From d9892cac12b99729763da8ea4e5aec86fda89caa Mon Sep 17 00:00:00 2001 From: Miguel Peixe Date: Wed, 14 Sep 2016 15:36:14 -0300 Subject: [PATCH] fix php error for admin-page-framework, update cartodb scripts versions, fix qtranslate support and update version --- README.md | 2 +- inc/admin/admin-page-framework.php | 1666 ++++++++++++++-------------- inc/core.php | 13 +- lib/cartodb.css | 4 +- lib/cartodb.js | 43 +- style.css | 2 +- 6 files changed, 867 insertions(+), 863 deletions(-) diff --git a/README.md b/README.md index 27b3a40..fe3d2f2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ #JEO -v1.0.6 +v1.0.7 JEO WordPress Theme acts as a geojournalism platform which allows news organizations, bloggers and NGOs to publish news stories as layers of information on digital maps. With JEO, creating the interaction between data layers and contextual information is much more intuitive and interactive. The theme is ready for multilingual content and facilitates the publishing tasks. diff --git a/inc/admin/admin-page-framework.php b/inc/admin/admin-page-framework.php index ad71664..da2652d 100644 --- a/inc/admin/admin-page-framework.php +++ b/inc/admin/admin-page-framework.php @@ -1,4 +1,4 @@ - 'options-general.php', 'network admin' => "network_admin_menu", ); - + // Default values public $strPageSlug = ''; // the extended class name will be assigned by default in the constructor but will be overwritten by the SetRootMenu() method. Must be public as referred from sub-classes. - public $strClassName = ''; // must be public as sub-classes refer to it. + public $strClassName = ''; // must be public as sub-classes refer to it. protected $strFormEncType = 'application/x-www-form-urlencoded'; protected $strCapability = 'manage_options'; // can be changed with SetCapability(). protected $strPageTitle = null; // the extended class name will be assigned. protected $strPathIcon16x16 = null; // set by the constructor and the SetMenuIcon() method. protected $numPosition = null; // this will be rarely used so put it aside until a good reason gets addressed to flexibly change it. protected $strOptionKey = null; // determins which key to use to store options in the database. - protected $numRootPages = 0; // stores the number of created root pages - protected $numSubPages = 0; // stores the number of created sub pages + protected $numRootPages = 0; // stores the number of created root pages + protected $numSubPages = 0; // stores the number of created sub pages protected $strThickBoxTitle = ''; // stores the media upload thick box's window title. protected $strThickBoxButtonUseThis = ''; // stores the media upload thick box's button label to insert the image. protected $strStyle = // the default css rules - '.updated, .settings-error { clear: both; } + '.updated, .settings-error { clear: both; } .category-check-list li { margin: 8px 0 8px 20px; } div.category-check-list { padding: 8px 0 8px 10px; @@ -126,107 +126,107 @@ class Admin_Page_Framework { } .category-check-list-label { margin-left: 0.5em; - }'; - protected $strScript = ''; // the default JavaScript + }'; + protected $strScript = ''; // the default JavaScript protected $strCallerPath; // stores the caller path which can be manually set by the user. If not set, the framework will try to set it. since 1.0.2.2 protected $strInPageTabTag = 'h3'; // stores the in-page tabs' tag. Default: h3. This can be set with SetInPageTabTag(). Added in 1.0.3. - + // for debugs // protected $numCalled = 0; // protected $arrCallbacks = array(); - + function __construct( $strOptionKey=null, $strCallerPath=null ){ - + /* - * $strOptionKey : Specifies the option key name to store in the option database table. + * $strOptionKey : Specifies the option key name to store in the option database table. * If this is set, all the options will be stored in an array to the key of this passed string. * $strCallerPath : used to retrieve the plugin ( if it's a plugin ) to retrieve the plugin data to auto-insert credit info into the footer. * */ - + // Objects $this->oUtil = new Admin_Page_Framework_Utilities; $this->oRedirect = new Admin_Page_Framework_Redirect( $this ); $this->oLink = new Admin_Page_Framework_Link( $this, $strCallerPath ); $this->oDebug = new Admin_Page_Framework_Debug; - + // Do not set the extended class name for this. It uses a page slug name if not set. $this->strClassName = get_class( $this ); - $this->strOptionKey = ( empty( $strOptionKey ) ) ? null : $strOptionKey; + $this->strOptionKey = ( empty( $strOptionKey ) ) ? null : $strOptionKey; $this->strPageTitle = ( !empty( $strOptionKey ) ) ? $strOptionKey : $this->strClassName; $this->strPageSlug = $this->strClassName; // will be invisible anyway - $this->strCallerPath = $strCallerPath; - + $this->strCallerPath = $strCallerPath; + // Schedule removing the root sub-menu because it will be just a duplicate item to the root label. add_action( 'admin_menu', array( $this, 'RemoveRootSubMenu' ), 999 ); - + // Disables the Settings API's admin notice. add_action( 'admin_menu', array( $this, 'DisableSettingsAPIAdminNotice' ), 999 ); - + // Hook the menu action - adds the menu items. add_action( 'admin_menu', array( $this, 'SetUp' ) ); - + // Hook the admin header to insert custom admin stylesheet. add_action( 'admin_head', array( $this, 'AddStyle' ) ); add_action( 'admin_head', array( $this, 'AddScript' ) ); // For the media uploader. - add_filter( 'gettext', array( $this, 'ReplaceThickBoxText' ) , 1, 2 ); - + add_filter( 'gettext', array( $this, 'ReplaceThickBoxText' ) , 1, 2 ); + // Create global filter hooks add_filter( $this->filter_global_head . $this->strClassName , array( $this, $this->filter_global_head . $this->strClassName ) ); add_filter( $this->filter_global_content . $this->strClassName , array( $this, $this->filter_global_content . $this->strClassName ) ); - add_filter( $this->filter_global_foot . $this->strClassName , array( $this, $this->filter_global_foot . $this->strClassName ) ); + add_filter( $this->filter_global_foot . $this->strClassName , array( $this, $this->filter_global_foot . $this->strClassName ) ); add_action( $this->do_global . $this->strClassName , array( $this, $this->do_global . $this->strClassName ) ); add_action( $this->do_global_before . $this->strClassName , array( $this, $this->do_global_before . $this->strClassName ) ); add_action( $this->do_global_after . $this->strClassName , array( $this, $this->do_global_after . $this->strClassName ) ); add_action( $this->prefix_do_form . $this->strClassName , array( $this, $this->prefix_do_form . $this->strClassName ) ); // since 1.0.2 - + // For earlier loading than $this->Setup add_action( $this->prefix_start . $this->strClassName , array( $this, $this->prefix_start . $this->strClassName ) ); - do_action( $this->prefix_start . $this->strClassName ); - - } + do_action( $this->prefix_start . $this->strClassName ); + + } /* Extensible Methods - should be customized in the extended class. */ protected function SetUp() { - + $this->CreateRootMenu( $this->strPageTitle ); - + } - + /* Front-End methods - the user may call it but it shoud not necessaliry be customized in the extended class. */ /* - * Add Links + * Add Links * */ protected function AddLinkToPluginDescription( $vLinks ) { - + $this->oLink->AddLinkToPluginDescription( $vLinks ); - + } protected function AddLinkToPluginTitle( $vLinks ) { - + $this->oLink->AddLinkToPluginTitle( $vLinks ); - + } - + /* * Add Menu and pages * */ protected function SetRootMenu( $strRootMenu, $strPathIcon16x16=null ) { - + $strRootMenu = trim( $strRootMenu ); - + // Check if it is one of the default menu. if ( array_key_exists( strtolower( $strRootMenu ) , $this->arrRootMenuSlugs ) ) { // do not use SetRootMenuBySlug since options-general contains a hyphen and it should not be converted to underscore. $this->strPageSlug = $this->arrRootMenuSlugs[ strtolower( $strRootMenu ) ]; return $this->strPageSlug; - + } // If it does not match the existent menus, use the class name as the slug name. @@ -234,75 +234,75 @@ protected function SetRootMenu( $strRootMenu, $strPathIcon16x16=null ) { $this->CreateRootMenu( $strRootMenu, $strPathIcon16x16 ); return $this->strPageSlug; - + } protected function SetRootMenuBySlug( $strSlug ) { - + $this->strPageSlug = $strSlug; - + } protected function ShowPageHeadingTabs( $bShowPageHeadingTabs ) { - + // Sets whether the tab in the top part of the page should be visible or not visible. True / False. $this->bShowPageHeadingTabs = $bShowPageHeadingTabs; - + } protected function SetRootMenuPosition( $numPosition ) { - - $this->numPosition = $numPosition; - + + $this->numPosition = $numPosition; + } protected function SetCapability( $strCapability ) { - + // Sets the access right to the menu. This also can be set in the constructor. $this->strCapability = $strCapability; - + // This lets the Settings API to allow the custom capability. The Settings API requires manage_options by default. - // the option_page_capability_{} filter is supported since WordPress 3.2 + // the option_page_capability_{} filter is supported since WordPress 3.2 add_filter( "option_page_capability_{$this->strPageSlug}", array( $this, 'GetCapability' ) ); } public function GetCapability( $strCapability ) { return $this->strCapability; - + } protected function SetMenuIcon( $strPathIcon16x16 ) { - + // Sets the menu icon. This also can be set in the constructor. $this->strPathIcon16x16 = $strPathIcon16x16; $this->arrIcons[ $this->strPageSlug ] = $strPathIcon16x16; - + } protected function HideInPageTab( $strSubPageSlug, $strTabSlug, $strAltTab='' ) { // since 1.0.2.1 - + // Hides the in-page tab link; the page will be still accessible by the direct url. // If $strAltTab is set, the given tab will be rendered as activated in stead of the hidden tab. - + $this->arrHiddenTabs[ $strSubPageSlug ][ $strTabSlug ] = $strAltTab; - + } protected function AddInPageTabs( $strSubPageSlug, $arrTabs ) { // Sanitize the slug strings in array keys. c.f. - => _ - $arrTabs = $this->oUtil->SanitizeArrayKeys( $arrTabs ); + $arrTabs = $this->oUtil->SanitizeArrayKeys( $arrTabs ); $strSubPageSlug = $this->oUtil->SanitizeSlug( $strSubPageSlug ); - + // Adds in-page tab, which does not have a menu. - $this->arrTabs[ $strSubPageSlug ] = $arrTabs; - + $this->arrTabs[ $strSubPageSlug ] = $arrTabs; + // add hooks for in-page tabs foreach ( $arrTabs as $strTabSlug => $strTabTitle ) { - + // filters add_filter( $this->prefix_content . $strSubPageSlug . '_' . $strTabSlug, array( $this, $this->prefix_content . $strSubPageSlug . '_' . $strTabSlug ) ); add_filter( $this->prefix_head . $strSubPageSlug . '_' . $strTabSlug, array( $this, $this->prefix_head . $strSubPageSlug . '_' . $strTabSlug ) ); - add_filter( $this->prefix_foot . $strSubPageSlug . '_' . $strTabSlug, array( $this, $this->prefix_foot . $strSubPageSlug . '_' . $strTabSlug ) ); - + add_filter( $this->prefix_foot . $strSubPageSlug . '_' . $strTabSlug, array( $this, $this->prefix_foot . $strSubPageSlug . '_' . $strTabSlug ) ); + // actions add_action( $this->prefix_do_before . $strSubPageSlug . '_' . $strTabSlug, array( $this, $this->prefix_do_before . $strSubPageSlug . '_' . $strTabSlug ) ); add_action( $this->prefix_do . $strSubPageSlug . '_' . $strTabSlug, array( $this, $this->prefix_do . $strSubPageSlug . '_' . $strTabSlug ) ); - add_action( $this->prefix_do_after . $strSubPageSlug . '_' . $strTabSlug, array( $this, $this->prefix_do_after . $strSubPageSlug . '_' . $strTabSlug ) ); + add_action( $this->prefix_do_after . $strSubPageSlug . '_' . $strTabSlug, array( $this, $this->prefix_do_after . $strSubPageSlug . '_' . $strTabSlug ) ); add_action( $this->prefix_do_form . $strSubPageSlug . '_' . $strTabSlug, array( $this, $this->prefix_do_form . $strSubPageSlug . '_' . $strTabSlug ) ); // since 1.0.2 } @@ -311,64 +311,64 @@ protected function AddInPageTabs( $strSubPageSlug, $arrTabs ) { protected function CreateRootMenu( $strTitle, $strPathIcon16x16=null ) { /* - + $strPathIcon16x16 = ( $strPathIcon16x16 ) ? $strPathIcon16x16 : $this->strPathIcon16x16; - add_menu_page( + add_menu_page( $this->strPageTitle, // Page title - will be invisible anyway - $strTitle, // Menu title + $strTitle, // Menu title $this->strCapability, // Capability - accsess right - $this->strPageSlug, // Menu ID - array( $this, $this->strPageSlug ), // Menu display function + $this->strPageSlug, // Menu ID + array( $this, $this->strPageSlug ), // Menu display function $strPathIcon16x16, // icon empty( $this->numPosition ) ? null : $this->numPosition // menu position ); - + // Store the page title and icon, and how many times a top level page has been created. $this->numRootPages++; $this->arrPageTitles[ $this->strPageSlug ] = trim( $this->strPageTitle ); $this->arrIcons[ $this->strPageSlug ] = $strPathIcon16x16; - - // Add a setting link in the plugin listing + + // Add a setting link in the plugin listing if ( $this->oLink->arrCallerInfo['type'] == 'plugin' ) add_filter( 'plugin_action_links_' . $this->oLink->GetCallerPluginBaseName() , array( $this->oLink, 'AddSettingsLinkInPluginListingPage' ) ); */ - - } + + } protected function AddSubMenu( $strSubTitle, $strPageSlug, $strPathIcon32x32=null, $strCapability=null ) { - + $strCapability = isset( $strCapability ) ? $strCapability : $this->strCapability; - + if ( ! current_user_can( $strCapability ) ) return; - + // add the sub-menu and sub-page $strPageSlug = $this->oUtil->SanitizeSlug( $strPageSlug ); // - => _, . => _ - add_theme_page( + add_theme_page( $strSubTitle // $page_title , $strSubTitle // $menu_title , $strCapability // $strCapability , $strPageSlug // $menu_slug , array( $this, $strPageSlug ) // triggers the __Call method with the method name of this slug. - ); - + ); + // Set the default page link so that it can be referred from the methods which add the link to the page including AddSettingsLinkInPluginListingPage() if ( $this->numRootPages == 1 && $this->numSubPages == 0 ) // means only the single root menu has been added so far $this->oLink->SetDefaultPageSlug( $strPageSlug ); - + if ( $this->numRootPages == 0 && $this->numSubPages == 0 ) { // means that this is the first time adding a page and it belongs to an existent page. - - // Add a setting link in the plugin listing + + // Add a setting link in the plugin listing $this->oLink->SetDefaultPageSlug( $strPageSlug ); // $this->strPageSlug should have been assigned the top level menu slug in SetRootMenu(). if ( $this->oLink->arrCallerInfo['type'] == 'plugin' ) add_filter( 'plugin_action_links_' . $this->oLink->GetCallerPluginBaseName() , array( $this->oLink, 'AddSettingsLinkInPluginListingPage' ) ); - - } + + } // Store the page title and icon $this->numSubPages++; $this->arrPageTitles[ $strPageSlug ] = trim( $strSubTitle ); $this->arrIcons[ $strPageSlug ] = $strPathIcon32x32; // if it is not set, screen_icon() will be used. - + // hook the filters for the page output add_filter( $this->prefix_content . $strPageSlug , array( $this, $this->prefix_content . $strPageSlug ) ); add_filter( $this->prefix_head . $strPageSlug , array( $this, $this->prefix_head . $strPageSlug ) ); @@ -377,40 +377,40 @@ protected function AddSubMenu( $strSubTitle, $strPageSlug, $strPathIcon32x32=nul add_action( $this->prefix_do_before . $strPageSlug , array( $this, $this->prefix_do_before . $strPageSlug ) ); add_action( $this->prefix_do_after . $strPageSlug , array( $this, $this->prefix_do_after . $strPageSlug ) ); add_action( $this->prefix_do_form . $strPageSlug , array( $this, $this->prefix_do_form . $strPageSlug ) ); // since 1.0.2 - + if ( ! $this->IsPageRegisterable( $strPageSlug ) ) return; - + $strOptionName = ( empty( $this->strOptionKey ) ) ? $strPageSlug : $this->strOptionKey; - register_setting( + register_setting( $this->strClassName, // the caller class name to be the option group name. $strOptionName, // the option key name stored in the option table in the database. - array( $this, $this->prefix_validation . 'pre_' . $strPageSlug ) // validation method - ); - + array( $this, $this->prefix_validation . 'pre_' . $strPageSlug ) // validation method + ); + } protected function AddFormSections( $arrSections ) { - + /* * Adds Form Section for Settings API for pages created with this class. - * Slug name must be consist of alphabets and underscores. - * + * Slug name must be consist of alphabets and underscores. + * e.g. root dimension: numeric keys, second dimension: must have 'id' and 'title' keys. The 'description' key is optional. - $arrSections = - array( + $arrSections = + array( array( 'pageslug'=>, 'my_first_page', 'id' => 'pageslug_section_a', 'title' => 'Section A', 'description' => 'This is Section A.' ), array( 'pageslug'=>, 'my_first_page', 'id' => 'pageslug_section_b', 'title' => 'Section B' ), ); - */ - + */ + foreach( ( array ) $arrSections as $index => $arrSection ) { - + // These slugs specify where this section belongs but the used characters have to be sanitized (without dots and hypens) for the callback functions. - // Therefore, it is not possible to support pages using dots and hyphens. That means only pages created by this class should be the ones specified by + // Therefore, it is not possible to support pages using dots and hyphens. That means only pages created by this class should be the ones specified by // this method. - + // Set keys in case some are not set - this prevents PHP invalid (undefined) index warnings - $arrSection = ( array ) $arrSection + array( + $arrSection = ( array ) $arrSection + array( 'pageslug' => null, 'tabslug' => null, 'title' => null, @@ -421,140 +421,140 @@ protected function AddFormSections( $arrSections ) { 'if' => true, // since 1.0.4.1 ); - $arrSection['pageslug'] = $this->oUtil->SanitizeSlug( $arrSection['pageslug'] ); + $arrSection['pageslug'] = $this->oUtil->SanitizeSlug( $arrSection['pageslug'] ); $arrSection['tabslug'] = $this->oUtil->SanitizeSlug( $arrSection['tabslug'] ); - + // If the page slug does not match the current loading page, there is no need to register form sections and fields. $strCurrentPageSlug = isset( $_GET['page'] ) ? $_GET['page'] : null; - if ( !$strCurrentPageSlug || (string) $strCurrentPageSlug !== (string) $arrSection['pageslug'] ) continue; - + if ( !$strCurrentPageSlug || (string) $strCurrentPageSlug !== (string) $arrSection['pageslug'] ) continue; + // If the tab slug is specified, determine if the current page is the default tab or the current tab matches the given tab slug. - if ( !$this->IsTabSpecifiedForFormSection( $arrSection ) ) continue; + if ( !$this->IsTabSpecifiedForFormSection( $arrSection ) ) continue; // If the custom condition is set and it's not true, skip, if ( $arrSection['if'] !== true ) continue; - + // If the access level is set and it is not sufficient, skip. if ( isset( $arrSection['capability'] ) && ! current_user_can( $arrSection['capability'] ) ) continue; // since 1.0.2.1 - + // Store the registered sections internally in the class object. - $this->arrSections[ $arrSection['id'] ] = array( + $this->arrSections[ $arrSection['id'] ] = array( 'title' => $arrSection['title'], 'pageslug' => $arrSection['pageslug'], 'description' => $arrSection['description'] ); - + // Add the given section - add_settings_section( + add_settings_section( $arrSection['id'], "" . $arrSection['title'], // insert the anchor in front of the title. array( $this, $this->prefix_section . 'pre_' . $arrSection['id'] ), // callback function - $arrSection['pageslug'] + $arrSection['pageslug'] ); - + // Add the given form fields - if ( is_array( $arrSection['fields'] ) ) - $this->AddFormFields( + if ( is_array( $arrSection['fields'] ) ) + $this->AddFormFields( $arrSection['pageslug'], $arrSection['id'], $arrSection['fields'] - ); - + ); + } } /* Back-end methods - the user may not use these method unless they know what they are doing and what these methods do. - */ - + */ + function IsTabSpecifiedForFormSection( $arrSection ) { - - // Determine: + + // Determine: // 1. if the current page is the default tab. Yes -> the section should be registered. // 2. if the current tab matches the given tab slug. Yes -> the section should be registered. - - // If the $_GET['tab'] is not set and the page slug is stored in the tab array, + + // If the $_GET['tab'] is not set and the page slug is stored in the tab array, // consider the default tab which should be loaded without the tab query value in the url if ( !isset( $_GET['tab'] ) && isset( $this->arrTabs[$arrSection['pageslug']] ) ) { - + // Get the first element stored in the $this->arrTabs[$strPageSlug] array foreach ( $this->arrTabs[$arrSection['pageslug']] as $strTabSlug => $strTabTitle ) { - $strDefaultTabSlug = $strTabSlug; + $strDefaultTabSlug = $strTabSlug; break; } - if ( (string) $strDefaultTabSlug === (string) $arrSection['tabslug'] ) return true; // should be registered. + if ( (string) $strDefaultTabSlug === (string) $arrSection['tabslug'] ) return true; // should be registered. } - + // If the checking tab slug and the current loading tab slug is the same, it should be registered. $strCurrentTab = isset( $_GET['tab'] ) ? $_GET['tab'] : null; if ( (string) $arrSection['tabslug'] === (string) $strCurrentTab ) return true; - - } + + } protected function SetFormEncType( $strEncType="application/x-www-form-urlencoded" ) { - - // Sets the form tag attribute of enctype. + + // Sets the form tag attribute of enctype. // Set one of the followings: application/x-www-form-urlencoded, multipart/form-data, text/plain $this->strFormEncType = $strEncType; - + } protected function IsPageRegisterable( $strPageSlug ) { // since 1.0.4 - + /* * Check if the current loading page has the passed page slug. If not, it returns false. * However, if it's options.php and the sent $_POST pageslug key matches the passed page slug, it returns true * , which the field/section ( for Settings API ) should be registered. */ - - + + // If this is a Settings API loading page behind the scene, which is options.php, do not register unnecessary callbacks. global $pagenow; - if ( $pagenow == 'options.php' && isset( $_POST['pageslug'] ) && $_POST['pageslug'] == $strPageSlug ) return true; - + if ( $pagenow == 'options.php' && isset( $_POST['pageslug'] ) && $_POST['pageslug'] == $strPageSlug ) return true; + if ( ! isset( $_GET['page'] ) ) return false; - - // If this adding page is not the current loading page, there is no need to register the setting for Settings API. - // Skipping the registration will help eliminate unnecessary validation callbacks. + + // If this adding page is not the current loading page, there is no need to register the setting for Settings API. + // Skipping the registration will help eliminate unnecessary validation callbacks. if ( $_GET['page'] == $strPageSlug ) return true; - + return false; - + } protected function AddFormFields( $strPageSlug, $strSectionID, &$arrFields ) { - + /* e.g. root dimension: numeric keys, second dimension: must have 'id' and 'title' keys. $arrFields = array( array( 'id' => 'section_a_field_a', 'title' => 'Option A' ), array( 'id' => 'section_a_field_b', 'title' => 'Option B' ) ); */ - + if ( ! $this->IsPageRegisterable( $strPageSlug ) ) return; - + $strPageSlug = $this->oUtil->SanitizeSlug( $strPageSlug ); // - => _, . => _ foreach( ( array ) $arrFields as $index => $arrField ) { - + // The id and type keys are mandatory. - if ( !isset( $arrField['id'] ) || !isset( $arrField['type'] ) ) continue; - + if ( !isset( $arrField['id'] ) || !isset( $arrField['type'] ) ) continue; + // If the access level is not sufficient, skip. if ( isset( $arrField['capability'] ) && ! current_user_can( $arrField['capability'] ) ) continue; // since 1.0.2.1 - + // If a custom condition is set and it's not true, skip - since 1.0.4.1 $arrField = $arrField + array( 'if' => true ); // avoid undefined index warnings. if ( $arrField['if'] !== true ) continue; - + // Sanitize the id since it is used as a callback method name. $arrField['id'] = $this->oUtil->SanitizeSlug( $arrField['id'] ); - + // If the input type is specified to file, set the enctype to 'multipart/form-data' if ( in_array( $arrField['type'], array( 'file', 'import', 'image' ) ) ) $this->strFormEncType = 'multipart/form-data'; if ( $arrField['type'] == 'image' ) { - + // These two hooks should be enabled when the image field type is added in the field array. $this->strThickBoxTitle = isset( $arrField['label']['title'] ) ? $arrField['label']['title'] : __( 'Upload Image', 'admin-page-framework' ); - $this->strThickBoxButtonUseThis = isset( $arrField['label']['insert'] ) ? $arrField['label']['insert'] : __( 'Use This Image', 'admin-page-framework' ); - add_action( 'admin_enqueue_scripts', array( $this, 'EnqueUploaderScripts' ) ); // called later than the admin_menu hook - + $this->strThickBoxButtonUseThis = isset( $arrField['label']['insert'] ) ? $arrField['label']['insert'] : __( 'Use This Image', 'admin-page-framework' ); + add_action( 'admin_enqueue_scripts', array( $this, 'EnqueUploaderScripts' ) ); // called later than the admin_menu hook + // Append the script $strFieldID = $arrField['id']; $strPreviewCSSRule = '{display:inline, border: none, max-width:100%}'; @@ -582,52 +582,52 @@ protected function AddFormFields( $strPageSlug, $strSectionID, &$arrFields ) { tb_remove(); // close the thickbox $( '#update_preview_' + field_id + ' img' ).attr( 'src',image_url ); // updates the preview image $( '#update_preview_' + field_id + ' img' ).show() //( 'style','display: inline; border: none; max-width: 100%;' ); // updates the visibility - // $( '.submit_options_form' ).trigger( 'click' ); // presses the form button + // $( '.submit_options_form' ).trigger( 'click' ); // presses the form button } });"; - } - + } + // Store the registered field internally in the class object. $arrField = $arrField + array( 'title' => '', 'description' => '', ); - $this->arrFields[ $arrField['id'] ] = $arrField + array( - 'field_title' => $arrField['title'], + $this->arrFields[ $arrField['id'] ] = $arrField + array( + 'field_title' => $arrField['title'], 'page_slug' => $strPageSlug, 'field_ID' => $arrField['id'], 'section_ID' => $strSectionID, - ); - - add_settings_field( + ); + + add_settings_field( $arrField['id'], '' . $arrField['title'] . '', array( $this, $this->prefix_field . 'pre_' . $arrField['id'] ), // callback function - will trigger the __call() magic method and be redirected to the RenderFormField() method. $strPageSlug, $strSectionID, - $this->arrFields[ $arrField['id'] ] - ); + $this->arrFields[ $arrField['id'] ] + ); } - } + } public function RemoveRootSubMenu() { - + remove_submenu_page( $this->strClassName, $this->strClassName ); - + } protected function EnableSettingsAPIAdminNotice( $bEnable=true ) { // since 1.0.3.2 - - // Sets the flag so that the below DisableSettingsAPIAdminNotice() will / will not perform deleting the Settings API's notification messages. + + // Sets the flag so that the below DisableSettingsAPIAdminNotice() will / will not perform deleting the Settings API's notification messages. $this->bUseOwnSettingsErrors = ! $bEnable; - + } public function DisableSettingsAPIAdminNotice() { // since 1.0.3.2 - + // Remove the Settings API's settings error. // Prevent the Settings API from automatically displaying the default update notice. if ( $this->bUseOwnSettingsErrors && isset( $_GET['page'] ) && array_key_exists( $_GET['page'] , $this->arrPageTitles ) ) - delete_transient( 'settings_errors' ); - + delete_transient( 'settings_errors' ); + } /* * Settings API Related @@ -638,12 +638,12 @@ function RenderSectionDescription( $strMethodName ) { $strSectionID = substr( $strMethodName, strlen( $this->prefix_section ) + 4 ); // section_pre_X if ( !isset( $this->arrSections[ $strSectionID ] ) ) return; // if it is not added $strDescription = '

' . $this->arrSections[ $strSectionID ]['description'] . '

'; - - echo $this->AddAndApplyFilter( + + echo $this->AddAndApplyFilter( $this->prefix_section . $strSectionID, - $strDescription, // the p-tagged description string + $strDescription, // the p-tagged description string $this->arrSections[ $strSectionID ]['description'] // the original description - ); + ); } function RenderFormField( $strMethodName, &$arrField ) { @@ -654,27 +654,27 @@ function RenderFormField( $strMethodName, &$arrField ) { $oFields = new Admin_Page_Framework_Input_Filed_Types( $arrField, $this->strOptionKey, $this->strClassName ); $strOutput = $oFields->GetInputField( $arrField['type'] ); - + // Render the input field - echo $this->AddAndApplyFilter( - $this->prefix_field . $arrField['field_ID'], + echo $this->AddAndApplyFilter( + $this->prefix_field . $arrField['field_ID'], $strOutput, $arrField ); } function MergeOptionArray( $strMethodName, $arrInput ) { - + // Check if the $_POST __href key set, with a submit button, and if it's set, redirect to the specified given page. if ( isset( $_POST['__href'] ) ) $this->oRedirect->CheckHrefRedirect( $_POST['__href'] ); - + // For debug - // $this->numCalled++; - // $this->arrCallbacks[$strMethodName] = $_POST['pageslug']; + // $this->numCalled++; + // $this->arrCallbacks[$strMethodName] = $_POST['pageslug']; // $strMethodName is made up of validation_pre + page slug $strPageSlug = substr( $strMethodName, strlen( $this->prefix_validation ) + 4 ); - + // Do not cast array. Check it manually since a casted array will have the index of 0 and will add it when it is merged. $arrOriginal = get_option( empty( $this->strOptionKey ) ? $strPageSlug : $this->strOptionKey ); @@ -684,12 +684,12 @@ function MergeOptionArray( $strMethodName, $arrInput ) { if ( $_POST['pageslug'] != $strPageSlug ) return ( array ) $arrOriginal; // Copy the original array to be used by Import and Export later on. - $arrOriginalIntact = $arrOriginal; - + $arrOriginalIntact = $arrOriginal; + // For Debug // $strOptionKeySet = empty( $this->strOptionKey ) ? 'No' : 'Yes'; - // $this->AddSettingsError( 'import_error', - // 'debug', + // $this->AddSettingsError( 'import_error', + // 'debug', // '

Submitted Values

' . // '

$arrKeys

' . $this->DumpArray( $arrKeys ) . '' . // '

Has Deleted?

' . $bDeleted . '
' . @@ -701,54 +701,54 @@ function MergeOptionArray( $strMethodName, $arrInput ) { // '

Registered Sections (to Settings API)

' . $this->DumpArray( $this->arrSections ) . // <-- does not work beacause the validation callback is triggered in a diffeprent page load // '

Called methods

' . $this->DumpArray( $this->arrCallbacks ) . // '

Passed Data - $arrInput

' . $this->DumpArray( $arrInput ) . - // '

Submitted Data - $_POST

' . $this->DumpArray( $_POST ) . + // '

Submitted Data - $_POST

' . $this->DumpArray( $_POST ) . // '

Currently Saved Data - $arrOptions

' . $this->DumpArray( $arrOptions ), // 'updated' - // ); + // ); // $this->DumpArray( $_POST, dirname( __FILE__ ) . '/info.txt' ); - + // If the passed value is explicitly set to null, it means the user has chosen to discard the options. if ( is_null( $arrInput ) && ! isset( $_POST['__import']['submit'] ) && ! isset( $_POST['__export']['submit'] ) ) return null; - + // Sanitize values - $arrInput could be passed as null $arrInput = ( array ) $arrInput; - + /* * For the custom field type, image * */ if ( isset( $_POST['__image_unset']['id'] ) ) { - + // Get the field ID foreach( $_POST['__image_unset']['id'] as $strFieldID => $strButtonLabel ) { $strID = $strFieldID; break; - } - + } + // Remove the data from the option in the database. $arrKeys = explode("|", $_POST['__image_unset']['option_key'][$strID]); - if ( count( $arrKeys ) == 4 ) { // it should be either 4 or 5. + if ( count( $arrKeys ) == 4 ) { // it should be either 4 or 5. unset( $arrInput[$arrKeys[1]][$arrKeys[2]][$arrKeys[3]] ); // page slug[section id][field id][imageurl] unset( $arrOriginal[$arrKeys[1]][$arrKeys[2]][$arrKeys[3]] ); // page slug[section id][field id][imageurl] } else { unset( $arrInput[$arrKeys[1]][$arrKeys[2]][$arrKeys[3]][$arrKeys[4]] ); // option key[page slug][section id][field id][imageurl] unset( $arrOriginal[$arrKeys[1]][$arrKeys[2]][$arrKeys[3]][$arrKeys[4]] ); // option key[page slug][section id][field id][imageurl] - } - + } + } if ( isset( $_POST['__image_delete']['id'] ) ) { - + // Remove the file from the server. foreach( $_POST['__image_delete']['id'] as $strFieldID => $strButtonLabel ) { $strURL = $_POST['__image_delete']['imageurl'][$strFieldID]; - $this->DeleteFileFromMediaLibraryByURL( $strURL ); + $this->DeleteFileFromMediaLibraryByURL( $strURL ); $strID = $strFieldID; break; } - + // Remove the data from the option in the database. $arrKeys = explode( "|", $_POST['__image_delete']['option_key'][ $strID ] ); - if ( count( $arrKeys ) == 4 ) { // it should be either 4 or 5. + if ( count( $arrKeys ) == 4 ) { // it should be either 4 or 5. unset( $arrInput[$arrKeys[1]][$arrKeys[2]][$arrKeys[3]] ); // page slug[section id][field id][imageurl] unset( $arrOriginal[$arrKeys[1]][$arrKeys[2]][$arrKeys[3]] ); // page slug[section id][field id][imageurl] } else { @@ -756,65 +756,65 @@ function MergeOptionArray( $strMethodName, $arrInput ) { unset( $arrOriginal[$arrKeys[1]][$arrKeys[2]][$arrKeys[3]][$arrKeys[4]] ); // option key[page slug][section id][field id][imageurl] } $bDeleted = true; - + } - + // For in-page tabs - if ( isset( $_POST['tabslug'] ) && ! empty( $_POST['tabslug'] ) ) - $arrInput = $this->AddAndApplyFilter( - $this->prefix_validation . $strPageSlug . '_' . $_POST['tabslug'], - $arrInput - ); + if ( isset( $_POST['tabslug'] ) && ! empty( $_POST['tabslug'] ) ) + $arrInput = $this->AddAndApplyFilter( + $this->prefix_validation . $strPageSlug . '_' . $_POST['tabslug'], + $arrInput + ); // For pages. // Do not cast array here either. Let the validation callback return non-array and make it consider as deleting the option. - $arrInput = $this->AddAndApplyFilter( $this->prefix_validation . $strPageSlug, $arrInput ); + $arrInput = $this->AddAndApplyFilter( $this->prefix_validation . $strPageSlug, $arrInput ); /* * For the custom field types, import and export - this must be done after applying the validation filters for pages and tabs to allow to set transients. * */ // Check if the import file is sent. If so, do not continue and return. - if ( isset( $_POST['__import']['submit'] ) && !$this->bIsImported ) + if ( isset( $_POST['__import']['submit'] ) && !$this->bIsImported ) return $this->ImportOptions( $_POST['__import'] + $_FILES['__import'], $arrOriginalIntact ); // if it fails, it returns back the original array // Check if the export button is pressed. If so, do not continue and return. if ( isset( $_POST['__export']['submit'] ) ) { - - $bIsExported = $this->ProcessExportOptions( $_POST['__export'], $arrOriginalIntact ); + + $bIsExported = $this->ProcessExportOptions( $_POST['__export'], $arrOriginalIntact ); if ( $bIsExported ) exit; } - + /* * Return the array to save into the option database table. * */ // return ( is_array( $arrOriginal ) && is_array( $arrInput ) ) ? wp_parse_args( $arrInput, $arrOriginal ) : $arrInput; // <-- causes the settings get cleared in other pages // return ( is_array( $arrOriginal ) && is_array( $arrInput ) ) ? array_replace_recursive( $arrOriginal, $arrInput ) : $arrInput; // <-- incompatible with PHP below 5.3 return ( is_array( $arrOriginal ) && is_array( $arrInput ) ) ? $this->oUtil->UniteArraysRecursive( $arrInput, $arrOriginal ) : $arrInput; // merge them so that options saved in the other page slug keys will be saved as well. - + } /* * The magic method. * */ - function __Call( $strMethodName, $arrArgs=null ) { - + function __Call( $strMethodName, $arrArgs=null ) { + /* * Undefined but called by the callback methods automatically inserted by the class will trigger this magic method, __call. * So determine which call back method triggered this and if nothing found, do nothing. * */ - + // Variables // the currently loading in-page tab slug. Careful that not all cases $strMethodName have the page slug. - $strTabSlug = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->GetDefaultTabSlug( $strMethodName ); - + $strTabSlug = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->GetDefaultTabSlug( $strMethodName ); + // For style filters, "style_" + page slug ( + _ + tab slug ) - if ( substr( $strMethodName, 0, strlen( $this->prefix_style ) ) == $this->prefix_style ) return $arrArgs[0]; - if ( substr( $strMethodName, 0, strlen( $this->prefix_script ) ) == $this->prefix_script ) return $arrArgs[0]; - + if ( substr( $strMethodName, 0, strlen( $this->prefix_style ) ) == $this->prefix_style ) return $arrArgs[0]; + if ( substr( $strMethodName, 0, strlen( $this->prefix_script ) ) == $this->prefix_script ) return $arrArgs[0]; + // For export an import filters, "export_" ... if ( substr( $strMethodName, 0, strlen( $this->prefix_import ) ) == $this->prefix_import ) return $arrArgs[0]; // since 1.0.2 if ( substr( $strMethodName, 0, strlen( $this->prefix_export ) ) == $this->prefix_export ) return $arrArgs[0]; // since 1.0.2 - + // If it is the filter and action method that is not defined, do nothing. if ( substr( $strMethodName, 0, strlen( $this->prefix_do_before ) ) == $this->prefix_do_before ) return; // do_before_X if ( substr( $strMethodName, 0, strlen( $this->prefix_do_after ) ) == $this->prefix_do_after ) return; // do_after_X @@ -837,74 +837,74 @@ function __Call( $strMethodName, $arrArgs=null ) { // If it is the validation callback method, if ( substr( $strMethodName, 0, strlen( $this->prefix_validation ) + 4 ) == $this->prefix_validation . 'pre_' ) return $this->MergeOptionArray( $strMethodName, $arrArgs[0] ); // $strMethodName does not contain the page slug if ( substr( $strMethodName, 0, strlen( $this->prefix_validation ) ) == $this->prefix_validation ) return $arrArgs[0]; - + // If it is the field pre callback method, call the RenderFormField() method and if it is an undefined field_X() method, return the passed value. if ( substr( $strMethodName, 0, strlen( $this->prefix_field ) + 4 ) == $this->prefix_field . 'pre_' ) return $this->RenderFormField( $strMethodName, $arrArgs[0] ); // field_pre_ if ( substr( $strMethodName, 0, strlen( $this->prefix_field ) ) == $this->prefix_field ) return $arrArgs[0]; // field_ // If it is the section pre callback method, call the RenderSectionDescription() method and if it is an undefined section_X() method, return the passed value. if ( substr( $strMethodName, 0, strlen( $this->prefix_section ) + 4 ) == $this->prefix_section . 'pre_' ) return $this->RenderSectionDescription( $strMethodName ); // section_pre_ - if ( substr( $strMethodName, 0, strlen( $this->prefix_section ) ) == $this->prefix_section ) return $arrArgs[0]; // section_ + if ( substr( $strMethodName, 0, strlen( $this->prefix_section ) ) == $this->prefix_section ) return $arrArgs[0]; // section_ // The callback of add_submenu_page() - render the page contents. if ( isset( $_GET['page'] ) && $_GET['page'] == $strMethodName ) $this->RenderPage( $strMethodName, $strTabSlug ); - + } protected function RemoveValidationCallbacksExcept( $strPageSlug ) { - - // Removes the Settings API validation callbacks except for the given page. + + // Removes the Settings API validation callbacks except for the given page. // Returns an array holding the results with the key of the callback method and the value of True/False. // True to be removed; otherwise, False. - + $arrRemoved = array(); foreach ( $this->arrPageTitles as $strStoredPageSlug => $strStoredPageTitle ) { $strOptionName = ( empty( $this->strOptionKey ) ) ? $strStoredPageSlug : $this->strOptionKey; $strValidationMethodName = $this->prefix_validation . 'pre_' . $strStoredPageSlug; $arrRemoved[ $strValidationMethodName ] = 0; - if ( $strStoredPageSlug == $strPageSlug ) continue; + if ( $strStoredPageSlug == $strPageSlug ) continue; $arrRemoved[ $strValidationMethodName ] = remove_filter( "sanitize_option_{$strOptionName}", array( $this, $strValidationMethodName ) ); - } + } return $arrRemoved; - + } protected function RenderPage( $strPageSlug, $strTabSlug=null ) { - + // This helps to prevent multiple validation callbacks for the case that the user sets custom option key. - $this->RemoveValidationCallbacksExcept( $strPageSlug ); + $this->RemoveValidationCallbacksExcept( $strPageSlug ); // variables $strHeader = ''; - + // Do actions before rendering the page. In this order, global -> page -> in-page tab do_action( $this->do_global_before . $this->strClassName ); do_action( $this->prefix_do_before . $strPageSlug ); do_action( $this->prefix_do_before . $strPageSlug . '_' . $strTabSlug); ?>
- arrIcons[$strPageSlug] ? '

' : get_screen_icon(); - + // Page heading tabs $strHeader .= ( $this->bShowPageHeadingTabs ) ? $this->AddPageHeadingTabs( $strPageSlug ) : '

' . $this->arrPageTitles[$strPageSlug] . '

'; // in-page tabs if ( isset( $this->arrTabs[$strPageSlug] ) ) $strHeader .= $this->GetInPageTabs( $strPageSlug, $this->strInPageTabTag ); - + // Apply filters in this order, in-page tab -> page -> global. $strHeader = apply_filters( $this->prefix_head . $strPageSlug . '_' . $strTabSlug, $strHeader ); $strHeader = apply_filters( $this->prefix_head . $strPageSlug, $strHeader ); echo apply_filters( $this->filter_global_head . $this->strClassName, $strHeader ); - + ?>
ShowSettingsErrors(); - + // do custom actions - since 1.0.2 do_action( $this->prefix_do_form . $this->strClassName ); do_action( $this->prefix_do_form . $strPageSlug ); @@ -912,20 +912,20 @@ protected function RenderPage( $strPageSlug, $strTabSlug=null ) { // Capture the output buffer ob_start(); // start buffer - + // Render the form elements by Settings API settings_fields( $this->strClassName ); - do_settings_sections( $strPageSlug ); - + do_settings_sections( $strPageSlug ); + $strContent = ob_get_contents(); // assign buffer contents to variable ob_end_clean(); // end buffer and remove buffer contents - - // Render custom contents + + // Render custom contents // Apply filters in this order, in-page tab -> page -> global. $strContent = apply_filters( $this->prefix_content . $strPageSlug . '_' . $strTabSlug, $strContent ); $strContent = apply_filters( $this->prefix_content . $strPageSlug, $strContent ); echo apply_filters( $this->filter_global_content . $this->strClassName, $strContent ); - + // Do custom actions do_action( $this->do_global . $this->strClassName ); do_action( $this->prefix_do . $strPageSlug ); @@ -933,89 +933,89 @@ protected function RenderPage( $strPageSlug, $strTabSlug=null ) { ?> -
+
- prefix_foot . $strPageSlug . '_' . $strTabSlug , '' ); - $strFoot = apply_filters( $this->prefix_foot . $strPageSlug, $strFoot ); + prefix_foot . $strPageSlug . '_' . $strTabSlug , '' ); + $strFoot = apply_filters( $this->prefix_foot . $strPageSlug, $strFoot ); echo apply_filters( $this->filter_global_foot . $this->strClassName, $strFoot ); ?>
do_global_after . $this->strClassName ); - do_action( $this->prefix_do_after . $strPageSlug ); - do_action( $this->prefix_do_after . $strPageSlug . '_' . $strTabSlug ); - + do_action( $this->do_global_after . $this->strClassName ); + do_action( $this->prefix_do_after . $strPageSlug ); + do_action( $this->prefix_do_after . $strPageSlug . '_' . $strTabSlug ); + // Clean up $this->DeleteFieldErrors( $strPageSlug ); - + } protected function DeleteFieldErrors( $strPageSlug ) { // since 1.0.3 // Deletes the field error transient delete_transient( md5( get_class( $this ) . '_' . $strPageSlug ) ); // delete the temporary data for errors. - - } + + } protected function SetFieldErrors( $arrErrors, $strID=null, $numSavingDuration=300 ) { // since 1.0.3 - + // Saves the given array in a temporary area of the option database table. // $strID should be the page slug of the page that has the dealing form filed. // $arrErrors should be constructed as the $_POST array submitted to the Settings API. // $numSavingDuration is 300 by default which is 5 minutes ( 60 seconds * 5 ). - + // We use the page slug as the id as the redirect key for the submit button refers to the error array with the page slug. - $strID = isset( $strID ) ? $strID : ( isset( $_POST['pageslug'] ) ? $_POST['pageslug'] : ( isset( $_GET['page'] ) ? $_GET['page'] : $this->strClassName ) ); - + $strID = isset( $strID ) ? $strID : ( isset( $_POST['pageslug'] ) ? $_POST['pageslug'] : ( isset( $_GET['page'] ) ? $_GET['page'] : $this->strClassName ) ); + // Store the error array in the transient with the name of a MD5 hash string that consists of the extended class name + _ + page slug. set_transient( md5( get_class( $this ) . '_' . $strID ), $arrErrors, $numSavingDuration ); // store it for 5 minutes ( 60 seconds * 5 ) - - } + + } protected function SetSettingsNotice( $strMsg, $strType='error', $strID=null ) { // since 1.0.4 // An alternative to the below AddSettingsError() method as the first parameter is sort of redundant. - + $strID = isset( $strID ) ? $strID : $this->oDebug->GetLastCallerFunc( __FUNCTION__ ); - + $this->AddSettingsError( $strID, $strMsg, $strType ); - - } + + } protected function AddSettingsError( $strID, $strMsg, $strType='error' ) { // since 1.0.3 - + // An alternative to add_settings_error() which causes multiple duplicate message to appear. - + $strTransientKey = md5( 'SettingsErrors_' . get_class( $this ) . '_' . $this->strPageSlug ); $arrSettingsErrors = ( array ) get_transient( $strTransientKey ); $strID = $this->oUtil->SanitizeString( $strID ); $arrSettingsErrors[ $strID ] = array( 'message' => $strMsg, - 'type' => $strType, + 'type' => $strType, ); set_transient( $strTransientKey, $arrSettingsErrors, 60*5 ); // for 5 minutes } protected function ShowSettingsErrors() { // since 1.0.3 - + // Alternative to settings_errors() // Displays the set settings error/notification messages set with AddSettingsError(). // Prevent multiple calls if ( $this->bLoadedSettingsErrors ) return; $this->bLoadedSettingsErrors = true; - + $strTransientKey = md5( 'SettingsErrors_' . get_class( $this ) . '_' . $this->strPageSlug ); $arrSettingsErrors = ( array ) get_transient( $strTransientKey ); // since it's a casted array, the 0 key will be assigened and empty() does not return true // empty( $arrSettingsErrors ) will not return true for array( 0 => null ) - if ( count( $arrSettingsErrors ) == 1 && isset( $arrSettingsErrors[0] ) && ! $arrSettingsErrors[0] ) { - + if ( count( $arrSettingsErrors ) == 1 && isset( $arrSettingsErrors[0] ) && ! $arrSettingsErrors[0] ) { + if ( isset( $_GET['settings-updated'] ) && $_GET['settings-updated'] ) echo '

' . __( 'Options have been updated.', 'admin-page-framework' ) . '

'; - + return; - - } - + + } + $strOutput = ''; foreach ( $arrSettingsErrors as $strID => $arrError ) { $strCSSID = 'setting-error-' . $strID; @@ -1024,98 +1024,98 @@ protected function ShowSettingsErrors() { // since 1.0.3 $strOutput .= "

{$arrError['message']}

"; $strOutput .= " \n"; } - echo $strOutput; + echo $strOutput; delete_transient( $strTransientKey ); - - } + + } function GetDefaultTabSlug( $strPageSlug ) { - + // retrieves the default in-page tab slug for the page. // if in-page tab is not added at all, returns nothing. if ( !IsSet( $this->arrTabs[$strPageSlug] ) ) return null; - - // means it's set, returns the first item - foreach ( $this->arrTabs[$strPageSlug] as $strTabSlug => $strTabTitle ) + + // means it's set, returns the first item + foreach ( $this->arrTabs[$strPageSlug] as $strTabSlug => $strTabTitle ) return $strTabSlug; // no need to iterate all, only the first one, which is the default - + } function GetCurrentSlug() { // <-- might not be used anymore; I forgot what this was for. - + return isset( $_GET['page'] ) ? trim( $_GET['page'] ) : $this->strPageSlug; - + } function AddPageHeadingTabs( $strCurrentSlug ) { - + $strHeadingTabs = '
'; + $strHeadingTabs .= ''; return $strHeadingTabs; - + } // end of tab menu protected function SetInPageTabTag( $strHeadingTag='h3' ) { // since 1.0.3 - - $this->strInPageTabTag = $strHeadingTag; - + + $this->strInPageTabTag = $strHeadingTag; + } protected function GetInPageTabs( $strCurrentPageSlug, $strHeadingTag='h3' ) { - + $strCurrentPageSlug = $this->oUtil->SanitizeSlug( $strCurrentPageSlug ); $strCurrentTabSlug = isset( $_GET['tab'] ) ? $_GET['tab'] : null; - $strInPageHeadingTabs = '
<' . $strHeadingTag . ' class="nav-tab-wrapper in-page-tab">'; - + $strInPageHeadingTabs = '
<' . $strHeadingTag . ' class="nav-tab-wrapper in-page-tab">'; + // First check if a hidden tab is specified if ( isset( $this->arrHiddenTabs[ $strCurrentPageSlug ][ $strCurrentTabSlug ] ) ) { - + $strCurrentTabSlug = $this->arrHiddenTabs[ $strCurrentPageSlug ][ $strCurrentTabSlug ]; $strCurrentTabSlug = empty( $strCurrentTabSlug ) ? null : $strCurrentTabSlug; - + } - + foreach( $this->arrTabs[$strCurrentPageSlug] as $strTabSlug => $strTabTitle ) { - + // If the hide tab is set, skip if ( isset( $this->arrHiddenTabs[ $strCurrentPageSlug ][ $strTabSlug ] ) ) continue; - + // if the tab slug is not included in the loading url, set the first iterating slug to the default. if ( $strCurrentTabSlug === null ) $strCurrentTabSlug = $strTabSlug; - - // checks if the current tab slug matches the iteration slug. + + // checks if the current tab slug matches the iteration slug. // If not match, assign blank; otherwise, put the active class name. - $strClassActive = ( (string) $strCurrentTabSlug === (string) $strTabSlug ) ? 'nav-tab-active' : ''; + $strClassActive = ( (string) $strCurrentTabSlug === (string) $strTabSlug ) ? 'nav-tab-active' : ''; $strInPageHeadingTabs .= '' . $strTabTitle . ''; - + } - $strInPageHeadingTabs .= '
'; + $strInPageHeadingTabs .= '
'; return $strInPageHeadingTabs; - + } - + function AddStyle() { // methods used by a WordPress hook callback cannot be protected, must be public. $strPageSlug = isset( $_GET['page'] ) ? $_GET['page'] : ''; - + // If the loading page has not been registered or not the plugin page which uses this library, do nothing. if ( !$this->IsPageAdded( $strPageSlug ) ) return; - + // Add and apply filters - $strStyle = $this->AddAndApplyFilters( + $strStyle = $this->AddAndApplyFilters( $this->prefix_style, // style_ array( 'page' => $strPageSlug, - ), + ), $this->strStyle // the default CSS rules ); - + echo ''; - - } + + } function AddScript() { // methods used by a WordPress hook callback cannot be protected, must be public. $strPageSlug = isset( $_GET['page'] ) ? $_GET['page'] : ''; @@ -1125,46 +1125,46 @@ function AddScript() { // methods used by a WordPress hook callback cannot be p // Add and apply filters. $strScript = $this->AddAndApplyFilters( - $this->prefix_script, + $this->prefix_script, array( 'page' => $strPageSlug, ), $this->strScript ); - echo ''; - + echo ''; + } - + /* * Image Uploader Methods - * */ + * */ function DeleteFileFromMediaLibraryByURL( $strImageURL ) { global $wpdb; $strDBPrefix = $wpdb->prefix; - $arrAttachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM " . $strDBPrefix . "posts" . " WHERE guid='%s';", $strImageURL ) ); + $arrAttachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM " . $strDBPrefix . "posts" . " WHERE guid='%s';", $strImageURL ) ); $nAttachmentID = isset( $arrAttachment[0] ) ? $arrAttachment[0] : null; - + if ( empty( $nAttachmentID ) ) { // could be a thumbnail url. $strImageURL = preg_replace( '/(\/.+)(-\d+x\d+)(\.\w+)$/i', '$1$3', $strImageURL ); // remove the thumbnail suffix, e.g. sunset-300x600.jpg -> sunset.jpg - $arrAttachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM " . $strDBPrefix . "posts" . " WHERE guid='%s';", $strImageURL ) ); + $arrAttachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM " . $strDBPrefix . "posts" . " WHERE guid='%s';", $strImageURL ) ); $nAttachmentID = $arrAttachment[0]; } - + return wp_delete_attachment( $nAttachmentID, True ); - + } function EnqueUploaderScripts() { // public, not private since it is used by hooks. - + // Adds necessary scripts for image upload - if ( !$this->IsPageAdded( $_GET['page'] ) ) return; - - wp_enqueue_script('jquery'); + if ( !$this->IsPageAdded( $_GET['page'] ) ) return; + + wp_enqueue_script('jquery'); wp_enqueue_script('thickbox'); - wp_enqueue_style('thickbox'); + wp_enqueue_style('thickbox'); wp_enqueue_script('media-upload'); - - } + + } function ReplaceThickBoxText( $strTranslated, $strText ) { // called from a filter so do not protect global $pagenow; @@ -1174,26 +1174,26 @@ function ReplaceThickBoxText( $strTranslated, $strText ) { // called from a filt if ( $strText != 'Insert into Post' ) return $strTranslated; if ( !$this->IsReferredFromAddedPage( wp_get_referer() ) ) return $strTranslated; - + if ( isset( $_GET['button_label'] ) ) return $_GET['button_label']; return $this->strThickBoxButtonUseThis ? $this->strThickBoxButtonUseThis : __( 'Use This Image', 'admin-page-framework' ); - - } - + + } + /* * Export and Import Methods * */ protected function ImportOptions( $arrImportInfo, &$arrOriginal ) { - + /* * This method is redirected from MergeOptionArray() called from the Setting API's validation callback * when the __import key is set, which indicates that the user uploaded an import file. * */ $this->bIsImported = True; // this prevents multiple error/update notices to be displayed. - + if ( $arrImportInfo['error'] > 0 ) { - if ( $arrImportInfo['error_message'] ) $strMsg = $arrImportInfo['error_message']; + if ( $arrImportInfo['error_message'] ) $strMsg = $arrImportInfo['error_message']; else if ( $arrImportInfo['error'] == 1 ) $strMsg = __( 'The file is bigger than this PHP installation allows.', 'admin-page-framework' ); else if ( $arrImportInfo['error'] == 2 ) $strMsg = __( 'The file is bigger than this form allows.', 'admin-page-framework' ); else if ( $arrImportInfo['error'] == 3 ) $strMsg = __( 'Only part of the file was uploaded.', 'admin-page-framework' ); @@ -1202,7 +1202,7 @@ protected function ImportOptions( $arrImportInfo, &$arrOriginal ) { return $arrOriginal; } if ( $arrImportInfo['type'] != 'text/plain' ) { - $strMsg = ( $arrImportInfo['error_message'] ) ? $arrImportInfo['error_message'] : __( 'Import Error: Wrong file type.', 'admin-page-framework' ); + $strMsg = ( $arrImportInfo['error_message'] ) ? $arrImportInfo['error_message'] : __( 'Import Error: Wrong file type.', 'admin-page-framework' ); $this->AddSettingsError( 'import_error', $strMsg ); return $arrOriginal; } @@ -1212,42 +1212,42 @@ protected function ImportOptions( $arrImportInfo, &$arrOriginal ) { $this->AddSettingsError( 'import_error', $strMsg ); return $arrOriginal; } - - // Specify which key of the option array to import - Not implemented yet + + // Specify which key of the option array to import - Not implemented yet // if ( $arrImportInfo['__import']['option_key'] !== null ) { // $arrOriginal[] // } - + // Apply filters - $arrImport = $this->AddAndApplyFilters( - $this->prefix_import, + $arrImport = $this->AddAndApplyFilters( + $this->prefix_import, array( 'page' => $_POST['pageslug'], 'tab' => isset( $_POST['tabslug'] ) ? $_POST['tabslug'] : null, ), $arrImport, $arrImportInfo - ); + ); // If the user returns null explicitly, consider it as to decline the import process. if ( is_null( $arrImport ) ) { $strMsg = __( 'The importing process has been failed.', 'admin-page-framework' ); - $this->AddSettingsError( 'import_error', $strMsg ); + $this->AddSettingsError( 'import_error', $strMsg ); return $arrOriginal; } // if ( count( $arrImport ) == 0 ) { // $strMsg = __( 'Nothing could be imported.', 'admin-page-framework' ); - // $this->AddSettingsError( 'import_error', $strMsg ); - // return $arrOriginal; + // $this->AddSettingsError( 'import_error', $strMsg ); + // return $arrOriginal; // } - + // Okay, return the importing data! $strMsg = ( $arrImportInfo['update_message'] ) ? $arrImportInfo['update_message'] : __( 'Options were imported.', 'admin-page-framework' ); - $this->AddSettingsError( 'import_error', $strMsg, 'updated' ); - return $arrImport; - + $this->AddSettingsError( 'import_error', $strMsg, 'updated' ); + return $arrImport; + } protected function ProcessExportOptions( $arrPostExport, $arrOriginal ) { // since 1.0.2 - + // Avoid undefined key warnings $arrPostExport = $arrPostExport + array( 'transient' => null, @@ -1255,25 +1255,25 @@ protected function ProcessExportOptions( $arrPostExport, $arrOriginal ) { // sin 'option_key' => null, // have not been inmplemented yet 'submit' => null, ); - + // Determine if multiple upload input fields were used or single. if ( is_array( $arrPostExport['submit'] ) ) { // the pressed submit button cannot be multiple as pressing buttons at the same time is impossible, // so just parse the first item. foreach( $arrPostExport['submit'] as $i => $v ) { - $strTransientKey = $this->oUtil->GetCorrespondingArrayValue( $i, $arrPostExport['transient'], null ); - $strFileName = $this->oUtil->GetCorrespondingArrayValue( $i, $arrPostExport['file_name'], $this->strClassName . '.txt' ); + $strTransientKey = $this->oUtil->GetCorrespondingArrayValue( $i, $arrPostExport['transient'], null ); + $strFileName = $this->oUtil->GetCorrespondingArrayValue( $i, $arrPostExport['file_name'], $this->strClassName . '.txt' ); break; } } else { $strTransientKey = $arrPostExport['transient']; $strFileName = $arrPostExport['file_name']; } - + // Set up the exporting array. $arrExport = isset( $strTransientKey ) && ! empty( $strTransientKey ) ? ( array ) get_transient( $strTransientKey ) : $arrOriginal; - $arrExport = $this->AddAndApplyFilters( - $this->prefix_export, + $arrExport = $this->AddAndApplyFilters( + $this->prefix_export, array( 'page' => $_POST['pageslug'], 'tab' => isset( $_POST['tabslug'] ) ? $_POST['tabslug'] : null, @@ -1281,53 +1281,53 @@ protected function ProcessExportOptions( $arrPostExport, $arrOriginal ) { // sin $arrExport, $arrPostExport ); - + // Delete the transient in case it remained. delete_transient( $strTransientKey ); - + // Do export. if ( count( $arrExport ) > 0 ) return $this->ExportOptions( $strFileName, $arrExport ); - + } function ExportOptions( $strFileName, &$arr ) { - + header( 'Content-Description: File Transfer' ); header( 'Content-Disposition: attachment; filename=' . $strFileName ); echo serialize( ( array ) $arr ); return true; // should be exited outside the method. - + } - + /* Misc Methods - utility methods which can be used by the user as well. */ - - + + /* * Utilities - designed to be used by the framework internally. * */ public function IsPluginPage( $strURL ) { // since 1.0.3.2, must be public as oRedirect refers to - + $arrURLElems = parse_url( $strURL ); if ( ! isset( $arrURLElems['query'] ) ) return false; parse_str( $arrURLElems['query'], $arrQuery ); - + $arrBlogURLElems = parse_url( site_url() ); if ( $arrURLElems['host'] != $arrBlogURLElems['host'] ) return false; // if the domain is different - + if ( ! $this->IsPageAdded( $arrQuery['page'] ) ) return false; return true; - - } + + } protected function AddAndApplyFilters( $strFilterPrefix, $arrSuffixes, $vInput, $vParams=null ) { - - // Creates filters of tab, page, and global and returns the filter-applied output. - // The reason to add the filter before applying it is that without adding the filter, it won't trigger the __call magic method. + + // Creates filters of tab, page, and global and returns the filter-applied output. + // The reason to add the filter before applying it is that without adding the filter, it won't trigger the __call magic method. // Limitation: Accepts up to 2 parameters, $vInput (the subject to be filtered) and $vParams. If more than two params are needed to be passed, enclose them into an array and pass it to the seoncd parameter. - + // Prepare the filter suffixes // Avoid the undefined index warining by merging with the default keys. $arrSuffixes = $arrSuffixes + array( @@ -1336,33 +1336,33 @@ protected function AddAndApplyFilters( $strFilterPrefix, $arrSuffixes, $vInput, 'class' => $this->strClassName, ); $strPageSlug = isset( $arrSuffixes['page'] ) ? $arrSuffixes['page'] : ( isset( $_GET['page'] ) ? $_GET['page'] : ( isset( $_POST['pageslug'] ) ? $_POST['pageslug'] : null ) ); - $strTabSlug = isset( $arrSuffixes['tab'] ) ? $arrSuffixes['tab'] : ( isset( $_GET['tab'] ) ? $_GET['tab'] : ( isset( $_POST['tabslug'] ) ? $_POST['tabslug'] : $this->GetDefaultTabSlug( $strPageSlug ) ) ); - + $strTabSlug = isset( $arrSuffixes['tab'] ) ? $arrSuffixes['tab'] : ( isset( $_GET['tab'] ) ? $_GET['tab'] : ( isset( $_POST['tabslug'] ) ? $_POST['tabslug'] : $this->GetDefaultTabSlug( $strPageSlug ) ) ); + // If the loading page has a in-page tab - if ( ! empty( $strPageSlug ) && ! empty( $strTabSlug ) ) + if ( ! empty( $strPageSlug ) && ! empty( $strTabSlug ) ) $vInput = $this->AddAndApplyFilter( $strFilterPrefix . $strPageSlug . '_' . $strTabSlug, $vInput, $vParams ); - + // For regular added pages. if ( ! empty( $strPageSlug ) ) $vInput = $this->AddAndApplyFilter( $strFilterPrefix . $strPageSlug, $vInput, $vParams ); - + // For all the plugin pages added by the library. - $vInput = $this->AddAndApplyFilter( $strFilterPrefix . $arrSuffixes['class'], $vInput, $vParams ); - + $vInput = $this->AddAndApplyFilter( $strFilterPrefix . $arrSuffixes['class'], $vInput, $vParams ); + return $vInput; - + } protected function AddAndApplyFilter( $strFilter, $vInput, $vParams=null ) { // called from the AddAndApplyFilters() method add_filter( $strFilter , array( $this, $strFilter ), 10, isset( $vParams ) ? 2 : 1 ); return apply_filters( $strFilter, $vInput, $vParams ); // at this point, the magic method __call(), gets triggred. - - } + + } public function IsPageAdded( $strPageSlug ) { // used by the oRedirect object as well so it must be public - + // returns true if the given page slug is one of the pages added by the library. - if ( array_key_exists( trim( $strPageSlug ), $this->arrPageTitles ) ) return true; + if ( array_key_exists( trim( $strPageSlug ), $this->arrPageTitles ) ) return true; } @@ -1370,31 +1370,31 @@ function IsReferredFromAddedPage( $strURL ) { // Used from the image uploader - checks the given url contains the page slug added by the library class - foreach ( $this->arrPageTitles as $strSlug => $strTitle ) + foreach ( $this->arrPageTitles as $strSlug => $strTitle ) if ( stripos( $strURL, $strSlug ) ) return true; - - } + + } function AddAdminNotice( $strMsg, $nType=0 ) { - + // $nType - 0: update, 1: error $this->strAdminNotice = '

' . $strMsg . '

'; add_action( 'admin_notices', array( $this, 'ShowAdminNotice' ) ); - + } function ShowAdminNotice() { - + echo $this->strAdminNotice; - - } - + + } + /* * Methods for Debug * */ function DumpArray( $arr, $strFilePath=null ) { - + return $this->oDebug->DumpArray( $arr, $strFilePath ); - + } } @@ -1403,180 +1403,180 @@ function DumpArray( $arr, $strFilePath=null ) { class Admin_Page_Framework_Debug { public function GetLastCallerFunc( $strFunc ) { - + foreach( debug_backtrace() as $arrTrace ) { - + if ( $arrTrace['function'] == __FUNCTION__ ) continue; - + if ( $arrTrace['function'] == $strFunc ) continue; - + return $arrTrace['function']; - + } - + } - + public function DumpBackTrace( $strPath=null ) { - + return $this->DumpArray( $this->CleanDebugBacktraceArray( debug_backtrace() ), $strPath ); - + } - + public function CleanDebugBacktraceArray( $arrBackTraces ) { - + foreach ( $arrBackTraces as &$arrBackTrace ) { foreach ( $arrBackTrace as &$vElem ) { - + $vElem = ( is_object( $vElem ) ) ? 'object' : $vElem; $vElem = ( is_array( $vElem ) ) ? 'array' : $vElem; - + } } return $arrBackTraces; - + } - + public function GetMemoryUsage() { - + $intMemoryUsage = memory_get_usage( true ); - + if ( $intMemoryUsage < 1024 ) return $intMemoryUsage . " bytes"; - + if ( $intMemoryUsage < 1048576 ) return round( $intMemoryUsage/1024,2 ) . " kilobytes"; - + return round( $intMemoryUsage / 1048576,2 ) . " megabytes"; - - } - + + } + public function DumpArray( $arr, $strFilePath=null ) { if ( $strFilePath ) { - + global $wp_filesystem; - $wp_filesystem->put_contents( - $strFilePath , + $wp_filesystem->put_contents( + $strFilePath , date( "Y/m/d H:i:s" ) . PHP_EOL . print_r( $arr, true ) . PHP_EOL . PHP_EOL - , FILE_APPEND - ); - + , FILE_APPEND + ); + } return '
' . esc_html( print_r( $arr, true ) ) . '
'; - - } + + } } endif; if ( ! class_exists( 'Admin_Page_Framework_Link' ) ) : class Admin_Page_Framework_Link { // since 1.0.4 - + // Objects public $oCore; // stores the caller core object instance. - + // Properties protected $strDefaultPageSlug; - + // Array containers public $arrCallerInfo = array(); // stores the caller script information. Must be public as $oLink will look up. protected $arrPluginTitleLinks = array(); // stores links which will be added to the title column in the plugin lising page. protected $arrPluginDescriptionLinks = array(); // stores links which will be added to the description column in the plugin lising page. - + function __construct( &$oCore, $strCallerPath ) { - + $this->oCore = $oCore; - + // Store the information of the caller file. - $this->arrCallerInfo = $this->GetCallerInfo( $strCallerPath ); - + $this->arrCallerInfo = $this->GetCallerInfo( $strCallerPath ); + // Modify the admin footer to add the plugin name and the version. add_filter( 'update_footer', array( $this, 'AddInfoInFooterRight' ), 11 ); - add_filter( 'admin_footer_text' , array( $this, 'AddInfoInFooterLeft' ) ); - + add_filter( 'admin_footer_text' , array( $this, 'AddInfoInFooterLeft' ) ); + } - - + + public function AddLinkToPluginDescription( $vLinks ) { - + if ( !is_array( $vLinks ) ) $this->arrPluginDescriptionLinks[] = $vLinks; else $this->arrPluginDescriptionLinks = array_merge( $this->arrPluginDescriptionLinks , $vLinks ); - + add_filter( 'plugin_row_meta', array( $this, 'AddLinkToPluginDescription_Callback' ), 10, 2 ); - } + } public function AddLinkToPluginDescription_Callback( $arrLinks, $strFile ) { // this is a callback method so should not be protected if ( $strFile != $this->GetCallerPluginBaseName() ) return $arrLinks; return array_merge( $arrLinks, $this->arrPluginDescriptionLinks ); - - } + + } public function AddLinkToPluginTitle( $vLinks ) { - + if ( !is_array( $vLinks ) ) $this->arrPluginTitleLinks[] = $vLinks; else $this->arrPluginTitleLinks = array_merge( $this->arrPluginTitleLinks, $vLinks ); - + add_filter( 'plugin_action_links_' . $this->GetCallerPluginBaseName(), array( $this, 'AddLinkToPluginTitle_Callback' ) ); } public function AddLinkToPluginTitle_Callback( $arrLinks ) { // A callback method should not be protected. - + return array_merge( $arrLinks, $this->arrPluginTitleLinks ); - - } + + } public function GetCallerPluginBaseName() { - + return plugin_basename( $this->arrCallerInfo['file'] ); - - } + + } public function SetDefaultPageSlug( $strPageSlug ) { - + $this->strDefaultPageSlug = trim( $strPageSlug ); - - } - public function AddSettingsLinkInPluginListingPage( $arrLinks ) { // this is a callback method so should not be protected - - array_unshift( + + } + public function AddSettingsLinkInPluginListingPage( $arrLinks ) { // this is a callback method so should not be protected + + array_unshift( $arrLinks, '' . __( 'Settings', 'admin-page-framework' ) . '' - ); + ); return $arrLinks; - - } + + } public function AddInfoInFooterLeft( $strText='' ) { // since 1.0.2.2, moved from main in 1.0.4. method used by hooks should be public - + // callback for the filter hook, admin_footer_text. - + if ( ! isset( $_GET['page'] ) || ! $this->oCore->IsPageAdded( $_GET['page'] ) ) return $strText; // $strText is given by the hook. - + $strPluginInfo = $this->arrCallerInfo['data']['Name'] . ' ' . $this->arrCallerInfo['data']['Version']; $strPluginInfo = empty( $this->arrCallerInfo['data']['ScriptURI'] ) ? $strPluginInfo : '' . $strPluginInfo . ''; $strAuthorInfo = empty( $this->arrCallerInfo['data']['AuthorURI'] ) ? $this->arrCallerInfo['data']['Author'] : '' . $this->arrCallerInfo['data']['Author'] . ''; $strAuthorInfo = empty( $this->arrCallerInfo['data']['Author'] ) ? $strAuthorInfo : 'by ' . $strAuthorInfo; - return $strPluginInfo . ' ' . $strAuthorInfo; + return $strPluginInfo . ' ' . $strAuthorInfo; - } + } public function AddInfoInFooterRight( $strText='' ) { // since 1.0.2.2, moved from main in 1.0.4. method used by hooks should be public - + // Adds plugin info into the footer - + if ( ! isset( $_GET['page'] ) || ! $this->oCore->IsPageAdded( $_GET['page'] ) ) return $strText; // $strText is given by the hook. - + if ( defined( 'WP_DEBUG' ) && WP_DEBUG == true ) $strMemoryUsage = ' Memory Usage: ' . $this->oCore->oDebug->GetMemoryUsage(); - - return __( 'Powered by', 'admin-page-framework' ) . ' ' + + return __( 'Powered by', 'admin-page-framework' ) . ' ' . 'Admin Page Framework' . ', WordPress' . $strMemoryUsage; - - } + + } protected function GetPluginData( $strPluginFilePath ) { // since 1.0.4 - + // An alternative to get_plugin_data() as some users change the location of the wp-admin directory. - return get_file_data( - $strPluginFilePath, + return get_file_data( + $strPluginFilePath, array( 'Name' => 'Plugin Name', 'PluginURI' => 'Plugin URI', @@ -1590,31 +1590,31 @@ protected function GetPluginData( $strPluginFilePath ) { // since 1.0.4 // Site Wide Only is deprecated in favor of Network. '_sitewide' => 'Site Wide Only', ), - 'plugin' - ); - + 'plugin' + ); + } - + public function GetCallerInfo( $strFilePath=null ) { // since 1.0.2.2, revised in 1.0.4 - + // Attempts to retrieve the caller script type whether it's a theme or plugin or something else // so that the info can be embedded into the footer. - + $arrCallerInfo = array(); $arrCallerInfo['file'] = $strFilePath ? $strFilePath : $this->GetParentScriptPath( debug_backtrace() ); $arrCallerInfo['type'] = $this->GetCallerType( $arrCallerInfo['file'] ); - + if ( $arrCallerInfo['type'] == 'plugin' ) { - - $arrCallerInfo['data'] = function_exists( 'get_plugin_data' ) + + $arrCallerInfo['data'] = function_exists( 'get_plugin_data' ) ? get_plugin_data( $arrCallerInfo['file'], false ) : $this->GetPluginData( $arrCallerInfo['file'] ); - + $arrCallerInfo['data']['ScriptURI'] = $arrCallerInfo['data']['PluginURI']; - + } else if ( $arrCallerInfo['type'] == 'theme' ) { - if ( ! function_exists( 'wp_get_theme' ) && file_exists( ABSPATH . 'wp-admin/includes/theme.php' ) ) + if ( ! function_exists( 'wp_get_theme' ) && file_exists( ABSPATH . 'wp-admin/includes/theme.php' ) ) include_once( ABSPATH . 'wp-admin/includes/theme.php' ); if ( ! function_exists( 'wp_get_theme' ) ) // if still the function does not exist, retrun an array with empty values. $arrCallerInfo['data'] = array( @@ -1623,9 +1623,9 @@ public function GetCallerInfo( $strFilePath=null ) { // since 1.0.2.2, revised 'ThemeURI' => '', 'ScriptURI' => '', 'AuthorURI' => '', - 'Author' => '', + 'Author' => '', ); - + $oTheme = wp_get_theme(); // stores the theme info object $arrCallerInfo['data'] = array( 'Name' => $oTheme->Name, @@ -1633,69 +1633,69 @@ public function GetCallerInfo( $strFilePath=null ) { // since 1.0.2.2, revised 'ThemeURI' => $oTheme->get( 'ThemeURI' ), 'ScriptURI' => $oTheme->get( 'ThemeURI' ), 'AuthorURI' => $oTheme->get( 'AuthorURI' ), - 'Author' => $oTheme->get( 'Author' ), + 'Author' => $oTheme->get( 'Author' ), ); - + } - + return $arrCallerInfo; - - } - - + + } + + protected function GetParentScriptPath( $arrDebugBacktrace ) { - + foreach( $arrDebugBacktrace as $intIndex => $arrDebugInfo ) { - + if ( $arrDebugInfo['file'] == __FILE__ ) continue; - + return $arrDebugInfo['file']; - + } - // isset( $arrDebugBacktrace[1] ) ? $arrDebugBacktrace[1]['file'] : $arrDebugBacktrace[0]['file']; + // isset( $arrDebugBacktrace[1] ) ? $arrDebugBacktrace[1]['file'] : $arrDebugBacktrace[0]['file']; } protected function GetCallerType( $strPath ) { // since 1.0.2.2 - + // Determines what kind of script this is, theme, plugin or something else from the given path. // Returns either 'theme', 'plugin', or 'unknown' - + if ( preg_match( '/[\/\\\\]themes[\/\\\\]/', $strPath, $m ) ) return 'theme'; if ( preg_match( '/[\/\\\\]plugins[\/\\\\]/', $strPath, $m ) ) return 'plugin'; return 'unknown'; - - } + + } } endif; if ( ! class_exists( 'Admin_Page_Framework_Redirect' ) ) : class Admin_Page_Framework_Redirect { // since 1.0.4 - + public $oCore; // stores the caller core object instance. - + function __construct( &$oCore ) { - + $this->oCore = $oCore; - + // Check if there is a redirect - add_action( 'admin_init', array( $this, 'CheckFormRedirect' ) ); // since 1.0.3.2 - + add_action( 'admin_init', array( $this, 'CheckFormRedirect' ) ); // since 1.0.3.2 + } - + public function CheckHrefRedirect( $arrHref ) { // since 1.0.3.2, moved from the main class in 1.0.4, must be public - - // Called from MergeOptionArray() to check if the href key is set in the submit form field type, - + + // Called from MergeOptionArray() to check if the href key is set in the submit form field type, + foreach( $arrHref as $strFieldID => $arrHrefInfo ) { - + // $arrHrefInfo['name'] - with the delimiter |, it stores the name set in the field name attribute // Case A : a submit button with a single label - keys are either three or four - // e.g. "{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" + // e.g. "{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" // , or "{$strOptionKey}|{$arrField['page_slug']}|{$arrField['section_ID']}|{$arrField['field_ID']}" // Case B : submit buttons with multiple labels - keys are either four or five - // __array|{$strOptionKeyForReference}|{$strArrayKey} + // __array|{$strOptionKeyForReference}|{$strArrayKey} $arrNameKeys = explode( '|', $arrHrefInfo['name'] ); if ( $arrNameKeys[0] == '__array' ) { - array_shift( $arrNameKeys ); // "__array|{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" -> "{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" + array_shift( $arrNameKeys ); // "__array|{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" -> "{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" if ( count( $arrNameKeys ) == 4 ) { if ( isset( $_POST[ $arrNameKeys[0] ][ $arrNameKeys[1] ][ $arrNameKeys[2] ][ $arrNameKeys[3] ] ) ) // means this button was pressed $this->Redirect( $arrHrefInfo['url'] ); @@ -1707,8 +1707,8 @@ public function CheckHrefRedirect( $arrHref ) { // since 1.0.3.2, moved from the } if ( count( $arrNameKeys ) == 3 ) { // a custom option key is not set by the user if ( isset( $_POST[ $arrNameKeys[0] ][ $arrNameKeys[1] ][ $arrNameKeys[2] ] ) ) // means this button was pressed - $this->Redirect( $arrHrefInfo['url'] ); - + $this->Redirect( $arrHrefInfo['url'] ); + } else if ( count( $arrNameKeys ) == 4 ) { if ( isset( $_POST[ $arrNameKeys[0] ][ $arrNameKeys[1] ][ $arrNameKeys[2] ][ $arrNameKeys[3] ] ) ) // means this button was pressed @@ -1717,32 +1717,32 @@ public function CheckHrefRedirect( $arrHref ) { // since 1.0.3.2, moved from the } } public function CheckFormRedirect() { // since 1.0.3.2, callback for the admin_init hook, so it has to be public, , moved from the main class in 1.0.4 - - // the Settings API redirects to options.php to process the data submission. In the page, the $_GET['page'] is not set but WordPress redirects back + + // the Settings API redirects to options.php to process the data submission. In the page, the $_GET['page'] is not set but WordPress redirects back // to the caller page with $_GET['page']. So in options.php, we save the necessary data into a transient and when the $_GET["settings-updated"] is present, // check the transient for the redirect and process the redirection if it tells it should. - + // Variables global $pagenow; - + // options.php if ( $pagenow == 'options.php' ) { - - if ( ! ( isset( $_POST['__redirect'] ) && isset( $_POST['pageslug'] ) && is_array( $_POST['__redirect'] ) ) ) + + if ( ! ( isset( $_POST['__redirect'] ) && isset( $_POST['pageslug'] ) && is_array( $_POST['__redirect'] ) ) ) return; - + $strTransient = md5( 'redirect_' . $this->oCore->strClassName . '_' . $_POST['pageslug'] ); foreach ( $_POST['__redirect'] as $strFieldID => $arrRedirectInfo ) { - + // $arrRedirectInfo['name'] - with the delimiter |, it stores the name set in the field name attribute // Case A : a submit button with a single label - keys are either three or four - // e.g. "{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" + // e.g. "{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" // , or "{$strOptionKey}|{$arrField['page_slug']}|{$arrField['section_ID']}|{$arrField['field_ID']}" // Case B : submit buttons with multiple labels - keys are either four or five // __array|{$strOptionKeyForReference}|{$strArrayKey} $arrNameKeys = explode( '|', $arrRedirectInfo['name'] ); if ( $arrNameKeys[0] == '__array' ) { - array_shift( $arrNameKeys ); // "__array|{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" -> "{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" + array_shift( $arrNameKeys ); // "__array|{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" -> "{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" if ( count( $arrNameKeys ) == 4 ) { if ( isset( $_POST[ $arrNameKeys[0] ][ $arrNameKeys[1] ][ $arrNameKeys[2] ][ $arrNameKeys[3] ] ) ) { // means this button was pressed set_transient( $strTransient, $arrRedirectInfo['url'] , 60*5 ); @@ -1769,17 +1769,17 @@ public function CheckFormRedirect() { // since 1.0.3.2, callback for the admin_i } } } - + return; - + } - + // So it's not options.php. Now check if it's one of the plugin's added page. If not, do nothing. - if ( ! ( isset( $_GET['page'] ) ) || ! $this->oCore->IsPageAdded( $_GET['page'] ) ) return; - + if ( ! ( isset( $_GET['page'] ) ) || ! $this->oCore->IsPageAdded( $_GET['page'] ) ) return; + // The settings-updated key indicates it's redirected from options.php by WordPress Settings API. - if ( - ! ( + if ( + ! ( ( isset( $_GET['settings-updated'] ) && ! empty( $_GET['settings-updated'] ) ) && ! get_transient( md5( $this->oCore->strClassName . '_' . $_GET['page'] ) ) // error transient set by this framework ) @@ -1789,28 +1789,28 @@ public function CheckFormRedirect() { // since 1.0.3.2, callback for the admin_i $strTransient = md5( 'redirect_' . $this->oCore->strClassName . '_' . $_GET['page'] ); $strURL = get_transient( $strTransient ); if ( $strURL === false ) return; - + // The redirect URL seems to be set. delete_transient( $strTransient ); // we don't need it anymore. - + // if the redirect page is outside the plugin admin page, delete the plugin settings admin notices as well. - if ( ! $this->oCore->IsPluginPage( $strURL ) ) + if ( ! $this->oCore->IsPluginPage( $strURL ) ) delete_transient( md5( 'SettingsErrors_' . $this->oCore->strClassName . '_' . $this->oCore->strPageSlug ) ); - - // Finally, go to the page! + + // Finally, go to the page! $this->Redirect( $strURL ); - + } - + protected function Redirect( $strURL ) { // since 1.0.3.2, moved from the main class in 1.0.4 - + // Redirects to the given URL and exits. Meant to save the one extra line, exit;. if ( ! function_exists('wp_redirect') ) include_once( ABSPATH . WPINC . '/pluggable.php' ); wp_redirect( $strURL ); exit; - + } - + } endif; @@ -1819,163 +1819,163 @@ class Admin_Page_Framework_Utilities { // since 1.0.4 /* * Provides utility functions - moved from the main class - * + * * */ public function CheckKeys( $arrMandatoryKeys, $arrSubject, $arrAllowedMissingKeys=array() ) { - + // Checks if the subject array has all the necessary keys. // The $arrMandatoryKeys array must be numerically indexed with the values of necessary keys. // ( use array_keys() to format the array prior to pass it to the method. ) - + foreach( $arrMandatoryKeys as $strKey ) { if ( in_array( $strKey, $arrAllowedMissingKeys ) ) continue; if ( ! array_key_exists( $strKey, $arrSubject ) ) return false; } - + return true; - + } public function FixNumbers( $arrNumbers, $numDefault, $numMin="", $numMax="" ) { // since 1.0.4 - + // An array version of FixNumber(). The array must be numerically indexed. - + foreach( $arrNumbers as &$intNumber ) $intNumber = $this->FixNumber( $intNumber, $numDefault, $numMin, $numMax ); - + return $arrNumbers; - - } + + } public function FixNumber( $numToFix, $numDefault, $numMin="", $numMax="" ) { - + // Checks if the passed value is a number and set it to the default if not. // if it is a number and exceeds the set maximum number, it sets it to the max value. // if it is a number and is below the minimum number, it sets to the minimium value. // set a blank value for no limit. // This is useful for form data validation. - + if ( !is_numeric( trim( $numToFix ) ) ) return $numDefault; - + if ( $numMin != "" && $numToFix < $numMin) return $numMin; - + if ( $numMax != "" && $numToFix > $numMax ) return $numMax; return $numToFix; - - } + + } public function UniteArraysRecursive( $arrPrecedence, $arrDefault ) { // since 1.0.1, moved from the main class in 1.0.4, must be public - + // Merges two multi-dimensional arrays recursively. The first parameter array takes its precedence. // This is useful to merge default option values. - + if ( is_null( $arrPrecedence ) ) $arrPrecedence = array(); - + if ( !is_array( $arrDefault ) || !is_array( $arrPrecedence ) ) return $arrPrecedence; - + foreach( $arrDefault as $strKey => $v ) { - + // If the precedence does not have the key, assign the default's value. if ( ! array_key_exists( $strKey, $arrPrecedence ) ) $arrPrecedence[ $strKey ] = $v; else { - + // if the preceding array key is null, set an empty array so that the function can proceed to merge the keys. if ( is_null( $arrPrecedence[ $strKey ] ) ) $arrPrecedence[ $strKey ] = array(); - + // if the both are arrays, do the recursive process. - if ( is_array( $arrPrecedence[ $strKey ] ) && is_array( $v ) ) - $arrPrecedence[ $strKey ] = $this->UniteArraysRecursive( $arrPrecedence[ $strKey ], $v ); - + if ( is_array( $arrPrecedence[ $strKey ] ) && is_array( $v ) ) + $arrPrecedence[ $strKey ] = $this->UniteArraysRecursive( $arrPrecedence[ $strKey ], $v ); + } } - + return $arrPrecedence; - - } + + } public function GetCorrespondingArrayValue( $strKey, $vSubject, $strDefault='' ) { // since 1.0.2, must be public - + // When there are multiple arrays and they have similar index struture but it's not certain, // use this method to retrieve the corresponding key value. This is mainly used by the field array // to insert user-defined key values. - + // if $vSubject is null or undefined. - if ( ! isset( $vSubject ) ) return $strDefault; - + if ( ! isset( $vSubject ) ) return $strDefault; + // $vSubject must be either string or array. if ( ! is_array( $vSubject ) ) return ( string ) $vSubject; // consider it as string. - + // Consider $vSubject as array if ( isset( $vSubject[ $strKey ] ) ) return ( string ) $vSubject[ $strKey ]; - + return $strDefault; - + } public function UnserializeFromFile( $strFilePath ) { // moved from the main class - + // Used for the Import functionality. // Returns an array from the contents of a given file global $wp_filesystem; $arr = unserialize( $wp_filesystem->get_contents( $strFilePath, true ) ); - return ( $arr ) ? $arr : null; - + return ( $arr ) ? $arr : null; + } public function UnsetEmptyArrayElements( $arr ) { // since 1.0.4 - - - foreach ( $arr as $k => $v ) + + + foreach ( $arr as $k => $v ) if ( ! isset( $v ) || $v == '' ) unset( $arr[ $k ] ); - + return $arr; - - } - public function SanitizeArrayKeys( $arr ) { // moved from the main class in 1.0.4, must be public - - foreach ( $arr as $key => $var ) { - + + } + public function SanitizeArrayKeys( $arr ) { // moved from the main class in 1.0.4, must be public + + foreach ( $arr as $key => $var ) { + unset( $arr[ $key ] ); $new_key = $this->SanitizeSlug( $key ); //str_replace( "-", "_", $key ); // check if the key already exists or not, skip if exists if ( isset( $arr[ $new_key ] ) ) continue; $arr[ $new_key ] = $var; - + } return $arr; - - } - public function SanitizeSlug( $strSlug ) { // moved from the main class in 1.0.4, must be public - + + } + public function SanitizeSlug( $strSlug ) { // moved from the main class in 1.0.4, must be public + return preg_replace( '/[^a-zA-Z0-9_\x7f-\xff]/', '_', $strSlug ); - + } - public function SanitizeString( $str ) { // moved from the main class in 1.0.4, must be public - + public function SanitizeString( $str ) { // moved from the main class in 1.0.4, must be public + // Similar to the above SanitizeSlug() except that this allows hyphen. return preg_replace( '/[^a-zA-Z0-9_\x7f-\xff\-]/', '_', $str ); - - } + + } } endif; if ( ! class_exists( 'Admin_Page_Framework_Input_Filed_Types' ) ) : class Admin_Page_Framework_Input_Filed_Types { // since 1.0.4 - + /* * Used to retrieve the output of a given field type as a part of the Settings API field elements. * Moved from the main class in 1.0.4. * */ - + // Default values protected $arrDefaultFieldKeys = array( 'type' => null, // determins the type of input field. For textarea and select, the mentioned tags will be created instead of the input tag. - 'class' => null, // the class of CSS style. + 'class' => null, // the class of CSS style. 'description' => null, 'label' => null, // this is used to construct and render elements . 'default' => null, // this is similar to the above label key but used to specify the default values. 'value' => null, // this suppress the default key value. This is usefult to display the value saved in a custom place other thant the framework automatically saves. 'error' => null, - 'file_name' => null, // used by the export custom field + 'file_name' => null, // used by the export custom field 'transient' => null, // used by the export custom field to look up exporting data, since 1.0.2 'option_key' => null, 'selectors' => null, // <-- not sure about this @@ -2003,100 +2003,100 @@ class Admin_Page_Framework_Input_Filed_Types { // since 1.0.4 'max_height' => 200, // since 1.0.4 - for the category checklist filed type. 'remove' => array( 'revision', 'attachment', 'nav_menu_item' ), // since 1.0.4 - for the posttype checklist field type ); - + // Objects protected $oUtil; protected $oDebug; - + // Array containers protected $arrOptions = array(); // stores the options of the admin pages as array. The construcor will fill the values. protected $arrErrors = array(); // stores the field errors as array. When the validation fails, it is used to display the specified message. protected $arrField = array(); // stores the field array which contains all necessay information for the rendering input field. - + // Dynamic properties - public $strClassName; // Stores the extended class name. Referenced by oRedirect so it must be public. + public $strClassName; // Stores the extended class name. Referenced by oRedirect so it must be public. protected $strOptionKey; // Stores the option key to use to save the data into the option database table. protected $strFieldName; // Stores the value for the name attribute to assign. protected $strTagID; // Stores the rendering input tag ID to assign. protected $vValue; // array or string. Stores the value either string or array for the value attribute to assign. protected $vDisable; // array or string. Stores the value for the disable attribe to assign, could be stored as as array for multiple elements. - + function __construct( &$arrField, &$strOptionKey, &$strClassName ) { - + // Objects $this->oUtil = new Admin_Page_Framework_Utilities; $this->oDebug = new Admin_Page_Framework_Debug; - + // Set up the option array - case 1. option key is specified. case 2 not specified in the constructor, then use the page slug as the key. $this->arrOptions = ( array ) get_option( ( empty( $strOptionKey ) ) ? $arrField['page_slug'] : $strOptionKey ); - if ( !empty( $strOptionKey ) ) // if the custom option key is set by the user, + if ( !empty( $strOptionKey ) ) // if the custom option key is set by the user, $this->arrOptions = isset( $this->arrOptions[ $arrField['page_slug'] ] ) ? $this->arrOptions[ $arrField['page_slug'] ] : array(); - + // Set up the field error array - // The 'settings-updated' key will be set in the $_GET array when redirected by Settings API + // The 'settings-updated' key will be set in the $_GET array when redirected by Settings API $this->arrErrors = get_transient( md5( $strClassName . '_' . $arrField['page_slug'] ) ); - $this->arrErrors = ( isset( $_GET['settings-updated'] ) && $this->arrErrors ) ? $this->arrErrors : null; - + $this->arrErrors = ( isset( $_GET['settings-updated'] ) && $this->arrErrors ) ? $this->arrErrors : null; + // Set up the field array. Merging with the default keys will prevent PHP undefined key warnings. $this->arrField = $arrField + $this->arrDefaultFieldKeys; - + // Dynamic prorperties $this->strOptionKey = $strOptionKey; $this->strClassName = $strClassName; - $this->strFieldName = $this->GetInputFieldName( $this->arrField ); + $this->strFieldName = $this->GetInputFieldName( $this->arrField ); $this->vValue = $this->GetInputFieldValue( $this->arrOptions, $this->arrField ); $this->strTagID = "{$this->arrField['section_ID']}_{$this->arrField['field_ID']}"; $this->vDisable = is_array( $this->arrField['disable'] ) ? $this->arrField['disable'] : ( $this->arrField['disable'] ? 'disabled="Disabled"' : '' ); - + } - + protected function GetInputFieldNameFlat() { // since 1.0.4, moved from GetFormFieldsByType() $arrField = &$this->arrField; $tmp = $this->strOptionKey; // something looking like a bug occurs with the direct assignment in the ternary below. - $strOptionKey = empty( $this->strOptionKey ) ? $arrField['page_slug'] : $tmp; // it seems a bug occurs without assigning to a different variable - return empty( $this->strOptionKey ) ? + $strOptionKey = empty( $this->strOptionKey ) ? $arrField['page_slug'] : $tmp; // it seems a bug occurs without assigning to a different variable + return empty( $this->strOptionKey ) ? "{$strOptionKey}|{$arrField['section_ID']}|{$arrField['field_ID']}" : - "{$strOptionKey}|{$arrField['page_slug']}|{$arrField['section_ID']}|{$arrField['field_ID']}"; - + "{$strOptionKey}|{$arrField['page_slug']}|{$arrField['section_ID']}|{$arrField['field_ID']}"; + } protected function GetInputFieldName( &$arrField ) { // since 1.0.4, moved from GetFormFieldsByType() - + // case 1: the option key is set // case 2: the option key is not set by the user and the page slug is used. // case 3: the name key is set. - + // if the name key is explicitly set, use it if ( ! empty( $arrField['name'] ) ) return $arrField['name']; - + $tmp = $this->strOptionKey; // something looking like a bug occurs with the direct assignment in the ternary below. $strOptionKey = empty( $this->strOptionKey ) ? $arrField['page_slug'] : $tmp; // it seems a bug occurs without assigning to a different variable - + if ( empty( $this->strOptionKey ) ) return "{$strOptionKey}[{$arrField['section_ID']}][{$arrField['field_ID']}]"; return "{$strOptionKey}[{$arrField['page_slug']}][{$arrField['section_ID']}][{$arrField['field_ID']}]"; - - } + + } protected function GetInputFieldValue( &$arrOptions, &$arrField ) { // since 1.0.4, moved from GetFormFieldsByType() // If the value key is explicitly set, use it. if ( isset( $arrField['value'] ) ) return $arrField['value']; - + // Check if a previously saved data exist or not. if ( isset( $arrOptions[ $arrField['section_ID'] ][ $arrField['field_ID'] ] ) ) return $arrOptions[ $arrField['section_ID'] ][ $arrField['field_ID'] ]; // If the default value is set, if ( isset( $arrField['default'] ) ) return $arrField['default']; - - } + + } public function GetInputField( $strType ) { // Field error message $strOutput = isset( $this->arrErrors[ $this->arrField['section_ID'] ][ $this->arrField['field_ID'] ] ) ? '* ' . $this->arrField['error'] . $this->arrErrors[ $this->arrField['section_ID'] ][ $this->arrField['field_ID'] ] . '
' : ''; - + // Start diverging switch ( $strType ) { case in_array( $strType, array( 'text', 'password', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'search', 'tel', 'time', 'url', 'week' ) ): @@ -2107,11 +2107,11 @@ public function GetInputField( $strType ) { break; case 'textarea': // Additional attributes: rows, cols $strOutput .= $this->GetTextAreaField(); - break; + break; case 'radio': $strOutput .= $this->GetRadioField(); break; - case 'checkbox': // Supports multiple creation with array of label + case 'checkbox': // Supports multiple creation with array of label $strOutput .= $this->GetCheckBoxField(); break; case 'select': @@ -2119,16 +2119,16 @@ public function GetInputField( $strType ) { break; case 'hidden': // Supports multiple creation with array of label $strOutput .= $this->GetHiddenField(); - break; + break; case 'file': // Supports multiple creation with array of label $strOutput .= $this->GetFileField(); break; - case 'submit': + case 'submit': $strOutput .= $this->GetSubmitField(); break; case 'import': // import options $strOutput .= $this->GetImportField(); - break; + break; case 'export': // export options $strOutput .= $this->GetExportField(); break; @@ -2141,18 +2141,18 @@ public function GetInputField( $strType ) { case 'posttype': $strOutput .= $this->GetPostTypeChecklistField(); break; - default: // for anything else, + default: // for anything else, $strOutput .= $this->arrField['pre_field'] . $this->vValue . $this->arrField['post_field']; - break; + break; } - + // Keys: pre_html, description, post_html $strOutput = $this->arrField['pre_html'] . $strOutput; $strOutput .= ( !isset( $this->arrField['description'] ) || trim( $this->arrField['description'] ) == '' ) ? null : '

' . $this->arrField['description'] . '

'; $strOutput .= $this->arrField['post_html']; - + return $strOutput; - + } protected function GetPostTypeChecklistField() { @@ -2162,7 +2162,7 @@ protected function GetPostTypeChecklistField() { $arrValues = ( array ) $this->vValue; $strOutput = "
"; foreach ( $arrPostTypes as $strKey => $bValue ) { - + $bValue = $this->oUtil->GetCorrespondingArrayValue( $strKey, $arrValues, false ); $strChecked = ( $bValue == 1 ) ? 'Checked' : ''; $strDisabled = $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->vDisable ); @@ -2173,54 +2173,54 @@ protected function GetPostTypeChecklistField() { $strOutput .= "vDisable} />  {$strLabel}"; $strOutput .= ""; $strOutput .= $this->arrField['delimiter']; - + } $strOutput .= "
"; - return $strOutput; + return $strOutput; - } + } protected function GetPostTypes( $arrRemoveNames ) { - - $arrPostTypes = get_post_types( '', 'names' ); + + $arrPostTypes = get_post_types( '', 'names' ); $arrPostTypes = array_diff_key( $arrPostTypes, array_flip( $arrRemoveNames ) ); // remove unnecessary keys. $arrPostTypes = array_fill_keys( $arrPostTypes, True ); - return $arrPostTypes; - - } + return $arrPostTypes; + + } protected function GetCategoryChecklistField() { // since 1.0.4 - + $strFieldName = &$this->strFieldName; $vValue = &$this->vValue; $arrField = &$this->arrField; - + $strOutput = "
"; $strOutput .= "'; - $strOutput .= '
'; + $strOutput .= ''; return $arrField['pre_field'] . $strOutput . $arrField['post_field']; - - } + + } protected function GetExportField() { - + $vValue = isset( $this->arrField['value'] ) ? $this->arrField['value'] : $this->arrField['label']; $vValue = isset( $vValue ) ? $vValue : $this->arrField['default']; $strOutput = ''; - + // Case: array - if ( is_array( $vValue ) ) { - + if ( is_array( $vValue ) ) { + foreach( $vValue as $intIndex => $strValue ) { - + // Variables $strValue = ( $strValue ) ? $strValue : __( 'Export Options', 'admin-page-framework' ); $strFileName = $this->oUtil->GetCorrespondingArrayValue( $intIndex, $this->arrField['file_name'], $this->strClassName . '.txt' ); @@ -2229,92 +2229,92 @@ protected function GetExportField() { $strOptionKey = $this->oUtil->GetCorrespondingArrayValue( $intIndex, $this->arrField['option_key'], '' ); $strDisabled = $this->oUtil->GetCorrespondingArrayValue( $intIndex, $this->arrField['disable'], '' ) ? 'disabled="Disabled"' : ''; $strName = $this->oUtil->GetCorrespondingArrayValue( $intIndex, $this->arrField['name'], "__export[submit][{$intIndex}]" ); - + // Output if ( !empty( $strTransientKey ) ) $strOutput .= ""; $strOutput .= ""; $strOutput .= ""; - $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $intIndex, $this->arrField['pre_field'] ) + $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $intIndex, $this->arrField['pre_field'] ) . "" . $this->oUtil->GetCorrespondingArrayValue( $intIndex, $this->arrField['post_field'] ) . $this->arrField['delimiter']; - + } return $strOutput; - + } - + // Case: string - if ( is_string( $vValue ) ) { - + if ( is_string( $vValue ) ) { + // Variables $vValue = ( $vValue ) ? $vValue : __( 'Export Options', 'admin-page-framework' ); $strFileName = $this->arrField['file_name'] ? $this->arrField['file_name'] : $this->strClassName . '.txt'; $strClass = ( $this->arrField['class'] ) ? $this->arrField['class'] : 'button button-primary'; $strName = $this->arrField['name'] ? $this->arrField['name'] : "__export[submit]"; - + // Output if ( isset( $this->arrField['transient'] ) && !empty( $this->arrField['transient'] ) ) $strOutput .= ""; $strOutput .= ""; $strOutput .= ""; - $strOutput .= $this->arrField['pre_field'] - . "vDisable} />" + $strOutput .= $this->arrField['pre_field'] + . "vDisable} />" . $this->arrField['post_field']; return $strOutput; - + } - } + } protected function GetImportField() { - - // currently only one import field can be supported per page. + + // currently only one import field can be supported per page. $strLabel = ( $this->arrField['label'] ) ? $this->arrField['label'] : __( 'Import Options', 'admin-page-framework' ); $strClass = ( $this->arrField['class'] ) ? $this->arrField['class'] : 'button button-primary'; - + $strOutput = ""; $strOutput .= ""; - $strOutput .= $this->arrField['pre_field'] - . "vDisable} />" // the file type will be stored in $_FILE + $strOutput .= $this->arrField['pre_field'] + . "vDisable} />" // the file type will be stored in $_FILE . $this->arrField['delimiter'] . "vDisable} />" . $this->arrField['post_field']; return $strOutput; - - } + + } protected function GetFileField() { $vValue = isset( $this->arrField['value'] ) ? $this->arrField['value'] : $this->arrField['label']; $vValue = isset( $vValue ) ? $vValue : $this->arrField['default']; - + // Case: array if ( is_array( $vValue ) ) { - + $strOutput = "
"; - foreach( $vValue as $strKey => $strValue ) - $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['pre_field'] ) + foreach( $vValue as $strKey => $strValue ) + $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['pre_field'] ) . "" - . $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['post_field'] ); + . $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['post_field'] ); $strOutput .= "
"; return $strOutput; - - } - + + } + // Case: string if ( is_string( $vValue ) ) { - - return $this->arrField['pre_field'] + + return $this->arrField['pre_field'] . "vDisable} />" . $this->arrField['post_field']; - + } - - } + + } protected function GetHiddenField() { - + $vValue = isset( $this->arrField['value'] ) ? $this->arrField['value'] : $this->arrField['label']; $vValue = isset( $vValue ) ? $vValue : $this->arrField['default']; - + // Case: array if ( is_array( $vValue ) ) { $strOutput = "
"; @@ -2322,7 +2322,7 @@ protected function GetHiddenField() { $strKey = $this->oUtil->GetCorrespondingArrayValue( $strArrayKey, $this->arrField['default'], $strArrayKey ); $strValue = $strArrayValue; - $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $strArrayKey, $this->arrField['pre_field'] ) + $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $strArrayKey, $this->arrField['pre_field'] ) . "" . $this->oUtil->GetCorrespondingArrayValue( $strArrayKey, $this->arrField['post_field'] ); @@ -2330,19 +2330,19 @@ protected function GetHiddenField() { $strOutput .= "
"; return $strOutput; } - + // Case: string - if ( is_string( $vValue ) ) - return $this->arrField['pre_field'] + if ( is_string( $vValue ) ) + return $this->arrField['pre_field'] . "" . $this->arrField['post_field']; - - } + + } protected function GetSelectField() { - + // The label key must be an array for the select type. - if ( ! is_array( $this->arrField['label'] ) ) break; - + if ( ! is_array( $this->arrField['label'] ) ) exit; + $strOutput = ""; return $this->arrField['pre_field'] . $strOutput . $this->arrField['post_field']; - - } + + } protected function GetRadioField() { - + $strOutput = "
"; foreach ( $this->arrField['label'] as $strKey => $strLabel ) { $strChecked = ( $this->vValue == $strKey ) ? 'Checked' : ''; @@ -2364,78 +2364,78 @@ protected function GetRadioField() { } $strOutput .= "
"; return $this->arrField['pre_field'] . $strOutput . $this->arrField['post_field']; - - } + + } protected function GetCheckBoxField() { - + // Case: Array if ( is_array( $this->arrField['label'] ) ) { $arrValues = ( array ) $this->vValue; $strOutput = "
"; - foreach ( $this->arrField['label'] as $strKey => $strLabel ) { - + foreach ( $this->arrField['label'] as $strKey => $strLabel ) { + $strChecked = ( $arrValues[ $strKey ] == 1 ) ? 'Checked' : ''; $strDisabled = $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->vDisable ) ? 'disabled="Disabled"' : '' ; $strOutput .= ""; - $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['pre_field'] ) + $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['pre_field'] ) . "" . "  {$strLabel}" . "" . $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['post_field'] ); $strOutput .= $this->arrField['delimiter']; - + } $strOutput .= "
"; return $strOutput; - } - + } + // Case: String if ( is_string( $this->arrField['label'] ) ) { - $strChecked = ( $this->vValue == 1 ) ? 'Checked' : ''; - return $this->arrField['pre_field'] + $strChecked = ( $this->vValue == 1 ) ? 'Checked' : ''; + return $this->arrField['pre_field'] . "" . "vDisable} />" . "  {$this->arrField['label']}
" . $this->arrField['post_field']; } - - } + + } protected function GetTextAreaField() { - + $strReadOnly = isset( $this->arrField['readonly'] ) && $this->arrField['readonly'] ? 'readonly="readonly"' : ''; - return $this->arrField['pre_field'] + return $this->arrField['pre_field'] . "" . $this->arrField['post_field']; - - } + + } protected function GetNumberField() { - + $strReadOnly = isset( $this->arrField['readonly'] ) && $this->arrField['readonly'] ? 'readonly="readonly"' : ''; $numMaxLength = isset( $this->arrField['maxlength'] ) ? $this->arrField['maxlength'] : $this->arrField['size']; - return $this->arrField['pre_field'] + return $this->arrField['pre_field'] . "vDisable} {$strReadOnly} />" . $this->arrField['post_field']; - - } + + } protected function GetTextField() { - + if ( is_array( $this->arrField['label'] ) ) { // since 1.0.4.1, added the label key support and it can be passed as array to support the multiple fields. $arrValues = ( array ) $this->vValue; $strOutput = "
"; - foreach ( $this->arrField['label'] as $strKey => $strLabel ) { - + foreach ( $this->arrField['label'] as $strKey => $strLabel ) { + $strValue = $arrValues[$strKey]; $strDisabled = $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->vDisable ) ? 'disabled="Disabled"' : '' ; $strReadOnly = $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['readonly'] ) ? 'readonly="readonly"' : '' ; $strClassAttr = $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['class'], '' ); $intSize = $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['size'], $this->arrDefaultFieldKeys['size'] ); - $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['pre_field'] ) + $strOutput .= $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['pre_field'] ) . "" . ( $strLabel ? "{$strLabel}   " : "" ) . "" . $this->oUtil->GetCorrespondingArrayValue( $strKey, $this->arrField['post_field'] ); $strOutput .= $this->arrField['delimiter']; - + } $strOutput .= "
"; return $strOutput; - } - + } + if ( ! $this->arrField['label'] || is_string( $this->arrField['label'] ) ) { - + $strReadOnly = isset( $this->arrField['readonly'] ) && $this->arrField['readonly'] ? 'readonly="readonly"' : ''; - return $this->arrField['pre_field'] - . $this->arrField['label'] + return $this->arrField['pre_field'] + . $this->arrField['label'] . "vDisable} {$strReadOnly} />" - . $this->arrField['post_field']; - + . $this->arrField['post_field']; + } - } + } protected function GetSubmitField() { // since 1.0.3.2 // Returns the submit input field. Moved from GetFormFieldsByType(). - + // Variables $strOutput = ''; $arrField = &$this->arrField; @@ -2473,18 +2473,18 @@ protected function GetSubmitField() { // since 1.0.3.2 $bIsDisabled = is_array( $arrField['disable'] ) ? $arrField['disable'] : ( $arrField['disable'] ? 'disabled="Disabled"' : '' ); $strTagID = "{$arrField['section_ID']}_{$arrField['field_ID']}"; $strClass = ( $arrField['class'] ) ? $arrField['class'] : 'button button-primary'; - + // For multiple elements if ( is_array( $arrField['label'] ) ) { // supports multiple creation with array of label $strOutput .= "
"; foreach( $arrField['label'] as $strArrayKey => $strArrayValue ) { $strLabel = ( $strArrayValue ) ? $strArrayValue : __( 'Submit', 'admin-page-framework' ); - $strRedirectURL = $this->oUtil->GetCorrespondingArrayValue( $strArrayKey, $arrField['redirect'], '' ); + $strRedirectURL = $this->oUtil->GetCorrespondingArrayValue( $strArrayKey, $arrField['redirect'], '' ); if ( ! empty( $strRedirectURL ) ) { $strOutput .= ""; $strOutput .= ""; - } - $strHrefURL = $this->oUtil->GetCorrespondingArrayValue( $strArrayKey, $arrField['href'], '' ); + } + $strHrefURL = $this->oUtil->GetCorrespondingArrayValue( $strArrayKey, $arrField['href'], '' ); if ( ! empty( $strHrefURL ) ) { $strOutput .= ""; $strOutput .= ""; @@ -2496,7 +2496,7 @@ protected function GetSubmitField() { // since 1.0.3.2 $strOutput .= "
"; return $strOutput; } - + // For a single element $strLabel = ( $arrField['label'] ) ? $arrField['label'] : __( 'Submit', 'admin-page-framework' ); if ( $arrField['redirect'] ) { @@ -2505,31 +2505,31 @@ protected function GetSubmitField() { // since 1.0.3.2 } if ( $arrField['href'] ) { $strOutput .= ""; - $strOutput .= ""; - } + $strOutput .= ""; + } $strInputField = ""; $strOutput .= $arrField['pre_field'] . $strInputField . $arrField['post_field']; return $strOutput; - - } + + } protected function GetImageField() { - + // Setup Variables - $strOutput = ''; + $strOutput = ''; $strFieldName = &$this->strFieldName; $arrOptions = &$this->arrOptions; $arrField = &$this->arrField; $strOptionKeyForReference = $this->GetInputFieldNameFlat(); - - // $arrFieldOptions - the retrieved value from the database option table in which currently saved + + // $arrFieldOptions - the retrieved value from the database option table in which currently saved $arrFieldOptions = isset( $arrOptions[$arrField['section_ID']][$arrField['field_ID']] ) ? $arrOptions[$arrField['section_ID']][$arrField['field_ID']] : array(); - // the default value is assigned $strValue if $arrField['default'] is set. + // the default value is assigned $strValue if $arrField['default'] is set. $strDefaultImage = isset( $arrField['default'] ) ? $arrField['default'] : null; - $strImageURL = ( !empty( $arrFieldOptions['imageurl'] ) ) ? esc_url( $arrFieldOptions['imageurl'] ) : $strDefaultImage; - $strStyleDisplay = $strImageURL ? '' : 'display: none;'; - - /* + $strImageURL = ( !empty( $arrFieldOptions['imageurl'] ) ) ? esc_url( $arrFieldOptions['imageurl'] ) : $strDefaultImage; + $strStyleDisplay = $strImageURL ? '' : 'display: none;'; + + /* - Supported Labels $arrField['label'] = array( 'title' => 'Pick an image from the Media Library or upload one.', @@ -2539,13 +2539,13 @@ protected function GetImageField() { 'delete' => 'Delete Image', ); - Visibility - $arrField['visibility'] => array( + $arrField['visibility'] => array( 'preview' => True, 'image_url' => True, 'unset_button' => True, 'delete_button' => True, - ) - */ + ) + */ $strLabelUploadImage = isset( $arrField['label']['upload'] ) ? $arrField['label']['upload'] : __( 'Upload Image', 'admin-page-framework' ); $strLabelDeleteImage = isset( $arrField['label']['delete'] ) ? $arrField['label']['delete'] : __( 'Delete Image', 'admin-page-framework' ); $strLabelUnsetImage = isset( $arrField['label']['unset'] ) ? $arrField['label']['unset'] : __( 'Unset Image', 'admin-page-framework' ); @@ -2554,26 +2554,26 @@ protected function GetImageField() { // $strOutput .= '$strImageURL: ' . $strImageURL . '
'; // $strOutput .= '$arrField["defalut"]
' . $arrField["defalut"] . '
'; // $strOutput .= '
' . print_r( $arrFieldOptions, true ) . '
'; - + // Start forming the field output // Button - Upload Image $strOutput .= ""; $strOutput .= "  "; // Button - Unset Image - if ( !isset( $arrField['visibility']['unset_button'] ) || $arrField['visibility']['unset_button'] ) { + if ( !isset( $arrField['visibility']['unset_button'] ) || $arrField['visibility']['unset_button'] ) { $strOutput .= ""; $strOutput .= ""; - $strOutput .= "  "; + $strOutput .= "  "; } // Button - Delete Image - if ( !isset( $arrField['visibility']['delete_button'] ) || $arrField['visibility']['delete_button'] ) { + if ( !isset( $arrField['visibility']['delete_button'] ) || $arrField['visibility']['delete_button'] ) { $strOutput .= ""; $strOutput .= ""; $strOutput .= ""; - } - // Preview Box - if ( !isset( $arrField['visibility']['preview'] ) || $arrField['visibility']['preview'] ) { + } + // Preview Box + if ( !isset( $arrField['visibility']['preview'] ) || $arrField['visibility']['preview'] ) { // $strMinHeight = $arrField['min-height'] ? $arrField['min-height'] : '100px'; // $strMinWidth = $arrField['min-width'] ? $arrField['min-width'] : '320px'; $strStyle = isset( $arrField['style'] ) ? $arrField['style'] : 'min-height: 100px;'; @@ -2590,55 +2590,55 @@ protected function GetImageField() { } return $arrField['pre_field'] . $strOutput . $arrField['post_field']; - - } + + } } endif; if ( ! class_exists( 'Admin_Page_Framework_Walker_Category_Checklist' ) ) : class Admin_Page_Framework_Walker_Category_Checklist extends Walker_Category { // since 1.0.4 - + /* * Used for the wp_list_categories() function to render category hierarchical checklist. Walker : wp-includes/class-wp-walker.php Walker_Category : wp-includes/category-template.php * */ - + function start_el( &$strOutput, $oCategory, $intDepth, $arrArgs ) { - - /* + + /* $arrArgs keys: - 'show_option_all' => '', + 'show_option_all' => '', 'show_option_none' => __('No categories'), - 'orderby' => 'name', + 'orderby' => 'name', 'order' => 'ASC', 'style' => 'list', - 'show_count' => 0, + 'show_count' => 0, 'hide_empty' => 1, - 'use_desc_for_title' => 1, + 'use_desc_for_title' => 1, 'child_of' => 0, - 'feed' => '', + 'feed' => '', 'feed_type' => '', - 'feed_image' => '', + 'feed_image' => '', 'exclude' => '', - 'exclude_tree' => '', + 'exclude_tree' => '', 'current_category' => 0, - 'hierarchical' => true, + 'hierarchical' => true, 'title_li' => __( 'Categories' ), - 'echo' => 1, + 'echo' => 1, 'depth' => 0, - 'taxonomy' => 'category' + 'taxonomy' => 'category' [class] => categories [has_children] => 1 */ - + $arrArgs = $arrArgs + array( 'name' => null, 'disabled' => null, 'selected' => array(), ); - + $intID = $oCategory->term_id; $strTaxonomy = empty( $arrArgs['taxonomy'] ) ? 'category' : $arrArgs['taxonomy']; $strChecked = in_array( $intID, ( array ) $arrArgs['selected'] ) ? 'Checked' : ''; @@ -2646,13 +2646,13 @@ function start_el( &$strOutput, $oCategory, $intDepth, $arrArgs ) { $strClass = 'category-list'; $strID = "{$strTaxonomy}-{$intID}"; $strOutput .= "\n" - . "
  • " + . "
  • " . "" . "" . ""; // no need to close
  • since it is done in end_el(). - + } } endif; diff --git a/inc/core.php b/inc/core.php index aad3f86..cada0ed 100644 --- a/inc/core.php +++ b/inc/core.php @@ -95,8 +95,8 @@ function scripts() { if($cartodb || is_admin()) { - wp_register_script('leaflet', get_template_directory_uri() . '/lib/cartodb.js', array(), '3.11.26'); - wp_enqueue_style('cartodb', get_template_directory_uri() . '/lib/cartodb.css'); + wp_register_script('leaflet', get_template_directory_uri() . '/lib/cartodb.js', array(), '3.15.10'); + wp_enqueue_style('cartodb', get_template_directory_uri() . '/lib/cartodb.css', array(), '3.15.10'); } else { @@ -679,10 +679,11 @@ function plugin_fixes() { } function fix_qtranslate() { - if(function_exists('qtrans_getLanguage')) { + if(function_exists('qtranxf_getLanguage')) { add_filter('get_the_date', array($this, 'qtranslate_get_the_date'), 10, 2); add_filter('admin_url', array($this, 'qtranslate_admin_url'), 10, 2); - add_action('post_type_archive_link', 'qtrans_convertURL'); + if(function_exists('qtranxf_convertURL')) + add_action('post_type_archive_link', 'qtranxf_convertURL'); } } @@ -697,8 +698,8 @@ function qtranslate_get_the_date($date, $format) { // send lang to ajax requests function qtranslate_admin_url($url, $path) { - if($path == 'admin-ajax.php' && function_exists('qtrans_getLanguage')) - $url .= '?lang=' . qtrans_getLanguage(); + if($path == 'admin-ajax.php' && function_exists('qtranxf_getLanguage')) + $url .= '?lang=' . qtranxf_getLanguage(); return $url; } diff --git a/lib/cartodb.css b/lib/cartodb.css index f827a35..069d480 100644 --- a/lib/cartodb.css +++ b/lib/cartodb.css @@ -1,2 +1,2 @@ -/* CartoDB.css minified version: 3.11.25 */ -div.cartodb-popup.dark .jspContainer:after{background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(0,0,0,0)),color-stop(100%,rgba(0,0,0,1)));background:-webkit-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,1));background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,1));background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,1));background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,1))}div.cartodb-popup.dark .jspContainer:before{background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(0,0,0,1)),color-stop(100%,rgba(0,0,0,0)));background:-webkit-linear-gradient(top,rgba(0,0,0,1),rgba(0,0,0,0));background:-moz-linear-gradient(top,rgba(0,0,0,1),rgba(0,0,0,0));background:-o-linear-gradient(top,rgba(0,0,0,1),rgba(0,0,0,0));background:linear-gradient(top,rgba(0,0,0,1),rgba(0,0,0,0))}div.cartodb-popup.dark{background:url(../img/dark.png) no-repeat -226px 0}div.cartodb-popup.dark div.cartodb-popup-content-wrapper{background:url(../img/dark.png) repeat-y -452px 0}div.cartodb-popup.dark div.cartodb-popup-tip-container{background:url(../img/dark.png) no-repeat 0 0}div.cartodb-popup.dark a.cartodb-popup-close-button{background:url(../img/dark.png) no-repeat 0 -23px}div.cartodb-popup.dark h4{color:#999}div.cartodb-popup.dark p{color:#FFF}div.cartodb-popup.dark a{color:#397DB9}div.cartodb-popup.dark p.empty{font-style:italic;color:#AAA}div.cartodb-popup.dark .jspDrag{background:#AAA;background:rgba(255,255,255,.5)}div.cartodb-popup.dark .jspDrag:hover{background:#DEDEDE;background:rgba(255,255,255,.8)}div.cartodb-popup.v2.dark{background:#000}div.cartodb-popup.v2.dark div.cartodb-popup-tip-container:after,div.cartodb-popup.v2.dark:before{border-top-color:#000}div.cartodb-popup.v2.dark a.cartodb-popup-close-button{background:#000}div.cartodb-popup.v2.dark a.cartodb-popup-close-button:after,div.cartodb-popup.v2.dark a.cartodb-popup-close-button:before{background:#fff}@media \0screen\,screen\9{div.cartodb-popup.v2.dark{border:4px solid #AAA}div.cartodb-popup.v2.dark div.cartodb-popup-tip-container{border-top:18px solid #000}div.cartodb-popup.v2.dark a.cartodb-popup-close-button{border:2px solid #AAA;color:#fff}div.cartodb-popup.v2.dark a.cartodb-popup-close-button:hover{border:2px solid #BBB}}div.cartodb-infowindow{position:absolute;z-index:12}div.cartodb-popup{position:relative;width:226px;height:auto;padding:7px 0 0;margin:0;background:url(../img/light.png) no-repeat -226px 0}div.cartodb-popup div.cartodb-popup-content-wrapper{width:190px;max-width:190px;padding:12px 19px;overflow-x:hidden;background:url(../img/light.png) repeat-y -452px 0}div.cartodb-popup div.cartodb-popup-content{display:block;width:190px;max-width:190px;min-height:5px;height:auto;max-height:185px;margin:0;padding:0;overflow-y:auto;overflow-x:hidden!important;outline:0;text-align:left}div.cartodb-popup .jspContainer:after,div.cartodb-popup .jspContainer:before{content:'';position:absolute;left:0;right:12px;display:block;height:10px;width:190px;z-index:5}div.cartodb-popup .jspContainer:after{bottom:0;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1));background:-moz-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1));background:-o-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1));background:linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#00ffffff', GradientType=0)}div.cartodb-popup .jspContainer:before{top:0;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(top,rgba(255,255,255,1),rgba(255,255,255,0));background:-moz-linear-gradient(top,rgba(255,255,255,1),rgba(255,255,255,0));background:-o-linear-gradient(top,rgba(255,255,255,1),rgba(255,255,255,0));background:linear-gradient(top,rgba(255,255,255,1),rgba(255,255,255,0));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#00ffffff', GradientType=0)}div.cartodb-popup div.cartodb-popup-tip-container{width:226px;height:20px;background:url(../img/light.png) no-repeat 0 0}div.cartodb-popup a.cartodb-popup-close-button{position:absolute;top:-9px;right:-9px;width:26px;height:26px;padding:0;background:url(../img/light.png) no-repeat 0 -23px;text-indent:-9999px;font-size:0;line-height:0;opacity:1;-ms-filter:"alpha(Opacity=100)";filter:alpha(Opacity=1);filter:alpha(opacity=100);text-transform:uppercase;z-index:3}div.cartodb-popup.header.no_fields div.cartodb-popup-content{display:none}div.cartodb-popup.header.no_fields div.cartodb-popup-content-wrapper div.cartodb-edit-buttons{padding-top:5px;margin-top:0}div.cartodb-popup.header.no_fields div.cartodb-edit-buttons{border:0;padding-top:0}div.cartodb-popup .jspContainer{overflow:hidden;position:relative;outline:0}div.cartodb-popup .jspContainer *{outline:0}div.cartodb-popup .jspPane{position:absolute;padding:4px 0 0!important;z-index:1}div.cartodb-popup .jspVerticalBar{position:absolute;top:0;right:0;width:6px;height:100%;background:0 0;z-index:10}div.cartodb-popup .jspHorizontalBar{position:absolute;bottom:0;left:0;width:100%;height:6px;background:0 0}div.cartodb-popup .jspHorizontalBar *,div.cartodb-popup .jspVerticalBar *{margin:0;padding:0}div.cartodb-popup .jspCap{display:none}div.cartodb-popup .jspHorizontalBar .jspCap{float:left}div.cartodb-popup .jspTrack{position:relative;cursor:pointer;background:0 0}div.cartodb-popup .jspDrag{position:relative;top:0;left:0;cursor:pointer;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;background:#999;background:rgba(0,0,0,.16)}div.cartodb-popup .jspDrag:hover{background:#666;background:rgba(0,0,0,.5);cursor:pointer}div.cartodb-popup .jspHorizontalBar .jspDrag,div.cartodb-popup .jspHorizontalBar .jspTrack{float:left;height:100%}div.cartodb-popup .jspArrow{background:#50506d;text-indent:-20000px;display:block;cursor:pointer}div.cartodb-popup .jspArrow.jspDisabled{cursor:default;background:#80808d}div.cartodb-popup .jspVerticalBar .jspArrow{height:16px}div.cartodb-popup .jspHorizontalBar .jspArrow{width:16px;float:left;height:100%}div.cartodb-popup .jspVerticalBar .jspArrow:focus{outline:0}div.cartodb-popup .jspCorner{background:#eeeef4;float:left;height:100%}* html div.cartodb-popup .jspCorner{margin:0 -3px 0 0}div.cartodb-popup h2{line-height:normal}div.cartodb-popup h4{display:block;width:190px;margin:0;padding:0;font:700 11px "Helvetica Neue",Helvetica,Arial;text-transform:uppercase;word-wrap:break-word}div.cartodb-popup p{display:block;width:190px;max-width:190px;margin:0;padding:0 0 7px;font:400 13px Helvetica,Arial;word-wrap:break-word}div.cartodb-popup p.italic{font-style:italic}div.cartodb-popup p.loading{position:relative;display:block;width:170px;max-width:170px;margin:0;padding:0 0 0 30px;font:400 13px Helvetica,Arial;font-style:italic;word-wrap:break-word;line-height:21px}div.cartodb-popup p.error{position:relative;display:block;width:170px;max-width:170px;margin:0;padding:0;font:400 13px Helvetica,Arial;font-style:italic;word-wrap:break-word;line-height:18px}div.cartodb-popup p.empty{font-style:italic}div.cartodb-popup div.spinner{position:absolute!important;display:inline;top:0;left:0;margin:10px 0 0 10px}div.cartodb-popup.v2{width:226px;padding:0;margin:0 0 14px;-moz-box-shadow:0 0 0 4px rgba(0,0,0,.15);-webkit-box-shadow:0 0 0 4px rgba(0,0,0,.15);box-shadow:0 0 0 4px rgba(0,0,0,.15);-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff}div.cartodb-popup.v2:before{content:'';position:absolute;bottom:-14px;left:0;width:0;height:0;margin-left:28px;border-left:0 solid transparent;border-right:14px solid transparent;border-top:14px solid #fff;z-index:2}div.cartodb-popup.v2 div.cartodb-popup-content-wrapper{width:auto;max-width:none;padding:12px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:0 0}div.cartodb-popup.v2 div.cartodb-popup-content{width:auto;max-width:none;display:block;background:0 0}div.cartodb-popup.v2 div.cartodb-popup-content h4,div.cartodb-popup.v2 div.cartodb-popup-content p{width:auto;max-width:95%;display:block}div.cartodb-popup.v2 div.cartodb-popup-tip-container{position:absolute;bottom:-20px;left:-4px;width:20px;height:16px;margin-left:28px;background:0 0;overflow:hidden;z-index:0}div.cartodb-popup.v2 div.cartodb-popup-tip-container:before{content:'';position:absolute;width:20px;height:20px;left:0;top:-10px;margin-left:0;-ms-transform:skew(0,-45deg);-webkit-transform:skew(0,-45deg);transform:skew(0,-45deg);border-radius:0 0 0 10px;background:rgba(0,0,0,.15);z-index:0}div.cartodb-popup.v2 a.cartodb-popup-close-button{right:-12px;top:-12px;width:20px;height:20px;background:#fff;-webkit-border-radius:18px;-moz-border-radius:18px;border-radius:18px;box-shadow:0 0 0 3px rgba(0,0,0,.15)}div.cartodb-popup.v2 a.cartodb-popup-close-button:after,div.cartodb-popup.v2 a.cartodb-popup-close-button:before{content:'';position:absolute;top:9px;left:6px;width:8px;height:2px;background:#397DBA;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}div.cartodb-popup.v2 a.cartodb-popup-close-button:before{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg)}div.cartodb-popup.v2 a.cartodb-popup-close-button:after{-ms-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}div.cartodb-popup.v2 a.cartodb-popup-close-button:hover{box-shadow:0 0 0 3px rgba(0,0,0,.25)}@media \0screen\,screen\9{div.cartodb-popup.v2{border:4px solid #CCC}div.cartodb-popup.v2 div.cartodb-popup-tip-container{position:absolute;width:0;height:0;margin-left:28px;z-index:2;bottom:-18px;left:-4px;border-left:0 solid transparent;border-right:18px solid transparent;border-top:18px solid #fff}div.cartodb-popup.v2 a.cartodb-popup-close-button{right:-14px;top:-14px;width:18px;padding:0 0 0 2px;text-indent:0;font:700 11px Arial;font-weight:700;text-decoration:none;text-align:center;line-height:20px;border:2px solid #CCC}div.cartodb-popup.v2 a.cartodb-popup-close-button:after,div.cartodb-popup.v2 a.cartodb-popup-close-button:before{display:none}div.cartodb-popup.v2 a.cartodb-popup-close-button:hover{border:2px solid #999}}div.cartodb-popup.header.blue div.cartodb-popup-header{background:url(../img/headers.png) no-repeat 0 -40px}div.cartodb-popup.header.blue.header .cartodb-popup-header a{color:#fff}div.cartodb-popup.header.blue div.cartodb-popup-header h4{color:#1F4C7F}div.cartodb-popup.header.blue div.cartodb-popup-header span.separator{background:#225386}div.cartodb-popup.header.blue a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -226px -40px}div.cartodb-popup.header.blue a.cartodb-popup-close-button:hover{background-position:-226px -66px}div.cartodb-popup.v2.header.blue div.cartodb-popup-header{background:0 0;background:-ms-linear-gradient(top,#4F9CD7,#2B68A8);background:-o-linear-gradient(right,#4F9CD7,#2B68A8);background:-webkit-linear-gradient(top,#4F9CD7,#2B68A8);background:-moz-linear-gradient(right,#4F9CD7,#2B68A8);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#4F9CD7',endColorStr='#2B68A8',GradientType=0)"}div.cartodb-popup.v2.header.blue a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.header{padding:0;background:0 0;box-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;-o-box-shadow:none;border-bottom:0;border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-o-border-radius:0}div.cartodb-popup.header div.cartodb-popup-header{position:relative;width:188px;height:auto;max-height:62px;overflow:hidden;padding:17px 19px;background:url(../img/headers.png) no-repeat 0 -40px}div.cartodb-popup.header div.cartodb-popup-header h1{width:100%;margin:0;font:700 21px "Helvetica Neue",Helvetica,Arial;color:#FFF;line-height:23px;text-shadow:0 1px rgba(0,0,0,.5);word-wrap:break-word}div.cartodb-popup.header div.cartodb-popup-header h1 a{color:#fff;font-size:21px;word-wrap:break-word}div.cartodb-popup.header div.cartodb-popup-header h1 a:hover{text-decoration:underline}div.cartodb-popup.header div.cartodb-popup-header h1.loading{position:relative;display:block;width:auto;padding-right:0;padding-left:30px;font-size:14px;font-weight:400;line-height:19px}div.cartodb-popup.header div.cartodb-popup-header h1.error{position:relative;display:block;width:auto;padding-right:0;padding-left:0;font-size:14px;font-weight:400;font-style:italic;line-height:19px}div.cartodb-popup.header div.cartodb-popup-header h4{color:#1F4C7F}div.cartodb-popup.header div.cartodb-popup-header span.separator{position:absolute;bottom:0;left:4px;right:4px;height:1px;background:#225386}div.cartodb-popup.header div.cartodb-popup-content{max-height:150px}div.cartodb-popup.header a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -226px -40px}div.cartodb-popup.header a.cartodb-popup-close-button:hover{background-position:-226px -66px}div.cartodb-popup.header.v2.header{-moz-box-shadow:0 0 0 4px rgba(0,0,0,.15);-webkit-box-shadow:0 0 0 4px rgba(0,0,0,.15);box-shadow:0 0 0 4px rgba(0,0,0,.15);-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff}div.cartodb-popup.v2.header div.cartodb-popup-header{position:relative;width:auto;height:auto;max-height:62px;overflow:hidden;padding:17px 12px;background:0 0;background:-ms-linear-gradient(top,#4F9CD7,#2B68A8);background:-o-linear-gradient(right,#4F9CD7,#2B68A8);background:-webkit-linear-gradient(top,#4F9CD7,#2B68A8);background:-moz-linear-gradient(right,#4F9CD7,#2B68A8);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#4F9CD7',endColorStr='#2B68A8',GradientType=0)";-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}div.cartodb-popup.v2.header div.cartodb-popup-header:before{content:'';position:absolute;bottom:0;left:0;right:0;width:100%;height:1px;background:rgba(0,0,0,.1)}div.cartodb-popup.v2.header a.cartodb-popup-close-button{right:-12px;top:-12px;width:20px;height:20px;background:#fff;-webkit-border-radius:18px;-moz-border-radius:18px;border-radius:18px;box-shadow:0 0 0 3px rgba(0,0,0,.15)}div.cartodb-popup.v2.header a.cartodb-popup-close-button:after,div.cartodb-popup.v2.header a.cartodb-popup-close-button:before{content:'';position:absolute;top:9px;left:6px;width:8px;height:2px;background:#397DBA;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}div.cartodb-popup.v2.header a.cartodb-popup-close-button:before{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg)}div.cartodb-popup.v2.header a.cartodb-popup-close-button:after{-ms-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}div.cartodb-popup.v2.header a.cartodb-popup-close-button:hover{box-shadow:0 0 0 3px rgba(0,0,0,.25)}@media \0screen\,screen\9{div.cartodb-popup.header.v2{border-bottom:4px solid #CCC}div.cartodb-popup.v2.header div.cartodb-popup-header{background:#3B7FBD;-ms-filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr='#4F9CD7', endColorStr='#2B68A8', GradientType=0)}}div.cartodb-popup.header.green div.cartodb-popup-header{background:url(../img/headers.png) no-repeat -252px -40px}div.cartodb-popup.header.green div.cartodb-popup-header h4{color:#00916D}div.cartodb-popup.header.green div.cartodb-popup-header span.separator{background:#008E6A}div.cartodb-popup.header.green a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -478px -40px}div.cartodb-popup.header.green a.cartodb-popup-close-button:hover{background-position:-478px -66px}div.cartodb-popup.v2.header.green div.cartodb-popup-header{background:0 0;background:-ms-linear-gradient(top,#0C9,#00B185);background:-o-linear-gradient(right,#0C9,#00B185);background:-webkit-linear-gradient(top,#0C9,#00B185);background:-moz-linear-gradient(right,#0C9,#00B185);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#00CC99',endColorStr='#00B185',GradientType=0)"}div.cartodb-popup.v2.header.green a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.v2.header.green a.cartodb-popup-close-button:after,div.cartodb-popup.v2.header.green a.cartodb-popup-close-button:before{background:#0C9}@media \0screen\,screen\9{div.cartodb-popup.v2.header.green a.cartodb-popup-close-button{color:#0C9}}div.cartodb-popup.header.orange div.cartodb-popup-header{background:url(../img/headers.png) no-repeat -756px -40px}div.cartodb-popup.header.orange div.cartodb-popup-header h4{color:#CC2929}div.cartodb-popup.header.orange div.cartodb-popup-header span.separator{background:#CC2929}div.cartodb-popup.header.orange a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -982px -40px}div.cartodb-popup.header.orange a.cartodb-popup-close-button:hover{background-position:-982px -66px}div.cartodb-popup.v2.header.orange div.cartodb-popup-header{background:0 0;background:-ms-linear-gradient(top,#FF6825,#F33);background:-o-linear-gradient(right,#FF6825,#F33);background:-webkit-linear-gradient(top,#FF6825,#F33);background:-moz-linear-gradient(right,#FF6825,#F33);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#FF6825',endColorStr='#FF3333',GradientType=0)"}div.cartodb-popup.v2.header.orange a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.v2.header.orange a.cartodb-popup-close-button:after,div.cartodb-popup.v2.header.orange a.cartodb-popup-close-button:before{background:#CC2929}@media \0screen\,screen\9{div.cartodb-popup.v2.header.orange a.cartodb-popup-close-button{color:#CC2929}}div.cartodb-popup.header.with-image div.cartodb-popup-header{position:relative;background:url(../img/headers.png) no-repeat -1008px 0;height:138px;max-height:104px}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover{display:block;position:absolute;overflow:hidden;width:218px;height:135px;top:4px;left:4px;border-radius:4px 4px 0 0}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover .shadow{position:absolute;width:218px;height:55px;bottom:0;left:0;background:url(../img/shadow.png) no-repeat;z-index:100}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover #spinner{position:absolute;top:67px;left:109px}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover img{position:absolute;border-radius:4px 4px 0 0;display:none}div.cartodb-popup.header.with-image div.cartodb-popup-header .image_not_found{position:absolute;top:15px;left:15px;width:200px;display:none}div.cartodb-popup.header.with-image div.cartodb-popup-header .image_not_found a{display:-moz-inline-stack;display:inline-block;vertical-align:top;*vertical-align:auto;zoom:1;*display:inline;margin:3px 0 0 -2px;color:#888;font-size:13px;font-family:Helvetica,"Helvetica Neue",Arial,sans-serif;text-decoration:underline}div.cartodb-popup.header.with-image div.cartodb-popup-header .image_not_found a:hover{color:#888;text-decoration:underline}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover .image_not_found i{display:-moz-inline-stack;display:inline-block;vertical-align:top;*vertical-align:auto;zoom:1;*display:inline;width:31px;height:22px;background:transparent url(../img/image_not_found.png)}div.cartodb-popup.header.with-image div.cartodb-popup-header h1{position:absolute;bottom:13px;left:18px;width:188px;z-index:150}div.cartodb-popup.header.with-image div.cartodb-popup-header h4{color:#CCC}div.cartodb-popup.header.with-image div.cartodb-popup-header span.separator{background:#CCC}div.cartodb-popup.header.with-image a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -226px -40px}div.cartodb-popup.header.with-image a.cartodb-popup-close-button:hover{background-position:-226px -66px}div.cartodb-popup.header.with-image .cartodb-popup-header h1{display:none}div.cartodb-popup.header.with-image .cartodb-popup-header h1.order1{display:block}div.cartodb-popup.header.with-image .cartodb-popup-content-wrapper .order1{display:none}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header{background:#2C2C2C;background:-ms-linear-gradient(top,#535353,#2C2C2C);background:-o-linear-gradient(right,#535353,#2C2C2C);background:-webkit-linear-gradient(top,#535353,#2C2C2C);background:-moz-linear-gradient(right,#535353,#2C2C2C);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#535353',endColorStr='#2C2C2C',GradientType=0)"}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header h1{width:85%}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header span.separator{left:0;right:0;background:#CCC}div.cartodb-popup.v2.header.with-image a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header .cover{display:block;width:100%;height:138px;top:0;left:0;-moz-border-radius:2px 2px 0 0;-webkit-border-radius:2px 2px 0 0;border-radius:2px 2px 0 0;overflow:hidden}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header .cover .shadow{width:100%;height:57px;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(0,0,0,0)),color-stop(100%,rgba(0,0,0,.8)));background:-webkit-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8));background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8));background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8));background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#000000', GradientType=0)}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header .cover img{-moz-border-radius:2px 2px 0 0;-webkit-border-radius:2px 2px 0 0;border-radius:2px 2px 0 0}div.cartodb-popup.header.yellow div.cartodb-popup-header{background:url(../img/headers.png) no-repeat -504px -40px}div.cartodb-popup.header.yellow div.cartodb-popup-header h4{color:#D8832A}div.cartodb-popup.header.yellow div.cartodb-popup-header span.separator{background:#CC7A29}div.cartodb-popup.header.yellow a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -730px -40px}div.cartodb-popup.header.yellow a.cartodb-popup-close-button:hover{background-position:-730px -66px}div.cartodb-popup.v2.header.yellow div.cartodb-popup-header{background:0 0;background:-ms-linear-gradient(top,#FFBF0D,#F93);background:-o-linear-gradient(right,#FFBF0D,#F93);background:-webkit-linear-gradient(top,#FFBF0D,#F93);background:-moz-linear-gradient(right,#FFBF0D,#F93);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#FFBF0D',endColorStr='#FF9933',GradientType=0)"}div.cartodb-popup.v2.header.yellow a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.v2.header.yellow a.cartodb-popup-close-button:after,div.cartodb-popup.v2.header.yellow a.cartodb-popup-close-button:before{background:#CC7A29}@media \0screen\,screen\9{div.cartodb-popup.v2.header.yellow a.cartodb-popup-close-button{color:#CC7A29}}div.cartodb-popup h4{color:#CCC}div.cartodb-popup p{color:#333}div.cartodb-popup p.loading{color:#888}div.cartodb-popup p.error{color:#FF7F7F}div.cartodb-popup p.empty{color:#999}*{-webkit-margin-after:0;-webkit-margin-before:0;-webkit-padding-start:0;-webkit-padding-end:0}div.cartodb-share{display:none;position:relative;float:right;margin:20px 20px 0 0;z-index:105}div.cartodb-share a{width:14px;height:14px;display:block;color:#397DB8;font-size:10px;font-weight:700;text-transform:uppercase;text-shadow:none;padding:7px;background:#fff url(../img/share.png) no-repeat 7px 8px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999}div.cartodb-share a:hover{background:#fff url(../img/share.png) no-repeat -28px 8px}div.cartodb-share a:active,div.cartodb-share a:hover:active{background:#fff url(../img/share.png) no-repeat 7px 8px}.cartodb-fullscreen{display:none;position:relative;margin:11px 0 0 20px;float:left;clear:both;z-index:105}.cartodb-fullscreen a{display:block;width:14px;height:14px;padding:7px;background:#fff url(../img/fullscreen.png) no-repeat 7px 3px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999}.cartodb-fullscreen a:active{background-position:7px 3px!important}.cartodb-fullscreen a:hover{background-position:-19px 5px}.cartodb-share-dialog{display:none}.cartodb-share-dialog .mamufas{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5);cursor:default;z-index:1000001}.cartodb-share-dialog .modal{position:absolute;top:50%;left:50%;margin-left:-216px;margin-top:-107px;webkit-box-shadow:rgba(0,0,0,.15) 0 0 0 4px;-moz-box-shadow:rgba(0,0,0,.15) 0 0 0 4px;box-shadow:rgba(0,0,0,.15) 0 0 0 4px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;font-weight:700;font-family:"Segoe UI Bold","Helvetica Bold",Helvetica,Arial;color:#333;line-height:normal}.cartodb-share-dialog.small .modal{margin-left:-108px;margin-top:-165px}.cartodb-share-dialog.small .block .buttons{margin:0 0 10px}.cartodb-share-dialog.small .block .buttons ul{border:0;padding:0}.cartodb-share-dialog.small .block .content .embed_code{padding:0}.cartodb-share-dialog .modal a.close{position:absolute;top:-15px;right:-15px;width:30px;height:15px;padding:7px 0 8px;background:#fff;font:400 13px Helvetica,Arial;text-decoration:none;webkit-box-shadow:rgba(0,0,0,.15) 0 0 0 4px;-moz-box-shadow:rgba(0,0,0,.15) 0 0 0 4px;box-shadow:rgba(0,0,0,.15) 0 0 0 4px;-webkit-border-radius:50px;-moz-border-radius:50px;-ms-border-radius:50px;-o-border-radius:50px;border-radius:50px;line-height:14px;text-align:center;z-index:105}.cartodb-share-dialog .block{background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;webkit-box-shadow:rgba(0,0,0,.15) 0 0 4px 3px;-moz-box-shadow:rgba(0,0,0,.15) 0 0 4px 3px;box-shadow:rgba(0,0,0,.15) 0 0 4px 3px}.cartodb-share-dialog .block .buttons ul{margin:0;padding:0 24px 0 0;border-right:1px solid #E5E5E5}.cartodb-share-dialog .block .buttons li{list-style:none;margin:0 0 4px;padding:0}.cartodb-share-dialog .block .buttons li a{display:block;padding:10px 13px 11px 30px;width:121px;font-size:13px;font-weight:700;color:#fff;background:#3D8FCA;text-decoration:none;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}@media only screen and (min-device-width :320px) and (max-device-width :480px){div.cartodb-header h1{width:78%}div.cartodb-header>p{width:80%}}@media only screen and (min-device-width :768px) and (max-device-width :1024px){div.cartodb-header h1{width:78%}div.cartodb-header>p{width:80%}}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){div.cartodb-header h1{width:78%}div.cartodb-header>p{width:80%}div.cartodb-zoom a{background:url(../img/other@2x.png) no-repeat 0 0!Important;background-size:113px 34px!Important}div.cartodb-zoom a.zoom_in{background-position:-68px 9px!important}div.cartodb-zoom a.zoom_out{background-position:-94px 10px!important}div.cartodb-header div.social a.facebook{background:url(../img/other@2x.png) no-repeat 0 0!Important;background-size:113px 34px!Important}div.cartodb-header div.social a.twitter{background:url(../img/other@2x.png) no-repeat -26px 0!Important;background-size:113px 34px!Important}div.cartodb-searchbox span.loader{background:url(../img/loader@2x.gif) no-repeat center center #fff!Important;background-size:16px 16px!Important}div.cartodb-mobile .aside div.cartodb-searchbox span.loader{background:url(../img/dark_loader@2x.gif) no-repeat center center #292929!Important;background-size:16px 16px!Important}div.cartodb-tiles-loader div.loader{background:url(../img/loader@2x.gif) no-repeat center center #fff!Important;background-size:16px 16px!Important}div.cartodb-searchbox input.submit{background:url(../img/other@2x.png) no-repeat -56px 0!Important;background-size:113px 34px!Important}.cartodb-mobile .aside .cartodb-searchbox input.submit{background:url(../img/mobile_zoom.png) no-repeat 0 0!Important}}.cartodb-share-dialog .block .buttons li a.twitter{background:#3D8FCA url(../img/twitter.png) no-repeat 10px 50%}.cartodb-share-dialog .block .buttons li a.twitter:hover{background-color:#3272A0}.cartodb-share-dialog .block .buttons li a.facebook{background:#3B5998 url(../img/facebook.png) no-repeat 10px 50%}.cartodb-share-dialog .block .buttons li a.facebook:hover{background-color:#283C65}.cartodb-share-dialog .block .buttons li a.link{background:#f37f7b url(../img/link.png) no-repeat 10px 50%}.cartodb-share-dialog .block .buttons li a.link:hover{background-color:#DC6161}.cartodb-share-dialog .block a,.cartodb-share-dialog .block h3,.cartodb-share-dialog .block label,.cartodb-share-dialog .block p{letter-spacing:0}.cartodb-share-dialog .block div.head{position:relative;padding:5px 26px;border-bottom:1px solid #E5E5E5}.cartodb-share-dialog .block h3{margin:1em 0;font-size:15px;font-weight:700}.cartodb-share-dialog .block h4{font-size:13px;font-weight:700;color:#666;padding:0;margin:0;margin:0 0 9px}.cartodb-share-dialog .block .content .buttons,.cartodb-share-dialog .block .content .embed_code{display:inline-block;zoom:1;*display:inline;vertical-align:top}.cartodb-share-dialog .block .content .embed_code{padding-left:24px}.cartodb-share-dialog .block .content .embed_code textarea{resize:none;padding:5px;width:153px;height:104px;border:1px solid #C3C3C3;background:#F5F5F5;font-size:11px;color:#666;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px}.cartodb-share-dialog .block .content{padding:20px 26px 30px}.cartodb-mobile{width:100%;height:100%;z-index:100000000}.cartodb-mobile .cartodb-header{background:0 0;z-index:100000}.cartodb-mobile .cartodb-header .content{padding:0}.cartodb-mobile .cartodb-header .hgroup{position:relative;height:40px;padding:10px}.cartodb-mobile.with-fullscreen .cartodb-header .hgroup{position:relative;margin-left:60px;margin-right:70px}.cartodb-mobile.with-header .cartodb-header .content .hgroup .description,.cartodb-mobile.with-header .cartodb-header .content .hgroup .title{display:block}.cartodb-mobile .cartodb-header .content .description,.cartodb-mobile .cartodb-header .content .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cartodb-mobile .cartodb-header .content .button{height:58px;width:58px;background-color:rgba(0,0,0,.5);line-height:normal;z-index:99999}.cartodb-mobile.with-header .cartodb-header{background-color:rgba(0,0,0,.5)}.cartodb-mobile.with-fullscreen .cartodb-header .content .fullscreen{display:block}.cartodb-mobile.with-header .cartodb-header .content .fullscreen{background:0 0}.cartodb-mobile .cartodb-header .content .fullscreen{display:none;position:relative;top:0;left:0;float:left;width:60px;height:60px;margin:auto;padding:0;background:rgba(0,0,0,.5);cursor:pointer;z-index:10;-webkit-border-radius:0 0 5px;-moz-border-radius:0 0 5px;-ms-border-radius:0 0 5px;-o-border-radius:0 0 5px;border-radius:0 0 5px;-webkit-transform-style:"ease-in";-moz-transform-style:"ease-in";-ms-transform-style:"ease-in";-o-transform-style:"ease-in";transform-style:"ease-in";-webkit-transition-property:background;-moz-transition-property:background;-o-transition-property:background;transition-property:background;-webkit-transition-duration:150ms;-moz-transition-duration:150ms;-o-transition-duration:150ms;transition-duration:150ms}.cartodb-mobile.with-header .cartodb-header .content .fullscreen{border-right:1px solid rgba(255,255,255,.35);-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}.cartodb-mobile .cartodb-header .content .fullscreen:hover,.cartodb-mobile.with-header .cartodb-header .content .fullscreen:hover{background:rgba(0,0,0,.3)}.cartodb-mobile .cartodb-header .content .fullscreen:before{content:'';width:60px;height:60px;background:url(../img/fullscreen_mobile.png) no-repeat 50% 50%;background-size:28px 28px;position:absolute}.cartodb-mobile.with-layers .cartodb-header .content .toggle,.cartodb-mobile.with-search .cartodb-header .content .toggle{display:block}.cartodb-mobile .cartodb-header .content .toggle{display:none;position:relative;top:0;right:0;float:right;width:70px;height:60px;margin:auto;padding:0;background:rgba(0,0,0,.5);cursor:pointer;z-index:10;-webkit-border-radius:0 0 0 5px;-moz-border-radius:0 0 0 5px;-ms-border-radius:0 0 0 5px;-o-border-radius:0 0 0 5px;border-radius:0 0 0 5px;-webkit-transform-style:"ease-in";-moz-transform-style:"ease-in";-ms-transform-style:"ease-in";-o-transform-style:"ease-in";transform-style:"ease-in";-webkit-transition-property:background;-moz-transition-property:background;-o-transition-property:background;transition-property:background;-webkit-transition-duration:150ms;-moz-transition-duration:150ms;-o-transition-duration:150ms;transition-duration:150ms}.cartodb-mobile .cartodb-header .content .toggle:hover,.cartodb-mobile.with-header .cartodb-header .content .toggle:hover{background:rgba(0,0,0,.3)}.cartodb-mobile.with-header .cartodb-header .content .toggle{background:0 0;border-left:1px solid rgba(255,255,255,.35);-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}.cartodb-mobile .cartodb-header .content .toggle:before{content:'';width:70px;height:60px;background:url(../img/toggle_aside.png) no-repeat 50% 50%;background-size:30px 30px;position:absolute}.cartodb-mobile.with-zoom .cartodb-zoom{position:absolute;top:0;z-index:100000}.cartodb-mobile.with-fullscreen .cartodb-zoom,.cartodb-mobile.with-zoom.with-header .cartodb-zoom{top:60px}.cartodb-mobile .aside{position:absolute;width:250px;height:100%;top:0;right:-250px;background:#2D2D2D;cursor:default;z-index:1000010}.cartodb-mobile .aside .cartodb-searchbox{position:relative;display:none;float:none;margin:0;width:100%;height:auto;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background:0 0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border:0;border-bottom:1px solid #505050;z-index:105}.cartodb-mobile .aside .cartodb-searchbox input.text{border:0;position:initial;top:initial;left:initial;height:39px;padding:10px 18px;width:185px;font-size:13px;color:#fff}.cartodb-mobile .aside .cartodb-searchbox input.text::-webkit-input-placeholder{font-style:italic}.cartodb-mobile .aside .cartodb-searchbox input.text:-moz-placeholder{font-style:italic}.cartodb-mobile .aside .cartodb-searchbox input.text::-moz-placeholder{font-style:italic}.cartodb-mobile .aside .cartodb-searchbox input.text:-ms-input-placeholder{font-style:italic}.cartodb-mobile .aside .cartodb-searchbox span.loader{left:initial;top:18px;right:14px;background:url(../img/dark_loader.gif) no-repeat center center}.cartodb-mobile .aside .cartodb-searchbox input.submit{right:18px;top:23px;width:14px;height:14px;left:initial;outline:0;cursor:pointer;background:url(../img/mobile_zoom.png) no-repeat 0 0}.cartodb-mobile .aside .layer-container{position:relative;height:100%}.cartodb-mobile .aside .scrollpane{width:100%;height:100%;overflow:hidden;outline:0}.cartodb-mobile .aside .scrollpane .jspContainer{overflow:hidden;position:relative}.cartodb-mobile .aside .scrollpane .jspPane{position:absolute}.cartodb-mobile .aside .scrollpane .jspVerticalBar{position:absolute;top:0;right:7px;width:5px;height:100%;background:0 0;z-index:20}.cartodb-mobile .aside .scrollpane .jspVerticalBar *{margin:0;padding:0}.cartodb-mobile .aside .scrollpane .jspCap{display:none}.cartodb-mobile .aside .scrollpane .jspTrack{background:0 0;position:relative}.cartodb-mobile .aside .scrollpane .jspDrag{background:rgba(#BBB,.5);border-radius:5px;position:relative;top:0;left:0;cursor:pointer}.cartodb-mobile .aside .scrollpane .jspArrow{background:0 0;text-indent:-20000px;display:block;cursor:pointer}.cartodb-mobile .aside .scrollpane .jspVerticalBar .jspArrow{height:10px}.cartodb-mobile .aside .scrollpane .jspVerticalBar .jspArrow:focus{outline:0}.cartodb-mobile .aside .scrollpane .jspCorner{background:#eeeef4;float:left;height:100%}.cartodb-mobile .aside .layer-container>h3{padding:23px 20px;color:#999;font:700 12px Helvetica,Arial,sans-serif;text-transform:uppercase;background:#292929;border-bottom:1px solid #585858}.cartodb-mobile .aside .layer-container .layers{margin:0;padding:0 10px}.cartodb-mobile .aside .layer-container .layers>li{padding:5px 10px;color:#fff;list-style:none;border-bottom:1px solid #585858}.cartodb-mobile .aside .layer-container .layers>li:last-child,.cartodb-mobile .aside .layer-container .layers>li:last-child h3{border:0}.cartodb-mobile .aside .layer-container .layers>li a.toggle{width:21px;height:10px;background:#191919;position:relative;top:2px;float:right;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px}.cartodb-mobile .aside .layer-container .layers>li a.toggle.hide{display:none}.cartodb-mobile .aside .layer-container .layers>li.hidden a.toggle:before{left:0}.cartodb-mobile .aside .layer-container .layers>li a.toggle:before{position:absolute;content:'';top:1px;right:0;width:7px;height:7px;-webkit-border-radius:100px;-moz-border-radius:100px;-ms-border-radius:100px;-o-border-radius:100px;border-radius:100px;background:#fff}.cartodb-mobile .aside .layer-container .layers>li h3{font:700 12px Helvetica,Arial,sans-serif;text-transform:uppercase;padding:12px 0 13px}.cartodb-mobile .aside .layer-container .layers>li.has-toggle h3{cursor:pointer}.cartodb-mobile .aside .layer-container .layers>li.has-legend.hidden h3,.cartodb-mobile .aside .layer-container .layers>li.hidden h3{color:#666;border:0;padding:12px 0 13px}.cartodb-mobile .aside .layer-container .layers>li.hidden.has-legend div.cartodb-legend{display:none!important}.cartodb-mobile .aside .layer-container .layers>li.hidden.has-legend h3{margin-bottom:0}.cartodb-mobile .aside .layer-container .layers>li.has-legend h3{border-bottom:1px solid #585858}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend{position:relative;border:0;webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background:0 0;margin:10px 0 18px;padding:2px 0 0;bottom:auto;right:auto;cursor:text}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend.bubble ul li.graph{border:0}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend.bubble ul li.graph .bubbles{background:url(../img/dark_bubbles.png) no-repeat 0 0}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend .graph{border:1px solid #1A1108}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend ul li{height:auto;padding:0;font-size:12px;color:#fff;font-weight:400;font-family:Helvetica,Arial,sans-serif;text-transform:none;line-height:normal}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend.intensity ul li.graph{height:22px}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend ul li .bullet{margin-top:2px}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend ul li.max,.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend ul li.min{font-size:10px}.cartodb-mobile div.cartodb-timeslider .slider-wrapper{position:absolute;top:17px}.cartodb-mobile div.cartodb-timeslider .slider{width:100%}.cartodb-mobile div.cartodb-timeslider{height:40px;margin-bottom:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border:1px solid #E5E5E5;border-left:0;border-right:0;border-top:1px solid rgba(0,0,0,.2);z-index:1000001}.cartodb-mobile div.cartodb-timeslider .slider-wrapper{display:block;width:100%;height:4px;padding:0}.cartodb-mobile div.cartodb-timeslider{width:100%!important}.cartodb-mobile div.cartodb-timeslider ul{width:100%;position:relative;clear:both;overflow:hidden}.cartodb-mobile div.cartodb-timeslider ul li{display:block;background:#fff;float:left}.cartodb-mobile div.cartodb-timeslider ul li.controls{width:50px}.cartodb-mobile div.cartodb-timeslider ul li.time{width:120px}.cartodb-mobile div.cartodb-timeslider ul li.last{position:absolute;left:180px;right:10px}.cartodb-mobile div.cartodb-timeslider ul li.controls a.button{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}.cartodb-mobile .cartodb-attribution{display:none;list-style:none;background:#fff;position:absolute;padding:9px 12px;margin:0;right:20px;bottom:20px;color:#999;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;z-index:10000001;font:12px/1.5 "Helvetica Neue",Arial,Helvetica,sans-serif}.cartodb-mobile .cartodb-attribution a{color:#0078A8}.cartodb-mobile .cartodb-attribution li{padding:0;margin:3px;display:inline-block;zoom:1;*display:inline;vertical-align:top;color:#999}.cartodb-mobile .cartodb-attribution li a{text-transform:capitalize;color:#0078A8}.cartodb-mobile .backdrop{display:none;position:absolute;top:0;left:0;right:0;bottom:0;background:#000;filter:alpha(opacity=20);filter:alpha(Opacity=20);opacity:.2;z-index:10000000}.cartodb-mobile.with-torque .cartodb-attribution-button{bottom:59px}.cartodb-mobile .cartodb-attribution-button{display:none;width:20px;height:20px;position:absolute;right:20px;bottom:20px;color:#999;text-align:center;text-decoration:none;-webkit-border-radius:100px;-moz-border-radius:100px;-ms-border-radius:100px;-o-border-radius:100px;border-radius:100px;background:#fff url(../img/bg-attribution-button.png) no-repeat 49% 50%;font:12px/1.5 "Helvetica Neue",Arial,Helvetica,sans-serif;z-index:10}.cartodb-mobile .cartodb-attribution-button:before{position:absolute;content:'';top:-3px;left:-3px;width:20px;height:20px;border:3px solid rgba(0,0,0,.3);-webkit-border-radius:100px;-moz-border-radius:100px;-ms-border-radius:100px;-o-border-radius:100px;border-radius:100px;-webkit-transform-style:"ease-in";-moz-transform-style:"ease-in";-ms-transform-style:"ease-in";-o-transform-style:"ease-in";transform-style:"ease-in";-webkit-transition-property:border;-moz-transition-property:border;-o-transition-property:border;transition-property:border;-webkit-transition-duration:150ms;-moz-transition-duration:150ms;-o-transition-duration:150ms;transition-duration:150ms}.cartodb-mobile .cartodb-attribution-button:hover:before{border:3px solid rgba(0,0,0,.7)}div.cartodb-legend-stack{position:absolute;bottom:35px;right:20px;display:none;webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;background:#fff;z-index:105;cursor:text}div.cartodb-legend-stack div.cartodb-legend{position:relative;top:auto;right:auto;left:auto;bottom:auto;background:0 0;border:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border-bottom:1px solid #999;webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;cursor:text}div.cartodb-legend-stack div.cartodb-legend:last-child{border-bottom:0}div.cartodb-legend{position:absolute;bottom:35px;right:20px;padding:13px 15px 14px;font:400 13px Helvetica,Arial;color:#858585;text-align:left;webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;background:#fff;z-index:105}div.cartodb-legend .legend-title{margin:0 0 10px;text-align:left;color:#666;font-weight:700;font-size:11px;text-transform:uppercase}div.cartodb-legend ul{padding:0;margin:0;list-style:none}div.cartodb-legend ul li{padding:0;margin:0;font-size:10px;color:#666;font-weight:700;font-family:Helvetica,Arial;text-transform:uppercase;line-height:normal}div.cartodb-legend-stack div.cartodb-legend.none,div.cartodb-legend.none{display:none}div.map div.cartodb-legend-stack div.cartodb-legend.wrapper .cartodb-legend{padding:0;display:block}div.cartodb-legend.wrapper .cartodb-legend{display:block;padding:0}div.cartodb-legend.category ul li,div.cartodb-legend.color ul li,div.cartodb-legend.custom ul li{position:relative;margin:0 0 7px;font-size:10px;color:#666;font-weight:700;font-family:Helvetica,Arial;text-transform:uppercase;text-align:left;height:10px;line-height:10px;vertical-align:middle}div.cartodb-legend.category ul li.bkg,div.cartodb-legend.color ul li.bkg,div.cartodb-legend.custom ul li.bkg{height:20px;line-height:24px;margin:0 0 15px}div.cartodb-legend.category ul li.bkg .bullet,div.cartodb-legend.color ul li.bkg .bullet,div.cartodb-legend.custom ul li.bkg .bullet{height:20px;width:20px;border:1px solid rgba(0,0,0,.3);border:0;background-size:26px 26px!important;background-position:center center!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}div.cartodb-legend.category ul li.bkg:last-child,div.cartodb-legend.color ul li.bkg:last-child,div.cartodb-legend.custom ul li.bkg:last-child{margin:0 0 5px}div.cartodb-legend.category ul li:last-child,div.cartodb-legend.color ul li:last-child,div.cartodb-legend.custom ul li:last-child{margin:0}div.cartodb-legend.category ul li .bullet,div.cartodb-legend.color ul li .bullet,div.cartodb-legend.custom ul li .bullet{float:left;margin:0 5px 0 0;width:3px;height:3px;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;padding:2px;background:#fff;border:1px solid rgba(0,0,0,.2);z-index:1000}div.cartodb-legend.bubble{text-align:center}div.cartodb-legend.bubble ul{clear:both;overflow:hidden;display:-moz-inline-stack;display:inline-block}div.cartodb-legend.bubble ul li{position:relative;float:left;top:15px}div.cartodb-legend.bubble ul li.graph{top:0;width:120px;height:40px;margin:0 10px;background:#f1f1f1}div.cartodb-legend.bubble ul li.graph .bubbles{background:url(../img/bubbles.png) no-repeat 0 0;width:120px;height:40px}div.cartodb-legend.choropleth{padding:13px 15px 15px}div.cartodb-legend.choropleth ul{min-width:210px}div.cartodb-legend.choropleth li.min{float:left;margin:0 0 5px}div.cartodb-legend.choropleth li.max{float:right;margin:0 0 5px}div.cartodb-legend.choropleth li.graph div{width:10px;height:22px}div.cartodb-legend.choropleth li.graph .quartile{display:table-cell}div.cartodb-legend.choropleth li.graph.count_7 .quartile{width:30px}div.cartodb-legend.choropleth li.graph.count_5 .quartile{width:42px}div.cartodb-legend.choropleth li.graph.count_3 .quartile{width:70px}div.cartodb-legend.choropleth li.graph .colors{display:table-row}div.cartodb-legend.choropleth li.graph{clear:both;overflow:hidden;display:table;width:100%;height:22px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-moz-background-clip:padding;-webkit-background-clip:padding;background-clip:padding;border:1px solid #b3b3b3}div.cartodb-legend.density{padding:13px 15px 15px}div.cartodb-legend.density ul{min-width:210px}div.cartodb-legend.density li.min{float:left;margin:0 0 5px}div.cartodb-legend.density li.max{float:right;margin:0 0 5px}div.cartodb-legend.density li.graph div{width:10px;height:22px}div.cartodb-legend.density li.graph .quartile{display:table-cell}div.cartodb-legend.density li.graph.count_7 .quartile{width:30px}div.cartodb-legend.density li.graph.count_5 .quartile{width:42px}div.cartodb-legend.density li.graph.count_3 .quartile{width:70px}div.cartodb-legend.density li.graph .colors{display:table-row}div.cartodb-legend.density li.graph{clear:both;overflow:hidden;display:table;width:100%;height:22px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-moz-background-clip:padding;-webkit-background-clip:padding;background-clip:padding;border:1px solid #b3b3b3}div.cartodb-legend.intensity{padding:13px 15px 15px}div.cartodb-legend.intensity ul{min-width:210px}div.cartodb-legend.intensity li.min{float:left;margin:0 0 5px}div.cartodb-legend.intensity li.max{float:right;margin:0 0 5px}div.cartodb-legend.intensity li.graph{clear:both;width:100%;height:22px;background:#f1f1f1;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-moz-background-clip:padding;-webkit-background-clip:padding;background-clip:padding;-webkit-box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);-o-box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);-ms-box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);box-shadow:inset 0 0 0 1px rgba(0,0,0,.2)}div.cartodb-zoom{position:relative;float:left;display:block;margin:20px 0 0 20px;width:28px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;z-index:105}div.cartodb-zoom a{position:relative;display:block;width:28px;height:28px;padding:0;font:700 20px Arial;color:#999;text-align:center;text-decoration:none;text-indent:-9999px;line-height:0;font-size:0;background:url(../img/other.png) no-repeat 0 0}div.cartodb-zoom a.zoom_in{border-bottom:1px solid #E6E6E6;background-position:-68px 10px;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px}div.cartodb-zoom a.zoom_in:hover{background-position:-68px -14px;cursor:pointer}div.cartodb-zoom a.zoom_out{background-position:-94px 10px;-webkit-border-bottom-left-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-bottomright:4px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}div.cartodb-zoom a.zoom_out:hover{background-position:-94px -14px;cursor:pointer}div.cartodb-zoom a.disabled{filter:alpha(opacity=20);filter:alpha(Opacity=20);opacity:.2}div.cartodb-zoom a.disabled:hover{cursor:default;color:#999}div.cartodb-zoom-info{position:absolute;display:block;top:100px;left:20px;margin:20px 0 0;width:28px;height:28px;font:400 13px Helvetica,Arial;color:#858585;text-align:center;line-height:28px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;background:#fff;z-index:105}div.cartodb-tiles-loader{position:relative;float:left;display:block;left:0;top:0}div.cartodb-tiles-loader div.loader{position:absolute;display:block;top:70px;left:-30px;margin:20px 0 0;width:28px;height:28px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:url(../img/loader.gif) no-repeat center center #fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;z-index:105}div.cartodb-layer-selector-box{display:none;position:relative;float:right;margin:20px 20px 0 0;width:142px;height:29px;color:#CCC;font-size:13px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;z-index:100000}div.cartodb-layer-selector-box a.layers{float:left;width:126px;padding:6px 8px;line-height:20px;color:#CCC;text-decoration:none;font-family:robotoregular,Helvetica,Arial,Sans-serif}div.cartodb-layer-selector-box a.layers:hover{color:#bbb}div.cartodb-layer-selector-box a.layers:hover .count{background:#ccc}div.cartodb-layer-selector-box a.layers .count{position:absolute;right:6px;top:6px;width:auto;padding:3px 6px;margin:0;font-size:10px;color:#fff;line-height:12px;background:#DDD;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}div.cartodb-layer-selector-box div.cartodb-dropdown{padding:0;margin:0}div.cartodb-layer-selector-box div.cartodb-dropdown ul{padding:0;margin:0;list-style:none;border:1px solid 999999}div.cartodb-layer-selector-box div.cartodb-dropdown ul li{border-bottom:1px solid #EDEDED;position:relative}div.cartodb-layer-selector-box div.cartodb-dropdown ul li:last-child{border-bottom:0}div.cartodb-layer-selector-box div.cartodb-dropdown ul li:hover{background:#fff}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.layer{display:-moz-inline-stack;display:inline-block;vertical-align:middle;width:104px;padding:13px 13px 15px;zoom:1;color:#666;font:400 13px "Helvetica Neue",Helvetica,Arial;text-decoration:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}div.cartodb-layer-selector-box div.cartodb-dropdown ul li:hover a.layer{text-decoration:underline;color:#545454}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch{position:absolute;top:13px;right:10px;text-indent:-9999px;vertical-align:middle;width:23px;height:12px;padding:0;-webkit-border-radius:12px;-moz-border-radius:12px;-ms-border-radius:12px;-o-border-radius:12px;border-radius:12px;-webkit-transform-style:"linear";-moz-transform-style:"linear";-ms-transform-style:"linear";-o-transform-style:"linear";transform-style:"linear";-webkit-transition-property:left;-moz-transition-property:left;-o-transition-property:left;transition-property:left;-webkit-transition-duration:180ms;-moz-transition-duration:180ms;-o-transition-duration:180ms;transition-duration:180ms;text-decoration:none;border:1px solid #44759E}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch:before{position:absolute;content:' ';top:0;left:0;width:100%;height:100%;-webkit-border-radius:12px;-moz-border-radius:12px;-ms-border-radius:12px;-o-border-radius:12px;border-radius:12px;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(0,0,0,.18)),color-stop(100%,rgba(0,0,0,0)));background:-webkit-linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,0));background:-moz-linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,0));background:-o-linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,0));background:linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,0));z-index:0}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch span.handle{position:absolute;top:0;width:10px;height:10px;-webkit-border-radius:12px;-moz-border-radius:12px;-ms-border-radius:12px;-o-border-radius:12px;border-radius:12px;border:1px solid #44759e;background:#F2F2F2;z-index:2;-webkit-transform-style:"linear";-moz-transform-style:"linear";-ms-transform-style:"linear";-o-transform-style:"linear";transform-style:"linear";-webkit-transition-property:left;-moz-transition-property:left;-o-transition-property:left;transition-property:left;-webkit-transition-duration:180ms;-moz-transition-duration:180ms;-o-transition-duration:180ms;transition-duration:180ms}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.enabled{border-color:#44759E;background:#56AFEF}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.enabled span.handle{left:12px;border-color:#44759E}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.disabled{opacity:1;-ms-filter:"alpha(Opacity=100)";filter:alpha(Opacity=1);filter:alpha(opacity=100);border-color:#CCC;background:#D8D8D8}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch span.handle{left:0;border-color:#999}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch:hover{cursor:pointer!important}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.working{opacity:.5;-ms-filter:"alpha(Opacity=50)";filter:alpha(Opacity=.5);filter:alpha(opacity=50)}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.working:hover{cursor:default!important}div.cartodb-searchbox{position:relative;display:none;float:right;margin:20px 20px 0 0;width:142px;height:29px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;z-index:105}div.cartodb-searchbox span.loader{position:absolute;display:none;top:3px;left:3px;width:22px;height:22px;background:url(../img/loader.gif) no-repeat center center #fff;z-index:105}div.cartodb-searchbox input.text{position:absolute;top:6px;left:30px;width:103px;padding:0;margin:0;line-height:17px;border:0;background:0 0;border-bottom:1px dotted #CCC;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;font:400 14px Arial;color:#999;text-align:left;z-index:2}div.cartodb-searchbox input.text:focus{outline:0;border-color:#999;color:#666}div.cartodb-searchbox input.submit{position:absolute;left:8px;top:8px;width:12px;height:12px;text-indent:-9999px;font-size:0;line-height:0;text-transform:uppercase;border:0;background:url(../img/other.png) no-repeat -56px 0;z-index:1}div.cartodb-searchbox input.submit:hover{cursor:pointer}div.cartodb-infobox{padding:20px;position:absolute;display:inline-block;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;text-align:left;z-index:105}div.cartodb-dropdown{position:absolute;display:none;background:#fff;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;border:0;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;-ms-box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;-o-box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;z-index:150}div.cartodb-dropdown.border{border:1px solid #999}div.cartodb-dropdown div.tail{position:absolute;top:-6px;right:10px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #999;z-index:0}div.cartodb-dropdown div.tail span.border{position:absolute;top:1px;left:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;z-index:2}div#cartodb-gmaps-attribution{position:absolute;display:block;bottom:13px;right:0;height:10px;line-height:10px;padding:0 6px 4px;background:#fff;background:rgba(245,245,245,.7);font-family:Roboto,Arial,sans-serif!important;font-size:11px;font-weight:400;color:#444!important;white-space:nowrap;direction:ltr;text-align:right;background-position:initial initial;background-repeat:initial initial;border:0;z-index:10000}div#cartodb-gmaps-attribution a{color:#444;text-decoration:none}div.cartodb-timeslider{position:absolute;display:inline-block;height:40px;width:auto!important;margin-bottom:30px;padding:0;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;text-align:left;z-index:105}div.cartodb-timeslider ul{display:block;height:40px;margin:0;padding:0;line-height:40px;list-style:none;cursor:default}div.cartodb-timeslider ul li{display:inline-block;zoom:1;*display:inline;vertical-align:top;height:40px;_height:40px;width:auto;line-height:40px;border-right:1px solid #E5E5E5}div.cartodb-timeslider ul li.last{border-right:0}div.cartodb-timeslider a.button{display:block;width:48px;height:40px;text-indent:-9999px;line-height:0;font-size:0;background:url(../img/slider.png) no-repeat -2px -55px}div.cartodb-timeslider a.button:hover{background-position:-42px -55px}div.cartodb-timeslider a.button.stop{background-position:-2px -4px}div.cartodb-timeslider a.button.stop:hover{background-position:-42px -4px}div.cartodb-timeslider p{width:120px;height:40px;margin:0;padding:0 5px 0 0;line-height:40px;font-size:13px;font-weight:700;font-family:Helvetica,Arial;text-align:center;color:#999}.cartodb-header{display:none;position:relative;width:100%;background-color:rgba(0,0,0,.5);font-family:'Helvetica Neue',Helvetica,sans-serif;line-height:normal;z-index:99999}.cartodb-header .content{padding:10px}.cartodb-header .content a{color:#fff}.cartodb-header .content a:hover{color:#ccc}.cartodb-header .content .title{display:none;margin:0 0 5px;line-height:normal;font-family:'Helvetica Neue',Helvetica,sans-serif;font-weight:700;font-size:15px;color:#fff}.cartodb-header .content .description{display:none;font-family:'Helvetica Neue',Helvetica,sans-serif;line-height:normal;color:#fff;font-size:13px}.cartodb-overlay.overlay-annotation,.cartodb-overlay.overlay-text{position:absolute;display:none;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;font-size:20px;line-height:normal;color:#fff;-ms-word-break:break-word;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto;z-index:11}.cartodb-overlay.overlay-annotation .content,.cartodb-overlay.overlay-text .content{padding:10px}.cartodb-overlay.overlay-text .text{font-size:20px;line-height:normal;color:#fff;-ms-word-break:break-word;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto}.cartodb-overlay.overlay-annotation .text strong,.cartodb-overlay.overlay-text .text strong{font-weight:700}.cartodb-overlay.overlay-annotation .text em,.cartodb-overlay.overlay-text .text em{font-style:italic}.cartodb-overlay.overlay-annotation div.text a,.cartodb-overlay.overlay-text div.text a{color:inherit}.cartodb-overlay.overlay-annotation .text a:hover,.cartodb-overlay.overlay-text .text a:hover{color:inherit;filter:alpha(Opacity=80);opacity:.8}.cartodb-overlay.overlay-annotation{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.cartodb-overlay.overlay-annotation .content{padding:5px}.cartodb-overlay.overlay-annotation.align-right .stick .ball{left:auto;right:-6px}.cartodb-overlay.overlay-annotation .stick{position:absolute;top:50%;left:-50px;margin-top:-1px;width:50px;height:2px;background:#333}.cartodb-overlay.overlay-annotation .stick .ball{position:absolute;left:-6px;top:50%;margin-top:-3px;width:6px;height:6px;background:#333;-webkit-border-radius:200px;-moz-border-radius:200px;-ms-border-radius:200px;-o-border-radius:200px;border-radius:200px}.cartodb-overlay.image-overlay{display:none;position:absolute;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;z-index:11}.cartodb-overlay.image-overlay .content{padding:10px}.cartodb-overlay.image-overlay img{display:block}@font-face{font-family:'Droid Sans';font-style:normal;font-weight:400;src:local('Droid Sans'),local('DroidSans'),url(//themes.googleusercontent.com/static/fonts/droidsans/v4/s-BiyweUPV0v-yRb-cjciL3hpw3pgy2gAi-Ip7WPMi0.woff) format('woff')}@font-face{font-family:'Droid Sans';font-style:bold;font-weight:700;src:local('Droid Sans Bold'),local('DroidSans-Bold'),url(//themes.googleusercontent.com/static/fonts/droidsans/v4/EFpQQyG9GqCrobXxL-KRMXbFhgvWbfSbdVg11QabG8w.woff) format('woff')}@font-face{font-family:Vollkorn;font-style:normal;font-weight:400;src:local('Vollkorn Regular'),local('Vollkorn-Regular'),url(//themes.googleusercontent.com/static/fonts/vollkorn/v4/BCFBp4rt5gxxFrX6F12DKnYhjbSpvc47ee6xR_80Hnw.woff) format('woff')}@font-face{font-family:Vollkorn;font-style:normal;font-weight:400;src:local('Vollkorn Regular'),local('Vollkorn-Regular'),url(//themes.googleusercontent.com/static/fonts/vollkorn/v4/BCFBp4rt5gxxFrX6F12DKnYhjbSpvc47ee6xR_80Hnw.woff) format('woff')}@font-face{font-family:Vollkorn;font-style:bold;font-weight:700;src:local('Vollkorn Bold'),local('Vollkorn-Bold'),url(//themes.googleusercontent.com/static/fonts/vollkorn/v4/wMZpbUtcCo9GUabw9JODerrIa-7acMAeDBVuclsi6Gc.woff) format('woff')}@font-face{font-family:'Open Sans';font-style:bold;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(//themes.googleusercontent.com/static/fonts/opensans/v8/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff) format('woff')}@font-face{font-family:'Open Sans';font-style:bold;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(//themes.googleusercontent.com/static/fonts/opensans/v8/MTP_ySUJH_bn48VBG8sNSqRDOzjiPcYnFooOUGCOsRk.woff) format('woff')}@font-face{font-family:'Roboto Slab';font-style:normal;font-weight:400;src:local('Roboto Slab Regular'),local('RobotoSlab-Regular'),url(//themes.googleusercontent.com/static/fonts/robotoslab/v3/y7lebkjgREBJK96VQi37ZrrIa-7acMAeDBVuclsi6Gc.woff) format('woff')}@font-face{font-family:'Roboto Slab';font-style:bold;font-weight:700;src:local('Roboto Slab Bold'),local('RobotoSlab-Bold'),url(//themes.googleusercontent.com/static/fonts/robotoslab/v3/dazS1PrQQuCxC3iOAJFEJRbnBKKEOwRKgsHDreGcocg.woff) format('woff')}.cartodb-overlay.overlay-text .content>.text{font-family:'Helvetica Neue',Helvetica,sans-serif;font-weight:400}.cartodb-overlay.overlay-text .content>.text strong{font-family:'Helvetica Neue',Helvetica,sans-serif;font-weight:700}.cartodb-overlay.overlay-text.droid .content>.text{font-family:'Droid Sans',serif;font-weight:400}.cartodb-overlay.overlay-text.droid .content>.text strong{font-family:'Droid Sans',Helvetica,sans-serif;font-weight:700}.cartodb-overlay.overlay-text.roboto .content>.text{font-family:'Roboto Slab',serif;font-weight:400}.cartodb-overlay.overlay-text.roboto .content>.text strong{font-family:'Roboto Slab',serif;font-weight:700}.cartodb-overlay.overlay-text.vollkorn .content>.text{font-family:Vollkorn,serif;font-weight:400}.cartodb-overlay.overlay-text.vollkorn .content>.text strong{font-family:Vollkorn,serif;font-weight:700}.cartodb-overlay.overlay-text.open_sans .content>.text{font-family:'Open Sans',sans-serif;font-weight:400}.cartodb-overlay.overlay-text.open_sans .content>.text strong{font-family:'Open Sans',sans-serif;font-weight:700}@media only screen and (max-device-width :320px) and (max-device-width :480px){div.cartodb-map-wrapper div.cartodb-searchbox{display:none}}div.cartodb-timeslider .slider-wrapper{display:inline-block;zoom:1;*display:inline;vertical-align:top;width:253px;height:4px;_height:4px;padding:18px 15px}div.cartodb-timeslider .slider{width:253px;height:4px}div.cartodb-timeslider .ui-helper-hidden{display:none}div.cartodb-timeslider .ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}div.cartodb-timeslider .ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}div.cartodb-timeslider .ui-helper-clearfix:after,div.cartodb-timeslider .ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}div.cartodb-timeslider .ui-helper-clearfix:after{clear:both}div.cartodb-timeslider .ui-helper-clearfix{min-height:0}div.cartodb-timeslider .ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}div.cartodb-timeslider .ui-front{z-index:100}div.cartodb-timeslider .ui-state-disabled{cursor:default!important}div.cartodb-timeslider .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}div.cartodb-timeslider .ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}div.cartodb-timeslider .ui-slider{background-color:#E0E0E0;position:relative;text-align:left;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px}div.cartodb-timeslider .ui-slider .ui-slider-handle{position:absolute;z-index:102;width:9px;height:10px;cursor:default;background:url(../img/slider.png) no-repeat -98px -18px #fff;border:1px solid #555;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px;outline:0}div.cartodb-timeslider .ui-slider .ui-slider-handle:hover{cursor:col-resize;background-position:-112px -18px}div.cartodb-timeslider .ui-slider .ui-slider-range{position:absolute;z-index:100;font-size:.7em;display:block;border:0;background-position:0 0;background-color:#397DBA;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px}div.cartodb-timeslider .ui-slider.ui-state-disabled .ui-slider-handle,div.cartodb-timeslider .ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}div.cartodb-timeslider .ui-slider-horizontal{height:4px;cursor:pointer}div.cartodb-timeslider .ui-slider-horizontal .ui-slider-handle{top:-4px;margin-left:-6px}div.cartodb-timeslider .ui-slider-horizontal .ui-slider-range{top:0;height:100%;cursor:pointer}div.cartodb-timeslider .ui-slider-horizontal .ui-slider-range-min{left:0}div.cartodb-timeslider .ui-slider-horizontal .ui-slider-range-max{right:0}div.cartodb-timeslider .ui-slider-vertical{width:.8em;height:100px}div.cartodb-timeslider .ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}div.cartodb-timeslider .ui-slider-vertical .ui-slider-range{left:0;width:100%}div.cartodb-timeslider .ui-slider-vertical .ui-slider-range-min{bottom:0}div.cartodb-timeslider .ui-slider-vertical .ui-slider-range-max{top:0}.leaflet-image-layer,.leaflet-layer,.leaflet-map-pane,.leaflet-marker-icon,.leaflet-marker-pane,.leaflet-marker-shadow,.leaflet-overlay-pane,.leaflet-overlay-pane svg,.leaflet-popup-pane,.leaflet-shadow-pane,.leaflet-tile,.leaflet-tile-container,.leaflet-tile-pane,.leaflet-zoom-box{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden;-ms-touch-action:none}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container img{max-width:none!important}.leaflet-container img.leaflet-image-layer{max-width:15000px!important}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-tile-pane{z-index:2}.leaflet-objects-pane{z-index:3}.leaflet-overlay-pane{z-index:4}.leaflet-shadow-pane{z-index:5}.leaflet-marker-pane{z-index:6}.leaflet-popup-pane{z-index:7}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:7;pointer-events:auto}.leaflet-bottom,.leaflet-top{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup,.leaflet-fade-anim .leaflet-tile{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup,.leaflet-fade-anim .leaflet-tile-loaded{opacity:1}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-touching .leaflet-zoom-animated,.leaflet-zoom-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-clickable{cursor:pointer}.leaflet-container{cursor:-webkit-grab;cursor:-moz-grab}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-clickable,.leaflet-dragging .leaflet-container{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078A8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,.5)}.leaflet-container{font:12px/1.5 "Helvetica Neue",Arial,Helvetica,sans-serif}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,.65);border-radius:4px}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:0}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px 'Lucida Console',Monaco,monospace;text-indent:1px}.leaflet-control-zoom-out{font-size:20px}.leaflet-touch .leaflet-control-zoom-in{font-size:22px}.leaflet-touch .leaflet-control-zoom-out{font-size:24px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255,255,255,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:0;line-height:1.1;padding:2px 5px 1px;font-size:11px;white-space:nowrap;overflow:hidden;-moz-box-sizing:content-box;box-sizing:content-box;background:#fff;background:rgba(255,255,255,.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:0;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 19px;line-height:1.4}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{margin:0 auto;width:40px;height:20px;position:relative;overflow:hidden}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;padding:4px 4px 0 0;text-align:center;width:18px;height:14px;font:16px/14px Tahoma,Verdana,sans-serif;color:#c3c3c3;text-decoration:none;font-weight:700;background:0 0}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678, M12=.70710678, M21=-.70710678, M22=.70710678)}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}div.cartodb-tooltip-content-wrapper.dark{background:#000;background:rgba(0,0,0,.75);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#bf000000, endColorstr=#bf000000);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#bf000000, endColorstr=#bf000000)"}div.cartodb-tooltip-content-wrapper.dark h4{color:#999}div.cartodb-tooltip-content-wrapper.dark p{color:#FFF}div.cartodb-tooltip-content-wrapper.dark a{color:#397DB9}div.cartodb-tooltip{position:absolute;display:none;min-width:120px;max-width:180px;overflow-y:hidden;z-index:5}div.cartodb-tooltip-content-wrapper{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,.9);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#E5FFFFFF, endColorstr=#E5FFFFFF);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#E5FFFFFF, endColorstr=#E5FFFFFF)";zoom:1}div.cartodb-tooltip-content{display:block;padding:8px 8px 8px 9px}div.cartodb-tooltip-content h4{display:block;text-transform:uppercase;font:400 10px "Helvetica Neue",Helvetica,Arial;color:#AAA;word-wrap:break-word}div.cartodb-tooltip-content p{display:block;margin:0;padding:0 0 7px;font:400 12px "Helvetica Neue",Helvetica,Arial;color:#333;word-wrap:break-word}div.cartodb-tooltip-content p:last-child{padding:0}div.cartodb-tooltip-content a{color:#0078A8}div.cartodb-tooltip>p{font-family:robotoregular,Helvetica,Arial,Sans-serif;font-size:15px;color:#333;text-align:center;text-shadow:-1px -1px 0 #FFF,1px -1px 0 #FFF,-1px 1px 0 #FFF,1px 1px 0 #FFF} \ No newline at end of file +/* CartoDB.css minified version: 3.15.10 */ +div.cartodb-popup.dark .jspContainer:after{background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(0,0,0,0)),color-stop(100%,rgba(0,0,0,1)));background:-webkit-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,1));background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,1));background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,1));background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,1))}div.cartodb-popup.dark .jspContainer:before{background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(0,0,0,1)),color-stop(100%,rgba(0,0,0,0)));background:-webkit-linear-gradient(top,rgba(0,0,0,1),rgba(0,0,0,0));background:-moz-linear-gradient(top,rgba(0,0,0,1),rgba(0,0,0,0));background:-o-linear-gradient(top,rgba(0,0,0,1),rgba(0,0,0,0));background:linear-gradient(top,rgba(0,0,0,1),rgba(0,0,0,0))}div.cartodb-popup.dark{background:url(../img/dark.png) no-repeat -226px 0}div.cartodb-popup.dark div.cartodb-popup-content-wrapper{background:url(../img/dark.png) repeat-y -452px 0}div.cartodb-popup.dark div.cartodb-popup-tip-container{background:url(../img/dark.png) no-repeat 0 0}div.cartodb-popup.dark a.cartodb-popup-close-button{background:url(../img/dark.png) no-repeat 0 -23px}div.cartodb-popup.dark h4{color:#999}div.cartodb-popup.dark p{color:#FFF}div.cartodb-popup.dark a{color:#397DB9}div.cartodb-popup.dark p.empty{font-style:italic;color:#AAA}div.cartodb-popup.dark .jspDrag{background:#AAA;background:rgba(255,255,255,.5)}div.cartodb-popup.dark .jspDrag:hover{background:#DEDEDE;background:rgba(255,255,255,.8)}div.cartodb-popup.v2.dark{background:#000}div.cartodb-popup.v2.dark div.cartodb-popup-tip-container:after,div.cartodb-popup.v2.dark:before{border-top-color:#000}div.cartodb-popup.v2.dark a.cartodb-popup-close-button{background:#000}div.cartodb-popup.v2.dark a.cartodb-popup-close-button:after,div.cartodb-popup.v2.dark a.cartodb-popup-close-button:before{background:#fff}@media \0screen\,screen\9{div.cartodb-popup.v2.dark{border:4px solid #AAA}div.cartodb-popup.v2.dark div.cartodb-popup-tip-container{border-top:18px solid #000}div.cartodb-popup.v2.dark a.cartodb-popup-close-button{border:2px solid #AAA;color:#fff}div.cartodb-popup.v2.dark a.cartodb-popup-close-button:hover{border:2px solid #BBB}}div.cartodb-infowindow{position:absolute;z-index:12}div.cartodb-popup{position:relative;width:226px;height:auto;padding:7px 0 0;margin:0;background:url(../img/light.png) no-repeat -226px 0}div.cartodb-popup div.cartodb-popup-content-wrapper{width:190px;max-width:190px;padding:12px 19px;overflow-x:hidden;background:url(../img/light.png) repeat-y -452px 0}div.cartodb-popup div.cartodb-popup-content{display:block;width:190px;max-width:190px;min-height:5px;height:auto;max-height:185px;margin:0;padding:0;overflow-y:auto;overflow-x:hidden!important;outline:0;text-align:left}div.cartodb-popup .jspContainer:after,div.cartodb-popup .jspContainer:before{content:'';position:absolute;left:0;right:12px;display:block;height:10px;width:190px;z-index:5}div.cartodb-popup .jspContainer:after{bottom:0;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1));background:-moz-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1));background:-o-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1));background:linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#00ffffff', GradientType=0)}div.cartodb-popup .jspContainer:before{top:0;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(top,rgba(255,255,255,1),rgba(255,255,255,0));background:-moz-linear-gradient(top,rgba(255,255,255,1),rgba(255,255,255,0));background:-o-linear-gradient(top,rgba(255,255,255,1),rgba(255,255,255,0));background:linear-gradient(top,rgba(255,255,255,1),rgba(255,255,255,0));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#00ffffff', GradientType=0)}div.cartodb-popup div.cartodb-popup-tip-container{width:226px;height:20px;background:url(../img/light.png) no-repeat 0 0}div.cartodb-popup a.cartodb-popup-close-button{position:absolute;top:-9px;right:-9px;width:26px;height:26px;padding:0;background:url(../img/light.png) no-repeat 0 -23px;text-indent:-9999px;font-size:0;line-height:0;opacity:1;-ms-filter:"alpha(Opacity=100)";filter:alpha(Opacity=1);filter:alpha(opacity=100);text-transform:uppercase;z-index:3}div.cartodb-popup.header.no_fields div.cartodb-popup-content{display:none}div.cartodb-popup.header.no_fields div.cartodb-popup-content-wrapper div.cartodb-edit-buttons{padding-top:5px;margin-top:0}div.cartodb-popup.header.no_fields div.cartodb-edit-buttons{border:0;padding-top:0}div.cartodb-popup .jspContainer{overflow:hidden;position:relative;outline:0}div.cartodb-popup .jspContainer *{outline:0}div.cartodb-popup .jspPane{position:absolute;padding:4px 0 0!important;z-index:1}div.cartodb-popup .jspVerticalBar{position:absolute;top:0;right:0;width:6px;height:100%;background:0 0;z-index:10}div.cartodb-popup .jspHorizontalBar{position:absolute;bottom:0;left:0;width:100%;height:6px;background:0 0}div.cartodb-popup .jspHorizontalBar *,div.cartodb-popup .jspVerticalBar *{margin:0;padding:0}div.cartodb-popup .jspCap{display:none}div.cartodb-popup .jspHorizontalBar .jspCap{float:left}div.cartodb-popup .jspTrack{position:relative;cursor:pointer;background:0 0}div.cartodb-popup .jspDrag{position:relative;top:0;left:0;cursor:pointer;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;background:#999;background:rgba(0,0,0,.16)}div.cartodb-popup .jspDrag:hover{background:#666;background:rgba(0,0,0,.5);cursor:pointer}div.cartodb-popup .jspHorizontalBar .jspDrag,div.cartodb-popup .jspHorizontalBar .jspTrack{float:left;height:100%}div.cartodb-popup .jspArrow{background:#50506d;text-indent:-20000px;display:block;cursor:pointer}div.cartodb-popup .jspArrow.jspDisabled{cursor:default;background:#80808d}div.cartodb-popup .jspVerticalBar .jspArrow{height:16px}div.cartodb-popup .jspHorizontalBar .jspArrow{width:16px;float:left;height:100%}div.cartodb-popup .jspVerticalBar .jspArrow:focus{outline:0}div.cartodb-popup .jspCorner{background:#eeeef4;float:left;height:100%}* html div.cartodb-popup .jspCorner{margin:0 -3px 0 0}div.cartodb-popup h1,div.cartodb-popup h2,div.cartodb-popup h3,div.cartodb-popup h4,div.cartodb-popup h5,div.cartodb-popup h6{display:block;width:190px;margin:0;padding:0;font-weight:700;font-family:"Helvetica Neue",Helvetica,Arial;color:#CCC;text-transform:uppercase;word-wrap:break-word;line-height:120%}div.cartodb-popup h1{font-size:24px}div.cartodb-popup h2{font-size:20px}div.cartodb-popup h3{font-size:15px}div.cartodb-popup h4{font-size:11px}div.cartodb-popup h5{font-size:10px}div.cartodb-popup h6{font-size:9px}div.cartodb-popup p{display:block;width:190px;max-width:190px;margin:0;padding:0 0 7px;font:400 13px Helvetica,Arial;word-wrap:break-word}div.cartodb-popup p.italic{font-style:italic}div.cartodb-popup p.loading{position:relative;display:block;width:170px;max-width:170px;margin:0;padding:0 0 0 30px;font:400 13px Helvetica,Arial;font-style:italic;word-wrap:break-word;line-height:21px}div.cartodb-popup p.error{position:relative;display:block;width:170px;max-width:170px;margin:0;padding:0;font:400 13px Helvetica,Arial;font-style:italic;word-wrap:break-word;line-height:18px}div.cartodb-popup p.empty{font-style:italic}div.cartodb-popup div.spinner{position:absolute!important;display:inline;top:0;left:0;margin:10px 0 0 10px}div.cartodb-popup.v2{width:226px;padding:0;margin:0 0 14px;-moz-box-shadow:0 0 0 4px rgba(0,0,0,.15);-webkit-box-shadow:0 0 0 4px rgba(0,0,0,.15);box-shadow:0 0 0 4px rgba(0,0,0,.15);-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff}div.cartodb-popup.v2:before{content:'';position:absolute;bottom:-14px;left:0;width:0;height:0;margin-left:28px;border-left:0 solid transparent;border-right:14px solid transparent;border-top:14px solid #fff;z-index:2}div.cartodb-popup.v2 div.cartodb-popup-content-wrapper{width:auto;max-width:none;padding:12px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:0 0}div.cartodb-popup.v2 div.cartodb-popup-content{width:auto;max-width:none;display:block;background:0 0}div.cartodb-popup.v2 div.cartodb-popup-content h1,div.cartodb-popup.v2 div.cartodb-popup-content h2,div.cartodb-popup.v2 div.cartodb-popup-content h3,div.cartodb-popup.v2 div.cartodb-popup-content h4,div.cartodb-popup.v2 div.cartodb-popup-content h5,div.cartodb-popup.v2 div.cartodb-popup-content h6,div.cartodb-popup.v2 div.cartodb-popup-content p{width:auto;max-width:95%;display:block}div.cartodb-popup.v2 div.cartodb-popup-tip-container{position:absolute;bottom:-20px;left:-4px;width:20px;height:16px;margin-left:28px;background:0 0;overflow:hidden;z-index:0}div.cartodb-popup.v2 div.cartodb-popup-tip-container:before{content:'';position:absolute;width:20px;height:20px;left:0;top:-10px;margin-left:0;-ms-transform:skew(0,-45deg);-webkit-transform:skew(0,-45deg);transform:skew(0,-45deg);border-radius:0 0 0 10px;background:rgba(0,0,0,.15);z-index:0}div.cartodb-popup.v2.centered:before{content:'';position:absolute;width:0;height:0;left:-10px;bottom:-10px;margin-left:50%;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #fff;border-radius:0;-ms-transform:skew(0,0);-webkit-transform:skew(0,0);transform:skew(0,0);background:0 0;z-index:1}div.cartodb-popup.v2.centered p{width:160px;padding-bottom:0}div.cartodb-popup.v2.centered div.cartodb-popup-tip-container{left:-12px;width:24px;margin-left:50%}div.cartodb-popup.v2.centered div.cartodb-popup-tip-container:before{content:'';position:absolute;width:0;height:0;left:0;top:0;margin-left:0;border-left:12px solid transparent;border-right:12px solid transparent;border-top:12px solid rgba(0,0,0,.15);-ms-transform:skew(0,0);-webkit-transform:skew(0,0);transform:skew(0,0);background:0 0;z-index:0}div.cartodb-popup.v2 a.cartodb-popup-close-button{right:-12px;top:-12px;width:20px;height:20px;background:#fff;-webkit-border-radius:18px;-moz-border-radius:18px;border-radius:18px;box-shadow:0 0 0 3px rgba(0,0,0,.15)}div.cartodb-popup.v2 a.cartodb-popup-close-button:after,div.cartodb-popup.v2 a.cartodb-popup-close-button:before{content:'';position:absolute;top:9px;left:6px;width:8px;height:2px;background:#397DBA;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}div.cartodb-popup.v2 a.cartodb-popup-close-button:before{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg)}div.cartodb-popup.v2 a.cartodb-popup-close-button:after{-ms-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}div.cartodb-popup.v2 a.cartodb-popup-close-button:hover{box-shadow:0 0 0 3px rgba(0,0,0,.25)}@media \0screen\,screen\9{div.cartodb-popup.v2{border:4px solid #CCC}div.cartodb-popup.v2 div.cartodb-popup-tip-container{position:absolute;width:0;height:0;margin-left:28px;z-index:2;bottom:-18px;left:-4px;border-left:0 solid transparent;border-right:18px solid transparent;border-top:18px solid #fff}div.cartodb-popup.v2 a.cartodb-popup-close-button{right:-14px;top:-14px;width:18px;padding:0 0 0 2px;text-indent:0;font:700 11px Arial;font-weight:700;text-decoration:none;text-align:center;line-height:20px;border:2px solid #CCC}div.cartodb-popup.v2 a.cartodb-popup-close-button:after,div.cartodb-popup.v2 a.cartodb-popup-close-button:before{display:none}div.cartodb-popup.v2 a.cartodb-popup-close-button:hover{border:2px solid #999}}div.cartodb-popup.header.blue div.cartodb-popup-header{background:url(../img/headers.png) no-repeat 0 -40px}div.cartodb-popup.header.blue.header .cartodb-popup-header a{color:#fff}div.cartodb-popup.header.blue div.cartodb-popup-header h4{color:#1F4C7F}div.cartodb-popup.header.blue div.cartodb-popup-header span.separator{background:#225386}div.cartodb-popup.header.blue a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -226px -40px}div.cartodb-popup.header.blue a.cartodb-popup-close-button:hover{background-position:-226px -66px}div.cartodb-popup.v2.header.blue div.cartodb-popup-header{background:0 0;background:-ms-linear-gradient(top,#4F9CD7,#2B68A8);background:-o-linear-gradient(right,#4F9CD7,#2B68A8);background:-webkit-linear-gradient(top,#4F9CD7,#2B68A8);background:-moz-linear-gradient(right,#4F9CD7,#2B68A8);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#4F9CD7',endColorStr='#2B68A8',GradientType=0)"}div.cartodb-popup.v2.header.blue a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.header{padding:0;background:0 0;box-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;-o-box-shadow:none;border-bottom:0;border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-o-border-radius:0}div.cartodb-popup.header div.cartodb-popup-header{position:relative;width:188px;height:auto;max-height:62px;overflow:hidden;padding:17px 19px;background:url(../img/headers.png) no-repeat 0 -40px}div.cartodb-popup.header div.cartodb-popup-header h1{width:100%;margin:0;font:700 21px "Helvetica Neue",Helvetica,Arial;color:#FFF;line-height:23px;text-shadow:0 1px rgba(0,0,0,.5);word-wrap:break-word}div.cartodb-popup.header div.cartodb-popup-header h1 a{color:#fff;font-size:21px;word-wrap:break-word}div.cartodb-popup.header div.cartodb-popup-header h1 a:hover{text-decoration:underline}div.cartodb-popup.header div.cartodb-popup-header h1.loading{position:relative;display:block;width:auto;padding-right:0;padding-left:30px;font-size:14px;font-weight:400;line-height:19px}div.cartodb-popup.header div.cartodb-popup-header h1.error{position:relative;display:block;width:auto;padding-right:0;padding-left:0;font-size:14px;font-weight:400;font-style:italic;line-height:19px}div.cartodb-popup.header div.cartodb-popup-header h4{color:#1F4C7F}div.cartodb-popup.header div.cartodb-popup-header span.separator{position:absolute;bottom:0;left:4px;right:4px;height:1px;background:#225386}div.cartodb-popup.header div.cartodb-popup-content{max-height:150px}div.cartodb-popup.header a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -226px -40px}div.cartodb-popup.header a.cartodb-popup-close-button:hover{background-position:-226px -66px}div.cartodb-popup.header.v2.header{-moz-box-shadow:0 0 0 4px rgba(0,0,0,.15);-webkit-box-shadow:0 0 0 4px rgba(0,0,0,.15);box-shadow:0 0 0 4px rgba(0,0,0,.15);-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff}div.cartodb-popup.v2.header div.cartodb-popup-header{position:relative;width:auto;height:auto;max-height:62px;overflow:hidden;padding:17px 12px;background:0 0;background:-ms-linear-gradient(top,#4F9CD7,#2B68A8);background:-o-linear-gradient(right,#4F9CD7,#2B68A8);background:-webkit-linear-gradient(top,#4F9CD7,#2B68A8);background:-moz-linear-gradient(right,#4F9CD7,#2B68A8);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#4F9CD7',endColorStr='#2B68A8',GradientType=0)";-webkit-border-top-left-radius:2px;-webkit-border-top-right-radius:2px;-moz-border-radius-topleft:2px;-moz-border-radius-topright:2px;border-top-left-radius:2px;border-top-right-radius:2px}div.cartodb-popup.v2.header div.cartodb-popup-header:before{content:'';position:absolute;bottom:0;left:0;right:0;width:100%;height:1px;background:rgba(0,0,0,.1)}div.cartodb-popup.v2.header a.cartodb-popup-close-button{right:-12px;top:-12px;width:20px;height:20px;background:#fff;-webkit-border-radius:18px;-moz-border-radius:18px;border-radius:18px;box-shadow:0 0 0 3px rgba(0,0,0,.15)}div.cartodb-popup.v2.header a.cartodb-popup-close-button:after,div.cartodb-popup.v2.header a.cartodb-popup-close-button:before{content:'';position:absolute;top:9px;left:6px;width:8px;height:2px;background:#397DBA;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}div.cartodb-popup.v2.header a.cartodb-popup-close-button:before{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg)}div.cartodb-popup.v2.header a.cartodb-popup-close-button:after{-ms-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}div.cartodb-popup.v2.header a.cartodb-popup-close-button:hover{box-shadow:0 0 0 3px rgba(0,0,0,.25)}@media \0screen\,screen\9{div.cartodb-popup.header.v2{border-bottom:4px solid #CCC}div.cartodb-popup.v2.header div.cartodb-popup-header{background:#3B7FBD;-ms-filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr='#4F9CD7', endColorStr='#2B68A8', GradientType=0)}}div.cartodb-popup.header.green div.cartodb-popup-header{background:url(../img/headers.png) no-repeat -252px -40px}div.cartodb-popup.header.green div.cartodb-popup-header h4{color:#00916D}div.cartodb-popup.header.green div.cartodb-popup-header span.separator{background:#008E6A}div.cartodb-popup.header.green a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -478px -40px}div.cartodb-popup.header.green a.cartodb-popup-close-button:hover{background-position:-478px -66px}div.cartodb-popup.v2.header.green div.cartodb-popup-header{background:0 0;background:-ms-linear-gradient(top,#0C9,#00B185);background:-o-linear-gradient(right,#0C9,#00B185);background:-webkit-linear-gradient(top,#0C9,#00B185);background:-moz-linear-gradient(right,#0C9,#00B185);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#00CC99',endColorStr='#00B185',GradientType=0)"}div.cartodb-popup.v2.header.green a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.v2.header.green a.cartodb-popup-close-button:after,div.cartodb-popup.v2.header.green a.cartodb-popup-close-button:before{background:#0C9}@media \0screen\,screen\9{div.cartodb-popup.v2.header.green a.cartodb-popup-close-button{color:#0C9}}div.cartodb-popup.header.orange div.cartodb-popup-header{background:url(../img/headers.png) no-repeat -756px -40px}div.cartodb-popup.header.orange div.cartodb-popup-header h4{color:#CC2929}div.cartodb-popup.header.orange div.cartodb-popup-header span.separator{background:#CC2929}div.cartodb-popup.header.orange a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -982px -40px}div.cartodb-popup.header.orange a.cartodb-popup-close-button:hover{background-position:-982px -66px}div.cartodb-popup.v2.header.orange div.cartodb-popup-header{background:0 0;background:-ms-linear-gradient(top,#FF6825,#F33);background:-o-linear-gradient(right,#FF6825,#F33);background:-webkit-linear-gradient(top,#FF6825,#F33);background:-moz-linear-gradient(right,#FF6825,#F33);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#FF6825',endColorStr='#FF3333',GradientType=0)"}div.cartodb-popup.v2.header.orange a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.v2.header.orange a.cartodb-popup-close-button:after,div.cartodb-popup.v2.header.orange a.cartodb-popup-close-button:before{background:#CC2929}@media \0screen\,screen\9{div.cartodb-popup.v2.header.orange a.cartodb-popup-close-button{color:#CC2929}}div.cartodb-popup.header.with-image div.cartodb-popup-header{position:relative;background:url(../img/headers.png) no-repeat -1008px 0;height:138px;max-height:104px}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover{display:block;position:absolute;overflow:hidden;width:218px;height:135px;top:4px;left:4px;border-radius:4px 4px 0 0}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover .shadow{position:absolute;width:218px;height:55px;bottom:0;left:0;background:url(../img/shadow.png) no-repeat;z-index:100}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover #spinner{position:absolute;top:67px;left:109px}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover img{position:absolute;border-radius:4px 4px 0 0;display:none}div.cartodb-popup.header.with-image div.cartodb-popup-header .image_not_found{position:absolute;top:15px;left:15px;width:200px;display:none}div.cartodb-popup.header.with-image div.cartodb-popup-header .image_not_found a{display:-moz-inline-stack;display:inline-block;vertical-align:top;*vertical-align:auto;zoom:1;*display:inline;margin:3px 0 0 -2px;color:#888;font-size:13px;font-family:Helvetica,"Helvetica Neue",Arial,sans-serif;text-decoration:underline}div.cartodb-popup.header.with-image div.cartodb-popup-header .image_not_found a:hover{color:#888;text-decoration:underline}div.cartodb-popup.header.with-image div.cartodb-popup-header .cover .image_not_found i{display:-moz-inline-stack;display:inline-block;vertical-align:top;*vertical-align:auto;zoom:1;*display:inline;width:31px;height:22px;background:transparent url(../img/image_not_found.png)}div.cartodb-popup.header.with-image div.cartodb-popup-header h1{position:absolute;bottom:13px;left:18px;width:188px;z-index:150}div.cartodb-popup.header.with-image div.cartodb-popup-header h4{color:#CCC}div.cartodb-popup.header.with-image div.cartodb-popup-header span.separator{background:#CCC}div.cartodb-popup.header.with-image a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -226px -40px}div.cartodb-popup.header.with-image a.cartodb-popup-close-button:hover{background-position:-226px -66px}div.cartodb-popup.header.with-image .cartodb-popup-header h1{display:none}div.cartodb-popup.header.with-image .cartodb-popup-header h1.order1{display:block}div.cartodb-popup.header.with-image .cartodb-popup-content-wrapper .order1{display:none}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header{background:#2C2C2C;background:-ms-linear-gradient(top,#535353,#2C2C2C);background:-o-linear-gradient(right,#535353,#2C2C2C);background:-webkit-linear-gradient(top,#535353,#2C2C2C);background:-moz-linear-gradient(right,#535353,#2C2C2C);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#535353',endColorStr='#2C2C2C',GradientType=0)"}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header h1{width:85%}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header span.separator{left:0;right:0;background:#CCC}div.cartodb-popup.v2.header.with-image a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header .cover{display:block;width:100%;height:138px;top:0;left:0;-moz-border-radius:2px 2px 0 0;-webkit-border-radius:2px 2px 0 0;border-radius:2px 2px 0 0;overflow:hidden}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header .cover .shadow{width:100%;height:57px;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(0,0,0,0)),color-stop(100%,rgba(0,0,0,.8)));background:-webkit-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8));background:-moz-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8));background:-o-linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8));background:linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,.8));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#000000', GradientType=0)}div.cartodb-popup.v2.header.with-image div.cartodb-popup-header .cover img{-moz-border-radius:2px 2px 0 0;-webkit-border-radius:2px 2px 0 0;border-radius:2px 2px 0 0}div.cartodb-popup.header.yellow div.cartodb-popup-header{background:url(../img/headers.png) no-repeat -504px -40px}div.cartodb-popup.header.yellow div.cartodb-popup-header h4{color:#D8832A}div.cartodb-popup.header.yellow div.cartodb-popup-header span.separator{background:#CC7A29}div.cartodb-popup.header.yellow a.cartodb-popup-close-button{background:url(../img/headers.png) no-repeat -730px -40px}div.cartodb-popup.header.yellow a.cartodb-popup-close-button:hover{background-position:-730px -66px}div.cartodb-popup.v2.header.yellow div.cartodb-popup-header{background:0 0;background:-ms-linear-gradient(top,#FFBF0D,#F93);background:-o-linear-gradient(right,#FFBF0D,#F93);background:-webkit-linear-gradient(top,#FFBF0D,#F93);background:-moz-linear-gradient(right,#FFBF0D,#F93);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(startColorStr='#FFBF0D',endColorStr='#FF9933',GradientType=0)"}div.cartodb-popup.v2.header.yellow a.cartodb-popup-close-button{background:#fff}div.cartodb-popup.v2.header.yellow a.cartodb-popup-close-button:after,div.cartodb-popup.v2.header.yellow a.cartodb-popup-close-button:before{background:#CC7A29}@media \0screen\,screen\9{div.cartodb-popup.v2.header.yellow a.cartodb-popup-close-button{color:#CC7A29}}div.cartodb-popup h4{color:#CCC}div.cartodb-popup p{color:#333}div.cartodb-popup p.loading{color:#888}div.cartodb-popup p.error{color:#FF7F7F}div.cartodb-popup p.empty{color:#999}@-webkit-keyframes loading{to{opacity:1}}@-moz-keyframes loading{to{opacity:1}}@-ms-keyframes loading{to{opacity:1}}@keyframes loading{to{opacity:1}}@-webkit-keyframes pulse{to{opacity:1;-webkit-transform:scale(1)}}@-moz-keyframes pulse{to{opacity:1;-moz-transform:scale(1)}}@-ms-keyframes pulse{to{opacity:1;-ms-transform:scale(1)}}@keyframes pulse{to{opacity:1;transform:scale(1)}}div.cartodb-share{display:none;position:relative;float:right;margin:20px 20px 0 0;z-index:105}div.cartodb-share a{width:14px;height:14px;display:block;color:#397DB8;font-size:10px;font-weight:700;text-transform:uppercase;text-shadow:none;padding:7px;box-sizing:content-box;background:#fff url(../img/share.png) no-repeat 7px 8px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999}div.cartodb-share a:hover{background:#fff url(../img/share.png) no-repeat -28px 8px}div.cartodb-share a:active,div.cartodb-share a:hover:active{background:#fff url(../img/share.png) no-repeat 7px 8px}.cartodb-fullscreen{display:none;position:relative;margin:11px 0 0 20px;float:left;clear:both;z-index:105}.cartodb-fullscreen a{display:block;width:14px;height:14px;padding:7px;box-sizing:content-box;background:#fff url(../img/fullscreen.png) no-repeat 7px 3px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999}.cartodb-fullscreen a:active{background-position:7px 3px!important}.cartodb-fullscreen a:hover{background-position:-19px 5px}.cartodb-share-dialog{display:none}.cartodb-share-dialog .mamufas{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5);cursor:default;z-index:1000001}.cartodb-share-dialog .modal{position:absolute;top:50%;left:50%;margin-left:-216px;margin-top:-107px;webkit-box-shadow:rgba(0,0,0,.15) 0 0 0 4px;-moz-box-shadow:rgba(0,0,0,.15) 0 0 0 4px;box-shadow:rgba(0,0,0,.15) 0 0 0 4px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;font-weight:700;font-family:"Segoe UI Bold","Helvetica Bold",Helvetica,Arial;color:#333;line-height:normal}.cartodb-share-dialog.small .modal{margin-left:-108px;margin-top:-165px}.cartodb-share-dialog.small .block .buttons{margin:0 0 10px}.cartodb-share-dialog.small .block .buttons ul{border:0;padding:0}.cartodb-share-dialog.small .block .content .embed_code{padding:0}.cartodb-share-dialog .modal a.close{position:absolute;top:-15px;right:-15px;width:30px;height:15px;padding:7px 0 8px;background:#fff;font:400 13px Helvetica,Arial;text-decoration:none;webkit-box-shadow:rgba(0,0,0,.15) 0 0 0 4px;-moz-box-shadow:rgba(0,0,0,.15) 0 0 0 4px;box-shadow:rgba(0,0,0,.15) 0 0 0 4px;-webkit-border-radius:50px;-moz-border-radius:50px;-ms-border-radius:50px;-o-border-radius:50px;border-radius:50px;line-height:14px;text-align:center;z-index:105}.cartodb-share-dialog .block{background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;webkit-box-shadow:rgba(0,0,0,.15) 0 0 4px 3px;-moz-box-shadow:rgba(0,0,0,.15) 0 0 4px 3px;box-shadow:rgba(0,0,0,.15) 0 0 4px 3px}.cartodb-share-dialog .block .buttons ul{margin:0;padding:0 24px 0 0;border-right:1px solid #E5E5E5}.cartodb-share-dialog .block .buttons li{list-style:none;margin:0 0 4px;padding:0}.cartodb-share-dialog .block .buttons li a{display:block;padding:10px 13px 11px 30px;width:121px;font-size:13px;font-weight:700;color:#fff;background:#3D8FCA;text-decoration:none;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}@media only screen and (min-device-width :320px) and (max-device-width :480px){div.cartodb-header h1{width:78%}div.cartodb-header>p{width:80%}}@media only screen and (min-device-width :768px) and (max-device-width :1024px){div.cartodb-header h1{width:78%}div.cartodb-header>p{width:80%}}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){div.cartodb-header h1{width:78%}div.cartodb-header>p{width:80%}div.cartodb-zoom a{background:url(../img/other@2x.png) no-repeat 0 0!important;background-size:113px 34px!important}div.cartodb-zoom a.zoom_in{background-position:-68px 9px!important}div.cartodb-zoom a.zoom_out{background-position:-94px 10px!important}div.cartodb-header div.social a.facebook{background:url(../img/other@2x.png) no-repeat 0 0!important;background-size:113px 34px!important}div.cartodb-header div.social a.twitter{background:url(../img/other@2x.png) no-repeat -26px 0!important;background-size:113px 34px!important}div.cartodb-searchbox span.loader{background:url(../img/loader@2x.gif) no-repeat center center #fff!important;background-size:16px 16px!important}div.cartodb-mobile .aside div.cartodb-searchbox span.loader{background:url(../img/dark_loader@2x.gif) no-repeat center center #292929!important;background-size:16px 16px!important}div.cartodb-tiles-loader div.loader{background:url(../img/loader@2x.gif) no-repeat center center #fff!important;background-size:16px 16px!important}div.cartodb-searchbox input.submit{background:url(../img/other@2x.png) no-repeat -56px 0!important;background-size:113px 34px!important}.cartodb-mobile .aside .cartodb-searchbox input.submit{background:url(../img/mobile_zoom.png) no-repeat 0 0!important}.cartodb-mobile div.cartodb-slides-controller div.slides-controller-content a.prev{background:url(../img/slide_left@2x.png) no-repeat;background-size:16px 15px}.cartodb-mobile div.cartodb-slides-controller div.slides-controller-content a.next{background:url(../img/slide_right@2x.png) no-repeat;background-size:16px 15px}}.cartodb-share-dialog .block .buttons li a.twitter{background:#3D8FCA url(../img/twitter.png) no-repeat 10px 50%}.cartodb-share-dialog .block .buttons li a.twitter:hover{background-color:#3272A0}.cartodb-share-dialog .block .buttons li a.facebook{background:#3B5998 url(../img/facebook.png) no-repeat 10px 50%}.cartodb-share-dialog .block .buttons li a.facebook:hover{background-color:#283C65}.cartodb-share-dialog .block .buttons li a.link{background:#f37f7b url(../img/link.png) no-repeat 10px 50%}.cartodb-share-dialog .block .buttons li a.link:hover{background-color:#DC6161}.cartodb-share-dialog .block a,.cartodb-share-dialog .block h3,.cartodb-share-dialog .block label,.cartodb-share-dialog .block p{letter-spacing:0}.cartodb-share-dialog .block div.head{position:relative;padding:5px 26px;border-bottom:1px solid #E5E5E5}.cartodb-share-dialog .block h3{margin:1em 0;font-size:15px;font-weight:700}.cartodb-share-dialog .block h4{font-size:13px;font-weight:700;color:#666;padding:0;margin:0;margin:0 0 9px}.cartodb-share-dialog .block .content .buttons,.cartodb-share-dialog .block .content .embed_code{display:inline-block;zoom:1;*display:inline;vertical-align:top}.cartodb-share-dialog .block .content .embed_code{padding-left:24px}.cartodb-share-dialog .block .content .embed_code textarea{resize:none;padding:5px;width:153px;height:104px;border:1px solid #C3C3C3;background:#F5F5F5;font-size:11px;color:#666;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px}.cartodb-share-dialog .block .content{padding:20px 26px 30px}.cartodb-mobile{width:100%;height:100%;z-index:100000000}.cartodb-mobile .cartodb-header{background:0 0;z-index:100000}.cartodb-mobile .cartodb-header .content{padding:0}.cartodb-mobile .cartodb-header .hgroup{position:relative;height:40px;padding:10px}.cartodb-mobile.with-fullscreen .cartodb-header .hgroup{position:relative;margin-left:60px;margin-right:70px}.cartodb-mobile.with-header .cartodb-header .content .hgroup .description,.cartodb-mobile.with-header .cartodb-header .content .hgroup .title{display:block}.cartodb-mobile .cartodb-header .content .description,.cartodb-mobile .cartodb-header .content .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cartodb-mobile .cartodb-header .content .button{height:58px;width:58px;background-color:rgba(0,0,0,.5);line-height:normal;z-index:99999}.cartodb-mobile.with-header .cartodb-header,.cartodb-mobile.with-slides .cartodb-header{background-color:rgba(0,0,0,.5)}.cartodb-mobile.with-fullscreen .cartodb-header .content .fullscreen{display:block}.cartodb-mobile.with-header .cartodb-header .content .fullscreen{background:0 0}.cartodb-mobile .cartodb-header .content .fullscreen{display:none;position:relative;top:0;left:0;float:left;width:60px;height:60px;margin:auto;padding:0;background:rgba(0,0,0,.5);cursor:pointer;z-index:10;-webkit-border-radius:0 0 5px;-moz-border-radius:0 0 5px;-ms-border-radius:0 0 5px;-o-border-radius:0 0 5px;border-radius:0 0 5px;-webkit-transform-style:"ease-in";-moz-transform-style:"ease-in";-ms-transform-style:"ease-in";-o-transform-style:"ease-in";transform-style:"ease-in";-webkit-transition-property:background;-moz-transition-property:background;-o-transition-property:background;transition-property:background;-webkit-transition-duration:150ms;-moz-transition-duration:150ms;-o-transition-duration:150ms;transition-duration:150ms}.cartodb-mobile.with-header .cartodb-header .content .fullscreen{border-right:1px solid rgba(255,255,255,.35);-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}.cartodb-mobile .cartodb-header .content .fullscreen:hover,.cartodb-mobile.with-header .cartodb-header .content .fullscreen:hover{background:rgba(0,0,0,.3)}.cartodb-mobile .cartodb-header .content .fullscreen:before{content:'';width:60px;height:60px;background:url(../img/fullscreen_mobile.png) no-repeat 50% 50%;background-size:28px 28px;position:absolute}.cartodb-mobile.with-layers .cartodb-header .content .toggle,.cartodb-mobile.with-search .cartodb-header .content .toggle{display:block}.cartodb-mobile .cartodb-header .content .toggle{display:none;position:relative;top:0;right:0;float:right;width:70px;height:60px;margin:auto;padding:0;background:rgba(0,0,0,.5);cursor:pointer;z-index:10;-webkit-border-radius:0 0 0 5px;-moz-border-radius:0 0 0 5px;-ms-border-radius:0 0 0 5px;-o-border-radius:0 0 0 5px;border-radius:0 0 0 5px;-webkit-transform-style:"ease-in";-moz-transform-style:"ease-in";-ms-transform-style:"ease-in";-o-transform-style:"ease-in";transform-style:"ease-in";-webkit-transition-property:background;-moz-transition-property:background;-o-transition-property:background;transition-property:background;-webkit-transition-duration:150ms;-moz-transition-duration:150ms;-o-transition-duration:150ms;transition-duration:150ms}.cartodb-mobile .cartodb-header .content .toggle:hover,.cartodb-mobile.with-header .cartodb-header .content .toggle:hover{background:rgba(0,0,0,.3)}.cartodb-mobile.with-header .cartodb-header .content .toggle{background:0 0;border-left:1px solid rgba(255,255,255,.35);-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}.cartodb-mobile .cartodb-header .content .toggle:before{content:'';width:70px;height:60px;background:url(../img/toggle_aside.png) no-repeat 50% 50%;background-size:30px 30px;position:absolute}.cartodb-mobile.with-zoom .cartodb-zoom{float:left;position:relative;z-index:100000}.cartodb-mobile .aside{position:absolute;width:250px;height:100%;top:0;right:-250px;background:#2D2D2D;cursor:default;z-index:1000010}.cartodb-mobile .aside .cartodb-searchbox{position:relative;display:none;float:none;margin:0;width:100%;height:auto;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background:0 0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border:0;border-bottom:1px solid #505050;z-index:105}.cartodb-mobile .aside .cartodb-searchbox input.text{border:0;position:initial;top:initial;left:initial;height:39px;padding:10px 18px;width:185px;font-size:13px;color:#fff}.cartodb-mobile .aside .cartodb-searchbox input.text::-webkit-input-placeholder{font-style:italic}.cartodb-mobile .aside .cartodb-searchbox input.text:-moz-placeholder{font-style:italic}.cartodb-mobile .aside .cartodb-searchbox input.text::-moz-placeholder{font-style:italic}.cartodb-mobile .aside .cartodb-searchbox input.text:-ms-input-placeholder{font-style:italic}.cartodb-mobile .aside .cartodb-searchbox span.loader{left:initial;top:18px;right:14px;background:url(../img/dark_loader.gif) no-repeat center center}.cartodb-mobile .aside .cartodb-searchbox input.submit{right:18px;top:23px;width:14px;height:14px;left:initial;outline:0;cursor:pointer;background:url(../img/mobile_zoom.png) no-repeat 0 0}.cartodb-mobile .aside .layer-container{position:relative;height:100%}.cartodb-mobile .aside .scrollpane{width:100%;height:100%;overflow:hidden;outline:0}.cartodb-mobile .aside .scrollpane .jspContainer{overflow:hidden;position:relative}.cartodb-mobile .aside .scrollpane .jspPane{position:absolute}.cartodb-mobile .aside .scrollpane .jspVerticalBar{position:absolute;top:0;right:7px;width:5px;height:100%;background:0 0;z-index:20}.cartodb-mobile .aside .scrollpane .jspVerticalBar *{margin:0;padding:0}.cartodb-mobile .aside .scrollpane .jspCap{display:none}.cartodb-mobile .aside .scrollpane .jspTrack{background:0 0;position:relative}.cartodb-mobile .aside .scrollpane .jspDrag{background:rgba(#BBB,.5);border-radius:5px;position:relative;top:0;left:0;cursor:pointer}.cartodb-mobile .aside .scrollpane .jspArrow{background:0 0;text-indent:-20000px;display:block;cursor:pointer}.cartodb-mobile .aside .scrollpane .jspVerticalBar .jspArrow{height:10px}.cartodb-mobile .aside .scrollpane .jspVerticalBar .jspArrow:focus{outline:0}.cartodb-mobile .aside .scrollpane .jspCorner{background:#eeeef4;float:left;height:100%}.cartodb-mobile .aside .layer-container>h3{padding:23px 20px;color:#999;font:700 12px Helvetica,Arial,sans-serif;text-transform:uppercase;background:#292929;border-bottom:1px solid #585858}.cartodb-mobile .aside .layer-container .layers{margin:0;padding:0 10px}.cartodb-mobile .aside .layer-container .layers>li{padding:5px 10px;color:#fff;list-style:none;border-bottom:1px solid #585858}.cartodb-mobile .aside .layer-container .layers>li:last-child,.cartodb-mobile .aside .layer-container .layers>li:last-child h3{border:0}.cartodb-mobile .aside .layer-container .layers>li a.toggle{width:21px;height:10px;background:#191919;position:relative;top:2px;float:right;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px}.cartodb-mobile .aside .layer-container .layers>li a.toggle.hide{display:none}.cartodb-mobile .aside .layer-container .layers>li.hidden a.toggle:before{left:0}.cartodb-mobile .aside .layer-container .layers>li a.toggle:before{position:absolute;content:'';top:1px;right:0;width:7px;height:7px;-webkit-border-radius:100px;-moz-border-radius:100px;-ms-border-radius:100px;-o-border-radius:100px;border-radius:100px;background:#fff}.cartodb-mobile .aside .layer-container .layers>li h3{font:700 12px Helvetica,Arial,sans-serif;text-transform:uppercase;padding:12px 0 13px}.cartodb-mobile .aside .layer-container .layers>li.has-toggle h3{cursor:pointer}.cartodb-mobile .aside .layer-container .layers>li.has-legend.hidden h3,.cartodb-mobile .aside .layer-container .layers>li.hidden h3{color:#666;border:0;padding:12px 0 13px}.cartodb-mobile .aside .layer-container .layers>li.hidden.has-legend div.cartodb-legend{display:none!important}.cartodb-mobile .aside .layer-container .layers>li.hidden.has-legend h3{margin-bottom:0}.cartodb-mobile .aside .layer-container .layers>li.has-legend h3{border-bottom:1px solid #585858}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend{position:relative;border:0;webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background:0 0;margin:10px 0 18px;padding:2px 0 0;bottom:auto;right:auto;cursor:text}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend.bubble ul li.graph{border:0}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend.bubble ul li.graph .bubbles{background:url(../img/dark_bubbles.png) no-repeat 0 0}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend .graph{border:1px solid #1A1108}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend ul li{height:auto;padding:0;font-size:12px;color:#fff;font-weight:400;font-family:Helvetica,Arial,sans-serif;text-transform:none;line-height:normal}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend.intensity ul li.graph{height:22px}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend ul li .bullet{margin-top:2px}.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend ul li.max,.cartodb-mobile .aside .layer-container .layers>li div.cartodb-legend ul li.min{font-size:10px}.cartodb-mobile div.cartodb-timeslider .slider-wrapper{position:absolute;top:17px}.cartodb-mobile div.cartodb-timeslider .slider{width:100%}.cartodb-mobile div.cartodb-timeslider{height:40px;margin-bottom:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border:1px solid #E5E5E5;border-left:0;border-right:0;border-top:1px solid rgba(0,0,0,.2);z-index:1000001}.cartodb-mobile div.cartodb-timeslider .slider-wrapper{display:block;width:100%;height:4px;padding:0}.cartodb-mobile div.cartodb-timeslider{width:100%!important}.cartodb-mobile div.cartodb-timeslider ul{width:100%;position:relative;clear:both;overflow:hidden}.cartodb-mobile div.cartodb-timeslider ul li{display:block;background:#fff;float:left}.cartodb-mobile div.cartodb-timeslider ul li.controls{width:50px}.cartodb-mobile div.cartodb-timeslider ul li.time{width:120px}.cartodb-mobile div.cartodb-timeslider ul li.last{position:absolute;left:180px;right:10px}.cartodb-mobile div.cartodb-timeslider ul li.controls a.button{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}.cartodb-mobile .cartodb-attribution{display:none;list-style:none;background:#fff;position:absolute;padding:9px 12px;margin:0;right:20px;bottom:20px;color:#999;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;z-index:10000001;font:12px/1.5 "Helvetica Neue",Arial,Helvetica,sans-serif}.cartodb-mobile .cartodb-attribution a{color:#0078A8}.cartodb-mobile .cartodb-attribution li{padding:0;margin:3px;display:inline-block;zoom:1;*display:inline;vertical-align:top;color:#999}.cartodb-mobile .cartodb-attribution li a{text-transform:capitalize;color:#0078A8}.cartodb-mobile .backdrop{display:none;position:absolute;top:0;left:0;right:0;bottom:0;background:#000;filter:alpha(opacity=20);filter:alpha(Opacity=20);opacity:.2;z-index:10000000}.cartodb-mobile.with-torque .cartodb-attribution-button{bottom:59px}.cartodb-mobile .cartodb-attribution-button{display:none;width:20px;height:20px;position:absolute;right:20px;bottom:20px;color:#999;text-align:center;text-decoration:none;-webkit-border-radius:100px;-moz-border-radius:100px;-ms-border-radius:100px;-o-border-radius:100px;border-radius:100px;background:#fff url(../img/bg-attribution-button.png) no-repeat 49% 50%;font:12px/1.5 "Helvetica Neue",Arial,Helvetica,sans-serif;z-index:10}.cartodb-mobile .cartodb-attribution-button:before{position:absolute;content:'';top:-3px;left:-3px;width:20px;height:20px;border:3px solid rgba(0,0,0,.3);-webkit-border-radius:100px;-moz-border-radius:100px;-ms-border-radius:100px;-o-border-radius:100px;border-radius:100px;-webkit-transform-style:"ease-in";-moz-transform-style:"ease-in";-ms-transform-style:"ease-in";-o-transform-style:"ease-in";transform-style:"ease-in";-webkit-transition-property:border;-moz-transition-property:border;-o-transition-property:border;transition-property:border;-webkit-transition-duration:150ms;-moz-transition-duration:150ms;-o-transition-duration:150ms;transition-duration:150ms}.cartodb-mobile .cartodb-attribution-button:hover:before{border:3px solid rgba(0,0,0,.7)}.cartodb-mobile .cartodb-slides-controller{position:absolute;bottom:0;top:auto;padding:0;line-height:0;z-index:9}.cartodb-mobile .cartodb-slides-controller .slides-controller-content{padding:20px 0}.cartodb-mobile .cartodb-slides-controller .slides-controller-content .prev{margin:0 20px 0 0}.cartodb-mobile .cartodb-slides-controller .slides-controller-content .next{margin:0 0 0 20px}.cartodb-mobile .cartodb-slides-controller .slides-controller-content .next:before,.cartodb-mobile .cartodb-slides-controller .slides-controller-content .prev:after,.cartodb-mobile .cartodb-slides-controller .slides-controller-content ul{display:none}div.cartodb-legend-stack{position:absolute;bottom:35px;right:20px;webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;background:#fff;z-index:105;cursor:text}div.cartodb-legend-stack div.cartodb-legend{position:relative;top:auto;right:auto;left:auto;bottom:auto;background:0 0;border:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;border-bottom:1px solid #999;webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;cursor:text}div.cartodb-legend-stack div.cartodb-legend:last-child{border-bottom:0}div.cartodb-legend{position:absolute;bottom:35px;right:20px;padding:13px 15px 14px;font:400 13px Helvetica,Arial;color:#858585;text-align:left;webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;background:#fff;z-index:105}div.cartodb-legend .legend-title{margin:0 0 10px;text-align:left;color:#666;font-weight:700;font-size:11px;text-transform:uppercase}div.cartodb-legend ul{padding:0;margin:0;list-style:none}div.cartodb-legend ul li{padding:0;margin:0;font-size:10px;color:#666;font-weight:700;font-family:Helvetica,Arial;text-transform:uppercase;line-height:normal}div.cartodb-legend-stack div.cartodb-legend.none,div.cartodb-legend.none{display:none}div.map div.cartodb-legend-stack div.cartodb-legend.wrapper .cartodb-legend{padding:0;display:block}div.cartodb-legend.wrapper .cartodb-legend{display:block;padding:0}div.cartodb-legend.category ul li,div.cartodb-legend.color ul li,div.cartodb-legend.custom ul li{position:relative;margin:0 0 7px;font-size:10px;color:#666;font-weight:700;font-family:Helvetica,Arial;text-transform:uppercase;text-align:left;height:10px;line-height:10px;vertical-align:middle}div.cartodb-legend.category ul li.bkg,div.cartodb-legend.color ul li.bkg,div.cartodb-legend.custom ul li.bkg{height:20px;line-height:24px;margin:0 0 15px}div.cartodb-legend.category ul li.bkg .bullet,div.cartodb-legend.color ul li.bkg .bullet,div.cartodb-legend.custom ul li.bkg .bullet{height:20px;width:20px;border:1px solid rgba(0,0,0,.3);border:0;background-size:26px 26px!important;background-position:center center!important;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}div.cartodb-legend.category ul li.bkg:last-child,div.cartodb-legend.color ul li.bkg:last-child,div.cartodb-legend.custom ul li.bkg:last-child{margin:0 0 5px}div.cartodb-legend.category ul li:last-child,div.cartodb-legend.color ul li:last-child,div.cartodb-legend.custom ul li:last-child{margin:0}div.cartodb-legend.category ul li .bullet,div.cartodb-legend.color ul li .bullet,div.cartodb-legend.custom ul li .bullet{float:left;margin:0 5px 0 0;width:3px;height:3px;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;padding:2px;background:#fff;border:1px solid rgba(0,0,0,.2);z-index:1000}div.cartodb-legend.bubble{text-align:center}div.cartodb-legend.bubble ul{clear:both;overflow:hidden;display:-moz-inline-stack;display:inline-block}div.cartodb-legend.bubble ul li{position:relative;float:left;top:15px}div.cartodb-legend.bubble ul li.graph{top:0;width:120px;height:40px;margin:0 10px;background:#f1f1f1}div.cartodb-legend.bubble ul li.graph .bubbles{background:url(../img/bubbles.png) no-repeat 0 0;width:120px;height:40px}div.cartodb-legend.choropleth{padding:13px 15px 15px}div.cartodb-legend.choropleth ul{min-width:210px}div.cartodb-legend.choropleth li.min{float:left;margin:0 0 5px}div.cartodb-legend.choropleth li.max{float:right;margin:0 0 5px}div.cartodb-legend.choropleth li.graph div{width:10px;height:22px}div.cartodb-legend.choropleth li.graph .quartile{display:table-cell}div.cartodb-legend.choropleth li.graph.count_7 .quartile{width:30px}div.cartodb-legend.choropleth li.graph.count_5 .quartile{width:42px}div.cartodb-legend.choropleth li.graph.count_3 .quartile{width:70px}div.cartodb-legend.choropleth li.graph .colors{display:table-row}div.cartodb-legend.choropleth li.graph{clear:both;overflow:hidden;display:table;width:100%;height:22px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;border:1px solid #b3b3b3}div.cartodb-legend.density{padding:13px 15px 15px}div.cartodb-legend.density ul{min-width:210px}div.cartodb-legend.density li.min{float:left;margin:0 0 5px}div.cartodb-legend.density li.max{float:right;margin:0 0 5px}div.cartodb-legend.density li.graph div{width:10px;height:22px}div.cartodb-legend.density li.graph .quartile{display:table-cell}div.cartodb-legend.density li.graph.count_7 .quartile{width:30px}div.cartodb-legend.density li.graph.count_5 .quartile{width:42px}div.cartodb-legend.density li.graph.count_3 .quartile{width:70px}div.cartodb-legend.density li.graph .colors{display:table-row}div.cartodb-legend.density li.graph{clear:both;overflow:hidden;display:table;width:100%;height:22px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;border:1px solid #b3b3b3}div.cartodb-legend.intensity{padding:13px 15px 15px}div.cartodb-legend.intensity ul{min-width:210px}div.cartodb-legend.intensity li.min{float:left;margin:0 0 5px}div.cartodb-legend.intensity li.max{float:right;margin:0 0 5px}div.cartodb-legend.intensity li.graph{clear:both;width:100%;height:22px;background:#f1f1f1;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);-o-box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);-ms-box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);box-shadow:inset 0 0 0 1px rgba(0,0,0,.2)}div.cartodb-zoom{position:relative;float:left;display:block;margin:20px 0 0 20px;width:28px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;z-index:105}div.cartodb-zoom a{position:relative;display:block;width:28px;height:28px;padding:0;font:700 20px Arial;color:#999;text-align:center;text-decoration:none;text-indent:-9999px;line-height:0;font-size:0;background:url(../img/other.png) no-repeat 0 0}div.cartodb-zoom a.zoom_in{border-bottom:1px solid #E6E6E6;background-position:-68px 10px;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px}div.cartodb-zoom a.zoom_in:hover{background-position:-68px -14px;cursor:pointer}div.cartodb-zoom a.zoom_out{background-position:-94px 10px;-webkit-border-bottom-left-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-bottomright:4px;border-bottom-left-radius:4px;border-bottom-right-radius:4px}div.cartodb-zoom a.zoom_out:hover{background-position:-94px -14px;cursor:pointer}div.cartodb-zoom a.disabled{filter:alpha(opacity=20);filter:alpha(Opacity=20);opacity:.2}div.cartodb-zoom a.disabled:hover{cursor:default;color:#999}div.cartodb-zoom-info{position:absolute;display:block;top:100px;left:20px;margin:20px 0 0;width:28px;height:28px;font:400 13px Helvetica,Arial;color:#858585;text-align:center;line-height:28px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;background:#fff;z-index:105}div.cartodb-tiles-loader{float:left;display:block;clear:both}div.cartodb-tiles-loader div.loader{position:relative;display:block;margin:15px 0 0 20px;width:28px;height:28px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:url(../img/loader.gif) no-repeat center center #fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;z-index:105}div.cartodb-layer-selector-box{display:none;position:relative;float:right;margin:20px 20px 0 0;width:142px;height:29px;color:#CCC;font-size:13px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;z-index:100000}div.cartodb-layer-selector-box a.layers{float:left;width:126px;padding:6px 8px;line-height:20px;color:#CCC;text-decoration:none;font-family:robotoregular,Helvetica,Arial,Sans-serif}div.cartodb-layer-selector-box a.layers:hover{color:#bbb}div.cartodb-layer-selector-box a.layers:hover .count{background:#ccc}div.cartodb-layer-selector-box a.layers .count{position:absolute;right:6px;top:6px;width:auto;padding:3px 6px;margin:0;font-size:10px;color:#fff;line-height:12px;background:#DDD;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}div.cartodb-layer-selector-box div.cartodb-dropdown{padding:0;margin:0}div.cartodb-layer-selector-box div.cartodb-dropdown ul{padding:0;margin:0;list-style:none;border:1px solid 999999}div.cartodb-layer-selector-box div.cartodb-dropdown ul li{border-bottom:1px solid #EDEDED;position:relative}div.cartodb-layer-selector-box div.cartodb-dropdown ul li:last-child{border-bottom:0}div.cartodb-layer-selector-box div.cartodb-dropdown ul li:hover{background:#fff}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.layer{display:-moz-inline-stack;display:inline-block;vertical-align:middle;width:104px;padding:13px 13px 15px;zoom:1;color:#666;font:400 13px "Helvetica Neue",Helvetica,Arial;text-decoration:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}div.cartodb-layer-selector-box div.cartodb-dropdown ul li:hover a.layer{text-decoration:underline;color:#545454}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch{position:absolute;top:13px;right:10px;text-indent:-9999px;vertical-align:middle;width:23px;height:12px;padding:0;-webkit-border-radius:12px;-moz-border-radius:12px;-ms-border-radius:12px;-o-border-radius:12px;border-radius:12px;-webkit-transform-style:"linear";-moz-transform-style:"linear";-ms-transform-style:"linear";-o-transform-style:"linear";transform-style:"linear";-webkit-transition-property:left;-moz-transition-property:left;-o-transition-property:left;transition-property:left;-webkit-transition-duration:180ms;-moz-transition-duration:180ms;-o-transition-duration:180ms;transition-duration:180ms;text-decoration:none;border:1px solid #44759E}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch:before{position:absolute;content:' ';top:0;left:0;width:100%;height:100%;-webkit-border-radius:12px;-moz-border-radius:12px;-ms-border-radius:12px;-o-border-radius:12px;border-radius:12px;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,rgba(0,0,0,.18)),color-stop(100%,rgba(0,0,0,0)));background:-webkit-linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,0));background:-moz-linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,0));background:-o-linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,0));background:linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,0));z-index:0}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch span.handle{position:absolute;top:0;width:10px;height:10px;-webkit-border-radius:12px;-moz-border-radius:12px;-ms-border-radius:12px;-o-border-radius:12px;border-radius:12px;border:1px solid #44759e;background:#F2F2F2;z-index:2;-webkit-transform-style:"linear";-moz-transform-style:"linear";-ms-transform-style:"linear";-o-transform-style:"linear";transform-style:"linear";-webkit-transition-property:left;-moz-transition-property:left;-o-transition-property:left;transition-property:left;-webkit-transition-duration:180ms;-moz-transition-duration:180ms;-o-transition-duration:180ms;transition-duration:180ms}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.enabled{border-color:#44759E;background:#56AFEF}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.enabled span.handle{left:12px;border-color:#44759E}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.disabled{opacity:1;-ms-filter:"alpha(Opacity=100)";filter:alpha(Opacity=1);filter:alpha(opacity=100);border-color:#CCC;background:#D8D8D8}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch span.handle{left:0;border-color:#999}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch:hover{cursor:pointer!important}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.working{opacity:.5;-ms-filter:"alpha(Opacity=50)";filter:alpha(Opacity=.5);filter:alpha(opacity=50)}div.cartodb-layer-selector-box div.cartodb-dropdown ul li a.switch.working:hover{cursor:default!important}div.cartodb-searchbox{position:relative;display:none;float:right;margin:20px 20px 0 0;width:142px;height:29px;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;z-index:105}div.cartodb-searchbox span.loader{position:absolute;display:none;top:3px;left:3px;width:22px;height:22px;background:url(../img/loader.gif) no-repeat center center #fff;z-index:105}div.cartodb-searchbox input.text{position:absolute;top:6px;left:30px;width:103px;padding:0;margin:0;line-height:17px;border:0;background:0 0;border-bottom:1px dotted #CCC;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;font:400 14px Arial;color:#999;text-align:left;z-index:2}div.cartodb-searchbox input.text:focus{outline:0;border-color:#999;color:#666}div.cartodb-searchbox input.submit{position:absolute;left:8px;top:8px;width:12px;height:12px;text-indent:-9999px;font-size:0;line-height:0;text-transform:uppercase;border:0;background:url(../img/other.png) no-repeat -56px 0;z-index:1}div.cartodb-searchbox input.submit:hover{cursor:pointer}div.cartodb-infobox{padding:20px;position:absolute;display:inline-block;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;text-align:left;z-index:105}div.cartodb-dropdown{position:absolute;display:none;background:#fff;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;border:0;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;-ms-box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;-o-box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;box-shadow:rgba(0,0,0,.2) 0 0 4px 1px;z-index:150}div.cartodb-dropdown.border{border:1px solid #999}div.cartodb-dropdown div.tail{position:absolute;top:-6px;right:10px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #999;z-index:0}div.cartodb-dropdown div.tail span.border{position:absolute;top:1px;left:-6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;z-index:2}div#cartodb-gmaps-attribution{position:absolute;display:block;bottom:13px;right:0;height:10px;line-height:10px;padding:0 6px 4px;background:#fff;background:rgba(245,245,245,.7);font-family:Roboto,Arial,sans-serif!important;font-size:11px;font-weight:400;color:#444!important;white-space:nowrap;direction:ltr;text-align:right;background-position:initial initial;background-repeat:initial initial;border:0;z-index:10000}div#cartodb-gmaps-attribution a{color:#444;text-decoration:none}div.cartodb-timeslider{position:absolute;display:inline-block;height:40px;width:auto!important;margin-bottom:30px;padding:0;-webkit-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;-moz-box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;box-shadow:rgba(0,0,0,.2) 0 0 4px 2px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #999;text-align:left;z-index:105}div.cartodb-timeslider ul{display:block;height:40px;margin:0;padding:0;line-height:40px;list-style:none;cursor:default}div.cartodb-timeslider ul li{display:inline-block;zoom:1;*display:inline;vertical-align:top;height:40px;_height:40px;width:auto;line-height:40px;border-right:1px solid #E5E5E5}div.cartodb-timeslider ul li.last{border-right:0}div.cartodb-timeslider a.button{display:block;width:48px;height:40px;text-indent:-9999px;line-height:0;font-size:0;background:url(../img/slider.png) no-repeat -2px -55px}div.cartodb-timeslider a.button:hover{background-position:-42px -55px}div.cartodb-timeslider a.button.stop{background-position:-2px -4px}div.cartodb-timeslider a.button.stop:hover{background-position:-42px -4px}div.cartodb-timeslider p{width:120px;height:40px;margin:0;padding:0 5px 0 0;line-height:40px;font-size:13px;font-weight:700;font-family:Helvetica,Arial;text-align:center;color:#999}.cartodb-header{display:none;position:relative;width:100%;background-color:rgba(0,0,0,.5);font-family:'Helvetica Neue',Helvetica,sans-serif;line-height:normal;z-index:99999}.cartodb-header .content{padding:10px}.cartodb-header .content a{color:#fff}.cartodb-header .content a:hover{color:#ccc}.cartodb-header .content .title{display:none;margin:0 0 5px;line-height:normal;font-family:'Helvetica Neue',Helvetica,sans-serif;font-weight:700;font-size:15px;color:#fff}.cartodb-header .content .description{display:none;font-family:'Helvetica Neue',Helvetica,sans-serif;line-height:normal;color:#fff;font-size:13px}.cartodb-overlay.overlay-annotation,.cartodb-overlay.overlay-text{position:absolute;display:none;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;font-size:20px;line-height:normal;color:#fff;-ms-word-break:break-word;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto;z-index:11}.cartodb-overlay.overlay-annotation .content,.cartodb-overlay.overlay-text .content{padding:10px}.cartodb-overlay.overlay-text .text{font-size:20px;line-height:normal;color:#fff;-ms-word-break:break-word;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto}.cartodb-overlay.overlay-annotation .text strong,.cartodb-overlay.overlay-text .text strong{font-weight:700}.cartodb-overlay.overlay-annotation .text em,.cartodb-overlay.overlay-text .text em{font-style:italic}.cartodb-overlay.overlay-annotation div.text a,.cartodb-overlay.overlay-text div.text a{color:inherit}.cartodb-overlay.overlay-annotation .text a:hover,.cartodb-overlay.overlay-text .text a:hover{color:inherit;filter:alpha(Opacity=80);opacity:.8}.cartodb-overlay.overlay-annotation{-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px}.cartodb-overlay.overlay-annotation .content{padding:5px}.cartodb-overlay.overlay-annotation.align-right .stick .ball{left:auto;right:-6px}.cartodb-overlay.overlay-annotation .stick{position:absolute;top:50%;left:-50px;margin-top:-1px;width:50px;height:2px;background:#333}.cartodb-overlay.overlay-annotation .stick .ball{position:absolute;left:-6px;top:50%;margin-top:-3px;width:6px;height:6px;background:#333;-webkit-border-radius:200px;-moz-border-radius:200px;-ms-border-radius:200px;-o-border-radius:200px;border-radius:200px}.cartodb-overlay.image-overlay{display:none;position:absolute;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;z-index:11}.cartodb-overlay.image-overlay .content{padding:10px}.cartodb-overlay.image-overlay img{display:block}@font-face{font-family:'Droid Sans';font-style:normal;font-weight:400;src:local('Droid Sans'),local('DroidSans'),url(//themes.googleusercontent.com/static/fonts/droidsans/v4/s-BiyweUPV0v-yRb-cjciL3hpw3pgy2gAi-Ip7WPMi0.woff) format('woff')}@font-face{font-family:'Droid Sans';font-style:bold;font-weight:700;src:local('Droid Sans Bold'),local('DroidSans-Bold'),url(//themes.googleusercontent.com/static/fonts/droidsans/v4/EFpQQyG9GqCrobXxL-KRMXbFhgvWbfSbdVg11QabG8w.woff) format('woff')}@font-face{font-family:Vollkorn;font-style:normal;font-weight:400;src:local('Vollkorn Regular'),local('Vollkorn-Regular'),url(//themes.googleusercontent.com/static/fonts/vollkorn/v4/BCFBp4rt5gxxFrX6F12DKnYhjbSpvc47ee6xR_80Hnw.woff) format('woff')}@font-face{font-family:Vollkorn;font-style:normal;font-weight:400;src:local('Vollkorn Regular'),local('Vollkorn-Regular'),url(//themes.googleusercontent.com/static/fonts/vollkorn/v4/BCFBp4rt5gxxFrX6F12DKnYhjbSpvc47ee6xR_80Hnw.woff) format('woff')}@font-face{font-family:Vollkorn;font-style:bold;font-weight:700;src:local('Vollkorn Bold'),local('Vollkorn-Bold'),url(//themes.googleusercontent.com/static/fonts/vollkorn/v4/wMZpbUtcCo9GUabw9JODerrIa-7acMAeDBVuclsi6Gc.woff) format('woff')}@font-face{font-family:'Open Sans';font-style:bold;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(//themes.googleusercontent.com/static/fonts/opensans/v8/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff) format('woff')}@font-face{font-family:'Open Sans';font-style:bold;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(//themes.googleusercontent.com/static/fonts/opensans/v8/MTP_ySUJH_bn48VBG8sNSqRDOzjiPcYnFooOUGCOsRk.woff) format('woff')}@font-face{font-family:'Roboto Slab';font-style:normal;font-weight:400;src:local('Roboto Slab Regular'),local('RobotoSlab-Regular'),url(//themes.googleusercontent.com/static/fonts/robotoslab/v3/y7lebkjgREBJK96VQi37ZrrIa-7acMAeDBVuclsi6Gc.woff) format('woff')}@font-face{font-family:'Roboto Slab';font-style:bold;font-weight:700;src:local('Roboto Slab Bold'),local('RobotoSlab-Bold'),url(//themes.googleusercontent.com/static/fonts/robotoslab/v3/dazS1PrQQuCxC3iOAJFEJRbnBKKEOwRKgsHDreGcocg.woff) format('woff')}@font-face{font-family:Lato;font-style:normal;font-weight:400;src:local('Lato Regular'),local('Lato-Regular'),url(//fonts.gstatic.com/s/lato/v11/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-weight:400;src:local('Lato Regular'),local('Lato-Regular'),url(//fonts.gstatic.com/s/lato/v11/MDadn8DQ_3oT6kvnUq_2rxTbgVql8nDJpwnrE27mub0.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:Lato;font-style:normal;font-weight:700;src:local('Lato Bold'),local('Lato-Bold'),url(//fonts.gstatic.com/s/lato/v11/rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-weight:700;src:local('Lato Bold'),local('Lato-Bold'),url(//fonts.gstatic.com/s/lato/v11/MgNNr5y1C_tIEuLEmicLm1KPGs1ZzpMvnHX-7fPOuAc.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:Lato;font-style:italic;font-weight:400;src:local('Lato Italic'),local('Lato-Italic'),url(//fonts.gstatic.com/s/lato/v11/cT2GN3KRBUX69GVJ2b2hxn-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:italic;font-weight:400;src:local('Lato Italic'),local('Lato-Italic'),url(//fonts.gstatic.com/s/lato/v11/1KWMyx7m-L0fkQGwYhWwun-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:Lato;font-style:italic;font-weight:700;src:local('Lato Bold Italic'),local('Lato-BoldItalic'),url(//fonts.gstatic.com/s/lato/v11/AcvTq8Q0lyKKNxRlL28Rn4X0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2');unicode-range:U+0100-024F,U+1E00-1EFF,U+20A0-20AB,U+20AD-20CF,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:italic;font-weight:700;src:local('Lato Bold Italic'),local('Lato-BoldItalic'),url(//fonts.gstatic.com/s/lato/v11/HkF_qI1x_noxlxhrhMQYEIX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:Graduate;font-style:normal;font-weight:400;src:local('Graduate'),local('Graduate-Regular'),url(//fonts.gstatic.com/s/graduate/v4/xBquLOzic3rRbJsTs3BiEBkAz4rYn47Zy2rvigWQf6w.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:'Old Standard TT';font-style:normal;font-weight:400;src:local('Old Standard TT Regular'),local('OldStandardTT-Regular'),url(//fonts.gstatic.com/s/oldstandardtt/v7/n6RTCDcIPWSE8UNBa4k-DLF-2NVkvf-rOuDmUqmzvVM.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:'Old Standard TT';font-style:normal;font-weight:700;src:local('Old Standard TT Bold'),local('OldStandardTT-Bold'),url(//fonts.gstatic.com/s/oldstandardtt/v7/5Ywdce7XEbTSbxs__4X1_C-wBZwrdXnFg8S-xRZijWL3rGVtsTkPsbDajuO5ueQw.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:'Old Standard TT';font-style:italic;font-weight:400;src:local('Old Standard TT Italic'),local('OldStandardTT-Italic'),url(//fonts.gstatic.com/s/oldstandardtt/v7/QQT_AUSp4AV4dpJfIN7U5L2K6DRqiD5gep8WjK7yGlo.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}@font-face{font-family:'Gravitas One';font-style:normal;font-weight:400;src:local('Gravitas One'),local('GravitasOne'),url(//fonts.gstatic.com/s/gravitasone/v6/nBHdBv6zVNU8MtP6w9FwTRVuXpl7XtNjpLlhhhGlVqc.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2212,U+2215,U+E0FF,U+EFFD,U+F000}.cartodb-overlay.overlay-annotation .content>.text,.cartodb-overlay.overlay-text .content>.text{font-family:'Helvetica Neue',Helvetica,sans-serif;font-weight:400}.cartodb-overlay.overlay-annotation .content>.text strong,.cartodb-overlay.overlay-text .content>.text strong{font-family:'Helvetica Neue',Helvetica,sans-serif;font-weight:700}.cartodb-overlay.overlay-annotation.droid .content>.text,.cartodb-overlay.overlay-text.droid .content>.text{font-family:'Droid Sans',serif;font-weight:400}.cartodb-overlay.overlay-annotation.droid .content>.text strong,.cartodb-overlay.overlay-text.droid .content>.text strong{font-family:'Droid Sans',Helvetica,sans-serif;font-weight:700}.cartodb-overlay.overlay-annotation.roboto .content>.text,.cartodb-overlay.overlay-text.roboto .content>.text{font-family:'Roboto Slab',serif;font-weight:400}.cartodb-overlay.overlay-annotation.roboto .content>.text strong,.cartodb-overlay.overlay-text.roboto .content>.text strong{font-family:'Roboto Slab',serif;font-weight:700}.cartodb-overlay.overlay-annotation.vollkorn .content>.text,.cartodb-overlay.overlay-text.vollkorn .content>.text{font-family:Vollkorn,serif;font-weight:400}.cartodb-overlay.overlay-annotation.vollkorn .content>.text strong,.cartodb-overlay.overlay-text.vollkorn .content>.text strong{font-family:Vollkorn,serif;font-weight:700}.cartodb-overlay.overlay-annotation.open_sans .content>.text,.cartodb-overlay.overlay-text.open_sans .content>.text{font-family:'Open Sans',sans-serif;font-weight:400}.cartodb-overlay.overlay-annotation.open_sans .content>.text strong,.cartodb-overlay.overlay-text.open_sans .content>.text strong{font-family:'Open Sans',sans-serif;font-weight:700}.cartodb-overlay.overlay-annotation.lato .content>.text,.cartodb-overlay.overlay-text.lato .content>.text{font-family:Lato,sans-serif;font-weight:400}.cartodb-overlay.overlay-annotation.lato .content>.text strong,.cartodb-overlay.overlay-text.lato .content>.text strong{font-family:Lato,sans-serif;font-weight:700}.cartodb-overlay.overlay-annotation.graduate .content>.text,.cartodb-overlay.overlay-annotation.graduate .content>.text strong,.cartodb-overlay.overlay-text.graduate .content>.text,.cartodb-overlay.overlay-text.graduate .content>.text strong{font-family:Graduate,sans-serif;font-weight:400}.cartodb-overlay.overlay-annotation.old_standard_tt .content>.text,.cartodb-overlay.overlay-text.old_standard_tt .content>.text{font-family:'Old Standard TT',sans-serif;font-weight:400}.cartodb-overlay.overlay-annotation.old_standard_tt .content>.text strong,.cartodb-overlay.overlay-text.old_standard_tt .content>.text strong{font-family:'Old Standard TT',sans-serif;font-weight:700}.cartodb-overlay.overlay-annotation.gravitas_one .content>.text,.cartodb-overlay.overlay-annotation.gravitas_one .content>.text strong,.cartodb-overlay.overlay-text.gravitas_one .content>.text,.cartodb-overlay.overlay-text.gravitas_one .content>.text strong{font-family:'Gravitas One',sans-serif;font-weight:400}.cartodb-header .cartodb-slides-controller{background:0 0}.cartodb-slides-controller{position:relative;width:100%;text-align:center;top:0;left:0;background:rgba(0,0,0,.5);line-height:0;z-index:1000000}.cartodb-slides-controller .slides-controller-content{margin:auto;padding:10px}.cartodb-slides-controller .slides-controller-content .next,.cartodb-slides-controller .slides-controller-content .prev{position:relative}.cartodb-slides-controller .slides-controller-content .prev{display:inline-block;*display:inline;vertical-align:middle;width:16px;height:15px;margin:0 30px 0 0;background:url(../img/slide_left.png) no-repeat;border-radius:100px;opacity:.5}.cartodb-slides-controller .slides-controller-content .next{display:inline-block;*display:inline;vertical-align:middle;margin:0 0 0 30px;width:16px;height:15px;background:url(../img/slide_right.png) no-repeat;border-radius:100px;opacity:.5}.cartodb-slides-controller .slides-controller-content .next:hover,.cartodb-slides-controller .slides-controller-content .prev:hover{opacity:.8}.cartodb-slides-controller .slides-controller-content .prev:after{content:'';position:absolute;top:-5px;left:31px;height:25px;width:2px;background:#fff;opacity:.5}.cartodb-slides-controller .slides-controller-content .next:before{content:'';position:absolute;top:-5px;left:-17px;height:25px;width:2px;background:#fff;opacity:.5}.cartodb-slides-controller .slides-controller-content .counter{color:#fff}.cartodb-slides-controller .slides-controller-content .counter,.cartodb-slides-controller .slides-controller-content ul{display:inline-block;*display:inline;text-align:center;padding:0}.cartodb-slides-controller .slides-controller-content .counter.loading{opacity:.2;animation:loading .35s infinite ease-out alternate;-ms-animation:loading .35s infinite ease-out alternate;-moz-animation:loading .35s infinite ease-out alternate;-webkit-animation:loading .35s infinite ease-out alternate}.cartodb-slides-controller .slides-controller-content ul li{display:inline-block;*display:inline;vertical-align:middle;margin:0 2px}.cartodb-slides-controller .slides-controller-content ul li a{width:10px;height:10px;display:block;background:#fff;border-radius:100px;opacity:.4}.cartodb-slides-controller .slides-controller-content ul li a.active{opacity:1}.cartodb-slides-controller .slides-controller-content ul li a.active.time{width:10px;height:10px;opacity:.5;transform:scale(.5);-ms-transform:scale(.5);-moz-transform:scale(.5);-webkit-transform:scale(.5);animation:pulse .35s infinite ease-out alternate;-ms-animation:pulse .35s infinite ease-out alternate;-moz-animation:pulse .35s infinite ease-out alternate;-webkit-animation:pulse .35s infinite ease-out alternate}div.cartodb-timeslider .slider-wrapper{display:inline-block;zoom:1;*display:inline;vertical-align:top;width:253px;height:4px;_height:4px;padding:18px 15px}div.cartodb-timeslider .slider{width:253px;height:4px}div.cartodb-timeslider .ui-helper-hidden{display:none}div.cartodb-timeslider .ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}div.cartodb-timeslider .ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}div.cartodb-timeslider .ui-helper-clearfix:after,div.cartodb-timeslider .ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}div.cartodb-timeslider .ui-helper-clearfix:after{clear:both}div.cartodb-timeslider .ui-helper-clearfix{min-height:0}div.cartodb-timeslider .ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}div.cartodb-timeslider .ui-front{z-index:100}div.cartodb-timeslider .ui-state-disabled{cursor:default!important}div.cartodb-timeslider .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}div.cartodb-timeslider .ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}div.cartodb-timeslider .ui-slider{background-color:#E0E0E0;position:relative;text-align:left;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px}div.cartodb-timeslider .ui-slider .ui-slider-handle{position:absolute;z-index:102;width:9px;height:10px;cursor:default;background:url(../img/slider.png) no-repeat -98px -18px #fff;border:1px solid #555;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px;outline:0}div.cartodb-timeslider .ui-slider .ui-slider-handle:hover{cursor:col-resize;background-position:-112px -18px}div.cartodb-timeslider .ui-slider .ui-slider-range{position:absolute;z-index:100;font-size:.7em;display:block;border:0;background-position:0 0;background-color:#397DBA;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px}div.cartodb-timeslider .ui-slider.ui-state-disabled .ui-slider-handle,div.cartodb-timeslider .ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}div.cartodb-timeslider .ui-slider-horizontal{height:4px;cursor:pointer}div.cartodb-timeslider .ui-slider-horizontal .ui-slider-handle{top:-4px;margin-left:-6px}div.cartodb-timeslider .ui-slider-horizontal .ui-slider-range{top:0;height:100%;cursor:pointer}div.cartodb-timeslider .ui-slider-horizontal .ui-slider-range-min{left:0}div.cartodb-timeslider .ui-slider-horizontal .ui-slider-range-max{right:0}div.cartodb-timeslider .ui-slider-vertical{width:.8em;height:100px}div.cartodb-timeslider .ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}div.cartodb-timeslider .ui-slider-vertical .ui-slider-range{left:0;width:100%}div.cartodb-timeslider .ui-slider-vertical .ui-slider-range-min{bottom:0}div.cartodb-timeslider .ui-slider-vertical .ui-slider-range-max{top:0}@media only screen and (min-width:360px) and (max-width:500px){div.cartodb-timeslider .slider,div.cartodb-timeslider .slider-wrapper{width:130px}}@media only screen and (min-width:180px) and (max-width:360px){div.cartodb-timeslider .slider,div.cartodb-timeslider .slider-wrapper{width:90px}div.cartodb-timeslider p.value{width:90px;font-size:12px}}.leaflet-image-layer,.leaflet-layer,.leaflet-map-pane,.leaflet-marker-icon,.leaflet-marker-pane,.leaflet-marker-shadow,.leaflet-overlay-pane,.leaflet-overlay-pane svg,.leaflet-popup-pane,.leaflet-shadow-pane,.leaflet-tile,.leaflet-tile-container,.leaflet-tile-pane,.leaflet-zoom-box{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden;-ms-touch-action:none}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container img{max-width:none!important}.leaflet-container img.leaflet-image-layer{max-width:15000px!important}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-tile-pane{z-index:2}.leaflet-objects-pane{z-index:3}.leaflet-overlay-pane{z-index:4}.leaflet-shadow-pane{z-index:5}.leaflet-marker-pane{z-index:6}.leaflet-popup-pane{z-index:7}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:7;pointer-events:auto}.leaflet-bottom,.leaflet-top{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup,.leaflet-fade-anim .leaflet-tile{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup,.leaflet-fade-anim .leaflet-tile-loaded{opacity:1}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-pan-anim .leaflet-tile,.leaflet-touching .leaflet-zoom-animated,.leaflet-zoom-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-clickable{cursor:pointer}.leaflet-container{cursor:-webkit-grab;cursor:-moz-grab}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-clickable,.leaflet-dragging .leaflet-container{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078A8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,.5)}.leaflet-container{font:12px/1.5 "Helvetica Neue",Arial,Helvetica,sans-serif}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,.65);border-radius:4px}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:0}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px 'Lucida Console',Monaco,monospace;text-indent:1px}.leaflet-control-zoom-out{font-size:20px}.leaflet-touch .leaflet-control-zoom-in{font-size:22px}.leaflet-touch .leaflet-control-zoom-out{font-size:24px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255,255,255,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:0;line-height:1.1;padding:2px 5px 1px;font-size:11px;white-space:nowrap;overflow:hidden;-moz-box-sizing:content-box;box-sizing:content-box;background:#fff;background:rgba(255,255,255,.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:0;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 19px;line-height:1.4}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{margin:0 auto;width:40px;height:20px;position:relative;overflow:hidden}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;padding:4px 4px 0 0;text-align:center;width:18px;height:14px;font:16px/14px Tahoma,Verdana,sans-serif;color:#c3c3c3;text-decoration:none;font-weight:700;background:0 0}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678, M12=.70710678, M21=-.70710678, M22=.70710678)}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}div.cartodb-tooltip-content-wrapper.dark{background:#000;background:rgba(0,0,0,.75);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#bf000000, endColorstr=#bf000000);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#bf000000, endColorstr=#bf000000)"}div.cartodb-tooltip-content-wrapper.dark h4{color:#999}div.cartodb-tooltip-content-wrapper.dark p{color:#FFF}div.cartodb-tooltip-content-wrapper.dark a{color:#397DB9}div.cartodb-tooltip{position:absolute;display:none;min-width:120px;max-width:180px;overflow-y:hidden;z-index:50}div.cartodb-tooltip-content-wrapper{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,.9);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#E5FFFFFF, endColorstr=#E5FFFFFF);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#E5FFFFFF, endColorstr=#E5FFFFFF)";zoom:1}div.cartodb-tooltip-content{display:block;padding:8px 8px 8px 9px}div.cartodb-tooltip-content h4{display:block;margin:0 0 1px;text-transform:uppercase;font:400 10px "Helvetica Neue",Helvetica,Arial;color:#AAA;word-wrap:break-word}div.cartodb-tooltip-content p{display:block;margin:0 0 4px;padding:0 0 7px;font:400 12px "Helvetica Neue",Helvetica,Arial;color:#333;word-wrap:break-word}div.cartodb-tooltip-content p:last-child{padding:0;margin:0}div.cartodb-tooltip-content a{color:#0078A8}div.cartodb-tooltip>p{font-family:robotoregular,Helvetica,Arial,Sans-serif;font-size:15px;color:#333;text-align:center;text-shadow:-1px -1px 0 #FFF,1px -1px 0 #FFF,-1px 1px 0 #FFF,1px 1px 0 #FFF} diff --git a/lib/cartodb.js b/lib/cartodb.js index 3181259..b942d87 100644 --- a/lib/cartodb.js +++ b/lib/cartodb.js @@ -1,20 +1,23 @@ -// CartoDB.js version: 3.11.26 -// sha: 19f8b0729255fc90cba92f3dc7161843b9621f52 -!function(){var root=this,__prev={jQuery:root.jQuery,$:root.$,L:root.L,Mustache:root.Mustache,Backbone:root.Backbone,_:root._};!function(a,b){function c(a){return J.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}function d(a){if(!sc[a]){var b=G.body,c=J("<"+a+">").appendTo(b),d=c.css("display");c.remove(),("none"===d||""===d)&&(oc||(oc=G.createElement("iframe"),oc.frameBorder=oc.width=oc.height=0),b.appendChild(oc),pc&&oc.createElement||(pc=(oc.contentWindow||oc.contentDocument).document,pc.write((J.support.boxModel?"":"")+""),pc.close()),c=pc.createElement(a),pc.body.appendChild(c),d=J.css(c,"display"),b.removeChild(oc)),sc[a]=d}return sc[a]}function e(a,b){var c={};return J.each(vc.concat.apply([],vc.slice(0,b)),function(){c[this]=a}),c}function f(){rc=b}function g(){return setTimeout(f,0),rc=J.now()}function h(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function i(){try{return new a.XMLHttpRequest}catch(b){}}function j(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d,e,f,g,h,i,j,k,l=a.dataTypes,m={},n=l.length,o=l[0];for(d=1;n>d;d++){if(1===d)for(e in a.converters)"string"==typeof e&&(m[e.toLowerCase()]=a.converters[e]);if(g=o,o=l[d],"*"===o)o=g;else if("*"!==g&&g!==o){if(h=g+" "+o,i=m[h]||m["* "+o],!i){k=b;for(j in m)if(f=j.split(" "),(f[0]===g||"*"===f[0])&&(k=m[f[1]+" "+o])){j=m[j],j===!0?i=k:k===!0&&(i=j);break}}!i&&!k&&J.error("No conversion from "+h.replace(" "," to ")),i!==!0&&(c=i?i(c):k(j(c)))}}return c}function k(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);for(;"*"===j[0];)j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}return g?(g!==j[0]&&j.unshift(g),d[g]):void 0}function l(a,b,c,d){if(J.isArray(b))J.each(b,function(b,e){c||Sb.test(a)?d(a,e):l(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==J.type(b))d(a,b);else for(var e in b)l(a+"["+e+"]",b[e],c,d)}function m(a,c){var d,e,f=J.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&J.extend(!0,a,e)}function n(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;for(var h,i=a[f],j=0,k=i?i.length:0,l=a===fc;k>j&&(l||!h);j++)h=i[j](c,d,e),"string"==typeof h&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=n(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=n(a,c,d,e,"*",g)),h}function o(a){return function(b,c){if("string"!=typeof b&&(c=b,b="*"),J.isFunction(c))for(var d,e,f,g=b.toLowerCase().split(bc),h=0,i=g.length;i>h;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function p(a,b,c){var d="width"===b?a.offsetWidth:a.offsetHeight,e="width"===b?1:0,f=4;if(d>0){if("border"!==c)for(;f>e;e+=2)c||(d-=parseFloat(J.css(a,"padding"+Ob[e]))||0),"margin"===c?d+=parseFloat(J.css(a,c+Ob[e]))||0:d-=parseFloat(J.css(a,"border"+Ob[e]+"Width"))||0;return d+"px"}if(d=Db(a,b),(0>d||null==d)&&(d=a.style[b]),Kb.test(d))return d;if(d=parseFloat(d)||0,c)for(;f>e;e+=2)d+=parseFloat(J.css(a,"padding"+Ob[e]))||0,"padding"!==c&&(d+=parseFloat(J.css(a,"border"+Ob[e]+"Width"))||0),"margin"===c&&(d+=parseFloat(J.css(a,c+Ob[e]))||0);return d+"px"}function q(a){var b=G.createElement("div");return Cb.appendChild(b),b.innerHTML=a.outerHTML,b.firstChild}function r(a){var b=(a.nodeName||"").toLowerCase();"input"===b?s(a):"script"!==b&&"undefined"!=typeof a.getElementsByTagName&&J.grep(a.getElementsByTagName("input"),s)}function s(a){("checkbox"===a.type||"radio"===a.type)&&(a.defaultChecked=a.checked)}function t(a){return"undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName("*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll("*"):[]}function u(a,b){var c;1===b.nodeType&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),"object"===c?b.outerHTML=a.outerHTML:"input"!==c||"checkbox"!==a.type&&"radio"!==a.type?"option"===c?b.selected=a.defaultSelected:"input"===c||"textarea"===c?b.defaultValue=a.defaultValue:"script"===c&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(J.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function v(a,b){if(1===b.nodeType&&J.hasData(a)){var c,d,e,f=J._data(a),g=J._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)J.event.add(b,c,h[c][d])}g.data&&(g.data=J.extend({},g.data))}}function w(a){return J.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function x(a){var b=ob.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function y(a,b,c){if(b=b||0,J.isFunction(b))return J.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return J.grep(a,function(a){return a===b===c});if("string"==typeof b){var d=J.grep(a,function(a){return 1===a.nodeType});if(kb.test(b))return J.filter(b,d,!c);b=J.filter(b,d)}return J.grep(a,function(a){return J.inArray(a,b)>=0===c})}function z(a){return!a||!a.parentNode||11===a.parentNode.nodeType}function A(){return!0}function B(){return!1}function C(a,b,c){var d=b+"defer",e=b+"queue",f=b+"mark",g=J._data(a,d);!(!g||"queue"!==c&&J._data(a,e)||"mark"!==c&&J._data(a,f)||!setTimeout(function(){!J._data(a,e)&&!J._data(a,f)&&(J.removeData(a,d,!0),g.fire())},0))}function D(a){for(var b in a)if(("data"!==b||!J.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function E(a,c,d){if(d===b&&1===a.nodeType){var e="data-"+c.replace(N,"-$1").toLowerCase();if(d=a.getAttribute(e),"string"==typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:J.isNumeric(d)?+d:M.test(d)?J.parseJSON(d):d}catch(f){}J.data(a,c,d)}else d=b}return d}function F(a){var b,c,d=K[a]={};for(a=a.split(/\s+/),b=0,c=a.length;c>b;b++)d[a[b]]=!0;return d}var G=a.document,H=a.navigator,I=a.location,J=function(){function c(){if(!h.isReady){try{G.documentElement.doScroll("left")}catch(a){return void setTimeout(c,1)}h.ready()}}var d,e,f,g,h=function(a,b){return new h.fn.init(a,b,d)},i=a.jQuery,j=a.$,k=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,l=/\S/,m=/^\s+/,n=/\s+$/,o=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p=/^[\],:{}\s]*$/,q=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,r=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,s=/(?:^|:|,)(?:\s*\[)+/g,t=/(webkit)[ \/]([\w.]+)/,u=/(opera)(?:.*version)?[ \/]([\w.]+)/,v=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,x=/-([a-z]|[0-9])/gi,y=/^-ms-/,z=function(a,b){return(b+"").toUpperCase()},A=H.userAgent,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,I=Array.prototype.indexOf,J={};return h.fn=h.prototype={constructor:h,init:function(a,c,d){var e,f,g,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if("body"===a&&!c&&G.body)return this.context=G,this[0]=G.body,this.selector=a,this.length=1,this;if("string"==typeof a){if(e="<"!==a.charAt(0)||">"!==a.charAt(a.length-1)||a.length<3?k.exec(a):[null,a,null],e&&(e[1]||!c)){if(e[1])return c=c instanceof h?c[0]:c,i=c?c.ownerDocument||c:G,g=o.exec(a),g?h.isPlainObject(c)?(a=[G.createElement(g[1])],h.fn.attr.call(a,c,!0)):a=[i.createElement(g[1])]:(g=h.buildFragment([e[1]],[i]),a=(g.cacheable?h.clone(g.fragment):g.fragment).childNodes),h.merge(this,a);if(f=G.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return d.find(a);this.length=1,this[0]=f}return this.context=G,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return h.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),h.makeArray(a,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();return h.isArray(a)?D.apply(d,a):h.merge(d,a),d.prevObject=this,d.context=this.context,"find"===b?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return h.each(this,a,b)},ready:function(a){return h.bindReady(),f.add(a),this},eq:function(a){return a=+a,-1===a?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(h.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},h.fn.init.prototype=h.fn,h.extend=h.fn.extend=function(){var a,c,d,e,f,g,i=arguments[0]||{},j=1,k=arguments.length,l=!1;for("boolean"==typeof i&&(l=i,i=arguments[1]||{},j=2),"object"!=typeof i&&!h.isFunction(i)&&(i={}),k===j&&(i=this,--j);k>j;j++)if(null!=(a=arguments[j]))for(c in a)d=i[c],e=a[c],i!==e&&(l&&e&&(h.isPlainObject(e)||(f=h.isArray(e)))?(f?(f=!1,g=d&&h.isArray(d)?d:[]):g=d&&h.isPlainObject(d)?d:{},i[c]=h.extend(l,g,e)):e!==b&&(i[c]=e));return i},h.extend({noConflict:function(b){return a.$===h&&(a.$=j),b&&a.jQuery===h&&(a.jQuery=i),h},isReady:!1,readyWait:1,holdReady:function(a){a?h.readyWait++:h.ready(!0)},ready:function(a){if(a===!0&&!--h.readyWait||a!==!0&&!h.isReady){if(!G.body)return setTimeout(h.ready,1);if(h.isReady=!0,a!==!0&&--h.readyWait>0)return;f.fireWith(G,[h]),h.fn.trigger&&h(G).trigger("ready").off("ready")}},bindReady:function(){if(!f){if(f=h.Callbacks("once memory"),"complete"===G.readyState)return setTimeout(h.ready,1);if(G.addEventListener)G.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",h.ready,!1);else if(G.attachEvent){G.attachEvent("onreadystatechange",g),a.attachEvent("onload",h.ready);var b=!1;try{b=null==a.frameElement}catch(d){}G.documentElement.doScroll&&b&&c()}}},isFunction:function(a){return"function"===h.type(a)},isArray:Array.isArray||function(a){return"array"===h.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?String(a):J[B.call(a)]||"object"},isPlainObject:function(a){if(!a||"object"!==h.type(a)||a.nodeType||h.isWindow(a))return!1;try{if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||C.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){return"string"==typeof b&&b?(b=h.trim(b),a.JSON&&a.JSON.parse?a.JSON.parse(b):p.test(b.replace(q,"@").replace(r,"]").replace(s,""))?new Function("return "+b)():void h.error("Invalid JSON: "+b)):null},parseXML:function(c){if("string"!=typeof c||!c)return null;var d,e;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&h.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&l.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(y,"ms-").replace(x,z)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,i=g===b||h.isFunction(a);if(d)if(i){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;g>f&&c.apply(a[f++],d)!==!1;);else if(i){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;g>f&&c.call(a[f],f,a[f++])!==!1;);return a},trim:F?function(a){return null==a?"":F.call(a)}:function(a){return null==a?"":(a+"").replace(m,"").replace(n,"")},makeArray:function(a,b){var c=b||[];if(null!=a){var d=h.type(a);null==a.length||"string"===d||"function"===d||"regexp"===d||h.isWindow(a)?D.call(c,a):h.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(I)return I.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if("number"==typeof c.length)for(var f=c.length;f>e;e++)a[d++]=c[e];else for(;c[e]!==b;)a[d++]=c[e++];return a.length=d,a},grep:function(a,b,c){var d,e=[];c=!!c;for(var f=0,g=a.length;g>f;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],i=0,j=a.length,k=a instanceof h||j!==b&&"number"==typeof j&&(j>0&&a[0]&&a[j-1]||0===j||h.isArray(a));if(k)for(;j>i;i++)e=c(a[i],i,d),null!=e&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),null!=e&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){if("string"==typeof c){var d=a[c];c=a,a=d}if(!h.isFunction(a))return b;var e=E.call(arguments,2),f=function(){return a.apply(c,e.concat(E.call(arguments)))};return f.guid=a.guid=a.guid||f.guid||h.guid++,f},access:function(a,c,d,e,f,g,i){var j,k=null==d,l=0,m=a.length;if(d&&"object"==typeof d){for(l in d)h.access(a,c,l,d[l],1,g,e);f=1}else if(e!==b){if(j=i===b&&h.isFunction(e),k&&(j?(j=c,c=function(a,b,c){return j.call(h(a),c)}):(c.call(a,e),c=null)),c)for(;m>l;l++)c(a[l],d,j?e.call(a[l],l,c(a[l],d)):e,i);f=1}return f?a:k?c.call(a):m?c(a[0],d):g},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=t.exec(a)||u.exec(a)||v.exec(a)||a.indexOf("compatible")<0&&w.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}h.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(c,d){return d&&d instanceof h&&!(d instanceof a)&&(d=a(d)),h.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(G);return a},browser:{}}),h.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()}),e=h.uaMatch(A),e.browser&&(h.browser[e.browser]=!0,h.browser.version=e.version),h.browser.webkit&&(h.browser.safari=!0),l.test(" ")&&(m=/^[\s\xA0]+/,n=/[\s\xA0]+$/),d=h(G),G.addEventListener?g=function(){G.removeEventListener("DOMContentLoaded",g,!1),h.ready()}:G.attachEvent&&(g=function(){"complete"===G.readyState&&(G.detachEvent("onreadystatechange",g),h.ready())}),h}(),K={};J.Callbacks=function(a){a=a?K[a]||F(a):{};var c,d,e,f,g,h,i=[],j=[],k=function(b){var c,d,e,f;for(c=0,d=b.length;d>c;c++)e=b[c],f=J.type(e),"array"===f?k(e):"function"===f&&(!a.unique||!m.has(e))&&i.push(e)},l=function(b,k){for(k=k||[],c=!a.memory||[b,k],d=!0,e=!0,h=f||0,f=0,g=i.length;i&&g>h;h++)if(i[h].apply(b,k)===!1&&a.stopOnFalse){c=!0;break}e=!1,i&&(a.once?c===!0?m.disable():i=[]:j&&j.length&&(c=j.shift(),m.fireWith(c[0],c[1])))},m={add:function(){if(i){var a=i.length;k(arguments),e?g=i.length:c&&c!==!0&&(f=a,l(c[0],c[1]))}return this},remove:function(){if(i)for(var b=arguments,c=0,d=b.length;d>c;c++)for(var f=0;f=f&&(g--,h>=f&&h--),i.splice(f--,1),!a.unique));f++);return this},has:function(a){if(i)for(var b=0,c=i.length;c>b;b++)if(a===i[b])return!0;return!1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,(!c||c===!0)&&m.disable(),this},locked:function(){return!j},fireWith:function(b,d){return j&&(e?a.once||j.push([b,d]):(!a.once||!c)&&l(b,d)),this},fire:function(){return m.fireWith(this,arguments),this},fired:function(){return!!d}};return m};var L=[].slice;J.extend({Deferred:function(a){var b,c=J.Callbacks("once memory"),d=J.Callbacks("once memory"),e=J.Callbacks("memory"),f="pending",g={resolve:c,reject:d,notify:e},h={done:c.add,fail:d.add,progress:e.add,state:function(){return f},isResolved:c.fired,isRejected:d.fired,then:function(a,b,c){return i.done(a).fail(b).progress(c),this},always:function(){return i.done.apply(i,arguments).fail.apply(i,arguments),this},pipe:function(a,b,c){return J.Deferred(function(d){J.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c,e=b[0],f=b[1];i[a](J.isFunction(e)?function(){c=e.apply(this,arguments),c&&J.isFunction(c.promise)?c.promise().then(d.resolve,d.reject,d.notify):d[f+"With"](this===i?d:this,[c])}:d[f])})}).promise()},promise:function(a){if(null==a)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({});for(b in g)i[b]=g[b].fire,i[b+"With"]=g[b].fireWith;return i.done(function(){f="resolved"},d.disable,e.lock).fail(function(){f="rejected"},c.disable,e.lock),a&&a.call(i,i),i},when:function(a){function b(a){return function(b){g[a]=arguments.length>1?L.call(arguments,0):b,i.notifyWith(j,g)}}function c(a){return function(b){d[a]=arguments.length>1?L.call(arguments,0):b,--h||i.resolveWith(i,d)}}var d=L.call(arguments,0),e=0,f=d.length,g=Array(f),h=f,i=1>=f&&a&&J.isFunction(a.promise)?a:J.Deferred(),j=i.promise();if(f>1){for(;f>e;e++)d[e]&&d[e].promise&&J.isFunction(d[e].promise)?d[e].promise().then(c(e),i.reject,b(e)):--h;h||i.resolveWith(i,d)}else i!==a&&i.resolveWith(i,f?[a]:[]);return j}}),J.support=function(){{var b,c,d,e,f,g,h,i,j,k,l,m=G.createElement("div");G.documentElement}if(m.setAttribute("className","t"),m.innerHTML="
    a",c=m.getElementsByTagName("*"),d=m.getElementsByTagName("a")[0],!c||!c.length||!d)return{};e=G.createElement("select"),f=e.appendChild(G.createElement("option")),g=m.getElementsByTagName("input")[0],b={leadingWhitespace:3===m.firstChild.nodeType,tbody:!m.getElementsByTagName("tbody").length,htmlSerialize:!!m.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:"/a"===d.getAttribute("href"),opacity:/^0.55/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:"on"===g.value,optSelected:f.selected,getSetAttribute:"t"!==m.className,enctype:!!G.createElement("form").enctype,html5Clone:"<:nav>"!==G.createElement("nav").cloneNode(!0).outerHTML,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},J.boxModel=b.boxModel="CSS1Compat"===G.compatMode,g.checked=!0,b.noCloneChecked=g.cloneNode(!0).checked,e.disabled=!0,b.optDisabled=!f.disabled;try{delete m.test}catch(n){b.deleteExpando=!1}if(!m.addEventListener&&m.attachEvent&&m.fireEvent&&(m.attachEvent("onclick",function(){b.noCloneEvent=!1}),m.cloneNode(!0).fireEvent("onclick")),g=G.createElement("input"),g.value="t",g.setAttribute("type","radio"),b.radioValue="t"===g.value,g.setAttribute("checked","checked"),g.setAttribute("name","t"),m.appendChild(g),h=G.createDocumentFragment(),h.appendChild(m.lastChild),b.checkClone=h.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=g.checked,h.removeChild(g),h.appendChild(m),m.attachEvent)for(k in{submit:1,change:1,focusin:1})j="on"+k,l=j in m,l||(m.setAttribute(j,"return;"),l="function"==typeof m[j]),b[k+"Bubbles"]=l;return h.removeChild(m),h=e=f=m=g=null,J(function(){var c,d,e,f,g,h,j,k,n,o,p,q,r=G.getElementsByTagName("body")[0];!r||(j=1,q="padding:0;margin:0;border:",o="position:absolute;top:0;left:0;width:1px;height:1px;",p=q+"0;visibility:hidden;",k="style='"+o+q+"5px solid #000;",n="
    ",c=G.createElement("div"),c.style.cssText=p+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(c,r.firstChild),m=G.createElement("div"),c.appendChild(m),m.innerHTML="
    t
    ",i=m.getElementsByTagName("td"),l=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",b.reliableHiddenOffsets=l&&0===i[0].offsetHeight,a.getComputedStyle&&(m.innerHTML="",h=G.createElement("div"),h.style.width="0",h.style.marginRight="0",m.style.width="2px",m.appendChild(h),b.reliableMarginRight=0===(parseInt((a.getComputedStyle(h,null)||{marginRight:0}).marginRight,10)||0)),"undefined"!=typeof m.style.zoom&&(m.innerHTML="",m.style.width=m.style.padding="1px",m.style.border=0,m.style.overflow="hidden",m.style.display="inline",m.style.zoom=1,b.inlineBlockNeedsLayout=3===m.offsetWidth,m.style.display="block",m.style.overflow="visible",m.innerHTML="
    ",b.shrinkWrapBlocks=3!==m.offsetWidth),m.style.cssText=o+p,m.innerHTML=n,d=m.firstChild,e=d.firstChild,f=d.nextSibling.firstChild.firstChild,g={doesNotAddBorder:5!==e.offsetTop,doesAddBorderForTableAndCells:5===f.offsetTop},e.style.position="fixed",e.style.top="20px",g.fixedPosition=20===e.offsetTop||15===e.offsetTop,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",g.subtractsBorderForOverflowNotVisible=-5===e.offsetTop,g.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,a.getComputedStyle&&(m.style.marginTop="1%",b.pixelMargin="1%"!==(a.getComputedStyle(m,null)||{marginTop:0}).marginTop),"undefined"!=typeof c.style.zoom&&(c.style.zoom=1),r.removeChild(c),h=m=c=null,J.extend(b,g))}),b}();var M=/^(?:\{.*\}|\[.*\])$/,N=/([A-Z])/g;J.extend({cache:{},uuid:0,expando:"jQuery"+(J.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?J.cache[a[J.expando]]:a[J.expando],!!a&&!D(a)},data:function(a,c,d,e){if(J.acceptData(a)){var f,g,h,i=J.expando,j="string"==typeof c,k=a.nodeType,l=k?J.cache:a,m=k?a[i]:a[i]&&i,n="events"===c;if(!(m&&l[m]&&(n||e||l[m].data)||!j||d!==b))return;return m||(k?a[i]=m=++J.uuid:m=i),l[m]||(l[m]={},k||(l[m].toJSON=J.noop)),("object"==typeof c||"function"==typeof c)&&(e?l[m]=J.extend(l[m],c):l[m].data=J.extend(l[m].data,c)),f=g=l[m],e||(g.data||(g.data={}),g=g.data),d!==b&&(g[J.camelCase(c)]=d),n&&!g[c]?f.events:(j?(h=g[c],null==h&&(h=g[J.camelCase(c)])):h=g,h)}},removeData:function(a,b,c){if(J.acceptData(a)){var d,e,f,g=J.expando,h=a.nodeType,i=h?J.cache:a,j=h?a[g]:g;if(!i[j])return;if(b&&(d=c?i[j]:i[j].data)){J.isArray(b)||(b in d?b=[b]:(b=J.camelCase(b),b=b in d?[b]:b.split(" ")));for(e=0,f=b.length;f>e;e++)delete d[b[e]];if(!(c?D:J.isEmptyObject)(d))return}if(!c&&(delete i[j].data,!D(i[j])))return;J.support.deleteExpando||!i.setInterval?delete i[j]:i[j]=null,h&&(J.support.deleteExpando?delete a[g]:a.removeAttribute?a.removeAttribute(g):a[g]=null)}},_data:function(a,b,c){return J.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=J.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),J.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length&&(k=J.data(i),1===i.nodeType&&!J._data(i,"parsedAttrs"))){for(f=i.attributes,h=f.length;h>j;j++)g=f[j].name,0===g.indexOf("data-")&&(g=J.camelCase(g.substring(5)),E(i,g,k[g]));J._data(i,"parsedAttrs",!0)}return k}return"object"==typeof a?this.each(function(){J.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",J.access(this,function(c){return c===b?(k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=J.data(i,a),k=E(i,a,k)),k===b&&d[1]?this.data(d[0]):k):(d[1]=c,void this.each(function(){var b=J(this);b.triggerHandler("setData"+e,d),J.data(this,a,c),b.triggerHandler("changeData"+e,d)}))},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){J.removeData(this,a)})}}),J.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",J._data(a,b,(J._data(a,b)||0)+1))},_unmark:function(a,b,c){if(a!==!0&&(c=b,b=a,a=!1),b){c=c||"fx";var d=c+"mark",e=a?0:(J._data(b,d)||1)-1;e?J._data(b,d,e):(J.removeData(b,d,!0),C(b,c,"mark"))}},queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=J._data(a,b),c&&(!d||J.isArray(c)?d=J._data(a,b,J.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=J.queue(a,b),d=c.shift(),e={};"inprogress"===d&&(d=c.shift()),d&&("fx"===b&&c.unshift("inprogress"),J._data(a,b+".run",e),d.call(a,function(){J.dequeue(a,b)},e)),c.length||(J.removeData(a,b+"queue "+b+".run",!0),C(a,b,"queue"))}}),J.fn.extend({queue:function(a,c){var d=2;return"string"!=typeof a&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){J.removeAttr(this,a)})},prop:function(a,b){return J.access(this,J.prop,a,b,arguments.length>1)},removeProp:function(a){return a=J.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(J.isFunction(a))return this.each(function(b){J(this).addClass(a.call(this,b,this.className))});if(a&&"string"==typeof a)for(b=a.split(S),c=0,d=this.length;d>c;c++)if(e=this[c],1===e.nodeType)if(e.className||1!==b.length){for(f=" "+e.className+" ",g=0,h=b.length;h>g;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=J.trim(f)}else e.className=a;return this},removeClass:function(a){var c,d,e,f,g,h,i;if(J.isFunction(a))return this.each(function(b){J(this).removeClass(a.call(this,b,this.className))});if(a&&"string"==typeof a||a===b)for(c=(a||"").split(S),d=0,e=this.length;e>d;d++)if(f=this[d],1===f.nodeType&&f.className)if(a){for(g=(" "+f.className+" ").replace(R," "),h=0,i=c.length;i>h;h++)g=g.replace(" "+c[h]+" "," ");f.className=J.trim(g)}else f.className="";return this},toggleClass:function(a,b){var c=typeof a,d="boolean"==typeof b;return this.each(J.isFunction(a)?function(c){J(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c)for(var e,f=0,g=J(this),h=b,i=a.split(S);e=i[f++];)h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e);else("undefined"===c||"boolean"===c)&&(this.className&&J._data(this,"__className__",this.className),this.className=this.className||a===!1?"":J._data(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(R," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];return arguments.length?(e=J.isFunction(a),this.each(function(d){var f,g=J(this);1===this.nodeType&&(f=e?a.call(this,d,g.val()):a,null==f?f="":"number"==typeof f?f+="":J.isArray(f)&&(f=J.map(f,function(a){return null==a?"":a+""})),c=J.valHooks[this.type]||J.valHooks[this.nodeName.toLowerCase()],c&&"set"in c&&c.set(this,f,"value")!==b||(this.value=f))})):f?(c=J.valHooks[f.type]||J.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,"string"==typeof d?d.replace(T,""):null==d?"":d)):void 0}}),J.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i="select-one"===a.type;if(0>f)return null;for(c=i?f:0,d=i?f+1:h.length;d>c;c++)if(e=h[c],!(!e.selected||(J.support.optDisabled?e.disabled:null!==e.getAttribute("disabled"))||e.parentNode.disabled&&J.nodeName(e.parentNode,"optgroup"))){if(b=J(e).val(),i)return b;g.push(b)}return i&&!g.length&&h.length?J(h[f]).val():g},set:function(a,b){var c=J.makeArray(b);return J(a).find("option").each(function(){this.selected=J.inArray(J(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;return a&&3!==i&&8!==i&&2!==i?e&&c in J.attrFn?J(a)[c](d):"undefined"==typeof a.getAttribute?J.prop(a,c,d):(h=1!==i||!J.isXMLDoc(a),h&&(c=c.toLowerCase(),g=J.attrHooks[c]||(X.test(c)?P:O)),d!==b?null===d?void J.removeAttr(a,c):g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d):g&&"get"in g&&h&&null!==(f=g.get(a,c))?f:(f=a.getAttribute(c),null===f?b:f)):void 0},removeAttr:function(a,b){var c,d,e,f,g,h=0;if(b&&1===a.nodeType)for(d=b.toLowerCase().split(S),f=d.length;f>h;h++)e=d[h],e&&(c=J.propFix[e]||e,g=X.test(e),g||J.attr(a,e,""),a.removeAttribute(Y?e:c),g&&c in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(U.test(a.nodeName)&&a.parentNode)J.error("type property can't be changed");else if(!J.support.radioValue&&"radio"===b&&J.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return O&&J.nodeName(a,"button")?O.get(a,b):b in a?a.value:null},set:function(a,b,c){return O&&J.nodeName(a,"button")?O.set(a,b,c):void(a.value=b)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;return a&&3!==h&&8!==h&&2!==h?(g=1!==h||!J.isXMLDoc(a),g&&(c=J.propFix[c]||c,f=J.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&null!==(e=f.get(a,c))?e:a[c]):void 0},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):V.test(a.nodeName)||W.test(a.nodeName)&&a.href?0:b}}}}),J.attrHooks.tabindex=J.propHooks.tabIndex,P={get:function(a,c){var d,e=J.prop(a,c);return e===!0||"boolean"!=typeof e&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?J.removeAttr(a,c):(d=J.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},Y||(Q={name:!0,id:!0,coords:!0},O=J.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(Q[c]?""!==d.nodeValue:d.specified)?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=G.createAttribute(c),a.setAttributeNode(d)),d.nodeValue=b+""}},J.attrHooks.tabindex.set=O.set,J.each(["width","height"],function(a,b){J.attrHooks[b]=J.extend(J.attrHooks[b],{set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}})}),J.attrHooks.contenteditable={get:O.get,set:function(a,b,c){""===b&&(b="false"),O.set(a,b,c)}}),J.support.hrefNormalized||J.each(["href","src","width","height"],function(a,c){J.attrHooks[c]=J.extend(J.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return null===d?b:d}})}),J.support.style||(J.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),J.support.optSelected||(J.propHooks.selected=J.extend(J.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),J.support.enctype||(J.propFix.enctype="encoding"),J.support.checkOn||J.each(["radio","checkbox"],function(){J.valHooks[this]={get:function(a){return null===a.getAttribute("value")?"on":a.value}}}),J.each(["radio","checkbox"],function(){J.valHooks[this]=J.extend(J.valHooks[this],{set:function(a,b){return J.isArray(b)?a.checked=J.inArray(J(a).val(),b)>=0:void 0 -}})});var Z=/^(?:textarea|input|select)$/i,$=/^([^\.]*)?(?:\.(.+))?$/,_=/(?:^|\s)hover(\.\S+)?\b/,ab=/^key/,bb=/^(?:mouse|contextmenu)|click/,cb=/^(?:focusinfocus|focusoutblur)$/,db=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,eb=function(a){var b=db.exec(a);return b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)")),b},fb=function(a,b){var c=a.attributes||{};return!(b[1]&&a.nodeName.toLowerCase()!==b[1]||b[2]&&(c.id||{}).value!==b[2]||b[3]&&!b[3].test((c["class"]||{}).value))},gb=function(a){return J.event.special.hover?a:a.replace(_,"mouseenter$1 mouseleave$1")};J.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;if(3!==a.nodeType&&8!==a.nodeType&&c&&d&&(g=J._data(a))){for(d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=J.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return"undefined"==typeof J||a&&J.event.triggered===a.type?b:J.event.dispatch.apply(h.elem,arguments)},h.elem=a),c=J.trim(gb(c)).split(" "),j=0;j=0&&(q=q.slice(0,-1),h=!0),q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),(!e||J.event.customEvent[q])&&!J.event.global[q])return;if(c="object"==typeof c?c[J.expando]?c:new J.Event(q,c):new J.Event(q),c.type=q,c.isTrigger=!0,c.exclusive=h,c.namespace=r.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,l=q.indexOf(":")<0?"on"+q:"",!e){g=J.cache;for(i in g)g[i].events&&g[i].events[q]&&J.event.trigger(c,d,g[i].handle.elem,!0);return}if(c.result=b,c.target||(c.target=e),d=null!=d?J.makeArray(d):[],d.unshift(c),m=J.event.special[q]||{},m.trigger&&m.trigger.apply(e,d)===!1)return;if(o=[[e,m.bindType||q]],!f&&!m.noBubble&&!J.isWindow(e)){for(p=m.delegateType||q,j=cb.test(p+q)?e:e.parentNode,k=null;j;j=j.parentNode)o.push([j,p]),k=j;k&&k===e.ownerDocument&&o.push([k.defaultView||k.parentWindow||a,p])}for(i=0;id;d++)l=n[d],m=l.selector,i[m]===b&&(i[m]=l.quick?fb(f,l.quick):g.is(m)),i[m]&&k.push(l);k.length&&s.push({elem:f,matches:k})}for(n.length>o&&s.push({elem:this,matches:n.slice(o)}),d=0;d0?this.on(b,null,a,c):this.trigger(b)},J.attrFn&&(J.attrFn[b]=!0),ab.test(b)&&(J.event.fixHooks[b]=J.event.keyHooks),bb.test(b)&&(J.event.fixHooks[b]=J.event.mouseHooks)}),function(){function a(a,b,c,d,f,g){for(var h=0,i=d.length;i>h;h++){var j=d[h];if(j){var k=!1;for(j=j[a];j;){if(j[e]===c){k=d[j.sizset];break}if(1===j.nodeType)if(g||(j[e]=c,j.sizset=h),"string"!=typeof b){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}j=j[a]}d[h]=k}}}function c(a,b,c,d,f,g){for(var h=0,i=d.length;i>h;h++){var j=d[h];if(j){var k=!1;for(j=j[a];j;){if(j[e]===c){k=d[j.sizset];break}if(1===j.nodeType&&!g&&(j[e]=c,j.sizset=h),j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}d[h]=k}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),f=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){return i=!1,0});var m=function(a,b,c,e){c=c||[],b=b||G;var f=b;if(1!==b.nodeType&&9!==b.nodeType)return[];if(!a||"string"!=typeof a)return c;var h,i,j,k,l,n,q,r,t=!0,u=m.isXML(b),v=[],x=a;do if(d.exec(""),h=d.exec(x),h&&(x=h[3],v.push(h[1]),h[2])){k=h[3];break}while(h);if(v.length>1&&p.exec(a))if(2===v.length&&o.relative[v[0]])i=w(v[0]+v[1],b,e);else for(i=o.relative[v[0]]?[b]:m(v.shift(),b);v.length;)a=v.shift(),o.relative[a]&&(a+=v.shift()),i=w(a,i,e);else if(!e&&v.length>1&&9===b.nodeType&&!u&&o.match.ID.test(v[0])&&!o.match.ID.test(v[v.length-1])&&(l=m.find(v.shift(),b,u),b=l.expr?m.filter(l.expr,l.set)[0]:l.set[0]),b)for(l=e?{expr:v.pop(),set:s(e)}:m.find(v.pop(),1!==v.length||"~"!==v[0]&&"+"!==v[0]||!b.parentNode?b:b.parentNode,u),i=l.expr?m.filter(l.expr,l.set):l.set,v.length>0?j=s(i):t=!1;v.length;)n=v.pop(),q=n,o.relative[n]?q=v.pop():n="",null==q&&(q=b),o.relative[n](j,q,u);else j=v=[];if(j||(j=i),j||m.error(n||a),"[object Array]"===g.call(j))if(t)if(b&&1===b.nodeType)for(r=0;null!=j[r];r++)j[r]&&(j[r]===!0||1===j[r].nodeType&&m.contains(b,j[r]))&&c.push(i[r]);else for(r=0;null!=j[r];r++)j[r]&&1===j[r].nodeType&&c.push(i[r]);else c.push.apply(c,j);else s(j,c);return k&&(m(k,f,c,e),m.uniqueSort(c)),c};m.uniqueSort=function(a){if(u&&(h=i,a.sort(u),h))for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;f>e;e++)if(h=o.order[e],(g=o.leftMatch[h].exec(a))&&(i=g[1],g.splice(1,1),"\\"!==i.substr(i.length-1)&&(g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c),null!=d))){a=a.replace(o.match[h],"");break}return d||(d="undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]),{set:d,expr:a}},m.filter=function(a,c,d,e){for(var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);a&&c.length;){for(h in o.filter)if(null!=(f=o.leftMatch[h].exec(a))&&f[2]){if(k=o.filter[h],l=f[1],g=!1,f.splice(1,1),"\\"===l.substr(l.length-1))continue;if(s===r&&(r=[]),o.preFilter[h])if(f=o.preFilter[h](f,s,d,r,e,t)){if(f===!0)continue}else g=i=!0;if(f)for(n=0;null!=(j=s[n]);n++)j&&(i=k(j,f,n,s),p=e^i,d&&null!=i?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){if(d||(s=r),a=a.replace(o.match[h],""),!g)return[];break}}if(a===q){if(null!=g)break;m.error(a)}q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(1===d||9===d||11===d){if("string"==typeof a.textContent)return a.textContent;if("string"==typeof a.innerText)return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(3===d||4===d)return a.nodeValue}else for(b=0;c=a[b];b++)8!==c.nodeType&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c="string"==typeof b,d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f,g=0,h=a.length;h>g;g++)if(f=a[g]){for(;(f=f.previousSibling)&&1!==f.nodeType;);a[g]=e||f&&f.nodeName.toLowerCase()===b?f||!1:f===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d="string"==typeof b,e=0,f=a.length;if(d&&!l.test(b)){for(b=b.toLowerCase();f>e;e++)if(c=a[e]){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}else{for(;f>e;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(b,d,e){var g,h=f++,i=a;"string"==typeof d&&!l.test(d)&&(d=d.toLowerCase(),g=d,i=c),i("parentNode",d,h,b,g,e)},"~":function(b,d,e){var g,h=f++,i=a;"string"==typeof d&&!l.test(d)&&(d=d.toLowerCase(),g=d,i=c),i("previousSibling",d,h,b,g,e)}},find:{ID:function(a,b,c){if("undefined"!=typeof b.getElementById&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if("undefined"!=typeof b.getElementsByName){for(var c=[],d=b.getElementsByName(a[1]),e=0,f=d.length;f>e;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return 0===c.length?null:c}},TAG:function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a[1]):void 0}},preFilter:{CLASS:function(a,b,c,d,e,f){if(a=" "+a[1].replace(j,"")+" ",f)return a;for(var g,h=0;null!=(g=b[h]);h++)g&&(e^(g.className&&(" "+g.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(g):c&&(b[h]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if("nth"===a[1]){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===a[2]&&"2n"||"odd"===a[2]&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);return a[0]=f++,a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");return!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),"~="===a[2]&&(a[4]=" "+a[4]+" "),a},PSEUDO:function(a,b,c,e,f){if("not"===a[1]){if(!((d.exec(a[3])||"").length>1||/^\w/.test(a[3]))){var g=m.filter(a[3],b,c,!0^f);return c||e.push.apply(e,g),!1}a[3]=m(a[3],null,null,b)}else if(o.match.POS.test(a[0])||o.match.CHILD.test(a[0]))return!0;return a},POS:function(a){return a.unshift(!0),a}},filters:{enabled:function(a){return a.disabled===!1&&"hidden"!==a.type},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"input"===a.nodeName.toLowerCase()&&"text"===c&&(b===c||null===b)},radio:function(a){return"input"===a.nodeName.toLowerCase()&&"radio"===a.type},checkbox:function(a){return"input"===a.nodeName.toLowerCase()&&"checkbox"===a.type},file:function(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type},password:function(a){return"input"===a.nodeName.toLowerCase()&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"submit"===a.type},image:function(a){return"input"===a.nodeName.toLowerCase()&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return 0===b},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if("contains"===e)return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if("not"===e){for(var g=b[3],h=0,i=g.length;i>h;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,d,f,g,h,i,j=b[1],k=a;switch(j){case"only":case"first":for(;k=k.previousSibling;)if(1===k.nodeType)return!1;if("first"===j)return!0;k=a;case"last":for(;k=k.nextSibling;)if(1===k.nodeType)return!1;return!0;case"nth":if(c=b[2],d=b[3],1===c&&0===d)return!0;if(f=b[0],g=a.parentNode,g&&(g[e]!==f||!a.nodeIndex)){for(h=0,k=g.firstChild;k;k=k.nextSibling)1===k.nodeType&&(k.nodeIndex=++h);g[e]=f}return i=a.nodeIndex-d,0===c?0===i:i%c===0&&i/c>=0}},ID:function(a,b){return 1===a.nodeType&&a.getAttribute("id")===b},TAG:function(a,b){return"*"===b&&1===a.nodeType||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return null==d?"!="===f:!f&&m.attr?null!=d:"="===f?e===g:"*="===f?e.indexOf(g)>=0:"~="===f?(" "+e+" ").indexOf(g)>=0:g?"!="===f?e!==g:"^="===f?0===e.indexOf(g):"$="===f?e.substr(e.length-g.length)===g:"|="===f?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];return f?f(a,c,b,d):void 0}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){return a=Array.prototype.slice.call(a,0),b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(G.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if("[object Array]"===g.call(a))Array.prototype.push.apply(d,a);else if("number"==typeof a.length)for(var e=a.length;e>c;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;G.documentElement.compareDocumentPosition?u=function(a,b){return a===b?(h=!0,0):a.compareDocumentPosition&&b.compareDocumentPosition?4&a.compareDocumentPosition(b)?-1:1:a.compareDocumentPosition?-1:1}:(u=function(a,b){if(a===b)return h=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;for(;j;)e.unshift(j),j=j.parentNode;for(j=i;j;)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;c>k&&d>k;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;for(var d=a.nextSibling;d;){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=G.createElement("div"),c="script"+(new Date).getTime(),d=G.documentElement;a.innerHTML="",d.insertBefore(a,d.firstChild),G.getElementById(c)&&(o.find.ID=function(a,c,d){if("undefined"!=typeof c.getElementById&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||"undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&c&&c.nodeValue===b}),d.removeChild(a),d=a=null}(),function(){var a=G.createElement("div");a.appendChild(G.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if("*"===a[1]){for(var d=[],e=0;c[e];e++)1===c[e].nodeType&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&"undefined"!=typeof a.firstChild.getAttribute&&"#"!==a.firstChild.getAttribute("href")&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),G.querySelectorAll&&function(){var a=m,b=G.createElement("div"),c="__sizzle__";if(b.innerHTML="

    ",!b.querySelectorAll||0!==b.querySelectorAll(".TEST").length){m=function(b,d,e,f){if(d=d||G,!f&&!m.isXML(d)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(g&&(1===d.nodeType||9===d.nodeType)){if(g[1])return s(d.getElementsByTagName(b),e);if(g[2]&&o.find.CLASS&&d.getElementsByClassName)return s(d.getElementsByClassName(g[2]),e)}if(9===d.nodeType){if("body"===b&&d.body)return s([d.body],e);if(g&&g[3]){var h=d.getElementById(g[3]);if(!h||!h.parentNode)return s([],e);if(h.id===g[3])return s([h],e)}try{return s(d.querySelectorAll(b),e)}catch(i){}}else if(1===d.nodeType&&"object"!==d.nodeName.toLowerCase()){var j=d,k=d.getAttribute("id"),l=k||c,n=d.parentNode,p=/^\s*[+~]/.test(b);k?l=l.replace(/'/g,"\\$&"):d.setAttribute("id",l),p&&n&&(d=d.parentNode);try{if(!p||n)return s(d.querySelectorAll("[id='"+l+"'] "+b),e)}catch(q){}finally{k||j.removeAttribute("id")}}}return a(b,d,e,f)};for(var d in a)m[d]=a[d];b=null}}(),function(){var a=G.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(G.createElement("div"),"div"),d=!1;try{b.call(G.documentElement,"[test!='']:sizzle")}catch(e){d=!0}m.matchesSelector=function(a,e){if(e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!m.isXML(a))try{if(d||!o.match.PSEUDO.test(e)&&!/!=/.test(e)){var f=b.call(a,e);if(f||!c||a.document&&11!==a.document.nodeType)return f}}catch(g){}return m(e,null,null,[a]).length>0}}}(),function(){var a=G.createElement("div");if(a.innerHTML="
    ",a.getElementsByClassName&&0!==a.getElementsByClassName("e").length){if(a.lastChild.className="e",1===a.getElementsByClassName("e").length)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){return"undefined"==typeof b.getElementsByClassName||c?void 0:b.getElementsByClassName(a[1])},a=null}}(),m.contains=G.documentElement.contains?function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:G.documentElement.compareDocumentPosition?function(a,b){return!!(16&a.compareDocumentPosition(b))}:function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?"HTML"!==b.nodeName:!1};var w=function(a,b,c){for(var d,e=[],f="",g=b.nodeType?[b]:b;d=o.match.PSEUDO.exec(a);)f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;i>h;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=J.attr,m.selectors.attrMap={},J.find=m,J.expr=m.selectors,J.expr[":"]=J.expr.filters,J.unique=m.uniqueSort,J.text=m.getText,J.isXMLDoc=m.isXML,J.contains=m.contains}();var hb=/Until$/,ib=/^(?:parents|prevUntil|prevAll)/,jb=/,/,kb=/^.[^:#\[\.,]*$/,lb=Array.prototype.slice,mb=J.expr.match.globalPOS,nb={children:!0,contents:!0,next:!0,prev:!0};J.fn.extend({find:function(a){var b,c,d=this;if("string"!=typeof a)return J(a).filter(function(){for(b=0,c=d.length;c>b;b++)if(J.contains(d[b],this))return!0});var e,f,g,h=this.pushStack("","find",a);for(b=0,c=this.length;c>b;b++)if(e=h.length,J.find(a,this[b],h),b>0)for(f=e;fg;g++)if(h[g]===h[f]){h.splice(f--,1);break}return h},has:function(a){var b=J(a);return this.filter(function(){for(var a=0,c=b.length;c>a;a++)if(J.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(y(this,a,!1),"not",a)},filter:function(a){return this.pushStack(y(this,a,!0),"filter",a)},is:function(a){return!!a&&("string"==typeof a?mb.test(a)?J(a,this.context).index(this[0])>=0:J.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d,e=[],f=this[0];if(J.isArray(a)){for(var g=1;f&&f.ownerDocument&&f!==b;){for(c=0;cc;c++)for(f=this[c];f;){if(h?h.index(f)>-1:J.find.matchesSelector(f,a)){e.push(f);break}if(f=f.parentNode,!f||!f.ownerDocument||f===b||11===f.nodeType)break}return e=e.length>1?J.unique(e):e,this.pushStack(e,"closest",a)},index:function(a){return a?"string"==typeof a?J.inArray(this[0],J(a)):J.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c="string"==typeof a?J(a,b):J.makeArray(a&&a.nodeType?[a]:a),d=J.merge(this.get(),c);return this.pushStack(z(c[0])||z(d[0])?d:J.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),J.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return J.dir(a,"parentNode")},parentsUntil:function(a,b,c){return J.dir(a,"parentNode",c)},next:function(a){return J.nth(a,2,"nextSibling")},prev:function(a){return J.nth(a,2,"previousSibling")},nextAll:function(a){return J.dir(a,"nextSibling")},prevAll:function(a){return J.dir(a,"previousSibling")},nextUntil:function(a,b,c){return J.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return J.dir(a,"previousSibling",c)},siblings:function(a){return J.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return J.sibling(a.firstChild)},contents:function(a){return J.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:J.makeArray(a.childNodes)}},function(a,b){J.fn[a]=function(c,d){var e=J.map(this,b,c);return hb.test(a)||(d=c),d&&"string"==typeof d&&(e=J.filter(d,e)),e=this.length>1&&!nb[a]?J.unique(e):e,(this.length>1||jb.test(d))&&ib.test(a)&&(e=e.reverse()),this.pushStack(e,a,lb.call(arguments).join(","))}}),J.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),1===b.length?J.find.matchesSelector(b[0],a)?[b[0]]:[]:J.find.matches(a,b)},dir:function(a,c,d){for(var e=[],f=a[c];f&&9!==f.nodeType&&(d===b||1!==f.nodeType||!J(f).is(d));)1===f.nodeType&&e.push(f),f=f[c];return e},nth:function(a,b,c){b=b||1;for(var d=0;a&&(1!==a.nodeType||++d!==b);a=a[c]);return a},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var ob="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",pb=/ jQuery\d+="(?:\d+|null)"/g,qb=/^\s+/,rb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,sb=/<([\w:]+)/,tb=/]","i"),yb=/checked\s*(?:[^=]|=\s*.checked.)/i,zb=/\/(java|ecma)script/i,Ab=/^\s*",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Cb=x(G);Bb.optgroup=Bb.option,Bb.tbody=Bb.tfoot=Bb.colgroup=Bb.caption=Bb.thead,Bb.th=Bb.td,J.support.htmlSerialize||(Bb._default=[1,"div
    ","
    "]),J.fn.extend({text:function(a){return J.access(this,function(a){return a===b?J.text(this):this.empty().append((this[0]&&this[0].ownerDocument||G).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(J.isFunction(a))return this.each(function(b){J(this).wrapAll(a.call(this,b))});if(this[0]){var b=J(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild; -return a}).append(this)}return this},wrapInner:function(a){return this.each(J.isFunction(a)?function(b){J(this).wrapInner(a.call(this,b))}:function(){var b=J(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=J.isFunction(a);return this.each(function(c){J(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){J.nodeName(this,"body")||J(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=J.clean(arguments);return a.push.apply(a,this.toArray()),this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);return a.push.apply(a,J.clean(arguments)),a}},remove:function(a,b){for(var c,d=0;null!=(c=this[d]);d++)(!a||J.filter(a,[c]).length)&&(!b&&1===c.nodeType&&(J.cleanData(c.getElementsByTagName("*")),J.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)for(1===a.nodeType&&J.cleanData(a.getElementsByTagName("*"));a.firstChild;)a.removeChild(a.firstChild);return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return J.clone(this,a,b)})},html:function(a){return J.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return 1===c.nodeType?c.innerHTML.replace(pb,""):null;if(!("string"!=typeof a||vb.test(a)||!J.support.leadingWhitespace&&qb.test(a)||Bb[(sb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(rb,"<$1>");try{for(;e>d;d++)c=this[d]||{},1===c.nodeType&&(J.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return this[0]&&this[0].parentNode?J.isFunction(a)?this.each(function(b){var c=J(this),d=c.html();c.replaceWith(a.call(this,b,d))}):("string"!=typeof a&&(a=J(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;J(this).remove(),b?J(b).before(a):J(c).append(a)})):this.length?this.pushStack(J(J.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,f,g,h,i=a[0],j=[];if(!J.support.checkClone&&3===arguments.length&&"string"==typeof i&&yb.test(i))return this.each(function(){J(this).domManip(a,c,d,!0)});if(J.isFunction(i))return this.each(function(e){var f=J(this);a[0]=i.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){if(h=i&&i.parentNode,e=J.support.parentNode&&h&&11===h.nodeType&&h.childNodes.length===this.length?{fragment:h}:J.buildFragment(a,this,j),g=e.fragment,f=1===g.childNodes.length?g=g.firstChild:g.firstChild,f){c=c&&J.nodeName(f,"tr");for(var k=0,l=this.length,m=l-1;l>k;k++)d.call(c?w(this[k],f):this[k],e.cacheable||l>1&&m>k?J.clone(g,!0,!0):g)}j.length&&J.each(j,function(a,b){b.src?J.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):J.globalEval((b.text||b.textContent||b.innerHTML||"").replace(Ab,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),J.buildFragment=function(a,b,c){var d,e,f,g,h=a[0];return b&&b[0]&&(g=b[0].ownerDocument||b[0]),g.createDocumentFragment||(g=G),1===a.length&&"string"==typeof h&&h.length<512&&g===G&&"<"===h.charAt(0)&&!wb.test(h)&&(J.support.checkClone||!yb.test(h))&&(J.support.html5Clone||!xb.test(h))&&(e=!0,f=J.fragments[h],f&&1!==f&&(d=f)),d||(d=g.createDocumentFragment(),J.clean(a,g,d,c)),e&&(J.fragments[h]=f?d:1),{fragment:d,cacheable:e}},J.fragments={},J.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){J.fn[a]=function(c){var d=[],e=J(c),f=1===this.length&&this[0].parentNode;if(f&&11===f.nodeType&&1===f.childNodes.length&&1===e.length)return e[b](this[0]),this;for(var g=0,h=e.length;h>g;g++){var i=(g>0?this.clone(!0):this).get();J(e[g])[b](i),d=d.concat(i)}return this.pushStack(d,a,e.selector)}}),J.extend({clone:function(a,b,c){var d,e,f,g=J.support.html5Clone||J.isXMLDoc(a)||!xb.test("<"+a.nodeName+">")?a.cloneNode(!0):q(a);if(!(J.support.noCloneEvent&&J.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||J.isXMLDoc(a)))for(u(a,g),d=t(a),e=t(g),f=0;d[f];++f)e[f]&&u(d[f],e[f]);if(b&&(v(a,g),c))for(d=t(a),e=t(g),f=0;d[f];++f)v(d[f],e[f]);return d=e=null,g},clean:function(a,b,c,d){var e,f,g,h=[];b=b||G,"undefined"==typeof b.createElement&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||G);for(var i,j=0;null!=(i=a[j]);j++)if("number"==typeof i&&(i+=""),i){if("string"==typeof i)if(ub.test(i)){i=i.replace(rb,"<$1>");var k,l=(sb.exec(i)||["",""])[1].toLowerCase(),m=Bb[l]||Bb._default,n=m[0],o=b.createElement("div"),p=Cb.childNodes;for(b===G?Cb.appendChild(o):x(b).appendChild(o),o.innerHTML=m[1]+i+m[2];n--;)o=o.lastChild;if(!J.support.tbody){var q=tb.test(i),s="table"!==l||q?""!==m[1]||q?[]:o.childNodes:o.firstChild&&o.firstChild.childNodes;for(g=s.length-1;g>=0;--g)J.nodeName(s[g],"tbody")&&!s[g].childNodes.length&&s[g].parentNode.removeChild(s[g])}!J.support.leadingWhitespace&&qb.test(i)&&o.insertBefore(b.createTextNode(qb.exec(i)[0]),o.firstChild),i=o.childNodes,o&&(o.parentNode.removeChild(o),p.length>0&&(k=p[p.length-1],k&&k.parentNode&&k.parentNode.removeChild(k)))}else i=b.createTextNode(i);var t;if(!J.support.appendChecked)if(i[0]&&"number"==typeof(t=i.length))for(g=0;t>g;g++)r(i[g]);else r(i);i.nodeType?h.push(i):h=J.merge(h,i)}if(c)for(e=function(a){return!a.type||zb.test(a.type)},j=0;h[j];j++)if(f=h[j],d&&J.nodeName(f,"script")&&(!f.type||zb.test(f.type)))d.push(f.parentNode?f.parentNode.removeChild(f):f);else{if(1===f.nodeType){var u=J.grep(f.getElementsByTagName("script"),e);h.splice.apply(h,[j+1,0].concat(u))}c.appendChild(f)}return h},cleanData:function(a){for(var b,c,d,e=J.cache,f=J.event.special,g=J.support.deleteExpando,h=0;null!=(d=a[h]);h++)if((!d.nodeName||!J.noData[d.nodeName.toLowerCase()])&&(c=d[J.expando])){if(b=e[c],b&&b.events){for(var i in b.events)f[i]?J.event.remove(d,i):J.removeEvent(d,i,b.handle);b.handle&&(b.handle.elem=null)}g?delete d[J.expando]:d.removeAttribute&&d.removeAttribute(J.expando),delete e[c]}}});var Db,Eb,Fb,Gb=/alpha\([^)]*\)/i,Hb=/opacity=([^)]*)/,Ib=/([A-Z]|^ms)/g,Jb=/^[\-+]?(?:\d*\.)?\d+$/i,Kb=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,Lb=/^([\-+])=([\-+.\de]+)/,Mb=/^margin/,Nb={position:"absolute",visibility:"hidden",display:"block"},Ob=["Top","Right","Bottom","Left"];J.fn.css=function(a,c){return J.access(this,function(a,c,d){return d!==b?J.style(a,c,d):J.css(a,c)},a,c,arguments.length>1)},J.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Db(a,"opacity");return""===c?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":J.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g,h=J.camelCase(c),i=a.style,j=J.cssHooks[h];if(c=J.cssProps[h]||h,d===b)return j&&"get"in j&&(f=j.get(a,!1,e))!==b?f:i[c];if(g=typeof d,"string"===g&&(f=Lb.exec(d))&&(d=+(f[1]+1)*+f[2]+parseFloat(J.css(a,c)),g="number"),null==d||"number"===g&&isNaN(d))return;if("number"===g&&!J.cssNumber[h]&&(d+="px"),!(j&&"set"in j&&(d=j.set(a,d))===b))try{i[c]=d}catch(k){}}},css:function(a,c,d){var e,f;return c=J.camelCase(c),f=J.cssHooks[c],c=J.cssProps[c]||c,"cssFloat"===c&&(c="float"),f&&"get"in f&&(e=f.get(a,!0,d))!==b?e:Db?Db(a,c):void 0},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),J.curCSS=J.css,G.defaultView&&G.defaultView.getComputedStyle&&(Eb=function(a,b){var c,d,e,f,g=a.style;return b=b.replace(Ib,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),""===c&&!J.contains(a.ownerDocument.documentElement,a)&&(c=J.style(a,b))),!J.support.pixelMargin&&e&&Mb.test(b)&&Kb.test(c)&&(f=g.width,g.width=c,c=e.width,g.width=f),c}),G.documentElement.currentStyle&&(Fb=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;return null==f&&g&&(e=g[b])&&(f=e),Kb.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left="fontSize"===b?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d)),""===f?"auto":f}),Db=Eb||Fb,J.each(["height","width"],function(a,b){J.cssHooks[b]={get:function(a,c,d){return c?0!==a.offsetWidth?p(a,b,d):J.swap(a,Nb,function(){return p(a,b,d)}):void 0},set:function(a,b){return Jb.test(b)?b+"px":b}}}),J.support.opacity||(J.cssHooks.opacity={get:function(a,b){return Hb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=J.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,b>=1&&""===J.trim(f.replace(Gb,""))&&(c.removeAttribute("filter"),d&&!d.filter)||(c.filter=Gb.test(f)?f.replace(Gb,e):f+" "+e)}}),J(function(){J.support.reliableMarginRight||(J.cssHooks.marginRight={get:function(a,b){return J.swap(a,{display:"inline-block"},function(){return b?Db(a,"margin-right"):a.style.marginRight})}})}),J.expr&&J.expr.filters&&(J.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return 0===b&&0===c||!J.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||J.css(a,"display"))},J.expr.filters.visible=function(a){return!J.expr.filters.hidden(a)}),J.each({margin:"",padding:"",border:"Width"},function(a,b){J.cssHooks[a+b]={expand:function(c){var d,e="string"==typeof c?c.split(" "):[c],f={};for(d=0;4>d;d++)f[a+Ob[d]+b]=e[d]||e[d-2]||e[0];return f}}});var Pb,Qb,Rb=/%20/g,Sb=/\[\]$/,Tb=/\r?\n/g,Ub=/#.*$/,Vb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Wb=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Xb=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Yb=/^(?:GET|HEAD)$/,Zb=/^\/\//,$b=/\?/,_b=/)<[^<]*)*<\/script>/gi,ac=/^(?:select|textarea)/i,bc=/\s+/,cc=/([?&])_=[^&]*/,dc=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,ec=J.fn.load,fc={},gc={},hc=["*/"]+["*"];try{Pb=I.href}catch(ic){Pb=G.createElement("a"),Pb.href="",Pb=Pb.href}Qb=dc.exec(Pb.toLowerCase())||[],J.fn.extend({load:function(a,c,d){if("string"!=typeof a&&ec)return ec.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}var g="GET";c&&(J.isFunction(c)?(d=c,c=b):"object"==typeof c&&(c=J.param(c,J.ajaxSettings.traditional),g="POST"));var h=this;return J.ajax({url:a,type:g,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),h.html(f?J("
    ").append(c.replace(_b,"")).find(f):c)),d&&h.each(d,[c,b,a])}}),this},serialize:function(){return J.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?J.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ac.test(this.nodeName)||Wb.test(this.type))}).map(function(a,b){var c=J(this).val();return null==c?null:J.isArray(c)?J.map(c,function(a){return{name:b.name,value:a.replace(Tb,"\r\n")}}):{name:b.name,value:c.replace(Tb,"\r\n")}}).get()}}),J.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){J.fn[b]=function(a){return this.on(b,a)}}),J.each(["get","post"],function(a,c){J[c]=function(a,d,e,f){return J.isFunction(d)&&(f=f||e,e=d,d=b),J.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),J.extend({getScript:function(a,c){return J.get(a,b,c,"script")},getJSON:function(a,b,c){return J.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?m(a,J.ajaxSettings):(b=a,a=J.ajaxSettings),m(a,b),a},ajaxSettings:{url:Pb,isLocal:Xb.test(Qb[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":hc},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":J.parseJSON,"text xml":J.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:o(fc),ajaxTransport:o(gc),ajax:function(a,c){function d(a,c,d,g){if(2!==x){x=2,i&&clearTimeout(i),h=b,f=g||"",y.readyState=a>0?4:0;var l,n,o,v,w,z=c,A=d?k(p,y,d):b;if(a>=200&&300>a||304===a)if(p.ifModified&&((v=y.getResponseHeader("Last-Modified"))&&(J.lastModified[e]=v),(w=y.getResponseHeader("Etag"))&&(J.etag[e]=w)),304===a)z="notmodified",l=!0;else try{n=j(p,A),z="success",l=!0}catch(B){z="parsererror",o=B}else o=z,(!z||a)&&(z="error",0>a&&(a=0));y.status=a,y.statusText=""+(c||z),l?s.resolveWith(q,[n,z,y]):s.rejectWith(q,[y,z,o]),y.statusCode(u),u=b,m&&r.trigger("ajax"+(l?"Success":"Error"),[y,p,l?n:o]),t.fireWith(q,[y,z]),m&&(r.trigger("ajaxComplete",[y,p]),--J.active||J.event.trigger("ajaxStop"))}}"object"==typeof a&&(c=a,a=b),c=c||{};var e,f,g,h,i,l,m,o,p=J.ajaxSetup({},c),q=p.context||p,r=q!==p&&(q.nodeType||q instanceof J)?J(q):J.event,s=J.Deferred(),t=J.Callbacks("once memory"),u=p.statusCode||{},v={},w={},x=0,y={readyState:0,setRequestHeader:function(a,b){if(!x){var c=a.toLowerCase();a=w[c]=w[c]||a,v[a]=b}return this},getAllResponseHeaders:function(){return 2===x?f:null},getResponseHeader:function(a){var c;if(2===x){if(!g)for(g={};c=Vb.exec(f);)g[c[1].toLowerCase()]=c[2];c=g[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return x||(p.mimeType=a),this},abort:function(a){return a=a||"abort",h&&h.abort(a),d(0,a),this}};if(s.promise(y),y.success=y.done,y.error=y.fail,y.complete=t.add,y.statusCode=function(a){if(a){var b;if(2>x)for(b in a)u[b]=[u[b],a[b]];else b=a[y.status],y.then(b,b)}return this},p.url=((a||p.url)+"").replace(Ub,"").replace(Zb,Qb[1]+"//"),p.dataTypes=J.trim(p.dataType||"*").toLowerCase().split(bc),null==p.crossDomain&&(l=dc.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]==Qb[1]&&l[2]==Qb[2]&&(l[3]||("http:"===l[1]?80:443))==(Qb[3]||("http:"===Qb[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=J.param(p.data,p.traditional)),n(fc,p,c,y),2===x)return!1;if(m=p.global,p.type=p.type.toUpperCase(),p.hasContent=!Yb.test(p.type),m&&0===J.active++&&J.event.trigger("ajaxStart"),!p.hasContent&&(p.data&&(p.url+=($b.test(p.url)?"&":"?")+p.data,delete p.data),e=p.url,p.cache===!1)){var z=J.now(),A=p.url.replace(cc,"$1_="+z);p.url=A+(A===p.url?($b.test(p.url)?"&":"?")+"_="+z:"")}(p.data&&p.hasContent&&p.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",p.contentType),p.ifModified&&(e=e||p.url,J.lastModified[e]&&y.setRequestHeader("If-Modified-Since",J.lastModified[e]),J.etag[e]&&y.setRequestHeader("If-None-Match",J.etag[e])),y.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+hc+"; q=0.01":""):p.accepts["*"]);for(o in p.headers)y.setRequestHeader(o,p.headers[o]);if(p.beforeSend&&(p.beforeSend.call(q,y,p)===!1||2===x))return y.abort(),!1;for(o in{success:1,error:1,complete:1})y[o](p[o]);if(h=n(gc,p,c,y)){y.readyState=1,m&&r.trigger("ajaxSend",[y,p]),p.async&&p.timeout>0&&(i=setTimeout(function(){y.abort("timeout")},p.timeout));try{x=1,h.send(v,d)}catch(B){if(!(2>x))throw B;d(-1,B)}}else d(-1,"No Transport");return y},param:function(a,c){var d=[],e=function(a,b){b=J.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b&&(c=J.ajaxSettings.traditional),J.isArray(a)||a.jquery&&!J.isPlainObject(a))J.each(a,function(){e(this.name,this.value)});else for(var f in a)l(f,a[f],c,e);return d.join("&").replace(Rb,"+")}}),J.extend({active:0,lastModified:{},etag:{}});var jc=J.now(),kc=/(\=)\?(&|$)|\?\?/i;J.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return J.expando+"_"+jc++}}),J.ajaxPrefilter("json jsonp",function(b,c,d){var e="string"==typeof b.data&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if("jsonp"===b.dataTypes[0]||b.jsonp!==!1&&(kc.test(b.url)||e&&kc.test(b.data))){var f,g=b.jsonpCallback=J.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h=a[g],i=b.url,j=b.data,k="$1"+g+"$2";return b.jsonp!==!1&&(i=i.replace(kc,k),b.url===i&&(e&&(j=j.replace(kc,k)),b.data===j&&(i+=(/\?/.test(i)?"&":"?")+b.jsonp+"="+g))),b.url=i,b.data=j,a[g]=function(a){f=[a]},d.always(function(){a[g]=h,f&&J.isFunction(h)&&a[g](f[0])}),b.converters["script json"]=function(){return f||J.error(g+" was not called"),f[0]},b.dataTypes[0]="json","script"}}),J.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return J.globalEval(a),a}}}),J.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),J.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=G.head||G.getElementsByTagName("head")[0]||G.documentElement;return{send:function(e,f){c=G.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){(e||!c.readyState||/loaded|complete/.test(c.readyState))&&(c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success"))},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var lc,mc=a.ActiveXObject?function(){for(var a in lc)lc[a](0,1)}:!1,nc=0;J.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&i()||h()}:i,function(a){J.extend(J.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(J.ajaxSettings.xhr()),J.support.ajax&&J.ajaxTransport(function(c){if(!c.crossDomain||J.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();if(c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async),c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||4===i.readyState))if(d=b,g&&(i.onreadystatechange=J.noop,mc&&delete lc[g]),e)4!==i.readyState&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}h||!c.isLocal||c.crossDomain?1223===h&&(h=204):h=l.text?200:404}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async&&4!==i.readyState?(g=++nc,mc&&(lc||(lc={},J(a).unload(mc)),lc[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var oc,pc,qc,rc,sc={},tc=/^(?:toggle|show|hide)$/,uc=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,vc=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];J.fn.extend({show:function(a,b,c){var f,g;if(a||0===a)return this.animate(e("show",3),a,b,c);for(var h=0,i=this.length;i>h;h++)f=this[h],f.style&&(g=f.style.display,!J._data(f,"olddisplay")&&"none"===g&&(g=f.style.display=""),(""===g&&"none"===J.css(f,"display")||!J.contains(f.ownerDocument.documentElement,f))&&J._data(f,"olddisplay",d(f.nodeName)));for(h=0;i>h;h++)f=this[h],f.style&&(g=f.style.display,(""===g||"none"===g)&&(f.style.display=J._data(f,"olddisplay")||""));return this},hide:function(a,b,c){if(a||0===a)return this.animate(e("hide",3),a,b,c);for(var d,f,g=0,h=this.length;h>g;g++)d=this[g],d.style&&(f=J.css(d,"display"),"none"!==f&&!J._data(d,"olddisplay")&&J._data(d,"olddisplay",f));for(g=0;h>g;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:J.fn.toggle,toggle:function(a,b,c){var d="boolean"==typeof a;return J.isFunction(a)&&J.isFunction(b)?this._toggle.apply(this,arguments):null==a||d?this.each(function(){var b=d?a:J(this).is(":hidden");J(this)[b?"show":"hide"]()}):this.animate(e("toggle",3),a,b,c),this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){function f(){g.queue===!1&&J._mark(this);var b,c,e,f,h,i,j,k,l,m,n,o=J.extend({},g),p=1===this.nodeType,q=p&&J(this).is(":hidden");o.animatedProperties={};for(e in a)if(b=J.camelCase(e),e!==b&&(a[b]=a[e],delete a[e]),(h=J.cssHooks[b])&&"expand"in h){i=h.expand(a[b]),delete a[b];for(e in i)e in a||(a[e]=i[e])}for(b in a){if(c=a[b],J.isArray(c)?(o.animatedProperties[b]=c[1],c=a[b]=c[0]):o.animatedProperties[b]=o.specialEasing&&o.specialEasing[b]||o.easing||"swing","hide"===c&&q||"show"===c&&!q)return o.complete.call(this);p&&("height"===b||"width"===b)&&(o.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===J.css(this,"display")&&"none"===J.css(this,"float")&&(J.support.inlineBlockNeedsLayout&&"inline"!==d(this.nodeName)?this.style.zoom=1:this.style.display="inline-block"))}null!=o.overflow&&(this.style.overflow="hidden");for(e in a)f=new J.fx(this,o,e),c=a[e],tc.test(c)?(n=J._data(this,"toggle"+e)||("toggle"===c?q?"show":"hide":0),n?(J._data(this,"toggle"+e,"show"===n?"hide":"show"),f[n]()):f[c]()):(j=uc.exec(c),k=f.cur(),j?(l=parseFloat(j[2]),m=j[3]||(J.cssNumber[e]?"":"px"),"px"!==m&&(J.style(this,e,(l||1)+m),k=(l||1)/f.cur()*k,J.style(this,e,k+m)),j[1]&&(l=("-="===j[1]?-1:1)*l+k),f.custom(k,l,m)):f.custom(k,c,""));return!0}var g=J.speed(b,c,e);return J.isEmptyObject(a)?this.each(g.complete,[!1]):(a=J.extend({},a),g.queue===!1?this.each(f):this.queue(g.queue,f))},stop:function(a,c,d){return"string"!=typeof a&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){function b(a,b,c){var e=b[c];J.removeData(a,c,!0),e.stop(d)}var c,e=!1,f=J.timers,g=J._data(this);if(d||J._unmark(!0,this),null==a)for(c in g)g[c]&&g[c].stop&&c.indexOf(".run")===c.length-4&&b(this,g,c);else g[c=a+".run"]&&g[c].stop&&b(this,g,c);for(c=f.length;c--;)f[c].elem===this&&(null==a||f[c].queue===a)&&(d?f[c](!0):f[c].saveState(),e=!0,f.splice(c,1));(!d||!e)&&J.dequeue(this,a)})}}),J.each({slideDown:e("show",1),slideUp:e("hide",1),slideToggle:e("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){J.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),J.extend({speed:function(a,b,c){var d=a&&"object"==typeof a?J.extend({},a):{complete:c||!c&&b||J.isFunction(a)&&a,duration:a,easing:c&&b||b&&!J.isFunction(b)&&b};return d.duration=J.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in J.fx.speeds?J.fx.speeds[d.duration]:J.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(a){J.isFunction(d.old)&&d.old.call(this),d.queue?J.dequeue(this,d.queue):a!==!1&&J._unmark(this)},d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),J.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(J.fx.step[this.prop]||J.fx.step._default)(this)},cur:function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];var a,b=J.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?b&&"auto"!==b?b:0:a},custom:function(a,c,d){function e(a){return f.step(a)}var f=this,h=J.fx;this.startTime=rc||g(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(J.cssNumber[this.prop]?"":"px"),e.queue=this.options.queue,e.elem=this.elem,e.saveState=function(){J._data(f.elem,"fxshow"+f.prop)===b&&(f.options.hide?J._data(f.elem,"fxshow"+f.prop,f.start):f.options.show&&J._data(f.elem,"fxshow"+f.prop,f.end))},e()&&J.timers.push(e)&&!qc&&(qc=setInterval(h.tick,h.interval))},show:function(){var a=J._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||J.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur()),J(this.elem).show()},hide:function(){this.options.orig[this.prop]=J._data(this.elem,"fxshow"+this.prop)||J.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=rc||g(),f=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(f=!1);if(f){if(null!=i.overflow&&!J.support.shrinkWrapBlocks&&J.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&J(h).hide(),i.hide||i.show)for(b in i.animatedProperties)J.style(h,b,i.orig[b]),J.removeData(h,"fxshow"+b,!0),J.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}return 1/0==i.duration?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=J.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},J.extend(J.fx,{tick:function(){for(var a,b=J.timers,c=0;c-1,l={},m={};k?(m=g.position(),e=m.top,f=m.left):(e=parseFloat(i)||0,f=parseFloat(j)||0),J.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(l.top=b.top-h.top+e),null!=b.left&&(l.left=b.left-h.left+f),"using"in b?b.using.call(a,l):g.css(l)}},J.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=yc.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(J.css(a,"marginTop"))||0,c.left-=parseFloat(J.css(a,"marginLeft"))||0,d.top+=parseFloat(J.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(J.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||G.body;a&&!yc.test(a.nodeName)&&"static"===J.css(a,"position");)a=a.offsetParent;return a})}}),J.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,d){var e=/Y/.test(d);J.fn[a]=function(f){return J.access(this,function(a,f,g){var h=c(a);return g===b?h?d in h?h[d]:J.support.boxModel&&h.document.documentElement[f]||h.document.body[f]:a[f]:void(h?h.scrollTo(e?J(h).scrollLeft():g,e?g:J(h).scrollTop()):a[f]=g)},a,f,arguments.length,null)}}),J.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,f="offset"+a;J.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(J.css(a,c,"padding")):this[c]():null},J.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(J.css(b,c,a?"margin":"border")):this[c]():null},J.fn[c]=function(a){return J.access(this,function(a,c,g){var h,i,j,k;return J.isWindow(a)?(h=a.document,i=h.documentElement[d],J.support.boxModel&&i||h.body&&h.body[d]||i):9===a.nodeType?(h=a.documentElement,h[d]>=h[e]?h[d]:Math.max(a.body[e],h[e],a.body[f],h[f])):g===b?(j=J.css(a,c),k=parseFloat(j),J.isNumeric(k)?k:j):void J(a).css(c,g)},c,a,arguments.length,null)}}),a.jQuery=a.$=J,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return J})}(window),function(){var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.push,h=d.slice,i=d.concat,j=e.toString,k=e.hasOwnProperty,l=d.forEach,m=d.map,n=d.reduce,o=d.reduceRight,p=d.filter,q=d.every,r=d.some,s=d.indexOf,t=d.lastIndexOf,u=Array.isArray,v=Object.keys,w=f.bind,x=function(a){return a instanceof x?a:this instanceof x?void(this._wrapped=a):new x(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=x),exports._=x):a._=x,x.VERSION="1.4.4";var y=x.each=x.forEach=function(a,b,d){if(null!=a)if(l&&a.forEach===l)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;f>e;e++)if(b.call(d,a[e],e,a)===c)return}else for(var g in a)if(x.has(a,g)&&b.call(d,a[g],g,a)===c)return};x.map=x.collect=function(a,b,c){var d=[];return null==a?d:m&&a.map===m?a.map(b,c):(y(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),d)};var z="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),n&&a.reduce===n)return d&&(b=x.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(y(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(z);return c},x.reduceRight=x.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),o&&a.reduceRight===o)return d&&(b=x.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=x.keys(a);f=g.length}if(y(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(z);return c},x.find=x.detect=function(a,b,c){var d;return A(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},x.filter=x.select=function(a,b,c){var d=[];return null==a?d:p&&a.filter===p?a.filter(b,c):(y(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a) -}),d)},x.reject=function(a,b,c){return x.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},x.every=x.all=function(a,b,d){b||(b=x.identity);var e=!0;return null==a?e:q&&a.every===q?a.every(b,d):(y(a,function(a,f,g){return(e=e&&b.call(d,a,f,g))?void 0:c}),!!e)};var A=x.some=x.any=function(a,b,d){b||(b=x.identity);var e=!1;return null==a?e:r&&a.some===r?a.some(b,d):(y(a,function(a,f,g){return e||(e=b.call(d,a,f,g))?c:void 0}),!!e)};x.contains=x.include=function(a,b){return null==a?!1:s&&a.indexOf===s?-1!=a.indexOf(b):A(a,function(a){return a===b})},x.invoke=function(a,b){var c=h.call(arguments,2),d=x.isFunction(b);return x.map(a,function(a){return(d?b:a[b]).apply(a,c)})},x.pluck=function(a,b){return x.map(a,function(a){return a[b]})},x.where=function(a,b,c){return x.isEmpty(b)?c?null:[]:x[c?"find":"filter"](a,function(a){for(var c in b)if(b[c]!==a[c])return!1;return!0})},x.findWhere=function(a,b){return x.where(a,b,!0)},x.max=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&65535>a.length)return Math.max.apply(Math,a);if(!b&&x.isEmpty(a))return-1/0;var d={computed:-1/0,value:-1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},x.min=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&65535>a.length)return Math.min.apply(Math,a);if(!b&&x.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;d.computed>g&&(d={value:a,computed:g})}),d.value},x.shuffle=function(a){var b,c=0,d=[];return y(a,function(a){b=x.random(c++),d[c-1]=d[b],d[b]=a}),d};var B=function(a){return x.isFunction(a)?a:function(b){return b[a]}};x.sortBy=function(a,b,c){var d=B(b);return x.pluck(x.map(a,function(a,b,e){return{value:a,index:b,criteria:d.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.indexf;){var h=f+g>>>1;e>c.call(d,a[h])?f=h+1:g=h}return f},x.toArray=function(a){return a?x.isArray(a)?h.call(a):a.length===+a.length?x.map(a,x.identity):x.values(a):[]},x.size=function(a){return null==a?0:a.length===+a.length?a.length:x.keys(a).length},x.first=x.head=x.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:h.call(a,0,b)},x.initial=function(a,b,c){return h.call(a,0,a.length-(null==b||c?1:b))},x.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:h.call(a,Math.max(a.length-b,0))},x.rest=x.tail=x.drop=function(a,b,c){return h.call(a,null==b||c?1:b)},x.compact=function(a){return x.filter(a,x.identity)};var D=function(a,b,c){return y(a,function(a){x.isArray(a)?b?g.apply(c,a):D(a,b,c):c.push(a)}),c};x.flatten=function(a,b){return D(a,b,[])},x.without=function(a){return x.difference(a,h.call(arguments,1))},x.uniq=x.unique=function(a,b,c,d){x.isFunction(b)&&(d=c,c=b,b=!1);var e=c?x.map(a,c,d):a,f=[],g=[];return y(e,function(c,d){(b?d&&g[g.length-1]===c:x.contains(g,c))||(g.push(c),f.push(a[d]))}),f},x.union=function(){return x.uniq(i.apply(d,arguments))},x.intersection=function(a){var b=h.call(arguments,1);return x.filter(x.uniq(a),function(a){return x.every(b,function(b){return x.indexOf(b,a)>=0})})},x.difference=function(a){var b=i.apply(d,h.call(arguments,1));return x.filter(a,function(a){return!x.contains(b,a)})},x.zip=function(){for(var a=h.call(arguments),b=x.max(x.pluck(a,"length")),c=Array(b),d=0;b>d;d++)c[d]=x.pluck(a,""+d);return c},x.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},x.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=x.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(s&&a.indexOf===s)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},x.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(t&&a.lastIndexOf===t)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},x.range=function(a,b,c){1>=arguments.length&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=Array(d);d>e;)f[e++]=a,a+=c;return f},x.bind=function(a,b){if(a.bind===w&&w)return w.apply(a,h.call(arguments,1));var c=h.call(arguments,2);return function(){return a.apply(b,c.concat(h.call(arguments)))}},x.partial=function(a){var b=h.call(arguments,1);return function(){return a.apply(this,b.concat(h.call(arguments)))}},x.bindAll=function(a){var b=h.call(arguments,1);return 0===b.length&&(b=x.functions(a)),y(b,function(b){a[b]=x.bind(a[b],a)}),a},x.memoize=function(a,b){var c={};return b||(b=x.identity),function(){var d=b.apply(this,arguments);return x.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},x.delay=function(a,b){var c=h.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},x.defer=function(a){return x.delay.apply(x,[a,1].concat(h.call(arguments,1)))},x.throttle=function(a,b){var c,d,e,f,g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)};return function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},x.debounce=function(a,b,c){var d,e;return function(){var f=this,g=arguments,h=function(){d=null,c||(e=a.apply(f,g))},i=c&&!d;return clearTimeout(d),d=setTimeout(h,b),i&&(e=a.apply(f,g)),e}},x.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},x.wrap=function(a,b){return function(){var c=[a];return g.apply(c,arguments),b.apply(this,c)}},x.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},x.after=function(a,b){return 0>=a?b():function(){return 1>--a?b.apply(this,arguments):void 0}},x.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)x.has(a,c)&&(b[b.length]=c);return b},x.values=function(a){var b=[];for(var c in a)x.has(a,c)&&b.push(a[c]);return b},x.pairs=function(a){var b=[];for(var c in a)x.has(a,c)&&b.push([c,a[c]]);return b},x.invert=function(a){var b={};for(var c in a)x.has(a,c)&&(b[a[c]]=c);return b},x.functions=x.methods=function(a){var b=[];for(var c in a)x.isFunction(a[c])&&b.push(c);return b.sort()},x.extend=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},x.pick=function(a){var b={},c=i.apply(d,h.call(arguments,1));return y(c,function(c){c in a&&(b[c]=a[c])}),b},x.omit=function(a){var b={},c=i.apply(d,h.call(arguments,1));for(var e in a)x.contains(c,e)||(b[e]=a[e]);return b},x.defaults=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)null==a[c]&&(a[c]=b[c])}),a},x.clone=function(a){return x.isObject(a)?x.isArray(a)?a.slice():x.extend({},a):a},x.tap=function(a,b){return b(a),a};var E=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof x&&(a=a._wrapped),b instanceof x&&(b=b._wrapped);var e=j.call(a);if(e!=j.call(b))return!1;switch(e){case"[object String]":return a==b+"";case"[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;c.push(a),d.push(b);var g=0,h=!0;if("[object Array]"==e){if(g=a.length,h=g==b.length)for(;g--&&(h=E(a[g],b[g],c,d)););}else{var i=a.constructor,k=b.constructor;if(i!==k&&!(x.isFunction(i)&&i instanceof i&&x.isFunction(k)&&k instanceof k))return!1;for(var l in a)if(x.has(a,l)&&(g++,!(h=x.has(b,l)&&E(a[l],b[l],c,d))))break;if(h){for(l in b)if(x.has(b,l)&&!g--)break;h=!g}}return c.pop(),d.pop(),h};x.isEqual=function(a,b){return E(a,b,[],[])},x.isEmpty=function(a){if(null==a)return!0;if(x.isArray(a)||x.isString(a))return 0===a.length;for(var b in a)if(x.has(a,b))return!1;return!0},x.isElement=function(a){return!(!a||1!==a.nodeType)},x.isArray=u||function(a){return"[object Array]"==j.call(a)},x.isObject=function(a){return a===Object(a)},y(["Arguments","Function","String","Number","Date","RegExp"],function(a){x["is"+a]=function(b){return j.call(b)=="[object "+a+"]"}}),x.isArguments(arguments)||(x.isArguments=function(a){return!(!a||!x.has(a,"callee"))}),"function"!=typeof/./&&(x.isFunction=function(a){return"function"==typeof a}),x.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},x.isNaN=function(a){return x.isNumber(a)&&a!=+a},x.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==j.call(a)},x.isNull=function(a){return null===a},x.isUndefined=function(a){return void 0===a},x.has=function(a,b){return k.call(a,b)},x.noConflict=function(){return a._=b,this},x.identity=function(a){return a},x.times=function(a,b,c){for(var d=Array(a),e=0;a>e;e++)d[e]=b.call(c,e);return d},x.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))};var F={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};F.unescape=x.invert(F.escape);var G={escape:RegExp("["+x.keys(F.escape).join("")+"]","g"),unescape:RegExp("("+x.keys(F.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(a){x[a]=function(b){return null==b?"":(""+b).replace(G[a],function(b){return F[a][b]})}}),x.result=function(a,b){if(null==a)return null;var c=a[b];return x.isFunction(c)?c.call(a):c},x.mixin=function(a){y(x.functions(a),function(b){var c=x[b]=a[b];x.prototype[b]=function(){var a=[this._wrapped];return g.apply(a,arguments),L.call(this,c.apply(x,a))}})};var H=0;x.uniqueId=function(a){var b=++H+"";return a?a+b:b},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var I=/(.)^/,J={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(a,b,c){var d;c=x.defaults({},c,x.templateSettings);var e=RegExp([(c.escape||I).source,(c.interpolate||I).source,(c.evaluate||I).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(K,function(a){return"\\"+J[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,x);var i=function(a){return d.call(this,a,x)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},x.chain=function(a){return x(a).chain()};var L=function(a){return this._chain?x(a).chain():a};x.mixin(x),y(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];x.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],L.call(this,c)}}),y(["concat","join","slice"],function(a){var b=d[a];x.prototype[a]=function(){return L.call(this,b.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(a){return 10>a?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g,h=gap,i=b[a];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(a)),"function"==typeof rep&&(i=rep.call(b,a,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,g=[],"[object Array]"===Object.prototype.toString.apply(i)){for(f=i.length,c=0;f>c;c+=1)g[c]=str(c,i)||"null";return e=0===g.length?"[]":gap?"[\n"+gap+g.join(",\n"+gap)+"\n"+h+"]":"["+g.join(",")+"]",gap=h,e}if(rep&&"object"==typeof rep)for(f=rep.length,c=0;f>c;c+=1)"string"==typeof rep[c]&&(d=rep[c],e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));return e=0===g.length?"{}":gap?"{\n"+gap+g.join(",\n"+gap)+"\n"+h+"}":"{"+g.join(",")+"}",gap=h,e}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(a,b,c){var d;if(gap="",indent="","number"==typeof c)for(d=0;c>d;d+=1)indent+=" ";else"string"==typeof c&&(indent=c);if(rep=b,b&&"function"!=typeof b&&("object"!=typeof b||"number"!=typeof b.length))throw new Error("JSON.stringify");return str("",{"":a})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&"object"==typeof e)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),void 0!==d?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(){var a,b=this,c=b.Backbone,d=Array.prototype.slice,e=Array.prototype.splice;a="undefined"!=typeof exports?exports:b.Backbone={},a.VERSION="0.9.2";var f=b._;f||"undefined"==typeof require||(f=require("underscore"));var g=b.jQuery||b.Zepto||b.ender;a.setDomLibrary=function(a){g=a},a.noConflict=function(){return b.Backbone=c,this},a.emulateHTTP=!1,a.emulateJSON=!1;var h=/\s+/,i=a.Events={on:function(a,b,c){var d,e,f,g,i;if(!b)return this;for(a=a.split(h),d=this._callbacks||(this._callbacks={});e=a.shift();)i=d[e],f=i?i.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:i?i.next:f};return this},off:function(a,b,c){var d,e,g,i,j,k;if(e=this._callbacks){if(!(a||b||c))return delete this._callbacks,this;for(a=a?a.split(h):f.keys(e);d=a.shift();)if(g=e[d],delete e[d],g&&(b||c))for(i=g.tail;(g=g.next)!==i;)j=g.callback,k=g.context,(b&&j!==b||c&&k!==c)&&this.on(d,j,k);return this}},trigger:function(a){var b,c,e,f,g,i,j;if(!(e=this._callbacks))return this;for(i=e.all,a=a.split(h),j=d.call(arguments,1);b=a.shift();){if(c=e[b])for(f=c.tail;(c=c.next)!==f;)c.callback.apply(c.context||this,j);if(c=i)for(f=c.tail,g=[b].concat(j);(c=c.next)!==f;)c.callback.apply(c.context||this,g)}return this}};i.bind=i.on,i.unbind=i.off;var j=a.Model=function(a,b){var c;a||(a={}),b&&b.parse&&(a=this.parse(a)),(c=A(this,"defaults"))&&(a=f.extend({},c,a)),b&&b.collection&&(this.collection=b.collection),this.attributes={},this._escapedAttributes={},this.cid=f.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(a,{silent:!0}),this.changed={},this._silent={},this._pending={},this._previousAttributes=f.clone(this.attributes),this.initialize.apply(this,arguments)};f.extend(j.prototype,i,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;var c=this.get(a);return this._escapedAttributes[a]=f.escape(null==c?"":""+c)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e,g;if(f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b),c||(c={}),!d)return this;if(d instanceof j&&(d=d.attributes),c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var h=c.changes={},i=this.attributes,k=this._escapedAttributes,l=this._previousAttributes||{};for(e in d)g=d[e],(!f.isEqual(i[e],g)||c.unset&&f.has(i,e))&&(delete k[e],(c.silent?this._silent:h)[e]=!0),c.unset?delete i[e]:i[e]=g,f.isEqual(l[e],g)&&f.has(i,e)==f.has(l,e)?(delete this.changed[e],delete this._pending[e]):(this.changed[e]=g,c.silent||(this._pending[e]=!0));return c.silent||this.change(c),this},unset:function(a,b){return(b||(b={})).unset=!0,this.set(a,null,b)},clear:function(a){return(a||(a={})).unset=!0,this.set(f.clone(this.attributes),a)},fetch:function(b){b=b?f.clone(b):{};var c=this,d=b.success;return b.success=function(a,e,f){return c.set(c.parse(a,f),b)?void(d&&d(c,a)):!1},b.error=a.wrapError(b.error,c,b),(this.sync||a.sync).call(this,"read",this,b)},save:function(b,c,d){var e,g;if(f.isObject(b)||null==b?(e=b,d=c):(e={},e[b]=c),d=d?f.clone(d):{},d.wait){if(!this._validate(e,d))return!1;g=f.clone(this.attributes)}var h=f.extend({},d,{silent:!0});if(e&&!this.set(e,d.wait?h:d))return!1;var i=this,j=d.success;d.success=function(a,b,c){var g=i.parse(a,c);return d.wait&&(delete d.wait,g=f.extend(e||{},g)),i.set(g,d)?void(j?j(i,a):i.trigger("sync",i,a,d)):!1},d.error=a.wrapError(d.error,i,d);var k=this.isNew()?"create":"update",l=(this.sync||a.sync).call(this,k,this,d);return d.wait&&this.set(g,h),l},destroy:function(b){b=b?f.clone(b):{};var c=this,d=b.success,e=function(){c.trigger("destroy",c,c.collection,b)};if(this.isNew())return e(),!1;b.success=function(a){b.wait&&e(),d?d(c,a):c.trigger("sync",c,a,b)},b.error=a.wrapError(b.error,c,b);var g=(this.sync||a.sync).call(this,"delete",this,b);return b.wait||e(),g},url:function(){var a=A(this,"urlRoot")||A(this.collection,"url")||B();return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(var c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending={},this.trigger("change",this,a);for(var c in this.changed)this._pending[c]||this._silent[c]||delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}return this._changing=!1,this},hasChanged:function(a){return arguments.length?f.has(this.changed,a):!f.isEmpty(this.changed)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes;for(var e in a)f.isEqual(d[e],b=a[e])||((c||(c={}))[e]=b);return c},previous:function(a){return arguments.length&&this._previousAttributes?this._previousAttributes[a]:null},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;a=f.extend({},this.attributes,a);var c=this.validate(a,b);return c?(b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b),!1):!0}});var k=a.Collection=function(a,b){b||(b={}),b.model&&(this.model=b.model),b.comparator&&(this.comparator=b.comparator),this._reset(),this.initialize.apply(this,arguments),a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(k.prototype,i,{model:j,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,g,h,i,j,k={},l={},m=[];for(b||(b={}),a=f.isArray(a)?a.slice():[a],c=0,g=a.length;g>c;c++){if(!(h=a[c]=this._prepareModel(a[c],b)))throw new Error("Can't add an invalid model to a collection");i=h.cid,j=h.id,k[i]||this._byCid[i]||null!=j&&(l[j]||this._byId[j])?m.push(c):k[i]=l[j]=h}for(c=m.length;c--;)a.splice(m[c],1);for(c=0,g=a.length;g>c;c++)(h=a[c]).on("all",this._onModelEvent,this),this._byCid[h.cid]=h,null!=h.id&&(this._byId[h.id]=h);if(this.length+=g,d=null!=b.at?b.at:this.models.length,e.apply(this.models,[d,0].concat(a)),this.comparator&&this.sort({silent:!0}),b.silent)return this;for(c=0,g=this.models.length;g>c;c++)k[(h=this.models[c]).cid]&&(b.index=c,h.trigger("add",h,this,b));return this},remove:function(a,b){var c,d,e,g;for(b||(b={}),a=f.isArray(a)?a.slice():[a],c=0,d=a.length;d>c;c++)g=this.getByCid(a[c])||this.get(a[c]),g&&(delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g));return this},push:function(a,b){return a=this._prepareModel(a,b),this.add(a,b),a},pop:function(a){var b=this.at(this.length-1);return this.remove(b,a),b},unshift:function(a,b){return a=this._prepareModel(a,b),this.add(a,f.extend({at:0},b)),a},shift:function(a){var b=this.at(0);return this.remove(b,a),b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){if(a||(a={}),!this.comparator)throw new Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);return 1==this.comparator.length?this.models=this.sortBy(b):this.models.sort(b),a.silent||this.trigger("reset",this,a),this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]),b||(b={});for(var c=0,d=this.models.length;d>c;c++)this._removeReference(this.models[c]);return this._reset(),this.add(a,f.extend({silent:!0},b)),b.silent||this.trigger("reset",this,b),this},fetch:function(b){b=b?f.clone(b):{},void 0===b.parse&&(b.parse=!0);var c=this,d=b.success;return b.success=function(a,e,f){c[b.add?"add":"reset"](c.parse(a,f),b),d&&d(c,a)},b.error=a.wrapError(b.error,c,b),(this.sync||a.sync).call(this,"read",this,b)},create:function(a,b){var c=this;if(b=b?f.clone(b):{},a=this._prepareModel(a,b),!a)return!1;b.wait||c.add(a,b);var d=b.success;return b.success=function(e,f){b.wait&&c.add(e,b),d?d(e,f):e.trigger("sync",a,f,b)},a.save(null,b),a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(a,b){if(b||(b={}),a instanceof j)a.collection||(a.collection=this);else{var c=a;b.collection=this,a=new this.model(c,b),a._validate(a.attributes,b)||(a=!1)}return a},_removeReference:function(a){this==a.collection&&delete a.collection,a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"!=a&&"remove"!=a||c==this)&&("destroy"==a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,arguments))}});var l=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","initial","rest","last","without","indexOf","shuffle","lastIndexOf","isEmpty","groupBy"];f.each(l,function(a){k.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var m=a.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},n=/:\w+/g,o=/\*\w+/g,p=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(m.prototype,i,{initialize:function(){},route:function(b,c,d){return a.history||(a.history=new q),f.isRegExp(b)||(b=this._routeToRegExp(b)),d||(d=this[c]),a.history.route(b,f.bind(function(e){var f=this._extractParameters(b,e);d&&d.apply(this,f),this.trigger.apply(this,["route:"+c].concat(f)),a.history.trigger("route",this,c,f)},this)),this},navigate:function(b,c){a.history.navigate(b,c)},_bindRoutes:function(){if(this.routes){var a=[];for(var b in this.routes)a.unshift([b,this.routes[b]]);for(var c=0,d=a.length;d>c;c++)this.route(a[c][0],a[c][1],this[a[c][1]])}},_routeToRegExp:function(a){return a=a.replace(p,"\\$&").replace(n,"([^/]+)").replace(o,"(.*?)"),new RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var q=a.History=function(){this.handlers=[],f.bindAll(this,"checkUrl")},r=/^[#\/]/,s=/msie [\w.]+/;q.started=!1,f.extend(q.prototype,i,{interval:50,getHash:function(a){var b=a?a.location:window.location,c=b.href.match(/#(.*)$/);return c?c[1]:""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){a=window.location.pathname;var c=window.location.search;c&&(a+=c)}else a=this.getHash();return a.indexOf(this.options.root)||(a=a.substr(this.options.root.length)),a.replace(r,"")},start:function(a){if(q.started)throw new Error("Backbone.history has already been started");q.started=!0,this.options=f.extend({},{root:"/"},this.options,a),this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&window.history&&window.history.pushState);var b=this.getFragment(),c=document.documentMode,d=s.exec(navigator.userAgent.toLowerCase())&&(!c||7>=c);d&&(this.iframe=g('";this.dialog=new cdb.ui.common.ShareDialog({title:a.map.get("title"),description:a.map.get("description"),model:this.options.vis.map,code:e,url:a.url,public_map_url:d,share_url:a.share_url,template:b,target:$(".cartodb-share a"),size:$(document).width()>400?"":"small",width:$(document).width()>400?430:216}),$(".cartodb-map-wrapper").append(this.dialog.render().$el)},render:function(){return this.$el.html(this.template(_.extend(this.model.attributes))),this}}),cdb.geo.ui.Zoom=cdb.core.View.extend({className:"cartodb-zoom",events:{"click .zoom_in":"zoom_in","click .zoom_out":"zoom_out"},default_options:{timeout:0,msg:""},initialize:function(){this.map=this.model,_.defaults(this.options,this.default_options),this.template=this.options.template?this.options.template:cdb.templates.getTemplate("geo/zoom"),this.map.bind("change:zoom change:minZoom change:maxZoom",this._checkZoom,this)},render:function(){return this.$el.html(this.template(this.options)),this._checkZoom(),this},_checkZoom:function(){var a=this.map.get("zoom");this.$(".zoom_in")[athis.map.get("minZoom")?"removeClass":"addClass"]("disabled")},zoom_in:function(a){this.map.get("maxZoom")>this.map.getZoom()&&this.map.setZoom(this.map.getZoom()+1),a.preventDefault(),a.stopPropagation()},zoom_out:function(a){this.map.get("minZoom")\n
    <%= title %>
    <% } %>
    • <%= leftLabel %>
    • <%= rightLabel %>
    • <%= colors %>\n
    '),initialize:function(){this.items=this.model.items},_generateColorList:function(){var a="";if(this.model.get("colors"))return _.map(this.model.get("colors"),function(a){return'\n
    '}).join("");for(var b=2;b
    '}return a},setLeftLabel:function(a){this.model.set("leftLabel",a)},setRightLabel:function(a){this.model.set("rightLabel",a)},setColors:function(a){this.model.set("colors",a)},render:function(){if(this.model.get("template")){var a=_.template(this.model.get("template"));this.$el.html(a(this.model.toJSON()))}else if(this.items.length>=2){this.leftLabel=this.items.at(0),this.rightLabel=this.items.at(1);var b=this.model.get("leftLabel")||this.leftLabel.get("value"),c=this.model.get("rightLabel")||this.rightLabel.get("value"),d=this._generateColorList(),e=_.extend(this.model.toJSON(),{leftLabel:b,rightLabel:c,colors:d,buckets_count:d.length});this.$el.html(this.template(e))}return this}}),cdb.geo.ui.DensityLegend=cdb.geo.ui.BaseLegend.extend({className:"density-legend",template:_.template('<% if (title && show_title) { %>\n
    <%= title %>
    <% } %>
    • <%= leftLabel %>
    • <%= rightLabel %>
    • <%= colors %>\n
    '),initialize:function(){this.items=this.model.items},setLeftLabel:function(a){this.model.set("leftLabel",a)},setRightLabel:function(a){this.model.set("rightLabel",a)},setColors:function(a){this.model.set("colors",a)},_generateColorList:function(){var a="";if(this.model.get("colors"))return _.map(this.model.get("colors"),function(a){return'\n
    '}).join("");for(var b=2;b'}return a},render:function(){if(this.model.get("template")){var a=_.template(this.model.get("template"));this.$el.html(a(this.model.toJSON()))}else if(this.items.length>=2){this.leftLabel=this.items.at(0),this.rightLabel=this.items.at(1);var b=this.model.get("leftLabel")||this.leftLabel.get("value"),c=this.model.get("rightLabel")||this.rightLabel.get("value"),d=this._generateColorList(),e=_.extend(this.model.toJSON(),{leftLabel:b,rightLabel:c,colors:d,buckets_count:d.length});this.$el.html(this.template(e))}return this}}),cdb.geo.ui.Legend.Density=cdb.geo.ui.DensityLegend.extend({type:"density",className:"cartodb-legend density",initialize:function(){this.items=this.options.items,this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1,leftLabel:this.options.left||this.options.leftLabel,rightLabel:this.options.right||this.options.rightLabel,colors:this.options.colors,buckets_count:this.options.colors?this.options.colors.length:0,items:this.options.items}),this._bindModel()},_bindModel:function(){this.model.bind("change:colors change:template change:title change:show_title change:colors change:leftLabel change:rightLabel",this.render,this)},_generateColorList:function(){return _.map(this.model.get("colors"),function(a){return'
    '}).join("")},render:function(){var a=_.extend(this.model.toJSON(),{colors:this._generateColorList()});return this.$el.html(this.template(a)),this}}),cdb.geo.ui.IntensityLegend=cdb.geo.ui.BaseLegend.extend({className:"intensity-legend",template:_.template('<% if (title && show_title) { %>\n
    <%= title %>
    <% } %>
    • <%= leftLabel %>
    • <%= rightLabel %>
    '),initialize:function(){this.items=this.model.items},_bindModel:function(){this.model.bind("change:template",this.render,this)},setColor:function(a){this.model.set("color",a)},setLeftLabel:function(a){this.model.set("leftLabel",a)},setRightLabel:function(a){this.model.set("rightLabel",a)},_hexToRGB:function(a){var b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null},_rgbToHex:function(a,b,c){function d(a){var b=a.toString(16);return 1==b.length?"0"+b:b}return"#"+d(a)+d(b)+d(c)},_calculateMultiply:function(a,b){var c=this._hexToRGB(a);if(c){for(var d=c.r,e=c.g,f=c.b,g=0;b>=g;g++)d=Math.round(d*c.r/255),e=Math.round(e*c.g/255),f=Math.round(f*c.b/255);return this._rgbToHex(d,e,f)}return"#ffffff"},_renderGraph:function(a){var b=""; -b+="background: <%= color %>;",b+="background: -moz-linear-gradient(left, <%= color %> 0%, <%= right %> 100%);",b+="background: -webkit-gradient(linear, left top, right top, color-stop(0%,<%= color %>), color-stop(100%,<%= right %>));",b+="background: -webkit-linear-gradient(left, <%= color %> 0%,<%= right %> 100%);",b+="background: -o-linear-gradient(left, <%= color %> 0%,<%= right %> 100%);",b+="background: -ms-linear-gradient(left, <%= color %> 0%,<%= right %> 100%)",b+="background: linear-gradient(to right, <%= color %> 0%,<%= right %> 100%);",b+="filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<%= color %>', endColorstr='<%= right %>',GradientType=1 );",b+="background-image: -ms-linear-gradient(left, <%= color %> 0%,<%= right %> 100%)";var c=_.template(b),d=this._calculateMultiply(a,4);this.$el.find(".graph").attr("style",c({color:a,right:d}))},render:function(){if(this.model.get("template")){var a=_.template(this.model.get("template"));this.$el.html(a(this.model.toJSON()))}else if(this.items.length>=3){this.leftLabel=this.items.at(0),this.rightLabel=this.items.at(1);var b=this.model.get("color")||this.items.at(2).get("value"),c=this.model.get("leftLabel")||this.leftLabel.get("value"),d=this.model.get("rightLabel")||this.rightLabel.get("value"),e=_.extend(this.model.toJSON(),{color:b,leftLabel:c,rightLabel:d});this.$el.html(this.template(e)),this._renderGraph(b)}return this}}),cdb.geo.ui.CategoryLegend=cdb.geo.ui.BaseLegend.extend({className:"category-legend",template:_.template('<% if (title && show_title) { %>\n
    <%= title %>
    <% } %>
      '),initialize:function(){this.items=this.model.items},_bindModel:function(){this.model.bind("change:title change:show_title change:template",this.render,this)},_renderItems:function(){this.items.each(this._renderItem,this)},_renderItem:function(a){view=new cdb.geo.ui.LegendItem({model:a,className:a.get("value")&&a.get("value").indexOf("http")>=0||a.get("type")&&"image"==a.get("type")?"bkg":"",template:'
      <%= name || ((name === false) ? "false": "null") %>'}),this.$el.find("ul").append(view.render())},render:function(){if(this.model.get("template")){var a=_.template(this.model.get("template"));this.$el.html(a(this.model.toJSON()))}else this.$el.html(this.template(this.model.toJSON())),this.items.length>0?this._renderItems():this.$el.html('
      The category legend is empty
      ');return this}}),cdb.geo.ui.Legend.Category=cdb.geo.ui.CategoryLegend.extend({className:"cartodb-legend category",type:"category",initialize:function(){this.items=new cdb.geo.ui.LegendItems(this.options.data),this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1}),this._bindModel()},render:function(){return this.$el.html(this.template(this.model.toJSON())),this._renderItems(),this}}),cdb.geo.ui.ColorLegend=cdb.geo.ui.BaseLegend.extend({className:"color-legend",type:"color",template:_.template('<% if (title && show_title) { %>\n
      <%= title %>
      <% } %>
        '),initialize:function(){this.items=this.model.items},_renderItems:function(){this.items.each(this._renderItem,this)},_renderItem:function(a){view=new cdb.geo.ui.LegendItem({model:a,className:a.get("value")&&a.get("value").indexOf("http")>=0?"bkg":"",template:'
        <%= name || ((name === false) ? "false": "null") %>'}),this.$el.find("ul").append(view.render())},render:function(){return this.$el.html(this.template(this.model.toJSON())),this.items.length>0?this._renderItems():this.$el.html('
        The color legend is empty
        '),this}}),cdb.geo.ui.Legend.Color=cdb.geo.ui.Legend.Category.extend({}),cdb.geo.ui.StackedLegend=cdb.core.View.extend({events:{dragstart:"_stopPropagation",mousedown:"_stopPropagation",touchstart:"_stopPropagation",MSPointerDown:"_stopPropagation",dblclick:"_stopPropagation",mousewheel:"_stopPropagation",DOMMouseScroll:"_stopPropagation",dbclick:"_stopPropagation",click:"_stopPropagation"},className:"cartodb-legend-stack",initialize:function(){_.each(this.options.legends,this._setupBinding,this)},_stopPropagation:function(a){a.stopPropagation()},getLegendByIndex:function(a){if(!this._layerByIndex){this._layerByIndex={};for(var b=this.options.legends,c=0;c0&&this.legendItems.each(this._renderLegend,this),this},_renderLegend:function(a){var b=a.get("type");b||(b="custom"),b=this._capitalize(b);var c=new cdb.geo.ui.Legend[b](a.attributes);this.legends.push(c),a.get("visible")!==!1&&this.$el.append(c.render().$el)},getLegendAt:function(a){return this.legends[a]},addLegend:function(a){var b=new cdb.geo.ui.LegendModel(a);this.legendItems.push(b)},removeLegendAt:function(a){var b=this.legendItems.at(a);this.legendItems.remove(b)}}),cdb.geo.ui.LegendModel=cdb.core.Model.extend({defaults:{type:null,show_title:!1,title:"",template:""},initialize:function(){this.items=new cdb.geo.ui.LegendItems(this.get("items")),this.items.bind("add remove reset change",function(){this.set({items:this.items.toJSON()})},this),this.bind("change:items",this._onUpdateItems,this),this.bind("change:title change:show_title",this._onUpdateTitle,this),this.bind("change:template",this._onUpdateTemplate,this)},_onUpdateTemplate:function(){this.template=this.get("template")},_onUpdateTitle:function(){this.title=this.get("title"),this.show_title=this.get("show_title")},_onUpdateItems:function(){var a=this.get("items");this.items.reset(a)}}),cdb.geo.ui.CustomLegend=cdb.geo.ui.BaseLegend.extend({className:"custom-legend",type:"custom",template:_.template('<% if (title && show_title) { %>\n
        <%= title %>
        <% } %>
          '),initialize:function(){this.items=this.model.items},setData:function(a){this.items=new cdb.geo.ui.LegendItems(a),this.model.items=this.items,this.model.set("items",a)},_renderItems:function(){this.items.each(this._renderItem,this)},_renderItem:function(a){view=new cdb.geo.ui.LegendItem({model:a,className:a.get("value")&&a.get("value").indexOf("http")>=0?"bkg":"",template:'
          \n <%= name || "null" %>'}),this.$el.find("ul").append(view.render())},render:function(){if(this.model.get("template")){var a=_.template(this.model.get("template"));this.$el.html(a(this.model.toJSON()))}else this.$el.html(this.template(this.model.toJSON())),this.items.length>0?this._renderItems():this.$el.html('
          The legend is empty
          ');return this}}),cdb.geo.ui.Legend.Custom=cdb.geo.ui.CustomLegend.extend({className:"cartodb-legend custom",type:"custom",initialize:function(){this.items=new cdb.geo.ui.LegendItems(this.options.data||this.options.items),this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1,items:this.items.models}),this._bindModel()},_bindModel:function(){this.model.bind("change:items change:template change:title change:show_title",this.render,this)}}),cdb.geo.ui.BubbleLegend=cdb.geo.ui.BaseLegend.extend({className:"bubble-legend",template:_.template('<% if (title && show_title) { %>\n
          <%= title %>
          <% } %>
          • <%= min %>
          • <%= max %>
          '),initialize:function(){this.items=this.model.items},_bindModel:function(){this.model.bind("change:template change:title change:show_title change:color change:min change:max",this.render,this)},setColor:function(a){this.model.set("color",a)},setMinValue:function(a){this.model.set("min",a)},setMaxValue:function(a){this.model.set("max",a)},_renderGraph:function(a){this.$el.find(".graph").css("background",a)},render:function(){if(this.model.get("template")){var a=_.template(this.model.get("template"));this.$el.html(a(this.model.toJSON())),this.$el.removeClass("bubble-legend")}else{var b=this.model.get("color")||(this.items.length>=3?this.items.at(2).get("value"):"");if(this.items.length>=3){var c=this.model.get("min")||this.items.at(0).get("value"),d=this.model.get("max")||this.items.at(1).get("value"),e=_.extend(this.model.toJSON(),{min:c,max:d});this.$el.html(this.template(e))}this._renderGraph(b)}return this}}),cdb.geo.ui.Legend.Bubble=cdb.geo.ui.BubbleLegend.extend({className:"cartodb-legend bubble",type:"bubble",initialize:function(){this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,min:this.options.min,max:this.options.max,color:this.options.color,show_title:this.options.title?!0:!1}),this.add_related_model(this.model),this._bindModel()},render:function(){return this.$el.html(this.template(this.model.toJSON())),this._renderGraph(this.model.get("color")),this}}),cdb.geo.ui.Legend.Choropleth=cdb.geo.ui.ChoroplethLegend.extend({type:"choropleth",className:"cartodb-legend choropleth",initialize:function(){this.items=this.options.items,this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1,leftLabel:this.options.left||this.options.leftLabel,rightLabel:this.options.right||this.options.rightLabel,colors:this.options.colors,buckets_count:this.options.colors?this.options.colors.length:0}),this.add_related_model(this.model),this._bindModel()},_bindModel:function(){this.model.bind("change:template change:title change:show_title change:colors change:leftLabel change:rightLabel",this.render,this)},_generateColorList:function(){return _.map(this.model.get("colors"),function(a){return'
          '}).join("")},render:function(){var a=_.extend(this.model.toJSON(),{colors:this._generateColorList()});return this.$el.html(this.template(a)),this}}),cdb.geo.ui.Legend.Intensity=cdb.geo.ui.IntensityLegend.extend({className:"cartodb-legend intensity",type:"intensity",initialize:function(){this.items=this.options.items,this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1,color:this.options.color,leftLabel:this.options.left||this.options.leftLabel,rightLabel:this.options.right||this.options.rightLabel}),this.add_related_model(this.model),this._bindModel()},_bindModel:function(){this.model.bind("change:title change:show_title change:color change:leftLabel change:rightLabel",this.render,this)},render:function(){return this.$el.html(this.template(this.model.toJSON())),this._renderGraph(this.model.get("color")),this}}),cdb.geo.ui.SwitcherItemModel=Backbone.Model.extend({}),cdb.geo.ui.SwitcherItems=Backbone.Collection.extend({model:cdb.geo.ui.SwitcherItemModel}),cdb.geo.ui.SwitcherItem=cdb.core.View.extend({tagName:"li",events:{"click a":"select"},initialize:function(){_.bindAll(this,"render"),this.template=cdb.templates.getTemplate("templates/map/switcher/item"),this.parent=this.options.parent,this.model.on("change:selected",this.render)},select:function(a){a.preventDefault(),this.parent.toggle(this);var b=this.model.get("callback");b&&b()},render:function(){return 1==this.model.get("selected")?this.$el.addClass("selected"):this.$el.removeClass("selected"),this.$el.html(this.template(this.model.toJSON())),this.$el}}),cdb.geo.ui.Switcher=cdb.core.View.extend({id:"switcher",default_options:{},initialize:function(){this.map=this.model,this.add_related_model(this.model),_.bindAll(this,"render","show","hide","toggle"),_.defaults(this.options,this.default_options),this.collection&&(this.model.collection=this.collection),this.template=this.options.template?this.options.template:cdb.templates.getTemplate("geo/switcher")},show:function(){this.$el.fadeIn(250)},hide:function(){this.$el.fadeOut(250)},toggle:function(){this.collection&&this.collection.each(function(a){a.set("selected",!a.get("selected"))})},render:function(){var a=this;return void 0!=this.model&&this.$el.html(this.template(this.model.toJSON())),this.collection&&this.collection.each(function(b){var c=new cdb.geo.ui.SwitcherItem({parent:a,className:b.get("className"),model:b});a.$el.find("ul").append(c.render())}),this}}),cdb.geo.ui.InfowindowModel=Backbone.Model.extend({SYSTEM_COLUMNS:["the_geom","the_geom_webmercator","created_at","updated_at","cartodb_id","cartodb_georef_status"],defaults:{template_name:"infowindow_light",latlng:[0,0],offset:[28,0],maxHeight:180,autoPan:!0,template:"",content:"",visibility:!1,alternative_names:{},fields:null},clearFields:function(){this.set({fields:[]})},saveFields:function(a){a=a||"old_fields",this.set(a,_.clone(this.get("fields")))},fieldCount:function(){var a=this.get("fields");return a?a.length:0},restoreFields:function(a,b){b=b||"old_fields";var c=this.get(b);a&&(c=c.filter(function(b){return _.contains(a,b.name)})),c&&c.length&&this._setFields(c),this.unset(b)},_cloneFields:function(){return _(this.get("fields")).map(function(a){return _.clone(a)})},_setFields:function(a){a.sort(function(a,b){return a.position-b.position}),this.set({fields:a})},sortFields:function(){this.get("fields").sort(function(a,b){return a.position-b.position})},_addField:function(a,b){var c=$.Deferred();if(!this.containsField(a)){var d=this.get("fields");d?(b=void 0===b?d.length:b,d.push({name:a,title:!0,position:b})):(b=void 0===b?0:b,this.set("fields",[{name:a,title:!0,position:b}],{silent:!0}))}return c.resolve(),c.promise()},addField:function(a,b){var c=this;return $.when(this._addField(a,b)).then(function(){c.sortFields(),c.trigger("change:fields"),c.trigger("add:fields")}),this},getFieldProperty:function(a,b){if(this.containsField(a)){var c=this.get("fields")||[],d=_.indexOf(_(c).pluck("name"),a);return c[d][b]}return null},setFieldProperty:function(a,b,c){if(this.containsField(a)){var d=this._cloneFields()||[],e=_.indexOf(_(d).pluck("name"),a);d[e][b]=c,this._setFields(d)}return this},getAlternativeName:function(a){return this.get("alternative_names")&&this.get("alternative_names")[a]},setAlternativeName:function(a,b){var c=this.get("alternative_names")||[];c[a]=b,this.set({alternative_names:c}),this.trigger("change:alternative_names")},getFieldPos:function(a){var b=this.getFieldProperty(a,"position");return void 0==b?Number.MAX_VALUE:b},containsAlternativeName:function(a){var b=this.get("alternative_names")||[];return b[a]},containsField:function(a){var b=this.get("fields")||[];return _.contains(_(b).pluck("name"),a)},removeField:function(a){if(this.containsField(a)){var b=this._cloneFields()||[],c=_.indexOf(_(b).pluck("name"),a);c>=0&&b.splice(c,1),this._setFields(b),this.trigger("remove:fields")}return this},updateContent:function(a){var b=this.get("fields");this.set("content",cdb.geo.ui.InfowindowModel.contentForFields(a,b))}},{contentForFields:function(a,b,c){c=c||{};for(var d=[],e=0;e0&&null!=a.data()&&a.data().jsp&&a.data().jsp.destroy();var b=_.map(this.model.attributes.content.fields,function(a){return _.clone(a)}),c=this.model.get("content")?this.model.get("content").data:{};if(this.model.get("template_name")){var d=_.clone(this.model.attributes.template_name);b=this._fieldsToString(b,d)}var e={};_.each(this.model.get("content").fields,function(a){e[a.title]=a.value});var f=_.extend({content:{fields:b,data:c}},e);this.$el.html(this.template(f)),this.model.get("width")&&this.$(".cartodb-popup").css("width",this.model.get("width")+"px"),this.$(".cartodb-popup .cartodb-popup-content").css("max-height",this.model.get("maxHeight")+"px");var g=this;setTimeout(function(){var a=g.$(".cartodb-popup-content").outerHeight();g.model.get("maxHeight")<=a&&g.$(".cartodb-popup-content").jScrollPane({maintainPosition:!1,verticalDragMinHeight:20})},1),this._checkLoading(),this._loadCover(),this.isLoadingData()||(this.model.trigger("domready",this,this.$el),this.trigger("domready",this,this.$el))}return this},_getModelTemplate:function(){return this.model.get("template_name")},_setTemplate:function(){this.model.get("template_name")&&(this.template=cdb.templates.getTemplate(this._getModelTemplate()),this.render())},_compileTemplate:function(){var a=this.model.get("template")?this.model.get("template"):cdb.templates.getTemplate(this._getModelTemplate());this.template="function"!=typeof a?new cdb.core.Template({template:a,type:this.model.get("template_type")||"mustache"}).asFunction():a,this.render()},_checkOrigin:function(a){var b=$(a.target).closest(".jspVerticalBar").length>0&&"touchstart"!=a.type;b||a.stopPropagation()},_fieldsToString:function(a,b){var c=[];if(a&&a.length>0){var d=this;c=_.map(a,function(a,c){return d._sanitizeField(a,b,a.index||c)})}return c},_sanitizeField:function(a,b,c){(null==a.value||void 0==a.value)&&(a.value="");var d=this.model.getAlternativeName(a.title);a.title&&d?a.title=d:a.title&&(a.title=a.title.replace(/_/g," "));var e=a.value.toString();return!a.type&&0==c&&a.value.length>35&&b&&-1!=b.search("_header_")&&(e=a.value.substr(0,32)+"..."),!a.type&&1==c&&a.value.length>35&&b&&-1!=b.search("_header_with_image")&&(e=a.value.substr(0,32)+"..."),this._isValidURL(a.value)&&(e=""+e+""),0==c&&-1!=b.search("_header_with_image")&&(e=a.value),a.value=e,a},isLoadingData:function(){var a=this.model.get("content");return a.fields&&1==a.fields.length&&"loading"===a.fields[0].type},_checkLoading:function(){this.isLoadingData()?this._startSpinner():this._stopSpinner()},_stopSpinner:function(){this.spinner&&this.spinner.stop()},_startSpinner:function(a){this._stopSpinner();var a=this.$el.find(".loading");if(a){var b=-1!=this.model.get("template_name").search("dark");this.spin_options.color=b?"#FFF":"rgba(0,0,0,0.5)",this.spinner=new Spinner(this.spin_options).spin(),a.append(this.spinner.el)}},_containsCover:function(){return this.$el.find(".cartodb-popup.header").attr("data-cover")?!0:!1},_getCoverURL:function(){var a=this.model.get("content");return a&&a.fields&&a.fields.length>0?(a.fields[0].value||"").toString():!1},_loadCover:function(){if(this._containsCover()){var a=this.$(".cover"),b=this.$(".shadow"),c=this._getCoverURL();if(!this._isValidURL(c))return b.hide(),void cdb.log.info("Header image url not valid");var d=document.getElementById("spinner"),e={lines:9,length:4,width:2,radius:4,corners:1,rotate:0,color:"#ccc",speed:1,trail:60,shadow:!0,hwaccel:!1,zIndex:2e9},f=new Spinner(e).spin(d),g=a.find("img");g.hide(function(){this.remove()}),g=$("").attr("src",c),a.append(g),g.load(function(){f.stop();var b=g.width(),c=g.height(),d=a.width(),e=a.height(),h=c/b,i=e/d;if(b>d&&c>e)if(i>h)g.css({height:e});else{var j=c/(b/d);g.css({width:d,top:"50%",position:"absolute","margin-top":-1*parseInt(j,10)/2})}else{var j=c/(b/d);g.css({width:d,top:"50%",position:"absolute","margin-top":-1*parseInt(j,10)/2})}g.fadeIn(300)}).error(function(){f.stop()})}},_isValidURL:function(a){if(a){var b=/^(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-|]*[\w@?^=%&\/~+#-])?$/;return null!=String(a).match(b)?!0:!1}return!1},toggle:function(){this.model.get("visibility")?this.show():this.hide()},_stopBubbling:function(a){a.preventDefault(),a.stopPropagation()},_stopPropagation:function(a){a.stopPropagation()},setLoading:function(){return this.model.set({content:{fields:[{title:null,alternative_name:null,value:"Loading content...",index:null,type:"loading"}],data:{}}}),this},setError:function(){return this.model.set({content:{fields:[{title:null,alternative_name:null,value:"There has been an error...",index:null,type:"error"}],data:{}}}),this},setLatLng:function(a){return this.model.set("latlng",a),this},_closeInfowindow:function(a){a&&(a.preventDefault(),a.stopPropagation()),this.model.get("visibility")&&(this.model.set("visibility",!1),this.trigger("close"))},showInfowindow:function(){this.model.set("visibility",!0)},show:function(a){var b=this;this.model.get("visibility")&&(b.$el.css({left:-5e3}),b._update(a))},isHidden:function(){return!this.model.get("visibility")},hide:function(a){(a||!this.model.get("visibility"))&&this._animateOut()},_update:function(a){if(!this.isHidden()){var b=0;if(!a)var b=this.adjustPan();this._updatePosition(),this._animateIn(b)}},_animateIn:function(a){!$.browser.msie||$.browser.msie&&parseInt($.browser.version)>8?(this.$el.css({marginBottom:"-10px",display:"block",opacity:0}),this.$el.delay(a).animate({opacity:1,marginBottom:0},300)):this.$el.show()},_animateOut:function(){if(!$.browser.msie||$.browser.msie&&parseInt($.browser.version)>8){var a=this;this.$el.animate({marginBottom:"-10px",opacity:"0",display:"block"},180,function(){a.$el.css({display:"none"})})}else this.$el.hide()},_updatePosition:function(){if(!this.isHidden()){var a=this.model.get("offset");pos=this.mapView.latLonToPixel(this.model.get("latlng")),x=this.$el.position().left,y=this.$el.position().top,containerHeight=this.$el.outerHeight(!0),containerWidth=this.$el.width(),left=pos.x-a[0],size=this.mapView.getSize(),bottom=-1*(pos.y-a[1]-size.y),this.$el.css({bottom:bottom,left:left})}},adjustPan:function(){var a=this.model.get("offset");if(this.model.get("autoPan")&&!this.isHidden()){var b=(this.$el.position().left,this.$el.position().top,this.$el.outerHeight(!0)+15),c=this.$el.width(),d=this.mapView.latLonToPixel(this.model.get("latlng")),e={x:0,y:0};return size=this.mapView.getSize(),wait_callback=0,d.x-a[0]<0&&(e.x=d.x-a[0]-10),d.x-a[0]+c>size.x&&(e.x=d.x+c-size.x-a[0]+10),d.y-b<0&&(e.y=d.y-b-10),d.y-b>size.y&&(e.y=d.y+b-size.y),(e.x||e.y)&&(this.mapView.panBy(e),wait_callback=300),wait_callback}}}),cdb.geo.ui.Header=cdb.core.View.extend({className:"cartodb-header",initialize:function(){var a=this.model.get("extra");this.model.set({title:a.title,description:this._setLinksTarget(a.description),show_title:a.show_title,show_description:a.show_description},{silent:!0})},show:function(){var a=this.model.get("title")&&this.model.get("show_title"),b=this.model.get("description")&&this.model.get("show_description");if(a||b){var c=this;this.$el.show(),a&&c.$title.show(),b&&c.$description.show()}},_setLinksTarget:function(a){if(!a)return a;var b=new RegExp(/<(a)([^>]+)>/g);return a.replace(b,'<$1 target="_blank"$2>')},render:function(){return this.$el.html(this.options.template(this.model.attributes)),this.$title=this.$el.find(".content div.title"),this.$description=this.$el.find(".content div.description"),this.model.get("show_title")||this.model.get("show_description")?this.show():this.hide(),this}}),cdb.geo.ui.Search=cdb.core.View.extend({className:"cartodb-searchbox",events:{"click input[type='text']":"_focus","submit form":"_submit",click:"_stopPropagation",dblclick:"_stopPropagation",mousedown:"_stopPropagation"},initialize:function(){},render:function(){return this.$el.html(this.options.template(this.options)),this},_stopPropagation:function(a){a.stopPropagation()},_focus:function(a){a.preventDefault(),$(a.target).focus()},_showLoader:function(){this.$("span.loader").show()},_hideLoader:function(){this.$("span.loader").hide()},_submit:function(a){a.preventDefault();var b=this,c=this.$("input.text").val();this._showLoader(),cdb.geo.geocoder.NOKIA.geocode(c,function(a){if(a.length>0){var c=!0;a[0].boundingbox&&a[0].boundingbox.south!=a[0].boundingbox.north&&a[0].boundingbox.east!=a[0].boundingbox.west||(c=!1),c&&a[0].boundingbox?b.model.setBounds([[parseFloat(a[0].boundingbox.south),parseFloat(a[0].boundingbox.west)],[parseFloat(a[0].boundingbox.north),parseFloat(a[0].boundingbox.east)]]):a[0].lat&&a[0].lon&&(b.model.setCenter([a[0].lat,a[0].lon]),b.model.setZoom(10))}b._hideLoader()})}}),cdb.geo.ui.LayerSelector=cdb.core.View.extend({className:"cartodb-layer-selector-box",events:{click:"_openDropdown",dblclick:"killEvent",mousedown:"killEvent"},initialize:function(){this.map=this.options.mapView.map,this.mapView=this.options.mapView,this.mapView.bind("click zoomstart drag",function(){this.dropdown&&this.dropdown.hide()},this),this.add_related_model(this.mapView),this.layers=[]},render:function(){return this.$el.html(this.options.template(this.options)),this.dropdown=new cdb.ui.common.Dropdown({className:"cartodb-dropdown border",template:this.options.dropdown_template,target:this.$el.find("a"),speedIn:300,speedOut:200,position:"position",tick:"right",vertical_position:"down",horizontal_position:"right",vertical_offset:7,horizontal_offset:13}),cdb.god&&cdb.god.bind("closeDialogs",this.dropdown.hide,this.dropdown),this.$el.append(this.dropdown.render().el),this._getLayers(),this._setCount(),this},_getLayers:function(){var a=this;this.layers=[],_.each(this.map.layers.models,function(b){if("layergroup"==b.get("type")||"namedmap"===b.get("type"))for(var c=a.mapView.getLayerByCid(b.cid),d=0;db;++b){var d=this.layers[b];d.model.get("visible")&&a++}this.$(".count").text(a),this.trigger("switchChanged",this)},_openDropdown:function(){this.dropdown.open()}}),cdb.geo.ui.LayerView=cdb.core.View.extend({tagName:"li",defaults:{template:' <%= layer_name %> switch"> '},events:{click:"_onSwitchClick"},initialize:function(){this.model.has("visible")||this.model.set("visible",!1),this.model.bind("change:visible",this._onSwitchSelected,this),this.add_related_model(this.model),this._onSwitchSelected(),this.template=this.options.template?cdb.templates.getTemplate(this.options.template):_.template(this.defaults.template)},render:function(){var a=_.clone(this.model.attributes);return a.layer_name=a.layer_name||a.table_name,this.$el.append(this.template(a)),this},_onSwitchSelected:function(){var a=this.model.get("visible");this.$el.find(".switch").removeClass(a?"disabled":"enabled").addClass(a?"enabled":"disabled"),this.trigger("switchChanged")},_onSwitchClick:function(a){this.killEvent(a),this.model.set("visible",!this.model.get("visible"))}}),cdb.geo.ui.LayerViewFromLayerGroup=cdb.geo.ui.LayerView.extend({_onSwitchSelected:function(){cdb.geo.ui.LayerView.prototype._onSwitchSelected.call(this);var a=this.options.layerView.getSubLayer(this.options.layerIndex),b=this.model.get("visible");b?a.show():a.hide()}}),cdb.geo.ui.MobileLayer=cdb.core.View.extend({events:{"click h3":"_toggle",dblclick:"_stopPropagation"},tagName:"li",className:"cartodb-mobile-layer has-toggle",template:cdb.core.Template.compile("<% if (show_title) { %>

          <%= layer_name %><% } %>

          "),_stopPropagation:function(a){a.stopPropagation()},initialize:function(){_.defaults(this.options,this.default_options),this.model.bind("change:visible",this._onChangeVisible,this)},_onChangeVisible:function(){this.$el.find(".legend")[this.model.get("visible")?"fadeIn":"fadeOut"](150),this.$el[this.model.get("visible")?"removeClass":"addClass"]("hidden"),this.trigger("change_visibility",this)},_toggle:function(a){a.preventDefault(),a.stopPropagation(),this.options.hide_toggle||this.model.set("visible",!this.model.get("visible"))},_renderLegend:function(){if(this.options.show_legends&&!(this.model.get("legend")&&("none"==this.model.get("legend").type||!this.model.get("legend").type)||this.model.get("legend")&&this.model.get("legend").items&&0==this.model.get("legend").items.length)){this.$el.addClass("has-legend");var a=new cdb.geo.ui.Legend(this.model.get("legend"));a.undelegateEvents(),this.$el.append(a.render().$el)}},_truncate:function(a,b){return a.substr(0,b-1)+(a.length>b?"…":"")},render:function(){var a=this.model.get("layer_name");a=a?this._truncate(a,23):"untitled"; -var b=_.extend(this.model.attributes,{layer_name:this.options.show_title?a:"",toggle_class:this.options.hide_toggle?" hide":""});return this.$el.html(this.template(_.extend(b,{show_title:this.options.show_title}))),this.options.hide_toggle&&this.$el.removeClass("has-toggle"),this.model.get("visible")||this.$el.addClass("hidden"),this.model.get("legend")&&this._renderLegend(),this._onChangeVisible(),this}}),cdb.geo.ui.Mobile=cdb.core.View.extend({className:"cartodb-mobile",events:{"click .cartodb-attribution-button":"_onAttributionClick","click .toggle":"_toggle","click .fullscreen":"_toggleFullScreen","click .backdrop":"_onBackdropClick","dblclick .aside":"_stopPropagation","dragstart .aside":"_checkOrigin","mousedown .aside":"_checkOrigin","touchstart .aside":"_checkOrigin","MSPointerDown .aside":"_checkOrigin"},initialize:function(){_.bindAll(this,"_toggle","_reInitScrollpane"),_.defaults(this.options,this.default_options),this.hasLayerSelector=!1,this.mobileEnabled=/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.visibility_options=this.options.visibility_options||{},this.mapView=this.options.mapView,this.map=this.mapView.map,this.template=this.options.template?this.options.template:cdb.templates.getTemplate("geo/zoom"),this.overlays=this.options.overlays,this._setupModel(),window.addEventListener("orientationchange",_.bind(this.doOnOrientationChange,this)),this._addWheelEvent()},_addWheelEvent:function(){var a=this.options.mapView;$(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange",function(){document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||a.options.map.set("scrollwheel",!1),a.invalidateSize()})},_setupModel:function(){this.model=new Backbone.Model({open:!1,layer_count:0}),this.model.on("change:open",this._onChangeOpen,this),this.model.on("change:layer_count",this._onChangeLayerCount,this)},_checkOrigin:function(a){var b=$(a.target).closest(".jspVerticalBar").length>0&&"touchstart"!=a.type;b||a.stopPropagation()},_stopPropagation:function(a){a.stopPropagation()},_onBackdropClick:function(a){a.preventDefault(),a.stopPropagation(),this.$el.find(".backdrop").fadeOut(250),this.$el.find(".cartodb-attribution").fadeOut(250)},_onAttributionClick:function(a){a.preventDefault(),a.stopPropagation(),this.$el.find(".backdrop").fadeIn(250),this.$el.find(".cartodb-attribution").fadeIn(250)},_toggle:function(a){a.preventDefault(),a.stopPropagation(),this.model.set("open",!this.model.get("open"))},_toggleFullScreen:function(a){a.stopPropagation(),a.preventDefault();var b=window.document,c=$("#map > div")[0],d=c.requestFullscreen||c.mozRequestFullScreen||c.webkitRequestFullScreen,e=b.exitFullscreen||b.mozCancelFullScreen||b.webkitExitFullscreen,f=this.options.mapView;b.fullscreenElement||b.mozFullScreenElement||b.webkitFullscreenElement?e.call(b):(d.call(c),f&&f.options.map.set("scrollwheel",!0))},_open:function(){var a=this.$el.find(".aside").width();this.$el.find(".cartodb-header").animate({right:a},200),this.$el.find(".aside").animate({right:0},200),this.$el.find(".cartodb-attribution-button").animate({right:a+parseInt(this.$el.find(".cartodb-attribution-button").css("right"))},200),this.$el.find(".cartodb-attribution").animate({right:a+parseInt(this.$el.find(".cartodb-attribution-button").css("right"))},200),this._initScrollPane()},_close:function(){this.$el.find(".cartodb-header").animate({right:0},200),this.$el.find(".aside").animate({right:-this.$el.find(".aside").width()},200),this.$el.find(".cartodb-attribution-button").animate({right:20},200),this.$el.find(".cartodb-attribution").animate({right:20},200)},default_options:{timeout:0,msg:""},_stopPropagation:function(a){a.stopPropagation()},doOnOrientationChange:function(){switch(window.orientation){case-90:case 90:this.recalc("landscape");break;default:this.recalc("portrait")}},recalc:function(){var a=$(".legends > div.cartodb-legend-stack").height();this.$el.hasClass("open")&&100>a&&!this.$el.hasClass("torque")?(this.$el.css("height",a),this.$el.find(".top-shadow").hide(),this.$el.find(".bottom-shadow").hide()):this.$el.hasClass("open")&&100>a&&this.$el.hasClass("legends")&&this.$el.hasClass("torque")&&(this.$el.css("height",a+$(".legends > div.torque").height()),this.$el.find(".top-shadow").hide(),this.$el.find(".bottom-shadow").hide())},_onChangeLayerCount:function(){var a=this.model.get("layer_count"),b=a+" layer"+(1!=a?"s":"");this.$el.find(".aside .layer-container > h3").html(b)},_onChangeOpen:function(){this.model.get("open")?this._open():this._close()},_createLayer:function(a,b){return new cdb.geo.ui[a](b)},_getLayers:function(){this.layers=[],this.options.layerView?this._getLayersFromLayerView():_.each(this.map.layers.models,this._getLayer,this)},_getLayersFromLayerView:function(){if(this.options.layerView&&"layergroup"==this.options.layerView.model.get("type"))this.layers=_.map(this.options.layerView.layers,function(b,c){var d=new cdb.core.Model(b);return d.set("order",c),d.set("type","layergroup"),d.set("visible",b.visible),d.set("layer_name",b.options.layer_name),a=this._createLayer("LayerViewFromLayerGroup",{model:d,layerView:this.options.layerView,layerIndex:c}),a.model},this);else if(this.options.layerView&&"torque"==this.options.layerView.model.get("type")){var a=this._createLayer("LayerView",{model:this.options.layerView.model});this.layers.push(a.model)}},_getLayer:function(a){if("layergroup"==a.get("type")||"namedmap"===a.get("type"))for(var b=this.mapView.getLayerByCid(a.cid),c=0;c+ -
          ',"mustache"),b=new cdb.geo.ui.Zoom({model:this.options.map,template:a});this.$el.append(b.render().$el),this.$el.addClass("with-zoom")},_addFullscreen:function(){0!=this.visibility_options.fullscreen&&(this.hasFullscreen=!0,this.$el.addClass("with-fullscreen"))},_addSearch:function(){this.hasSearch=!0;var a=cdb.core.Template.compile('
          ',"mustache"),b=new cdb.geo.ui.Search({template:a,model:this.mapView.map});this.$el.find(".aside").prepend(b.render().$el),this.$el.find(".cartodb-searchbox").show(),this.$el.addClass("with-search")},_addHeader:function(a){this.hasHeader=!0,this.$header=this.$el.find(".cartodb-header");var b=_.template('
          <% if (show_title) { %>
          <%= title %>
          <% } %><% if (show_description) { %>
          <%= description %><% } %>
          '),c=a.options.extra,d=!1,e=!1,f=!1;if(c){(this.visibility_options.title||0!=this.visibility_options.title&&c.show_title)&&(d=!0,e=!0),(this.visibility_options.description||0!=this.visibility_options.description&&c.show_description)&&(d=!0,f=!0);var g=b({title:c.title,show_title:e,description:c.description,show_description:f});d&&(this.$el.addClass("with-header"),this.$header.find(".content").append(g))}},_addAttributions:function(){var a="";this.options.mapView.$el.find(".leaflet-control-attribution").hide(),this.options.layerView?(a=this.options.layerView.model.get("attribution"),this.$el.find(".cartodb-attribution").append(a)):this.options.map.get("attribution")&&(a=this.options.map.get("attribution"),_.each(a,function(a){{var b=$("
        • ");b.html(a)}this.$el.find(".cartodb-attribution").append(b)},this)),a&&this.$el.find(".cartodb-attribution-button").fadeIn(250)},_renderLayers:function(){var a=this.visibility_options.legends,b=this.layers.filter(function(a){return a.get("legend")&&"none"!==a.get("legend").type}),c=b.length?!0:!1;(this.hasLayerSelector||a)&&(this.hasLayerSelector||c)&&0!=this.layers.length&&(1!=this.layers.length||c)&&(this.$el.addClass("with-layers"),this.model.set("layer_count",0),this.hasSearch||this.$el.find(".aside .layer-container").prepend("

          "),_.each(this.layers,this._renderLayer,this))},_renderLayer:function(a){var b=a.get("legend")&&""!==a.get("legend").type&&"none"!==a.get("legend").type;if((this.hasLayerSelector||b)&&(this.hasLayerSelector||a.get("visible"))){var c=1==this.layers.length||!this.hasLayerSelector,d=!0;this.visibility_options&&void 0!==this.visibility_options.legends&&(d=this.visibility_options.legends);var e=new cdb.geo.ui.MobileLayer({model:a,show_legends:d,show_title:this.hasLayerSelector?!0:!1,hide_toggle:c});this.$el.find(".aside .layers").append(e.render().$el),e.bind("change_visibility",this._reInitScrollpane,this),this.model.set("layer_count",this.model.get("layer_count")+1)}},_renderTorque:function(){this.options.torqueLayer&&(this.hasTorque=!0,this.slider=new cdb.geo.ui.TimeSlider({type:"time_slider",layer:this.options.torqueLayer,map:this.options.map,pos_margin:0,position:"none",width:"auto"}),this.slider.bind("time_clicked",function(){this.slider.toggleTime()},this),this.$el.find(".torque").append(this.slider.render().$el),this.options.torqueLayer.hidden?this.slider.hide():this.$el.addClass("with-torque"))},render:function(){return this._bindOrientationChange(),this.$el.html(this.template(this.options)),this._renderOverlays(),this._addAttributions(),this.$header=this.$el.find(".cartodb-header"),this.$header.show(),this._getLayers(),this._renderLayers(),this._renderTorque(),this}}),cdb.geo.ui.TilesLoader=cdb.core.View.extend({className:"cartodb-tiles-loader",default_options:{animationSpeed:500},initialize:function(){_.defaults(this.options,this.default_options),this.isVisible=0,this.template=this.options.template?this.options.template:cdb.templates.getTemplate("geo/tiles_loader")},render:function(){return this.$el.html($(this.template(this.options))),this},show:function(){this.isVisible||(!$.browser.msie||$.browser.msie&&0!=$.browser.version.indexOf("9.")?this.$el.fadeTo(this.options.animationSpeed,1):this.$el.show(),this.isVisible++)},hide:function(){this.isVisible--,this.isVisible>0||(this.isVisible=0,!$.browser.msie||$.browser.msie&&0==$.browser.version.indexOf("9.")?this.$el.stop(!0).fadeTo(this.options.animationSpeed,0):this.$el.hide())},visible:function(){return this.isVisible>0}}),cdb.geo.ui.InfoBox=cdb.core.View.extend({className:"cartodb-infobox",defaults:{pos_margin:20,position:"bottom|right",width:200},initialize:function(){_.defaults(this.options,this.defaults),this.options.layer&&this.enable(),this.setTemplate(this.options.template||this.defaultTemplate,"mustache")},setTemplate:function(a){this.template=cdb.core.Template.compile(a,"mustache")},enable:function(){this.options.layer&&this.options.layer.on("featureOver",function(a,b,c,d){this.render(d).show()},this).on("featureOut",function(){this.hide()},this)},disable:function(){this.options.layer&&this.options.layer.off(null,null,this)},setPosition:function(a){var b={};-1!==a.indexOf("top")?b.top=this.options.pos_margin:-1!==a.indexOf("bottom")&&(b.bottom=this.options.pos_margin),-1!==a.indexOf("left")?b.left=this.options.pos_margin:-1!==a.indexOf("right")&&(b.right=this.options.pos_margin),this.$el.css(b)},render:function(a){return this.$el.html(this.template(a)),this.options.width&&this.$el.css("width",this.options.width),this.options.position&&this.setPosition(this.options.position),this}}),cdb.geo.ui.Tooltip=cdb.geo.ui.InfoBox.extend({defaultTemplate:"

          {{text}}

          ",className:"cartodb-tooltip",defaults:{vertical_offset:0,horizontal_offset:0,position:"top|center"},initialize:function(){this.options.template=this.options.template||this.defaultTemplate,cdb.geo.ui.InfoBox.prototype.initialize.call(this),this._filter=null,this.showing=!1,this.showhideTimeout=null},setLayer:function(a){return this.options.layer=a,this},setFilter:function(a){return this._filter=a,this},setFields:function(a){return this.options.fields=a,this},setAlternativeNames:function(a){this.options.alternative_names=a},enable:function(){this.options.layer&&(this.options.layer.unbind(null,null,this),this.options.layer.on("mouseover",function(a,b,c,d){if(this.options.fields){var e=["fields","content"];this.options.omit_columns&&(e=e.concat(this.options.omit_columns));var f=cdb.geo.ui.InfowindowModel.contentForFields(d,this.options.fields,{empty_fields:this.options.empty_fields});d.content=_.omit(d,e),d.fields=f.fields;var g=this.options.alternative_names;if(g)for(var h=0;h=b.length?-1:+b[a]},visibleLayers:function(){for(var a=[],b=0;b>18&63,f=i>>12&63,g=i>>6&63,h=63&i,n[l++]=j.charAt(e)+j.charAt(f)+j.charAt(g)+j.charAt(h);while(ke;e++)b.push("auth_token[]="+c.auth_token[e]);else b.push("auth_token="+c.auth_token);this.stat_tag&&b.push("stat_tag="+this.stat_tag),this._waiting=!0;var g=null;return g=this._usePOST()?this._requestPOST:this._requestGET,g.call(this,b,a),this},_usePOST:function(){if(this.options.cors){if(this.options.force_cors)return!0;var a=JSON.stringify(this.toJSON());if(a.length>this.options.MAX_GET_SIZE)return!0}return!1},getLayer:function(a){return _.clone(this.layers[a])},invalidate:function(){this.layerToken=null,this.urls=null,this.onLayerDefinitionUpdated()},setLayer:function(a,b){if(a=0){if(b.options.hidden){var c=this.interactionEnabled[a];c&&(b.interaction=!0,this.setInteraction(a,!1))}else this.layers[a].interaction&&(this.setInteraction(a,!0),delete this.layers[a].interaction);this.layers[a]=_.clone(b)}return this.invalidate(),this},getTiles:function(a){var b=this;return b.layerToken?(a&&a(b._layerGroupTiles(b.layerToken,b.options.extra_params)),this):(this.getLayerToken(function(c,d){if(c){if(b.layerToken=c.layergroupid,c.cdn_url){var e=b.options.cdn_url=b.options.cdn_url||{};e.http=c.cdn_url.http||e.http,e.https=c.cdn_url.https||e.https}b.urls=b._layerGroupTiles(c.layergroupid,b.options.extra_params),a&&a(b.urls)}else{if(0===b.visibleLayers().length)return void(a&&a({tiles:[Map.EMPTY_GIF],grids:[]}));a&&a(null,d)}}),this)},isHttps:function(){return"https"===this.options.tiler_protocol},_layerGroupTiles:function(a,b){var c=this.options.subdomains||["0","1","2","3"];this.isHttps()&&(c=[null]);for(var d="/{z}/{x}/{y}",e=[],f=[],g=this._encodeParams(b,this.options.pngParams),h=0;hg;g++)c.push(e+"[]="+encodeURIComponent(f[g]));else{var i=encodeURIComponent(f);i=i.replace(/%7Bx%7D/g,"{x}").replace(/%7By%7D/g,"{y}").replace(/%7Bz%7D/g,"{z}"),c.push(e+"="+i)}}return c.join("&")},_tilerHost:function(){var a=this.options;return a.tiler_protocol+"://"+(a.user_name?a.user_name+".":"")+a.tiler_domain+(""!=a.tiler_port?":"+a.tiler_port:"")},_host:function(a){var b=this.options;if(b.no_cdn)return this._tilerHost();var c=b.tiler_protocol+"://";a&&(c+=a+".");var d=b.cdn_url||cdb.CDB_HOST;if(!d.http&&!d.https)throw new Error("cdn_host should contain http and/or https entries");return c+=d[b.tiler_protocol]+"/"+b.user_name},getTooltipData:function(a){return this.layers[a].tooltip},getInfowindowData:function(a){var b,c=this.layers[a].infowindow;return!c&&this.options.layer_definition&&(b=this.options.layer_definition.layers[a])&&(c=b.infowindow),c&&c.fields&&c.fields.length>0?c:null},containInfowindow:function(){for(var a=this.options.layer_definition.layers,b=0;b0)return!0}return!1},containTooltip:function(){for(var a=this.options.layer_definition.layers,b=0;b0)return!0}return!1},containTooltip:function(){for(var a=this.layers||[],b=0;bh;h++)g.push("auth_token[]="+f[h]);d+="?"+g.join("&")}else d+="?auth_token="+f;return d},fetchAttributes:function(a,b,c,d){this._attrCallbackName=this._attrCallbackName||this._callbackName();var e=this.options.ajax,f=cartodb.core.Profiler.metric("cartodb-js.named_map.attributes.time").start();e({dataType:"jsonp",url:this._attributesUrl(a,b),jsonpCallback:"_cdbi_layer_attributes_"+this._attrCallbackName,cache:!0,success:function(a){f.end(),d(a)},error:function(){f.end(),cartodb.core.Profiler.metric("cartodb-js.named_map.attributes.error").inc(),d(null)}})},setSQL:function(){throw new Error("SQL is read-only in NamedMaps")},setCartoCSS:function(){throw new Error("cartocss is read-only in NamedMaps")},getCartoCSS:function(){throw new Error("cartocss can't be accessed in NamedMaps")},getSQL:function(){throw new Error("SQL can't be accessed in NamedMaps")},setLayer:function(a,b){var c={sql:1,cartocss:1,interactivity:1};for(var d in b.options)if(d in c)throw delete b.options[d],new Error(d+" is read-only in NamedMaps");return Map.prototype.setLayer.call(this,a,b)},removeLayer:function(){throw new Error("sublayers are read-only in Named Maps")},createSubLayer:function(){throw new Error("sublayers are read-only in Named Maps")},addLayer:function(){throw new Error("sublayers are read-only in Named Maps")},getLayerIndexByNumber:function(a){return+a}}),LayerDefinition.prototype=_.extend({},Map.prototype,{setLayerDefinition:function(a,b){b=b||{},this.version=a.version||"1.0.0",this.stat_tag=a.stat_tag,this.layers=_.clone(a.layers),b.silent||this._definitionUpdated()},toJSON:function(){var a={};a.version=this.version,this.stat_tag&&(a.stat_tag=this.stat_tag),a.layers=[];for(var b=this.visibleLayers(),c=0;c=0&&(this.layers.splice(a,1),this.interactionEnabled.splice(a,1),this._reorderSubLayers(),this.invalidate()),this},_reorderSubLayers:function(){for(var a=0;a=0){if(!a.sql||!a.cartocss)throw new Error("layer definition should contain at least a sql and a cartocss");this.layers.splice(b,0,{type:"cartodb",options:a}),this._definitionUpdated()}return this},setInteractivity:function(a,b){if(void 0===b&&(b=a,a=0),a>=this.getLayerCount()&&0>a)throw new Error("layer does not exist");"string"==typeof b&&(b=b.split(","));for(var c=0;cc;++c){a=c;for(var d=0;8>d;++d)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b},cartodb.crc32=function(a){for(var b=cartodb._crcTable||(cartodb._crcTable=cartodb._makeCRCTable()),c=-1,d=0,e=a.length;e>d;++d)c=c>>>8^b[255&(c^a.charCodeAt(d))];return(-1^c)>>>0},cartodb.uniqueCallbackName=function(a){return cartodb._callback_c=cartodb._callback_c||0,++cartodb._callback_c,cartodb.crc32(a)+"_"+cartodb._callback_c},CartoDBLayerCommon.prototype={show:function(){this.setOpacity(void 0===this.options.previous_opacity?.99:this.options.previous_opacity),delete this.options.previous_opacity,this._interactionDisabled=!1,this.visible=!0},hide:function(){void 0==this.options.previous_opacity&&(this.options.previous_opacity=this.options.opacity),this.setOpacity(0),this._interactionDisabled=!0,this.visible=!1},toggle:function(){return this.isVisible()?this.hide():this.show(),this.isVisible()},isVisible:function(){return this.visible},setInteraction:function(a,b){void 0==b&&(b=a,a=0);var c;if(this.interactionEnabled[a]=b,b){if(this.urls){var d=this.getLayerIndexByNumber(+a),e=this._tileJSONfromTiles(d,this.urls);c=this.interaction[a],c&&c.remove();var f=this;this.interaction[a]=this.interactionClass().map(this.options.map).tilejson(e).on("on",function(b){f._interactionDisabled||(b.layer=+a,f._manageOnEvents(f.options.map,b))}).on("off",function(b){f._interactionDisabled||(b=b||{},b.layer=+a,f._manageOffEvents(f.options.map,b))})}}else c=this.interaction[a],c&&(c.remove(),this.interaction[a]=null);return this},setOptions:function(a){if("object"!=typeof a||a.length)throw new Error(a+" options must be an object");_.extend(this.options,a);var a=this.options;this.options.query=this.options.query||"select * from "+this.options.table_name,this.options.query_wrapper&&(this.options.query=_.template(this.options.query_wrapper)({sql:this.options.query})),this.setSilent(!0),a.interaction&&this.setInteraction(a.interaction),a.opacity&&this.setOpacity(a.opacity),a.query&&this.setQuery(a.query.replace(/\{\{table_name\}\}/g,this.options.table_name)),a.tile_style&&this.setCartoCSS(a.tile_style.replace(new RegExp(a.table_name,"g"),"layer0")),a.cartocss&&this.setCartoCSS(a.cartocss),a.interactivity&&this.setInteractivity(a.interactivity),a.visible?this.show():this.hide(),this.setSilent(!1),this._definitionUpdated()},_getLayerDefinition:function(){var a,b,c,d={},e=this.options;a=e.query||"select * from "+e.table_name,e.query_wrapper&&(a=_.template(e.query_wrapper)({sql:a})),b=e.tile_style,c=e.cartocss_version||"2.1.0";for(var f in e.extra_params){var g=e.extra_params[f];d[f]=g.replace?g.replace(/\{\{table_name\}\}/g,e.table_name):g}return a=a.replace(/\{\{table_name\}\}/g,e.table_name),b=b.replace(/\{\{table_name\}\}/g,e.table_name),b=b.replace(new RegExp(e.table_name,"g"),"layer0"),{sql:a,cartocss:b,cartocss_version:c,params:d,interactivity:e.interactivity}},error:function(){},tilesOk:function(){},_clearInteraction:function(){for(var a in this.interactionEnabled)this.interactionEnabled.hasOwnProperty(a)&&this.interactionEnabled[a]&&this.setInteraction(a,!1)},_reloadInteraction:function(){for(var a in this.interactionEnabled)this.interactionEnabled.hasOwnProperty(a)&&this.interactionEnabled[a]&&(this.setInteraction(a,!1),this.setInteraction(a,!0))},_checkTiles:function(){{var a={z:4,x:6,y:6},b=this;new Image,this._tileJSON()}getTiles(function(d){var e=d.tiles[0].replace(/\{z\}/g,a.z).replace(/\{x\}/g,a.x).replace(/\{y\}/g,a.y);this.options.ajax({method:"get",url:e,crossDomain:!0,success:function(){b.tilesOk(),clearTimeout(c)},error:function(a){clearTimeout(c),b.error(a.responseText&&JSON.parse(a.responseText))}})});var c=setTimeout(function(){clearTimeout(c),b.error("tile timeout")},3e4)}},cdb.geo.common={},cdb.geo.common.CartoDBLogo={isWadusAdded:function(a,b){for(var c=[],d=new RegExp("\\b"+b+"\\b"),e=a.getElementsByTagName("*"),f=0,g=e.length;g>f;f++)d.test(e[f].className)&&c.push(e[f]);return c.length>0},isRetinaBrowser:function(){return"devicePixelRatio"in window&&window.devicePixelRatio>1||"matchMedia"in window&&window.matchMedia("(min-resolution:144dpi)")&&window.matchMedia("(min-resolution:144dpi)").matches},addWadus:function(a,b,c){var d=this;setTimeout(function(){if(!d.isWadusAdded(c,"cartodb-logo")){var b=document.createElement("div"),e=d.isRetinaBrowser();b.setAttribute("class","cartodb-logo"),b.setAttribute("style","position:absolute; bottom:0; left:0; display:block; border:none; z-index:1000000;");var f=-1===location.protocol.indexOf("https")?"http":"https",g=cdb.config.get("cartodb_logo_link");b.innerHTML="CartoDB",c.appendChild(b)}},b||0)}},function(){var a=function(a,b,c){this.leafletLayer=b,this.leafletMap=c,this.model=a,this.model.bind("change",this._modelUpdated,this),this.type=a.get("type")||a.get("kind"),this.type=this.type.toLowerCase()};_.extend(a.prototype,Backbone.Events),_.extend(a.prototype,{remove:function(){this.leafletMap.removeLayer(this.leafletLayer),this.model.unbind(null,null,this),this.unbind()},reload:function(){this.leafletLayer.redraw()}}),cdb.geo.LeafLetLayerView=a}(),function(){if("undefined"!=typeof L){var a=L.Class.extend({includes:L.Mixin.Events,initialize:function(a,b){cdb.geo.LeafLetLayerView.call(this,a,this,b)},onAdd:function(){this.redraw()},onRemove:function(){var a=this.leafletMap.getContainer();a.style.background="none"},_modelUpdated:function(){this.redraw()},redraw:function(){var a=this.leafletMap.getContainer();if(a.style.backgroundColor=this.model.get("color")||"#FFF",this.model.get("image")){var b="transparent url("+this.model.get("image")+") repeat center center";a.style.background=b}}});_.extend(a.prototype,cdb.geo.LeafLetLayerView.prototype),cdb.geo.LeafLetPlainLayerView=a}}(),function(){if("undefined"!=typeof L){var a=L.TileLayer.extend({initialize:function(a,b){L.TileLayer.prototype.initialize.call(this,a.get("urlTemplate"),{tms:a.get("tms"),attribution:a.get("attribution"),minZoom:a.get("minZoom"),maxZoom:a.get("maxZoom"),subdomains:a.get("subdomains")||"abc",errorTileUrl:a.get("errorTileUrl"),opacity:a.get("opacity")}),cdb.geo.LeafLetLayerView.call(this,a,this,b)}});_.extend(a.prototype,cdb.geo.LeafLetLayerView.prototype,{_modelUpdated:function(){_.defaults(this.leafletLayer.options,_.clone(this.model.attributes)),this.leafletLayer.options.subdomains=this.model.get("subdomains")||"abc",this.leafletLayer.options.attribution=this.model.get("attribution"),this.leafletLayer.options.maxZoom=this.model.get("maxZoom"),this.leafletLayer.options.minZoom=this.model.get("minZoom"),this.leafletLayer.setUrl(this.model.get("urlTemplate"))}}),cdb.geo.LeafLetTiledLayerView=a}}(),function(){if("undefined"!=typeof L){var a=function(a){return{url:"http://{s}.basemaps.cartocdn.com/"+a+"_all/{z}/{x}/{y}.png",subdomains:"abcd",minZoom:0,maxZoom:18,attribution:'Map designs by Stamen. Data by OpenStreetMap, Provided by CartoDB'}},b=function(a){return{url:"https://{s}.maps.nlp.nokia.com/maptile/2.1/maptile/newest/"+a+".day/{z}/{x}/{y}/256/png8?lg=eng&token=A7tBPacePg9Mj_zghvKt9Q&app_id=KuYppsdXZznpffJsKT24",subdomains:"1234",minZoom:0,maxZoom:21,attribution:'©2012 Nokia Terms of use'}},c={roadmap:b("normal"),gray_roadmap:a("light"),dark_roadmap:a("dark"),hybrid:b("hybrid"),terrain:b("terrain"),satellite:b("satellite")},d=L.TileLayer.extend({initialize:function(a,b){var d=c[a.get("base_type")];L.TileLayer.prototype.initialize.call(this,d.url,{tms:!1,attribution:d.attribution,minZoom:d.minZoom,maxZoom:d.maxZoom,subdomains:d.subdomains,errorTileUrl:"",opacity:1}),cdb.geo.LeafLetLayerView.call(this,a,this,b)}});_.extend(d.prototype,cdb.geo.LeafLetLayerView.prototype,{_modelUpdated:function(){throw new Error("A GMaps baselayer should never be updated")}}),cdb.geo.LeafLetGmapsTiledLayerView=d}}(),function(){if("undefined"!=typeof L){var a=L.TileLayer.WMS.extend({initialize:function(a,b){L.TileLayer.WMS.prototype.initialize.call(this,a.get("urlTemplate"),{attribution:a.get("attribution"),layers:a.get("layers"),format:a.get("format"),transparent:a.get("transparent"),minZoom:a.get("minZomm"),maxZoom:a.get("maxZoom"),subdomains:a.get("subdomains")||"abc",errorTileUrl:a.get("errorTileUrl"),opacity:a.get("opacity")}),cdb.geo.LeafLetLayerView.call(this,a,this,b)}});_.extend(a.prototype,cdb.geo.LeafLetLayerView.prototype,{_modelUpdated:function(){_.defaults(this.leafletLayer.options,_.clone(this.model.attributes)),this.leafletLayer.setUrl(this.model.get("urlTemplate"))}}),cdb.geo.LeafLetWMSLayerView=a}}(),function(){function a(a){var b=a.extend({includes:[cdb.geo.LeafLetLayerView.prototype,Backbone.Events],initialize:function(b,c){var d=this,e=[];b.attributes.attribution=cdb.config.get("cartodb_attributions");var f=_.clone(b.attributes);f.map=c;var g,h=f.featureOver,i=f.featureOut,j=f.featureClick,k=-1;f.featureOver=function(a,b,c,f,i){e[i]||d.trigger("layerenter",a,b,c,f,i),e[i]=1,h&&h.apply(this,arguments),d.featureOver&&d.featureOver.apply(d,arguments),a.timeStamp===g&&clearTimeout(k),k=setTimeout(function(){d.trigger("mouseover",a,b,c,f,i),d.trigger("layermouseover",a,b,c,f,i)},0),g=a.timeStamp},f.featureOut=function(a,b){e[b]&&d.trigger("layermouseout",b),e[b]=0,_.any(e)||d.trigger("mouseout"),i&&i.apply(this,arguments),d.featureOut&&d.featureOut.apply(d,arguments)},f.featureClick=_.debounce(function(){j&&j.apply(d,arguments),d.featureClick&&d.featureClick.apply(d,arguments)},10),a.prototype.initialize.call(this,f),cdb.geo.LeafLetLayerView.call(this,b,this,c)},featureOver:function(a,b,c,d,e){this.trigger("featureOver",a,[b.lat,b.lng],c,d,e)},featureOut:function(a,b){this.trigger("featureOut",a,b)},featureClick:function(a,b,c,d,e){this.trigger("featureClick",a,[b.lat,b.lng],c,d,e)},error:function(a){this.trigger("error",a?a.errors:"unknown error"),this.model.trigger("error",a?a.errors:"unknown error")},ok:function(){this.model.trigger("tileOk")},onLayerDefinitionUpdated:function(){this.__update()}});return b}"undefined"!=typeof L&&(L.CartoDBGroupLayerBase=L.TileLayer.extend({interactionClass:wax.leaf.interaction,includes:[cdb.geo.LeafLetLayerView.prototype,CartoDBLayerCommon.prototype],options:{opacity:.99,attribution:"CartoDB",debug:!1,visible:!0,added:!1,tiler_domain:"cartodb.com",tiler_port:"80",tiler_protocol:"http",sql_api_domain:"cartodb.com",sql_api_port:"80",sql_api_protocol:"http",maxZoom:30,extra_params:{},cdn_url:null,subdomains:null},initialize:function(a){if(a=a||{},L.Util.setOptions(this,a),!a.layer_definition&&!a.sublayers)throw new Error("cartodb-leaflet needs at least the layer_definition or sublayer list");a.layer_definition||(this.options.layer_definition=LayerDefinition.layerDefFromSubLayers(a.sublayers)),LayerDefinition.call(this,this.options.layer_definition,this.options),this.fire=this.trigger,CartoDBLayerCommon.call(this),L.TileLayer.prototype.initialize.call(this),this.interaction=[],this.addProfiling()},addProfiling:function(){this.bind("tileloadstart",function(a){var b=this.tileStats||(this.tileStats={});b[a.tile.src]=cartodb.core.Profiler.metric("cartodb-js.tile.png.load.time").start()});var a=function(a){var b=this.tileStats&&this.tileStats[a.tile.src];b&&b.end()};this.bind("tileload",a),this.bind("tileerror",function(b){cartodb.core.Profiler.metric("cartodb-js.tile.png.error").inc(),a(b)})},getTileUrl:function(a){var b="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";this._adjustTilePoint(a);var c=[b];this.tilejson&&(c=this.tilejson.tiles);var d=(a.x+a.y)%c.length;return L.Util.template(c[d],L.Util.extend({z:this._getZoomForUrl(),x:a.x,y:a.y},this.options))},setOpacity:function(a){if(isNaN(a)||a>1||0>a)throw new Error(a+" is not a valid value");this.options.opacity=Math.min(a,.99),this.options.visible&&(L.TileLayer.prototype.setOpacity.call(this,this.options.opacity),this.fire("updated"))},onAdd:function(a){var b=this;this.options.map=a,0!=this.options.cartodb_logo&&cdb.geo.common.CartoDBLogo.addWadus({left:8,bottom:8},0,a._container),this.__update(function(){var c=L.stamp(b);a._layers[c]&&(L.TileLayer.prototype.onAdd.call(b,a),b.fire("added"),b.options.added=!0)})},onRemove:function(a){this.options.added&&(this.options.added=!1,L.TileLayer.prototype.onRemove.call(this,a))},__update:function(a){var b=this;this.fire("updated"),this.fire("loading");this.options.map;this.getTiles(function(c,d){c?(b.tilejson=c,b.setUrl(b.tilejson.tiles[0]),b._reloadInteraction(),b.ok&&b.ok(),a&&a()):(b.error&&b.error(d),a&&a())})},_checkLayer:function(){if(!this.options.added)throw new Error("the layer is not still added to the map")},setAttribution:function(a){this._checkLayer(),this.map.attributionControl.removeAttribution(this.options.attribution),this.options.attribution=a,this.map.attributionControl.addAttribution(this.options.attribution),this.options.attribution=this.options.attribution,this.tilejson.attribution=this.options.attribution,this.fire("updated")},_manageOnEvents:function(a,b){var c=this._findPos(a,b);if(!c||isNaN(c.x)||isNaN(c.y))return!1;var d=a.layerPointToLatLng(c),e=b.e.type.toLowerCase(),f=a.layerPointToContainerPoint(c);switch(e){case"mousemove":if(this.options.featureOver)return this.options.featureOver(b.e,d,f,b.data,b.layer);break;case"click":case"touchend":case"mspointerup":case"pointerup":case"pointermove":this.options.featureClick&&this.options.featureClick(b.e,d,f,b.data,b.layer)}},_manageOffEvents:function(a,b){return this.options.featureOut?this.options.featureOut&&this.options.featureOut(b.e,b.layer):void 0},_findPos:function(a,b){var c,d,e=0,f=0,g=a.getContainer();if(b.e.changedTouches&&b.e.changedTouches.length>0?(c=b.e.changedTouches[0].clientX+window.scrollX,d=b.e.changedTouches[0].clientY+window.scrollY):(c=b.e.clientX,d=b.e.clientY),g.offsetParent){do e+=g.offsetLeft,f+=g.offsetTop;while(g=g.offsetParent);return a.containerPointToLayerPoint(new L.Point(c-e,d-f))}var h=g.getBoundingClientRect(),i=new L.Point(b.e.clientX-h.left-g.clientLeft-window.scrollX,b.e.clientY-h.top-g.clientTop-window.scrollY);return a.containerPointToLayerPoint(i)}}),L.CartoDBGroupLayer=L.CartoDBGroupLayerBase.extend({includes:[LayerDefinition.prototype]}),L.NamedMap=L.CartoDBGroupLayerBase.extend({includes:[cdb.geo.LeafLetLayerView.prototype,NamedMap.prototype,CartoDBLayerCommon.prototype],initialize:function(a){if(a=a||{},L.Util.setOptions(this,a),!a.named_map&&!a.sublayers)throw new Error("cartodb-leaflet needs at least the named_map");NamedMap.call(this,this.options.named_map,this.options),this.fire=this.trigger,CartoDBLayerCommon.call(this),L.TileLayer.prototype.initialize.call(this),this.interaction=[],this.addProfiling()}}),cdb.geo.LeafLetCartoDBLayerGroupView=a(L.CartoDBGroupLayer),cdb.geo.LeafLetCartoDBNamedMapView=a(L.NamedMap))}(),function(){if("undefined"!=typeof L){L.CartoDBLayer=L.CartoDBGroupLayer.extend({options:{query:"SELECT * FROM {{table_name}}",opacity:.99,attribution:"CartoDB",debug:!1,visible:!0,added:!1,extra_params:{},layer_definition_version:"1.0.0"},initialize:function(a){if(L.Util.setOptions(this,a),!a.table_name||!a.user_name||!a.tile_style)throw"cartodb-leaflet needs at least a CartoDB table name, user_name and tile_style";L.CartoDBGroupLayer.prototype.initialize.call(this,{layer_definition:{version:this.options.layer_definition_version,layers:[{type:"cartodb",options:this._getLayerDefinition(),infowindow:this.options.infowindow}]}}),this.setOptions(this.options)},setQuery:function(a,b){void 0===b&&(b=a,a=0),b=b||"select * from "+this.options.table_name,LayerDefinition.prototype.setQuery.call(this,a,b)},isVisible:function(){return this.visible},isAdded:function(){return this.options.added}});var a=L.CartoDBLayer.extend({initialize:function(a,b){var c=this;_.bindAll(this,"featureOut","featureOver","featureClick"),a.attributes.attribution=cdb.config.get("cartodb_attributions");var d=_.clone(a.attributes);d.map=b;var e=d.featureOver,f=d.featureOut,g=d.featureClick;d.featureOver=function(){e&&e.apply(this,arguments),c.featureOver&&c.featureOver.apply(this,arguments)},d.featureOut=function(){f&&f.apply(this,arguments),c.featureOut&&c.featureOut.apply(this,arguments)},d.featureClick=function(){g&&g.apply(this,arguments),c.featureClick&&c.featureClick.apply(d,arguments)},a.bind("change:visible",function(){c.model.get("visible")?c.show():c.hide()},this),L.CartoDBLayer.prototype.initialize.call(this,d),cdb.geo.LeafLetLayerView.call(this,a,this,b)},_modelUpdated:function(){var a=_.clone(this.model.attributes);this.leafletLayer.setOptions(a)},featureOver:function(a,b,c,d){this.trigger("featureOver",a,[b.lat,b.lng],c,d,0)},featureOut:function(a){this.trigger("featureOut",a,0)},featureClick:function(a,b,c,d){this.trigger("featureClick",a,[b.lat,b.lng],c,d,0)},reload:function(){this.model.invalidate()},error:function(a){this.trigger("error",a?a.error:"unknown error"),this.model.trigger("tileError",a?a.error:"unknown error")},tilesOk:function(){this.model.trigger("tileOk")},includes:[cdb.geo.LeafLetLayerView.prototype,Backbone.Events]});cdb.geo.LeafLetLayerCartoDBView=a}}(),function(){"undefined"!=typeof L&&(cdb.geo.LeafletMapView=cdb.geo.MapView.extend({initialize:function(){_.bindAll(this,"_addLayer","_removeLayer","_setZoom","_setCenter","_setView"),cdb.geo.MapView.prototype.initialize.call(this);var a=this,b=this.map.get("center"),c={zoomControl:!1,center:new L.LatLng(b[0],b[1]),zoom:this.map.get("zoom"),minZoom:this.map.get("minZoom"),maxZoom:this.map.get("maxZoom")};if(this.map.get("bounding_box_ne"),this.options.map_object){this.map_leaflet=this.options.map_object,this.setElement(this.map_leaflet.getContainer());var d=a.map_leaflet.getCenter();a._setModelProperty({center:[d.lat,d.lng]}),a._setModelProperty({zoom:a.map_leaflet.getZoom()}),a.map.unset("view_bounds_sw",{silent:!0}),a.map.unset("view_bounds_ne",{silent:!0})}else this.map_leaflet=new L.Map(this.el,c),this.map_leaflet.attributionControl.setPrefix(""),0==this.map.get("scrollwheel")&&this.map_leaflet.scrollWheelZoom.disable();this.map.bind("set_view",this._setView,this),this.map.layers.bind("add",this._addLayer,this),this.map.layers.bind("remove",this._removeLayer,this),this.map.layers.bind("reset",this._addLayers,this),this.map.layers.bind("change:type",this._swicthLayerView,this),this.map.geometries.bind("add",this._addGeometry,this),this.map.geometries.bind("remove",this._removeGeometry,this),this._bindModel(),this._addLayers(),this.map_leaflet.on("layeradd",function(b){this.trigger("layeradd",b,a)},this),this.map_leaflet.on("zoomstart",function(){a.trigger("zoomstart")}),this.map_leaflet.on("click",function(b){a.trigger("click",b.originalEvent,[b.latlng.lat,b.latlng.lng])}),this.map_leaflet.on("dblclick",function(b){a.trigger("dblclick",b.originalEvent)}),this.map_leaflet.on("zoomend",function(){a._setModelProperty({zoom:a.map_leaflet.getZoom()}),a.trigger("zoomend")},this),this.map_leaflet.on("move",function(){var b=a.map_leaflet.getCenter();a._setModelProperty({center:[b.lat,b.lng]})}),this.map_leaflet.on("drag",function(){var b=a.map_leaflet.getCenter();a._setModelProperty({center:[b.lat,b.lng]}),a.trigger("drag")},this),this.map.bind("change:maxZoom",function(){L.Util.setOptions(a.map_leaflet,{maxZoom:a.map.get("maxZoom")})},this),this.map.bind("change:minZoom",function(){L.Util.setOptions(a.map_leaflet,{minZoom:a.map.get("minZoom")})},this),this.trigger("ready");var e=this.map.getViewBounds();e&&this.showBounds(e)},clean:function(){L.DomEvent.off(window,"resize",this.map_leaflet._onResize,this.map_leaflet);for(var a in this.layers){var b=this.layers[a];b.remove(),delete this.layers[a]}cdb.core.View.prototype.clean.call(this)},_setScrollWheel:function(a,b){b?this.map_leaflet.scrollWheelZoom.enable():this.map_leaflet.scrollWheelZoom.disable()},_setZoom:function(){this._setView()},_setCenter:function(){this._setView()},_setView:function(){this.map_leaflet.setView(this.map.get("center"),this.map.get("zoom")||0)},_addGeomToMap:function(a){var b=cdb.geo.LeafletMapView.createGeometry(a);return b.geom.addTo(this.map_leaflet),b},_removeGeomFromMap:function(a){this.map_leaflet.removeLayer(a.geom)},createLayer:function(a){return cdb.geo.LeafletMapView.createLayer(a,this.map_leaflet)},_addLayer:function(a,b,c){var d,e=this;if(d=cdb.geo.LeafletMapView.createLayer(a,this.map_leaflet)){var f=!c||void 0===c.index||c.index===_.size(this.layers);if(!f)for(var g in this.layers)this.map_leaflet.removeLayer(this.layers[g]);this.layers[a.cid]=d,f?(cdb.geo.LeafletMapView.addLayerToMap(d,e.map_leaflet),d.setZIndex&&d.setZIndex(a.get("order"))):this.map.layers.each(function(a){var b=e.layers[a.cid];b&&(cdb.geo.LeafletMapView.addLayerToMap(b,e.map_leaflet),b.setZIndex&&b.setZIndex(a.get("order")))});var h=a.get("attribution");if(h){var i=this.map.get("attribution")||[];_.contains(i,h)||i.push(h),this.map.set({attribution:i})}return void 0!=c&&c.silent||this.trigger("newLayerView",d,a,this),d}},pixelToLatLon:function(a){var b=this.map_leaflet.containerPointToLatLng([a[0],a[1]]);return b},latLonToPixel:function(a){var b=this.map_leaflet.latLngToLayerPoint(new L.LatLng(a[0],a[1]));return this.map_leaflet.layerPointToContainerPoint(b)},getBounds:function(){var a=this.map_leaflet.getBounds(),b=a.getSouthWest(),c=a.getNorthEast();return[[b.lat,b.lng],[c.lat,c.lng]]},setAttribution:function(){},getSize:function(){return this.map_leaflet.getSize()},panBy:function(a){this.map_leaflet.panBy(new L.Point(a.x,a.y))},setCursor:function(a){$(this.map_leaflet.getContainer()).css("cursor",a)},getNativeMap:function(){return this.map_leaflet},invalidateSize:function(){this.map_leaflet.invalidateSize({pan:!1}),this.map_leaflet.setView(this.map.get("center"),this.map.get("zoom")||0,{animate:!1})}},{layerTypeMap:{tiled:cdb.geo.LeafLetTiledLayerView,wms:cdb.geo.LeafLetWMSLayerView,cartodb:cdb.geo.LeafLetLayerCartoDBView,carto:cdb.geo.LeafLetLayerCartoDBView,plain:cdb.geo.LeafLetPlainLayerView,gmapsbase:cdb.geo.LeafLetGmapsTiledLayerView,layergroup:cdb.geo.LeafLetCartoDBLayerGroupView,namedmap:cdb.geo.LeafLetCartoDBNamedMapView,torque:function(a,b){return new cdb.geo.LeafLetTorqueLayer(a,b)}},createLayer:function(a,b){var c=null,d=this.layerTypeMap[a.get("type").toLowerCase()];if(d)try{c=new d(a,b)}catch(e){cdb.log.error("MAP: error creating layer"+a.get("type")+" "+e)}else cdb.log.error("MAP: "+a.get("type")+" can't be created");return c},addLayerToMap:function(a,b,c){b.addLayer(a.leafletLayer),void 0!==c&&v.setZIndex&&v.setZIndex(c)},createGeometry:function(a){return a.isPoint()?new cdb.geo.leaflet.PointView(a):new cdb.geo.leaflet.PathView(a)}}),L.Icon.Default.imagePath=function(){var a,b,c,d,e=document.getElementsByTagName("script"),f=/\/?cartodb[\-\._]?([\w\-\._]*)\.js\??/;for(a=0,b=e.length;b>a;a++)if(c=e[a].src,d=c.match(f)){var g=c.split("/");return delete g[g.length-1],g.join("/")+"themes/css/images"}}())}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a,b,c){this.gmapsLayer=b,this.map=this.gmapsMap=c,this.model=a,this.model.bind("change",this._update,this),this.type=a.get("type")||a.get("kind"),this.type=this.type.toLowerCase()};_.extend(a.prototype,Backbone.Events),_.extend(a.prototype,{_searchLayerIndex:function(){var a=this,b=-1;return this.gmapsMap.overlayMapTypes.forEach(function(c,d){c==a&&(b=d)}),b},remove:function(){if(!this.isBase){var a=this._searchLayerIndex();a>=0?this.gmapsMap.overlayMapTypes.removeAt(a):this.gmapsLayer.setMap&&this.gmapsLayer.setMap(null),this.model.unbind(null,null,this),this.unbind()}},refreshView:function(){if(this.isBase){var a="_baseLayer";this.gmapsMap.setMapTypeId(null),this.gmapsMap.mapTypes.set(a,this.gmapsLayer),this.gmapsMap.setMapTypeId(a)}else{var b=this._searchLayerIndex();b>=0&&this.gmapsMap.overlayMapTypes.setAt(b,this)}},reload:function(){this.refreshView()},_update:function(){this.refreshView()}}),cdb.geo.GMapsLayerView=a}}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a,b){cdb.geo.GMapsLayerView.call(this,a,null,b)};_.extend(a.prototype,cdb.geo.GMapsLayerView.prototype,{_update:function(){var a=this.model,b={roadmap:google.maps.MapTypeId.ROADMAP,gray_roadmap:google.maps.MapTypeId.ROADMAP,dark_roadmap:google.maps.MapTypeId.ROADMAP,hybrid:google.maps.MapTypeId.HYBRID,satellite:google.maps.MapTypeId.SATELLITE,terrain:google.maps.MapTypeId.TERRAIN};this.gmapsMap.setOptions({mapTypeId:b[a.get("base_type")]}),this.gmapsMap.setOptions({styles:a.get("style")||DEFAULT_MAP_STYLE})},remove:function(){}}),cdb.geo.GMapsBaseLayerView=a}}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a,b){this.color=a.get("color"),cdb.geo.GMapsLayerView.call(this,a,this,b)};_.extend(a.prototype,cdb.geo.GMapsLayerView.prototype,{_update:function(){this.color=this.model.get("color"),this.refreshView()},getTile:function(){var a=document.createElement("div");return a.style.width=this.tileSize.x,a.style.height=this.tileSize.y,a["background-color"]=this.color,a},tileSize:new google.maps.Size(256,256),maxZoom:100,minZoom:0,name:"plain layer",alt:"plain layer"}),cdb.geo.GMapsPlainLayerView=a}}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a,b){cdb.geo.GMapsLayerView.call(this,a,this,b),this.tileSize=new google.maps.Size(256,256),this.opacity=1,this.isPng=!0,this.maxZoom=22,this.minZoom=0,this.name="cartodb tiled layer",google.maps.ImageMapType.call(this,this)};_.extend(a.prototype,cdb.geo.GMapsLayerView.prototype,google.maps.ImageMapType.prototype,{getTileUrl:function(a,b){var c=a.y,d=1<c||c>=d)return null;var e=a.x;(0>e||e>=d)&&(e=(e%d+d)%d),this.model.get("tms")&&(c=d-c-1);var f=this.model.get("urlTemplate");return f.replace("{x}",e).replace("{y}",c).replace("{z}",b)}}),cdb.geo.GMapsTiledLayerView=a}}(),function(){function a(a,b){var c=Math.round(100*b);a.style.filter=c>=99?f:"alpha(opacity="+b+");"}function b(){}function c(a){var b=function(b,c){var d=this,e=[];_.bindAll(this,"featureOut","featureOver","featureClick"),b.attributes.attribution=cdb.config.get("cartodb_attributions");var f=_.clone(b.attributes);f.map=c;var g,h=f.featureOver,i=f.featureOut,j=f.featureClick,k=-1;f.featureOver=function(a,b,c,f,i){e[i]||d.trigger("layerenter",a,b,c,f,i),e[i]=1,h&&h.apply(this,arguments),d.featureOver&&d.featureOver.apply(this,arguments),a.timeStamp===g&&clearTimeout(k),k=setTimeout(function(){d.trigger("mouseover",a,b,c,f,i),d.trigger("layermouseover",a,b,c,f,i)},0),g=a.timeStamp},f.featureOut=function(a,b){e[b]&&d.trigger("layermouseout",b),e[b]=0,_.any(e)||d.trigger("mouseout"),i&&i.apply(this,arguments),d.featureOut&&d.featureOut.apply(this,arguments)},f.featureClick=_.debounce(function(){j&&j.apply(this,arguments),d.featureClick&&d.featureClick.apply(f,arguments)},10),a.call(this,f),cdb.geo.GMapsLayerView.call(this,b,this,c)};return _.extend(b.prototype,cdb.geo.GMapsLayerView.prototype,a.prototype,{_update:function(){this.setOptions(this.model.attributes)},reload:function(){this.model.invalidate()},remove:function(){cdb.geo.GMapsLayerView.prototype.remove.call(this),this.clear()},featureOver:function(a,b,c,d,e){this.trigger("featureOver",a,[b.lat(),b.lng()],c,d,e)},featureOut:function(a,b){this.trigger("featureOut",a,b)},featureClick:function(a,b,c,d,e){this.trigger("featureClick",a,[b.lat(),b.lng()],c,d,e)},error:function(a){this.model&&(this.model.trigger("error",a?a.errors:"unknown error"),this.model.trigger("tileError",a?a.errors:"unknown error"))},ok:function(){this.model.trigger("tileOk")},tilesOk:function(){this.model.trigger("tileOk")},loading:function(){this.trigger("loading")},finishLoading:function(){this.trigger("load")}}),b}if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var d=function(a){this.setMap(a)};d.prototype=new google.maps.OverlayView,d.prototype.draw=function(){},d.prototype.latLngToPixel=function(a){var b=this.getProjection();return b?b.fromLatLngToContainerPixel(a):[0,0]},d.prototype.pixelToLatLng=function(a){var b=this.getProjection();return b?b.fromContainerPixelToLatLng(a):[0,0]};var e={opacity:.99,attribution:"CartoDB",debug:!1,visible:!0,added:!1,tiler_domain:"cartodb.com",tiler_port:"80",tiler_protocol:"http",sql_api_domain:"cartodb.com",sql_api_port:"80",sql_api_protocol:"http",extra_params:{},cdn_url:null,subdomains:null},f="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)",g=function(a){if(this.options=_.defaults(a,e),this.tiles=0,this.tilejson=null,this.interaction=[],!a.named_map&&!a.sublayers)throw new Error("cartodb-gmaps needs at least the named_map");0!=this.options.cartodb_logo&&cdb.geo.common.CartoDBLogo.addWadus({left:74,bottom:8},2e3,this.options.map.getDiv()),wax.g.connector.call(this,a),_.extend(this.options,a),this.projector=new d(a.map),NamedMap.call(this,this.options.named_map,this.options),CartoDBLayerCommon.call(this),this.update()},h=function(a){if(this.options=_.defaults(a,e),this.tiles=0,this.tilejson=null,this.interaction=[],!a.layer_definition&&!a.sublayers)throw new Error("cartodb-leaflet needs at least the layer_definition or sublayer list");a.layer_definition||(a.layer_definition=LayerDefinition.layerDefFromSubLayers(a.sublayers)),0!=this.options.cartodb_logo&&cdb.geo.common.CartoDBLogo.addWadus({left:74,bottom:8},2e3,this.options.map.getDiv()),wax.g.connector.call(this,a),_.extend(this.options,a),this.projector=new d(a.map),LayerDefinition.call(this,a.layer_definition,this.options),CartoDBLayerCommon.call(this),this.update()};b.prototype.setOpacity=function(b){if(isNaN(b)||b>1||0>b)throw new Error(b+" is not a valid value, should be in [0, 1] range");this.opacity=this.options.opacity=b;for(var c in this.cache){var d=this.cache[c];d.style.opacity=b,a(d,b)}},b.prototype.setAttribution=function(){},b.prototype.getTile=function(b,c,d){var e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",f=this,g="ActiveXObject"in window,h=g&&!document.addEventListener;if(this.options.added=!0,null===this.tilejson){var i=c+"/"+b.x+"/"+b.y,j=this.cache[i]=new Image(256,256);return j.src=e,j.setAttribute("gTileKey",i),j.style.opacity=this.options.opacity,j}var k=wax.g.connector.prototype.getTile.call(this,b,c,d);h&&a(k,this.options.opacity),k.style.opacity=this.options.opacity,0===this.tiles&&this.loading&&this.loading(),this.tiles++;var l=cartodb.core.Profiler.metric("cartodb-js.tile.png.load.time").start(),m=function(){l.end(),f.tiles--,0===f.tiles&&f.finishLoading&&f.finishLoading()};return k.onload=m,k.onerror=function(){cartodb.core.Profiler.metric("cartodb-js.tile.png.error").inc(),m() -},k},b.prototype.onAdd=function(){},b.prototype.clear=function(){this._clearInteraction(),self.finishLoading&&self.finishLoading()},b.prototype.update=function(a){var b=this;this.loading&&this.loading(),this.getTiles(function(c,d){c?(b.tilejson=c,b.options.tiles=c.tiles,b.tiles=0,b.cache={},b._reloadInteraction(),b.refreshView(),b.ok&&b.ok(),a&&a()):b.error&&b.error(d)})},b.prototype.refreshView=function(){var a=this,b=this.options.map;b.overlayMapTypes.forEach(function(c,d){return c==a?void b.overlayMapTypes.setAt(d,a):void 0})},b.prototype.onLayerDefinitionUpdated=function(){this.update()},b.prototype._checkLayer=function(){if(!this.options.added)throw new Error("the layer is not still added to the map")},b.prototype._findPos=function(a,b){var c;c=curtop=0;var d,e,f=a.getDiv();b.e.changedTouches&&b.e.changedTouches.length>0?(d=b.e.changedTouches[0].clientX+window.scrollX,e=b.e.changedTouches[0].clientY+window.scrollY):(d=b.e.clientX,e=b.e.clientY);do c+=f.offsetLeft,curtop+=f.offsetTop;while(f=f.offsetParent);return new google.maps.Point(d-c,e-curtop)},b.prototype._manageOffEvents=function(a,b){return this.options.featureOut?this.options.featureOut&&this.options.featureOut(b.e,b.layer):void 0},b.prototype._manageOnEvents=function(a,b){var c=this._findPos(a,b),d=this.projector.pixelToLatLng(c),e=b.e.type.toLowerCase();switch(e){case"mousemove":if(this.options.featureOver)return this.options.featureOver(b.e,d,c,b.data,b.layer);break;case"click":case"touchend":case"mspointerup":this.options.featureClick&&this.options.featureClick(b.e,d,c,b.data,b.layer)}},h.Projector=d,h.prototype=new wax.g.connector,_.extend(h.prototype,LayerDefinition.prototype,b.prototype,CartoDBLayerCommon.prototype),h.prototype.interactionClass=wax.g.interaction,g.prototype=new wax.g.connector,_.extend(g.prototype,NamedMap.prototype,b.prototype,CartoDBLayerCommon.prototype),g.prototype.interactionClass=wax.g.interaction,cdb.geo.CartoDBLayerGroupGMaps=h,cdb.geo.CartoDBNamedMapGMaps=g,cdb.geo.GMapsCartoDBLayerGroupView=c(h),cdb.geo.GMapsCartoDBNamedMapView=c(g),cdb.geo.CartoDBNamedMapGMaps=g}}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a){this.setMap(a)};a.prototype=new google.maps.OverlayView,a.prototype.draw=function(){},a.prototype.latLngToPixel=function(a){var b=this.getProjection();return b?b.fromLatLngToContainerPixel(a):[0,0]},a.prototype.pixelToLatLng=function(a){var b=this.getProjection();return b?b.fromContainerPixelToLatLng(a):[0,0]};var b=function(a){var b={query:"SELECT * FROM {{table_name}}",opacity:.99,attribution:"CartoDB",opacity:1,debug:!1,visible:!0,added:!1,extra_params:{},layer_definition_version:"1.0.0"};if(this.options=_.defaults(a,b),!a.table_name||!a.user_name||!a.tile_style)throw"cartodb-gmaps needs at least a CartoDB table name, user_name and tile_style";this.options.layer_definition={version:this.options.layer_definition_version,layers:[{type:"cartodb",options:this._getLayerDefinition(),infowindow:this.options.infowindow}]},cdb.geo.CartoDBLayerGroupGMaps.call(this,this.options),this.setOptions(this.options)};_.extend(b.prototype,cdb.geo.CartoDBLayerGroupGMaps.prototype),b.prototype.setQuery=function(a,b){void 0===b&&(b=a,a=0),b=b||"select * from "+this.options.table_name,LayerDefinition.prototype.setQuery.call(this,a,b)},cdb.geo.CartoDBLayerGMaps=b;var c=function(a,b){var c=this;_.bindAll(this,"featureOut","featureOver","featureClick"),a.attributes.attribution=cdb.config.get("cartodb_attributions");var d=_.clone(a.attributes);d.map=b;var e=d.featureOver,f=d.featureOut,g=d.featureClick;d.featureOver=function(){e&&e.apply(this,arguments),c.featureOver&&c.featureOver.apply(this,arguments)},d.featureOut=function(){f&&f.apply(this,arguments),c.featureOut&&c.featureOut.apply(this,arguments)},d.featureClick=function(){g&&g.apply(this,arguments),c.featureClick&&c.featureClick.apply(d,arguments)},cdb.geo.CartoDBLayerGMaps.call(this,d),cdb.geo.GMapsLayerView.call(this,a,this,b)};cdb.geo.GMapsCartoDBLayerView=c,_.extend(c.prototype,cdb.geo.CartoDBLayerGMaps.prototype,cdb.geo.GMapsLayerView.prototype,{_update:function(){this.setOptions(this.model.attributes)},reload:function(){this.model.invalidate()},remove:function(){cdb.geo.GMapsLayerView.prototype.remove.call(this),this.clear()},featureOver:function(a,b,c,d){this.trigger("featureOver",a,[b.lat(),b.lng()],c,d,0)},featureOut:function(a){this.trigger("featureOut",a)},featureClick:function(a,b,c,d){this.trigger("featureClick",a,[b.lat(),b.lng()],c,d,0)},error:function(a){this.model&&(this.model.trigger("error",a?a.error:"unknown error"),this.model.trigger("tileError",a?a.error:"unknown error"))},tilesOk:function(){this.model.trigger("tileOk")},loading:function(){this.trigger("loading")},finishLoading:function(){this.trigger("load")}})}}(),"undefined"!=typeof google&&"undefined"!=typeof google.maps){var DEFAULT_MAP_STYLE=[{stylers:[{saturation:-65},{gamma:1.52}]},{featureType:"administrative",stylers:[{saturation:-95},{gamma:2.26}]},{featureType:"water",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative.locality",stylers:[{visibility:"off"}]},{featureType:"road",stylers:[{visibility:"simplified"},{saturation:-99},{gamma:2.22}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.arterial",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"poi",stylers:[{saturation:-55}]}];cdb.geo.GoogleMapsMapView=cdb.geo.MapView.extend({layerTypeMap:{tiled:cdb.geo.GMapsTiledLayerView,cartodb:cdb.geo.GMapsCartoDBLayerView,carto:cdb.geo.GMapsCartoDBLayerView,plain:cdb.geo.GMapsPlainLayerView,gmapsbase:cdb.geo.GMapsBaseLayerView,layergroup:cdb.geo.GMapsCartoDBLayerGroupView,namedmap:cdb.geo.GMapsCartoDBNamedMapView,torque:function(a,b){return new cdb.geo.GMapsTorqueLayerView(a,b)},wms:cdb.geo.LeafLetWMSLayerView},initialize:function(){_.bindAll(this,"_ready"),this._isReady=!1;var a=this;cdb.geo.MapView.prototype.initialize.call(this);var b=this.map.getViewBounds();b&&this.showBounds(b);var c=this.map.get("center");if(this.options.map_object){this.map_googlemaps=this.options.map_object,this.setElement(this.map_googlemaps.getDiv());var d=a.map_googlemaps.getCenter();a._setModelProperty({center:[d.lat(),d.lng()]}),a._setModelProperty({zoom:a.map_googlemaps.getZoom()}),a.map.unset("view_bounds_sw",{silent:!0}),a.map.unset("view_bounds_ne",{silent:!0})}else this.map_googlemaps=new google.maps.Map(this.el,{center:new google.maps.LatLng(c[0],c[1]),zoom:this.map.get("zoom"),minZoom:this.map.get("minZoom"),maxZoom:this.map.get("maxZoom"),disableDefaultUI:!0,scrollwheel:this.map.get("scrollwheel"),mapTypeControl:!1,mapTypeId:google.maps.MapTypeId.ROADMAP,backgroundColor:"white",tilt:0}),this.map.bind("change:maxZoom",function(){a.map_googlemaps.setOptions({maxZoom:a.map.get("maxZoom")})},this),this.map.bind("change:minZoom",function(){a.map_googlemaps.setOptions({minZoom:a.map.get("minZoom")})},this);this.map.geometries.bind("add",this._addGeometry,this),this.map.geometries.bind("remove",this._removeGeometry,this),this._bindModel(),this._addLayers(),google.maps.event.addListener(this.map_googlemaps,"center_changed",function(){var b=a.map_googlemaps.getCenter();a._setModelProperty({center:[b.lat(),b.lng()]})}),google.maps.event.addListener(this.map_googlemaps,"zoom_changed",function(){a._setModelProperty({zoom:a.map_googlemaps.getZoom()})}),google.maps.event.addListener(this.map_googlemaps,"click",function(b){a.trigger("click",b,[b.latLng.lat(),b.latLng.lng()])}),google.maps.event.addListener(this.map_googlemaps,"dblclick",function(b){a.trigger("dblclick",b)}),this.map.layers.bind("add",this._addLayer,this),this.map.layers.bind("remove",this._removeLayer,this),this.map.layers.bind("reset",this._addLayers,this),this.map.layers.bind("change:type",this._swicthLayerView,this),this.projector=new cdb.geo.CartoDBLayerGroupGMaps.Projector(this.map_googlemaps),this.projector.draw=this._ready},_ready:function(){this.projector.draw=function(){},this.trigger("ready"),this._isReady=!0},_setScrollWheel:function(a,b){this.map_googlemaps.setOptions({scrollwheel:b})},_setZoom:function(a,b){b=b||0,this.map_googlemaps.setZoom(b)},_setCenter:function(a,b){var c=new google.maps.LatLng(b[0],b[1]);this.map_googlemaps.setCenter(c)},createLayer:function(a){var b,c=this.layerTypeMap[a.get("type").toLowerCase()];if(c)try{b=new c(a,this.map_googlemaps)}catch(d){cdb.log.error("MAP: error creating layer"+a.get("type")+" "+d)}else cdb.log.error("MAP: "+a.get("type")+" can't be created");return b},_addLayer:function(a,b,c){c=c||{};var d,e=this;if(d=this.createLayer(a)){if(this.layers[a.cid]=d,d){var f=_(this.layers).filter(function(a){return!!a.getTile}).length-1,g=1===_.keys(this.layers).length||c&&0===c.index;if(g&&!c.no_base_layer){var h=d.model;"GMapsBase"===h.get("type")?d._update():(d.isBase=!0,d._update())}else f-=1,f=Math.max(0,f),d.getTile?(d.gmapsLayer||cdb.log.error("gmaps layer can't be null"),e.map_googlemaps.overlayMapTypes.setAt(f,d.gmapsLayer)):d.gmapsLayer.setMap(e.map_googlemaps);void 0!==c&&c.silent||this.trigger("newLayerView",d,a,this)}else cdb.log.error("layer type not supported");var i=a.get("attribution");if(i){var j=this.map.get("attribution")||[];_.contains(j,i)||j.push(i),this.map.set({attribution:j})}return d}},pixelToLatLon:function(a){return this.projector.fromContainerPixelToLatLng(new google.maps.Point(a[0],a[1]))},latLonToPixel:function(a){return this.projector.latLngToPixel(new google.maps.LatLng(a[0],a[1]))},getSize:function(){return{x:this.$el.width(),y:this.$el.height()}},panBy:function(a){var b=this.map.get("center"),c=this.latLonToPixel(b);a.x+=c.x,a.y+=c.y;var d=this.projector.pixelToLatLng(a);this.map.setCenter([d.lat(),d.lng()])},getBounds:function(){if(this._isReady){var a=this.map_googlemaps.getBounds(),b=a.getSouthWest(),c=a.getNorthEast();return[[b.lat(),b.lng()],[c.lat(),c.lng()]]}return[[0,0],[0,0]]},setAttribution:function(a){var b=document.getElementById("cartodb-gmaps-attribution"),c=a.get("attribution").join(", ");b&&b.parentNode.removeChild(b);var d=this.map_googlemaps.getDiv(),e=document.createElement("div");e.setAttribute("id","cartodb-gmaps-attribution"),e.setAttribute("class","gmaps"),d.appendChild(e),e.innerHTML=c},setCursor:function(a){this.map_googlemaps.setOptions({draggableCursor:a})},_addGeomToMap:function(a){var b=cdb.geo.GoogleMapsMapView.createGeometry(a);if(b.geom.length)for(var c=0;c/g)||[]).join("");var c=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;return a&&"string"==typeof a?a.replace(c,function(a,c){return b.indexOf("<"+c.toLowerCase()+">")>-1?a:""}):""},open:function(){var a=this;this.$el.show(0,function(){a.isOpen=!0})},hide:function(){var a=this;this.$el.hide(0,function(){a.isOpen=!1}),this.options.clean_on_hide&&this.clean()},toggle:function(){this.isOpen?this.hide():this.open()},_truncateTitle:function(a,b){return a.substr(0,b-1)+(a.length>b?"…":"")},render:function(){var a,b,c=this.$el,d=this.options.title,e=(this.options.description,this._stripHTML(this.options.description)),f=this.options.share_url;this.$el.addClass(this.options.size);var g,h=d+": "+e;g=d&&e?this._truncateTitle(d+": "+e,112)+" %23map ":d?this._truncateTitle(d,112)+" %23map":e?this._truncateTitle(e,112)+" %23map":"%23map",a=this.options.facebook_url?this.options.facebook_url:"http://www.facebook.com/sharer.php?u="+f+"&text="+h,b=this.options.twitter_url?this.options.twitter_url:"https://twitter.com/share?url="+f+"&text="+g;var i=_.extend(this.options,{facebook_url:a,twitter_url:b});return c.html(this.options.template(i)),c.find(".modal").css({width:this.options.width}),this.render_content&&this.$(".content").append(this.render_content()),this.options.modal_class&&this.$el.addClass(this.options.modal_class),this.options.disableLinks&&this.$el.find("a").attr("target",""),this}}),cdb.ui.common.Notification=cdb.core.View.extend({tagName:"div",className:"dialog",events:{"click .close":"hide"},default_options:{timeout:0,msg:"",hideMethod:"",duration:"normal"},initialize:function(){this.closeTimeout=-1,_.defaults(this.options,this.default_options),this.template=this.options.template?_.template(this.options.template):cdb.templates.getTemplate("common/notification"),this.$el.hide()},render:function(){var a=this.$el;return a.html(this.template(this.options)),this.render_content&&this.$(".content").append(this.render_content()),this},hide:function(a){var b=this;a&&a.preventDefault(),clearTimeout(this.closeTimeout),""!=this.options.hideMethod&&this.$el.is(":visible")?this.$el[this.options.hideMethod](this.options.duration,"swing",function(){b.$el.html(""),b.trigger("notificationDeleted"),b.remove()}):(this.$el.hide(),b.$el.html(""),b.trigger("notificationDeleted"),b.remove())},open:function(a,b){this.render(),this.$el.show(a,b),this.options.timeout&&(this.closeTimeout=setTimeout(_.bind(this.hide,this),this.options.timeout))}}),cdb.ui.common.Row=cdb.core.Model.extend({}),cdb.ui.common.TableData=Backbone.Collection.extend({model:cdb.ui.common.Row,fetched:!1,initialize:function(){var a=this;this.bind("reset",function(){a.fetched=!0})},getCell:function(a,b){var c=this.at(a);return c?c.get(b):null},isEmpty:function(){return 0===this.length}}),cdb.ui.common.TableProperties=cdb.core.Model.extend({columnNames:function(){return _.map(this.get("schema"),function(a){return a[0]})},columnName:function(a){return this.columnNames()[a]}}),cdb.ui.common.RowView=cdb.core.View.extend({tagName:"tr",initialize:function(){this.model.bind("change",this.render,this),this.model.bind("destroy",this.clean,this),this.model.bind("remove",this.clean,this),this.model.bind("change",this.triggerChange,this),this.model.bind("sync",this.triggerSync,this),this.model.bind("error",this.triggerError,this),this.add_related_model(this.model),this.order=this.options.order},triggerChange:function(){this.trigger("changeRow")},triggerSync:function(){this.trigger("syncRow")},triggerError:function(){this.trigger("errorRow")},valueView:function(a,b){return b},render:function(){var a,b=this,c=this.model,d="",e=0;a=this.options.row_header?'
          ",e++,d+=a;for(var g=this.order||_.keys(c.attributes),h="",i=c.attributes,j=0,k=g.length;k>j;++j){var l=g[j],m=i[l];if(void 0!==m){var a='",e++,h+=a}}return d+=h,this.$el.html(d).attr("id","row_"+c.id),this},getCell:function(a){return this.options.row_header&&++a,this.$("td:eq("+a+")")},getTableView:function(){return this.tableView}}),cdb.ui.common.Table=cdb.core.View.extend({tagName:"table",rowView:cdb.ui.common.RowView,events:{"click td":"_cellClick","dblclick td":"_cellDblClick"},default_options:{},initialize:function(){var a=this;_.defaults(this.options,this.default_options),this.dataModel=this.options.dataModel,this.rowViews=[],this.setDataSource(this.dataModel),this.model.bind("change",this.render,this),this.model.bind("change:dataSource",this.setDataSource,this),this.bind("clean",this.clear_rows,this),this.add_related_model(this.dataModel),this.add_related_model(this.model),this.model.bind("removing:row",function(){a.rowsBeingDeleted=a.rowsBeingDeleted?a.rowsBeingDeleted+1:1,a.rowDestroying()}),this.model.bind("remove:row",function(){a.rowsBeingDeleted>0&&(a.rowsBeingDeleted--,a.rowDestroyed(),0==a.dataModel.length&&a.emptyTable())})},headerView:function(a){return a[0]},setDataSource:function(a){this.dataModel&&this.dataModel.unbind(null,null,this),this.dataModel=a,this.dataModel.bind("reset",this._renderRows,this),this.dataModel.bind("error",this._renderRows,this),this.dataModel.bind("add",this.addRow,this)},_renderHeader:function(){var a=this,b=$(""),c=$("");return c.append(this.options.row_header?$("]","i"),ya=/checked\s*(?:[^=]|=\s*.checked.)/i,za=/\/(java|ecma)script/i,Aa=/^\s*",""],legend:[1,"
          ","
          "],thead:[1,"
          ':'';var f=b.valueView("","");f.html&&(f=f[0].outerHTML),a+=f,a+="',f=b.valueView(l,m);f.html&&(f=f[0].outerHTML),a+=f,a+="
          ").append(a.headerView(["","header"])):$("").append(a.headerView(["","header"]))),_(this.model.get("schema")).each(function(b){c.append($("").append(a.headerView(b)))}),b.append(c),b},clear_rows:function(){this.$("tfoot").remove(),this.$("tr.noRows").remove();for(var a=null;a=this.rowViews.pop();)a.unbind(null,null,this),a.clean();this.rowViews=[]},addRow:function(a,b,c){var d=this,e=new d.rowView({model:a,order:this.model.columnNames(),row_header:this.options.row_header});if(e.tableView=this,e.bind("clean",function(){var a=_.indexOf(d.rowViews,e);d.rowViews.splice(a,1);for(var b=a;b").css({position:"relative",width:"100%",height:"100%"});this.container=l;var m=$("
          ").addClass("cartodb-map-wrapper").css({position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%"});l.append(m),this.$el.append(l);var n=new cdb.geo.MapView.create(m,j);if(this.mapView=n,this._addLayers(a.layers,b),(b.legends||void 0===b.legends&&this.map.get("legends")!==!1)&&this.addLegends(a.layers,this.mobile_enabled),b.time_slider){var o=_(this.getLayers()).filter(function(a){return"torque"===a.model.get("type")});o&&o.length&&(this.torqueLayer=o[0],!this.mobile_enabled&&this.torqueLayer&&this.addTimeSlider(this.torqueLayer))}return b.sublayer_options||this._setupSublayers(a.layers,b),b.sublayer_options&&this._setLayerOptions(b),this.mobile_enabled&&(void 0===b.legends&&(b.legends=this.legends?!0:!1),this.addMobile(a.overlays,a.layers,b)),this._addOverlays(a.overlays,b),_.defer(function(){c.trigger("done",c,c.getLayers())}),this},_addFullScreen:function(){this.addOverlay({options:{allowWheelOnFullscreen:!0},type:"fullscreen"})},_createOverlays:function(a,b){_.each(a,function(a){var c=a.type;if(!(this.mobile_enabled&&"zoom"===c||this.mobile_enabled&&"header"===c||"fullscreen"===c&&$.browser.msie&&parseFloat($.browser.version)<=10)){if("image"===c||"text"===c||"annotation"===c){var d="mobile"==a.options.device?!0:!1;if(this.mobile!==d)return;if(!b[c]&&void 0!==b[c])return}var e=this.addOverlay(a);e&&c in b&&b[c]===!1&&e.hide();var f=a.options;if(("share"==c&&b.shareable||"share"==c&&e.model.get("display")&&void 0==b.shareable)&&e.show(),("layer_selector"==c&&b[c]||"layer_selector"==c&&e.model.get("display")&&void 0==b[c])&&e.show(),("fullscreen"==c&&b[c]||"fullscreen"==c&&e.model.get("display")&&void 0==b[c])&&e.show(),!this.mobile_enabled&&("search"==c&&b[c]||"search"==c&&f.display&&void 0==b[c])&&e.show(),!this.mobile_enabled&&"header"===c){var g=e.model;void 0!==b.title&&g.set("show_title",b.title),void 0!==b.description&&g.set("show_description",b.description),(g.get("show_title")||g.get("show_description"))&&$(".cartodb-map-wrapper").addClass("with_header"),e.render()}}},this)},addMobile:function(a,b,c){var d,e=b[1];e.options&&e.options.layer_definition?d=e.options.layer_definition.layers:e.options&&e.options.named_map&&e.options.named_map.layers&&(d=e.options.named_map.layers),this.addOverlay({type:"mobile",layers:d,overlays:a,options:c,torqueLayer:this.torqueLayer})},createLegendView:function(a){for(var b=[],c=a.length-1;c>=0;--c){var d=a[c];if(d.legend){d.legend.data=d.legend.items;var e=d.legend;(e.items&&e.items.length||e.template)&&(d.legend.index=c,b.push(new cdb.geo.ui.Legend(d.legend))) -}d.options&&d.options.layer_definition?b=b.concat(this.createLegendView(d.options.layer_definition.layers)):d.options&&d.options.named_map&&d.options.named_map.layers&&(b=b.concat(this.createLegendView(d.options.named_map.layers)))}return b},addOverlay:function(b){b.map=this.map;var c=a.create(b.type,this,b);return c&&("loader"==b.type&&(this.loader=c),this.mapView.addOverlay(c),this.overlays.push(c),c.bind("clean",function(){for(var a in this.overlays){var b=this.overlays[a];if(c.cid===b.cid)return void this.overlays.splice(a,1)}},this),"header"==b.type),c},_applyOptions:function(a,b){function c(b){if(!a.overlays)return null;for(var c=0;c1)for(var l=b.auth_token,m=1;m','x','
          ','
          ',"{{#content.fields}}","{{#title}}

          {{title}}

          {{/title}}","{{#value}}",'

          {{{ value }}}

          ',"{{/value}}","{{^value}}",'

          null

          ',"{{/value}}","{{/content.fields}}","
          ","
          ",'
          ',"
          "].join("")},cdb.vis.Vis=d}(),function(){cdb.vis.Overlay.register("logo",function(){}),cdb.vis.Overlay.register("mobile",function(a,b){var c=cdb.core.Template.compile(a.template||'
            ',a.templateType||"mustache"),d=new cdb.geo.ui.Mobile({template:c,mapView:b.mapView,overlays:a.overlays,layerView:a.layerView,visibility_options:a.options,torqueLayer:a.torqueLayer,map:a.map});return d.render()}),cdb.vis.Overlay.register("image",function(a){var b=a.options,c=cdb.core.Template.compile(a.template||'
            {{{ content }}}
            ',a.templateType||"mustache"),d=new cdb.geo.ui.Image({model:new cdb.core.Model(b),template:c});return d.render()}),cdb.vis.Overlay.register("text",function(a){var b=a.options,c=cdb.core.Template.compile(a.template||'
            {{{ text }}}
            ',a.templateType||"mustache"),d=new cdb.geo.ui.Text({model:new cdb.core.Model(b),template:c,className:"cartodb-overlay overlay-text "+b.device});return d.render()}),cdb.vis.Overlay.register("annotation",function(a,b){var c=a.options,d=cdb.core.Template.compile(a.template||'
            {{{ text }}}
            ',a.templateType||"mustache"),c=a.options,e=new cdb.geo.ui.Annotation({className:"cartodb-overlay overlay-annotation "+c.device,template:d,mapView:b.mapView,device:c.device,text:c.extra.rendered_text,minZoom:c.style["min-zoom"],maxZoom:c.style["max-zoom"],latlng:c.extra.latlng,style:c.style});return e.render()}),cdb.vis.Overlay.register("zoom_info",function(){}),cdb.vis.Overlay.register("header",function(a){var b=a.options,c=cdb.core.Template.compile(a.template||'
            {{{ title }}}
            {{{ description }}}
            ',a.templateType||"mustache"),d=new cdb.geo.ui.Header({model:new cdb.core.Model(b),template:c});return d.render()}),cdb.vis.Overlay.register("zoom",function(a,b){if(!a.template)return void b.trigger("error","zoom template is empty");var c=new cdb.geo.ui.Zoom({model:a.map,template:cdb.core.Template.compile(a.template)});return c.render()}),cdb.vis.Overlay.register("loader",function(a){var b=new cdb.geo.ui.TilesLoader({template:cdb.core.Template.compile(a.template)});return b.render()}),cdb.vis.Overlay.register("time_slider",function(a){var b=new cdb.geo.ui.TimeSlider(a);return b.render()}),cdb.vis.Overlay.register("_header",function(a){function b(a,b){return a.substr(0,b-1)+(a.length>b?"…":"")}a.share_url=location.href?encodeURIComponent(location.href):a.url;var c,d=cdb.core.Template.compile(a.template||" {{#title}}

            {{#url}} {{title}} {{/url}} {{^url}} {{title}} {{/url}}

            {{/title}} {{#description}}

            {{{description}}}

            {{/description}} {{#mobile_shareable}} {{/mobile_shareable}} ",a.templateType||"mustache"),e=a.map.get("title"),f=a.map.get("description"),g=e+": "+f;c=e&&f?b(e+": "+f,112)+" %23map ":e?b(e,112)+" %23map":f?b(f,112)+" %23map":"%23map";var h="false"!=a.shareable&&a.shareable?a.shareable:null,i=h;i=i&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);var j=new cdb.geo.ui.Header({title:e,description:f,facebook_title:g,twitter_title:c,url:a.url,share_url:a.share_url,mobile_shareable:i,shareable:h&&!i,template:d});return j.render()}),cdb.vis.Overlay.register("infowindow",function(a,b){if(0==_.size(a.fields))return null;var c=new cdb.geo.ui.InfowindowModel({template:a.template,alternative_names:a.alternative_names,fields:a.fields,template_name:a.template_name}),d=a.templateType||"mustache",e=new cdb.geo.ui.Infowindow({model:c,mapView:b.mapView,template:new cdb.core.Template({template:a.template,type:d}).asFunction()});return e}),cdb.vis.Overlay.register("layer_selector",function(a,b){var c=a.options,d=cdb.core.Template.compile(a.template||' Visible layers
            ',a.templateType||"underscore"),e=cdb.core.Template.compile(a.template||'
              ',a.templateType||"underscore"),f=new cdb.geo.ui.LayerSelector({model:new cdb.core.Model(c),mapView:b.mapView,template:d,dropdown_template:e,layer_names:a.layer_names});return b.legends&&f.bind("change:visible",function(a,c,d){if("torque"===d.get("type")){var e=b.getOverlay("time_slider");e&&e[a?"show":"hide"]()}if("layergroup"===d.get("type")||"torque"===d.get("type")){var f=b.legends&&b.legends.getLegendByIndex(c);f&&f[a?"show":"hide"]()}}),f.render()}),cdb.vis.Overlay.register("fullscreen",function(a,b){var c=a.options;c.allowWheelOnFullscreen=!1;var d=cdb.core.Template.compile(a.template||'',a.templateType||"mustache"),e=new cdb.ui.common.FullScreen({doc:"#map > div",model:new cdb.core.Model(c),mapView:b.mapView,template:d});return e.render()}),cdb.vis.Overlay.register("share",function(a,b){var c=a.options,d=cdb.core.Template.compile(a.template||'',a.templateType||"mustache"),e=new cdb.geo.ui.Share({model:new cdb.core.Model(c),vis:b,map:b.map,template:d});return e.createDialog(),e.render()}),cdb.vis.Overlay.register("search",function(a,b){var c=(a.options,cdb.core.Template.compile(a.template||'
              ',a.templateType||"mustache")),d=new cdb.geo.ui.Search({template:c,model:b.map});return d.render()}),cdb.vis.Overlay.register("tooltip",function(a,b){var c;if(!a.layer){var d=b.getLayers();d.length>1&&(c=d[1]),a.layer=c}if(!a.layer)throw new Error("layer is null");a.layer.setInteraction(!0);var e=new cdb.geo.ui.Tooltip(a);return e}),cdb.vis.Overlay.register("infobox",function(a,b){var c,d=b.getLayers();if(a.layer||(d.length>1&&(c=d[1]),a.layer=c),!a.layer)throw new Error("layer is null");a.layer.setInteraction(!0);var e=new cdb.geo.ui.InfoBox(a);return e})}(),function(){function a(a){for(var b in d)if(-1!==a.indexOf(b))return a.replace(b,d[b]);return a}function b(a,b){b.infowindow&&b.infowindow.fields&&(b.interactivity?-1===b.interactivity.indexOf("cartodb_id")&&(b.interactivity=b.interactivity+",cartodb_id"):b.interactivity="cartodb_id"),a.https&&(b.tiler_protocol="https",b.tiler_port=443,b.sql_api_protocol="https",b.sql_api_port=443),b.cartodb_logo=void 0==a.cartodb_logo?b.cartodb_logo:a.cartodb_logo}var c=cdb.vis.Layers,d={"https://dnv9my2eseobd.cloudfront.net/":"http://a.tiles.mapbox.com/","https://maps.nlp.nokia.com/":"http://maps.nlp.nokia.com/","https://tile.stamen.com/":"http://tile.stamen.com/","https://{s}.maps.nlp.nokia.com/":"http://{s}.maps.nlp.nokia.com/","https://cartocdn_{s}.global.ssl.fastly.net/":"http://{s}.api.cartocdn.com/"};c.register("tilejson",function(b,c){var d=c.tiles[0];return d=b.https?d:a(d),new cdb.geo.TileLayer({urlTemplate:d})}),c.register("tiled",function(b,c){var d=c.urlTemplate;return d=b.https?d:a(d),c.urlTemplate=d,new cdb.geo.TileLayer(c)}),c.register("wms",function(a,b){return new cdb.geo.WMSLayer(b)}),c.register("gmapsbase",function(a,b){return new cdb.geo.GMapsBaseLayer(b)}),c.register("plain",function(a,b){return new cdb.geo.PlainLayer(b)}),c.register("background",function(a,b){return new cdb.geo.PlainLayer(b)});var e=function(a,c){return b(a,c),c.sublayers?(c.type="layergroup",new cdb.geo.CartoDBGroupLayer(c)):new cdb.geo.CartoDBLayer(c)};c.register("cartodb",e),c.register("carto",e),c.register("layergroup",function(a,c){return b(a,c),new cdb.geo.CartoDBGroupLayer(c)}),c.register("namedmap",function(a,c){return b(a,c),new cdb.geo.CartoDBNamedMapLayer(c)}),c.register("torque",function(a,b){return a.https&&b.sql_api_domain&&-1!==b.sql_api_domain.indexOf("cartodb.com")&&(b.sql_api_protocol="https",b.sql_api_port=443,b.tiler_protocol="https",b.tiler_port=443),b.cartodb_logo=void 0==a.cartodb_logo?b.cartodb_logo:a.cartodb_logo,new cdb.geo.TorqueLayer(b)})}(),function(){function a(){}function b(a){var b=a.host||"cartodb.com",c=a.protocol||"https";return c+"://"+a.user+"."+b+"/api/v1/viz/"+a.table+"/viz.json"}function c(a,c){var d=null;return void 0!==a.layers||void 0!==(a.kind||a.type)?void _.defer(function(){c(a)}):(void 0!==a.table&&void 0!==a.user?d=b(a):a.indexOf&&0===a.indexOf("http")&&(d=a),void(d?cdb.vis.Loader.get(d,c):_.defer(function(){c(null)})))}_.extend(a.prototype,Backbone.Events,{done:function(a){return this.bind("done",a)},error:function(a){return this.bind("error",a)}}),cdb._Promise=a;cartodb.createLayer=function(b,d,e,f){var g,h,i=new a;if(e=e||{},void 0===b)throw new TypeError("map should be provided");if(void 0===d)throw new TypeError("layer should be provided");var j=arguments,k=j[j.length-1];return _.isFunction(k)&&(f=k),i.addTo=function(a,b){return i.on("done",function(){h.addLayerToMap(g,a,b)}),i},c(d,function(a){function c(){g=k.createLayer(d,{no_base_layer:!0});var a,c=/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),h=e.mobile_layout&&c||e.force_mobile;return g?(e.infowindow&&k.addInfowindow(g),e.tooltip&&k.addTooltip(g),e.legends&&k.addLegends([d],c&&e.mobile_layout||e.force_mobile),e.time_slider&&"torque"===g.model.get("type")&&(h||k.addTimeSlider(g),a=g),h&&(e.mapView=b.viz.mapView,k.addOverlay({type:"mobile",layerView:g,overlays:[],torqueLayer:a,options:e})),f&&f(g),void i.trigger("done",g)):(i.trigger("error","layer not supported"),i)}var d;if(!a)return void i.trigger("error");if(a.layers){a.layers.length<2&&i.trigger("error","visualization file does not contain layer info");var j=void 0===e.layerIndex?1:e.layerIndex;if(a.layers.length<=j)return void i.trigger("error","layerIndex out of bounds");d=a.layers[j]}else d=a;if(!d)return void i.trigger("error");if(e&&!_.isFunction(e)&&(d.options=d.options||{},_.extend(d.options,e)),e=_.defaults(e,{infowindow:!0,https:!1,legends:!0,time_slider:!0,tooltip:!0}),"undefined"!=typeof b.overlayMapTypes)h=cdb.geo.GoogleMapsMapView;else{if(!(b instanceof L.Map||window.L&&b instanceof window.L.Map))return i.trigger("error","cartodb.js can't guess the map type"),i;h=cdb.geo.LeafletMapView}var k=b.viz;if(!k){var l=new h({map_object:b,map:new cdb.geo.Map});b.viz=k=new cdb.vis.Vis({mapView:l}),k.updated_at=a.updated_at,k.https=e.https}k.checkModules([d])?c():k.loadModules([d],function(){c()})}),i}}(),function(){function a(b){if(cartodb===this||window===this)return new a(b);if(!b.user)throw new Error("user should be provided");var c=new String(window.location.protocol);if(c=c.slice(0,c.length-1),"file"==c&&(c="https"),this.ajax=b.ajax||("undefined"!=typeof jQuery?jQuery.ajax:reqwest),!this.ajax)throw new Error("jQuery or reqwest should be loaded");this.options=_.defaults(b,{version:"v2",protocol:c,jsonp:"undefined"!=typeof jQuery?!jQuery.support.cors:!1})}var b=this;b.cartodb=b.cartodb||{},a.prototype._host=function(){var a=this.options;if(a&&a.completeDomain)return a.completeDomain+"/api/"+a.version+"/sql";var b=a.host||"cartodb.com",c=a.protocol||"https";return c+"://"+a.user+"."+b+"/api/"+a.version+"/sql"},a.prototype.execute=function(a,b,c,d){var e=1024,f=new cartodb._Promise;if(!a)throw new TypeError("sql should not be null");var g=arguments,h=g[g.length-1];_.isFunction(h)&&(d=h),c=_.defaults(c||{},this.options);var i={type:"get",dataType:"json",crossDomain:!0};void 0!==c.cache&&(i.cache=c.cache),c.jsonp&&(delete i.crossDomain,c.jsonpCallback&&(i.jsonpCallback=c.jsonpCallback),i.dataType="jsonp");var j="156543.03515625",k="ST_MakeEnvelope(-20037508.5,-20037508.5,20037508.5,20037508.5,3857)";a=a.replace("!bbox!",k).replace("!pixel_width!",j).replace("!pixel_height!",j);var l=Mustache.render(a,b),m=l.length0&&null!=a.rows[0].maxx){var b=a.rows[0],c=-85.0511,f=85.0511,g=-179,h=179,i=function(a,b,c){return b>a?b:a>c?c:a},j=i(b.maxx,g,h),k=i(b.minx,g,h),l=i(b.maxy,c,f),m=i(b.miny,c,f),n=[[l,j],[m,k]];e.trigger("done",n),d&&d(n)}}).error(function(a){e.trigger("error",a)}),e},a.prototype.table=function(a){function b(){b.fetch.apply(b,arguments)}var c,d,e,f,g=a,h=[],i=this;return b.fetch=function(a){a=a||{};var c=arguments,d=c[c.length-1];_.isFunction(d)&&(callback=d,1===c.length&&(a={})),i.execute(b.sql(),a,callback)},b.sql=function(){var a="select";return a+=h.length?" "+h.join(",")+" ":" * ",a+="from "+g,c&&(a+=" where "+c),d&&(a+=" limit "+d),e&&(a+=" order by "+e),f&&(a+=" "+f),a},b.filter=function(a){return c=a,b},b.order_by=function(a){return e=a,b},b.asc=function(){return f="asc",b},b.desc=function(){return f="desc",b},b.columns=function(a){return h=a,b},b.limit=function(a){return d=a,b},b},b.cartodb.SQL=a}(),function(){cartodb.createVis=function(a,b,c,d){if(!a)throw new TypeError("a DOM element should be provided");var e=arguments,f=e[e.length-1];_.isFunction(f)&&(d=f),a="string"==typeof a?document.getElementById(a):a;var g=new cartodb.vis.Vis({el:a});return b&&(g.load(b,c),d&&g.done(d)),g}}(),cdb.$=$,cdb.L=L,cdb.Mustache=Mustache,cdb.Backbone=Backbone,cdb._=_}();for(var i in __prev)__prev[i]&&(window[i]=__prev[i])}(); \ No newline at end of file +// CartoDB.js version: 3.15.10 +// sha: b0f743801efcdf67255637c955b8fcfc9e811f64 +!function(){var define,root=this,__prev={jQuery:root.jQuery,$:root.$,L:root.L,Mustache:root.Mustache,Backbone:root.Backbone,_:root._};!function(a,b){function c(a){return J.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}function d(a){if(!sb[a]){var b=G.body,c=J("<"+a+">").appendTo(b),d=c.css("display");c.remove(),("none"===d||""===d)&&(ob||(ob=G.createElement("iframe"),ob.frameBorder=ob.width=ob.height=0),b.appendChild(ob),pb&&ob.createElement||(pb=(ob.contentWindow||ob.contentDocument).document,pb.write((J.support.boxModel?"":"")+""),pb.close()),c=pb.createElement(a),pb.body.appendChild(c),d=J.css(c,"display"),b.removeChild(ob)),sb[a]=d}return sb[a]}function e(a,b){var c={};return J.each(vb.concat.apply([],vb.slice(0,b)),function(){c[this]=a}),c}function f(){rb=b}function g(){return setTimeout(f,0),rb=J.now()}function h(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function i(){try{return new a.XMLHttpRequest}catch(b){}}function j(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d,e,f,g,h,i,j,k,l=a.dataTypes,m={},n=l.length,o=l[0];for(d=1;n>d;d++){if(1===d)for(e in a.converters)"string"==typeof e&&(m[e.toLowerCase()]=a.converters[e]);if(g=o,o=l[d],"*"===o)o=g;else if("*"!==g&&g!==o){if(h=g+" "+o,i=m[h]||m["* "+o],!i){k=b;for(j in m)if(f=j.split(" "),(f[0]===g||"*"===f[0])&&(k=m[f[1]+" "+o])){j=m[j],j===!0?i=k:k===!0&&(i=j);break}}!i&&!k&&J.error("No conversion from "+h.replace(" "," to ")),i!==!0&&(c=i?i(c):k(j(c)))}}return c}function k(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);for(;"*"===j[0];)j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}return g?(g!==j[0]&&j.unshift(g),d[g]):void 0}function l(a,b,c,d){if(J.isArray(b))J.each(b,function(b,e){c||Sa.test(a)?d(a,e):l(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==J.type(b))d(a,b);else for(var e in b)l(a+"["+e+"]",b[e],c,d)}function m(a,c){var d,e,f=J.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&J.extend(!0,a,e)}function n(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;for(var h,i=a[f],j=0,k=i?i.length:0,l=a===fb;k>j&&(l||!h);j++)h=i[j](c,d,e),"string"==typeof h&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=n(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=n(a,c,d,e,"*",g)),h}function o(a){return function(b,c){if("string"!=typeof b&&(c=b,b="*"),J.isFunction(c))for(var d,e,f,g=b.toLowerCase().split(bb),h=0,i=g.length;i>h;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function p(a,b,c){var d="width"===b?a.offsetWidth:a.offsetHeight,e="width"===b?1:0,f=4;if(d>0){if("border"!==c)for(;f>e;e+=2)c||(d-=parseFloat(J.css(a,"padding"+Oa[e]))||0),"margin"===c?d+=parseFloat(J.css(a,c+Oa[e]))||0:d-=parseFloat(J.css(a,"border"+Oa[e]+"Width"))||0;return d+"px"}if(d=Da(a,b),(0>d||null==d)&&(d=a.style[b]),Ka.test(d))return d;if(d=parseFloat(d)||0,c)for(;f>e;e+=2)d+=parseFloat(J.css(a,"padding"+Oa[e]))||0,"padding"!==c&&(d+=parseFloat(J.css(a,"border"+Oa[e]+"Width"))||0),"margin"===c&&(d+=parseFloat(J.css(a,c+Oa[e]))||0);return d+"px"}function q(a){var b=G.createElement("div");return Ca.appendChild(b),b.innerHTML=a.outerHTML,b.firstChild}function r(a){var b=(a.nodeName||"").toLowerCase();"input"===b?s(a):"script"!==b&&"undefined"!=typeof a.getElementsByTagName&&J.grep(a.getElementsByTagName("input"),s)}function s(a){("checkbox"===a.type||"radio"===a.type)&&(a.defaultChecked=a.checked)}function t(a){return"undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName("*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll("*"):[]}function u(a,b){var c;1===b.nodeType&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),"object"===c?b.outerHTML=a.outerHTML:"input"!==c||"checkbox"!==a.type&&"radio"!==a.type?"option"===c?b.selected=a.defaultSelected:"input"===c||"textarea"===c?b.defaultValue=a.defaultValue:"script"===c&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(J.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function v(a,b){if(1===b.nodeType&&J.hasData(a)){var c,d,e,f=J._data(a),g=J._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)J.event.add(b,c,h[c][d])}g.data&&(g.data=J.extend({},g.data))}}function w(a,b){return J.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function x(a){var b=oa.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function y(a,b,c){if(b=b||0,J.isFunction(b))return J.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return J.grep(a,function(a,d){return a===b===c});if("string"==typeof b){var d=J.grep(a,function(a){return 1===a.nodeType});if(ka.test(b))return J.filter(b,d,!c);b=J.filter(b,d)}return J.grep(a,function(a,d){return J.inArray(a,b)>=0===c})}function z(a){return!a||!a.parentNode||11===a.parentNode.nodeType}function A(){return!0}function B(){return!1}function C(a,b,c){var d=b+"defer",e=b+"queue",f=b+"mark",g=J._data(a,d);g&&("queue"===c||!J._data(a,e))&&("mark"===c||!J._data(a,f))&&setTimeout(function(){!J._data(a,e)&&!J._data(a,f)&&(J.removeData(a,d,!0),g.fire())},0)}function D(a){for(var b in a)if(("data"!==b||!J.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function E(a,c,d){if(d===b&&1===a.nodeType){var e="data-"+c.replace(N,"-$1").toLowerCase();if(d=a.getAttribute(e),"string"==typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:J.isNumeric(d)?+d:M.test(d)?J.parseJSON(d):d}catch(f){}J.data(a,c,d)}else d=b}return d}function F(a){var b,c,d=K[a]={};for(a=a.split(/\s+/),b=0,c=a.length;c>b;b++)d[a[b]]=!0;return d}var G=a.document,H=a.navigator,I=a.location,J=function(){function c(){if(!h.isReady){try{G.documentElement.doScroll("left")}catch(a){return void setTimeout(c,1)}h.ready()}}var d,e,f,g,h=function(a,b){return new h.fn.init(a,b,d)},i=a.jQuery,j=a.$,k=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,l=/\S/,m=/^\s+/,n=/\s+$/,o=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p=/^[\],:{}\s]*$/,q=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,r=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,s=/(?:^|:|,)(?:\s*\[)+/g,t=/(webkit)[ \/]([\w.]+)/,u=/(opera)(?:.*version)?[ \/]([\w.]+)/,v=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,x=/-([a-z]|[0-9])/gi,y=/^-ms-/,z=function(a,b){return(b+"").toUpperCase()},A=H.userAgent,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,I=Array.prototype.indexOf,J={};return h.fn=h.prototype={constructor:h,init:function(a,c,d){var e,f,g,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if("body"===a&&!c&&G.body)return this.context=G,this[0]=G.body,this.selector=a,this.length=1,this;if("string"==typeof a){if(e="<"!==a.charAt(0)||">"!==a.charAt(a.length-1)||a.length<3?k.exec(a):[null,a,null],e&&(e[1]||!c)){if(e[1])return c=c instanceof h?c[0]:c,i=c?c.ownerDocument||c:G,g=o.exec(a),g?h.isPlainObject(c)?(a=[G.createElement(g[1])],h.fn.attr.call(a,c,!0)):a=[i.createElement(g[1])]:(g=h.buildFragment([e[1]],[i]),a=(g.cacheable?h.clone(g.fragment):g.fragment).childNodes),h.merge(this,a);if(f=G.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return d.find(a);this.length=1,this[0]=f}return this.context=G,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return h.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),h.makeArray(a,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();return h.isArray(a)?D.apply(d,a):h.merge(d,a),d.prevObject=this,d.context=this.context,"find"===b?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return h.each(this,a,b)},ready:function(a){return h.bindReady(),f.add(a),this},eq:function(a){return a=+a,-1===a?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(h.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},h.fn.init.prototype=h.fn,h.extend=h.fn.extend=function(){var a,c,d,e,f,g,i=arguments[0]||{},j=1,k=arguments.length,l=!1;for("boolean"==typeof i&&(l=i,i=arguments[1]||{},j=2),"object"!=typeof i&&!h.isFunction(i)&&(i={}),k===j&&(i=this,--j);k>j;j++)if(null!=(a=arguments[j]))for(c in a)d=i[c],e=a[c],i!==e&&(l&&e&&(h.isPlainObject(e)||(f=h.isArray(e)))?(f?(f=!1,g=d&&h.isArray(d)?d:[]):g=d&&h.isPlainObject(d)?d:{},i[c]=h.extend(l,g,e)):e!==b&&(i[c]=e));return i},h.extend({noConflict:function(b){return a.$===h&&(a.$=j),b&&a.jQuery===h&&(a.jQuery=i),h},isReady:!1,readyWait:1,holdReady:function(a){a?h.readyWait++:h.ready(!0)},ready:function(a){if(a===!0&&!--h.readyWait||a!==!0&&!h.isReady){if(!G.body)return setTimeout(h.ready,1);if(h.isReady=!0,a!==!0&&--h.readyWait>0)return;f.fireWith(G,[h]),h.fn.trigger&&h(G).trigger("ready").off("ready")}},bindReady:function(){if(!f){if(f=h.Callbacks("once memory"),"complete"===G.readyState)return setTimeout(h.ready,1);if(G.addEventListener)G.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",h.ready,!1);else if(G.attachEvent){G.attachEvent("onreadystatechange",g),a.attachEvent("onload",h.ready);var b=!1;try{b=null==a.frameElement}catch(d){}G.documentElement.doScroll&&b&&c()}}},isFunction:function(a){return"function"===h.type(a)},isArray:Array.isArray||function(a){return"array"===h.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?String(a):J[B.call(a)]||"object"},isPlainObject:function(a){if(!a||"object"!==h.type(a)||a.nodeType||h.isWindow(a))return!1;try{if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||C.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){return"string"==typeof b&&b?(b=h.trim(b),a.JSON&&a.JSON.parse?a.JSON.parse(b):p.test(b.replace(q,"@").replace(r,"]").replace(s,""))?new Function("return "+b)():void h.error("Invalid JSON: "+b)):null},parseXML:function(c){if("string"!=typeof c||!c)return null;var d,e;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&h.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&l.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(y,"ms-").replace(x,z)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,i=g===b||h.isFunction(a);if(d)if(i){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;g>f&&c.apply(a[f++],d)!==!1;);else if(i){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;g>f&&c.call(a[f],f,a[f++])!==!1;);return a},trim:F?function(a){return null==a?"":F.call(a)}:function(a){return null==a?"":(a+"").replace(m,"").replace(n,"")},makeArray:function(a,b){var c=b||[];if(null!=a){var d=h.type(a);null==a.length||"string"===d||"function"===d||"regexp"===d||h.isWindow(a)?D.call(c,a):h.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(I)return I.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if("number"==typeof c.length)for(var f=c.length;f>e;e++)a[d++]=c[e];else for(;c[e]!==b;)a[d++]=c[e++];return a.length=d,a},grep:function(a,b,c){var d,e=[];c=!!c;for(var f=0,g=a.length;g>f;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],i=0,j=a.length,k=a instanceof h||j!==b&&"number"==typeof j&&(j>0&&a[0]&&a[j-1]||0===j||h.isArray(a));if(k)for(;j>i;i++)e=c(a[i],i,d),null!=e&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),null!=e&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){if("string"==typeof c){var d=a[c];c=a,a=d}if(!h.isFunction(a))return b;var e=E.call(arguments,2),f=function(){return a.apply(c,e.concat(E.call(arguments)))};return f.guid=a.guid=a.guid||f.guid||h.guid++,f},access:function(a,c,d,e,f,g,i){var j,k=null==d,l=0,m=a.length;if(d&&"object"==typeof d){for(l in d)h.access(a,c,l,d[l],1,g,e);f=1}else if(e!==b){if(j=i===b&&h.isFunction(e),k&&(j?(j=c,c=function(a,b,c){return j.call(h(a),c)}):(c.call(a,e),c=null)),c)for(;m>l;l++)c(a[l],d,j?e.call(a[l],l,c(a[l],d)):e,i);f=1}return f?a:k?c.call(a):m?c(a[0],d):g},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=t.exec(a)||u.exec(a)||v.exec(a)||a.indexOf("compatible")<0&&w.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}h.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(c,d){return d&&d instanceof h&&!(d instanceof a)&&(d=a(d)),h.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(G);return a},browser:{}}),h.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()}),e=h.uaMatch(A),e.browser&&(h.browser[e.browser]=!0,h.browser.version=e.version),h.browser.webkit&&(h.browser.safari=!0),l.test(" ")&&(m=/^[\s\xA0]+/,n=/[\s\xA0]+$/),d=h(G),G.addEventListener?g=function(){G.removeEventListener("DOMContentLoaded",g,!1),h.ready()}:G.attachEvent&&(g=function(){"complete"===G.readyState&&(G.detachEvent("onreadystatechange",g),h.ready())}),h}(),K={};J.Callbacks=function(a){a=a?K[a]||F(a):{};var c,d,e,f,g,h,i=[],j=[],k=function(b){var c,d,e,f;for(c=0,d=b.length;d>c;c++)e=b[c],f=J.type(e),"array"===f?k(e):"function"===f&&(!a.unique||!m.has(e))&&i.push(e)},l=function(b,k){for(k=k||[],c=!a.memory||[b,k],d=!0,e=!0,h=f||0,f=0,g=i.length;i&&g>h;h++)if(i[h].apply(b,k)===!1&&a.stopOnFalse){c=!0;break}e=!1,i&&(a.once?c===!0?m.disable():i=[]:j&&j.length&&(c=j.shift(),m.fireWith(c[0],c[1])))},m={add:function(){if(i){var a=i.length;k(arguments),e?g=i.length:c&&c!==!0&&(f=a,l(c[0],c[1]))}return this},remove:function(){if(i)for(var b=arguments,c=0,d=b.length;d>c;c++)for(var f=0;f=f&&(g--,h>=f&&h--),i.splice(f--,1),!a.unique));f++);return this},has:function(a){if(i)for(var b=0,c=i.length;c>b;b++)if(a===i[b])return!0;return!1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,(!c||c===!0)&&m.disable(),this},locked:function(){return!j},fireWith:function(b,d){return j&&(e?a.once||j.push([b,d]):(!a.once||!c)&&l(b,d)),this},fire:function(){return m.fireWith(this,arguments),this},fired:function(){return!!d}};return m};var L=[].slice;J.extend({Deferred:function(a){var b,c=J.Callbacks("once memory"),d=J.Callbacks("once memory"),e=J.Callbacks("memory"),f="pending",g={resolve:c,reject:d,notify:e},h={done:c.add,fail:d.add,progress:e.add,state:function(){return f},isResolved:c.fired,isRejected:d.fired,then:function(a,b,c){return i.done(a).fail(b).progress(c),this},always:function(){return i.done.apply(i,arguments).fail.apply(i,arguments),this},pipe:function(a,b,c){return J.Deferred(function(d){J.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c,e=b[0],f=b[1];J.isFunction(e)?i[a](function(){c=e.apply(this,arguments),c&&J.isFunction(c.promise)?c.promise().then(d.resolve,d.reject,d.notify):d[f+"With"](this===i?d:this,[c])}):i[a](d[f])})}).promise()},promise:function(a){if(null==a)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({});for(b in g)i[b]=g[b].fire,i[b+"With"]=g[b].fireWith;return i.done(function(){f="resolved"},d.disable,e.lock).fail(function(){f="rejected"},c.disable,e.lock),a&&a.call(i,i),i},when:function(a){function b(a){return function(b){g[a]=arguments.length>1?L.call(arguments,0):b,i.notifyWith(j,g)}}function c(a){return function(b){d[a]=arguments.length>1?L.call(arguments,0):b,--h||i.resolveWith(i,d)}}var d=L.call(arguments,0),e=0,f=d.length,g=Array(f),h=f,i=1>=f&&a&&J.isFunction(a.promise)?a:J.Deferred(),j=i.promise();if(f>1){for(;f>e;e++)d[e]&&d[e].promise&&J.isFunction(d[e].promise)?d[e].promise().then(c(e),i.reject,b(e)):--h;h||i.resolveWith(i,d)}else i!==a&&i.resolveWith(i,f?[a]:[]);return j}}),J.support=function(){var b,c,d,e,f,g,h,i,j,k,l,m=G.createElement("div");G.documentElement;if(m.setAttribute("className","t"),m.innerHTML="
              a",c=m.getElementsByTagName("*"),d=m.getElementsByTagName("a")[0],!c||!c.length||!d)return{};e=G.createElement("select"),f=e.appendChild(G.createElement("option")),g=m.getElementsByTagName("input")[0],b={leadingWhitespace:3===m.firstChild.nodeType,tbody:!m.getElementsByTagName("tbody").length,htmlSerialize:!!m.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:"/a"===d.getAttribute("href"),opacity:/^0.55/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:"on"===g.value,optSelected:f.selected,getSetAttribute:"t"!==m.className,enctype:!!G.createElement("form").enctype,html5Clone:"<:nav>"!==G.createElement("nav").cloneNode(!0).outerHTML,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},J.boxModel=b.boxModel="CSS1Compat"===G.compatMode,g.checked=!0,b.noCloneChecked=g.cloneNode(!0).checked,e.disabled=!0,b.optDisabled=!f.disabled;try{delete m.test}catch(n){b.deleteExpando=!1}if(!m.addEventListener&&m.attachEvent&&m.fireEvent&&(m.attachEvent("onclick",function(){b.noCloneEvent=!1}),m.cloneNode(!0).fireEvent("onclick")),g=G.createElement("input"),g.value="t",g.setAttribute("type","radio"),b.radioValue="t"===g.value,g.setAttribute("checked","checked"),g.setAttribute("name","t"),m.appendChild(g),h=G.createDocumentFragment(),h.appendChild(m.lastChild),b.checkClone=h.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=g.checked,h.removeChild(g),h.appendChild(m),m.attachEvent)for(k in{submit:1,change:1,focusin:1})j="on"+k,l=j in m,l||(m.setAttribute(j,"return;"),l="function"==typeof m[j]),b[k+"Bubbles"]=l;return h.removeChild(m),h=e=f=m=g=null,J(function(){var c,d,e,f,g,h,j,k,n,o,p,q,r=G.getElementsByTagName("body")[0];!r||(j=1,q="padding:0;margin:0;border:",o="position:absolute;top:0;left:0;width:1px;height:1px;",p=q+"0;visibility:hidden;",k="style='"+o+q+"5px solid #000;",n="
              ",c=G.createElement("div"),c.style.cssText=p+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(c,r.firstChild),m=G.createElement("div"),c.appendChild(m),m.innerHTML="
              t
              ",i=m.getElementsByTagName("td"),l=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",b.reliableHiddenOffsets=l&&0===i[0].offsetHeight,a.getComputedStyle&&(m.innerHTML="",h=G.createElement("div"),h.style.width="0",h.style.marginRight="0",m.style.width="2px",m.appendChild(h),b.reliableMarginRight=0===(parseInt((a.getComputedStyle(h,null)||{marginRight:0}).marginRight,10)||0)),"undefined"!=typeof m.style.zoom&&(m.innerHTML="",m.style.width=m.style.padding="1px",m.style.border=0,m.style.overflow="hidden",m.style.display="inline",m.style.zoom=1,b.inlineBlockNeedsLayout=3===m.offsetWidth,m.style.display="block",m.style.overflow="visible",m.innerHTML="
              ",b.shrinkWrapBlocks=3!==m.offsetWidth),m.style.cssText=o+p,m.innerHTML=n,d=m.firstChild,e=d.firstChild,f=d.nextSibling.firstChild.firstChild,g={doesNotAddBorder:5!==e.offsetTop,doesAddBorderForTableAndCells:5===f.offsetTop},e.style.position="fixed",e.style.top="20px",g.fixedPosition=20===e.offsetTop||15===e.offsetTop,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",g.subtractsBorderForOverflowNotVisible=-5===e.offsetTop,g.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,a.getComputedStyle&&(m.style.marginTop="1%",b.pixelMargin="1%"!==(a.getComputedStyle(m,null)||{marginTop:0}).marginTop),"undefined"!=typeof c.style.zoom&&(c.style.zoom=1),r.removeChild(c),h=m=c=null,J.extend(b,g))}),b}();var M=/^(?:\{.*\}|\[.*\])$/,N=/([A-Z])/g;J.extend({cache:{},uuid:0,expando:"jQuery"+(J.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?J.cache[a[J.expando]]:a[J.expando],!!a&&!D(a)},data:function(a,c,d,e){if(J.acceptData(a)){var f,g,h,i=J.expando,j="string"==typeof c,k=a.nodeType,l=k?J.cache:a,m=k?a[i]:a[i]&&i,n="events"===c;if((!m||!l[m]||!n&&!e&&!l[m].data)&&j&&d===b)return;return m||(k?a[i]=m=++J.uuid:m=i),l[m]||(l[m]={},k||(l[m].toJSON=J.noop)),("object"==typeof c||"function"==typeof c)&&(e?l[m]=J.extend(l[m],c):l[m].data=J.extend(l[m].data,c)),f=g=l[m],e||(g.data||(g.data={}),g=g.data),d!==b&&(g[J.camelCase(c)]=d),n&&!g[c]?f.events:(j?(h=g[c],null==h&&(h=g[J.camelCase(c)])):h=g,h)}},removeData:function(a,b,c){if(J.acceptData(a)){var d,e,f,g=J.expando,h=a.nodeType,i=h?J.cache:a,j=h?a[g]:g;if(!i[j])return;if(b&&(d=c?i[j]:i[j].data)){J.isArray(b)||(b in d?b=[b]:(b=J.camelCase(b),b=b in d?[b]:b.split(" ")));for(e=0,f=b.length;f>e;e++)delete d[b[e]];if(!(c?D:J.isEmptyObject)(d))return}if(!c&&(delete i[j].data,!D(i[j])))return;J.support.deleteExpando||!i.setInterval?delete i[j]:i[j]=null,h&&(J.support.deleteExpando?delete a[g]:a.removeAttribute?a.removeAttribute(g):a[g]=null)}},_data:function(a,b,c){return J.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=J.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),J.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length&&(k=J.data(i),1===i.nodeType&&!J._data(i,"parsedAttrs"))){for(f=i.attributes,h=f.length;h>j;j++)g=f[j].name,0===g.indexOf("data-")&&(g=J.camelCase(g.substring(5)),E(i,g,k[g]));J._data(i,"parsedAttrs",!0)}return k}return"object"==typeof a?this.each(function(){J.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",J.access(this,function(c){return c===b?(k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=J.data(i,a),k=E(i,a,k)),k===b&&d[1]?this.data(d[0]):k):(d[1]=c,void this.each(function(){var b=J(this);b.triggerHandler("setData"+e,d),J.data(this,a,c),b.triggerHandler("changeData"+e,d)}))},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){J.removeData(this,a)})}}),J.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",J._data(a,b,(J._data(a,b)||0)+1))},_unmark:function(a,b,c){if(a!==!0&&(c=b,b=a,a=!1),b){c=c||"fx";var d=c+"mark",e=a?0:(J._data(b,d)||1)-1;e?J._data(b,d,e):(J.removeData(b,d,!0),C(b,c,"mark"))}},queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=J._data(a,b),c&&(!d||J.isArray(c)?d=J._data(a,b,J.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=J.queue(a,b),d=c.shift(),e={};"inprogress"===d&&(d=c.shift()),d&&("fx"===b&&c.unshift("inprogress"),J._data(a,b+".run",e),d.call(a,function(){J.dequeue(a,b)},e)),c.length||(J.removeData(a,b+"queue "+b+".run",!0),C(a,b,"queue"))}}),J.fn.extend({queue:function(a,c){var d=2;return"string"!=typeof a&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){J.removeAttr(this,a)})},prop:function(a,b){return J.access(this,J.prop,a,b,arguments.length>1)},removeProp:function(a){return a=J.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(J.isFunction(a))return this.each(function(b){J(this).addClass(a.call(this,b,this.className))});if(a&&"string"==typeof a)for(b=a.split(S),c=0,d=this.length;d>c;c++)if(e=this[c],1===e.nodeType)if(e.className||1!==b.length){for(f=" "+e.className+" ",g=0,h=b.length;h>g;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=J.trim(f)}else e.className=a;return this},removeClass:function(a){var c,d,e,f,g,h,i;if(J.isFunction(a))return this.each(function(b){J(this).removeClass(a.call(this,b,this.className))});if(a&&"string"==typeof a||a===b)for(c=(a||"").split(S),d=0,e=this.length;e>d;d++)if(f=this[d],1===f.nodeType&&f.className)if(a){for(g=(" "+f.className+" ").replace(R," "),h=0,i=c.length;i>h;h++)g=g.replace(" "+c[h]+" "," ");f.className=J.trim(g)}else f.className="";return this},toggleClass:function(a,b){var c=typeof a,d="boolean"==typeof b;return J.isFunction(a)?this.each(function(c){J(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===c)for(var e,f=0,g=J(this),h=b,i=a.split(S);e=i[f++];)h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e);else("undefined"===c||"boolean"===c)&&(this.className&&J._data(this,"__className__",this.className),this.className=this.className||a===!1?"":J._data(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(R," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];return arguments.length?(e=J.isFunction(a),this.each(function(d){var f,g=J(this);1===this.nodeType&&(f=e?a.call(this,d,g.val()):a,null==f?f="":"number"==typeof f?f+="":J.isArray(f)&&(f=J.map(f,function(a){return null==a?"":a+""})),c=J.valHooks[this.type]||J.valHooks[this.nodeName.toLowerCase()],c&&"set"in c&&c.set(this,f,"value")!==b||(this.value=f))})):f?(c=J.valHooks[f.type]||J.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,"string"==typeof d?d.replace(T,""):null==d?"":d)):void 0}}),J.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i="select-one"===a.type;if(0>f)return null;for(c=i?f:0,d=i?f+1:h.length;d>c;c++)if(e=h[c],e.selected&&(J.support.optDisabled?!e.disabled:null===e.getAttribute("disabled"))&&(!e.parentNode.disabled||!J.nodeName(e.parentNode,"optgroup"))){if(b=J(e).val(),i)return b;g.push(b)}return i&&!g.length&&h.length?J(h[f]).val():g},set:function(a,b){var c=J.makeArray(b);return J(a).find("option").each(function(){this.selected=J.inArray(J(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;return a&&3!==i&&8!==i&&2!==i?e&&c in J.attrFn?J(a)[c](d):"undefined"==typeof a.getAttribute?J.prop(a,c,d):(h=1!==i||!J.isXMLDoc(a),h&&(c=c.toLowerCase(),g=J.attrHooks[c]||(X.test(c)?P:O)),d!==b?null===d?void J.removeAttr(a,c):g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d):g&&"get"in g&&h&&null!==(f=g.get(a,c))?f:(f=a.getAttribute(c),null===f?b:f)):void 0},removeAttr:function(a,b){var c,d,e,f,g,h=0;if(b&&1===a.nodeType)for(d=b.toLowerCase().split(S),f=d.length;f>h;h++)e=d[h],e&&(c=J.propFix[e]||e,g=X.test(e),g||J.attr(a,e,""),a.removeAttribute(Y?e:c),g&&c in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(U.test(a.nodeName)&&a.parentNode)J.error("type property can't be changed");else if(!J.support.radioValue&&"radio"===b&&J.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return O&&J.nodeName(a,"button")?O.get(a,b):b in a?a.value:null},set:function(a,b,c){return O&&J.nodeName(a,"button")?O.set(a,b,c):void(a.value=b)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;return a&&3!==h&&8!==h&&2!==h?(g=1!==h||!J.isXMLDoc(a),g&&(c=J.propFix[c]||c,f=J.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&null!==(e=f.get(a,c))?e:a[c]):void 0},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):V.test(a.nodeName)||W.test(a.nodeName)&&a.href?0:b}}}}),J.attrHooks.tabindex=J.propHooks.tabIndex,P={get:function(a,c){var d,e=J.prop(a,c);return e===!0||"boolean"!=typeof e&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?J.removeAttr(a,c):(d=J.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},Y||(Q={name:!0,id:!0,coords:!0},O=J.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(Q[c]?""!==d.nodeValue:d.specified)?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=G.createAttribute(c),a.setAttributeNode(d)),d.nodeValue=b+""}},J.attrHooks.tabindex.set=O.set,J.each(["width","height"],function(a,b){J.attrHooks[b]=J.extend(J.attrHooks[b],{set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}})}),J.attrHooks.contenteditable={get:O.get,set:function(a,b,c){""===b&&(b="false"),O.set(a,b,c)}}),J.support.hrefNormalized||J.each(["href","src","width","height"],function(a,c){J.attrHooks[c]=J.extend(J.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return null===d?b:d}})}),J.support.style||(J.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),J.support.optSelected||(J.propHooks.selected=J.extend(J.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),J.support.enctype||(J.propFix.enctype="encoding"),J.support.checkOn||J.each(["radio","checkbox"],function(){J.valHooks[this]={get:function(a){return null===a.getAttribute("value")?"on":a.value}}}),J.each(["radio","checkbox"],function(){J.valHooks[this]=J.extend(J.valHooks[this],{set:function(a,b){return J.isArray(b)?a.checked=J.inArray(J(a).val(),b)>=0:void 0; +}})});var Z=/^(?:textarea|input|select)$/i,$=/^([^\.]*)?(?:\.(.+))?$/,_=/(?:^|\s)hover(\.\S+)?\b/,aa=/^key/,ba=/^(?:mouse|contextmenu)|click/,ca=/^(?:focusinfocus|focusoutblur)$/,da=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,ea=function(a){var b=da.exec(a);return b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)")),b},fa=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},ga=function(a){return J.event.special.hover?a:a.replace(_,"mouseenter$1 mouseleave$1")};J.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;if(3!==a.nodeType&&8!==a.nodeType&&c&&d&&(g=J._data(a))){for(d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=J.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return"undefined"==typeof J||a&&J.event.triggered===a.type?b:J.event.dispatch.apply(h.elem,arguments)},h.elem=a),c=J.trim(ga(c)).split(" "),j=0;j=0&&(q=q.slice(0,-1),h=!0),q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),(!e||J.event.customEvent[q])&&!J.event.global[q])return;if(c="object"==typeof c?c[J.expando]?c:new J.Event(q,c):new J.Event(q),c.type=q,c.isTrigger=!0,c.exclusive=h,c.namespace=r.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,l=q.indexOf(":")<0?"on"+q:"",!e){g=J.cache;for(i in g)g[i].events&&g[i].events[q]&&J.event.trigger(c,d,g[i].handle.elem,!0);return}if(c.result=b,c.target||(c.target=e),d=null!=d?J.makeArray(d):[],d.unshift(c),m=J.event.special[q]||{},m.trigger&&m.trigger.apply(e,d)===!1)return;if(o=[[e,m.bindType||q]],!f&&!m.noBubble&&!J.isWindow(e)){for(p=m.delegateType||q,j=ca.test(p+q)?e:e.parentNode,k=null;j;j=j.parentNode)o.push([j,p]),k=j;k&&k===e.ownerDocument&&o.push([k.defaultView||k.parentWindow||a,p])}for(i=0;id;d++)l=n[d],m=l.selector,i[m]===b&&(i[m]=l.quick?fa(f,l.quick):g.is(m)),i[m]&&k.push(l);k.length&&s.push({elem:f,matches:k})}for(n.length>o&&s.push({elem:this,matches:n.slice(o)}),d=0;d0?this.on(b,null,a,c):this.trigger(b)},J.attrFn&&(J.attrFn[b]=!0),aa.test(b)&&(J.event.fixHooks[b]=J.event.keyHooks),ba.test(b)&&(J.event.fixHooks[b]=J.event.mouseHooks)}),function(){function a(a,b,c,d,f,g){for(var h=0,i=d.length;i>h;h++){var j=d[h];if(j){var k=!1;for(j=j[a];j;){if(j[e]===c){k=d[j.sizset];break}if(1===j.nodeType)if(g||(j[e]=c,j.sizset=h),"string"!=typeof b){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}j=j[a]}d[h]=k}}}function c(a,b,c,d,f,g){for(var h=0,i=d.length;i>h;h++){var j=d[h];if(j){var k=!1;for(j=j[a];j;){if(j[e]===c){k=d[j.sizset];break}if(1===j.nodeType&&!g&&(j[e]=c,j.sizset=h),j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}d[h]=k}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),f=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){return i=!1,0});var m=function(a,b,c,e){c=c||[],b=b||G;var f=b;if(1!==b.nodeType&&9!==b.nodeType)return[];if(!a||"string"!=typeof a)return c;var h,i,j,k,l,n,q,r,t=!0,u=m.isXML(b),v=[],x=a;do if(d.exec(""),h=d.exec(x),h&&(x=h[3],v.push(h[1]),h[2])){k=h[3];break}while(h);if(v.length>1&&p.exec(a))if(2===v.length&&o.relative[v[0]])i=w(v[0]+v[1],b,e);else for(i=o.relative[v[0]]?[b]:m(v.shift(),b);v.length;)a=v.shift(),o.relative[a]&&(a+=v.shift()),i=w(a,i,e);else if(!e&&v.length>1&&9===b.nodeType&&!u&&o.match.ID.test(v[0])&&!o.match.ID.test(v[v.length-1])&&(l=m.find(v.shift(),b,u),b=l.expr?m.filter(l.expr,l.set)[0]:l.set[0]),b)for(l=e?{expr:v.pop(),set:s(e)}:m.find(v.pop(),1!==v.length||"~"!==v[0]&&"+"!==v[0]||!b.parentNode?b:b.parentNode,u),i=l.expr?m.filter(l.expr,l.set):l.set,v.length>0?j=s(i):t=!1;v.length;)n=v.pop(),q=n,o.relative[n]?q=v.pop():n="",null==q&&(q=b),o.relative[n](j,q,u);else j=v=[];if(j||(j=i),j||m.error(n||a),"[object Array]"===g.call(j))if(t)if(b&&1===b.nodeType)for(r=0;null!=j[r];r++)j[r]&&(j[r]===!0||1===j[r].nodeType&&m.contains(b,j[r]))&&c.push(i[r]);else for(r=0;null!=j[r];r++)j[r]&&1===j[r].nodeType&&c.push(i[r]);else c.push.apply(c,j);else s(j,c);return k&&(m(k,f,c,e),m.uniqueSort(c)),c};m.uniqueSort=function(a){if(u&&(h=i,a.sort(u),h))for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;f>e;e++)if(h=o.order[e],(g=o.leftMatch[h].exec(a))&&(i=g[1],g.splice(1,1),"\\"!==i.substr(i.length-1)&&(g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c),null!=d))){a=a.replace(o.match[h],"");break}return d||(d="undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]),{set:d,expr:a}},m.filter=function(a,c,d,e){for(var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);a&&c.length;){for(h in o.filter)if(null!=(f=o.leftMatch[h].exec(a))&&f[2]){if(k=o.filter[h],l=f[1],g=!1,f.splice(1,1),"\\"===l.substr(l.length-1))continue;if(s===r&&(r=[]),o.preFilter[h])if(f=o.preFilter[h](f,s,d,r,e,t)){if(f===!0)continue}else g=i=!0;if(f)for(n=0;null!=(j=s[n]);n++)j&&(i=k(j,f,n,s),p=e^i,d&&null!=i?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){if(d||(s=r),a=a.replace(o.match[h],""),!g)return[];break}}if(a===q){if(null!=g)break;m.error(a)}q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(1===d||9===d||11===d){if("string"==typeof a.textContent)return a.textContent;if("string"==typeof a.innerText)return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(3===d||4===d)return a.nodeValue}else for(b=0;c=a[b];b++)8!==c.nodeType&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c="string"==typeof b,d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f,g=0,h=a.length;h>g;g++)if(f=a[g]){for(;(f=f.previousSibling)&&1!==f.nodeType;);a[g]=e||f&&f.nodeName.toLowerCase()===b?f||!1:f===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d="string"==typeof b,e=0,f=a.length;if(d&&!l.test(b)){for(b=b.toLowerCase();f>e;e++)if(c=a[e]){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}else{for(;f>e;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(b,d,e){var g,h=f++,i=a;"string"==typeof d&&!l.test(d)&&(d=d.toLowerCase(),g=d,i=c),i("parentNode",d,h,b,g,e)},"~":function(b,d,e){var g,h=f++,i=a;"string"==typeof d&&!l.test(d)&&(d=d.toLowerCase(),g=d,i=c),i("previousSibling",d,h,b,g,e)}},find:{ID:function(a,b,c){if("undefined"!=typeof b.getElementById&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if("undefined"!=typeof b.getElementsByName){for(var c=[],d=b.getElementsByName(a[1]),e=0,f=d.length;f>e;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return 0===c.length?null:c}},TAG:function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a[1]):void 0}},preFilter:{CLASS:function(a,b,c,d,e,f){if(a=" "+a[1].replace(j,"")+" ",f)return a;for(var g,h=0;null!=(g=b[h]);h++)g&&(e^(g.className&&(" "+g.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(g):c&&(b[h]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if("nth"===a[1]){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===a[2]&&"2n"||"odd"===a[2]&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);return a[0]=f++,a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");return!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),"~="===a[2]&&(a[4]=" "+a[4]+" "),a},PSEUDO:function(a,b,c,e,f){if("not"===a[1]){if(!((d.exec(a[3])||"").length>1||/^\w/.test(a[3]))){var g=m.filter(a[3],b,c,!0^f);return c||e.push.apply(e,g),!1}a[3]=m(a[3],null,null,b)}else if(o.match.POS.test(a[0])||o.match.CHILD.test(a[0]))return!0;return a},POS:function(a){return a.unshift(!0),a}},filters:{enabled:function(a){return a.disabled===!1&&"hidden"!==a.type},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"input"===a.nodeName.toLowerCase()&&"text"===c&&(b===c||null===b)},radio:function(a){return"input"===a.nodeName.toLowerCase()&&"radio"===a.type},checkbox:function(a){return"input"===a.nodeName.toLowerCase()&&"checkbox"===a.type},file:function(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type},password:function(a){return"input"===a.nodeName.toLowerCase()&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"submit"===a.type},image:function(a){return"input"===a.nodeName.toLowerCase()&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return 0===b},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if("contains"===e)return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if("not"===e){for(var g=b[3],h=0,i=g.length;i>h;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,d,f,g,h,i,j=b[1],k=a;switch(j){case"only":case"first":for(;k=k.previousSibling;)if(1===k.nodeType)return!1;if("first"===j)return!0;k=a;case"last":for(;k=k.nextSibling;)if(1===k.nodeType)return!1;return!0;case"nth":if(c=b[2],d=b[3],1===c&&0===d)return!0;if(f=b[0],g=a.parentNode,g&&(g[e]!==f||!a.nodeIndex)){for(h=0,k=g.firstChild;k;k=k.nextSibling)1===k.nodeType&&(k.nodeIndex=++h);g[e]=f}return i=a.nodeIndex-d,0===c?0===i:i%c===0&&i/c>=0}},ID:function(a,b){return 1===a.nodeType&&a.getAttribute("id")===b},TAG:function(a,b){return"*"===b&&1===a.nodeType||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return null==d?"!="===f:!f&&m.attr?null!=d:"="===f?e===g:"*="===f?e.indexOf(g)>=0:"~="===f?(" "+e+" ").indexOf(g)>=0:g?"!="===f?e!==g:"^="===f?0===e.indexOf(g):"$="===f?e.substr(e.length-g.length)===g:"|="===f?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];return f?f(a,c,b,d):void 0}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){return a=Array.prototype.slice.call(a,0),b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(G.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if("[object Array]"===g.call(a))Array.prototype.push.apply(d,a);else if("number"==typeof a.length)for(var e=a.length;e>c;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;G.documentElement.compareDocumentPosition?u=function(a,b){return a===b?(h=!0,0):a.compareDocumentPosition&&b.compareDocumentPosition?4&a.compareDocumentPosition(b)?-1:1:a.compareDocumentPosition?-1:1}:(u=function(a,b){if(a===b)return h=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;for(;j;)e.unshift(j),j=j.parentNode;for(j=i;j;)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;c>k&&d>k;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;for(var d=a.nextSibling;d;){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=G.createElement("div"),c="script"+(new Date).getTime(),d=G.documentElement;a.innerHTML="",d.insertBefore(a,d.firstChild),G.getElementById(c)&&(o.find.ID=function(a,c,d){if("undefined"!=typeof c.getElementById&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||"undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&c&&c.nodeValue===b}),d.removeChild(a),d=a=null}(),function(){var a=G.createElement("div");a.appendChild(G.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if("*"===a[1]){for(var d=[],e=0;c[e];e++)1===c[e].nodeType&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&"undefined"!=typeof a.firstChild.getAttribute&&"#"!==a.firstChild.getAttribute("href")&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),G.querySelectorAll&&function(){var a=m,b=G.createElement("div"),c="__sizzle__";if(b.innerHTML="

              ",!b.querySelectorAll||0!==b.querySelectorAll(".TEST").length){m=function(b,d,e,f){if(d=d||G,!f&&!m.isXML(d)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(g&&(1===d.nodeType||9===d.nodeType)){if(g[1])return s(d.getElementsByTagName(b),e);if(g[2]&&o.find.CLASS&&d.getElementsByClassName)return s(d.getElementsByClassName(g[2]),e)}if(9===d.nodeType){if("body"===b&&d.body)return s([d.body],e);if(g&&g[3]){var h=d.getElementById(g[3]);if(!h||!h.parentNode)return s([],e);if(h.id===g[3])return s([h],e)}try{return s(d.querySelectorAll(b),e)}catch(i){}}else if(1===d.nodeType&&"object"!==d.nodeName.toLowerCase()){var j=d,k=d.getAttribute("id"),l=k||c,n=d.parentNode,p=/^\s*[+~]/.test(b);k?l=l.replace(/'/g,"\\$&"):d.setAttribute("id",l),p&&n&&(d=d.parentNode);try{if(!p||n)return s(d.querySelectorAll("[id='"+l+"'] "+b),e)}catch(q){}finally{k||j.removeAttribute("id")}}}return a(b,d,e,f)};for(var d in a)m[d]=a[d];b=null}}(),function(){var a=G.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(G.createElement("div"),"div"),d=!1;try{b.call(G.documentElement,"[test!='']:sizzle")}catch(e){d=!0}m.matchesSelector=function(a,e){if(e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!m.isXML(a))try{if(d||!o.match.PSEUDO.test(e)&&!/!=/.test(e)){var f=b.call(a,e);if(f||!c||a.document&&11!==a.document.nodeType)return f}}catch(g){}return m(e,null,null,[a]).length>0}}}(),function(){var a=G.createElement("div");if(a.innerHTML="
              ",a.getElementsByClassName&&0!==a.getElementsByClassName("e").length){if(a.lastChild.className="e",1===a.getElementsByClassName("e").length)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){return"undefined"==typeof b.getElementsByClassName||c?void 0:b.getElementsByClassName(a[1])},a=null}}(),G.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:G.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(16&a.compareDocumentPosition(b))}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?"HTML"!==b.nodeName:!1};var w=function(a,b,c){for(var d,e=[],f="",g=b.nodeType?[b]:b;d=o.match.PSEUDO.exec(a);)f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;i>h;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=J.attr,m.selectors.attrMap={},J.find=m,J.expr=m.selectors,J.expr[":"]=J.expr.filters,J.unique=m.uniqueSort,J.text=m.getText,J.isXMLDoc=m.isXML,J.contains=m.contains}();var ha=/Until$/,ia=/^(?:parents|prevUntil|prevAll)/,ja=/,/,ka=/^.[^:#\[\.,]*$/,la=Array.prototype.slice,ma=J.expr.match.globalPOS,na={children:!0,contents:!0,next:!0,prev:!0};J.fn.extend({find:function(a){var b,c,d=this;if("string"!=typeof a)return J(a).filter(function(){for(b=0,c=d.length;c>b;b++)if(J.contains(d[b],this))return!0});var e,f,g,h=this.pushStack("","find",a);for(b=0,c=this.length;c>b;b++)if(e=h.length,J.find(a,this[b],h),b>0)for(f=e;fg;g++)if(h[g]===h[f]){h.splice(f--,1);break}return h},has:function(a){var b=J(a);return this.filter(function(){for(var a=0,c=b.length;c>a;a++)if(J.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(y(this,a,!1),"not",a)},filter:function(a){return this.pushStack(y(this,a,!0),"filter",a)},is:function(a){return!!a&&("string"==typeof a?ma.test(a)?J(a,this.context).index(this[0])>=0:J.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d,e=[],f=this[0];if(J.isArray(a)){for(var g=1;f&&f.ownerDocument&&f!==b;){for(c=0;cc;c++)for(f=this[c];f;){if(h?h.index(f)>-1:J.find.matchesSelector(f,a)){e.push(f);break}if(f=f.parentNode,!f||!f.ownerDocument||f===b||11===f.nodeType)break}return e=e.length>1?J.unique(e):e,this.pushStack(e,"closest",a)},index:function(a){return a?"string"==typeof a?J.inArray(this[0],J(a)):J.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c="string"==typeof a?J(a,b):J.makeArray(a&&a.nodeType?[a]:a),d=J.merge(this.get(),c);return this.pushStack(z(c[0])||z(d[0])?d:J.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),J.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return J.dir(a,"parentNode")},parentsUntil:function(a,b,c){return J.dir(a,"parentNode",c)},next:function(a){return J.nth(a,2,"nextSibling")},prev:function(a){return J.nth(a,2,"previousSibling")},nextAll:function(a){return J.dir(a,"nextSibling")},prevAll:function(a){return J.dir(a,"previousSibling")},nextUntil:function(a,b,c){return J.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return J.dir(a,"previousSibling",c)},siblings:function(a){return J.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return J.sibling(a.firstChild)},contents:function(a){return J.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:J.makeArray(a.childNodes)}},function(a,b){J.fn[a]=function(c,d){var e=J.map(this,b,c);return ha.test(a)||(d=c),d&&"string"==typeof d&&(e=J.filter(d,e)),e=this.length>1&&!na[a]?J.unique(e):e,(this.length>1||ja.test(d))&&ia.test(a)&&(e=e.reverse()),this.pushStack(e,a,la.call(arguments).join(","))}}),J.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),1===b.length?J.find.matchesSelector(b[0],a)?[b[0]]:[]:J.find.matches(a,b)},dir:function(a,c,d){for(var e=[],f=a[c];f&&9!==f.nodeType&&(d===b||1!==f.nodeType||!J(f).is(d));)1===f.nodeType&&e.push(f),f=f[c];return e},nth:function(a,b,c,d){b=b||1;for(var e=0;a&&(1!==a.nodeType||++e!==b);a=a[c]);return a},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var oa="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",pa=/ jQuery\d+="(?:\d+|null)"/g,qa=/^\s+/,ra=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,sa=/<([\w:]+)/,ta=/
              ","
              "],tr:[2,"","
              "],td:[3,"","
              "],col:[2,"","
              "],area:[1,"",""],_default:[0,"",""]},Ca=x(G);Ba.optgroup=Ba.option,Ba.tbody=Ba.tfoot=Ba.colgroup=Ba.caption=Ba.thead,Ba.th=Ba.td,J.support.htmlSerialize||(Ba._default=[1,"div
              ","
              "]),J.fn.extend({text:function(a){return J.access(this,function(a){return a===b?J.text(this):this.empty().append((this[0]&&this[0].ownerDocument||G).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(J.isFunction(a))return this.each(function(b){J(this).wrapAll(a.call(this,b))});if(this[0]){var b=J(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild; +return a}).append(this)}return this},wrapInner:function(a){return J.isFunction(a)?this.each(function(b){J(this).wrapInner(a.call(this,b))}):this.each(function(){var b=J(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=J.isFunction(a);return this.each(function(c){J(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){J.nodeName(this,"body")||J(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=J.clean(arguments);return a.push.apply(a,this.toArray()),this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);return a.push.apply(a,J.clean(arguments)),a}},remove:function(a,b){for(var c,d=0;null!=(c=this[d]);d++)(!a||J.filter(a,[c]).length)&&(!b&&1===c.nodeType&&(J.cleanData(c.getElementsByTagName("*")),J.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)for(1===a.nodeType&&J.cleanData(a.getElementsByTagName("*"));a.firstChild;)a.removeChild(a.firstChild);return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return J.clone(this,a,b)})},html:function(a){return J.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return 1===c.nodeType?c.innerHTML.replace(pa,""):null;if("string"==typeof a&&!va.test(a)&&(J.support.leadingWhitespace||!qa.test(a))&&!Ba[(sa.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ra,"<$1>");try{for(;e>d;d++)c=this[d]||{},1===c.nodeType&&(J.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return this[0]&&this[0].parentNode?J.isFunction(a)?this.each(function(b){var c=J(this),d=c.html();c.replaceWith(a.call(this,b,d))}):("string"!=typeof a&&(a=J(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;J(this).remove(),b?J(b).before(a):J(c).append(a)})):this.length?this.pushStack(J(J.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,f,g,h,i=a[0],j=[];if(!J.support.checkClone&&3===arguments.length&&"string"==typeof i&&ya.test(i))return this.each(function(){J(this).domManip(a,c,d,!0)});if(J.isFunction(i))return this.each(function(e){var f=J(this);a[0]=i.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){if(h=i&&i.parentNode,e=J.support.parentNode&&h&&11===h.nodeType&&h.childNodes.length===this.length?{fragment:h}:J.buildFragment(a,this,j),g=e.fragment,f=1===g.childNodes.length?g=g.firstChild:g.firstChild,f){c=c&&J.nodeName(f,"tr");for(var k=0,l=this.length,m=l-1;l>k;k++)d.call(c?w(this[k],f):this[k],e.cacheable||l>1&&m>k?J.clone(g,!0,!0):g)}j.length&&J.each(j,function(a,b){b.src?J.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):J.globalEval((b.text||b.textContent||b.innerHTML||"").replace(Aa,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),J.buildFragment=function(a,b,c){var d,e,f,g,h=a[0];return b&&b[0]&&(g=b[0].ownerDocument||b[0]),g.createDocumentFragment||(g=G),1===a.length&&"string"==typeof h&&h.length<512&&g===G&&"<"===h.charAt(0)&&!wa.test(h)&&(J.support.checkClone||!ya.test(h))&&(J.support.html5Clone||!xa.test(h))&&(e=!0,f=J.fragments[h],f&&1!==f&&(d=f)),d||(d=g.createDocumentFragment(),J.clean(a,g,d,c)),e&&(J.fragments[h]=f?d:1),{fragment:d,cacheable:e}},J.fragments={},J.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){J.fn[a]=function(c){var d=[],e=J(c),f=1===this.length&&this[0].parentNode;if(f&&11===f.nodeType&&1===f.childNodes.length&&1===e.length)return e[b](this[0]),this;for(var g=0,h=e.length;h>g;g++){var i=(g>0?this.clone(!0):this).get();J(e[g])[b](i),d=d.concat(i)}return this.pushStack(d,a,e.selector)}}),J.extend({clone:function(a,b,c){var d,e,f,g=J.support.html5Clone||J.isXMLDoc(a)||!xa.test("<"+a.nodeName+">")?a.cloneNode(!0):q(a);if(!(J.support.noCloneEvent&&J.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||J.isXMLDoc(a)))for(u(a,g),d=t(a),e=t(g),f=0;d[f];++f)e[f]&&u(d[f],e[f]);if(b&&(v(a,g),c))for(d=t(a),e=t(g),f=0;d[f];++f)v(d[f],e[f]);return d=e=null,g},clean:function(a,b,c,d){var e,f,g,h=[];b=b||G,"undefined"==typeof b.createElement&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||G);for(var i,j=0;null!=(i=a[j]);j++)if("number"==typeof i&&(i+=""),i){if("string"==typeof i)if(ua.test(i)){i=i.replace(ra,"<$1>");var k,l=(sa.exec(i)||["",""])[1].toLowerCase(),m=Ba[l]||Ba._default,n=m[0],o=b.createElement("div"),p=Ca.childNodes;for(b===G?Ca.appendChild(o):x(b).appendChild(o),o.innerHTML=m[1]+i+m[2];n--;)o=o.lastChild;if(!J.support.tbody){var q=ta.test(i),s="table"!==l||q?""!==m[1]||q?[]:o.childNodes:o.firstChild&&o.firstChild.childNodes;for(g=s.length-1;g>=0;--g)J.nodeName(s[g],"tbody")&&!s[g].childNodes.length&&s[g].parentNode.removeChild(s[g])}!J.support.leadingWhitespace&&qa.test(i)&&o.insertBefore(b.createTextNode(qa.exec(i)[0]),o.firstChild),i=o.childNodes,o&&(o.parentNode.removeChild(o),p.length>0&&(k=p[p.length-1],k&&k.parentNode&&k.parentNode.removeChild(k)))}else i=b.createTextNode(i);var t;if(!J.support.appendChecked)if(i[0]&&"number"==typeof(t=i.length))for(g=0;t>g;g++)r(i[g]);else r(i);i.nodeType?h.push(i):h=J.merge(h,i)}if(c)for(e=function(a){return!a.type||za.test(a.type)},j=0;h[j];j++)if(f=h[j],d&&J.nodeName(f,"script")&&(!f.type||za.test(f.type)))d.push(f.parentNode?f.parentNode.removeChild(f):f);else{if(1===f.nodeType){var u=J.grep(f.getElementsByTagName("script"),e);h.splice.apply(h,[j+1,0].concat(u))}c.appendChild(f)}return h},cleanData:function(a){for(var b,c,d,e=J.cache,f=J.event.special,g=J.support.deleteExpando,h=0;null!=(d=a[h]);h++)if((!d.nodeName||!J.noData[d.nodeName.toLowerCase()])&&(c=d[J.expando])){if(b=e[c],b&&b.events){for(var i in b.events)f[i]?J.event.remove(d,i):J.removeEvent(d,i,b.handle);b.handle&&(b.handle.elem=null)}g?delete d[J.expando]:d.removeAttribute&&d.removeAttribute(J.expando),delete e[c]}}});var Da,Ea,Fa,Ga=/alpha\([^)]*\)/i,Ha=/opacity=([^)]*)/,Ia=/([A-Z]|^ms)/g,Ja=/^[\-+]?(?:\d*\.)?\d+$/i,Ka=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,La=/^([\-+])=([\-+.\de]+)/,Ma=/^margin/,Na={position:"absolute",visibility:"hidden",display:"block"},Oa=["Top","Right","Bottom","Left"];J.fn.css=function(a,c){return J.access(this,function(a,c,d){return d!==b?J.style(a,c,d):J.css(a,c)},a,c,arguments.length>1)},J.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Da(a,"opacity");return""===c?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":J.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g,h=J.camelCase(c),i=a.style,j=J.cssHooks[h];if(c=J.cssProps[h]||h,d===b)return j&&"get"in j&&(f=j.get(a,!1,e))!==b?f:i[c];if(g=typeof d,"string"===g&&(f=La.exec(d))&&(d=+(f[1]+1)*+f[2]+parseFloat(J.css(a,c)),g="number"),null==d||"number"===g&&isNaN(d))return;if("number"===g&&!J.cssNumber[h]&&(d+="px"),!(j&&"set"in j&&(d=j.set(a,d))===b))try{i[c]=d}catch(k){}}},css:function(a,c,d){var e,f;return c=J.camelCase(c),f=J.cssHooks[c],c=J.cssProps[c]||c,"cssFloat"===c&&(c="float"),f&&"get"in f&&(e=f.get(a,!0,d))!==b?e:Da?Da(a,c):void 0},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),J.curCSS=J.css,G.defaultView&&G.defaultView.getComputedStyle&&(Ea=function(a,b){var c,d,e,f,g=a.style;return b=b.replace(Ia,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),""===c&&!J.contains(a.ownerDocument.documentElement,a)&&(c=J.style(a,b))),!J.support.pixelMargin&&e&&Ma.test(b)&&Ka.test(c)&&(f=g.width,g.width=c,c=e.width,g.width=f),c}),G.documentElement.currentStyle&&(Fa=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;return null==f&&g&&(e=g[b])&&(f=e),Ka.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left="fontSize"===b?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d)),""===f?"auto":f}),Da=Ea||Fa,J.each(["height","width"],function(a,b){J.cssHooks[b]={get:function(a,c,d){return c?0!==a.offsetWidth?p(a,b,d):J.swap(a,Na,function(){return p(a,b,d)}):void 0},set:function(a,b){return Ja.test(b)?b+"px":b}}}),J.support.opacity||(J.cssHooks.opacity={get:function(a,b){return Ha.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=J.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,b>=1&&""===J.trim(f.replace(Ga,""))&&(c.removeAttribute("filter"),d&&!d.filter)||(c.filter=Ga.test(f)?f.replace(Ga,e):f+" "+e)}}),J(function(){J.support.reliableMarginRight||(J.cssHooks.marginRight={get:function(a,b){return J.swap(a,{display:"inline-block"},function(){return b?Da(a,"margin-right"):a.style.marginRight})}})}),J.expr&&J.expr.filters&&(J.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return 0===b&&0===c||!J.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||J.css(a,"display"))},J.expr.filters.visible=function(a){return!J.expr.filters.hidden(a)}),J.each({margin:"",padding:"",border:"Width"},function(a,b){J.cssHooks[a+b]={expand:function(c){var d,e="string"==typeof c?c.split(" "):[c],f={};for(d=0;4>d;d++)f[a+Oa[d]+b]=e[d]||e[d-2]||e[0];return f}}});var Pa,Qa,Ra=/%20/g,Sa=/\[\]$/,Ta=/\r?\n/g,Ua=/#.*$/,Va=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Wa=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Xa=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Ya=/^(?:GET|HEAD)$/,Za=/^\/\//,$a=/\?/,_a=/)<[^<]*)*<\/script>/gi,ab=/^(?:select|textarea)/i,bb=/\s+/,cb=/([?&])_=[^&]*/,db=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,eb=J.fn.load,fb={},gb={},hb=["*/"]+["*"];try{Pa=I.href}catch(ib){Pa=G.createElement("a"),Pa.href="",Pa=Pa.href}Qa=db.exec(Pa.toLowerCase())||[],J.fn.extend({load:function(a,c,d){if("string"!=typeof a&&eb)return eb.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}var g="GET";c&&(J.isFunction(c)?(d=c,c=b):"object"==typeof c&&(c=J.param(c,J.ajaxSettings.traditional),g="POST"));var h=this;return J.ajax({url:a,type:g,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),h.html(f?J("
              ").append(c.replace(_a,"")).find(f):c)),d&&h.each(d,[c,b,a])}}),this},serialize:function(){return J.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?J.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ab.test(this.nodeName)||Wa.test(this.type))}).map(function(a,b){var c=J(this).val();return null==c?null:J.isArray(c)?J.map(c,function(a,c){return{name:b.name,value:a.replace(Ta,"\r\n")}}):{name:b.name,value:c.replace(Ta,"\r\n")}}).get()}}),J.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){J.fn[b]=function(a){return this.on(b,a)}}),J.each(["get","post"],function(a,c){J[c]=function(a,d,e,f){return J.isFunction(d)&&(f=f||e,e=d,d=b),J.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),J.extend({getScript:function(a,c){return J.get(a,b,c,"script")},getJSON:function(a,b,c){return J.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?m(a,J.ajaxSettings):(b=a,a=J.ajaxSettings),m(a,b),a},ajaxSettings:{url:Pa,isLocal:Xa.test(Qa[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":hb},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":J.parseJSON,"text xml":J.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:o(fb),ajaxTransport:o(gb),ajax:function(a,c){function d(a,c,d,g){if(2!==x){x=2,i&&clearTimeout(i),h=b,f=g||"",y.readyState=a>0?4:0;var l,n,o,v,w,z=c,A=d?k(p,y,d):b;if(a>=200&&300>a||304===a)if(p.ifModified&&((v=y.getResponseHeader("Last-Modified"))&&(J.lastModified[e]=v),(w=y.getResponseHeader("Etag"))&&(J.etag[e]=w)),304===a)z="notmodified",l=!0;else try{n=j(p,A),z="success",l=!0}catch(B){z="parsererror",o=B}else o=z,(!z||a)&&(z="error",0>a&&(a=0));y.status=a,y.statusText=""+(c||z),l?s.resolveWith(q,[n,z,y]):s.rejectWith(q,[y,z,o]),y.statusCode(u),u=b,m&&r.trigger("ajax"+(l?"Success":"Error"),[y,p,l?n:o]),t.fireWith(q,[y,z]),m&&(r.trigger("ajaxComplete",[y,p]),--J.active||J.event.trigger("ajaxStop"))}}"object"==typeof a&&(c=a,a=b),c=c||{};var e,f,g,h,i,l,m,o,p=J.ajaxSetup({},c),q=p.context||p,r=q!==p&&(q.nodeType||q instanceof J)?J(q):J.event,s=J.Deferred(),t=J.Callbacks("once memory"),u=p.statusCode||{},v={},w={},x=0,y={readyState:0,setRequestHeader:function(a,b){if(!x){var c=a.toLowerCase();a=w[c]=w[c]||a,v[a]=b}return this},getAllResponseHeaders:function(){return 2===x?f:null},getResponseHeader:function(a){var c;if(2===x){if(!g)for(g={};c=Va.exec(f);)g[c[1].toLowerCase()]=c[2];c=g[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return x||(p.mimeType=a),this},abort:function(a){return a=a||"abort",h&&h.abort(a),d(0,a),this}};if(s.promise(y),y.success=y.done,y.error=y.fail,y.complete=t.add,y.statusCode=function(a){if(a){var b;if(2>x)for(b in a)u[b]=[u[b],a[b]];else b=a[y.status],y.then(b,b)}return this},p.url=((a||p.url)+"").replace(Ua,"").replace(Za,Qa[1]+"//"),p.dataTypes=J.trim(p.dataType||"*").toLowerCase().split(bb),null==p.crossDomain&&(l=db.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]==Qa[1]&&l[2]==Qa[2]&&(l[3]||("http:"===l[1]?80:443))==(Qa[3]||("http:"===Qa[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=J.param(p.data,p.traditional)),n(fb,p,c,y),2===x)return!1;if(m=p.global,p.type=p.type.toUpperCase(),p.hasContent=!Ya.test(p.type),m&&0===J.active++&&J.event.trigger("ajaxStart"),!p.hasContent&&(p.data&&(p.url+=($a.test(p.url)?"&":"?")+p.data,delete p.data),e=p.url,p.cache===!1)){var z=J.now(),A=p.url.replace(cb,"$1_="+z);p.url=A+(A===p.url?($a.test(p.url)?"&":"?")+"_="+z:"")}(p.data&&p.hasContent&&p.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",p.contentType),p.ifModified&&(e=e||p.url,J.lastModified[e]&&y.setRequestHeader("If-Modified-Since",J.lastModified[e]),J.etag[e]&&y.setRequestHeader("If-None-Match",J.etag[e])),y.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+hb+"; q=0.01":""):p.accepts["*"]);for(o in p.headers)y.setRequestHeader(o,p.headers[o]);if(p.beforeSend&&(p.beforeSend.call(q,y,p)===!1||2===x))return y.abort(),!1;for(o in{success:1,error:1,complete:1})y[o](p[o]);if(h=n(gb,p,c,y)){y.readyState=1,m&&r.trigger("ajaxSend",[y,p]),p.async&&p.timeout>0&&(i=setTimeout(function(){y.abort("timeout")},p.timeout));try{x=1,h.send(v,d)}catch(B){if(!(2>x))throw B;d(-1,B)}}else d(-1,"No Transport");return y},param:function(a,c){var d=[],e=function(a,b){b=J.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b&&(c=J.ajaxSettings.traditional),J.isArray(a)||a.jquery&&!J.isPlainObject(a))J.each(a,function(){e(this.name,this.value)});else for(var f in a)l(f,a[f],c,e);return d.join("&").replace(Ra,"+")}}),J.extend({active:0,lastModified:{},etag:{}});var jb=J.now(),kb=/(\=)\?(&|$)|\?\?/i;J.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return J.expando+"_"+jb++}}),J.ajaxPrefilter("json jsonp",function(b,c,d){var e="string"==typeof b.data&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if("jsonp"===b.dataTypes[0]||b.jsonp!==!1&&(kb.test(b.url)||e&&kb.test(b.data))){var f,g=b.jsonpCallback=J.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h=a[g],i=b.url,j=b.data,k="$1"+g+"$2";return b.jsonp!==!1&&(i=i.replace(kb,k),b.url===i&&(e&&(j=j.replace(kb,k)),b.data===j&&(i+=(/\?/.test(i)?"&":"?")+b.jsonp+"="+g))),b.url=i,b.data=j,a[g]=function(a){f=[a]},d.always(function(){a[g]=h,f&&J.isFunction(h)&&a[g](f[0])}),b.converters["script json"]=function(){return f||J.error(g+" was not called"),f[0]},b.dataTypes[0]="json","script"}}),J.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return J.globalEval(a),a}}}),J.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),J.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=G.head||G.getElementsByTagName("head")[0]||G.documentElement;return{send:function(e,f){c=G.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){(e||!c.readyState||/loaded|complete/.test(c.readyState))&&(c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success"))},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var lb,mb=a.ActiveXObject?function(){for(var a in lb)lb[a](0,1)}:!1,nb=0;J.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&i()||h()}:i,function(a){J.extend(J.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(J.ajaxSettings.xhr()),J.support.ajax&&J.ajaxTransport(function(c){if(!c.crossDomain||J.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();if(c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async),c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||4===i.readyState))if(d=b,g&&(i.onreadystatechange=J.noop,mb&&delete lb[g]),e)4!==i.readyState&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}h||!c.isLocal||c.crossDomain?1223===h&&(h=204):h=l.text?200:404}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async&&4!==i.readyState?(g=++nb,mb&&(lb||(lb={},J(a).unload(mb)),lb[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var ob,pb,qb,rb,sb={},tb=/^(?:toggle|show|hide)$/,ub=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,vb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];J.fn.extend({show:function(a,b,c){var f,g;if(a||0===a)return this.animate(e("show",3),a,b,c);for(var h=0,i=this.length;i>h;h++)f=this[h],f.style&&(g=f.style.display,!J._data(f,"olddisplay")&&"none"===g&&(g=f.style.display=""),(""===g&&"none"===J.css(f,"display")||!J.contains(f.ownerDocument.documentElement,f))&&J._data(f,"olddisplay",d(f.nodeName)));for(h=0;i>h;h++)f=this[h],f.style&&(g=f.style.display,(""===g||"none"===g)&&(f.style.display=J._data(f,"olddisplay")||""));return this},hide:function(a,b,c){if(a||0===a)return this.animate(e("hide",3),a,b,c);for(var d,f,g=0,h=this.length;h>g;g++)d=this[g],d.style&&(f=J.css(d,"display"),"none"!==f&&!J._data(d,"olddisplay")&&J._data(d,"olddisplay",f));for(g=0;h>g;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:J.fn.toggle,toggle:function(a,b,c){var d="boolean"==typeof a;return J.isFunction(a)&&J.isFunction(b)?this._toggle.apply(this,arguments):null==a||d?this.each(function(){var b=d?a:J(this).is(":hidden");J(this)[b?"show":"hide"]()}):this.animate(e("toggle",3),a,b,c),this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){function f(){g.queue===!1&&J._mark(this);var b,c,e,f,h,i,j,k,l,m,n,o=J.extend({},g),p=1===this.nodeType,q=p&&J(this).is(":hidden");o.animatedProperties={};for(e in a)if(b=J.camelCase(e),e!==b&&(a[b]=a[e],delete a[e]),(h=J.cssHooks[b])&&"expand"in h){i=h.expand(a[b]),delete a[b];for(e in i)e in a||(a[e]=i[e])}for(b in a){if(c=a[b],J.isArray(c)?(o.animatedProperties[b]=c[1],c=a[b]=c[0]):o.animatedProperties[b]=o.specialEasing&&o.specialEasing[b]||o.easing||"swing","hide"===c&&q||"show"===c&&!q)return o.complete.call(this);p&&("height"===b||"width"===b)&&(o.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===J.css(this,"display")&&"none"===J.css(this,"float")&&(J.support.inlineBlockNeedsLayout&&"inline"!==d(this.nodeName)?this.style.zoom=1:this.style.display="inline-block"))}null!=o.overflow&&(this.style.overflow="hidden");for(e in a)f=new J.fx(this,o,e),c=a[e],tb.test(c)?(n=J._data(this,"toggle"+e)||("toggle"===c?q?"show":"hide":0),n?(J._data(this,"toggle"+e,"show"===n?"hide":"show"),f[n]()):f[c]()):(j=ub.exec(c),k=f.cur(),j?(l=parseFloat(j[2]),m=j[3]||(J.cssNumber[e]?"":"px"),"px"!==m&&(J.style(this,e,(l||1)+m),k=(l||1)/f.cur()*k,J.style(this,e,k+m)),j[1]&&(l=("-="===j[1]?-1:1)*l+k),f.custom(k,l,m)):f.custom(k,c,""));return!0}var g=J.speed(b,c,e);return J.isEmptyObject(a)?this.each(g.complete,[!1]):(a=J.extend({},a),g.queue===!1?this.each(f):this.queue(g.queue,f))},stop:function(a,c,d){return"string"!=typeof a&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){function b(a,b,c){var e=b[c];J.removeData(a,c,!0),e.stop(d)}var c,e=!1,f=J.timers,g=J._data(this);if(d||J._unmark(!0,this),null==a)for(c in g)g[c]&&g[c].stop&&c.indexOf(".run")===c.length-4&&b(this,g,c);else g[c=a+".run"]&&g[c].stop&&b(this,g,c);for(c=f.length;c--;)f[c].elem===this&&(null==a||f[c].queue===a)&&(d?f[c](!0):f[c].saveState(),e=!0,f.splice(c,1));(!d||!e)&&J.dequeue(this,a)})}}),J.each({slideDown:e("show",1),slideUp:e("hide",1),slideToggle:e("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){J.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),J.extend({speed:function(a,b,c){var d=a&&"object"==typeof a?J.extend({},a):{complete:c||!c&&b||J.isFunction(a)&&a,duration:a,easing:c&&b||b&&!J.isFunction(b)&&b};return d.duration=J.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in J.fx.speeds?J.fx.speeds[d.duration]:J.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(a){J.isFunction(d.old)&&d.old.call(this),d.queue?J.dequeue(this,d.queue):a!==!1&&J._unmark(this)},d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),J.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(J.fx.step[this.prop]||J.fx.step._default)(this)},cur:function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];var a,b=J.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?b&&"auto"!==b?b:0:a},custom:function(a,c,d){function e(a){return f.step(a)}var f=this,h=J.fx;this.startTime=rb||g(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(J.cssNumber[this.prop]?"":"px"),e.queue=this.options.queue,e.elem=this.elem,e.saveState=function(){J._data(f.elem,"fxshow"+f.prop)===b&&(f.options.hide?J._data(f.elem,"fxshow"+f.prop,f.start):f.options.show&&J._data(f.elem,"fxshow"+f.prop,f.end))},e()&&J.timers.push(e)&&!qb&&(qb=setInterval(h.tick,h.interval))},show:function(){var a=J._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||J.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur()),J(this.elem).show()},hide:function(){this.options.orig[this.prop]=J._data(this.elem,"fxshow"+this.prop)||J.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=rb||g(),f=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(f=!1);if(f){if(null!=i.overflow&&!J.support.shrinkWrapBlocks&&J.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&J(h).hide(),i.hide||i.show)for(b in i.animatedProperties)J.style(h,b,i.orig[b]),J.removeData(h,"fxshow"+b,!0),J.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}return i.duration==1/0?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=J.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},J.extend(J.fx,{tick:function(){for(var a,b=J.timers,c=0;c-1,l={},m={};k?(m=g.position(),e=m.top,f=m.left):(e=parseFloat(i)||0,f=parseFloat(j)||0),J.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(l.top=b.top-h.top+e),null!=b.left&&(l.left=b.left-h.left+f),"using"in b?b.using.call(a,l):g.css(l)}},J.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=yb.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(J.css(a,"marginTop"))||0,c.left-=parseFloat(J.css(a,"marginLeft"))||0,d.top+=parseFloat(J.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(J.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||G.body;a&&!yb.test(a.nodeName)&&"static"===J.css(a,"position");)a=a.offsetParent;return a})}}),J.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,d){var e=/Y/.test(d);J.fn[a]=function(f){return J.access(this,function(a,f,g){var h=c(a);return g===b?h?d in h?h[d]:J.support.boxModel&&h.document.documentElement[f]||h.document.body[f]:a[f]:void(h?h.scrollTo(e?J(h).scrollLeft():g,e?g:J(h).scrollTop()):a[f]=g)},a,f,arguments.length,null)}}),J.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,f="offset"+a;J.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(J.css(a,c,"padding")):this[c]():null},J.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(J.css(b,c,a?"margin":"border")):this[c]():null},J.fn[c]=function(a){return J.access(this,function(a,c,g){var h,i,j,k;return J.isWindow(a)?(h=a.document,i=h.documentElement[d],J.support.boxModel&&i||h.body&&h.body[d]||i):9===a.nodeType?(h=a.documentElement,h[d]>=h[e]?h[d]:Math.max(a.body[e],h[e],a.body[f],h[f])):g===b?(j=J.css(a,c),k=parseFloat(j),J.isNumeric(k)?k:j):void J(a).css(c,g)},c,a,arguments.length,null)}}),a.jQuery=a.$=J,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return J})}(window),function(){var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.push,h=d.slice,i=d.concat,j=e.toString,k=e.hasOwnProperty,l=d.forEach,m=d.map,n=d.reduce,o=d.reduceRight,p=d.filter,q=d.every,r=d.some,s=d.indexOf,t=d.lastIndexOf,u=Array.isArray,v=Object.keys,w=f.bind,x=function(a){return a instanceof x?a:this instanceof x?void(this._wrapped=a):new x(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=x),exports._=x):a._=x,x.VERSION="1.4.4";var y=x.each=x.forEach=function(a,b,d){if(null!=a)if(l&&a.forEach===l)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;f>e;e++)if(b.call(d,a[e],e,a)===c)return}else for(var g in a)if(x.has(a,g)&&b.call(d,a[g],g,a)===c)return};x.map=x.collect=function(a,b,c){var d=[];return null==a?d:m&&a.map===m?a.map(b,c):(y(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),d)};var z="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),n&&a.reduce===n)return d&&(b=x.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(y(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(z);return c},x.reduceRight=x.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),o&&a.reduceRight===o)return d&&(b=x.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=x.keys(a);f=g.length}if(y(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(z);return c},x.find=x.detect=function(a,b,c){var d;return A(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},x.filter=x.select=function(a,b,c){var d=[];return null==a?d:p&&a.filter===p?a.filter(b,c):(y(a,function(a,e,f){ +b.call(c,a,e,f)&&(d[d.length]=a)}),d)},x.reject=function(a,b,c){return x.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},x.every=x.all=function(a,b,d){b||(b=x.identity);var e=!0;return null==a?e:q&&a.every===q?a.every(b,d):(y(a,function(a,f,g){return(e=e&&b.call(d,a,f,g))?void 0:c}),!!e)};var A=x.some=x.any=function(a,b,d){b||(b=x.identity);var e=!1;return null==a?e:r&&a.some===r?a.some(b,d):(y(a,function(a,f,g){return e||(e=b.call(d,a,f,g))?c:void 0}),!!e)};x.contains=x.include=function(a,b){return null==a?!1:s&&a.indexOf===s?-1!=a.indexOf(b):A(a,function(a){return a===b})},x.invoke=function(a,b){var c=h.call(arguments,2),d=x.isFunction(b);return x.map(a,function(a){return(d?b:a[b]).apply(a,c)})},x.pluck=function(a,b){return x.map(a,function(a){return a[b]})},x.where=function(a,b,c){return x.isEmpty(b)?c?null:[]:x[c?"find":"filter"](a,function(a){for(var c in b)if(b[c]!==a[c])return!1;return!0})},x.findWhere=function(a,b){return x.where(a,b,!0)},x.max=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&65535>a.length)return Math.max.apply(Math,a);if(!b&&x.isEmpty(a))return-1/0;var d={computed:-1/0,value:-1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},x.min=function(a,b,c){if(!b&&x.isArray(a)&&a[0]===+a[0]&&65535>a.length)return Math.min.apply(Math,a);if(!b&&x.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;d.computed>g&&(d={value:a,computed:g})}),d.value},x.shuffle=function(a){var b,c=0,d=[];return y(a,function(a){b=x.random(c++),d[c-1]=d[b],d[b]=a}),d};var B=function(a){return x.isFunction(a)?a:function(b){return b[a]}};x.sortBy=function(a,b,c){var d=B(b);return x.pluck(x.map(a,function(a,b,e){return{value:a,index:b,criteria:d.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.indexf;){var h=f+g>>>1;e>c.call(d,a[h])?f=h+1:g=h}return f},x.toArray=function(a){return a?x.isArray(a)?h.call(a):a.length===+a.length?x.map(a,x.identity):x.values(a):[]},x.size=function(a){return null==a?0:a.length===+a.length?a.length:x.keys(a).length},x.first=x.head=x.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:h.call(a,0,b)},x.initial=function(a,b,c){return h.call(a,0,a.length-(null==b||c?1:b))},x.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:h.call(a,Math.max(a.length-b,0))},x.rest=x.tail=x.drop=function(a,b,c){return h.call(a,null==b||c?1:b)},x.compact=function(a){return x.filter(a,x.identity)};var D=function(a,b,c){return y(a,function(a){x.isArray(a)?b?g.apply(c,a):D(a,b,c):c.push(a)}),c};x.flatten=function(a,b){return D(a,b,[])},x.without=function(a){return x.difference(a,h.call(arguments,1))},x.uniq=x.unique=function(a,b,c,d){x.isFunction(b)&&(d=c,c=b,b=!1);var e=c?x.map(a,c,d):a,f=[],g=[];return y(e,function(c,d){(b?d&&g[g.length-1]===c:x.contains(g,c))||(g.push(c),f.push(a[d]))}),f},x.union=function(){return x.uniq(i.apply(d,arguments))},x.intersection=function(a){var b=h.call(arguments,1);return x.filter(x.uniq(a),function(a){return x.every(b,function(b){return x.indexOf(b,a)>=0})})},x.difference=function(a){var b=i.apply(d,h.call(arguments,1));return x.filter(a,function(a){return!x.contains(b,a)})},x.zip=function(){for(var a=h.call(arguments),b=x.max(x.pluck(a,"length")),c=Array(b),d=0;b>d;d++)c[d]=x.pluck(a,""+d);return c},x.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},x.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=x.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(s&&a.indexOf===s)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},x.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(t&&a.lastIndexOf===t)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},x.range=function(a,b,c){1>=arguments.length&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=Array(d);d>e;)f[e++]=a,a+=c;return f},x.bind=function(a,b){if(a.bind===w&&w)return w.apply(a,h.call(arguments,1));var c=h.call(arguments,2);return function(){return a.apply(b,c.concat(h.call(arguments)))}},x.partial=function(a){var b=h.call(arguments,1);return function(){return a.apply(this,b.concat(h.call(arguments)))}},x.bindAll=function(a){var b=h.call(arguments,1);return 0===b.length&&(b=x.functions(a)),y(b,function(b){a[b]=x.bind(a[b],a)}),a},x.memoize=function(a,b){var c={};return b||(b=x.identity),function(){var d=b.apply(this,arguments);return x.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},x.delay=function(a,b){var c=h.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},x.defer=function(a){return x.delay.apply(x,[a,1].concat(h.call(arguments,1)))},x.throttle=function(a,b){var c,d,e,f,g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)};return function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},x.debounce=function(a,b,c){var d,e;return function(){var f=this,g=arguments,h=function(){d=null,c||(e=a.apply(f,g))},i=c&&!d;return clearTimeout(d),d=setTimeout(h,b),i&&(e=a.apply(f,g)),e}},x.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},x.wrap=function(a,b){return function(){var c=[a];return g.apply(c,arguments),b.apply(this,c)}},x.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},x.after=function(a,b){return 0>=a?b():function(){return 1>--a?b.apply(this,arguments):void 0}},x.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)x.has(a,c)&&(b[b.length]=c);return b},x.values=function(a){var b=[];for(var c in a)x.has(a,c)&&b.push(a[c]);return b},x.pairs=function(a){var b=[];for(var c in a)x.has(a,c)&&b.push([c,a[c]]);return b},x.invert=function(a){var b={};for(var c in a)x.has(a,c)&&(b[a[c]]=c);return b},x.functions=x.methods=function(a){var b=[];for(var c in a)x.isFunction(a[c])&&b.push(c);return b.sort()},x.extend=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},x.pick=function(a){var b={},c=i.apply(d,h.call(arguments,1));return y(c,function(c){c in a&&(b[c]=a[c])}),b},x.omit=function(a){var b={},c=i.apply(d,h.call(arguments,1));for(var e in a)x.contains(c,e)||(b[e]=a[e]);return b},x.defaults=function(a){return y(h.call(arguments,1),function(b){if(b)for(var c in b)null==a[c]&&(a[c]=b[c])}),a},x.clone=function(a){return x.isObject(a)?x.isArray(a)?a.slice():x.extend({},a):a},x.tap=function(a,b){return b(a),a};var E=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof x&&(a=a._wrapped),b instanceof x&&(b=b._wrapped);var e=j.call(a);if(e!=j.call(b))return!1;switch(e){case"[object String]":return a==b+"";case"[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;c.push(a),d.push(b);var g=0,h=!0;if("[object Array]"==e){if(g=a.length,h=g==b.length)for(;g--&&(h=E(a[g],b[g],c,d)););}else{var i=a.constructor,k=b.constructor;if(i!==k&&!(x.isFunction(i)&&i instanceof i&&x.isFunction(k)&&k instanceof k))return!1;for(var l in a)if(x.has(a,l)&&(g++,!(h=x.has(b,l)&&E(a[l],b[l],c,d))))break;if(h){for(l in b)if(x.has(b,l)&&!g--)break;h=!g}}return c.pop(),d.pop(),h};x.isEqual=function(a,b){return E(a,b,[],[])},x.isEmpty=function(a){if(null==a)return!0;if(x.isArray(a)||x.isString(a))return 0===a.length;for(var b in a)if(x.has(a,b))return!1;return!0},x.isElement=function(a){return!(!a||1!==a.nodeType)},x.isArray=u||function(a){return"[object Array]"==j.call(a)},x.isObject=function(a){return a===Object(a)},y(["Arguments","Function","String","Number","Date","RegExp"],function(a){x["is"+a]=function(b){return j.call(b)=="[object "+a+"]"}}),x.isArguments(arguments)||(x.isArguments=function(a){return!(!a||!x.has(a,"callee"))}),"function"!=typeof/./&&(x.isFunction=function(a){return"function"==typeof a}),x.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},x.isNaN=function(a){return x.isNumber(a)&&a!=+a},x.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==j.call(a)},x.isNull=function(a){return null===a},x.isUndefined=function(a){return void 0===a},x.has=function(a,b){return k.call(a,b)},x.noConflict=function(){return a._=b,this},x.identity=function(a){return a},x.times=function(a,b,c){for(var d=Array(a),e=0;a>e;e++)d[e]=b.call(c,e);return d},x.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))};var F={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};F.unescape=x.invert(F.escape);var G={escape:RegExp("["+x.keys(F.escape).join("")+"]","g"),unescape:RegExp("("+x.keys(F.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(a){x[a]=function(b){return null==b?"":(""+b).replace(G[a],function(b){return F[a][b]})}}),x.result=function(a,b){if(null==a)return null;var c=a[b];return x.isFunction(c)?c.call(a):c},x.mixin=function(a){y(x.functions(a),function(b){var c=x[b]=a[b];x.prototype[b]=function(){var a=[this._wrapped];return g.apply(a,arguments),L.call(this,c.apply(x,a))}})};var H=0;x.uniqueId=function(a){var b=++H+"";return a?a+b:b},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var I=/(.)^/,J={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(a,b,c){var d;c=x.defaults({},c,x.templateSettings);var e=RegExp([(c.escape||I).source,(c.interpolate||I).source,(c.evaluate||I).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(K,function(a){return"\\"+J[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,x);var i=function(a){return d.call(this,a,x)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},x.chain=function(a){return x(a).chain()};var L=function(a){return this._chain?x(a).chain():a};x.mixin(x),y(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];x.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],L.call(this,c)}}),y(["concat","join","slice"],function(a){var b=d[a];x.prototype[a]=function(){return L.call(this,b.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(a){return 10>a?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g,h=gap,i=b[a];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(a)),"function"==typeof rep&&(i=rep.call(b,a,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,g=[],"[object Array]"===Object.prototype.toString.apply(i)){for(f=i.length,c=0;f>c;c+=1)g[c]=str(c,i)||"null";return e=0===g.length?"[]":gap?"[\n"+gap+g.join(",\n"+gap)+"\n"+h+"]":"["+g.join(",")+"]",gap=h,e}if(rep&&"object"==typeof rep)for(f=rep.length,c=0;f>c;c+=1)"string"==typeof rep[c]&&(d=rep[c],e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));return e=0===g.length?"{}":gap?"{\n"+gap+g.join(",\n"+gap)+"\n"+h+"}":"{"+g.join(",")+"}",gap=h,e}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(a,b,c){var d;if(gap="",indent="","number"==typeof c)for(d=0;c>d;d+=1)indent+=" ";else"string"==typeof c&&(indent=c);if(rep=b,b&&"function"!=typeof b&&("object"!=typeof b||"number"!=typeof b.length))throw new Error("JSON.stringify");return str("",{"":a})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&"object"==typeof e)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),void 0!==d?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(){var a,b=this,c=b.Backbone,d=Array.prototype.slice,e=Array.prototype.splice;a="undefined"!=typeof exports?exports:b.Backbone={},a.VERSION="0.9.2";var f=b._;f||"undefined"==typeof require||(f=require("underscore"));var g=b.jQuery||b.Zepto||b.ender;a.setDomLibrary=function(a){g=a},a.noConflict=function(){return b.Backbone=c,this},a.emulateHTTP=!1,a.emulateJSON=!1;var h=/\s+/,i=a.Events={on:function(a,b,c){var d,e,f,g,i;if(!b)return this;for(a=a.split(h),d=this._callbacks||(this._callbacks={});e=a.shift();)i=d[e],f=i?i.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:i?i.next:f};return this},off:function(a,b,c){var d,e,g,i,j,k;if(e=this._callbacks){if(!(a||b||c))return delete this._callbacks,this;for(a=a?a.split(h):f.keys(e);d=a.shift();)if(g=e[d],delete e[d],g&&(b||c))for(i=g.tail;(g=g.next)!==i;)j=g.callback,k=g.context,(b&&j!==b||c&&k!==c)&&this.on(d,j,k);return this}},trigger:function(a){var b,c,e,f,g,i,j;if(!(e=this._callbacks))return this;for(i=e.all,a=a.split(h),j=d.call(arguments,1);b=a.shift();){if(c=e[b])for(f=c.tail;(c=c.next)!==f;)c.callback.apply(c.context||this,j);if(c=i)for(f=c.tail,g=[b].concat(j);(c=c.next)!==f;)c.callback.apply(c.context||this,g)}return this}};i.bind=i.on,i.unbind=i.off;var j=a.Model=function(a,b){var c;a||(a={}),b&&b.parse&&(a=this.parse(a)),(c=A(this,"defaults"))&&(a=f.extend({},c,a)),b&&b.collection&&(this.collection=b.collection),this.attributes={},this._escapedAttributes={},this.cid=f.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(a,{silent:!0}),this.changed={},this._silent={},this._pending={},this._previousAttributes=f.clone(this.attributes),this.initialize.apply(this,arguments)};f.extend(j.prototype,i,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(a){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;var c=this.get(a);return this._escapedAttributes[a]=f.escape(null==c?"":""+c)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e,g;if(f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b),c||(c={}),!d)return this;if(d instanceof j&&(d=d.attributes),c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var h=c.changes={},i=this.attributes,k=this._escapedAttributes,l=this._previousAttributes||{};for(e in d)g=d[e],(!f.isEqual(i[e],g)||c.unset&&f.has(i,e))&&(delete k[e],(c.silent?this._silent:h)[e]=!0),c.unset?delete i[e]:i[e]=g,f.isEqual(l[e],g)&&f.has(i,e)==f.has(l,e)?(delete this.changed[e],delete this._pending[e]):(this.changed[e]=g,c.silent||(this._pending[e]=!0));return c.silent||this.change(c),this},unset:function(a,b){return(b||(b={})).unset=!0,this.set(a,null,b)},clear:function(a){return(a||(a={})).unset=!0,this.set(f.clone(this.attributes),a)},fetch:function(b){b=b?f.clone(b):{};var c=this,d=b.success;return b.success=function(a,e,f){return c.set(c.parse(a,f),b)?void(d&&d(c,a)):!1},b.error=a.wrapError(b.error,c,b),(this.sync||a.sync).call(this,"read",this,b)},save:function(b,c,d){var e,g;if(f.isObject(b)||null==b?(e=b,d=c):(e={},e[b]=c),d=d?f.clone(d):{},d.wait){if(!this._validate(e,d))return!1;g=f.clone(this.attributes)}var h=f.extend({},d,{silent:!0});if(e&&!this.set(e,d.wait?h:d))return!1;var i=this,j=d.success;d.success=function(a,b,c){var g=i.parse(a,c);return d.wait&&(delete d.wait,g=f.extend(e||{},g)),i.set(g,d)?void(j?j(i,a):i.trigger("sync",i,a,d)):!1},d.error=a.wrapError(d.error,i,d);var k=this.isNew()?"create":"update",l=(this.sync||a.sync).call(this,k,this,d);return d.wait&&this.set(g,h),l},destroy:function(b){b=b?f.clone(b):{};var c=this,d=b.success,e=function(){c.trigger("destroy",c,c.collection,b)};if(this.isNew())return e(),!1;b.success=function(a){b.wait&&e(),d?d(c,a):c.trigger("sync",c,a,b)},b.error=a.wrapError(b.error,c,b);var g=(this.sync||a.sync).call(this,"delete",this,b);return b.wait||e(),g},url:function(){var a=A(this,"urlRoot")||A(this.collection,"url")||B();return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a,b){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(var c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending={},this.trigger("change",this,a);for(var c in this.changed)this._pending[c]||this._silent[c]||delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}return this._changing=!1,this},hasChanged:function(a){return arguments.length?f.has(this.changed,a):!f.isEmpty(this.changed)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes;for(var e in a)f.isEqual(d[e],b=a[e])||((c||(c={}))[e]=b);return c},previous:function(a){return arguments.length&&this._previousAttributes?this._previousAttributes[a]:null},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;a=f.extend({},this.attributes,a);var c=this.validate(a,b);return c?(b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b),!1):!0}});var k=a.Collection=function(a,b){b||(b={}),b.model&&(this.model=b.model),b.comparator&&(this.comparator=b.comparator),this._reset(),this.initialize.apply(this,arguments),a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(k.prototype,i,{model:j,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,g,h,i,j,k={},l={},m=[];for(b||(b={}),a=f.isArray(a)?a.slice():[a],c=0,g=a.length;g>c;c++){if(!(h=a[c]=this._prepareModel(a[c],b)))throw new Error("Can't add an invalid model to a collection");i=h.cid,j=h.id,k[i]||this._byCid[i]||null!=j&&(l[j]||this._byId[j])?m.push(c):k[i]=l[j]=h}for(c=m.length;c--;)a.splice(m[c],1);for(c=0,g=a.length;g>c;c++)(h=a[c]).on("all",this._onModelEvent,this),this._byCid[h.cid]=h,null!=h.id&&(this._byId[h.id]=h);if(this.length+=g,d=null!=b.at?b.at:this.models.length,e.apply(this.models,[d,0].concat(a)),this.comparator&&this.sort({silent:!0}),b.silent)return this;for(c=0,g=this.models.length;g>c;c++)k[(h=this.models[c]).cid]&&(b.index=c,h.trigger("add",h,this,b));return this},remove:function(a,b){var c,d,e,g;for(b||(b={}),a=f.isArray(a)?a.slice():[a],c=0,d=a.length;d>c;c++)g=this.getByCid(a[c])||this.get(a[c]),g&&(delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g));return this},push:function(a,b){return a=this._prepareModel(a,b),this.add(a,b),a},pop:function(a){var b=this.at(this.length-1);return this.remove(b,a),b},unshift:function(a,b){return a=this._prepareModel(a,b),this.add(a,f.extend({at:0},b)),a},shift:function(a){var b=this.at(0);return this.remove(b,a),b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){if(a||(a={}),!this.comparator)throw new Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);return 1==this.comparator.length?this.models=this.sortBy(b):this.models.sort(b),a.silent||this.trigger("reset",this,a),this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]),b||(b={});for(var c=0,d=this.models.length;d>c;c++)this._removeReference(this.models[c]);return this._reset(),this.add(a,f.extend({silent:!0},b)),b.silent||this.trigger("reset",this,b),this},fetch:function(b){b=b?f.clone(b):{},void 0===b.parse&&(b.parse=!0);var c=this,d=b.success;return b.success=function(a,e,f){c[b.add?"add":"reset"](c.parse(a,f),b),d&&d(c,a)},b.error=a.wrapError(b.error,c,b),(this.sync||a.sync).call(this,"read",this,b)},create:function(a,b){var c=this;if(b=b?f.clone(b):{},a=this._prepareModel(a,b),!a)return!1;b.wait||c.add(a,b);var d=b.success;return b.success=function(e,f,g){b.wait&&c.add(e,b),d?d(e,f):e.trigger("sync",a,f,b)},a.save(null,b),a},parse:function(a,b){return a},chain:function(){return f(this.models).chain()},_reset:function(a){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(a,b){if(b||(b={}),a instanceof j)a.collection||(a.collection=this);else{var c=a;b.collection=this,a=new this.model(c,b),a._validate(a.attributes,b)||(a=!1)}return a},_removeReference:function(a){this==a.collection&&delete a.collection,a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"!=a&&"remove"!=a||c==this)&&("destroy"==a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,arguments))}});var l=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","initial","rest","last","without","indexOf","shuffle","lastIndexOf","isEmpty","groupBy"];f.each(l,function(a){k.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var m=a.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},n=/:\w+/g,o=/\*\w+/g,p=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(m.prototype,i,{initialize:function(){},route:function(b,c,d){return a.history||(a.history=new q),f.isRegExp(b)||(b=this._routeToRegExp(b)),d||(d=this[c]),a.history.route(b,f.bind(function(e){var f=this._extractParameters(b,e);d&&d.apply(this,f),this.trigger.apply(this,["route:"+c].concat(f)),a.history.trigger("route",this,c,f)},this)),this},navigate:function(b,c){a.history.navigate(b,c)},_bindRoutes:function(){if(this.routes){var a=[];for(var b in this.routes)a.unshift([b,this.routes[b]]);for(var c=0,d=a.length;d>c;c++)this.route(a[c][0],a[c][1],this[a[c][1]])}},_routeToRegExp:function(a){return a=a.replace(p,"\\$&").replace(n,"([^/]+)").replace(o,"(.*?)"),new RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var q=a.History=function(){this.handlers=[],f.bindAll(this,"checkUrl")},r=/^[#\/]/,s=/msie [\w.]+/;q.started=!1,f.extend(q.prototype,i,{interval:50,getHash:function(a){var b=a?a.location:window.location,c=b.href.match(/#(.*)$/);return c?c[1]:""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){a=window.location.pathname;var c=window.location.search;c&&(a+=c)}else a=this.getHash();return a.indexOf(this.options.root)||(a=a.substr(this.options.root.length)),a.replace(r,"")},start:function(a){if(q.started)throw new Error("Backbone.history has already been started");q.started=!0,this.options=f.extend({},{root:"/"},this.options,a),this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&window.history&&window.history.pushState);var b=this.getFragment(),c=document.documentMode,d=s.exec(navigator.userAgent.toLowerCase())&&(!c||7>=c);d&&(this.iframe=g('";this.dialog=new cdb.ui.common.ShareDialog({title:a.map.get("title"),description:a.map.get("description"),model:this.options.vis.map,code:e,url:a.url,public_map_url:d,share_url:a.share_url,template:b,target:$(".cartodb-share a"),size:$(document).width()>400?"":"small",width:$(document).width()>400?430:216}),$(".cartodb-map-wrapper").append(this.dialog.render().$el),this.addView(this.dialog)},render:function(){return this.$el.html(this.template(_.extend(this.model.attributes))),this}}),cdb.geo.ui.Zoom=cdb.core.View.extend({className:"cartodb-zoom",events:{"click .zoom_in":"zoom_in","click .zoom_out":"zoom_out"},default_options:{timeout:0,msg:""},initialize:function(){this.map=this.model,_.defaults(this.options,this.default_options),this.template=this.options.template?this.options.template:cdb.templates.getTemplate("geo/zoom"),this.map.bind("change:zoom change:minZoom change:maxZoom",this._checkZoom,this)},render:function(){return this.$el.html(this.template(this.options)),this._checkZoom(),this},_checkZoom:function(){var a=this.map.get("zoom");this.$(".zoom_in")[athis.map.get("minZoom")?"removeClass":"addClass"]("disabled")},zoom_in:function(a){this.map.get("maxZoom")>this.map.getZoom()&&this.map.setZoom(this.map.getZoom()+1),a.preventDefault(),a.stopPropagation()},zoom_out:function(a){this.map.get("minZoom")\n
              <%- title %>
              <% } %>
              • <%- leftLabel %>
              • <%- rightLabel %>
              • <%= colors %>\n
              '),initialize:function(){this.items=this.model.items},_generateColorList:function(){var a="";if(this.model.get("colors"))return _.map(this.model.get("colors"),function(a){return'\n
              '}).join("");for(var b=2;b
              '}return a},setLeftLabel:function(a){this.model.set("leftLabel",a)},setRightLabel:function(a){this.model.set("rightLabel",a)},setColors:function(a){this.model.set("colors",a)},render:function(){if(this.model.get("template")){var a=_.template(cdb.core.sanitize.html(this.model.get("template"),this.model.get("sanitizeTemplate")));this.$el.html(a(this.model.toJSON()))}else if(this.items.length>=2){this.leftLabel=this.items.at(0),this.rightLabel=this.items.at(1);var b=this.model.get("leftLabel")||this.leftLabel.get("value"),c=this.model.get("rightLabel")||this.rightLabel.get("value"),d=this._generateColorList(),e=_.extend(this.model.toJSON(),{leftLabel:b,rightLabel:c,colors:d,buckets_count:d.length});this.$el.html(this.template(e))}return this}}),cdb.geo.ui.DensityLegend=cdb.geo.ui.BaseLegend.extend({className:"density-legend",template:_.template('<% if (title && show_title) { %>\n
              <%- title %>
              <% } %>
              • <%- leftLabel %>
              • <%- rightLabel %>
              • <%= colors %>\n
              '),initialize:function(){this.items=this.model.items},setLeftLabel:function(a){this.model.set("leftLabel",a)},setRightLabel:function(a){this.model.set("rightLabel",a)},setColors:function(a){this.model.set("colors",a)},_generateColorList:function(){var a="";if(this.model.get("colors"))return _.map(this.model.get("colors"),function(a){return'\n
              '}).join("");for(var b=2;b'}return a},render:function(){if(this.model.get("template")){var a=_.template(cdb.core.sanitize.html(this.model.get("template"),this.model.get("sanitizeTemplate")));this.$el.html(a(this.model.toJSON()))}else if(this.items.length>=2){this.leftLabel=this.items.at(0),this.rightLabel=this.items.at(1);var b=this.model.get("leftLabel")||this.leftLabel.get("value"),c=this.model.get("rightLabel")||this.rightLabel.get("value"),d=this._generateColorList(),e=_.extend(this.model.toJSON(),{leftLabel:b,rightLabel:c,colors:d,buckets_count:d.length});this.$el.html(this.template(e))}return this}}),cdb.geo.ui.Legend.Density=cdb.geo.ui.DensityLegend.extend({type:"density",className:"cartodb-legend density",initialize:function(){this.items=this.options.items,this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1,leftLabel:this.options.left||this.options.leftLabel,rightLabel:this.options.right||this.options.rightLabel,colors:this.options.colors,buckets_count:this.options.colors?this.options.colors.length:0,items:this.options.items}),this._bindModel()},_bindModel:function(){this.model.bind("change:colors change:template change:title change:show_title change:colors change:leftLabel change:rightLabel",this.render,this)},_generateColorList:function(){return _.map(this.model.get("colors"),function(a){return'
              '}).join("")},render:function(){var a=_.extend(this.model.toJSON(),{colors:this._generateColorList()});return this.$el.html(this.template(a)),this}}),cdb.geo.ui.IntensityLegend=cdb.geo.ui.BaseLegend.extend({className:"intensity-legend",template:_.template('<% if (title && show_title) { %>\n
              <%- title %>
              <% } %>
              • <%- leftLabel %>
              • <%- rightLabel %>
              '),initialize:function(){this.items=this.model.items},_bindModel:function(){this.model.bind("change:template",this.render,this)},setColor:function(a){this.model.set("color",a)},setLeftLabel:function(a){this.model.set("leftLabel",a)},setRightLabel:function(a){this.model.set("rightLabel",a)},_hexToRGB:function(a){var b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null},_rgbToHex:function(a,b,c){function d(a){var b=a.toString(16);return 1==b.length?"0"+b:b}return"#"+d(a)+d(b)+d(c)},_calculateMultiply:function(a,b){var c=this._hexToRGB(a);if(c){for(var d=c.r,e=c.g,f=c.b,g=0;b>=g;g++)d=Math.round(d*c.r/255),e=Math.round(e*c.g/255),f=Math.round(f*c.b/255);return this._rgbToHex(d,e,f)}return"#ffffff"},_renderGraph:function(a){var b="";b+="background: <%= color %>;",b+="background: -moz-linear-gradient(left, <%= color %> 0%, <%= right %> 100%);",b+="background: -webkit-gradient(linear, left top, right top, color-stop(0%,<%= color %>), color-stop(100%,<%= right %>));",b+="background: -webkit-linear-gradient(left, <%= color %> 0%,<%= right %> 100%);",b+="background: -o-linear-gradient(left, <%= color %> 0%,<%= right %> 100%);", +b+="background: -ms-linear-gradient(left, <%= color %> 0%,<%= right %> 100%)",b+="background: linear-gradient(to right, <%= color %> 0%,<%= right %> 100%);",b+="filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='<%= color %>', endColorstr='<%= right %>',GradientType=1 );",b+="background-image: -ms-linear-gradient(left, <%= color %> 0%,<%= right %> 100%)";var c=_.template(b),d=this._calculateMultiply(a,4);this.$el.find(".graph").attr("style",c({color:a,right:d}))},render:function(){if(this.model.get("template")){var a=_.template(cdb.core.sanitize.html(this.model.get("template"),this.model.get("sanitizeTemplate")));this.$el.html(a(this.model.toJSON()))}else if(this.items.length>=3){this.leftLabel=this.items.at(0),this.rightLabel=this.items.at(1);var b=this.model.get("color")||this.items.at(2).get("value"),c=this.model.get("leftLabel")||this.leftLabel.get("value"),d=this.model.get("rightLabel")||this.rightLabel.get("value"),e=_.extend(this.model.toJSON(),{color:b,leftLabel:c,rightLabel:d});this.$el.html(this.template(e)),this._renderGraph(b)}return this}}),cdb.geo.ui.CategoryLegend=cdb.geo.ui.BaseLegend.extend({className:"category-legend",template:_.template('<% if (title && show_title) { %>\n
              <%- title %>
              <% } %>
                '),initialize:function(){this.items=this.model.items},_bindModel:function(){this.model.bind("change:title change:show_title change:template",this.render,this)},_renderItems:function(){this.items.each(this._renderItem,this)},_renderItem:function(a){view=new cdb.geo.ui.LegendItem({model:a,className:a.get("value")&&a.get("value").indexOf("http")>=0||a.get("type")&&"image"==a.get("type")?"bkg":"",template:'
                <%- name || ((name === false) ? "false": "null") %>'}),this.$el.find("ul").append(view.render())},render:function(){if(this.model.get("template")){var a=_.template(cdb.core.sanitize.html(this.model.get("template"),this.model.get("sanitizeTemplate")));this.$el.html(a(this.model.toJSON()))}else this.$el.html(this.template(this.model.toJSON())),this.items.length>0?this._renderItems():this.$el.html('
                The category legend is empty
                ');return this}}),cdb.geo.ui.Legend.Category=cdb.geo.ui.CategoryLegend.extend({className:"cartodb-legend category",type:"category",initialize:function(){this.items=new cdb.geo.ui.LegendItems(this.options.data),this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1}),this._bindModel()},render:function(){return this.$el.html(this.template(this.model.toJSON())),this._renderItems(),this}}),cdb.geo.ui.ColorLegend=cdb.geo.ui.BaseLegend.extend({className:"color-legend",type:"color",template:_.template('<% if (title && show_title) { %>\n
                <%- title %>
                <% } %>
                  '),initialize:function(){this.items=this.model.items},_renderItems:function(){this.items.each(this._renderItem,this)},_renderItem:function(a){view=new cdb.geo.ui.LegendItem({model:a,className:a.get("value")&&a.get("value").indexOf("http")>=0?"bkg":"",template:'
                  <%- name || ((name === false) ? "false": "null") %>'}),this.$el.find("ul").append(view.render())},render:function(){return this.$el.html(this.template(this.model.toJSON())),this.items.length>0?this._renderItems():this.$el.html('
                  The color legend is empty
                  '),this}}),cdb.geo.ui.Legend.Color=cdb.geo.ui.Legend.Category.extend({}),cdb.geo.ui.StackedLegend=cdb.core.View.extend({events:{dragstart:"_stopPropagation",mousedown:"_stopPropagation",touchstart:"_stopPropagation",MSPointerDown:"_stopPropagation",dblclick:"_stopPropagation",mousewheel:"_stopPropagation",DOMMouseScroll:"_stopPropagation",dbclick:"_stopPropagation",click:"_stopPropagation"},className:"cartodb-legend-stack",initialize:function(){_.each(this.options.legends,this._setupBinding,this)},_stopPropagation:function(a){a.stopPropagation()},getLegendByIndex:function(a){if(!this._layerByIndex){this._layerByIndex={};for(var b=this.options.legends,c=0;c0&&this.legendItems.each(this._renderLegend,this),this},_renderLegend:function(a){var b=a.get("type");b||(b="custom"),b=this._capitalize(b);var c=new cdb.geo.ui.Legend[b](a.attributes);this.legends.push(c),a.get("visible")!==!1&&this.$el.append(c.render().$el)},getLegendAt:function(a){return this.legends[a]},addLegend:function(a){var b=new cdb.geo.ui.LegendModel(a);this.legendItems.push(b)},removeLegendAt:function(a){var b=this.legendItems.at(a);this.legendItems.remove(b)}}),cdb.geo.ui.CustomLegend=cdb.geo.ui.BaseLegend.extend({className:"custom-legend",type:"custom",template:_.template('<% if (title && show_title) { %>\n
                  <%- title %>
                  <% } %>
                    '),initialize:function(){this.items=this.model.items},setData:function(a){this.items=new cdb.geo.ui.LegendItems(a),this.model.items=this.items,this.model.set("items",a)},_renderItems:function(){this.items.each(this._renderItem,this)},_renderItem:function(a){var b=this.options.itemTemplate||'
                    \n <%- name || "null" %>';view=new cdb.geo.ui.LegendItem({model:a,className:a.get("value")&&a.get("value").indexOf("http")>=0?"bkg":"",template:b}),this.$el.find("ul").append(view.render())},render:function(){if(this.model.get("template")){var a=_.template(cdb.core.sanitize.html(this.model.get("template"),this.model.get("sanitizeTemplate")));this.$el.html(a(this.model.toJSON()))}else this.$el.html(this.template(this.model.toJSON())),this.items.length>0?this._renderItems():this.$el.html('
                    The legend is empty
                    ');return this}}),cdb.geo.ui.Legend.Custom=cdb.geo.ui.CustomLegend.extend({className:"cartodb-legend custom",type:"custom",initialize:function(){this.items=new cdb.geo.ui.LegendItems(this.options.data||this.options.items),this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1,items:this.items.models,template:this.options.template}),this._bindModel()},_bindModel:function(){this.model.bind("change:items change:template change:title change:show_title",this.render,this)}}),cdb.geo.ui.BubbleLegend=cdb.geo.ui.BaseLegend.extend({className:"bubble-legend",template:_.template('<% if (title && show_title) { %>\n
                    <%- title %>
                    <% } %>
                    • <%- min %>
                    • <%- max %>
                    '),initialize:function(){this.items=this.model.items},_bindModel:function(){this.model.bind("change:template change:title change:show_title change:color change:min change:max",this.render,this)},setColor:function(a){this.model.set("color",a)},setMinValue:function(a){this.model.set("min",a)},setMaxValue:function(a){this.model.set("max",a)},_renderGraph:function(a){this.$el.find(".graph").css("background",a)},render:function(){if(this.model.get("template")){var a=_.template(cdb.core.sanitize.html(this.model.get("template"),this.model.get("sanitizeTemplate")));this.$el.html(a(this.model.toJSON())),this.$el.removeClass("bubble-legend")}else{var b=this.model.get("color")||(this.items.length>=3?this.items.at(2).get("value"):"");if(this.items.length>=3){var c=this.model.get("min")||this.items.at(0).get("value"),d=this.model.get("max")||this.items.at(1).get("value"),e=_.extend(this.model.toJSON(),{min:c,max:d});this.$el.html(this.template(e))}this._renderGraph(b)}return this}}),cdb.geo.ui.Legend.Bubble=cdb.geo.ui.BubbleLegend.extend({className:"cartodb-legend bubble",type:"bubble",initialize:function(){this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,min:this.options.min,max:this.options.max,color:this.options.color,show_title:this.options.title?!0:!1}),this.add_related_model(this.model),this._bindModel()},render:function(){return this.$el.html(this.template(this.model.toJSON())),this._renderGraph(this.model.get("color")),this}}),cdb.geo.ui.Legend.Choropleth=cdb.geo.ui.ChoroplethLegend.extend({type:"choropleth",className:"cartodb-legend choropleth",initialize:function(){this.items=this.options.items,this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1,leftLabel:this.options.left||this.options.leftLabel,rightLabel:this.options.right||this.options.rightLabel,colors:this.options.colors,buckets_count:this.options.colors?this.options.colors.length:0}),this.add_related_model(this.model),this._bindModel()},_bindModel:function(){this.model.bind("change:template change:title change:show_title change:colors change:leftLabel change:rightLabel",this.render,this)},_generateColorList:function(){return _.map(this.model.get("colors"),function(a){return'
                    '}).join("")},render:function(){var a=_.extend(this.model.toJSON(),{colors:this._generateColorList()});return this.$el.html(this.template(a)),this}}),cdb.geo.ui.Legend.Intensity=cdb.geo.ui.IntensityLegend.extend({className:"cartodb-legend intensity",type:"intensity",initialize:function(){this.items=this.options.items,this.model=new cdb.geo.ui.LegendModel({type:this.type,title:this.options.title,show_title:this.options.title?!0:!1,color:this.options.color,leftLabel:this.options.left||this.options.leftLabel,rightLabel:this.options.right||this.options.rightLabel}),this.add_related_model(this.model),this._bindModel()},_bindModel:function(){this.model.bind("change:title change:show_title change:color change:leftLabel change:rightLabel",this.render,this)},render:function(){return this.$el.html(this.template(this.model.toJSON())),this._renderGraph(this.model.get("color")),this}}),cdb.geo.ui.SwitcherItemModel=Backbone.Model.extend({}),cdb.geo.ui.SwitcherItems=Backbone.Collection.extend({model:cdb.geo.ui.SwitcherItemModel}),cdb.geo.ui.SwitcherItem=cdb.core.View.extend({tagName:"li",events:{"click a":"select"},initialize:function(){_.bindAll(this,"render"),this.template=cdb.templates.getTemplate("templates/map/switcher/item"),this.parent=this.options.parent,this.model.on("change:selected",this.render)},select:function(a){a.preventDefault(),this.parent.toggle(this);var b=this.model.get("callback");b&&b()},render:function(){return 1==this.model.get("selected")?this.$el.addClass("selected"):this.$el.removeClass("selected"),this.$el.html(this.template(this.model.toJSON())),this.$el}}),cdb.geo.ui.Switcher=cdb.core.View.extend({id:"switcher",default_options:{},initialize:function(){this.map=this.model,this.add_related_model(this.model),_.bindAll(this,"render","show","hide","toggle"),_.defaults(this.options,this.default_options),this.collection&&(this.model.collection=this.collection),this.template=this.options.template?this.options.template:cdb.templates.getTemplate("geo/switcher")},show:function(){this.$el.fadeIn(250)},hide:function(){this.$el.fadeOut(250)},toggle:function(a){this.collection&&this.collection.each(function(a){a.set("selected",!a.get("selected"))})},render:function(){var a=this;return void 0!=this.model&&this.$el.html(this.template(this.model.toJSON())),this.collection&&this.collection.each(function(b){var c=new cdb.geo.ui.SwitcherItem({parent:a,className:b.get("className"),model:b});a.$el.find("ul").append(c.render())}),this}}),cdb.geo.ui.InfowindowModel=Backbone.Model.extend({SYSTEM_COLUMNS:["the_geom","the_geom_webmercator","created_at","updated_at","cartodb_id","cartodb_georef_status"],defaults:{template_name:"infowindow_light",latlng:[0,0],offset:[28,0],maxHeight:180,autoPan:!0,template:"",content:"",visibility:!1,alternative_names:{},fields:null},clearFields:function(){this.set({fields:[]})},saveFields:function(a){a=a||"old_fields",this.set(a,_.clone(this.get("fields")))},fieldCount:function(){var a=this.get("fields");return a?a.length:0},restoreFields:function(a,b){b=b||"old_fields";var c=this.get(b);a&&(c=c.filter(function(b){return _.contains(a,b.name)})),c&&c.length&&this._setFields(c),this.unset(b)},_cloneFields:function(){return _(this.get("fields")).map(function(a){return _.clone(a)})},_setFields:function(a){a.sort(function(a,b){return a.position-b.position}),this.set({fields:a})},sortFields:function(){this.get("fields").sort(function(a,b){return a.position-b.position})},_addField:function(a,b){var c=$.Deferred();if(!this.containsField(a)){var d=this.get("fields");d?(b=void 0===b?d.length:b,d.push({name:a,title:!0,position:b})):(b=void 0===b?0:b,this.set("fields",[{name:a,title:!0,position:b}],{silent:!0}))}return c.resolve(),c.promise()},addField:function(a,b){var c=this;return $.when(this._addField(a,b)).then(function(){c.sortFields(),c.trigger("change:fields"),c.trigger("add:fields")}),this},getFieldProperty:function(a,b){if(this.containsField(a)){var c=this.get("fields")||[],d=_.indexOf(_(c).pluck("name"),a);return c[d][b]}return null},setFieldProperty:function(a,b,c){if(this.containsField(a)){var d=this._cloneFields()||[],e=_.indexOf(_(d).pluck("name"),a);d[e][b]=c,this._setFields(d)}return this},getAlternativeName:function(a){return this.get("alternative_names")&&this.get("alternative_names")[a]},setAlternativeName:function(a,b){var c=this.get("alternative_names")||[];c[a]=b,this.set({alternative_names:c}),this.trigger("change:alternative_names")},getFieldPos:function(a){var b=this.getFieldProperty(a,"position");return void 0==b?Number.MAX_VALUE:b},containsAlternativeName:function(a){var b=this.get("alternative_names")||[];return b[a]},containsField:function(a){var b=this.get("fields")||[];return _.contains(_(b).pluck("name"),a)},removeField:function(a){if(this.containsField(a)){var b=this._cloneFields()||[],c=_.indexOf(_(b).pluck("name"),a);c>=0&&b.splice(c,1),this._setFields(b),this.trigger("remove:fields")}return this},updateContent:function(a){var b=this.get("fields");this.set("content",cdb.geo.ui.InfowindowModel.contentForFields(a,b))},closeInfowindow:function(){this.get("visibility")&&(this.set("visibility",!1),this.trigger("close"))}},{contentForFields:function(a,b,c){c=c||{};for(var d=[],e=0;e0&&null!=a.data()&&a.data().jsp&&a.data().jsp.destroy();var b=_.map(this.model.attributes.content.fields,function(a){return _.clone(a)}),c=this.model.get("content")?this.model.get("content").data:{};if(this.model.get("template_name")){var d=_.clone(this.model.attributes.template_name);b=this._fieldsToString(b,d)}var e={};_.each(this.model.get("content").fields,function(a){e[a.title]=a.value});var f=_.extend({content:{fields:b,data:c}},e);this.$el.html(cdb.core.sanitize.html(this.template(f),this.model.get("sanitizeTemplate"))),this.model.get("width")&&this.$(".cartodb-popup").css("width",this.model.get("width")+"px"),this.$(".cartodb-popup .cartodb-popup-content").css("max-height",this.model.get("maxHeight")+"px");var g=this;setTimeout(function(){var a=g.$(".cartodb-popup-content").outerHeight();g.model.get("maxHeight")<=a&&g.$(".cartodb-popup-content").jScrollPane({verticalDragMinHeight:20,autoReinitialise:!0})},1),this._checkLoading(),this._loadCover(),this.isLoadingData()||(this.model.trigger("domready",this,this.$el),this.trigger("domready",this,this.$el))}return this},_getModelTemplate:function(){return this.model.get("template_name")},_setTemplate:function(){this.model.get("template_name")&&(this.template=cdb.templates.getTemplate(this._getModelTemplate()),this.render())},_compileTemplate:function(){var a=this.model.get("template")?this.model.get("template"):cdb.templates.getTemplate(this._getModelTemplate());"function"!=typeof a?this.template=new cdb.core.Template({template:a,type:this.model.get("template_type")||"mustache"}).asFunction():this.template=a,this.render()},_checkOrigin:function(a){var b=$(a.target).closest(".jspVerticalBar").length>0&&"touchstart"!=a.type;b||a.stopPropagation()},_fieldsToString:function(a,b){var c=[];if(a&&a.length>0){var d=this;c=_.map(a,function(a,c){return d._sanitizeField(a,b,a.index||c)})}return c},_sanitizeField:function(a,b,c){(null==a.value||void 0==a.value)&&(a.value="");var d=this.model.getAlternativeName(a.title);a.title&&d?a.title=d:a.title&&(a.title=a.title.replace(/_/g," "));var e=a.value.toString();return!a.type&&0==c&&a.value.length>35&&b&&-1!=b.search("_header_")&&(e=a.value.substr(0,32)+"..."),!a.type&&1==c&&a.value.length>35&&b&&-1!=b.search("_header_with_image")&&(e=a.value.substr(0,32)+"..."),this._isValidURL(a.value)&&(e=""+e+""),0==c&&-1!=b.search("_header_with_image")&&(e=a.value),a.value=e,a},isLoadingData:function(){var a=this.model.get("content");return a.fields&&1==a.fields.length&&"loading"===a.fields[0].type},_checkLoading:function(){this.isLoadingData()?this._startSpinner():this._stopSpinner()},_stopSpinner:function(){this.spinner&&this.spinner.stop()},_startSpinner:function(a){this._stopSpinner();var a=this.$el.find(".loading");if(a){var b=-1!=this.model.get("template_name").search("dark");b?this.spin_options.color="#FFF":this.spin_options.color="rgba(0,0,0,0.5)",this.spinner=new Spinner(this.spin_options).spin(),a.append(this.spinner.el)}},_containsCover:function(){return this.$el.find(".cartodb-popup.header").attr("data-cover")?!0:!1},_getCoverURL:function(){var a=this.model.get("content");return a&&a.fields&&a.fields.length>0?(a.fields[0].value||"").toString():!1},_loadCover:function(){if(this._containsCover()){var a=this.$(".cover"),b=a.find("img"),c=this.$(".shadow"),d=this._getCoverURL();if(!this._isValidURL(d))return b.hide(),c.hide(),void cdb.log.info("Header image url not valid");var e=document.getElementById("spinner"),f={lines:9,length:4,width:2,radius:4,corners:1,rotate:0,color:"#ccc",speed:1,trail:60,shadow:!0,hwaccel:!1,zIndex:2e9},g=new Spinner(f).spin(e);b.hide(function(){this.remove()}),b=$("").attr("src",d),a.append(b),b.load(function(){g.stop();var c=b.width(),d=b.height(),e=a.width(),f=a.height(),h=d/c,i=f/e;if(c>e&&d>f)if(i>h)b.css({height:f});else{var j=d/(c/e);b.css({width:e,top:"50%",position:"absolute","margin-top":-1*parseInt(j,10)/2})}else{var j=d/(c/e);b.css({width:e,top:"50%",position:"absolute","margin-top":-1*parseInt(j,10)/2})}b.fadeIn(300)}).error(function(){g.stop()})}},_isValidURL:function(a){if(a){var b=/^(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-|]*[\w@?^=%&\/~+#-])?$/;return null!=String(a).match(b)?!0:!1}return!1},toggle:function(){this.model.get("visibility")?this.show():this.hide()},_stopBubbling:function(a){a.preventDefault(),a.stopPropagation()},_stopPropagation:function(a){a.stopPropagation()},setLoading:function(){return this.model.set({content:{fields:[{title:null,alternative_name:null,value:"Loading content...",index:null,type:"loading"}],data:{}}}),this},setError:function(){return this.model.set({content:{fields:[{title:null,alternative_name:null,value:"There has been an error...",index:null,type:"error"}],data:{}}}),this},setLatLng:function(a){return this.model.set("latlng",a),this},_closeInfowindow:function(a){a&&(a.preventDefault(),a.stopPropagation()),this.model.get("visibility")&&(this.model.set("visibility",!1),this.trigger("close"))},showInfowindow:function(){this.model.set("visibility",!0)},show:function(a){var b=this;this.model.get("visibility")&&(b.$el.css({left:-5e3}),b._update(a))},isHidden:function(){return!this.model.get("visibility")},hide:function(a){(a||!this.model.get("visibility"))&&this._animateOut()},_update:function(a){if(!this.isHidden()){var b=0;if(!a)var b=this.adjustPan();this._updatePosition(),this._animateIn(b)}},_animateIn:function(a){!cdb.core.util.ie||cdb.core.util.browser.ie&&cdb.core.util.browser.ie.version>8?(this.$el.css({marginBottom:"-10px",display:"block",visibility:"visible",opacity:0}),this.$el.delay(a).animate({opacity:1,marginBottom:0},300)):this.$el.show()},_animateOut:function(){if(!$.browser.msie||$.browser.msie&&parseInt($.browser.version)>8){var a=this;this.$el.animate({marginBottom:"-10px",opacity:"0",display:"block"},180,function(){a.$el.css({visibility:"hidden"})})}else this.$el.hide()},_updatePosition:function(){if(!this.isHidden()){var a=this.model.get("offset"),b=this.mapView.latLonToPixel(this.model.get("latlng")),c=(this.$el.position().left,this.$el.position().top,this.$el.outerHeight(!0),this.$el.width(),b.x-a[0]),d=this.mapView.getSize(),e=-1*(b.y-a[1]-d.y);this.$el.css({bottom:e,left:c})}},adjustPan:function(){var a=this.model.get("offset");if(this.model.get("autoPan")&&!this.isHidden()){var b=(this.$el.position().left,this.$el.position().top,this.$el.outerHeight(!0)+15),c=this.$el.width(),d=this.mapView.latLonToPixel(this.model.get("latlng")),e={x:0,y:0};return size=this.mapView.getSize(),wait_callback=0,d.x-a[0]<0&&(e.x=d.x-a[0]-10),d.x-a[0]+c>size.x&&(e.x=d.x+c-size.x-a[0]+10),d.y-b<0&&(e.y=d.y-b-10),d.y-b>size.y&&(e.y=d.y+b-size.y),(e.x||e.y)&&(this.mapView.panBy(e),wait_callback=300),wait_callback}}}),cdb.geo.ui.Header=cdb.core.View.extend({className:"cartodb-header",initialize:function(){var a=this.model.get("extra");this.model.set({title:a.title,description:a.description,show_title:a.show_title,show_description:a.show_description},{silent:!0})},show:function(){var a=this.model.get("title")&&this.model.get("show_title"),b=this.model.get("description")&&this.model.get("show_description");(a||b)&&(this.$el.show(),a&&this.$el.find(".content div.title").show(),b&&this.$el.find(".content div.description").show())},_setLinksTarget:function(a){if(!a)return a;var b=new RegExp(/<(a)([^>]+)>/g);return a.replace(b,'<$1 target="_blank"$2>')},render:function(){var a=_.clone(this.model.attributes);return a.title=cdb.core.sanitize.html(a.title),a.description=this._setLinksTarget(cdb.core.sanitize.html(a.description)),this.$el.html(this.options.template(a)),this.options.slides&&(this.slides_controller=new cdb.geo.ui.SlidesController({transitions:this.options.transitions,slides:this.options.slides}),this.$el.append(this.slides_controller.render().$el)),this.model.get("show_title")||this.model.get("show_description")?this.show():this.hide(),this}}),cdb.geo.ui.Search=cdb.core.View.extend({className:"cartodb-searchbox",_ZOOM_BY_CATEGORY:{building:18,"postal-area":15,venue:18,region:8,address:18,country:5,county:8,locality:12,localadmin:11,neighbourhood:15,"default":12},events:{"click input[type='text']":"_onFocus","submit form":"_onSubmit",click:"_stopPropagation",dblclick:"_stopPropagation",mousedown:"_stopPropagation"},options:{searchPin:!0,infowindowTemplate:'
                    x

                    {{ address }}

                    ',infowindowWidth:186,infowindowOffset:[93,90],iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAfCAYAAADXwvzvAAACuklEQVR4Ae3PQ+AsNxzA8e8vo/Xus237vVN9qW3b7qW2bdu2caxt29bu/meSmaTpqW63Pfc7wemTZPh9K/Xv3zhzxIgVrho0aMsLGo2N9o+iuYDwV02E5NJpM7d5fMGC515dMP/7l6dNMc+OGJY9Uq99cVMc33I4LOJXCQBQuXPBglNnDRm0Xa1RAWewP3yL/vJLul99Q/pNm0/b+qsnbLHngXAVgAI4b9KkXWc1m9vV58ykst56lKdMptyokdTKRJUIV1MMTGTgbOTknWABgFo2SSbOjuN9wlgIBrSIJ0yiVG9QUgGxUigRRAlpCQYrBs+A/QClliuXV6ppPVibDPPqi5irL8G+/QY2S3FZhityrLNYBWkAI2G5WTA2nGTthKDTJfP/FH1sCb76nNBa7I8/knba6Eyj8wJjLbk4qlCdAFNClWXKiiL72kGRUkSRhwUuTUm7XTqZ3z3KnMM7QhAFUfiKMZ9OQci+ydFFH32BIsDh8hxjDF2T0y0KtHHUczCg34P3wgesfWhZozstW1R/cJpuohA8dI7cWrSfxqM4gwEOnoJnn4HXBVDHwHnriNr2W3G0I8FEkKufMbjcIw1DC+iCuRw2OBduEYAKDD8drlkGlk6BHwAtIEDioD/QBnsnnHAI7A9YAAAGenwEnPuAd8+DewHcS+CeB3szvL0b7ADE/FWzYf5BCxa9dMvqa7oLll7WbTlsxKkDYRi9dPqhRz743L0PuKtOPMXtutHmm/InKf5Y6Co15Upl8qSCqVajXiEeUTRb6GqNIojoGaLEDwEA6B0KIKL8lH8JBeS/3AgK73qAPfc/tCLiAACUCmyvsJHnphwEAYFStNs/NoHgn2ATWPmlF54b/9GHH/Khn88/+9SywJx/+q0SsKTZbB45d/6CO0aNHnutv3kbYDQg9JAAIRDwF/0EjlkjUi3fkAMAAAAASUVORK5CYII=",iconAnchor:[7,31]},initialize:function(){this.mapView=this.options.mapView,this.template=this.options.template},render:function(){return this.$el.html(this.template(this.options)),this},_stopPropagation:function(a){a&&a.stopPropagation()},_onFocus:function(a){a&&(a.preventDefault(),$(a.target).focus())},_showLoader:function(){this.$("span.loader").show()},_hideLoader:function(){this.$("span.loader").hide()},_onSubmit:function(a){a.preventDefault();var b=this,c=this.$("input.text").val();c&&(this._showLoader(),this._destroySearchPin(),cdb.geo.geocoder.MAPZEN.geocode(c,function(a){b._onResult(a),b._hideLoader()}))},_onResult:function(a){var b="",c=this.$("input.text").val();if(a&&a.length>0){var d=a[0],e=this._isBBoxValid(d);if(e){var f=parseFloat(d.boundingbox.south),g=parseFloat(d.boundingbox.west),h=parseFloat(d.boundingbox.north),i=parseFloat(d.boundingbox.east),j=(g+i)/2,k=(f+h)/2;b=[k,j],this.model.setBounds([[f,g],[h,i]])}d.lat&&d.lon&&(b=[d.lat,d.lon]),e||(this.model.setCenter(b),this.model.setZoom(this._getZoomByCategory(d.type))),this.options.searchPin&&this._createSearchPin(b,c)}},_getZoomByCategory:function(a){return a&&this._ZOOM_BY_CATEGORY[a]?this._ZOOM_BY_CATEGORY[a]:this._ZOOM_BY_CATEGORY["default"]},_isBBoxValid:function(a){return a.boundingbox&&a.boundingbox.south!=a.boundingbox.north&&a.boundingbox.east!=a.boundingbox.west?!0:!1},_createSearchPin:function(a,b){this._destroySearchPin(),this._createPin(a,b),this._createInfowindow(a,b),this._bindEvents()},_destroySearchPin:function(){this._unbindEvents(),this._destroyPin(),this._destroyInfowindow()},_createInfowindow:function(a,b){var c=new cdb.geo.ui.InfowindowModel({template:this.options.infowindowTemplate,latlng:a,width:this.options.infowindowWidth,offset:this.options.infowindowOffset,content:{fields:[{title:"address",value:b}]}});this._searchInfowindow=new cdb.geo.ui.Infowindow({model:c,mapView:this.mapView}),this.mapView.$el.append(this._searchInfowindow.el),c.set("visibility",!0)},_destroyInfowindow:function(){if(this._searchInfowindow){this._searchInfowindow.hide(!0);var a=this._searchInfowindow;setTimeout(function(){a.clean()},1e3)}},_createPin:function(a,b){this._searchPin=this.mapView._addGeomToMap(new cdb.geo.Geometry({geojson:{type:"Point",coordinates:[a[1],a[0]]},iconUrl:this.options.iconUrl,iconAnchor:this.options.iconAnchor}))},_toggleSearchInfowindow:function(){var a=this._searchInfowindow.model.get("visibility");this._searchInfowindow.model.set("visibility",!a)},_destroyPin:function(){this._searchPin&&(this.mapView._removeGeomFromMap(this._searchPin),delete this._searchPin)},_bindEvents:function(){this._searchPin&&this._searchPin.bind("click",this._toggleSearchInfowindow,this),this.mapView.bind("click",this._destroySearchPin,this)},_unbindEvents:function(){this._searchPin&&this._searchPin.unbind("click",this._toggleSearchInfowindow,this),this.mapView.unbind("click",this._destroySearchPin,this)},clean:function(){this._unbindEvents(),this._destroySearchPin(),this.elder("clean")}}),cdb.geo.ui.LayerSelector=cdb.core.View.extend({className:"cartodb-layer-selector-box",events:{click:"_openDropdown",dblclick:"killEvent",mousedown:"killEvent"},initialize:function(){this.map=this.options.mapView.map,this.mapView=this.options.mapView,this.mapView.bind("click zoomstart drag",function(){this.dropdown&&this.dropdown.hide()},this),this.add_related_model(this.mapView),this.layers=[]},render:function(){return this.$el.html(this.options.template(this.options)),this.dropdown=new cdb.ui.common.Dropdown({className:"cartodb-dropdown border",template:this.options.dropdown_template,target:this.$el.find("a"),speedIn:300,speedOut:200,position:"position",tick:"right",vertical_position:"down",horizontal_position:"right",vertical_offset:7,horizontal_offset:13}),cdb.god&&cdb.god.bind("closeDialogs",this.dropdown.hide,this.dropdown),this.$el.append(this.dropdown.render().el),this._getLayers(),this._setCount(),this},_getLayers:function(){var a=this;this.layers=[],_.each(this.map.layers.models,function(b){if("layergroup"==b.get("type")||"namedmap"===b.get("type"))for(var c=a.mapView.getLayerByCid(b.cid),d=0;db;++b){var d=this.layers[b];d.model.get("visible")&&a++}this.$(".count").text(a),this.trigger("switchChanged",this)},_openDropdown:function(){this.dropdown.open()}}),cdb.geo.ui.LayerView=cdb.core.View.extend({tagName:"li",defaults:{template:' <%- layer_name %> switch"> '},events:{click:"_onSwitchClick"},initialize:function(){this.model.has("visible")||this.model.set("visible",!1),this.model.bind("change:visible",this._onSwitchSelected,this),this.add_related_model(this.model),this._onSwitchSelected(),this.template=this.options.template?cdb.templates.getTemplate(this.options.template):_.template(this.defaults.template)},render:function(){var a=_.clone(this.model.attributes);return a.layer_name=a.layer_name||a.table_name,this.$el.append(this.template(a)),this},_onSwitchSelected:function(){var a=this.model.get("visible");this.$el.find(".switch").removeClass(a?"disabled":"enabled").addClass(a?"enabled":"disabled"),this.trigger("switchChanged")},_onSwitchClick:function(a){this.killEvent(a),this.model.set("visible",!this.model.get("visible"))}}),cdb.geo.ui.LayerViewFromLayerGroup=cdb.geo.ui.LayerView.extend({_onSwitchSelected:function(){cdb.geo.ui.LayerView.prototype._onSwitchSelected.call(this);var a=this.options.layerView.getSubLayer(this.options.layerIndex),b=this.model.get("visible");b?a.show():a.hide()}}),cdb.geo.ui.SlidesControllerItem=cdb.core.View.extend({tagName:"li",events:{"click a":"_onClick"},template:cdb.core.Template.compile(''),initialize:function(){this.model=new cdb.core.Model(this.options),this.model.bind("change:active",this._onChangeActive,this)},_onChangeActive:function(a){this.model.get("active")?this.$el.find("a").addClass("active"):this.$el.find("a").removeClass("active")},_onClick:function(a){a&&this.killEvent(a),this.trigger("onClick",this)},render:function(){var a=_.extend({transition_trigger:"click"},this.options.transition_options);return this.$el.html(this.template(a)),this._onChangeActive(),this}}),cdb.geo.ui.SlidesController=cdb.core.View.extend({defaults:{show_counter:!1},events:{"click a.next":"_next","click a.prev":"_prev"},tagName:"div",className:"cartodb-slides-controller",template:cdb.core.Template.compile("
                    <% if (show_counter) {%>
                    <% } else { %>
                      <% } %>
                      "),initialize:function(){this.slidesCount=this.options.transitions.length,this.visualization=this.options.visualization,this.slides=this.visualization.slides},_prev:function(a){a&&this.killEvent(a),this.visualization.sequence.prev()},_next:function(a){a&&this.killEvent(a),this.visualization.sequence.next()},_renderDots:function(){for(var a=this.slides.state(),b=0;b

                      <%- layer_name %><% } %>

                      "),_stopPropagation:function(a){a.stopPropagation()},initialize:function(){_.defaults(this.options,this.default_options),this.model.bind("change:visible",this._onChangeVisible,this)},_onChangeVisible:function(){this.$el.find(".legend")[this.model.get("visible")?"fadeIn":"fadeOut"](150),this.$el[this.model.get("visible")?"removeClass":"addClass"]("hidden"),this.trigger("change_visibility",this)},_toggle:function(a){a.preventDefault(),a.stopPropagation(),this.options.hide_toggle||this.model.set("visible",!this.model.get("visible"))},_renderLegend:function(){if(this.options.show_legends&&(!this.model.get("legend")||"none"!=this.model.get("legend").type&&this.model.get("legend").type)&&(!this.model.get("legend")||!this.model.get("legend").items||0!=this.model.get("legend").items.length)){this.$el.addClass("has-legend");var a=new cdb.geo.ui.Legend(this.model.get("legend"));a.undelegateEvents(),this.$el.append(a.render().$el)}},_truncate:function(a,b){return a.substr(0,b-1)+(a.length>b?"…":"")},render:function(){var a=this.model.get("layer_name");a=a?this._truncate(a,23):"untitled";var b=_.extend(this.model.attributes,{layer_name:this.options.show_title?a:"",toggle_class:this.options.hide_toggle?" hide":""});return this.$el.html(this.template(_.extend(b,{show_title:this.options.show_title}))),this.options.hide_toggle&&this.$el.removeClass("has-toggle"),this.model.get("visible")||this.$el.addClass("hidden"),this.model.get("legend")&&this._renderLegend(),this._onChangeVisible(),this}}),cdb.geo.ui.Mobile=cdb.core.View.extend({className:"cartodb-mobile",events:{"click .cartodb-attribution-button":"_onAttributionClick","click .toggle":"_toggle","click .fullscreen":"_toggleFullScreen","click .backdrop":"_onBackdropClick","dblclick .aside":"_stopPropagation","dragstart .aside":"_checkOrigin","mousedown .aside":"_checkOrigin","touchstart .aside":"_checkOrigin","MSPointerDown .aside":"_checkOrigin"},initialize:function(){_.bindAll(this,"_toggle","_reInitScrollpane"),_.defaults(this.options,this.default_options),this.hasLayerSelector=!1,this.layersLoading=0,this.slides_data=this.options.slides_data,this.visualization=this.options.visualization,this.visualization&&(this.slides=this.visualization.slides),this.mobileEnabled=/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.visibility_options=this.options.visibility_options||{},this.mapView=this.options.mapView,this.map=this.mapView.map,this.template=this.options.template?this.options.template:cdb.templates.getTemplate("geo/zoom"),this._selectOverlays(),this._setupModel(),window.addEventListener("orientationchange",_.bind(this.doOnOrientationChange,this)),this._addWheelEvent()},loadingTiles:function(){this.loader&&this.loader.show(),0===this.layersLoading&&this.trigger("loading"),this.layersLoading++},loadTiles:function(){this.loader&&this.loader.hide(),this.layersLoading--,this.layersLoading<=0&&(this.layersLoading=0,this.trigger("load"))},_selectOverlays:function(){if(this.slides&&this.slides_data){var a=this.slides.state();0==a?this.overlays=this.options.overlays:this.overlays=this.slides_data[a-1].overlays}else this.overlays=this.options.overlays},_addWheelEvent:function(){var a=this.options.mapView;$(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange",function(){document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||a.options.map.set("scrollwheel",!1),a.invalidateSize()})},_setupModel:function(){this.model=new Backbone.Model({open:!1,layer_count:0}),this.model.on("change:open",this._onChangeOpen,this),this.model.on("change:layer_count",this._onChangeLayerCount,this)},_checkOrigin:function(a){var b=$(a.target).closest(".jspVerticalBar").length>0&&"touchstart"!=a.type;b||a.stopPropagation()},_stopPropagation:function(a){a.stopPropagation()},_onBackdropClick:function(a){a.preventDefault(),a.stopPropagation(),this.$el.find(".backdrop").fadeOut(250),this.$el.find(".cartodb-attribution").fadeOut(250)},_onAttributionClick:function(a){a.preventDefault(),a.stopPropagation(),this.$el.find(".backdrop").fadeIn(250),this.$el.find(".cartodb-attribution").fadeIn(250)},_toggle:function(a){a.preventDefault(),a.stopPropagation(),this.model.set("open",!this.model.get("open"))},_toggleFullScreen:function(a){a.stopPropagation(),a.preventDefault();var b=window.document,c=$("#map > div")[0],d=c.requestFullscreen||c.mozRequestFullScreen||c.webkitRequestFullScreen,e=b.exitFullscreen||b.mozCancelFullScreen||b.webkitExitFullscreen,f=this.options.mapView;b.fullscreenElement||b.mozFullScreenElement||b.webkitFullscreenElement?e.call(b):(d.call(c),f&&f.options.map.set("scrollwheel",!0))},_open:function(){var a=this.$el.find(".aside").width();this.$el.find(".cartodb-header").animate({right:a},200),this.$el.find(".aside").animate({right:0},200),this.$el.find(".cartodb-attribution-button").animate({right:a+parseInt(this.$el.find(".cartodb-attribution-button").css("right"))},200),this.$el.find(".cartodb-attribution").animate({right:a+parseInt(this.$el.find(".cartodb-attribution-button").css("right"))},200),this._initScrollPane()},_close:function(){this.$el.find(".cartodb-header").animate({right:0},200),this.$el.find(".aside").animate({right:-this.$el.find(".aside").width()},200),this.$el.find(".cartodb-attribution-button").animate({right:20},200),this.$el.find(".cartodb-attribution").animate({right:20},200)},default_options:{timeout:0,msg:""},_stopPropagation:function(a){a.stopPropagation()},doOnOrientationChange:function(){switch(window.orientation){case-90:case 90:this.recalc("landscape");break;default:this.recalc("portrait")}},recalc:function(a){var b=$(".legends > div.cartodb-legend-stack").height();this.$el.hasClass("open")&&100>b&&!this.$el.hasClass("torque")?(this.$el.css("height",b),this.$el.find(".top-shadow").hide(),this.$el.find(".bottom-shadow").hide()):this.$el.hasClass("open")&&100>b&&this.$el.hasClass("legends")&&this.$el.hasClass("torque")&&(this.$el.css("height",b+$(".legends > div.torque").height()),this.$el.find(".top-shadow").hide(),this.$el.find(".bottom-shadow").hide())},_onChangeLayerCount:function(){var a=this.model.get("layer_count"),b=a+" layer"+(1!=a?"s":"");this.$el.find(".aside .layer-container > h3").html(b)},_onChangeOpen:function(){this.model.get("open")?this._open():this._close()},_createLayer:function(a,b){return new cdb.geo.ui[a](b)},_getLayers:function(){this.layers=[],this.options.layerView?this._getLayersFromLayerView():_.each(this.map.layers.models,this._getLayer,this)},_getLayersFromLayerView:function(){if(this.options.layerView&&"layergroup"==this.options.layerView.model.get("type"))this.layers=_.map(this.options.layerView.layers,function(b,c){var d=new cdb.core.Model(b);return d.set("order",c),d.set("type","layergroup"),d.set("visible",b.visible),d.set("layer_name",b.options.layer_name),a=this._createLayer("LayerViewFromLayerGroup",{model:d,layerView:this.options.layerView,layerIndex:c}),a.model},this);else if(this.options.layerView&&"torque"==this.options.layerView.model.get("type")){var a=this._createLayer("LayerView",{model:this.options.layerView.model});this.layers.push(a.model)}},_getLayer:function(a){if("layergroup"==a.get("type")||"namedmap"===a.get("type"))for(var b=this.mapView.getLayerByCid(a.cid),c=0;c+ -
                      ',"mustache"),b=new cdb.geo.ui.Zoom({model:this.options.map,template:a});this.$el.append(b.render().$el),this.$el.addClass("with-zoom")},_addLoader:function(){var a=cdb.core.Template.compile('
                      ',"mustache");this.loader=new cdb.geo.ui.TilesLoader({template:a}),this.$el.append(this.loader.render().$el),this.$el.addClass("with-loader")},_addFullscreen:function(){0!=this.visibility_options.fullscreen&&(this.hasFullscreen=!0,this.$el.addClass("with-fullscreen"))},_addSearch:function(){this.hasSearch=!0;var a=cdb.core.Template.compile('
                      ',"mustache"),b=new cdb.geo.ui.Search({template:a,mapView:this.mapView,model:this.mapView.map});this.$el.find(".aside").prepend(b.render().$el),this.$el.find(".cartodb-searchbox").show(),this.$el.addClass("with-search")},_addHeader:function(a){this.hasHeader=!0,this.$header=this.$el.find(".cartodb-header");var b=_.template('
                      <% if (show_title) { %>
                      <%= title %>
                      <% } %><% if (show_description) { %>
                      <%= description %><% } %>
                      '),c=a.options.extra,d=!1,e=!1,f=!1;if(c){(this.visibility_options.title||0!=this.visibility_options.title&&c.show_title)&&(d=!0,e=!0),(this.visibility_options.description||0!=this.visibility_options.description&&c.show_description)&&(d=!0,f=!0),this.slides&&(d=!0);var g=b({title:cdb.core.sanitize.html(c.title),show_title:e,description:cdb.core.sanitize.html(c.description),show_description:f});d&&(this.$el.addClass("with-header"),this.$header.find(".content").append(g))}},_addAttributions:function(){var a="";this.options.mapView.$el.find(".leaflet-control-attribution").hide(),this.options.layerView?(a=this.options.layerView.model.get("attribution"),this.$el.find(".cartodb-attribution").append(a)):this.options.map.get("attribution")&&(a=this.options.map.get("attribution"),_.each(a,function(a){var b=$("
                    • ");b.html(a);this.$el.find(".cartodb-attribution").append(b)},this)),a&&this.$el.find(".cartodb-attribution-button").fadeIn(250)},_renderLayers:function(){var a=this.visibility_options.legends,b=this.layers.filter(function(a){return a.get("legend")&&"none"!==a.get("legend").type}),c=b.length?!0:!1;(this.hasLayerSelector||a)&&(this.hasLayerSelector||c)&&0!=this.layers.length&&(1!=this.layers.length||c)&&(this.$el.addClass("with-layers"),this.model.set("layer_count",0),this.hasSearch||this.$el.find(".aside .layer-container").prepend("

                      "),_.each(this.layers,this._renderLayer,this))},_renderLayer:function(a){var b=a.get("legend")&&""!==a.get("legend").type&&"none"!==a.get("legend").type;if((this.hasLayerSelector||b)&&(this.hasLayerSelector||a.get("visible"))){var c=1==this.layers.length||!this.hasLayerSelector,d=!0;this.visibility_options&&void 0!==this.visibility_options.legends&&(d=this.visibility_options.legends);var e=new cdb.geo.ui.MobileLayer({model:a,show_legends:d,show_title:this.hasLayerSelector?!0:!1,hide_toggle:c});this.$el.find(".aside .layers").append(e.render().$el),e.bind("change_visibility",this._reInitScrollpane,this),this.model.set("layer_count",this.model.get("layer_count")+1)}},_renderTorque:function(){this.options.torqueLayer&&(this.hasTorque=!0,this.slider=new cdb.geo.ui.TimeSlider({type:"time_slider",layer:this.options.torqueLayer,map:this.options.map,pos_margin:0,position:"none",width:"auto"}),this.slider.bind("time_clicked",function(){this.slider.toggleTime()},this),this.$el.find(".torque").append(this.slider.render().$el),this.options.torqueLayer.hidden?this.slider.hide():this.$el.addClass("with-torque"))},_renderSlidesController:function(){this.slides&&(this.$el.addClass("with-slides"),this.slidesController=new cdb.geo.ui.SlidesController({show_counter:!0,transitions:this.options.transitions,visualization:this.options.visualization,slides:this.slides}),this.$el.append(this.slidesController.render().$el))},render:function(){return this._bindOrientationChange(),this.$el.html(this.template(this.options)),this.$header=this.$el.find(".cartodb-header"),this.$header.show(),this._renderOverlays(),this._renderSlidesController(),this._addAttributions(),this._getLayers(),this._renderLayers(),this._renderTorque(),this}}),cdb.geo.ui.TilesLoader=cdb.core.View.extend({className:"cartodb-tiles-loader",default_options:{animationSpeed:500},initialize:function(){_.defaults(this.options,this.default_options),this.isVisible=0,this.template=this.options.template?this.options.template:cdb.templates.getTemplate("geo/tiles_loader")},render:function(){return this.$el.html($(this.template(this.options))),this},show:function(a){this.isVisible||(!cdb.core.util.ie||cdb.core.util.browser.ie&&cdb.core.util.browser.ie.version>=10?this.$el.fadeTo(this.options.animationSpeed,1):this.$el.show(),this.isVisible++)},hide:function(a){this.isVisible--,this.isVisible>0||(this.isVisible=0,!cdb.core.util.ie||cdb.core.util.browser.ie&&cdb.core.util.browser.ie.version>=10?this.$el.stop(!0).fadeTo(this.options.animationSpeed,0):this.$el.hide())},visible:function(){return this.isVisible>0}}),cdb.geo.ui.InfoBox=cdb.core.View.extend({className:"cartodb-infobox",defaults:{pos_margin:20,position:"bottom|right",width:200},initialize:function(){_.defaults(this.options,this.defaults),this.options.layer&&this.enable(),this.setTemplate(this.options.template||this.defaultTemplate,"mustache")},setTemplate:function(a){this.template=cdb.core.Template.compile(a,"mustache")},enable:function(){this.options.layer&&this.options.layer.on("featureOver",function(a,b,c,d){this.render(d).show()},this).on("featureOut",function(){this.hide()},this)},disable:function(){this.options.layer&&this.options.layer.off(null,null,this)},setPosition:function(a){var b={};-1!==a.indexOf("top")?b.top=this.options.pos_margin:-1!==a.indexOf("bottom")&&(b.bottom=this.options.pos_margin),-1!==a.indexOf("left")?b.left=this.options.pos_margin:-1!==a.indexOf("right")&&(b.right=this.options.pos_margin),this.$el.css(b)},render:function(a){return this.$el.html(this.template(a)),this.options.width&&this.$el.css("width",this.options.width),this.options.position&&this.setPosition(this.options.position),this}}),cdb.geo.ui.Tooltip=cdb.geo.ui.InfoBox.extend({defaultTemplate:"

                      {{text}}

                      ",className:"cartodb-tooltip",defaults:{vertical_offset:0,horizontal_offset:0,position:"top|center"},initialize:function(){if(!this.options.mapView)throw new Error("mapView should be present");this.options.template=this.options.template||this.defaultTemplate,cdb.geo.ui.InfoBox.prototype.initialize.call(this),this._filter=null,this.showing=!1,this.showhideTimeout=null},setLayer:function(a){return this.options.layer=a,this},setFilter:function(a){return this._filter=a,this},setFields:function(a){return this.options.fields=a,this},setAlternativeNames:function(a){this.options.alternative_names=a},enable:function(){this.options.layer&&(this.options.layer.unbind(null,null,this),this.options.layer.on("mouseover",function(a,b,c,d){if(this.options.fields&&this.options.fields.length>0){var e=["fields","content"];this.options.omit_columns&&(e=e.concat(this.options.omit_columns));var f=cdb.geo.ui.InfowindowModel.contentForFields(d,this.options.fields,{empty_fields:this.options.empty_fields});d.content=_.omit(d,e),d.fields=f.fields;var g=this.options.alternative_names;if(g)for(var h=0;hf?f=a.y:f+c>e.y&&(f=a.y-c),g=-1!==b.indexOf("left")?a.x-d:-1!==b.indexOf("center")?a.x-d/2:a.x,0>g?g=a.x:g+d>e.x&&(g=a.x-d),f+=this.options.vertical_offset,g+=this.options.horizontal_offset,this.$el.css({top:f,left:g})},render:function(a){var b=cdb.core.sanitize.html(this.template(a));return this.$el.html(b),this}}),cdb.ui.common.FullScreen=cdb.core.View.extend({tagName:"div",className:"cartodb-fullscreen",events:{"click a":"_toggleFullScreen"},initialize:function(){_.bindAll(this,"render"),_.defaults(this.options,this.default_options),this._addWheelEvent()},_addWheelEvent:function(){var a=this,b=this.options.mapView;$(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange",function(){document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||a.model.get("allowWheelOnFullscreen")&&b.options.map.set("scrollwheel",!1),b.invalidateSize()})},_toggleFullScreen:function(a){a&&this.killEvent(a);var b=window.document,c=b.documentElement;this.options.doc&&(c=$(this.options.doc)[0]);var d=c.requestFullscreen||c.mozRequestFullScreen||c.webkitRequestFullScreen||c.msRequestFullscreen,e=b.exitFullscreen||b.mozCancelFullScreen||b.webkitExitFullscreen||b.msExitFullscreen,f=this.options.mapView;b.fullscreenElement||b.mozFullScreenElement||b.webkitFullscreenElement||b.msFullscreenElement?e.call(b):(c.webkitRequestFullScreen?d.call(c,void 0):d&&d.call(c),f&&this.model.get("allowWheelOnFullscreen")&&f.map.set("scrollwheel",!0))},render:function(){var a=_.extend(this.options,{mapUrl:location.href||""});return this.$el.html(this.options.template(a)),this._canFullScreenBeEnabled()||(this.undelegateEvents(),cdb.log.info("FullScreen API is deprecated on insecure origins. See https://goo.gl/rStTGz for more details.")),this},_canFullScreenBeEnabled:function(){if(this._isInIframe()){var a=document.referrer;if(0!==a.search("https:"))return!1}return!0},_isInIframe:function(){try{return window.self!==window.top}catch(a){return!0}}}),SubLayerFactory.createSublayer=function(a,b,c){if(a=a&&a.toLowerCase(),a&&"mapnik"!==a&&"cartodb"!==a){if("http"===a)return new HttpSubLayer(b,c);throw"Sublayer type not supported"}return new CartoDBSubLayer(b,c)},SubLayerBase.prototype={toJSON:function(){throw"toJSON must be implemented"},isValid:function(){throw"isValid must be implemented"},remove:function(){this._check(),this._parent.removeLayer(this._position),this._added=!1,this.trigger("remove",this),this._onRemove()},_onRemove:function(){},toggle:function(){return this.get("hidden")?this.show():this.hide(),!this.get("hidden")},show:function(){this.get("hidden")&&this.set({hidden:!1})},hide:function(){this.get("hidden")||this.set({hidden:!0})},set:function(a){this._check();var b=this._parent.getLayer(this._position),c=b.options;for(var d in a)c[d]=a[d];return this._parent.setLayer(this._position,b),void 0!==a.hidden&&this.trigger("change:visibility",this,a.hidden),this},unset:function(a){var b=this._parent.getLayer(this._position);delete b.options[a],this._parent.setLayer(this._position,b)},get:function(a){this._check();var b=this._parent.getLayer(this._position);return b.options[a]},isVisible:function(){return!this.get("hidden")},_check:function(){if(!this._added)throw"sublayer was removed"},_unbindInteraction:function(){this._parent.off&&this._parent.off(null,null,this)},_bindInteraction:function(){if(this._parent.on){var a=this,b=function(b,c){c=c||b,a._parent.on(b,function(){var b=Array.prototype.slice.call(arguments);parseInt(b[b.length-1],10)==a._position&&a.trigger.apply(a,[c].concat(b))},a)};b("featureOver"),b("featureOut"),b("featureClick"),b("layermouseover","mouseover"),b("layermouseout","mouseout")}},_setPosition:function(a){this._position=a}},_.extend(SubLayerBase.prototype,Backbone.Events),CartoDBSubLayer.prototype=_.extend({},SubLayerBase.prototype,{toJSON:function(){var a={type:"cartodb",options:{sql:this.getSQL(),cartocss:this.getCartoCSS(),cartocss_version:this.get("cartocss_version")||"2.1.0"}},b=this.getInteractivity();if(b&&b.length>0){a.options.interactivity=b;var c=this.getAttributes();c.length>0&&(a.options.attributes={id:"cartodb_id",columns:c})}return this.get("raster")&&(a.options.raster=!0,a.options.geom_column="the_raster_webmercator",a.options.geom_type="raster",a.options.raster_band=this.get("raster_band")||0,a.options.cartocss_version=this.get("cartocss_version")||"2.3.0"),a},isValid:function(){return this.get("sql")&&this.get("cartocss")},_onRemove:function(){this._unbindInteraction()},setSQL:function(a){return this.set({sql:a})},setCartoCSS:function(a){return this.set({cartocss:a})},setInteractivity:function(a){return this.set({interactivity:a})},setInteraction:function(a){this._parent.setInteraction(this._position,a)},getSQL:function(){return this.get("sql")},getCartoCSS:function(){return this.get("cartocss")},getInteractivity:function(){var a=this.get("interactivity");return a?("string"==typeof a&&(a=a.split(",")),this._trimArrayItems(a)):void 0},getAttributes:function(){var a=[];return a=this.get("attributes")?this.get("attributes"):_.map(this.infowindow.get("fields"),function(a){return a.name}),this._trimArrayItems(a)},_trimArrayItems:function(a){return _.map(a,function(a){return a.trim()})}}),HttpSubLayer.prototype=_.extend({},SubLayerBase.prototype,{toJSON:function(){var a={type:"http",options:{urlTemplate:this.getURLTemplate()}},b=this.get("subdomains");b&&(a.options.subdomains=b);var c=this.get("tms");return void 0!==c&&(a.options.tms=c),a},isValid:function(){return this.get("urlTemplate")},setURLTemplate:function(a){return this.set({urlTemplate:a})},setSubdomains:function(a){return this.set({subdomains:a})},setTms:function(a){return this.set({tms:a})},getURLTemplate:function(a){return this.get("urlTemplate")},getSubdomains:function(a){return this.get("subdomains")},getTms:function(a){return this.get("tms")}}),MapProperties.prototype.getMapId=function(){return this.mapProperties.layergroupid},MapProperties.prototype.getLayerIndexByType=function(a,b){var c=this.mapProperties.metadata&&this.mapProperties.metadata.layers;if(!c)return a;for(var d={},e=0,f=0;f0&&(f=f&&-1!=a.indexOf(e.type)),f&&c.push(d)}return c}},MapBase.BASE_URL="/api/v1/map",MapBase.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",MapBase.prototype={_buildMapsApiTemplate:function(a){var b=a.tiler_protocol,c=a.tiler_domain,d=""!=a.tiler_port?":"+a.tiler_port:"",e=a.user_name?"{user}.":"";a.maps_api_template=[b,"://",e,c,d].join("")},createMap:function(a){function b(a,b){for(var d;d=c._createMapCallbacks.pop();)d(a,b)}var c=this;clearTimeout(this._timeout),this._createMapCallsStack.push(b),this._createMapCallbacks.push(a),this._timeout=setTimeout(function(){c._createMap(b)},4)},_createMap:function(a){if(a=a||function(){},this._waiting)return this;if(this._createMapCallsStack=[],!this.named_map&&0===this.visibleLayers().length)return void a(null);this._waiting=!0;var b=null;b=this._usePOST()?this._requestPOST:this._requestGET;var c=this._getParamsFromOptions(this.options);return b.call(this,c,a),this},_getParamsFromOptions:function(a){var b=[],c=a.extra_params||{},d=a.map_key||a.api_key||c.map_key||c.api_key;if(d&&b.push("map_key="+d),c.auth_token)if(_.isArray(c.auth_token))for(var e=0,f=c.auth_token.length;f>e;e++)b.push("auth_token[]="+c.auth_token[e]);else b.push("auth_token="+c.auth_token);return this.stat_tag&&b.push("stat_tag="+this.stat_tag),b},_usePOST:function(){if(this.options.cors){if(this.options.force_cors)return!0;var a=JSON.stringify(this.toJSON());if(a.length>this.options.MAX_GET_SIZE)return!0}return!1},_requestPOST:function(a,b){var c=this,d=this.options.ajax,e=cartodb.core.Profiler.metric("cartodb-js.layergroup.post.time").start();d({crossOrigin:!0,type:"POST",method:"POST",dataType:"json",contentType:"application/json",url:this._tilerHost()+this.endPoint+(a.length?"?"+a.join("&"):""),data:JSON.stringify(this.toJSON()),success:function(a){e.end(),0===c._createMapCallsStack.length&&(a.errors?(cartodb.core.Profiler.metric("cartodb-js.layergroup.post.error").inc(),b(null,a)):b(a)),c._requestFinished()},error:function(a){e.end(),cartodb.core.Profiler.metric("cartodb-js.layergroup.post.error").inc();var d={errors:["unknow error"]};0===a.status&&(d={errors:["connection error"]});try{d=JSON.parse(a.responseText)}catch(f){}0===c._createMapCallsStack.length&&b(null,d),c._requestFinished()}})},_requestGET:function(a,b){var c=this,d=this.options.ajax,e=JSON.stringify(this.toJSON()),f=this._getCompressor(e),g=c.JSONPendPoint||c.endPoint;f(e,3,function(e){a.push(e);var f=cartodb.core.Profiler.metric("cartodb-js.layergroup.get.time").start(),h=c.options.dynamic_cdn?c._host():c._tilerHost();d({dataType:"jsonp",url:h+g+"?"+a.join("&"),jsonpCallback:c.options.instanciateCallback,cache:!!c.options.instanciateCallback,success:function(a){f.end(),0===c._createMapCallsStack.length&&(a.errors?(cartodb.core.Profiler.metric("cartodb-js.layergroup.get.error").inc(), +b(null,a)):b(a)),c._requestFinished()},error:function(a){f.end(),cartodb.core.Profiler.metric("cartodb-js.layergroup.get.error").inc();var d={errors:["unknow error"]};try{d=JSON.parse(xhr.responseText)}catch(e){}0===c._createMapCallsStack.length&&b(null,d),c._requestFinished()}})})},_getCompressor:function(a){return this.options.compressor?this.options.compressor:(a=a||JSON.stringify(this.toJSON()),!this.options.force_compress&&a.lengthh;h++)g.push("auth_token[]="+f[h]);d+="?"+g.join("&")}else d+="?auth_token="+f;return d},invalidate:function(){this.mapProperties=null,this.urls=null,this.onLayerDefinitionUpdated()},getTiles:function(a){var b=this;return b.mapProperties?(a&&a(b._layerGroupTiles(b.mapProperties,b.options.extra_params)),this):(this.createMap(function(c,d){if(c)b.mapProperties=new MapProperties(c),c.cdn_url&&(b.options.cdn_url=b.options.cdn_url||{},b.options.cdn_url={http:c.cdn_url.http||b.options.cdn_url.http,https:c.cdn_url.https||b.options.cdn_url.https}),b.urls=b._layerGroupTiles(b.mapProperties,b.options.extra_params),a&&a(b.urls);else if(null!==b.named_map&&d)a&&a(null,d);else if(0===b.visibleLayers().length)return void(a&&a({tiles:[MapBase.EMPTY_GIF],grids:[]}))}),this)},isHttps:function(){return 0===this.options.maps_api_template.indexOf("https")},_layerGroupTiles:function(a,b){var c=[],d=[],e=this._encodeParams(b,this.options.pngParams),f=this._encodeParams(b,this.options.gridParams),g=this.options.subdomains||["0","1","2","3"];this.isHttps()&&(g=[null]);var h=a.getLayerIndexesByType(this.options.filter);if(h.length)for(var i="/"+h.join(",")+"/{z}/{x}/{y}",j="/{z}/{x}/{y}",k=0;kg;g++)c.push(e+"[]="+encodeURIComponent(f[g]));else{var i=encodeURIComponent(f);i=i.replace(/%7Bx%7D/g,"{x}").replace(/%7By%7D/g,"{y}").replace(/%7Bz%7D/g,"{z}"),c.push(e+"="+i)}}return c.join("&")},onLayerDefinitionUpdated:function(){},setSilent:function(a){this.silent=a},_definitionUpdated:function(){this.silent||this.invalidate()},getTileJSON:function(a,b){a=void 0==a?0:a;var c=this;this.getTiles(function(d){return d?void(b&&b(c._tileJSONfromTiles(a,d))):void b(null)})},_tileJSONfromTiles:function(a,b,c){function d(a){for(var b=[],c=0;c=b.length?-1:+b[a]},visibleLayers:function(){for(var a=[],b=0;b=0){if(b.options.hidden){var c=this.interactionEnabled[a];c&&(b.interaction=!0,this.setInteraction(a,!1))}else this.layers[a].interaction&&(this.setInteraction(a,!0),delete this.layers[a].interaction);this.layers[a]=_.clone(b)}return this.invalidate(),this},getTooltipData:function(a){var b=this.layers[a].tooltip;return b&&b.fields&&b.fields.length?b:null},getInfowindowData:function(a){var b,c=this.layers[a].infowindow;return!c&&this.options.layer_definition&&(b=this.options.layer_definition.layers[a])&&(c=b.infowindow),c&&c.fields&&c.fields.length>0?c:null},containInfowindow:function(){for(var a=this.options.layer_definition.layers,b=0;b0)return!0}return!1},containTooltip:function(){for(var a=this.options.layer_definition.layers,b=0;b=0&&(this.layers.splice(a,1),this.interactionEnabled.splice(a,1),this._reorderSubLayers(),this.invalidate()),this},_reorderSubLayers:function(){for(var a=0;a=0){var c=a.type||"cartodb";delete a.type,this.layers.splice(b,0,{type:c,options:a});var d=this.getSubLayer(b);if(!d.isValid())throw d.remove(),"Layer definition should contain all the required attributes";this._definitionUpdated()}return this},setInteractivity:function(a,b){if(void 0===b&&(b=a,a=0),a>=this.getLayerCount()&&0>a)throw new Error("layer does not exist");"string"==typeof b&&(b=b.split(","));for(var c=0;c0)return!0}return!1},containTooltip:function(){for(var a=this.layers||[],b=0;bf;f++)d.test(e[f].className)&&c.push(e[f]);return c.length>0},isRetinaBrowser:function(){return"devicePixelRatio"in window&&window.devicePixelRatio>1||"matchMedia"in window&&window.matchMedia("(min-resolution:144dpi)")&&window.matchMedia("(min-resolution:144dpi)").matches},addWadus:function(a,b,c){var d=this;setTimeout(function(){if(!d.isWadusAdded(c,"cartodb-logo")){var b=document.createElement("div"),e=d.isRetinaBrowser();b.setAttribute("class","cartodb-logo"),b.setAttribute("style","position:absolute; bottom:0; left:0; display:block; border:none; z-index:1000000;");var f=-1===location.protocol.indexOf("https")?"http":"https",g=cdb.config.get("cartodb_logo_link");b.innerHTML="CARTO",c.appendChild(b)}},b||0)}},function(){var a=function(a,b,c){this.leafletLayer=b,this.leafletMap=c,this.model=a,this.setModel(a),this.type=a.get("type")||a.get("kind"),this.type=this.type.toLowerCase()};_.extend(a.prototype,Backbone.Events),_.extend(a.prototype,{setModel:function(a){this.model&&this.model.unbind("change",this._modelUpdated,this),this.model=a,this.model.bind("change",this._modelUpdated,this)},remove:function(){this.leafletMap.removeLayer(this.leafletLayer),this.trigger("remove",this),this.model.unbind(null,null,this),this.unbind()},reload:function(){this.leafletLayer.redraw()}}),cdb.geo.LeafLetLayerView=a}(),function(){if("undefined"!=typeof L){var a=L.Class.extend({includes:L.Mixin.Events,initialize:function(a,b){cdb.geo.LeafLetLayerView.call(this,a,this,b)},onAdd:function(){this.redraw()},onRemove:function(){var a=this.leafletMap.getContainer();a.style.background="none"},_modelUpdated:function(){this.redraw()},redraw:function(){var a=this.leafletMap.getContainer();if(a.style.backgroundColor=this.model.get("color")||"#FFF",this.model.get("image")){var b="transparent url("+this.model.get("image")+") repeat center center";a.style.background=b}},setZIndex:function(){}});_.extend(a.prototype,cdb.geo.LeafLetLayerView.prototype),cdb.geo.LeafLetPlainLayerView=a}}(),function(){if("undefined"!=typeof L){var a=L.TileLayer.extend({initialize:function(a,b){var c={tms:a.get("tms"),attribution:a.get("attribution"),minZoom:a.get("minZoom"),maxZoom:a.get("maxZoom"),subdomains:a.get("subdomains")||"abc",errorTileUrl:a.get("errorTileUrl"),opacity:a.get("opacity")};a.get("tileSize")&&(c.tileSize=a.get("tileSize")),a.get("zoomOffset")&&(c.zoomOffset=a.get("zoomOffset")),L.TileLayer.prototype.initialize.call(this,a.get("urlTemplate"),c),cdb.geo.LeafLetLayerView.call(this,a,this,b)}});_.extend(a.prototype,cdb.geo.LeafLetLayerView.prototype,{_modelUpdated:function(){_.defaults(this.leafletLayer.options,_.clone(this.model.attributes)),this.leafletLayer.options.subdomains=this.model.get("subdomains")||"abc",this.leafletLayer.options.attribution=this.model.get("attribution"),this.leafletLayer.options.maxZoom=this.model.get("maxZoom"),this.leafletLayer.options.minZoom=this.model.get("minZoom"),this.leafletLayer.setUrl(this.model.get("urlTemplate"))}}),cdb.geo.LeafLetTiledLayerView=a}}(),function(){if("undefined"!=typeof L){var a=function(a){return{url:"http://{s}.basemaps.cartocdn.com/"+a+"_all/{z}/{x}/{y}.png",subdomains:"abcd",minZoom:0,maxZoom:18,attribution:'Map designs by Stamen. Data by OpenStreetMap, Provided by CARTO'}},b=function(a){return{url:"https://{s}.maps.nlp.nokia.com/maptile/2.1/maptile/newest/"+a+".day/{z}/{x}/{y}/256/png8?lg=eng&token=A7tBPacePg9Mj_zghvKt9Q&app_id=KuYppsdXZznpffJsKT24",subdomains:"1234",minZoom:0,maxZoom:21,attribution:'©2012 Nokia Terms of use'}},c={roadmap:b("normal"),gray_roadmap:a("light"),dark_roadmap:a("dark"),hybrid:b("hybrid"),terrain:b("terrain"),satellite:b("satellite")},d=L.TileLayer.extend({initialize:function(a,b){var d=c[a.get("base_type")];L.TileLayer.prototype.initialize.call(this,d.url,{tms:!1,attribution:d.attribution,minZoom:d.minZoom,maxZoom:d.maxZoom,subdomains:d.subdomains,errorTileUrl:"",opacity:1}),cdb.geo.LeafLetLayerView.call(this,a,this,b)}});_.extend(d.prototype,cdb.geo.LeafLetLayerView.prototype,{_modelUpdated:function(){}}),cdb.geo.LeafLetGmapsTiledLayerView=d}}(),function(){if("undefined"!=typeof L){var a=L.TileLayer.WMS.extend({initialize:function(a,b){var c={attribution:a.get("attribution"),layers:a.get("layers"),format:a.get("format"),transparent:a.get("transparent"),minZoom:a.get("minZomm"),maxZoom:a.get("maxZoom"),subdomains:a.get("subdomains")||"abc",errorTileUrl:a.get("errorTileUrl"),opacity:a.get("opacity")};a.get("tileSize")&&(c.tileSize=a.get("tileSize")),a.get("zoomOffset")&&(c.zoomOffset=a.get("zoomOffset")),L.TileLayer.WMS.prototype.initialize.call(this,a.get("urlTemplate"),c),cdb.geo.LeafLetLayerView.call(this,a,this,b)}});_.extend(a.prototype,cdb.geo.LeafLetLayerView.prototype,{_modelUpdated:function(){_.defaults(this.leafletLayer.options,_.clone(this.model.attributes)),this.leafletLayer.setUrl(this.model.get("urlTemplate"))}}),cdb.geo.LeafLetWMSLayerView=a}}(),function(){function a(a){var b=a.extend({includes:[cdb.geo.LeafLetLayerView.prototype,Backbone.Events],initialize:function(b,c){var d=this,e=[],f=_.clone(b.attributes);f.map=c;var g,h=f.featureOver,i=f.featureOut,j=f.featureClick,k=-1;f.featureOver=function(a,b,c,f,i){e[i]||d.trigger("layerenter",a,b,c,f,i),e[i]=1,h&&h.apply(this,arguments),d.featureOver&&d.featureOver.apply(d,arguments),a.timeStamp===g&&clearTimeout(k),k=setTimeout(function(){d.trigger("mouseover",a,b,c,f,i),d.trigger("layermouseover",a,b,c,f,i)},0),g=a.timeStamp},f.featureOut=function(a,b){e[b]&&d.trigger("layermouseout",b),e[b]=0,_.any(e)||d.trigger("mouseout"),i&&i.apply(this,arguments),d.featureOut&&d.featureOut.apply(d,arguments)},f.featureClick=_.debounce(function(){j&&j.apply(d,arguments),d.featureClick&&d.featureClick.apply(d,arguments)},10),a.prototype.initialize.call(this,f),cdb.geo.LeafLetLayerView.call(this,b,this,c)},featureOver:function(a,b,c,d,e){this.trigger("featureOver",a,[b.lat,b.lng],c,d,e)},featureOut:function(a,b){this.trigger("featureOut",a,b)},featureClick:function(a,b,c,d,e){this.trigger("featureClick",a,[b.lat,b.lng],c,d,e)},error:function(a){this.trigger("error",a?a.errors||a:"unknown error"),this.model.trigger("error",a?a.errors:"unknown error")},ok:function(a){this.model.trigger("tileOk")},onLayerDefinitionUpdated:function(){this.__update()}});return b}"undefined"!=typeof L&&(L.CartoDBGroupLayerBase=L.TileLayer.extend({interactionClass:wax.leaf.interaction,includes:[cdb.geo.LeafLetLayerView.prototype,CartoDBLayerCommon.prototype],options:{opacity:.99,attribution:cdb.config.get("cartodb_attributions"),debug:!1,visible:!0,added:!1,tiler_domain:"carto.com",tiler_port:"80",tiler_protocol:"http",sql_api_domain:"carto.com",sql_api_port:"80",sql_api_protocol:"http",maxZoom:30,extra_params:{},cdn_url:null,subdomains:null},initialize:function(a){if(a=a||{},L.Util.setOptions(this,a),!a.layer_definition&&!a.sublayers)throw new Error("cartodb-leaflet needs at least the layer_definition or sublayer list");a.layer_definition||(this.options.layer_definition=LayerDefinition.layerDefFromSubLayers(a.sublayers)),LayerDefinition.call(this,this.options.layer_definition,this.options),this.fire=this.trigger,CartoDBLayerCommon.call(this),L.TileLayer.prototype.initialize.call(this),this.interaction=[],this.addProfiling()},addProfiling:function(){this.bind("tileloadstart",function(a){var b=this.tileStats||(this.tileStats={});b[a.tile.src]=cartodb.core.Profiler.metric("cartodb-js.tile.png.load.time").start()});var a=function(a){var b=this.tileStats&&this.tileStats[a.tile.src];b&&b.end()};this.bind("tileload",a),this.bind("tileerror",function(b){cartodb.core.Profiler.metric("cartodb-js.tile.png.error").inc(),a(b)})},getTileUrl:function(a){var b="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";this._adjustTilePoint(a);var c=[b];this.tilejson&&(c=this.tilejson.tiles);var d=(a.x+a.y)%c.length;return L.Util.template(c[d],L.Util.extend({z:this._getZoomForUrl(),x:a.x,y:a.y},this.options))},setOpacity:function(a){if(isNaN(a)||a>1||0>a)throw new Error(a+" is not a valid value");this.options.opacity=Math.min(a,.99),this.options.visible&&(L.TileLayer.prototype.setOpacity.call(this,this.options.opacity),this.fire("updated"))},onAdd:function(a){var b=this;this.options.map=a,0!=this.options.cartodb_logo&&cdb.geo.common.CartoDBLogo.addWadus({left:8,bottom:8},0,a._container),this.__update(function(){var c=L.stamp(b);a._layers[c]&&(L.TileLayer.prototype.onAdd.call(b,a),b.fire("added"),b.options.added=!0)})},getAttribution:function(){return cdb.core.sanitize.html(this.options.attribution)},onRemove:function(a){this.options.added&&(this.options.added=!1,L.TileLayer.prototype.onRemove.call(this,a))},__update:function(a){var b=this;this.fire("updated"),this.fire("loading");this.options.map;this.getTiles(function(c,d){c?(b.tilejson=c,b.setUrl(b.tilejson.tiles[0]),b._reloadInteraction(),b.ok&&b.ok(),a&&a()):(b.error&&b.error(d),a&&a())})},_checkLayer:function(){if(!this.options.added)throw new Error("the layer is not still added to the map")},setAttribution:function(a){this._checkLayer(),this.map.attributionControl.removeAttribution(cdb.core.sanitize.html(this.options.attribution)),this.map.attributionControl.addAttribution(cdb.core.sanitize.html(a)),this.options.attribution=a,this.tilejson.attribution=this.options.attribution,this.fire("updated")},_manageOnEvents:function(a,b){var c=this._findPos(a,b);if(!c||isNaN(c.x)||isNaN(c.y))return!1;var d=a.layerPointToLatLng(c),e=b.e.type.toLowerCase(),f=a.layerPointToContainerPoint(c);switch(e){case"mousemove":if(this.options.featureOver)return this.options.featureOver(b.e,d,f,b.data,b.layer);break;case"click":case"touchend":case"touchmove":case"mspointerup":case"pointerup":case"pointermove":this.options.featureClick&&this.options.featureClick(b.e,d,f,b.data,b.layer)}},_manageOffEvents:function(a,b){return this.options.featureOut?this.options.featureOut&&this.options.featureOut(b.e,b.layer):void 0},_findPos:function(a,b){var c,d,e=0,f=0,g=a.getContainer();if(b.e.changedTouches&&b.e.changedTouches.length>0?(c=b.e.changedTouches[0].clientX+window.scrollX,d=b.e.changedTouches[0].clientY+window.scrollY):(c=b.e.clientX,d=b.e.clientY),g.offsetParent&&g.offsetTop>0){do e+=g.offsetLeft,f+=g.offsetTop;while(g=g.offsetParent);var h=this._newPoint(c-e,d-f)}else var i=g.getBoundingClientRect(),j=window.scrollX||window.pageXOffset,k=window.scrollY||window.pageYOffset,h=this._newPoint((b.e.clientX?b.e.clientX:c)-i.left-g.clientLeft-j,(b.e.clientY?b.e.clientY:d)-i.top-g.clientTop-k);return a.containerPointToLayerPoint(h)},_newPoint:function(a,b){return new L.Point(a,b)}}),L.CartoDBGroupLayer=L.CartoDBGroupLayerBase.extend({includes:[LayerDefinition.prototype],_modelUpdated:function(){this.setLayerDefinition(this.model.get("layer_definition"))}}),L.NamedMap=L.CartoDBGroupLayerBase.extend({includes:[cdb.geo.LeafLetLayerView.prototype,NamedMap.prototype,CartoDBLayerCommon.prototype],initialize:function(a){if(a=a||{},L.Util.setOptions(this,a),!a.named_map&&!a.sublayers)throw new Error("cartodb-leaflet needs at least the named_map");NamedMap.call(this,this.options.named_map,this.options),this.fire=this.trigger,CartoDBLayerCommon.call(this),L.TileLayer.prototype.initialize.call(this),this.interaction=[],this.addProfiling()},_modelUpdated:function(){this.setLayerDefinition(this.model.get("named_map"))}}),cdb.geo.LeafLetCartoDBLayerGroupView=a(L.CartoDBGroupLayer),cdb.geo.LeafLetCartoDBNamedMapView=a(L.NamedMap))}(),function(){if("undefined"!=typeof L){L.CartoDBLayer=L.CartoDBGroupLayer.extend({options:{query:"SELECT * FROM {{table_name}}",opacity:.99,attribution:cdb.config.get("cartodb_attributions"),debug:!1,visible:!0,added:!1,extra_params:{},layer_definition_version:"1.0.0"},initialize:function(a){if(L.Util.setOptions(this,a),!a.table_name||!a.user_name||!a.tile_style)throw"cartodb-leaflet needs at least a CartoDB table name, user_name and tile_style";L.CartoDBGroupLayer.prototype.initialize.call(this,{layer_definition:{version:this.options.layer_definition_version,layers:[{type:"cartodb",options:this._getLayerDefinition(),infowindow:this.options.infowindow}]}}),this.setOptions(this.options)},setQuery:function(a,b){void 0===b&&(b=a,a=0),b=b||"select * from "+this.options.table_name,LayerDefinition.prototype.setQuery.call(this,a,b)},isVisible:function(){return this.visible},isAdded:function(){return this.options.added}});var a=L.CartoDBLayer.extend({initialize:function(a,b){var c=this;_.bindAll(this,"featureOut","featureOver","featureClick");var d=_.clone(a.attributes);d.map=b;var e=d.featureOver,f=d.featureOut,g=d.featureClick;d.featureOver=function(){e&&e.apply(this,arguments),c.featureOver&&c.featureOver.apply(this,arguments)},d.featureOut=function(){f&&f.apply(this,arguments),c.featureOut&&c.featureOut.apply(this,arguments)},d.featureClick=function(){g&&g.apply(this,arguments),c.featureClick&&c.featureClick.apply(d,arguments)},a.bind("change:visible",function(){c.model.get("visible")?c.show():c.hide()},this),L.CartoDBLayer.prototype.initialize.call(this,d),cdb.geo.LeafLetLayerView.call(this,a,this,b)},_modelUpdated:function(){var a=_.clone(this.model.attributes);this.leafletLayer.setOptions(a)},featureOver:function(a,b,c,d){this.trigger("featureOver",a,[b.lat,b.lng],c,d,0)},featureOut:function(a){this.trigger("featureOut",a,0)},featureClick:function(a,b,c,d){this.trigger("featureClick",a,[b.lat,b.lng],c,d,0)},reload:function(){this.model.invalidate()},error:function(a){this.trigger("error",a?a.error:"unknown error"),this.model.trigger("tileError",a?a.error:"unknown error")},tilesOk:function(a){this.model.trigger("tileOk")},includes:[cdb.geo.LeafLetLayerView.prototype,Backbone.Events]});cdb.geo.LeafLetLayerCartoDBView=a}}(),function(){function a(a){var b=this,c=["click","dblclick","mousedown","mouseover","mouseout","dragstart","drag","dragend"];this._eventHandlers={},this.model=a,this.points=[];var d={iconUrl:this.model.get("iconUrl")||cdb.config.get("assets_url")+"/images/layout/default_marker.png",iconAnchor:this.model.get("iconAnchor")||[11,11]};this.geom=L.GeoJSON.geometryToLayer(a.get("geojson"),function(a,e){var f,g=L.marker(e,{icon:L.icon(d)});for(f=0;f "+e.message)}else cdb.log.error("MAP: "+a.get("type")+" can't be created");return c},addLayerToMap:function(a,b,c){b.addLayer(a.leafletLayer),void 0!==c&&a.setZIndex&&a.setZIndex(c)},createGeometry:function(a){return a.isPoint()?new cdb.geo.leaflet.PointView(a):new cdb.geo.leaflet.PathView(a)}}),L.Icon.Default.imagePath=function(){var a,b,c,d,e=document.getElementsByTagName("script"),f=/\/?cartodb[\-\._]?([\w\-\._]*)\.js\??/;for(a=0,b=e.length;b>a;a++)if(c=e[a].src,d=c.match(f)){var g=c.split("/");return delete g[g.length-1],g.join("/")+"themes/css/images"}}())}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a,b,c){this.gmapsLayer=b,this.map=this.gmapsMap=c,this.model=a,this.model.bind("change",this._update,this),this.type=a.get("type")||a.get("kind"),this.type=this.type.toLowerCase()};_.extend(a.prototype,Backbone.Events),_.extend(a.prototype,{_searchLayerIndex:function(){var a=this,b=-1;return this.gmapsMap.overlayMapTypes.forEach(function(c,d){c==a&&(b=d)}),b},remove:function(){if(!this.isBase){var a=this._searchLayerIndex();a>=0?this.gmapsMap.overlayMapTypes.removeAt(a):this.gmapsLayer.setMap&&this.gmapsLayer.setMap(null),this.model.unbind(null,null,this),this.unbind()}},refreshView:function(){if(this.isBase){var a="_baseLayer";this.gmapsMap.setMapTypeId(null),this.gmapsMap.mapTypes.set(a,this.gmapsLayer),this.gmapsMap.setMapTypeId(a)}else{var b=this._searchLayerIndex();b>=0&&this.gmapsMap.overlayMapTypes.setAt(b,this)}},reload:function(){this.refreshView()},_update:function(){this.refreshView()}}),cdb.geo.GMapsLayerView=a}}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a,b){cdb.geo.GMapsLayerView.call(this,a,null,b)};_.extend(a.prototype,cdb.geo.GMapsLayerView.prototype,{_update:function(){var a=this.model,b={roadmap:google.maps.MapTypeId.ROADMAP,gray_roadmap:google.maps.MapTypeId.ROADMAP,dark_roadmap:google.maps.MapTypeId.ROADMAP,hybrid:google.maps.MapTypeId.HYBRID,satellite:google.maps.MapTypeId.SATELLITE,terrain:google.maps.MapTypeId.TERRAIN};this.gmapsMap.setOptions({mapTypeId:b[a.get("base_type")]}),this.gmapsMap.setOptions({styles:a.get("style")||DEFAULT_MAP_STYLE})},remove:function(){}}),cdb.geo.GMapsBaseLayerView=a}}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a,b){this.color=a.get("color"),cdb.geo.GMapsLayerView.call(this,a,this,b)};_.extend(a.prototype,cdb.geo.GMapsLayerView.prototype,{_update:function(){this.color=this.model.get("color"),this.refreshView()},getTile:function(a,b,c){var d=document.createElement("div");return d.style.width=this.tileSize.x,d.style.height=this.tileSize.y,d["background-color"]=this.color,d},tileSize:new google.maps.Size(256,256),maxZoom:100,minZoom:0,name:"plain layer",alt:"plain layer"}),cdb.geo.GMapsPlainLayerView=a}}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a,b){cdb.geo.GMapsLayerView.call(this,a,this,b),this.tileSize=new google.maps.Size(256,256),this.opacity=1,this.isPng=!0,this.maxZoom=22,this.minZoom=0,this.name="cartodb tiled layer",google.maps.ImageMapType.call(this,this)};_.extend(a.prototype,cdb.geo.GMapsLayerView.prototype,google.maps.ImageMapType.prototype,{getTileUrl:function(a,b){var c=a.y,d=1<c||c>=d)return null;var e=a.x;(0>e||e>=d)&&(e=(e%d+d)%d),this.model.get("tms")&&(c=d-c-1);var f=this.model.get("urlTemplate");return f.replace("{x}",e).replace("{y}",c).replace("{z}",b)}}),cdb.geo.GMapsTiledLayerView=a}}(),function(){function a(a,b){var c=Math.round(100*b);c>=99?a.style.filter=f:a.style.filter="alpha(opacity="+b+");"}function b(){}function c(a){var b=function(b,c){var d=this,e=[];_.bindAll(this,"featureOut","featureOver","featureClick");var f=_.clone(b.attributes);f.map=c;var g,h=f.featureOver,i=f.featureOut,j=f.featureClick,k=-1;f.featureOver=function(a,b,c,f,i){e[i]||d.trigger("layerenter",a,b,c,f,i),e[i]=1,h&&h.apply(this,arguments),d.featureOver&&d.featureOver.apply(this,arguments),a.timeStamp===g&&clearTimeout(k),k=setTimeout(function(){d.trigger("mouseover",a,b,c,f,i),d.trigger("layermouseover",a,b,c,f,i)},0),g=a.timeStamp},f.featureOut=function(a,b){e[b]&&d.trigger("layermouseout",b),e[b]=0,_.any(e)||d.trigger("mouseout"),i&&i.apply(this,arguments),d.featureOut&&d.featureOut.apply(this,arguments)},f.featureClick=_.debounce(function(){j&&j.apply(this,arguments),d.featureClick&&d.featureClick.apply(f,arguments)},10),a.call(this,f),cdb.geo.GMapsLayerView.call(this,b,this,c)};return _.extend(b.prototype,cdb.geo.GMapsLayerView.prototype,a.prototype,{_update:function(){this.setOptions(this.model.attributes)},reload:function(){this.model.invalidate()},remove:function(){cdb.geo.GMapsLayerView.prototype.remove.call(this),this.clear()},featureOver:function(a,b,c,d,e){this.trigger("featureOver",a,[b.lat(),b.lng()],c,d,e)},featureOut:function(a,b){this.trigger("featureOut",a,b)},featureClick:function(a,b,c,d,e){this.trigger("featureClick",a,[b.lat(),b.lng()],c,d,e)},error:function(a){this.model&&(this.model.trigger("error",a?a.errors:"unknown error"),this.model.trigger("tileError",a?a.errors:"unknown error"))},ok:function(a){this.model.trigger("tileOk")},tilesOk:function(a){this.model.trigger("tileOk")},loading:function(){this.trigger("loading")},finishLoading:function(){this.trigger("load")}}),b}if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var d=function(a){this.setMap(a)};d.prototype=new google.maps.OverlayView,d.prototype.draw=function(){},d.prototype.latLngToPixel=function(a){var b=this.getProjection();return b?b.fromLatLngToContainerPixel(a):[0,0]},d.prototype.pixelToLatLng=function(a){var b=this.getProjection();return b?b.fromContainerPixelToLatLng(a):[0,0]};var e={opacity:.99,attribution:cdb.config.get("cartodb_attributions"),debug:!1,visible:!0,added:!1,tiler_domain:"carto.com",tiler_port:"80",tiler_protocol:"http",sql_api_domain:"carto.com",sql_api_port:"80",sql_api_protocol:"http",extra_params:{},cdn_url:null,subdomains:null},f="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)",g=function(a){if(this.options=_.defaults(a,e),this.tiles=0,this.tilejson=null,this.interaction=[],!a.named_map&&!a.sublayers)throw new Error("cartodb-gmaps needs at least the named_map");0!=this.options.cartodb_logo&&cdb.geo.common.CartoDBLogo.addWadus({left:74,bottom:8},2e3,this.options.map.getDiv()),wax.g.connector.call(this,a),_.extend(this.options,a),this.projector=new d(a.map),NamedMap.call(this,this.options.named_map,this.options),CartoDBLayerCommon.call(this),this.update()},h=function(a){if(this.options=_.defaults(a,e),this.tiles=0,this.tilejson=null,this.interaction=[],!a.layer_definition&&!a.sublayers)throw new Error("cartodb-leaflet needs at least the layer_definition or sublayer list");a.layer_definition||(a.layer_definition=LayerDefinition.layerDefFromSubLayers(a.sublayers)),0!=this.options.cartodb_logo&&cdb.geo.common.CartoDBLogo.addWadus({left:74,bottom:8},2e3,this.options.map.getDiv()),wax.g.connector.call(this,a),_.extend(this.options,a),this.projector=new d(a.map),LayerDefinition.call(this,a.layer_definition,this.options),CartoDBLayerCommon.call(this),this.update()};b.prototype.setOpacity=function(b){if(isNaN(b)||b>1||0>b)throw new Error(b+" is not a valid value, should be in [0, 1] range");this.opacity=this.options.opacity=b;for(var c in this.cache){var d=this.cache[c];d.style.opacity=b,a(d,b)}},b.prototype.setAttribution=function(){},b.prototype.getTile=function(b,c,d){var e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",f=this,g="ActiveXObject"in window,h=g&&!document.addEventListener;if(this.options.added=!0,null===this.tilejson){var i=c+"/"+b.x+"/"+b.y,j=this.cache[i]=new Image(256,256);return j.src=e,j.setAttribute("gTileKey",i),j.style.opacity=this.options.opacity,j}var k=wax.g.connector.prototype.getTile.call(this,b,c,d);h&&a(k,this.options.opacity),k.style.opacity=this.options.opacity,0===this.tiles&&this.loading&&this.loading(),this.tiles++;var l=cartodb.core.Profiler.metric("cartodb-js.tile.png.load.time").start(),m=function(){l.end(),f.tiles--,0===f.tiles&&f.finishLoading&&f.finishLoading()};return k.onload=m,k.onerror=function(){cartodb.core.Profiler.metric("cartodb-js.tile.png.error").inc(),m()},k},b.prototype.onAdd=function(){},b.prototype.clear=function(){this._clearInteraction(),self.finishLoading&&self.finishLoading()},b.prototype.update=function(a){var b=this;this.loading&&this.loading(),this.getTiles(function(c,d){c?(b.tilejson=c,b.options.tiles=c.tiles,b.tiles=0,b.cache={},b._reloadInteraction(),b.refreshView(),b.ok&&b.ok(),a&&a()):b.error&&b.error(d)})},b.prototype.refreshView=function(){var a=this,b=this.options.map;b.overlayMapTypes.forEach(function(c,d){return c==a?void b.overlayMapTypes.setAt(d,a):void 0})},b.prototype.onLayerDefinitionUpdated=function(){this.update()},b.prototype._checkLayer=function(){if(!this.options.added)throw new Error("the layer is not still added to the map")},b.prototype._findPos=function(a,b){var c,d,e=0,f=0,g=a.getDiv();if(b.e.changedTouches&&b.e.changedTouches.length>0?(c=b.e.changedTouches[0].clientX+window.scrollX,d=b.e.changedTouches[0].clientY+window.scrollY):(c=b.e.clientX,d=b.e.clientY),g.offsetParent&&g.offsetTop>0){do e+=g.offsetLeft,f+=g.offsetTop;while(g=g.offsetParent);var h=this._newPoint(c-e,d-f)}else var i=g.getBoundingClientRect(),j=window.scrollX||window.pageXOffset,k=window.scrollY||window.pageYOffset,h=this._newPoint((b.e.clientX?b.e.clientX:c)-i.left-g.clientLeft-j,(b.e.clientY?b.e.clientY:d)-i.top-g.clientTop-k);return h},b.prototype._newPoint=function(a,b){return new google.maps.Point(a,b)},b.prototype._manageOffEvents=function(a,b){return this.options.featureOut?this.options.featureOut&&this.options.featureOut(b.e,b.layer):void 0},b.prototype._manageOnEvents=function(a,b){var c=this._findPos(a,b),d=this.projector.pixelToLatLng(c),e=b.e.type.toLowerCase();switch(e){case"mousemove":if(this.options.featureOver)return this.options.featureOver(b.e,d,c,b.data,b.layer);break;case"click":case"touchend":case"touchmove":case"mspointerup":case"pointerup":case"pointermove":this.options.featureClick&&this.options.featureClick(b.e,d,c,b.data,b.layer)}},h.Projector=d,h.prototype=new wax.g.connector,_.extend(h.prototype,LayerDefinition.prototype,b.prototype,CartoDBLayerCommon.prototype),h.prototype.interactionClass=wax.g.interaction,g.prototype=new wax.g.connector,_.extend(g.prototype,NamedMap.prototype,b.prototype,CartoDBLayerCommon.prototype),g.prototype.interactionClass=wax.g.interaction,cdb.geo.CartoDBLayerGroupGMaps=h,cdb.geo.CartoDBNamedMapGMaps=g,cdb.geo.GMapsCartoDBLayerGroupView=c(h),cdb.geo.GMapsCartoDBNamedMapView=c(g),cdb.geo.CartoDBNamedMapGMaps=g}}(),function(){if("undefined"!=typeof google&&"undefined"!=typeof google.maps){var a=function(a){this.setMap(a)};a.prototype=new google.maps.OverlayView,a.prototype.draw=function(){},a.prototype.latLngToPixel=function(a){var b=this.getProjection();return b?b.fromLatLngToContainerPixel(a):[0,0]},a.prototype.pixelToLatLng=function(a){var b=this.getProjection();return b?b.fromContainerPixelToLatLng(a):[0,0]};var b=function(a){var b={query:"SELECT * FROM {{table_name}}",opacity:.99,attribution:cdb.config.get("cartodb_attributions"),opacity:1,debug:!1,visible:!0,added:!1,extra_params:{},layer_definition_version:"1.0.0"};if(this.options=_.defaults(a,b),!a.table_name||!a.user_name||!a.tile_style)throw"cartodb-gmaps needs at least a CartoDB table name, user_name and tile_style";this.options.layer_definition={version:this.options.layer_definition_version,layers:[{type:"cartodb",options:this._getLayerDefinition(),infowindow:this.options.infowindow}]},cdb.geo.CartoDBLayerGroupGMaps.call(this,this.options),this.setOptions(this.options)};_.extend(b.prototype,cdb.geo.CartoDBLayerGroupGMaps.prototype),b.prototype.setQuery=function(a,b){void 0===b&&(b=a,a=0),b=b||"select * from "+this.options.table_name,LayerDefinition.prototype.setQuery.call(this,a,b)},cdb.geo.CartoDBLayerGMaps=b;var c=function(a,b){var c=this;_.bindAll(this,"featureOut","featureOver","featureClick");var d=_.clone(a.attributes);d.map=b;var e=d.featureOver,f=d.featureOut,g=d.featureClick;d.featureOver=function(){e&&e.apply(this,arguments),c.featureOver&&c.featureOver.apply(this,arguments)},d.featureOut=function(){f&&f.apply(this,arguments),c.featureOut&&c.featureOut.apply(this,arguments)},d.featureClick=function(){g&&g.apply(this,arguments),c.featureClick&&c.featureClick.apply(d,arguments)},cdb.geo.CartoDBLayerGMaps.call(this,d),cdb.geo.GMapsLayerView.call(this,a,this,b)};cdb.geo.GMapsCartoDBLayerView=c,_.extend(c.prototype,cdb.geo.CartoDBLayerGMaps.prototype,cdb.geo.GMapsLayerView.prototype,{_update:function(){this.setOptions(this.model.attributes)},reload:function(){this.model.invalidate()},remove:function(){cdb.geo.GMapsLayerView.prototype.remove.call(this),this.clear()},featureOver:function(a,b,c,d){this.trigger("featureOver",a,[b.lat(),b.lng()],c,d,0)},featureOut:function(a){this.trigger("featureOut",a)},featureClick:function(a,b,c,d,e){this.trigger("featureClick",a,[b.lat(),b.lng()],c,d,0)},error:function(a){this.model&&(this.model.trigger("error",a?a.error:"unknown error"),this.model.trigger("tileError",a?a.error:"unknown error"))},tilesOk:function(a){this.model.trigger("tileOk")},loading:function(){this.trigger("loading")},finishLoading:function(){this.trigger("load")}})}}(),function(){function a(a){var b=this,c=["click","dblclick","mousedown","mouseover","mouseout","dragstart","drag","dragend"];this._eventHandlers={},this.model=a,this.points=[];var d=(_.clone(a.get("style"))||{},this.model.get("iconAnchor")),e={url:this.model.get("iconUrl")||cdb.config.get("assets_url")+"/images/layout/default_marker.png",anchor:{x:d&&d[0]||10,y:d&&d[1]||10}};this.geom=new GeoJSON(a.get("geojson"),{icon:e,raiseOnDrag:!1,crossOnDrag:!1});var f;for(f=0;f "+d.message)}else cdb.log.error("MAP: "+a.get("type")+" can't be created");return b},_addLayer:function(a,b,c){c=c||{};var d;return(d=this.createLayer(a))?this._addLayerToMap(d,c):void 0},_addLayerToMap:function(a,b){var c=a.model;if(this.layers[c.cid]=a,a){var d=_(this.layers).filter(function(a){return!!a.getTile}).length-1,e=1===_.keys(this.layers).length||b&&0===b.index||0===c.get("order");if(e&&!b.no_base_layer){var f=a.model;"GMapsBase"===f.get("type")?a._update():(a.isBase=!0,a._update())}else d-=1,d=Math.max(0,d),a.getTile?(a.gmapsLayer||cdb.log.error("gmaps layer can't be null"),this.map_googlemaps.overlayMapTypes.setAt(d,a.gmapsLayer)):a.gmapsLayer.setMap(this.map_googlemaps);void 0!==b&&b.silent||this.trigger("newLayerView",a,c,this)}else cdb.log.error("layer type not supported");return a},pixelToLatLon:function(a){var b=this.projector.pixelToLatLng(new google.maps.Point(a[0],a[1]));return{lat:b.lat(),lng:b.lng()}},latLonToPixel:function(a){return this.projector.latLngToPixel(new google.maps.LatLng(a[0],a[1]))},getSize:function(){return{x:this.$el.width(),y:this.$el.height()}},panBy:function(a){var b=this.map.get("center"),c=this.latLonToPixel(b);a.x+=c.x,a.y+=c.y;var d=this.projector.pixelToLatLng(a);this.map.setCenter([d.lat(),d.lng()])},getBounds:function(){if(this._isReady){var a=this.map_googlemaps.getBounds(),b=a.getSouthWest(),c=a.getNorthEast();return[[b.lat(),b.lng()],[c.lat(),c.lng()]]}return[[0,0],[0,0]]},setAttribution:function(){var a=document.getElementById("cartodb-gmaps-attribution"),b=cdb.core.sanitize.html(this.map.get("attribution").join(", "));a&&a.parentNode.removeChild(a);var c=this.map_googlemaps.getDiv(),d=document.createElement("div");d.setAttribute("id","cartodb-gmaps-attribution"),d.setAttribute("class","gmaps"),c.appendChild(d),d.innerHTML=b},setCursor:function(a){this.map_googlemaps.setOptions({draggableCursor:a})},_addGeomToMap:function(a){var b=cdb.geo.GoogleMapsMapView.createGeometry(a);if(b.geom.length)for(var c=0;c/g)||[]).join("");var c=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;return a&&"string"==typeof a?a.replace(c,function(a,c){return b.indexOf("<"+c.toLowerCase()+">")>-1?a:""}):""},open:function(){var a=this;this.$el.show(0,function(){a.isOpen=!0})},hide:function(){var a=this;this.$el.hide(0,function(){a.isOpen=!1}),this.options.clean_on_hide&&this.clean()},toggle:function(){this.isOpen?this.hide():this.open()},_truncateTitle:function(a,b){return a.substr(0,b-1)+(a.length>b?"…":"")},render:function(){var a,b,c=this.$el,d=cdb.core.sanitize.html(this.options.title),e=(cdb.core.sanitize.html(this.options.description),this._stripHTML(this.options.description)),f=this.options.share_url;this.$el.addClass(this.options.size);var g,h=d+": "+e;g=d&&e?this._truncateTitle(d+": "+e,112)+" %23map ":d?this._truncateTitle(d,112)+" %23map":e?this._truncateTitle(e,112)+" %23map":"%23map",a=this.options.facebook_url?this.options.facebook_url:"http://www.facebook.com/sharer.php?u="+f+"&text="+h,b=this.options.twitter_url?this.options.twitter_url:"https://twitter.com/share?url="+f+"&text="+g;var i=_.extend(this.options,{facebook_url:a,twitter_url:b});return c.html(this.options.template(i)),c.find(".modal").css({width:this.options.width}),this.render_content&&this.$(".content").append(this.render_content()),this.options.modal_class&&this.$el.addClass(this.options.modal_class),this.options.disableLinks&&this.$el.find("a").attr("target",""),this}}),cdb.ui.common.Notification=cdb.core.View.extend({ +tagName:"div",className:"dialog",events:{"click .close":"hide"},default_options:{timeout:0,msg:"",hideMethod:"",duration:"normal"},initialize:function(){this.closeTimeout=-1,_.defaults(this.options,this.default_options),this.template=this.options.template?_.template(this.options.template):cdb.templates.getTemplate("common/notification"),this.$el.hide()},render:function(){var a=this.$el;return a.html(this.template(this.options)),this.render_content&&this.$(".content").append(this.render_content()),this},hide:function(a){var b=this;a&&a.preventDefault(),clearTimeout(this.closeTimeout),""!=this.options.hideMethod&&this.$el.is(":visible")?this.$el[this.options.hideMethod](this.options.duration,"swing",function(){b.$el.html(""),b.trigger("notificationDeleted"),b.remove()}):(this.$el.hide(),b.$el.html(""),b.trigger("notificationDeleted"),b.remove())},open:function(a,b){this.render(),this.$el.show(a,b),this.options.timeout&&(this.closeTimeout=setTimeout(_.bind(this.hide,this),this.options.timeout))}}),cdb.ui.common.Row=cdb.core.Model.extend({}),cdb.ui.common.TableData=Backbone.Collection.extend({model:cdb.ui.common.Row,fetched:!1,initialize:function(){var a=this;this.bind("reset",function(){a.fetched=!0})},getCell:function(a,b){var c=this.at(a);return c?c.get(b):null},isEmpty:function(){return 0===this.length}}),cdb.ui.common.TableProperties=cdb.core.Model.extend({columnNames:function(){return _.map(this.get("schema"),function(a){return a[0]})},columnName:function(a){return this.columnNames()[a]}}),cdb.ui.common.RowView=cdb.core.View.extend({tagName:"tr",initialize:function(){this.model.bind("change",this.render,this),this.model.bind("destroy",this.clean,this),this.model.bind("remove",this.clean,this),this.model.bind("change",this.triggerChange,this),this.model.bind("sync",this.triggerSync,this),this.model.bind("error",this.triggerError,this),this.add_related_model(this.model),this.order=this.options.order},triggerChange:function(){this.trigger("changeRow")},triggerSync:function(){this.trigger("syncRow")},triggerError:function(){this.trigger("errorRow")},valueView:function(a,b){return b},render:function(){var a,b=this,c=this.model,d="",e=0;a=this.options.row_header?'
                      ",e++,d+=a;for(var g=this.order||_.keys(c.attributes),h="",i=c.attributes,j=0,k=g.length;k>j;++j){var l=g[j],m=i[l];if(void 0!==m){var a='",e++,h+=a}}return d+=h,this.$el.html(d).attr("id","row_"+c.id),this},getCell:function(a){return this.options.row_header&&++a,this.$("td:eq("+a+")")},getTableView:function(){return this.tableView}}),cdb.ui.common.Table=cdb.core.View.extend({tagName:"table",rowView:cdb.ui.common.RowView,events:{"click td":"_cellClick","dblclick td":"_cellDblClick"},default_options:{},initialize:function(){var a=this;_.defaults(this.options,this.default_options),this.dataModel=this.options.dataModel,this.rowViews=[],this.setDataSource(this.dataModel),this.model.bind("change",this.render,this),this.model.bind("change:dataSource",this.setDataSource,this),this.bind("clean",this.clear_rows,this),this.add_related_model(this.dataModel),this.add_related_model(this.model),this.model.bind("removing:row",function(){a.rowsBeingDeleted=a.rowsBeingDeleted?a.rowsBeingDeleted+1:1,a.rowDestroying()}),this.model.bind("remove:row",function(){a.rowsBeingDeleted>0&&(a.rowsBeingDeleted--,a.rowDestroyed(),0==a.dataModel.length&&a.emptyTable())})},headerView:function(a){return a[0]},setDataSource:function(a){this.dataModel&&this.dataModel.unbind(null,null,this),this.dataModel=a,this.dataModel.bind("reset",this._renderRows,this),this.dataModel.bind("error",this._renderRows,this),this.dataModel.bind("add",this.addRow,this)},_renderHeader:function(){var a=this,b=$(""),c=$("");return this.options.row_header?c.append($("
                      ':'';var f=b.valueView("","");f.html&&(f=f[0].outerHTML),a+=f,a+="',f=b.valueView(l,m);f.html&&(f=f[0].outerHTML),a+=f,a+="
                      ").append(a.headerView(["","header"]))):c.append($("").append(a.headerView(["","header"]))),_(this.model.get("schema")).each(function(b){c.append($("").append(a.headerView(b)))}),b.append(c),b},clear_rows:function(){this.$("tfoot").remove(),this.$("tr.noRows").remove();for(var a=null;a=this.rowViews.pop();)a.unbind(null,null,this),a.clean();this.rowViews=[]},addRow:function(a,b,c){var d=this,e=new d.rowView({model:a,order:this.model.columnNames(),row_header:this.options.row_header});if(e.tableView=this,e.bind("clean",function(){var a=_.indexOf(d.rowViews,e);d.rowViews.splice(a,1);for(var b=a;b1&&!this.timeSlider){var c=this,d=a.create("time_slider",this,{layer:b});this.mapView.addOverlay(d),this.timeSlider=d,b.bind("remove",function e(){c.timeSlider=null,d.remove(),b.unbind("remove",e)})}},_setupSublayers:function(a,b){b.sublayer_options=[],_.each(a.slice(1),function(a){"layergroup"===a.type?_.each(a.options.layer_definition.layers,function(a){b.sublayer_options.push({visible:void 0!==a.visible?a.visible:!0})}):"namedmap"===a.type?_.each(a.options.named_map.layers,function(a){b.sublayer_options.push({visible:void 0!==a.visible?a.visible:!0})}):"torque"===a.type&&b.sublayer_options.push({visible:void 0!==a.options.visible?a.options.visible:!0})})},load:function(a,c){function d(){e._createSlides([a].concat(a.slides))}var e=this;if("string"==typeof a){var f=a;return cdb.core.Loader.get(f,function(a){a?e.load(a,c):e.throwError("error fetching viz.json file")}),this}var g=a.slides;g&&g.length>0&&(a=g[0],a.slides=g.slice(1));var h=a.layers;if(a.slides&&a.slides.length>0&&(h=h.concat(_.flatten(a.slides.map(function(a){return a.layers})))),!this.checkModules(h))return this.moduleChecked?(e.throwError("modules couldn't be loaded"),this):(this.moduleChecked=!0,this.loadModules(h,function(){e.load(a,c)}),this);window&&window.location.protocol&&"https:"===window.location.protocol&&(this.https=!0),a.https&&(this.https=a.https),c=c||{},this._applyOptions(a,c);var i=!!_.find(a.overlays,function(a){return"logo"===a.type&&a.options.display});this.cartodb_logo=void 0!==c.cartodb_logo?c.cartodb_logo:i,this.mobile?this.cartodb_logo=!1:i||void 0!==c.cartodb_logo||(this.cartodb_logo=!0);var j=void 0===c.scrollwheel?a.scrollwheel:c.scrollwheel,k=(void 0===c.slides_controller?a.slides_controller:c.slides_controller,this.isMobileDevice()),l=_.isObject(_.find(a.overlays,function(a){return"zoom"==a.type})),m=k||l||j;if(a.maxZoom||(a.maxZoom=20),a.minZoom||(a.minZoom=0),this.gmaps_base_type&&"leaflet"===a.map_provider){var n=["roadmap","gray_roadmap","dark_roadmap","hybrid","satellite","terrain"];_.contains(n,this.gmaps_base_type)?a.layers?(a.layers[0].options.type="GMapsBase",a.layers[0].options.base_type=this.gmaps_base_type,a.layers[0].options.name=this.gmaps_base_type,this.gmaps_style&&(a.layers[0].options.style="string"==typeof this.gmaps_style?JSON.parse(this.gmaps_style):this.gmaps_style),a.map_provider="googlemaps",a.layers[0].options.attribution=""):cdb.log.error("No base map loaded. Using Leaflet."):cdb.log.error('GMaps base_type "'+this.gmaps_base_type+" is not supported. Using leaflet.")}var o={title:a.title,description:a.description,maxZoom:a.maxZoom,minZoom:a.minZoom,legends:a.legends,scrollwheel:j,drag:m,provider:a.map_provider};if(a.bounding_box_sw&&a.bounding_box_ne&&(o.bounding_box_sw=a.bounding_box_sw,o.bounding_box_ne=a.bounding_box_ne),a.bounds)o.view_bounds_sw=a.bounds[0],o.view_bounds_ne=a.bounds[1];else{var p=a.center;"string"==typeof p&&(p=$.parseJSON(p)),o.center=p||[0,0],o.zoom=void 0===a.zoom?4:a.zoom}var q=new cdb.geo.Map(o);this.map=q,this.overlayModels=new Backbone.Collection,this.updated_at=a.updated_at||(new Date).getTime();var r=this.$el.outerHeight();0===r&&(this.mapConfig=o,$(window).bind("resize",this._onResize));var s=$("
                      ").css({position:"relative",width:"100%",height:"100%"});this.container=s;var t=$("
                      ").addClass("cartodb-map-wrapper").css({position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%"});s.append(t),this.$el.append(s);var u=new cdb.geo.MapView.create(t,q);return this.mapView=u,(c.legends||void 0===c.legends&&this.map.get("legends")!==!1)&&q.layers.bind("reset",this.addLegends,this),this.overlayModels.bind("reset",function(b){this._addOverlays(b,a,c),this._addMobile(a,c)},this),this.mapView.bind("newLayerView",this._addLoading,this),c.time_slider&&this.mapView.bind("newLayerView",this._addTimeSlider,this),this.infowindow&&this.mapView.bind("newLayerView",this.addInfowindow,this),this.tooltip&&this.mapView.bind("newLayerView",this.addTooltip,this),this.map.layers.reset(_.map(a.layers,function(a){return b.create(a.type||a.kind,e,a)})),this.overlayModels.reset(a.overlays),c.sublayer_options||this._setupSublayers(a.layers,c),this._setLayerOptions(c),a.slides&&(this.map.disableKeyboard(),void 0===cartodb.odyssey?(cdb.config.bind("moduleLoaded:odyssey",d),Loader.loadModule("odyssey")):d()),_.defer(function(){e.trigger("done",e,e.getLayers())}),this},_addTimeSlider:function(){var a=_(this.getLayers()).find(function(a){return"torque"===a.model.get("type")&&a.model.get("visible")});a&&(this.torqueLayer=a,this.torqueLayer.bind("change:time",function(a){this.trigger("change:step",this.torqueLayer,this.torqueLayer.getStep())},this),!this.isMobileEnabled&&this.torqueLayer&&this.addTimeSlider(this.torqueLayer))},setAnimationStep:function(a,b){return this.torqueLayer?(this.torqueLayer.setStep(a,b),!0):!1},_createSlides:function(a){function c(a){var b={set:function(){var b=arguments;return O.Action({enter:function(){a.set.apply(a,b)}})},reset:function(){var b=arguments;return O.Action({enter:function(){a.reset.apply(a,b)}})}};return b}function d(a,b){var c=O.Trigger(),e=d._callbacks;return e||(e=d._callbacks=[],O.Keys().left().then(function(){for(var b=0;b0){var b=[a.transition_options].concat(_.pluck(a.slides,"transition_options"));return this.addOverlay({type:"slides_controller",transitions:b})}},_addHeader:function(a,b){var c=[b.transition_options].concat(_.pluck(b.slides,"transition_options"));return this.addOverlay({type:"header",options:a.options,transitions:c})},_addMobile:function(a,b){var c,d=a.layers[1];if(this.isMobileEnabled){b&&void 0===b.legends&&(b.legends=this.legends?!0:!1),d.options&&d.options.layer_definition?c=d.options.layer_definition.layers:d.options&&d.options.named_map&&d.options.named_map.layers&&(c=d.options.named_map.layers);var e=[a.transition_options].concat(_.pluck(a.slides,"transition_options"));this.mobileOverlay=this.addOverlay({type:"mobile",layers:c,slides:a.slides,transitions:e,overlays:a.overlays,options:b,torqueLayer:this.torqueLayer})}},_createLegendView:function(a,b){if(a.legend){a.legend.data=a.legend.items;var c=a.legend;if(c.items&&c.items.length||c.template){var d=_.extend(a.legend,{visible:a.visible}),e=new cdb.geo.ui.LegendModel(d),f=new cdb.geo.ui.Legend({model:e});return b.bind("change:visibility",function(a,b){f[b?"hide":"show"]()}),b.legend=e,f}}return null},createLegendView:function(a){for(var b=[],c=a.length-1;c>=0;--c){var d=a.at(c).cid,e=a.at(c).attributes;if(e.visible){var f=this.mapView.getLayerByCid(d);if(f){var f=this.mapView.getLayerByCid(d);b.push(this._createLayerLegendView(e,f))}}}return _.flatten(b)},_createLayerLegendView:function(a,b){var c=this,d=[];if(a.options&&a.options.layer_definition){var e=a.options.layer_definition.layers;_(e).each(function(a,e){d.push(c._createLegendView(a,b.getSubLayer(e)))})}else if(a.options&&a.options.named_map&&a.options.named_map.layers){var e=a.options.named_map.layers;_(e).each(function(a,e){d.push(c._createLegendView(a,b.getSubLayer(e)))})}else d.push(this._createLegendView(a,b));return _.compact(d).reverse()},addOverlay:function(b){b.map=this.map;var c=a.create(b.type,this,b);return c&&("loader"==b.type&&(this.loader=c),this.mapView.addOverlay(c),this.overlays.push(c),c.bind("clean",function(){for(var a in this.overlays){var b=this.overlays[a];if(c.cid===b.cid)return void this.overlays.splice(a,1)}},this)),c},_applyOptions:function(a,b){function c(b){if(!a.overlays)return null;for(var c=0;c1){var m=b.auth_token;if(e(a.layers),a.slides)for(var n=0;n','x','
                      ','
                      ',"{{#content.fields}}","{{#title}}

                      {{title}}

                      {{/title}}","{{#value}}",'

                      {{{ value }}}

                      ',"{{/value}}","{{^value}}",'

                      null

                      ',"{{/value}}","{{/content.fields}}","
                      ","
                      ",'
                      ',"
                      "].join("")},cdb.vis.Vis=c}(),function(){Queue=function(){this._methods=[],this._response=null,this._flushed=!1},Queue.prototype={add:function(a){this._flushed?a(this._response):this._methods.push(a)},flush:function(a){if(!this._flushed)for(this._response=a,this._flushed=!0;this._methods[0];)this._methods.shift()(a)}},StaticImage=function(){MapBase.call(this,this),this.imageOptions={},this.error=null,this.supported_formats=["png","jpg"],this.defaults={basemap_url_template:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",basemap_subdomains:["a","b","c"],format:"png",zoom:10,center:[0,0],size:[320,240],tiler_port:80,tiler_domain:"carto.com"}},StaticImage.prototype=_.extend({},MapBase.prototype,{load:function(a,b){return _.bindAll(this,"_onVisLoaded"),this.queue=new Queue,this.no_cdn=b.no_cdn,this.userOptions=b,b=_.defaults({vizjson:a,temp_id:"s"+this._getUUID()},this.defaults),this.imageOptions=b,cdb.core.Loader.get(a,this._onVisLoaded),this},loadLayerDefinition:function(a,b){return this.queue=new Queue,a.user_name?(this.userOptions=b,this.options.api_key=a.api_key,this.options.user_name=a.user_name,this.options.tiler_protocol=a.tiler_protocol,this.options.tiler_domain=a.tiler_domain,this.options.tiler_port=a.tiler_port,this.options.maps_api_template=a.maps_api_template,this.endPoint="/api/v1/map",this.options.maps_api_template||this._buildMapsApiTemplate(this.options),this.options.layers=a,void this._requestLayerGroupID()):void cartodb.log.error("Please, specify the username")},_onVisLoaded:function(a){if(a){var b=a.layers[0],c=this._getDataLayer(a.layers);c.options&&(this.options.user_name=c.options.user_name),c.options.maps_api_template?this.options.maps_api_template=c.options.maps_api_template:this._setupTilerConfiguration(c.options.tiler_protocol,c.options.tiler_domain,c.options.tiler_port),this.auth_tokens=a.auth_tokens,this.endPoint="/api/v1/map";var d=[],e=a.bounds;e&&(d.push([e[0][1],e[0][0]]),d.push([e[1][1],e[1][0]])),this.imageOptions.zoom=a.zoom,this.imageOptions.center=JSON.parse(a.center),this.imageOptions.bbox=d,this.imageOptions.bounds=a.bounds,b&&b.options&&(this.imageOptions.basemap=b);var f=!1,g=this._getLayerByType(a.layers,"namedmap");if(g){var h=this._getLayerByType(a.layers,"torque");h&&h.options&&h.options.named_map&&h.options.named_map.name===g.options.named_map.name&&(f=!0)}var i=[],j=this._getBasemapLayer();j&&i.push(j);for(var k,l=1;l0&&(b.auth_tokens=this.auth_tokens),{type:"named",options:b}},_getVisibleLayers:function(a){return _.filter(a,function(a){return a.visible})},_getUrl:function(){var a=(this.options.user_name,this.imageOptions.bbox),b=this.imageOptions.layergroupid,c=this.imageOptions.zoom||this.defaults.zoom,d=this.imageOptions.center||this.defaults.center,e=this.imageOptions.size||this.defaults.size,f=this.imageOptions.format||this.defaults.format,g=d[0],h=d[1],i=e[0],j=e[1],k=this.isHttps()?null:"a",l=this._host(k)+this.endPoint;return a&&a.length&&!this.userOptions.override_bbox?[l,"static/bbox",b,a.join(","),i,j+"."+f].join("/"):[l,"static/center",b,c,g,h,i,j+"."+f].join("/")},_getUUID:function(){var a=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},_set:function(a,b){var c=this;return this.queue.add(function(){c.imageOptions[a]=b}),this},zoom:function(a){return this._set("zoom",a)},bbox:function(a){return this._set("bbox",a)},center:function(a){return this._set("bbox",null),this._set("center",a)},format:function(a){return this._set("format",_.include(this.supported_formats,a)?a:this.defaults.format)},size:function(a,b){return this._set("size",[a,void 0===b?a:b])},into:function(a){var b=this;return a instanceof HTMLImageElement?(this.imageOptions.size=[a.width,a.height],void this.queue.add(function(c){a.src=b._getUrl()})):void cartodb.log.error("img should be an image")},getUrl:function(a){var b=this;this.queue.add(function(){a&&a(b.error,b._getUrl())})},write:function(a){var b=this;return this.imageOptions.attributes=a,a&&a.src?document.write(''):document.write(''),this.queue.add(function(){var a=document.getElementById(b.imageOptions.temp_id);a.src=b._getUrl(),a.removeAttribute("temp_id");var c=b.imageOptions.attributes;c&&c["class"]&&a.setAttribute("class",c["class"]),c&&c.id&&a.setAttribute("id",c.id)}),this}}),cdb.Image=function(a,b){b||(b={});var c=new StaticImage;return"string"==typeof a?c.load(a,b):c.loadLayerDefinition(a,b),c}}(),function(){cdb.vis.Overlay.register("logo",function(a,b){}),cdb.vis.Overlay.register("slides_controller",function(a,b){var c=new cdb.geo.ui.SlidesController({transitions:a.transitions,visualization:b});return c.render()}),cdb.vis.Overlay.register("mobile",function(a,b){var c=cdb.core.Template.compile(a.template||'
                        ',a.templateType||"mustache"),d=new cdb.geo.ui.Mobile({template:c,mapView:b.mapView,overlays:a.overlays,transitions:a.transitions,slides_data:a.slides,visualization:b,layerView:a.layerView,visibility_options:a.options,torqueLayer:a.torqueLayer,map:a.map});return d.render()}),cdb.vis.Overlay.register("image",function(a,b){var c=a.options,d=cdb.core.Template.compile(a.template||'
                        {{{ content }}}
                        ',a.templateType||"mustache"),e=new cdb.geo.ui.Image({model:new cdb.core.Model(c),template:d});return e.render()}),cdb.vis.Overlay.register("text",function(a,b){var c=a.options,d=cdb.core.Template.compile(a.template||'
                        {{{ text }}}
                        ',a.templateType||"mustache"),e=new cdb.geo.ui.Text({model:new cdb.core.Model(c),template:d,className:"cartodb-overlay overlay-text "+c.device});return e.render()}),cdb.vis.Overlay.register("annotation",function(a,b){var c=a.options,d=cdb.core.Template.compile(a.template||'
                        {{{ text }}}
                        ',a.templateType||"mustache"),c=a.options,e=new cdb.geo.ui.Annotation({className:"cartodb-overlay overlay-annotation "+c.device,template:d,mapView:b.mapView,device:c.device,text:c.extra.rendered_text,minZoom:c.style["min-zoom"],maxZoom:c.style["max-zoom"],latlng:c.extra.latlng,style:c.style});return e.render()}),cdb.vis.Overlay.register("zoom_info",function(a,b){}),cdb.vis.Overlay.register("header",function(a,b){var c=a.options,d=cdb.core.Template.compile(a.template||'
                        {{{ title }}}
                        {{{ description }}}
                        ',a.templateType||"mustache"),e=new cdb.geo.ui.Header({model:new cdb.core.Model(c),transitions:a.transitions,slides:b.slides,template:d});return e.render()}),cdb.vis.Overlay.register("zoom",function(a,b){if(!a.template)return void b.trigger("error","zoom template is empty");var c=new cdb.geo.ui.Zoom({model:a.map,template:cdb.core.Template.compile(a.template)});return c.render()}),cdb.vis.Overlay.register("loader",function(a){var b=new cdb.geo.ui.TilesLoader({template:cdb.core.Template.compile(a.template)});return b.render()}),cdb.vis.Overlay.register("time_slider",function(a,b){var c=new cdb.geo.ui.TimeSlider(a);return c.render()}),cdb.vis.Overlay.register("_header",function(a,b){function c(a,b){return a.substr(0,b-1)+(a.length>b?"…":"")}location.href?a.share_url=encodeURIComponent(location.href):a.share_url=a.url;var d,e=cdb.core.Template.compile(a.template||" {{#title}}

                        {{#url}} {{title}} {{/url}} {{^url}} {{title}} {{/url}}

                        {{/title}} {{#description}}

                        {{{description}}}

                        {{/description}} {{#mobile_shareable}} {{/mobile_shareable}} ",a.templateType||"mustache"),f=a.map.get("title"),g=a.map.get("description"),h=f+": "+g;d=f&&g?c(f+": "+g,112)+" %23map ":f?c(f,112)+" %23map":g?c(g,112)+" %23map":"%23map";var i="false"!=a.shareable&&a.shareable?a.shareable:null,j=i;j=j&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);var k=new cdb.geo.ui.Header({title:f,description:g,facebook_title:h,twitter_title:d,url:a.url,share_url:a.share_url,mobile_shareable:j,shareable:i&&!j,template:e});return k.render()}),cdb.vis.Overlay.register("infowindow",function(a,b){if(0==_.size(a.fields))return null;var c=new cdb.geo.ui.InfowindowModel({template:a.template,template_type:a.templateType,alternative_names:a.alternative_names,fields:a.fields,template_name:a.template_name}),d=new cdb.geo.ui.Infowindow({model:c,mapView:b.mapView,template:a.template});return d}),cdb.vis.Overlay.register("layer_selector",function(a,b){var c=a.options,d=cdb.core.Template.compile(a.template||' Visible layers
                        ',a.templateType||"underscore"),e=cdb.core.Template.compile(a.template||'
                          ',a.templateType||"underscore"),f=new cdb.geo.ui.LayerSelector({model:new cdb.core.Model(c),mapView:b.mapView,template:d,dropdown_template:e,layer_names:a.layer_names}),g=b.timeSlider;return g&&f.bind("change:visible",function(a,b,c){"torque"===c.get("type")&&g[a?"show":"hide"]()}),b.legends&&f.bind("change:visible",function(a,c,d){if("layergroup"===d.get("type")||"torque"===d.get("type")){var e=b.legends&&b.legends.getLegendByIndex(c);e&&e[a?"show":"hide"]()}}),f.render()}),cdb.vis.Overlay.register("fullscreen",function(a,b){var c=a.options;c.allowWheelOnFullscreen=!1;var d=cdb.core.Template.compile(a.template||'',a.templateType||"mustache"),e=new cdb.ui.common.FullScreen({doc:"#map > div",model:new cdb.core.Model(c),mapView:b.mapView,template:d});return e.render()}),cdb.vis.Overlay.register("share",function(a,b){var c=a.options,d=cdb.core.Template.compile(a.template||'',a.templateType||"mustache"),e=new cdb.geo.ui.Share({model:new cdb.core.Model(c),vis:b,map:b.map,template:d});return e.createDialog(),e.render()}),cdb.vis.Overlay.register("search",function(a,b){var c=cdb.core.Template.compile(a.template||'
                          ',a.templateType||"mustache"),d=new cdb.geo.ui.Search(_.extend(a,{template:c,mapView:b.mapView,model:b.map}));return d.render()}),cdb.vis.Overlay.register("tooltip",function(a,b){if(!a.layer&&b.getLayers().length<=1)throw new Error("layer is null");return a.layer=a.layer||b.getLayers()[1],a.layer.setInteraction(!0),a.mapView=b.mapView,new cdb.geo.ui.Tooltip(a)}),cdb.vis.Overlay.register("infobox",function(a,b){var c,d=b.getLayers();if(a.layer||(d.length>1&&(c=d[1]),a.layer=c),!a.layer)throw new Error("layer is null");a.layer.setInteraction(!0);var e=new cdb.geo.ui.InfoBox(a);return e})}(),function(){function a(a){for(var b in e)if(-1!==a.indexOf(b))return a.replace(b,e[b]);return a}function b(a){for(var b in e){var c=e[b];if(-1!==a.indexOf(c))return a.replace(c,b)}return a}function c(a,b){b.infowindow&&b.infowindow.fields&&(b.interactivity?-1===b.interactivity.indexOf("cartodb_id")&&(b.interactivity=b.interactivity+",cartodb_id"):b.interactivity="cartodb_id"),a.https&&(b.tiler_protocol="https",b.tiler_port=443,b.sql_api_protocol="https",b.sql_api_port=443),b.cartodb_logo=void 0==a.cartodb_logo?b.cartodb_logo:a.cartodb_logo}var d=cdb.vis.Layers,e={"https://dnv9my2eseobd.cloudfront.net/":"http://a.tiles.mapbox.com/","https://maps.nlp.nokia.com/":"http://maps.nlp.nokia.com/","https://tile.stamen.com/":"http://tile.stamen.com/","https://{s}.maps.nlp.nokia.com/":"http://{s}.maps.nlp.nokia.com/","https://cartocdn_{s}.global.ssl.fastly.net/":"http://{s}.api.cartocdn.com/","https://cartodb-basemaps-{s}.global.ssl.fastly.net/":"http://{s}.basemaps.cartocdn.com/"};d.register("tilejson",function(c,d){var e=d.tiles[0];return c.https===!0?e=b(e):c.https===!1&&(e=a(e)),new cdb.geo.TileLayer({urlTemplate:e})}),d.register("tiled",function(c,d){var e=d.urlTemplate;return c.https===!0?e=b(e):c.https===!1&&(e=a(e)),d.urlTemplate=e,new cdb.geo.TileLayer(d)}),d.register("wms",function(a,b){return new cdb.geo.WMSLayer(b)}),d.register("gmapsbase",function(a,b){return new cdb.geo.GMapsBaseLayer(b)}),d.register("plain",function(a,b){return new cdb.geo.PlainLayer(b)}),d.register("background",function(a,b){return new cdb.geo.PlainLayer(b)});var f=function(a,b){return c(a,b),b.sublayers?(b.type="layergroup",new cdb.geo.CartoDBGroupLayer(b)):new cdb.geo.CartoDBLayer(b)};d.register("cartodb",f),d.register("carto",f),d.register("layergroup",function(a,b){return c(a,b),new cdb.geo.CartoDBGroupLayer(b)}),d.register("namedmap",function(a,b){return c(a,b),new cdb.geo.CartoDBNamedMapLayer(b)}),d.register("torque",function(a,b){return c(a,b),a.https&&b.sql_api_domain&&-1!==b.sql_api_domain.indexOf("carto.com")&&(b.sql_api_protocol="https",b.sql_api_port=443,b.tiler_protocol="https",b.tiler_port=443),b.cartodb_logo=void 0==a.cartodb_logo?b.cartodb_logo:a.cartodb_logo,new cdb.geo.TorqueLayer(b)})}(),function(){function a(){}function b(a){var b=a.host||"carto.com",c=a.protocol||"https";return c+"://"+a.user+"."+b+"/api/v1/viz/"+a.table+"/viz.json"}function c(a,c){var d=null;return void 0!==a.layers||void 0!==(a.kind||a.type)?void _.defer(function(){c(a)}):(void 0!==a.table&&void 0!==a.user?d=b(a):a.indexOf&&(d=a),void(d?cdb.core.Loader.get(d,c):_.defer(function(){c(null)})))}_.extend(a.prototype,Backbone.Events,{done:function(a){return this.bind("done",a)},error:function(a){return this.bind("error",a)}}),cdb._Promise=a;cartodb.createLayer=function(b,d,e,f){if(void 0===b)throw new TypeError("map should be provided");if(void 0===d)throw new TypeError("layer should be provided");var g,h,e=e||{},i=arguments,j=i[i.length-1];_.isFunction(j)&&(f=j);var k=new a;return k.addTo=function(a,b){return k.on("done",function(){h.addLayerToMap(g,a,b)}),k},c(d,function(a){function c(){g=l.createLayer(d,{no_base_layer:!0});var a,c=/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),h=e.mobile_layout&&c||e.force_mobile;if(!g)return k.trigger("error","layer not supported"),k;if(e.infowindow&&l.addInfowindow(g),e.tooltip&&l.addTooltip(g),e.legends){var i=cdb.vis.Layers.create(d.type||d.kind,l,d);l._addLegends(l._createLayerLegendView(i.attributes,g))}e.time_slider&&"torque"===g.model.get("type")&&(h||l.addTimeSlider(g),a=g),h&&(e.mapView=b.viz.mapView,l.addOverlay({type:"mobile",layerView:g,overlays:[],torqueLayer:a,options:e})),f&&f(g),k.trigger("done",g)}var d;if(!a)return void k.trigger("error");if(a.layers){a.layers.length<2&&k.trigger("error","visualization file does not contain layer info");var i=e.layerIndex;if(void 0!==i){if(a.layers.length<=i)return void k.trigger("error","layerIndex out of bounds");d=a.layers[i]}else{var j=["namedmap","layergroup","torque"];d=_.find(a.layers,function(a){return-1!==j.indexOf(a.type)})}}else d=a;if(!d)return void k.trigger("error");if(e&&!_.isFunction(e)&&(d.options=d.options||{},_.extend(d.options,e)),e=_.defaults(e,{infowindow:!0,https:!1,legends:!0,time_slider:!0,tooltip:!0}),"undefined"!=typeof b.overlayMapTypes)h=cdb.geo.GoogleMapsMapView;else{if(!(b instanceof L.Map||window.L&&b instanceof window.L.Map))return k.trigger("error","cartodb.js can't guess the map type"),k;h=cdb.geo.LeafletMapView}var l=b.viz;if(!l){var m=new h({map_object:b,map:new cdb.geo.Map});b.viz=l=new cdb.vis.Vis({mapView:m}),l.updated_at=a.updated_at,l.https=e.https}l.checkModules([d])?c():l.loadModules([d],function(){c()})}),k}}(),function(){function a(b){if(cartodb===this||window===this)return new a(b);if(!b.user)throw new Error("user should be provided");var c=new String(window.location.protocol);if(c=c.slice(0,c.length-1),"file"==c&&(c="https"),this.ajax=b.ajax||("undefined"!=typeof jQuery?jQuery.ajax:reqwest),!this.ajax)throw new Error("jQuery or reqwest should be loaded");if(this.options=_.defaults(b,{version:"v2",protocol:c,jsonp:"undefined"!=typeof jQuery?!jQuery.support.cors:!1}),!this.options.sql_api_template){var d=this.options,e=null;if(d&&d.completeDomain)e=d.completeDomain;else{var f=d.host||"carto.com",g=d.protocol||"https";e=g+"://{user}."+f}this.options.sql_api_template=e}}function b(a){return JSON.parse(a.replace(/^{/,"[").replace(/}$/,"]"))}var c=this;c.cartodb=c.cartodb||{},a.prototype._host=function(){var a=this.options;return a.sql_api_template.replace("{user}",a.user)+"/api/"+a.version+"/sql"},a.prototype.execute=function(a,b,c,d){var e=1024,f=new cartodb._Promise;if(!a)throw new TypeError("sql should not be null");var g=arguments,h=g[g.length-1];_.isFunction(h)&&(d=h),c=_.defaults(c||{},this.options);var i={type:"get",dataType:"json",crossDomain:!0};void 0!==c.cache&&(i.cache=c.cache),c.jsonp&&(delete i.crossDomain,c.jsonpCallback&&(i.jsonpCallback=c.jsonpCallback),i.dataType="jsonp");var j="156543.03515625",k="ST_MakeEnvelope(-20037508.5,-20037508.5,20037508.5,20037508.5,3857)";a=a.replace("!bbox!",k).replace("!pixel_width!",j).replace("!pixel_height!",j);var l=Mustache.render(a,b),m=l.length0&&null!=a.rows[0].maxx){var b=a.rows[0],c=-85.0511,f=85.0511,g=-179,h=179,i=function(a,b,c){return b>a?b:a>c?c:a},j=i(b.maxx,g,h),k=i(b.minx,g,h),l=i(b.maxy,c,f),m=i(b.miny,c,f),n=[[l,j],[m,k]];e.trigger("done",n),d&&d(n)}}).error(function(a){e.trigger("error",a)}),e},a.prototype.table=function(a){function b(){b.fetch.apply(b,arguments)}var c,d,e,f,g=a,h=[],i=this;return b.fetch=function(a){a=a||{};var c=arguments,d=c[c.length-1];_.isFunction(d)&&(callback=d,1===c.length&&(a={})),i.execute(b.sql(),a,callback)},b.sql=function(){var a="select";return a+=h.length?" "+h.join(",")+" ":" * ",a+="from "+g,c&&(a+=" where "+c),d&&(a+=" limit "+d),e&&(a+=" order by "+e),f&&(a+=" "+f),a},b.filter=function(a){return c=a,b},b.order_by=function(a){return e=a,b},b.asc=function(){return f="asc",b},b.desc=function(){return f="desc",b},b.columns=function(a){return h=a,b},b.limit=function(a){return d=a,b},b},a.prototype.describeString=function(a,c,d){var e=["WITH t as ("," SELECT count(*) as total,"," count(DISTINCT {{column}}) as ndist"," FROM ({{sql}}) _wrap"," ), a as ("," SELECT "," count(*) cnt, "," {{column}}"," FROM "," ({{sql}}) _wrap "," GROUP BY "," {{column}} "," ORDER BY "," cnt DESC"," ), b As ("," SELECT"," row_number() OVER (ORDER BY cnt DESC) rn,"," cnt"," FROM a"," ), c As ("," SELECT "," sum(cnt) OVER (ORDER BY rn ASC) / t.total cumperc,"," rn,"," cnt "," FROM b, t"," LIMIT 10"," ),","stats as (","select count(distinct({{column}})) as uniq, "," count(*) as cnt, "," sum(case when COALESCE(NULLIF({{column}},'')) is null then 1 else 0 end)::numeric as null_count, "," sum(case when COALESCE(NULLIF({{column}},'')) is null then 1 else 0 end)::numeric / count(*)::numeric as null_ratio, "," (SELECT max(cumperc) weight FROM c) As skew ","from ({{sql}}) __wrap","),","hist as (","select array_agg(row(d, c)) array_agg from (select distinct({{column}}) d, count(*) as c from ({{sql}}) __wrap, stats group by 1 limit 100) _a",")","select * from stats, hist"],f=Mustache.render(e.join("\n"),{column:c,sql:a}),g=function(a){var b=a.replace(/^"(.+(?="$))?"$/,"$1");return b.replace(/""/g,'"')};this.execute(f,function(a){var c=a.rows[0],e=0,f=[];try{var h=b(c.array_agg),f=_(h).map(function(a){var b=a.match(/\((.*),(\d+)/),c=g(b[1]);return[c,+b[2]]});e=c.skew*(1-c.null_ratio)*(1-c.uniq/c.cnt)*(c.uniq>1?1:0)}catch(i){}d({type:"string",hist:f,distinct:c.uniq,count:c.cnt,null_count:c.null_count,null_ratio:c.null_ratio,skew:c.skew,weight:e})})},a.prototype.describeDate=function(a,b,c){var d=["with minimum as (","SELECT min({{column}}) as start_time FROM ({{sql}}) _wrap), ","maximum as (SELECT max({{column}}) as end_time FROM ({{sql}}) _wrap), ","null_ratio as (SELECT sum(case when {{column}} is null then 1 else 0 end)::numeric / count(*)::numeric as null_ratio FROM ({{sql}}) _wrap), ","moments as (SELECT count(DISTINCT {{column}}) as moments FROM ({{sql}}) _wrap)","SELECT * FROM minimum, maximum, moments, null_ratio"],e=Mustache.render(d.join("\n"),{column:b,sql:a});this.execute(e,function(a){var b=a.rows[0],d=new Date(b.end_time),e=new Date(b.start_time),f=(b.moments,Math.min(b.moments,1024));c({type:"date",start_time:e,end_time:d,range:d-e,steps:f,null_ratio:b.null_ratio})})},a.prototype.describeBoolean=function(a,b,c){var d=["with stats as (","select count(distinct({{column}})) as uniq,","count(*) as cnt","from ({{sql}}) _wrap ","),","null_ratio as (","SELECT sum(case when {{column}} is null then 1 else 0 end)::numeric / count(*)::numeric as null_ratio FROM ({{sql}}) _wrap), ","true_ratio as (","SELECT sum(case when {{column}} is true then 1 else 0 end)::numeric / count(*)::numeric as true_ratio FROM ({{sql}}) _wrap) ","SELECT * FROM true_ratio, null_ratio, stats"],e=Mustache.render(d.join("\n"),{column:b,sql:a});this.execute(e,function(a){var b=a.rows[0];c({type:"boolean",null_ratio:b.null_ratio,true_ratio:b.true_ratio,distinct:b.uniq,count:b.cnt})})},a.prototype.describeGeom=function(a,b,c){function d(a){return{st_multipolygon:"polygon",st_polygon:"polygon",st_multilinestring:"line",st_linestring:"line",st_multipoint:"point",st_point:"point"}[a.toLowerCase()]}var e=["with stats as (","select st_asgeojson(st_extent({{column}})) as bbox","from ({{sql}}) _wrap","),","geotype as (","select st_geometrytype({{column}}) as geometry_type from ({{sql}}) _w where {{column}} is not null limit 1","),","clusters as (","with clus as (","SELECT distinct(ST_snaptogrid(the_geom, 10)) as cluster, count(*) as clustercount FROM ({{sql}}) _wrap group by 1 order by 2 desc limit 3),","total as (","SELECT count(*) FROM ({{sql}}) _wrap)","SELECT sum(clus.clustercount)/sum(total.count) AS clusterrate FROM clus, total","),","density as (","SELECT count(*) / st_area(st_extent(the_geom)) as density FROM ({{sql}}) _wrap",")","select * from stats, geotype, clusters, density"],f=Mustache.render(e.join("\n"),{column:b,sql:a});this.execute(f,function(a){var b=a.rows[0],e=JSON.parse(b.bbox).coordinates[0];c({type:"geom",bbox:[[e[0][0],e[0][1]],[e[2][0],e[2][1]]],geometry_type:b.geometry_type,simplified_geometry_type:d(b.geometry_type),cluster_rate:b.clusterrate,density:b.density})})},a.prototype.columns=function(a,b,c){var d=arguments,e=d[d.length-1];_.isFunction(e)&&(c=e);var f="select * from ("+a+") __wrap limit 0",g=["cartodb_id","latitude","longitude","created_at","updated_at","lat","lon","the_geom_webmercator"];this.execute(f,function(a){var b={};for(var d in a.fields)-1===g.indexOf(d)&&(b[d]=a.fields[d].type);c(b)})},a.prototype.describeFloat=function(a,c,d){var e=["with stats as (","select min({{column}}) as min,","max({{column}}) as max,","avg({{column}}) as avg,","count(DISTINCT {{column}}) as cnt,","count(distinct({{column}})) as uniq,","count(*) as cnt,","sum(case when {{column}} is null then 1 else 0 end)::numeric / count(*)::numeric as null_ratio,","stddev_pop({{column}}) / count({{column}}) as stddev,","CASE WHEN abs(avg({{column}})) > 1e-7 THEN stddev({{column}}) / abs(avg({{column}})) ELSE 1e12 END as stddevmean,",'CDB_DistType(array_agg("{{column}}"::numeric)) as dist_type ',"from ({{sql}}) _wrap ","),","params as (select min(a) as min, (max(a) - min(a)) / 7 as diff from ( select {{column}} as a from ({{sql}}) _table_sql where {{column}} is not null ) as foo ),","histogram as (","select array_agg(row(bucket, range, freq)) as hist from (","select CASE WHEN uniq > 1 then width_bucket({{column}}, min-0.01*abs(min), max+0.01*abs(max), 100) ELSE 1 END as bucket,","numrange(min({{column}})::numeric, max({{column}})::numeric) as range,","count(*) as freq","from ({{sql}}) _w, stats","group by 1","order by 1",") __wrap","),","hist as (","select array_agg(row(d, c)) cat_hist from (select distinct({{column}}) d, count(*) as c from ({{sql}}) __wrap, stats group by 1 limit 100) _a","),","buckets as (","select CDB_QuantileBins(array_agg(distinct({{column}}::numeric)), 7) as quantiles, "," (select array_agg(x::numeric) FROM (SELECT (min + n * diff)::numeric as x FROM generate_series(1,7) n, params) p) as equalint,"," CDB_JenksBins(array_agg(distinct({{column}}::numeric)), 7) as jenks, "," CDB_HeadsTailsBins(array_agg(distinct({{column}}::numeric)), 7) as headtails ","from ({{sql}}) _table_sql where {{column}} is not null",")","select * from histogram, stats, buckets, hist"],f=Mustache.render(e.join("\n"),{column:c,sql:a});this.execute(f,function(a){var c=a.rows[0],e=b(c.hist),f=b(c.cat_hist);d({type:"number",cat_hist:_(f).map(function(a){var b=a.match(/\((.*),(\d+)/);return[+b[1],+b[2]]}),hist:_(e).map(function(a){if(!(a.indexOf("empty")>-1)){var b=a.split('"');return{index:b[0].replace(/\D/g,""),range:b[1].split(",").map(function(a){return a.replace(/\D/g,"")}),freq:b[2].replace(/\D/g,"")}}}),stddev:c.stddev,null_ratio:c.null_ratio,count:c.cnt,distinct:c.uniq,avg:c.avg,max:c.max,min:c.min,stddevmean:c.stddevmean,weight:(c.uniq>1?1:0)*(1-c.null_ratio)*(c.stddev<-1?1:c.stddev<1?.5:c.stddev<3?.25:.1),quantiles:c.quantiles,equalint:c.equalint,jenks:c.jenks,headtails:c.headtails,dist_type:c.dist_type})})},a.prototype.describe=function(a,b,c){var d=this,e=arguments,f=e[e.length-1];if(_.isFunction(f))var g=f;var h=function(a){a.column=b,g(a)},i="select * from ("+a+") __wrap limit 0";this.execute(i,function(e){var f=c&&c.type?c.type:e.fields[b].type;return f?void("string"===f?d.describeString(a,b,h):"number"===f?d.describeFloat(a,b,h):"geometry"===f?d.describeGeom(a,b,h):"date"===f?d.describeDate(a,b,h):"boolean"===f?d.describeBoolean(a,b,h):h(new Error("column type is not supported"))):void h(new Error("column does not exist"))})},c.cartodb.SQL=a}(),function(){cartodb.createVis=function(a,b,c,d){if(!a)throw new TypeError("a DOM element should be provided");var e=arguments,f=e[e.length-1];_.isFunction(f)&&(d=f),a="string"==typeof a?document.getElementById(a):a;var g=new cartodb.vis.Vis({el:a});return b&&(g.load(b,c),d&&g.done(d)),g}}(),cdb.$=$,cdb.L=L,cdb.Mustache=Mustache,cdb.Backbone=Backbone,cdb._=_}();for(var i in __prev)__prev[i]&&(window[i]=__prev[i])}(); diff --git a/style.css b/style.css index 137b3d5..e159ab3 100644 --- a/style.css +++ b/style.css @@ -4,7 +4,7 @@ Theme URI: https://github.com/cardume/jeo Author: Cardume Author URI: http://www.cardume.art.br/ Description: Interactive maps and journalism -Version: 1.0.6 +Version: 1.0.7 License: GNU General Public License v3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html Tags: black, white, green, light, four-columns, two-columns, responsive-layout, translation-ready, theme-options