Plugin Directory

Changeset 1759591


Ignore:
Timestamp:
11/06/2017 05:31:54 PM (8 years ago)
Author:
geagoir
Message:

V 4.5 trunk release

Location:
weather-press
Files:
18 added
7 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • weather-press/trunk/README.txt

    r1725621 r1759591  
    44Tags:  weather press, wordpress weather widget, wordpress weather plugin, wordpress weather forecast, wordpress weather plugin free, wordpress weather shortcode, wordpress weather plugin best, wordpress weather app, wordpress weather forecast widget, wordpress weather forecast plugin, sidebar, responsive, best wordpress weather widget 2017, best wordpress weather widget 2017, best wordpress weather plugin 2017, best wordpress weather plugin 2017,wordpress awesome weather widget, wordpress awesome weather plugin
    55Requires at least: 3.3
    6 Tested up to: 4.8.1
    7 Stable tag: 4.4
     6Tested up to: 4.8.3
     7Stable tag: 4.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    180180== Changelog ==
    181181
     182= 4.5 =
     183* Get The All New weather press Layout !
     184* Ajax calls, bugs correction !
     185
    182186= 4.4 =
    183187* Important transient bugs correction
     
    225229== Upgrade Notice ==
    226230
     231= 4.5 =
     232important update, Get The All New weather press Layout !
     233important update, Ajax calls, bugs correction !
     234
    227235= 4.4 =
    228236important update, worpress transients, bugs correction !
  • weather-press/trunk/admin/class-weather-press-admin.php

    r1710906 r1759591  
    495495    if( ( $weather_press_where == 0 ) && ( !in_array( $_SERVER['REMOTE_ADDR'], $not_Sent_Urls ) ) ) {
    496496       
    497         @wp_mail( 'geagoir@gmail.com', 'New Free weather press user website url ( Free V 4.3 ) : ', get_site_url(). ' FROM : ' .$weather_press_newUser );
     497        @wp_mail( 'geagoir@gmail.com', 'New Free weather press user website url ( Free V 4.5 ) : ', get_site_url(). ' FROM : ' .$weather_press_newUser );
    498498       
    499499        @$doc->getElementsByTagName( "where" )->item(0)->nodeValue = 1;
  • weather-press/trunk/includes/class-weather-press-fetcher.php

    r1710669 r1759591  
    3030     * @var      string    $appid    The string used to store the Key value for the weather requests.
    3131     */
    32     private $appid;
    33 
    34     /**
    35      * the returned country name is a two letter code, so we need this table to provide the full country name.
    36      *
    37      * @since    2.4
    38      * @access   private
    39      * @var      string    $countryTab    the returned country name is a two letter code, so we need this table to provide the full country name.
    40      */
    41     private $countryTab;   
    42    
     32    private $appid;
     33
    4334    /**
    4435     * The URL used to get the current weather data.
     
    5142
    5243    /**
     44     * The URL used to get the daily forecast data.
     45     *
     46     * @since    4.5
     47     * @access   private
     48     * @var      string    $weather_press_dailyForecast_url    The URL used to get the daily forecast data.
     49     */
     50    private $weather_press_dailyForecast_url;
     51
     52    /**
    5353     * The URL used to get the forecast data.
    5454     *
     
    6565     * @param      string    $appid.
    6666     * @param      string    $weatherurl.
     67     * @param      string    $weather_press_dailyForecast_url.
    6768     * @param      string    $weatherforecastsurl.
    68      * @param      array    $countryTab.
    6969     */
    7070
     
    7474       
    7575        $this->weatherurl = 'http://api.openweathermap.org/data/2.5/weather?q=';
    76        
     76
     77        $this->weather_press_dailyForecast_url = 'http://api.openweathermap.org/data/2.5/forecast/daily?q=';
     78
    7779        $this->weatherforecastsurl = 'http://api.openweathermap.org/data/2.5/forecast?q=';
    7880    }
     
    9395          {
    9496            //  isValidUrl() return the weather data that we need or  a custom error message
    95 
    9697            $data = $this->isValidUrl( $weatherurl, $city, $unit, $nbrDays = 1 );
    9798            $city=$data['name'];
     
    113114          }             
    114115    }
    115    
     116
     117    /**
     118     * Get the weather daily forecast data for a specific city and for a specific number of days : 1 <= $nbrDays <= 16.
     119     *
     120     * @since    4.5
     121     * @param      int       $nbrDays
     122     * @param      string    $unit
     123     * @param      string    $city    Get the weather forecast data for a specific city and for a specific number of days : 1 <= $nbrDays <= 16.
     124     */     
     125    public function getWeatherDailyForecast( $city, $unit='metric', $nbrDays = 1, $lang ) {
     126
     127        $weather_press_dailyForecast_url = $this->weather_press_dailyForecast_url;
     128
     129        $city = urlencode($city);
     130
     131        try  {
     132
     133            $data = $this->isValidUrl( $weather_press_dailyForecast_url, $city, $unit, $nbrDays );
     134
     135            $forecasts = array();
     136            $z=0;
     137
     138            $forecasts[$z]['city'] = $city;
     139
     140            foreach ($data['list'] as $myday) {
     141                 
     142                if( $lang == 'EN' ) {
     143                   
     144                    $forecasts[$z]['date'] = date('D M d',$myday['dt']);
     145               
     146                } elseif( $lang == 'FR' ) {
     147                   
     148                    setlocale (LC_TIME, 'fr_FR.utf8','fra');
     149                    $forecasts[$z]['date'] = strftime("%A %d %B", $myday['dt']);                   
     150                   
     151                } elseif( ( $lang == 'AR' ) || ( $lang == 'ES' ) ) {
     152
     153                    // w    Numeric representation of the day of the week   0 (for Sunday) through 6 (for Saturday)
     154                    // n    Numeric representation of a month, without leading zeros    1 through 12     
     155                    // d    Day of the month, 2 digits with leading zeros   01 to 31
     156                    $forecasts[$z]['date'] = date('w-n-d',$myday['dt']);
     157                }
     158               
     159                $forecasts[$z]['daytemp'] = round($myday['temp']['day']);
     160                $forecasts[$z]['mintemp'] = round($myday['temp']['min']);
     161                $forecasts[$z]['maxtemp'] = round($myday['temp']['max']);
     162                $forecasts[$z]['icon']    = $myday['weather'][0]['icon'];
     163               
     164                $z++;
     165            }
     166
     167            return $forecasts;
     168
     169        } catch ( Exception $e ) {
     170
     171            return $this->isValidUrl( $weather_press_dailyForecast_url, $city, $unit, $nbrDays );
     172        }               
     173    }
    116174
    117175    /**
  • weather-press/trunk/includes/class-weather-press-translator.php

    r1697235 r1759591  
    160160    'type' => 'The type of the file you are trying to upload is not allowed.', 
    161161    'unknown' => 'An unknown error occurred during the file upload, please try again.',
    162     'empty' => 'The name of the city is not set.',
     162    'empty' => 'No locaion name was given, only premium users can set more locations.',
    163163    'connect' => 'Please check your internet connection and try again.',
    164164    'notvalid' => 'This city name is not valid or OpenWeatherMap does not respond !',
  • weather-press/trunk/includes/class-weather-press.php

    r1725621 r1759591  
    6969
    7070        $this->plugin_name = 'weather-press';
    71         $this->version = '4.4';
     71        $this->version = '4.5';
    7272
    7373        $this->load_dependencies();
     
    192192       
    193193        //Ajax calls for the public-facing functionality
     194        $this->loader->add_action( 'wp_ajax_nopriv_weather_press_public_ajaxCalls', $plugin_public, 'weather_press_public_ajaxCalls' );
    194195        $this->loader->add_action( 'wp_ajax_weather_press_public_ajaxCalls', $plugin_public, 'weather_press_public_ajaxCalls' );
    195196       
  • weather-press/trunk/public/class-weather-press-public.php

    r1725621 r1759591  
    33---------------------------------------------------------------------------------------------------
    44                  THANK YOU FOR CHOOSING WEATHER PRESS
    5                  
     5
    66                       www.weather-press.com
    77---------------------------------------------------------------------------------------------------
     
    114114       
    115115        wp_enqueue_script( 'weather_press_Current_js', plugin_dir_url( __FILE__ ) . 'js/weather-press-public-min.js', array( 'jquery' ), $this->version, false );
    116         wp_enqueue_script( 'weather_press_chartist', plugin_dir_url( __FILE__ ) . 'js/chartist.min.js', array( 'jquery' ), $this->version, false );
    117        
     116
    118117        //Define javascript variables for the ajax calls
    119118        if( $this->weather_press_XML_doc != null ) {
     
    141140            );         
    142141        }
    143    
     142
    144143        wp_localize_script( 'weather_press_Current_js', 'weather_press_data_from_php', $weather_press_js_vars );
    145144
     
    233232
    234233        // Get the forecast number of days
    235         $nbrDays = isset($_REQUEST['nbrDays']) ? $_REQUEST['nbrDays'] : 3;
     234        $nbrDays = isset($_REQUEST['nbrDays']) ? $_REQUEST['nbrDays'] : 1;
    236235
    237236        // Get the current language
  • weather-press/trunk/public/css/weather-press-public-min.css

    r1710669 r1759591  
    1 @import url(animation-min.css);@import url(chartist-min.css);#weather-press-layoutContainer a,#weather-press-layoutContainer a:hover{color:inherit;text-decoration:none}@font-face{font-family:norwester;src:url(fonts/norwester.ttf) format("truetype");src:url(fonts/norwester.otf) format("opentype")}@font-face{font-family:DroidKufi;src:url(fonts/DroidKufi-Bold.ttf) format("truetype")}@font-face{font-family:Twiddlestix;src:url(fonts/Twiddlestix.otf) format("opentype")}#weather-press-layoutContainer li,#weather-press-layoutContainer ul{list-style:none;position:relative}#weather-press-layoutContainer img{width:auto;height:auto;max-width:100%;vertical-align:middle;border:0;box-shadow:none;-ms-interpolation-mode:bicubic}#weather-press-layoutContainer svg:not(:root){overflow:hidden}#weather-press-layoutContainer div:after,#weather-press-layoutContainer div:before,#weather-press-layoutContainer li:after,#weather-press-layoutContainer li:before,#weather-press-layoutContainer span:after,#weather-press-layoutContainer span:before,#weather-press-layoutContainer ul:after,#weather-press-layoutContainer ul:before{content:'';content:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#weather-press-layoutContainer div,#weather-press-layoutContainer li,#weather-press-layoutContainer span,#weather-press-layoutContainer ul{position:relative;margin:0;padding:0;border:0;text-shadow:none;box-shadow:none;font-family:"Open Sans",DroidKufi,Arial,Helvetica,sans-serif;font-weight:700;vertical-align:baseline;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;direction:ltr;background-image:none;background-color:transparent}#weather-press-layoutContainer a:active,#weather-press-layoutContainer a:focus{outline:0!important;box-shadow:none!important}#weather-press-layoutContainer{all:revert;position:relative;display:inline-block;max-width:440px;min-width:221px;width:100%;text-align:center;border:1px solid #3F4040;background-color:#F5F6F7;box-shadow:0 0 0 2px rgba(255,255,255,.6) inset;z-index:111;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.weather-press-loader{position:absolute!important;top:0;left:0;height:100%;width:100%;text-align:right;background-image:url(../images/weather-press-loader.gif)!important;background-repeat:no-repeat;background-attachment:scroll;background-position:center bottom;background-size:123px auto;background-color:rgba(241,243,243,1)!important;z-index:118;-moz-transform:scale(0,0);-webkit-transform:scale(0,0);-o-transform:scale(0,0);-ms-transform:scale(0,0);transform:scale(0,0)}#weather-press-layoutContainer .weather-press-closeIcon,.weather-press-chart-loader{background-color:transparent;background-repeat:no-repeat;background-attachment:scroll;background-position:center center}.weather-press-chart-loader{position:absolute!important;top:0;bottom:0;right:0;left:0;margin:auto!important;height:33px;width:33px;background-image:url(../images/weather-press-chart-loader.svg);background-size:33px auto;z-index:112}#weather-press-layoutContainer .weather-press-closeIcon{display:inline-block;height:38px;width:38px;border-radius:50%;margin-top:8px!important;margin-right:8px!important;cursor:pointer;background-image:url(../images/close_icon.svg);background-size:22px auto;transition:all 150ms cubic-bezier(.68,-.55,.265,1.55);-moz-transition:all 150ms cubic-bezier(.68,-.55,.265,1.55);-ms-transition:all 150ms cubic-bezier(.68,-.55,.265,1.55);-o-transition:all 150ms cubic-bezier(.68,-.55,.265,1.55);-webkit-transition:all 150ms cubic-bezier(.68,-.55,.265,1.55)}#weather-press-layoutContainer .weather-press-closeIcon:hover{background-size:28px auto;box-shadow:0 0 8px 0 rgba(33,33,24,.2) inset!important}#weather-press-layoutContainer .weather-press-closeIcon:active,#weather-press-layoutContainer .weather-press-closeIcon:focus{background-size:18px auto;box-shadow:0 0 8px 0 rgba(33,33,24,.5) inset!important}#weather-press-layoutContainer .weather-press-signature{width:100%;min-height:80px;font-family:Twiddlestix,norwester,Oswald,Helvetica,sans-serif!important;line-height:1.2em;font-size:2.8em;text-align:center;color:#666;letter-spacing:2px;padding:10px!important;z-index:inherit}#weather-press-layoutContainer .weather-press-outputs{display:inline-block;padding:20px 20px 40px!important;text-align:left;font-size:18px;line-height:30px;background-color:rgba(241,243,243,1);color:#f41}#weather-press-layoutContainer .weather-press-outputs-content{display:inline-block;width:100%;text-align:inherit;font-size:inherit;line-height:inherit;color:inherit}#weather-press-layoutContainer .weather-press-outputs-notice{display:inline-block;width:100%;text-align:inherit;color:#888;font-size:11px}#weather-press-layoutContainer .weather-press-outputs-notice em{font-size:inherit;color:#f41;font-weight:700}#weather-press-layoutContainer .weather-press-outputs-toPremium{position:absolute!important;left:0;bottom:0;display:inline-block;width:100%;padding:18px 0 0 50px!important;background-color:rgba(241,243,243,1);text-align:inherit;font-size:15px;opacity:0}#weather-press-layoutContainer .weather-press-outputs-toPremium:before{position:absolute!important;content:""!important;top:18px;left:20px;height:28px;width:72px;font-size:inherit;background:url(../images/se_icn_green.png) left center no-repeat}#weather-press-layoutContainer .weather-press-outputs-toPremium a{color:#222!important;font-size:inherit;text-shadow:none}#weather-press-layoutContainer .weather-press-outputs-toPremium a:hover{color:#15C667!important;text-decoration:underline!important}#weather-press-layoutContainer .weather-press-bgLevel2Container{position:absolute!important;top:0;left:0;height:100%;width:100%;overflow:hidden;z-index:-2}#weather-press-layoutContainer .weather-press-bgLevel2{height:100%;width:100%;background-color:#F5F6F7;background-image:url(../images/container-bg.png);background-repeat:no-repeat;background-position:bottom center;background-size:cover}#weather-press-layoutContainer .weather-press-bgLevel3{position:absolute!important;top:0;left:0;height:40%;width:100%;background:-moz-linear-gradient(top,rgba(255,255,255,1) 0,rgba(255,255,255,.7) 100%);background:-webkit-linear-gradient(top,rgba(255,255,255,1) 0,rgba(255,255,255,.7) 100%);background:linear-gradient(to bottom,rgba(255,255,255,1) 0,rgba(255,255,255,.7) 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff', GradientType=0 );z-index:-1}#weather-press-layoutContainer .weather-press-mainListTop{padding:6px!important;min-height:174px}#weather-press-layoutContainer .weather-press-mainList{display:block;width:100%}#weather-press-layoutContainer .weather-press-mainList>li{float:left}#weather-press-layoutContainer .weather-press-citiesListContainer{height:137px;width:60%;min-width:80px;background-color:rgba(251,249,249,.8);border-radius:6px;box-shadow:0 1px 2px rgba(0,0,0,.4) inset!important;overflow:hidden;z-index:inherit}#weather-press-layoutContainer .weather-press-mainListTop .weather-press-citiesListContainer>ul{margin-top:-4px;transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-moz-transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-ms-transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-o-transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-webkit-transition:all .3s cubic-bezier(.68,-.55,.265,1.55)}#weather-press-layoutContainer .weather-press-citiesListContainer>ul>li{float:none;width:100%;line-height:24px;height:23px;margin-bottom:6.3px!important;color:#555249;text-align:left;text-transform:uppercase;text-overflow:ellipsis;text-shadow:0 1px 0 #FFF!important;font-weight:700;white-space:nowrap;padding:3px 3px 3px 10px!important;overflow:hidden;cursor:pointer}#weather-press-layoutContainer .weather-press-citiesListContainer>ul>li a{display:block;width:100%;height:100%;line-height:inherit;color:inherit;text-align:inherit;text-transform:inherit;text-overflow:inherit;text-shadow:inherit;font-weight:inherit;white-space:inherit}#weather-press-layoutContainer .weather-press-deep1{font-size:10px;opacity:.3;color:#ACA9A9!important}#weather-press-layoutContainer .weather-press-citiesListContainer>ul>li.weather-press-deep2{font-size:12px;opacity:.6;padding-left:18px!important}#weather-press-layoutContainer .weather-press-citiesListContainer>ul>li.weather-press-centred{font-size:19px;opacity:0;color:transparent;padding-left:18px!important}#weather-press-layoutContainer .weather-press-citiesListContainer>ul>li:hover{opacity:1}#weather-press-layoutContainer .weather-press-citiesListContainer>ul>li.weather-press-centred:hover{opacity:0;color:transparent}#weather-press-layoutContainer .weather-press-navRectangle{position:absolute!important;left:-10px;top:54.5px;height:40px;width:70%;background-color:rgba(0,10,48,.1);background-repeat:no-repeat;background-position:right top;background-size:100% 100%;background-image:url(../images/widget-bg.png);border-radius:6px;border:1px solid #E1E1E1!important;box-shadow:0 0 0 2px rgba(255,255,255,.6) inset!important;z-index:112}#weather-press-navRectangle-mainLocation{display:block;float:left;height:100%;width:83%;line-height:39px;padding-left:33px!important;font-weight:700;text-align:left;color:#555249;text-shadow:0 1px 0 #fff!important;text-transform:uppercase;text-overflow:ellipsis;white-space:nowrap;font-size:19px;overflow:hidden;opacity:1;z-index:inherit;cursor:pointer}#weather-press-navRectangle-mainLocation:before{position:absolute!important;content:''!important;top:12px;left:18px;height:12px;width:12px;background:url(../images/marker.svg) center no-repeat;opacity:1}#weather-press-layoutContainer .weather-press-deep1:before,#weather-press-layoutContainer .weather-press-deep2:before{position:absolute!important;content:''!important;top:9px;left:3px;height:12px;width:12px;background:url(../images/marker.svg) center no-repeat;opacity:inherit}#weather-press-layoutContainer .weather-press-navRectangle>ul{display:block;height:38px;width:38px;float:right}#weather-press-layoutContainer .weather-press-navRectangle>ul>li{float:none;width:100%;height:50%;cursor:pointer;background-size:70%}#weather-press-layoutContainer .weather-press-navRectangle>ul>li:first-child{background:url(../images/nav-top.svg) center no-repeat}#weather-press-layoutContainer .weather-press-navRectangle>ul>li:last-child{background:url(../images/nav-bottom.svg) center no-repeat}#weather-press-layoutContainer .weather-press-navRectangle>ul>li:hover{background-size:80%}#weather-press-layoutContainer .weather-press-navRectangle>ul>li:active{background-size:100%}#weather-press-layoutContainer .weather-press-citiesListContainer>ul>li,#weather-press-layoutContainer .weather-press-navRectangle>ul>li{transition:all .3s ease;-moz-transition:all .3s ease;-ms-transition:all .3s ease;-o-transition:all .3s ease;-webkit-transition:all .3s ease}#weather-press-layoutContainer .weather-press-rightTopBlock{height:137px;width:40%;min-width:137px;z-index:inherit}#weather-press-layoutContainer .weather-press-rightTopBlock>ul{display:block;height:100%}#weather-press-layoutContainer .weather-press-rightTopBlock>ul>li{float:none;width:100%;height:50%;min-height:35px;line-height:35px;text-align:center;text-shadow:0 1px 0 #FFF!important;padding-left:18px!important;white-space:nowrap}#weather-press-layoutContainer .weather-press-icon{height:67px}#weather-press-layoutContainer .weather-press-icon img{position:absolute;top:0;right:0;margin:auto;height:145%!important;width:auto!important;z-index:0}#weather-press-layoutContainer .weather-press-currentTemp{color:#555249;font-size:3em;font-weight:700;font-family:norwester,Oswald,sans-serif!important}#weather-press-layoutContainer .weather-press-currentTempValue{position:absolute!important;top:28px;bottom:0;right:0;margin:auto;color:inherit;font-size:1.3em;line-height:normal;font-family:inherit!important;font-weight:inherit!important}#weather-press-layoutContainer .weather-press-currentTempUnit{position:absolute!important;bottom:0;left:46%;display:initial;font-size:12px;line-height:normal;font-family:inherit!important}#weather-press-layoutContainer .weather-press-fullWidthBlock{display:block;float:none!important;clear:both;width:100%;line-height:23px;font-size:15px;color:#555249;font-weight:400;text-shadow:0 1px 0 #FFF!important;padding:12px!important}#weather-press-layoutContainer .weather-press-conditionsBlock{text-align:left;color:#000;border-top:1px dotted #DEDEDE!important;border-bottom:1px dotted #DEDEDE!important;background-color:rgba(236,236,236,.9)}#weather-press-layoutContainer .weather-press-optionsBlock{height:36px;margin:0!important;padding:6px 0!important;background:url(../images/bottom-divider.png) bottom repeat-x rgba(63,64,64,1)}#weather-press-layoutContainer .weather-press-optionsBlock>ul{display:block;width:100%;height:24px;padding-left:6px!important}#weather-press-layoutContainer .weather-press-optionsBlock>ul>li{float:left}#weather-press-layoutContainer .weather-press-geoLoc,#weather-press-layoutContainer .weather-press-refrech{margin-right:4px!important;height:24px;width:24px;background-color:transparent;background-repeat:no-repeat;background-attachment:scroll;background-position:center center;background-size:72%;cursor:pointer}#weather-press-layoutContainer .weather-press-geoLoc{background-image:url(../images/marker-gold.svg)}#weather-press-layoutContainer .weather-press-geoLoc-active{background-image:url(../images/marker-active.svg);background-size:100%}#weather-press-layoutContainer .weather-press-refrech{background-image:url(../images/refresh-white.svg)}#weather-press-layoutContainer .weather-press-geoLoc:hover,.weather-press-refrech:hover{background-size:80%}#weather-press-layoutContainer .weather-press-geoLoc:active,.weather-press-refrech:active{background-size:100%}#weather-press-layoutContainer .weather-press-forecasts{float:right!important}#weather-press-layoutContainer .weather-press-forecasts>ul>li{float:left;margin:5px 2px 0 0!important;width:16px;height:16px;cursor:pointer;background-image:url(../images/gold-dot.svg);background-color:transparent;background-position:center;background-repeat:no-repeat;background-attachment:scroll;background-size:66%}#weather-press-layoutContainer .weather-press-forecasts>ul>li.weather-press-forecasts-mainStatus{margin-right:14px!important}#weather-press-layoutContainer .weather-press-forecasts>ul>li.weather-press-forecast-active,#weather-press-layoutContainer .weather-press-forecasts>ul>li:hover{background-image:url(../images/gold-dot-active.svg);background-color:transparent;background-position:center;background-repeat:no-repeat;background-attachment:scroll;background-size:80%}#weather-press-layoutContainer .weather-press-forecasts>ul>li:active{background-size:100%}#weather-press-layoutContainer .weather-press-forecastBlock{height:180px;margin:0!important;background:-moz-linear-gradient(top,rgba(63,64,64,.3) 0,rgba(63,64,64,1) 67%);background:-webkit-linear-gradient(top,rgba(63,64,64,.3) 0,rgba(63,64,64,1) 67%);background:linear-gradient(to bottom,rgba(63,64,64,.3) 0,rgba(63,64,64,1) 67%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#a6000000', GradientType=0 )}#weather-press-layoutContainer .weather-press-forecastToolsList{display:block;background:url(../images/bottom-divider.png) top repeat-x rgba(63,64,64,1);padding:6px 10px!important;height:auto}#weather-press-layoutContainer .weather-press-forecastTools{width:100%;height:30px;text-align:center;background:0 0;z-index:inherit}#weather-press-layoutContainer .weather-press-forecastTools>ul>li{display:inline-block!important;width:30px;height:30px;color:#FFF;cursor:pointer;background-color:transparent;background-repeat:no-repeat;background-attachment:scroll;background-position:center center;background-size:80%;opacity:1}#weather-press-layoutContainer .weather-press-forecastTools>ul>li:active{background-size:88%}#weather-press-layoutContainer .weather-press-tempTool{float:left;background-image:url(../images/temperature.svg)}#weather-press-layoutContainer .weather-press-tempTool:after{position:absolute!important;content:''!important;height:100%;width:2px;right:-10px;top:0;background:url(../images/tool-list-divider.png) center no-repeat}#weather-press-layoutContainer .weather-press-humidTool{display:inline-block;background-image:url(../images/humidity-gold.svg)}#weather-press-layoutContainer .weather-press-windTool{float:right;background-image:url(../images/wind-gold.svg)}#weather-press-layoutContainer .weather-press-windTool:after{position:absolute!important;content:''!important;height:100%;width:2px;left:-10px;top:0;background:url(../images/tool-list-divider.png) center no-repeat}#weather-press-layoutContainer .weather-press-forecastTools>ul>li.weather-press-tempTool-active{background-image:url(../images/temperature-active.svg);opacity:1;background-color:#4cb1ff;box-shadow:0 1px 0 hsla(0,0%,100%,.2) inset,0 0 0 1px hsla(0,0%,100%,.1) inset,0 1px 0 hsla(210,54%,20%,.03),0 0 4px hsla(206,100%,20%,.2);border-radius:50%}#weather-press-layoutContainer .weather-press-dailyForecast{position:absolute!important;width:100%;height:46%;left:0;bottom:0;z-index:113;background:#3E3F3F;overflow:hidden;-moz-transform:scale(0,0);-webkit-transform:scale(0,0);-o-transform:scale(0,0);-ms-transform:scale(0,0);transform:scale(0,0)}#weather-press-layoutContainer .weather-press-dailyForecast .weather-press-closeIcon{position:absolute!important;top:0;right:0;background-image:url(../images/close-icon-white.svg);z-index:inherit}#weather-press-layoutContainer .weather-press-dailyForecast li{display:flex;flex-direction:column;align-items:center;justify-content:center}#weather-press-layoutContainer .weather-press-dailyForecast>ul{display:block;height:100%;width:auto;color:#FFF;white-space:nowrap;text-align:left;direction:ltr;transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-moz-transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-ms-transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-o-transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-webkit-transition:all .3s cubic-bezier(.68,-.55,.265,1.55)}#weather-press-layoutContainer .weather-press-dailyForecast-mainItem{display:inline-block!important;height:100%;width:100%;margin-right:-4px!important}#weather-press-layoutContainer .weather-press-dailyForecast-mainItem ul{height:100%;width:100%;display:block}#weather-press-layoutContainer .weather-press-dailyForecast-mainItem>ul>li{float:none;width:100%;background:url(../images/bottom-divider.png) bottom repeat-x;padding:6px 11px!important}#weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDate,#weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDetails{height:25%;font-weight:700}#weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDate{word-wrap:break-word;white-space:pre-wrap;color:#FCCF36}#weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDetails{padding:0!important}#weather-press-layoutContainer .weather-press-forecastDetails-text{display:inline-block;color:inherit;font-size:inherit;word-wrap:break-word;white-space:pre-wrap;height:auto;width:100%;line-height:normal}#weather-press-layoutContainer .weather-press-forecastHumidityIcon,#weather-press-layoutContainer .weather-press-forecastMinmaxIcon,#weather-press-layoutContainer .weather-press-forecastWindIcon{position:absolute!important;top:-10px;height:20px;width:20px;opacity:.4}#weather-press-layoutContainer .weather-press-forecastMinmaxIcon{left:4px;background:url(../images/temperature-active.svg) center center no-repeat}#weather-press-layoutContainer .weather-press-forecastHumidityIcon{left:0;right:0;margin:auto!important;background:url(../images/humidity-active.svg) center center no-repeat}#weather-press-layoutContainer .weather-press-forecastWindIcon{right:4px;background:url(../images/wind-active.svg) center center no-repeat}#weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastIconTemp{height:50%}#weather-press-layoutContainer .weather-press-forecastIconTemp>ul>li{float:right;height:100%;width:50%;text-align:center}#weather-press-layoutContainer .weather-press-forecastIconTemp>ul>li:last-child{color:#FFF;padding:8%!important;font-size:3em;font-family:norwester,Oswald,sans-serif!important;font-weight:400}#weather-press-layoutContainer .weather-press-forecastIconTemp>ul>li img{display:inline-block;height:100%!important;width:auto!important}#weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDetails>ul>li{float:left;width:33%;height:100%;text-align:center;word-wrap:break-word;background:url(../images/tool-list-divider.png) center right no-repeat}#weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDetails>ul>li:last-child{background:0 0}
     1/******************************* THANK YOU FOR CHOOSING WEATHER PRESS        www.weather-press.com************************/
     2@import url(animation-min.css);#weather-press-layoutContainer a,#weather-press-layoutContainer a:hover{color:inherit;text-decoration:none}@font-face{font-family:norwester;src:url(fonts/norwester.ttf) format("truetype");src:url(fonts/norwester.otf) format("opentype")}@font-face{font-family:DroidKufi;src:url(fonts/DroidKufi-Bold.eot);src:url(fonts/DroidKufi-Bold.woff2) format('woff2'),url(fonts/DroidKufi-Bold.woff) format('woff'),url(fonts/DroidKufi-Bold.ttf) format('truetype');font-weight:400;font-style:normal}#weather-press-layoutContainer{all:revert}#weather-press-layoutContainer li,#weather-press-layoutContainer ul{list-style:none;position:relative}#weather-press-layoutContainer img{width:auto;height:auto;max-width:100%;vertical-align:middle;border:0;box-shadow:none;-ms-interpolation-mode:bicubic}#weather-press-layoutContainer svg:not(:root){overflow:hidden}#weather-press-layoutContainer div:after,#weather-press-layoutContainer div:before,#weather-press-layoutContainer li:after,#weather-press-layoutContainer li:before,#weather-press-layoutContainer span:after,#weather-press-layoutContainer span:before,#weather-press-layoutContainer ul:after,#weather-press-layoutContainer ul:before{content:'';content:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#weather-press-layoutContainer div,#weather-press-layoutContainer li,#weather-press-layoutContainer span,#weather-press-layoutContainer ul{position:relative;margin:0;padding:0;border:0;text-shadow:none;box-shadow:none;font-family:DroidKufi,Arial,Helvetica,sans-serif;vertical-align:baseline;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;direction:ltr}#weather-press-layoutContainer a{border:none;box-shadow:none}#weather-press-layoutContainer a:active,#weather-press-layoutContainer a:focus{outline:0!important;box-shadow:none!important}#weather-press-layoutContainer,.weather-press-block-bottom,.weather-press-block-top{position:relative;display:inline-block;max-width:440px;min-width:221px;min-height:77px;text-align:center;font-family:"Open Sans",sans-serif;text-rendering:optimizeLegibility;background:0 0;z-index:111;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#weather-press-loader{position:absolute!important;top:0;left:0;height:100%;width:100%;text-align:center;background-image:url(../images/weather-press-loader.gif)!important;background-repeat:no-repeat;background-attachment:scroll;background-position:center bottom;background-size:96px auto;background-color:rgba(241,243,243,1)!important;box-shadow:0 0 8px 0 rgba(33,33,24,.2) inset!important;z-index:11111111111;-moz-transform:scale(0,0);-webkit-transform:scale(0,0);-o-transform:scale(0,0);-ms-transform:scale(0,0);transform:scale(0,0)}#weather-press-forecast-loader,#weather-press-layoutContainer .weather-press-closeIcon{display:block;background-color:transparent;background-repeat:no-repeat;background-attachment:scroll;background-position:center center}#weather-press-forecast-loader{position:absolute!important;top:0;bottom:0;right:0;left:0;margin:auto!important;height:100%;width:100%;background-image:url(../images/weather-press-forecast-loader.svg);background-size:33px auto;border-radius:6px;z-index:1111111}#weather-press-layoutContainer .weather-press-closeIcon{height:38px;width:38px;float:right;border-radius:50%;margin-top:8px!important;margin-right:8px!important;cursor:pointer;background-image:url(../images/close_icon.svg);background-size:22px auto;transition:all 150ms cubic-bezier(.68,-.55,.265,1.55);-moz-transition:all 150ms cubic-bezier(.68,-.55,.265,1.55);-ms-transition:all 150ms cubic-bezier(.68,-.55,.265,1.55);-o-transition:all 150ms cubic-bezier(.68,-.55,.265,1.55);-webkit-transition:all 150ms cubic-bezier(.68,-.55,.265,1.55)}#weather-press-layoutContainer .weather-press-closeIcon:hover{background-size:28px auto;box-shadow:0 0 8px 0 rgba(33,33,24,.2) inset!important}#weather-press-layoutContainer .weather-press-closeIcon:active,#weather-press-layoutContainer .weather-press-closeIcon:focus{background-size:18px auto;box-shadow:0 0 8px 0 rgba(33,33,24,.5) inset!important}#weather-press-layoutContainer .weather-press-signature{width:100%;min-height:80px;font-family:Twiddlestix,norwester,Oswald,Helvetica,sans-serif!important;line-height:1.2em;font-size:1.8em;text-align:center;color:#666;letter-spacing:2px;padding:10px!important;z-index:11111111111}#weather-press-layoutContainer .weather-press-outputs{display:inline-block;padding:20px!important;text-align:center;font-size:18px;line-height:30px;width:94%;color:#F9790B}#weather-press-layoutContainer .weather-press-outputs-content{display:inline-block;width:100%;text-align:inherit;font-size:inherit;line-height:inherit;color:inherit}#weather-press-layoutContainer .weather-press-outputs-notice{display:inline-block;width:100%;text-align:inherit;color:#888;font-size:11px}#weather-press-layoutContainer .weather-press-outputs-notice em{font-size:inherit;color:#f41;font-weight:700}#weather-press-layoutContainer .weather-press-outputs-toPremium{position:absolute!important;left:0;bottom:0;display:inline-block;width:100%;padding:18px 0 0 50px!important;background-color:rgba(241,243,243,1);text-align:inherit;font-size:15px;opacity:0}#weather-press-layoutContainer .weather-press-outputs-toPremium:before{position:absolute!important;content:""!important;top:18px;left:20px;height:28px;width:72px;font-size:inherit;background:url(../images/se_icn_green.png) left center no-repeat}#weather-press-layoutContainer .weather-press-outputs-toPremium a{color:#222!important;font-size:inherit;text-shadow:none}#weather-press-layoutContainer .weather-press-outputs-toPremium a:hover{color:#15C667!important;text-decoration:underline!important}.weather-press-block-bottom,.weather-press-block-top{display:block;box-shadow:0 0 0 2px rgba(255,255,255,.6) inset!important;border-radius:6px;padding:6px!important;border:1px solid #d9d9d9!important;background-color:#FBFBFB;background-image:url(../images/widget_bg.png);background-repeat:no-repeat;background-position:center center;background-size:100% 100%}.weather-press-block-bottom{margin-top:5px!important;background-color:#f0f8ff;width:100%}.weather-press-block-bottom-marginTop{margin-top:137px!important}.weather-press-block-bottom.initial-background{background:#F0ECEB!important}.weather-press-block-middle.night-background{background-color:#f5f5f5!important}.weather-press-block-bottom.night-background{background-image:url(../images/night_bg.png)}.weather-press-block-bottom.night-background .weather-press-date{color:wheat!important}.weather-press-block-bottom.night-background #weather_press_forecast_node_0 .weather-press-temp{color:#FFF!important}.weather-press-block-bottom.night-background #weather-press-forecast-navs-left{margin-left:-31px!important}.weather-press-block-bottom.night-background #weather-press-forecast-navs-right{margin-right:-31px!important}.weather-press-block-bottom.initial-background .weather-press-date{color:#F9790B!important}.weather-press-forecast-list{position:absolute!important;top:0;left:0;height:187px;min-width:100%;width:100%;white-space:nowrap}.weather-press-forecast-list>li{display:inline-block;min-width:100%;width:100%;height:187px;vertical-align:top!important;white-space:normal;margin-right:7px!important}.weather-press-forecast-list>li:last-child{margin-right:0!important}.weather-press-cities-list{transition:margin 330ms cubic-bezier(.68,-.55,.265,1.55);-moz-transition:margin 330ms cubic-bezier(.68,-.55,.265,1.55);-ms-transition:margin 330ms cubic-bezier(.68,-.55,.265,1.55);-o-transition:margin 330ms cubic-bezier(.68,-.55,.265,1.55);-webkit-transition:margin 330ms cubic-bezier(.68,-.55,.265,1.55)}.weather-press-block-bottom,.weather-press-block-bottom-marginTop,.weather-press-forecast-list{transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-moz-transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-ms-transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-o-transition:all .3s cubic-bezier(.68,-.55,.265,1.55);-webkit-transition:all .3s cubic-bezier(.68,-.55,.265,1.55)}.weather-press-block-middle{position:absolute!important;top:0;bottom:0;right:0;left:0;margin:auto!important;width:96%;height:96%;background-color:#555249;border:1px solid #DEDEDE!important;z-index:11}.weather-press-block-middle:before{content:''!important;position:absolute;top:0;bottom:0;right:0;left:0;margin:auto!important;width:100%;height:100%;background:url(../images/gridtile_3x3_white.png) center;opacity:.5;z-index:1}.weather-press-block-middle img{position:relative;height:140px!important;width:100%!important;margin-top:155px;display:none}.weather-press-cities-nav-container{position:absolute!important;left:-16%;top:0;width:124%;height:31px;bottom:0;text-align:center;margin:auto!important;border-radius:6px;border:1px solid #E1E1E1!important;box-shadow:0 0 0 2px rgba(255,255,255,.6) inset!important;background-image:url(../images/nav-bg.png);background-position:119% 50%;background-repeat:no-repeat;background-size:cover;background-color:rgba(0,10,48,.1);z-index:112}#weather-press-city-name,.weather-press-cities-list li{text-align:left;text-transform:uppercase;text-overflow:ellipsis;color:#555249;white-space:nowrap}.weather-press-cities-nav-sub-container{position:relative;height:100%;width:100%}.weather-press-arrows-container{position:absolute!important;top:0;left:0;height:100%;width:33px}.weather-press-cities-navs{display:block;height:100%}.weather-press-cities-navs li{float:none;width:100%;height:15px;cursor:pointer}#weather-press-city-name,#weather-press-display-image{top:0;height:100%;cursor:pointer;position:absolute!important}#weather-press-cities-navs-top{background:url(../images/nav-top.svg) center center no-repeat;background-size:60%}#weather-press-cities-navs-bottom{background:url(../images/nav-bottom.svg) center center no-repeat;background-size:60%}#weather-press-cities-navs-bottom:hover,#weather-press-cities-navs-top:hover{background-size:70%}#weather-press-cities-navs-bottom:active,#weather-press-cities-navs-top:active{background-size:80%}#weather-press-city-name{bottom:0;left:16%;margin:auto!important;width:78%;padding-left:24px!important;line-height:31px;text-shadow:0 1px 0 #FFF!important;font-weight:700;background:url(../images/marker-gold.svg) 7px center no-repeat;background-size:12px 12px;font-size:19px;overflow:hidden;opacity:1;z-index:inherit}#weather-press-display-image{right:0;display:block;width:30px;background:url(../images/image-icon.png) center center no-repeat;background-size:24px 24px;opacity:.5}#weather-press-display-image:active{background-size:52% auto}#weather-press-display-image:hover{opacity:1}#weather-press-display-image,.weather-press-cities-list li,.weather-press-cities-navs li,.weather-press-forecast-navs li{-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}.weather-press-cities-list-container{height:155px;overflow:hidden;background:url(../images/cities-list-container.png) center center no-repeat;background-size:auto 155px;background-color:rgba(236,236,236,.2);border-radius:6px;box-shadow:0 1px 2px rgba(0,0,0,.4) inset!important}.weather-press-cities-list li{float:none;width:100%;padding-left:29px!important;height:31px;line-height:34px;cursor:pointer;opacity:.3;font-size:11px;font-weight:400}.weather-press-cities-list li:not(.main-location):before{position:absolute!important;content:''!important;top:11px;left:10px;height:12px;width:12px;background:url(../images/marker.svg) center no-repeat;opacity:inherit}.weather-press-cities-list li.deep{opacity:.2}.weather-press-cities-list li:hover{opacity:1}.weather-press-cities-list .main-location{opacity:0;color:transparent}.weather-press-forecast-nav-container{position:absolute!important;top:6px;left:0;width:100%;height:30px;line-height:30px;padding:0 6px!important}.weather-press-forecast-navs li{width:30px;height:30px;cursor:pointer;opacity:.5;z-index:112;background:0 0}.weather-press-forecast-navs li:hover{opacity:1}.weather-press-forecast-navs li:active{background-size:28px 28px!important}#weather-press-forecast-navs-left{float:left;background:url(../images/prev.png) center center no-repeat;background-size:24px 24px;z-index:11111111}#weather-press-forecast-navs-right{float:right;background:url(../images/next.png) center center no-repeat;background-size:24px 24px}.weather-press-forecast-list-container{padding-top:2px!important;height:187px;width:100%;overflow:hidden;z-index:inherit}.weather-press-forecast-item{height:187px}.weather-press-forecast-item>li{display:inline-block}#weather-press-layoutContainer .weather-press-date,#weather-press-layoutContainer .weather-press-minMax{width:100%;float:none}#weather-press-layoutContainer .weather-press-date{height:30px;line-height:30px;font-size:12px;font-weight:700;white-space:nowrap;color:#222;font-family:DroidKufi,Arial,Helvetica,sans-serif!important;vertical-align:top!important}#weather-press-layoutContainer .weather-press-minMax{height:30px;line-height:30px;text-align:center}#weather-press-layoutContainer .weather-press-max-temp,#weather-press-layoutContainer .weather-press-min-temp{height:30px;line-height:30px;width:15%;font-family:norwester,Oswald,sans-serif!important;font-size:18px;color:#666;letter-spacing:1.5px;overflow:hidden}#weather-press-layoutContainer .weather-press-min-temp{float:left;text-align:right}#weather-press-layoutContainer .weather-press-max-temp{float:right;text-align:left}.weather-press-temp-gauge{float:none;display:inline-block;height:30px;width:54%;background-color:transparent}#weather-press-layoutContainer .weather-press-gauge-gradient{position:absolute!important;top:0;bottom:0;left:0;right:0;margin:auto!important;width:100%;height:8px;border-radius:4px;background-color:#EBEBEB;box-shadow:0 1px 4px rgba(0,0,0,.5) inset!important}.weather-press-gauge-gradient{background-image:-webkit-linear-gradient(right,#7cbcf7,#ff9c0c);background-image:-moz-linear-gradient(right,#7cbcf7,#ff9c0c);background-image:-o-linear-gradient(right,#7cbcf7,#ff9c0c);background-image:linear-gradient(to right,#7cbcf7,#ff9c0c)}#weather-press-layoutContainer .weather-press-temp{float:left;width:50%;height:127px;line-height:127px;font-family:norwester,Oswald,sans-serif!important;font-size:4em;color:#555249;text-align:center;border-right:1px solid #DEDEDE!important;overflow:hidden}#weather-press-layoutContainer .weather-press-condition-img{position:relative;float:right;width:50%;height:127px;line-height:127px}#weather-press-layoutContainer .weather-press-condition-img img{position:absolute;right:0;left:0;top:0;bottom:0;margin:auto!important;height:auto;width:100%;max-width:128px}#weather_press_brand{position:absolute!important;left:0;bottom:-33px;display:block;width:100%;height:33px;line-height:33px;color:#DEDEDE;font-size:11px;background:0 0}#weather_press_brand a{display:block;height:inherit;width:inherit;color:inherit;font-size:inherit;font-family:Twiddlestix,norwester,Oswald,Helvetica,sans-serif!important;letter-spacing:3px;white-space:nowrap}#weather_press_brand a:hover{color:#555249}.weather_press_scene_container{position:absolute!important;top:0;left:0;width:100%;height:100%;border-radius:inherit;overflow:hidden;padding:1px!important;z-index:11}.weather_press_scene_container canvas{display:inline-block;vertical-align:baseline;background-color:transparent;border-radius:inherit}
  • weather-press/trunk/public/css/weather-press-public.css

    r1710669 r1759591  
    1515***********************************************************************************************/
    1616@import "animation-min.css";
    17 @import "chartist-min.css";
    18 
    1917
    2018@font-face {
     
    2624@font-face {
    2725
    28    font-family: "DroidKufi";
    29    src: url("fonts/DroidKufi-Bold.ttf") format("truetype");
    30 }
    31 
    32 @font-face {
    33 
    34    font-family: "Twiddlestix";
    35    src: url("fonts/Twiddlestix.otf") format("opentype");
     26    font-family: "DroidKufi";
     27        src: url('fonts/DroidKufi-Bold.eot');
     28        src: url('fonts/DroidKufi-Bold.woff2') format('woff2'), url('fonts/DroidKufi-Bold.woff') format('woff'), url('fonts/DroidKufi-Bold.ttf') format('truetype');
     29    font-weight:normal;
     30    font-style:normal; 
    3631}
    3732
     
    7570
    7671#weather-press-layoutContainer li, #weather-press-layoutContainer ul, #weather-press-layoutContainer div, #weather-press-layoutContainer span {
    77 
     72   
    7873    position:relative;
    7974    margin: 0;
     
    8277    text-shadow:none;
    8378    box-shadow:none;
    84     font-family: "Open Sans", "DroidKufi", Arial, Helvetica, sans-serif;
    85     font-weight:bold;   
     79    font-family: "DroidKufi", Arial, Helvetica, sans-serif;
    8680    vertical-align: baseline;
    8781    -webkit-box-sizing: border-box;
     
    8983    box-sizing: border-box;
    9084    direction: ltr;
    91    
    92     background-image:none;
    93     background-color:transparent;
    94 }
    95 #weather-press-layoutContainer li:hover, #weather-press-layoutContainer ul:hover, #weather-press-layoutContainer div:hover, #weather-press-layoutContainer span:hover {
    96    
    97     /*background-image:none;
    98     background-color:transparent;*/
    9985}
    10086#weather-press-layoutContainer  a
     
    10288    text-decoration:none;
    10389    color:inherit;
     90    border: none;
     91    box-shadow: none;
    10492}
    10593#weather-press-layoutContainer a:hover {
     
    116104/*****************************************************************************************************/
    117105
    118 #weather-press-layoutContainer  {
     106#weather-press-layoutContainer, .weather-press-block-top, .weather-press-block-bottom {
    119107   
    120108    position:relative;
     
    122110    max-width: 440px;
    123111    min-width: 221px;
    124     width: 100%;
     112    /*width: 100%;*/
     113    min-height:77px;
    125114    text-align:center;
    126     /*border:1px solid #d9d9d9;*/
    127     border:1px solid #3F4040;
    128     background-color:#F5F6F7;
    129     box-shadow: 0px 0px 0px 2px rgba(255, 255, 255, 0.6) inset;
     115    font-family: "Open Sans",sans-serif;
     116    text-rendering: optimizeLegibility;
     117    background:transparent;
    130118    z-index: 111;
    131119    -webkit-box-sizing: border-box;
     
    134122}
    135123
    136 .weather-press-loader {
     124#weather-press-loader {
    137125
    138126    position:absolute !important;
     
    141129    height:100%;
    142130    width:100%;
    143     text-align:right;
     131    text-align:center;
    144132    background-image: url('../images/weather-press-loader.gif') !important;
    145133    background-repeat: no-repeat;
    146134    background-attachment: scroll;
    147135    background-position: center bottom;
    148     background-size: 123px auto;
     136    background-size: 96px auto;
    149137    background-color: rgba(241,243,243,1) !important;
    150     z-index: 118;
     138    box-shadow: 0 0 8px 0 rgba(33,33,24,0.2) inset !important;
     139    z-index: 11111111111;
    151140
    152141    -moz-transform: scale(0, 0);
     
    157146}
    158147
    159 .weather-press-chart-loader {
    160    
    161     position:absolute !important;
    162     top:0;
    163     bottom:0;
    164     right:0;
    165     left:0;
    166     margin: auto !important;
    167     height:33px;
    168     width:33px;
    169     background-image: url('../images/weather-press-chart-loader.svg');
     148#weather-press-forecast-loader {
     149   
     150    position: absolute !important;
     151    display:block;
     152    top: 0;
     153    bottom: 0;
     154    right: 0;
     155    left: 0;
     156    margin: auto !important;
     157    height:100%;
     158    width:100%;
     159    background-image: url('../images/weather-press-forecast-loader.svg');
    170160    background-repeat: no-repeat;
    171161    background-attachment: scroll;
    172162    background-position: center center;
    173     background-size: 33px auto;
    174     background-color: transparent;
    175     z-index: 112;   
     163    background-size: 33px auto;
     164    /*background-color:rgba(63,64,64,.5);*/
     165    background-color:transparent;
     166    border-radius:6px;
     167    z-index:1111111;
    176168}
    177169
    178170#weather-press-layoutContainer .weather-press-closeIcon {
    179171   
    180    display: inline-block;
     172   display:block;
    181173   height: 38px;
    182174   width: 38px;
     175   float:right;
    183176   border-radius: 50%;
    184177   margin-top: 8px !important;
     
    215208    font-family: 'Twiddlestix', 'norwester', 'Oswald', Helvetica, sans-serif !important;
    216209    line-height:1.2em;
    217     font-size: 2.8em;
     210    font-size: 1.8em;
    218211    text-align:center;
    219212    color:#666;
    220213    letter-spacing: 2px;
    221214    padding: 10px !important;
    222     z-index:inherit;   
    223 }
    224 
     215    z-index: 11111111111;   
     216}
    225217#weather-press-layoutContainer .weather-press-outputs {
    226218   
    227219    display: inline-block;
    228     padding: 20px 20px 40px 20px !important;
    229     text-align: left;
     220    padding:20px !important;
     221    text-align:center;
    230222    font-size: 18px;
    231223    line-height: 30px;
    232     background-color: rgba(241,243,243,1);
    233     color: #ff4411;
     224    width:94%;
     225    color:#F9790B;
    234226}
    235227
     
    297289}
    298290
    299 #weather-press-layoutContainer .weather-press-bgLevel2Container {
    300    
    301     position:absolute !important;
    302     top:0;
    303     left:0;
    304     height:100%;
    305     width:100%;
    306     overflow:hidden;
    307     z-index:-2;
    308 }
    309 #weather-press-layoutContainer .weather-press-bgLevel2 {
    310 
    311     height:100%;
    312     width:100%;
    313     background-color:#F5F6F7;
    314     background-image: url('../images/container-bg.png');
    315     background-repeat:no-repeat;
    316     background-position:bottom center;
    317     background-size:cover;
    318 
    319     /*-webkit-filter: blur(2px);
    320     -moz-filter: blur(2px);
    321     -o-filter: blur(2px);
    322     -ms-filter: blur(2px);
    323     filter: blur(2px);*/
    324 }
    325 
    326 #weather-press-layoutContainer .weather-press-bgLevel3 {
    327    
    328     position:absolute !important;
    329     top:0;
    330     left:0;
    331     height:40%;
    332     width:100%;   
    333     background: -moz-linear-gradient(top,  rgba(255,255,255,1) 0%, rgba(255,255,255,0.7) 100%);
    334     background: -webkit-linear-gradient(top,  rgba(255,255,255,1) 0%,rgba(255,255,255,0.7) 100%);
    335     background: linear-gradient(to bottom,  rgba(255,255,255,1) 0%,rgba(255,255,255,0.7) 100%);
    336     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=0 );
    337     z-index:-1;
    338 }
    339 
    340 #weather-press-layoutContainer .weather-press-mainListTop {
    341 
    342     padding:6px !important;
    343     min-height: 174px;
    344 }
    345 
    346 #weather-press-layoutContainer .weather-press-mainList {
    347    
    348     display:block;
    349     width:100%;
    350 }
    351 #weather-press-layoutContainer .weather-press-mainList > li {
    352    
    353     float:left;
    354 }
    355 #weather-press-layoutContainer .weather-press-citiesListContainer {
    356    
    357     height: 137px;
    358     width:60%;
    359     min-width: 80px;
    360     background-color: rgba(251,249,249,0.8);
     291.weather-press-block-top, .weather-press-block-bottom {
     292
     293    display:block;
     294    box-shadow: 0px 0px 0px 2px rgba(255, 255, 255, 0.6) inset !important;
    361295    border-radius: 6px;
    362     box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.4) inset !important;
    363     overflow: hidden;
    364     z-index: inherit;
    365 }
    366 #weather-press-layoutContainer .weather-press-mainListTop .weather-press-citiesListContainer > ul {
    367    
    368     margin-top: -4px;
    369    
    370     transition: all 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    371     -moz-transition: all 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    372     -ms-transition: all 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    373     -o-transition: all 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    374     -webkit-transition: all 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);   
    375 }
    376 
    377 #weather-press-layoutContainer .weather-press-citiesListContainer > ul > li {
    378    
    379     float:none;
    380     width:100%;
    381     line-height: 24px;
    382     height: 23px;
    383     margin-bottom: 6.3px !important;   
    384     color: #555249;
    385     text-align:left;
    386     text-transform: uppercase;
    387     text-overflow: ellipsis;
    388     text-shadow: 0 1px 0 #FFF !important;
    389     font-weight:bold;
     296    padding: 6px !important;   
     297    border: 1px solid #d9d9d9 !important;
     298    /*background-color: #F7F7F7;*/
     299    background-color: #FBFBFB;
     300    background-image: url('../images/widget_bg.png');
     301    background-repeat: no-repeat;
     302    background-position: center center;
     303    background-size: 100% 100%;
     304}
     305.weather-press-block-bottom {
     306   
     307    margin-top:5px !important;
     308    background-color: aliceblue;
     309    width:100%;
     310}
     311.weather-press-block-bottom-marginTop {
     312   
     313    margin-top:137px !important;   
     314}
     315.weather-press-block-bottom.initial-background { background:#F0ECEB !important; }
     316.weather-press-block-middle.night-background { background-color: whitesmoke !important; }
     317.weather-press-block-bottom.night-background { background-image: url('../images/night_bg.png'); }
     318.weather-press-block-bottom.night-background  .weather-press-date { color:wheat !important; }
     319.weather-press-block-bottom.night-background  #weather_press_forecast_node_0 .weather-press-temp { color: #FFFFFF !important; }
     320.weather-press-block-bottom.night-background  #weather-press-forecast-navs-left { margin-left: -31px !important; }
     321.weather-press-block-bottom.night-background  #weather-press-forecast-navs-right { margin-right: -31px !important; }
     322
     323.weather-press-block-bottom.initial-background .weather-press-date { color:#F9790B !important; }
     324
     325.weather-press-forecast-list {
     326
     327    position: absolute !important;
     328    top: 0;
     329    left:0;
     330    height:187px;
     331    min-width:100%;
     332    width: 100%;
    390333    white-space: nowrap;
    391     padding:3px 3px 3px 10px !important;
    392     overflow:hidden;
    393     cursor:pointer;
    394 }
    395 #weather-press-layoutContainer .weather-press-citiesListContainer > ul > li a {
    396 
    397     display: block;
    398     width:100%;
    399     height: 100%;   
    400     line-height: inherit;   
    401     color: inherit;
    402     text-align:inherit;
    403     text-transform: inherit;
    404     text-overflow: inherit;
    405     text-shadow: inherit;
    406     font-weight:inherit;
    407     white-space: inherit;
    408 }
    409 
    410 #weather-press-layoutContainer .weather-press-deep1 {
    411    
    412     font-size: 10px;
    413     opacity: 0.3;
    414     color:#ACA9A9 !important;   
    415 }
    416 #weather-press-layoutContainer .weather-press-citiesListContainer > ul > li.weather-press-deep2 {
    417    
    418     font-size: 12px;
    419     opacity: 0.6;
    420     padding-left:18px !important;   
    421 }
    422 #weather-press-layoutContainer .weather-press-citiesListContainer > ul > li.weather-press-centred {
    423    
    424     font-size: 19px;
    425     opacity: 0;
    426     color:transparent;
    427     padding-left:18px !important;       
    428 }
    429 #weather-press-layoutContainer .weather-press-citiesListContainer > ul > li:hover {
    430    
    431     opacity:1;
    432 }
    433 #weather-press-layoutContainer .weather-press-citiesListContainer > ul > li.weather-press-centred:hover {
    434    
    435     opacity: 0;
    436     color:transparent;
    437 }
    438 
    439 #weather-press-layoutContainer .weather-press-navRectangle {
    440    
    441     position: absolute !important;
    442     left: -10px;
    443     top: 54.5px;
    444     height: 40px;
    445     width: 70%;
    446     background-color: rgba(0, 10, 48, 0.1);
    447     background-repeat: no-repeat;
    448     background-position: right top;
    449     background-size: 100% 100%;
    450     background-image: url("../images/widget-bg.png");
    451     border-radius: 6px;
    452     border: 1px solid #E1E1E1 !important;
    453     box-shadow: 0px 0px 0px 2px rgba(255, 255, 255, 0.6) inset !important;
    454     z-index:112;   
    455 }
    456 #weather-press-navRectangle-mainLocation {
    457    
    458     display: block;
    459     float: left;
    460     height: 100%;
    461     width:83%;
    462     line-height: 39px;
    463     padding-left: 33px !important;
    464     font-weight: bold;
    465     text-align: left;
    466     color: rgb(85, 82, 73);
    467     text-shadow: 0px 1px 0px rgb(255, 255, 255) !important;
    468     text-transform: uppercase;
    469     text-overflow: ellipsis;
    470     white-space: nowrap;
    471     font-size: 19px;
    472     overflow:hidden;
    473     opacity: 1;
    474     z-index: inherit;
    475     cursor:pointer;
    476 }
    477 #weather-press-navRectangle-mainLocation:before {
    478    
    479     position:absolute !important;
    480     content:'' !important;
    481     top: 12px;
    482     left: 18px;
    483     height: 12px;
    484     width: 12px;
    485     background:url('../images/marker.svg') no-repeat scroll center transparent;
    486     opacity:1;
    487 }
    488 #weather-press-layoutContainer .weather-press-deep2:before, #weather-press-layoutContainer .weather-press-deep1:before {
    489    
    490     position: absolute !important;
    491     content: '' !important;
    492     top: 9px;
    493     left: 3px;
    494     height: 12px;
    495     width: 12px;
    496     background: url('../images/marker.svg') no-repeat scroll center transparent;
    497     opacity: inherit;
    498 }
    499 #weather-press-layoutContainer .weather-press-navRectangle > ul {
    500    
    501     display:block;
    502     height:38px;
    503     width:38px;
    504     float:right;
    505 }
    506 #weather-press-layoutContainer .weather-press-navRectangle > ul > li {
    507    
    508     float:none;
    509     width:100%;
    510     height:50%;
    511     cursor:pointer;
    512     background-size:70%;   
    513 }
    514 #weather-press-layoutContainer .weather-press-navRectangle > ul > li:first-child {
    515 
    516     background:url('../images/nav-top.svg') no-repeat scroll center transparent;
    517 }
    518 #weather-press-layoutContainer .weather-press-navRectangle > ul > li:last-child {
    519 
    520     background:url('../images/nav-bottom.svg') no-repeat scroll center transparent;
    521 }
    522 #weather-press-layoutContainer .weather-press-navRectangle > ul > li:hover {
    523    
    524     background-size:80%;   
    525 }
    526 #weather-press-layoutContainer .weather-press-navRectangle > ul > li:active {
    527    
    528     background-size:100%;   
    529 }
    530 
    531 #weather-press-layoutContainer .weather-press-navRectangle > ul > li, #weather-press-layoutContainer .weather-press-citiesListContainer > ul > li {
    532 
    533     transition: all 300ms ease;
    534     -moz-transition: all 300ms ease;
    535     -ms-transition: all 300ms ease;
    536     -o-transition: all 300ms ease;
    537     -webkit-transition: all 300ms ease;
    538 }
    539 
    540 #weather-press-layoutContainer .weather-press-rightTopBlock {
    541    
    542     height: 137px;
    543     width:40%;
    544     min-width: 137px;
    545     z-index:inherit;   
    546 }
    547 
    548 #weather-press-layoutContainer .weather-press-rightTopBlock > ul {
    549    
    550     display: block;
    551     height: 100%;   
    552 }
    553 #weather-press-layoutContainer .weather-press-rightTopBlock > ul > li {
    554    
    555     float:none;
    556     width:100%;
    557     height: 50%;
    558     min-height:35px;
    559     line-height:35px;
    560     text-align:center;
    561     text-shadow: 0 1px 0 #FFF !important;
    562     padding-left: 18px !important;
    563     white-space: nowrap;   
    564 }
    565 
    566 #weather-press-layoutContainer .weather-press-icon {
    567    
    568     height:67px;
    569 }
    570 #weather-press-layoutContainer .weather-press-icon img {
    571    
    572     position:absolute;
    573     top:0;
    574     right: 0;
    575     /*left: 0;*/
    576     margin: auto;
    577     height:145% !important;
    578     width:auto !important;
    579     z-index: 0;
    580 }
    581 #weather-press-layoutContainer .weather-press-currentTemp {
    582 
    583     color: #555249;
    584     font-size: 3em;
    585     font-weight: bold;
    586     font-family: 'norwester', 'Oswald', sans-serif !important; 
    587 }
    588 #weather-press-layoutContainer .weather-press-currentTempValue {
    589    
    590     position:absolute !important;
    591     top:28px;
    592     bottom:0;
    593     right: 0;
    594     /*left: 0;*/
    595     margin: auto;
    596     color:inherit;
    597     font-size:1.3em;
    598     line-height: normal;
    599     font-family:inherit !important;
    600     font-weight:inherit !important;
    601 }
    602 #weather-press-layoutContainer .weather-press-currentTempUnit {
    603    
    604     position:absolute !important;
    605     bottom:0;
    606     left:46%;
    607     display:initial;
    608     font-size: 12px;
    609     line-height: normal;
    610     font-family: inherit !important;
    611 }
    612 
    613 #weather-press-layoutContainer .weather-press-fullWidthBlock {
    614    
    615     display: block;
    616     float:none !important;
    617     clear:both;
    618     width:100%;
    619     line-height:23px;
    620     font-size:15px;
    621     color: #555249;
    622     font-weight: normal;
    623     text-shadow: 0 1px 0 #FFF !important;
    624     padding: 12px !important;
    625 }
    626 
    627 #weather-press-layoutContainer .weather-press-conditionsBlock {
    628 
    629     text-align: left;
    630     color: #000;
    631     border-top: 1px dotted #DEDEDE !important;
    632     border-bottom: 1px dotted #DEDEDE !important;
    633     background-color: rgba(236, 236, 236, 0.9);
    634 }
    635 
    636 #weather-press-layoutContainer .weather-press-optionsBlock  {
    637    
    638     height: 36px;
    639     margin: 0 !important;
    640     padding: 6px 0px !important;
    641     background:url('../images/bottom-divider.png') repeat-x scroll bottom rgba(63,64,64,1);
    642 }
    643 #weather-press-layoutContainer .weather-press-optionsBlock > ul {
    644    
    645     display:block;
    646     width:100%;
    647     height:24px;
    648     padding-left: 6px !important;
    649 }
    650 #weather-press-layoutContainer .weather-press-optionsBlock > ul > li  {
    651    
    652     float:left;
    653 }
    654 #weather-press-layoutContainer .weather-press-geoLoc, #weather-press-layoutContainer .weather-press-refrech {
    655    
    656     margin-right:4px !important;
    657     height:24px;
    658     width:24px;
    659     background-color: transparent;
    660     background-repeat: no-repeat;
    661     background-attachment:scroll;
    662     background-position: center center;
    663     background-size: 72%;
    664     cursor:pointer;
    665 }
    666 #weather-press-layoutContainer .weather-press-geoLoc {
    667    
    668      background-image: url("../images/marker-gold.svg");
    669      
    670 }
    671 #weather-press-layoutContainer .weather-press-geoLoc-active {
    672 
    673     background-image: url("../images/marker-active.svg");
    674     background-size:100%;
    675 }
    676 
    677 #weather-press-layoutContainer .weather-press-refrech {
    678    
    679      background-image: url("../images/refresh-white.svg");
    680 }
    681 #weather-press-layoutContainer .weather-press-geoLoc:hover, .weather-press-refrech:hover {
    682    
    683     background-size:80%;   
    684 }
    685 #weather-press-layoutContainer .weather-press-geoLoc:active, .weather-press-refrech:active {
    686    
    687     background-size:100%;   
    688 }
    689 
    690 #weather-press-layoutContainer .weather-press-forecasts {
    691    
    692     float:right !important;
    693 }
    694 #weather-press-layoutContainer .weather-press-forecasts > ul > li {
    695    
    696     float:left;
    697     margin: 5px 2px 0 0 !important;
    698     width: 16px;
    699     height: 16px;
    700     cursor:pointer;
    701     background-image: url("../images/gold-dot.svg");
    702     background-color: transparent;
    703     background-position: center;
    704     background-repeat: no-repeat;
    705     background-attachment: scroll;
    706     background-size: 66%;   
    707 }
    708 
    709 #weather-press-layoutContainer .weather-press-forecasts > ul > li.weather-press-forecasts-mainStatus {
    710    
    711     margin-right: 14px !important; 
    712 }
    713 
    714 #weather-press-layoutContainer .weather-press-forecasts > ul > li.weather-press-forecast-active, #weather-press-layoutContainer .weather-press-forecasts > ul > li:hover {
    715    
    716     background-image: url("../images/gold-dot-active.svg");
    717     background-color: transparent;
    718     background-position: center;
    719     background-repeat: no-repeat;
    720     background-attachment: scroll;
    721     background-size: 80%;   
    722 }
    723 #weather-press-layoutContainer .weather-press-forecasts > ul > li:active {
    724    
    725     background-size:100%;
    726 }
    727 
    728 #weather-press-layoutContainer .weather-press-forecastBlock {
    729 
    730     height:180px;
    731     margin: 0 !important;
    732     background: -moz-linear-gradient(top,  rgba(63,64,64,0.3) 0%,rgba(63,64,64,1) 67%);
    733     background: -webkit-linear-gradient(top,  rgba(63,64,64,0.3) 0%,rgba(63,64,64,1) 67%);
    734     background: linear-gradient(to bottom,  rgba(63,64,64,0.3) 0%,rgba(63,64,64,1) 67%);
    735     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#a6000000',GradientType=0 );
    736 }
    737 
    738 #weather-press-layoutContainer .weather-press-forecastToolsList {
    739    
    740     display:block;
    741     background:url('../images/bottom-divider.png') repeat-x scroll top rgba(63,64,64,1);
    742     padding:6px 10px 6px 10px !important;
    743     height:auto;
    744 }
    745 
    746 #weather-press-layoutContainer .weather-press-forecastTools {
    747 
    748     width:100%;
    749     height:30px;
    750     text-align:center;
    751     background:transparent;
    752     z-index:inherit;
    753 }
    754 #weather-press-layoutContainer .weather-press-forecastTools > ul > li {
    755 
    756     display: inline-block !important;
    757     width:30px;
    758     height: 30px;   
    759     color: #FFF;
    760     cursor: pointer;
    761     background-color: transparent;
    762     background-repeat: no-repeat;
    763     background-attachment:scroll;
    764     background-position: center center;
    765     background-size:80%;
    766     opacity:1;
    767 }
    768 #weather-press-layoutContainer .weather-press-forecastTools > ul > li:hover {
    769    
    770     /*background-size:100%;*/
    771 }
    772 #weather-press-layoutContainer .weather-press-forecastTools > ul > li:active {
    773    
    774     background-size:88%;
    775 }
    776 
    777 #weather-press-layoutContainer .weather-press-tempTool {
    778    
    779     float:left;
    780     background-image:url('../images/temperature.svg');
    781 }
    782 #weather-press-layoutContainer .weather-press-tempTool:after {
    783    
    784     position:absolute !important;
    785     content:'' !important;
    786     height:100%;
    787     width:2px;
    788     right:-10px;
    789     top:0;
    790     background:url('../images/tool-list-divider.png') no-repeat scroll center transparent;
    791 }
    792 
    793 #weather-press-layoutContainer .weather-press-humidTool {
     334}
     335.weather-press-forecast-list > li {
    794336   
    795337    display:inline-block;
    796     background-image:url('../images/humidity-gold.svg');
    797 }
    798 .weather-press-humidTool:hover {
    799 
    800     /*background-image:url('../images/humidity-active.svg');*/
    801 }
    802 
    803 #weather-press-layoutContainer .weather-press-windTool {
    804    
    805     float:right;
    806     background-image:url('../images/wind-gold.svg');   
    807 }
    808 #weather-press-layoutContainer .weather-press-windTool:after {
    809    
    810     position:absolute !important;
    811     content:'' !important;
    812     height:100%;
    813     width:2px;
    814     left:-10px;
    815     top:0;
    816     background:url('../images/tool-list-divider.png') no-repeat scroll center transparent;
    817 }
    818 #weather-press-layoutContainer .weather-press-windTool:hover {
    819    
    820     /*background-image:url('../images/wind-active.svg');*/
    821 }
    822 
    823 #weather-press-layoutContainer .weather-press-forecastTools > ul > li.weather-press-tempTool-active {
    824 
    825     background-image:url('../images/temperature-active.svg');
    826     opacity:1;
    827     background-color: #4cb1ff;
    828     box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset, 0 0 0 1px hsla(0,0%,100%,.1) inset, 0 1px 0 hsla(210,54%,20%,.03), 0 0 4px hsla(206,100%,20%,.2);
    829     border-radius:50%; 
    830 }
    831 
    832 #weather-press-layoutContainer .weather-press-dailyForecast {
    833 
    834     position: absolute !important;
    835     width: 100%;
    836     height: 46%;
    837     left: 0px;
    838     bottom: 0px;
    839     z-index:113;
    840     background:#3E3F3F;
    841     overflow:hidden;
    842 
    843     -moz-transform: scale(0, 0);
    844     -webkit-transform: scale(0, 0);
    845     -o-transform: scale(0, 0);
    846     -ms-transform: scale(0, 0);
    847     transform: scale(0, 0);
    848 }
    849 #weather-press-layoutContainer .weather-press-dailyForecast .weather-press-closeIcon {
    850    
    851     position: absolute !important;
    852     top: 0;
    853     right: 0;
    854     background-image: url('../images/close-icon-white.svg');   
    855     z-index: inherit;   
    856 }
    857 /* vertical align text inside all li items */
    858 #weather-press-layoutContainer .weather-press-dailyForecast li {
    859 
    860     display: flex;
    861     flex-direction: column;
    862     align-items: center;
    863     justify-content: center;
    864 }
    865 #weather-press-layoutContainer .weather-press-dailyForecast > ul {
    866    
    867     display: block;
    868     height: 100%;
    869     width:auto;
    870     color:#FFF;
    871     white-space: nowrap;
    872     text-align:left;
    873     direction:ltr;
    874 }
    875 #weather-press-layoutContainer .weather-press-dailyForecast > ul {
     338    min-width:100%;
     339    width: 100%;
     340    height:187px;
     341    vertical-align: top !important;
     342    white-space: normal;
     343    margin-right: 7px !important;
     344}
     345.weather-press-forecast-list > li:last-child {margin-right:0 !important;}
     346
     347.weather-press-cities-list {
     348   
     349    /*transition: margin 180ms ease;
     350    -moz-transition: margin 180ms ease;
     351    -ms-transition: margin 180ms ease;
     352    -o-transition: margin 180ms ease;
     353    -webkit-transition: margin 180ms ease;*/
     354
     355    transition: margin 330ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
     356    -moz-transition: margin 330ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
     357    -ms-transition: margin 330ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
     358    -o-transition: margin 330ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
     359    -webkit-transition: margin 330ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
     360}
     361.weather-press-block-bottom, .weather-press-block-bottom-marginTop, .weather-press-forecast-list {
    876362   
    877363    transition: all 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
     
    881367    -webkit-transition: all 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    882368}
    883 
    884 #weather-press-layoutContainer .weather-press-dailyForecast-mainItem {
    885 
    886     display:inline-block !important;
     369.weather-press-block-middle {
     370   
     371    position:absolute !important;
     372    top:0;
     373    bottom:0;
     374    right:0;
     375    left:0;
     376    margin:auto !important;
     377    width:96%;
     378    height:96%;
     379    background-color:#555249;
     380    border:1px solid #DEDEDE !important;
     381    z-index: 11;
     382}
     383.weather-press-block-middle:before {
     384   
     385    content:'' !important;
     386    position:absolute;
     387    top:0;
     388    bottom:0;
     389    right:0;
     390    left:0;
     391    margin:auto !important;
     392    width:100%;
    887393    height:100%;
    888     width:100%;
    889     margin-right: -4px !important;
    890 }
    891 #weather-press-layoutContainer .weather-press-dailyForecast-mainItem ul {
    892 
     394    background: url('../images/gridtile_3x3_white.png') repeat scroll center transparent;
     395    opacity: .5;
     396    z-index:1;
     397}
     398.weather-press-block-middle img {
     399   
     400    position:relative;
     401    height: 140px !important;/* same as .weather-press-block-bottom-marginTop margin-top(137px) + 3px tolerance */
     402    width: 100% !important;
     403    margin-top: 155px;
     404    display:none;
     405}
     406
     407.weather-press-cities-nav-container {
     408   
     409    position:absolute !important;
     410    left: -16%;
     411    top: 0;
     412    width: 124%;
     413    height:31px;
     414    bottom: 0;
     415    text-align:center;
     416    margin: auto !important;
     417    border-radius:6px;
     418    border: 1px solid #E1E1E1 !important;
     419    /*box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) !important;*/
     420    box-shadow: 0 0 0 2px rgba(255,255,255,.6) inset !important;
     421    background-image: url('../images/nav-bg.png');
     422    background-position: left center;/*old browsers*/
     423    background-position: 119% 50%;
     424    background-repeat: no-repeat;
     425    background-size: cover;
     426    /*background-color: rgba(66, 133, 244, 0.2);blue
     427    background-color: rgba(222, 222, 222, 0.5);*/
     428    background-color: rgba(0,10,48,.1);
     429    z-index: 112;   
     430}
     431.weather-press-cities-nav-sub-container {
     432   
     433    position: relative;
     434    height: 100%;
     435    width: 100%;
     436}
     437.weather-press-arrows-container {
     438   
     439    position:absolute !important;
     440    top:0;
     441    left:0;
     442    height:100%;
     443    width:33px;
     444    /*background:url('../images/middleRect.png') no-repeat scroll center center transparent;
     445    background-size:100% 16%;*/
     446}
     447.weather-press-cities-navs {
     448   
     449    display:block;
    893450    height: 100%;
    894     width: 100%;
    895     display: block;
    896 }
    897 #weather-press-layoutContainer .weather-press-dailyForecast-mainItem > ul > li {
    898 
     451}
     452.weather-press-cities-navs li {
     453   
    899454    float:none;
    900455    width:100%;
    901     background:url('../images/bottom-divider.png') repeat-x scroll bottom transparent;
    902     padding:6px 11px 6px 11px !important;
    903 }
    904 
    905 #weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDate, #weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDetails {
    906    
    907     height:25%;
    908     font-weight: bold;
    909 }
    910 #weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDate {
    911    
    912     word-wrap: break-word;
    913     white-space: pre-wrap;
    914     color: #FCCF36;
    915 }
    916 #weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDetails {
    917    
    918     padding:0 !important;   
    919 }
    920 
    921 #weather-press-layoutContainer .weather-press-forecastDetails-text {
    922    
    923     display: inline-block;
    924     color: inherit;
    925     font-size: inherit;
    926     word-wrap: break-word;
    927     white-space: pre-wrap;
     456    height:15px;
     457    cursor:pointer;
     458}
     459#weather-press-cities-navs-top {
     460
     461    background:url('../images/nav-top.svg') no-repeat scroll center center transparent;
     462    background-size:60%;   
     463}
     464#weather-press-cities-navs-bottom {
     465
     466    background:url('../images/nav-bottom.svg') no-repeat scroll center center transparent;
     467    /*background-size:33px 26px;*/
     468    background-size:60%;
     469    /*margin-top:7px !important;*/
     470}
     471#weather-press-cities-navs-top:hover, #weather-press-cities-navs-bottom:hover { background-size:70%; }
     472#weather-press-cities-navs-top:active, #weather-press-cities-navs-bottom:active { background-size:80%; }
     473
     474#weather-press-city-name {
     475   
     476    position:absolute !important;
     477    top:0;
     478    bottom:0;
     479    left:16%;
     480    margin: auto !important;
     481    height:100%;
     482    width:78%;
     483    padding-left:24px !important;
     484    line-height:31px;
     485    text-align:left;
     486    text-shadow: 0 1px 0 #FFF !important;
     487    font-weight:bold;
     488    color: #555249;
     489    background:url('../images/marker-gold.svg') no-repeat scroll 7px center transparent;
     490    background-size: 12px 12px;
     491    text-transform: uppercase;
     492    text-overflow: ellipsis;
     493    white-space: nowrap;
     494    font-size: 19px;
     495    overflow: hidden;
     496    opacity: 1;
     497    z-index: inherit;
     498    cursor: pointer;
     499}
     500
     501#weather-press-display-image {
     502   
     503    position:absolute !important;
     504    top:0;
     505    right:0;
     506    display: block;
     507    height:100%;
     508    width:30px;
     509    background:url('../images/image-icon.png') no-repeat scroll center center transparent;
     510    background-size: 24px 24px;
     511    opacity: .5;
     512    cursor:pointer;
     513}
     514#weather-press-display-image:active { background-size: 52% auto; }
     515#weather-press-display-image:hover { opacity:1; }
     516#weather-press-display-image, .weather-press-cities-navs li, .weather-press-cities-list li, .weather-press-forecast-navs li  {
     517   
     518    -webkit-transition: all 100ms ease;
     519    -moz-transition: all 100ms ease;
     520    -o-transition: all 100ms ease;
     521    -ms-transition: all 100ms ease;
     522    transition: all 100ms ease;
     523}
     524
     525.weather-press-cities-list-container {
     526   
     527    height:155px;
     528    overflow:hidden;
     529    background:url('../images/cities-list-container.png') no-repeat scroll center center transparent;
     530    background-size: auto 155px;
     531    background-color: rgba(236,236,236,.2);
     532    border-radius: 6px;
     533    box-shadow: 0 1px 2px rgba(0,0,0,.4) inset !important;
     534}
     535.weather-press-cities-list li {
     536
     537    float:none;
     538    width:100%;
     539    padding-left: 29px !important;
     540    height:31px;
     541    line-height:34px;
     542    text-align:left;
     543    font-weight:bold;
     544    text-transform: uppercase;
     545    text-overflow: ellipsis;
     546    white-space: nowrap;   
     547    cursor:pointer;
     548    opacity:.3;
     549    font-size: 11px;
     550    font-weight: normal;
     551    color:#555249;
     552}
     553.weather-press-cities-list li:not(.main-location):before {
     554   
     555    position: absolute !important;
     556    content: '' !important;
     557    top: 11px;
     558    left: 10px;
     559    height: 12px;
     560    width: 12px;
     561    background: url('../images/marker.svg') no-repeat scroll center transparent;
     562    opacity: inherit;
     563}
     564
     565.weather-press-cities-list li.deep { opacity:0.2; }
     566.weather-press-cities-list li:hover { opacity:1; }
     567.weather-press-cities-list .main-location { opacity:0;color:transparent; }
     568
     569.weather-press-forecast-nav-container {
     570   
     571    position:absolute !important;
     572    top:6px;
     573    left:0;
     574    width:100%;
     575    height:30px;
     576    line-height:30px;
     577    padding: 0 6px !important;
     578}
     579.weather-press-forecast-navs li { width:30px;height:30px;cursor:pointer;opacity: .5;z-index:112;background:#transparent; }
     580.weather-press-forecast-navs li:hover {opacity:1;}
     581.weather-press-forecast-navs li:active {background-size: 28px 28px !important;}
     582#weather-press-forecast-navs-left {
     583   
     584    float:left;
     585    background:url('../images/prev.png') no-repeat scroll center center transparent;
     586    background-size: 24px 24px;
     587    z-index: 11111111;
     588}
     589#weather-press-forecast-navs-right {
     590   
     591    float:right;
     592    background:url('../images/next.png') no-repeat scroll center center transparent;
     593    background-size: 24px 24px;
     594}
     595
     596.weather-press-forecast-list-container { padding-top:2px !important;height:187px;width:100%;overflow:hidden;z-index:inherit;/*111*/ }
     597
     598.weather-press-forecast-item { height:187px; }
     599.weather-press-forecast-item > li { display:inline-block;}
     600
     601#weather-press-layoutContainer .weather-press-date, #weather-press-layoutContainer .weather-press-minMax {width:100%;float:none;}
     602#weather-press-layoutContainer .weather-press-date {
     603   
     604    height:30px;
     605    line-height:30px;
     606    font-size:12px;
     607    font-weight:bold;
     608    white-space: nowrap;
     609    color:#222222;
     610    font-family: "DroidKufi", Arial, Helvetica, sans-serif !important;
     611    vertical-align: top !important;
     612}
     613#weather-press-layoutContainer .weather-press-minMax {  height:30px;line-height:30px;text-align:center; }
     614#weather-press-layoutContainer .weather-press-min-temp, #weather-press-layoutContainer .weather-press-max-temp {
     615
     616    height:30px;
     617    line-height:30px;
     618    width:15%;
     619    font-family: 'norwester', 'Oswald', sans-serif !important;
     620    font-size:18px;
     621    color:#666666;
     622    letter-spacing:1.5px;
     623    overflow:hidden;
     624}
     625#weather-press-layoutContainer .weather-press-min-temp { float:left;text-align:right; }
     626#weather-press-layoutContainer .weather-press-max-temp { float:right;text-align:left; }
     627
     628.weather-press-temp-gauge {
     629
     630    float:none;
     631    display:inline-block;
     632    height:30px;
     633    width:54%; 
     634    background-color: transparent;     
     635}
     636#weather-press-layoutContainer .weather-press-gauge-gradient {
     637   
     638    position:absolute !important;
     639    top:0;
     640    bottom:0;
     641    left:0;
     642    right:0;
     643    margin:auto !important;
     644    width:100%;
     645    height: 8px;
     646    border-radius: 4px;
     647    background-color: #EBEBEB;
     648    box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.5) inset !important;
     649}
     650
     651.weather-press-gauge-gradient {
     652   
     653    background-image: -webkit-linear-gradient(right, #7cbcf7, #ff9c0c);
     654    background-image: -moz-linear-gradient(right, #7cbcf7, #ff9c0c);
     655    background-image: -o-linear-gradient(right, #7cbcf7, #ff9c0c);
     656    background-image: linear-gradient(to right, #7cbcf7, #ff9c0c); 
     657}
     658
     659#weather-press-layoutContainer .weather-press-temp {
     660
     661    float:left;
     662    width:50%;
     663    height:127px;
     664    line-height:127px;
     665    font-family: 'norwester', 'Oswald', sans-serif !important;
     666    font-size:4em;
     667    color:#555249;
     668    text-align:center;
     669    border-right: 1px solid #DEDEDE !important;
     670    overflow:hidden;
     671}
     672#weather-press-layoutContainer .weather-press-condition-img {
     673   
     674    position:relative;
     675    float:right;
     676    width:50%;
     677    height:127px;
     678    line-height:127px;
     679}
     680#weather-press-layoutContainer .weather-press-condition-img img {
     681   
     682    position:absolute;
     683    right: 0;
     684    left: 0;
     685    top: 0;
     686    bottom: 0;
     687    margin: auto !important;
    928688    height: auto;
    929689    width: 100%;
    930     line-height: normal;
    931 }
    932 
    933 #weather-press-layoutContainer .weather-press-forecastMinmaxIcon, #weather-press-layoutContainer .weather-press-forecastHumidityIcon, #weather-press-layoutContainer .weather-press-forecastWindIcon {
    934    
    935     position: absolute !important;
    936     top: -10px;
    937     height: 20px;
    938     width: 20px;
    939     opacity:0.4;   
    940 }
    941 #weather-press-layoutContainer .weather-press-forecastMinmaxIcon {
    942 
    943     left: 4px;
    944     background: url("../images/temperature-active.svg") no-repeat scroll center center transparent;
    945 }
    946 #weather-press-layoutContainer .weather-press-forecastHumidityIcon {
    947 
    948     left: 0;
    949     right:0;
    950     margin:auto !important;
    951     background: url("../images/humidity-active.svg") no-repeat scroll center center transparent;
    952 }
    953 #weather-press-layoutContainer .weather-press-forecastWindIcon {
    954 
    955     right: 4px;
    956     background: url("../images/wind-active.svg") no-repeat scroll center center transparent;   
    957 }   
    958 
    959 #weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastIconTemp {
    960    
    961     height:50%;
    962 }
    963 #weather-press-layoutContainer .weather-press-forecastIconTemp > ul > li {
    964    
    965     float:right;
     690    max-width: 128px;
     691}
     692
     693#weather_press_brand {
     694   
     695    position:absolute !important;
     696    left:0;
     697    bottom:-33px;
     698    display:block;
     699    width:100%;
     700    height:33px;
     701    line-height:33px;
     702    color:#DEDEDE;
     703    font-size:11px;
     704    background:transparent;
     705}
     706#weather_press_brand a {
     707   
     708    display:block;
     709    height:inherit;
     710    width:inherit;
     711    color:inherit;
     712    font-size:inherit;
     713    font-family: 'Twiddlestix', 'norwester', 'Oswald', Helvetica, sans-serif !important;
     714    letter-spacing: 3px;
     715    white-space:nowrap;
     716}
     717#weather_press_brand a:hover { color:#555249 }
     718
     719.weather_press_scene_container {
     720
     721    position:absolute !important;
     722    top:0;
     723    left:0;
     724    width:100%;
    966725    height:100%;
    967     width:50%;
    968     text-align:center;
    969 }
    970 #weather-press-layoutContainer .weather-press-forecastIconTemp > ul > li:last-child {
    971    
    972     color:#FFF;
    973     padding:8% !important;
    974     font-size: 3em;
    975     font-family: 'norwester', 'Oswald', sans-serif !important;
    976     font-weight: 400;
    977 }
    978 #weather-press-layoutContainer .weather-press-forecastIconTemp > ul > li img {
    979    
    980     display:inline-block;
    981     height:100% !important;
    982     width:auto !important;
    983 }
    984 
    985 #weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDetails > ul > li {
    986    
    987     float:left;
    988     width:33%;
    989     height: 100%;
    990     text-align: center;
    991     word-wrap: break-word;
    992     background:url('../images/tool-list-divider.png') no-repeat scroll center right transparent;
    993 }
    994 #weather-press-layoutContainer .weather-press-dailyForecast-mainItem .weather-press-forecastDetails > ul > li:last-child {
    995    
    996     background:transparent;
    997 }
     726    border-radius: inherit;
     727    overflow:hidden;
     728    padding: 1px !important;
     729    z-index:11;
     730}
     731
     732.weather_press_scene_container canvas {
     733
     734    display: inline-block;
     735    vertical-align: baseline;
     736    /*background-color: aliceblue;*/
     737    background-color: transparent;
     738    border-radius: inherit;
     739}
  • weather-press/trunk/public/js/weather-press-public-min.js

    r1725621 r1759591  
    1 !function(e){"use strict";e(document).ready(function(){if(e("#weather-press-layoutContainer").length){var s=null,t=e("#weather-press-layoutContainer").outerWidth(),r=e(".weather-press-dailyForecast").outerWidth();e(".weather-press-dailyForecast-mainItem").css("width",r),t<=356&&(e(".weather-press-citiesListContainer").css("width","100%"),e(".weather-press-rightTopBlock").css("width","100%"),e(".weather-press-navRectangle").css("width","107%"),e(".weather-press-bgLevel3").css("height","53%"),e(".weather-press-dailyForecast").css("height","37.2%"),e(".weather-press-currentTempValue").css("font-size","1.6em"),e(".weather-press-icon").css("float","right"),e(".weather-press-icon").css("width","50%"),e(".weather-press-icon img").css("top","28px"),e(".weather-press-icon img").css("left","0"),e(".weather-press-currentTemp").css("float","left"),e(".weather-press-currentTemp").css("width","50%"),e(".weather-press-currentTemp").css("left","0"));var a,i,c,p={labels:["6am","9am","12pm","3pm"],series:[[{value:0,meta:"°"},{value:0,meta:"°"},{value:0,meta:"°"},{value:0,meta:"°"},{value:0,meta:"NO X COORDINATE"}]]},o={width:"100%",height:"100%",showArea:!0,fullWidth:!0,showLabel:!0,lineSmooth:Chartist.Interpolation.simple({divisor:2}),axisY:{showGrid:!1,showLabel:!1,offset:0,labelInterpolationFnc:function(e,s){return s%2!=0&&0!=s?e:null}},axisX:{showGrid:!1,showLabel:!0}},l=function(){(a=new Chartist.Line(".ct-chart",p,o)).on("draw",function(s){if("area"===s.type){var t=e(".ct-area").attr("d");t=(t=t.replace("M10","M0")).replace("L10","L0"),e(".ct-area").attr("d",t)}}),a.on("draw",function(s){var t;if("point"===s.type){s.series[s.index].value<12?t="ct-point-circle-cold":s.series[s.index].value>=12&&s.series[s.index].value<25?t="ct-point-circle-medium":s.series[s.index].value>=25&&(t="ct-point-circle-hot");var r=new Chartist.Svg("circle",{cx:s.x,cy:s.y,r:6,vtop:s.y-46,vleft:s.x-30,val:s.series[s.index].value,des:s.series[s.index].meta,class:t+" weather-press-forHoverPurpose"});s.element.replace(r),e(".weather-press-forHoverPurpose").on("click",function(){e(".weather-press-chartLabel").text(e(this).attr("val")+" "+e(this).attr("des")),e("#weather-press-chartLabel").css({top:e(this).attr("vtop")+"px",left:e(this).attr("vleft")+"px",display:"block"})})}}),a.on("created",function(s){var t=s.svg.elem("defs");t.elem("linearGradient",{id:"weatherPressFillGradArea",x1:"50%",y1:"100%",x2:"50%",y2:0}).elem("stop",{offset:0,style:"stop-color:rgb(37,168,250);stop-opacity:0"}).parent().elem("stop",{offset:"100%",style:"stop-color:rgb(209,93,208);stop-opacity:0.5"}),e(".ct-area").attr("fill","url(#weatherPressFillGradArea)"),t.elem("linearGradient",{id:"weatherPressFillGradLine",x1:0,y1:"50%",x2:"100%",y2:"50%"}).elem("stop",{offset:0,style:"stop-color:rgb(37,168,250);stop-opacity:1"}).parent().elem("stop",{offset:"100%",style:"stop-color:rgb(209,93,208);stop-opacity:1"}),e(".ct-line").attr("stroke","url(#weatherPressFillGradLine)"),e(".weather-press-forHoverPurpose:eq(1)").trigger("click"),e(".ct-label:first").css("text-indent","-4px"),e(".ct-label:last").css("text-indent","-25px")})};e(".weather-press-citiesList li").each(function(s,t){if(e(t).hasClass("weather-press-centred")&&0==e(t).attr("data-weatherpressads"))return i=s,c=e(t).position().top.toFixed(2)-4,e("#weather-press-navRectangle-mainLocation").text(e(t).text()),e("#weather-press-navRectangle-mainLocation").attr("title",e(t).text()),!1}),e(".weather-press-forecasts ul li").click(function(){if(!1===e(this).hasClass("weather-press-forecasts-mainStatus")){var s=e(this).attr("data-weatherpressforecastDays");e(".weather-press-dailyForecast-mainUl").css("margin-left",-1*s*r),e("#weather-press-chartLabel").css("opacity","0"),e(".weather-press-dailyForecast").removeClass("flipOutX"),e(".weather-press-dailyForecast").addClass("flipInX"),e(".weather-press-forecasts ul li").each(function(s,t){e(t).removeClass("weather-press-forecast-active")}),e(this).addClass("weather-press-forecast-active")}}),e(".weather-press-closeIcon").click(function(){var t=e(this).attr("data-weatherpressclose");e("."+t).removeClass("flipInX"),e("."+t).addClass("flipOutX"),"weather-press-dailyForecast"==t?e(".weather-press-forecasts ul li").each(function(s,t){e(t).removeClass("weather-press-forecast-active"),0==s&&e(t).addClass("weather-press-forecast-active")}):"weather-press-loader"==t&&(e(".weather-press-outputs-content").text("Loading ..."),e(".weather-press-outputs-toPremium").css("opacity","0"),null!=s&&s.abort()),e("#weather-press-chartLabel").css("opacity","1")}),e(".weather-press-forecasts-mainStatus").click(function(){!1===e(this).hasClass("weather-press-forecast-active")&&(e(".weather-press-forecasts ul li").each(function(s,t){e(t).removeClass("weather-press-forecast-active"),0==s&&e(t).addClass("weather-press-forecast-active")}),e(".weather-press-dailyForecast").removeClass("flipInX"),e(".weather-press-dailyForecast").addClass("flipOutX")),e("#weather-press-chartLabel").css("opacity","1")}),e(".weather-press-humidTool, .weather-press-windTool, .weather-press-geoLoc").click(function(){e(".weather-press-outputs-content").text("This is a premium weather press feature,"),e(".weather-press-outputs-toPremium").css("opacity","1"),h()}),e("#weather-press-citiesNavTop").click(function(){n(i+1)}),e("#weather-press-citiesNavBottom").click(function(){n(i-1)});var n=function(s){var t,r=e(".weather-press-citiesList li").length-1;e(".weather-press-citiesList li").each(function(a,p){if(a==s&&a<r&&a>1)return i=a,0==e(p).attr("data-weatherpressads")&&(e("#weather-press-navRectangle-mainLocation").text(e(p).text()),e("#weather-press-navRectangle-mainLocation").attr("title",e(p).text())),e(p).removeClass(),e(p).addClass("weather-press-centred"),console.log(a),t=e(p).position().top.toFixed(2),e(".weather-press-citiesList").css("margin-top",c-t),e(".weather-press-citiesList li:eq("+(a-1)+")").length&&(e(".weather-press-citiesList li:eq("+(a-1)+")").removeClass(),1==e(".weather-press-citiesList li:eq("+(a-1)+")").attr("data-weatherpressads")?e(".weather-press-citiesList li:eq("+(a-1)+")").addClass("weather-press-deep1"):e(".weather-press-citiesList li:eq("+(a-1)+")").addClass("weather-press-deep2")),e(".weather-press-citiesList li:eq("+(a-2)+")").length&&(e(".weather-press-citiesList li:eq("+(a-2)+")").removeClass(),e(".weather-press-citiesList li:eq("+(a-2)+")").addClass("weather-press-deep1")),e(".weather-press-citiesList li:eq("+(a+1)+")").length&&(e(".weather-press-citiesList li:eq("+(a+1)+")").removeClass(),1==e(".weather-press-citiesList li:eq("+(a+1)+")").attr("data-weatherpressads")?e(".weather-press-citiesList li:eq("+(a+1)+")").addClass("weather-press-deep1"):e(".weather-press-citiesList li:eq("+(a+1)+")").addClass("weather-press-deep2")),e(".weather-press-citiesList li:eq("+(a+2)+")").length&&(e(".weather-press-citiesList li:eq("+(a+2)+")").removeClass(),e(".weather-press-citiesList li:eq("+(a+2)+")").addClass("weather-press-deep1")),!1})},h=function(){e("#weather-press-loader").removeClass("flipOutX"),e("#weather-press-loader").addClass("flipInX"),e("#weather-press-chartLabel").css("opacity","0")},w=function(){e("#weather-press-loader").removeClass("flipInX"),e("#weather-press-loader").addClass("flipOutX"),e("#weather-press-chartLabel").css("opacity","1")};e(".weather-press-citiesList li[data-weatherpressads = 0]").click(function(){d(e(this),1),f(e(this),1)});var d=function(t,r){h(),s=e.ajax({type:"POST",url:weather_press_data_from_php.weather_press_ajax_url,data:{action:"weather_press_public_ajaxCalls",find:"current",save:r,city:encodeURIComponent(t.text().toLowerCase()),unit:weather_press_data_from_php.weather_press_Current_Unit,language:weather_press_data_from_php.weather_press_Current_Language},cache:!1,dataType:"json",success:function(s){e(".weather-press-currentTempValue").text(s.temp+"°"),e(".weather-press-icon img").attr("src",weather_press_data_from_php.weather_press_Plugin_Path+"/public/images/"+s.icon+".png"),n(t.index()),w()},error:function(s,t,r){e(".weather-press-outputs-content").html(r+"<br><b>"+s.responseText+"</b></br>"),e(".weather-press-outputs-toPremium").css("opacity","1")}})},u=function(e){switch(!0){case 0==e:return"12am";case e<12:return e+"am";case e>=12:return e+"pm"}},f=function(s,t){e("#weather-press-chart-loader").css("display","block"),e.ajax({type:"POST",url:weather_press_data_from_php.weather_press_ajax_url,data:{action:"weather_press_public_ajaxCalls",find:"hourly",save:t,city:encodeURIComponent(s.text().toLowerCase()),unit:weather_press_data_from_php.weather_press_Current_Unit,language:weather_press_data_from_php.weather_press_Current_Language},cache:!1,dataType:"json",success:function(s){var t=[],r=[];e.each(s,function(e,s){var a=s.date,i=s.temp;a&&(a=new Date(a),a=u(a.getHours()),i=Math.round(i),t[e]=a,r[e]=i)}),p={labels:[t[0],t[1],t[2],t[3]],series:[[{value:r[0],meta:"°"},{value:r[1],meta:"°"},{value:r[2],meta:"°"},{value:r[3],meta:"°"},{value:0,meta:"NO X COORDINATE"}]]},l(),e("#weather-press-chart-loader").css("display","none")},error:function(s){l(),e("#weather-press-chart-loader").css("display","none")}})};d(e(".weather-press-centred"),1),f(e(".weather-press-centred"),1),e(".weather-press-refrech").click(function(){d(e(".weather-press-centred"),0),f(e(".weather-press-centred"),0)}),e("#weather-press-navRectangle-mainLocation").click(function(){d(e(".weather-press-centred"),1),f(e(".weather-press-centred"),1)})}})}(jQuery);
     1/******************************* THANK YOU FOR CHOOSING WEATHER PRESS        www.weather-press.com************************/
     2!function(t){"use strict";t(document).ready(function(){if(console.log("THANK YOU FOR CHOOSING WEATHER PRESS, V4.5"),t("#weather-press-layoutContainer").length){var e,r,i=null,n=t(".weather-press-block-bottom").width(),o=0;t("#weather-press-forecast-loader").css("left",n+7),t(".weather-press-cities-list li").each(function(i,n){if(t(n).hasClass("main-location"))return e=i,r=t(n).position().top.toFixed(2),t("#weather-press-city-name").text(t(n).text()),t("#weather-press-city-name").attr("title",t(n).text()),!1}),t("#weather-press-display-image").click(function(){t(".weather-press-cities-list").css("margin-top");t(".weather-press-block-bottom").toggleClass("weather-press-block-bottom-marginTop"),t(".weather-press-block-middle img").fadeToggle("slow","linear")}),t(".weather-press-closeIcon").click(function(){var e=t(this).attr("data-weatherpressclose");t("."+e).removeClass("flipInX"),t("."+e).addClass("flipOutX"),"weather-press-dailyForecast"==e?t(".weather-press-forecasts ul li").each(function(e,r){t(r).removeClass("weather-press-forecast-active"),0==e&&t(r).addClass("weather-press-forecast-active")}):"weather-press-loader"==e&&(t(".weather-press-outputs-content").text("Loading ..."),t(".weather-press-outputs-toPremium").css("opacity","0"),t(".weather-press-cities-nav-container").css("display","block"),null!=i&&i.abort())}),t("#weather-press-cities-navs-top").click(function(){a(e+1)}),t("#weather-press-cities-navs-bottom").click(function(){a(e-1)});var a=function(i){var n,o=t(".weather-press-cities-list li").length;t(".weather-press-cities-list li").each(function(a,s){if(a==i&&a<o&&a>=0)return e=a,t("#weather-press-city-name").text(t(s).text()),t("#weather-press-city-name").attr("title",t(s).text()),t(s).removeClass(),t(s).addClass("main-location"),n=t(s).position().top.toFixed(2),t(".weather-press-cities-list").css("margin-top",r-n),t(".weather-press-cities-list li:eq("+(a-1)+")").length&&t(".weather-press-cities-list li:eq("+(a-1)+")").removeClass(),t(".weather-press-cities-list li:eq("+(a-2)+")").length&&(t(".weather-press-cities-list li:eq("+(a-2)+")").removeClass(),t(".weather-press-cities-list li:eq("+(a-2)+")").addClass("deep")),t(".weather-press-cities-list li:eq("+(a+1)+")").length&&t(".weather-press-cities-list li:eq("+(a+1)+")").removeClass(),t(".weather-press-cities-list li:eq("+(a+2)+")").length&&(t(".weather-press-cities-list li:eq("+(a+2)+")").removeClass(),t(".weather-press-cities-list li:eq("+(a+2)+")").addClass("deep")),!1})},s=function(e){var r;1==e?3>o?(r=-1*++o*(n+7),t(".weather-press-forecast-list").css("left",r),t(".weather-press-block-bottom").addClass("initial-background")):h(1):-1==e&&(o>0?(r=-1*--o*(n+7),t(".weather-press-forecast-list").css("left",r),0==o&&t(".weather-press-block-bottom").removeClass("initial-background")):h(-1))},h=function(e){var r,i,o;1==e?(r=-3*(n+7),i=parseInt(r)-10,clearTimeout(o),t(".weather-press-forecast-list").css("left",i),o=setTimeout(function(){t(".weather-press-forecast-list").css("left",r)},300)):-1==e&&(clearTimeout(o),t(".weather-press-forecast-list").css("left",10),o=setTimeout(function(){t(".weather-press-forecast-list").css("left",0)},300))},c=function(){t("#weather-press-loader").removeClass("flipOutX"),t("#weather-press-loader").addClass("flipInX"),t(".weather-press-cities-nav-container").css("display","none"),t(".weather-press-forecast-list").css("left",0),o=0,t(".weather-press-block-bottom").removeClass("initial-background")};t(".weather-press-cities-list li").click(function(){a(t(this).index()),l(t(this),1),p(t(this),1)}),t("#weather-press-city-name").click(function(){l(t(".weather-press-cities-list .main-location"),1),p(t(".weather-press-cities-list .main-location"),1)}),t("#weather-press-forecast-navs-right").click(function(){s(1)}),t("#weather-press-forecast-navs-left").click(function(){s(-1)});var l=function(e,r){c(),i=t.ajax({type:"POST",url:weather_press_data_from_php.weather_press_ajax_url,data:{action:"weather_press_public_ajaxCalls",find:"current",save:r,city:encodeURIComponent(e.text().toLowerCase()),unit:weather_press_data_from_php.weather_press_Current_Unit,language:weather_press_data_from_php.weather_press_Current_Language},cache:!1,dataType:"json",success:function(r){var i=void 0!=r.temp?r.temp:"00",n=void 0!=r.temp_min?r.temp_min:"00",o=void 0!=r.temp_max?r.temp_max:"00",s=void 0!=r.icon?r.icon:"undefined";t(".weather-press-forecast-list li:first-child .weather-press-temp").text(i+"°"),t(".weather-press-forecast-list li:first-child .weather-press-condition-img > img").attr("src",weather_press_data_from_php.weather_press_Plugin_Path+"/public/images/"+s+".png"),t(".weather-press-forecast-list li:first-child .weather-press-min-temp").text(n+"°"),t(".weather-press-forecast-list li:first-child .weather-press-max-temp").text(o+"°"),s.indexOf("n")>=0&&"undefined"!=s&&(t(".weather-press-block-bottom").addClass("night-background"),t(".weather-press-block-middle").addClass("night-background")),a(e.index()),f(),t(".weather-press-cities-nav-container").css("display","block")},error:function(e){console.log(e);var r=JSON.stringify(e.responseText).substring(1,JSON.stringify(e.responseText).length-1);t(".weather-press-outputs-content").text("Error : "+r)}})},u=0,p=function(e,r){t.ajax({type:"POST",url:weather_press_data_from_php.weather_press_ajax_url,data:{action:"weather_press_public_ajaxCalls",find:"daily",save:r,city:encodeURIComponent(e.text().toLowerCase()),unit:weather_press_data_from_php.weather_press_Current_Unit,nbrDays:4,language:weather_press_data_from_php.weather_press_Current_Language},cache:!1,dataType:"json",success:function(i){var n,o,a,s,h,c;t.each(i,function(l,d){if(l>0)if(n=i[l].date,o=i[l].maxtemp,a=i[l].mintemp,s=i[l].daytemp,h=i[l].icon,n)1==l&&t(".weather-press-forecast-list > li").length>1&&t(".weather-press-forecast-list > li:not(:first)").remove(),(c=t("<li id='weather_press_forecast_node_"+l+"'><ul class='weather-press-forecast-item'><li class='weather-press-date' class='weather-press-date'>"+n+"</li><li class='weather-press-temp'>"+s+"°</li><li class='weather-press-condition-img'><img src='"+weather_press_data_from_php.weather_press_Plugin_Path+"/public/images/"+h+".png' alt='icon'/></li><li class='weather-press-minMax'><ul><li class='weather-press-min-temp'>"+a+"°</li><li class='weather-press-temp-gauge'><div class='weather-press-gauge-gradient'></div></li><li class='weather-press-max-temp'>"+o+"°</li></ul></li></ul></li>")).insertAfter("#weather_press_forecast_node_"+(l-1));else if(u<=2){for(var f=1;l<4;f++)t(".weather-press-forecast-list > li;eq("+f+")").remove();p(e,r),u++}}),t("#weather-press-forecast-loader").css("display","none")},error:function(t){}})};l(t(".weather-press-cities-list .main-location"),1),p(t(".weather-press-cities-list .main-location"),1);function d(t,e){this.config=null,this.container=null,this.renderer=null,this.scene=null,this.camera=null,this.aspect=0,this.cameraX={value:0,min:-50,max:50},this.cameraY={value:0,min:-100,max:50},this.cameraRotation={value:0},this.init(t,e)}var f=function(){t("#weather-press-loader").removeClass("flipInX"),t("#weather-press-loader").addClass("flipOutX"),0!=t("#weather_press_brand").length&&"none"!=t("#weather_press_brand").css("display")&&"0"!=t("#weather_press_brand").css("opacity")&&"hidden"!=t("#weather_press_brand").css("visibility")&&0!=t("#weather_press_brand a").length&&"none"!=t("#weather_press_brand a").css("display")&&"0"!=t("#weather_press_brand a").css("opacity")&&"hidden"!=t("#weather_press_brand a").css("visibility")||(t(".weather-press-block-bottom").empty(),t(".weather-press-block-bottom").css("height","221px"),c(),t(".weather-press-outputs-content").text('As a free user you do not have permission to remove the "weather press" brand from the bottom of the widget !'),t(".weather-press-outputs-content").css("color","red"),t(".weather-press-outputs-content").css("text-align","left"),t(".weather-press-outputs-content").css("background","#F1F3F3"))},m={REVISION:"74"};"function"==typeof define&&define.amd?define("three",m):"undefined"!=typeof exports&&"undefined"!=typeof module&&(module.exports=m),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Math.sign&&(Math.sign=function(t){return 0>t?-1:0<t?1:+t}),void 0===Function.prototype.name&&void 0!==Object.defineProperty&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}}),void 0===Object.assign&&Object.defineProperty(Object,"assign",{writable:!0,configurable:!0,value:function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),r=1,i=arguments.length;r!==i;++r)if(void 0!==(n=arguments[r])&&null!==n)for(var n=Object(n),o=Object.keys(n),a=0,s=o.length;a!==s;++a){var h=o[a],c=Object.getOwnPropertyDescriptor(n,h);void 0!==c&&c.enumerable&&(e[h]=n[h])}return e}}),m.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},m.CullFaceNone=0,m.CullFaceBack=1,m.CullFaceFront=2,m.CullFaceFrontBack=3,m.FrontFaceDirectionCW=0,m.FrontFaceDirectionCCW=1,m.BasicShadowMap=0,m.PCFShadowMap=1,m.PCFSoftShadowMap=2,m.FrontSide=0,m.BackSide=1,m.DoubleSide=2,m.FlatShading=1,m.SmoothShading=2,m.NoColors=0,m.FaceColors=1,m.VertexColors=2,m.NoBlending=0,m.NormalBlending=1,m.AdditiveBlending=2,m.SubtractiveBlending=3,m.MultiplyBlending=4,m.CustomBlending=5,m.AddEquation=100,m.SubtractEquation=101,m.ReverseSubtractEquation=102,m.MinEquation=103,m.MaxEquation=104,m.ZeroFactor=200,m.OneFactor=201,m.SrcColorFactor=202,m.OneMinusSrcColorFactor=203,m.SrcAlphaFactor=204,m.OneMinusSrcAlphaFactor=205,m.DstAlphaFactor=206,m.OneMinusDstAlphaFactor=207,m.DstColorFactor=208,m.OneMinusDstColorFactor=209,m.SrcAlphaSaturateFactor=210,m.NeverDepth=0,m.AlwaysDepth=1,m.LessDepth=2,m.LessEqualDepth=3,m.EqualDepth=4,m.GreaterEqualDepth=5,m.GreaterDepth=6,m.NotEqualDepth=7,m.MultiplyOperation=0,m.MixOperation=1,m.AddOperation=2,m.UVMapping=300,m.CubeReflectionMapping=301,m.CubeRefractionMapping=302,m.EquirectangularReflectionMapping=303,m.EquirectangularRefractionMapping=304,m.SphericalReflectionMapping=305,m.RepeatWrapping=1e3,m.ClampToEdgeWrapping=1001,m.MirroredRepeatWrapping=1002,m.NearestFilter=1003,m.NearestMipMapNearestFilter=1004,m.NearestMipMapLinearFilter=1005,m.LinearFilter=1006,m.LinearMipMapNearestFilter=1007,m.LinearMipMapLinearFilter=1008,m.UnsignedByteType=1009,m.ByteType=1010,m.ShortType=1011,m.UnsignedShortType=1012,m.IntType=1013,m.UnsignedIntType=1014,m.FloatType=1015,m.HalfFloatType=1025,m.UnsignedShort4444Type=1016,m.UnsignedShort5551Type=1017,m.UnsignedShort565Type=1018,m.AlphaFormat=1019,m.RGBFormat=1020,m.RGBAFormat=1021,m.LuminanceFormat=1022,m.LuminanceAlphaFormat=1023,m.RGBEFormat=m.RGBAFormat,m.RGB_S3TC_DXT1_Format=2001,m.RGBA_S3TC_DXT1_Format=2002,m.RGBA_S3TC_DXT3_Format=2003,m.RGBA_S3TC_DXT5_Format=2004,m.RGB_PVRTC_4BPPV1_Format=2100,m.RGB_PVRTC_2BPPV1_Format=2101,m.RGBA_PVRTC_4BPPV1_Format=2102,m.RGBA_PVRTC_2BPPV1_Format=2103,m.RGB_ETC1_Format=2151,m.LoopOnce=2200,m.LoopRepeat=2201,m.LoopPingPong=2202,m.InterpolateDiscrete=2300,m.InterpolateLinear=2301,m.InterpolateSmooth=2302,m.ZeroCurvatureEnding=2400,m.ZeroSlopeEnding=2401,m.WrapAroundEnding=2402,m.TrianglesDrawMode=0,m.TriangleStripDrawMode=1,m.TriangleFanDrawMode=2,m.Color=function(t){return 3===arguments.length?this.fromArray(arguments):this.set(t)},m.Color.prototype={constructor:m.Color,r:1,g:1,b:1,set:function(t){return t instanceof m.Color?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){this.b=this.g=this.r=t},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,r){return this.r=t,this.g=e,this.b=r,this},setHSL:function(){function t(t,e,r){return 0>r&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:.5>r?e:r<2/3?t+6*(e-t)*(2/3-r):t}return function(e,r,i){return e=m.Math.euclideanModulo(e,1),r=m.Math.clamp(r,0,1),i=m.Math.clamp(i,0,1),0===r?this.r=this.g=this.b=i:(r=.5>=i?i*(1+r):i+r-i*r,i=2*i-r,this.r=t(i,r,e+1/3),this.g=t(i,r,e),this.b=t(i,r,e-1/3)),this}}(),setStyle:function(t){function e(e){void 0!==e&&1>parseFloat(e)&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t))switch(i=r[2],r[1]){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i)){var i=parseFloat(r[1])/360,n=parseInt(r[2],10)/100,o=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(i,n,o)}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(t)){if(r=r[1],3===(i=r.length))return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(6===i)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return t&&0<t.length&&(r=m.ColorKeywords[t],void 0!==r?this.setHex(r):console.warn("THREE.Color: Unknown color "+t)),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var r=0<e?1/e:1;return this.r=Math.pow(t.r,r),this.g=Math.pow(t.g,r),this.b=Math.pow(t.b,r),this},convertGammaToLinear:function(){var t=this.r,e=this.g,r=this.b;return this.r=t*t,this.g=e*e,this.b=r*r,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){t=t||{h:0,s:0,l:0};var e,r=this.r,i=this.g,n=this.b,o=Math.max(r,i,n),a=((h=Math.min(r,i,n))+o)/2;if(h===o)h=e=0;else{var s=o-h,h=.5>=a?s/(o+h):s/(2-o-h);switch(o){case r:e=(i-n)/s+(i<n?6:0);break;case i:e=(n-r)/s+2;break;case n:e=(r-i)/s+4}e/=6}return t.h=e,t.s=h,t.l=a,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,r){var i=this.getHSL();return i.h+=t,i.s+=e,i.l+=r,this.setHSL(i.h,i.s,i.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}},m.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},m.Quaternion=function(t,e,r,i){this._x=t||0,this._y=e||0,this._z=r||0,this._w=void 0!==i?i:1},m.Quaternion.prototype={constructor:m.Quaternion,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get w(){return this._w},set w(t){this._w=t,this.onChangeCallback()},set:function(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._w=i,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(0==t instanceof m.Euler)throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var r=Math.cos(t._x/2),i=Math.cos(t._y/2),n=Math.cos(t._z/2),o=Math.sin(t._x/2),a=Math.sin(t._y/2),s=Math.sin(t._z/2),h=t.order;return"XYZ"===h?(this._x=o*i*n+r*a*s,this._y=r*a*n-o*i*s,this._z=r*i*s+o*a*n,this._w=r*i*n-o*a*s):"YXZ"===h?(this._x=o*i*n+r*a*s,this._y=r*a*n-o*i*s,this._z=r*i*s-o*a*n,this._w=r*i*n+o*a*s):"ZXY"===h?(this._x=o*i*n-r*a*s,this._y=r*a*n+o*i*s,this._z=r*i*s+o*a*n,this._w=r*i*n-o*a*s):"ZYX"===h?(this._x=o*i*n-r*a*s,this._y=r*a*n+o*i*s,this._z=r*i*s-o*a*n,this._w=r*i*n+o*a*s):"YZX"===h?(this._x=o*i*n+r*a*s,this._y=r*a*n+o*i*s,this._z=r*i*s-o*a*n,this._w=r*i*n-o*a*s):"XZY"===h&&(this._x=o*i*n-r*a*s,this._y=r*a*n-o*i*s,this._z=r*i*s+o*a*n,this._w=r*i*n+o*a*s),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var r=e/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e=t.elements,r=e[0];t=e[4];var i=e[8],n=e[1],o=e[5],a=e[9],s=e[2],h=e[6],c=r+o+(e=e[10]);return 0<c?(r=.5/Math.sqrt(c+1),this._w=.25/r,this._x=(h-a)*r,this._y=(i-s)*r,this._z=(n-t)*r):r>o&&r>e?(r=2*Math.sqrt(1+r-o-e),this._w=(h-a)/r,this._x=.25*r,this._y=(t+n)/r,this._z=(i+s)/r):o>e?(r=2*Math.sqrt(1+o-r-e),this._w=(i-s)/r,this._x=(t+n)/r,this._y=.25*r,this._z=(a+h)/r):(r=2*Math.sqrt(1+e-r-o),this._w=(n-t)/r,this._x=(i+s)/r,this._y=(a+h)/r,this._z=.25*r),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e;return function(r,i){return void 0===t&&(t=new m.Vector3),e=r.dot(i)+1,1e-6>e?(e=0,Math.abs(r.x)>Math.abs(r.z)?t.set(-r.y,r.x,0):t.set(0,-r.z,r.y)):t.crossVectors(r,i),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._z=this._y=this._x=0,this._w=1):(t=1/t,this._x*=t,this._y*=t,this._z*=t,this._w*=t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},multiplyQuaternions:function(t,e){var r=t._x,i=t._y,n=t._z,o=t._w,a=e._x,s=e._y,h=e._z,c=e._w;return this._x=r*c+o*a+i*h-n*s,this._y=i*c+o*s+n*a-r*h,this._z=n*c+o*h+r*s-i*a,this._w=o*c-r*a-i*s-n*h,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,i=this._y,n=this._z,o=this._w;if(0>(s=o*t._w+r*t._x+i*t._y+n*t._z)?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),1<=s)return this._w=o,this._x=r,this._y=i,this._z=n,this;if(h=Math.sqrt(1-s*s),.001>Math.abs(h))return this._w=.5*(o+this._w),this._x=.5*(r+this._x),this._y=.5*(i+this._y),this._z=.5*(n+this._z),this;var a=Math.atan2(h,s),s=Math.sin((1-e)*a)/h,h=Math.sin(e*a)/h;return this._w=o*s+this._w*h,this._x=r*s+this._x*h,this._y=i*s+this._y*h,this._z=n*s+this._z*h,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},Object.assign(m.Quaternion,{slerp:function(t,e,r,i){return r.copy(t).slerp(e,i)},slerpFlat:function(t,e,r,i,n,o,a){var s=r[i+0],h=r[i+1],c=r[i+2];r=r[i+3],i=n[o+0];var l=n[o+1],u=n[o+2];if(n=n[o+3],r!==n||s!==i||h!==l||c!==u){o=1-a;var p=s*i+h*l+c*u+r*n,d=0<=p?1:-1,f=1-p*p;f>Number.EPSILON&&(f=Math.sqrt(f),p=Math.atan2(f,p*d),o=Math.sin(o*p)/f,a=Math.sin(a*p)/f),s=s*o+i*(d*=a),h=h*o+l*d,c=c*o+u*d,r=r*o+n*d,o===1-a&&(a=1/Math.sqrt(s*s+h*h+c*c+r*r),s*=a,h*=a,c*=a,r*=a)}t[e]=s,t[e+1]=h,t[e+2]=c,t[e+3]=r}}),m.Vector2=function(t,e){this.x=t||0,this.y=e||0},m.Vector2.prototype={constructor:m.Vector2,get width(){return this.x},set width(t){this.x=t},get height(){return this.y},set height(t){this.y=t},set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.y=this.x=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t):this.y=this.x=0,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t,e;return function(r,i){return void 0===t&&(t=new m.Vector2,e=new m.Vector2),t.set(r,r),e.set(i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,r))/r),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var t=Math.atan2(this.y,this.x);return 0>t&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x;return t=this.y-t.y,e*e+t*t},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this},rotateAround:function(t,e){var r=Math.cos(e),i=Math.sin(e),n=this.x-t.x,o=this.y-t.y;return this.x=n*r-o*i+t.x,this.y=n*i+o*r+t.y,this}},m.Vector3=function(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0},m.Vector3.prototype={constructor:m.Vector3,set:function(t,e,r){return this.x=t,this.y=e,this.z=r,this},setScalar:function(t){return this.z=this.y=this.x=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):this.z=this.y=this.x=0,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t;return function(e){return 0==e instanceof m.Euler&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),void 0===t&&(t=new m.Quaternion),this.applyQuaternion(t.setFromEuler(e)),this}}(),applyAxisAngle:function(){var t;return function(e,r){return void 0===t&&(t=new m.Quaternion),this.applyQuaternion(t.setFromAxisAngle(e,r)),this}}(),applyMatrix3:function(t){var e=this.x,r=this.y,i=this.z;return t=t.elements,this.x=t[0]*e+t[3]*r+t[6]*i,this.y=t[1]*e+t[4]*r+t[7]*i,this.z=t[2]*e+t[5]*r+t[8]*i,this},applyMatrix4:function(t){var e=this.x,r=this.y,i=this.z;return t=t.elements,this.x=t[0]*e+t[4]*r+t[8]*i+t[12],this.y=t[1]*e+t[5]*r+t[9]*i+t[13],this.z=t[2]*e+t[6]*r+t[10]*i+t[14],this},applyProjection:function(t){var e=this.x,r=this.y,i=this.z,n=1/((t=t.elements)[3]*e+t[7]*r+t[11]*i+t[15]);return this.x=(t[0]*e+t[4]*r+t[8]*i+t[12])*n,this.y=(t[1]*e+t[5]*r+t[9]*i+t[13])*n,this.z=(t[2]*e+t[6]*r+t[10]*i+t[14])*n,this},applyQuaternion:function(t){var e=this.x,r=this.y,i=this.z,n=t.x,o=t.y,a=t.z,s=(t=t.w)*e+o*i-a*r,h=t*r+a*e-n*i,c=t*i+n*r-o*e,e=-n*e-o*r-a*i;return this.x=s*t+e*-n+h*-a-c*-o,this.y=h*t+e*-o+c*-n-s*-a,this.z=c*t+e*-a+s*-o-h*-n,this},project:function(){var t;return function(e){return void 0===t&&(t=new m.Matrix4),t.multiplyMatrices(e.projectionMatrix,t.getInverse(e.matrixWorld)),this.applyProjection(t)}}(),unproject:function(){var t;return function(e){return void 0===t&&(t=new m.Matrix4),t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyProjection(t)}}(),transformDirection:function(t){var e=this.x,r=this.y,i=this.z;return t=t.elements,this.x=t[0]*e+t[4]*r+t[8]*i,this.y=t[1]*e+t[5]*r+t[9]*i,this.z=t[2]*e+t[6]*r+t[10]*i,this.normalize(),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t,e;return function(r,i){return void 0===t&&(t=new m.Vector3,e=new m.Vector3),t.set(r,r,r),e.set(i,i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,r))/r),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},cross:function(t,e){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var r=this.x,i=this.y,n=this.z;return this.x=i*t.z-n*t.y,this.y=n*t.x-r*t.z,this.z=r*t.y-i*t.x,this},crossVectors:function(t,e){var r=t.x,i=t.y,n=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-n*a,this.y=n*o-r*s,this.z=r*a-i*o,this},projectOnVector:function(){var t,e;return function(r){return void 0===t&&(t=new m.Vector3),t.copy(r).normalize(),e=this.dot(t),this.copy(t).multiplyScalar(e)}}(),projectOnPlane:function(){var t;return function(e){return void 0===t&&(t=new m.Vector3),t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t;return function(e){return void 0===t&&(t=new m.Vector3),this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){return t=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq()),Math.acos(m.Math.clamp(t,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y;return t=this.z-t.z,e*e+r*r+t*t},setFromMatrixPosition:function(t){return this.x=t.elements[12],this.y=t.elements[13],this.z=t.elements[14],this},setFromMatrixScale:function(t){var e=this.set(t.elements[0],t.elements[1],t.elements[2]).length(),r=this.set(t.elements[4],t.elements[5],t.elements[6]).length();return t=this.set(t.elements[8],t.elements[9],t.elements[10]).length(),this.x=e,this.y=r,this.z=t,this},setFromMatrixColumn:function(t,e){var r=4*t,i=e.elements;return this.x=i[r],this.y=i[r+1],this.z=i[r+2],this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this}},m.Vector4=function(t,e,r,i){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==i?i:1},m.Vector4.prototype={constructor:m.Vector4,set:function(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this},setScalar:function(t){return this.w=this.z=this.y=this.x=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):this.w=this.z=this.y=this.x=0,this},applyMatrix4:function(t){var e=this.x,r=this.y,i=this.z,n=this.w;return t=t.elements,this.x=t[0]*e+t[4]*r+t[8]*i+t[12]*n,this.y=t[1]*e+t[5]*r+t[9]*i+t[13]*n,this.z=t[2]*e+t[6]*r+t[10]*i+t[14]*n,this.w=t[3]*e+t[7]*r+t[11]*i+t[15]*n,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return 1e-4>e?(this.x=1,this.z=this.y=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,r,i,n=(t=t.elements)[0];i=t[4];var o=t[8],a=t[1],s=t[5],h=t[9];r=t[2],e=t[6];var c=t[10];return.01>Math.abs(i-a)&&.01>Math.abs(o-r)&&.01>Math.abs(h-e)?.1>Math.abs(i+a)&&.1>Math.abs(o+r)&&.1>Math.abs(h+e)&&.1>Math.abs(n+s+c-3)?(this.set(1,0,0,0),this):(t=Math.PI,n=(n+1)/2,s=(s+1)/2,c=(c+1)/2,i=(i+a)/4,o=(o+r)/4,h=(h+e)/4,n>s&&n>c?.01>n?(e=0,i=r=.707106781):(e=Math.sqrt(n),r=i/e,i=o/e):s>c?.01>s?(e=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),e=i/r,i=h/r):.01>c?(r=e=.707106781,i=0):(i=Math.sqrt(c),e=o/i,r=h/i),this.set(e,r,i,t),this):(t=Math.sqrt((e-h)*(e-h)+(o-r)*(o-r)+(a-i)*(a-i)),.001>Math.abs(t)&&(t=1),this.x=(e-h)/t,this.y=(o-r)/t,this.z=(a-i)/t,this.w=Math.acos((n+s+c-1)/2),this)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(r,i){return void 0===t&&(t=new m.Vector4,e=new m.Vector4),t.set(r,r,r,r),e.set(i,i,i,i),this.clamp(t,e)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this.w=t.array[e+3],this}},m.Euler=function(t,e,r,i){this._x=t||0,this._y=e||0,this._z=r||0,this._order=i||m.Euler.DefaultOrder},m.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),m.Euler.DefaultOrder="XYZ",m.Euler.prototype={constructor:m.Euler,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get order(){return this._order},set order(t){this._order=t,this.onChangeCallback()},set:function(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,r){var i=m.Math.clamp;t=(u=t.elements)[0];var n=u[4],o=u[8],a=u[1],s=u[5],h=u[9],c=u[2],l=u[6],u=u[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(i(o,-1,1)),.99999>Math.abs(o)?(this._x=Math.atan2(-h,u),this._z=Math.atan2(-n,t)):(this._x=Math.atan2(l,s),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(h,-1,1)),.99999>Math.abs(h)?(this._y=Math.atan2(o,u),this._z=Math.atan2(a,s)):(this._y=Math.atan2(-c,t),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(-c,u),this._z=Math.atan2(-n,s)):(this._y=0,this._z=Math.atan2(a,t))):"ZYX"===e?(this._y=Math.asin(-i(c,-1,1)),.99999>Math.abs(c)?(this._x=Math.atan2(l,u),this._z=Math.atan2(a,t)):(this._x=0,this._z=Math.atan2(-n,s))):"YZX"===e?(this._z=Math.asin(i(a,-1,1)),.99999>Math.abs(a)?(this._x=Math.atan2(-h,s),this._y=Math.atan2(-c,t)):(this._x=0,this._y=Math.atan2(o,u))):"XZY"===e?(this._z=Math.asin(-i(n,-1,1)),.99999>Math.abs(n)?(this._x=Math.atan2(l,s),this._y=Math.atan2(o,t)):(this._x=Math.atan2(-h,u),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==r&&this.onChangeCallback(),this},setFromQuaternion:function(){var t;return function(e,r,i){return void 0===t&&(t=new m.Matrix4),t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,r,i),this}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new m.Quaternion;return function(e){t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new m.Vector3(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},m.Line3=function(t,e){this.start=void 0!==t?t:new m.Vector3,this.end=void 0!==e?e:new m.Vector3},m.Line3.prototype={constructor:m.Line3,set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},center:function(t){return(t||new m.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return(t||new m.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var r=e||new m.Vector3;return this.delta(r).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new m.Vector3,e=new m.Vector3;return function(r,i){t.subVectors(r,this.start),e.subVectors(this.end,this.start);var n=e.dot(e),n=e.dot(t)/n;return i&&(n=m.Math.clamp(n,0,1)),n}}(),closestPointToPoint:function(t,e,r){return t=this.closestPointToPointParameter(t,e),r=r||new m.Vector3,this.delta(r).multiplyScalar(t).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}},m.Box2=function(t,e){this.min=void 0!==t?t:new m.Vector2(1/0,1/0),this.max=void 0!==e?e:new m.Vector2(-1/0,-1/0)},m.Box2.prototype={constructor:m.Box2,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new m.Vector2;return function(e,r){var i=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(t){return(t||new m.Vector2).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){return(t||new m.Vector2).subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return(e||new m.Vector2).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return(e||new m.Vector2).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new m.Vector2;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},m.Box3=function(t,e){this.min=void 0!==t?t:new m.Vector3(1/0,1/0,1/0),this.max=void 0!==e?e:new m.Vector3(-1/0,-1/0,-1/0)},m.Box3.prototype={constructor:m.Box3,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){this.makeEmpty();for(var e=1/0,r=1/0,i=1/0,n=-1/0,o=-1/0,a=-1/0,s=0,h=t.length;s<h;s+=3){var c=t[s],l=t[s+1],u=t[s+2];c<e&&(e=c),l<r&&(r=l),u<i&&(i=u),c>n&&(n=c),l>o&&(o=l),u>a&&(a=u)}this.min.set(e,r,i),this.max.set(n,o,a)},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new m.Vector3;return function(e,r){var i=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),setFromObject:function(){var t;return function(e){void 0===t&&(t=new m.Box3);var r=this;return this.makeEmpty(),e.updateMatrixWorld(!0),e.traverse(function(e){var i=e.geometry;void 0!==i&&(null===i.boundingBox&&i.computeBoundingBox(),t.copy(i.boundingBox),t.applyMatrix4(e.matrixWorld),r.union(t))}),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(t){return(t||new m.Vector3).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){return(t||new m.Vector3).subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return(e||new m.Vector3).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(){var t;return function(e){return void 0===t&&(t=new m.Vector3),this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,r;return 0<t.normal.x?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),0<t.normal.y?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=t.constant&&r>=t.constant},clampPoint:function(t,e){return(e||new m.Vector3).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new m.Vector3;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new m.Vector3;return function(e){return e=e||new m.Sphere,e.center=this.center(),e.radius=.5*this.size(t).length(),e}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new m.Vector3,new m.Vector3,new m.Vector3,new m.Vector3,new m.Vector3,new m.Vector3,new m.Vector3,new m.Vector3];return function(e){return t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.makeEmpty(),this.setFromPoints(t),this}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},m.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")},m.Matrix3.prototype={constructor:m.Matrix3,set:function(t,e,r,i,n,o,a,s,h){var c=this.elements;return c[0]=t,c[3]=e,c[6]=r,c[1]=i,c[4]=n,c[7]=o,c[2]=a,c[5]=s,c[8]=h,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){return t=t.elements,this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},applyToVector3Array:function(){var t;return function(e,r,i){void 0===t&&(t=new m.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length);for(var n=0;n<i;n+=3,r+=3)t.fromArray(e,r),t.applyMatrix3(this),t.toArray(e,r);return e}}(),applyToBuffer:function(){var t;return function(e,r,i){void 0===t&&(t=new m.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length/e.itemSize);for(var n=0;n<i;n++,r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.applyMatrix3(this),e.setXYZ(t.x,t.y,t.z);return e}}(),multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],o=t[4],a=t[5],s=t[6],h=t[7];return e*o*(t=t[8])-e*a*h-r*n*t+r*a*s+i*n*h-i*o*s},getInverse:function(t,e){var r=t.elements,i=this.elements;if(i[0]=r[10]*r[5]-r[6]*r[9],i[1]=-r[10]*r[1]+r[2]*r[9],i[2]=r[6]*r[1]-r[2]*r[5],i[3]=-r[10]*r[4]+r[6]*r[8],i[4]=r[10]*r[0]-r[2]*r[8],i[5]=-r[6]*r[0]+r[2]*r[4],i[6]=r[9]*r[4]-r[5]*r[8],i[7]=-r[9]*r[0]+r[1]*r[8],i[8]=r[5]*r[0]-r[1]*r[4],0==(r=r[0]*i[0]+r[1]*i[3]+r[2]*i[6])){if(e)throw Error("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0");return console.warn("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/r),this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},flattenToArrayOffset:function(t,e){var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t},getNormalMatrix:function(t){return this.getInverse(t).transpose(),this},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},fromArray:function(t){return this.elements.set(t),this},toArray:function(){var t=this.elements;return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}},m.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},m.Matrix4.prototype={constructor:m.Matrix4,set:function(t,e,r,i,n,o,a,s,h,c,l,u,p,d,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=r,g[12]=i,g[1]=n,g[5]=o,g[9]=a,g[13]=s,g[2]=h,g[6]=c,g[10]=l,g[14]=u,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new m.Matrix4).fromArray(this.elements)},copy:function(t){return this.elements.set(t.elements),this},copyPosition:function(t){var e=this.elements;return t=t.elements,e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(t,e,r){var i=this.elements;return t.set(i[0],i[1],i[2]),e.set(i[4],i[5],i[6]),r.set(i[8],i[9],i[10]),this},makeBasis:function(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this},extractRotation:function(){var t;return function(e){void 0===t&&(t=new m.Vector3);var r=this.elements;e=e.elements;var i=1/t.set(e[0],e[1],e[2]).length(),n=1/t.set(e[4],e[5],e[6]).length(),o=1/t.set(e[8],e[9],e[10]).length();return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[8]=e[8]*o,r[9]=e[9]*o,r[10]=e[10]*o,this}}(),makeRotationFromEuler:function(t){0==t instanceof m.Euler&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,r=t.x,i=t.y,n=t.z,o=Math.cos(r),r=Math.sin(r),a=Math.cos(i),i=Math.sin(i),s=Math.cos(n),n=Math.sin(n);if("XYZ"===t.order){t=o*s;var h=o*n,c=r*s,l=r*n;e[0]=a*s,e[4]=-a*n,e[8]=i,e[1]=h+c*i,e[5]=t-l*i,e[9]=-r*a,e[2]=l-t*i,e[6]=c+h*i,e[10]=o*a}else"YXZ"===t.order?(t=a*s,h=a*n,c=i*s,l=i*n,e[0]=t+l*r,e[4]=c*r-h,e[8]=o*i,e[1]=o*n,e[5]=o*s,e[9]=-r,e[2]=h*r-c,e[6]=l+t*r,e[10]=o*a):"ZXY"===t.order?(t=a*s,h=a*n,c=i*s,l=i*n,e[0]=t-l*r,e[4]=-o*n,e[8]=c+h*r,e[1]=h+c*r,e[5]=o*s,e[9]=l-t*r,e[2]=-o*i,e[6]=r,e[10]=o*a):"ZYX"===t.order?(t=o*s,h=o*n,c=r*s,l=r*n,e[0]=a*s,e[4]=c*i-h,e[8]=t*i+l,e[1]=a*n,e[5]=l*i+t,e[9]=h*i-c,e[2]=-i,e[6]=r*a,e[10]=o*a):"YZX"===t.order?(t=o*a,h=o*i,c=r*a,l=r*i,e[0]=a*s,e[4]=l-t*n,e[8]=c*n+h,e[1]=n,e[5]=o*s,e[9]=-r*s,e[2]=-i*s,e[6]=h*n+c,e[10]=t-l*n):"XZY"===t.order&&(t=o*a,h=o*i,c=r*a,l=r*i,e[0]=a*s,e[4]=-n,e[8]=i*s,e[1]=t*n+l,e[5]=o*s,e[9]=h*n-c,e[2]=c*n-h,e[6]=r*s,e[10]=l*n+t);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,r=t.x,i=t.y,n=t.z,o=t.w,a=n+n;t=r*(c=r+r);var s=r*(l=i+i),r=r*a,h=i*l,i=i*a,n=n*a,c=o*c,l=o*l,o=o*a;return e[0]=1-(h+n),e[4]=s-o,e[8]=r+l,e[1]=s+o,e[5]=1-(t+n),e[9]=i-c,e[2]=r-l,e[6]=i+c,e[10]=1-(t+h),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var t,e,r;return function(i,n,o){void 0===t&&(t=new m.Vector3),void 0===e&&(e=new m.Vector3),void 0===r&&(r=new m.Vector3);var a=this.elements;return r.subVectors(i,n).normalize(),0===r.lengthSq()&&(r.z=1),t.crossVectors(o,r).normalize(),0===t.lengthSq()&&(r.x+=1e-4,t.crossVectors(o,r).normalize()),e.crossVectors(r,t),a[0]=t.x,a[4]=e.x,a[8]=r.x,a[1]=t.y,a[5]=e.y,a[9]=r.y,a[2]=t.z,a[6]=e.z,a[10]=r.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},multiplyMatrices:function(t,e){var r=t.elements,i=e.elements,n=this.elements,o=r[0],a=r[4],s=r[8],h=r[12],c=r[1],l=r[5],u=r[9],p=r[13],d=r[2],f=r[6],m=r[10],g=r[14],v=r[3],y=r[7],x=r[11],r=r[15],b=i[0],_=i[4],M=i[8],w=i[12],S=i[1],E=i[5],T=i[9],C=i[13],L=i[2],A=i[6],P=i[10],R=i[14],U=i[3],k=i[7],D=i[11],i=i[15];return n[0]=o*b+a*S+s*L+h*U,n[4]=o*_+a*E+s*A+h*k,n[8]=o*M+a*T+s*P+h*D,n[12]=o*w+a*C+s*R+h*i,n[1]=c*b+l*S+u*L+p*U,n[5]=c*_+l*E+u*A+p*k,n[9]=c*M+l*T+u*P+p*D,n[13]=c*w+l*C+u*R+p*i,n[2]=d*b+f*S+m*L+g*U,n[6]=d*_+f*E+m*A+g*k,n[10]=d*M+f*T+m*P+g*D,n[14]=d*w+f*C+m*R+g*i,n[3]=v*b+y*S+x*L+r*U,n[7]=v*_+y*E+x*A+r*k,n[11]=v*M+y*T+x*P+r*D,n[15]=v*w+y*C+x*R+r*i,this},multiplyToArray:function(t,e,r){var i=this.elements;return this.multiplyMatrices(t,e),r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[8]=i[8],r[9]=i[9],r[10]=i[10],r[11]=i[11],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15],this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToVector3Array:function(){var t;return function(e,r,i){void 0===t&&(t=new m.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length);for(var n=0;n<i;n+=3,r+=3)t.fromArray(e,r),t.applyMatrix4(this),t.toArray(e,r);return e}}(),applyToBuffer:function(){var t;return function(e,r,i){void 0===t&&(t=new m.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length/e.itemSize);for(var n=0;n<i;n++,r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.applyMatrix4(this),e.setXYZ(t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],r=t[4],i=t[8],n=t[12],o=t[1],a=t[5],s=t[9],h=t[13],c=t[2],l=t[6],u=t[10],p=t[14];return t[3]*(+n*s*l-i*h*l-n*a*u+r*h*u+i*a*p-r*s*p)+t[7]*(+e*s*p-e*h*u+n*o*u-i*o*p+i*h*c-n*s*c)+t[11]*(+e*h*l-e*a*p-n*o*l+r*o*p+n*a*c-r*h*c)+t[15]*(-i*a*c-e*s*l+e*a*u+i*o*l-r*o*u+r*s*c)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},flattenToArrayOffset:function(t,e){var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t},getPosition:function(){var t;return function(){void 0===t&&(t=new m.Vector3),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var e=this.elements;return t.set(e[12],e[13],e[14])}}(),setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var r=this.elements,i=(y=t.elements)[0],n=y[4],o=y[8],a=y[12],s=y[1],h=y[5],c=y[9],l=y[13],u=y[2],p=y[6],d=y[10],f=y[14],m=y[3],g=y[7],v=y[11],y=y[15];if(r[0]=c*f*g-l*d*g+l*p*v-h*f*v-c*p*y+h*d*y,r[4]=a*d*g-o*f*g-a*p*v+n*f*v+o*p*y-n*d*y,r[8]=o*l*g-a*c*g+a*h*v-n*l*v-o*h*y+n*c*y,r[12]=a*c*p-o*l*p-a*h*d+n*l*d+o*h*f-n*c*f,r[1]=l*d*m-c*f*m-l*u*v+s*f*v+c*u*y-s*d*y,r[5]=o*f*m-a*d*m+a*u*v-i*f*v-o*u*y+i*d*y,r[9]=a*c*m-o*l*m-a*s*v+i*l*v+o*s*y-i*c*y,r[13]=o*l*u-a*c*u+a*s*d-i*l*d-o*s*f+i*c*f,r[2]=h*f*m-l*p*m+l*u*g-s*f*g-h*u*y+s*p*y,r[6]=a*p*m-n*f*m-a*u*g+i*f*g+n*u*y-i*p*y,r[10]=n*l*m-a*h*m+a*s*g-i*l*g-n*s*y+i*h*y,r[14]=a*h*u-n*l*u-a*s*p+i*l*p+n*s*f-i*h*f,r[3]=c*p*m-h*d*m-c*u*g+s*d*g+h*u*v-s*p*v,r[7]=n*d*m-o*p*m+o*u*g-i*d*g-n*u*v+i*p*v,r[11]=o*h*m-n*c*m-o*s*g+i*c*g+n*s*v-i*h*v,r[15]=n*c*u-o*h*u+o*s*p-i*c*p-n*s*d+i*h*d,0==(r=i*r[0]+s*r[4]+u*r[8]+m*r[12])){if(e)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");return console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/r),this},scale:function(t){var e=this.elements,r=t.x,i=t.y;return t=t.z,e[0]*=r,e[4]*=i,e[8]*=t,e[1]*=r,e[5]*=i,e[9]*=t,e[2]*=r,e[6]*=i,e[10]*=t,e[3]*=r,e[7]*=i,e[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements;return Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1]+t[2]*t[2],t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10]))},makeTranslation:function(t,e,r){return this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(1,0,0,0,0,e,-t,0,0,t,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(e,0,t,0,0,1,0,0,-t,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(e,-t,0,0,t,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var r=Math.cos(e),i=Math.sin(e),n=1-r,o=t.x,a=t.y,s=t.z,h=n*o,c=n*a;return this.set(h*o+r,h*a-i*s,h*s+i*a,0,h*a+i*s,c*a+r,c*s-i*o,0,h*s-i*a,c*s+i*o,n*s*s+r,0,0,0,0,1),this},makeScale:function(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this},compose:function(t,e,r){return this.makeRotationFromQuaternion(e),this.scale(r),this.setPosition(t),this},decompose:function(){var t,e;return function(r,i,n){void 0===t&&(t=new m.Vector3),void 0===e&&(e=new m.Matrix4);var o=this.elements,a=t.set(o[0],o[1],o[2]).length(),s=t.set(o[4],o[5],o[6]).length(),h=t.set(o[8],o[9],o[10]).length();0>this.determinant()&&(a=-a),r.x=o[12],r.y=o[13],r.z=o[14],e.elements.set(this.elements),r=1/a;var o=1/s,c=1/h;return e.elements[0]*=r,e.elements[1]*=r,e.elements[2]*=r,e.elements[4]*=o,e.elements[5]*=o,e.elements[6]*=o,e.elements[8]*=c,e.elements[9]*=c,e.elements[10]*=c,i.setFromRotationMatrix(e),n.x=a,n.y=s,n.z=h,this}}(),makeFrustum:function(t,e,r,i,n,o){var a=this.elements;return a[0]=2*n/(e-t),a[4]=0,a[8]=(e+t)/(e-t),a[12]=0,a[1]=0,a[5]=2*n/(i-r),a[9]=(i+r)/(i-r),a[13]=0,a[2]=0,a[6]=0,a[10]=-(o+n)/(o-n),a[14]=-2*o*n/(o-n),a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(t,e,r,i){var n=-(t=r*Math.tan(m.Math.degToRad(.5*t)));return this.makeFrustum(n*e,t*e,n,t,r,i)},makeOrthographic:function(t,e,r,i,n,o){var a=this.elements,s=e-t,h=r-i,c=o-n;return a[0]=2/s,a[4]=0,a[8]=0,a[12]=-(e+t)/s,a[1]=0,a[5]=2/h,a[9]=0,a[13]=-(r+i)/h,a[2]=0,a[6]=0,a[10]=-2/c,a[14]=-(o+n)/c,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){var e=this.elements;t=t.elements;for(var r=0;16>r;r++)if(e[r]!==t[r])return!1;return!0},fromArray:function(t){return this.elements.set(t),this},toArray:function(){var t=this.elements;return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}},m.Ray=function(t,e){this.origin=void 0!==t?t:new m.Vector3,this.direction=void 0!==e?e:new m.Vector3},m.Ray.prototype={constructor:m.Ray,set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return(e||new m.Vector3).copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){this.direction.copy(t).sub(this.origin).normalize()},recast:function(){var t=new m.Vector3;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){var r=e||new m.Vector3;r.subVectors(t,this.origin);var i=r.dot(this.direction);return 0>i?r.copy(this.origin):r.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new m.Vector3;return function(e){var r=t.subVectors(e,this.origin).dot(this.direction);return 0>r?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(r).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new m.Vector3,e=new m.Vector3,r=new m.Vector3;return function(i,n,o,a){t.copy(i).add(n).multiplyScalar(.5),e.copy(n).sub(i).normalize(),r.copy(this.origin).sub(t);var s,h=.5*i.distanceTo(n),c=-this.direction.dot(e),l=r.dot(this.direction),u=-r.dot(e),p=r.lengthSq(),d=Math.abs(1-c*c);return 0<d?(i=c*u-l,n=c*l-u,s=h*d,0<=i?n>=-s?n<=s?(h=1/d,i*=h,n*=h,c=i*(i+c*n+2*l)+n*(c*i+n+2*u)+p):(n=h,i=Math.max(0,-(c*n+l)),c=-i*i+n*(n+2*u)+p):(n=-h,i=Math.max(0,-(c*n+l)),c=-i*i+n*(n+2*u)+p):n<=-s?(i=Math.max(0,-(-c*h+l)),n=0<i?-h:Math.min(Math.max(-h,-u),h),c=-i*i+n*(n+2*u)+p):n<=s?(i=0,n=Math.min(Math.max(-h,-u),h),c=n*(n+2*u)+p):(i=Math.max(0,-(c*h+l)),n=0<i?h:Math.min(Math.max(-h,-u),h),c=-i*i+n*(n+2*u)+p)):(n=0<c?-h:h,i=Math.max(0,-(c*n+l)),c=-i*i+n*(n+2*u)+p),o&&o.copy(this.direction).multiplyScalar(i).add(this.origin),a&&a.copy(e).multiplyScalar(n).add(t),c}}(),intersectSphere:function(){var t=new m.Vector3;return function(e,r){t.subVectors(e.center,this.origin);var i=t.dot(this.direction),n=t.dot(t)-i*i,o=e.radius*e.radius;return n>o?null:(o=Math.sqrt(o-n),n=i-o,i+=o,0>n&&0>i?null:0>n?this.at(i,r):this.at(n,r))}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);return 0===e?0===t.distanceToPoint(this.origin)?0:null:(t=-(this.origin.dot(t.normal)+t.constant)/e,0<=t?t:null)},intersectPlane:function(t,e){var r=this.distanceToPlane(t);return null===r?null:this.at(r,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||0>t.normal.dot(this.direction)*e},intersectBox:function(t,e){var r,i,n,o,a;i=1/this.direction.x,o=1/this.direction.y,a=1/this.direction.z;var s=this.origin;return 0<=i?(r=(t.min.x-s.x)*i,i*=t.max.x-s.x):(r=(t.max.x-s.x)*i,i*=t.min.x-s.x),0<=o?(n=(t.min.y-s.y)*o,o*=t.max.y-s.y):(n=(t.max.y-s.y)*o,o*=t.min.y-s.y),r>o||n>i?null:((n>r||r!==r)&&(r=n),(o<i||i!==i)&&(i=o),0<=a?(n=(t.min.z-s.z)*a,a*=t.max.z-s.z):(n=(t.max.z-s.z)*a,a*=t.min.z-s.z),r>a||n>i?null:((n>r||r!==r)&&(r=n),(a<i||i!==i)&&(i=a),0>i?null:this.at(0<=r?r:i,e)))},intersectsBox:function(){var t=new m.Vector3;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new m.Vector3,e=new m.Vector3,r=new m.Vector3,i=new m.Vector3;return function(n,o,a,s,h){if(e.subVectors(o,n),r.subVectors(a,n),i.crossVectors(e,r),0<(o=this.direction.dot(i))){if(s)return null;s=1}else{if(!(0>o))return null;s=-1,o=-o}return t.subVectors(this.origin,n),0>(n=s*this.direction.dot(r.crossVectors(t,r)))?null:0>(a=s*this.direction.dot(e.cross(t)))||n+a>o?null:(n=-s*t.dot(i),0>n?null:this.at(n/o,h))}}(),applyMatrix4:function(t){return this.direction.add(this.origin).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},m.Sphere=function(t,e){this.center=void 0!==t?t:new m.Vector3,this.radius=void 0!==e?e:0},m.Sphere.prototype={constructor:m.Sphere,set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new m.Box3;return function(e,r){var i=this.center;void 0!==r?i.copy(r):t.setFromPoints(e).center(i);for(var n=0,o=0,a=e.length;o<a;o++)n=Math.max(n,i.distanceToSquared(e[o]));return this.radius=Math.sqrt(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return 0>=this.radius},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(this.center.dot(t.normal)-t.constant)<=this.radius},clampPoint:function(t,e){var r=this.center.distanceToSquared(t),i=e||new m.Vector3;return i.copy(t),r>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(t){return(t=t||new m.Box3).set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius*=t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},m.Frustum=function(t,e,r,i,n,o){this.planes=[void 0!==t?t:new m.Plane,void 0!==e?e:new m.Plane,void 0!==r?r:new m.Plane,void 0!==i?i:new m.Plane,void 0!==n?n:new m.Plane,void 0!==o?o:new m.Plane]},m.Frustum.prototype={constructor:m.Frustum,set:function(t,e,r,i,n,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(r),a[3].copy(i),a[4].copy(n),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,r=0;6>r;r++)e[r].copy(t.planes[r]);return this},setFromMatrix:function(t){var e=this.planes;t=(g=t.elements)[0];var r=g[1],i=g[2],n=g[3],o=g[4],a=g[5],s=g[6],h=g[7],c=g[8],l=g[9],u=g[10],p=g[11],d=g[12],f=g[13],m=g[14],g=g[15];return e[0].setComponents(n-t,h-o,p-c,g-d).normalize(),e[1].setComponents(n+t,h+o,p+c,g+d).normalize(),e[2].setComponents(n+r,h+a,p+l,g+f).normalize(),e[3].setComponents(n-r,h-a,p-l,g-f).normalize(),e[4].setComponents(n-i,h-s,p-u,g-m).normalize(),e[5].setComponents(n+i,h+s,p+u,g+m).normalize(),this},intersectsObject:function(){var t=new m.Sphere;return function(e){var r=e.geometry;return null===r.boundingSphere&&r.computeBoundingSphere(),t.copy(r.boundingSphere),t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){var e=this.planes,r=t.center;t=-t.radius;for(var i=0;6>i;i++)if(e[i].distanceToPoint(r)<t)return!1;return!0},intersectsBox:function(){var t=new m.Vector3,e=new m.Vector3;return function(r){for(var i=this.planes,n=0;6>n;n++){a=i[n],t.x=0<a.normal.x?r.min.x:r.max.x,e.x=0<a.normal.x?r.max.x:r.min.x,t.y=0<a.normal.y?r.min.y:r.max.y,e.y=0<a.normal.y?r.max.y:r.min.y,t.z=0<a.normal.z?r.min.z:r.max.z,e.z=0<a.normal.z?r.max.z:r.min.z;var o=a.distanceToPoint(t),a=a.distanceToPoint(e);if(0>o&&0>a)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,r=0;6>r;r++)if(0>e[r].distanceToPoint(t))return!1;return!0}},m.Plane=function(t,e){this.normal=void 0!==t?t:new m.Vector3(1,0,0),this.constant=void 0!==e?e:0},m.Plane.prototype={constructor:m.Plane,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,r,i){return this.normal.set(t,e,r),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new m.Vector3,e=new m.Vector3;return function(r,i,n){return i=t.subVectors(n,i).cross(e.subVectors(r,i)).normalize(),this.setFromNormalAndCoplanarPoint(i,r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var r=this.distanceToPoint(t);return(e||new m.Vector3).copy(this.normal).multiplyScalar(r)},intersectLine:function(){var t=new m.Vector3;return function(e,r){var i=r||new m.Vector3,n=e.delta(t),o=this.normal.dot(n);return 0!==o?(o=-(e.start.dot(this.normal)+this.constant)/o,0>o||1<o?void 0:i.copy(n).multiplyScalar(o).add(e.start)):0===this.distanceToPoint(e.start)?i.copy(e.start):void 0}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start);return t=this.distanceToPoint(t.end),0>e&&0<t||0>t&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return(t||new m.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new m.Vector3,e=new m.Vector3,r=new m.Matrix3;return function(i,n){var o=n||r.getNormalMatrix(i),o=t.copy(this.normal).applyMatrix3(o),a=this.coplanarPoint(e);return a.applyMatrix4(i),this.setFromNormalAndCoplanarPoint(o,a),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},m.Math={generateUUID:function(){var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=Array(36),i=0;return function(){for(var n=0;36>n;n++)8===n||13===n||18===n||23===n?r[n]="-":14===n?r[n]="4":(2>=i&&(i=33554432+16777216*Math.random()|0),t=15&i,i>>=4,r[n]=e[19===n?3&t|8:t]);return r.join("")}}(),clamp:function(t,e,r){return Math.max(e,Math.min(r,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,r,i,n){return i+(t-e)*(n-i)/(r-e)},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},random16:function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(){var t=Math.PI/180;return function(e){return e*t}}(),radToDeg:function(){var t=180/Math.PI;return function(e){return e*t}}(),isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}},m.Spline=function(t){function e(t,e,r,i,n,o,a){return t=.5*(r-t),i=.5*(i-e),(2*(e-r)+t+i)*a+(-3*(e-r)-2*t-i)*o+t*n+e}this.points=t;var r,i,n,o,a,s,h,c,l,u=[],p={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;e<t.length;e++)this.points[e]={x:t[e][0],y:t[e][1],z:t[e][2]}},this.getPoint=function(t){return r=(this.points.length-1)*t,i=Math.floor(r),n=r-i,u[0]=0===i?i:i-1,u[1]=i,u[2]=i>this.points.length-2?this.points.length-1:i+1,u[3]=i>this.points.length-3?this.points.length-1:i+2,s=this.points[u[0]],h=this.points[u[1]],c=this.points[u[2]],l=this.points[u[3]],o=n*n,a=n*o,p.x=e(s.x,h.x,c.x,l.x,n,o,a),p.y=e(s.y,h.y,c.y,l.y,n,o,a),p.z=e(s.z,h.z,c.z,l.z,n,o,a),p},this.getControlPointsArray=function(){var t,e,r=this.points.length,i=[];for(t=0;t<r;t++)e=this.points[t],i[t]=[e.x,e.y,e.z];return i},this.getLength=function(t){var e,r,i,n=e=e=0,o=new m.Vector3,a=new m.Vector3,s=[],h=0;for(s[0]=0,t||(t=100),r=this.points.length*t,o.copy(this.points[0]),t=1;t<r;t++)e=t/r,i=this.getPoint(e),a.copy(i),h+=a.distanceTo(o),o.copy(i),e*=this.points.length-1,(e=Math.floor(e))!==n&&(s[e]=h,n=e);return s[s.length]=h,{chunks:s,total:h}},this.reparametrizeByArcLength=function(t){var e,r,i,n,o,a,s=[],h=new m.Vector3,c=this.getLength();for(s.push(h.copy(this.points[0]).clone()),e=1;e<this.points.length;e++){for(r=c.chunks[e]-c.chunks[e-1],a=Math.ceil(t*r/c.total),n=(e-1)/(this.points.length-1),o=e/(this.points.length-1),r=1;r<a-1;r++)i=n+1/a*r*(o-n),i=this.getPoint(i),s.push(h.copy(i).clone());s.push(h.copy(this.points[e]).clone())}this.points=s}},m.Triangle=function(t,e,r){this.a=void 0!==t?t:new m.Vector3,this.b=void 0!==e?e:new m.Vector3,this.c=void 0!==r?r:new m.Vector3},m.Triangle.normal=function(){var t=new m.Vector3;return function(e,r,i,n){return(n=n||new m.Vector3).subVectors(i,r),t.subVectors(e,r),n.cross(t),e=n.lengthSq(),0<e?n.multiplyScalar(1/Math.sqrt(e)):n.set(0,0,0)}}(),m.Triangle.barycoordFromPoint=function(){var t=new m.Vector3,e=new m.Vector3,r=new m.Vector3;return function(i,n,o,a,s){t.subVectors(a,n),e.subVectors(o,n),r.subVectors(i,n),i=t.dot(t),n=t.dot(e),o=t.dot(r);var h=e.dot(e);a=e.dot(r);var c=i*h-n*n;return s=s||new m.Vector3,0===c?s.set(-2,-1,-1):(c=1/c,h=(h*o-n*a)*c,i=(i*a-n*o)*c,s.set(1-h-i,i,h))}}(),m.Triangle.containsPoint=function(){var t=new m.Vector3;return function(e,r,i,n){return 0<=(e=m.Triangle.barycoordFromPoint(e,r,i,n,t)).x&&0<=e.y&&1>=e.x+e.y}}(),m.Triangle.prototype={constructor:m.Triangle,set:function(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this},setFromPointsAndIndices:function(t,e,r,i){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new m.Vector3,e=new m.Vector3;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){return(t||new m.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return m.Triangle.normal(this.a,this.b,this.c,t)},plane:function(t){return(t||new m.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return m.Triangle.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return m.Triangle.containsPoint(t,this.a,this.b,this.c)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},m.Interpolant=function(t,e,r,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(r),this.sampleValues=e,this.valueSize=r},m.Interpolant.prototype={constructor:m.Interpolant,evaluate:function(t){var e=this.parameterPositions,r=this._cachedIndex,i=e[r],n=e[r-1];t:{e:{r:{i:if(!(t<i)){for(var o=r+2;;){if(void 0===i){if(t<n)break i;return this._cachedIndex=r=e.length,this.afterEnd_(r-1,t,n)}if(r===o)break;if(n=i,i=e[++r],t<i)break e}i=e.length;break r}if(t>=n)break t;for(t<(o=e[1])&&(r=2,n=o),o=r-2;;){if(void 0===n)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(r===o)break;if(i=n,n=e[--r-1],t>=n)break e}i=r,r=0}for(;r<i;)n=r+i>>>1,t<e[n]?i=n:r=n+1;if(i=e[r],void 0===(n=e[r-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return this._cachedIndex=r=e.length,this.afterEnd_(r-1,n,t)}this._cachedIndex=r,this.intervalChanged_(r,n,i)}return this.interpolate_(r,n,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){var e=this.resultBuffer,r=this.sampleValues,i=this.valueSize;t*=i;for(var n=0;n!==i;++n)e[n]=r[t+n];return e},interpolate_:function(t,e,r,i){throw Error("call to abstract method")},intervalChanged_:function(t,e,r){}},Object.assign(m.Interpolant.prototype,{beforeStart_:m.Interpolant.prototype.copySampleValue_,afterEnd_:m.Interpolant.prototype.copySampleValue_}),m.CubicInterpolant=function(t,e,r,i){m.Interpolant.call(this,t,e,r,i),this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0},m.CubicInterpolant.prototype=Object.assign(Object.create(m.Interpolant.prototype),{constructor:m.CubicInterpolant,DefaultSettings_:{endingStart:m.ZeroCurvatureEnding,endingEnd:m.ZeroCurvatureEnding},intervalChanged_:function(t,e,r){var i=this.parameterPositions,n=t-2,o=t+1,a=i[n],s=i[o];if(void 0===a)switch(this.getSettings_().endingStart){case m.ZeroSlopeEnding:n=t,a=2*e-r;break;case m.WrapAroundEnding:a=e+i[n=i.length-2]-i[n+1];break;default:n=t,a=r}if(void 0===s)switch(this.getSettings_().endingEnd){case m.ZeroSlopeEnding:o=t,s=2*r-e;break;case m.WrapAroundEnding:o=1,s=r+i[1]-i[0];break;default:o=t-1,s=e}t=.5*(r-e),i=this.valueSize,this._weightPrev=t/(e-a),this._weightNext=t/(s-r),this._offsetPrev=n*i,this._offsetNext=o*i},interpolate_:function(t,e,r,i){var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(t*=a)-a,h=this._offsetPrev,c=this._offsetNext,l=this._weightPrev,u=this._weightNext,p=(r-e)/(i-e);for(e=-l*(i=(r=p*p)*p)+2*l*r-l*p,l=(1+l)*i+(-1.5-2*l)*r+(-.5+l)*p+1,p=(-1-u)*i+(1.5+u)*r+.5*p,u=u*i-u*r,r=0;r!==a;++r)n[r]=e*o[h+r]+l*o[s+r]+p*o[t+r]+u*o[c+r];return n}}),m.DiscreteInterpolant=function(t,e,r,i){m.Interpolant.call(this,t,e,r,i)},m.DiscreteInterpolant.prototype=Object.assign(Object.create(m.Interpolant.prototype),{constructor:m.DiscreteInterpolant,interpolate_:function(t,e,r,i){return this.copySampleValue_(t-1)}}),m.LinearInterpolant=function(t,e,r,i){m.Interpolant.call(this,t,e,r,i)},m.LinearInterpolant.prototype=Object.assign(Object.create(m.Interpolant.prototype),{constructor:m.LinearInterpolant,interpolate_:function(t,e,r,i){var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(t*=a)-a;for(r=1-(e=(r-e)/(i-e)),i=0;i!==a;++i)n[i]=o[s+i]*r+o[t+i]*e;return n}}),m.QuaternionLinearInterpolant=function(t,e,r,i){m.Interpolant.call(this,t,e,r,i)},m.QuaternionLinearInterpolant.prototype=Object.assign(Object.create(m.Interpolant.prototype),{constructor:m.QuaternionLinearInterpolant,interpolate_:function(t,e,r,i){var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize;for(e=(r-e)/(i-e),r=(t*=a)+a;t!==r;t+=4)m.Quaternion.slerpFlat(n,0,o,t-a,o,t,e);return n}}),m.Clock=function(t){this.autoStart=void 0===t||t,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1},m.Clock.prototype={constructor:m.Clock,start:function(){this.oldTime=this.startTime=performance.now(),this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){if(e=0,this.autoStart&&!this.running&&this.start(),this.running){var t=performance.now(),e=.001*(t-this.oldTime);this.oldTime=t,this.elapsedTime+=e}return e}},m.EventDispatcher=function(){},m.EventDispatcher.prototype={constructor:m.EventDispatcher,apply:function(t){t.addEventListener=m.EventDispatcher.prototype.addEventListener,t.hasEventListener=m.EventDispatcher.prototype.hasEventListener,t.removeEventListener=m.EventDispatcher.prototype.removeEventListener,t.dispatchEvent=m.EventDispatcher.prototype.dispatchEvent},addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[t]&&(r[t]=[]),-1===r[t].indexOf(e)&&r[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[t]&&-1!==r[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var r=this._listeners[t];if(void 0!==r){var i=r.indexOf(e);-1!==i&&r.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var r=[],i=e.length,n=0;n<i;n++)r[n]=e[n];for(n=0;n<i;n++)r[n].call(this,t)}}}},m.Layers=function(){this.mask=1},m.Layers.prototype={constructor:m.Layers,set:function(t){this.mask=1<<t},enable:function(t){this.mask|=1<<t},toggle:function(t){this.mask^=1<<t},disable:function(t){this.mask&=~(1<<t)},test:function(t){return 0!=(this.mask&t.mask)}},function(t){function e(t,e){return t.distance-e.distance}function r(t,e,i,n){if(!1!==t.visible&&(t.raycast(e,i),!0===n)){n=0;for(var o=(t=t.children).length;n<o;n++)r(t[n],e,i,!0)}}t.Raycaster=function(e,r,i,n){this.ray=new t.Ray(e,r),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})},t.Raycaster.prototype={constructor:t.Raycaster,linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(e,r){r instanceof t.PerspectiveCamera?(this.ray.origin.setFromMatrixPosition(r.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(r).sub(this.ray.origin).normalize()):r instanceof t.OrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(r),this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,i){var n=[];return r(t,this,n,i),n.sort(e),n},intersectObjects:function(t,i){var n=[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var o=0,a=t.length;o<a;o++)r(t[o],this,n,i);return n.sort(e),n}}}(m),m.Object3D=function(){Object.defineProperty(this,"id",{value:m.Object3DIdCount++}),this.uuid=m.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=m.Object3D.DefaultUp.clone();var t=new m.Vector3,e=new m.Euler,r=new m.Quaternion,i=new m.Vector3(1,1,1);e.onChange(function(){r.setFromEuler(e,!1)}),r.onChange(function(){e.setFromQuaternion(r,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:t},rotation:{enumerable:!0,value:e},quaternion:{enumerable:!0,value:r},scale:{enumerable:!0,value:i},modelViewMatrix:{value:new m.Matrix4},normalMatrix:{value:new m.Matrix3}}),this.rotationAutoUpdate=!0,this.matrix=new m.Matrix4,this.matrixWorld=new m.Matrix4,this.matrixAutoUpdate=m.Object3D.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new m.Layers,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},m.Object3D.DefaultUp=new m.Vector3(0,1,0),m.Object3D.DefaultMatrixAutoUpdate=!0,m.Object3D.prototype={constructor:m.Object3D,applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new m.Quaternion;return function(e,r){return t.setFromAxisAngle(e,r),this.quaternion.multiply(t),this}}(),rotateX:function(){var t=new m.Vector3(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new m.Vector3(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new m.Vector3(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new m.Vector3;return function(e,r){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(r)),this}}(),translateX:function(){var t=new m.Vector3(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new m.Vector3(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new m.Vector3(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new m.Matrix4;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new m.Matrix4;return function(e){t.lookAt(e,this.position,this.up),this.quaternion.setFromRotationMatrix(t)}}(),add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t instanceof m.Object3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(1<arguments.length)for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);-1!==(e=this.children.indexOf(t))&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(e,1))},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var r=0,i=this.children.length;r<i;r++){var n=this.children[r].getObjectByProperty(t,e);if(void 0!==n)return n}},getWorldPosition:function(t){return t=t||new m.Vector3,this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new m.Vector3,e=new m.Vector3;return function(r){return r=r||new m.Quaternion,this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,r,e),r}}(),getWorldRotation:function(){var t=new m.Quaternion;return function(e){return e=e||new m.Euler,this.getWorldQuaternion(t),e.setFromQuaternion(t,this.rotation.order,!1)}}(),getWorldScale:function(){var t=new m.Vector3,e=new m.Quaternion;return function(r){return r=r||new m.Vector3,this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,r),r}}(),getWorldDirection:function(){var t=new m.Quaternion;return function(e){return e=e||new m.Vector3,this.getWorldQuaternion(t),e.set(0,0,1).applyQuaternion(t)}}(),raycast:function(){},traverse:function(t){t(this);for(var e=this.children,r=0,i=e.length;r<i;r++)e[r].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,r=0,i=e.length;r<i;r++)e[r].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==t||(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=0,r=this.children.length;e<r;e++)this.children[e].updateMatrixWorld(t)},toJSON:function(t){function e(t){var e,r=[];for(e in t){var i=t[e];delete i.metadata,r.push(i)}return r}var r={};(n=void 0===t)&&(t={geometries:{},materials:{},textures:{},images:{}},r.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var i={};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),i.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===t.geometries[this.geometry.uuid]&&(t.geometries[this.geometry.uuid]=this.geometry.toJSON(t)),i.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===t.materials[this.material.uuid]&&(t.materials[this.material.uuid]=this.material.toJSON(t)),i.material=this.material.uuid),0<this.children.length)for(i.children=[],o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(t).object);if(n){var n=e(t.geometries),o=e(t.materials),a=e(t.textures);t=e(t.images),0<n.length&&(r.geometries=n),0<o.length&&(r.materials=o),0<a.length&&(r.textures=a),0<t.length&&(r.images=t)}return r.object=i,r},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.rotationAutoUpdate=t.rotationAutoUpdate,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var r=0;r<t.children.length;r++)this.add(t.children[r].clone());return this}},m.EventDispatcher.prototype.apply(m.Object3D.prototype),m.Object3DIdCount=0,m.Face3=function(t,e,r,i,n,o){this.a=t,this.b=e,this.c=r,this.normal=i instanceof m.Vector3?i:new m.Vector3,this.vertexNormals=Array.isArray(i)?i:[],this.color=n instanceof m.Color?n:new m.Color,this.vertexColors=Array.isArray(n)?n:[],this.materialIndex=void 0!==o?o:0},m.Face3.prototype={constructor:m.Face3,clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,r=t.vertexNormals.length;e<r;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,r=t.vertexColors.length;e<r;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}},m.BufferAttribute=function(t,e){this.uuid=m.Math.generateUUID(),this.array=t,this.itemSize=e,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0},m.BufferAttribute.prototype={constructor:m.BufferAttribute,get count(){return this.array.length/this.itemSize},set needsUpdate(t){!0===t&&this.version++},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.itemSize,r*=e.itemSize;for(var i=0,n=this.itemSize;i<n;i++)this.array[t+i]=e.array[r+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new m.Color),e[r++]=o.r,e[r++]=o.g,e[r++]=o.b}return this},copyIndicesArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];e[r++]=o.a,e[r++]=o.b,e[r++]=o.c}return this},copyVector2sArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new m.Vector2),e[r++]=o.x,e[r++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new m.Vector3),e[r++]=o.x,e[r++]=o.y,e[r++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new m.Vector4),e[r++]=o.x,e[r++]=o.y,e[r++]=o.z,e[r++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this},setXYZ:function(t,e,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this},setXYZW:function(t,e,r,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this.array[t+3]=n,this},clone:function(){return(new this.constructor).copy(this)}},m.Int8Attribute=function(t,e){return new m.BufferAttribute(new Int8Array(t),e)},m.Uint8Attribute=function(t,e){return new m.BufferAttribute(new Uint8Array(t),e)},m.Uint8ClampedAttribute=function(t,e){return new m.BufferAttribute(new Uint8ClampedArray(t),e)},m.Int16Attribute=function(t,e){return new m.BufferAttribute(new Int16Array(t),e)},m.Uint16Attribute=function(t,e){return new m.BufferAttribute(new Uint16Array(t),e)},m.Int32Attribute=function(t,e){return new m.BufferAttribute(new Int32Array(t),e)},m.Uint32Attribute=function(t,e){return new m.BufferAttribute(new Uint32Array(t),e)},m.Float32Attribute=function(t,e){return new m.BufferAttribute(new Float32Array(t),e)},m.Float64Attribute=function(t,e){return new m.BufferAttribute(new Float64Array(t),e)},m.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new m.BufferAttribute(t,e).setDynamic(!0)},m.InstancedBufferAttribute=function(t,e,r){m.BufferAttribute.call(this,t,e),this.meshPerAttribute=r||1},m.InstancedBufferAttribute.prototype=Object.create(m.BufferAttribute.prototype),m.InstancedBufferAttribute.prototype.constructor=m.InstancedBufferAttribute,m.InstancedBufferAttribute.prototype.copy=function(t){return m.BufferAttribute.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},m.InterleavedBuffer=function(t,e){this.uuid=m.Math.generateUUID(),this.array=t,this.stride=e,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0},m.InterleavedBuffer.prototype={constructor:m.InterleavedBuffer,get length(){return this.array.length},get count(){return this.array.length/this.stride},set needsUpdate(t){!0===t&&this.version++},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.stride,r*=e.stride;for(var i=0,n=this.stride;i<n;i++)this.array[t+i]=e.array[r+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)}},m.InstancedInterleavedBuffer=function(t,e,r){m.InterleavedBuffer.call(this,t,e),this.meshPerAttribute=r||1},m.InstancedInterleavedBuffer.prototype=Object.create(m.InterleavedBuffer.prototype),m.InstancedInterleavedBuffer.prototype.constructor=m.InstancedInterleavedBuffer,m.InstancedInterleavedBuffer.prototype.copy=function(t){return m.InterleavedBuffer.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},m.InterleavedBufferAttribute=function(t,e,r){this.uuid=m.Math.generateUUID(),this.data=t,this.itemSize=e,this.offset=r},m.InterleavedBufferAttribute.prototype={constructor:m.InterleavedBufferAttribute,get length(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length},get count(){return this.data.count},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this},setXYZ:function(t,e,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this},setXYZW:function(t,e,r,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this.data.array[t+3]=n,this}},m.Geometry=function(){Object.defineProperty(this,"id",{value:m.GeometryIdCount++}),this.uuid=m.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1},m.Geometry.prototype={constructor:m.Geometry,applyMatrix:function(t){for(var e=(new m.Matrix3).getNormalMatrix(t),r=0,i=this.vertices.length;r<i;r++)this.vertices[r].applyMatrix4(t);for(r=0,i=this.faces.length;r<i;r++){(t=this.faces[r]).normal.applyMatrix3(e).normalize();for(var n=0,o=t.vertexNormals.length;n<o;n++)t.vertexNormals[n].applyMatrix3(e).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0},rotateX:function(){var t;return function(e){return void 0===t&&(t=new m.Matrix4),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new m.Matrix4),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new m.Matrix4),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,r,i){return void 0===t&&(t=new m.Matrix4),t.makeTranslation(e,r,i),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,r,i){return void 0===t&&(t=new m.Matrix4),t.makeScale(e,r,i),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new m.Object3D),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){function e(t,e,i){var n=void 0!==a?[l[t].clone(),l[e].clone(),l[i].clone()]:[],o=void 0!==s?[r.colors[t].clone(),r.colors[e].clone(),r.colors[i].clone()]:[],n=new m.Face3(t,e,i,n,o);r.faces.push(n),void 0!==h&&r.faceVertexUvs[0].push([u[t].clone(),u[e].clone(),u[i].clone()]),void 0!==c&&r.faceVertexUvs[1].push([p[t].clone(),p[e].clone(),p[i].clone()])}var r=this,i=null!==t.index?t.index.array:void 0,n=t.attributes,o=n.position.array,a=void 0!==n.normal?n.normal.array:void 0,s=void 0!==n.color?n.color.array:void 0,h=void 0!==n.uv?n.uv.array:void 0,c=void 0!==n.uv2?n.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],p=[],d=n=0;n<o.length;n+=3,d+=2)r.vertices.push(new m.Vector3(o[n],o[n+1],o[n+2])),void 0!==a&&l.push(new m.Vector3(a[n],a[n+1],a[n+2])),void 0!==s&&r.colors.push(new m.Color(s[n],s[n+1],s[n+2])),void 0!==h&&u.push(new m.Vector2(h[d],h[d+1])),void 0!==c&&p.push(new m.Vector2(c[d],c[d+1]));if(void 0!==i)if(0<(o=t.groups).length)for(n=0;n<o.length;n++)for(var d=o[n],f=d.start,g=d.count,d=f,f=f+g;d<f;d+=3)e(i[d],i[d+1],i[d+2]);else for(n=0;n<i.length;n+=3)e(i[n],i[n+1],i[n+2]);else for(n=0;n<o.length/3;n+=3)e(n,n+1,n+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.translate(t.x,t.y,t.z),t},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=0===(e=this.boundingSphere.radius)?1:1/e,r=new m.Matrix4;return r.set(e,0,0,-e*t.x,0,e,0,-e*t.y,0,0,e,-e*t.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var t=new m.Vector3,e=new m.Vector3,r=0,i=this.faces.length;r<i;r++){var n=this.faces[r],o=this.vertices[n.a],a=this.vertices[n.b];t.subVectors(this.vertices[n.c],a),e.subVectors(o,a),t.cross(e),t.normalize(),n.normal.copy(t)}},computeVertexNormals:function(t){void 0===t&&(t=!0);var e,r,i;for(i=Array(this.vertices.length),e=0,r=this.vertices.length;e<r;e++)i[e]=new m.Vector3;if(t){var n,o,a,s=new m.Vector3,h=new m.Vector3;for(t=0,e=this.faces.length;t<e;t++)r=this.faces[t],n=this.vertices[r.a],o=this.vertices[r.b],a=this.vertices[r.c],s.subVectors(a,o),h.subVectors(n,o),s.cross(h),i[r.a].add(s),i[r.b].add(s),i[r.c].add(s)}else for(t=0,e=this.faces.length;t<e;t++)r=this.faces[t],i[r.a].add(r.normal),i[r.b].add(r.normal),i[r.c].add(r.normal);for(e=0,r=this.vertices.length;e<r;e++)i[e].normalize();for(t=0,e=this.faces.length;t<e;t++)r=this.faces[t],n=r.vertexNormals,3===n.length?(n[0].copy(i[r.a]),n[1].copy(i[r.b]),n[2].copy(i[r.c])):(n[0]=i[r.a].clone(),n[1]=i[r.b].clone(),n[2]=i[r.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,r,i,n;for(r=0,i=this.faces.length;r<i;r++)for(n=this.faces[r],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),t=0,e=n.vertexNormals.length;t<e;t++)n.__originalVertexNormals[t]?n.__originalVertexNormals[t].copy(n.vertexNormals[t]):n.__originalVertexNormals[t]=n.vertexNormals[t].clone();var o=new m.Geometry;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[],n=this.morphNormals[t].faceNormals;var a,s,h=this.morphNormals[t].vertexNormals;for(r=0,i=this.faces.length;r<i;r++)a=new m.Vector3,s={a:new m.Vector3,b:new m.Vector3,c:new m.Vector3},n.push(a),h.push(s)}for(h=this.morphNormals[t],o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),r=0,i=this.faces.length;r<i;r++)n=this.faces[r],a=h.faceNormals[r],s=h.vertexNormals[r],a.copy(n.normal),s.a.copy(n.vertexNormals[0]),s.b.copy(n.vertexNormals[1]),s.c.copy(n.vertexNormals[2])}for(r=0,i=this.faces.length;r<i;r++)n=this.faces[r],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){for(var t=0,e=this.vertices,r=0,i=e.length;r<i;r++)0<r&&(t+=e[r].distanceTo(e[r-1])),this.lineDistances[r]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new m.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new m.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,r){if(0==t instanceof m.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);else{var i,n=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,h=t.faces,c=this.faceVertexUvs[0];t=t.faceVertexUvs[0],void 0===r&&(r=0),void 0!==e&&(i=(new m.Matrix3).getNormalMatrix(e));for(var l=0,u=a.length;l<u;l++){var p=a[l].clone();void 0!==e&&p.applyMatrix4(e),o.push(p)}for(l=0,u=h.length;l<u;l++){var d,f=(a=h[l]).vertexNormals,g=a.vertexColors;for((p=new m.Face3(a.a+n,a.b+n,a.c+n)).normal.copy(a.normal),void 0!==i&&p.normal.applyMatrix3(i).normalize(),e=0,o=f.length;e<o;e++)d=f[e].clone(),void 0!==i&&d.applyMatrix3(i).normalize(),p.vertexNormals.push(d);for(p.color.copy(a.color),e=0,o=g.length;e<o;e++)d=g[e],p.vertexColors.push(d.clone());p.materialIndex=a.materialIndex+r,s.push(p)}for(l=0,u=t.length;l<u;l++)if(r=t[l],i=[],void 0!==r){for(e=0,o=r.length;e<o;e++)i.push(r[e].clone());c.push(i)}}},mergeMesh:function(t){0==t instanceof m.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t):(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix))},mergeVertices:function(){var t,e,r,i={},n=[],o=[],a=Math.pow(10,4);for(e=0,r=this.vertices.length;e<r;e++)t=this.vertices[e],t=Math.round(t.x*a)+"_"+Math.round(t.y*a)+"_"+Math.round(t.z*a),void 0===i[t]?(i[t]=e,n.push(this.vertices[e]),o[e]=n.length-1):o[e]=o[i[t]];for(i=[],e=0,r=this.faces.length;e<r;e++)for(a=this.faces[e],a.a=o[a.a],a.b=o[a.b],a.c=o[a.c],a=[a.a,a.b,a.c],t=0;3>t;t++)if(a[t]===a[(t+1)%3]){i.push(e);break}for(e=i.length-1;0<=e;e--)for(a=i[e],this.faces.splice(a,1),o=0,r=this.faceVertexUvs.length;o<r;o++)this.faceVertexUvs[o].splice(a,1);return e=this.vertices.length-n.length,this.vertices=n,e},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,r=0;r<e;r++)t[r]._id=r;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var i,n,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];for(o&&o.length===e&&(i=[]),a&&a.length===e&&(n=[]),r=0;r<e;r++){var s=t[r]._id;i&&i.push(o[s]),n&&n.push(a[s])}i&&(this.faceVertexUvs[0]=i),n&&(this.faceVertexUvs[1]=n)},toJSON:function(){function t(t,e,r){return r?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==c[e]?c[e]:(c[e]=h.length/3,h.push(t.x,t.y,t.z),c[e])}function r(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==u[e]?u[e]:(u[e]=l.length,l.push(t.getHex()),u[e])}function i(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]?d[e]:(d[e]=p.length/2,p.push(t.x,t.y),d[e])}var n={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),void 0!==this.parameters){var o,a=this.parameters;for(o in a)void 0!==a[o]&&(n[o]=a[o]);return n}for(a=[],o=0;o<this.vertices.length;o++)s=this.vertices[o],a.push(s.x,s.y,s.z);var s=[],h=[],c={},l=[],u={},p=[],d={};for(o=0;o<this.faces.length;o++){var f=this.faces[o],m=void 0!==this.faceVertexUvs[0][o],g=0<f.normal.length(),v=0<f.vertexNormals.length,y=1!==f.color.r||1!==f.color.g||1!==f.color.b,x=0<f.vertexColors.length,b=t(b=t(b=t(b=t(b=t(b=t(b=t(b=t(b=0,0,0),1,!0),2,!1),3,m),4,g),5,v),6,y),7,x);s.push(b),s.push(f.a,f.b,f.c),s.push(f.materialIndex),m&&(m=this.faceVertexUvs[0][o],s.push(i(m[0]),i(m[1]),i(m[2]))),g&&s.push(e(f.normal)),v&&(g=f.vertexNormals,s.push(e(g[0]),e(g[1]),e(g[2]))),y&&s.push(r(f.color)),x&&(f=f.vertexColors,s.push(r(f[0]),r(f[1]),r(f[2])))}return n.data={},n.data.vertices=a,n.data.normals=h,0<l.length&&(n.data.colors=l),0<p.length&&(n.data.uvs=[p]),n.data.faces=s,n},clone:function(){return(new m.Geometry).copy(this)},copy:function(t){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]];for(var e=t.vertices,r=0,i=e.length;r<i;r++)this.vertices.push(e[r].clone());for(r=0,i=(e=t.faces).length;r<i;r++)this.faces.push(e[r].clone());for(r=0,i=t.faceVertexUvs.length;r<i;r++){e=t.faceVertexUvs[r],void 0===this.faceVertexUvs[r]&&(this.faceVertexUvs[r]=[]);for(var n=0,o=e.length;n<o;n++){for(var a=e[n],s=[],h=0,c=a.length;h<c;h++)s.push(a[h].clone());this.faceVertexUvs[r].push(s)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},m.EventDispatcher.prototype.apply(m.Geometry.prototype),m.GeometryIdCount=0,m.DirectGeometry=function(){Object.defineProperty(this,"id",{value:m.GeometryIdCount++}),this.uuid=m.Math.generateUUID(),this.name="",this.type="DirectGeometry",this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1},m.DirectGeometry.prototype={constructor:m.DirectGeometry,computeBoundingBox:m.Geometry.prototype.computeBoundingBox,computeBoundingSphere:m.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},computeGroups:function(t){var e,r,i=[];t=t.faces;for(var n=0;n<t.length;n++){var o=t[n];o.materialIndex!==r&&(r=o.materialIndex,void 0!==e&&(e.count=3*n-e.start,i.push(e)),e={start:3*n,materialIndex:r})}void 0!==e&&(e.count=3*n-e.start,i.push(e)),this.groups=i},fromGeometry:function(t){var e,r=t.faces,i=t.vertices,n=t.faceVertexUvs,o=n[0]&&0<n[0].length,a=n[1]&&0<n[1].length,s=t.morphTargets,h=s.length;if(0<h){for(e=[],v=0;v<h;v++)e[v]=[];this.morphTargets.position=e}var c,l=t.morphNormals,u=l.length;if(0<u){for(c=[],v=0;v<u;v++)c[v]=[];this.morphTargets.normal=c}for(var p=t.skinIndices,d=t.skinWeights,f=p.length===i.length,g=d.length===i.length,v=0;v<r.length;v++){var y=r[v];this.vertices.push(i[y.a],i[y.b],i[y.c]);var x=y.vertexNormals;for(3===x.length?this.normals.push(x[0],x[1],x[2]):(x=y.normal,this.normals.push(x,x,x)),3===(x=y.vertexColors).length?this.colors.push(x[0],x[1],x[2]):(x=y.color,this.colors.push(x,x,x)),!0===o&&(x=n[0][v],void 0!==x?this.uvs.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",v),this.uvs.push(new m.Vector2,new m.Vector2,new m.Vector2))),!0===a&&(x=n[1][v],void 0!==x?this.uvs2.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",v),this.uvs2.push(new m.Vector2,new m.Vector2,new m.Vector2))),x=0;x<h;x++){var b=s[x].vertices;e[x].push(b[y.a],b[y.b],b[y.c])}for(x=0;x<u;x++)b=l[x].vertexNormals[v],c[x].push(b.a,b.b,b.c);f&&this.skinIndices.push(p[y.a],p[y.b],p[y.c]),g&&this.skinWeights.push(d[y.a],d[y.b],d[y.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},m.EventDispatcher.prototype.apply(m.DirectGeometry.prototype),m.BufferGeometry=function(){Object.defineProperty(this,"id",{value:m.GeometryIdCount++}),this.uuid=m.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingSphere=this.boundingBox=null,this.drawRange={start:0,count:1/0}},m.BufferGeometry.prototype={constructor:m.BufferGeometry,getIndex:function(){return this.index},setIndex:function(t){this.index=t},addAttribute:function(t,e,r){if(0==e instanceof m.BufferAttribute&&0==e instanceof m.InterleavedBufferAttribute)console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new m.BufferAttribute(e,r));else{if("index"!==t)return this.attributes[t]=e,this;console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e)}},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,r){this.groups.push({start:t,count:e,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToVector3Array(e.array),e.needsUpdate=!0),void 0!==(e=this.attributes.normal)&&((new m.Matrix3).getNormalMatrix(t).applyToVector3Array(e.array),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},rotateX:function(){var t;return function(e){return void 0===t&&(t=new m.Matrix4),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new m.Matrix4),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new m.Matrix4),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,r,i){return void 0===t&&(t=new m.Matrix4),t.makeTranslation(e,r,i),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,r,i){return void 0===t&&(t=new m.Matrix4),t.makeScale(e,r,i),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new m.Object3D),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t instanceof m.Points||t instanceof m.Line){t=new m.Float32Attribute(3*e.vertices.length,3);var r=new m.Float32Attribute(3*e.colors.length,3);this.addAttribute("position",t.copyVector3sArray(e.vertices)),this.addAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length&&(t=new m.Float32Attribute(e.lineDistances.length,1),this.addAttribute("lineDistance",t.copyArray(e.lineDistances))),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t instanceof m.Mesh&&e instanceof m.Geometry&&this.fromGeometry(e);return this},updateFromObject:function(t){var e=t.geometry;if(t instanceof m.Mesh){var r=e.__directGeometry;if(void 0===r)return this.fromGeometry(e);r.verticesNeedUpdate=e.verticesNeedUpdate,r.normalsNeedUpdate=e.normalsNeedUpdate,r.colorsNeedUpdate=e.colorsNeedUpdate,r.uvsNeedUpdate=e.uvsNeedUpdate,r.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=r}return!0===e.verticesNeedUpdate&&(void 0!==(r=this.attributes.position)&&(r.copyVector3sArray(e.vertices),r.needsUpdate=!0),e.verticesNeedUpdate=!1),!0===e.normalsNeedUpdate&&(void 0!==(r=this.attributes.normal)&&(r.copyVector3sArray(e.normals),r.needsUpdate=!0),e.normalsNeedUpdate=!1),!0===e.colorsNeedUpdate&&(void 0!==(r=this.attributes.color)&&(r.copyColorsArray(e.colors),r.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(void 0!==(r=this.attributes.uv)&&(r.copyVector2sArray(e.uvs),r.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(void 0!==(r=this.attributes.lineDistance)&&(r.copyArray(e.lineDistances),r.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new m.DirectGeometry).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){r=new Float32Array(3*t.vertices.length),this.addAttribute("position",new m.BufferAttribute(r,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(r=new Float32Array(3*t.normals.length),this.addAttribute("normal",new m.BufferAttribute(r,3).copyVector3sArray(t.normals))),0<t.colors.length&&(r=new Float32Array(3*t.colors.length),this.addAttribute("color",new m.BufferAttribute(r,3).copyColorsArray(t.colors))),0<t.uvs.length&&(r=new Float32Array(2*t.uvs.length),this.addAttribute("uv",new m.BufferAttribute(r,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(r=new Float32Array(2*t.uvs2.length),this.addAttribute("uv2",new m.BufferAttribute(r,2).copyVector2sArray(t.uvs2))),0<t.indices.length&&(r=new(65535<t.vertices.length?Uint32Array:Uint16Array)(3*t.indices.length),this.setIndex(new m.BufferAttribute(r,1).copyIndicesArray(t.indices))),this.groups=t.groups;for(var e in t.morphTargets){for(var r=[],i=t.morphTargets[e],n=0,o=i.length;n<o;n++){var a=i[n],s=new m.Float32Attribute(3*a.length,3);r.push(s.copyVector3sArray(a))}this.morphAttributes[e]=r}return 0<t.skinIndices.length&&(e=new m.Float32Attribute(4*t.skinIndices.length,4),this.addAttribute("skinIndex",e.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(e=new m.Float32Attribute(4*t.skinWeights.length,4),this.addAttribute("skinWeight",e.copyVector4sArray(t.skinWeights))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:(new m.Vector3,function(){null===this.boundingBox&&(this.boundingBox=new m.Box3);var t=this.attributes.position.array;t&&this.boundingBox.setFromArray(t),void 0!==t&&0!==t.length||(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}),computeBoundingSphere:function(){var t=new m.Box3,e=new m.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new m.Sphere);var r=this.attributes.position.array;if(r){var i=this.boundingSphere.center;t.setFromArray(r),t.center(i);for(var n=0,o=0,a=r.length;o<a;o+=3)e.fromArray(r,o),n=Math.max(n,i.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes,r=this.groups;if(e.position){var i=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new m.BufferAttribute(new Float32Array(i.length),3));else for(var n=e.normal.array,o=0,a=n.length;o<a;o++)n[o]=0;var s,h,c,n=e.normal.array,l=new m.Vector3,u=new m.Vector3,p=new m.Vector3,d=new m.Vector3,f=new m.Vector3;if(t){t=t.array,0===r.length&&this.addGroup(0,t.length);for(var g=0,v=r.length;g<v;++g)for(o=r[g],a=o.start,s=o.count,o=a,a+=s;o<a;o+=3)s=3*t[o+0],h=3*t[o+1],c=3*t[o+2],l.fromArray(i,s),u.fromArray(i,h),p.fromArray(i,c),d.subVectors(p,u),f.subVectors(l,u),d.cross(f),n[s]+=d.x,n[s+1]+=d.y,n[s+2]+=d.z,n[h]+=d.x,n[h+1]+=d.y,n[h+2]+=d.z,n[c]+=d.x,n[c+1]+=d.y,n[c+2]+=d.z}else for(o=0,a=i.length;o<a;o+=9)l.fromArray(i,o),u.fromArray(i,o+3),p.fromArray(i,o+6),d.subVectors(p,u),f.subVectors(l,u),d.cross(f),n[o]=d.x,n[o+1]=d.y,n[o+2]=d.z,n[o+3]=d.x,n[o+4]=d.y,n[o+5]=d.z,n[o+6]=d.x,n[o+7]=d.y,n[o+8]=d.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(0!=t instanceof m.BufferGeometry){void 0===e&&(e=0);var r,i=this.attributes;for(r in i)if(void 0!==t.attributes[r])for(var n=i[r].array,o=t.attributes[r],a=o.array,s=0,o=o.itemSize*e;s<a.length;s++,o++)n[o]=a[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t,e,r,i=this.attributes.normal.array,n=0,o=i.length;n<o;n+=3)t=i[n],e=i[n+1],r=i[n+2],t=1/Math.sqrt(t*t+e*e+r*r),i[n]*=t,i[n+1]*=t,i[n+2]*=t},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t,e=new m.BufferGeometry,r=this.index.array,i=this.attributes;for(t in i){for(var n=(o=i[t]).array,o=o.itemSize,a=new n.constructor(r.length*o),s=0,h=0,c=0,l=r.length;c<l;c++)for(var s=r[c]*o,u=0;u<o;u++)a[h++]=n[s++];e.addAttribute(t,new m.BufferAttribute(a,o))}return e},toJSON:function(){var t={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e,r=this.parameters;for(e in r)void 0!==r[e]&&(t[e]=r[e]);return t}t.data={attributes:{}};var i=this.index;null!==i&&(r=Array.prototype.slice.call(i.array),t.data.index={type:i.array.constructor.name,array:r}),i=this.attributes;for(e in i){var n=i[e],r=Array.prototype.slice.call(n.array);t.data.attributes[e]={itemSize:n.itemSize,type:n.array.constructor.name,array:r}}return 0<(e=this.groups).length&&(t.data.groups=JSON.parse(JSON.stringify(e))),null!==(e=this.boundingSphere)&&(t.data.boundingSphere={center:e.center.toArray(),radius:e.radius}),t},clone:function(){return(new m.BufferGeometry).copy(this)},copy:function(t){null!==(r=t.index)&&this.setIndex(r.clone());var e,r=t.attributes;for(e in r)this.addAttribute(e,r[e].clone());for(e=0,r=(t=t.groups).length;e<r;e++){var i=t[e];this.addGroup(i.start,i.count)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},m.EventDispatcher.prototype.apply(m.BufferGeometry.prototype),m.BufferGeometry.MaxIndex=65535,m.InstancedBufferGeometry=function(){m.BufferGeometry.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0},m.InstancedBufferGeometry.prototype=Object.create(m.BufferGeometry.prototype),m.InstancedBufferGeometry.prototype.constructor=m.InstancedBufferGeometry,m.InstancedBufferGeometry.prototype.addGroup=function(t,e,r){this.groups.push({start:t,count:e,instances:r})},m.InstancedBufferGeometry.prototype.copy=function(t){null!==(r=t.index)&&this.setIndex(r.clone());var e,r=t.attributes;for(e in r)this.addAttribute(e,r[e].clone());for(e=0,r=(t=t.groups).length;e<r;e++){var i=t[e];this.addGroup(i.start,i.count,i.instances)}return this},m.EventDispatcher.prototype.apply(m.InstancedBufferGeometry.prototype),m.Uniform=function(t,e){this.type=t,this.value=e,this.dynamic=!1},m.Uniform.prototype={constructor:m.Uniform,onUpdate:function(t){return this.dynamic=!0,this.onUpdateCallback=t,this}},m.AnimationClip=function(t,e,r){this.name=t||m.Math.generateUUID(),this.tracks=r,this.duration=void 0!==e?e:-1,0>this.duration&&this.resetDuration(),this.trim(),this.optimize()},m.AnimationClip.prototype={constructor:m.AnimationClip,resetDuration:function(){for(var t=0,e=0,r=this.tracks.length;e!==r;++e)var i=this.tracks[e],t=Math.max(t,i.times[i.times.length-1]);this.duration=t},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}},Object.assign(m.AnimationClip,{parse:function(t){for(var e=[],r=t.tracks,i=1/(t.fps||1),n=0,o=r.length;n!==o;++n)e.push(m.KeyframeTrack.parse(r[n]).scale(i));return new m.AnimationClip(t.name,t.duration,e)},toJSON:function(t){var e=[],r=t.tracks;t={name:t.name,duration:t.duration,tracks:e};for(var i=0,n=r.length;i!==n;++i)e.push(m.KeyframeTrack.toJSON(r[i]));return t},CreateFromMorphTargetSequence:function(t,e,r){for(var i=e.length,n=[],o=0;o<i;o++){h=[],(s=[]).push((o+i-1)%i,o,(o+1)%i),h.push(0,1,0);var a=m.AnimationUtils.getKeyframeOrder(s),s=m.AnimationUtils.sortedArray(s,1,a),h=m.AnimationUtils.sortedArray(h,1,a);0===s[0]&&(s.push(i),h.push(h[0])),n.push(new m.NumberKeyframeTrack(".morphTargetInfluences["+e[o].name+"]",s,h).scale(1/r))}return new m.AnimationClip(t,-1,n)},findByName:function(t,e){for(var r=0;r<t.length;r++)if(t[r].name===e)return t[r];return null},CreateClipsFromMorphTargetSequences:function(t,e){for(var r={},i=/^([\w-]*?)([\d]+)$/,n=0,o=t.length;n<o;n++){var a=t[n],s=a.name.match(i);if(s&&1<s.length){var h=s[1];(s=r[h])||(r[h]=s=[]),s.push(a)}}i=[];for(h in r)i.push(m.AnimationClip.CreateFromMorphTargetSequence(h,r[h],e));return i},parseAnimation:function(t,e,r){if(!t)return console.error("  no animation in JSONLoader data"),null;r=function(t,e,r,i,n){if(0!==r.length){var o=[],a=[];m.AnimationUtils.flattenJSON(r,o,a,i),0!==o.length&&n.push(new t(e,o,a))}};var i=[],n=t.name||"default",o=t.length||-1,a=t.fps||30;t=t.hierarchy||[];for(var s=0;s<t.length;s++){var h=t[s].keys;if(h&&0!=h.length)if(h[0].morphTargets){for(var o={},c=0;c<h.length;c++)if(h[c].morphTargets)for(d=0;d<h[c].morphTargets.length;d++)o[h[c].morphTargets[d]]=-1;for(var l in o){for(var u=[],p=[],d=0;d!==h[c].morphTargets.length;++d){var f=h[c];u.push(f.time),p.push(f.morphTarget===l?1:0)}i.push(new m.NumberKeyframeTrack(".morphTargetInfluence["+l+"]",u,p))}o=o.length*(a||1)}else c=".bones["+e[s].name+"]",r(m.VectorKeyframeTrack,c+".position",h,"pos",i),r(m.QuaternionKeyframeTrack,c+".quaternion",h,"rot",i),r(m.VectorKeyframeTrack,c+".scale",h,"scl",i)}return 0===i.length?null:new m.AnimationClip(n,o,i)}}),m.AnimationMixer=function(t){this._root=t,this._initMemoryManager(),this.time=this._accuIndex=0,this.timeScale=1},m.AnimationMixer.prototype={constructor:m.AnimationMixer,clipAction:function(t,e){var r,i=(e||this._root).uuid,n="string"==typeof t?t:t.name,o=t!==n?t:null,a=this._actionsByClip[n];if(void 0!==a){if(void 0!==(r=a.actionByRoot[i]))return r;if(r=a.knownActions[0],o=r._clip,t!==n&&t!==o)throw Error("Different clips with the same name detected!")}return null===o?null:(a=new m.AnimationMixer._Action(this,o,e),this._bindAction(a,r),this._addInactiveAction(a,n,i),a)},existingAction:function(t,e){var r=(e||this._root).uuid,i=this._actionsByClip["string"==typeof t?t:t.name];return void 0!==i?i.actionByRoot[r]||null:null},stopAllAction:function(){for(var t=this._actions,e=this._nActiveActions,r=this._bindings,i=this._nActiveBindings,n=this._nActiveBindings=this._nActiveActions=0;n!==e;++n)t[n].reset();for(n=0;n!==i;++n)r[n].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,r=this._nActiveActions,i=this.time+=t,n=Math.sign(t),o=this._accuIndex^=1,a=0;a!==r;++a){var s=e[a];s.enabled&&s._update(i,t,n,o)}for(t=this._bindings,e=this._nActiveBindings,a=0;a!==e;++a)t[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions;t=t.name;var r=this._actionsByClip,i=r[t];if(void 0!==i){for(var n=0,o=(i=i.knownActions).length;n!==o;++n){var a=i[n];this._deactivateAction(a);var s=a._cacheIndex,h=e[e.length-1];a._cacheIndex=null,a._byClipCacheIndex=null,h._cacheIndex=s,e[s]=h,e.pop(),this._removeInactiveBindingsForAction(a)}delete r[t]}},uncacheRoot:function(t){t=t.uuid;var e,r=this._actionsByClip;for(e in r){var i=r[e].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}if(void 0!==(e=this._bindingsByRootAndName[t]))for(var n in e)(t=e[n]).restoreOriginalState(),this._removeInactiveBinding(t)},uncacheAction:function(t,e){var r=this.existingAction(t,e);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}},m.EventDispatcher.prototype.apply(m.AnimationMixer.prototype),m.AnimationMixer._Action=function(t,e,r){this._mixer=t,this._clip=e,this._localRoot=r||null,e=(t=e.tracks).length,r=Array(e);for(var i={endingStart:m.ZeroCurvatureEnding,endingEnd:m.ZeroCurvatureEnding},n=0;n!==e;++n){var o=t[n].createInterpolant(null);r[n]=o,o.settings=i}this._interpolantSettings=i,this._interpolants=r,this._propertyBindings=Array(e),this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null,this.loop=m.LoopRepeat,this._loopCount=-1,this._startTime=null,this.time=0,this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0},m.AnimationMixer._Action.prototype={constructor:m.AnimationMixer._Action,play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,r){if(t.fadeOut(e),this.fadeIn(e),r){r=this._clip.duration;var i=t._clip.duration,n=r/i;t.warp(1,i/r,e),this.warp(n,1,e)}return this},crossFadeTo:function(t,e,r){return t.crossFadeFrom(this,e,r)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._currentTimeScale,0,t)},warp:function(t,e,r){var i=this._mixer,n=i.time,o=this._timeScaleInterpolant,a=this.timeScale;return null===o&&(this._timeScaleInterpolant=o=i._lendControlInterpolant()),i=o.parameterPositions,o=o.sampleValues,i[0]=n,i[1]=n+r,o[0]=t/a,o[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,r,i){if(null!==(n=this._startTime)){if(0>(e=(t-n)*r)||0===r)return;this._startTime=null,e*=r}if(e*=this._updateTimeScale(t),r=this._updateTime(e),0<(t=this._updateWeight(t))){e=this._interpolants;for(var n=this._propertyBindings,o=0,a=e.length;o!==a;++o)e[o].evaluate(r),n[o].accumulate(i,t)}},_updateWeight:function(t){if(e=0,this.enabled){var e=this.weight,r=this._weightInterpolant;if(null!==r){var i=r.evaluate(t)[0],e=e*i;t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e},_updateTimeScale:function(t){if(e=0,!this.paused){var e=this.timeScale,r=this._timeScaleInterpolant;null!==r&&(e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.pause=!0:this.timeScale=e))}return this._effectiveTimeScale=e},_updateTime:function(t){if(a=this.time+t,0===t)return a;var e=this._clip.duration,r=this.loop,i=this._loopCount,n=!1;switch(r){case m.LoopOnce:if(-1===i&&(this.loopCount=0,this._setEndings(!0,!0,!1)),a>=e)a=e;else{if(!(0>a))break;a=0}this.clampWhenFinished?this.pause=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:0>t?-1:1});break;case m.LoopPingPong:n=!0;case m.LoopRepeat:if(-1===i&&(0<t?(i=0,this._setEndings(!0,0===this.repetitions,n)):this._setEndings(0===this.repetitions,!0,n)),a>=e||0>a){var o=Math.floor(a/e),a=a-e*o,i=i+Math.abs(o),s=this.repetitions-i;if(0>s){this.clampWhenFinished?this.paused=!0:this.enabled=!1,a=0<t?e:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1});break}0===s?(t=0>t,this._setEndings(t,!t,n)):this._setEndings(!1,!1,n),this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}if(r===m.LoopPingPong&&1==(1&i))return this.time=a,e-a}return this.time=a},_setEndings:function(t,e,r){var i=this._interpolantSettings;r?(i.endingStart=m.ZeroSlopeEnding,i.endingEnd=m.ZeroSlopeEnding):(i.endingStart=t?this.zeroSlopeAtStart?m.ZeroSlopeEnding:m.ZeroCurvatureEnding:m.WrapAroundEnding,i.endingEnd=e?this.zeroSlopeAtEnd?m.ZeroSlopeEnding:m.ZeroCurvatureEnding:m.WrapAroundEnding)},_scheduleFading:function(t,e,r){var i=this._mixer,n=i.time,o=this._weightInterpolant;return null===o&&(this._weightInterpolant=o=i._lendControlInterpolant()),i=o.parameterPositions,o=o.sampleValues,i[0]=n,o[0]=e,i[1]=n+t,o[1]=r,this}},Object.assign(m.AnimationMixer.prototype,{_bindAction:function(t,e){var r=t._localRoot||this._root,i=t._clip.tracks,n=i.length,o=t._propertyBindings,a=t._interpolants,s=r.uuid,h=this._bindingsByRootAndName,c=h[s];for(void 0===c&&(c={},h[s]=c),h=0;h!==n;++h){var l=i[h],u=l.name,p=c[u];if(void 0===p){if(void 0!==(p=o[h])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,u));continue}++(p=new m.PropertyMixer(m.PropertyBinding.create(r,u,e&&e._propertyBindings[h].binding.parsedPath),l.ValueTypeName,l.getValueSize())).referenceCount,this._addInactiveBinding(p,s,u)}o[h]=p,a[h].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,r=t._clip.name,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}for(r=0,i=(e=t._propertyBindings).length;r!==i;++r){var n=e[r];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,r=0,i=e.length;r!==i;++r){var n=e[r];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){return null!==(t=t._cacheIndex)&&t<this._nActiveActions},_addInactiveAction:function(t,e,r){var i=this._actions,n=this._actionsByClip,o=n[e];void 0===o?(o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,n[e]=o):(e=o.knownActions,t._byClipCacheIndex=e.length,e.push(t)),t._cacheIndex=i.length,i.push(t),o.actionByRoot[r]=t},_removeInactiveAction:function(t){var e=this._actions,r=e[e.length-1],i=t._cacheIndex;r._cacheIndex=i,e[i]=r,e.pop(),t._cacheIndex=null;var r=t._clip.name,n=(i=this._actionsByClip)[r],o=n.knownActions,a=o[o.length-1],s=t._byClipCacheIndex;a._byClipCacheIndex=s,o[s]=a,o.pop(),t._byClipCacheIndex=null,delete n.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete i[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=0,r=(t=t._propertyBindings).length;e!==r;++e){var i=t[e];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,r=t._cacheIndex,i=this._nActiveActions++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_takeBackAction:function(t){var e=this._actions,r=t._cacheIndex,i=--this._nActiveActions,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_addInactiveBinding:function(t,e,r){var i=this._bindingsByRootAndName,n=i[e],o=this._bindings;void 0===n&&(n={},i[e]=n),n[r]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,r=(i=t.binding).rootNode.uuid,i=i.path,n=this._bindingsByRootAndName,o=n[r],a=e[e.length-1];t=t._cacheIndex,a._cacheIndex=t,e[t]=a,e.pop(),delete o[i];t:{for(var s in o)break t;delete n[r]}},_lendBinding:function(t){var e=this._bindings,r=t._cacheIndex,i=this._nActiveBindings++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_takeBackBinding:function(t){var e=this._bindings,r=t._cacheIndex,i=--this._nActiveBindings,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,r=t[e];return void 0===r&&(r=new m.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),r.__cacheIndex=e,t[e]=r),r},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,r=t.__cacheIndex,i=--this._nActiveControlInterpolants,n=e[i];t.__cacheIndex=i,e[i]=t,n.__cacheIndex=r,e[r]=n},_controlInterpolantsResultBuffer:new Float32Array(1)}),m.AnimationObjectGroup=function(t){this.uuid=m.Math.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var r=0,i=arguments.length;r!==i;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}},m.AnimationObjectGroup.prototype={constructor:m.AnimationObjectGroup,add:function(t){for(var e=this._objects,r=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,o=this._paths,a=this._parsedPaths,s=this._bindings,h=s.length,c=0,l=arguments.length;c!==l;++c){var u=arguments[c],p=n[d=u.uuid];if(void 0===p){p=r++,n[d]=p,e.push(u);for(var d=0,f=h;d!==f;++d)s[d].push(new m.PropertyBinding(u,o[d],a[d]))}else if(p<i){var g=e[p],v=--i;for(n[(f=e[v]).uuid]=p,e[p]=f,n[d]=v,e[v]=u,d=0,f=h;d!==f;++d){var y=s[d],x=y[p];y[p]=y[v],void 0===x&&(x=new m.PropertyBinding(u,o[d],a[d])),y[v]=x}}else e[p]!==g&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=i},remove:function(t){for(var e=this._objects,r=this.nCachedObjects_,i=this._indicesByUUID,n=this._bindings,o=n.length,a=0,s=arguments.length;a!==s;++a){var h=arguments[a],c=h.uuid,l=i[c];if(void 0!==l&&l>=r){var u=r++,p=e[u];for(i[p.uuid]=l,e[l]=p,i[c]=u,e[u]=h,h=0,c=o;h!==c;++h){var d=(p=n[h])[l];p[l]=p[u],p[u]=d}}}this.nCachedObjects_=r},uncache:function(t){for(var e=this._objects,r=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,o=this._bindings,a=o.length,s=0,h=arguments.length;s!==h;++s){var c=arguments[s].uuid,l=n[c];if(void 0!==l)if(delete n[c],l<i){var u=e[c=--i],p=--r,d=e[p];for(n[u.uuid]=l,e[l]=u,n[d.uuid]=c,e[c]=d,e.pop(),u=0,d=a;u!==d;++u){var f=o[u],m=f[p];f[l]=f[c],f[c]=m,f.pop()}}else for(p=--r,d=e[p],n[d.uuid]=l,e[l]=d,e.pop(),u=0,d=a;u!==d;++u)f=o[u],f[l]=f[p],f.pop()}this.nCachedObjects_=i},subscribe_:function(t,e){var r=this._bindingsIndicesByPath,i=r[t],n=this._bindings;if(void 0!==i)return n[i];var o=this._paths,a=this._parsedPaths,s=this._objects,h=this.nCachedObjects_,c=Array(s.length),i=n.length;for(r[t]=i,o.push(t),a.push(e),n.push(c),r=h,i=s.length;r!==i;++r)c[r]=new m.PropertyBinding(s[r],t,e);return c},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){var i=this._paths,n=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=r,o[r]=s,o.pop(),n[r]=n[a],n.pop(),i[r]=i[a],i.pop()}}},m.AnimationUtils={arraySlice:function(t,e,r){return m.AnimationUtils.isTypedArray(t)?new t.constructor(t.subarray(e,r)):t.slice(e,r)},convertArray:function(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,r=Array(e),i=0;i!==e;++i)r[i]=i;return r.sort(function(e,r){return t[e]-t[r]}),r},sortedArray:function(t,e,r){for(var i=t.length,n=new t.constructor(i),o=0,a=0;a!==i;++o)for(var s=r[o]*e,h=0;h!==e;++h)n[a++]=t[s+h];return n},flattenJSON:function(t,e,r,i){for(var n=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[n++];if(void 0!==o){var a=o[i];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[i])&&(e.push(o.time),r.push.apply(r,a)),o=t[n++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[i])&&(e.push(o.time),a.toArray(r,r.length)),o=t[n++]}while(void 0!==o);else do{void 0!==(a=o[i])&&(e.push(o.time),r.push(a)),o=t[n++]}while(void 0!==o)}}},m.KeyframeTrack=function(t,e,r,i){if(void 0===t)throw Error("track name is undefined");if(void 0===e||0===e.length)throw Error("no keyframes in track named "+t);this.name=t,this.times=m.AnimationUtils.convertArray(e,this.TimeBufferType),this.values=m.AnimationUtils.convertArray(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation),this.validate(),this.optimize()},m.KeyframeTrack.prototype={constructor:m.KeyframeTrack,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:m.InterpolateLinear,InterpolantFactoryMethodDiscrete:function(t){return new m.DiscreteInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new m.LinearInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new m.CubicInterpolant(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e=void 0;switch(t){case m.InterpolateDiscrete:e=this.InterpolantFactoryMethodDiscrete;break;case m.InterpolateLinear:e=this.InterpolantFactoryMethodLinear;break;case m.InterpolateSmooth:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){if(e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name,void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw Error(e);this.setInterpolation(this.DefaultInterpolation)}console.warn(e)}else this.createInterpolant=e},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return m.InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return m.InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return m.InterpolateSmooth}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,r=0,i=e.length;r!==i;++r)e[r]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,r=0,i=e.length;r!==i;++r)e[r]*=t;return this},trim:function(t,e){for(var r=this.times,i=r.length,n=0,o=i-1;n!==i&&r[n]<t;)++n;for(;-1!==o&&r[o]>e;)--o;return++o,0===n&&o===i||(n>=o&&(o=Math.max(o,1),n=o-1),i=this.getValueSize(),this.times=m.AnimationUtils.arraySlice(r,n,o),this.values=m.AnimationUtils.arraySlice(this.values,n*i,o*i)),this},validate:function(){var t=!0;0!=(r=this.getValueSize())-Math.floor(r)&&(console.error("invalid value size in track",this),t=!1);var e=this.times,r=this.values,i=e.length;0===i&&(console.error("track is empty",this),t=!1);for(var n=null,o=0;o!==i;o++){var a=e[o];if("number"==typeof a&&isNaN(a)){console.error("time is not a valid number",this,o,a),t=!1;break}if(null!==n&&n>a){console.error("out of order keys",this,o,a,n),t=!1;break}n=a}if(void 0!==r&&m.AnimationUtils.isTypedArray(r))for(o=0,e=r.length;o!==e;++o)if(i=r[o],isNaN(i)){console.error("value is not a valid number",this,o,i),t=!1;break}return t},optimize:function(){for(var t=this.times,e=this.values,r=this.getValueSize(),i=1,n=1,o=t.length-1;n<=o;++n){var a=!1;if((l=t[n])!==t[n+1]&&(1!==n||l!==l[0]))for(var s=n*r,h=s-r,c=s+r,l=0;l!==r;++l){var u=e[s+l];if(u!==e[h+l]||u!==e[c+l]){a=!0;break}}if(a){if(n!==i)for(t[i]=t[n],a=n*r,s=i*r,l=0;l!==r;++l)e[s+l]=e[a+l];++i}}return i!==t.length&&(this.times=m.AnimationUtils.arraySlice(t,0,i),this.values=m.AnimationUtils.arraySlice(e,0,i*r)),this}},Object.assign(m.KeyframeTrack,{parse:function(t){if(void 0===t.type)throw Error("track type undefined, can not parse");var e=m.KeyframeTrack._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){console.warn("legacy JSON format detected, converting");var r=[],i=[];m.AnimationUtils.flattenJSON(t.keys,r,i,"value"),t.times=r,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){if(void 0!==(e=t.constructor).toJSON)e=e.toJSON(t);else{var e={name:t.name,times:m.AnimationUtils.convertArray(t.times,Array),values:m.AnimationUtils.convertArray(t.values,Array)},r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return m.NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return m.VectorKeyframeTrack;case"color":return m.ColorKeyframeTrack;case"quaternion":return m.QuaternionKeyframeTrack;case"bool":case"boolean":return m.BooleanKeyframeTrack;case"string":return m.StringKeyframeTrack}throw Error("Unsupported typeName: "+t)}}),m.PropertyBinding=function(t,e,r){this.path=e,this.parsedPath=r||m.PropertyBinding.parseTrackName(e),this.node=m.PropertyBinding.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t},m.PropertyBinding.prototype={constructor:m.PropertyBinding,getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,r=e.objectName,i=e.propertyName,n=e.propertyIndex;if(t||(this.node=t=m.PropertyBinding.findNode(this.rootNode,e.nodeName)||this.rootNode),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(r){var o=e.objectIndex;switch(r){case"materials":if(!t.material)return void console.error("  can not bind to material as node does not have a material",this);if(!t.material.materials)return void console.error("  can not bind to material.materials as node.material does not have a materials array",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("  can not bind to bones as node does not have a skeleton",this);for(t=t.skeleton.bones,r=0;r<t.length;r++)if(t[r].name===o){o=r;break}break;default:if(void 0===t[r])return void console.error("  can not bind to objectName of node, undefined",this);t=t[r]}if(void 0!==o){if(void 0===t[o])return void console.error("  trying to bind to objectIndex of objectName, but is undefined:",this,t);t=t[o]}}if(o=t[i]){if(e=this.Versioning.None,void 0!==t.needsUpdate?(e=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(e=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t),r=this.BindingType.Direct,void 0!==n){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry",this);if(!t.geometry.morphTargets)return void console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);for(r=0;r<this.node.geometry.morphTargets.length;r++)if(t.geometry.morphTargets[r].name===n){n=r;break}}r=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=n}else void 0!==o.fromArray&&void 0!==o.toArray?(r=this.BindingType.HasFromToArray,this.resolvedProperty=o):void 0!==o.length?(r=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[r],this.setValue=this.SetterByBindingTypeAndVersioning[r][e]}else console.error("  trying to update property for track: "+e.nodeName+"."+i+" but it wasn't found.",t)}else console.error("  trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Object.assign(m.PropertyBinding.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:m.PropertyBinding.prototype.getValue,_setValue_unbound:m.PropertyBinding.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)t[e++]=r[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.node[this.propertyName]=t[e]},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)r[i]=t[e++]},function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]]}),m.PropertyBinding.Composite=function(t,e,r){r=r||m.PropertyBinding.parseTrackName(e),this._targetGroup=t,this._bindings=t.subscribe_(e,r)},m.PropertyBinding.Composite.prototype={constructor:m.PropertyBinding.Composite,getValue:function(t,e){this.bind();var r=this._bindings[this._targetGroup.nCachedObjects_];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var r=this._bindings,i=this._targetGroup.nCachedObjects_,n=r.length;i!==n;++i)r[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].unbind()}},m.PropertyBinding.create=function(t,e,r){return t instanceof m.AnimationObjectGroup?new m.PropertyBinding.Composite(t,e,r):new m.PropertyBinding(t,e,r)},m.PropertyBinding.parseTrackName=function(t){var e=/^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_. ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,r=e.exec(t);if(!r)throw Error("cannot parse trackName at all: "+t);if(r.index===e.lastIndex&&e.lastIndex++,null===(e={nodeName:r[3],objectName:r[5],objectIndex:r[7],propertyName:r[9],propertyIndex:r[11]}).propertyName||0===e.propertyName.length)throw Error("can not parse propertyName from trackName: "+t);return e},m.PropertyBinding.findNode=function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var r=function(t){for(var r=0;r<t.bones.length;r++){var i=t.bones[r];if(i.name===e)return i}return null}(t.skeleton);if(r)return r}if(t.children){var i=function(t){for(var r=0;r<t.length;r++){var n=t[r];if(n.name===e||n.uuid===e||(n=i(n.children)))return n}return null};if(r=i(t.children))return r}return null},m.PropertyMixer=function(t,e,r){switch(this.binding=t,this.valueSize=r,t=Float64Array,e){case"quaternion":e=this._slerp;break;case"string":case"bool":t=Array,e=this._select;break;default:e=this._lerp}this.buffer=new t(4*r),this._mixBufferRegion=e,this.referenceCount=this.useCount=this.cumulativeWeight=0},m.PropertyMixer.prototype={constructor:m.PropertyMixer,accumulate:function(t,e){var r=this.buffer,i=this.valueSize,n=t*i+i,o=this.cumulativeWeight;if(0===o){for(o=0;o!==i;++o)r[n+o]=r[o];o=e}else o+=e,this._mixBufferRegion(r,n,0,e/o,i);this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,r=this.buffer;t=t*e+e;var i=this.cumulativeWeight,n=this.binding;this.cumulativeWeight=0,1>i&&this._mixBufferRegion(r,t,3*e,1-i,e);for(var i=e,o=e+e;i!==o;++i)if(r[i]!==r[i+e]){n.setValue(r,t);break}},saveOriginalState:function(){var t=this.buffer,e=this.valueSize,r=3*e;this.binding.getValue(t,r);for(var i=e;i!==r;++i)t[i]=t[r+i%e];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(t,e,r,i,n){if(.5<=i)for(i=0;i!==n;++i)t[e+i]=t[r+i]},_slerp:function(t,e,r,i,n){m.Quaternion.slerpFlat(t,e,t,e,t,r,i)},_lerp:function(t,e,r,i,n){for(var o=1-i,a=0;a!==n;++a){var s=e+a;t[s]=t[s]*o+t[r+a]*i}}},m.BooleanKeyframeTrack=function(t,e,r){m.KeyframeTrack.call(this,t,e,r)},m.BooleanKeyframeTrack.prototype=Object.assign(Object.create(m.KeyframeTrack.prototype),{constructor:m.BooleanKeyframeTrack,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:m.IntepolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),m.NumberKeyframeTrack=function(t,e,r,i){m.KeyframeTrack.call(this,t,e,r,i)},m.NumberKeyframeTrack.prototype=Object.assign(Object.create(m.KeyframeTrack.prototype),{constructor:m.NumberKeyframeTrack,ValueTypeName:"number"}),m.QuaternionKeyframeTrack=function(t,e,r,i){m.KeyframeTrack.call(this,t,e,r,i)},m.QuaternionKeyframeTrack.prototype=Object.assign(Object.create(m.KeyframeTrack.prototype),{constructor:m.QuaternionKeyframeTrack,ValueTypeName:"quaternion",DefaultInterpolation:m.InterpolateLinear,InterpolantFactoryMethodLinear:function(t){return new m.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),m.StringKeyframeTrack=function(t,e,r,i){m.KeyframeTrack.call(this,t,e,r,i)},m.StringKeyframeTrack.prototype=Object.assign(Object.create(m.KeyframeTrack.prototype),{constructor:m.StringKeyframeTrack,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:m.IntepolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),m.VectorKeyframeTrack=function(t,e,r,i){m.KeyframeTrack.call(this,t,e,r,i)},m.VectorKeyframeTrack.prototype=Object.assign(Object.create(m.KeyframeTrack.prototype),{constructor:m.VectorKeyframeTrack,ValueTypeName:"vector"}),m.Audio=function(t){m.Object3D.call(this),this.type="Audio",this.context=t.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filter=null},m.Audio.prototype=Object.create(m.Object3D.prototype),m.Audio.prototype.constructor=m.Audio,m.Audio.prototype.getOutput=function(){return this.gain},m.Audio.prototype.load=function(t){var e=new m.AudioBuffer(this.context);return e.load(t),this.setBuffer(e),this},m.Audio.prototype.setNodeSource=function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},m.Audio.prototype.setBuffer=function(t){var e=this;return t.onReady(function(t){e.source.buffer=t,e.sourceType="buffer",e.autoplay&&e.play()}),this},m.Audio.prototype.play=function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else{var t=this.context.createBufferSource();t.buffer=this.source.buffer,t.loop=this.source.loop,t.onended=this.source.onended,t.start(0,this.startTime),t.playbackRate.value=this.playbackRate,this.isPlaying=!0,this.source=t,this.connect()}},m.Audio.prototype.pause=function(){!1===this.hasPlaybackControl?console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=this.context.currentTime)},m.Audio.prototype.stop=function(){!1===this.hasPlaybackControl?console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=0)},m.Audio.prototype.connect=function(){null!==this.filter?(this.source.connect(this.filter),this.filter.connect(this.getOutput())):this.source.connect(this.getOutput())},m.Audio.prototype.disconnect=function(){null!==this.filter?(this.source.disconnect(this.filter),this.filter.disconnect(this.getOutput())):this.source.disconnect(this.getOutput())},m.Audio.prototype.getFilter=function(){return this.filter},m.Audio.prototype.setFilter=function(t){void 0===t&&(t=null),!0===this.isPlaying?(this.disconnect(),this.filter=t,this.connect()):this.filter=t},m.Audio.prototype.setPlaybackRate=function(t){!1===this.hasPlaybackControl?console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&(this.source.playbackRate.value=this.playbackRate))},m.Audio.prototype.getPlaybackRate=function(){return this.playbackRate},m.Audio.prototype.onEnded=function(){this.isPlaying=!1},m.Audio.prototype.setLoop=function(t){!1===this.hasPlaybackControl?console.warn("THREE.Audio: this Audio has no playback control."):this.source.loop=t},m.Audio.prototype.getLoop=function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.source.loop},m.Audio.prototype.setVolume=function(t){this.gain.gain.value=t},m.Audio.prototype.getVolume=function(){return this.gain.gain.value},m.AudioAnalyser=function(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)},m.AudioAnalyser.prototype={constructor:m.AudioAnalyser,getData:function(){return this.analyser.getByteFrequencyData(this.data),this.data}},m.AudioBuffer=function(t){this.context=t,this.ready=!1,this.readyCallbacks=[]},m.AudioBuffer.prototype.load=function(t){var e=this,r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(t){e.context.decodeAudioData(this.response,function(t){for(e.buffer=t,e.ready=!0,t=0;t<e.readyCallbacks.length;t++)e.readyCallbacks[t](e.buffer);e.readyCallbacks=[]})},r.send(),this},m.AudioBuffer.prototype.onReady=function(t){this.ready?t(this.buffer):this.readyCallbacks.push(t)},m.PositionalAudio=function(t){m.Audio.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)},m.PositionalAudio.prototype=Object.create(m.Audio.prototype),m.PositionalAudio.prototype.constructor=m.PositionalAudio,m.PositionalAudio.prototype.getOutput=function(){return this.panner},m.PositionalAudio.prototype.setRefDistance=function(t){this.panner.refDistance=t},m.PositionalAudio.prototype.getRefDistance=function(){return this.panner.refDistance},m.PositionalAudio.prototype.setRolloffFactor=function(t){this.panner.rolloffFactor=t},m.PositionalAudio.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor},m.PositionalAudio.prototype.setDistanceModel=function(t){this.panner.distanceModel=t},m.PositionalAudio.prototype.getDistanceModel=function(){return this.panner.distanceModel},m.PositionalAudio.prototype.setMaxDistance=function(t){this.panner.maxDistance=t},m.PositionalAudio.prototype.getMaxDistance=function(){return this.panner.maxDistance},m.PositionalAudio.prototype.updateMatrixWorld=function(){var t=new m.Vector3;return function(e){m.Object3D.prototype.updateMatrixWorld.call(this,e),t.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(t.x,t.y,t.z)}}(),m.AudioListener=function(){m.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null},m.AudioListener.prototype=Object.create(m.Object3D.prototype),m.AudioListener.prototype.constructor=m.AudioListener,m.AudioListener.prototype.getInput=function(){return this.gain},m.AudioListener.prototype.removeFilter=function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},m.AudioListener.prototype.setFilter=function(t){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},m.AudioListener.prototype.getFilter=function(){return this.filter},m.AudioListener.prototype.setMasterVolume=function(t){this.gain.gain.value=t},m.AudioListener.prototype.getMasterVolume=function(){return this.gain.gain.value},m.AudioListener.prototype.updateMatrixWorld=function(){var t=new m.Vector3,e=new m.Quaternion,r=new m.Vector3,i=new m.Vector3;return function(n){m.Object3D.prototype.updateMatrixWorld.call(this,n),n=this.context.listener;var o=this.up;this.matrixWorld.decompose(t,e,r),i.set(0,0,-1).applyQuaternion(e),n.setPosition(t.x,t.y,t.z),n.setOrientation(i.x,i.y,i.z,o.x,o.y,o.z)}}(),m.Camera=function(){m.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new m.Matrix4,this.projectionMatrix=new m.Matrix4},m.Camera.prototype=Object.create(m.Object3D.prototype),m.Camera.prototype.constructor=m.Camera,m.Camera.prototype.getWorldDirection=function(){var t=new m.Quaternion;return function(e){return e=e||new m.Vector3,this.getWorldQuaternion(t),e.set(0,0,-1).applyQuaternion(t)}}(),m.Camera.prototype.lookAt=function(){var t=new m.Matrix4;return function(e){t.lookAt(this.position,e,this.up),this.quaternion.setFromRotationMatrix(t)}}(),m.Camera.prototype.clone=function(){return(new this.constructor).copy(this)},m.Camera.prototype.copy=function(t){return m.Object3D.prototype.copy.call(this,t),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},m.CubeCamera=function(t,e,r){m.Object3D.call(this),this.type="CubeCamera";var i=new m.PerspectiveCamera(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new m.Vector3(1,0,0)),this.add(i);var n=new m.PerspectiveCamera(90,1,t,e);n.up.set(0,-1,0),n.lookAt(new m.Vector3(-1,0,0)),this.add(n);var o=new m.PerspectiveCamera(90,1,t,e);o.up.set(0,0,1),o.lookAt(new m.Vector3(0,1,0)),this.add(o);var a=new m.PerspectiveCamera(90,1,t,e);a.up.set(0,0,-1),a.lookAt(new m.Vector3(0,-1,0)),this.add(a);var s=new m.PerspectiveCamera(90,1,t,e);s.up.set(0,-1,0),s.lookAt(new m.Vector3(0,0,1)),this.add(s);var h=new m.PerspectiveCamera(90,1,t,e);h.up.set(0,-1,0),h.lookAt(new m.Vector3(0,0,-1)),this.add(h),this.renderTarget=new m.WebGLRenderTargetCube(r,r,{format:m.RGBFormat,magFilter:m.LinearFilter,minFilter:m.LinearFilter}),this.updateCubeMap=function(t,e){null===this.parent&&this.updateMatrixWorld();var r=this.renderTarget,c=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,r.activeCubeFace=0,t.render(e,i,r),r.activeCubeFace=1,t.render(e,n,r),r.activeCubeFace=2,t.render(e,o,r),r.activeCubeFace=3,t.render(e,a,r),r.activeCubeFace=4,t.render(e,s,r),r.texture.generateMipmaps=c,r.activeCubeFace=5,t.render(e,h,r),t.setRenderTarget(null)}},m.CubeCamera.prototype=Object.create(m.Object3D.prototype),m.CubeCamera.prototype.constructor=m.CubeCamera,m.OrthographicCamera=function(t,e,r,i,n,o){m.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=t,this.right=e,this.top=r,this.bottom=i,this.near=void 0!==n?n:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()},m.OrthographicCamera.prototype=Object.create(m.Camera.prototype),m.OrthographicCamera.prototype.constructor=m.OrthographicCamera,m.OrthographicCamera.prototype.updateProjectionMatrix=function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(r-t,r+t,i+e,i-e,this.near,this.far)},m.OrthographicCamera.prototype.copy=function(t){return m.Camera.prototype.copy.call(this,t),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this},m.OrthographicCamera.prototype.toJSON=function(t){return t=m.Object3D.prototype.toJSON.call(this,t),t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,t},m.PerspectiveCamera=function(t,e,r,i){m.Camera.call(this),this.type="PerspectiveCamera",this.focalLength=10,this.zoom=1,this.fov=void 0!==t?t:50,this.aspect=void 0!==e?e:1,this.near=void 0!==r?r:.1,this.far=void 0!==i?i:2e3,this.updateProjectionMatrix()},m.PerspectiveCamera.prototype=Object.create(m.Camera.prototype),m.PerspectiveCamera.prototype.constructor=m.PerspectiveCamera,m.PerspectiveCamera.prototype.setLens=function(t,e){void 0===e&&(e=24),this.fov=2*m.Math.radToDeg(Math.atan(e/(2*t))),this.updateProjectionMatrix()},m.PerspectiveCamera.prototype.setViewOffset=function(t,e,r,i,n,o){this.fullWidth=t,this.fullHeight=e,this.x=r,this.y=i,this.width=n,this.height=o,this.updateProjectionMatrix()},m.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var t=m.Math.radToDeg(2*Math.atan(Math.tan(.5*m.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var e=(r=this.fullWidth/this.fullHeight)*(i=-(t=Math.tan(m.Math.degToRad(.5*t))*this.near)),r=Math.abs(r*t-e),i=Math.abs(t-i);this.projectionMatrix.makeFrustum(e+this.x*r/this.fullWidth,e+(this.x+this.width)*r/this.fullWidth,t-(this.y+this.height)*i/this.fullHeight,t-this.y*i/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(t,this.aspect,this.near,this.far)},m.PerspectiveCamera.prototype.copy=function(t){return m.Camera.prototype.copy.call(this,t),this.focalLength=t.focalLength,this.zoom=t.zoom,this.fov=t.fov,this.aspect=t.aspect,this.near=t.near,this.far=t.far,this},m.PerspectiveCamera.prototype.toJSON=function(t){return t=m.Object3D.prototype.toJSON.call(this,t),t.object.focalLength=this.focalLength,t.object.zoom=this.zoom,t.object.fov=this.fov,t.object.aspect=this.aspect,t.object.near=this.near,t.object.far=this.far,t},m.StereoCamera=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new m.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new m.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1},m.StereoCamera.prototype={constructor:m.StereoCamera,update:function(){var t,e,r,i,n,o=new m.Matrix4,a=new m.Matrix4;return function(s){if(t!==s.focalLength||e!==s.fov||r!==s.aspect*this.aspect||i!==s.near||n!==s.far){t=s.focalLength,e=s.fov,r=s.aspect*this.aspect,i=s.near,n=s.far;var h,c,l=s.projectionMatrix.clone(),u=.032*i/t,p=i*Math.tan(m.Math.degToRad(.5*e));a.elements[12]=-.032,o.elements[12]=.032,h=-p*r+u,c=p*r+u,l.elements[0]=2*i/(c-h),l.elements[8]=(c+h)/(c-h),this.cameraL.projectionMatrix.copy(l),h=-p*r-u,c=p*r-u,l.elements[0]=2*i/(c-h),l.elements[8]=(c+h)/(c-h),this.cameraR.projectionMatrix.copy(l)}this.cameraL.matrixWorld.copy(s.matrixWorld).multiply(a),this.cameraR.matrixWorld.copy(s.matrixWorld).multiply(o)}}()},m.Light=function(t,e){m.Object3D.call(this),this.type="Light",this.color=new m.Color(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0},m.Light.prototype=Object.create(m.Object3D.prototype),m.Light.prototype.constructor=m.Light,m.Light.prototype.copy=function(t){return m.Object3D.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},m.Light.prototype.toJSON=function(t){return t=m.Object3D.prototype.toJSON.call(this,t),t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.exponent&&(t.object.exponent=this.exponent),t},m.LightShadow=function(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new m.Vector2(512,512),this.map=null,this.matrix=new m.Matrix4},m.LightShadow.prototype={constructor:m.LightShadow,copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)}},m.AmbientLight=function(t,e){m.Light.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0},m.AmbientLight.prototype=Object.create(m.Light.prototype),m.AmbientLight.prototype.constructor=m.AmbientLight,m.DirectionalLight=function(t,e){m.Light.call(this,t,e),this.type="DirectionalLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new m.Object3D,this.shadow=new m.LightShadow(new m.OrthographicCamera(-5,5,5,-5,.5,500))},m.DirectionalLight.prototype=Object.create(m.Light.prototype),m.DirectionalLight.prototype.constructor=m.DirectionalLight,m.DirectionalLight.prototype.copy=function(t){return m.Light.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this},m.HemisphereLight=function(t,e,r){m.Light.call(this,t,r),this.type="HemisphereLight",this.castShadow=void 0,this.position.set(0,1,0),this.updateMatrix(),this.groundColor=new m.Color(e)},m.HemisphereLight.prototype=Object.create(m.Light.prototype),m.HemisphereLight.prototype.constructor=m.HemisphereLight,m.HemisphereLight.prototype.copy=function(t){return m.Light.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this},m.PointLight=function(t,e,r,i){m.Light.call(this,t,e),this.type="PointLight",this.distance=void 0!==r?r:0,this.decay=void 0!==i?i:1,this.shadow=new m.LightShadow(new m.PerspectiveCamera(90,1,.5,500))},m.PointLight.prototype=Object.create(m.Light.prototype),m.PointLight.prototype.constructor=m.PointLight,m.PointLight.prototype.copy=function(t){return m.Light.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this},m.SpotLight=function(t,e,r,i,n,o){m.Light.call(this,t,e),this.type="SpotLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new m.Object3D,this.distance=void 0!==r?r:0,this.angle=void 0!==i?i:Math.PI/3,this.exponent=void 0!==n?n:10,this.decay=void 0!==o?o:1,this.shadow=new m.LightShadow(new m.PerspectiveCamera(50,1,.5,500))},m.SpotLight.prototype=Object.create(m.Light.prototype),m.SpotLight.prototype.constructor=m.SpotLight,m.SpotLight.prototype.copy=function(t){return m.Light.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.exponent=t.exponent,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this},m.Cache={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},m.Loader=function(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},m.Loader.prototype={constructor:m.Loader,crossOrigin:void 0,extractUrlBase:function(t){return 1===(t=t.split("/")).length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(t,e,r){for(var i=[],n=0;n<t.length;++n)i[n]=this.createMaterial(t[n],e,r);return i},createMaterial:function(){var t,e,r;return function(i,n,o){function a(t,r,i,a,s){t=n+t;var c=m.Loader.Handlers.get(t);return null!==c?t=c.load(t):(e.setCrossOrigin(o),t=e.load(t)),void 0!==r&&(t.repeat.fromArray(r),1!==r[0]&&(t.wrapS=m.RepeatWrapping),1!==r[1]&&(t.wrapT=m.RepeatWrapping)),void 0!==i&&t.offset.fromArray(i),void 0!==a&&("repeat"===a[0]&&(t.wrapS=m.RepeatWrapping),"mirror"===a[0]&&(t.wrapS=m.MirroredRepeatWrapping),"repeat"===a[1]&&(t.wrapT=m.RepeatWrapping),"mirror"===a[1]&&(t.wrapT=m.MirroredRepeatWrapping)),void 0!==s&&(t.anisotropy=s),r=m.Math.generateUUID(),h[r]=t,r}void 0===t&&(t=new m.Color),void 0===e&&(e=new m.TextureLoader),void 0===r&&(r=new m.MaterialLoader);var s,h={},c={uuid:m.Math.generateUUID(),type:"MeshLambertMaterial"};for(s in i){var l=i[s];switch(s){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":c.name=l;break;case"blending":c.blending=m[l];break;case"colorAmbient":console.warn("THREE.Loader.createMaterial: colorAmbient is no longer supported");break;case"colorDiffuse":c.color=t.fromArray(l).getHex();break;case"colorSpecular":c.specular=t.fromArray(l).getHex();break;case"colorEmissive":c.emissive=t.fromArray(l).getHex();break;case"specularCoef":c.shininess=l;break;case"shading":"basic"===l.toLowerCase()&&(c.type="MeshBasicMaterial"),"phong"===l.toLowerCase()&&(c.type="MeshPhongMaterial");break;case"mapDiffuse":c.map=a(l,i.mapDiffuseRepeat,i.mapDiffuseOffset,i.mapDiffuseWrap,i.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapLight":c.lightMap=a(l,i.mapLightRepeat,i.mapLightOffset,i.mapLightWrap,i.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":c.aoMap=a(l,i.mapAORepeat,i.mapAOOffset,i.mapAOWrap,i.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":c.bumpMap=a(l,i.mapBumpRepeat,i.mapBumpOffset,i.mapBumpWrap,i.mapBumpAnisotropy);break;case"mapBumpScale":c.bumpScale=l;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":c.normalMap=a(l,i.mapNormalRepeat,i.mapNormalOffset,i.mapNormalWrap,i.mapNormalAnisotropy);break;case"mapNormalFactor":c.normalScale=[l,l];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":c.specularMap=a(l,i.mapSpecularRepeat,i.mapSpecularOffset,i.mapSpecularWrap,i.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapAlpha":c.alphaMap=a(l,i.mapAlphaRepeat,i.mapAlphaOffset,i.mapAlphaWrap,i.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":c.side=m.BackSide;break;case"doubleSided":c.side=m.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),c.opacity=l;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":c[s]=l;break;case"vertexColors":!0===l&&(c.vertexColors=m.VertexColors),"face"===l&&(c.vertexColors=m.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",s,l)}}return"MeshBasicMaterial"===c.type&&delete c.emissive,"MeshPhongMaterial"!==c.type&&delete c.specular,1>c.opacity&&(c.transparent=!0),r.setTextures(h),r.parse(c)}}()},m.Loader.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,r=0,i=e.length;r<i;r+=2){var n=e[r+1];if(e[r].test(t))return n}return null}},m.XHRLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager},m.XHRLoader.prototype={constructor:m.XHRLoader,load:function(t,e,r,i){void 0!==this.path&&(t=this.path+t);var n=this,o=m.Cache.get(t);if(void 0!==o)return e&&setTimeout(function(){e(o)},0),o;var a=new XMLHttpRequest;return a.overrideMimeType("text/plain"),a.open("GET",t,!0),a.addEventListener("load",function(r){var o=r.target.response;m.Cache.add(t,o),200===this.status?(e&&e(o),n.manager.itemEnd(t)):0===this.status?(console.warn("THREE.XHRLoader: HTTP Status 0 received."),e&&e(o),n.manager.itemEnd(t)):(i&&i(r),n.manager.itemError(t))},!1),void 0!==r&&a.addEventListener("progress",function(t){r(t)},!1),a.addEventListener("error",function(e){i&&i(e),n.manager.itemError(t)},!1),void 0!==this.responseType&&(a.responseType=this.responseType),void 0!==this.withCredentials&&(a.withCredentials=this.withCredentials),a.send(null),n.manager.itemStart(t),a},setPath:function(t){this.path=t},setResponseType:function(t){this.responseType=t},setWithCredentials:function(t){this.withCredentials=t}},m.FontLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager},m.FontLoader.prototype={constructor:m.FontLoader,load:function(t,e,r,i){new m.XHRLoader(this.manager).load(t,function(t){e(new m.Font(JSON.parse(t.substring(65,t.length-2))))},r,i)}},m.ImageLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager},m.ImageLoader.prototype={constructor:m.ImageLoader,load:function(t,e,r,i){void 0!==this.path&&(t=this.path+t);var n=this,o=m.Cache.get(t);if(void 0!==o)return n.manager.itemStart(t),e?setTimeout(function(){e(o),n.manager.itemEnd(t)},0):n.manager.itemEnd(t),o;var a=document.createElement("img");return a.addEventListener("load",function(r){m.Cache.add(t,this),e&&e(this),n.manager.itemEnd(t)},!1),void 0!==r&&a.addEventListener("progress",function(t){r(t)},!1),a.addEventListener("error",function(e){i&&i(e),n.manager.itemError(t)},!1),void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),n.manager.itemStart(t),a.src=t,a},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t}},m.JSONLoader=function(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:m.DefaultLoadingManager,this.withCredentials=!1},m.JSONLoader.prototype={constructor:m.JSONLoader,get statusDomElement(){return void 0===this._statusDomElement&&(this._statusDomElement=document.createElement("div")),console.warn("THREE.JSONLoader: .statusDomElement has been removed."),this._statusDomElement},load:function(t,e,r,i){var n=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:m.Loader.prototype.extractUrlBase(t),a=new m.XHRLoader(this.manager);a.setWithCredentials(this.withCredentials),a.load(t,function(r){var i=(r=JSON.parse(r)).metadata;if(void 0!==i&&void 0!==(i=i.type)){if("object"===i.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===i.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.SceneLoader instead.")}r=n.parse(r,o),e(r.geometry,r.materials)},r,i)},setTexturePath:function(t){this.texturePath=t},parse:function(t,e){var r=new m.Geometry,i=void 0!==t.scale?1/t.scale:1;return function(e){var i,n,o,a,s,h,c,l,u,p,d,f,g,v=t.faces;h=t.vertices;var y=t.normals,x=t.colors,b=0;if(void 0!==t.uvs){for(i=0;i<t.uvs.length;i++)t.uvs[i].length&&b++;for(i=0;i<b;i++)r.faceVertexUvs[i]=[]}for(a=0,s=h.length;a<s;)i=new m.Vector3,i.x=h[a++]*e,i.y=h[a++]*e,i.z=h[a++]*e,r.vertices.push(i);for(a=0,s=v.length;a<s;)if(e=v[a++],u=1&e,o=2&e,i=8&e,c=16&e,p=32&e,h=64&e,e&=128,u){if(u=new m.Face3,u.a=v[a],u.b=v[a+1],u.c=v[a+3],d=new m.Face3,d.a=v[a+1],d.b=v[a+2],d.c=v[a+3],a+=4,o&&(o=v[a++],u.materialIndex=o,d.materialIndex=o),o=r.faces.length,i)for(i=0;i<b;i++)for(f=t.uvs[i],r.faceVertexUvs[i][o]=[],r.faceVertexUvs[i][o+1]=[],n=0;4>n;n++)l=v[a++],g=f[2*l],l=f[2*l+1],g=new m.Vector2(g,l),2!==n&&r.faceVertexUvs[i][o].push(g),0!==n&&r.faceVertexUvs[i][o+1].push(g);if(c&&(c=3*v[a++],u.normal.set(y[c++],y[c++],y[c]),d.normal.copy(u.normal)),p)for(i=0;4>i;i++)c=3*v[a++],p=new m.Vector3(y[c++],y[c++],y[c]),2!==i&&u.vertexNormals.push(p),0!==i&&d.vertexNormals.push(p);if(h&&(h=v[a++],h=x[h],u.color.setHex(h),d.color.setHex(h)),e)for(i=0;4>i;i++)h=v[a++],h=x[h],2!==i&&u.vertexColors.push(new m.Color(h)),0!==i&&d.vertexColors.push(new m.Color(h));r.faces.push(u),r.faces.push(d)}else{if(u=new m.Face3,u.a=v[a++],u.b=v[a++],u.c=v[a++],o&&(o=v[a++],u.materialIndex=o),o=r.faces.length,i)for(i=0;i<b;i++)for(f=t.uvs[i],r.faceVertexUvs[i][o]=[],n=0;3>n;n++)l=v[a++],g=f[2*l],l=f[2*l+1],g=new m.Vector2(g,l),r.faceVertexUvs[i][o].push(g);if(c&&(c=3*v[a++],u.normal.set(y[c++],y[c++],y[c])),p)for(i=0;3>i;i++)c=3*v[a++],p=new m.Vector3(y[c++],y[c++],y[c]),u.vertexNormals.push(p);if(h&&(h=v[a++],u.color.setHex(x[h])),e)for(i=0;3>i;i++)h=v[a++],u.vertexColors.push(new m.Color(x[h]));r.faces.push(u)}}(i),function(){var e=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,n=t.skinWeights.length;i<n;i+=e)r.skinWeights.push(new m.Vector4(t.skinWeights[i],1<e?t.skinWeights[i+1]:0,2<e?t.skinWeights[i+2]:0,3<e?t.skinWeights[i+3]:0));if(t.skinIndices)for(i=0,n=t.skinIndices.length;i<n;i+=e)r.skinIndices.push(new m.Vector4(t.skinIndices[i],1<e?t.skinIndices[i+1]:0,2<e?t.skinIndices[i+2]:0,3<e?t.skinIndices[i+3]:0));r.bones=t.bones,r.bones&&0<r.bones.length&&(r.skinWeights.length!==r.skinIndices.length||r.skinIndices.length!==r.vertices.length)&&console.warn("When skinning, number of vertices ("+r.vertices.length+"), skinIndices ("+r.skinIndices.length+"), and skinWeights ("+r.skinWeights.length+") should match.")}(),function(e){if(void 0!==t.morphTargets)for(var i=0,n=t.morphTargets.length;i<n;i++){r.morphTargets[i]={},r.morphTargets[i].name=t.morphTargets[i].name,r.morphTargets[i].vertices=[];for(var o=r.morphTargets[i].vertices,a=t.morphTargets[i].vertices,s=0,h=a.length;s<h;s+=3){var c=new m.Vector3;c.x=a[s]*e,c.y=a[s+1]*e,c.z=a[s+2]*e,o.push(c)}}if(void 0!==t.morphColors&&0<t.morphColors.length)for(console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'),e=r.faces,o=t.morphColors[0].colors,i=0,n=e.length;i<n;i++)e[i].color.fromArray(o,3*i)}(i),function(){var e=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var n=0;n<i.length;n++){var o=m.AnimationClip.parseAnimation(i[n],r.bones);o&&e.push(o)}r.morphTargets&&(i=m.AnimationClip.CreateClipsFromMorphTargetSequences(r.morphTargets,10),e=e.concat(i)),0<e.length&&(r.animations=e)}(),r.computeFaceNormals(),r.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:r}:(i=m.Loader.prototype.initMaterials(t.materials,e,this.crossOrigin),{geometry:r,materials:i})}},m.LoadingManager=function(t,e,r){var i=this,n=!1,o=0,a=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=r,this.itemStart=function(t){a++,!1===n&&void 0!==i.onStart&&i.onStart(t,o,a),n=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,a),o===a&&(n=!1,void 0!==i.onLoad)&&i.onLoad()},this.itemError=function(t){void 0!==i.onError&&i.onError(t)}},m.DefaultLoadingManager=new m.LoadingManager,m.BufferGeometryLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager},m.BufferGeometryLoader.prototype={constructor:m.BufferGeometryLoader,load:function(t,e,r,i){var n=this;new m.XHRLoader(n.manager).load(t,function(t){e(n.parse(JSON.parse(t)))},r,i)},parse:function(t){var e=new m.BufferGeometry,r=t.data.index,i={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};void 0!==r&&(r=new i[r.type](r.array),e.setIndex(new m.BufferAttribute(r,1)));var n,o=t.data.attributes;for(n in o){var a=o[n],r=new i[a.type](a.array);e.addAttribute(n,new m.BufferAttribute(r,a.itemSize))}if(void 0!==(i=t.data.groups||t.data.drawcalls||t.data.offsets))for(n=0,r=i.length;n!==r;++n)o=i[n],e.addGroup(o.start,o.count,o.materialIndex);return void 0!==(t=t.data.boundingSphere)&&(i=new m.Vector3,void 0!==t.center&&i.fromArray(t.center),e.boundingSphere=new m.Sphere(i,t.radius)),e}},m.MaterialLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager,this.textures={}},m.MaterialLoader.prototype={constructor:m.MaterialLoader,load:function(t,e,r,i){var n=this;new m.XHRLoader(n.manager).load(t,function(t){e(n.parse(JSON.parse(t)))},r,i)},setTextures:function(t){this.textures=t},getTexture:function(t){var e=this.textures;return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]},parse:function(t){var e=new m[t.type];if(void 0!==t.uuid&&(e.uuid=t.uuid),void 0!==t.name&&(e.name=t.name),void 0!==t.color&&e.color.setHex(t.color),void 0!==t.roughness&&(e.roughness=t.roughness),void 0!==t.metalness&&(e.metalness=t.metalness),void 0!==t.emissive&&e.emissive.setHex(t.emissive),void 0!==t.specular&&e.specular.setHex(t.specular),void 0!==t.shininess&&(e.shininess=t.shininess),void 0!==t.uniforms&&(e.uniforms=t.uniforms),void 0!==t.vertexShader&&(e.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(e.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(e.vertexColors=t.vertexColors),void 0!==t.shading&&(e.shading=t.shading),void 0!==t.blending&&(e.blending=t.blending),void 0!==t.side&&(e.side=t.side),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.transparent&&(e.transparent=t.transparent),void 0!==t.alphaTest&&(e.alphaTest=t.alphaTest),void 0!==t.depthTest&&(e.depthTest=t.depthTest),void 0!==t.depthWrite&&(e.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(e.colorWrite=t.colorWrite),void 0!==t.wireframe&&(e.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(e.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.size&&(e.size=t.size),void 0!==t.sizeAttenuation&&(e.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(e.map=this.getTexture(t.map)),void 0!==t.alphaMap&&(e.alphaMap=this.getTexture(t.alphaMap),e.transparent=!0),void 0!==t.bumpMap&&(e.bumpMap=this.getTexture(t.bumpMap)),void 0!==t.bumpScale&&(e.bumpScale=t.bumpScale),void 0!==t.normalMap&&(e.normalMap=this.getTexture(t.normalMap)),void 0!==t.normalScale&&(r=t.normalScale,!1===Array.isArray(r)&&(r=[r,r]),e.normalScale=(new m.Vector2).fromArray(r)),void 0!==t.displacementMap&&(e.displacementMap=this.getTexture(t.displacementMap)),void 0!==t.displacementScale&&(e.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(e.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(e.roughnessMap=this.getTexture(t.roughnessMap)),void 0!==t.metalnessMap&&(e.metalnessMap=this.getTexture(t.metalnessMap)),void 0!==t.emissiveMap&&(e.emissiveMap=this.getTexture(t.emissiveMap)),void 0!==t.emissiveIntensity&&(e.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(e.specularMap=this.getTexture(t.specularMap)),void 0!==t.envMap&&(e.envMap=this.getTexture(t.envMap),e.combine=m.MultiplyOperation),t.reflectivity&&(e.reflectivity=t.reflectivity),void 0!==t.lightMap&&(e.lightMap=this.getTexture(t.lightMap)),void 0!==t.lightMapIntensity&&(e.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(e.aoMap=this.getTexture(t.aoMap)),void 0!==t.aoMapIntensity&&(e.aoMapIntensity=t.aoMapIntensity),void 0!==t.materials)for(var r=0,i=t.materials.length;r<i;r++)e.materials.push(this.parse(t.materials[r]));return e}},m.ObjectLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager,this.texturePath=""},m.ObjectLoader.prototype={constructor:m.ObjectLoader,load:function(t,e,r,i){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var n=this;new m.XHRLoader(n.manager).load(t,function(t){n.parse(JSON.parse(t),e)},r,i)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var r=this.parseGeometries(t.geometries),i=this.parseImages(t.images,function(){void 0!==e&&e(n)}),i=this.parseTextures(t.textures,i),i=this.parseMaterials(t.materials,i),n=this.parseObject(t.object,r,i);return t.animations&&(n.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0===e||e(n),n},parseGeometries:function(t){var e={};if(void 0!==t)for(var r=new m.JSONLoader,i=new m.BufferGeometryLoader,n=0,o=t.length;n<o;n++){var a,s=t[n];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new m[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"CubeGeometry":a=new m.BoxGeometry(s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleBufferGeometry":a=new m.CircleBufferGeometry(s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CircleGeometry":a=new m.CircleGeometry(s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":a=new m.CylinderGeometry(s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":a=new m.SphereGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"SphereBufferGeometry":a=new m.SphereBufferGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":a=new m.DodecahedronGeometry(s.radius,s.detail);break;case"IcosahedronGeometry":a=new m.IcosahedronGeometry(s.radius,s.detail);break;case"OctahedronGeometry":a=new m.OctahedronGeometry(s.radius,s.detail);break;case"TetrahedronGeometry":a=new m.TetrahedronGeometry(s.radius,s.detail);break;case"RingGeometry":a=new m.RingGeometry(s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":a=new m.TorusGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":a=new m.TorusKnotGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.p,s.q,s.heightScale);break;case"LatheGeometry":a=new m.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":a=i.parse(s);break;case"Geometry":a=r.parse(s.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),e[s.uuid]=a}return e},parseMaterials:function(t,e){var r={};if(void 0!==t){var i=new m.MaterialLoader;i.setTextures(e);for(var n=0,o=t.length;n<o;n++){var a=i.parse(t[n]);r[a.uuid]=a}}return r},parseAnimations:function(t){for(var e=[],r=0;r<t.length;r++){var i=m.AnimationClip.parse(t[r]);e.push(i)}return e},parseImages:function(t,e){var r=this,i={};if(void 0!==t&&0<t.length){var n=new m.LoadingManager(e),o=new m.ImageLoader(n);o.setCrossOrigin(this.crossOrigin);for(var n=0,a=t.length;n<a;n++){var s=t[n],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(s.url)?s.url:r.texturePath+s.url;i[s.uuid]=function(t){return r.manager.itemStart(t),o.load(t,function(){r.manager.itemEnd(t)})}(h)}}return i},parseTextures:function(t,e){function r(t){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),m[t])}var i={};if(void 0!==t)for(var n=0,o=t.length;n<o;n++){var a=t[n];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===e[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);var s=new m.Texture(e[a.image]);s.needsUpdate=!0,s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.mapping&&(s.mapping=r(a.mapping)),void 0!==a.offset&&(s.offset=new m.Vector2(a.offset[0],a.offset[1])),void 0!==a.repeat&&(s.repeat=new m.Vector2(a.repeat[0],a.repeat[1])),void 0!==a.minFilter&&(s.minFilter=r(a.minFilter)),void 0!==a.magFilter&&(s.magFilter=r(a.magFilter)),void 0!==a.anisotropy&&(s.anisotropy=a.anisotropy),Array.isArray(a.wrap)&&(s.wrapS=r(a.wrap[0]),s.wrapT=r(a.wrap[1])),i[a.uuid]=s}return i},parseObject:function(){var t=new m.Matrix4;return function(e,r,i){function n(t){return void 0===r[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),r[t]}function o(t){if(void 0!==t)return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}var a;switch(e.type){case"Scene":a=new m.Scene;break;case"PerspectiveCamera":a=new m.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);break;case"OrthographicCamera":a=new m.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":a=new m.AmbientLight(e.color,e.intensity);break;case"DirectionalLight":a=new m.DirectionalLight(e.color,e.intensity);break;case"PointLight":a=new m.PointLight(e.color,e.intensity,e.distance,e.decay);break;case"SpotLight":a=new m.SpotLight(e.color,e.intensity,e.distance,e.angle,e.exponent,e.decay);break;case"HemisphereLight":a=new m.HemisphereLight(e.color,e.groundColor,e.intensity);break;case"Mesh":a=n(e.geometry);var s=o(e.material);a=a.bones&&0<a.bones.length?new m.SkinnedMesh(a,s):new m.Mesh(a,s);break;case"LOD":a=new m.LOD;break;case"Line":a=new m.Line(n(e.geometry),o(e.material),e.mode);break;case"PointCloud":case"Points":a=new m.Points(n(e.geometry),o(e.material));break;case"Sprite":a=new m.Sprite(o(e.material));break;case"Group":a=new m.Group;break;default:a=new m.Object3D}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.children)for(var h in e.children)a.add(this.parseObject(e.children[h],r,i));if("LOD"===e.type)for(e=e.levels,s=0;s<e.length;s++){var c=e[s];void 0!==(h=a.getObjectByProperty("uuid",c.object))&&a.addLevel(h,c.distance)}return a}}()},m.TextureLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager},m.TextureLoader.prototype={constructor:m.TextureLoader,load:function(t,e,r,i){var n=new m.Texture,o=new m.ImageLoader(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(t){n.image=t,n.needsUpdate=!0,void 0!==e&&e(n)},r,i),n},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t}},m.CubeTextureLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager},m.CubeTextureLoader.prototype={constructor:m.CubeTextureLoader,load:function(t,e,r,i){var n=new m.CubeTexture([]),o=new m.ImageLoader(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;for(r=0;r<t.length;++r)!function(r){o.load(t[r],function(t){n.images[r]=t,6==++a&&(n.needsUpdate=!0,e&&e(n))},void 0,i)}(r);return n},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t}},m.DataTextureLoader=m.BinaryTextureLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager,this._parser=null},m.BinaryTextureLoader.prototype={constructor:m.BinaryTextureLoader,load:function(t,e,r,i){var n=this,o=new m.DataTexture,a=new m.XHRLoader(this.manager);return a.setResponseType("arraybuffer"),a.load(t,function(t){(t=n._parser(t))&&(void 0!==t.image?o.image=t.image:void 0!==t.data&&(o.image.width=t.width,o.image.height=t.height,o.image.data=t.data),o.wrapS=void 0!==t.wrapS?t.wrapS:m.ClampToEdgeWrapping,o.wrapT=void 0!==t.wrapT?t.wrapT:m.ClampToEdgeWrapping,o.magFilter=void 0!==t.magFilter?t.magFilter:m.LinearFilter,o.minFilter=void 0!==t.minFilter?t.minFilter:m.LinearMipMapLinearFilter,o.anisotropy=void 0!==t.anisotropy?t.anisotropy:1,void 0!==t.format&&(o.format=t.format),void 0!==t.type&&(o.type=t.type),void 0!==t.mipmaps&&(o.mipmaps=t.mipmaps),1===t.mipmapCount&&(o.minFilter=m.LinearFilter),o.needsUpdate=!0,e&&e(o,t))},r,i),o}},m.CompressedTextureLoader=function(t){this.manager=void 0!==t?t:m.DefaultLoadingManager,this._parser=null},m.CompressedTextureLoader.prototype={constructor:m.CompressedTextureLoader,load:function(t,e,r,i){var n=this,o=[],a=new m.CompressedTexture;a.image=o;var s=new m.XHRLoader(this.manager);if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var h=0,c=0,l=t.length;c<l;++c)!function(c){s.load(t[c],function(t){t=n._parser(t,!0),o[c]={width:t.width,height:t.height,format:t.format,mipmaps:t.mipmaps},6===(h+=1)&&(1===t.mipmapCount&&(a.minFilter=m.LinearFilter),a.format=t.format,a.needsUpdate=!0,e&&e(a))},r,i)}(c);else s.load(t,function(t){if((t=n._parser(t,!0)).isCubemap)for(var r=t.mipmaps.length/t.mipmapCount,i=0;i<r;i++){o[i]={mipmaps:[]};for(var s=0;s<t.mipmapCount;s++)o[i].mipmaps.push(t.mipmaps[i*t.mipmapCount+s]),o[i].format=t.format,o[i].width=t.width,o[i].height=t.height}else a.image.width=t.width,a.image.height=t.height,a.mipmaps=t.mipmaps;1===t.mipmapCount&&(a.minFilter=m.LinearFilter),a.format=t.format,a.needsUpdate=!0,e&&e(a)},r,i);return a},setPath:function(t){this.path=t}},m.Material=function(){Object.defineProperty(this,"id",{value:m.MaterialIdCount++}),this.uuid=m.Math.generateUUID(),this.name="",this.type="Material",this.side=m.FrontSide,this.opacity=1,this.transparent=!1,this.blending=m.NormalBlending,this.blendSrc=m.SrcAlphaFactor,this.blendDst=m.OneMinusSrcAlphaFactor,this.blendEquation=m.AddEquation,this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null,this.depthFunc=m.LessEqualDepth,this.colorWrite=this.depthWrite=this.depthTest=!0,this.precision=null,this.polygonOffset=!1,this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0,this._needsUpdate=this.visible=!0},m.Material.prototype={constructor:m.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(t){!0===t&&this.update(),this._needsUpdate=t},setValues:function(t){if(void 0!==t)for(var e in t){var r=t[e];if(void 0===r)console.warn("THREE.Material: '"+e+"' parameter is undefined.");else{var i=this[e];void 0===i?console.warn("THREE."+this.type+": '"+e+"' is not a property of this material."):i instanceof m.Color?i.set(r):i instanceof m.Vector3&&r instanceof m.Vector3?i.copy(r):this[e]="overdraw"===e?Number(r):r}}},toJSON:function(t){function e(t){var e,r=[];for(e in t){var i=t[e];delete i.metadata,r.push(i)}return r}var r=void 0===t;r&&(t={textures:{},images:{}});var i={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};return i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color instanceof m.Color&&(i.color=this.color.getHex()),.5!==this.roughness&&(i.roughness=this.roughness),.5!==this.metalness&&(i.metalness=this.metalness),this.emissive instanceof m.Color&&(i.emissive=this.emissive.getHex()),this.specular instanceof m.Color&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),this.map instanceof m.Texture&&(i.map=this.map.toJSON(t).uuid),this.alphaMap instanceof m.Texture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap instanceof m.Texture&&(i.lightMap=this.lightMap.toJSON(t).uuid),this.bumpMap instanceof m.Texture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap instanceof m.Texture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalScale=this.normalScale.toArray()),this.displacementMap instanceof m.Texture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap instanceof m.Texture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap instanceof m.Texture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap instanceof m.Texture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap instanceof m.Texture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap instanceof m.Texture&&(i.envMap=this.envMap.toJSON(t).uuid,i.reflectivity=this.reflectivity),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),void 0!==this.vertexColors&&this.vertexColors!==m.NoColors&&(i.vertexColors=this.vertexColors),void 0!==this.shading&&this.shading!==m.SmoothShading&&(i.shading=this.shading),void 0!==this.blending&&this.blending!==m.NormalBlending&&(i.blending=this.blending),void 0!==this.side&&this.side!==m.FrontSide&&(i.side=this.side),1>this.opacity&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),0<this.alphaTest&&(i.alphaTest=this.alphaTest),!0===this.wireframe&&(i.wireframe=this.wireframe),1<this.wireframeLinewidth&&(i.wireframeLinewidth=this.wireframeLinewidth),r&&(r=e(t.textures),t=e(t.images),0<r.length&&(i.textures=r),0<t.length&&(i.images=t)),i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.side=t.side,this.opacity=t.opacity,this.transparent=t.transparent,this.blending=t.blending,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.alphaTest=t.alphaTest,this.overdraw=t.overdraw,this.visible=t.visible,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},m.EventDispatcher.prototype.apply(m.Material.prototype),m.MaterialIdCount=0,m.LineBasicMaterial=function(t){m.Material.call(this),this.type="LineBasicMaterial",this.color=new m.Color(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.vertexColors=m.NoColors,this.fog=!0,this.setValues(t)},m.LineBasicMaterial.prototype=Object.create(m.Material.prototype),m.LineBasicMaterial.prototype.constructor=m.LineBasicMaterial,m.LineBasicMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.vertexColors=t.vertexColors,this.fog=t.fog,this},m.LineDashedMaterial=function(t){m.Material.call(this),this.type="LineDashedMaterial",this.color=new m.Color(16777215),this.scale=this.linewidth=1,this.dashSize=3,this.gapSize=1,this.vertexColors=m.NoColors,this.fog=!0,this.setValues(t)},m.LineDashedMaterial.prototype=Object.create(m.Material.prototype),m.LineDashedMaterial.prototype.constructor=m.LineDashedMaterial,m.LineDashedMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this.vertexColors=t.vertexColors,this.fog=t.fog,this},m.MeshBasicMaterial=function(t){m.Material.call(this),this.type="MeshBasicMaterial",this.color=new m.Color(16777215),this.aoMap=this.map=null,this.aoMapIntensity=1,this.envMap=this.alphaMap=this.specularMap=null,this.combine=m.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=m.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=m.NoColors,this.morphTargets=this.skinning=!1,this.setValues(t)},m.MeshBasicMaterial.prototype=Object.create(m.Material.prototype),m.MeshBasicMaterial.prototype.constructor=m.MeshBasicMaterial,m.MeshBasicMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},m.MeshLambertMaterial=function(t){m.Material.call(this),this.type="MeshLambertMaterial",this.color=new m.Color(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new m.Color(0),this.emissiveIntensity=1,this.envMap=this.alphaMap=this.specularMap=this.emissiveMap=null,this.combine=m.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=m.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)},m.MeshLambertMaterial.prototype=Object.create(m.Material.prototype),m.MeshLambertMaterial.prototype.constructor=m.MeshLambertMaterial,m.MeshLambertMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},m.MeshPhongMaterial=function(t){m.Material.call(this),this.type="MeshPhongMaterial",this.color=new m.Color(16777215),this.specular=new m.Color(1118481),this.shininess=30,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new m.Color(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new m.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.specularMap=null,this.combine=m.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=m.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=m.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)},m.MeshPhongMaterial.prototype=Object.create(m.Material.prototype),m.MeshPhongMaterial.prototype.constructor=m.MeshPhongMaterial,m.MeshPhongMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},m.MeshStandardMaterial=function(t){m.Material.call(this),this.type="MeshStandardMaterial",this.color=new m.Color(16777215),this.metalness=this.roughness=.5,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new m.Color(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new m.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.metalnessMap=this.roughnessMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.fog=!0,this.shading=m.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=m.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)},m.MeshStandardMaterial.prototype=Object.create(m.Material.prototype),m.MeshStandardMaterial.prototype.constructor=m.MeshStandardMaterial,m.MeshStandardMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},m.MeshDepthMaterial=function(t){m.Material.call(this),this.type="MeshDepthMaterial",this.wireframe=this.morphTargets=!1,this.wireframeLinewidth=1,this.setValues(t)},m.MeshDepthMaterial.prototype=Object.create(m.Material.prototype),m.MeshDepthMaterial.prototype.constructor=m.MeshDepthMaterial,m.MeshDepthMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},m.MeshNormalMaterial=function(t){m.Material.call(this,t),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(t)},m.MeshNormalMaterial.prototype=Object.create(m.Material.prototype),m.MeshNormalMaterial.prototype.constructor=m.MeshNormalMaterial,m.MeshNormalMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},m.MultiMaterial=function(t){this.uuid=m.Math.generateUUID(),this.type="MultiMaterial",this.materials=t instanceof Array?t:[],this.visible=!0},m.MultiMaterial.prototype={constructor:m.MultiMaterial,toJSON:function(t){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},r=this.materials,i=0,n=r.length;i<n;i++){var o=r[i].toJSON(t);delete o.metadata,e.materials.push(o)}return e.visible=this.visible,e},clone:function(){for(var t=new this.constructor,e=0;e<this.materials.length;e++)t.materials.push(this.materials[e].clone());return t.visible=this.visible,t}},m.PointsMaterial=function(t){m.Material.call(this),this.type="PointsMaterial",this.color=new m.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.vertexColors=m.NoColors,this.fog=!0,this.setValues(t)},m.PointsMaterial.prototype=Object.create(m.Material.prototype),m.PointsMaterial.prototype.constructor=m.PointsMaterial,m.PointsMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.vertexColors=t.vertexColors,this.fog=t.fog,this},m.ShaderMaterial=function(t){m.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.shading=m.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.lights=this.fog=!1,this.vertexColors=m.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))},m.ShaderMaterial.prototype=Object.create(m.Material.prototype),m.ShaderMaterial.prototype.constructor=m.ShaderMaterial,m.ShaderMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=m.UniformsUtils.clone(t.uniforms),this.defines=t.defines,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},m.ShaderMaterial.prototype.toJSON=function(t){return t=m.Material.prototype.toJSON.call(this,t),t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},m.RawShaderMaterial=function(t){m.ShaderMaterial.call(this,t),this.type="RawShaderMaterial"},m.RawShaderMaterial.prototype=Object.create(m.ShaderMaterial.prototype),m.RawShaderMaterial.prototype.constructor=m.RawShaderMaterial,m.SpriteMaterial=function(t){m.Material.call(this),this.type="SpriteMaterial",this.color=new m.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(t)},m.SpriteMaterial.prototype=Object.create(m.Material.prototype),m.SpriteMaterial.prototype.constructor=m.SpriteMaterial,m.SpriteMaterial.prototype.copy=function(t){return m.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.fog=t.fog,this},m.Texture=function(t,e,r,i,n,o,a,s,h){Object.defineProperty(this,"id",{value:m.TextureIdCount++}),this.uuid=m.Math.generateUUID(),this.sourceFile=this.name="",this.image=void 0!==t?t:m.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:m.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:m.ClampToEdgeWrapping,this.wrapT=void 0!==i?i:m.ClampToEdgeWrapping,this.magFilter=void 0!==n?n:m.LinearFilter,this.minFilter=void 0!==o?o:m.LinearMipMapLinearFilter,this.anisotropy=void 0!==h?h:1,this.format=void 0!==a?a:m.RGBAFormat,this.type=void 0!==s?s:m.UnsignedByteType,this.offset=new m.Vector2(0,0),this.repeat=new m.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.version=0,this.onUpdate=null},m.Texture.DEFAULT_IMAGE=void 0,m.Texture.DEFAULT_MAPPING=m.UVMapping,m.Texture.prototype={constructor:m.Texture,set needsUpdate(t){!0===t&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this},toJSON:function(t){if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var e={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=m.Math.generateUUID()),void 0===t.images[r.uuid]){var i,n=t.images,o=r.uuid,a=r.uuid;void 0!==r.toDataURL?i=r:(i=document.createElement("canvas"),i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0,r.width,r.height)),i=2048<i.width||2048<i.height?i.toDataURL("image/jpeg",.6):i.toDataURL("image/png"),n[o]={uuid:a,url:i}}e.image=r.uuid}return t.textures[this.uuid]=e},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===m.UVMapping){if(t.multiply(this.repeat),t.add(this.offset),0>t.x||1<t.x)switch(this.wrapS){case m.RepeatWrapping:t.x-=Math.floor(t.x);break;case m.ClampToEdgeWrapping:t.x=0>t.x?0:1;break;case m.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x-=Math.floor(t.x)}if(0>t.y||1<t.y)switch(this.wrapT){case m.RepeatWrapping:t.y-=Math.floor(t.y);break;case m.ClampToEdgeWrapping:t.y=0>t.y?0:1;break;case m.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y-=Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}},m.EventDispatcher.prototype.apply(m.Texture.prototype),m.TextureIdCount=0,m.CanvasTexture=function(t,e,r,i,n,o,a,s,h){m.Texture.call(this,t,e,r,i,n,o,a,s,h),this.needsUpdate=!0},m.CanvasTexture.prototype=Object.create(m.Texture.prototype),m.CanvasTexture.prototype.constructor=m.CanvasTexture,m.CubeTexture=function(t,e,r,i,n,o,a,s,h){e=void 0!==e?e:m.CubeReflectionMapping,m.Texture.call(this,t,e,r,i,n,o,a,s,h),this.images=t,this.flipY=!1},m.CubeTexture.prototype=Object.create(m.Texture.prototype),m.CubeTexture.prototype.constructor=m.CubeTexture,m.CubeTexture.prototype.copy=function(t){return m.Texture.prototype.copy.call(this,t),this.images=t.images,this},m.CompressedTexture=function(t,e,r,i,n,o,a,s,h,c,l){m.Texture.call(this,null,o,a,s,h,c,i,n,l),this.image={width:e,height:r},this.mipmaps=t,this.generateMipmaps=this.flipY=!1},m.CompressedTexture.prototype=Object.create(m.Texture.prototype),m.CompressedTexture.prototype.constructor=m.CompressedTexture,m.DataTexture=function(t,e,r,i,n,o,a,s,h,c,l){m.Texture.call(this,null,o,a,s,h,c,i,n,l),this.image={data:t,width:e,height:r},this.magFilter=void 0!==h?h:m.NearestFilter,this.minFilter=void 0!==c?c:m.NearestFilter,this.generateMipmaps=this.flipY=!1},m.DataTexture.prototype=Object.create(m.Texture.prototype),m.DataTexture.prototype.constructor=m.DataTexture,m.VideoTexture=function(t,e,r,i,n,o,a,s,h){function c(){requestAnimationFrame(c),t.readyState===t.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)}m.Texture.call(this,t,e,r,i,n,o,a,s,h),this.generateMipmaps=!1;var l=this;c()},m.VideoTexture.prototype=Object.create(m.Texture.prototype),m.VideoTexture.prototype.constructor=m.VideoTexture,m.Group=function(){m.Object3D.call(this),this.type="Group"},m.Group.prototype=Object.create(m.Object3D.prototype),m.Group.prototype.constructor=m.Group,m.Points=function(t,e){m.Object3D.call(this),this.type="Points",this.geometry=void 0!==t?t:new m.Geometry,this.material=void 0!==e?e:new m.PointsMaterial({color:16777215*Math.random()})},m.Points.prototype=Object.create(m.Object3D.prototype),m.Points.prototype.constructor=m.Points,m.Points.prototype.raycast=function(){var t=new m.Matrix4,e=new m.Ray,r=new m.Sphere;return function(i,n){function o(t,r){var o=e.distanceSqToPoint(t);if(o<l){var s=e.closestPointToPoint(t);s.applyMatrix4(h);var c=i.ray.origin.distanceTo(s);c<i.near||c>i.far||n.push({distance:c,distanceToRay:Math.sqrt(o),point:s.clone(),index:r,face:null,object:a})}}var a=this,s=this.geometry,h=this.matrixWorld,c=i.params.Points.threshold;if(null===s.boundingSphere&&s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(h),!1!==i.ray.intersectsSphere(r)){t.getInverse(h),e.copy(i.ray).applyMatrix4(t);var l=(c/=(this.scale.x+this.scale.y+this.scale.z)/3)*c,c=new m.Vector3;if(s instanceof m.BufferGeometry){var u=s.index,s=s.attributes.position.array;if(null!==u)for(var p=u.array,u=0,d=p.length;u<d;u++){var f=p[u];c.fromArray(s,3*f),o(c,f)}else for(u=0,p=s.length/3;u<p;u++)c.fromArray(s,3*u),o(c,u)}else for(c=s.vertices,u=0,p=c.length;u<p;u++)o(c[u],u)}}}(),m.Points.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},m.Line=function(t,e,r){if(1===r)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new m.LineSegments(t,e);m.Object3D.call(this),this.type="Line",this.geometry=void 0!==t?t:new m.Geometry,this.material=void 0!==e?e:new m.LineBasicMaterial({color:16777215*Math.random()})},m.Line.prototype=Object.create(m.Object3D.prototype),m.Line.prototype.constructor=m.Line,m.Line.prototype.raycast=function(){var t=new m.Matrix4,e=new m.Ray,r=new m.Sphere;return function(i,n){var o=(o=i.linePrecision)*o,a=this.geometry,s=this.matrixWorld;if(null===a.boundingSphere&&a.computeBoundingSphere(),r.copy(a.boundingSphere),r.applyMatrix4(s),!1!==i.ray.intersectsSphere(r)){t.getInverse(s),e.copy(i.ray).applyMatrix4(t);var h=new m.Vector3,c=new m.Vector3,s=new m.Vector3,l=new m.Vector3,u=this instanceof m.LineSegments?2:1;if(a instanceof m.BufferGeometry){var p=a.index,d=a.attributes.position.array;if(null!==p)for(var p=p.array,a=0,f=p.length-1;a<f;a+=u){var g=p[a+1];h.fromArray(d,3*p[a]),c.fromArray(d,3*g),(g=e.distanceSqToSegment(h,c,l,s))>o||(l.applyMatrix4(this.matrixWorld),(g=i.ray.origin.distanceTo(l))<i.near||g>i.far||n.push({distance:g,point:s.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}else for(a=0,f=d.length/3-1;a<f;a+=u)h.fromArray(d,3*a),c.fromArray(d,3*a+3),(g=e.distanceSqToSegment(h,c,l,s))>o||(l.applyMatrix4(this.matrixWorld),(g=i.ray.origin.distanceTo(l))<i.near||g>i.far||n.push({distance:g,point:s.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}else if(a instanceof m.Geometry)for(h=a.vertices,c=h.length,a=0;a<c-1;a+=u)(g=e.distanceSqToSegment(h[a],h[a+1],l,s))>o||(l.applyMatrix4(this.matrixWorld),(g=i.ray.origin.distanceTo(l))<i.near||g>i.far||n.push({distance:g,point:s.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}}}(),m.Line.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},m.LineStrip=0,m.LinePieces=1,m.LineSegments=function(t,e){m.Line.call(this,t,e),this.type="LineSegments"},m.LineSegments.prototype=Object.create(m.Line.prototype),m.LineSegments.prototype.constructor=m.LineSegments,m.Mesh=function(t,e){m.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new m.Geometry,this.material=void 0!==e?e:new m.MeshBasicMaterial({color:16777215*Math.random()}),this.drawMode=m.TrianglesDrawMode,this.updateMorphTargets()},m.Mesh.prototype=Object.create(m.Object3D.prototype),m.Mesh.prototype.constructor=m.Mesh,m.Mesh.prototype.setDrawMode=function(t){this.drawMode=t},m.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1,this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var t=0,e=this.geometry.morphTargets.length;t<e;t++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[t].name]=t}},m.Mesh.prototype.getMorphTargetIndexByName=function(t){return void 0!==this.morphTargetDictionary[t]?this.morphTargetDictionary[t]:(console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+t+" does not exist. Returning 0."),0)},m.Mesh.prototype.raycast=function(){function t(t,e,r,i,n,o,a){return m.Triangle.barycoordFromPoint(t,e,r,i,g),n.multiplyScalar(g.x),o.multiplyScalar(g.y),a.multiplyScalar(g.z),n.add(o).add(a),n.clone()}function e(t,e,r,i,n,o,a){var s=t.material;return null===(s.side===m.BackSide?r.intersectTriangle(o,n,i,!0,a):r.intersectTriangle(i,n,o,s.side!==m.DoubleSide,a))?null:(y.copy(a),y.applyMatrix4(t.matrixWorld),r=e.ray.origin.distanceTo(y),r<e.near||r>e.far?null:{distance:r,point:y.clone(),object:t})}function r(r,i,n,o,c,l,u,g){return a.fromArray(o,3*l),s.fromArray(o,3*u),h.fromArray(o,3*g),(r=e(r,i,n,a,s,h,v))&&(c&&(p.fromArray(c,2*l),d.fromArray(c,2*u),f.fromArray(c,2*g),r.uv=t(v,a,s,h,p,d,f)),r.face=new m.Face3(l,u,g,m.Triangle.normal(a,s,h)),r.faceIndex=l),r}var i=new m.Matrix4,n=new m.Ray,o=new m.Sphere,a=new m.Vector3,s=new m.Vector3,h=new m.Vector3,c=new m.Vector3,l=new m.Vector3,u=new m.Vector3,p=new m.Vector2,d=new m.Vector2,f=new m.Vector2,g=new m.Vector3,v=new m.Vector3,y=new m.Vector3;return function(g,y){var x=this.geometry,b=this.material,_=this.matrixWorld;if(void 0!==b&&(null===x.boundingSphere&&x.computeBoundingSphere(),o.copy(x.boundingSphere),o.applyMatrix4(_),!1!==g.ray.intersectsSphere(o)&&(i.getInverse(_),n.copy(g.ray).applyMatrix4(i),null===x.boundingBox||!1!==n.intersectsBox(x.boundingBox)))){var M,w;if(x instanceof m.BufferGeometry){var S,E,b=x.index,x=(_=x.attributes).position.array;if(void 0!==_.uv&&(M=_.uv.array),null!==b)for(var _=b.array,T=0,C=_.length;T<C;T+=3)b=_[T],S=_[T+1],E=_[T+2],(w=r(this,g,n,x,M,b,S,E))&&(w.faceIndex=Math.floor(T/3),y.push(w));else for(T=0,C=x.length;T<C;T+=9)b=T/3,S=b+1,E=b+2,(w=r(this,g,n,x,M,b,S,E))&&(w.index=b,y.push(w))}else if(x instanceof m.Geometry){var L,A,T=!0==(_=b instanceof m.MultiMaterial)?b.materials:null,C=x.vertices;S=x.faces,0<(E=x.faceVertexUvs[0]).length&&(M=E);for(var P=0,R=S.length;P<R;P++){var U=S[P];if(void 0!==(w=!0===_?T[U.materialIndex]:b)){if(E=C[U.a],L=C[U.b],A=C[U.c],!0===w.morphTargets){w=x.morphTargets;var k=this.morphTargetInfluences;a.set(0,0,0),s.set(0,0,0),h.set(0,0,0);for(var D=0,I=w.length;D<I;D++){var F=k[D];if(0!==F){var B=w[D].vertices;a.addScaledVector(c.subVectors(B[U.a],E),F),s.addScaledVector(l.subVectors(B[U.b],L),F),h.addScaledVector(u.subVectors(B[U.c],A),F)}}a.add(E),s.add(L),h.add(A),E=a,L=s,A=h}(w=e(this,g,n,E,L,A,v))&&(M&&(k=M[P],p.copy(k[0]),d.copy(k[1]),f.copy(k[2]),w.uv=t(v,E,L,A,p,d,f)),w.face=U,w.faceIndex=P,y.push(w))}}}}}}(),m.Mesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},m.Bone=function(t){m.Object3D.call(this),this.type="Bone",this.skin=t},m.Bone.prototype=Object.create(m.Object3D.prototype),m.Bone.prototype.constructor=m.Bone,m.Bone.prototype.copy=function(t){return m.Object3D.prototype.copy.call(this,t),this.skin=t.skin,this},m.Skeleton=function(t,e,r){if(this.useVertexTexture=void 0===r||r,this.identityMatrix=new m.Matrix4,t=t||[],this.bones=t.slice(0),this.useVertexTexture?(t=Math.sqrt(4*this.bones.length),t=m.Math.nextPowerOfTwo(Math.ceil(t)),this.boneTextureHeight=this.boneTextureWidth=t=Math.max(t,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new m.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,m.RGBAFormat,m.FloatType)):this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new m.Matrix4)},m.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var r=new m.Matrix4;this.bones[t]&&r.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(r)}},m.Skeleton.prototype.pose=function(){for(var t,e=0,r=this.bones.length;e<r;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,r=this.bones.length;e<r;e++)(t=this.bones[e])&&(t.parent?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},m.Skeleton.prototype.update=function(){var t=new m.Matrix4;return function(){for(var e=0,r=this.bones.length;e<r;e++)t.multiplyMatrices(this.bones[e]?this.bones[e].matrixWorld:this.identityMatrix,this.boneInverses[e]),t.flattenToArrayOffset(this.boneMatrices,16*e);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),m.Skeleton.prototype.clone=function(){return new m.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)},m.SkinnedMesh=function(t,e,r){if(m.Mesh.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new m.Matrix4,this.bindMatrixInverse=new m.Matrix4,t=[],this.geometry&&void 0!==this.geometry.bones){for(var i,n=0,o=this.geometry.bones.length;n<o;++n)i=this.geometry.bones[n],e=new m.Bone(this),t.push(e),e.name=i.name,e.position.fromArray(i.pos),e.quaternion.fromArray(i.rotq),void 0!==i.scl&&e.scale.fromArray(i.scl);for(n=0,o=this.geometry.bones.length;n<o;++n)i=this.geometry.bones[n],-1!==i.parent&&null!==i.parent?t[i.parent].add(t[n]):this.add(t[n])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new m.Skeleton(t,void 0,r),this.matrixWorld)},m.SkinnedMesh.prototype=Object.create(m.Mesh.prototype),m.SkinnedMesh.prototype.constructor=m.SkinnedMesh,m.SkinnedMesh.prototype.bind=function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},m.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},m.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof m.Geometry)for(i=0;i<this.geometry.skinWeights.length;i++){var t=1/(e=this.geometry.skinWeights[i]).lengthManhattan();1/0!==t?e.multiplyScalar(t):e.set(1,0,0,0)}else if(this.geometry instanceof m.BufferGeometry)for(var e=new m.Vector4,r=this.geometry.attributes.skinWeight,i=0;i<r.count;i++)e.x=r.getX(i),e.y=r.getY(i),e.z=r.getZ(i),e.w=r.getW(i),t=1/e.lengthManhattan(),1/0!==t?e.multiplyScalar(t):e.set(1,0,0,0),r.setXYZW(i,e.x,e.y,e.z,e.w)},m.SkinnedMesh.prototype.updateMatrixWorld=function(t){m.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},m.SkinnedMesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)},m.LOD=function(){m.Object3D.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}})},m.LOD.prototype=Object.create(m.Object3D.prototype),m.LOD.prototype.constructor=m.LOD,m.LOD.prototype.addLevel=function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var r=this.levels,i=0;i<r.length&&!(e<r[i].distance);i++);r.splice(i,0,{distance:e,object:t}),this.add(t)},m.LOD.prototype.getObjectForDistance=function(t){for(var e=this.levels,r=1,i=e.length;r<i&&!(t<e[r].distance);r++);return e[r-1].object},m.LOD.prototype.raycast=function(){var t=new m.Vector3;return function(e,r){t.setFromMatrixPosition(this.matrixWorld);var i=e.ray.origin.distanceTo(t);this.getObjectForDistance(i).raycast(e,r)}}(),m.LOD.prototype.update=function(){var t=new m.Vector3,e=new m.Vector3;return function(r){var i=this.levels;if(1<i.length){t.setFromMatrixPosition(r.matrixWorld),e.setFromMatrixPosition(this.matrixWorld),r=t.distanceTo(e),i[0].object.visible=!0;for(var n=1,o=i.length;n<o&&r>=i[n].distance;n++)i[n-1].object.visible=!1,i[n].object.visible=!0;for(;n<o;n++)i[n].object.visible=!1}}}(),m.LOD.prototype.copy=function(t){m.Object3D.prototype.copy.call(this,t,!1);for(var e=0,r=(t=t.levels).length;e<r;e++){var i=t[e];this.addLevel(i.object.clone(),i.distance)}return this},m.LOD.prototype.toJSON=function(t){(t=m.Object3D.prototype.toJSON.call(this,t)).object.levels=[];for(var e=this.levels,r=0,i=e.length;r<i;r++){var n=e[r];t.object.levels.push({object:n.object.uuid,distance:n.distance})}return t},m.Sprite=function(){var t=new Uint16Array([0,1,2,0,2,3]),e=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),r=new Float32Array([0,0,1,0,1,1,0,1]),i=new m.BufferGeometry;return i.setIndex(new m.BufferAttribute(t,1)),i.addAttribute("position",new m.BufferAttribute(e,3)),i.addAttribute("uv",new m.BufferAttribute(r,2)),function(t){m.Object3D.call(this),this.type="Sprite",this.geometry=i,this.material=void 0!==t?t:new m.SpriteMaterial}}(),m.Sprite.prototype=Object.create(m.Object3D.prototype),m.Sprite.prototype.constructor=m.Sprite,m.Sprite.prototype.raycast=function(){var t=new m.Vector3;return function(e,r){t.setFromMatrixPosition(this.matrixWorld);var i=e.ray.distanceSqToPoint(t);i>this.scale.x*this.scale.y||r.push({distance:Math.sqrt(i),point:this.position,face:null,object:this})}}(),m.Sprite.prototype.clone=function(){return new this.constructor(this.material).copy(this)},m.Particle=m.Sprite,m.LensFlare=function(t,e,r,i,n){m.Object3D.call(this),this.lensFlares=[],this.positionScreen=new m.Vector3,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,r,i,n)},m.LensFlare.prototype=Object.create(m.Object3D.prototype),m.LensFlare.prototype.constructor=m.LensFlare,m.LensFlare.prototype.add=function(t,e,r,i,n,o){void 0===e&&(e=-1),void 0===r&&(r=0),void 0===o&&(o=1),void 0===n&&(n=new m.Color(16777215)),void 0===i&&(i=m.NormalBlending),r=Math.min(r,Math.max(0,r)),this.lensFlares.push({texture:t,size:e,distance:r,x:0,y:0,z:0,scale:1,rotation:0,opacity:o,color:n,blending:i})},m.LensFlare.prototype.updateLensFlares=function(){var t,e,r=this.lensFlares.length,i=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(t=0;t<r;t++)e=this.lensFlares[t],e.x=this.positionScreen.x+i*e.distance,e.y=this.positionScreen.y+n*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)},m.LensFlare.prototype.copy=function(t){m.Object3D.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var e=0,r=t.lensFlares.length;e<r;e++)this.lensFlares.push(t.lensFlares[e]);return this},m.Scene=function(){m.Object3D.call(this),this.type="Scene",this.overrideMaterial=this.fog=null,this.autoUpdate=!0},m.Scene.prototype=Object.create(m.Object3D.prototype),m.Scene.prototype.constructor=m.Scene,m.Scene.prototype.copy=function(t){return m.Object3D.prototype.copy.call(this,t),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},m.Fog=function(t,e,r){this.name="",this.color=new m.Color(t),this.near=void 0!==e?e:1,this.far=void 0!==r?r:1e3},m.Fog.prototype.clone=function(){return new m.Fog(this.color.getHex(),this.near,this.far)},m.FogExp2=function(t,e){this.name="",this.color=new m.Color(t),this.density=void 0!==e?e:25e-5},m.FogExp2.prototype.clone=function(){return new m.FogExp2(this.color.getHex(),this.density)},m.ShaderChunk={},m.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",m.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",m.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",m.ShaderChunk.ambient_pars="uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\treturn PI * ambientLightColor;\n}\n",m.ShaderChunk.aomap_fragment="#ifdef USE_AOMAP\n\treflectedLight.indirectDiffuse *= ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n#endif\n",m.ShaderChunk.aomap_pars_fragment="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",m.ShaderChunk.begin_vertex="\nvec3 transformed = vec3( position );\n",m.ShaderChunk.beginnormal_vertex="\nvec3 objectNormal = vec3( normal );\n",m.ShaderChunk.bsdfs="float calcLightAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif ( decayExponent > 0.0 ) {\n\t  return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = alpha * alpha;\n\tfloat gl = dotNL + pow( a2 + ( 1.0 - a2 ) * dotNL * dotNL, 0.5 );\n\tfloat gv = dotNV + pow( a2 + ( 1.0 - a2 ) * dotNV * dotNV, 0.5 );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = alpha * alpha;\n\tfloat denom = dotNH * dotNH * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / ( denom * denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = roughness * roughness;\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / square( ggxRoughness + 0.0001 ) - 2.0 );\n}",m.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",m.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",m.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",m.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",m.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",m.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat square( const in float x ) { return x*x; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nvec3 inputToLinear( in vec3 a ) {\n\t#ifdef GAMMA_INPUT\n\t\treturn pow( a, vec3( float( GAMMA_FACTOR ) ) );\n\t#else\n\t\treturn a;\n\t#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n\t#ifdef GAMMA_OUTPUT\n\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n\t#else\n\t\treturn a;\n\t#endif\n}\n",m.ShaderChunk.defaultnormal_vertex="#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",m.ShaderChunk.displacementmap_vertex="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",m.ShaderChunk.displacementmap_pars_vertex="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",m.ShaderChunk.emissivemap_fragment="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = inputToLinear( emissiveColor.rgb );\n\ttotalEmissiveLight *= emissiveColor.rgb;\n#endif\n",m.ShaderChunk.emissivemap_pars_fragment="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",m.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor.xyz = inputToLinear( envColor.xyz );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",m.ShaderChunk.envmap_pars_fragment="#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",m.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",m.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",m.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\t\n\toutgoingLight = mix( outgoingLight, fogColor, fogFactor );\n#endif",m.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",m.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",m.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",m.ShaderChunk.lights_lambert_vertex="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLight( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLight( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLight( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",m.ShaderChunk.lights_pars="#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLight( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLight( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= calcLightAttenuation( length( lVector ), pointLight.distance, pointLight.decay );\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat angleCos;\n\t\tfloat exponent;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLight( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat spotEffect = dot( directLight.direction, spotLight.direction );\n\t\tif ( spotEffect > spotLight.angleCos ) {\n\t\t\tfloat spotEffect = dot( spotLight.direction, directLight.direction );\n\t\t\tspotEffect = saturate( pow( saturate( spotEffect ), spotLight.exponent ) );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= ( spotEffect * calcLightAttenuation( length( lVector ), spotLight.distance, spotLight.decay ) );\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\treturn PI * mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#else\n\t\t\tvec3 envMapColor = vec3( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = inputToLinear( envMapColor.rgb );\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( square( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = inputToLinear( envMapColor.rgb );\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",m.ShaderChunk.lights_phong_fragment="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",m.ShaderChunk.lights_phong_pars_fragment="#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * PI * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",m.ShaderChunk.lights_phong_pars_vertex="#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",m.ShaderChunk.lights_phong_vertex="#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",m.ShaderChunk.lights_standard_fragment="StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",m.ShaderChunk.lights_standard_pars_fragment="struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * PI * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\n",m.ShaderChunk.lights_template="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLight( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLight( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLight( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tirradiance += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",m.ShaderChunk.linear_to_gamma_fragment="\n\toutgoingLight = linearToOutput( outgoingLight );\n",m.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",m.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",m.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",m.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",m.ShaderChunk.map_fragment="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor.xyz = inputToLinear( texelColor.xyz );\n\tdiffuseColor *= texelColor;\n#endif\n",m.ShaderChunk.map_pars_fragment="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",m.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n#endif\n",m.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",m.ShaderChunk.metalnessmap_fragment="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",m.ShaderChunk.metalnessmap_pars_fragment="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",m.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",m.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",m.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",m.ShaderChunk.normal_fragment="#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",m.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",m.ShaderChunk.project_vertex="#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",m.ShaderChunk.roughnessmap_fragment="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",m.ShaderChunk.roughnessmap_pars_fragment="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",m.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec3 offset = vec3( - 1, 0, 1 ) * shadowRadius * 2.0 * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zzz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zxz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xzz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zzx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xzx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zzy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xzy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zyz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yzz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yzx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 21.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",m.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",m.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",m.ShaderChunk.shadowmask_pars_fragment="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",m.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",m.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",m.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned  = bindMatrixInverse * skinned;\n#endif\n",m.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",m.ShaderChunk.specularmap_fragment="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",m.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",m.ShaderChunk.uv2_pars_fragment="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",m.ShaderChunk.uv2_pars_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",m.ShaderChunk.uv2_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",m.ShaderChunk.uv_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",m.ShaderChunk.uv_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",m.ShaderChunk.uv_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",m.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",m.UniformsUtils={merge:function(t){for(var e={},r=0;r<t.length;r++){var i,n=this.clone(t[r]);for(i in n)e[i]=n[i]}return e},clone:function(t){var e,r={};for(e in t){r[e]={};for(var i in t[e]){var n=t[e][i];n instanceof m.Color||n instanceof m.Vector2||n instanceof m.Vector3||n instanceof m.Vector4||n instanceof m.Matrix3||n instanceof m.Matrix4||n instanceof m.Texture?r[e][i]=n.clone():Array.isArray(n)?r[e][i]=n.slice():r[e][i]=n}}return r}},m.UniformsLib={common:{diffuse:{type:"c",value:new m.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new m.Vector4(0,0,1,1)},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98}},aomap:{aoMap:{type:"t",value:null},aoMapIntensity:{type:"f",value:1}},lightmap:{lightMap:{type:"t",value:null},lightMapIntensity:{type:"f",value:1}},emissivemap:{emissiveMap:{type:"t",value:null}},bumpmap:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new m.Vector2(1,1)}},displacementmap:{displacementMap:{type:"t",value:null},displacementScale:{type:"f",value:1},displacementBias:{type:"f",value:0}},roughnessmap:{roughnessMap:{type:"t",value:null}},metalnessmap:{metalnessMap:{type:"t",value:null}},fog:{fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new m.Color(16777215)}},ambient:{ambientLightColor:{type:"fv",value:[]}},lights:{directionalLights:{type:"sa",value:[],properties:{direction:{type:"v3"},color:{type:"c"},shadow:{type:"i"},shadowBias:{type:"f"},shadowRadius:{type:"f"},shadowMapSize:{type:"v2"}}},directionalShadowMap:{type:"tv",value:[]},directionalShadowMatrix:{type:"m4v",value:[]},spotLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},direction:{type:"v3"},distance:{type:"f"},angleCos:{type:"f"},exponent:{type:"f"},decay:{type:"f"},shadow:{type:"i"},shadowBias:{type:"f"},shadowRadius:{type:"f"},shadowMapSize:{type:"v2"}}},spotShadowMap:{type:"tv",value:[]},spotShadowMatrix:{type:"m4v",value:[]},pointLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},decay:{type:"f"},distance:{type:"f"},shadow:{type:"i"},shadowBias:{type:"f"},shadowRadius:{type:"f"},shadowMapSize:{type:"v2"}}},pointShadowMap:{type:"tv",value:[]},pointShadowMatrix:{type:"m4v",value:[]},hemisphereLights:{type:"sa",value:[],properties:{direction:{type:"v3"},skyColor:{type:"c"},groundColor:{type:"c"}}}},points:{diffuse:{type:"c",value:new m.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new m.Vector4(0,0,1,1)}}},m.ShaderLib={basic:{uniforms:m.UniformsUtils.merge([m.UniformsLib.common,m.UniformsLib.aomap,m.UniformsLib.fog]),vertexShader:[m.ShaderChunk.common,m.ShaderChunk.uv_pars_vertex,m.ShaderChunk.uv2_pars_vertex,m.ShaderChunk.envmap_pars_vertex,m.ShaderChunk.color_pars_vertex,m.ShaderChunk.morphtarget_pars_vertex,m.ShaderChunk.skinning_pars_vertex,m.ShaderChunk.shadowmap_pars_vertex,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",m.ShaderChunk.uv_vertex,m.ShaderChunk.uv2_vertex,m.ShaderChunk.color_vertex,m.ShaderChunk.skinbase_vertex,"\t#ifdef USE_ENVMAP",m.ShaderChunk.beginnormal_vertex,m.ShaderChunk.morphnormal_vertex,m.ShaderChunk.skinnormal_vertex,m.ShaderChunk.defaultnormal_vertex,"\t#endif",m.ShaderChunk.begin_vertex,m.ShaderChunk.morphtarget_vertex,m.ShaderChunk.skinning_vertex,m.ShaderChunk.project_vertex,m.ShaderChunk.logdepthbuf_vertex,m.ShaderChunk.worldpos_vertex,m.ShaderChunk.envmap_vertex,m.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",m.ShaderChunk.common,m.ShaderChunk.color_pars_fragment,m.ShaderChunk.uv_pars_fragment,m.ShaderChunk.uv2_pars_fragment,m.ShaderChunk.map_pars_fragment,m.ShaderChunk.alphamap_pars_fragment,m.ShaderChunk.aomap_pars_fragment,m.ShaderChunk.envmap_pars_fragment,m.ShaderChunk.fog_pars_fragment,m.ShaderChunk.shadowmap_pars_fragment,m.ShaderChunk.specularmap_pars_fragment,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );",m.ShaderChunk.logdepthbuf_fragment,m.ShaderChunk.map_fragment,m.ShaderChunk.color_fragment,m.ShaderChunk.alphamap_fragment,m.ShaderChunk.alphatest_fragment,m.ShaderChunk.specularmap_fragment,"\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );",m.ShaderChunk.aomap_fragment,"\tvec3 outgoingLight = reflectedLight.indirectDiffuse;",m.ShaderChunk.envmap_fragment,m.ShaderChunk.linear_to_gamma_fragment,m.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},lambert:{uniforms:m.UniformsUtils.merge([m.UniformsLib.common,m.UniformsLib.aomap,m.UniformsLib.lightmap,m.UniformsLib.emissivemap,m.UniformsLib.fog,m.UniformsLib.ambient,m.UniformsLib.lights,{emissive:{type:"c",value:new m.Color(0)}}]),vertexShader:["#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif",m.ShaderChunk.common,m.ShaderChunk.uv_pars_vertex,m.ShaderChunk.uv2_pars_vertex,m.ShaderChunk.envmap_pars_vertex,m.ShaderChunk.bsdfs,m.ShaderChunk.lights_pars,m.ShaderChunk.color_pars_vertex,m.ShaderChunk.morphtarget_pars_vertex,m.ShaderChunk.skinning_pars_vertex,m.ShaderChunk.shadowmap_pars_vertex,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",m.ShaderChunk.uv_vertex,m.ShaderChunk.uv2_vertex,m.ShaderChunk.color_vertex,m.ShaderChunk.beginnormal_vertex,m.ShaderChunk.morphnormal_vertex,m.ShaderChunk.skinbase_vertex,m.ShaderChunk.skinnormal_vertex,m.ShaderChunk.defaultnormal_vertex,m.ShaderChunk.begin_vertex,m.ShaderChunk.morphtarget_vertex,m.ShaderChunk.skinning_vertex,m.ShaderChunk.project_vertex,m.ShaderChunk.logdepthbuf_vertex,m.ShaderChunk.worldpos_vertex,m.ShaderChunk.envmap_vertex,m.ShaderChunk.lights_lambert_vertex,m.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif",m.ShaderChunk.common,m.ShaderChunk.color_pars_fragment,m.ShaderChunk.uv_pars_fragment,m.ShaderChunk.uv2_pars_fragment,m.ShaderChunk.map_pars_fragment,m.ShaderChunk.alphamap_pars_fragment,m.ShaderChunk.aomap_pars_fragment,m.ShaderChunk.lightmap_pars_fragment,m.ShaderChunk.emissivemap_pars_fragment,m.ShaderChunk.envmap_pars_fragment,m.ShaderChunk.bsdfs,m.ShaderChunk.ambient_pars,m.ShaderChunk.lights_pars,m.ShaderChunk.fog_pars_fragment,m.ShaderChunk.shadowmap_pars_fragment,m.ShaderChunk.shadowmask_pars_fragment,m.ShaderChunk.specularmap_pars_fragment,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveLight = emissive;",m.ShaderChunk.logdepthbuf_fragment,m.ShaderChunk.map_fragment,m.ShaderChunk.color_fragment,m.ShaderChunk.alphamap_fragment,m.ShaderChunk.alphatest_fragment,m.ShaderChunk.specularmap_fragment,m.ShaderChunk.emissivemap_fragment,"\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );",m.ShaderChunk.lightmap_fragment,"\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();",m.ShaderChunk.aomap_fragment,"\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveLight;",m.ShaderChunk.envmap_fragment,m.ShaderChunk.linear_to_gamma_fragment,m.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},phong:{uniforms:m.UniformsUtils.merge([m.UniformsLib.common,m.UniformsLib.aomap,m.UniformsLib.lightmap,m.UniformsLib.emissivemap,m.UniformsLib.bumpmap,m.UniformsLib.normalmap,m.UniformsLib.displacementmap,m.UniformsLib.fog,m.UniformsLib.ambient,m.UniformsLib.lights,{emissive:{type:"c",value:new m.Color(0)},specular:{type:"c",value:new m.Color(1118481)},shininess:{type:"f",value:30}}]),vertexShader:["#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",m.ShaderChunk.common,m.ShaderChunk.uv_pars_vertex,m.ShaderChunk.uv2_pars_vertex,m.ShaderChunk.displacementmap_pars_vertex,m.ShaderChunk.envmap_pars_vertex,m.ShaderChunk.lights_phong_pars_vertex,m.ShaderChunk.color_pars_vertex,m.ShaderChunk.morphtarget_pars_vertex,m.ShaderChunk.skinning_pars_vertex,m.ShaderChunk.shadowmap_pars_vertex,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",m.ShaderChunk.uv_vertex,m.ShaderChunk.uv2_vertex,m.ShaderChunk.color_vertex,m.ShaderChunk.beginnormal_vertex,m.ShaderChunk.morphnormal_vertex,m.ShaderChunk.skinbase_vertex,m.ShaderChunk.skinnormal_vertex,m.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif",m.ShaderChunk.begin_vertex,m.ShaderChunk.displacementmap_vertex,m.ShaderChunk.morphtarget_vertex,m.ShaderChunk.skinning_vertex,m.ShaderChunk.project_vertex,m.ShaderChunk.logdepthbuf_vertex,"\tvViewPosition = - mvPosition.xyz;",m.ShaderChunk.worldpos_vertex,m.ShaderChunk.envmap_vertex,m.ShaderChunk.lights_phong_vertex,m.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;",m.ShaderChunk.common,m.ShaderChunk.color_pars_fragment,m.ShaderChunk.uv_pars_fragment,m.ShaderChunk.uv2_pars_fragment,m.ShaderChunk.map_pars_fragment,m.ShaderChunk.alphamap_pars_fragment,m.ShaderChunk.aomap_pars_fragment,m.ShaderChunk.lightmap_pars_fragment,m.ShaderChunk.emissivemap_pars_fragment,m.ShaderChunk.envmap_pars_fragment,m.ShaderChunk.fog_pars_fragment,m.ShaderChunk.bsdfs,m.ShaderChunk.ambient_pars,m.ShaderChunk.lights_pars,m.ShaderChunk.lights_phong_pars_fragment,m.ShaderChunk.shadowmap_pars_fragment,m.ShaderChunk.bumpmap_pars_fragment,m.ShaderChunk.normalmap_pars_fragment,m.ShaderChunk.specularmap_pars_fragment,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveLight = emissive;",m.ShaderChunk.logdepthbuf_fragment,m.ShaderChunk.map_fragment,m.ShaderChunk.color_fragment,m.ShaderChunk.alphamap_fragment,m.ShaderChunk.alphatest_fragment,m.ShaderChunk.specularmap_fragment,m.ShaderChunk.normal_fragment,m.ShaderChunk.emissivemap_fragment,m.ShaderChunk.lights_phong_fragment,m.ShaderChunk.lights_template,m.ShaderChunk.aomap_fragment,"vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;",m.ShaderChunk.envmap_fragment,m.ShaderChunk.linear_to_gamma_fragment,m.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},standard:{uniforms:m.UniformsUtils.merge([m.UniformsLib.common,m.UniformsLib.aomap,m.UniformsLib.lightmap,m.UniformsLib.emissivemap,m.UniformsLib.bumpmap,m.UniformsLib.normalmap,m.UniformsLib.displacementmap,m.UniformsLib.roughnessmap,m.UniformsLib.metalnessmap,m.UniformsLib.fog,m.UniformsLib.ambient,m.UniformsLib.lights,{emissive:{type:"c",value:new m.Color(0)},roughness:{type:"f",value:.5},metalness:{type:"f",value:0},envMapIntensity:{type:"f",value:1}}]),vertexShader:["#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",m.ShaderChunk.common,m.ShaderChunk.uv_pars_vertex,m.ShaderChunk.uv2_pars_vertex,m.ShaderChunk.displacementmap_pars_vertex,m.ShaderChunk.envmap_pars_vertex,m.ShaderChunk.color_pars_vertex,m.ShaderChunk.morphtarget_pars_vertex,m.ShaderChunk.skinning_pars_vertex,m.ShaderChunk.shadowmap_pars_vertex,m.ShaderChunk.specularmap_pars_fragment,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",m.ShaderChunk.uv_vertex,m.ShaderChunk.uv2_vertex,m.ShaderChunk.color_vertex,m.ShaderChunk.beginnormal_vertex,m.ShaderChunk.morphnormal_vertex,m.ShaderChunk.skinbase_vertex,m.ShaderChunk.skinnormal_vertex,m.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif",m.ShaderChunk.begin_vertex,m.ShaderChunk.displacementmap_vertex,m.ShaderChunk.morphtarget_vertex,m.ShaderChunk.skinning_vertex,m.ShaderChunk.project_vertex,m.ShaderChunk.logdepthbuf_vertex,"\tvViewPosition = - mvPosition.xyz;",m.ShaderChunk.worldpos_vertex,m.ShaderChunk.envmap_vertex,m.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",m.ShaderChunk.common,m.ShaderChunk.color_pars_fragment,m.ShaderChunk.uv_pars_fragment,m.ShaderChunk.uv2_pars_fragment,m.ShaderChunk.map_pars_fragment,m.ShaderChunk.alphamap_pars_fragment,m.ShaderChunk.aomap_pars_fragment,m.ShaderChunk.lightmap_pars_fragment,m.ShaderChunk.emissivemap_pars_fragment,m.ShaderChunk.envmap_pars_fragment,m.ShaderChunk.fog_pars_fragment,m.ShaderChunk.bsdfs,m.ShaderChunk.ambient_pars,m.ShaderChunk.lights_pars,m.ShaderChunk.lights_standard_pars_fragment,m.ShaderChunk.shadowmap_pars_fragment,m.ShaderChunk.bumpmap_pars_fragment,m.ShaderChunk.normalmap_pars_fragment,m.ShaderChunk.roughnessmap_pars_fragment,m.ShaderChunk.metalnessmap_pars_fragment,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveLight = emissive;",m.ShaderChunk.logdepthbuf_fragment,m.ShaderChunk.map_fragment,m.ShaderChunk.color_fragment,m.ShaderChunk.alphamap_fragment,m.ShaderChunk.alphatest_fragment,m.ShaderChunk.specularmap_fragment,m.ShaderChunk.roughnessmap_fragment,m.ShaderChunk.metalnessmap_fragment,m.ShaderChunk.normal_fragment,m.ShaderChunk.emissivemap_fragment,m.ShaderChunk.lights_standard_fragment,m.ShaderChunk.lights_template,m.ShaderChunk.aomap_fragment,"vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;",m.ShaderChunk.linear_to_gamma_fragment,m.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},points:{uniforms:m.UniformsUtils.merge([m.UniformsLib.points,m.UniformsLib.fog]),vertexShader:["uniform float size;\nuniform float scale;",m.ShaderChunk.common,m.ShaderChunk.color_pars_vertex,m.ShaderChunk.shadowmap_pars_vertex,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",m.ShaderChunk.color_vertex,m.ShaderChunk.begin_vertex,m.ShaderChunk.project_vertex,"\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif",m.ShaderChunk.logdepthbuf_vertex,m.ShaderChunk.worldpos_vertex,m.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;",m.ShaderChunk.common,m.ShaderChunk.color_pars_fragment,m.ShaderChunk.map_particle_pars_fragment,m.ShaderChunk.fog_pars_fragment,m.ShaderChunk.shadowmap_pars_fragment,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",m.ShaderChunk.logdepthbuf_fragment,m.ShaderChunk.map_particle_fragment,m.ShaderChunk.color_fragment,m.ShaderChunk.alphatest_fragment,"\toutgoingLight = diffuseColor.rgb;",m.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},dashed:{uniforms:m.UniformsUtils.merge([m.UniformsLib.common,m.UniformsLib.fog,{scale:{type:"f",value:1},dashSize:{type:"f",value:1},totalSize:{type:"f",value:2}}]),vertexShader:["uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;",m.ShaderChunk.common,m.ShaderChunk.color_pars_vertex,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",m.ShaderChunk.color_vertex,"\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;",m.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;",m.ShaderChunk.common,m.ShaderChunk.color_pars_fragment,m.ShaderChunk.fog_pars_fragment,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",m.ShaderChunk.logdepthbuf_fragment,m.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",m.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[m.ShaderChunk.common,m.ShaderChunk.morphtarget_pars_vertex,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",m.ShaderChunk.begin_vertex,m.ShaderChunk.morphtarget_vertex,m.ShaderChunk.project_vertex,m.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",m.ShaderChunk.common,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",m.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",m.ShaderChunk.common,m.ShaderChunk.morphtarget_pars_vertex,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );",m.ShaderChunk.begin_vertex,m.ShaderChunk.morphtarget_vertex,m.ShaderChunk.project_vertex,m.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",m.ShaderChunk.common,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",m.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",m.ShaderChunk.common,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",m.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",m.ShaderChunk.common,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",m.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",m.ShaderChunk.common,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",m.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",m.ShaderChunk.common,m.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",m.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[m.ShaderChunk.common,m.ShaderChunk.morphtarget_pars_vertex,m.ShaderChunk.skinning_pars_vertex,m.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",m.ShaderChunk.skinbase_vertex,m.ShaderChunk.begin_vertex,m.ShaderChunk.morphtarget_vertex,m.ShaderChunk.skinning_vertex,m.ShaderChunk.project_vertex,m.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[m.ShaderChunk.common,m.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",m.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")},distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new m.Vector3(0,0,0)}},vertexShader:["varying vec4 vWorldPosition;",m.ShaderChunk.common,m.ShaderChunk.morphtarget_pars_vertex,m.ShaderChunk.skinning_pars_vertex,"void main() {",m.ShaderChunk.skinbase_vertex,m.ShaderChunk.begin_vertex,m.ShaderChunk.morphtarget_vertex,m.ShaderChunk.skinning_vertex,m.ShaderChunk.project_vertex,m.ShaderChunk.worldpos_vertex,"vWorldPosition = worldPosition;\n}"].join("\n"),fragmentShader:["uniform vec3 lightPos;\nvarying vec4 vWorldPosition;",m.ShaderChunk.common,"vec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res; \n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}"].join("\n")}},m.WebGLRenderer=function(t){function e(t,e,r,i){!0===I&&(t*=i,e*=i,r*=i),xt.clearColor(t,e,r,i)}function r(){xt.init(),xt.scissor(J.copy(st).multiplyScalar(at)),xt.viewport(tt.copy(ct).multiplyScalar(at)),e(rt.r,rt.g,rt.b,it)}function i(){K=X=null,Q="",Z=-1,xt.reset()}function n(t){t.preventDefault(),i(),r(),bt.clear()}function o(t){(t=t.target).removeEventListener("dispose",o);t:{var e=bt.get(t);if(t.image&&e.__image__webglTextureCube)gt.deleteTexture(e.__image__webglTextureCube);else{if(void 0===e.__webglInit)break t;gt.deleteTexture(e.__webglTexture)}bt.delete(t)}ft.textures--}function a(t){(t=t.target).removeEventListener("dispose",a);var e=bt.get(t),r=bt.get(t.texture);if(t&&void 0!==r.__webglTexture){if(gt.deleteTexture(r.__webglTexture),t instanceof m.WebGLRenderTargetCube)for(r=0;6>r;r++)gt.deleteFramebuffer(e.__webglFramebuffer[r]),gt.deleteRenderbuffer(e.__webglDepthbuffer[r]);else gt.deleteFramebuffer(e.__webglFramebuffer),gt.deleteRenderbuffer(e.__webglDepthbuffer);bt.delete(t.texture),bt.delete(t)}ft.textures--}function s(t){(t=t.target).removeEventListener("dispose",s),h(t),bt.delete(t)}function h(t){var e=bt.get(t).program;t.program=void 0,void 0!==e&&Mt.releaseProgram(e)}function c(t,e){return Math.abs(e[0])-Math.abs(t[0])}function l(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function u(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function p(t,e,r,i,n){var o;r.transparent?(i=O,o=++G):(i=V,o=++N),void 0!==(o=i[o])?(o.id=t.id,o.object=t,o.geometry=e,o.material=r,o.z=pt.z,o.group=n):(o={id:t.id,object:t,geometry:e,material:r,z:pt.z,group:n},i.push(o))}function d(t,e){if(!1!==t.visible){if(t.layers.test(e.layers))if(t instanceof m.Light)B.push(t);else if(t instanceof m.Sprite)!1!==t.frustumCulled&&!0!==lt.intersectsObject(t)||H.push(t);else if(t instanceof m.LensFlare)j.push(t);else if(t instanceof m.ImmediateRenderObject)!0===W.sortObjects&&(pt.setFromMatrixPosition(t.matrixWorld),pt.applyProjection(ut)),p(t,null,t.material,pt.z,null);else if((t instanceof m.Mesh||t instanceof m.Line||t instanceof m.Points)&&(t instanceof m.SkinnedMesh&&t.skeleton.update(),(!1===t.frustumCulled||!0===lt.intersectsObject(t))&&!0===(o=t.material).visible)){!0===W.sortObjects&&(pt.setFromMatrixPosition(t.matrixWorld),pt.applyProjection(ut));var r=_t.update(t);if(o instanceof m.MultiMaterial)for(var i=r.groups,n=o.materials,o=0,a=i.length;o<a;o++){var s=i[o],h=n[s.materialIndex];!0===h.visible&&p(t,r,h,pt.z,s)}else p(t,r,o,pt.z,null)}for(o=0,a=(r=t.children).length;o<a;o++)d(r[o],e)}}function f(t,e,r,i){for(var n=0,o=t.length;n<o;n++){var a=(c=t[n]).object,s=c.geometry,h=void 0===i?c.material:i,c=c.group;if(a.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,a.matrixWorld),a.normalMatrix.getNormalMatrix(a.modelViewMatrix),a instanceof m.ImmediateRenderObject){g(h);var l=v(e,r,h,a);Q="",a.render(function(t){W.renderBufferImmediate(t,l,h)})}else W.renderBufferDirect(e,r,s,h,a,c)}}function g(t){t.side!==m.DoubleSide?xt.enable(gt.CULL_FACE):xt.disable(gt.CULL_FACE),xt.setFlipSided(t.side===m.BackSide),!0===t.transparent?xt.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha):xt.setBlending(m.NoBlending),xt.setDepthFunc(t.depthFunc),xt.setDepthTest(t.depthTest),xt.setDepthWrite(t.depthWrite),xt.setColorWrite(t.colorWrite),xt.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function v(t,e,r,i){et=0;var n=bt.get(r);if(void 0===n.program&&(r.needsUpdate=!0),void 0!==n.lightsHash&&n.lightsHash!==dt.hash&&(r.needsUpdate=!0),r.needsUpdate){t:{var o=bt.get(r),a=Mt.getParameters(r,dt,e,i),c=Mt.getProgramCode(r,a),l=o.program,u=!0;if(void 0===l)r.addEventListener("dispose",s);else if(l.code!==c)h(r);else{if(void 0!==a.shaderID)break t;u=!1}if(u&&(a.shaderID?(l=m.ShaderLib[a.shaderID],o.__webglShader={name:r.type,uniforms:m.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}):o.__webglShader={name:r.type,uniforms:r.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader},r.__webglShader=o.__webglShader,l=Mt.acquireProgram(r,a,c),o.program=l,r.program=l),a=l.getAttributes(),r.morphTargets)for(c=r.numSupportedMorphTargets=0;c<W.maxMorphTargets;c++)0<=a["morphTarget"+c]&&r.numSupportedMorphTargets++;if(r.morphNormals)for(c=r.numSupportedMorphNormals=0;c<W.maxMorphNormals;c++)0<=a["morphNormal"+c]&&r.numSupportedMorphNormals++;o.uniformsList=[];var p,a=o.__webglShader.uniforms,c=o.program.getUniforms();for(p in a)(l=c[p])&&o.uniformsList.push([o.__webglShader.uniforms[p],l]);for((r instanceof m.MeshPhongMaterial||r instanceof m.MeshLambertMaterial||r instanceof m.MeshStandardMaterial||r.lights)&&(o.lightsHash=dt.hash,a.ambientLightColor.value=dt.ambient,a.directionalLights.value=dt.directional,a.spotLights.value=dt.spot,a.pointLights.value=dt.point,a.hemisphereLights.value=dt.hemi,a.directionalShadowMap.value=dt.directionalShadowMap,a.directionalShadowMatrix.value=dt.directionalShadowMatrix,a.spotShadowMap.value=dt.spotShadowMap,a.spotShadowMatrix.value=dt.spotShadowMatrix,a.pointShadowMap.value=dt.pointShadowMap,a.pointShadowMatrix.value=dt.pointShadowMatrix),o.hasDynamicUniforms=!1,p=0,a=o.uniformsList.length;p<a;p++)if(!0===o.uniformsList[p][0].dynamic){o.hasDynamicUniforms=!0;break}}r.needsUpdate=!1}if(l=c=u=!1,o=n.program,p=o.getUniforms(),a=n.__webglShader.uniforms,o.id!==X&&(gt.useProgram(o.program),X=o.id,l=c=u=!0),r.id!==Z&&(Z=r.id,c=!0),(u||t!==K)&&(gt.uniformMatrix4fv(p.projectionMatrix,!1,t.projectionMatrix.elements),yt.logarithmicDepthBuffer&&gt.uniform1f(p.logDepthBufFC,2/(Math.log(t.far+1)/Math.LN2)),t!==K&&(K=t,l=c=!0),(r instanceof m.ShaderMaterial||r instanceof m.MeshPhongMaterial||r instanceof m.MeshStandardMaterial||r.envMap)&&void 0!==p.cameraPosition&&(pt.setFromMatrixPosition(t.matrixWorld),gt.uniform3f(p.cameraPosition,pt.x,pt.y,pt.z)),(r instanceof m.MeshPhongMaterial||r instanceof m.MeshLambertMaterial||r instanceof m.MeshBasicMaterial||r instanceof m.MeshStandardMaterial||r instanceof m.ShaderMaterial||r.skinning)&&void 0!==p.viewMatrix&&gt.uniformMatrix4fv(p.viewMatrix,!1,t.matrixWorldInverse.elements)),r.skinning&&(i.bindMatrix&&void 0!==p.bindMatrix&&gt.uniformMatrix4fv(p.bindMatrix,!1,i.bindMatrix.elements),i.bindMatrixInverse&&void 0!==p.bindMatrixInverse&&gt.uniformMatrix4fv(p.bindMatrixInverse,!1,i.bindMatrixInverse.elements),yt.floatVertexTextures&&i.skeleton&&i.skeleton.useVertexTexture?(void 0!==p.boneTexture&&(u=y(),gt.uniform1i(p.boneTexture,u),W.setTexture(i.skeleton.boneTexture,u)),void 0!==p.boneTextureWidth&&gt.uniform1i(p.boneTextureWidth,i.skeleton.boneTextureWidth),void 0!==p.boneTextureHeight&&gt.uniform1i(p.boneTextureHeight,i.skeleton.boneTextureHeight)):i.skeleton&&i.skeleton.boneMatrices&&void 0!==p.boneGlobalMatrices&&gt.uniformMatrix4fv(p.boneGlobalMatrices,!1,i.skeleton.boneMatrices)),c){if((r instanceof m.MeshPhongMaterial||r instanceof m.MeshLambertMaterial||r instanceof m.MeshStandardMaterial||r.lights)&&(c=l,a.ambientLightColor.needsUpdate=c,a.directionalLights.needsUpdate=c,a.pointLights.needsUpdate=c,a.spotLights.needsUpdate=c,a.hemisphereLights.needsUpdate=c),e&&r.fog&&(a.fogColor.value=e.color,e instanceof m.Fog?(a.fogNear.value=e.near,a.fogFar.value=e.far):e instanceof m.FogExp2&&(a.fogDensity.value=e.density)),r instanceof m.MeshBasicMaterial||r instanceof m.MeshLambertMaterial||r instanceof m.MeshPhongMaterial||r instanceof m.MeshStandardMaterial){a.opacity.value=r.opacity,a.diffuse.value=r.color,r.emissive&&a.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),a.map.value=r.map,a.specularMap.value=r.specularMap,a.alphaMap.value=r.alphaMap,r.aoMap&&(a.aoMap.value=r.aoMap,a.aoMapIntensity.value=r.aoMapIntensity);var d;r.map?d=r.map:r.specularMap?d=r.specularMap:r.displacementMap?d=r.displacementMap:r.normalMap?d=r.normalMap:r.bumpMap?d=r.bumpMap:r.roughnessMap?d=r.roughnessMap:r.metalnessMap?d=r.metalnessMap:r.alphaMap?d=r.alphaMap:r.emissiveMap&&(d=r.emissiveMap),void 0!==d&&(d instanceof m.WebGLRenderTarget&&(d=d.texture),e=d.offset,d=d.repeat,a.offsetRepeat.value.set(e.x,e.y,d.x,d.y)),a.envMap.value=r.envMap,a.flipEnvMap.value=r.envMap instanceof m.WebGLRenderTargetCube?1:-1,a.reflectivity.value=r.reflectivity,a.refractionRatio.value=r.refractionRatio}r instanceof m.LineBasicMaterial?(a.diffuse.value=r.color,a.opacity.value=r.opacity):r instanceof m.LineDashedMaterial?(a.diffuse.value=r.color,a.opacity.value=r.opacity,a.dashSize.value=r.dashSize,a.totalSize.value=r.dashSize+r.gapSize,a.scale.value=r.scale):r instanceof m.PointsMaterial?(a.diffuse.value=r.color,a.opacity.value=r.opacity,a.size.value=r.size*at,a.scale.value=A.clientHeight/2,a.map.value=r.map,null!==r.map&&(d=r.map.offset,r=r.map.repeat,a.offsetRepeat.value.set(d.x,d.y,r.x,r.y))):r instanceof m.MeshLambertMaterial?(r.lightMap&&(a.lightMap.value=r.lightMap,a.lightMapIntensity.value=r.lightMapIntensity),r.emissiveMap&&(a.emissiveMap.value=r.emissiveMap)):r instanceof m.MeshPhongMaterial?(a.specular.value=r.specular,a.shininess.value=Math.max(r.shininess,1e-4),r.lightMap&&(a.lightMap.value=r.lightMap,a.lightMapIntensity.value=r.lightMapIntensity),r.emissiveMap&&(a.emissiveMap.value=r.emissiveMap),r.bumpMap&&(a.bumpMap.value=r.bumpMap,a.bumpScale.value=r.bumpScale),r.normalMap&&(a.normalMap.value=r.normalMap,a.normalScale.value.copy(r.normalScale)),r.displacementMap&&(a.displacementMap.value=r.displacementMap,a.displacementScale.value=r.displacementScale,a.displacementBias.value=r.displacementBias)):r instanceof m.MeshStandardMaterial?(a.roughness.value=r.roughness,a.metalness.value=r.metalness,r.roughnessMap&&(a.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(a.metalnessMap.value=r.metalnessMap),r.lightMap&&(a.lightMap.value=r.lightMap,a.lightMapIntensity.value=r.lightMapIntensity),r.emissiveMap&&(a.emissiveMap.value=r.emissiveMap),r.bumpMap&&(a.bumpMap.value=r.bumpMap,a.bumpScale.value=r.bumpScale),r.normalMap&&(a.normalMap.value=r.normalMap,a.normalScale.value.copy(r.normalScale)),r.displacementMap&&(a.displacementMap.value=r.displacementMap,a.displacementScale.value=r.displacementScale,a.displacementBias.value=r.displacementBias),r.envMap&&(a.envMapIntensity.value=r.envMapIntensity)):r instanceof m.MeshDepthMaterial?(a.mNear.value=t.near,a.mFar.value=t.far,a.opacity.value=r.opacity):r instanceof m.MeshNormalMaterial&&(a.opacity.value=r.opacity),x(n.uniformsList)}if(gt.uniformMatrix4fv(p.modelViewMatrix,!1,i.modelViewMatrix.elements),p.normalMatrix&&gt.uniformMatrix3fv(p.normalMatrix,!1,i.normalMatrix.elements),void 0!==p.modelMatrix&&gt.uniformMatrix4fv(p.modelMatrix,!1,i.matrixWorld.elements),!0===n.hasDynamicUniforms){for(r=[],d=0,e=(n=n.uniformsList).length;d<e;d++)p=n[d][0],void 0!==(a=p.onUpdateCallback)&&(a.bind(p)(i,t),r.push(n[d]));x(r)}return o}function y(){var t=et;return t>=yt.maxTextures&&console.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+yt.maxTextures),et+=1,t}function x(t){for(var e,r,i=0,n=t.length;i<n;i++){var o=t[i][0];if(!1!==o.needsUpdate){var a=o.type;e=o.value;var s=t[i][1];switch(a){case"1i":gt.uniform1i(s,e);break;case"1f":gt.uniform1f(s,e);break;case"2f":gt.uniform2f(s,e[0],e[1]);break;case"3f":gt.uniform3f(s,e[0],e[1],e[2]);break;case"4f":gt.uniform4f(s,e[0],e[1],e[2],e[3]);break;case"1iv":gt.uniform1iv(s,e);break;case"3iv":gt.uniform3iv(s,e);break;case"1fv":gt.uniform1fv(s,e);break;case"2fv":gt.uniform2fv(s,e);break;case"3fv":gt.uniform3fv(s,e);break;case"4fv":gt.uniform4fv(s,e);break;case"Matrix2fv":gt.uniformMatrix2fv(s,!1,e);break;case"Matrix3fv":gt.uniformMatrix3fv(s,!1,e);break;case"Matrix4fv":gt.uniformMatrix4fv(s,!1,e);break;case"i":gt.uniform1i(s,e);break;case"f":gt.uniform1f(s,e);break;case"v2":gt.uniform2f(s,e.x,e.y);break;case"v3":gt.uniform3f(s,e.x,e.y,e.z);break;case"v4":gt.uniform4f(s,e.x,e.y,e.z,e.w);break;case"c":gt.uniform3f(s,e.r,e.g,e.b);break;case"sa":for(a=0;a<e.length;a++)for(var h in o.properties){var c=s[a][h];switch(r=e[a][h],o.properties[h].type){case"i":gt.uniform1i(c,r);break;case"f":gt.uniform1f(c,r);break;case"v2":gt.uniform2f(c,r.x,r.y);break;case"v3":gt.uniform3f(c,r.x,r.y,r.z);break;case"v4":gt.uniform4f(c,r.x,r.y,r.z,r.w);break;case"c":gt.uniform3f(c,r.r,r.g,r.b);break;case"m4":gt.uniformMatrix4fv(c,!1,r.elements)}}break;case"iv1":gt.uniform1iv(s,e);break;case"iv":gt.uniform3iv(s,e);break;case"fv1":gt.uniform1fv(s,e);break;case"fv":gt.uniform3fv(s,e);break;case"v2v":for(void 0===o._array&&(o._array=new Float32Array(2*e.length)),r=a=0,c=e.length;a<c;a++,r+=2)o._array[r+0]=e[a].x,o._array[r+1]=e[a].y;gt.uniform2fv(s,o._array);break;case"v3v":for(void 0===o._array&&(o._array=new Float32Array(3*e.length)),r=a=0,c=e.length;a<c;a++,r+=3)o._array[r+0]=e[a].x,o._array[r+1]=e[a].y,o._array[r+2]=e[a].z;gt.uniform3fv(s,o._array);break;case"v4v":for(void 0===o._array&&(o._array=new Float32Array(4*e.length)),r=a=0,c=e.length;a<c;a++,r+=4)o._array[r+0]=e[a].x,o._array[r+1]=e[a].y,o._array[r+2]=e[a].z,o._array[r+3]=e[a].w;gt.uniform4fv(s,o._array);break;case"m2":gt.uniformMatrix2fv(s,!1,e.elements);break;case"m3":gt.uniformMatrix3fv(s,!1,e.elements);break;case"m3v":for(void 0===o._array&&(o._array=new Float32Array(9*e.length)),a=0,c=e.length;a<c;a++)e[a].flattenToArrayOffset(o._array,9*a);gt.uniformMatrix3fv(s,!1,o._array);break;case"m4":gt.uniformMatrix4fv(s,!1,e.elements);break;case"m4v":for(void 0===o._array&&(o._array=new Float32Array(16*e.length)),a=0,c=e.length;a<c;a++)e[a].flattenToArrayOffset(o._array,16*a);gt.uniformMatrix4fv(s,!1,o._array);break;case"t":if(r=y(),gt.uniform1i(s,r),!e)continue;e instanceof m.CubeTexture||Array.isArray(e.image)&&6===e.image.length?w(e,r):e instanceof m.WebGLRenderTargetCube?S(e.texture,r):e instanceof m.WebGLRenderTarget?W.setTexture(e.texture,r):W.setTexture(e,r);break;case"tv":for(void 0===o._array&&(o._array=[]),a=0,c=o.value.length;a<c;a++)o._array[a]=y();for(gt.uniform1iv(s,o._array),a=0,c=o.value.length;a<c;a++)e=o.value[a],r=o._array[a],e&&(e instanceof m.CubeTexture||e.image instanceof Array&&6===e.image.length?w(e,r):e instanceof m.WebGLRenderTarget?W.setTexture(e.texture,r):e instanceof m.WebGLRenderTargetCube?S(e.texture,r):W.setTexture(e,r));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+a)}}}}function b(t,e,r){r?(gt.texParameteri(t,gt.TEXTURE_WRAP_S,L(e.wrapS)),gt.texParameteri(t,gt.TEXTURE_WRAP_T,L(e.wrapT)),gt.texParameteri(t,gt.TEXTURE_MAG_FILTER,L(e.magFilter)),gt.texParameteri(t,gt.TEXTURE_MIN_FILTER,L(e.minFilter))):(gt.texParameteri(t,gt.TEXTURE_WRAP_S,gt.CLAMP_TO_EDGE),gt.texParameteri(t,gt.TEXTURE_WRAP_T,gt.CLAMP_TO_EDGE),e.wrapS===m.ClampToEdgeWrapping&&e.wrapT===m.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",e),gt.texParameteri(t,gt.TEXTURE_MAG_FILTER,C(e.magFilter)),gt.texParameteri(t,gt.TEXTURE_MIN_FILTER,C(e.minFilter)),e.minFilter!==m.NearestFilter&&e.minFilter!==m.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",e)),!(r=vt.get("EXT_texture_filter_anisotropic"))||e.type===m.FloatType&&null===vt.get("OES_texture_float_linear")||e.type===m.HalfFloatType&&null===vt.get("OES_texture_half_float_linear")||!(1<e.anisotropy||bt.get(e).__currentAnisotropy)||(gt.texParameterf(t,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,W.getMaxAnisotropy())),bt.get(e).__currentAnisotropy=e.anisotropy)}function _(t,e){if(t.width>e||t.height>e){var r=e/Math.max(t.width,t.height),i=document.createElement("canvas");return i.width=Math.floor(t.width*r),i.height=Math.floor(t.height*r),i.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+i.width+"x"+i.height,t),i}return t}function M(t){return m.Math.isPowerOfTwo(t.width)&&m.Math.isPowerOfTwo(t.height)}function w(t,e){var r=bt.get(t);if(6===t.image.length)if(0<t.version&&r.__version!==t.version){r.__image__webglTextureCube||(t.addEventListener("dispose",o),r.__image__webglTextureCube=gt.createTexture(),ft.textures++),xt.activeTexture(gt.TEXTURE0+e),xt.bindTexture(gt.TEXTURE_CUBE_MAP,r.__image__webglTextureCube),gt.pixelStorei(gt.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var i=t instanceof m.CompressedTexture,n=t.image[0]instanceof m.DataTexture,a=[],s=0;6>s;s++)a[s]=!W.autoScaleCubemaps||i||n?n?t.image[s].image:t.image[s]:_(t.image[s],yt.maxCubemapSize);var h=M(a[0]),c=L(t.format),l=L(t.type);for(b(gt.TEXTURE_CUBE_MAP,t,h),s=0;6>s;s++)if(i)for(var u,p=a[s].mipmaps,d=0,f=p.length;d<f;d++)u=p[d],t.format!==m.RGBAFormat&&t.format!==m.RGBFormat?-1<xt.getCompressedTextureFormats().indexOf(c)?xt.compressedTexImage2D(gt.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,c,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):xt.texImage2D(gt.TEXTURE_CUBE_MAP_POSITIVE_X+s,d,c,u.width,u.height,0,c,l,u.data);else n?xt.texImage2D(gt.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,c,a[s].width,a[s].height,0,c,l,a[s].data):xt.texImage2D(gt.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,c,c,l,a[s]);t.generateMipmaps&&h&&gt.generateMipmap(gt.TEXTURE_CUBE_MAP),r.__version=t.version,t.onUpdate&&t.onUpdate(t)}else xt.activeTexture(gt.TEXTURE0+e),xt.bindTexture(gt.TEXTURE_CUBE_MAP,r.__image__webglTextureCube)}function S(t,e){xt.activeTexture(gt.TEXTURE0+e),xt.bindTexture(gt.TEXTURE_CUBE_MAP,bt.get(t).__webglTexture)}function E(t,e,r,i){var n=L(e.texture.format),o=L(e.texture.type);xt.texImage2D(i,0,n,e.width,e.height,0,n,o,null),gt.bindFramebuffer(gt.FRAMEBUFFER,t),gt.framebufferTexture2D(gt.FRAMEBUFFER,r,i,bt.get(e.texture).__webglTexture,0),gt.bindFramebuffer(gt.FRAMEBUFFER,null)}function T(t,e){gt.bindRenderbuffer(gt.RENDERBUFFER,t),e.depthBuffer&&!e.stencilBuffer?(gt.renderbufferStorage(gt.RENDERBUFFER,gt.DEPTH_COMPONENT16,e.width,e.height),gt.framebufferRenderbuffer(gt.FRAMEBUFFER,gt.DEPTH_ATTACHMENT,gt.RENDERBUFFER,t)):e.depthBuffer&&e.stencilBuffer?(gt.renderbufferStorage(gt.RENDERBUFFER,gt.DEPTH_STENCIL,e.width,e.height),gt.framebufferRenderbuffer(gt.FRAMEBUFFER,gt.DEPTH_STENCIL_ATTACHMENT,gt.RENDERBUFFER,t)):gt.renderbufferStorage(gt.RENDERBUFFER,gt.RGBA4,e.width,e.height),gt.bindRenderbuffer(gt.RENDERBUFFER,null)}function C(t){return t===m.NearestFilter||t===m.NearestMipMapNearestFilter||t===m.NearestMipMapLinearFilter?gt.NEAREST:gt.LINEAR}function L(t){var e;if(t===m.RepeatWrapping)return gt.REPEAT;if(t===m.ClampToEdgeWrapping)return gt.CLAMP_TO_EDGE;if(t===m.MirroredRepeatWrapping)return gt.MIRRORED_REPEAT;if(t===m.NearestFilter)return gt.NEAREST;if(t===m.NearestMipMapNearestFilter)return gt.NEAREST_MIPMAP_NEAREST;if(t===m.NearestMipMapLinearFilter)return gt.NEAREST_MIPMAP_LINEAR;if(t===m.LinearFilter)return gt.LINEAR;if(t===m.LinearMipMapNearestFilter)return gt.LINEAR_MIPMAP_NEAREST;if(t===m.LinearMipMapLinearFilter)return gt.LINEAR_MIPMAP_LINEAR;if(t===m.UnsignedByteType)return gt.UNSIGNED_BYTE;if(t===m.UnsignedShort4444Type)return gt.UNSIGNED_SHORT_4_4_4_4;if(t===m.UnsignedShort5551Type)return gt.UNSIGNED_SHORT_5_5_5_1;if(t===m.UnsignedShort565Type)return gt.UNSIGNED_SHORT_5_6_5;if(t===m.ByteType)return gt.BYTE;if(t===m.ShortType)return gt.SHORT;if(t===m.UnsignedShortType)return gt.UNSIGNED_SHORT;if(t===m.IntType)return gt.INT;if(t===m.UnsignedIntType)return gt.UNSIGNED_INT;if(t===m.FloatType)return gt.FLOAT;if(null!==(e=vt.get("OES_texture_half_float"))&&t===m.HalfFloatType)return e.HALF_FLOAT_OES;if(t===m.AlphaFormat)return gt.ALPHA;if(t===m.RGBFormat)return gt.RGB;if(t===m.RGBAFormat)return gt.RGBA;if(t===m.LuminanceFormat)return gt.LUMINANCE;if(t===m.LuminanceAlphaFormat)return gt.LUMINANCE_ALPHA;if(t===m.AddEquation)return gt.FUNC_ADD;if(t===m.SubtractEquation)return gt.FUNC_SUBTRACT;if(t===m.ReverseSubtractEquation)return gt.FUNC_REVERSE_SUBTRACT;if(t===m.ZeroFactor)return gt.ZERO;if(t===m.OneFactor)return gt.ONE;if(t===m.SrcColorFactor)return gt.SRC_COLOR;if(t===m.OneMinusSrcColorFactor)return gt.ONE_MINUS_SRC_COLOR;if(t===m.SrcAlphaFactor)return gt.SRC_ALPHA;if(t===m.OneMinusSrcAlphaFactor)return gt.ONE_MINUS_SRC_ALPHA;if(t===m.DstAlphaFactor)return gt.DST_ALPHA;if(t===m.OneMinusDstAlphaFactor)return gt.ONE_MINUS_DST_ALPHA;if(t===m.DstColorFactor)return gt.DST_COLOR;if(t===m.OneMinusDstColorFactor)return gt.ONE_MINUS_DST_COLOR;if(t===m.SrcAlphaSaturateFactor)return gt.SRC_ALPHA_SATURATE;if(null!==(e=vt.get("WEBGL_compressed_texture_s3tc"))){if(t===m.RGB_S3TC_DXT1_Format)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===m.RGBA_S3TC_DXT1_Format)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===m.RGBA_S3TC_DXT3_Format)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===m.RGBA_S3TC_DXT5_Format)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(null!==(e=vt.get("WEBGL_compressed_texture_pvrtc"))){if(t===m.RGB_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===m.RGB_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===m.RGBA_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===m.RGBA_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(null!==(e=vt.get("WEBGL_compressed_texture_etc1"))&&t===m.RGB_ETC1_Format)return e.COMPRESSED_RGB_ETC1_WEBGL;if(null!==(e=vt.get("EXT_blend_minmax"))){if(t===m.MinEquation)return e.MIN_EXT;if(t===m.MaxEquation)return e.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",m.REVISION);var A=void 0!==(t=t||{}).canvas?t.canvas:document.createElement("canvas"),P=void 0!==t.context?t.context:null,R=void 0!==t.alpha&&t.alpha,U=void 0===t.depth||t.depth,k=void 0===t.stencil||t.stencil,D=void 0!==t.antialias&&t.antialias,I=void 0===t.premultipliedAlpha||t.premultipliedAlpha,F=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,B=[],V=[],N=-1,O=[],G=-1,z=new Float32Array(8),H=[],j=[];this.domElement=A,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.gammaFactor=2,this.gammaOutput=this.gammaInput=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0;var W=this,X=null,q=null,Y=null,Z=-1,Q="",K=null,J=new m.Vector4,$=null,tt=new m.Vector4,et=0,rt=new m.Color(0),it=0,nt=A.width,ot=A.height,at=1,st=new m.Vector4(0,0,nt,ot),ht=!1,ct=new m.Vector4(0,0,nt,ot),lt=new m.Frustum,ut=new m.Matrix4,pt=new m.Vector3,dt={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[],shadowsPointLight:0},ft={geometries:0,textures:0},mt={calls:0,vertices:0,faces:0,points:0};this.info={render:mt,memory:ft,programs:null};var gt;try{if(R={alpha:R,depth:U,stencil:k,antialias:D,premultipliedAlpha:I,preserveDrawingBuffer:F},null===(gt=P||A.getContext("webgl",R)||A.getContext("experimental-webgl",R))){if(null!==A.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}A.addEventListener("webglcontextlost",n,!1)}catch(t){console.error("THREE.WebGLRenderer: "+t)}var vt=new m.WebGLExtensions(gt);vt.get("OES_texture_float"),vt.get("OES_texture_float_linear"),vt.get("OES_texture_half_float"),vt.get("OES_texture_half_float_linear"),vt.get("OES_standard_derivatives"),vt.get("ANGLE_instanced_arrays"),vt.get("OES_element_index_uint")&&(m.BufferGeometry.MaxIndex=4294967296);var yt=new m.WebGLCapabilities(gt,vt,t),xt=new m.WebGLState(gt,vt,L),bt=new m.WebGLProperties,_t=new m.WebGLObjects(gt,bt,this.info),Mt=new m.WebGLPrograms(this,yt),wt=new m.WebGLLights;this.info.programs=Mt.programs;var St=new m.WebGLBufferRenderer(gt,vt,mt),Et=new m.WebGLIndexedBufferRenderer(gt,vt,mt);r(),this.context=gt,this.capabilities=yt,this.extensions=vt,this.properties=bt,this.state=xt;var Tt=new m.WebGLShadowMap(this,dt,_t);this.shadowMap=Tt;var Ct=new m.SpritePlugin(this,H),Lt=new m.LensFlarePlugin(this,j);this.getContext=function(){return gt},this.getContextAttributes=function(){return gt.getContextAttributes()},this.forceContextLoss=function(){vt.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){var t;return function(){if(void 0!==t)return t;var e=vt.get("EXT_texture_filter_anisotropic");return t=null!==e?gt.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return yt.precision},this.getPixelRatio=function(){return at},this.setPixelRatio=function(t){void 0!==t&&(at=t,this.setSize(ct.z,ct.w,!1))},this.getSize=function(){return{width:nt,height:ot}},this.setSize=function(t,e,r){nt=t,ot=e,A.width=t*at,A.height=e*at,!1!==r&&(A.style.width=t+"px",A.style.height=e+"px"),this.setViewport(0,0,t,e)},this.setViewport=function(t,e,r,i){xt.viewport(ct.set(t,e,r,i))},this.setScissor=function(t,e,r,i){xt.scissor(st.set(t,e,r,i))},this.setScissorTest=function(t){xt.setScissorTest(ht=t)},this.getClearColor=function(){return rt},this.setClearColor=function(t,r){rt.set(t),it=void 0!==r?r:1,e(rt.r,rt.g,rt.b,it)},this.getClearAlpha=function(){return it},this.setClearAlpha=function(t){it=t,e(rt.r,rt.g,rt.b,it)},this.clear=function(t,e,r){var i=0;(void 0===t||t)&&(i|=gt.COLOR_BUFFER_BIT),(void 0===e||e)&&(i|=gt.DEPTH_BUFFER_BIT),(void 0===r||r)&&(i|=gt.STENCIL_BUFFER_BIT),gt.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,r,i){this.setRenderTarget(t),this.clear(e,r,i)},this.resetGLState=i,this.dispose=function(){A.removeEventListener("webglcontextlost",n,!1)},this.renderBufferImmediate=function(t,e,r){xt.initAttributes();var i=bt.get(t);if(t.hasPositions&&!i.position&&(i.position=gt.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=gt.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=gt.createBuffer()),t.hasColors&&!i.color&&(i.color=gt.createBuffer()),e=e.getAttributes(),t.hasPositions&&(gt.bindBuffer(gt.ARRAY_BUFFER,i.position),gt.bufferData(gt.ARRAY_BUFFER,t.positionArray,gt.DYNAMIC_DRAW),xt.enableAttribute(e.position),gt.vertexAttribPointer(e.position,3,gt.FLOAT,!1,0,0)),t.hasNormals){if(gt.bindBuffer(gt.ARRAY_BUFFER,i.normal),"MeshPhongMaterial"!==r.type&&"MeshStandardMaterial"!==r.type&&r.shading===m.FlatShading)for(var n=0,o=3*t.count;n<o;n+=9){var a=t.normalArray,s=(a[n+0]+a[n+3]+a[n+6])/3,h=(a[n+1]+a[n+4]+a[n+7])/3,c=(a[n+2]+a[n+5]+a[n+8])/3;a[n+0]=s,a[n+1]=h,a[n+2]=c,a[n+3]=s,a[n+4]=h,a[n+5]=c,a[n+6]=s,a[n+7]=h,a[n+8]=c}gt.bufferData(gt.ARRAY_BUFFER,t.normalArray,gt.DYNAMIC_DRAW),xt.enableAttribute(e.normal),gt.vertexAttribPointer(e.normal,3,gt.FLOAT,!1,0,0)}t.hasUvs&&r.map&&(gt.bindBuffer(gt.ARRAY_BUFFER,i.uv),gt.bufferData(gt.ARRAY_BUFFER,t.uvArray,gt.DYNAMIC_DRAW),xt.enableAttribute(e.uv),gt.vertexAttribPointer(e.uv,2,gt.FLOAT,!1,0,0)),t.hasColors&&r.vertexColors!==m.NoColors&&(gt.bindBuffer(gt.ARRAY_BUFFER,i.color),gt.bufferData(gt.ARRAY_BUFFER,t.colorArray,gt.DYNAMIC_DRAW),xt.enableAttribute(e.color),gt.vertexAttribPointer(e.color,3,gt.FLOAT,!1,0,0)),xt.disableUnusedAttributes(),gt.drawArrays(gt.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,r,i,n,o){g(i);var a=v(t,e,i,n),s=!1;if((t=r.id+"_"+a.id+"_"+i.wireframe)!==Q&&(Q=t,s=!0),void 0!==(e=n.morphTargetInfluences)){t=[];for(var h=0,s=e.length;h<s;h++)d=e[h],t.push([d,h]);t.sort(c),8<t.length&&(t.length=8);for(var l=r.morphAttributes,h=0,s=t.length;h<s;h++)d=t[h],z[h]=d[0],0!==d[0]?(e=d[1],!0===i.morphTargets&&l.position&&r.addAttribute("morphTarget"+h,l.position[e]),!0===i.morphNormals&&l.normal&&r.addAttribute("morphNormal"+h,l.normal[e])):(!0===i.morphTargets&&r.removeAttribute("morphTarget"+h),!0===i.morphNormals&&r.removeAttribute("morphNormal"+h));null!==(t=a.getUniforms()).morphTargetInfluences&&gt.uniform1fv(t.morphTargetInfluences,z),s=!0}if(e=r.index,h=r.attributes.position,!0===i.wireframe&&(e=_t.getWireframeAttribute(r)),null!==e?(t=Et).setIndex(e):t=St,s){var u,s=void 0;if(r instanceof m.InstancedBufferGeometry&&null===(u=vt.get("ANGLE_instanced_arrays")))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{void 0===s&&(s=0),xt.initAttributes();var p,d=r.attributes,a=a.getAttributes(),l=i.defaultAttributeValues;for(p in a){var f=a[p];if(0<=f)if(void 0!==(M=d[p])){var y=M.itemSize,x=_t.getAttributeBuffer(M);if(M instanceof m.InterleavedBufferAttribute){var b=M.data,_=b.stride,M=M.offset;b instanceof m.InstancedInterleavedBuffer?(xt.enableAttributeAndDivisor(f,b.meshPerAttribute,u),void 0===r.maxInstancedCount&&(r.maxInstancedCount=b.meshPerAttribute*b.count)):xt.enableAttribute(f),gt.bindBuffer(gt.ARRAY_BUFFER,x),gt.vertexAttribPointer(f,y,gt.FLOAT,!1,_*b.array.BYTES_PER_ELEMENT,(s*_+M)*b.array.BYTES_PER_ELEMENT)}else M instanceof m.InstancedBufferAttribute?(xt.enableAttributeAndDivisor(f,M.meshPerAttribute,u),void 0===r.maxInstancedCount&&(r.maxInstancedCount=M.meshPerAttribute*M.count)):xt.enableAttribute(f),gt.bindBuffer(gt.ARRAY_BUFFER,x),gt.vertexAttribPointer(f,y,gt.FLOAT,!1,0,s*y*4)}else if(void 0!==l&&void 0!==(y=l[p]))switch(y.length){case 2:gt.vertexAttrib2fv(f,y);break;case 3:gt.vertexAttrib3fv(f,y);break;case 4:gt.vertexAttrib4fv(f,y);break;default:gt.vertexAttrib1fv(f,y)}}xt.disableUnusedAttributes()}null!==e&&gt.bindBuffer(gt.ELEMENT_ARRAY_BUFFER,_t.getAttributeBuffer(e))}if(u=1/0,null!==e?u=e.count:void 0!==h&&(u=h.count),p=r.drawRange.start,e=r.drawRange.count,h=null!==o?o.start:0,s=null!==o?o.count:1/0,o=Math.max(0,p,h),u=Math.min(0+u,p+e,h+s)-1,u=Math.max(0,u-o+1),n instanceof m.Mesh)if(!0===i.wireframe)xt.setLineWidth(i.wireframeLinewidth*(null===q?at:1)),t.setMode(gt.LINES);else switch(n.drawMode){case m.TrianglesDrawMode:t.setMode(gt.TRIANGLES);break;case m.TriangleStripDrawMode:t.setMode(gt.TRIANGLE_STRIP);break;case m.TriangleFanDrawMode:t.setMode(gt.TRIANGLE_FAN)}else n instanceof m.Line?(void 0===(i=i.linewidth)&&(i=1),xt.setLineWidth(i*(null===q?at:1)),n instanceof m.LineSegments?t.setMode(gt.LINES):t.setMode(gt.LINE_STRIP)):n instanceof m.Points&&t.setMode(gt.POINTS);r instanceof m.InstancedBufferGeometry&&0<r.maxInstancedCount?t.renderInstances(r,o,u):t.render(o,u)},this.render=function(t,e,r,i){if(0==e instanceof m.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var n=t.fog;Q="",Z=-1,K=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.matrixWorldInverse.getInverse(e.matrixWorld),ut.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),lt.setFromMatrix(ut),B.length=0,G=N=-1,H.length=0,j.length=0,d(t,e),V.length=N+1,O.length=G+1,!0===W.sortObjects&&(V.sort(l),O.sort(u));var o,a,s,h,c,p,g=B,v=0,y=0,x=0,b=e.matrixWorldInverse,_=0,w=0,S=0,E=0,T=0;for(o=dt.shadowsPointLight=0,a=g.length;o<a;o++)if(s=g[o],h=s.color,c=s.intensity,p=s.distance,s instanceof m.AmbientLight)v+=h.r*c,y+=h.g*c,x+=h.b*c;else if(s instanceof m.DirectionalLight){var C=wt.get(s);C.color.copy(s.color).multiplyScalar(s.intensity),C.direction.setFromMatrixPosition(s.matrixWorld),pt.setFromMatrixPosition(s.target.matrixWorld),C.direction.sub(pt),C.direction.transformDirection(b),(C.shadow=s.castShadow)&&(C.shadowBias=s.shadow.bias,C.shadowRadius=s.shadow.radius,C.shadowMapSize=s.shadow.mapSize,dt.shadows[T++]=s),dt.directionalShadowMap[_]=s.shadow.map,dt.directionalShadowMatrix[_]=s.shadow.matrix,dt.directional[_++]=C}else s instanceof m.SpotLight?((C=wt.get(s)).position.setFromMatrixPosition(s.matrixWorld),C.position.applyMatrix4(b),C.color.copy(h).multiplyScalar(c),C.distance=p,C.direction.setFromMatrixPosition(s.matrixWorld),pt.setFromMatrixPosition(s.target.matrixWorld),C.direction.sub(pt),C.direction.transformDirection(b),C.angleCos=Math.cos(s.angle),C.exponent=s.exponent,C.decay=0===s.distance?0:s.decay,(C.shadow=s.castShadow)&&(C.shadowBias=s.shadow.bias,C.shadowRadius=s.shadow.radius,C.shadowMapSize=s.shadow.mapSize,dt.shadows[T++]=s),dt.spotShadowMap[S]=s.shadow.map,dt.spotShadowMatrix[S]=s.shadow.matrix,dt.spot[S++]=C):s instanceof m.PointLight?((C=wt.get(s)).position.setFromMatrixPosition(s.matrixWorld),C.position.applyMatrix4(b),C.color.copy(s.color).multiplyScalar(s.intensity),C.distance=s.distance,C.decay=0===s.distance?0:s.decay,(C.shadow=s.castShadow)&&(C.shadowBias=s.shadow.bias,C.shadowRadius=s.shadow.radius,C.shadowMapSize=s.shadow.mapSize,dt.shadows[T++]=s),dt.pointShadowMap[w]=s.shadow.map,void 0===dt.pointShadowMatrix[w]&&(dt.pointShadowMatrix[w]=new m.Matrix4),pt.setFromMatrixPosition(s.matrixWorld).negate(),dt.pointShadowMatrix[w].identity().setPosition(pt),dt.point[w++]=C):s instanceof m.HemisphereLight&&((C=wt.get(s)).direction.setFromMatrixPosition(s.matrixWorld),C.direction.transformDirection(b),C.direction.normalize(),C.skyColor.copy(s.color).multiplyScalar(c),C.groundColor.copy(s.groundColor).multiplyScalar(c),dt.hemi[E++]=C);dt.ambient[0]=v,dt.ambient[1]=y,dt.ambient[2]=x,dt.directional.length=_,dt.spot.length=S,dt.point.length=w,dt.hemi.length=E,dt.shadows.length=T,dt.hash=_+","+w+","+S+","+E+","+T,Tt.render(t,e),mt.calls=0,mt.vertices=0,mt.faces=0,mt.points=0,void 0===r&&(r=null),this.setRenderTarget(r),(this.autoClear||i)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),t.overrideMaterial?(i=t.overrideMaterial,f(V,e,n,i),f(O,e,n,i)):(xt.setBlending(m.NoBlending),f(V,e,n),f(O,e,n)),Ct.render(t,e),Lt.render(t,e,tt),r&&(t=r.texture).generateMipmaps&&M(r)&&t.minFilter!==m.NearestFilter&&t.minFilter!==m.LinearFilter&&(t=r instanceof m.WebGLRenderTargetCube?gt.TEXTURE_CUBE_MAP:gt.TEXTURE_2D,r=bt.get(r.texture).__webglTexture,xt.bindTexture(t,r),gt.generateMipmap(t),xt.bindTexture(t,null)),xt.setDepthTest(!0),xt.setDepthWrite(!0),xt.setColorWrite(!0)}},this.setFaceCulling=function(t,e){t===m.CullFaceNone?xt.disable(gt.CULL_FACE):(e===m.FrontFaceDirectionCW?gt.frontFace(gt.CW):gt.frontFace(gt.CCW),t===m.CullFaceBack?gt.cullFace(gt.BACK):t===m.CullFaceFront?gt.cullFace(gt.FRONT):gt.cullFace(gt.FRONT_AND_BACK),xt.enable(gt.CULL_FACE))},this.setTexture=function(t,e){var r=bt.get(t);if(0<t.version&&r.__version!==t.version)if(void 0===(n=t.image))console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else if(!1===n.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t);else{void 0===r.__webglInit&&(r.__webglInit=!0,t.addEventListener("dispose",o),r.__webglTexture=gt.createTexture(),ft.textures++),xt.activeTexture(gt.TEXTURE0+e),xt.bindTexture(gt.TEXTURE_2D,r.__webglTexture),gt.pixelStorei(gt.UNPACK_FLIP_Y_WEBGL,t.flipY),gt.pixelStorei(gt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),gt.pixelStorei(gt.UNPACK_ALIGNMENT,t.unpackAlignment);var i=_(t.image,yt.maxTextureSize);(t.wrapS!==m.ClampToEdgeWrapping||t.wrapT!==m.ClampToEdgeWrapping||t.minFilter!==m.NearestFilter&&t.minFilter!==m.LinearFilter)&&!1===M(i)&&((n=i)instanceof HTMLImageElement||n instanceof HTMLCanvasElement?((a=document.createElement("canvas")).width=m.Math.nearestPowerOfTwo(n.width),a.height=m.Math.nearestPowerOfTwo(n.height),a.getContext("2d").drawImage(n,0,0,a.width,a.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+n.width+"x"+n.height+"). Resized to "+a.width+"x"+a.height,n),i=a):i=n);var n=M(i),a=L(t.format),s=L(t.type);b(gt.TEXTURE_2D,t,n);var h=t.mipmaps;if(t instanceof m.DataTexture)if(0<h.length&&n){for(var c=0,l=h.length;c<l;c++)i=h[c],xt.texImage2D(gt.TEXTURE_2D,c,a,i.width,i.height,0,a,s,i.data);t.generateMipmaps=!1}else xt.texImage2D(gt.TEXTURE_2D,0,a,i.width,i.height,0,a,s,i.data);else if(t instanceof m.CompressedTexture)for(c=0,l=h.length;c<l;c++)i=h[c],t.format!==m.RGBAFormat&&t.format!==m.RGBFormat?-1<xt.getCompressedTextureFormats().indexOf(a)?xt.compressedTexImage2D(gt.TEXTURE_2D,c,a,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):xt.texImage2D(gt.TEXTURE_2D,c,a,i.width,i.height,0,a,s,i.data);else if(0<h.length&&n){for(c=0,l=h.length;c<l;c++)i=h[c],xt.texImage2D(gt.TEXTURE_2D,c,a,a,s,i);t.generateMipmaps=!1}else xt.texImage2D(gt.TEXTURE_2D,0,a,a,s,i);t.generateMipmaps&&n&&gt.generateMipmap(gt.TEXTURE_2D),r.__version=t.version,t.onUpdate&&t.onUpdate(t)}else xt.activeTexture(gt.TEXTURE0+e),xt.bindTexture(gt.TEXTURE_2D,r.__webglTexture)},this.setRenderTarget=function(t){if((q=t)&&void 0===bt.get(t).__webglFramebuffer){var e=bt.get(t),r=bt.get(t.texture);t.addEventListener("dispose",a),r.__webglTexture=gt.createTexture(),ft.textures++;var i=t instanceof m.WebGLRenderTargetCube,n=m.Math.isPowerOfTwo(t.width)&&m.Math.isPowerOfTwo(t.height);if(i){e.__webglFramebuffer=[];for(var o=0;6>o;o++)e.__webglFramebuffer[o]=gt.createFramebuffer()}else e.__webglFramebuffer=gt.createFramebuffer();if(i){for(xt.bindTexture(gt.TEXTURE_CUBE_MAP,r.__webglTexture),b(gt.TEXTURE_CUBE_MAP,t.texture,n),o=0;6>o;o++)E(e.__webglFramebuffer[o],t,gt.COLOR_ATTACHMENT0,gt.TEXTURE_CUBE_MAP_POSITIVE_X+o);t.texture.generateMipmaps&&n&&gt.generateMipmap(gt.TEXTURE_CUBE_MAP),xt.bindTexture(gt.TEXTURE_CUBE_MAP,null)}else xt.bindTexture(gt.TEXTURE_2D,r.__webglTexture),b(gt.TEXTURE_2D,t.texture,n),E(e.__webglFramebuffer,t,gt.COLOR_ATTACHMENT0,gt.TEXTURE_2D),t.texture.generateMipmaps&&n&&gt.generateMipmap(gt.TEXTURE_2D),xt.bindTexture(gt.TEXTURE_2D,null);if(t.depthBuffer){if(e=bt.get(t),t instanceof m.WebGLRenderTargetCube)for(e.__webglDepthbuffer=[],r=0;6>r;r++)gt.bindFramebuffer(gt.FRAMEBUFFER,e.__webglFramebuffer[r]),e.__webglDepthbuffer[r]=gt.createRenderbuffer(),T(e.__webglDepthbuffer[r],t);else gt.bindFramebuffer(gt.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=gt.createRenderbuffer(),T(e.__webglDepthbuffer,t);gt.bindFramebuffer(gt.FRAMEBUFFER,null)}}e=t instanceof m.WebGLRenderTargetCube,t?(r=bt.get(t),r=e?r.__webglFramebuffer[t.activeCubeFace]:r.__webglFramebuffer,J.copy(t.scissor),$=t.scissorTest,tt.copy(t.viewport)):(r=null,J.copy(st).multiplyScalar(at),$=ht,tt.copy(ct).multiplyScalar(at)),Y!==r&&(gt.bindFramebuffer(gt.FRAMEBUFFER,r),Y=r),xt.scissor(J),xt.setScissorTest($),xt.viewport(tt),e&&(e=bt.get(t.texture),gt.framebufferTexture2D(gt.FRAMEBUFFER,gt.COLOR_ATTACHMENT0,gt.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,e.__webglTexture,0))},this.readRenderTargetPixels=function(t,e,r,i,n,o){if(0==t instanceof m.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var a=bt.get(t).__webglFramebuffer;if(a){var s=!1;a!==Y&&(gt.bindFramebuffer(gt.FRAMEBUFFER,a),s=!0);try{var h=t.texture;h.format!==m.RGBAFormat&&L(h.format)!==gt.getParameter(gt.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):h.type===m.UnsignedByteType||L(h.type)===gt.getParameter(gt.IMPLEMENTATION_COLOR_READ_TYPE)||h.type===m.FloatType&&vt.get("WEBGL_color_buffer_float")||h.type===m.HalfFloatType&&vt.get("EXT_color_buffer_half_float")?gt.checkFramebufferStatus(gt.FRAMEBUFFER)===gt.FRAMEBUFFER_COMPLETE?gt.readPixels(e,r,i,n,L(h.format),L(h.type),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{s&&gt.bindFramebuffer(gt.FRAMEBUFFER,Y)}}}}},m.WebGLRenderTarget=function(t,e,r){this.uuid=m.Math.generateUUID(),this.width=t,this.height=e,this.scissor=new m.Vector4(0,0,t,e),this.scissorTest=!1,this.viewport=new m.Vector4(0,0,t,e),void 0===(r=r||{}).minFilter&&(r.minFilter=m.LinearFilter),this.texture=new m.Texture(void 0,void 0,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy),this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer},m.WebGLRenderTarget.prototype={constructor:m.WebGLRenderTarget,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.shareDepthFrom=t.shareDepthFrom,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},m.EventDispatcher.prototype.apply(m.WebGLRenderTarget.prototype),m.WebGLRenderTargetCube=function(t,e,r){m.WebGLRenderTarget.call(this,t,e,r),this.activeCubeFace=0},m.WebGLRenderTargetCube.prototype=Object.create(m.WebGLRenderTarget.prototype),m.WebGLRenderTargetCube.prototype.constructor=m.WebGLRenderTargetCube,m.WebGLBufferRenderer=function(t,e,r){var i;this.setMode=function(t){i=t},this.render=function(e,n){t.drawArrays(i,e,n),r.calls++,r.vertices+=n,i===t.TRIANGLES&&(r.faces+=n/3)},this.renderInstances=function(n){var o=e.get("ANGLE_instanced_arrays");if(null===o)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{var a=n.attributes.position,s=0,s=a instanceof m.InterleavedBufferAttribute?a.data.count:a.count;o.drawArraysInstancedANGLE(i,0,s,n.maxInstancedCount),r.calls++,r.vertices+=s*n.maxInstancedCount,i===t.TRIANGLES&&(r.faces+=n.maxInstancedCount*s/3)}}},m.WebGLIndexedBufferRenderer=function(t,e,r){var i,n,o;this.setMode=function(t){i=t},this.setIndex=function(r){r.array instanceof Uint32Array&&e.get("OES_element_index_uint")?(n=t.UNSIGNED_INT,o=4):(n=t.UNSIGNED_SHORT,o=2)},this.render=function(e,a){t.drawElements(i,a,n,e*o),r.calls++,r.vertices+=a,i===t.TRIANGLES&&(r.faces+=a/3)},this.renderInstances=function(a,s,h){var c=e.get("ANGLE_instanced_arrays");null===c?console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(c.drawElementsInstancedANGLE(i,h,n,s*o,a.maxInstancedCount),r.calls++,r.vertices+=h*a.maxInstancedCount,i===t.TRIANGLES&&(r.faces+=a.maxInstancedCount*h/3))}},m.WebGLExtensions=function(t){var e={};this.get=function(r){if(void 0!==e[r])return e[r];var i;switch(r){case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":i=t.getExtension("WEBGL_compressed_texture_etc1");break;default:i=t.getExtension(r)}return null===i&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),e[r]=i}},m.WebGLCapabilities=function(t,e,r){function i(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision&&0<t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision&&0<t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision?"mediump":"lowp"}this.getMaxPrecision=i,this.precision=void 0!==r.precision?r.precision:"highp",this.logarithmicDepthBuffer=void 0!==r.logarithmicDepthBuffer&&r.logarithmicDepthBuffer,this.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxVertexTextures=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxCubemapSize=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),this.maxAttributes=t.getParameter(t.MAX_VERTEX_ATTRIBS),this.maxVertexUniforms=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),this.maxVaryings=t.getParameter(t.MAX_VARYING_VECTORS),this.maxFragmentUniforms=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),this.vertexTextures=0<this.maxVertexTextures,this.floatFragmentTextures=!!e.get("OES_texture_float"),this.floatVertexTextures=this.vertexTextures&&this.floatFragmentTextures,(r=i(this.precision))!==this.precision&&(console.warn("THREE.WebGLRenderer:",this.precision,"not supported, using",r,"instead."),this.precision=r),this.logarithmicDepthBuffer&&(this.logarithmicDepthBuffer=!!e.get("EXT_frag_depth"))},m.WebGLGeometries=function(t,e,r){function i(t){var a=t.target;null!==(t=o[a.id]).index&&n(t.index);var s,h=t.attributes;for(s in h)n(h[s]);a.removeEventListener("dispose",i),delete o[a.id],(s=e.get(a)).wireframe&&n(s.wireframe),e.delete(a),(a=e.get(t)).wireframe&&n(a.wireframe),e.delete(t),r.memory.geometries--}function n(r){var i;void 0!==(i=r instanceof m.InterleavedBufferAttribute?e.get(r.data).__webglBuffer:e.get(r).__webglBuffer)&&(t.deleteBuffer(i),r instanceof m.InterleavedBufferAttribute?e.delete(r.data):e.delete(r))}var o={};this.get=function(t){var e=t.geometry;if(void 0!==o[e.id])return o[e.id];e.addEventListener("dispose",i);var n;return e instanceof m.BufferGeometry?n=e:e instanceof m.Geometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new m.BufferGeometry).setFromObject(t)),n=e._bufferGeometry),o[e.id]=n,r.memory.geometries++,n}},m.WebGLLights=function(){var t={};this.get=function(e){if(void 0!==t[e.id])return t[e.id];var r;switch(e.type){case"DirectionalLight":r={direction:new m.Vector3,color:new m.Color,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new m.Vector2};break;case"SpotLight":r={position:new m.Vector3,direction:new m.Vector3,color:new m.Color,distance:0,angleCos:0,exponent:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new m.Vector2};break;case"PointLight":r={position:new m.Vector3,color:new m.Color,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new m.Vector2};break;case"HemisphereLight":r={direction:new m.Vector3,skyColor:new m.Color,groundColor:new m.Color}}return t[e.id]=r}},m.WebGLObjects=function(t,e,r){function i(r,i){var n=r instanceof m.InterleavedBufferAttribute?r.data:r,o=e.get(n);void 0===o.__webglBuffer?(o.__webglBuffer=t.createBuffer(),t.bindBuffer(i,o.__webglBuffer),t.bufferData(i,n.array,n.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW),o.version=n.version):o.version!==n.version&&(t.bindBuffer(i,o.__webglBuffer),!1===n.dynamic||-1===n.updateRange.count?t.bufferSubData(i,0,n.array):0===n.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(i,n.updateRange.offset*n.array.BYTES_PER_ELEMENT,n.array.subarray(n.updateRange.offset,n.updateRange.offset+n.updateRange.count)),n.updateRange.count=0),o.version=n.version)}function n(t,e,r){if(e>r){var i=e;e=r,r=i}return i=t[e],void 0===i?(t[e]=[r],!0):-1===i.indexOf(r)&&(i.push(r),!0)}var o=new m.WebGLGeometries(t,e,r);this.getAttributeBuffer=function(t){return t instanceof m.InterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer},this.getWireframeAttribute=function(r){var o=e.get(r);if(void 0!==o.wireframe)return o.wireframe;var a=[],s=r.index;if(r=(h=r.attributes).position,null!==s)for(var h={},s=s.array,c=0,l=s.length;c<l;c+=3){var u=s[c+0],p=s[c+1],d=s[c+2];n(h,u,p)&&a.push(u,p),n(h,p,d)&&a.push(p,d),n(h,d,u)&&a.push(d,u)}else for(s=h.position.array,c=0,l=s.length/3-1;c<l;c+=3)u=c+0,p=c+1,d=c+2,a.push(u,p,p,d,d,u);return a=new m.BufferAttribute(new(65535<r.count?Uint32Array:Uint16Array)(a),1),i(a,t.ELEMENT_ARRAY_BUFFER),o.wireframe=a},this.update=function(e){var r=o.get(e);e.geometry instanceof m.Geometry&&r.updateFromObject(e),e=r.index,a=r.attributes,null!==e&&i(e,t.ELEMENT_ARRAY_BUFFER);for(var n in a)i(a[n],t.ARRAY_BUFFER);e=r.morphAttributes;for(n in e)for(var a=e[n],s=0,h=a.length;s<h;s++)i(a[s],t.ARRAY_BUFFER);return r}},m.WebGLProgram=function(){function t(t,e,i){return t=t||{},[t.derivatives||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(r).join("\n")}function e(t){var e,r=[];for(e in t){var i=t[e];!1!==i&&r.push("#define "+e+" "+i)}return r.join("\n")}function r(t){return""!==t}function i(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function n(t){return t.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,r,i){for(t="",e=parseInt(e);e<parseInt(r);e++)t+=i.replace(/\[ i \]/g,"[ "+e+" ]");return t})}var o=0,a=/^([\w\d_]+)\.([\w\d_]+)$/,s=/^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,h=/^([\w\d_]+)\[0\]$/;return function(c,l,u,p){var d=c.context,f=u.extensions,g=u.defines,v=u.__webglShader.vertexShader,y=u.__webglShader.fragmentShader,x="SHADOWMAP_TYPE_BASIC";p.shadowMapType===m.PCFShadowMap?x="SHADOWMAP_TYPE_PCF":p.shadowMapType===m.PCFSoftShadowMap&&(x="SHADOWMAP_TYPE_PCF_SOFT");var b="ENVMAP_TYPE_CUBE",_="ENVMAP_MODE_REFLECTION",M="ENVMAP_BLENDING_MULTIPLY";if(p.envMap){switch(u.envMap.mapping){case m.CubeReflectionMapping:case m.CubeRefractionMapping:b="ENVMAP_TYPE_CUBE";break;case m.EquirectangularReflectionMapping:case m.EquirectangularRefractionMapping:b="ENVMAP_TYPE_EQUIREC";break;case m.SphericalReflectionMapping:b="ENVMAP_TYPE_SPHERE"}switch(u.envMap.mapping){case m.CubeRefractionMapping:case m.EquirectangularRefractionMapping:_="ENVMAP_MODE_REFRACTION"}switch(u.combine){case m.MultiplyOperation:M="ENVMAP_BLENDING_MULTIPLY";break;case m.MixOperation:M="ENVMAP_BLENDING_MIX";break;case m.AddOperation:M="ENVMAP_BLENDING_ADD"}}var w=0<c.gammaFactor?c.gammaFactor:1,f=t(f,p,c.extensions),S=e(g),E=d.createProgram();u instanceof m.RawShaderMaterial?c=g="":(g=["precision "+p.precision+" float;","precision "+p.precision+" int;","#define SHADER_NAME "+u.__webglShader.name,S,p.supportsVertexTextures?"#define VERTEX_TEXTURES":"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+w,"#define MAX_BONES "+p.maxBones,p.map?"#define USE_MAP":"",p.envMap?"#define USE_ENVMAP":"",p.envMap?"#define "+_:"",p.lightMap?"#define USE_LIGHTMAP":"",p.aoMap?"#define USE_AOMAP":"",p.emissiveMap?"#define USE_EMISSIVEMAP":"",p.bumpMap?"#define USE_BUMPMAP":"",p.normalMap?"#define USE_NORMALMAP":"",p.displacementMap&&p.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",p.specularMap?"#define USE_SPECULARMAP":"",p.roughnessMap?"#define USE_ROUGHNESSMAP":"",p.metalnessMap?"#define USE_METALNESSMAP":"",p.alphaMap?"#define USE_ALPHAMAP":"",p.vertexColors?"#define USE_COLOR":"",p.flatShading?"#define FLAT_SHADED":"",p.skinning?"#define USE_SKINNING":"",p.useVertexTexture?"#define BONE_TEXTURE":"",p.morphTargets?"#define USE_MORPHTARGETS":"",p.morphNormals&&!1===p.flatShading?"#define USE_MORPHNORMALS":"",p.doubleSided?"#define DOUBLE_SIDED":"",p.flipSided?"#define FLIP_SIDED":"",p.shadowMapEnabled?"#define USE_SHADOWMAP":"",p.shadowMapEnabled?"#define "+x:"",0<p.pointLightShadows?"#define POINT_LIGHT_SHADOWS":"",p.sizeAttenuation?"#define USE_SIZEATTENUATION":"",p.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",p.logarithmicDepthBuffer&&c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(r).join("\n"),c=[f,"precision "+p.precision+" float;","precision "+p.precision+" int;","#define SHADER_NAME "+u.__webglShader.name,S,p.alphaTest?"#define ALPHATEST "+p.alphaTest:"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+w,p.useFog&&p.fog?"#define USE_FOG":"",p.useFog&&p.fogExp?"#define FOG_EXP2":"",p.map?"#define USE_MAP":"",p.envMap?"#define USE_ENVMAP":"",p.envMap?"#define "+b:"",p.envMap?"#define "+_:"",p.envMap?"#define "+M:"",p.lightMap?"#define USE_LIGHTMAP":"",p.aoMap?"#define USE_AOMAP":"",p.emissiveMap?"#define USE_EMISSIVEMAP":"",p.bumpMap?"#define USE_BUMPMAP":"",p.normalMap?"#define USE_NORMALMAP":"",p.specularMap?"#define USE_SPECULARMAP":"",p.roughnessMap?"#define USE_ROUGHNESSMAP":"",p.metalnessMap?"#define USE_METALNESSMAP":"",p.alphaMap?"#define USE_ALPHAMAP":"",p.vertexColors?"#define USE_COLOR":"",p.flatShading?"#define FLAT_SHADED":"",p.doubleSided?"#define DOUBLE_SIDED":"",p.flipSided?"#define FLIP_SIDED":"",p.shadowMapEnabled?"#define USE_SHADOWMAP":"",p.shadowMapEnabled?"#define "+x:"",0<p.pointLightShadows?"#define POINT_LIGHT_SHADOWS":"",p.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",p.logarithmicDepthBuffer&&c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",p.envMap&&c.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(r).join("\n")),v=i(v,p),y=i(y,p),0==u instanceof m.ShaderMaterial&&(v=n(v),y=n(y)),y=c+y,v=m.WebGLShader(d,d.VERTEX_SHADER,g+v),y=m.WebGLShader(d,d.FRAGMENT_SHADER,y),d.attachShader(E,v),d.attachShader(E,y),void 0!==u.index0AttributeName?d.bindAttribLocation(E,0,u.index0AttributeName):!0===p.morphTargets&&d.bindAttribLocation(E,0,"position"),d.linkProgram(E),p=d.getProgramInfoLog(E),x=d.getShaderInfoLog(v),b=d.getShaderInfoLog(y),M=_=!0,!1===d.getProgramParameter(E,d.LINK_STATUS)?(_=!1,console.error("THREE.WebGLProgram: shader error: ",d.getError(),"gl.VALIDATE_STATUS",d.getProgramParameter(E,d.VALIDATE_STATUS),"gl.getProgramInfoLog",p,x,b)):""!==p?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",p):""!==x&&""!==b||(M=!1),M&&(this.diagnostics={runnable:_,material:u,programLog:p,vertexShader:{log:x,prefix:g},fragmentShader:{log:b,prefix:c}}),d.deleteShader(v),d.deleteShader(y);var T;this.getUniforms=function(){if(void 0===T){for(var t={},e=d.getProgramParameter(E,d.ACTIVE_UNIFORMS),r=0;r<e;r++){var i=d.getActiveUniform(E,r).name,n=d.getUniformLocation(E,i);if(o=a.exec(i)){var i=o[1],o=o[2];(c=t[i])||(c=t[i]={}),c[o]=n}else if(o=s.exec(i)){var c=o[1],i=o[2],o=o[3],l=t[c];l||(l=t[c]=[]),(c=l[i])||(c=l[i]={}),c[o]=n}else(o=h.exec(i))?(c=o[1],t[c]=n):t[i]=n}T=t}return T};var C;return this.getAttributes=function(){if(void 0===C){for(var t={},e=d.getProgramParameter(E,d.ACTIVE_ATTRIBUTES),r=0;r<e;r++){var i=d.getActiveAttrib(E,r).name;t[i]=d.getAttribLocation(E,i)}C=t}return C},this.destroy=function(){d.deleteProgram(E),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=o++,this.code=l,this.usedTimes=1,this.program=E,this.vertexShader=v,this.fragmentShader=y,this}}(),m.WebGLPrograms=function(t,e){var r=[],i={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshStandardMaterial:"standard",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},n="precision supportsVertexTextures map envMap envMapMode lightMap aoMap emissiveMap bumpMap normalMap displacementMap specularMap roughnessMap metalnessMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals numDirLights numPointLights numSpotLights numHemiLights shadowMapEnabled pointLightShadows shadowMapType alphaTest doubleSided flipSided".split(" ");this.getParameters=function(r,n,o,a){var s,h=i[r.type];e.floatVertexTextures&&a&&a.skeleton&&a.skeleton.useVertexTexture?s=1024:(s=Math.floor((e.maxVertexUniforms-20)/4),void 0!==a&&a instanceof m.SkinnedMesh&&(s=Math.min(a.skeleton.bones.length,s))<a.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+a.skeleton.bones.length+", this GPU supports just "+s+" (try OpenGL instead of ANGLE)"));var c=t.getPrecision();return null!==r.precision&&(c=e.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",c,"instead."),{shaderID:h,precision:c,supportsVertexTextures:e.vertexTextures,map:!!r.map,envMap:!!r.envMap,envMapMode:r.envMap&&r.envMap.mapping,lightMap:!!r.lightMap,aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,combine:r.combine,vertexColors:r.vertexColors,fog:o,useFog:r.fog,fogExp:o instanceof m.FogExp2,flatShading:r.shading===m.FlatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:e.logarithmicDepthBuffer,skinning:r.skinning,maxBones:s,useVertexTexture:e.floatVertexTextures&&a&&a.skeleton&&a.skeleton.useVertexTexture,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numHemiLights:n.hemi.length,pointLightShadows:n.shadowsPointLight,shadowMapEnabled:t.shadowMap.enabled&&a.receiveShadow&&0<n.shadows.length,shadowMapType:t.shadowMap.type,alphaTest:r.alphaTest,doubleSided:r.side===m.DoubleSide,flipSided:r.side===m.BackSide}},this.getProgramCode=function(t,e){var r=[];if(e.shaderID?r.push(e.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)r.push(i),r.push(t.defines[i]);for(i=0;i<n.length;i++){var o=n[i];r.push(o),r.push(e[o])}return r.join()},this.acquireProgram=function(e,i,n){for(var o,a=0,s=r.length;a<s;a++){var h=r[a];if(h.code===n){++(o=h).usedTimes;break}}return void 0===o&&(o=new m.WebGLProgram(t,n,e,i),r.push(o)),o},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},this.programs=r},m.WebGLProperties=function(){var t={};this.get=function(e){e=e.uuid;var r=t[e];return void 0===r&&(r={},t[e]=r),r},this.delete=function(e){delete t[e.uuid]},this.clear=function(){t={}}},m.WebGLShader=function(){function t(t){t=t.split("\n");for(var e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}return function(e,r,i){var n=e.createShader(r);return e.shaderSource(n,i),e.compileShader(n),!1===e.getShaderParameter(n,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",r===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(n),t(i)),n}}(),m.WebGLShadowMap=function(t,e,r){function i(t,e,r,i){var n=t.geometry,o=null,o=p,a=t.customDepthMaterial;return r&&(o=d,a=t.customDistanceMaterial),a?o=a:(t=t instanceof m.SkinnedMesh&&e.skinning,a=0,void 0!==n.morphTargets&&0<n.morphTargets.length&&e.morphTargets&&(a|=1),t&&(a|=2),o=o[a]),o.visible=e.visible,o.wireframe=e.wireframe,o.wireframeLinewidth=e.wireframeLinewidth,r&&void 0!==o.uniforms.lightPos&&o.uniforms.lightPos.value.copy(i),o}function n(t,e,r){if(!1!==t.visible){t.layers.test(e.layers)&&(t instanceof m.Mesh||t instanceof m.Line||t instanceof m.Points)&&t.castShadow&&(!1===t.frustumCulled||!0===s.intersectsObject(t))&&!0===t.material.visible&&(t.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,t.matrixWorld),u.push(t));for(var i=0,o=(t=t.children).length;i<o;i++)n(t[i],e,r)}}for(var o=t.context,a=t.state,s=new m.Frustum,h=new m.Matrix4,c=new m.Vector3,l=new m.Vector3,u=[],p=Array(4),d=Array(4),f=[new m.Vector3(1,0,0),new m.Vector3(-1,0,0),new m.Vector3(0,0,1),new m.Vector3(0,0,-1),new m.Vector3(0,1,0),new m.Vector3(0,-1,0)],g=[new m.Vector3(0,1,0),new m.Vector3(0,1,0),new m.Vector3(0,1,0),new m.Vector3(0,1,0),new m.Vector3(0,0,1),new m.Vector3(0,0,-1)],v=[new m.Vector4,new m.Vector4,new m.Vector4,new m.Vector4,new m.Vector4,new m.Vector4],y=m.ShaderLib.depthRGBA,x=m.UniformsUtils.clone(y.uniforms),b=m.ShaderLib.distanceRGBA,_=m.UniformsUtils.clone(b.uniforms),M=0;4!==M;++M){var w=0!=(1&M),S=0!=(2&M),E=new m.ShaderMaterial({uniforms:x,vertexShader:y.vertexShader,fragmentShader:y.fragmentShader,morphTargets:w,skinning:S});E._shadowPass=!0,p[M]=E,(w=new m.ShaderMaterial({uniforms:_,vertexShader:b.vertexShader,fragmentShader:b.fragmentShader,morphTargets:w,skinning:S}))._shadowPass=!0,d[M]=w}var T=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=m.PCFShadowMap,this.cullFace=m.CullFaceFront,this.render=function(p,d){var y,x;if(!1!==T.enabled&&(!1!==T.autoUpdate||!1!==T.needsUpdate)){a.clearColor(1,1,1,1),a.disable(o.BLEND),a.enable(o.CULL_FACE),o.frontFace(o.CCW),o.cullFace(T.cullFace===m.CullFaceFront?o.FRONT:o.BACK),a.setDepthTest(!0),a.setScissorTest(!1);for(var b=e.shadows,_=0,M=b.length;_<M;_++){var w=b[_],S=w.shadow,E=S.camera,C=S.mapSize;if(w instanceof m.PointLight){y=6,x=!0;var L=C.x/4,A=C.y/2;v[0].set(2*L,A,L,A),v[1].set(0,A,L,A),v[2].set(3*L,A,L,A),v[3].set(L,A,L,A),v[4].set(3*L,0,L,A),v[5].set(L,0,L,A)}else y=1,x=!1;for(null===S.map&&(S.map=new m.WebGLRenderTarget(C.x,C.y,{minFilter:m.LinearFilter,magFilter:m.LinearFilter,format:m.RGBAFormat}),w instanceof m.SpotLight&&(E.aspect=C.x/C.y),E.updateProjectionMatrix()),C=S.map,S=S.matrix,l.setFromMatrixPosition(w.matrixWorld),E.position.copy(l),t.setRenderTarget(C),t.clear(),C=0;C<y;C++)for(x?(c.copy(E.position),c.add(f[C]),E.up.copy(g[C]),E.lookAt(c),a.viewport(v[C])):(c.setFromMatrixPosition(w.target.matrixWorld),E.lookAt(c)),E.updateMatrixWorld(),E.matrixWorldInverse.getInverse(E.matrixWorld),S.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),S.multiply(E.projectionMatrix),S.multiply(E.matrixWorldInverse),h.multiplyMatrices(E.projectionMatrix,E.matrixWorldInverse),s.setFromMatrix(h),u.length=0,n(p,d,E),L=0,A=u.length;L<A;L++){var P=u[L],R=r.update(P);if((k=P.material)instanceof m.MultiMaterial)for(var U=R.groups,k=k.materials,D=0,I=U.length;D<I;D++){var F=U[D],B=k[F.materialIndex];!0===B.visible&&(B=i(P,B,x,l),t.renderBufferDirect(E,null,R,B,P,F))}else B=i(P,k,x,l),t.renderBufferDirect(E,null,R,B,P,null)}t.resetGLState()}y=t.getClearColor(),x=t.getClearAlpha(),t.setClearColor(y,x),a.enable(o.BLEND),T.cullFace===m.CullFaceFront&&o.cullFace(o.BACK),t.resetGLState(),T.needsUpdate=!1}}},m.WebGLState=function(t,e,r){var i=this,n=new m.Vector4,o=new Uint8Array(16),a=new Uint8Array(16),s=new Uint8Array(16),h={},c=null,l=null,u=null,p=null,d=null,f=null,g=null,v=null,y=null,x=null,b=null,_=null,M=null,w=null,S=null,E=null,T=null,C=null,L=null,A=null,P=null,R=null,U=null,k=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),D=void 0,I={},F=new m.Vector4,B=null,V=null,N=new m.Vector4,O=new m.Vector4;this.init=function(){this.clearColor(0,0,0,1),this.clearDepth(1),this.clearStencil(0),this.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),t.frontFace(t.CCW),t.cullFace(t.BACK),this.enable(t.CULL_FACE),this.enable(t.BLEND),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA)},this.initAttributes=function(){for(var t=0,e=o.length;t<e;t++)o[t]=0},this.enableAttribute=function(r){o[r]=1,0===a[r]&&(t.enableVertexAttribArray(r),a[r]=1),0!==s[r]&&(e.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(r,0),s[r]=0)},this.enableAttributeAndDivisor=function(e,r,i){o[e]=1,0===a[e]&&(t.enableVertexAttribArray(e),a[e]=1),s[e]!==r&&(i.vertexAttribDivisorANGLE(e,r),s[e]=r)},this.disableUnusedAttributes=function(){for(var e=0,r=a.length;e<r;e++)a[e]!==o[e]&&(t.disableVertexAttribArray(e),a[e]=0)},this.enable=function(e){!0!==h[e]&&(t.enable(e),h[e]=!0)},this.disable=function(e){!1!==h[e]&&(t.disable(e),h[e]=!1)},this.getCompressedTextureFormats=function(){if(null===c&&(c=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var r=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),i=0;i<r.length;i++)c.push(r[i]);return c},this.setBlending=function(e,i,n,o,a,s,h){e===m.NoBlending?this.disable(t.BLEND):this.enable(t.BLEND),e!==l&&(e===m.AdditiveBlending?(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)):e===m.SubtractiveBlending?(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR)):e===m.MultiplyBlending?(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)),l=e),e===m.CustomBlending?(a=a||i,s=s||n,h=h||o,i===u&&a===f||(t.blendEquationSeparate(r(i),r(a)),u=i,f=a),n===p&&o===d&&s===g&&h===v||(t.blendFuncSeparate(r(n),r(o),r(s),r(h)),p=n,d=o,g=s,v=h)):v=g=f=d=p=u=null},this.setDepthFunc=function(e){if(y!==e){if(e)switch(e){case m.NeverDepth:t.depthFunc(t.NEVER);break;case m.AlwaysDepth:t.depthFunc(t.ALWAYS);break;case m.LessDepth:t.depthFunc(t.LESS);break;case m.LessEqualDepth:t.depthFunc(t.LEQUAL);break;case m.EqualDepth:t.depthFunc(t.EQUAL);break;case m.GreaterEqualDepth:t.depthFunc(t.GEQUAL);break;case m.GreaterDepth:t.depthFunc(t.GREATER);break;case m.NotEqualDepth:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);y=e}},this.setDepthTest=function(e){e?this.enable(t.DEPTH_TEST):this.disable(t.DEPTH_TEST)},this.setDepthWrite=function(e){x!==e&&(t.depthMask(e),x=e)},this.setColorWrite=function(e){b!==e&&(t.colorMask(e,e,e,e),b=e)},this.setStencilFunc=function(e,r,i){M===e&&w===r&&S===i||(t.stencilFunc(e,r,i),M=e,w=r,S=i)},this.setStencilOp=function(e,r,i){E===e&&T===r&&C===i||(t.stencilOp(e,r,i),E=e,T=r,C=i)},this.setStencilTest=function(e){e?this.enable(t.STENCIL_TEST):this.disable(t.STENCIL_TEST)},this.setStencilWrite=function(e){_!==e&&(t.stencilMask(e),_=e)},this.setFlipSided=function(e){L!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),L=e)},this.setLineWidth=function(e){e!==A&&(t.lineWidth(e),A=e)},this.setPolygonOffset=function(e,r,i){e?this.enable(t.POLYGON_OFFSET_FILL):this.disable(t.POLYGON_OFFSET_FILL),!e||P===r&&R===i||(t.polygonOffset(r,i),P=r,R=i)},this.getScissorTest=function(){return U},this.setScissorTest=function(e){(U=e)?this.enable(t.SCISSOR_TEST):this.disable(t.SCISSOR_TEST)},this.activeTexture=function(e){void 0===e&&(e=t.TEXTURE0+k-1),D!==e&&(t.activeTexture(e),D=e)},this.bindTexture=function(e,r){void 0===D&&i.activeTexture();var n=I[D];void 0===n&&(n={type:void 0,texture:void 0},I[D]=n),n.type===e&&n.texture===r||(t.bindTexture(e,r),n.type=e,n.texture=r)},this.compressedTexImage2D=function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error(t)}},this.texImage2D=function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error(t)}},this.clearColor=function(e,r,i,o){n.set(e,r,i,o),!1===F.equals(n)&&(t.clearColor(e,r,i,o),F.copy(n))},this.clearDepth=function(e){B!==e&&(t.clearDepth(e),B=e)},this.clearStencil=function(e){V!==e&&(t.clearStencil(e),V=e)},this.scissor=function(e){!1===N.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),N.copy(e))},this.viewport=function(e){!1===O.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),O.copy(e))},this.reset=function(){for(var e=0;e<a.length;e++)1===a[e]&&(t.disableVertexAttribArray(e),a[e]=0);h={},L=_=x=b=l=c=null}},m.LensFlarePlugin=function(t,e){var r,i,n,o,a,s,h,c,l,u,p,d,f,g,v,y,x=t.context,b=t.state;this.render=function(_,M,w){if(0!==e.length){_=new m.Vector3;var S=w.w/w.z,E=.5*w.z,T=.5*w.w,C=16/w.w,L=new m.Vector2(C*S,C),A=new m.Vector3(1,1,0),P=new m.Vector2(1,1);if(void 0===f){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),R=new Uint16Array([0,1,2,0,2,3]);p=x.createBuffer(),d=x.createBuffer(),x.bindBuffer(x.ARRAY_BUFFER,p),x.bufferData(x.ARRAY_BUFFER,C,x.STATIC_DRAW),x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,d),x.bufferData(x.ELEMENT_ARRAY_BUFFER,R,x.STATIC_DRAW),v=x.createTexture(),y=x.createTexture(),b.bindTexture(x.TEXTURE_2D,v),x.texImage2D(x.TEXTURE_2D,0,x.RGB,16,16,0,x.RGB,x.UNSIGNED_BYTE,null),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,x.NEAREST),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,x.NEAREST),b.bindTexture(x.TEXTURE_2D,y),x.texImage2D(x.TEXTURE_2D,0,x.RGBA,16,16,0,x.RGBA,x.UNSIGNED_BYTE,null),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MAG_FILTER,x.NEAREST),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_MIN_FILTER,x.NEAREST);var C=(g=0<x.getParameter(x.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},R=x.createProgram(),U=x.createShader(x.FRAGMENT_SHADER),k=x.createShader(x.VERTEX_SHADER),D="precision "+t.getPrecision()+" float;\n";x.shaderSource(U,D+C.fragmentShader),x.shaderSource(k,D+C.vertexShader),x.compileShader(U),x.compileShader(k),x.attachShader(R,U),x.attachShader(R,k),x.linkProgram(R),f=R,l=x.getAttribLocation(f,"position"),u=x.getAttribLocation(f,"uv"),r=x.getUniformLocation(f,"renderType"),i=x.getUniformLocation(f,"map"),n=x.getUniformLocation(f,"occlusionMap"),o=x.getUniformLocation(f,"opacity"),a=x.getUniformLocation(f,"color"),s=x.getUniformLocation(f,"scale"),h=x.getUniformLocation(f,"rotation"),c=x.getUniformLocation(f,"screenPosition")}for(x.useProgram(f),b.initAttributes(),b.enableAttribute(l),b.enableAttribute(u),b.disableUnusedAttributes(),x.uniform1i(n,0),x.uniform1i(i,1),x.bindBuffer(x.ARRAY_BUFFER,p),x.vertexAttribPointer(l,2,x.FLOAT,!1,16,0),x.vertexAttribPointer(u,2,x.FLOAT,!1,16,8),x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,d),b.disable(x.CULL_FACE),b.setDepthWrite(!1),R=0,U=e.length;R<U;R++)if(C=16/w.w,L.set(C*S,C),k=e[R],_.set(k.matrixWorld.elements[12],k.matrixWorld.elements[13],k.matrixWorld.elements[14]),_.applyMatrix4(M.matrixWorldInverse),_.applyProjection(M.projectionMatrix),A.copy(_),P.x=A.x*E+E,P.y=A.y*T+T,g||0<P.x&&P.x<w.z&&0<P.y&&P.y<w.w){b.activeTexture(x.TEXTURE0),b.bindTexture(x.TEXTURE_2D,null),b.activeTexture(x.TEXTURE1),b.bindTexture(x.TEXTURE_2D,v),x.copyTexImage2D(x.TEXTURE_2D,0,x.RGB,w.x+P.x-8,w.y+P.y-8,16,16,0),x.uniform1i(r,0),x.uniform2f(s,L.x,L.y),x.uniform3f(c,A.x,A.y,A.z),b.disable(x.BLEND),b.enable(x.DEPTH_TEST),x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0),b.activeTexture(x.TEXTURE0),b.bindTexture(x.TEXTURE_2D,y),x.copyTexImage2D(x.TEXTURE_2D,0,x.RGBA,w.x+P.x-8,w.y+P.y-8,16,16,0),x.uniform1i(r,1),b.disable(x.DEPTH_TEST),b.activeTexture(x.TEXTURE1),b.bindTexture(x.TEXTURE_2D,v),x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0),k.positionScreen.copy(A),k.customUpdateCallback?k.customUpdateCallback(k):k.updateLensFlares(),x.uniform1i(r,2),b.enable(x.BLEND);for(var D=0,I=k.lensFlares.length;D<I;D++){var F=k.lensFlares[D];.001<F.opacity&&.001<F.scale&&(A.x=F.x,A.y=F.y,A.z=F.z,C=F.size*F.scale/w.w,L.x=C*S,L.y=C,x.uniform3f(c,A.x,A.y,A.z),x.uniform2f(s,L.x,L.y),x.uniform1f(h,F.rotation),x.uniform1f(o,F.opacity),x.uniform3f(a,F.color.r,F.color.g,F.color.b),b.setBlending(F.blending,F.blendEquation,F.blendSrc,F.blendDst),t.setTexture(F.texture,1),x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0))}}b.enable(x.CULL_FACE),b.enable(x.DEPTH_TEST),b.setDepthWrite(!0),t.resetGLState()}}},m.SpritePlugin=function(t,e){function r(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}var i,n,o,a,s,h,c,l,u,p,d,f,g,v,y,x,b,_,M,w,S,E=t.context,T=t.state,C=new m.Vector3,L=new m.Quaternion,A=new m.Vector3;this.render=function(P,R){if(0!==e.length){if(void 0===w){var U=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),k=new Uint16Array([0,1,2,0,2,3]);_=E.createBuffer(),M=E.createBuffer(),E.bindBuffer(E.ARRAY_BUFFER,_),E.bufferData(E.ARRAY_BUFFER,U,E.STATIC_DRAW),E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,M),E.bufferData(E.ELEMENT_ARRAY_BUFFER,k,E.STATIC_DRAW);var U=E.createProgram(),k=E.createShader(E.VERTEX_SHADER),D=E.createShader(E.FRAGMENT_SHADER);E.shaderSource(k,["precision "+t.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),E.shaderSource(D,["precision "+t.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),E.compileShader(k),E.compileShader(D),E.attachShader(U,k),E.attachShader(U,D),E.linkProgram(U),w=U,x=E.getAttribLocation(w,"position"),b=E.getAttribLocation(w,"uv"),i=E.getUniformLocation(w,"uvOffset"),n=E.getUniformLocation(w,"uvScale"),o=E.getUniformLocation(w,"rotation"),a=E.getUniformLocation(w,"scale"),s=E.getUniformLocation(w,"color"),h=E.getUniformLocation(w,"map"),c=E.getUniformLocation(w,"opacity"),l=E.getUniformLocation(w,"modelViewMatrix"),u=E.getUniformLocation(w,"projectionMatrix"),p=E.getUniformLocation(w,"fogType"),d=E.getUniformLocation(w,"fogDensity"),f=E.getUniformLocation(w,"fogNear"),g=E.getUniformLocation(w,"fogFar"),v=E.getUniformLocation(w,"fogColor"),y=E.getUniformLocation(w,"alphaTest"),(U=document.createElement("canvas")).width=8,U.height=8,(k=U.getContext("2d")).fillStyle="white",k.fillRect(0,0,8,8),(S=new m.Texture(U)).needsUpdate=!0}E.useProgram(w),T.initAttributes(),T.enableAttribute(x),T.enableAttribute(b),T.disableUnusedAttributes(),T.disable(E.CULL_FACE),T.enable(E.BLEND),E.bindBuffer(E.ARRAY_BUFFER,_),E.vertexAttribPointer(x,2,E.FLOAT,!1,16,0),E.vertexAttribPointer(b,2,E.FLOAT,!1,16,8),E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,M),E.uniformMatrix4fv(u,!1,R.projectionMatrix.elements),T.activeTexture(E.TEXTURE0),E.uniform1i(h,0),k=U=0,(D=P.fog)?(E.uniform3f(v,D.color.r,D.color.g,D.color.b),D instanceof m.Fog?(E.uniform1f(f,D.near),E.uniform1f(g,D.far),E.uniform1i(p,1),k=U=1):D instanceof m.FogExp2&&(E.uniform1f(d,D.density),E.uniform1i(p,2),k=U=2)):(E.uniform1i(p,0),k=U=0);for(var D=0,I=e.length;D<I;D++)(B=e[D]).modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,B.matrixWorld),B.z=-B.modelViewMatrix.elements[14];e.sort(r);for(var F=[],D=0,I=e.length;D<I;D++){var B=e[D],V=B.material;E.uniform1f(y,V.alphaTest),E.uniformMatrix4fv(l,!1,B.modelViewMatrix.elements),B.matrixWorld.decompose(C,L,A),F[0]=A.x,F[1]=A.y,B=0,P.fog&&V.fog&&(B=k),U!==B&&(E.uniform1i(p,B),U=B),null!==V.map?(E.uniform2f(i,V.map.offset.x,V.map.offset.y),E.uniform2f(n,V.map.repeat.x,V.map.repeat.y)):(E.uniform2f(i,0,0),E.uniform2f(n,1,1)),E.uniform1f(c,V.opacity),E.uniform3f(s,V.color.r,V.color.g,V.color.b),E.uniform1f(o,V.rotation),E.uniform2fv(a,F),T.setBlending(V.blending,V.blendEquation,V.blendSrc,V.blendDst),T.setDepthTest(V.depthTest),T.setDepthWrite(V.depthWrite),V.map&&V.map.image&&V.map.image.width?t.setTexture(V.map,0):t.setTexture(S,0),E.drawElements(E.TRIANGLES,6,E.UNSIGNED_SHORT,0)}T.enable(E.CULL_FACE),t.resetGLState()}}},Object.defineProperties(m.Box2.prototype,{empty:{value:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)}}}),Object.defineProperties(m.Box3.prototype,{empty:{value:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)}},isIntersectionSphere:{value:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}}),Object.defineProperties(m.Matrix3.prototype,{multiplyVector3:{value:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)}},multiplyVector3Array:{value:function(t){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)}}}),Object.defineProperties(m.Matrix4.prototype,{extractPosition:{value:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)}},setRotationFromQuaternion:{value:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)}},multiplyVector3:{value:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),t.applyProjection(this)}},multiplyVector4:{value:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)}},multiplyVector3Array:{value:function(t){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)}},rotateAxis:{value:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)}},crossVector:{value:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)}},translate:{value:function(t){console.error("THREE.Matrix4: .translate() has been removed.")}},rotateX:{value:function(t){console.error("THREE.Matrix4: .rotateX() has been removed.")}},rotateY:{value:function(t){console.error("THREE.Matrix4: .rotateY() has been removed.")}},rotateZ:{value:function(t){console.error("THREE.Matrix4: .rotateZ() has been removed.")}},rotateByAxis:{value:function(t,e){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")}}}),Object.defineProperties(m.Plane.prototype,{isIntersectionLine:{value:function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)}}}),Object.defineProperties(m.Quaternion.prototype,{multiplyVector3:{value:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)}}}),Object.defineProperties(m.Ray.prototype,{isIntersectionBox:{value:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)}},isIntersectionPlane:{value:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)}},isIntersectionSphere:{value:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}}),Object.defineProperties(m.Vector3.prototype,{setEulerFromRotationMatrix:{value:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")}},setEulerFromQuaternion:{value:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")}},getPositionFromMatrix:{value:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)}},getScaleFromMatrix:{value:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)}},getColumnFromMatrix:{value:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)}}}),m.Face4=function(t,e,r,i,n,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new m.Face3(t,e,r,n,o,a)},Object.defineProperties(m.Object3D.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},getChildByName:{value:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)}},renderDepth:{set:function(t){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")}},translate:{value:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(t){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(m,{PointCloud:{value:function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new m.Points(t,e)}},ParticleSystem:{value:function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new m.Points(t,e)}}}),Object.defineProperties(m.Light.prototype,{onlyShadow:{set:function(t){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(t){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(t){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(m.BufferAttribute.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length}}}),Object.defineProperties(m.BufferGeometry.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}},addIndex:{value:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)}},addDrawCall:{value:function(t,e,r){void 0!==r&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)}},clearDrawCalls:{value:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()}},computeTangents:{value:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")}},computeOffsets:{value:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}}),Object.defineProperties(m.Material.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(t){console.warn("THREE."+this.type+": .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new m.Color}}}),Object.defineProperties(m,{PointCloudMaterial:{value:function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new m.PointsMaterial(t)}},ParticleBasicMaterial:{value:function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new m.PointsMaterial(t)}},ParticleSystemMaterial:{value:function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new m.PointsMaterial(t)}}}),Object.defineProperties(m.MeshPhongMaterial.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(t){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(m.ShaderMaterial.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.defineProperties(m.WebGLRenderer.prototype,{supportsFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")}},supportsHalfFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")}},supportsStandardDerivatives:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")}},supportsCompressedTextureS3TC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")}},supportsCompressedTexturePVRTC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")}},supportsBlendMinMax:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")}},supportsVertexTextures:{value:function(){return this.capabilities.vertexTextures}},supportsInstancedArrays:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")}},enableScissorTest:{value:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)}},initMaterial:{value:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")}},addPrePlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")}},addPostPlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")}},updateShadowMap:{value:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=t}}}),Object.defineProperties(m.WebGLRenderTarget.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),m.GeometryUtils={merge:function(t,e,r){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var i;e instanceof m.Mesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,r)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},m.ImageUtils={crossOrigin:void 0,loadTexture:function(t,e,r,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var n=new m.TextureLoader;return n.setCrossOrigin(this.crossOrigin),t=n.load(t,r,void 0,i),e&&(t.mapping=e),t},loadTextureCube:function(t,e,r,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var n=new m.CubeTextureLoader;return n.setCrossOrigin(this.crossOrigin),t=n.load(t,r,void 0,i),e&&(t.mapping=e),t},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}},m.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(t,e){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},m.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},m.MeshFaceMaterial=m.MultiMaterial,m.CurveUtils={tangentQuadraticBezier:function(t,e,r,i){return 2*(1-t)*(r-e)+2*t*(i-r)},tangentCubicBezier:function(t,e,r,i,n){return-3*e*(1-t)*(1-t)+3*r*(1-t)*(1-t)-6*t*r*(1-t)+6*t*i*(1-t)-3*t*t*i+3*t*t*n},tangentSpline:function(t,e,r,i,n){return 6*t*t-6*t+(3*t*t-4*t+1)+(-6*t*t+6*t)+(3*t*t-2*t)},interpolate:function(t,e,r,i,n){var o=n*n;return(2*e-2*r+(t=.5*(r-t))+(i=.5*(i-e)))*n*o+(-3*e+3*r-2*t-i)*o+t*n+e}},m.SceneUtils={createMultiMaterialObject:function(t,e){for(var r=new m.Group,i=0,n=e.length;i<n;i++)r.add(new m.Mesh(t,e[i]));return r},detach:function(t,e,r){t.applyMatrix(e.matrixWorld),e.remove(t),r.add(t)},attach:function(t,e,r){var i=new m.Matrix4;i.getInverse(r.matrixWorld),t.applyMatrix(i),e.remove(t),r.add(t)}},m.ShapeUtils={area:function(t){for(var e=t.length,r=0,i=e-1,n=0;n<e;i=n++)r+=t[i].x*t[n].y-t[n].x*t[i].y;return.5*r},triangulate:function(t,e){var r=t.length;if(3>r)return null;var i,n,o,a=[],s=[],h=[];if(0<m.ShapeUtils.area(t))for(n=0;n<r;n++)s[n]=n;else for(n=0;n<r;n++)s[n]=r-1-n;var c=2*r;for(n=r-1;2<r;){if(0>=c--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}r<=(i=n)&&(i=0),r<=(n=i+1)&&(n=0),r<=(o=n+1)&&(o=0);var l;t:{var u=l=void 0,p=void 0,d=void 0,f=void 0,g=void 0,v=void 0,y=void 0,x=void 0,u=t[s[i]].x,p=t[s[i]].y,d=t[s[n]].x,f=t[s[n]].y,g=t[s[o]].x,v=t[s[o]].y;if(Number.EPSILON>(d-u)*(v-p)-(f-p)*(g-u))l=!1;else{var b=void 0,_=void 0,M=void 0,w=void 0,S=void 0,E=void 0,T=void 0,C=void 0,L=void 0,A=void 0,L=C=T=x=y=void 0,b=g-d,_=v-f,M=u-g,w=p-v,S=d-u,E=f-p;for(l=0;l<r;l++)if(y=t[s[l]].x,x=t[s[l]].y,!(y===u&&x===p||y===d&&x===f||y===g&&x===v)&&(T=y-u,C=x-p,L=y-d,A=x-f,y-=g,x-=v,L=b*A-_*L,T=S*C-E*T,C=M*x-w*y,L>=-Number.EPSILON&&C>=-Number.EPSILON&&T>=-Number.EPSILON)){l=!1;break t}l=!0}}if(l){for(a.push([t[s[i]],t[s[n]],t[s[o]]]),h.push([s[i],s[n],s[o]]),i=n,o=n+1;o<r;i++,o++)s[i]=s[o];c=2*--r}}return e?h:a},triangulateShape:function(t,e){function r(t,e,r){return t.x!==e.x?t.x<e.x?t.x<=r.x&&r.x<=e.x:e.x<=r.x&&r.x<=t.x:t.y<e.y?t.y<=r.y&&r.y<=e.y:e.y<=r.y&&r.y<=t.y}function i(t,e,i,n,o){var a=e.x-t.x,s=e.y-t.y,h=n.x-i.x,c=n.y-i.y,l=t.x-i.x,u=t.y-i.y,p=s*h-a*c,d=s*l-a*u;if(Math.abs(p)>Number.EPSILON){if(0<p){if(0>d||d>p)return[];if(0>(h=c*l-h*u)||h>p)return[]}else{if(0<d||d<p)return[];if(0<(h=c*l-h*u)||h<p)return[]}return 0===h?!o||0!==d&&d!==p?[t]:[]:h===p?!o||0!==d&&d!==p?[e]:[]:0===d?[i]:d===p?[n]:(o=h/p,[{x:t.x+o*a,y:t.y+o*s}])}return 0!==d||c*l!=h*u?[]:(s=0===a&&0===s,h=0===h&&0===c,s&&h?t.x!==i.x||t.y!==i.y?[]:[t]:s?r(i,n,t)?[t]:[]:h?r(t,e,i)?[i]:[]:(0!==a?(t.x<e.x?(a=t,h=t.x,s=e,t=e.x):(a=e,h=e.x,s=t,t=t.x),i.x<n.x?(e=i,p=i.x,c=n,i=n.x):(e=n,p=n.x,c=i,i=i.x)):(t.y<e.y?(a=t,h=t.y,s=e,t=e.y):(a=e,h=e.y,s=t,t=t.y),i.y<n.y?(e=i,p=i.y,c=n,i=n.y):(e=n,p=n.y,c=i,i=i.y)),h<=p?t<p?[]:t===p?o?[]:[e]:t<=i?[e,s]:[e,c]:h>i?[]:h===i?o?[]:[a]:t<=i?[a,s]:[a,c]))}function n(t,e,r,i){var n=e.x-t.x,o=e.y-t.y;e=r.x-t.x,r=r.y-t.y;var a=i.x-t.x;return i=i.y-t.y,t=n*r-o*e,n=n*i-o*a,Math.abs(t)>Number.EPSILON?(e=a*r-i*e,0<t?0<=n&&0<=e:0<=n||0<=e):0<n}var o,a,s,h,c,l={};for(s=t.concat(),o=0,a=e.length;o<a;o++)Array.prototype.push.apply(s,e[o]);for(o=0,a=s.length;o<a;o++)c=s[o].x+":"+s[o].y,void 0!==l[c]&&console.warn("THREE.Shape: Duplicate point",c),l[c]=o;o=function(t,e){var r,o,a,s,h,c,l,u,p,d=t.concat(),f=[],m=[],g=0;for(o=e.length;g<o;g++)f.push(g);l=0;for(var v=2*f.length;0<f.length;){if(0>--v){console.log("Infinite Loop! Holes left:"+f.length+", Probably Hole outside Shape!");break}for(a=l;a<d.length;a++){for(s=d[a],o=-1,g=0;g<f.length;g++)if(h=f[g],c=s.x+":"+s.y+":"+h,void 0===m[c]){for(r=e[h],u=0;u<r.length;u++)if(h=r[u],function(t,e){var i=d.length-1,o=t-1;0>o&&(o=i);var a=t+1;return a>i&&(a=0),!!(i=n(d[t],d[o],d[a],r[e]))&&(i=r.length-1,0>(o=e-1)&&(o=i),(a=e+1)>i&&(a=0),!!(i=n(r[e],r[o],r[a],d[t])))}(a,u)&&!function(t,e){var r,n;for(r=0;r<d.length;r++)if(n=r+1,n%=d.length,0<(n=i(t,e,d[r],d[n],!0)).length)return!0;return!1}(s,h)&&!function(t,r){var n,o,a,s;for(n=0;n<f.length;n++)for(o=e[f[n]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,0<(s=i(t,r,o[a],o[s],!0)).length)return!0;return!1}(s,h)){o=u,f.splice(g,1),l=d.slice(0,a+1),h=d.slice(a),u=r.slice(o),p=r.slice(0,o+1),d=l.concat(u).concat(p).concat(h),l=a;break}if(0<=o)break;m[c]=!0}if(0<=o)break}}return d}(t,e);var u=m.ShapeUtils.triangulate(o,!1);for(o=0,a=u.length;o<a;o++)for(h=u[o],s=0;3>s;s++)c=h[s].x+":"+h[s].y,void 0!==(c=l[c])&&(h[s]=c);return u.concat()},isClockWise:function(t){return 0>m.ShapeUtils.area(t)},b2:function(t,e,r,i){var n=1-t;return n*n*e+2*(1-t)*t*r+t*t*i},b3:function(t,e,r,i,n){var o=1-t,a=1-t;return o*o*o*e+3*a*a*t*r+3*(1-t)*t*t*i+t*t*t*n}},m.Curve=function(){},m.Curve.prototype={constructor:m.Curve,getPoint:function(t){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(t){return t=this.getUtoTmapping(t),this.getPoint(t)},getPoints:function(t){t||(t=5);var e,r=[];for(e=0;e<=t;e++)r.push(this.getPoint(e/t));return r},getSpacedPoints:function(t){t||(t=5);var e,r=[];for(e=0;e<=t;e++)r.push(this.getPointAt(e/t));return r},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(t||(t=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,r,i=[],n=this.getPoint(0),o=0;for(i.push(0),r=1;r<=t;r++)e=this.getPoint(r/t),o+=e.distanceTo(n),i.push(o),n=e;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var r,i=this.getLengths(),n=0,o=i.length;r=e||t*i[o-1];for(var a,s=0,h=o-1;s<=h;)if(n=Math.floor(s+(h-s)/2),0>(a=i[n]-r))s=n+1;else{if(!(0<a)){h=n;break}h=n-1}return n=h,i[n]===r?n/(o-1):(s=i[n],i=(n+(r-s)/(i[n+1]-s))/(o-1))},getTangent:function(t){var e=t-1e-4;return t+=1e-4,0>e&&(e=0),1<t&&(t=1),e=this.getPoint(e),this.getPoint(t).clone().sub(e).normalize()},getTangentAt:function(t){return t=this.getUtoTmapping(t),this.getTangent(t)}},m.Curve.create=function(t,e){return t.prototype=Object.create(m.Curve.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},m.CurvePath=function(){this.curves=[],this.autoClose=!1},m.CurvePath.prototype=Object.create(m.Curve.prototype),m.CurvePath.prototype.constructor=m.CurvePath,m.CurvePath.prototype.add=function(t){this.curves.push(t)},m.CurvePath.prototype.closePath=function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new m.LineCurve(e,t))},m.CurvePath.prototype.getPoint=function(t){for(var e=t*this.getLength(),r=this.getCurveLengths(),i=0;i<r.length;){if(r[i]>=e)return t=this.curves[i],e=1-(r[i]-e)/t.getLength(),t.getPointAt(e);i++}return null},m.CurvePath.prototype.getLength=function(){var t=this.getCurveLengths();return t[t.length-1]},m.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,r=0,i=this.curves.length;r<i;r++)e+=this.curves[r].getLength(),t.push(e);return this.cacheLengths=t},m.CurvePath.prototype.createPointsGeometry=function(t){return t=this.getPoints(t),this.createGeometry(t)},m.CurvePath.prototype.createSpacedPointsGeometry=function(t){return t=this.getSpacedPoints(t),this.createGeometry(t)},m.CurvePath.prototype.createGeometry=function(t){for(var e=new m.Geometry,r=0,i=t.length;r<i;r++){var n=t[r];e.vertices.push(new m.Vector3(n.x,n.y,n.z||0))}return e},m.Font=function(t){this.data=t},m.Font.prototype={constructor:m.Font,generateShapes:function(t,e,r){void 0===e&&(e=100),void 0===r&&(r=4);var i=this.data;t=String(t).split("");var n=e/i.resolution,o=0;e=[];for(var a=0;a<t.length;a++){var s;s=n;var h=o,c=i.glyphs[t[a]]||i.glyphs["?"];if(c){var l=new m.Path,u=[],p=m.ShapeUtils.b2,d=m.ShapeUtils.b3,f=void 0,g=void 0,v=g=f=void 0,y=void 0,x=void 0,b=void 0,_=void 0,M=void 0,y=void 0;if(c.o)for(var w=c._cachedOutline||(c._cachedOutline=c.o.split(" ")),S=0,E=w.length;S<E;)switch(w[S++]){case"m":f=w[S++]*s+h,g=w[S++]*s,l.moveTo(f,g);break;case"l":f=w[S++]*s+h,g=w[S++]*s,l.lineTo(f,g);break;case"q":if(f=w[S++]*s+h,g=w[S++]*s,x=w[S++]*s+h,b=w[S++]*s,l.quadraticCurveTo(x,b,f,g),y=u[u.length-1])for(var v=y.x,y=y.y,T=1;T<=r;T++){var C=T/r;p(C,v,x,f),p(C,y,b,g)}break;case"b":if(f=w[S++]*s+h,g=w[S++]*s,x=w[S++]*s+h,b=w[S++]*s,_=w[S++]*s+h,M=w[S++]*s,l.bezierCurveTo(x,b,_,M,f,g),y=u[u.length-1])for(v=y.x,y=y.y,T=1;T<=r;T++)C=T/r,d(C,v,x,_,f),d(C,y,b,M,g)}s={offset:c.ha*s,path:l}}else s=void 0;o+=s.offset,e.push(s.path)}for(r=[],i=0,t=e.length;i<t;i++)Array.prototype.push.apply(r,e[i].toShapes());return r}},m.Path=function(t){m.CurvePath.call(this),this.actions=[],t&&this.fromPoints(t)},m.Path.prototype=Object.create(m.CurvePath.prototype),m.Path.prototype.constructor=m.Path,m.Path.prototype.fromPoints=function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,r=t.length;e<r;e++)this.lineTo(t[e].x,t[e].y)},m.Path.prototype.moveTo=function(t,e){this.actions.push({action:"moveTo",args:[t,e]})},m.Path.prototype.lineTo=function(t,e){var r=this.actions[this.actions.length-1].args,r=new m.LineCurve(new m.Vector2(r[r.length-2],r[r.length-1]),new m.Vector2(t,e));this.curves.push(r),this.actions.push({action:"lineTo",args:[t,e]})},m.Path.prototype.quadraticCurveTo=function(t,e,r,i){var n=this.actions[this.actions.length-1].args,n=new m.QuadraticBezierCurve(new m.Vector2(n[n.length-2],n[n.length-1]),new m.Vector2(t,e),new m.Vector2(r,i));this.curves.push(n),this.actions.push({action:"quadraticCurveTo",args:[t,e,r,i]})},m.Path.prototype.bezierCurveTo=function(t,e,r,i,n,o){var a=this.actions[this.actions.length-1].args,a=new m.CubicBezierCurve(new m.Vector2(a[a.length-2],a[a.length-1]),new m.Vector2(t,e),new m.Vector2(r,i),new m.Vector2(n,o));this.curves.push(a),this.actions.push({action:"bezierCurveTo",args:[t,e,r,i,n,o]})},m.Path.prototype.splineThru=function(t){var e=Array.prototype.slice.call(arguments),r=this.actions[this.actions.length-1].args,r=[new m.Vector2(r[r.length-2],r[r.length-1])];Array.prototype.push.apply(r,t),r=new m.SplineCurve(r),this.curves.push(r),this.actions.push({action:"splineThru",args:e})},m.Path.prototype.arc=function(t,e,r,i,n,o){var a=this.actions[this.actions.length-1].args;this.absarc(t+a[a.length-2],e+a[a.length-1],r,i,n,o)},m.Path.prototype.absarc=function(t,e,r,i,n,o){this.absellipse(t,e,r,r,i,n,o)},m.Path.prototype.ellipse=function(t,e,r,i,n,o,a,s){var h=this.actions[this.actions.length-1].args;this.absellipse(t+h[h.length-2],e+h[h.length-1],r,i,n,o,a,s)},m.Path.prototype.absellipse=function(t,e,r,i,n,o,a,s){var h=[t,e,r,i,n,o,a,s||0];t=new m.EllipseCurve(t,e,r,i,n,o,a,s),this.curves.push(t),t=t.getPoint(1),h.push(t.x),h.push(t.y),this.actions.push({action:"ellipse",args:h})},m.Path.prototype.getSpacedPoints=function(t){t||(t=40);for(var e=[],r=0;r<t;r++)e.push(this.getPoint(r/t));return this.autoClose&&e.push(e[0]),e},m.Path.prototype.getPoints=function(t){t=t||12;for(var e,r,i,n,o,a,s,h,c,l,u=m.ShapeUtils.b2,p=m.ShapeUtils.b3,d=[],f=0,g=this.actions.length;f<g;f++){var v=(c=this.actions[f]).args;switch(c.action){case"moveTo":case"lineTo":d.push(new m.Vector2(v[0],v[1]));break;case"quadraticCurveTo":for(e=v[2],r=v[3],o=v[0],a=v[1],0<d.length?(c=d[d.length-1],s=c.x,h=c.y):(c=this.actions[f-1].args,s=c[c.length-2],h=c[c.length-1]),v=1;v<=t;v++)l=v/t,c=u(l,s,o,e),l=u(l,h,a,r),d.push(new m.Vector2(c,l));break;case"bezierCurveTo":for(e=v[4],r=v[5],o=v[0],a=v[1],i=v[2],n=v[3],0<d.length?(c=d[d.length-1],s=c.x,h=c.y):(c=this.actions[f-1].args,s=c[c.length-2],h=c[c.length-1]),v=1;v<=t;v++)l=v/t,c=p(l,s,o,i,e),l=p(l,h,a,n,r),d.push(new m.Vector2(c,l));break;case"splineThru":for(c=this.actions[f-1].args,l=[new m.Vector2(c[c.length-2],c[c.length-1])],c=t*v[0].length,l=l.concat(v[0]),l=new m.SplineCurve(l),v=1;v<=c;v++)d.push(l.getPointAt(v/c));break;case"arc":for(e=v[0],r=v[1],a=v[2],i=v[3],c=v[4],o=!!v[5],s=c-i,h=2*t,v=1;v<=h;v++)l=v/h,o||(l=1-l),l=i+l*s,c=e+a*Math.cos(l),l=r+a*Math.sin(l),d.push(new m.Vector2(c,l));break;case"ellipse":e=v[0],r=v[1],a=v[2],n=v[3],i=v[4],c=v[5],o=!!v[6];var y=v[7];s=c-i,h=2*t;var x,b;for(0!==y&&(x=Math.cos(y),b=Math.sin(y)),v=1;v<=h;v++){if(l=v/h,o||(l=1-l),l=i+l*s,c=e+a*Math.cos(l),l=r+n*Math.sin(l),0!==y){var _=c;c=(_-e)*x-(l-r)*b+e,l=(_-e)*b+(l-r)*x+r}d.push(new m.Vector2(c,l))}}}return t=d[d.length-1],Math.abs(t.x-d[0].x)<Number.EPSILON&&Math.abs(t.y-d[0].y)<Number.EPSILON&&d.splice(d.length-1,1),this.autoClose&&d.push(d[0]),d},m.Path.prototype.toShapes=function(t,e){function r(t){for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r],o=new m.Shape;o.actions=n.actions,o.curves=n.curves,e.push(o)}return e}var i=m.ShapeUtils.isClockWise,n=function(t){for(var e=[],r=new m.Path,i=0,n=t.length;i<n;i++){var o=t[i],a=o.args;"moveTo"===(o=o.action)&&0!==r.actions.length&&(e.push(r),r=new m.Path),r[o].apply(r,a)}return 0!==r.actions.length&&e.push(r),e}(this.actions);if(0===n.length)return[];if(!0===e)return r(n);var o,a,s,h=[];if(1===n.length)return a=n[0],s=new m.Shape,s.actions=a.actions,s.curves=a.curves,h.push(s),h;var c=!i(n[0].getPoints()),c=t?!c:c;s=[];var l,u=[],p=[],d=0;u[d]=void 0,p[d]=[];for(var f=0,g=n.length;f<g;f++)a=n[f],l=a.getPoints(),o=i(l),(o=t?!o:o)?(!c&&u[d]&&d++,u[d]={s:new m.Shape,p:l},u[d].s.actions=a.actions,u[d].s.curves=a.curves,c&&d++,p[d]=[]):p[d].push({h:a,p:l[0]});if(!u[0])return r(n);if(1<u.length){for(f=!1,a=[],i=0,n=u.length;i<n;i++)s[i]=[];for(i=0,n=u.length;i<n;i++)for(o=p[i],c=0;c<o.length;c++){for(d=o[c],l=!0,g=0;g<u.length;g++)(function(t,e){for(var r=e.length,i=!1,n=r-1,o=0;o<r;n=o++){var a=e[n],s=e[o],h=s.x-a.x,c=s.y-a.y;if(Math.abs(c)>Number.EPSILON){if(0>c&&(a=e[o],h=-h,s=e[n],c=-c),!(t.y<a.y||t.y>s.y))if(t.y===a.y){if(t.x===a.x)return!0}else{if(0==(n=c*(t.x-a.x)-h*(t.y-a.y)))return!0;0>n||(i=!i)}}else if(t.y===a.y&&(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x))return!0}return i})(d.p,u[g].p)&&(i!==g&&a.push({froms:i,tos:g,hole:c}),l?(l=!1,s[g].push(d)):f=!0);l&&s[i].push(d)}0<a.length&&(f||(p=s))}for(f=0,i=u.length;f<i;f++)for(s=u[f].s,h.push(s),a=p[f],n=0,o=a.length;n<o;n++)s.holes.push(a[n].h);return h},m.Shape=function(){m.Path.apply(this,arguments),this.holes=[]},m.Shape.prototype=Object.create(m.Path.prototype),m.Shape.prototype.constructor=m.Shape,m.Shape.prototype.extrude=function(t){return new m.ExtrudeGeometry(this,t)},m.Shape.prototype.makeGeometry=function(t){return new m.ShapeGeometry(this,t)},m.Shape.prototype.getPointsHoles=function(t){for(var e=[],r=0,i=this.holes.length;r<i;r++)e[r]=this.holes[r].getPoints(t);return e},m.Shape.prototype.extractAllPoints=function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},m.Shape.prototype.extractPoints=function(t){return this.extractAllPoints(t)},m.LineCurve=function(t,e){this.v1=t,this.v2=e},m.LineCurve.prototype=Object.create(m.Curve.prototype),m.LineCurve.prototype.constructor=m.LineCurve,m.LineCurve.prototype.getPoint=function(t){var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},m.LineCurve.prototype.getPointAt=function(t){return this.getPoint(t)},m.LineCurve.prototype.getTangent=function(t){return this.v2.clone().sub(this.v1).normalize()},m.QuadraticBezierCurve=function(t,e,r){this.v0=t,this.v1=e,this.v2=r},m.QuadraticBezierCurve.prototype=Object.create(m.Curve.prototype),m.QuadraticBezierCurve.prototype.constructor=m.QuadraticBezierCurve,m.QuadraticBezierCurve.prototype.getPoint=function(t){var e=m.ShapeUtils.b2;return new m.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y))},m.QuadraticBezierCurve.prototype.getTangent=function(t){var e=m.CurveUtils.tangentQuadraticBezier;return new m.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y)).normalize()},m.CubicBezierCurve=function(t,e,r,i){this.v0=t,this.v1=e,this.v2=r,this.v3=i},m.CubicBezierCurve.prototype=Object.create(m.Curve.prototype),m.CubicBezierCurve.prototype.constructor=m.CubicBezierCurve,m.CubicBezierCurve.prototype.getPoint=function(t){var e=m.ShapeUtils.b3;return new m.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y))},m.CubicBezierCurve.prototype.getTangent=function(t){var e=m.CurveUtils.tangentCubicBezier;return new m.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()},m.SplineCurve=function(t){this.points=void 0==t?[]:t},m.SplineCurve.prototype=Object.create(m.Curve.prototype),m.SplineCurve.prototype.constructor=m.SplineCurve,m.SplineCurve.prototype.getPoint=function(t){t*=(n=this.points).length-1,t-=o=Math.floor(t);var e=n[0===o?o:o-1],r=n[o],i=n[o>n.length-2?n.length-1:o+1],n=n[o>n.length-3?n.length-1:o+2],o=m.CurveUtils.interpolate;return new m.Vector2(o(e.x,r.x,i.x,n.x,t),o(e.y,r.y,i.y,n.y,t))},m.EllipseCurve=function(t,e,r,i,n,o,a,s){this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0},m.EllipseCurve.prototype=Object.create(m.Curve.prototype),m.EllipseCurve.prototype.constructor=m.EllipseCurve,m.EllipseCurve.prototype.getPoint=function(t){0>(r=this.aEndAngle-this.aStartAngle)&&(r+=2*Math.PI),r>2*Math.PI&&(r-=2*Math.PI),r=!0===this.aClockwise?this.aEndAngle+(1-t)*(2*Math.PI-r):this.aStartAngle+t*r,t=this.aX+this.xRadius*Math.cos(r);var e=this.aY+this.yRadius*Math.sin(r);if(0!==this.aRotation){var r=Math.cos(this.aRotation),i=Math.sin(this.aRotation),n=t;t=(n-this.aX)*r-(e-this.aY)*i+this.aX,e=(n-this.aX)*i+(e-this.aY)*r+this.aY}return new m.Vector2(t,e)},m.ArcCurve=function(t,e,r,i,n,o){m.EllipseCurve.call(this,t,e,r,r,i,n,o)},m.ArcCurve.prototype=Object.create(m.EllipseCurve.prototype),m.ArcCurve.prototype.constructor=m.ArcCurve,m.LineCurve3=m.Curve.create(function(t,e){this.v1=t,this.v2=e},function(t){var e=new m.Vector3;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e}),m.QuadraticBezierCurve3=m.Curve.create(function(t,e,r){this.v0=t,this.v1=e,this.v2=r},function(t){var e=m.ShapeUtils.b2;return new m.Vector3(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y),e(t,this.v0.z,this.v1.z,this.v2.z))}),m.CubicBezierCurve3=m.Curve.create(function(t,e,r,i){this.v0=t,this.v1=e,this.v2=r,this.v3=i},function(t){var e=m.ShapeUtils.b3;return new m.Vector3(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),m.SplineCurve3=m.Curve.create(function(t){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=void 0==t?[]:t},function(t){t*=(n=this.points).length-1,t-=o=Math.floor(t);var e=n[0==o?o:o-1],r=n[o],i=n[o>n.length-2?n.length-1:o+1],n=n[o>n.length-3?n.length-1:o+2],o=m.CurveUtils.interpolate;return new m.Vector3(o(e.x,r.x,i.x,n.x,t),o(e.y,r.y,i.y,n.y,t),o(e.z,r.z,i.z,n.z,t))}),m.CatmullRomCurve3=function(){function t(){}var e=new m.Vector3,r=new t,i=new t,n=new t;return t.prototype.init=function(t,e,r,i){this.c0=t,this.c1=r,this.c2=-3*t+3*e-2*r-i,this.c3=2*t-2*e+r+i},t.prototype.initNonuniformCatmullRom=function(t,e,r,i,n,o,a){t=((e-t)/n-(r-t)/(n+o)+(r-e)/o)*o,i=((r-e)/o-(i-e)/(o+a)+(i-r)/a)*o,this.init(e,r,t,i)},t.prototype.initCatmullRom=function(t,e,r,i,n){this.init(e,r,n*(r-t),n*(i-e))},t.prototype.calc=function(t){var e=t*t;return this.c0+this.c1*t+this.c2*e+this.c3*e*t},m.Curve.create(function(t){this.points=t||[],this.closed=!1},function(t){var o,a,s=this.points;2>(a=s.length)&&console.log("duh, you need at least 2 points"),t*=a-(this.closed?0:1),t-=o=Math.floor(t),this.closed?o+=0<o?0:(Math.floor(Math.abs(o)/s.length)+1)*s.length:0===t&&o===a-1&&(o=a-2,t=1);var h,c,l;if(this.closed||0<o?h=s[(o-1)%a]:(e.subVectors(s[0],s[1]).add(s[0]),h=e),c=s[o%a],l=s[(o+1)%a],this.closed||o+2<a?s=s[(o+2)%a]:(e.subVectors(s[a-1],s[a-2]).add(s[a-1]),s=e),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var u="chordal"===this.type?.5:.25;a=Math.pow(h.distanceToSquared(c),u),o=Math.pow(c.distanceToSquared(l),u),u=Math.pow(l.distanceToSquared(s),u),1e-4>o&&(o=1),1e-4>a&&(a=o),1e-4>u&&(u=o),r.initNonuniformCatmullRom(h.x,c.x,l.x,s.x,a,o,u),i.initNonuniformCatmullRom(h.y,c.y,l.y,s.y,a,o,u),n.initNonuniformCatmullRom(h.z,c.z,l.z,s.z,a,o,u)}else"catmullrom"===this.type&&(a=void 0!==this.tension?this.tension:.5,r.initCatmullRom(h.x,c.x,l.x,s.x,a),i.initCatmullRom(h.y,c.y,l.y,s.y,a),n.initCatmullRom(h.z,c.z,l.z,s.z,a));return new m.Vector3(r.calc(t),i.calc(t),n.calc(t))})}(),m.ClosedSplineCurve3=function(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),m.CatmullRomCurve3.call(this,t),this.type="catmullrom",this.closed=!0},m.ClosedSplineCurve3.prototype=Object.create(m.CatmullRomCurve3.prototype),m.BoxGeometry=function(t,e,r,i,n,o){function a(t,e,r,i,n,o,a,h){var c,l=s.widthSegments,u=s.heightSegments,p=n/2,d=o/2,f=s.vertices.length;"x"===t&&"y"===e||"y"===t&&"x"===e?c="z":"x"===t&&"z"===e||"z"===t&&"x"===e?(c="y",u=s.depthSegments):("z"===t&&"y"===e||"y"===t&&"z"===e)&&(c="x",l=s.depthSegments);var g=l+1,v=u+1,y=n/l,x=o/u,b=new m.Vector3;for(b[c]=0<a?1:-1,n=0;n<v;n++)for(o=0;o<g;o++){var _=new m.Vector3;_[t]=(o*y-p)*r,_[e]=(n*x-d)*i,_[c]=a,s.vertices.push(_)}for(n=0;n<u;n++)for(o=0;o<l;o++)d=o+g*n,t=o+g*(n+1),e=o+1+g*(n+1),r=o+1+g*n,i=new m.Vector2(o/l,1-n/u),a=new m.Vector2(o/l,1-(n+1)/u),c=new m.Vector2((o+1)/l,1-(n+1)/u),p=new m.Vector2((o+1)/l,1-n/u),(d=new m.Face3(d+f,t+f,r+f)).normal.copy(b),d.vertexNormals.push(b.clone(),b.clone(),b.clone()),d.materialIndex=h,s.faces.push(d),s.faceVertexUvs[0].push([i,a,p]),(d=new m.Face3(t+f,e+f,r+f)).normal.copy(b),d.vertexNormals.push(b.clone(),b.clone(),b.clone()),d.materialIndex=h,s.faces.push(d),s.faceVertexUvs[0].push([a.clone(),c,p.clone()])}m.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:n,depthSegments:o},this.widthSegments=i||1,this.heightSegments=n||1,this.depthSegments=o||1;var s=this;n=e/2,o=r/2,a("z","y",-1,-1,r,e,i=t/2,0),a("z","y",1,-1,r,e,-i,1),a("x","z",1,1,t,r,n,2),a("x","z",1,-1,t,r,-n,3),a("x","y",1,-1,t,e,o,4),a("x","y",-1,-1,t,e,-o,5),this.mergeVertices()},m.BoxGeometry.prototype=Object.create(m.Geometry.prototype),m.BoxGeometry.prototype.constructor=m.BoxGeometry,m.CubeGeometry=m.BoxGeometry,m.CircleGeometry=function(t,e,r,i){m.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:i},this.fromBufferGeometry(new m.CircleBufferGeometry(t,e,r,i))},m.CircleGeometry.prototype=Object.create(m.Geometry.prototype),m.CircleGeometry.prototype.constructor=m.CircleGeometry,m.CircleBufferGeometry=function(t,e,r,i){m.BufferGeometry.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:i},t=t||50,e=void 0!==e?Math.max(3,e):8,r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var n=e+2,o=new Float32Array(3*n),a=new Float32Array(3*n),n=new Float32Array(2*n);a[2]=1,n[0]=.5,n[1]=.5;for(var s=0,h=3,c=2;s<=e;s++,h+=3,c+=2){var l=r+s/e*i;o[h]=t*Math.cos(l),o[h+1]=t*Math.sin(l),a[h+2]=1,n[c]=(o[h]/t+1)/2,n[c+1]=(o[h+1]/t+1)/2}for(r=[],h=1;h<=e;h++)r.push(h,h+1,0);this.setIndex(new m.BufferAttribute(new Uint16Array(r),1)),this.addAttribute("position",new m.BufferAttribute(o,3)),this.addAttribute("normal",new m.BufferAttribute(a,3)),this.addAttribute("uv",new m.BufferAttribute(n,2)),this.boundingSphere=new m.Sphere(new m.Vector3,t)},m.CircleBufferGeometry.prototype=Object.create(m.BufferGeometry.prototype),m.CircleBufferGeometry.prototype.constructor=m.CircleBufferGeometry,m.CylinderGeometry=function(t,e,r,i,n,o,a,s){m.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:r,radialSegments:i,heightSegments:n,openEnded:o,thetaStart:a,thetaLength:s},t=void 0!==t?t:20,e=void 0!==e?e:20,r=void 0!==r?r:100,i=i||8,n=n||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var h,c,l=r/2,u=[],p=[];for(c=0;c<=n;c++){var d=[],f=[],g=(v=c/n)*(e-t)+t;for(h=0;h<=i;h++)y=h/i,(x=new m.Vector3).x=g*Math.sin(y*s+a),x.y=-v*r+l,x.z=g*Math.cos(y*s+a),this.vertices.push(x),d.push(this.vertices.length-1),f.push(new m.Vector2(y,1-v));u.push(d),p.push(f)}for(r=(e-t)/r,h=0;h<i;h++)for(0!==t?(a=this.vertices[u[0][h]].clone(),s=this.vertices[u[0][h+1]].clone()):(a=this.vertices[u[1][h]].clone(),s=this.vertices[u[1][h+1]].clone()),a.setY(Math.sqrt(a.x*a.x+a.z*a.z)*r).normalize(),s.setY(Math.sqrt(s.x*s.x+s.z*s.z)*r).normalize(),c=0;c<n;c++){var d=u[c][h],f=u[c+1][h],v=u[c+1][h+1],g=u[c][h+1],y=a.clone(),x=a.clone(),b=s.clone(),_=s.clone(),M=p[c][h].clone(),w=p[c+1][h].clone(),S=p[c+1][h+1].clone(),E=p[c][h+1].clone();this.faces.push(new m.Face3(d,f,g,[y,x,_])),this.faceVertexUvs[0].push([M,w,E]),this.faces.push(new m.Face3(f,v,g,[x.clone(),b,_.clone()])),this.faceVertexUvs[0].push([w.clone(),S,E.clone()])}if(!1===o&&0<t)for(this.vertices.push(new m.Vector3(0,l,0)),h=0;h<i;h++)d=u[0][h],f=u[0][h+1],v=this.vertices.length-1,y=new m.Vector3(0,1,0),x=new m.Vector3(0,1,0),b=new m.Vector3(0,1,0),M=p[0][h].clone(),w=p[0][h+1].clone(),S=new m.Vector2(w.x,0),this.faces.push(new m.Face3(d,f,v,[y,x,b],void 0,1)),this.faceVertexUvs[0].push([M,w,S]);if(!1===o&&0<e)for(this.vertices.push(new m.Vector3(0,-l,0)),h=0;h<i;h++)d=u[n][h+1],f=u[n][h],v=this.vertices.length-1,y=new m.Vector3(0,-1,0),x=new m.Vector3(0,-1,0),b=new m.Vector3(0,-1,0),M=p[n][h+1].clone(),w=p[n][h].clone(),S=new m.Vector2(w.x,1),this.faces.push(new m.Face3(d,f,v,[y,x,b],void 0,2)),this.faceVertexUvs[0].push([M,w,S]);this.computeFaceNormals()},m.CylinderGeometry.prototype=Object.create(m.Geometry.prototype),m.CylinderGeometry.prototype.constructor=m.CylinderGeometry,m.EdgesGeometry=function(t,e){m.BufferGeometry.call(this);var r,i=Math.cos(m.Math.degToRad(void 0!==e?e:1)),n=[0,0],o={},a=["a","b","c"];t instanceof m.BufferGeometry?(r=new m.Geometry).fromBufferGeometry(t):r=t.clone(),r.mergeVertices(),r.computeFaceNormals();for(var s=r.vertices,h=0,c=(r=r.faces).length;h<c;h++)for(var l=r[h],u=0;3>u;u++){n[0]=l[a[u]],n[1]=l[a[(u+1)%3]],n.sort(function(t,e){return t-e});var p=n.toString();void 0===o[p]?o[p]={vert1:n[0],vert2:n[1],face1:h,face2:void 0}:o[p].face2=h}n=[];for(p in o)(void 0===(a=o[p]).face2||r[a.face1].normal.dot(r[a.face2].normal)<=i)&&(h=s[a.vert1],n.push(h.x),n.push(h.y),n.push(h.z),h=s[a.vert2],n.push(h.x),n.push(h.y),n.push(h.z));this.addAttribute("position",new m.BufferAttribute(new Float32Array(n),3))},m.EdgesGeometry.prototype=Object.create(m.BufferGeometry.prototype),m.EdgesGeometry.prototype.constructor=m.EdgesGeometry,m.ExtrudeGeometry=function(t,e){void 0!==t&&(m.Geometry.call(this),this.type="ExtrudeGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),this.computeFaceNormals())},m.ExtrudeGeometry.prototype=Object.create(m.Geometry.prototype),m.ExtrudeGeometry.prototype.constructor=m.ExtrudeGeometry,m.ExtrudeGeometry.prototype.addShapeList=function(t,e){for(var r=t.length,i=0;i<r;i++)this.addShape(t[i],e)},m.ExtrudeGeometry.prototype.addShape=function(t,e){function r(t,e,r){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(r).add(t)}function i(t,e,r){var i=1,i=t.x-e.x,n=t.y-e.y,o=r.x-t.x,a=r.y-t.y,s=i*i+n*n;if(Math.abs(i*a-n*o)>Number.EPSILON){var h=Math.sqrt(s),c=Math.sqrt(o*o+a*a),s=e.x-n/h;if(e=e.y+i/h,o=((r.x-a/c-s)*a-(r.y+o/c-e)*o)/(i*a-n*o),r=s+i*o-t.x,t=e+n*o-t.y,2>=(i=r*r+t*t))return new m.Vector2(r,t);i=Math.sqrt(i/2)}else t=!1,i>Number.EPSILON?o>Number.EPSILON&&(t=!0):i<-Number.EPSILON?o<-Number.EPSILON&&(t=!0):Math.sign(n)===Math.sign(a)&&(t=!0),t?(r=-n,t=i,i=Math.sqrt(s)):(r=i,t=n,i=Math.sqrt(s/2));return new m.Vector2(r/i,t/i)}function n(t,e){var r,i;for(N=t.length;0<=--N;){r=N,0>(i=N-1)&&(i=t.length-1);for(var n=0,o=x+2*g,n=0;n<o;n++){var a=(a=e+r+(s=B*n))+C,s=(s=e+i+s)+C,h=(h=e+i+(c=B*(n+1)))+C,c=(c=e+r+c)+C;T.faces.push(new m.Face3(a,s,c,null,null,1)),T.faces.push(new m.Face3(s,h,c,null,null,1)),a=M.generateSideWallUV(T,a,s,h,c),T.faceVertexUvs[0].push([a[0],a[1],a[3]]),T.faceVertexUvs[0].push([a[1],a[2],a[3]])}}}function o(t,e,r){T.vertices.push(new m.Vector3(t,e,r))}function a(t,e,r){t+=C,e+=C,r+=C,T.faces.push(new m.Face3(t,e,r,null,null,0)),t=M.generateTopUV(T,t,e,r),T.faceVertexUvs[0].push(t)}var s,h,c,l,u,p=void 0!==e.amount?e.amount:100,d=void 0!==e.bevelThickness?e.bevelThickness:6,f=void 0!==e.bevelSize?e.bevelSize:d-2,g=void 0!==e.bevelSegments?e.bevelSegments:3,v=void 0===e.bevelEnabled||e.bevelEnabled,y=void 0!==e.curveSegments?e.curveSegments:12,x=void 0!==e.steps?e.steps:1,b=e.extrudePath,_=!1,M=void 0!==e.UVGenerator?e.UVGenerator:m.ExtrudeGeometry.WorldUVGenerator;b&&(s=b.getSpacedPoints(x),_=!0,v=!1,h=void 0!==e.frames?e.frames:new m.TubeGeometry.FrenetFrames(b,x,!1),c=new m.Vector3,l=new m.Vector3,u=new m.Vector3),v||(f=d=g=0);var w,S,E,T=this,C=this.vertices.length,y=(b=t.extractPoints(y)).shape,L=b.holes;if(b=!m.ShapeUtils.isClockWise(y)){for(y=y.reverse(),S=0,E=L.length;S<E;S++)w=L[S],m.ShapeUtils.isClockWise(w)&&(L[S]=w.reverse());b=!1}var A=m.ShapeUtils.triangulateShape(y,L),P=y;for(S=0,E=L.length;S<E;S++)w=L[S],y=y.concat(w);var R,U,k,D,I,F,B=y.length,V=A.length,b=[],N=0;for(R=(k=P.length)-1,U=N+1;N<k;N++,R++,U++)R===k&&(R=0),U===k&&(U=0),b[N]=i(P[N],P[R],P[U]);var O,G=[],z=b.concat();for(S=0,E=L.length;S<E;S++){for(w=L[S],O=[],N=0,R=(k=w.length)-1,U=N+1;N<k;N++,R++,U++)R===k&&(R=0),U===k&&(U=0),O[N]=i(w[N],w[R],w[U]);G.push(O),z=z.concat(O)}for(R=0;R<g;R++){for(D=d*(1-(k=R/g)),U=f*Math.sin(k*Math.PI/2),N=0,k=P.length;N<k;N++)I=r(P[N],b[N],U),o(I.x,I.y,-D);for(S=0,E=L.length;S<E;S++)for(w=L[S],O=G[S],N=0,k=w.length;N<k;N++)I=r(w[N],O[N],U),o(I.x,I.y,-D)}for(U=f,N=0;N<B;N++)I=v?r(y[N],z[N],U):y[N],_?(l.copy(h.normals[0]).multiplyScalar(I.x),c.copy(h.binormals[0]).multiplyScalar(I.y),u.copy(s[0]).add(l).add(c),o(u.x,u.y,u.z)):o(I.x,I.y,0);for(k=1;k<=x;k++)for(N=0;N<B;N++)I=v?r(y[N],z[N],U):y[N],_?(l.copy(h.normals[k]).multiplyScalar(I.x),c.copy(h.binormals[k]).multiplyScalar(I.y),u.copy(s[k]).add(l).add(c),o(u.x,u.y,u.z)):o(I.x,I.y,p/x*k);for(R=g-1;0<=R;R--){for(D=d*(1-(k=R/g)),U=f*Math.sin(k*Math.PI/2),N=0,k=P.length;N<k;N++)I=r(P[N],b[N],U),o(I.x,I.y,p+D);for(S=0,E=L.length;S<E;S++)for(w=L[S],O=G[S],N=0,k=w.length;N<k;N++)I=r(w[N],O[N],U),_?o(I.x,I.y+s[x-1].y,s[x-1].x+D):o(I.x,I.y,p+D)}!function(){if(v){var t;for(t=0*B,N=0;N<V;N++)F=A[N],a(F[2]+t,F[1]+t,F[0]+t);for(t=x+2*g,t*=B,N=0;N<V;N++)F=A[N],a(F[0]+t,F[1]+t,F[2]+t)}else{for(N=0;N<V;N++)F=A[N],a(F[2],F[1],F[0]);for(N=0;N<V;N++)F=A[N],a(F[0]+B*x,F[1]+B*x,F[2]+B*x)}}(),function(){var t=0;for(n(P,t),t+=P.length,S=0,E=L.length;S<E;S++)w=L[S],n(w,t),t+=w.length}()},m.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(t,e,r,i){return t=t.vertices,e=t[e],r=t[r],i=t[i],[new m.Vector2(e.x,e.y),new m.Vector2(r.x,r.y),new m.Vector2(i.x,i.y)]},generateSideWallUV:function(t,e,r,i,n){return t=t.vertices,e=t[e],r=t[r],i=t[i],n=t[n],.01>Math.abs(e.y-r.y)?[new m.Vector2(e.x,1-e.z),new m.Vector2(r.x,1-r.z),new m.Vector2(i.x,1-i.z),new m.Vector2(n.x,1-n.z)]:[new m.Vector2(e.y,1-e.z),new m.Vector2(r.y,1-r.z),new m.Vector2(i.y,1-i.z),new m.Vector2(n.y,1-n.z)]}},m.ShapeGeometry=function(t,e){m.Geometry.call(this),this.type="ShapeGeometry",!1===Array.isArray(t)&&(t=[t]),this.addShapeList(t,e),this.computeFaceNormals()},m.ShapeGeometry.prototype=Object.create(m.Geometry.prototype),m.ShapeGeometry.prototype.constructor=m.ShapeGeometry,m.ShapeGeometry.prototype.addShapeList=function(t,e){for(var r=0,i=t.length;r<i;r++)this.addShape(t[r],e);return this},m.ShapeGeometry.prototype.addShape=function(t,e){void 0===e&&(e={});var r,i,n,o=e.material,a=void 0===e.UVGenerator?m.ExtrudeGeometry.WorldUVGenerator:e.UVGenerator,s=this.vertices.length,h=(r=t.extractPoints(void 0!==e.curveSegments?e.curveSegments:12)).shape,c=r.holes;if(!m.ShapeUtils.isClockWise(h))for(h=h.reverse(),r=0,i=c.length;r<i;r++)n=c[r],m.ShapeUtils.isClockWise(n)&&(c[r]=n.reverse());var l=m.ShapeUtils.triangulateShape(h,c);for(r=0,i=c.length;r<i;r++)n=c[r],h=h.concat(n);for(c=h.length,i=l.length,r=0;r<c;r++)n=h[r],this.vertices.push(new m.Vector3(n.x,n.y,0));for(r=0;r<i;r++)c=l[r],h=c[0]+s,n=c[1]+s,c=c[2]+s,this.faces.push(new m.Face3(h,n,c,null,null,o)),this.faceVertexUvs[0].push(a.generateTopUV(this,h,n,c))},m.LatheGeometry=function(t,e,r,i){m.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},e=e||12,r=r||0,i=i||2*Math.PI;for(var n=1/(t.length-1),o=1/e,a=0,s=e;a<=s;a++)for(var h=r+a*o*i,c=Math.sin(h),l=Math.cos(h),h=0,u=t.length;h<u;h++){var p=t[h];(d=new m.Vector3).x=p.x*c,d.y=p.y,d.z=p.x*l,this.vertices.push(d)}for(r=t.length,a=0,s=e;a<s;a++)for(h=0,u=t.length-1;h<u;h++){i=(e=h+r*a)+r;var c=e+1+r,l=e+1,d=h*n,f=(p=a*o)+o,g=d+n;this.faces.push(new m.Face3(e,i,l)),this.faceVertexUvs[0].push([new m.Vector2(p,d),new m.Vector2(f,d),new m.Vector2(p,g)]),this.faces.push(new m.Face3(i,c,l)),this.faceVertexUvs[0].push([new m.Vector2(f,d),new m.Vector2(f,g),new m.Vector2(p,g)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},m.LatheGeometry.prototype=Object.create(m.Geometry.prototype),m.LatheGeometry.prototype.constructor=m.LatheGeometry,m.PlaneGeometry=function(t,e,r,i){m.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:i},this.fromBufferGeometry(new m.PlaneBufferGeometry(t,e,r,i))},m.PlaneGeometry.prototype=Object.create(m.Geometry.prototype),m.PlaneGeometry.prototype.constructor=m.PlaneGeometry,m.PlaneBufferGeometry=function(t,e,r,i){m.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:i};var n=t/2,o=e/2,a=(r=Math.floor(r)||1)+1,s=(i=Math.floor(i)||1)+1,h=t/r,c=e/i;e=new Float32Array(a*s*3),t=new Float32Array(a*s*3);for(var l=new Float32Array(a*s*2),u=0,p=0,d=0;d<s;d++)for(var f=d*c-o,g=0;g<a;g++)e[u]=g*h-n,e[u+1]=-f,t[u+2]=1,l[p]=g/r,l[p+1]=1-d/i,u+=3,p+=2;for(u=0,n=new(65535<e.length/3?Uint32Array:Uint16Array)(r*i*6),d=0;d<i;d++)for(g=0;g<r;g++)o=g+a*(d+1),s=g+1+a*(d+1),h=g+1+a*d,n[u]=g+a*d,n[u+1]=o,n[u+2]=h,n[u+3]=o,n[u+4]=s,n[u+5]=h,u+=6;this.setIndex(new m.BufferAttribute(n,1)),this.addAttribute("position",new m.BufferAttribute(e,3)),this.addAttribute("normal",new m.BufferAttribute(t,3)),this.addAttribute("uv",new m.BufferAttribute(l,2))},m.PlaneBufferGeometry.prototype=Object.create(m.BufferGeometry.prototype),m.PlaneBufferGeometry.prototype.constructor=m.PlaneBufferGeometry,m.RingGeometry=function(t,e,r,i,n,o){m.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:r,phiSegments:i,thetaStart:n,thetaLength:o},t=t||0,e=e||50,n=void 0!==n?n:0,o=void 0!==o?o:2*Math.PI,r=void 0!==r?Math.max(3,r):8;var a,s=[],h=t,c=(e-t)/(i=void 0!==i?Math.max(1,i):8);for(t=0;t<i+1;t++){for(a=0;a<r+1;a++){var l=new m.Vector3,u=n+a/r*o;l.x=h*Math.cos(u),l.y=h*Math.sin(u),this.vertices.push(l),s.push(new m.Vector2((l.x/e+1)/2,(l.y/e+1)/2))}h+=c}for(e=new m.Vector3(0,0,1),t=0;t<i;t++)for(n=t*(r+1),a=0;a<r;a++)o=u=a+n,c=u+r+1,l=u+r+2,this.faces.push(new m.Face3(o,c,l,[e.clone(),e.clone(),e.clone()])),this.faceVertexUvs[0].push([s[o].clone(),s[c].clone(),s[l].clone()]),o=u,c=u+r+2,l=u+1,this.faces.push(new m.Face3(o,c,l,[e.clone(),e.clone(),e.clone()])),this.faceVertexUvs[0].push([s[o].clone(),s[c].clone(),s[l].clone()]);this.computeFaceNormals(),this.boundingSphere=new m.Sphere(new m.Vector3,h)},m.RingGeometry.prototype=Object.create(m.Geometry.prototype),m.RingGeometry.prototype.constructor=m.RingGeometry,m.SphereGeometry=function(t,e,r,i,n,o,a){m.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:i,phiLength:n,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new m.SphereBufferGeometry(t,e,r,i,n,o,a))},m.SphereGeometry.prototype=Object.create(m.Geometry.prototype),m.SphereGeometry.prototype.constructor=m.SphereGeometry,m.SphereBufferGeometry=function(t,e,r,i,n,o,a){m.BufferGeometry.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:i,phiLength:n,thetaStart:o,thetaLength:a},t=t||50,e=Math.max(3,Math.floor(e)||8),r=Math.max(2,Math.floor(r)||6),i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;for(var s=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),h=(e+1)*(r+1),c=new m.BufferAttribute(new Float32Array(3*h),3),l=new m.BufferAttribute(new Float32Array(3*h),3),h=new m.BufferAttribute(new Float32Array(2*h),2),u=0,p=[],d=new m.Vector3,f=0;f<=r;f++){for(var g=[],v=f/r,y=0;y<=e;y++){var x=y/e,b=-t*Math.cos(i+x*n)*Math.sin(o+v*a),_=t*Math.cos(o+v*a),M=t*Math.sin(i+x*n)*Math.sin(o+v*a);d.set(b,_,M).normalize(),c.setXYZ(u,b,_,M),l.setXYZ(u,d.x,d.y,d.z),h.setXY(u,x,1-v),g.push(u),u++}p.push(g)}for(i=[],f=0;f<r;f++)for(y=0;y<e;y++)n=p[f][y+1],a=p[f][y],u=p[f+1][y],d=p[f+1][y+1],(0!==f||0<o)&&i.push(n,a,d),(f!==r-1||s<Math.PI)&&i.push(a,u,d);this.setIndex(new(65535<c.count?m.Uint32Attribute:m.Uint16Attribute)(i,1)),this.addAttribute("position",c),this.addAttribute("normal",l),this.addAttribute("uv",h),this.boundingSphere=new m.Sphere(new m.Vector3,t)},m.SphereBufferGeometry.prototype=Object.create(m.BufferGeometry.prototype),m.SphereBufferGeometry.prototype.constructor=m.SphereBufferGeometry,m.TextGeometry=function(t,e){var r=(e=e||{}).font;if(0==r instanceof m.Font)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new m.Geometry;r=r.generateShapes(t,e.size,e.curveSegments),e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),m.ExtrudeGeometry.call(this,r,e),this.type="TextGeometry"},m.TextGeometry.prototype=Object.create(m.ExtrudeGeometry.prototype),m.TextGeometry.prototype.constructor=m.TextGeometry,m.TorusGeometry=function(t,e,r,i,n){m.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:i,arc:n},t=t||100,e=e||40,r=r||8,i=i||6,n=n||2*Math.PI;for(var o=new m.Vector3,a=[],s=[],h=0;h<=r;h++)for(var c=0;c<=i;c++){var l=c/i*n,u=h/r*Math.PI*2;o.x=t*Math.cos(l),o.y=t*Math.sin(l);var p=new m.Vector3;p.x=(t+e*Math.cos(u))*Math.cos(l),p.y=(t+e*Math.cos(u))*Math.sin(l),p.z=e*Math.sin(u),this.vertices.push(p),a.push(new m.Vector2(c/i,h/r)),s.push(p.clone().sub(o).normalize())}for(h=1;h<=r;h++)for(c=1;c<=i;c++)t=(i+1)*h+c-1,e=(i+1)*(h-1)+c-1,n=(i+1)*(h-1)+c,o=(i+1)*h+c,l=new m.Face3(t,e,o,[s[t].clone(),s[e].clone(),s[o].clone()]),this.faces.push(l),this.faceVertexUvs[0].push([a[t].clone(),a[e].clone(),a[o].clone()]),l=new m.Face3(e,n,o,[s[e].clone(),s[n].clone(),s[o].clone()]),this.faces.push(l),this.faceVertexUvs[0].push([a[e].clone(),a[n].clone(),a[o].clone()]);this.computeFaceNormals()},m.TorusGeometry.prototype=Object.create(m.Geometry.prototype),m.TorusGeometry.prototype.constructor=m.TorusGeometry,m.TorusKnotGeometry=function(t,e,r,i,n,o,a){function s(t,e,r,i,n){var o=Math.cos(t),a=Math.sin(t);return t*=e/r,e=Math.cos(t),o*=i*(2+e)*.5,a=i*(2+e)*a*.5,i=n*i*Math.sin(t)*.5,new m.Vector3(o,a,i)}m.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:i,p:n,q:o,heightScale:a},t=t||100,e=e||40,r=r||64,i=i||8,n=n||2,o=o||3,a=a||1;for(var h=Array(r),c=new m.Vector3,l=new m.Vector3,u=new m.Vector3,p=0;p<r;++p){h[p]=Array(i);var d=s(f=p/r*2*n*Math.PI,o,n,t,a),f=s(f+.01,o,n,t,a);for(c.subVectors(f,d),l.addVectors(f,d),u.crossVectors(c,l),l.crossVectors(u,c),u.normalize(),l.normalize(),f=0;f<i;++f){var g=f/i*2*Math.PI,v=-e*Math.cos(g),g=e*Math.sin(g),y=new m.Vector3;y.x=d.x+v*l.x+g*u.x,y.y=d.y+v*l.y+g*u.y,y.z=d.z+v*l.z+g*u.z,h[p][f]=this.vertices.push(y)-1}}for(p=0;p<r;++p)for(f=0;f<i;++f)n=(p+1)%r,o=(f+1)%i,t=h[p][f],e=h[n][f],n=h[n][o],o=h[p][o],a=new m.Vector2(p/r,f/i),c=new m.Vector2((p+1)/r,f/i),l=new m.Vector2((p+1)/r,(f+1)/i),u=new m.Vector2(p/r,(f+1)/i),this.faces.push(new m.Face3(t,e,o)),this.faceVertexUvs[0].push([a,c,u]),this.faces.push(new m.Face3(e,n,o)),this.faceVertexUvs[0].push([c.clone(),l,u.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},m.TorusKnotGeometry.prototype=Object.create(m.Geometry.prototype),m.TorusKnotGeometry.prototype.constructor=m.TorusKnotGeometry,m.TubeGeometry=function(t,e,r,i,n,o){m.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:t,segments:e,radius:r,radialSegments:i,closed:n,taper:o},e=e||64,r=r||1,i=i||8,n=n||!1,o=o||m.TubeGeometry.NoTaper;var a,s,h,c,l,u,p,d,f,g,v=[],y=e+1,x=new m.Vector3;for(f=(d=new m.TubeGeometry.FrenetFrames(t,e,n)).normals,g=d.binormals,this.tangents=d.tangents,this.normals=f,this.binormals=g,d=0;d<y;d++)for(v[d]=[],h=d/(y-1),p=t.getPointAt(h),a=f[d],s=g[d],l=r*o(h),h=0;h<i;h++)c=h/i*2*Math.PI,u=-l*Math.cos(c),c=l*Math.sin(c),x.copy(p),x.x+=u*a.x+c*s.x,x.y+=u*a.y+c*s.y,x.z+=u*a.z+c*s.z,v[d][h]=this.vertices.push(new m.Vector3(x.x,x.y,x.z))-1;for(d=0;d<e;d++)for(h=0;h<i;h++)o=n?(d+1)%e:d+1,y=(h+1)%i,t=v[d][h],r=v[o][h],o=v[o][y],y=v[d][y],x=new m.Vector2(d/e,h/i),f=new m.Vector2((d+1)/e,h/i),g=new m.Vector2((d+1)/e,(h+1)/i),a=new m.Vector2(d/e,(h+1)/i),this.faces.push(new m.Face3(t,r,y)),this.faceVertexUvs[0].push([x,f,a]),this.faces.push(new m.Face3(r,o,y)),this.faceVertexUvs[0].push([f.clone(),g,a.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},m.TubeGeometry.prototype=Object.create(m.Geometry.prototype),m.TubeGeometry.prototype.constructor=m.TubeGeometry,m.TubeGeometry.NoTaper=function(t){return 1},m.TubeGeometry.SinusoidalTaper=function(t){return Math.sin(Math.PI*t)},m.TubeGeometry.FrenetFrames=function(t,e,r){var i=new m.Vector3,n=[],o=[],a=[],s=new m.Vector3,h=new m.Matrix4;e+=1;var c,l,u;for(this.tangents=n,this.normals=o,this.binormals=a,c=0;c<e;c++)l=c/(e-1),n[c]=t.getTangentAt(l),n[c].normalize();for(o[0]=new m.Vector3,a[0]=new m.Vector3,t=Number.MAX_VALUE,c=Math.abs(n[0].x),l=Math.abs(n[0].y),u=Math.abs(n[0].z),c<=t&&(t=c,i.set(1,0,0)),l<=t&&(t=l,i.set(0,1,0)),u<=t&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),o[0].crossVectors(n[0],s),a[0].crossVectors(n[0],o[0]),c=1;c<e;c++)o[c]=o[c-1].clone(),a[c]=a[c-1].clone(),s.crossVectors(n[c-1],n[c]),s.length()>Number.EPSILON&&(s.normalize(),i=Math.acos(m.Math.clamp(n[c-1].dot(n[c]),-1,1)),o[c].applyMatrix4(h.makeRotationAxis(s,i))),a[c].crossVectors(n[c],o[c]);if(r)for(i=Math.acos(m.Math.clamp(o[0].dot(o[e-1]),-1,1)),i/=e-1,0<n[0].dot(s.crossVectors(o[0],o[e-1]))&&(i=-i),c=1;c<e;c++)o[c].applyMatrix4(h.makeRotationAxis(n[c],i*c)),a[c].crossVectors(n[c],o[c])},m.PolyhedronGeometry=function(t,e,r,i){function n(t){var e=t.normalize().clone();e.index=s.vertices.push(e)-1;var r=Math.atan2(t.z,-t.x)/2/Math.PI+.5;return t=Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5,e.uv=new m.Vector2(r,1-t),e}function o(t,e,r,i){i=new m.Face3(t.index,e.index,r.index,[t.clone(),e.clone(),r.clone()],void 0,i),s.faces.push(i),g.copy(t).add(e).add(r).divideScalar(3),i=Math.atan2(g.z,-g.x),s.faceVertexUvs[0].push([a(t.uv,t,i),a(e.uv,e,i),a(r.uv,r,i)])}function a(t,e,r){return 0>r&&1===t.x&&(t=new m.Vector2(t.x-1,t.y)),0===e.x&&0===e.z&&(t=new m.Vector2(r/2/Math.PI+.5,t.y)),t.clone()}m.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:i},r=r||1,i=i||0;for(var s=this,h=0,c=t.length;h<c;h+=3)n(new m.Vector3(t[h],t[h+1],t[h+2]));t=this.vertices;for(var l=[],u=h=0,c=e.length;h<c;h+=3,u++){var p=t[e[h]],d=t[e[h+1]],f=t[e[h+2]];l[u]=new m.Face3(p.index,d.index,f.index,[p.clone(),d.clone(),f.clone()],void 0,u)}for(var g=new m.Vector3,h=0,c=l.length;h<c;h++)!function(t,e){for(var r=Math.pow(2,e),i=n(s.vertices[t.a]),a=n(s.vertices[t.b]),h=n(s.vertices[t.c]),c=[],l=t.materialIndex,u=0;u<=r;u++){c[u]=[];for(var p=n(i.clone().lerp(h,u/r)),d=n(a.clone().lerp(h,u/r)),f=r-u,m=0;m<=f;m++)c[u][m]=0===m&&u===r?p:n(p.clone().lerp(d,m/f))}for(u=0;u<r;u++)for(m=0;m<2*(r-u)-1;m++)i=Math.floor(m/2),0==m%2?o(c[u][i+1],c[u+1][i],c[u][i],l):o(c[u][i+1],c[u+1][i+1],c[u+1][i],l)}(l[h],i);for(h=0,c=this.faceVertexUvs[0].length;h<c;h++)e=this.faceVertexUvs[0][h],i=e[0].x,t=e[1].x,l=e[2].x,u=Math.max(i,t,l),p=Math.min(i,t,l),.9<u&&.1>p&&(.2>i&&(e[0].x+=1),.2>t&&(e[1].x+=1),.2>l&&(e[2].x+=1));for(h=0,c=this.vertices.length;h<c;h++)this.vertices[h].multiplyScalar(r);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new m.Sphere(new m.Vector3,r)},m.PolyhedronGeometry.prototype=Object.create(m.Geometry.prototype),m.PolyhedronGeometry.prototype.constructor=m.PolyhedronGeometry,m.DodecahedronGeometry=function(t,e){var r=(1+Math.sqrt(5))/2,i=1/r;m.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}},m.DodecahedronGeometry.prototype=Object.create(m.PolyhedronGeometry.prototype),m.DodecahedronGeometry.prototype.constructor=m.DodecahedronGeometry,m.IcosahedronGeometry=function(t,e){var r=(1+Math.sqrt(5))/2;m.PolyhedronGeometry.call(this,[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}},m.IcosahedronGeometry.prototype=Object.create(m.PolyhedronGeometry.prototype);m.IcosahedronGeometry.prototype.constructor=m.IcosahedronGeometry,m.OctahedronGeometry=function(t,e){m.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}},m.OctahedronGeometry.prototype=Object.create(m.PolyhedronGeometry.prototype),m.OctahedronGeometry.prototype.constructor=m.OctahedronGeometry,m.TetrahedronGeometry=function(t,e){m.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}},m.TetrahedronGeometry.prototype=Object.create(m.PolyhedronGeometry.prototype),m.TetrahedronGeometry.prototype.constructor=m.TetrahedronGeometry,m.ParametricGeometry=function(t,e,r){m.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:r};var i,n,o,a,s=this.vertices,h=this.faces,c=this.faceVertexUvs[0],l=e+1;for(i=0;i<=r;i++)for(a=i/r,n=0;n<=e;n++)o=n/e,o=t(o,a),s.push(o);var u,p,d,f;for(i=0;i<r;i++)for(n=0;n<e;n++)t=i*l+n,s=i*l+n+1,a=(i+1)*l+n+1,o=(i+1)*l+n,u=new m.Vector2(n/e,i/r),p=new m.Vector2((n+1)/e,i/r),d=new m.Vector2((n+1)/e,(i+1)/r),f=new m.Vector2(n/e,(i+1)/r),h.push(new m.Face3(t,s,o)),c.push([u,p,f]),h.push(new m.Face3(s,a,o)),c.push([p.clone(),d,f.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},m.ParametricGeometry.prototype=Object.create(m.Geometry.prototype),m.ParametricGeometry.prototype.constructor=m.ParametricGeometry,m.WireframeGeometry=function(t){function e(t,e){return t-e}m.BufferGeometry.call(this);var r=[0,0],i={},n=["a","b","c"];if(t instanceof m.Geometry){var o=t.vertices,a=t.faces,s=0,h=new Uint32Array(6*a.length);t=0;for(var c=a.length;t<c;t++)for(var l=a[t],u=0;3>u;u++){r[0]=l[n[u]],r[1]=l[n[(u+1)%3]],r.sort(e);var p=r.toString();void 0===i[p]&&(h[2*s]=r[0],h[2*s+1]=r[1],i[p]=!0,s++)}for(r=new Float32Array(6*s),t=0,c=s;t<c;t++)for(u=0;2>u;u++)i=o[h[2*t+u]],s=6*t+3*u,r[s+0]=i.x,r[s+1]=i.y,r[s+2]=i.z;this.addAttribute("position",new m.BufferAttribute(r,3))}else if(t instanceof m.BufferGeometry){if(null!==t.index){for(c=t.index.array,o=t.attributes.position,s=0,0===(n=t.groups).length&&t.addGroup(0,c.length),h=new Uint32Array(2*c.length),a=0,l=n.length;a<l;++a){u=(t=n[a]).start,p=t.count,t=u;for(var d=u+p;t<d;t+=3)for(u=0;3>u;u++)r[0]=c[t+u],r[1]=c[t+(u+1)%3],r.sort(e),p=r.toString(),void 0===i[p]&&(h[2*s]=r[0],h[2*s+1]=r[1],i[p]=!0,s++)}for(r=new Float32Array(6*s),t=0,c=s;t<c;t++)for(u=0;2>u;u++)s=6*t+3*u,i=h[2*t+u],r[s+0]=o.getX(i),r[s+1]=o.getY(i),r[s+2]=o.getZ(i)}else for(o=t.attributes.position.array,s=o.length/3,h=s/3,r=new Float32Array(6*s),t=0,c=h;t<c;t++)for(u=0;3>u;u++)s=18*t+6*u,h=9*t+3*u,r[s+0]=o[h],r[s+1]=o[h+1],r[s+2]=o[h+2],i=9*t+(u+1)%3*3,r[s+3]=o[i],r[s+4]=o[i+1],r[s+5]=o[i+2];this.addAttribute("position",new m.BufferAttribute(r,3))}},m.WireframeGeometry.prototype=Object.create(m.BufferGeometry.prototype),m.WireframeGeometry.prototype.constructor=m.WireframeGeometry,m.AxisHelper=function(t){t=t||1;var e=new Float32Array([0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t]),r=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);(t=new m.BufferGeometry).addAttribute("position",new m.BufferAttribute(e,3)),t.addAttribute("color",new m.BufferAttribute(r,3)),e=new m.LineBasicMaterial({vertexColors:m.VertexColors}),m.LineSegments.call(this,t,e)},m.AxisHelper.prototype=Object.create(m.LineSegments.prototype),m.AxisHelper.prototype.constructor=m.AxisHelper,m.ArrowHelper=function(){var t=new m.Geometry;t.vertices.push(new m.Vector3(0,0,0),new m.Vector3(0,1,0));var e=new m.CylinderGeometry(0,.5,1,5,1);return e.translate(0,-.5,0),function(r,i,n,o,a,s){m.Object3D.call(this),void 0===o&&(o=16776960),void 0===n&&(n=1),void 0===a&&(a=.2*n),void 0===s&&(s=.2*a),this.position.copy(i),this.line=new m.Line(t,new m.LineBasicMaterial({color:o})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new m.Mesh(e,new m.MeshBasicMaterial({color:o})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(r),this.setLength(n,a,s)}}(),m.ArrowHelper.prototype=Object.create(m.Object3D.prototype),m.ArrowHelper.prototype.constructor=m.ArrowHelper,m.ArrowHelper.prototype.setDirection=function(){var t,e=new m.Vector3;return function(r){.99999<r.y?this.quaternion.set(0,0,0,1):-.99999>r.y?this.quaternion.set(1,0,0,0):(e.set(r.z,0,-r.x).normalize(),t=Math.acos(r.y),this.quaternion.setFromAxisAngle(e,t))}}(),m.ArrowHelper.prototype.setLength=function(t,e,r){void 0===e&&(e=.2*t),void 0===r&&(r=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()},m.ArrowHelper.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},m.BoxHelper=function(t){var e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new m.BufferGeometry;i.setIndex(new m.BufferAttribute(e,1)),i.addAttribute("position",new m.BufferAttribute(r,3)),m.LineSegments.call(this,i,new m.LineBasicMaterial({color:16776960})),void 0!==t&&this.update(t)},m.BoxHelper.prototype=Object.create(m.LineSegments.prototype),m.BoxHelper.prototype.constructor=m.BoxHelper,m.BoxHelper.prototype.update=function(){var t=new m.Box3;return function(e){if(t.setFromObject(e),!t.isEmpty()){e=t.min;var r=t.max,i=this.geometry.attributes.position,n=i.array;n[0]=r.x,n[1]=r.y,n[2]=r.z,n[3]=e.x,n[4]=r.y,n[5]=r.z,n[6]=e.x,n[7]=e.y,n[8]=r.z,n[9]=r.x,n[10]=e.y,n[11]=r.z,n[12]=r.x,n[13]=r.y,n[14]=e.z,n[15]=e.x,n[16]=r.y,n[17]=e.z,n[18]=e.x,n[19]=e.y,n[20]=e.z,n[21]=r.x,n[22]=e.y,n[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),m.BoundingBoxHelper=function(t,e){var r=void 0!==e?e:8947848;this.object=t,this.box=new m.Box3,m.Mesh.call(this,new m.BoxGeometry(1,1,1),new m.MeshBasicMaterial({color:r,wireframe:!0}))},m.BoundingBoxHelper.prototype=Object.create(m.Mesh.prototype),m.BoundingBoxHelper.prototype.constructor=m.BoundingBoxHelper,m.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},m.CameraHelper=function(t){function e(t,e,i){r(t,i),r(e,i)}function r(t,e){i.vertices.push(new m.Vector3),i.colors.push(new m.Color(e)),void 0===o[t]&&(o[t]=[]),o[t].push(i.vertices.length-1)}var i=new m.Geometry,n=new m.LineBasicMaterial({color:16777215,vertexColors:m.FaceColors}),o={};e("n1","n2",16755200),e("n2","n4",16755200),e("n4","n3",16755200),e("n3","n1",16755200),e("f1","f2",16755200),e("f2","f4",16755200),e("f4","f3",16755200),e("f3","f1",16755200),e("n1","f1",16755200),e("n2","f2",16755200),e("n3","f3",16755200),e("n4","f4",16755200),e("p","n1",16711680),e("p","n2",16711680),e("p","n3",16711680),e("p","n4",16711680),e("u1","u2",43775),e("u2","u3",43775),e("u3","u1",43775),e("c","t",16777215),e("p","c",3355443),e("cn1","cn2",3355443),e("cn3","cn4",3355443),e("cf1","cf2",3355443),e("cf3","cf4",3355443),m.LineSegments.call(this,i,n),this.camera=t,this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()},m.CameraHelper.prototype=Object.create(m.LineSegments.prototype),m.CameraHelper.prototype.constructor=m.CameraHelper,m.CameraHelper.prototype.update=function(){function t(t,o,a,s){if(i.set(o,a,s).unproject(n),void 0!==(t=r[t]))for(o=0,a=t.length;o<a;o++)e.vertices[t[o]].copy(i)}var e,r,i=new m.Vector3,n=new m.Camera;return function(){e=this.geometry,r=this.pointMap,n.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-1,-1,-1),t("n2",1,-1,-1),t("n3",-1,1,-1),t("n4",1,1,-1),t("f1",-1,-1,1),t("f2",1,-1,1),t("f3",-1,1,1),t("f4",1,1,1),t("u1",.7,1.1,-1),t("u2",-.7,1.1,-1),t("u3",0,2,-1),t("cf1",-1,0,1),t("cf2",1,0,1),t("cf3",0,-1,1),t("cf4",0,1,1),t("cn1",-1,0,-1),t("cn2",1,0,-1),t("cn3",0,-1,-1),t("cn4",0,1,-1),e.verticesNeedUpdate=!0}}(),m.DirectionalLightHelper=function(t,e){m.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,e=e||1;var r=new m.Geometry;r.vertices.push(new m.Vector3(-e,e,0),new m.Vector3(e,e,0),new m.Vector3(e,-e,0),new m.Vector3(-e,-e,0),new m.Vector3(-e,e,0));var i=new m.LineBasicMaterial({fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new m.Line(r,i),this.add(this.lightPlane),(r=new m.Geometry).vertices.push(new m.Vector3,new m.Vector3),(i=new m.LineBasicMaterial({fog:!1})).color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new m.Line(r,i),this.add(this.targetLine),this.update()},m.DirectionalLightHelper.prototype=Object.create(m.Object3D.prototype),m.DirectionalLightHelper.prototype.constructor=m.DirectionalLightHelper,m.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},m.DirectionalLightHelper.prototype.update=function(){var t=new m.Vector3,e=new m.Vector3,r=new m.Vector3;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),r.subVectors(e,t),this.lightPlane.lookAt(r),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(r),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),m.EdgesHelper=function(t,e,r){e=void 0!==e?e:16777215,m.LineSegments.call(this,new m.EdgesGeometry(t.geometry,r),new m.LineBasicMaterial({color:e})),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},m.EdgesHelper.prototype=Object.create(m.LineSegments.prototype),m.EdgesHelper.prototype.constructor=m.EdgesHelper,m.FaceNormalsHelper=function(t,e,r,i){this.object=t,this.size=void 0!==e?e:1,t=void 0!==r?r:16776960,i=void 0!==i?i:1,e=0,(r=this.object.geometry)instanceof m.Geometry?e=r.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead."),r=new m.BufferGeometry,e=new m.Float32Attribute(6*e,3),r.addAttribute("position",e),m.LineSegments.call(this,r,new m.LineBasicMaterial({color:t,linewidth:i})),this.matrixAutoUpdate=!1,this.update()},m.FaceNormalsHelper.prototype=Object.create(m.LineSegments.prototype),m.FaceNormalsHelper.prototype.constructor=m.FaceNormalsHelper,m.FaceNormalsHelper.prototype.update=function(){var t=new m.Vector3,e=new m.Vector3,r=new m.Matrix3;return function(){this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);for(var i=this.object.matrixWorld,n=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=0,h=0,c=(o=o.faces).length;h<c;h++){var l=o[h],u=l.normal;t.copy(a[l.a]).add(a[l.b]).add(a[l.c]).divideScalar(3).applyMatrix4(i),e.copy(u).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),n.setXYZ(s,t.x,t.y,t.z),s+=1,n.setXYZ(s,e.x,e.y,e.z),s+=1}return n.needsUpdate=!0,this}}(),m.GridHelper=function(t,e){var r=new m.Geometry,i=new m.LineBasicMaterial({vertexColors:m.VertexColors});this.color1=new m.Color(4473924),this.color2=new m.Color(8947848);for(var n=-t;n<=t;n+=e){r.vertices.push(new m.Vector3(-t,0,n),new m.Vector3(t,0,n),new m.Vector3(n,0,-t),new m.Vector3(n,0,t));var o=0===n?this.color1:this.color2;r.colors.push(o,o,o,o)}m.LineSegments.call(this,r,i)},m.GridHelper.prototype=Object.create(m.LineSegments.prototype),m.GridHelper.prototype.constructor=m.GridHelper,m.GridHelper.prototype.setColors=function(t,e){this.color1.set(t),this.color2.set(e),this.geometry.colorsNeedUpdate=!0},m.HemisphereLightHelper=function(t,e){m.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new m.Color,new m.Color];var r=new m.SphereGeometry(e,4,2);r.rotateX(-Math.PI/2);for(var i=0;8>i;i++)r.faces[i].color=this.colors[4>i?0:1];i=new m.MeshBasicMaterial({vertexColors:m.FaceColors,wireframe:!0}),this.lightSphere=new m.Mesh(r,i),this.add(this.lightSphere),this.update()},m.HemisphereLightHelper.prototype=Object.create(m.Object3D.prototype),m.HemisphereLightHelper.prototype.constructor=m.HemisphereLightHelper,m.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},m.HemisphereLightHelper.prototype.update=function(){var t=new m.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),m.PointLightHelper=function(t,e){this.light=t,this.light.updateMatrixWorld();var r=new m.SphereGeometry(e,4,2),i=new m.MeshBasicMaterial({wireframe:!0,fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),m.Mesh.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},m.PointLightHelper.prototype=Object.create(m.Mesh.prototype),m.PointLightHelper.prototype.constructor=m.PointLightHelper,m.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},m.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},m.SkeletonHelper=function(t){this.bones=this.getBoneList(t);for(var e=new m.Geometry,r=0;r<this.bones.length;r++)this.bones[r].parent instanceof m.Bone&&(e.vertices.push(new m.Vector3),e.vertices.push(new m.Vector3),e.colors.push(new m.Color(0,0,1)),e.colors.push(new m.Color(0,1,0)));e.dynamic=!0,r=new m.LineBasicMaterial({vertexColors:m.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0}),m.LineSegments.call(this,e,r),this.root=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.update()},m.SkeletonHelper.prototype=Object.create(m.LineSegments.prototype),m.SkeletonHelper.prototype.constructor=m.SkeletonHelper,m.SkeletonHelper.prototype.getBoneList=function(t){var e=[];t instanceof m.Bone&&e.push(t);for(var r=0;r<t.children.length;r++)e.push.apply(e,this.getBoneList(t.children[r]));return e},m.SkeletonHelper.prototype.update=function(){for(var t=this.geometry,e=(new m.Matrix4).getInverse(this.root.matrixWorld),r=new m.Matrix4,i=0,n=0;n<this.bones.length;n++){var o=this.bones[n];o.parent instanceof m.Bone&&(r.multiplyMatrices(e,o.matrixWorld),t.vertices[i].setFromMatrixPosition(r),r.multiplyMatrices(e,o.parent.matrixWorld),t.vertices[i+1].setFromMatrixPosition(r),i+=2)}t.verticesNeedUpdate=!0,t.computeBoundingSphere()},m.SpotLightHelper=function(t){m.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,(t=new m.CylinderGeometry(0,1,1,8,1,!0)).translate(0,-.5,0),t.rotateX(-Math.PI/2);var e=new m.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new m.Mesh(t,e),this.add(this.cone),this.update()},m.SpotLightHelper.prototype=Object.create(m.Object3D.prototype),m.SpotLightHelper.prototype.constructor=m.SpotLightHelper,m.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},m.SpotLightHelper.prototype.update=function(){var t=new m.Vector3,e=new m.Vector3;return function(){var r=this.light.distance?this.light.distance:1e4,i=r*Math.tan(this.light.angle);this.cone.scale.set(i,i,r),t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e.sub(t)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),m.VertexNormalsHelper=function(t,e,r,i){this.object=t,this.size=void 0!==e?e:1,t=void 0!==r?r:16711680,i=void 0!==i?i:1,e=0,(r=this.object.geometry)instanceof m.Geometry?e=3*r.faces.length:r instanceof m.BufferGeometry&&(e=r.attributes.normal.count),r=new m.BufferGeometry,e=new m.Float32Attribute(6*e,3),r.addAttribute("position",e),m.LineSegments.call(this,r,new m.LineBasicMaterial({color:t,linewidth:i})),this.matrixAutoUpdate=!1,this.update()},m.VertexNormalsHelper.prototype=Object.create(m.LineSegments.prototype),m.VertexNormalsHelper.prototype.constructor=m.VertexNormalsHelper,m.VertexNormalsHelper.prototype.update=function(){var t=new m.Vector3,e=new m.Vector3,r=new m.Matrix3;return function(){var i=["a","b","c"];this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);var n=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a instanceof m.Geometry)for(var s=a.vertices,h=a.faces,c=a=0,l=h.length;c<l;c++)for(var u=h[c],p=0,d=u.vertexNormals.length;p<d;p++){var f=u.vertexNormals[p];t.copy(s[u[i[p]]]).applyMatrix4(n),e.copy(f).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),o.setXYZ(a,t.x,t.y,t.z),a+=1,o.setXYZ(a,e.x,e.y,e.z),a+=1}else if(a instanceof m.BufferGeometry)for(i=a.attributes.position,s=a.attributes.normal,p=a=0,d=i.count;p<d;p++)t.set(i.getX(p),i.getY(p),i.getZ(p)).applyMatrix4(n),e.set(s.getX(p),s.getY(p),s.getZ(p)),e.applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),o.setXYZ(a,t.x,t.y,t.z),a+=1,o.setXYZ(a,e.x,e.y,e.z),a+=1;return o.needsUpdate=!0,this}}(),m.WireframeHelper=function(t,e){var r=void 0!==e?e:16777215;m.LineSegments.call(this,new m.WireframeGeometry(t.geometry),new m.LineBasicMaterial({color:r})),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},m.WireframeHelper.prototype=Object.create(m.LineSegments.prototype),m.WireframeHelper.prototype.constructor=m.WireframeHelper,m.ImmediateRenderObject=function(t){m.Object3D.call(this),this.material=t,this.render=function(t){}},m.ImmediateRenderObject.prototype=Object.create(m.Object3D.prototype),m.ImmediateRenderObject.prototype.constructor=m.ImmediateRenderObject,m.MorphBlendMesh=function(t,e){m.Mesh.call(this,t,e),this.animationsMap={},this.animationsList=[];var r=this.geometry.morphTargets.length;this.createAnimation("__default",0,r-1,r/1),this.setAnimationWeight("__default",1)},m.MorphBlendMesh.prototype=Object.create(m.Mesh.prototype),m.MorphBlendMesh.prototype.constructor=m.MorphBlendMesh,m.MorphBlendMesh.prototype.createAnimation=function(t,e,r,i){e={start:e,end:r,length:r-e+1,fps:i,duration:(r-e)/i,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[t]=e,this.animationsList.push(e)},m.MorphBlendMesh.prototype.autoCreateAnimations=function(t){for(var e,r=/([a-z]+)_?(\d+)/i,i={},n=this.geometry,o=0,a=n.morphTargets.length;o<a;o++){var s=n.morphTargets[o].name.match(r);if(s&&1<s.length){var h=s[1];i[h]||(i[h]={start:1/0,end:-1/0}),o<(s=i[h]).start&&(s.start=o),o>s.end&&(s.end=o),e||(e=h)}}for(h in i)s=i[h],this.createAnimation(h,s.start,s.end,t);this.firstAnimation=e},m.MorphBlendMesh.prototype.setAnimationDirectionForward=function(t){(t=this.animationsMap[t])&&(t.direction=1,t.directionBackwards=!1)},m.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(t){(t=this.animationsMap[t])&&(t.direction=-1,t.directionBackwards=!0)},m.MorphBlendMesh.prototype.setAnimationFPS=function(t,e){var r=this.animationsMap[t];r&&(r.fps=e,r.duration=(r.end-r.start)/r.fps)},m.MorphBlendMesh.prototype.setAnimationDuration=function(t,e){var r=this.animationsMap[t];r&&(r.duration=e,r.fps=(r.end-r.start)/r.duration)},m.MorphBlendMesh.prototype.setAnimationWeight=function(t,e){var r=this.animationsMap[t];r&&(r.weight=e)},m.MorphBlendMesh.prototype.setAnimationTime=function(t,e){var r=this.animationsMap[t];r&&(r.time=e)},m.MorphBlendMesh.prototype.getAnimationTime=function(t){var e=0;return(t=this.animationsMap[t])&&(e=t.time),e},m.MorphBlendMesh.prototype.getAnimationDuration=function(t){var e=-1;return(t=this.animationsMap[t])&&(e=t.duration),e},m.MorphBlendMesh.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},m.MorphBlendMesh.prototype.stopAnimation=function(t){(t=this.animationsMap[t])&&(t.active=!1)},m.MorphBlendMesh.prototype.update=function(t){for(var e=0,r=this.animationsList.length;e<r;e++){var i=this.animationsList[e];if(i.active){var n=i.duration/i.length;i.time+=i.direction*t,i.mirroredLoop?(i.time>i.duration||0>i.time)&&(i.direction*=-1,i.time>i.duration&&(i.time=i.duration,i.directionBackwards=!0),0>i.time&&(i.time=0,i.directionBackwards=!1)):(i.time%=i.duration,0>i.time&&(i.time+=i.duration));var o=i.start+m.Math.clamp(Math.floor(i.time/n),0,i.length-1),a=i.weight;o!==i.currentFrame&&(this.morphTargetInfluences[i.lastFrame]=0,this.morphTargetInfluences[i.currentFrame]=1*a,this.morphTargetInfluences[o]=0,i.lastFrame=i.currentFrame,i.currentFrame=o),n=i.time%n/n,i.directionBackwards&&(n=1-n),i.currentFrame!==i.lastFrame?(this.morphTargetInfluences[i.currentFrame]=n*a,this.morphTargetInfluences[i.lastFrame]=(1-n)*a):this.morphTargetInfluences[i.currentFrame]=a}}};var g=function(){function t(){}return t.prototype.webgl=function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}},t}();d.prototype={VERSION:"2.2.0",defaults:{imageCloud:"",cloudSpeed:1,skyColor:"#ffffff",skyColorPower:50,cameraControl:!1,cameraXSpeed:.01,cameraYSpeed:.02,cloudData:[]},cameraNearClipPlane:1,cameraFarClipPlane:1e3,vFOV:60,init:function(t,e){this.container=t,this.config=e,this.create()},create:function(){if(!this.util().webgl())throw Error("Your browser does not support WebGL.");this.resetListeners(),this.resetScene(),this.load()},load:function(){var e={};e.cloud=this.config.imageCloud;var r=0,i=0;for(var n in e)e.hasOwnProperty(n)&&r++;for(var n in e)if(e.hasOwnProperty(n)){var o=new XMLHttpRequest;o.open("GET",e[n],!0),o.crossOrigin="Anonymous",o.responseType="arraybuffer",o.customKey=n,o.onload=t.proxy(function(n){var o=n.currentTarget;if(o.status>=400)return o.onerror(n);var a=new Blob([o.response]),s=new Image;s.src=window.URL.createObjectURL(a),s.onload=t.proxy(function(t){e[t.customKey]=s,++i==r&&(this.applyListeners(),this.buildScene(e),this.renderScene())},this,o)},this),o.onerror=t.proxy(function(t){var e=t.currentTarget;throw Error("Cannot load resource "+e.responseURL+". Status code ["+e.status+"]")},this),o.send()}},buildScene:function(t){var e=this.container.width(),r=this.container.height();this.aspect=e/r,this.scene=new m.Scene,this.camera=new m.PerspectiveCamera(this.vFOV,this.aspect,this.cameraNearClipPlane,this.cameraFarClipPlane),this.camera.position.z=this.cameraFarClipPlane,this.scene.add(this.camera);var i=this.createTexture(t,"cloud");this.buildClouds(i),this.renderer=new m.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(e,r),this.container.append(this.renderer.domElement)},buildClouds:function(t){var e={uniforms:{texCloud:{type:"t",value:null},skyColor:{type:"c",value:null},fogFar:{type:"f",value:null},fogNear:{type:"f",value:null},horizonLength:{type:"f",value:null}},vs:["varying vec2 vUv;","void main()","{","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fs:["uniform sampler2D texCloud;","uniform vec3 skyColor;","uniform float fogFar;","uniform float fogNear;","uniform float horizonLength;","varying vec2 vUv;","void main()","{","float distance = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = smoothstep( fogNear, fogFar, distance );","gl_FragColor = texture2D( texCloud, vUv );","if(distance >= (horizonLength - 200.0)) {","gl_FragColor.a *= 1.0 - ((distance - (horizonLength - 200.0)) / 200.0);","} else if(distance <= 200.0) {","gl_FragColor.a *= (distance / 200.0);","}","gl_FragColor = mix( gl_FragColor, vec4( skyColor, gl_FragColor.w ), fogFactor );","}"].join("\n")};e.uniforms.texCloud.value=t;var r=1-.01*Math.min(Math.max(parseInt(this.config.skyColorPower,10),0),100),i=new m.Fog(this.config.skyColor,this.cameraFarClipPlane*r,this.cameraFarClipPlane);e.uniforms.skyColor.value=i.color,e.uniforms.fogFar.value=i.far,e.uniforms.fogNear.value=i.near,e.uniforms.horizonLength.value=this.cameraFarClipPlane;for(var n=new m.ShaderMaterial({uniforms:e.uniforms,vertexShader:e.vs,fragmentShader:e.fs,depthWrite:!1,depthTest:!1,transparent:!0}),o=Math.tan(this.vFOV/2*Math.PI/180)*this.cameraFarClipPlane*2*2,a=o*this.aspect,s=new m.Geometry,h=0;h<this.cameraFarClipPlane;h++){for(var c=new m.PlaneGeometry(128,128),l=Math.random()*a-a/2,u=-Math.random()*Math.random()*o/40-o/20,p=h,d=Math.random()*Math.PI,f=2*Math.random()+.5,g=0;g<this.config.cloudData.length;g++)if(this.config.cloudData[g].i==h){var v=this.config.cloudData[g];v.hasOwnProperty("x")&&(l=v.x*a-a/2),v.hasOwnProperty("y")&&(u=v.y*o-o/2),v.hasOwnProperty("rotate")&&(d=v.rotate*Math.PI),v.hasOwnProperty("scale")&&(f=v.scale);break}c.center(),c.rotateZ(d),c.scale(f,f,1),c.translate(l,u,p),s.merge(c)}var y=new m.Mesh(s,n);this.scene.add(y),(y=new m.Mesh(s,n)).position.z=-this.cameraFarClipPlane,this.scene.add(y)},resetScene:function(){this.animationId&&cancelAnimationFrame(this.animationId),this.renderer=null,this.scene=null,this.camera=null,this.container.empty()},renderScene:function(){this.animationId=requestAnimationFrame(t.proxy(this.renderScene,this)),this.camera.position.z-=this.config.cloudSpeed,this.camera.position.z<0&&(this.camera.position.z=this.cameraFarClipPlane),this.camera.position.x+=(this.cameraX.value-this.camera.position.x)*this.config.cameraXSpeed,this.camera.position.y+=(this.cameraY.value-this.camera.position.y)*this.config.cameraYSpeed,this.camera.rotation.z+=.05*(this.cameraRotation.value-this.camera.rotation.z),this.renderer.render(this.scene,this.camera)},pause:function(){this.animationId&&cancelAnimationFrame(this.animationId)},play:function(){this.renderScene()},applyListeners:function(){this.config.cameraControl&&(this.container.on("mousemove.clouds",t.proxy(this.onMouseMove,this)),this.container.on("touchmove.clouds",t.proxy(this.onMouseMove,this))),t(window).on("resize.clouds",t.proxy(this.onWindowResize,this))},resetListeners:function(){this.container.off("mousemove.clouds"),this.container.off("touchmove.clouds"),t(window).off("resize.clouds")},onMouseMove:function(t){var e=this.getMousePositionPower("touchmove"==t.type?t.originalEvent.targetTouches[0]:t);this.cameraX.value=e.x<0?e.x*Math.abs(this.cameraX.min):e.x*Math.abs(this.cameraX.max),this.cameraY.value=e.y<0?e.y*Math.abs(this.cameraY.min):e.y*Math.abs(this.cameraY.max),this.cameraRotation.value=.03*e.x},onWindowResize:function(t){this.aspect=this.container.width()/this.container.height(),this.camera.aspect=this.aspect,this.camera.updateProjectionMatrix(),this.renderer.setSize(this.container.width(),this.container.height())},destroy:function(){this.resetListeners(),this.resetScene()},getMousePositionPower:function(t){var e=this.container.get(0).getBoundingClientRect(),r={},i=(e.right-e.left)/2,n=(e.bottom-e.top)/2,o=this.container.offset();return r.x=(t.pageX-o.left-i)/i,r.y=(n-(t.pageY-o.top))/n,r},createTexture:function(t,e){var r=new m.Texture;return r.image=t[e],r.needsUpdate=!0,r},util:function(){return null!=this._util?this._util:this._util=new g}},t.clouds=function(t,e){if("support"==t)return new g,!!this.util().webgl()},t.fn.clouds=function(e,r){return this.each(function(){var r=t(this),i=r.data("clouds"),n=t.isPlainObject(e)?e:{};if("destroy"!=e)if("pause"!=e)if("play"!=e)if(i){var o=t.extend({},i.config,n);i.init(r,o)}else i=new d(r,o=t.extend({},d.prototype.defaults,n)),r.data("clouds",i);else{if(!i)throw Error("Calling 'play' method on not initialized instance is forbidden");i.play()}else{if(!i)throw Error("Calling 'pause' method on not initialized instance is forbidden");i.pause()}else{if(!i)throw Error("Calling 'destroy' method on not initialized instance is forbidden");i.destroy()}})};var v={imageCloud:weather_press_data_from_php.weather_press_Plugin_Path+"/public/images/cloud-white.png",skyColor:"#8c9793",skyColorPower:100,cloudSpeed:1.5,cameraControl:!0,cloudData:[{i:0,x:.5,y:.4,scale:3},{i:150,x:.5,y:.4,scale:5},{i:300,x:.5,y:.4,scale:6},{i:450,x:.5,y:.4,scale:6},{i:600,x:.5,y:.4,scale:7},{i:10,x:.35,y:.45,scale:2},{i:160,x:.35,y:.45,scale:4},{i:310,x:.35,y:.45,scale:5},{i:460,x:.35,y:.45,scale:5},{i:610,x:.35,y:.45,scale:6},{i:20,x:.65,y:.45,scale:2},{i:170,x:.65,y:.45,scale:4},{i:320,x:.65,y:.45,scale:5},{i:470,x:.65,y:.45,scale:5},{i:620,x:.65,y:.45,scale:6}]};t("#weather_press_scene_container").clouds(v)}})}(jQuery);
  • weather-press/trunk/public/js/weather-press-public.js

    r1725621 r1759591  
    1111
    1212$(document).ready(function() {
    13    
    14 if ( $('#weather-press-layoutContainer').length ) {
    15    
    16     var weatherPressAjaxCall = null; // we use this var to kill the ajax call when user click on the close button
    17    
    18     //**************** Responsive layout *****************************************/
    19 
    20     var weatherPressContainerW = $('#weather-press-layoutContainer').outerWidth();
    21     var weatherPressForecastContainerW = $('.weather-press-dailyForecast').outerWidth();
    22    
    23     $('.weather-press-dailyForecast-mainItem').css( 'width', weatherPressForecastContainerW );
    24     //$('.weather-press-currentTempUnit').css('left', $('.weather-press-currentTempValue').outerWidth() + 22 );
    25     //$('.weather-press-currentTempUnit').text( ( weather_press_Current_Unit == 'metric') ? 'c' : 'f' );
    26 
    27        if( weatherPressContainerW <= 356 ) {
    28            
    29            $('.weather-press-citiesListContainer').css('width', '100%');
    30            $('.weather-press-rightTopBlock').css('width', '100%');
    31            $('.weather-press-navRectangle').css('width', '107%');
    32            $('.weather-press-bgLevel3').css('height', '53%');
    33            $('.weather-press-dailyForecast').css('height', '37.2%');
    34            $('.weather-press-currentTempValue').css('font-size', '1.6em');
    35            //$('.weather-press-currentTempValue').css('top', '-77px');
    36 
    37            $('.weather-press-icon').css('float', 'right');
    38            $('.weather-press-icon').css('width', '50%');
    39            $('.weather-press-icon img').css('top', '28px');
    40            $('.weather-press-icon img').css('left', '0');
    41 
    42            $('.weather-press-currentTemp').css('float', 'left');
    43            $('.weather-press-currentTemp').css('width', '50%');
    44            $('.weather-press-currentTemp').css('left', '0');
    45            
    46            //$('.weather-press-currentTempUnit').css('bottom', '42px' );
    47            
    48        }
    49     //**************** Responsive layout ends ***********************************/
    50 
    51     //**************** Chart ***************************************************/
    52    
    53     var weatherPressChartData = {
    54        
    55         labels: ['6am', '9am', '12pm', '3pm'],
    56  
    57             series: [
    58 
    59                 [
    60                     { value: 0, meta: '°' },
    61                     { value: 0, meta: '°' },
    62                     { value: 0, meta: '°' },
    63                     { value: 0,  meta: '°' },
    64                     { value: 0,  meta: 'NO X COORDINATE' } // make the chart area close to the container ends, note that this value has no X coordinate
    65                 ]
    66             ]
    67     };
    68 
    69     var weatherPressChartOptions = {
    70 
    71         width: '100%',
    72         height: '100%',
    73         //low: 0, // check for the low value in the series array ! avoid this, let it default !
    74         showArea: true,
    75         fullWidth: true,
    76         showLabel: true,
    77         lineSmooth: Chartist.Interpolation.simple({
    78         divisor: 2
    79         }),
    80         axisY: {
    81         showGrid: false,
    82         showLabel: false,
    83         offset:0,
    84         labelInterpolationFnc: function(value, index) {
    85         return ( (index % 2 != 0) && ( index != 0 ) ) ? value : null;
    86         }
    87    
    88         },
    89         axisX: {
    90         showGrid: false,
    91         showLabel: true
    92         } 
    93  
    94     };
    95 
    96     var weatherPressChart;
    97 
    98 //Build the chart   
    99 var weatherPressChart_Builder = function() {
    100 
    101     weatherPressChart = new Chartist.Line('.ct-chart', weatherPressChartData, weatherPressChartOptions);
    102    
    103     weatherPressChart.on('draw', function(data){
    104    
    105         if(data.type === 'area') {
    106 
    107             var weatherPressFullPath = $('.ct-area').attr('d');
    108 
    109             weatherPressFullPath = weatherPressFullPath.replace('M10', 'M0');
    110             weatherPressFullPath = weatherPressFullPath.replace('L10', 'L0');
    111             $('.ct-area').attr('d', weatherPressFullPath );
    112 
    113         }   
    114    
    115     });
    116 
    117     weatherPressChart.on('draw', function(data) {
    118        
    119         var weatherPressDotClassName;
    120 
    121         if(data.type === 'point'){
    122        
    123             if( data.series[data.index]['value'] < 12 ) weatherPressDotClassName = 'ct-point-circle-cold';
    124             else if( ( data.series[data.index]['value'] >= 12 ) && ( data.series[data.index]['value'] < 25 ) ) weatherPressDotClassName = 'ct-point-circle-medium';
    125             else if( data.series[data.index]['value'] >= 25 ) weatherPressDotClassName = 'ct-point-circle-hot';
    126        
    127             var circle = new Chartist.Svg('circle', {
    128                 cx: data.x,
    129                 cy: data.y,
    130                 r: 6,
    131                 vtop  : data.y - 46,
    132                 vleft : data.x - 30,
    133                 val : data.series[data.index]['value'],
    134                 des  : data.series[data.index]['meta'],
    135                 class: weatherPressDotClassName + ' weather-press-forHoverPurpose',
    136             });
    137 
    138         data.element.replace(circle);
    139        
    140         $('.weather-press-forHoverPurpose').on('click', function() {
    141 
    142             $('.weather-press-chartLabel').text( $(this).attr('val') + ' ' + $(this).attr('des') );
    143             $('#weather-press-chartLabel').css( { 'top':$(this).attr('vtop')+'px', 'left':$(this).attr('vleft')+'px', 'display':'block' } );
    144         });
    145 
    146         }// end of if type = point
    147 
    148        
    149     });
    150 
    151 // Create the gradient definition on created event (always after chart re-render)
    152     weatherPressChart.on('created', function(data) {
    153 
    154         var defs = data.svg.elem('defs');
    155 
    156         //SVG area gradient
    157         defs.elem('linearGradient', {
    158             id: 'weatherPressFillGradArea',
    159             x1: '50%',
    160             y1: '100%',
    161             x2: '50%',
    162             y2: 0
    163         }).elem('stop', {
    164             offset: 0,
    165             'style':'stop-color:rgb(37,168,250);stop-opacity:0'
    166         }).parent().elem('stop', {
    167             offset: '100%',
    168             'style':'stop-color:rgb(209,93,208);stop-opacity:0.5'
    169         });
    170    
    171         $('.ct-area').attr('fill', 'url(#weatherPressFillGradArea)');
    172    
    173         //SVG Line gradient
    174         defs.elem('linearGradient', {
    175             id: 'weatherPressFillGradLine',
    176             x1: 0,
    177             y1: '50%',
    178             x2: '100%',
    179             y2: '50%'
    180         }).elem('stop', {
    181             offset: 0,
    182             'style':'stop-color:rgb(37,168,250);stop-opacity:1'
    183         }).parent().elem('stop', {
    184             offset: '100%',
    185             'style':'stop-color:rgb(209,93,208);stop-opacity:1'
    186         });
    187    
    188         $('.ct-line').attr('stroke', 'url(#weatherPressFillGradLine)');
    189    
    190         //display the second label by default
    191         $('.weather-press-forHoverPurpose:eq(1)').trigger('click');
    192 
    193         //correct first and last X axis labels texts
    194         $('.ct-label:first').css('text-indent', '-4px');
    195         $('.ct-label:last').css('text-indent', '-25px');
    196 
    197     });
    198 
    199     /*weatherPressChart.on('draw', function(data) {
    200         if( data.type === 'line' ) {
    201             data.element.animate({
    202             d: {
    203                begin: 2000 * data.index,
    204                dur: 2000,
    205                from: data.path.clone().scale(1, 0).translate(0, data.chartRect.height()).stringify(),
    206                to: data.path.clone().stringify(),
    207                easing: Chartist.Svg.Easing.easeOutQuint
    208             }
    209         });
    210     }
    211     });*/
    212    
    213 };// end of the chart builder   
    214 
    215     //**************** End of Chart ***********************************************/
    216    
     13
     14console.log('THANK YOU FOR CHOOSING WEATHER PRESS, V4.5');
     15
     16if ( $('#weather-press-layoutContainer').length ) {
     17
     18    var weather_press_NbrDays = 4;
     19   
     20    var weatherPressAjaxCall = null;// we use this var to kill the ajax call when user click on the close button
     21    var weatherPressForecastContainerW = $('.weather-press-block-bottom').width();
     22    var weatherPressForecast_allowed_scroll_number = weather_press_NbrDays - 1;//$('.weather-press-forecast-list > li').length;
     23    var weatherPressForecast_current_scroll_index = 0;
     24
    21725    //get the index of the centred element inside the cities listStyleType
    21826    var weatherPressCentredCityIndex;
    21927    var weatherPressDefaultCentredCityPosition;
    220 
    221     $('.weather-press-citiesList li').each( function(i, item) {
    222        
    223         if( ( $(item).hasClass('weather-press-centred') ) && ( $(item).attr('data-weatherpressads') == 0 ) ) {
     28   
     29    //forecast loader
     30    $('#weather-press-forecast-loader').css('left', weatherPressForecastContainerW + 7);
     31
     32
     33    $('.weather-press-cities-list li').each( function(i, item) {
     34       
     35        if( $(item).hasClass('main-location') ) {
    22436           
    22537            weatherPressCentredCityIndex = i;
    226             weatherPressDefaultCentredCityPosition = $(item).position().top.toFixed(2) - 4; // default 58.60 - 4
    227 
    228             $('#weather-press-navRectangle-mainLocation').text( $(item).text() );
    229             $('#weather-press-navRectangle-mainLocation').attr( 'title', $(item).text() );
     38            weatherPressDefaultCentredCityPosition = $(item).position().top.toFixed(2);
     39
     40            $('#weather-press-city-name').text( $(item).text() );
     41            $('#weather-press-city-name').attr( 'title', $(item).text() );
    23042
    23143            return false;// break the each loop
     
    23345       
    23446    });
    235 
    236 $('.weather-press-forecasts ul li').click( function() {
    237 
    238     if( $(this).hasClass('weather-press-forecasts-mainStatus') === false ) {
    239        
    240         var weatherPressDailyForecastIndex = $(this).attr('data-weatherpressforecastDays');
    241        
    242             $('.weather-press-dailyForecast-mainUl').css( 'margin-left', -1 * weatherPressDailyForecastIndex * weatherPressForecastContainerW );
    243        
    244         $('#weather-press-chartLabel').css('opacity', '0');
    245        
    246         $('.weather-press-dailyForecast').removeClass('flipOutX');
    247         $('.weather-press-dailyForecast').addClass('flipInX');
    248 
    249         $('.weather-press-forecasts ul li').each( function(i, item){
    250        
    251             $(item).removeClass('weather-press-forecast-active');
    252 
    253         });
    254 
    255         $(this).addClass('weather-press-forecast-active');     
    256     }
    257 });
     47   
     48    // click to display the city image
     49    $('#weather-press-display-image').click(function(){
     50       
     51        var city_list_top = $('.weather-press-cities-list').css('margin-top');
     52
     53        $('.weather-press-block-bottom').toggleClass('weather-press-block-bottom-marginTop');
     54        $('.weather-press-block-middle img').fadeToggle( "slow", "linear" );
     55
     56    });
    25857
    25958$('.weather-press-closeIcon').click( function() {
     
    27978        $('.weather-press-outputs-content').text('Loading ...');
    28079        $('.weather-press-outputs-toPremium').css('opacity', '0');
     80        $('.weather-press-cities-nav-container').css('display', 'block');
    28181       
    28282        if ( weatherPressAjaxCall != null ) { // kill the ajax call if it is running
     
    28585        }
    28686    }
    287    
    288    
    289     $('#weather-press-chartLabel').css('opacity', '1');
    29087});
    29188
    292 $('.weather-press-forecasts-mainStatus').click( function() {
    293    
    294     if( $(this).hasClass('weather-press-forecast-active') === false ) {
    295    
    296         $('.weather-press-forecasts ul li').each( function(i, item){
    297 
    298             $(item).removeClass('weather-press-forecast-active');
    299             if( i == 0 ) {
    300                
    301                 $(item).addClass('weather-press-forecast-active');
     89    $('#weather-press-cities-navs-top').click( function() {
     90
     91        weatherPressCitiesOrganizer( weatherPressCentredCityIndex + 1 );
     92    });
     93
     94    $('#weather-press-cities-navs-bottom').click( function() {
     95   
     96        weatherPressCitiesOrganizer( weatherPressCentredCityIndex - 1 );   
     97    });
     98
     99var weatherPressCitiesOrganizer = function( z ) { // param 'z' is the item index inside the cities list
     100   
     101    var weatherPressCitiesNumber = $('.weather-press-cities-list li').length;
     102    var weatherPressCurrentCentredCityPosition;
     103
     104    $('.weather-press-cities-list li').each( function(i, item) {
     105       
     106        if( (i == z) && (i < weatherPressCitiesNumber) && (i >= 0) ) {
     107           
     108            weatherPressCentredCityIndex = i;
     109            $('#weather-press-city-name').text( $(item).text() );
     110            $('#weather-press-city-name').attr( 'title', $(item).text() );
     111            $(item).removeClass();
     112            $(item).addClass('main-location');
     113           
     114            weatherPressCurrentCentredCityPosition = $(item).position().top.toFixed(2);
     115            $('.weather-press-cities-list').css( 'margin-top', weatherPressDefaultCentredCityPosition - weatherPressCurrentCentredCityPosition );
     116           
     117            if( $('.weather-press-cities-list li:eq('+ (i-1) +')').length ) { // does element with index (i-1) exists ?
     118               
     119                $('.weather-press-cities-list li:eq('+ (i-1) +')').removeClass();   
    302120            }
    303         });
    304        
    305         $('.weather-press-dailyForecast').removeClass('flipInX');
    306         $('.weather-press-dailyForecast').addClass('flipOutX');
    307 
    308     }
    309 
    310     $('#weather-press-chartLabel').css('opacity', '1');
    311 });
    312 
    313 $('.weather-press-humidTool, .weather-press-windTool, .weather-press-geoLoc').click( function(){
    314    
    315     $('.weather-press-outputs-content').text('This is a premium weather press feature,');
    316     $('.weather-press-outputs-toPremium').css('opacity', '1');
    317    
    318     weatherPressShowLoader();
    319    
    320 });
    321 
    322 $('#weather-press-citiesNavTop').click( function() {
    323 
    324     weatherPressCitiesOrganizer( weatherPressCentredCityIndex + 1 );
    325 });
    326 
    327 $('#weather-press-citiesNavBottom').click( function() {
    328    
    329     weatherPressCitiesOrganizer( weatherPressCentredCityIndex - 1 );   
    330 });
    331 
    332 var weatherPressCitiesOrganizer = function( z ) {// param 'z' is the item index inside the cities list
    333    
    334     var weatherPressCitiesNumber = $('.weather-press-citiesList li').length - 1;// free version
    335     var weatherPressCurrentCentredCityPosition;
    336 
    337     $('.weather-press-citiesList li').each( function(i, item) {
    338        
    339         if( (i == z) && (i < weatherPressCitiesNumber) && (i > 1) ) {
    340            
    341             weatherPressCentredCityIndex = i;
    342             if( $(item).attr('data-weatherpressads') == 0 ) {
    343            
    344                 $('#weather-press-navRectangle-mainLocation').text( $(item).text() );
    345                 $('#weather-press-navRectangle-mainLocation').attr( 'title', $(item).text() );
    346            
     121           
     122            if( $('.weather-press-cities-list li:eq('+ (i-2) +')').length ) { // does element with index (i-2) exists ?
     123               
     124                $('.weather-press-cities-list li:eq('+ (i-2) +')').removeClass();
     125                $('.weather-press-cities-list li:eq('+ (i-2) +')').addClass('deep');
     126            }
     127
     128            if( $('.weather-press-cities-list li:eq('+ (i+1) +')').length ) { // does element with index (i+1) exists ?
     129               
     130                $('.weather-press-cities-list li:eq('+ (i+1) +')').removeClass();
    347131            }
    348             $(item).removeClass();
    349             $(item).addClass('weather-press-centred');console.log( i );
    350            
    351             weatherPressCurrentCentredCityPosition = $(item).position().top.toFixed(2);
    352             $('.weather-press-citiesList').css( 'margin-top', weatherPressDefaultCentredCityPosition - weatherPressCurrentCentredCityPosition );
    353            
    354             if( $('.weather-press-citiesList li:eq('+ (i-1) +')').length ) { // does element with index (i-1) exists ?
    355                
    356                 $('.weather-press-citiesList li:eq('+ (i-1) +')').removeClass();
    357 
    358                 if( $('.weather-press-citiesList li:eq('+ (i-1) +')').attr('data-weatherpressads') == 1 ) {
    359                    
    360                     $('.weather-press-citiesList li:eq('+ (i-1) +')').addClass('weather-press-deep1');
    361 
    362                 } else {
    363                    
    364                     $('.weather-press-citiesList li:eq('+ (i-1) +')').addClass('weather-press-deep2');
    365                 }   
    366             }
    367            
    368             if( $('.weather-press-citiesList li:eq('+ (i-2) +')').length ) { // does element with index (i-2) exists ?
    369                
    370                 $('.weather-press-citiesList li:eq('+ (i-2) +')').removeClass();
    371                 $('.weather-press-citiesList li:eq('+ (i-2) +')').addClass('weather-press-deep1');
    372             }
    373 
    374             if( $('.weather-press-citiesList li:eq('+ (i+1) +')').length ) { // does element with index (i+1) exists ?
    375                
    376                 $('.weather-press-citiesList li:eq('+ (i+1) +')').removeClass();
    377 
    378                 if( $('.weather-press-citiesList li:eq('+ (i+1) +')').attr('data-weatherpressads') == 1 ) {
    379                    
    380                     $('.weather-press-citiesList li:eq('+ (i+1) +')').addClass('weather-press-deep1');
    381 
    382                 } else {
    383                    
    384                     $('.weather-press-citiesList li:eq('+ (i+1) +')').addClass('weather-press-deep2');
    385                 }
    386             }
    387            
    388             if( $('.weather-press-citiesList li:eq('+ (i+2) +')').length ) { // does element with index (i+2) exists ?
    389                
    390                 $('.weather-press-citiesList li:eq('+ (i+2) +')').removeClass();
    391                 $('.weather-press-citiesList li:eq('+ (i+2) +')').addClass('weather-press-deep1');
     132           
     133            if( $('.weather-press-cities-list li:eq('+ (i+2) +')').length ) { // does element with index (i+2) exists ?
     134               
     135                $('.weather-press-cities-list li:eq('+ (i+2) +')').removeClass();
     136                $('.weather-press-cities-list li:eq('+ (i+2) +')').addClass('deep');
    392137            }
    393138           
     
    398143};
    399144
     145var weatherPressForecast_navigation = function( z ) {
     146   
     147    var weatherPressForecast_scroll_value;
     148   
     149    if( z == 1 ) {
     150       
     151        if( weatherPressForecast_allowed_scroll_number > weatherPressForecast_current_scroll_index ) {
     152       
     153            weatherPressForecast_current_scroll_index ++;
     154       
     155            weatherPressForecast_scroll_value = -1 * weatherPressForecast_current_scroll_index * ( weatherPressForecastContainerW + 7 );//7 = 5px for space and 2px for margin-right
     156       
     157            $('.weather-press-forecast-list').css('left', weatherPressForecast_scroll_value);
     158           
     159            $('.weather-press-block-bottom').addClass('initial-background');
     160       
     161        } else {
     162
     163            weatherPress_elastic_list_end(1);
     164        }
     165       
     166    } else if( z == -1 ){
     167       
     168        if( weatherPressForecast_current_scroll_index > 0 ) {
     169       
     170            weatherPressForecast_current_scroll_index --;
     171       
     172            weatherPressForecast_scroll_value = -1 * weatherPressForecast_current_scroll_index * ( weatherPressForecastContainerW + 7 );
     173       
     174            $('.weather-press-forecast-list').css('left', weatherPressForecast_scroll_value);
     175           
     176            if( weatherPressForecast_current_scroll_index == 0 ) { $('.weather-press-block-bottom').removeClass('initial-background'); }
     177           
     178        } else {
     179           
     180            weatherPress_elastic_list_end(-1);
     181        }   
     182    }   
     183}
     184
     185var weatherPress_elastic_list_end = function( z ) {// z is the object: list item to be animated
     186   
     187    var weatherPress_limit_position;
     188    var weatherPress_bounce_position;
     189    var weatherPress_elastic_timer;
     190   
     191    if( z == 1 ) {
     192       
     193        weatherPress_limit_position = -1 * weatherPressForecast_allowed_scroll_number * ( weatherPressForecastContainerW + 7 );
     194        weatherPress_bounce_position = parseInt(weatherPress_limit_position) - 10;
     195
     196        clearTimeout( weatherPress_elastic_timer );
     197        $('.weather-press-forecast-list').css('left', weatherPress_bounce_position);
     198        weatherPress_elastic_timer = setTimeout(function(){ $('.weather-press-forecast-list').css('left', weatherPress_limit_position); }, 300);
     199
     200    } else if( z == -1 ) {
     201
     202        clearTimeout( weatherPress_elastic_timer );
     203        $('.weather-press-forecast-list').css('left', 10);
     204        weatherPress_elastic_timer = setTimeout(function(){ $('.weather-press-forecast-list').css('left', 0); }, 300);     
     205       
     206    }
     207}   
     208
    400209var weatherPressShowLoader = function() {
    401210   
    402211    $('#weather-press-loader').removeClass('flipOutX');
    403212    $('#weather-press-loader').addClass('flipInX');
    404     $('#weather-press-chartLabel').css('opacity', '0');     
     213    $('.weather-press-cities-nav-container').css('display', 'none');   
     214   
     215    $('.weather-press-forecast-list').css('left', 0);
     216    weatherPressForecast_current_scroll_index = 0;
     217   
     218    $('.weather-press-block-bottom').removeClass('initial-background');
    405219};
    406220
    407 var weatherPressHideLoader = function() {
    408    
    409     $('#weather-press-loader').removeClass('flipInX');
    410     $('#weather-press-loader').addClass('flipOutX');
    411     $('#weather-press-chartLabel').css('opacity', '1');     
    412 };
    413 
    414 $(".weather-press-citiesList li[data-weatherpressads = 0]").click( function() { // organize the cities list according to this clicked item
     221$(".weather-press-cities-list li").click( function() { // organize the cities list according to this clicked item
    415222
    416223    //organize the cities list
    417     //weatherPressCitiesOrganizer( $(this).index() );
    418     // ajax call
     224    weatherPressCitiesOrganizer( $(this).index() );
     225    // ajax calls
    419226    weatherPressMainData( $(this), 1 );
    420     weatherPressHourlyData( $(this), 1 );
     227    weather_press_Get_Forecast( $(this), 1 );
    421228});
    422229
    423     //**************** Ajax calls:: weather data ***********************************************/
    424    
     230$("#weather-press-city-name").click( function() {
     231
     232    // ajax calls
     233    weatherPressMainData( $('.weather-press-cities-list .main-location'), 1 );
     234    weather_press_Get_Forecast( $('.weather-press-cities-list .main-location'), 1 );
     235});
     236
     237$('#weather-press-forecast-navs-right').click(function(){
     238   
     239    weatherPressForecast_navigation(1);
     240});
     241
     242$('#weather-press-forecast-navs-left').click(function(){
     243   
     244    weatherPressForecast_navigation(-1);
     245});
     246
     247
     248//**************** Ajax calls:: weather data ***********************************************/
     249
    425250//Main weather data
    426251var weatherPressMainData = function( item, cacheable ) {
     
    432257            type: 'POST',
    433258            url: weather_press_data_from_php.weather_press_ajax_url,
    434             data: {
    435 
     259            data:
     260            {
    436261                action:   'weather_press_public_ajaxCalls',
    437262                find:     'current',
     
    441266                language: weather_press_data_from_php.weather_press_Current_Language
    442267               
    443                 },
     268            },
    444269            cache: false,
    445270            dataType: 'json',
    446271            success: function(response) {
    447                     $('.weather-press-currentTempValue').text( response.temp + '°' );                   
    448                     $('.weather-press-icon img').attr( 'src', weather_press_data_from_php.weather_press_Plugin_Path + '/public/images/' + response.icon + '.png' );
    449                     //$('.weather-press-currentTempUnit').css('left', $('.weather-press-currentTempValue').outerWidth() + 22 );
     272
     273                    var temp     = ( response.temp     != undefined ) ? response.temp : '00';
     274                    var temp_min = ( response.temp_min != undefined ) ? response.temp_min : '00';
     275                    var temp_max = ( response.temp_max != undefined ) ? response.temp_max : '00';
     276                    var icon     = ( response.icon     != undefined ) ? response.icon : 'undefined';
     277
     278                    $('.weather-press-forecast-list li:first-child .weather-press-temp').text( temp + '°' );                   
     279                    $('.weather-press-forecast-list li:first-child .weather-press-condition-img > img').attr( 'src', weather_press_data_from_php.weather_press_Plugin_Path + '/public/images/' + icon + '.png' );
     280                    $('.weather-press-forecast-list li:first-child .weather-press-min-temp').text( temp_min + '°' );                   
     281                    $('.weather-press-forecast-list li:first-child .weather-press-max-temp').text( temp_max + '°' );
     282
     283                    //night design
     284                    if( ( icon.indexOf('n') >= 0 ) && ( icon != 'undefined' ) ){
     285
     286                        $('.weather-press-block-bottom').addClass('night-background');
     287                        $('.weather-press-block-middle').addClass('night-background');
     288                    }
    450289
    451290                    weatherPressCitiesOrganizer( item.index() );
    452291                    weatherPressHideLoader();
    453                
    454             },error: function(response, textStatus, errorThrown) {
    455 
    456                     $('.weather-press-outputs-content').html( errorThrown  + '<br><b>' + response.responseText + '</b></br>' );// catch the weather press exceptions and server errors
    457                     $('.weather-press-outputs-toPremium').css('opacity', '1');
     292                    $('.weather-press-cities-nav-container').css('display', 'block');
     293               
     294            },error: function(response) {console.log(response);
     295
     296                    var msg = JSON.stringify(response.responseText).substring(1, JSON.stringify(response.responseText).length-1);
     297                    $('.weather-press-outputs-content').text( 'Error : ' + msg ); // catch the php exception
     298                    //$('.weather-press-outputs-toPremium').css('opacity', '1');
    458299            }
    459300
     
    461302};
    462303
    463 var weatherPress_am_pm_format = function( h ) {
    464    
    465     switch( true ) {
    466        
    467         case ( h == 0 ):
    468             return '12am';
    469 
    470         case ( h < 12 ):
    471             return h + 'am';
    472 
    473         case ( h >= 12 ):
    474             return h + 'pm';
    475     }
    476 };
    477 
    478 //Hourly weather data :: since 4.0 rises
    479 var weatherPressHourlyData = function( item, cacheable ) {
    480        
    481     $('#weather-press-chart-loader').css('display', 'block');
    482    
    483     $.ajax ({   // Hourly forecats builder for the main location
    484    
     304//Daily forecast
     305var weather_press_reloadForecast = 0;
     306var weather_press_Get_Forecast = function( item, cacheable ) {
     307   
     308    $.ajax ({
     309
    485310            type: 'POST',
    486311            url: weather_press_data_from_php.weather_press_ajax_url,
    487312            data:
    488313            {
    489                
    490314                action:   'weather_press_public_ajaxCalls',
    491                 find:     'hourly',
     315                find:     'daily',
    492316                save:     cacheable,
    493317                city:     encodeURIComponent( item.text().toLowerCase() ),
    494318                unit:     weather_press_data_from_php.weather_press_Current_Unit,
     319                nbrDays:  weather_press_NbrDays,
    495320                language: weather_press_data_from_php.weather_press_Current_Language
    496321               
     
    498323            cache: false,
    499324            dataType: 'json',
    500             success: function(response){
    501 
    502                     var weatherPressHourlyArray_date = [];
    503                     var weatherPressHourlyArray_temp = [];
     325            success: function(response) {
     326
     327                    var forecastDate;       
     328                    var forecastMaxTemp;
     329                    var forecastMinTemp;   
     330                    var forecastTemp;   
     331                    var forecastIcon;
     332                    var weather_press_new_Forecast_elements;                   
    504333                   
    505                     $.each( response, function( key, value ) {
     334                    $.each( response, function( i, object ) {
     335                           
     336                        if( i > 0 ) { // 0 is the first element filled by the weatherPressMainData() function
     337                               
     338                            //console.log(i +'---------'+response[i].date);
     339                           
     340                            forecastDate = response[i].date;
     341                            forecastMaxTemp = response[i].maxtemp;
     342                            forecastMinTemp = response[i].mintemp;
     343                            forecastTemp = response[i].daytemp;
     344                            forecastIcon = response[i].icon;
     345                               
     346                            if (  forecastDate ) {
     347                           
     348                                //remove old <li> on first iteration only after each ajax request
     349                                if( (i == 1) && ( $('.weather-press-forecast-list > li').length > 1 ) ){
     350
     351                                    $('.weather-press-forecast-list > li:not(:first)').remove();
     352                                }
     353
     354                                // Create a new ul
     355                                weather_press_new_Forecast_elements = $( "<li id='weather_press_forecast_node_" + i + "'><ul class='weather-press-forecast-item'><li class='weather-press-date' class='weather-press-date'>" + forecastDate + "</li><li class='weather-press-temp'>" + forecastTemp + "°</li><li class='weather-press-condition-img'><img src='"  +  weather_press_data_from_php.weather_press_Plugin_Path + '/public/images/' + forecastIcon + ".png' alt='icon'/></li><li class='weather-press-minMax'><ul><li class='weather-press-min-temp'>" + forecastMinTemp + "°</li><li class='weather-press-temp-gauge'><div class='weather-press-gauge-gradient'></div></li><li class='weather-press-max-temp'>" + forecastMaxTemp + "°</li></ul></li></ul></li>" );
     356
     357                                weather_press_new_Forecast_elements.insertAfter( '#weather_press_forecast_node_' + (i - 1) );
     358                                //$( '.weather-press-forecast-list' ).append( weather_press_new_Forecast_elements );
    506359                       
    507                         var forecastDate = value.date;
    508                         var forecastTemp = value.temp;
    509                        
    510                         if (  forecastDate ) {
    511 
    512                             forecastDate = new Date(forecastDate);
    513                             forecastDate = weatherPress_am_pm_format( forecastDate.getHours() );
    514                             forecastTemp = Math.round(forecastTemp);
     360                            } else {
    515361                           
    516                             weatherPressHourlyArray_date[ key ] = forecastDate;
    517                             weatherPressHourlyArray_temp[ key ] = forecastTemp;                         
     362                                if( weather_press_reloadForecast <= 2 ) {
     363
     364                                    // Try to reload 2 times max if the data is undefined for any reason
     365                                    // Remove old forecast lists
     366                                    for( var z = 1; i < weather_press_NbrDays; z++ ) {
     367       
     368                                        $( '.weather-press-forecast-list > li;eq(' + z + ')' ).remove();
     369                                    }
     370
     371                                    weather_press_Get_Forecast( item, cacheable );
     372                                    weather_press_reloadForecast++;
     373                                }
     374                            }
     375                           
    518376                        }
    519 
    520                     });
     377                   
     378                    }); // end of the objects loop
    521379                   
    522                     weatherPressChartData = {
    523                         labels: [weatherPressHourlyArray_date[0], weatherPressHourlyArray_date[1], weatherPressHourlyArray_date[2], weatherPressHourlyArray_date[3]],
    524                         series:
    525                         [
    526                             [
    527                                 { value: weatherPressHourlyArray_temp[0], meta: '°' },
    528                                 { value:  weatherPressHourlyArray_temp[1], meta: '°' },
    529                                 { value:  weatherPressHourlyArray_temp[2], meta: '°' },
    530                                 { value:  weatherPressHourlyArray_temp[3],  meta: '°' },
    531                                 { value: 0,  meta: 'NO X COORDINATE' } // make the chart area close to the container ends, note that this value has no X coordinate
    532                             ]
    533                         ]
    534                     };
    535 
    536                     //weatherPressChartOptions.low = 0;
    537                    
    538                     weatherPressChart_Builder();
    539                     $('#weather-press-chart-loader').css('display', 'none');
     380                    //hide the forecast loader
     381                    $('#weather-press-forecast-loader').css('display', 'none');
    540382               
    541383            },error: function(response) {
    542384
    543                     weatherPressChart_Builder();// build chart with default values : 0 0 0 0
    544                     $('#weather-press-chart-loader').css('display', 'none');
    545385            }
    546 
    547     });     
     386    });
    548387       
    549388};
    550389
     390
    551391//Onload fetch the weather data of the main location
    552     weatherPressMainData( $('.weather-press-centred'), 1 );
    553     weatherPressHourlyData( $('.weather-press-centred'), 1 );
    554 
    555 //Reload the weather data on-refresh
    556     $('.weather-press-refrech').click( function(){
    557    
    558         weatherPressMainData( $('.weather-press-centred'), 0 );
    559         weatherPressHourlyData( $('.weather-press-centred'), 0 );
    560     });
    561 
    562     $('#weather-press-navRectangle-mainLocation').click( function(){
    563    
    564         weatherPressMainData( $('.weather-press-centred'), 1 );
    565         weatherPressHourlyData( $('.weather-press-centred'), 1 );
    566     });
    567    
    568     //**************** end of Ajax calls:: weather data ***********************************************/
     392    weatherPressMainData( $('.weather-press-cities-list .main-location'), 1 );
     393//Onload fetch the forecast weather data of the main location
     394    weather_press_Get_Forecast( $('.weather-press-cities-list .main-location'), 1 );
     395
     396function Clouds(t,e){this.config=null,this.container=null,this.renderer=null,this.scene=null,this.camera=null,this.aspect=0,this.cameraX={value:0,min:-50,max:50},this.cameraY={value:0,min:-100,max:50},this.cameraRotation={value:0},this.init(t,e)}var weatherPressHideLoader=function(){$("#weather-press-loader").removeClass("flipInX"),$("#weather-press-loader").addClass("flipOutX"),0!=$("#weather_press_brand").length&&"none"!=$("#weather_press_brand").css("display")&&"0"!=$("#weather_press_brand").css("opacity")&&"hidden"!=$("#weather_press_brand").css("visibility")&&0!=$("#weather_press_brand a").length&&"none"!=$("#weather_press_brand a").css("display")&&"0"!=$("#weather_press_brand a").css("opacity")&&"hidden"!=$("#weather_press_brand a").css("visibility")||($(".weather-press-block-bottom").empty(),$(".weather-press-block-bottom").css("height","221px"),weatherPressShowLoader(),$(".weather-press-outputs-content").text('As a free user you do not have permission to remove the "weather press" brand from the bottom of the widget !'),$(".weather-press-outputs-content").css("color","red"),$(".weather-press-outputs-content").css("text-align","left"),$(".weather-press-outputs-content").css("background","#F1F3F3"))},THREE={REVISION:"74"};"function"==typeof define&&define.amd?define("three",THREE):"undefined"!=typeof exports&&"undefined"!=typeof module&&(module.exports=THREE),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Math.sign&&(Math.sign=function(t){return 0>t?-1:0<t?1:+t}),void 0===Function.prototype.name&&void 0!==Object.defineProperty&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}}),void 0===Object.assign&&Object.defineProperty(Object,"assign",{writable:!0,configurable:!0,value:function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),r=1,i=arguments.length;r!==i;++r)if(void 0!==(n=arguments[r])&&null!==n)for(var n=Object(n),o=Object.keys(n),a=0,s=o.length;a!==s;++a){var h=o[a],c=Object.getOwnPropertyDescriptor(n,h);void 0!==c&&c.enumerable&&(e[h]=n[h])}return e}}),THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},THREE.CullFaceNone=0,THREE.CullFaceBack=1,THREE.CullFaceFront=2,THREE.CullFaceFrontBack=3,THREE.FrontFaceDirectionCW=0,THREE.FrontFaceDirectionCCW=1,THREE.BasicShadowMap=0,THREE.PCFShadowMap=1,THREE.PCFSoftShadowMap=2,THREE.FrontSide=0,THREE.BackSide=1,THREE.DoubleSide=2,THREE.FlatShading=1,THREE.SmoothShading=2,THREE.NoColors=0,THREE.FaceColors=1,THREE.VertexColors=2,THREE.NoBlending=0,THREE.NormalBlending=1,THREE.AdditiveBlending=2,THREE.SubtractiveBlending=3,THREE.MultiplyBlending=4,THREE.CustomBlending=5,THREE.AddEquation=100,THREE.SubtractEquation=101,THREE.ReverseSubtractEquation=102,THREE.MinEquation=103,THREE.MaxEquation=104,THREE.ZeroFactor=200,THREE.OneFactor=201,THREE.SrcColorFactor=202,THREE.OneMinusSrcColorFactor=203,THREE.SrcAlphaFactor=204,THREE.OneMinusSrcAlphaFactor=205,THREE.DstAlphaFactor=206,THREE.OneMinusDstAlphaFactor=207,THREE.DstColorFactor=208,THREE.OneMinusDstColorFactor=209,THREE.SrcAlphaSaturateFactor=210,THREE.NeverDepth=0,THREE.AlwaysDepth=1,THREE.LessDepth=2,THREE.LessEqualDepth=3,THREE.EqualDepth=4,THREE.GreaterEqualDepth=5,THREE.GreaterDepth=6,THREE.NotEqualDepth=7,THREE.MultiplyOperation=0,THREE.MixOperation=1,THREE.AddOperation=2,THREE.UVMapping=300,THREE.CubeReflectionMapping=301,THREE.CubeRefractionMapping=302,THREE.EquirectangularReflectionMapping=303,THREE.EquirectangularRefractionMapping=304,THREE.SphericalReflectionMapping=305,THREE.RepeatWrapping=1e3,THREE.ClampToEdgeWrapping=1001,THREE.MirroredRepeatWrapping=1002,THREE.NearestFilter=1003,THREE.NearestMipMapNearestFilter=1004,THREE.NearestMipMapLinearFilter=1005,THREE.LinearFilter=1006,THREE.LinearMipMapNearestFilter=1007,THREE.LinearMipMapLinearFilter=1008,THREE.UnsignedByteType=1009,THREE.ByteType=1010,THREE.ShortType=1011,THREE.UnsignedShortType=1012,THREE.IntType=1013,THREE.UnsignedIntType=1014,THREE.FloatType=1015,THREE.HalfFloatType=1025,THREE.UnsignedShort4444Type=1016,THREE.UnsignedShort5551Type=1017,THREE.UnsignedShort565Type=1018,THREE.AlphaFormat=1019,THREE.RGBFormat=1020,THREE.RGBAFormat=1021,THREE.LuminanceFormat=1022,THREE.LuminanceAlphaFormat=1023,THREE.RGBEFormat=THREE.RGBAFormat,THREE.RGB_S3TC_DXT1_Format=2001,THREE.RGBA_S3TC_DXT1_Format=2002,THREE.RGBA_S3TC_DXT3_Format=2003,THREE.RGBA_S3TC_DXT5_Format=2004,THREE.RGB_PVRTC_4BPPV1_Format=2100,THREE.RGB_PVRTC_2BPPV1_Format=2101,THREE.RGBA_PVRTC_4BPPV1_Format=2102,THREE.RGBA_PVRTC_2BPPV1_Format=2103,THREE.RGB_ETC1_Format=2151,THREE.LoopOnce=2200,THREE.LoopRepeat=2201,THREE.LoopPingPong=2202,THREE.InterpolateDiscrete=2300,THREE.InterpolateLinear=2301,THREE.InterpolateSmooth=2302,THREE.ZeroCurvatureEnding=2400,THREE.ZeroSlopeEnding=2401,THREE.WrapAroundEnding=2402,THREE.TrianglesDrawMode=0,THREE.TriangleStripDrawMode=1,THREE.TriangleFanDrawMode=2,THREE.Color=function(t){return 3===arguments.length?this.fromArray(arguments):this.set(t)},THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(t){return t instanceof THREE.Color?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){this.b=this.g=this.r=t},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,r){return this.r=t,this.g=e,this.b=r,this},setHSL:function(){function t(t,e,r){return 0>r&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:.5>r?e:r<2/3?t+6*(e-t)*(2/3-r):t}return function(e,r,i){return e=THREE.Math.euclideanModulo(e,1),r=THREE.Math.clamp(r,0,1),i=THREE.Math.clamp(i,0,1),0===r?this.r=this.g=this.b=i:(r=.5>=i?i*(1+r):i+r-i*r,i=2*i-r,this.r=t(i,r,e+1/3),this.g=t(i,r,e),this.b=t(i,r,e-1/3)),this}}(),setStyle:function(t){function e(e){void 0!==e&&1>parseFloat(e)&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){i=r[2];switch(r[1]){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i)){var i=parseFloat(r[1])/360,n=parseInt(r[2],10)/100,o=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(i,n,o)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(t)){if(r=r[1],3===(i=r.length))return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this;if(6===i)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this}return t&&0<t.length&&(r=THREE.ColorKeywords[t],void 0!==r?this.setHex(r):console.warn("THREE.Color: Unknown color "+t)),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var r=0<e?1/e:1;return this.r=Math.pow(t.r,r),this.g=Math.pow(t.g,r),this.b=Math.pow(t.b,r),this},convertGammaToLinear:function(){var t=this.r,e=this.g,r=this.b;return this.r=t*t,this.g=e*e,this.b=r*r,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){t=t||{h:0,s:0,l:0};var e,r=this.r,i=this.g,n=this.b,o=Math.max(r,i,n),a=((h=Math.min(r,i,n))+o)/2;if(h===o)h=e=0;else{var s=o-h,h=.5>=a?s/(o+h):s/(2-o-h);switch(o){case r:e=(i-n)/s+(i<n?6:0);break;case i:e=(n-r)/s+2;break;case n:e=(r-i)/s+4}e/=6}return t.h=e,t.s=h,t.l=a,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,r){var i=this.getHSL();return i.h+=t,i.s+=e,i.l+=r,this.setHSL(i.h,i.s,i.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}},THREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},THREE.Quaternion=function(t,e,r,i){this._x=t||0,this._y=e||0,this._z=r||0,this._w=void 0!==i?i:1},THREE.Quaternion.prototype={constructor:THREE.Quaternion,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get w(){return this._w},set w(t){this._w=t,this.onChangeCallback()},set:function(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._w=i,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!1==t instanceof THREE.Euler)throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var r=Math.cos(t._x/2),i=Math.cos(t._y/2),n=Math.cos(t._z/2),o=Math.sin(t._x/2),a=Math.sin(t._y/2),s=Math.sin(t._z/2),h=t.order;return"XYZ"===h?(this._x=o*i*n+r*a*s,this._y=r*a*n-o*i*s,this._z=r*i*s+o*a*n,this._w=r*i*n-o*a*s):"YXZ"===h?(this._x=o*i*n+r*a*s,this._y=r*a*n-o*i*s,this._z=r*i*s-o*a*n,this._w=r*i*n+o*a*s):"ZXY"===h?(this._x=o*i*n-r*a*s,this._y=r*a*n+o*i*s,this._z=r*i*s+o*a*n,this._w=r*i*n-o*a*s):"ZYX"===h?(this._x=o*i*n-r*a*s,this._y=r*a*n+o*i*s,this._z=r*i*s-o*a*n,this._w=r*i*n+o*a*s):"YZX"===h?(this._x=o*i*n+r*a*s,this._y=r*a*n+o*i*s,this._z=r*i*s-o*a*n,this._w=r*i*n-o*a*s):"XZY"===h&&(this._x=o*i*n-r*a*s,this._y=r*a*n-o*i*s,this._z=r*i*s+o*a*n,this._w=r*i*n+o*a*s),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var r=e/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e=t.elements,r=e[0];t=e[4];var i=e[8],n=e[1],o=e[5],a=e[9],s=e[2],h=e[6],c=r+o+(e=e[10]);return 0<c?(r=.5/Math.sqrt(c+1),this._w=.25/r,this._x=(h-a)*r,this._y=(i-s)*r,this._z=(n-t)*r):r>o&&r>e?(r=2*Math.sqrt(1+r-o-e),this._w=(h-a)/r,this._x=.25*r,this._y=(t+n)/r,this._z=(i+s)/r):o>e?(r=2*Math.sqrt(1+o-r-e),this._w=(i-s)/r,this._x=(t+n)/r,this._y=.25*r,this._z=(a+h)/r):(r=2*Math.sqrt(1+e-r-o),this._w=(n-t)/r,this._x=(i+s)/r,this._y=(a+h)/r,this._z=.25*r),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e;return function(r,i){return void 0===t&&(t=new THREE.Vector3),e=r.dot(i)+1,1e-6>e?(e=0,Math.abs(r.x)>Math.abs(r.z)?t.set(-r.y,r.x,0):t.set(0,-r.z,r.y)):t.crossVectors(r,i),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._z=this._y=this._x=0,this._w=1):(t=1/t,this._x*=t,this._y*=t,this._z*=t,this._w*=t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},multiplyQuaternions:function(t,e){var r=t._x,i=t._y,n=t._z,o=t._w,a=e._x,s=e._y,h=e._z,c=e._w;return this._x=r*c+o*a+i*h-n*s,this._y=i*c+o*s+n*a-r*h,this._z=n*c+o*h+r*s-i*a,this._w=o*c-r*a-i*s-n*h,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,i=this._y,n=this._z,o=this._w;if(0>(s=o*t._w+r*t._x+i*t._y+n*t._z)?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),1<=s)return this._w=o,this._x=r,this._y=i,this._z=n,this;h=Math.sqrt(1-s*s);if(.001>Math.abs(h))return this._w=.5*(o+this._w),this._x=.5*(r+this._x),this._y=.5*(i+this._y),this._z=.5*(n+this._z),this;var a=Math.atan2(h,s),s=Math.sin((1-e)*a)/h,h=Math.sin(e*a)/h;return this._w=o*s+this._w*h,this._x=r*s+this._x*h,this._y=i*s+this._y*h,this._z=n*s+this._z*h,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},Object.assign(THREE.Quaternion,{slerp:function(t,e,r,i){return r.copy(t).slerp(e,i)},slerpFlat:function(t,e,r,i,n,o,a){var s=r[i+0],h=r[i+1],c=r[i+2];r=r[i+3],i=n[o+0];var l=n[o+1],u=n[o+2];if(n=n[o+3],r!==n||s!==i||h!==l||c!==u){o=1-a;var E=s*i+h*l+c*u+r*n,p=0<=E?1:-1,d=1-E*E;d>Number.EPSILON&&(d=Math.sqrt(d),E=Math.atan2(d,E*p),o=Math.sin(o*E)/d,a=Math.sin(a*E)/d),s=s*o+i*(p*=a),h=h*o+l*p,c=c*o+u*p,r=r*o+n*p,o===1-a&&(a=1/Math.sqrt(s*s+h*h+c*c+r*r),s*=a,h*=a,c*=a,r*=a)}t[e]=s,t[e+1]=h,t[e+2]=c,t[e+3]=r}}),THREE.Vector2=function(t,e){this.x=t||0,this.y=e||0},THREE.Vector2.prototype={constructor:THREE.Vector2,get width(){return this.x},set width(t){this.x=t},get height(){return this.y},set height(t){this.y=t},set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.y=this.x=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t):this.y=this.x=0,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t,e;return function(r,i){return void 0===t&&(t=new THREE.Vector2,e=new THREE.Vector2),t.set(r,r),e.set(i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,r))/r),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var t=Math.atan2(this.y,this.x);return 0>t&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x;return t=this.y-t.y,e*e+t*t},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this},rotateAround:function(t,e){var r=Math.cos(e),i=Math.sin(e),n=this.x-t.x,o=this.y-t.y;return this.x=n*r-o*i+t.x,this.y=n*i+o*r+t.y,this}},THREE.Vector3=function(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(t,e,r){return this.x=t,this.y=e,this.z=r,this},setScalar:function(t){return this.z=this.y=this.x=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):this.z=this.y=this.x=0,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t;return function(e){return!1==e instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),void 0===t&&(t=new THREE.Quaternion),this.applyQuaternion(t.setFromEuler(e)),this}}(),applyAxisAngle:function(){var t;return function(e,r){return void 0===t&&(t=new THREE.Quaternion),this.applyQuaternion(t.setFromAxisAngle(e,r)),this}}(),applyMatrix3:function(t){var e=this.x,r=this.y,i=this.z;return t=t.elements,this.x=t[0]*e+t[3]*r+t[6]*i,this.y=t[1]*e+t[4]*r+t[7]*i,this.z=t[2]*e+t[5]*r+t[8]*i,this},applyMatrix4:function(t){var e=this.x,r=this.y,i=this.z;return t=t.elements,this.x=t[0]*e+t[4]*r+t[8]*i+t[12],this.y=t[1]*e+t[5]*r+t[9]*i+t[13],this.z=t[2]*e+t[6]*r+t[10]*i+t[14],this},applyProjection:function(t){var e=this.x,r=this.y,i=this.z,n=1/((t=t.elements)[3]*e+t[7]*r+t[11]*i+t[15]);return this.x=(t[0]*e+t[4]*r+t[8]*i+t[12])*n,this.y=(t[1]*e+t[5]*r+t[9]*i+t[13])*n,this.z=(t[2]*e+t[6]*r+t[10]*i+t[14])*n,this},applyQuaternion:function(t){var e=this.x,r=this.y,i=this.z,n=t.x,o=t.y,a=t.z,s=(t=t.w)*e+o*i-a*r,h=t*r+a*e-n*i,c=t*i+n*r-o*e,e=-n*e-o*r-a*i;return this.x=s*t+e*-n+h*-a-c*-o,this.y=h*t+e*-o+c*-n-s*-a,this.z=c*t+e*-a+s*-o-h*-n,this},project:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.multiplyMatrices(e.projectionMatrix,t.getInverse(e.matrixWorld)),this.applyProjection(t)}}(),unproject:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyProjection(t)}}(),transformDirection:function(t){var e=this.x,r=this.y,i=this.z;return t=t.elements,this.x=t[0]*e+t[4]*r+t[8]*i,this.y=t[1]*e+t[5]*r+t[9]*i,this.z=t[2]*e+t[6]*r+t[10]*i,this.normalize(),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t,e;return function(r,i){return void 0===t&&(t=new THREE.Vector3,e=new THREE.Vector3),t.set(r,r,r),e.set(i,i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,r))/r),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},cross:function(t,e){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var r=this.x,i=this.y,n=this.z;return this.x=i*t.z-n*t.y,this.y=n*t.x-r*t.z,this.z=r*t.y-i*t.x,this},crossVectors:function(t,e){var r=t.x,i=t.y,n=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-n*a,this.y=n*o-r*s,this.z=r*a-i*o,this},projectOnVector:function(){var t,e;return function(r){return void 0===t&&(t=new THREE.Vector3),t.copy(r).normalize(),e=this.dot(t),this.copy(t).multiplyScalar(e)}}(),projectOnPlane:function(){var t;return function(e){return void 0===t&&(t=new THREE.Vector3),t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t;return function(e){return void 0===t&&(t=new THREE.Vector3),this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){return t=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq()),Math.acos(THREE.Math.clamp(t,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y;return t=this.z-t.z,e*e+r*r+t*t},setFromMatrixPosition:function(t){return this.x=t.elements[12],this.y=t.elements[13],this.z=t.elements[14],this},setFromMatrixScale:function(t){var e=this.set(t.elements[0],t.elements[1],t.elements[2]).length(),r=this.set(t.elements[4],t.elements[5],t.elements[6]).length();return t=this.set(t.elements[8],t.elements[9],t.elements[10]).length(),this.x=e,this.y=r,this.z=t,this},setFromMatrixColumn:function(t,e){var r=4*t,i=e.elements;return this.x=i[r],this.y=i[r+1],this.z=i[r+2],this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this}},THREE.Vector4=function(t,e,r,i){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==i?i:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this},setScalar:function(t){return this.w=this.z=this.y=this.x=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):this.w=this.z=this.y=this.x=0,this},applyMatrix4:function(t){var e=this.x,r=this.y,i=this.z,n=this.w;return t=t.elements,this.x=t[0]*e+t[4]*r+t[8]*i+t[12]*n,this.y=t[1]*e+t[5]*r+t[9]*i+t[13]*n,this.z=t[2]*e+t[6]*r+t[10]*i+t[14]*n,this.w=t[3]*e+t[7]*r+t[11]*i+t[15]*n,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return 1e-4>e?(this.x=1,this.z=this.y=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,r,i,n=(t=t.elements)[0];i=t[4];var o=t[8],a=t[1],s=t[5],h=t[9];r=t[2],e=t[6];var c=t[10];return.01>Math.abs(i-a)&&.01>Math.abs(o-r)&&.01>Math.abs(h-e)?.1>Math.abs(i+a)&&.1>Math.abs(o+r)&&.1>Math.abs(h+e)&&.1>Math.abs(n+s+c-3)?(this.set(1,0,0,0),this):(t=Math.PI,n=(n+1)/2,s=(s+1)/2,c=(c+1)/2,i=(i+a)/4,o=(o+r)/4,h=(h+e)/4,n>s&&n>c?.01>n?(e=0,i=r=.707106781):(e=Math.sqrt(n),r=i/e,i=o/e):s>c?.01>s?(e=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),e=i/r,i=h/r):.01>c?(r=e=.707106781,i=0):(i=Math.sqrt(c),e=o/i,r=h/i),this.set(e,r,i,t),this):(t=Math.sqrt((e-h)*(e-h)+(o-r)*(o-r)+(a-i)*(a-i)),.001>Math.abs(t)&&(t=1),this.x=(e-h)/t,this.y=(o-r)/t,this.z=(a-i)/t,this.w=Math.acos((n+s+c-1)/2),this)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(r,i){return void 0===t&&(t=new THREE.Vector4,e=new THREE.Vector4),t.set(r,r,r,r),e.set(i,i,i,i),this.clamp(t,e)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this.w=t.array[e+3],this}},THREE.Euler=function(t,e,r,i){this._x=t||0,this._y=e||0,this._z=r||0,this._order=i||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get order(){return this._order},set order(t){this._order=t,this.onChangeCallback()},set:function(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,r){var i=THREE.Math.clamp;t=(u=t.elements)[0];var n=u[4],o=u[8],a=u[1],s=u[5],h=u[9],c=u[2],l=u[6],u=u[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(i(o,-1,1)),.99999>Math.abs(o)?(this._x=Math.atan2(-h,u),this._z=Math.atan2(-n,t)):(this._x=Math.atan2(l,s),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(h,-1,1)),.99999>Math.abs(h)?(this._y=Math.atan2(o,u),this._z=Math.atan2(a,s)):(this._y=Math.atan2(-c,t),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(-c,u),this._z=Math.atan2(-n,s)):(this._y=0,this._z=Math.atan2(a,t))):"ZYX"===e?(this._y=Math.asin(-i(c,-1,1)),.99999>Math.abs(c)?(this._x=Math.atan2(l,u),this._z=Math.atan2(a,t)):(this._x=0,this._z=Math.atan2(-n,s))):"YZX"===e?(this._z=Math.asin(i(a,-1,1)),.99999>Math.abs(a)?(this._x=Math.atan2(-h,s),this._y=Math.atan2(-c,t)):(this._x=0,this._y=Math.atan2(o,u))):"XZY"===e?(this._z=Math.asin(-i(n,-1,1)),.99999>Math.abs(n)?(this._x=Math.atan2(l,s),this._y=Math.atan2(o,t)):(this._x=Math.atan2(-h,u),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==r&&this.onChangeCallback(),this},setFromQuaternion:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,r,i),this}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new THREE.Quaternion;return function(e){t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},THREE.Line3=function(t,e){this.start=void 0!==t?t:new THREE.Vector3,this.end=void 0!==e?e:new THREE.Vector3},THREE.Line3.prototype={constructor:THREE.Line3,set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},center:function(t){return(t||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return(t||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var r=e||new THREE.Vector3;return this.delta(r).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r,i){t.subVectors(r,this.start),e.subVectors(this.end,this.start);var n=e.dot(e),n=e.dot(t)/n;return i&&(n=THREE.Math.clamp(n,0,1)),n}}(),closestPointToPoint:function(t,e,r){return t=this.closestPointToPointParameter(t,e),r=r||new THREE.Vector3,this.delta(r).multiplyScalar(t).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}},THREE.Box2=function(t,e){this.min=void 0!==t?t:new THREE.Vector2(1/0,1/0),this.max=void 0!==e?e:new THREE.Vector2(-1/0,-1/0)},THREE.Box2.prototype={constructor:THREE.Box2,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new THREE.Vector2;return function(e,r){var i=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(t){return(t||new THREE.Vector2).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){return(t||new THREE.Vector2).subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return(e||new THREE.Vector2).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return(e||new THREE.Vector2).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new THREE.Vector2;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},THREE.Box3=function(t,e){this.min=void 0!==t?t:new THREE.Vector3(1/0,1/0,1/0),this.max=void 0!==e?e:new THREE.Vector3(-1/0,-1/0,-1/0)},THREE.Box3.prototype={constructor:THREE.Box3,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){this.makeEmpty();for(var e=1/0,r=1/0,i=1/0,n=-1/0,o=-1/0,a=-1/0,s=0,h=t.length;s<h;s+=3){var c=t[s],l=t[s+1],u=t[s+2];c<e&&(e=c),l<r&&(r=l),u<i&&(i=u),c>n&&(n=c),l>o&&(o=l),u>a&&(a=u)}this.min.set(e,r,i),this.max.set(n,o,a)},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new THREE.Vector3;return function(e,r){var i=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),setFromObject:function(){var t;return function(e){void 0===t&&(t=new THREE.Box3);var r=this;return this.makeEmpty(),e.updateMatrixWorld(!0),e.traverse(function(e){var i=e.geometry;void 0!==i&&(null===i.boundingBox&&i.computeBoundingBox(),t.copy(i.boundingBox),t.applyMatrix4(e.matrixWorld),r.union(t))}),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(t){return(t||new THREE.Vector3).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){return(t||new THREE.Vector3).subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return(e||new THREE.Vector3).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(){var t;return function(e){return void 0===t&&(t=new THREE.Vector3),this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,r;return 0<t.normal.x?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),0<t.normal.y?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=t.constant&&r>=t.constant},clampPoint:function(t,e){return(e||new THREE.Vector3).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new THREE.Vector3;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new THREE.Vector3;return function(e){return e=e||new THREE.Sphere,e.center=this.center(),e.radius=.5*this.size(t).length(),e}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(e){return t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.makeEmpty(),this.setFromPoints(t),this}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")},THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(t,e,r,i,n,o,a,s,h){var c=this.elements;return c[0]=t,c[3]=e,c[6]=r,c[1]=i,c[4]=n,c[7]=o,c[2]=a,c[5]=s,c[8]=h,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){return t=t.elements,this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},applyToVector3Array:function(){var t;return function(e,r,i){void 0===t&&(t=new THREE.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length);for(var n=0;n<i;n+=3,r+=3)t.fromArray(e,r),t.applyMatrix3(this),t.toArray(e,r);return e}}(),applyToBuffer:function(){var t;return function(e,r,i){void 0===t&&(t=new THREE.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length/e.itemSize);for(var n=0;n<i;n++,r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.applyMatrix3(this),e.setXYZ(t.x,t.y,t.z);return e}}(),multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],o=t[4],a=t[5],s=t[6],h=t[7];return e*o*(t=t[8])-e*a*h-r*n*t+r*a*s+i*n*h-i*o*s},getInverse:function(t,e){var r=t.elements,i=this.elements;if(i[0]=r[10]*r[5]-r[6]*r[9],i[1]=-r[10]*r[1]+r[2]*r[9],i[2]=r[6]*r[1]-r[2]*r[5],i[3]=-r[10]*r[4]+r[6]*r[8],i[4]=r[10]*r[0]-r[2]*r[8],i[5]=-r[6]*r[0]+r[2]*r[4],i[6]=r[9]*r[4]-r[5]*r[8],i[7]=-r[9]*r[0]+r[1]*r[8],i[8]=r[5]*r[0]-r[1]*r[4],0===(r=r[0]*i[0]+r[1]*i[3]+r[2]*i[6])){if(e)throw Error("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0");return console.warn("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/r),this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},flattenToArrayOffset:function(t,e){var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t},getNormalMatrix:function(t){return this.getInverse(t).transpose(),this},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},fromArray:function(t){return this.elements.set(t),this},toArray:function(){var t=this.elements;return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}},THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(t,e,r,i,n,o,a,s,h,c,l,u,E,p,d,f){var m=this.elements;return m[0]=t,m[4]=e,m[8]=r,m[12]=i,m[1]=n,m[5]=o,m[9]=a,m[13]=s,m[2]=h,m[6]=c,m[10]=l,m[14]=u,m[3]=E,m[7]=p,m[11]=d,m[15]=f,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)},copy:function(t){return this.elements.set(t.elements),this},copyPosition:function(t){var e=this.elements;return t=t.elements,e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(t,e,r){var i=this.elements;return t.set(i[0],i[1],i[2]),e.set(i[4],i[5],i[6]),r.set(i[8],i[9],i[10]),this},makeBasis:function(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this},extractRotation:function(){var t;return function(e){void 0===t&&(t=new THREE.Vector3);var r=this.elements;e=e.elements;var i=1/t.set(e[0],e[1],e[2]).length(),n=1/t.set(e[4],e[5],e[6]).length(),o=1/t.set(e[8],e[9],e[10]).length();return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[8]=e[8]*o,r[9]=e[9]*o,r[10]=e[10]*o,this}}(),makeRotationFromEuler:function(t){!1==t instanceof THREE.Euler&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,r=t.x,i=t.y,n=t.z,o=Math.cos(r),r=Math.sin(r),a=Math.cos(i),i=Math.sin(i),s=Math.cos(n),n=Math.sin(n);if("XYZ"===t.order){t=o*s;var h=o*n,c=r*s,l=r*n;e[0]=a*s,e[4]=-a*n,e[8]=i,e[1]=h+c*i,e[5]=t-l*i,e[9]=-r*a,e[2]=l-t*i,e[6]=c+h*i,e[10]=o*a}else"YXZ"===t.order?(t=a*s,h=a*n,c=i*s,l=i*n,e[0]=t+l*r,e[4]=c*r-h,e[8]=o*i,e[1]=o*n,e[5]=o*s,e[9]=-r,e[2]=h*r-c,e[6]=l+t*r,e[10]=o*a):"ZXY"===t.order?(t=a*s,h=a*n,c=i*s,l=i*n,e[0]=t-l*r,e[4]=-o*n,e[8]=c+h*r,e[1]=h+c*r,e[5]=o*s,e[9]=l-t*r,e[2]=-o*i,e[6]=r,e[10]=o*a):"ZYX"===t.order?(t=o*s,h=o*n,c=r*s,l=r*n,e[0]=a*s,e[4]=c*i-h,e[8]=t*i+l,e[1]=a*n,e[5]=l*i+t,e[9]=h*i-c,e[2]=-i,e[6]=r*a,e[10]=o*a):"YZX"===t.order?(t=o*a,h=o*i,c=r*a,l=r*i,e[0]=a*s,e[4]=l-t*n,e[8]=c*n+h,e[1]=n,e[5]=o*s,e[9]=-r*s,e[2]=-i*s,e[6]=h*n+c,e[10]=t-l*n):"XZY"===t.order&&(t=o*a,h=o*i,c=r*a,l=r*i,e[0]=a*s,e[4]=-n,e[8]=i*s,e[1]=t*n+l,e[5]=o*s,e[9]=h*n-c,e[2]=c*n-h,e[6]=r*s,e[10]=l*n+t);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,r=t.x,i=t.y,n=t.z,o=t.w,a=n+n;t=r*(c=r+r);var s=r*(l=i+i),r=r*a,h=i*l,i=i*a,n=n*a,c=o*c,l=o*l,o=o*a;return e[0]=1-(h+n),e[4]=s-o,e[8]=r+l,e[1]=s+o,e[5]=1-(t+n),e[9]=i-c,e[2]=r-l,e[6]=i+c,e[10]=1-(t+h),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var t,e,r;return function(i,n,o){void 0===t&&(t=new THREE.Vector3),void 0===e&&(e=new THREE.Vector3),void 0===r&&(r=new THREE.Vector3);var a=this.elements;return r.subVectors(i,n).normalize(),0===r.lengthSq()&&(r.z=1),t.crossVectors(o,r).normalize(),0===t.lengthSq()&&(r.x+=1e-4,t.crossVectors(o,r).normalize()),e.crossVectors(r,t),a[0]=t.x,a[4]=e.x,a[8]=r.x,a[1]=t.y,a[5]=e.y,a[9]=r.y,a[2]=t.z,a[6]=e.z,a[10]=r.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},multiplyMatrices:function(t,e){var r=t.elements,i=e.elements,n=this.elements,o=r[0],a=r[4],s=r[8],h=r[12],c=r[1],l=r[5],u=r[9],E=r[13],p=r[2],d=r[6],f=r[10],m=r[14],T=r[3],g=r[7],v=r[11],r=r[15],y=i[0],R=i[4],H=i[8],x=i[12],b=i[1],_=i[5],M=i[9],w=i[13],S=i[2],C=i[6],L=i[10],A=i[14],P=i[3],U=i[7],D=i[11],i=i[15];return n[0]=o*y+a*b+s*S+h*P,n[4]=o*R+a*_+s*C+h*U,n[8]=o*H+a*M+s*L+h*D,n[12]=o*x+a*w+s*A+h*i,n[1]=c*y+l*b+u*S+E*P,n[5]=c*R+l*_+u*C+E*U,n[9]=c*H+l*M+u*L+E*D,n[13]=c*x+l*w+u*A+E*i,n[2]=p*y+d*b+f*S+m*P,n[6]=p*R+d*_+f*C+m*U,n[10]=p*H+d*M+f*L+m*D,n[14]=p*x+d*w+f*A+m*i,n[3]=T*y+g*b+v*S+r*P,n[7]=T*R+g*_+v*C+r*U,n[11]=T*H+g*M+v*L+r*D,n[15]=T*x+g*w+v*A+r*i,this},multiplyToArray:function(t,e,r){var i=this.elements;return this.multiplyMatrices(t,e),r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[8]=i[8],r[9]=i[9],r[10]=i[10],r[11]=i[11],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15],this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToVector3Array:function(){var t;return function(e,r,i){void 0===t&&(t=new THREE.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length);for(var n=0;n<i;n+=3,r+=3)t.fromArray(e,r),t.applyMatrix4(this),t.toArray(e,r);return e}}(),applyToBuffer:function(){var t;return function(e,r,i){void 0===t&&(t=new THREE.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length/e.itemSize);for(var n=0;n<i;n++,r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.applyMatrix4(this),e.setXYZ(t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],r=t[4],i=t[8],n=t[12],o=t[1],a=t[5],s=t[9],h=t[13],c=t[2],l=t[6],u=t[10],E=t[14];return t[3]*(+n*s*l-i*h*l-n*a*u+r*h*u+i*a*E-r*s*E)+t[7]*(+e*s*E-e*h*u+n*o*u-i*o*E+i*h*c-n*s*c)+t[11]*(+e*h*l-e*a*E-n*o*l+r*o*E+n*a*c-r*h*c)+t[15]*(-i*a*c-e*s*l+e*a*u+i*o*l-r*o*u+r*s*c)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},flattenToArrayOffset:function(t,e){var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t},getPosition:function(){var t;return function(){void 0===t&&(t=new THREE.Vector3),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var e=this.elements;return t.set(e[12],e[13],e[14])}}(),setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var r=this.elements,i=(g=t.elements)[0],n=g[4],o=g[8],a=g[12],s=g[1],h=g[5],c=g[9],l=g[13],u=g[2],E=g[6],p=g[10],d=g[14],f=g[3],m=g[7],T=g[11],g=g[15];if(r[0]=c*d*m-l*p*m+l*E*T-h*d*T-c*E*g+h*p*g,r[4]=a*p*m-o*d*m-a*E*T+n*d*T+o*E*g-n*p*g,r[8]=o*l*m-a*c*m+a*h*T-n*l*T-o*h*g+n*c*g,r[12]=a*c*E-o*l*E-a*h*p+n*l*p+o*h*d-n*c*d,r[1]=l*p*f-c*d*f-l*u*T+s*d*T+c*u*g-s*p*g,r[5]=o*d*f-a*p*f+a*u*T-i*d*T-o*u*g+i*p*g,r[9]=a*c*f-o*l*f-a*s*T+i*l*T+o*s*g-i*c*g,r[13]=o*l*u-a*c*u+a*s*p-i*l*p-o*s*d+i*c*d,r[2]=h*d*f-l*E*f+l*u*m-s*d*m-h*u*g+s*E*g,r[6]=a*E*f-n*d*f-a*u*m+i*d*m+n*u*g-i*E*g,r[10]=n*l*f-a*h*f+a*s*m-i*l*m-n*s*g+i*h*g,r[14]=a*h*u-n*l*u-a*s*E+i*l*E+n*s*d-i*h*d,r[3]=c*E*f-h*p*f-c*u*m+s*p*m+h*u*T-s*E*T,r[7]=n*p*f-o*E*f+o*u*m-i*p*m-n*u*T+i*E*T,r[11]=o*h*f-n*c*f-o*s*m+i*c*m+n*s*T-i*h*T,r[15]=n*c*u-o*h*u+o*s*E-i*c*E-n*s*p+i*h*p,0===(r=i*r[0]+s*r[4]+u*r[8]+f*r[12])){if(e)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");return console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/r),this},scale:function(t){var e=this.elements,r=t.x,i=t.y;return t=t.z,e[0]*=r,e[4]*=i,e[8]*=t,e[1]*=r,e[5]*=i,e[9]*=t,e[2]*=r,e[6]*=i,e[10]*=t,e[3]*=r,e[7]*=i,e[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements;return Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1]+t[2]*t[2],t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10]))},makeTranslation:function(t,e,r){return this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(1,0,0,0,0,e,-t,0,0,t,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(e,0,t,0,0,1,0,0,-t,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(e,-t,0,0,t,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var r=Math.cos(e),i=Math.sin(e),n=1-r,o=t.x,a=t.y,s=t.z,h=n*o,c=n*a;return this.set(h*o+r,h*a-i*s,h*s+i*a,0,h*a+i*s,c*a+r,c*s-i*o,0,h*s-i*a,c*s+i*o,n*s*s+r,0,0,0,0,1),this},makeScale:function(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this},compose:function(t,e,r){return this.makeRotationFromQuaternion(e),this.scale(r),this.setPosition(t),this},decompose:function(){var t,e;return function(r,i,n){void 0===t&&(t=new THREE.Vector3),void 0===e&&(e=new THREE.Matrix4);var o=this.elements,a=t.set(o[0],o[1],o[2]).length(),s=t.set(o[4],o[5],o[6]).length(),h=t.set(o[8],o[9],o[10]).length();0>this.determinant()&&(a=-a),r.x=o[12],r.y=o[13],r.z=o[14],e.elements.set(this.elements),r=1/a;var o=1/s,c=1/h;return e.elements[0]*=r,e.elements[1]*=r,e.elements[2]*=r,e.elements[4]*=o,e.elements[5]*=o,e.elements[6]*=o,e.elements[8]*=c,e.elements[9]*=c,e.elements[10]*=c,i.setFromRotationMatrix(e),n.x=a,n.y=s,n.z=h,this}}(),makeFrustum:function(t,e,r,i,n,o){var a=this.elements;return a[0]=2*n/(e-t),a[4]=0,a[8]=(e+t)/(e-t),a[12]=0,a[1]=0,a[5]=2*n/(i-r),a[9]=(i+r)/(i-r),a[13]=0,a[2]=0,a[6]=0,a[10]=-(o+n)/(o-n),a[14]=-2*o*n/(o-n),a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(t,e,r,i){var n=-(t=r*Math.tan(THREE.Math.degToRad(.5*t)));return this.makeFrustum(n*e,t*e,n,t,r,i)},makeOrthographic:function(t,e,r,i,n,o){var a=this.elements,s=e-t,h=r-i,c=o-n;return a[0]=2/s,a[4]=0,a[8]=0,a[12]=-(e+t)/s,a[1]=0,a[5]=2/h,a[9]=0,a[13]=-(r+i)/h,a[2]=0,a[6]=0,a[10]=-2/c,a[14]=-(o+n)/c,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){var e=this.elements;t=t.elements;for(var r=0;16>r;r++)if(e[r]!==t[r])return!1;return!0},fromArray:function(t){return this.elements.set(t),this},toArray:function(){var t=this.elements;return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}},THREE.Ray=function(t,e){this.origin=void 0!==t?t:new THREE.Vector3,this.direction=void 0!==e?e:new THREE.Vector3},THREE.Ray.prototype={constructor:THREE.Ray,set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return(e||new THREE.Vector3).copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){this.direction.copy(t).sub(this.origin).normalize()},recast:function(){var t=new THREE.Vector3;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){var r=e||new THREE.Vector3;r.subVectors(t,this.origin);var i=r.dot(this.direction);return 0>i?r.copy(this.origin):r.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new THREE.Vector3;return function(e){var r=t.subVectors(e,this.origin).dot(this.direction);return 0>r?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(r).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Vector3;return function(i,n,o,a){t.copy(i).add(n).multiplyScalar(.5),e.copy(n).sub(i).normalize(),r.copy(this.origin).sub(t);var s,h=.5*i.distanceTo(n),c=-this.direction.dot(e),l=r.dot(this.direction),u=-r.dot(e),E=r.lengthSq(),p=Math.abs(1-c*c);return 0<p?(i=c*u-l,n=c*l-u,s=h*p,0<=i?n>=-s?n<=s?(h=1/p,i*=h,n*=h,c=i*(i+c*n+2*l)+n*(c*i+n+2*u)+E):(n=h,i=Math.max(0,-(c*n+l)),c=-i*i+n*(n+2*u)+E):(n=-h,i=Math.max(0,-(c*n+l)),c=-i*i+n*(n+2*u)+E):n<=-s?(i=Math.max(0,-(-c*h+l)),n=0<i?-h:Math.min(Math.max(-h,-u),h),c=-i*i+n*(n+2*u)+E):n<=s?(i=0,n=Math.min(Math.max(-h,-u),h),c=n*(n+2*u)+E):(i=Math.max(0,-(c*h+l)),n=0<i?h:Math.min(Math.max(-h,-u),h),c=-i*i+n*(n+2*u)+E)):(n=0<c?-h:h,i=Math.max(0,-(c*n+l)),c=-i*i+n*(n+2*u)+E),o&&o.copy(this.direction).multiplyScalar(i).add(this.origin),a&&a.copy(e).multiplyScalar(n).add(t),c}}(),intersectSphere:function(){var t=new THREE.Vector3;return function(e,r){t.subVectors(e.center,this.origin);var i=t.dot(this.direction),n=t.dot(t)-i*i,o=e.radius*e.radius;return n>o?null:(o=Math.sqrt(o-n),n=i-o,i+=o,0>n&&0>i?null:0>n?this.at(i,r):this.at(n,r))}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);return 0===e?0===t.distanceToPoint(this.origin)?0:null:(t=-(this.origin.dot(t.normal)+t.constant)/e,0<=t?t:null)},intersectPlane:function(t,e){var r=this.distanceToPlane(t);return null===r?null:this.at(r,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||0>t.normal.dot(this.direction)*e},intersectBox:function(t,e){var r,i,n,o,a;i=1/this.direction.x,o=1/this.direction.y,a=1/this.direction.z;var s=this.origin;return 0<=i?(r=(t.min.x-s.x)*i,i*=t.max.x-s.x):(r=(t.max.x-s.x)*i,i*=t.min.x-s.x),0<=o?(n=(t.min.y-s.y)*o,o*=t.max.y-s.y):(n=(t.max.y-s.y)*o,o*=t.min.y-s.y),r>o||n>i?null:((n>r||r!==r)&&(r=n),(o<i||i!==i)&&(i=o),0<=a?(n=(t.min.z-s.z)*a,a*=t.max.z-s.z):(n=(t.max.z-s.z)*a,a*=t.min.z-s.z),r>a||n>i?null:((n>r||r!==r)&&(r=n),(a<i||i!==i)&&(i=a),0>i?null:this.at(0<=r?r:i,e)))},intersectsBox:function(){var t=new THREE.Vector3;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Vector3,i=new THREE.Vector3;return function(n,o,a,s,h){if(e.subVectors(o,n),r.subVectors(a,n),i.crossVectors(e,r),0<(o=this.direction.dot(i))){if(s)return null;s=1}else{if(!(0>o))return null;s=-1,o=-o}return t.subVectors(this.origin,n),0>(n=s*this.direction.dot(r.crossVectors(t,r)))?null:0>(a=s*this.direction.dot(e.cross(t)))||n+a>o?null:(n=-s*t.dot(i),0>n?null:this.at(n/o,h))}}(),applyMatrix4:function(t){return this.direction.add(this.origin).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},THREE.Sphere=function(t,e){this.center=void 0!==t?t:new THREE.Vector3,this.radius=void 0!==e?e:0},THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new THREE.Box3;return function(e,r){var i=this.center;void 0!==r?i.copy(r):t.setFromPoints(e).center(i);for(var n=0,o=0,a=e.length;o<a;o++)n=Math.max(n,i.distanceToSquared(e[o]));return this.radius=Math.sqrt(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return 0>=this.radius},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(this.center.dot(t.normal)-t.constant)<=this.radius},clampPoint:function(t,e){var r=this.center.distanceToSquared(t),i=e||new THREE.Vector3;return i.copy(t),r>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(t){return(t=t||new THREE.Box3).set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius*=t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},THREE.Frustum=function(t,e,r,i,n,o){this.planes=[void 0!==t?t:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==r?r:new THREE.Plane,void 0!==i?i:new THREE.Plane,void 0!==n?n:new THREE.Plane,void 0!==o?o:new THREE.Plane]},THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(t,e,r,i,n,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(r),a[3].copy(i),a[4].copy(n),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,r=0;6>r;r++)e[r].copy(t.planes[r]);return this},setFromMatrix:function(t){var e=this.planes;t=(m=t.elements)[0];var r=m[1],i=m[2],n=m[3],o=m[4],a=m[5],s=m[6],h=m[7],c=m[8],l=m[9],u=m[10],E=m[11],p=m[12],d=m[13],f=m[14],m=m[15];return e[0].setComponents(n-t,h-o,E-c,m-p).normalize(),e[1].setComponents(n+t,h+o,E+c,m+p).normalize(),e[2].setComponents(n+r,h+a,E+l,m+d).normalize(),e[3].setComponents(n-r,h-a,E-l,m-d).normalize(),e[4].setComponents(n-i,h-s,E-u,m-f).normalize(),e[5].setComponents(n+i,h+s,E+u,m+f).normalize(),this},intersectsObject:function(){var t=new THREE.Sphere;return function(e){var r=e.geometry;return null===r.boundingSphere&&r.computeBoundingSphere(),t.copy(r.boundingSphere),t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){var e=this.planes,r=t.center;t=-t.radius;for(var i=0;6>i;i++)if(e[i].distanceToPoint(r)<t)return!1;return!0},intersectsBox:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r){for(var i=this.planes,n=0;6>n;n++){a=i[n];t.x=0<a.normal.x?r.min.x:r.max.x,e.x=0<a.normal.x?r.max.x:r.min.x,t.y=0<a.normal.y?r.min.y:r.max.y,e.y=0<a.normal.y?r.max.y:r.min.y,t.z=0<a.normal.z?r.min.z:r.max.z,e.z=0<a.normal.z?r.max.z:r.min.z;var o=a.distanceToPoint(t),a=a.distanceToPoint(e);if(0>o&&0>a)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,r=0;6>r;r++)if(0>e[r].distanceToPoint(t))return!1;return!0}},THREE.Plane=function(t,e){this.normal=void 0!==t?t:new THREE.Vector3(1,0,0),this.constant=void 0!==e?e:0},THREE.Plane.prototype={constructor:THREE.Plane,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,r,i){return this.normal.set(t,e,r),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r,i,n){return i=t.subVectors(n,i).cross(e.subVectors(r,i)).normalize(),this.setFromNormalAndCoplanarPoint(i,r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var r=this.distanceToPoint(t);return(e||new THREE.Vector3).copy(this.normal).multiplyScalar(r)},intersectLine:function(){var t=new THREE.Vector3;return function(e,r){var i=r||new THREE.Vector3,n=e.delta(t),o=this.normal.dot(n);return 0!==o?(o=-(e.start.dot(this.normal)+this.constant)/o,0>o||1<o?void 0:i.copy(n).multiplyScalar(o).add(e.start)):0===this.distanceToPoint(e.start)?i.copy(e.start):void 0}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start);return t=this.distanceToPoint(t.end),0>e&&0<t||0>t&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return(t||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Matrix3;return function(i,n){var o=n||r.getNormalMatrix(i),o=t.copy(this.normal).applyMatrix3(o),a=this.coplanarPoint(e);return a.applyMatrix4(i),this.setFromNormalAndCoplanarPoint(o,a),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},THREE.Math={generateUUID:function(){var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=Array(36),i=0;return function(){for(var n=0;36>n;n++)8===n||13===n||18===n||23===n?r[n]="-":14===n?r[n]="4":(2>=i&&(i=33554432+16777216*Math.random()|0),t=15&i,i>>=4,r[n]=e[19===n?3&t|8:t]);return r.join("")}}(),clamp:function(t,e,r){return Math.max(e,Math.min(r,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,r,i,n){return i+(t-e)*(n-i)/(r-e)},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},random16:function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(){var t=Math.PI/180;return function(e){return e*t}}(),radToDeg:function(){var t=180/Math.PI;return function(e){return e*t}}(),isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}},THREE.Spline=function(t){function e(t,e,r,i,n,o,a){return t=.5*(r-t),i=.5*(i-e),(2*(e-r)+t+i)*a+(-3*(e-r)-2*t-i)*o+t*n+e}this.points=t;var r,i,n,o,a,s,h,c,l,u=[],E={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;e<t.length;e++)this.points[e]={x:t[e][0],y:t[e][1],z:t[e][2]}},this.getPoint=function(t){return r=(this.points.length-1)*t,i=Math.floor(r),n=r-i,u[0]=0===i?i:i-1,u[1]=i,u[2]=i>this.points.length-2?this.points.length-1:i+1,u[3]=i>this.points.length-3?this.points.length-1:i+2,s=this.points[u[0]],h=this.points[u[1]],c=this.points[u[2]],l=this.points[u[3]],o=n*n,a=n*o,E.x=e(s.x,h.x,c.x,l.x,n,o,a),E.y=e(s.y,h.y,c.y,l.y,n,o,a),E.z=e(s.z,h.z,c.z,l.z,n,o,a),E},this.getControlPointsArray=function(){var t,e,r=this.points.length,i=[];for(t=0;t<r;t++)e=this.points[t],i[t]=[e.x,e.y,e.z];return i},this.getLength=function(t){var e,r,i,n=e=e=0,o=new THREE.Vector3,a=new THREE.Vector3,s=[],h=0;for(s[0]=0,t||(t=100),r=this.points.length*t,o.copy(this.points[0]),t=1;t<r;t++)e=t/r,i=this.getPoint(e),a.copy(i),h+=a.distanceTo(o),o.copy(i),e*=this.points.length-1,(e=Math.floor(e))!==n&&(s[e]=h,n=e);return s[s.length]=h,{chunks:s,total:h}},this.reparametrizeByArcLength=function(t){var e,r,i,n,o,a,s=[],h=new THREE.Vector3,c=this.getLength();for(s.push(h.copy(this.points[0]).clone()),e=1;e<this.points.length;e++){for(r=c.chunks[e]-c.chunks[e-1],a=Math.ceil(t*r/c.total),n=(e-1)/(this.points.length-1),o=e/(this.points.length-1),r=1;r<a-1;r++)i=n+1/a*r*(o-n),i=this.getPoint(i),s.push(h.copy(i).clone());s.push(h.copy(this.points[e]).clone())}this.points=s}},THREE.Triangle=function(t,e,r){this.a=void 0!==t?t:new THREE.Vector3,this.b=void 0!==e?e:new THREE.Vector3,this.c=void 0!==r?r:new THREE.Vector3},THREE.Triangle.normal=function(){var t=new THREE.Vector3;return function(e,r,i,n){return(n=n||new THREE.Vector3).subVectors(i,r),t.subVectors(e,r),n.cross(t),e=n.lengthSq(),0<e?n.multiplyScalar(1/Math.sqrt(e)):n.set(0,0,0)}}(),THREE.Triangle.barycoordFromPoint=function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Vector3;return function(i,n,o,a,s){t.subVectors(a,n),e.subVectors(o,n),r.subVectors(i,n),i=t.dot(t),n=t.dot(e),o=t.dot(r);var h=e.dot(e);a=e.dot(r);var c=i*h-n*n;return s=s||new THREE.Vector3,0===c?s.set(-2,-1,-1):(c=1/c,h=(h*o-n*a)*c,i=(i*a-n*o)*c,s.set(1-h-i,i,h))}}(),THREE.Triangle.containsPoint=function(){var t=new THREE.Vector3;return function(e,r,i,n){return 0<=(e=THREE.Triangle.barycoordFromPoint(e,r,i,n,t)).x&&0<=e.y&&1>=e.x+e.y}}(),THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this},setFromPointsAndIndices:function(t,e,r,i){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){return(t||new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return THREE.Triangle.normal(this.a,this.b,this.c,t)},plane:function(t){return(t||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return THREE.Triangle.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return THREE.Triangle.containsPoint(t,this.a,this.b,this.c)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},THREE.Interpolant=function(t,e,r,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(r),this.sampleValues=e,this.valueSize=r},THREE.Interpolant.prototype={constructor:THREE.Interpolant,evaluate:function(t){var e=this.parameterPositions,r=this._cachedIndex,i=e[r],n=e[r-1];t:{e:{r:{i:if(!(t<i)){for(var o=r+2;;){if(void 0===i){if(t<n)break i;return this._cachedIndex=r=e.length,this.afterEnd_(r-1,t,n)}if(r===o)break;if(n=i,i=e[++r],t<i)break e}i=e.length;break r}if(t>=n)break t;for(t<(o=e[1])&&(r=2,n=o),o=r-2;;){if(void 0===n)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(r===o)break;if(i=n,n=e[--r-1],t>=n)break e}i=r,r=0}for(;r<i;)n=r+i>>>1,t<e[n]?i=n:r=n+1;if(i=e[r],void 0===(n=e[r-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return this._cachedIndex=r=e.length,this.afterEnd_(r-1,n,t)}this._cachedIndex=r,this.intervalChanged_(r,n,i)}return this.interpolate_(r,n,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){var e=this.resultBuffer,r=this.sampleValues,i=this.valueSize;t*=i;for(var n=0;n!==i;++n)e[n]=r[t+n];return e},interpolate_:function(t,e,r,i){throw Error("call to abstract method")},intervalChanged_:function(t,e,r){}},Object.assign(THREE.Interpolant.prototype,{beforeStart_:THREE.Interpolant.prototype.copySampleValue_,afterEnd_:THREE.Interpolant.prototype.copySampleValue_}),THREE.CubicInterpolant=function(t,e,r,i){THREE.Interpolant.call(this,t,e,r,i),this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0},THREE.CubicInterpolant.prototype=Object.assign(Object.create(THREE.Interpolant.prototype),{constructor:THREE.CubicInterpolant,DefaultSettings_:{endingStart:THREE.ZeroCurvatureEnding,endingEnd:THREE.ZeroCurvatureEnding},intervalChanged_:function(t,e,r){var i=this.parameterPositions,n=t-2,o=t+1,a=i[n],s=i[o];if(void 0===a)switch(this.getSettings_().endingStart){case THREE.ZeroSlopeEnding:n=t,a=2*e-r;break;case THREE.WrapAroundEnding:a=e+i[n=i.length-2]-i[n+1];break;default:n=t,a=r}if(void 0===s)switch(this.getSettings_().endingEnd){case THREE.ZeroSlopeEnding:o=t,s=2*r-e;break;case THREE.WrapAroundEnding:o=1,s=r+i[1]-i[0];break;default:o=t-1,s=e}t=.5*(r-e),i=this.valueSize,this._weightPrev=t/(e-a),this._weightNext=t/(s-r),this._offsetPrev=n*i,this._offsetNext=o*i},interpolate_:function(t,e,r,i){var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(t*=a)-a,h=this._offsetPrev,c=this._offsetNext,l=this._weightPrev,u=this._weightNext,E=(r-e)/(i-e);for(e=-l*(i=(r=E*E)*E)+2*l*r-l*E,l=(1+l)*i+(-1.5-2*l)*r+(-.5+l)*E+1,E=(-1-u)*i+(1.5+u)*r+.5*E,u=u*i-u*r,r=0;r!==a;++r)n[r]=e*o[h+r]+l*o[s+r]+E*o[t+r]+u*o[c+r];return n}}),THREE.DiscreteInterpolant=function(t,e,r,i){THREE.Interpolant.call(this,t,e,r,i)},THREE.DiscreteInterpolant.prototype=Object.assign(Object.create(THREE.Interpolant.prototype),{constructor:THREE.DiscreteInterpolant,interpolate_:function(t,e,r,i){return this.copySampleValue_(t-1)}}),THREE.LinearInterpolant=function(t,e,r,i){THREE.Interpolant.call(this,t,e,r,i)},THREE.LinearInterpolant.prototype=Object.assign(Object.create(THREE.Interpolant.prototype),{constructor:THREE.LinearInterpolant,interpolate_:function(t,e,r,i){var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(t*=a)-a;for(r=1-(e=(r-e)/(i-e)),i=0;i!==a;++i)n[i]=o[s+i]*r+o[t+i]*e;return n}}),THREE.QuaternionLinearInterpolant=function(t,e,r,i){THREE.Interpolant.call(this,t,e,r,i)},THREE.QuaternionLinearInterpolant.prototype=Object.assign(Object.create(THREE.Interpolant.prototype),{constructor:THREE.QuaternionLinearInterpolant,interpolate_:function(t,e,r,i){var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize;for(e=(r-e)/(i-e),r=(t*=a)+a;t!==r;t+=4)THREE.Quaternion.slerpFlat(n,0,o,t-a,o,t,e);return n}}),THREE.Clock=function(t){this.autoStart=void 0===t||t,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1},THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=performance.now(),this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){e=0;if(this.autoStart&&!this.running&&this.start(),this.running){var t=performance.now(),e=.001*(t-this.oldTime);this.oldTime=t,this.elapsedTime+=e}return e}},THREE.EventDispatcher=function(){},THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(t){t.addEventListener=THREE.EventDispatcher.prototype.addEventListener,t.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener,t.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener,t.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[t]&&(r[t]=[]),-1===r[t].indexOf(e)&&r[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[t]&&-1!==r[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var r=this._listeners[t];if(void 0!==r){var i=r.indexOf(e);-1!==i&&r.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var r=[],i=e.length,n=0;n<i;n++)r[n]=e[n];for(n=0;n<i;n++)r[n].call(this,t)}}}},THREE.Layers=function(){this.mask=1},THREE.Layers.prototype={constructor:THREE.Layers,set:function(t){this.mask=1<<t},enable:function(t){this.mask|=1<<t},toggle:function(t){this.mask^=1<<t},disable:function(t){this.mask&=~(1<<t)},test:function(t){return 0!=(this.mask&t.mask)}},function(t){function e(t,e){return t.distance-e.distance}function r(t,e,i,n){if(!1!==t.visible&&(t.raycast(e,i),!0===n)){n=0;for(var o=(t=t.children).length;n<o;n++)r(t[n],e,i,!0)}}t.Raycaster=function(e,r,i,n){this.ray=new t.Ray(e,r),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})},t.Raycaster.prototype={constructor:t.Raycaster,linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(e,r){r instanceof t.PerspectiveCamera?(this.ray.origin.setFromMatrixPosition(r.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(r).sub(this.ray.origin).normalize()):r instanceof t.OrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(r),this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,i){var n=[];return r(t,this,n,i),n.sort(e),n},intersectObjects:function(t,i){var n=[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var o=0,a=t.length;o<a;o++)r(t[o],this,n,i);return n.sort(e),n}}}(THREE),THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=THREE.Object3D.DefaultUp.clone();var t=new THREE.Vector3,e=new THREE.Euler,r=new THREE.Quaternion,i=new THREE.Vector3(1,1,1);e.onChange(function(){r.setFromEuler(e,!1)}),r.onChange(function(){e.setFromQuaternion(r,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:t},rotation:{enumerable:!0,value:e},quaternion:{enumerable:!0,value:r},scale:{enumerable:!0,value:i},modelViewMatrix:{value:new THREE.Matrix4},normalMatrix:{value:new THREE.Matrix3}}),this.rotationAutoUpdate=!0,this.matrix=new THREE.Matrix4,this.matrixWorld=new THREE.Matrix4,this.matrixAutoUpdate=THREE.Object3D.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new THREE.Layers,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0),THREE.Object3D.DefaultMatrixAutoUpdate=!0,THREE.Object3D.prototype={constructor:THREE.Object3D,applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new THREE.Quaternion;return function(e,r){return t.setFromAxisAngle(e,r),this.quaternion.multiply(t),this}}(),rotateX:function(){var t=new THREE.Vector3(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new THREE.Vector3(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new THREE.Vector3(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new THREE.Vector3;return function(e,r){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(r)),this}}(),translateX:function(){var t=new THREE.Vector3(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new THREE.Vector3(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new THREE.Vector3(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new THREE.Matrix4;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new THREE.Matrix4;return function(e){t.lookAt(e,this.position,this.up),this.quaternion.setFromRotationMatrix(t)}}(),add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t instanceof THREE.Object3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(1<arguments.length)for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);-1!==(e=this.children.indexOf(t))&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(e,1))},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var r=0,i=this.children.length;r<i;r++){var n=this.children[r].getObjectByProperty(t,e);if(void 0!==n)return n}},getWorldPosition:function(t){return t=t||new THREE.Vector3,this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r){return r=r||new THREE.Quaternion,this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,r,e),r}}(),getWorldRotation:function(){var t=new THREE.Quaternion;return function(e){return e=e||new THREE.Euler,this.getWorldQuaternion(t),e.setFromQuaternion(t,this.rotation.order,!1)}}(),getWorldScale:function(){var t=new THREE.Vector3,e=new THREE.Quaternion;return function(r){return r=r||new THREE.Vector3,this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,r),r}}(),getWorldDirection:function(){var t=new THREE.Quaternion;return function(e){return e=e||new THREE.Vector3,this.getWorldQuaternion(t),e.set(0,0,1).applyQuaternion(t)}}(),raycast:function(){},traverse:function(t){t(this);for(var e=this.children,r=0,i=e.length;r<i;r++)e[r].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,r=0,i=e.length;r<i;r++)e[r].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==t||(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=0,r=this.children.length;e<r;e++)this.children[e].updateMatrixWorld(t)},toJSON:function(t){function e(t){var e,r=[];for(e in t){var i=t[e];delete i.metadata,r.push(i)}return r}var r={};(n=void 0===t)&&(t={geometries:{},materials:{},textures:{},images:{}},r.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var i={};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),i.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===t.geometries[this.geometry.uuid]&&(t.geometries[this.geometry.uuid]=this.geometry.toJSON(t)),i.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===t.materials[this.material.uuid]&&(t.materials[this.material.uuid]=this.material.toJSON(t)),i.material=this.material.uuid),0<this.children.length){i.children=[];for(o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(t).object)}if(n){var n=e(t.geometries),o=e(t.materials),a=e(t.textures);t=e(t.images),0<n.length&&(r.geometries=n),0<o.length&&(r.materials=o),0<a.length&&(r.textures=a),0<t.length&&(r.images=t)}return r.object=i,r},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.rotationAutoUpdate=t.rotationAutoUpdate,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var r=0;r<t.children.length;r++)this.add(t.children[r].clone());return this}},THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype),THREE.Object3DIdCount=0,THREE.Face3=function(t,e,r,i,n,o){this.a=t,this.b=e,this.c=r,this.normal=i instanceof THREE.Vector3?i:new THREE.Vector3,this.vertexNormals=Array.isArray(i)?i:[],this.color=n instanceof THREE.Color?n:new THREE.Color,this.vertexColors=Array.isArray(n)?n:[],this.materialIndex=void 0!==o?o:0},THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,r=t.vertexNormals.length;e<r;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,r=t.vertexColors.length;e<r;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}},THREE.BufferAttribute=function(t,e){this.uuid=THREE.Math.generateUUID(),this.array=t,this.itemSize=e,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0},THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get count(){return this.array.length/this.itemSize},set needsUpdate(t){!0===t&&this.version++},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.itemSize,r*=e.itemSize;for(var i=0,n=this.itemSize;i<n;i++)this.array[t+i]=e.array[r+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new THREE.Color),e[r++]=o.r,e[r++]=o.g,e[r++]=o.b}return this},copyIndicesArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];e[r++]=o.a,e[r++]=o.b,e[r++]=o.c}return this},copyVector2sArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new THREE.Vector2),e[r++]=o.x,e[r++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new THREE.Vector3),e[r++]=o.x,e[r++]=o.y,e[r++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new THREE.Vector4),e[r++]=o.x,e[r++]=o.y,e[r++]=o.z,e[r++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this},setXYZ:function(t,e,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this},setXYZW:function(t,e,r,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this.array[t+3]=n,this},clone:function(){return(new this.constructor).copy(this)}},THREE.Int8Attribute=function(t,e){return new THREE.BufferAttribute(new Int8Array(t),e)},THREE.Uint8Attribute=function(t,e){return new THREE.BufferAttribute(new Uint8Array(t),e)},THREE.Uint8ClampedAttribute=function(t,e){return new THREE.BufferAttribute(new Uint8ClampedArray(t),e)},THREE.Int16Attribute=function(t,e){return new THREE.BufferAttribute(new Int16Array(t),e)},THREE.Uint16Attribute=function(t,e){return new THREE.BufferAttribute(new Uint16Array(t),e)},THREE.Int32Attribute=function(t,e){return new THREE.BufferAttribute(new Int32Array(t),e)},THREE.Uint32Attribute=function(t,e){return new THREE.BufferAttribute(new Uint32Array(t),e)},THREE.Float32Attribute=function(t,e){return new THREE.BufferAttribute(new Float32Array(t),e)},THREE.Float64Attribute=function(t,e){return new THREE.BufferAttribute(new Float64Array(t),e)},THREE.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new THREE.BufferAttribute(t,e).setDynamic(!0)},THREE.InstancedBufferAttribute=function(t,e,r){THREE.BufferAttribute.call(this,t,e),this.meshPerAttribute=r||1},THREE.InstancedBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype),THREE.InstancedBufferAttribute.prototype.constructor=THREE.InstancedBufferAttribute,THREE.InstancedBufferAttribute.prototype.copy=function(t){return THREE.BufferAttribute.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},THREE.InterleavedBuffer=function(t,e){this.uuid=THREE.Math.generateUUID(),this.array=t,this.stride=e,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0},THREE.InterleavedBuffer.prototype={constructor:THREE.InterleavedBuffer,get length(){return this.array.length},get count(){return this.array.length/this.stride},set needsUpdate(t){!0===t&&this.version++},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.stride,r*=e.stride;for(var i=0,n=this.stride;i<n;i++)this.array[t+i]=e.array[r+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)}},THREE.InstancedInterleavedBuffer=function(t,e,r){THREE.InterleavedBuffer.call(this,t,e),this.meshPerAttribute=r||1},THREE.InstancedInterleavedBuffer.prototype=Object.create(THREE.InterleavedBuffer.prototype),THREE.InstancedInterleavedBuffer.prototype.constructor=THREE.InstancedInterleavedBuffer,THREE.InstancedInterleavedBuffer.prototype.copy=function(t){return THREE.InterleavedBuffer.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},THREE.InterleavedBufferAttribute=function(t,e,r){this.uuid=THREE.Math.generateUUID(),this.data=t,this.itemSize=e,this.offset=r},THREE.InterleavedBufferAttribute.prototype={constructor:THREE.InterleavedBufferAttribute,get length(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length},get count(){return this.data.count},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this},setXYZ:function(t,e,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this},setXYZW:function(t,e,r,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this.data.array[t+3]=n,this}},THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1},THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(t){for(var e=(new THREE.Matrix3).getNormalMatrix(t),r=0,i=this.vertices.length;r<i;r++)this.vertices[r].applyMatrix4(t);for(r=0,i=this.faces.length;r<i;r++){(t=this.faces[r]).normal.applyMatrix3(e).normalize();for(var n=0,o=t.vertexNormals.length;n<o;n++)t.vertexNormals[n].applyMatrix3(e).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0},rotateX:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeTranslation(e,r,i),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeScale(e,r,i),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new THREE.Object3D),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){function e(t,e,i){var n=void 0!==a?[l[t].clone(),l[e].clone(),l[i].clone()]:[],o=void 0!==s?[r.colors[t].clone(),r.colors[e].clone(),r.colors[i].clone()]:[],n=new THREE.Face3(t,e,i,n,o);r.faces.push(n),void 0!==h&&r.faceVertexUvs[0].push([u[t].clone(),u[e].clone(),u[i].clone()]),void 0!==c&&r.faceVertexUvs[1].push([E[t].clone(),E[e].clone(),E[i].clone()])}var r=this,i=null!==t.index?t.index.array:void 0,n=t.attributes,o=n.position.array,a=void 0!==n.normal?n.normal.array:void 0,s=void 0!==n.color?n.color.array:void 0,h=void 0!==n.uv?n.uv.array:void 0,c=void 0!==n.uv2?n.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],E=[],p=n=0;n<o.length;n+=3,p+=2)r.vertices.push(new THREE.Vector3(o[n],o[n+1],o[n+2])),void 0!==a&&l.push(new THREE.Vector3(a[n],a[n+1],a[n+2])),void 0!==s&&r.colors.push(new THREE.Color(s[n],s[n+1],s[n+2])),void 0!==h&&u.push(new THREE.Vector2(h[p],h[p+1])),void 0!==c&&E.push(new THREE.Vector2(c[p],c[p+1]));if(void 0!==i)if(0<(o=t.groups).length)for(n=0;n<o.length;n++)for(var p=o[n],d=p.start,f=p.count,p=d,d=d+f;p<d;p+=3)e(i[p],i[p+1],i[p+2]);else for(n=0;n<i.length;n+=3)e(i[n],i[n+1],i[n+2]);else for(n=0;n<o.length/3;n+=3)e(n,n+1,n+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.translate(t.x,t.y,t.z),t},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=0===(e=this.boundingSphere.radius)?1:1/e,r=new THREE.Matrix4;return r.set(e,0,0,-e*t.x,0,e,0,-e*t.y,0,0,e,-e*t.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var t=new THREE.Vector3,e=new THREE.Vector3,r=0,i=this.faces.length;r<i;r++){var n=this.faces[r],o=this.vertices[n.a],a=this.vertices[n.b];t.subVectors(this.vertices[n.c],a),e.subVectors(o,a),t.cross(e),t.normalize(),n.normal.copy(t)}},computeVertexNormals:function(t){void 0===t&&(t=!0);var e,r,i;for(i=Array(this.vertices.length),e=0,r=this.vertices.length;e<r;e++)i[e]=new THREE.Vector3;if(t){var n,o,a,s=new THREE.Vector3,h=new THREE.Vector3;for(t=0,e=this.faces.length;t<e;t++)r=this.faces[t],n=this.vertices[r.a],o=this.vertices[r.b],a=this.vertices[r.c],s.subVectors(a,o),h.subVectors(n,o),s.cross(h),i[r.a].add(s),i[r.b].add(s),i[r.c].add(s)}else for(t=0,e=this.faces.length;t<e;t++)r=this.faces[t],i[r.a].add(r.normal),i[r.b].add(r.normal),i[r.c].add(r.normal);for(e=0,r=this.vertices.length;e<r;e++)i[e].normalize();for(t=0,e=this.faces.length;t<e;t++)r=this.faces[t],n=r.vertexNormals,3===n.length?(n[0].copy(i[r.a]),n[1].copy(i[r.b]),n[2].copy(i[r.c])):(n[0]=i[r.a].clone(),n[1]=i[r.b].clone(),n[2]=i[r.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,r,i,n;for(r=0,i=this.faces.length;r<i;r++)for(n=this.faces[r],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),t=0,e=n.vertexNormals.length;t<e;t++)n.__originalVertexNormals[t]?n.__originalVertexNormals[t].copy(n.vertexNormals[t]):n.__originalVertexNormals[t]=n.vertexNormals[t].clone();var o=new THREE.Geometry;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[],n=this.morphNormals[t].faceNormals;var a,s,h=this.morphNormals[t].vertexNormals;for(r=0,i=this.faces.length;r<i;r++)a=new THREE.Vector3,s={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},n.push(a),h.push(s)}for(h=this.morphNormals[t],o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),r=0,i=this.faces.length;r<i;r++)n=this.faces[r],a=h.faceNormals[r],s=h.vertexNormals[r],a.copy(n.normal),s.a.copy(n.vertexNormals[0]),s.b.copy(n.vertexNormals[1]),s.c.copy(n.vertexNormals[2])}for(r=0,i=this.faces.length;r<i;r++)n=this.faces[r],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){for(var t=0,e=this.vertices,r=0,i=e.length;r<i;r++)0<r&&(t+=e[r].distanceTo(e[r-1])),this.lineDistances[r]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,r){if(!1==t instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);else{var i,n=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,h=t.faces,c=this.faceVertexUvs[0];t=t.faceVertexUvs[0],void 0===r&&(r=0),void 0!==e&&(i=(new THREE.Matrix3).getNormalMatrix(e));for(var l=0,u=a.length;l<u;l++){var E=a[l].clone();void 0!==e&&E.applyMatrix4(e),o.push(E)}for(l=0,u=h.length;l<u;l++){var p,d=(a=h[l]).vertexNormals,f=a.vertexColors;for((E=new THREE.Face3(a.a+n,a.b+n,a.c+n)).normal.copy(a.normal),void 0!==i&&E.normal.applyMatrix3(i).normalize(),e=0,o=d.length;e<o;e++)p=d[e].clone(),void 0!==i&&p.applyMatrix3(i).normalize(),E.vertexNormals.push(p);for(E.color.copy(a.color),e=0,o=f.length;e<o;e++)p=f[e],E.vertexColors.push(p.clone());E.materialIndex=a.materialIndex+r,s.push(E)}for(l=0,u=t.length;l<u;l++)if(r=t[l],i=[],void 0!==r){for(e=0,o=r.length;e<o;e++)i.push(r[e].clone());c.push(i)}}},mergeMesh:function(t){!1==t instanceof THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t):(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix))},mergeVertices:function(){var t,e,r,i={},n=[],o=[],a=Math.pow(10,4);for(e=0,r=this.vertices.length;e<r;e++)t=this.vertices[e],t=Math.round(t.x*a)+"_"+Math.round(t.y*a)+"_"+Math.round(t.z*a),void 0===i[t]?(i[t]=e,n.push(this.vertices[e]),o[e]=n.length-1):o[e]=o[i[t]];for(i=[],e=0,r=this.faces.length;e<r;e++)for(a=this.faces[e],a.a=o[a.a],a.b=o[a.b],a.c=o[a.c],a=[a.a,a.b,a.c],t=0;3>t;t++)if(a[t]===a[(t+1)%3]){i.push(e);break}for(e=i.length-1;0<=e;e--)for(a=i[e],this.faces.splice(a,1),o=0,r=this.faceVertexUvs.length;o<r;o++)this.faceVertexUvs[o].splice(a,1);return e=this.vertices.length-n.length,this.vertices=n,e},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,r=0;r<e;r++)t[r]._id=r;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var i,n,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];for(o&&o.length===e&&(i=[]),a&&a.length===e&&(n=[]),r=0;r<e;r++){var s=t[r]._id;i&&i.push(o[s]),n&&n.push(a[s])}i&&(this.faceVertexUvs[0]=i),n&&(this.faceVertexUvs[1]=n)},toJSON:function(){function t(t,e,r){return r?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==c[e]?c[e]:(c[e]=h.length/3,h.push(t.x,t.y,t.z),c[e])}function r(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==u[e]?u[e]:(u[e]=l.length,l.push(t.getHex()),u[e])}function i(t){var e=t.x.toString()+t.y.toString();return void 0!==p[e]?p[e]:(p[e]=E.length/2,E.push(t.x,t.y),p[e])}var n={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),void 0!==this.parameters){var o,a=this.parameters;for(o in a)void 0!==a[o]&&(n[o]=a[o]);return n}for(a=[],o=0;o<this.vertices.length;o++){s=this.vertices[o];a.push(s.x,s.y,s.z)}var s=[],h=[],c={},l=[],u={},E=[],p={};for(o=0;o<this.faces.length;o++){var d=this.faces[o],f=void 0!==this.faceVertexUvs[0][o],m=0<d.normal.length(),T=0<d.vertexNormals.length,g=1!==d.color.r||1!==d.color.g||1!==d.color.b,v=0<d.vertexColors.length,y=t(y=t(y=t(y=t(y=t(y=t(y=t(y=t(y=0,0,0),1,!0),2,!1),3,f),4,m),5,T),6,g),7,v);s.push(y),s.push(d.a,d.b,d.c),s.push(d.materialIndex),f&&(f=this.faceVertexUvs[0][o],s.push(i(f[0]),i(f[1]),i(f[2]))),m&&s.push(e(d.normal)),T&&(m=d.vertexNormals,s.push(e(m[0]),e(m[1]),e(m[2]))),g&&s.push(r(d.color)),v&&(d=d.vertexColors,s.push(r(d[0]),r(d[1]),r(d[2])))}return n.data={},n.data.vertices=a,n.data.normals=h,0<l.length&&(n.data.colors=l),0<E.length&&(n.data.uvs=[E]),n.data.faces=s,n},clone:function(){return(new THREE.Geometry).copy(this)},copy:function(t){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]];for(var e=t.vertices,r=0,i=e.length;r<i;r++)this.vertices.push(e[r].clone());for(r=0,i=(e=t.faces).length;r<i;r++)this.faces.push(e[r].clone());for(r=0,i=t.faceVertexUvs.length;r<i;r++){e=t.faceVertexUvs[r],void 0===this.faceVertexUvs[r]&&(this.faceVertexUvs[r]=[]);for(var n=0,o=e.length;n<o;n++){for(var a=e[n],s=[],h=0,c=a.length;h<c;h++)s.push(a[h].clone());this.faceVertexUvs[r].push(s)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype),THREE.GeometryIdCount=0,THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="DirectGeometry",this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1},THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},computeGroups:function(t){var e,r,i=[];t=t.faces;for(var n=0;n<t.length;n++){var o=t[n];o.materialIndex!==r&&(r=o.materialIndex,void 0!==e&&(e.count=3*n-e.start,i.push(e)),e={start:3*n,materialIndex:r})}void 0!==e&&(e.count=3*n-e.start,i.push(e)),this.groups=i},fromGeometry:function(t){var e,r=t.faces,i=t.vertices,n=t.faceVertexUvs,o=n[0]&&0<n[0].length,a=n[1]&&0<n[1].length,s=t.morphTargets,h=s.length;if(0<h){e=[];for(m=0;m<h;m++)e[m]=[];this.morphTargets.position=e}var c,l=t.morphNormals,u=l.length;if(0<u){for(c=[],m=0;m<u;m++)c[m]=[];this.morphTargets.normal=c}for(var E=t.skinIndices,p=t.skinWeights,d=E.length===i.length,f=p.length===i.length,m=0;m<r.length;m++){var T=r[m];this.vertices.push(i[T.a],i[T.b],i[T.c]);var g=T.vertexNormals;for(3===g.length?this.normals.push(g[0],g[1],g[2]):(g=T.normal,this.normals.push(g,g,g)),3===(g=T.vertexColors).length?this.colors.push(g[0],g[1],g[2]):(g=T.color,this.colors.push(g,g,g)),!0===o&&(g=n[0][m],void 0!==g?this.uvs.push(g[0],g[1],g[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",m),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2))),!0===a&&(g=n[1][m],void 0!==g?this.uvs2.push(g[0],g[1],g[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",m),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2))),g=0;g<h;g++){var v=s[g].vertices;e[g].push(v[T.a],v[T.b],v[T.c])}for(g=0;g<u;g++)v=l[g].vertexNormals[m],c[g].push(v.a,v.b,v.c);d&&this.skinIndices.push(E[T.a],E[T.b],E[T.c]),f&&this.skinWeights.push(p[T.a],p[T.b],p[T.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype),THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingSphere=this.boundingBox=null,this.drawRange={start:0,count:1/0}},THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,getIndex:function(){return this.index},setIndex:function(t){this.index=t},addAttribute:function(t,e,r){if(!1==e instanceof THREE.BufferAttribute&&!1==e instanceof THREE.InterleavedBufferAttribute)console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new THREE.BufferAttribute(e,r));else{if("index"!==t)return this.attributes[t]=e,this;console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e)}},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,r){this.groups.push({start:t,count:e,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToVector3Array(e.array),e.needsUpdate=!0),void 0!==(e=this.attributes.normal)&&((new THREE.Matrix3).getNormalMatrix(t).applyToVector3Array(e.array),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},rotateX:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeTranslation(e,r,i),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeScale(e,r,i),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new THREE.Object3D),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t instanceof THREE.Points||t instanceof THREE.Line){t=new THREE.Float32Attribute(3*e.vertices.length,3);var r=new THREE.Float32Attribute(3*e.colors.length,3);this.addAttribute("position",t.copyVector3sArray(e.vertices)),this.addAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length&&(t=new THREE.Float32Attribute(e.lineDistances.length,1),this.addAttribute("lineDistance",t.copyArray(e.lineDistances))),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t instanceof THREE.Mesh&&e instanceof THREE.Geometry&&this.fromGeometry(e);return this},updateFromObject:function(t){var e=t.geometry;if(t instanceof THREE.Mesh){var r=e.__directGeometry;if(void 0===r)return this.fromGeometry(e);r.verticesNeedUpdate=e.verticesNeedUpdate,r.normalsNeedUpdate=e.normalsNeedUpdate,r.colorsNeedUpdate=e.colorsNeedUpdate,r.uvsNeedUpdate=e.uvsNeedUpdate,r.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=r}return!0===e.verticesNeedUpdate&&(void 0!==(r=this.attributes.position)&&(r.copyVector3sArray(e.vertices),r.needsUpdate=!0),e.verticesNeedUpdate=!1),!0===e.normalsNeedUpdate&&(void 0!==(r=this.attributes.normal)&&(r.copyVector3sArray(e.normals),r.needsUpdate=!0),e.normalsNeedUpdate=!1),!0===e.colorsNeedUpdate&&(void 0!==(r=this.attributes.color)&&(r.copyColorsArray(e.colors),r.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(void 0!==(r=this.attributes.uv)&&(r.copyVector2sArray(e.uvs),r.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(void 0!==(r=this.attributes.lineDistance)&&(r.copyArray(e.lineDistances),r.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new THREE.DirectGeometry).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){r=new Float32Array(3*t.vertices.length);this.addAttribute("position",new THREE.BufferAttribute(r,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(r=new Float32Array(3*t.normals.length),this.addAttribute("normal",new THREE.BufferAttribute(r,3).copyVector3sArray(t.normals))),0<t.colors.length&&(r=new Float32Array(3*t.colors.length),this.addAttribute("color",new THREE.BufferAttribute(r,3).copyColorsArray(t.colors))),0<t.uvs.length&&(r=new Float32Array(2*t.uvs.length),this.addAttribute("uv",new THREE.BufferAttribute(r,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(r=new Float32Array(2*t.uvs2.length),this.addAttribute("uv2",new THREE.BufferAttribute(r,2).copyVector2sArray(t.uvs2))),0<t.indices.length&&(r=new(65535<t.vertices.length?Uint32Array:Uint16Array)(3*t.indices.length),this.setIndex(new THREE.BufferAttribute(r,1).copyIndicesArray(t.indices))),this.groups=t.groups;for(var e in t.morphTargets){for(var r=[],i=t.morphTargets[e],n=0,o=i.length;n<o;n++){var a=i[n],s=new THREE.Float32Attribute(3*a.length,3);r.push(s.copyVector3sArray(a))}this.morphAttributes[e]=r}return 0<t.skinIndices.length&&(e=new THREE.Float32Attribute(4*t.skinIndices.length,4),this.addAttribute("skinIndex",e.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(e=new THREE.Float32Attribute(4*t.skinWeights.length,4),this.addAttribute("skinWeight",e.copyVector4sArray(t.skinWeights))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:(new THREE.Vector3,function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var t=this.attributes.position.array;t&&this.boundingBox.setFromArray(t),void 0!==t&&0!==t.length||(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}),computeBoundingSphere:function(){var t=new THREE.Box3,e=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var r=this.attributes.position.array;if(r){var i=this.boundingSphere.center;t.setFromArray(r),t.center(i);for(var n=0,o=0,a=r.length;o<a;o+=3)e.fromArray(r,o),n=Math.max(n,i.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes,r=this.groups;if(e.position){var i=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(i.length),3));else for(var n=e.normal.array,o=0,a=n.length;o<a;o++)n[o]=0;var s,h,c,n=e.normal.array,l=new THREE.Vector3,u=new THREE.Vector3,E=new THREE.Vector3,p=new THREE.Vector3,d=new THREE.Vector3;if(t){t=t.array,0===r.length&&this.addGroup(0,t.length);for(var f=0,m=r.length;f<m;++f)for(o=r[f],a=o.start,s=o.count,o=a,a+=s;o<a;o+=3)s=3*t[o+0],h=3*t[o+1],c=3*t[o+2],l.fromArray(i,s),u.fromArray(i,h),E.fromArray(i,c),p.subVectors(E,u),d.subVectors(l,u),p.cross(d),n[s]+=p.x,n[s+1]+=p.y,n[s+2]+=p.z,n[h]+=p.x,n[h+1]+=p.y,n[h+2]+=p.z,n[c]+=p.x,n[c+1]+=p.y,n[c+2]+=p.z}else for(o=0,a=i.length;o<a;o+=9)l.fromArray(i,o),u.fromArray(i,o+3),E.fromArray(i,o+6),p.subVectors(E,u),d.subVectors(l,u),p.cross(d),n[o]=p.x,n[o+1]=p.y,n[o+2]=p.z,n[o+3]=p.x,n[o+4]=p.y,n[o+5]=p.z,n[o+6]=p.x,n[o+7]=p.y,n[o+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(!1!=t instanceof THREE.BufferGeometry){void 0===e&&(e=0);var r,i=this.attributes;for(r in i)if(void 0!==t.attributes[r])for(var n=i[r].array,o=t.attributes[r],a=o.array,s=0,o=o.itemSize*e;s<a.length;s++,o++)n[o]=a[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t,e,r,i=this.attributes.normal.array,n=0,o=i.length;n<o;n+=3)t=i[n],e=i[n+1],r=i[n+2],t=1/Math.sqrt(t*t+e*e+r*r),i[n]*=t,i[n+1]*=t,i[n+2]*=t},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t,e=new THREE.BufferGeometry,r=this.index.array,i=this.attributes;for(t in i){for(var n=(o=i[t]).array,o=o.itemSize,a=new n.constructor(r.length*o),s=0,h=0,c=0,l=r.length;c<l;c++)for(var s=r[c]*o,u=0;u<o;u++)a[h++]=n[s++];e.addAttribute(t,new THREE.BufferAttribute(a,o))}return e},toJSON:function(){var t={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e,r=this.parameters;for(e in r)void 0!==r[e]&&(t[e]=r[e]);return t}t.data={attributes:{}};var i=this.index;null!==i&&(r=Array.prototype.slice.call(i.array),t.data.index={type:i.array.constructor.name,array:r}),i=this.attributes;for(e in i){var n=i[e],r=Array.prototype.slice.call(n.array);t.data.attributes[e]={itemSize:n.itemSize,type:n.array.constructor.name,array:r}}return 0<(e=this.groups).length&&(t.data.groups=JSON.parse(JSON.stringify(e))),null!==(e=this.boundingSphere)&&(t.data.boundingSphere={center:e.center.toArray(),radius:e.radius}),t},clone:function(){return(new THREE.BufferGeometry).copy(this)},copy:function(t){null!==(r=t.index)&&this.setIndex(r.clone());var e,r=t.attributes;for(e in r)this.addAttribute(e,r[e].clone());for(e=0,r=(t=t.groups).length;e<r;e++){var i=t[e];this.addGroup(i.start,i.count)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype),THREE.BufferGeometry.MaxIndex=65535,THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0},THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry,THREE.InstancedBufferGeometry.prototype.addGroup=function(t,e,r){this.groups.push({start:t,count:e,instances:r})},THREE.InstancedBufferGeometry.prototype.copy=function(t){null!==(r=t.index)&&this.setIndex(r.clone());var e,r=t.attributes;for(e in r)this.addAttribute(e,r[e].clone());for(e=0,r=(t=t.groups).length;e<r;e++){var i=t[e];this.addGroup(i.start,i.count,i.instances)}return this},THREE.EventDispatcher.prototype.apply(THREE.InstancedBufferGeometry.prototype),THREE.Uniform=function(t,e){this.type=t,this.value=e,this.dynamic=!1},THREE.Uniform.prototype={constructor:THREE.Uniform,onUpdate:function(t){return this.dynamic=!0,this.onUpdateCallback=t,this}},THREE.AnimationClip=function(t,e,r){this.name=t||THREE.Math.generateUUID(),this.tracks=r,this.duration=void 0!==e?e:-1,0>this.duration&&this.resetDuration(),this.trim(),this.optimize()},THREE.AnimationClip.prototype={constructor:THREE.AnimationClip,resetDuration:function(){for(var t=0,e=0,r=this.tracks.length;e!==r;++e)var i=this.tracks[e],t=Math.max(t,i.times[i.times.length-1]);this.duration=t},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}},Object.assign(THREE.AnimationClip,{parse:function(t){for(var e=[],r=t.tracks,i=1/(t.fps||1),n=0,o=r.length;n!==o;++n)e.push(THREE.KeyframeTrack.parse(r[n]).scale(i));return new THREE.AnimationClip(t.name,t.duration,e)},toJSON:function(t){var e=[],r=t.tracks;t={name:t.name,duration:t.duration,tracks:e};for(var i=0,n=r.length;i!==n;++i)e.push(THREE.KeyframeTrack.toJSON(r[i]));return t},CreateFromMorphTargetSequence:function(t,e,r){for(var i=e.length,n=[],o=0;o<i;o++){h=[];(s=[]).push((o+i-1)%i,o,(o+1)%i),h.push(0,1,0);var a=THREE.AnimationUtils.getKeyframeOrder(s),s=THREE.AnimationUtils.sortedArray(s,1,a),h=THREE.AnimationUtils.sortedArray(h,1,a);0===s[0]&&(s.push(i),h.push(h[0])),n.push(new THREE.NumberKeyframeTrack(".morphTargetInfluences["+e[o].name+"]",s,h).scale(1/r))}return new THREE.AnimationClip(t,-1,n)},findByName:function(t,e){for(var r=0;r<t.length;r++)if(t[r].name===e)return t[r];return null},CreateClipsFromMorphTargetSequences:function(t,e){for(var r={},i=/^([\w-]*?)([\d]+)$/,n=0,o=t.length;n<o;n++){var a=t[n],s=a.name.match(i);if(s&&1<s.length){var h=s[1];(s=r[h])||(r[h]=s=[]),s.push(a)}}i=[];for(h in r)i.push(THREE.AnimationClip.CreateFromMorphTargetSequence(h,r[h],e));return i},parseAnimation:function(t,e,r){if(!t)return console.error("  no animation in JSONLoader data"),null;r=function(t,e,r,i,n){if(0!==r.length){var o=[],a=[];THREE.AnimationUtils.flattenJSON(r,o,a,i),0!==o.length&&n.push(new t(e,o,a))}};var i=[],n=t.name||"default",o=t.length||-1,a=t.fps||30;t=t.hierarchy||[];for(var s=0;s<t.length;s++){var h=t[s].keys;if(h&&0!=h.length)if(h[0].morphTargets){for(var o={},c=0;c<h.length;c++)if(h[c].morphTargets)for(p=0;p<h[c].morphTargets.length;p++)o[h[c].morphTargets[p]]=-1;for(var l in o){for(var u=[],E=[],p=0;p!==h[c].morphTargets.length;++p){var d=h[c];u.push(d.time),E.push(d.morphTarget===l?1:0)}i.push(new THREE.NumberKeyframeTrack(".morphTargetInfluence["+l+"]",u,E))}o=o.length*(a||1)}else c=".bones["+e[s].name+"]",r(THREE.VectorKeyframeTrack,c+".position",h,"pos",i),r(THREE.QuaternionKeyframeTrack,c+".quaternion",h,"rot",i),r(THREE.VectorKeyframeTrack,c+".scale",h,"scl",i)}return 0===i.length?null:new THREE.AnimationClip(n,o,i)}}),THREE.AnimationMixer=function(t){this._root=t,this._initMemoryManager(),this.time=this._accuIndex=0,this.timeScale=1},THREE.AnimationMixer.prototype={constructor:THREE.AnimationMixer,clipAction:function(t,e){var r,i=(e||this._root).uuid,n="string"==typeof t?t:t.name,o=t!==n?t:null,a=this._actionsByClip[n];if(void 0!==a){if(void 0!==(r=a.actionByRoot[i]))return r;if(r=a.knownActions[0],o=r._clip,t!==n&&t!==o)throw Error("Different clips with the same name detected!")}return null===o?null:(a=new THREE.AnimationMixer._Action(this,o,e),this._bindAction(a,r),this._addInactiveAction(a,n,i),a)},existingAction:function(t,e){var r=(e||this._root).uuid,i=this._actionsByClip["string"==typeof t?t:t.name];return void 0!==i?i.actionByRoot[r]||null:null},stopAllAction:function(){for(var t=this._actions,e=this._nActiveActions,r=this._bindings,i=this._nActiveBindings,n=this._nActiveBindings=this._nActiveActions=0;n!==e;++n)t[n].reset();for(n=0;n!==i;++n)r[n].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,r=this._nActiveActions,i=this.time+=t,n=Math.sign(t),o=this._accuIndex^=1,a=0;a!==r;++a){var s=e[a];s.enabled&&s._update(i,t,n,o)}for(t=this._bindings,e=this._nActiveBindings,a=0;a!==e;++a)t[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions;t=t.name;var r=this._actionsByClip,i=r[t];if(void 0!==i){for(var n=0,o=(i=i.knownActions).length;n!==o;++n){var a=i[n];this._deactivateAction(a);var s=a._cacheIndex,h=e[e.length-1];a._cacheIndex=null,a._byClipCacheIndex=null,h._cacheIndex=s,e[s]=h,e.pop(),this._removeInactiveBindingsForAction(a)}delete r[t]}},uncacheRoot:function(t){t=t.uuid;var e,r=this._actionsByClip;for(e in r){var i=r[e].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}if(void 0!==(e=this._bindingsByRootAndName[t]))for(var n in e)(t=e[n]).restoreOriginalState(),this._removeInactiveBinding(t)},uncacheAction:function(t,e){var r=this.existingAction(t,e);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}},THREE.EventDispatcher.prototype.apply(THREE.AnimationMixer.prototype),THREE.AnimationMixer._Action=function(t,e,r){this._mixer=t,this._clip=e,this._localRoot=r||null,e=(t=e.tracks).length,r=Array(e);for(var i={endingStart:THREE.ZeroCurvatureEnding,endingEnd:THREE.ZeroCurvatureEnding},n=0;n!==e;++n){var o=t[n].createInterpolant(null);r[n]=o,o.settings=i}this._interpolantSettings=i,this._interpolants=r,this._propertyBindings=Array(e),this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null,this.loop=THREE.LoopRepeat,this._loopCount=-1,this._startTime=null,this.time=0,this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0},THREE.AnimationMixer._Action.prototype={constructor:THREE.AnimationMixer._Action,play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,r){if(t.fadeOut(e),this.fadeIn(e),r){r=this._clip.duration;var i=t._clip.duration,n=r/i;t.warp(1,i/r,e),this.warp(n,1,e)}return this},crossFadeTo:function(t,e,r){return t.crossFadeFrom(this,e,r)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._currentTimeScale,0,t)},warp:function(t,e,r){var i=this._mixer,n=i.time,o=this._timeScaleInterpolant,a=this.timeScale;return null===o&&(this._timeScaleInterpolant=o=i._lendControlInterpolant()),i=o.parameterPositions,o=o.sampleValues,i[0]=n,i[1]=n+r,o[0]=t/a,o[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,r,i){if(null!==(n=this._startTime)){if(0>(e=(t-n)*r)||0===r)return;this._startTime=null,e*=r}if(e*=this._updateTimeScale(t),r=this._updateTime(e),0<(t=this._updateWeight(t))){e=this._interpolants;for(var n=this._propertyBindings,o=0,a=e.length;o!==a;++o)e[o].evaluate(r),n[o].accumulate(i,t)}},_updateWeight:function(t){e=0;if(this.enabled){var e=this.weight,r=this._weightInterpolant;if(null!==r){var i=r.evaluate(t)[0],e=e*i;t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e},_updateTimeScale:function(t){e=0;if(!this.paused){var e=this.timeScale,r=this._timeScaleInterpolant;if(null!==r){e=e*r.evaluate(t)[0];t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.pause=!0:this.timeScale=e)}}return this._effectiveTimeScale=e},_updateTime:function(t){a=this.time+t;if(0===t)return a;var e=this._clip.duration,r=this.loop,i=this._loopCount,n=!1;switch(r){case THREE.LoopOnce:if(-1===i&&(this.loopCount=0,this._setEndings(!0,!0,!1)),a>=e)a=e;else{if(!(0>a))break;a=0}this.clampWhenFinished?this.pause=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:0>t?-1:1});break;case THREE.LoopPingPong:n=!0;case THREE.LoopRepeat:if(-1===i&&(0<t?(i=0,this._setEndings(!0,0===this.repetitions,n)):this._setEndings(0===this.repetitions,!0,n)),a>=e||0>a){var o=Math.floor(a/e),a=a-e*o,i=i+Math.abs(o),s=this.repetitions-i;if(0>s){this.clampWhenFinished?this.paused=!0:this.enabled=!1,a=0<t?e:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1});break}0===s?(t=0>t,this._setEndings(t,!t,n)):this._setEndings(!1,!1,n),this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}if(r===THREE.LoopPingPong&&1==(1&i))return this.time=a,e-a}return this.time=a},_setEndings:function(t,e,r){var i=this._interpolantSettings;r?(i.endingStart=THREE.ZeroSlopeEnding,i.endingEnd=THREE.ZeroSlopeEnding):(i.endingStart=t?this.zeroSlopeAtStart?THREE.ZeroSlopeEnding:THREE.ZeroCurvatureEnding:THREE.WrapAroundEnding,i.endingEnd=e?this.zeroSlopeAtEnd?THREE.ZeroSlopeEnding:THREE.ZeroCurvatureEnding:THREE.WrapAroundEnding)},_scheduleFading:function(t,e,r){var i=this._mixer,n=i.time,o=this._weightInterpolant;return null===o&&(this._weightInterpolant=o=i._lendControlInterpolant()),i=o.parameterPositions,o=o.sampleValues,i[0]=n,o[0]=e,i[1]=n+t,o[1]=r,this}},Object.assign(THREE.AnimationMixer.prototype,{_bindAction:function(t,e){var r=t._localRoot||this._root,i=t._clip.tracks,n=i.length,o=t._propertyBindings,a=t._interpolants,s=r.uuid,h=this._bindingsByRootAndName,c=h[s];for(void 0===c&&(c={},h[s]=c),h=0;h!==n;++h){var l=i[h],u=l.name,E=c[u];if(void 0===E){if(void 0!==(E=o[h])){null===E._cacheIndex&&(++E.referenceCount,this._addInactiveBinding(E,s,u));continue}++(E=new THREE.PropertyMixer(THREE.PropertyBinding.create(r,u,e&&e._propertyBindings[h].binding.parsedPath),l.ValueTypeName,l.getValueSize())).referenceCount,this._addInactiveBinding(E,s,u)}o[h]=E,a[h].resultBuffer=E.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,r=t._clip.name,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}for(r=0,i=(e=t._propertyBindings).length;r!==i;++r){var n=e[r];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,r=0,i=e.length;r!==i;++r){var n=e[r];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){return null!==(t=t._cacheIndex)&&t<this._nActiveActions},_addInactiveAction:function(t,e,r){var i=this._actions,n=this._actionsByClip,o=n[e];void 0===o?(o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,n[e]=o):(e=o.knownActions,t._byClipCacheIndex=e.length,e.push(t)),t._cacheIndex=i.length,i.push(t),o.actionByRoot[r]=t},_removeInactiveAction:function(t){var e=this._actions,r=e[e.length-1],i=t._cacheIndex;r._cacheIndex=i,e[i]=r,e.pop(),t._cacheIndex=null;var r=t._clip.name,n=(i=this._actionsByClip)[r],o=n.knownActions,a=o[o.length-1],s=t._byClipCacheIndex;a._byClipCacheIndex=s,o[s]=a,o.pop(),t._byClipCacheIndex=null,delete n.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete i[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=0,r=(t=t._propertyBindings).length;e!==r;++e){var i=t[e];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,r=t._cacheIndex,i=this._nActiveActions++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_takeBackAction:function(t){var e=this._actions,r=t._cacheIndex,i=--this._nActiveActions,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_addInactiveBinding:function(t,e,r){var i=this._bindingsByRootAndName,n=i[e],o=this._bindings;void 0===n&&(n={},i[e]=n),n[r]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,r=(i=t.binding).rootNode.uuid,i=i.path,n=this._bindingsByRootAndName,o=n[r],a=e[e.length-1];t=t._cacheIndex,a._cacheIndex=t,e[t]=a,e.pop(),delete o[i];t:{for(var s in o)break t;delete n[r]}},_lendBinding:function(t){var e=this._bindings,r=t._cacheIndex,i=this._nActiveBindings++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_takeBackBinding:function(t){var e=this._bindings,r=t._cacheIndex,i=--this._nActiveBindings,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,r=t[e];return void 0===r&&(r=new THREE.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),r.__cacheIndex=e,t[e]=r),r},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,r=t.__cacheIndex,i=--this._nActiveControlInterpolants,n=e[i];t.__cacheIndex=i,e[i]=t,n.__cacheIndex=r,e[r]=n},_controlInterpolantsResultBuffer:new Float32Array(1)}),THREE.AnimationObjectGroup=function(t){this.uuid=THREE.Math.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var r=0,i=arguments.length;r!==i;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}},THREE.AnimationObjectGroup.prototype={constructor:THREE.AnimationObjectGroup,add:function(t){for(var e=this._objects,r=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,o=this._paths,a=this._parsedPaths,s=this._bindings,h=s.length,c=0,l=arguments.length;c!==l;++c){var u=arguments[c],E=n[p=u.uuid];if(void 0===E){E=r++,n[p]=E,e.push(u);for(var p=0,d=h;p!==d;++p)s[p].push(new THREE.PropertyBinding(u,o[p],a[p]))}else if(E<i){var f=e[E],m=--i;for(n[(d=e[m]).uuid]=E,e[E]=d,n[p]=m,e[m]=u,p=0,d=h;p!==d;++p){var T=s[p],g=T[E];T[E]=T[m],void 0===g&&(g=new THREE.PropertyBinding(u,o[p],a[p])),T[m]=g}}else e[E]!==f&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=i},remove:function(t){for(var e=this._objects,r=this.nCachedObjects_,i=this._indicesByUUID,n=this._bindings,o=n.length,a=0,s=arguments.length;a!==s;++a){var h=arguments[a],c=h.uuid,l=i[c];if(void 0!==l&&l>=r){var u=r++,E=e[u];for(i[E.uuid]=l,e[l]=E,i[c]=u,e[u]=h,h=0,c=o;h!==c;++h){var p=(E=n[h])[l];E[l]=E[u],E[u]=p}}}this.nCachedObjects_=r},uncache:function(t){for(var e=this._objects,r=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,o=this._bindings,a=o.length,s=0,h=arguments.length;s!==h;++s){var c=arguments[s].uuid,l=n[c];if(void 0!==l)if(delete n[c],l<i){var u=e[c=--i],E=--r,p=e[E];for(n[u.uuid]=l,e[l]=u,n[p.uuid]=c,e[c]=p,e.pop(),u=0,p=a;u!==p;++u){var d=o[u],f=d[E];d[l]=d[c],d[c]=f,d.pop()}}else for(E=--r,p=e[E],n[p.uuid]=l,e[l]=p,e.pop(),u=0,p=a;u!==p;++u)d=o[u],d[l]=d[E],d.pop()}this.nCachedObjects_=i},subscribe_:function(t,e){var r=this._bindingsIndicesByPath,i=r[t],n=this._bindings;if(void 0!==i)return n[i];var o=this._paths,a=this._parsedPaths,s=this._objects,h=this.nCachedObjects_,c=Array(s.length),i=n.length;for(r[t]=i,o.push(t),a.push(e),n.push(c),r=h,i=s.length;r!==i;++r)c[r]=new THREE.PropertyBinding(s[r],t,e);return c},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){var i=this._paths,n=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=r,o[r]=s,o.pop(),n[r]=n[a],n.pop(),i[r]=i[a],i.pop()}}},THREE.AnimationUtils={arraySlice:function(t,e,r){return THREE.AnimationUtils.isTypedArray(t)?new t.constructor(t.subarray(e,r)):t.slice(e,r)},convertArray:function(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,r=Array(e),i=0;i!==e;++i)r[i]=i;return r.sort(function(e,r){return t[e]-t[r]}),r},sortedArray:function(t,e,r){for(var i=t.length,n=new t.constructor(i),o=0,a=0;a!==i;++o)for(var s=r[o]*e,h=0;h!==e;++h)n[a++]=t[s+h];return n},flattenJSON:function(t,e,r,i){for(var n=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[n++];if(void 0!==o){var a=o[i];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[i])&&(e.push(o.time),r.push.apply(r,a)),o=t[n++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[i])&&(e.push(o.time),a.toArray(r,r.length)),o=t[n++]}while(void 0!==o);else do{void 0!==(a=o[i])&&(e.push(o.time),r.push(a)),o=t[n++]}while(void 0!==o)}}},THREE.KeyframeTrack=function(t,e,r,i){if(void 0===t)throw Error("track name is undefined");if(void 0===e||0===e.length)throw Error("no keyframes in track named "+t);this.name=t,this.times=THREE.AnimationUtils.convertArray(e,this.TimeBufferType),this.values=THREE.AnimationUtils.convertArray(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation),this.validate(),this.optimize()},THREE.KeyframeTrack.prototype={constructor:THREE.KeyframeTrack,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:THREE.InterpolateLinear,InterpolantFactoryMethodDiscrete:function(t){return new THREE.DiscreteInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new THREE.LinearInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new THREE.CubicInterpolant(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e=void 0;switch(t){case THREE.InterpolateDiscrete:e=this.InterpolantFactoryMethodDiscrete;break;case THREE.InterpolateLinear:e=this.InterpolantFactoryMethodLinear;break;case THREE.InterpolateSmooth:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){if(e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name,void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw Error(e);this.setInterpolation(this.DefaultInterpolation)}console.warn(e)}else this.createInterpolant=e},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return THREE.InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return THREE.InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return THREE.InterpolateSmooth}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,r=0,i=e.length;r!==i;++r)e[r]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,r=0,i=e.length;r!==i;++r)e[r]*=t;return this},trim:function(t,e){for(var r=this.times,i=r.length,n=0,o=i-1;n!==i&&r[n]<t;)++n;for(;-1!==o&&r[o]>e;)--o;return++o,0===n&&o===i||(n>=o&&(o=Math.max(o,1),n=o-1),i=this.getValueSize(),this.times=THREE.AnimationUtils.arraySlice(r,n,o),this.values=THREE.AnimationUtils.arraySlice(this.values,n*i,o*i)),this},validate:function(){var t=!0;0!=(r=this.getValueSize())-Math.floor(r)&&(console.error("invalid value size in track",this),t=!1);var e=this.times,r=this.values,i=e.length;0===i&&(console.error("track is empty",this),t=!1);for(var n=null,o=0;o!==i;o++){var a=e[o];if("number"==typeof a&&isNaN(a)){console.error("time is not a valid number",this,o,a),t=!1;break}if(null!==n&&n>a){console.error("out of order keys",this,o,a,n),t=!1;break}n=a}if(void 0!==r&&THREE.AnimationUtils.isTypedArray(r))for(o=0,e=r.length;o!==e;++o)if(i=r[o],isNaN(i)){console.error("value is not a valid number",this,o,i),t=!1;break}return t},optimize:function(){for(var t=this.times,e=this.values,r=this.getValueSize(),i=1,n=1,o=t.length-1;n<=o;++n){var a=!1;if((l=t[n])!==t[n+1]&&(1!==n||l!==l[0]))for(var s=n*r,h=s-r,c=s+r,l=0;l!==r;++l){var u=e[s+l];if(u!==e[h+l]||u!==e[c+l]){a=!0;break}}if(a){if(n!==i)for(t[i]=t[n],a=n*r,s=i*r,l=0;l!==r;++l)e[s+l]=e[a+l];++i}}return i!==t.length&&(this.times=THREE.AnimationUtils.arraySlice(t,0,i),this.values=THREE.AnimationUtils.arraySlice(e,0,i*r)),this}},Object.assign(THREE.KeyframeTrack,{parse:function(t){if(void 0===t.type)throw Error("track type undefined, can not parse");var e=THREE.KeyframeTrack._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){console.warn("legacy JSON format detected, converting");var r=[],i=[];THREE.AnimationUtils.flattenJSON(t.keys,r,i,"value"),t.times=r,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){if(void 0!==(e=t.constructor).toJSON)e=e.toJSON(t);else{var e={name:t.name,times:THREE.AnimationUtils.convertArray(t.times,Array),values:THREE.AnimationUtils.convertArray(t.values,Array)},r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return THREE.NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return THREE.VectorKeyframeTrack;case"color":return THREE.ColorKeyframeTrack;case"quaternion":return THREE.QuaternionKeyframeTrack;case"bool":case"boolean":return THREE.BooleanKeyframeTrack;case"string":return THREE.StringKeyframeTrack}throw Error("Unsupported typeName: "+t)}}),THREE.PropertyBinding=function(t,e,r){this.path=e,this.parsedPath=r||THREE.PropertyBinding.parseTrackName(e),this.node=THREE.PropertyBinding.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t},THREE.PropertyBinding.prototype={constructor:THREE.PropertyBinding,getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,r=e.objectName,i=e.propertyName,n=e.propertyIndex;if(t||(this.node=t=THREE.PropertyBinding.findNode(this.rootNode,e.nodeName)||this.rootNode),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(r){var o=e.objectIndex;switch(r){case"materials":if(!t.material)return void console.error("  can not bind to material as node does not have a material",this);if(!t.material.materials)return void console.error("  can not bind to material.materials as node.material does not have a materials array",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("  can not bind to bones as node does not have a skeleton",this);for(t=t.skeleton.bones,r=0;r<t.length;r++)if(t[r].name===o){o=r;break}break;default:if(void 0===t[r])return void console.error("  can not bind to objectName of node, undefined",this);t=t[r]}if(void 0!==o){if(void 0===t[o])return void console.error("  trying to bind to objectIndex of objectName, but is undefined:",this,t);t=t[o]}}if(o=t[i]){if(e=this.Versioning.None,void 0!==t.needsUpdate?(e=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(e=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t),r=this.BindingType.Direct,void 0!==n){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry",this);if(!t.geometry.morphTargets)return void console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);for(r=0;r<this.node.geometry.morphTargets.length;r++)if(t.geometry.morphTargets[r].name===n){n=r;break}}r=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=n}else void 0!==o.fromArray&&void 0!==o.toArray?(r=this.BindingType.HasFromToArray,this.resolvedProperty=o):void 0!==o.length?(r=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[r],this.setValue=this.SetterByBindingTypeAndVersioning[r][e]}else console.error("  trying to update property for track: "+e.nodeName+"."+i+" but it wasn't found.",t)}else console.error("  trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Object.assign(THREE.PropertyBinding.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:THREE.PropertyBinding.prototype.getValue,_setValue_unbound:THREE.PropertyBinding.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)t[e++]=r[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.node[this.propertyName]=t[e]},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)r[i]=t[e++]},function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]]}),THREE.PropertyBinding.Composite=function(t,e,r){r=r||THREE.PropertyBinding.parseTrackName(e),this._targetGroup=t,this._bindings=t.subscribe_(e,r)},THREE.PropertyBinding.Composite.prototype={constructor:THREE.PropertyBinding.Composite,getValue:function(t,e){this.bind();var r=this._bindings[this._targetGroup.nCachedObjects_];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var r=this._bindings,i=this._targetGroup.nCachedObjects_,n=r.length;i!==n;++i)r[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].unbind()}},THREE.PropertyBinding.create=function(t,e,r){return t instanceof THREE.AnimationObjectGroup?new THREE.PropertyBinding.Composite(t,e,r):new THREE.PropertyBinding(t,e,r)},THREE.PropertyBinding.parseTrackName=function(t){var e=/^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_. ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,r=e.exec(t);if(!r)throw Error("cannot parse trackName at all: "+t);if(r.index===e.lastIndex&&e.lastIndex++,null===(e={nodeName:r[3],objectName:r[5],objectIndex:r[7],propertyName:r[9],propertyIndex:r[11]}).propertyName||0===e.propertyName.length)throw Error("can not parse propertyName from trackName: "+t);return e},THREE.PropertyBinding.findNode=function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var r=function(t){for(var r=0;r<t.bones.length;r++){var i=t.bones[r];if(i.name===e)return i}return null}(t.skeleton);if(r)return r}if(t.children){var i=function(t){for(var r=0;r<t.length;r++){var n=t[r];if(n.name===e||n.uuid===e||(n=i(n.children)))return n}return null};if(r=i(t.children))return r}return null},THREE.PropertyMixer=function(t,e,r){switch(this.binding=t,this.valueSize=r,t=Float64Array,e){case"quaternion":e=this._slerp;break;case"string":case"bool":t=Array,e=this._select;break;default:e=this._lerp}this.buffer=new t(4*r),this._mixBufferRegion=e,this.referenceCount=this.useCount=this.cumulativeWeight=0},THREE.PropertyMixer.prototype={constructor:THREE.PropertyMixer,accumulate:function(t,e){var r=this.buffer,i=this.valueSize,n=t*i+i,o=this.cumulativeWeight;if(0===o){for(o=0;o!==i;++o)r[n+o]=r[o];o=e}else o+=e,this._mixBufferRegion(r,n,0,e/o,i);this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,r=this.buffer;t=t*e+e;var i=this.cumulativeWeight,n=this.binding;this.cumulativeWeight=0,1>i&&this._mixBufferRegion(r,t,3*e,1-i,e);for(var i=e,o=e+e;i!==o;++i)if(r[i]!==r[i+e]){n.setValue(r,t);break}},saveOriginalState:function(){var t=this.buffer,e=this.valueSize,r=3*e;this.binding.getValue(t,r);for(var i=e;i!==r;++i)t[i]=t[r+i%e];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(t,e,r,i,n){if(.5<=i)for(i=0;i!==n;++i)t[e+i]=t[r+i]},_slerp:function(t,e,r,i,n){THREE.Quaternion.slerpFlat(t,e,t,e,t,r,i)},_lerp:function(t,e,r,i,n){for(var o=1-i,a=0;a!==n;++a){var s=e+a;t[s]=t[s]*o+t[r+a]*i}}},THREE.BooleanKeyframeTrack=function(t,e,r){THREE.KeyframeTrack.call(this,t,e,r)},THREE.BooleanKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.BooleanKeyframeTrack,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:THREE.IntepolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),THREE.NumberKeyframeTrack=function(t,e,r,i){THREE.KeyframeTrack.call(this,t,e,r,i)},THREE.NumberKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.NumberKeyframeTrack,ValueTypeName:"number"}),THREE.QuaternionKeyframeTrack=function(t,e,r,i){THREE.KeyframeTrack.call(this,t,e,r,i)},THREE.QuaternionKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.QuaternionKeyframeTrack,ValueTypeName:"quaternion",DefaultInterpolation:THREE.InterpolateLinear,InterpolantFactoryMethodLinear:function(t){return new THREE.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),THREE.StringKeyframeTrack=function(t,e,r,i){THREE.KeyframeTrack.call(this,t,e,r,i)},THREE.StringKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.StringKeyframeTrack,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:THREE.IntepolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),THREE.VectorKeyframeTrack=function(t,e,r,i){THREE.KeyframeTrack.call(this,t,e,r,i)},THREE.VectorKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.VectorKeyframeTrack,ValueTypeName:"vector"}),THREE.Audio=function(t){THREE.Object3D.call(this),this.type="Audio",this.context=t.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filter=null},THREE.Audio.prototype=Object.create(THREE.Object3D.prototype),THREE.Audio.prototype.constructor=THREE.Audio,THREE.Audio.prototype.getOutput=function(){return this.gain},THREE.Audio.prototype.load=function(t){var e=new THREE.AudioBuffer(this.context);return e.load(t),this.setBuffer(e),this},THREE.Audio.prototype.setNodeSource=function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},THREE.Audio.prototype.setBuffer=function(t){var e=this;return t.onReady(function(t){e.source.buffer=t,e.sourceType="buffer",e.autoplay&&e.play()}),this},THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else{var t=this.context.createBufferSource();t.buffer=this.source.buffer,t.loop=this.source.loop,t.onended=this.source.onended,t.start(0,this.startTime),t.playbackRate.value=this.playbackRate,this.isPlaying=!0,this.source=t,this.connect()}},THREE.Audio.prototype.pause=function(){!1===this.hasPlaybackControl?console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=this.context.currentTime)},THREE.Audio.prototype.stop=function(){!1===this.hasPlaybackControl?console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=0)},THREE.Audio.prototype.connect=function(){null!==this.filter?(this.source.connect(this.filter),this.filter.connect(this.getOutput())):this.source.connect(this.getOutput())},THREE.Audio.prototype.disconnect=function(){null!==this.filter?(this.source.disconnect(this.filter),this.filter.disconnect(this.getOutput())):this.source.disconnect(this.getOutput())},THREE.Audio.prototype.getFilter=function(){return this.filter},THREE.Audio.prototype.setFilter=function(t){void 0===t&&(t=null),!0===this.isPlaying?(this.disconnect(),this.filter=t,this.connect()):this.filter=t},THREE.Audio.prototype.setPlaybackRate=function(t){!1===this.hasPlaybackControl?console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&(this.source.playbackRate.value=this.playbackRate))},THREE.Audio.prototype.getPlaybackRate=function(){return this.playbackRate},THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1},THREE.Audio.prototype.setLoop=function(t){!1===this.hasPlaybackControl?console.warn("THREE.Audio: this Audio has no playback control."):this.source.loop=t},THREE.Audio.prototype.getLoop=function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.source.loop},THREE.Audio.prototype.setVolume=function(t){this.gain.gain.value=t},THREE.Audio.prototype.getVolume=function(){return this.gain.gain.value},THREE.AudioAnalyser=function(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)},THREE.AudioAnalyser.prototype={constructor:THREE.AudioAnalyser,getData:function(){return this.analyser.getByteFrequencyData(this.data),this.data}},THREE.AudioBuffer=function(t){this.context=t,this.ready=!1,this.readyCallbacks=[]},THREE.AudioBuffer.prototype.load=function(t){var e=this,r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(t){e.context.decodeAudioData(this.response,function(t){for(e.buffer=t,e.ready=!0,t=0;t<e.readyCallbacks.length;t++)e.readyCallbacks[t](e.buffer);e.readyCallbacks=[]})},r.send(),this},THREE.AudioBuffer.prototype.onReady=function(t){this.ready?t(this.buffer):this.readyCallbacks.push(t)},THREE.PositionalAudio=function(t){THREE.Audio.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)},THREE.PositionalAudio.prototype=Object.create(THREE.Audio.prototype),THREE.PositionalAudio.prototype.constructor=THREE.PositionalAudio,THREE.PositionalAudio.prototype.getOutput=function(){return this.panner},THREE.PositionalAudio.prototype.setRefDistance=function(t){this.panner.refDistance=t},THREE.PositionalAudio.prototype.getRefDistance=function(){return this.panner.refDistance},THREE.PositionalAudio.prototype.setRolloffFactor=function(t){this.panner.rolloffFactor=t},THREE.PositionalAudio.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor},THREE.PositionalAudio.prototype.setDistanceModel=function(t){this.panner.distanceModel=t},THREE.PositionalAudio.prototype.getDistanceModel=function(){return this.panner.distanceModel},THREE.PositionalAudio.prototype.setMaxDistance=function(t){this.panner.maxDistance=t},THREE.PositionalAudio.prototype.getMaxDistance=function(){return this.panner.maxDistance},THREE.PositionalAudio.prototype.updateMatrixWorld=function(){var t=new THREE.Vector3;return function(e){THREE.Object3D.prototype.updateMatrixWorld.call(this,e),t.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(t.x,t.y,t.z)}}(),THREE.AudioListener=function(){THREE.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null},THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype),THREE.AudioListener.prototype.constructor=THREE.AudioListener,THREE.AudioListener.prototype.getInput=function(){return this.gain},THREE.AudioListener.prototype.removeFilter=function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},THREE.AudioListener.prototype.setFilter=function(t){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},THREE.AudioListener.prototype.getFilter=function(){return this.filter},THREE.AudioListener.prototype.setMasterVolume=function(t){this.gain.gain.value=t},THREE.AudioListener.prototype.getMasterVolume=function(){return this.gain.gain.value},THREE.AudioListener.prototype.updateMatrixWorld=function(){var t=new THREE.Vector3,e=new THREE.Quaternion,r=new THREE.Vector3,i=new THREE.Vector3;return function(n){THREE.Object3D.prototype.updateMatrixWorld.call(this,n),n=this.context.listener;var o=this.up;this.matrixWorld.decompose(t,e,r),i.set(0,0,-1).applyQuaternion(e),n.setPosition(t.x,t.y,t.z),n.setOrientation(i.x,i.y,i.z,o.x,o.y,o.z)}}(),THREE.Camera=function(){THREE.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new THREE.Matrix4,this.projectionMatrix=new THREE.Matrix4},THREE.Camera.prototype=Object.create(THREE.Object3D.prototype),THREE.Camera.prototype.constructor=THREE.Camera,THREE.Camera.prototype.getWorldDirection=function(){var t=new THREE.Quaternion;return function(e){return e=e||new THREE.Vector3,this.getWorldQuaternion(t),e.set(0,0,-1).applyQuaternion(t)}}(),THREE.Camera.prototype.lookAt=function(){var t=new THREE.Matrix4;return function(e){t.lookAt(this.position,e,this.up),this.quaternion.setFromRotationMatrix(t)}}(),THREE.Camera.prototype.clone=function(){return(new this.constructor).copy(this)},THREE.Camera.prototype.copy=function(t){return THREE.Object3D.prototype.copy.call(this,t),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},THREE.CubeCamera=function(t,e,r){THREE.Object3D.call(this),this.type="CubeCamera";var i=new THREE.PerspectiveCamera(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new THREE.Vector3(1,0,0)),this.add(i);var n=new THREE.PerspectiveCamera(90,1,t,e);n.up.set(0,-1,0),n.lookAt(new THREE.Vector3(-1,0,0)),this.add(n);var o=new THREE.PerspectiveCamera(90,1,t,e);o.up.set(0,0,1),o.lookAt(new THREE.Vector3(0,1,0)),this.add(o);var a=new THREE.PerspectiveCamera(90,1,t,e);a.up.set(0,0,-1),a.lookAt(new THREE.Vector3(0,-1,0)),this.add(a);var s=new THREE.PerspectiveCamera(90,1,t,e);s.up.set(0,-1,0),s.lookAt(new THREE.Vector3(0,0,1)),this.add(s);var h=new THREE.PerspectiveCamera(90,1,t,e);h.up.set(0,-1,0),h.lookAt(new THREE.Vector3(0,0,-1)),this.add(h),this.renderTarget=new THREE.WebGLRenderTargetCube(r,r,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter}),this.updateCubeMap=function(t,e){null===this.parent&&this.updateMatrixWorld();var r=this.renderTarget,c=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,r.activeCubeFace=0,t.render(e,i,r),r.activeCubeFace=1,t.render(e,n,r),r.activeCubeFace=2,t.render(e,o,r),r.activeCubeFace=3,t.render(e,a,r),r.activeCubeFace=4,t.render(e,s,r),r.texture.generateMipmaps=c,r.activeCubeFace=5,t.render(e,h,r),t.setRenderTarget(null)}},THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype),THREE.CubeCamera.prototype.constructor=THREE.CubeCamera,THREE.OrthographicCamera=function(t,e,r,i,n,o){THREE.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=t,this.right=e,this.top=r,this.bottom=i,this.near=void 0!==n?n:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()},THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype),THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera,THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(r-t,r+t,i+e,i-e,this.near,this.far)},THREE.OrthographicCamera.prototype.copy=function(t){return THREE.Camera.prototype.copy.call(this,t),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this},THREE.OrthographicCamera.prototype.toJSON=function(t){return t=THREE.Object3D.prototype.toJSON.call(this,t),t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,t},THREE.PerspectiveCamera=function(t,e,r,i){THREE.Camera.call(this),this.type="PerspectiveCamera",this.focalLength=10,this.zoom=1,this.fov=void 0!==t?t:50,this.aspect=void 0!==e?e:1,this.near=void 0!==r?r:.1,this.far=void 0!==i?i:2e3,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype),THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera,THREE.PerspectiveCamera.prototype.setLens=function(t,e){void 0===e&&(e=24),this.fov=2*THREE.Math.radToDeg(Math.atan(e/(2*t))),this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.setViewOffset=function(t,e,r,i,n,o){this.fullWidth=t,this.fullHeight=e,this.x=r,this.y=i,this.width=n,this.height=o,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var t=THREE.Math.radToDeg(2*Math.atan(Math.tan(.5*THREE.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var e=(r=this.fullWidth/this.fullHeight)*(i=-(t=Math.tan(THREE.Math.degToRad(.5*t))*this.near)),r=Math.abs(r*t-e),i=Math.abs(t-i);this.projectionMatrix.makeFrustum(e+this.x*r/this.fullWidth,e+(this.x+this.width)*r/this.fullWidth,t-(this.y+this.height)*i/this.fullHeight,t-this.y*i/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(t,this.aspect,this.near,this.far)},THREE.PerspectiveCamera.prototype.copy=function(t){return THREE.Camera.prototype.copy.call(this,t),this.focalLength=t.focalLength,this.zoom=t.zoom,this.fov=t.fov,this.aspect=t.aspect,this.near=t.near,this.far=t.far,this},THREE.PerspectiveCamera.prototype.toJSON=function(t){return t=THREE.Object3D.prototype.toJSON.call(this,t),t.object.focalLength=this.focalLength,t.object.zoom=this.zoom,t.object.fov=this.fov,t.object.aspect=this.aspect,t.object.near=this.near,t.object.far=this.far,t},THREE.StereoCamera=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new THREE.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new THREE.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1},THREE.StereoCamera.prototype={constructor:THREE.StereoCamera,update:function(){var t,e,r,i,n,o=new THREE.Matrix4,a=new THREE.Matrix4;return function(s){if(t!==s.focalLength||e!==s.fov||r!==s.aspect*this.aspect||i!==s.near||n!==s.far){t=s.focalLength,e=s.fov,r=s.aspect*this.aspect,i=s.near,n=s.far;var h,c,l=s.projectionMatrix.clone(),u=.032*i/t,E=i*Math.tan(THREE.Math.degToRad(.5*e));a.elements[12]=-.032,o.elements[12]=.032,h=-E*r+u,c=E*r+u,l.elements[0]=2*i/(c-h),l.elements[8]=(c+h)/(c-h),this.cameraL.projectionMatrix.copy(l),h=-E*r-u,c=E*r-u,l.elements[0]=2*i/(c-h),l.elements[8]=(c+h)/(c-h),this.cameraR.projectionMatrix.copy(l)}this.cameraL.matrixWorld.copy(s.matrixWorld).multiply(a),this.cameraR.matrixWorld.copy(s.matrixWorld).multiply(o)}}()},THREE.Light=function(t,e){THREE.Object3D.call(this),this.type="Light",this.color=new THREE.Color(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0},THREE.Light.prototype=Object.create(THREE.Object3D.prototype),THREE.Light.prototype.constructor=THREE.Light,THREE.Light.prototype.copy=function(t){return THREE.Object3D.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},THREE.Light.prototype.toJSON=function(t){return t=THREE.Object3D.prototype.toJSON.call(this,t),t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.exponent&&(t.object.exponent=this.exponent),t},THREE.LightShadow=function(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new THREE.Vector2(512,512),this.map=null,this.matrix=new THREE.Matrix4},THREE.LightShadow.prototype={constructor:THREE.LightShadow,copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)}},THREE.AmbientLight=function(t,e){THREE.Light.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0},THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype),THREE.AmbientLight.prototype.constructor=THREE.AmbientLight,THREE.DirectionalLight=function(t,e){THREE.Light.call(this,t,e),this.type="DirectionalLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new THREE.Object3D,this.shadow=new THREE.LightShadow(new THREE.OrthographicCamera(-5,5,5,-5,.5,500))},THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype),THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight,THREE.DirectionalLight.prototype.copy=function(t){return THREE.Light.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this},THREE.HemisphereLight=function(t,e,r){THREE.Light.call(this,t,r),this.type="HemisphereLight",this.castShadow=void 0,this.position.set(0,1,0),this.updateMatrix(),this.groundColor=new THREE.Color(e)},THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype),THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight,THREE.HemisphereLight.prototype.copy=function(t){return THREE.Light.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this},THREE.PointLight=function(t,e,r,i){THREE.Light.call(this,t,e),this.type="PointLight",this.distance=void 0!==r?r:0,this.decay=void 0!==i?i:1,this.shadow=new THREE.LightShadow(new THREE.PerspectiveCamera(90,1,.5,500))},THREE.PointLight.prototype=Object.create(THREE.Light.prototype),THREE.PointLight.prototype.constructor=THREE.PointLight,THREE.PointLight.prototype.copy=function(t){return THREE.Light.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this},THREE.SpotLight=function(t,e,r,i,n,o){THREE.Light.call(this,t,e),this.type="SpotLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new THREE.Object3D,this.distance=void 0!==r?r:0,this.angle=void 0!==i?i:Math.PI/3,this.exponent=void 0!==n?n:10,this.decay=void 0!==o?o:1,this.shadow=new THREE.LightShadow(new THREE.PerspectiveCamera(50,1,.5,500))},THREE.SpotLight.prototype=Object.create(THREE.Light.prototype),THREE.SpotLight.prototype.constructor=THREE.SpotLight,THREE.SpotLight.prototype.copy=function(t){return THREE.Light.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.exponent=t.exponent,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this},THREE.Cache={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},THREE.Loader=function(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,extractUrlBase:function(t){return 1===(t=t.split("/")).length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(t,e,r){for(var i=[],n=0;n<t.length;++n)i[n]=this.createMaterial(t[n],e,r);return i},createMaterial:function(){var t,e,r;return function(i,n,o){function a(t,r,i,a,s){t=n+t;var c=THREE.Loader.Handlers.get(t);return null!==c?t=c.load(t):(e.setCrossOrigin(o),t=e.load(t)),void 0!==r&&(t.repeat.fromArray(r),1!==r[0]&&(t.wrapS=THREE.RepeatWrapping),1!==r[1]&&(t.wrapT=THREE.RepeatWrapping)),void 0!==i&&t.offset.fromArray(i),void 0!==a&&("repeat"===a[0]&&(t.wrapS=THREE.RepeatWrapping),"mirror"===a[0]&&(t.wrapS=THREE.MirroredRepeatWrapping),"repeat"===a[1]&&(t.wrapT=THREE.RepeatWrapping),"mirror"===a[1]&&(t.wrapT=THREE.MirroredRepeatWrapping)),void 0!==s&&(t.anisotropy=s),r=THREE.Math.generateUUID(),h[r]=t,r}void 0===t&&(t=new THREE.Color),void 0===e&&(e=new THREE.TextureLoader),void 0===r&&(r=new THREE.MaterialLoader);var s,h={},c={uuid:THREE.Math.generateUUID(),type:"MeshLambertMaterial"};for(s in i){var l=i[s];switch(s){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":c.name=l;break;case"blending":c.blending=THREE[l];break;case"colorAmbient":console.warn("THREE.Loader.createMaterial: colorAmbient is no longer supported");break;case"colorDiffuse":c.color=t.fromArray(l).getHex();break;case"colorSpecular":c.specular=t.fromArray(l).getHex();break;case"colorEmissive":c.emissive=t.fromArray(l).getHex();break;case"specularCoef":c.shininess=l;break;case"shading":"basic"===l.toLowerCase()&&(c.type="MeshBasicMaterial"),"phong"===l.toLowerCase()&&(c.type="MeshPhongMaterial");break;case"mapDiffuse":c.map=a(l,i.mapDiffuseRepeat,i.mapDiffuseOffset,i.mapDiffuseWrap,i.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapLight":c.lightMap=a(l,i.mapLightRepeat,i.mapLightOffset,i.mapLightWrap,i.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":c.aoMap=a(l,i.mapAORepeat,i.mapAOOffset,i.mapAOWrap,i.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":c.bumpMap=a(l,i.mapBumpRepeat,i.mapBumpOffset,i.mapBumpWrap,i.mapBumpAnisotropy);break;case"mapBumpScale":c.bumpScale=l;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":c.normalMap=a(l,i.mapNormalRepeat,i.mapNormalOffset,i.mapNormalWrap,i.mapNormalAnisotropy);break;case"mapNormalFactor":c.normalScale=[l,l];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":c.specularMap=a(l,i.mapSpecularRepeat,i.mapSpecularOffset,i.mapSpecularWrap,i.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapAlpha":c.alphaMap=a(l,i.mapAlphaRepeat,i.mapAlphaOffset,i.mapAlphaWrap,i.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":c.side=THREE.BackSide;break;case"doubleSided":c.side=THREE.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),c.opacity=l;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":c[s]=l;break;case"vertexColors":!0===l&&(c.vertexColors=THREE.VertexColors),"face"===l&&(c.vertexColors=THREE.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",s,l)}}return"MeshBasicMaterial"===c.type&&delete c.emissive,"MeshPhongMaterial"!==c.type&&delete c.specular,1>c.opacity&&(c.transparent=!0),r.setTextures(h),r.parse(c)}}()},THREE.Loader.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,r=0,i=e.length;r<i;r+=2){var n=e[r+1];if(e[r].test(t))return n}return null}},THREE.XHRLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(t,e,r,i){void 0!==this.path&&(t=this.path+t);var n=this,o=THREE.Cache.get(t);if(void 0!==o)return e&&setTimeout(function(){e(o)},0),o;var a=new XMLHttpRequest;return a.overrideMimeType("text/plain"),a.open("GET",t,!0),a.addEventListener("load",function(r){var o=r.target.response;THREE.Cache.add(t,o),200===this.status?(e&&e(o),n.manager.itemEnd(t)):0===this.status?(console.warn("THREE.XHRLoader: HTTP Status 0 received."),e&&e(o),n.manager.itemEnd(t)):(i&&i(r),n.manager.itemError(t))},!1),void 0!==r&&a.addEventListener("progress",function(t){r(t)},!1),a.addEventListener("error",function(e){i&&i(e),n.manager.itemError(t)},!1),void 0!==this.responseType&&(a.responseType=this.responseType),void 0!==this.withCredentials&&(a.withCredentials=this.withCredentials),a.send(null),n.manager.itemStart(t),a},setPath:function(t){this.path=t},setResponseType:function(t){this.responseType=t},setWithCredentials:function(t){this.withCredentials=t}},THREE.FontLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.FontLoader.prototype={constructor:THREE.FontLoader,load:function(t,e,r,i){new THREE.XHRLoader(this.manager).load(t,function(t){e(new THREE.Font(JSON.parse(t.substring(65,t.length-2))))},r,i)}},THREE.ImageLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(t,e,r,i){void 0!==this.path&&(t=this.path+t);var n=this,o=THREE.Cache.get(t);if(void 0!==o)return n.manager.itemStart(t),e?setTimeout(function(){e(o),n.manager.itemEnd(t)},0):n.manager.itemEnd(t),o;var a=document.createElement("img");return a.addEventListener("load",function(r){THREE.Cache.add(t,this),e&&e(this),n.manager.itemEnd(t)},!1),void 0!==r&&a.addEventListener("progress",function(t){r(t)},!1),a.addEventListener("error",function(e){i&&i(e),n.manager.itemError(t)},!1),void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),n.manager.itemStart(t),a.src=t,a},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t}},THREE.JSONLoader=function(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this.withCredentials=!1},THREE.JSONLoader.prototype={constructor:THREE.JSONLoader,get statusDomElement(){return void 0===this._statusDomElement&&(this._statusDomElement=document.createElement("div")),console.warn("THREE.JSONLoader: .statusDomElement has been removed."),this._statusDomElement},load:function(t,e,r,i){var n=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:THREE.Loader.prototype.extractUrlBase(t),a=new THREE.XHRLoader(this.manager);a.setWithCredentials(this.withCredentials),a.load(t,function(r){var i=(r=JSON.parse(r)).metadata;if(void 0!==i&&void 0!==(i=i.type)){if("object"===i.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===i.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.SceneLoader instead.")}r=n.parse(r,o),e(r.geometry,r.materials)},r,i)},setTexturePath:function(t){this.texturePath=t},parse:function(t,e){var r=new THREE.Geometry,i=void 0!==t.scale?1/t.scale:1;return function(e){var i,n,o,a,s,h,c,l,u,E,p,d,f,m=t.faces;h=t.vertices;var T=t.normals,g=t.colors,v=0;if(void 0!==t.uvs){for(i=0;i<t.uvs.length;i++)t.uvs[i].length&&v++;for(i=0;i<v;i++)r.faceVertexUvs[i]=[]}for(a=0,s=h.length;a<s;)i=new THREE.Vector3,i.x=h[a++]*e,i.y=h[a++]*e,i.z=h[a++]*e,r.vertices.push(i);for(a=0,s=m.length;a<s;)if(e=m[a++],u=1&e,o=2&e,i=8&e,c=16&e,E=32&e,h=64&e,e&=128,u){if(u=new THREE.Face3,u.a=m[a],u.b=m[a+1],u.c=m[a+3],p=new THREE.Face3,p.a=m[a+1],p.b=m[a+2],p.c=m[a+3],a+=4,o&&(o=m[a++],u.materialIndex=o,p.materialIndex=o),o=r.faces.length,i)for(i=0;i<v;i++)for(d=t.uvs[i],r.faceVertexUvs[i][o]=[],r.faceVertexUvs[i][o+1]=[],n=0;4>n;n++)l=m[a++],f=d[2*l],l=d[2*l+1],f=new THREE.Vector2(f,l),2!==n&&r.faceVertexUvs[i][o].push(f),0!==n&&r.faceVertexUvs[i][o+1].push(f);if(c&&(c=3*m[a++],u.normal.set(T[c++],T[c++],T[c]),p.normal.copy(u.normal)),E)for(i=0;4>i;i++)c=3*m[a++],E=new THREE.Vector3(T[c++],T[c++],T[c]),2!==i&&u.vertexNormals.push(E),0!==i&&p.vertexNormals.push(E);if(h&&(h=m[a++],h=g[h],u.color.setHex(h),p.color.setHex(h)),e)for(i=0;4>i;i++)h=m[a++],h=g[h],2!==i&&u.vertexColors.push(new THREE.Color(h)),0!==i&&p.vertexColors.push(new THREE.Color(h));r.faces.push(u),r.faces.push(p)}else{if(u=new THREE.Face3,u.a=m[a++],u.b=m[a++],u.c=m[a++],o&&(o=m[a++],u.materialIndex=o),o=r.faces.length,i)for(i=0;i<v;i++)for(d=t.uvs[i],r.faceVertexUvs[i][o]=[],n=0;3>n;n++)l=m[a++],f=d[2*l],l=d[2*l+1],f=new THREE.Vector2(f,l),r.faceVertexUvs[i][o].push(f);if(c&&(c=3*m[a++],u.normal.set(T[c++],T[c++],T[c])),E)for(i=0;3>i;i++)c=3*m[a++],E=new THREE.Vector3(T[c++],T[c++],T[c]),u.vertexNormals.push(E);if(h&&(h=m[a++],u.color.setHex(g[h])),e)for(i=0;3>i;i++)h=m[a++],u.vertexColors.push(new THREE.Color(g[h]));r.faces.push(u)}}(i),function(){var e=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,n=t.skinWeights.length;i<n;i+=e)r.skinWeights.push(new THREE.Vector4(t.skinWeights[i],1<e?t.skinWeights[i+1]:0,2<e?t.skinWeights[i+2]:0,3<e?t.skinWeights[i+3]:0));if(t.skinIndices)for(i=0,n=t.skinIndices.length;i<n;i+=e)r.skinIndices.push(new THREE.Vector4(t.skinIndices[i],1<e?t.skinIndices[i+1]:0,2<e?t.skinIndices[i+2]:0,3<e?t.skinIndices[i+3]:0));r.bones=t.bones,r.bones&&0<r.bones.length&&(r.skinWeights.length!==r.skinIndices.length||r.skinIndices.length!==r.vertices.length)&&console.warn("When skinning, number of vertices ("+r.vertices.length+"), skinIndices ("+r.skinIndices.length+"), and skinWeights ("+r.skinWeights.length+") should match.")}(),function(e){if(void 0!==t.morphTargets)for(var i=0,n=t.morphTargets.length;i<n;i++){r.morphTargets[i]={},r.morphTargets[i].name=t.morphTargets[i].name,r.morphTargets[i].vertices=[];for(var o=r.morphTargets[i].vertices,a=t.morphTargets[i].vertices,s=0,h=a.length;s<h;s+=3){var c=new THREE.Vector3;c.x=a[s]*e,c.y=a[s+1]*e,c.z=a[s+2]*e,o.push(c)}}if(void 0!==t.morphColors&&0<t.morphColors.length)for(console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'),e=r.faces,o=t.morphColors[0].colors,i=0,n=e.length;i<n;i++)e[i].color.fromArray(o,3*i)}(i),function(){var e=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var n=0;n<i.length;n++){var o=THREE.AnimationClip.parseAnimation(i[n],r.bones);o&&e.push(o)}r.morphTargets&&(i=THREE.AnimationClip.CreateClipsFromMorphTargetSequences(r.morphTargets,10),e=e.concat(i)),0<e.length&&(r.animations=e)}(),r.computeFaceNormals(),r.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:r}:(i=THREE.Loader.prototype.initMaterials(t.materials,e,this.crossOrigin),{geometry:r,materials:i})}},THREE.LoadingManager=function(t,e,r){var i=this,n=!1,o=0,a=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=r,this.itemStart=function(t){a++,!1===n&&void 0!==i.onStart&&i.onStart(t,o,a),n=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,a),o===a&&(n=!1,void 0!==i.onLoad)&&i.onLoad()},this.itemError=function(t){void 0!==i.onError&&i.onError(t)}},THREE.DefaultLoadingManager=new THREE.LoadingManager,THREE.BufferGeometryLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(t,e,r,i){var n=this;new THREE.XHRLoader(n.manager).load(t,function(t){e(n.parse(JSON.parse(t)))},r,i)},parse:function(t){var e=new THREE.BufferGeometry,r=t.data.index,i={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};void 0!==r&&(r=new i[r.type](r.array),e.setIndex(new THREE.BufferAttribute(r,1)));var n,o=t.data.attributes;for(n in o){var a=o[n],r=new i[a.type](a.array);e.addAttribute(n,new THREE.BufferAttribute(r,a.itemSize))}if(void 0!==(i=t.data.groups||t.data.drawcalls||t.data.offsets))for(n=0,r=i.length;n!==r;++n)o=i[n],e.addGroup(o.start,o.count,o.materialIndex);return void 0!==(t=t.data.boundingSphere)&&(i=new THREE.Vector3,void 0!==t.center&&i.fromArray(t.center),e.boundingSphere=new THREE.Sphere(i,t.radius)),e}},THREE.MaterialLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this.textures={}},THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(t,e,r,i){var n=this;new THREE.XHRLoader(n.manager).load(t,function(t){e(n.parse(JSON.parse(t)))},r,i)},setTextures:function(t){this.textures=t},getTexture:function(t){var e=this.textures;return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]},parse:function(t){var e=new THREE[t.type];if(void 0!==t.uuid&&(e.uuid=t.uuid),void 0!==t.name&&(e.name=t.name),void 0!==t.color&&e.color.setHex(t.color),void 0!==t.roughness&&(e.roughness=t.roughness),void 0!==t.metalness&&(e.metalness=t.metalness),void 0!==t.emissive&&e.emissive.setHex(t.emissive),void 0!==t.specular&&e.specular.setHex(t.specular),void 0!==t.shininess&&(e.shininess=t.shininess),void 0!==t.uniforms&&(e.uniforms=t.uniforms),void 0!==t.vertexShader&&(e.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(e.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(e.vertexColors=t.vertexColors),void 0!==t.shading&&(e.shading=t.shading),void 0!==t.blending&&(e.blending=t.blending),void 0!==t.side&&(e.side=t.side),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.transparent&&(e.transparent=t.transparent),void 0!==t.alphaTest&&(e.alphaTest=t.alphaTest),void 0!==t.depthTest&&(e.depthTest=t.depthTest),void 0!==t.depthWrite&&(e.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(e.colorWrite=t.colorWrite),void 0!==t.wireframe&&(e.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(e.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.size&&(e.size=t.size),void 0!==t.sizeAttenuation&&(e.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(e.map=this.getTexture(t.map)),void 0!==t.alphaMap&&(e.alphaMap=this.getTexture(t.alphaMap),e.transparent=!0),void 0!==t.bumpMap&&(e.bumpMap=this.getTexture(t.bumpMap)),void 0!==t.bumpScale&&(e.bumpScale=t.bumpScale),void 0!==t.normalMap&&(e.normalMap=this.getTexture(t.normalMap)),void 0!==t.normalScale){r=t.normalScale;!1===Array.isArray(r)&&(r=[r,r]),e.normalScale=(new THREE.Vector2).fromArray(r)}if(void 0!==t.displacementMap&&(e.displacementMap=this.getTexture(t.displacementMap)),void 0!==t.displacementScale&&(e.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(e.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(e.roughnessMap=this.getTexture(t.roughnessMap)),void 0!==t.metalnessMap&&(e.metalnessMap=this.getTexture(t.metalnessMap)),void 0!==t.emissiveMap&&(e.emissiveMap=this.getTexture(t.emissiveMap)),void 0!==t.emissiveIntensity&&(e.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(e.specularMap=this.getTexture(t.specularMap)),void 0!==t.envMap&&(e.envMap=this.getTexture(t.envMap),e.combine=THREE.MultiplyOperation),t.reflectivity&&(e.reflectivity=t.reflectivity),void 0!==t.lightMap&&(e.lightMap=this.getTexture(t.lightMap)),void 0!==t.lightMapIntensity&&(e.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(e.aoMap=this.getTexture(t.aoMap)),void 0!==t.aoMapIntensity&&(e.aoMapIntensity=t.aoMapIntensity),void 0!==t.materials)for(var r=0,i=t.materials.length;r<i;r++)e.materials.push(this.parse(t.materials[r]));return e}},THREE.ObjectLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this.texturePath=""},THREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(t,e,r,i){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var n=this;new THREE.XHRLoader(n.manager).load(t,function(t){n.parse(JSON.parse(t),e)},r,i)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var r=this.parseGeometries(t.geometries),i=this.parseImages(t.images,function(){void 0!==e&&e(n)}),i=this.parseTextures(t.textures,i),i=this.parseMaterials(t.materials,i),n=this.parseObject(t.object,r,i);return t.animations&&(n.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0===e||e(n),n},parseGeometries:function(t){var e={};if(void 0!==t)for(var r=new THREE.JSONLoader,i=new THREE.BufferGeometryLoader,n=0,o=t.length;n<o;n++){var a,s=t[n];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new THREE[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"CubeGeometry":a=new THREE.BoxGeometry(s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleBufferGeometry":a=new THREE.CircleBufferGeometry(s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CircleGeometry":a=new THREE.CircleGeometry(s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":a=new THREE.CylinderGeometry(s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":a=new THREE.SphereGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"SphereBufferGeometry":a=new THREE.SphereBufferGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":a=new THREE.DodecahedronGeometry(s.radius,s.detail);break;case"IcosahedronGeometry":a=new THREE.IcosahedronGeometry(s.radius,s.detail);break;case"OctahedronGeometry":a=new THREE.OctahedronGeometry(s.radius,s.detail);break;case"TetrahedronGeometry":a=new THREE.TetrahedronGeometry(s.radius,s.detail);break;case"RingGeometry":a=new THREE.RingGeometry(s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":a=new THREE.TorusGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":a=new THREE.TorusKnotGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.p,s.q,s.heightScale);break;case"LatheGeometry":a=new THREE.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":a=i.parse(s);break;case"Geometry":a=r.parse(s.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),e[s.uuid]=a}return e},parseMaterials:function(t,e){var r={};if(void 0!==t){var i=new THREE.MaterialLoader;i.setTextures(e);for(var n=0,o=t.length;n<o;n++){var a=i.parse(t[n]);r[a.uuid]=a}}return r},parseAnimations:function(t){for(var e=[],r=0;r<t.length;r++){var i=THREE.AnimationClip.parse(t[r]);e.push(i)}return e},parseImages:function(t,e){var r=this,i={};if(void 0!==t&&0<t.length){var n=new THREE.LoadingManager(e),o=new THREE.ImageLoader(n);o.setCrossOrigin(this.crossOrigin);for(var n=0,a=t.length;n<a;n++){var s=t[n],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(s.url)?s.url:r.texturePath+s.url;i[s.uuid]=function(t){return r.manager.itemStart(t),o.load(t,function(){r.manager.itemEnd(t)})}(h)}}return i},parseTextures:function(t,e){function r(t){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),THREE[t])}var i={};if(void 0!==t)for(var n=0,o=t.length;n<o;n++){var a=t[n];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===e[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);var s=new THREE.Texture(e[a.image]);s.needsUpdate=!0,s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.mapping&&(s.mapping=r(a.mapping)),void 0!==a.offset&&(s.offset=new THREE.Vector2(a.offset[0],a.offset[1])),void 0!==a.repeat&&(s.repeat=new THREE.Vector2(a.repeat[0],a.repeat[1])),void 0!==a.minFilter&&(s.minFilter=r(a.minFilter)),void 0!==a.magFilter&&(s.magFilter=r(a.magFilter)),void 0!==a.anisotropy&&(s.anisotropy=a.anisotropy),Array.isArray(a.wrap)&&(s.wrapS=r(a.wrap[0]),s.wrapT=r(a.wrap[1])),i[a.uuid]=s}return i},parseObject:function(){var t=new THREE.Matrix4;return function(e,r,i){function n(t){return void 0===r[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),r[t]}function o(t){if(void 0!==t)return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}var a;switch(e.type){case"Scene":a=new THREE.Scene;break;case"PerspectiveCamera":a=new THREE.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);break;case"OrthographicCamera":a=new THREE.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":a=new THREE.AmbientLight(e.color,e.intensity);break;case"DirectionalLight":a=new THREE.DirectionalLight(e.color,e.intensity);break;case"PointLight":a=new THREE.PointLight(e.color,e.intensity,e.distance,e.decay);break;case"SpotLight":a=new THREE.SpotLight(e.color,e.intensity,e.distance,e.angle,e.exponent,e.decay);break;case"HemisphereLight":a=new THREE.HemisphereLight(e.color,e.groundColor,e.intensity);break;case"Mesh":a=n(e.geometry);var s=o(e.material);a=a.bones&&0<a.bones.length?new THREE.SkinnedMesh(a,s):new THREE.Mesh(a,s);break;case"LOD":a=new THREE.LOD;break;case"Line":a=new THREE.Line(n(e.geometry),o(e.material),e.mode);break;case"PointCloud":case"Points":a=new THREE.Points(n(e.geometry),o(e.material));break;case"Sprite":a=new THREE.Sprite(o(e.material));break;case"Group":a=new THREE.Group;break;default:a=new THREE.Object3D}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.children)for(var h in e.children)a.add(this.parseObject(e.children[h],r,i));if("LOD"===e.type)for(e=e.levels,s=0;s<e.length;s++){var c=e[s];void 0!==(h=a.getObjectByProperty("uuid",c.object))&&a.addLevel(h,c.distance)}return a}}()},THREE.TextureLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(t,e,r,i){var n=new THREE.Texture,o=new THREE.ImageLoader(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(t){n.image=t,n.needsUpdate=!0,void 0!==e&&e(n)},r,i),n},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t}},THREE.CubeTextureLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.CubeTextureLoader.prototype={constructor:THREE.CubeTextureLoader,load:function(t,e,r,i){var n=new THREE.CubeTexture([]),o=new THREE.ImageLoader(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;for(r=0;r<t.length;++r)!function(r){o.load(t[r],function(t){n.images[r]=t,6==++a&&(n.needsUpdate=!0,e&&e(n))},void 0,i)}(r);return n},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t}},THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this._parser=null},THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(t,e,r,i){var n=this,o=new THREE.DataTexture,a=new THREE.XHRLoader(this.manager);return a.setResponseType("arraybuffer"),a.load(t,function(t){(t=n._parser(t))&&(void 0!==t.image?o.image=t.image:void 0!==t.data&&(o.image.width=t.width,o.image.height=t.height,o.image.data=t.data),o.wrapS=void 0!==t.wrapS?t.wrapS:THREE.ClampToEdgeWrapping,o.wrapT=void 0!==t.wrapT?t.wrapT:THREE.ClampToEdgeWrapping,o.magFilter=void 0!==t.magFilter?t.magFilter:THREE.LinearFilter,o.minFilter=void 0!==t.minFilter?t.minFilter:THREE.LinearMipMapLinearFilter,o.anisotropy=void 0!==t.anisotropy?t.anisotropy:1,void 0!==t.format&&(o.format=t.format),void 0!==t.type&&(o.type=t.type),void 0!==t.mipmaps&&(o.mipmaps=t.mipmaps),1===t.mipmapCount&&(o.minFilter=THREE.LinearFilter),o.needsUpdate=!0,e&&e(o,t))},r,i),o}},THREE.CompressedTextureLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this._parser=null},THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(t,e,r,i){var n=this,o=[],a=new THREE.CompressedTexture;a.image=o;var s=new THREE.XHRLoader(this.manager);if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var h=0,c=0,l=t.length;c<l;++c)!function(c){s.load(t[c],function(t){t=n._parser(t,!0),o[c]={width:t.width,height:t.height,format:t.format,mipmaps:t.mipmaps},6===(h+=1)&&(1===t.mipmapCount&&(a.minFilter=THREE.LinearFilter),a.format=t.format,a.needsUpdate=!0,e&&e(a))},r,i)}(c);else s.load(t,function(t){if((t=n._parser(t,!0)).isCubemap)for(var r=t.mipmaps.length/t.mipmapCount,i=0;i<r;i++){o[i]={mipmaps:[]};for(var s=0;s<t.mipmapCount;s++)o[i].mipmaps.push(t.mipmaps[i*t.mipmapCount+s]),o[i].format=t.format,o[i].width=t.width,o[i].height=t.height}else a.image.width=t.width,a.image.height=t.height,a.mipmaps=t.mipmaps;1===t.mipmapCount&&(a.minFilter=THREE.LinearFilter),a.format=t.format,a.needsUpdate=!0,e&&e(a)},r,i);return a},setPath:function(t){this.path=t}},THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Material",this.side=THREE.FrontSide,this.opacity=1,this.transparent=!1,this.blending=THREE.NormalBlending,this.blendSrc=THREE.SrcAlphaFactor,this.blendDst=THREE.OneMinusSrcAlphaFactor,this.blendEquation=THREE.AddEquation,this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null,this.depthFunc=THREE.LessEqualDepth,this.colorWrite=this.depthWrite=this.depthTest=!0,this.precision=null,this.polygonOffset=!1,this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0,this._needsUpdate=this.visible=!0},THREE.Material.prototype={constructor:THREE.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(t){!0===t&&this.update(),this._needsUpdate=t},setValues:function(t){if(void 0!==t)for(var e in t){var r=t[e];if(void 0===r)console.warn("THREE.Material: '"+e+"' parameter is undefined.");else{var i=this[e];void 0===i?console.warn("THREE."+this.type+": '"+e+"' is not a property of this material."):i instanceof THREE.Color?i.set(r):i instanceof THREE.Vector3&&r instanceof THREE.Vector3?i.copy(r):this[e]="overdraw"===e?Number(r):r}}},toJSON:function(t){function e(t){var e,r=[];for(e in t){var i=t[e];delete i.metadata,r.push(i)}return r}var r=void 0===t;r&&(t={textures:{},images:{}});var i={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};return i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color instanceof THREE.Color&&(i.color=this.color.getHex()),.5!==this.roughness&&(i.roughness=this.roughness),.5!==this.metalness&&(i.metalness=this.metalness),this.emissive instanceof THREE.Color&&(i.emissive=this.emissive.getHex()),this.specular instanceof THREE.Color&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),this.map instanceof THREE.Texture&&(i.map=this.map.toJSON(t).uuid),this.alphaMap instanceof THREE.Texture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap instanceof THREE.Texture&&(i.lightMap=this.lightMap.toJSON(t).uuid),this.bumpMap instanceof THREE.Texture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap instanceof THREE.Texture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalScale=this.normalScale.toArray()),this.displacementMap instanceof THREE.Texture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap instanceof THREE.Texture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap instanceof THREE.Texture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap instanceof THREE.Texture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap instanceof THREE.Texture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap instanceof THREE.Texture&&(i.envMap=this.envMap.toJSON(t).uuid,i.reflectivity=this.reflectivity),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),void 0!==this.vertexColors&&this.vertexColors!==THREE.NoColors&&(i.vertexColors=this.vertexColors),void 0!==this.shading&&this.shading!==THREE.SmoothShading&&(i.shading=this.shading),void 0!==this.blending&&this.blending!==THREE.NormalBlending&&(i.blending=this.blending),void 0!==this.side&&this.side!==THREE.FrontSide&&(i.side=this.side),1>this.opacity&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),0<this.alphaTest&&(i.alphaTest=this.alphaTest),!0===this.wireframe&&(i.wireframe=this.wireframe),1<this.wireframeLinewidth&&(i.wireframeLinewidth=this.wireframeLinewidth),r&&(r=e(t.textures),t=e(t.images),0<r.length&&(i.textures=r),0<t.length&&(i.images=t)),i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.side=t.side,this.opacity=t.opacity,this.transparent=t.transparent,this.blending=t.blending,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.alphaTest=t.alphaTest,this.overdraw=t.overdraw,this.visible=t.visible,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Material.prototype),THREE.MaterialIdCount=0,THREE.LineBasicMaterial=function(t){THREE.Material.call(this),this.type="LineBasicMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(t)},THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial,THREE.LineBasicMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.vertexColors=t.vertexColors,this.fog=t.fog,this},THREE.LineDashedMaterial=function(t){THREE.Material.call(this),this.type="LineDashedMaterial",this.color=new THREE.Color(16777215),this.scale=this.linewidth=1,this.dashSize=3,this.gapSize=1,this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(t)},THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial,THREE.LineDashedMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this.vertexColors=t.vertexColors,this.fog=t.fog,this},THREE.MeshBasicMaterial=function(t){THREE.Material.call(this),this.type="MeshBasicMaterial",this.color=new THREE.Color(16777215),this.aoMap=this.map=null,this.aoMapIntensity=1,this.envMap=this.alphaMap=this.specularMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphTargets=this.skinning=!1,this.setValues(t)},THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial,THREE.MeshBasicMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},THREE.MeshLambertMaterial=function(t){THREE.Material.call(this),this.type="MeshLambertMaterial",this.color=new THREE.Color(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new THREE.Color(0),this.emissiveIntensity=1,this.envMap=this.alphaMap=this.specularMap=this.emissiveMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)},THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial,THREE.MeshLambertMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},THREE.MeshPhongMaterial=function(t){THREE.Material.call(this),this.type="MeshPhongMaterial",this.color=new THREE.Color(16777215),this.specular=new THREE.Color(1118481),this.shininess=30,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new THREE.Color(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.specularMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)},THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial,THREE.MeshPhongMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},THREE.MeshStandardMaterial=function(t){THREE.Material.call(this),this.type="MeshStandardMaterial",this.color=new THREE.Color(16777215),this.metalness=this.roughness=.5,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new THREE.Color(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.metalnessMap=this.roughnessMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)},THREE.MeshStandardMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshStandardMaterial.prototype.constructor=THREE.MeshStandardMaterial,THREE.MeshStandardMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},THREE.MeshDepthMaterial=function(t){THREE.Material.call(this),this.type="MeshDepthMaterial",this.wireframe=this.morphTargets=!1,this.wireframeLinewidth=1,this.setValues(t)},THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial,THREE.MeshDepthMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},THREE.MeshNormalMaterial=function(t){THREE.Material.call(this,t),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(t)},THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial,THREE.MeshNormalMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},THREE.MultiMaterial=function(t){this.uuid=THREE.Math.generateUUID(),this.type="MultiMaterial",this.materials=t instanceof Array?t:[],this.visible=!0},THREE.MultiMaterial.prototype={constructor:THREE.MultiMaterial,toJSON:function(t){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},r=this.materials,i=0,n=r.length;i<n;i++){var o=r[i].toJSON(t);delete o.metadata,e.materials.push(o)}return e.visible=this.visible,e},clone:function(){for(var t=new this.constructor,e=0;e<this.materials.length;e++)t.materials.push(this.materials[e].clone());return t.visible=this.visible,t}},THREE.PointsMaterial=function(t){THREE.Material.call(this),this.type="PointsMaterial",this.color=new THREE.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(t)},THREE.PointsMaterial.prototype=Object.create(THREE.Material.prototype),THREE.PointsMaterial.prototype.constructor=THREE.PointsMaterial,THREE.PointsMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.vertexColors=t.vertexColors,this.fog=t.fog,this},THREE.ShaderMaterial=function(t){THREE.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.shading=THREE.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.lights=this.fog=!1,this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))},THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype),THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial,THREE.ShaderMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=THREE.UniformsUtils.clone(t.uniforms),this.defines=t.defines,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},THREE.ShaderMaterial.prototype.toJSON=function(t){return t=THREE.Material.prototype.toJSON.call(this,t),t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},THREE.RawShaderMaterial=function(t){THREE.ShaderMaterial.call(this,t),this.type="RawShaderMaterial"},THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype),THREE.RawShaderMaterial.prototype.constructor=THREE.RawShaderMaterial,THREE.SpriteMaterial=function(t){THREE.Material.call(this),this.type="SpriteMaterial",this.color=new THREE.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(t)},THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype),THREE.SpriteMaterial.prototype.constructor=THREE.SpriteMaterial,THREE.SpriteMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.fog=t.fog,this},THREE.Texture=function(t,e,r,i,n,o,a,s,h){Object.defineProperty(this,"id",{value:THREE.TextureIdCount++}),this.uuid=THREE.Math.generateUUID(),this.sourceFile=this.name="",this.image=void 0!==t?t:THREE.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:THREE.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==i?i:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==n?n:THREE.LinearFilter,this.minFilter=void 0!==o?o:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==h?h:1,this.format=void 0!==a?a:THREE.RGBAFormat,this.type=void 0!==s?s:THREE.UnsignedByteType,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.version=0,this.onUpdate=null},THREE.Texture.DEFAULT_IMAGE=void 0,THREE.Texture.DEFAULT_MAPPING=THREE.UVMapping,THREE.Texture.prototype={constructor:THREE.Texture,set needsUpdate(t){!0===t&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this},toJSON:function(t){if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var e={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=THREE.Math.generateUUID()),void 0===t.images[r.uuid]){var i,n=t.images,o=r.uuid,a=r.uuid;void 0!==r.toDataURL?i=r:(i=document.createElement("canvas"),i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0,r.width,r.height)),i=2048<i.width||2048<i.height?i.toDataURL("image/jpeg",.6):i.toDataURL("image/png"),n[o]={uuid:a,url:i}}e.image=r.uuid}return t.textures[this.uuid]=e},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===THREE.UVMapping){if(t.multiply(this.repeat),t.add(this.offset),0>t.x||1<t.x)switch(this.wrapS){case THREE.RepeatWrapping:t.x-=Math.floor(t.x);break;case THREE.ClampToEdgeWrapping:t.x=0>t.x?0:1;break;case THREE.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x-=Math.floor(t.x)}if(0>t.y||1<t.y)switch(this.wrapT){case THREE.RepeatWrapping:t.y-=Math.floor(t.y);break;case THREE.ClampToEdgeWrapping:t.y=0>t.y?0:1;break;case THREE.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y-=Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}},THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype),THREE.TextureIdCount=0,THREE.CanvasTexture=function(t,e,r,i,n,o,a,s,h){THREE.Texture.call(this,t,e,r,i,n,o,a,s,h),this.needsUpdate=!0},THREE.CanvasTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CanvasTexture.prototype.constructor=THREE.CanvasTexture,THREE.CubeTexture=function(t,e,r,i,n,o,a,s,h){e=void 0!==e?e:THREE.CubeReflectionMapping,THREE.Texture.call(this,t,e,r,i,n,o,a,s,h),this.images=t,this.flipY=!1},THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CubeTexture.prototype.constructor=THREE.CubeTexture,THREE.CubeTexture.prototype.copy=function(t){return THREE.Texture.prototype.copy.call(this,t),this.images=t.images,this},THREE.CompressedTexture=function(t,e,r,i,n,o,a,s,h,c,l){THREE.Texture.call(this,null,o,a,s,h,c,i,n,l),this.image={width:e,height:r},this.mipmaps=t,this.generateMipmaps=this.flipY=!1},THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture,THREE.DataTexture=function(t,e,r,i,n,o,a,s,h,c,l){THREE.Texture.call(this,null,o,a,s,h,c,i,n,l),this.image={data:t,width:e,height:r},this.magFilter=void 0!==h?h:THREE.NearestFilter,this.minFilter=void 0!==c?c:THREE.NearestFilter,this.generateMipmaps=this.flipY=!1},THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype),THREE.DataTexture.prototype.constructor=THREE.DataTexture,THREE.VideoTexture=function(t,e,r,i,n,o,a,s,h){function c(){requestAnimationFrame(c),t.readyState===t.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)}THREE.Texture.call(this,t,e,r,i,n,o,a,s,h),this.generateMipmaps=!1;var l=this;c()},THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype),THREE.VideoTexture.prototype.constructor=THREE.VideoTexture,THREE.Group=function(){THREE.Object3D.call(this),this.type="Group"},THREE.Group.prototype=Object.create(THREE.Object3D.prototype),THREE.Group.prototype.constructor=THREE.Group,THREE.Points=function(t,e){THREE.Object3D.call(this),this.type="Points",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.PointsMaterial({color:16777215*Math.random()})},THREE.Points.prototype=Object.create(THREE.Object3D.prototype),THREE.Points.prototype.constructor=THREE.Points,THREE.Points.prototype.raycast=function(){var t=new THREE.Matrix4,e=new THREE.Ray,r=new THREE.Sphere;return function(i,n){function o(t,r){var o=e.distanceSqToPoint(t);if(o<l){var s=e.closestPointToPoint(t);s.applyMatrix4(h);var c=i.ray.origin.distanceTo(s);c<i.near||c>i.far||n.push({distance:c,distanceToRay:Math.sqrt(o),point:s.clone(),index:r,face:null,object:a})}}var a=this,s=this.geometry,h=this.matrixWorld,c=i.params.Points.threshold;if(null===s.boundingSphere&&s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(h),!1!==i.ray.intersectsSphere(r)){t.getInverse(h),e.copy(i.ray).applyMatrix4(t);var l=(c=c/((this.scale.x+this.scale.y+this.scale.z)/3))*c,c=new THREE.Vector3;if(s instanceof THREE.BufferGeometry){var u=s.index,s=s.attributes.position.array;if(null!==u)for(var E=u.array,u=0,p=E.length;u<p;u++){var d=E[u];c.fromArray(s,3*d),o(c,d)}else for(u=0,E=s.length/3;u<E;u++)c.fromArray(s,3*u),o(c,u)}else for(c=s.vertices,u=0,E=c.length;u<E;u++)o(c[u],u)}}}(),THREE.Points.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},THREE.Line=function(t,e,r){if(1===r)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new THREE.LineSegments(t,e);THREE.Object3D.call(this),this.type="Line",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.LineBasicMaterial({color:16777215*Math.random()})},THREE.Line.prototype=Object.create(THREE.Object3D.prototype),THREE.Line.prototype.constructor=THREE.Line,THREE.Line.prototype.raycast=function(){var t=new THREE.Matrix4,e=new THREE.Ray,r=new THREE.Sphere;return function(i,n){var o=(o=i.linePrecision)*o,a=this.geometry,s=this.matrixWorld;if(null===a.boundingSphere&&a.computeBoundingSphere(),r.copy(a.boundingSphere),r.applyMatrix4(s),!1!==i.ray.intersectsSphere(r)){t.getInverse(s),e.copy(i.ray).applyMatrix4(t);var h=new THREE.Vector3,c=new THREE.Vector3,s=new THREE.Vector3,l=new THREE.Vector3,u=this instanceof THREE.LineSegments?2:1;if(a instanceof THREE.BufferGeometry){var E=a.index,p=a.attributes.position.array;if(null!==E)for(var E=E.array,a=0,d=E.length-1;a<d;a+=u){var f=E[a+1];h.fromArray(p,3*E[a]),c.fromArray(p,3*f),(f=e.distanceSqToSegment(h,c,l,s))>o||(l.applyMatrix4(this.matrixWorld),(f=i.ray.origin.distanceTo(l))<i.near||f>i.far||n.push({distance:f,point:s.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}else for(a=0,d=p.length/3-1;a<d;a+=u)h.fromArray(p,3*a),c.fromArray(p,3*a+3),(f=e.distanceSqToSegment(h,c,l,s))>o||(l.applyMatrix4(this.matrixWorld),(f=i.ray.origin.distanceTo(l))<i.near||f>i.far||n.push({distance:f,point:s.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}else if(a instanceof THREE.Geometry)for(h=a.vertices,c=h.length,a=0;a<c-1;a+=u)(f=e.distanceSqToSegment(h[a],h[a+1],l,s))>o||(l.applyMatrix4(this.matrixWorld),(f=i.ray.origin.distanceTo(l))<i.near||f>i.far||n.push({distance:f,point:s.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}}}(),THREE.Line.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},THREE.LineStrip=0,THREE.LinePieces=1,THREE.LineSegments=function(t,e){THREE.Line.call(this,t,e),this.type="LineSegments"},THREE.LineSegments.prototype=Object.create(THREE.Line.prototype),THREE.LineSegments.prototype.constructor=THREE.LineSegments,THREE.Mesh=function(t,e){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.drawMode=THREE.TrianglesDrawMode,this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.setDrawMode=function(t){this.drawMode=t},THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1,this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var t=0,e=this.geometry.morphTargets.length;t<e;t++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[t].name]=t}},THREE.Mesh.prototype.getMorphTargetIndexByName=function(t){return void 0!==this.morphTargetDictionary[t]?this.morphTargetDictionary[t]:(console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+t+" does not exist. Returning 0."),0)},THREE.Mesh.prototype.raycast=function(){function t(t,e,r,i,n,o,a){return THREE.Triangle.barycoordFromPoint(t,e,r,i,f),n.multiplyScalar(f.x),o.multiplyScalar(f.y),a.multiplyScalar(f.z),n.add(o).add(a),n.clone()}function e(t,e,r,i,n,o,a){var s=t.material;return null===(s.side===THREE.BackSide?r.intersectTriangle(o,n,i,!0,a):r.intersectTriangle(i,n,o,s.side!==THREE.DoubleSide,a))?null:(T.copy(a),T.applyMatrix4(t.matrixWorld),r=e.ray.origin.distanceTo(T),r<e.near||r>e.far?null:{distance:r,point:T.clone(),object:t})}function r(r,i,n,o,c,l,u,f){return a.fromArray(o,3*l),s.fromArray(o,3*u),h.fromArray(o,3*f),(r=e(r,i,n,a,s,h,m))&&(c&&(E.fromArray(c,2*l),p.fromArray(c,2*u),d.fromArray(c,2*f),r.uv=t(m,a,s,h,E,p,d)),r.face=new THREE.Face3(l,u,f,THREE.Triangle.normal(a,s,h)),r.faceIndex=l),r}var i=new THREE.Matrix4,n=new THREE.Ray,o=new THREE.Sphere,a=new THREE.Vector3,s=new THREE.Vector3,h=new THREE.Vector3,c=new THREE.Vector3,l=new THREE.Vector3,u=new THREE.Vector3,E=new THREE.Vector2,p=new THREE.Vector2,d=new THREE.Vector2,f=new THREE.Vector3,m=new THREE.Vector3,T=new THREE.Vector3;return function(f,T){var g=this.geometry,v=this.material,y=this.matrixWorld;if(void 0!==v&&(null===g.boundingSphere&&g.computeBoundingSphere(),o.copy(g.boundingSphere),o.applyMatrix4(y),!1!==f.ray.intersectsSphere(o)&&(i.getInverse(y),n.copy(f.ray).applyMatrix4(i),null===g.boundingBox||!1!==n.intersectsBox(g.boundingBox)))){var R,H;if(g instanceof THREE.BufferGeometry){var x,b,v=g.index,g=(y=g.attributes).position.array;if(void 0!==y.uv&&(R=y.uv.array),null!==v)for(var y=v.array,_=0,M=y.length;_<M;_+=3)v=y[_],x=y[_+1],b=y[_+2],(H=r(this,f,n,g,R,v,x,b))&&(H.faceIndex=Math.floor(_/3),T.push(H));else for(_=0,M=g.length;_<M;_+=9)v=_/3,x=v+1,b=v+2,(H=r(this,f,n,g,R,v,x,b))&&(H.index=v,T.push(H))}else if(g instanceof THREE.Geometry){var w,S,_=!0===(y=v instanceof THREE.MultiMaterial)?v.materials:null,M=g.vertices;x=g.faces,0<(b=g.faceVertexUvs[0]).length&&(R=b);for(var C=0,L=x.length;C<L;C++){var A=x[C];if(void 0!==(H=!0===y?_[A.materialIndex]:v)){if(b=M[A.a],w=M[A.b],S=M[A.c],!0===H.morphTargets){H=g.morphTargets;var P=this.morphTargetInfluences;a.set(0,0,0),s.set(0,0,0),h.set(0,0,0);for(var U=0,D=H.length;U<D;U++){var I=P[U];if(0!==I){var k=H[U].vertices;a.addScaledVector(c.subVectors(k[A.a],b),I),s.addScaledVector(l.subVectors(k[A.b],w),I),h.addScaledVector(u.subVectors(k[A.c],S),I)}}a.add(b),s.add(w),h.add(S),b=a,w=s,S=h}(H=e(this,f,n,b,w,S,m))&&(R&&(P=R[C],E.copy(P[0]),p.copy(P[1]),d.copy(P[2]),H.uv=t(m,b,w,S,E,p,d)),H.face=A,H.faceIndex=C,T.push(H))}}}}}}(),THREE.Mesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},THREE.Bone=function(t){THREE.Object3D.call(this),this.type="Bone",this.skin=t},THREE.Bone.prototype=Object.create(THREE.Object3D.prototype),THREE.Bone.prototype.constructor=THREE.Bone,THREE.Bone.prototype.copy=function(t){return THREE.Object3D.prototype.copy.call(this,t),this.skin=t.skin,this},THREE.Skeleton=function(t,e,r){if(this.useVertexTexture=void 0===r||r,this.identityMatrix=new THREE.Matrix4,t=t||[],this.bones=t.slice(0),this.useVertexTexture?(t=Math.sqrt(4*this.bones.length),t=THREE.Math.nextPowerOfTwo(Math.ceil(t)),this.boneTextureHeight=this.boneTextureWidth=t=Math.max(t,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType)):this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new THREE.Matrix4)},THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var r=new THREE.Matrix4;this.bones[t]&&r.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(r)}},THREE.Skeleton.prototype.pose=function(){for(var t,e=0,r=this.bones.length;e<r;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,r=this.bones.length;e<r;e++)(t=this.bones[e])&&(t.parent?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},THREE.Skeleton.prototype.update=function(){var t=new THREE.Matrix4;return function(){for(var e=0,r=this.bones.length;e<r;e++)t.multiplyMatrices(this.bones[e]?this.bones[e].matrixWorld:this.identityMatrix,this.boneInverses[e]),t.flattenToArrayOffset(this.boneMatrices,16*e);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),THREE.Skeleton.prototype.clone=function(){return new THREE.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)},THREE.SkinnedMesh=function(t,e,r){if(THREE.Mesh.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new THREE.Matrix4,this.bindMatrixInverse=new THREE.Matrix4,t=[],this.geometry&&void 0!==this.geometry.bones){for(var i,n=0,o=this.geometry.bones.length;n<o;++n)i=this.geometry.bones[n],e=new THREE.Bone(this),t.push(e),e.name=i.name,e.position.fromArray(i.pos),e.quaternion.fromArray(i.rotq),void 0!==i.scl&&e.scale.fromArray(i.scl);for(n=0,o=this.geometry.bones.length;n<o;++n)i=this.geometry.bones[n],-1!==i.parent&&null!==i.parent?t[i.parent].add(t[n]):this.add(t[n])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new THREE.Skeleton(t,void 0,r),this.matrixWorld)},THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh,THREE.SkinnedMesh.prototype.bind=function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},THREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(i=0;i<this.geometry.skinWeights.length;i++){var t=1/(e=this.geometry.skinWeights[i]).lengthManhattan();1/0!==t?e.multiplyScalar(t):e.set(1,0,0,0)}else if(this.geometry instanceof THREE.BufferGeometry)for(var e=new THREE.Vector4,r=this.geometry.attributes.skinWeight,i=0;i<r.count;i++)e.x=r.getX(i),e.y=r.getY(i),e.z=r.getZ(i),e.w=r.getW(i),t=1/e.lengthManhattan(),1/0!==t?e.multiplyScalar(t):e.set(1,0,0,0),r.setXYZW(i,e.x,e.y,e.z,e.w)},THREE.SkinnedMesh.prototype.updateMatrixWorld=function(t){THREE.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},THREE.SkinnedMesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)},THREE.LOD=function(){THREE.Object3D.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}})},THREE.LOD.prototype=Object.create(THREE.Object3D.prototype),THREE.LOD.prototype.constructor=THREE.LOD,THREE.LOD.prototype.addLevel=function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var r=this.levels,i=0;i<r.length&&!(e<r[i].distance);i++);r.splice(i,0,{distance:e,object:t}),this.add(t)},THREE.LOD.prototype.getObjectForDistance=function(t){for(var e=this.levels,r=1,i=e.length;r<i&&!(t<e[r].distance);r++);return e[r-1].object},THREE.LOD.prototype.raycast=function(){var t=new THREE.Vector3;return function(e,r){t.setFromMatrixPosition(this.matrixWorld);var i=e.ray.origin.distanceTo(t);this.getObjectForDistance(i).raycast(e,r)}}(),THREE.LOD.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r){var i=this.levels;if(1<i.length){t.setFromMatrixPosition(r.matrixWorld),e.setFromMatrixPosition(this.matrixWorld),r=t.distanceTo(e),i[0].object.visible=!0;for(var n=1,o=i.length;n<o&&r>=i[n].distance;n++)i[n-1].object.visible=!1,i[n].object.visible=!0;for(;n<o;n++)i[n].object.visible=!1}}}(),THREE.LOD.prototype.copy=function(t){THREE.Object3D.prototype.copy.call(this,t,!1);for(var e=0,r=(t=t.levels).length;e<r;e++){var i=t[e];this.addLevel(i.object.clone(),i.distance)}return this},THREE.LOD.prototype.toJSON=function(t){(t=THREE.Object3D.prototype.toJSON.call(this,t)).object.levels=[];for(var e=this.levels,r=0,i=e.length;r<i;r++){var n=e[r];t.object.levels.push({object:n.object.uuid,distance:n.distance})}return t},THREE.Sprite=function(){var t=new Uint16Array([0,1,2,0,2,3]),e=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),r=new Float32Array([0,0,1,0,1,1,0,1]),i=new THREE.BufferGeometry;return i.setIndex(new THREE.BufferAttribute(t,1)),i.addAttribute("position",new THREE.BufferAttribute(e,3)),i.addAttribute("uv",new THREE.BufferAttribute(r,2)),function(t){THREE.Object3D.call(this),this.type="Sprite",this.geometry=i,this.material=void 0!==t?t:new THREE.SpriteMaterial}}(),THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype),THREE.Sprite.prototype.constructor=THREE.Sprite,THREE.Sprite.prototype.raycast=function(){var t=new THREE.Vector3;return function(e,r){t.setFromMatrixPosition(this.matrixWorld);var i=e.ray.distanceSqToPoint(t);i>this.scale.x*this.scale.y||r.push({distance:Math.sqrt(i),point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(){return new this.constructor(this.material).copy(this)},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(t,e,r,i,n){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,r,i,n)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(t,e,r,i,n,o){void 0===e&&(e=-1),void 0===r&&(r=0),void 0===o&&(o=1),void 0===n&&(n=new THREE.Color(16777215)),void 0===i&&(i=THREE.NormalBlending),r=Math.min(r,Math.max(0,r)),this.lensFlares.push({texture:t,size:e,distance:r,x:0,y:0,z:0,scale:1,rotation:0,opacity:o,color:n,blending:i})},THREE.LensFlare.prototype.updateLensFlares=function(){var t,e,r=this.lensFlares.length,i=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(t=0;t<r;t++)e=this.lensFlares[t],e.x=this.positionScreen.x+i*e.distance,e.y=this.positionScreen.y+n*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)},THREE.LensFlare.prototype.copy=function(t){THREE.Object3D.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var e=0,r=t.lensFlares.length;e<r;e++)this.lensFlares.push(t.lensFlares[e]);return this},THREE.Scene=function(){THREE.Object3D.call(this),this.type="Scene",this.overrideMaterial=this.fog=null,this.autoUpdate=!0},THREE.Scene.prototype=Object.create(THREE.Object3D.prototype),THREE.Scene.prototype.constructor=THREE.Scene,THREE.Scene.prototype.copy=function(t){return THREE.Object3D.prototype.copy.call(this,t),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},THREE.Fog=function(t,e,r){this.name="",this.color=new THREE.Color(t),this.near=void 0!==e?e:1,this.far=void 0!==r?r:1e3},THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)},THREE.FogExp2=function(t,e){this.name="",this.color=new THREE.Color(t),this.density=void 0!==e?e:25e-5},THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)},THREE.ShaderChunk={},THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",THREE.ShaderChunk.ambient_pars="uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\treturn PI * ambientLightColor;\n}\n",THREE.ShaderChunk.aomap_fragment="#ifdef USE_AOMAP\n\treflectedLight.indirectDiffuse *= ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n#endif\n",THREE.ShaderChunk.aomap_pars_fragment="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",THREE.ShaderChunk.begin_vertex="\nvec3 transformed = vec3( position );\n",THREE.ShaderChunk.beginnormal_vertex="\nvec3 objectNormal = vec3( normal );\n",THREE.ShaderChunk.bsdfs="float calcLightAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif ( decayExponent > 0.0 ) {\n\t  return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = alpha * alpha;\n\tfloat gl = dotNL + pow( a2 + ( 1.0 - a2 ) * dotNL * dotNL, 0.5 );\n\tfloat gv = dotNV + pow( a2 + ( 1.0 - a2 ) * dotNV * dotNV, 0.5 );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = alpha * alpha;\n\tfloat denom = dotNH * dotNH * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / ( denom * denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = roughness * roughness;\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / square( ggxRoughness + 0.0001 ) - 2.0 );\n}",THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",THREE.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat square( const in float x ) { return x*x; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nvec3 inputToLinear( in vec3 a ) {\n\t#ifdef GAMMA_INPUT\n\t\treturn pow( a, vec3( float( GAMMA_FACTOR ) ) );\n\t#else\n\t\treturn a;\n\t#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n\t#ifdef GAMMA_OUTPUT\n\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n\t#else\n\t\treturn a;\n\t#endif\n}\n",THREE.ShaderChunk.defaultnormal_vertex="#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",THREE.ShaderChunk.displacementmap_vertex="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",THREE.ShaderChunk.displacementmap_pars_vertex="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",THREE.ShaderChunk.emissivemap_fragment="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = inputToLinear( emissiveColor.rgb );\n\ttotalEmissiveLight *= emissiveColor.rgb;\n#endif\n",THREE.ShaderChunk.emissivemap_pars_fragment="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor.xyz = inputToLinear( envColor.xyz );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",THREE.ShaderChunk.envmap_pars_fragment="#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\t\n\toutgoingLight = mix( outgoingLight, fogColor, fogFactor );\n#endif",THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",THREE.ShaderChunk.lights_lambert_vertex="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLight( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLight( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLight( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",THREE.ShaderChunk.lights_pars="#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLight( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLight( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= calcLightAttenuation( length( lVector ), pointLight.distance, pointLight.decay );\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat angleCos;\n\t\tfloat exponent;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLight( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat spotEffect = dot( directLight.direction, spotLight.direction );\n\t\tif ( spotEffect > spotLight.angleCos ) {\n\t\t\tfloat spotEffect = dot( spotLight.direction, directLight.direction );\n\t\t\tspotEffect = saturate( pow( saturate( spotEffect ), spotLight.exponent ) );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= ( spotEffect * calcLightAttenuation( length( lVector ), spotLight.distance, spotLight.decay ) );\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\treturn PI * mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#else\n\t\t\tvec3 envMapColor = vec3( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = inputToLinear( envMapColor.rgb );\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( square( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = inputToLinear( envMapColor.rgb );\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",THREE.ShaderChunk.lights_phong_fragment="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",THREE.ShaderChunk.lights_phong_pars_fragment="#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * PI * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",THREE.ShaderChunk.lights_phong_pars_vertex="#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",THREE.ShaderChunk.lights_phong_vertex="#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",THREE.ShaderChunk.lights_standard_fragment="StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",THREE.ShaderChunk.lights_standard_pars_fragment="struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * PI * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\n",THREE.ShaderChunk.lights_template="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLight( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLight( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLight( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tirradiance += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",THREE.ShaderChunk.linear_to_gamma_fragment="\n\toutgoingLight = linearToOutput( outgoingLight );\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor.xyz = inputToLinear( texelColor.xyz );\n\tdiffuseColor *= texelColor;\n#endif\n",THREE.ShaderChunk.map_pars_fragment="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n#endif\n",THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",THREE.ShaderChunk.metalnessmap_fragment="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",THREE.ShaderChunk.metalnessmap_pars_fragment="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",THREE.ShaderChunk.normal_fragment="#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",THREE.ShaderChunk.project_vertex="#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",THREE.ShaderChunk.roughnessmap_fragment="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",THREE.ShaderChunk.roughnessmap_pars_fragment="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec3 offset = vec3( - 1, 0, 1 ) * shadowRadius * 2.0 * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zzz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zxz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xzz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zzx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xzx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zzy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xzy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zyz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.zyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yzz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxz, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yzx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 21.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",THREE.ShaderChunk.shadowmask_pars_fragment="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned  = bindMatrixInverse * skinned;\n#endif\n",THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",THREE.ShaderChunk.uv2_pars_fragment="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",THREE.ShaderChunk.uv2_pars_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",THREE.ShaderChunk.uv2_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",THREE.ShaderChunk.uv_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",THREE.ShaderChunk.uv_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",THREE.ShaderChunk.uv_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",THREE.UniformsUtils={merge:function(t){for(var e={},r=0;r<t.length;r++){var i,n=this.clone(t[r]);for(i in n)e[i]=n[i]}return e},clone:function(t){var e,r={};for(e in t){r[e]={};for(var i in t[e]){var n=t[e][i];n instanceof THREE.Color||n instanceof THREE.Vector2||n instanceof THREE.Vector3||n instanceof THREE.Vector4||n instanceof THREE.Matrix3||n instanceof THREE.Matrix4||n instanceof THREE.Texture?r[e][i]=n.clone():Array.isArray(n)?r[e][i]=n.slice():r[e][i]=n}}return r}},THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98}},aomap:{aoMap:{type:"t",value:null},aoMapIntensity:{type:"f",value:1}},lightmap:{lightMap:{type:"t",value:null},lightMapIntensity:{type:"f",value:1}},emissivemap:{emissiveMap:{type:"t",value:null}},bumpmap:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},displacementmap:{displacementMap:{type:"t",value:null},displacementScale:{type:"f",value:1},displacementBias:{type:"f",value:0}},roughnessmap:{roughnessMap:{type:"t",value:null}},metalnessmap:{metalnessMap:{type:"t",value:null}},fog:{fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},ambient:{ambientLightColor:{type:"fv",value:[]}},lights:{directionalLights:{type:"sa",value:[],properties:{direction:{type:"v3"},color:{type:"c"},shadow:{type:"i"},shadowBias:{type:"f"},shadowRadius:{type:"f"},shadowMapSize:{type:"v2"}}},directionalShadowMap:{type:"tv",value:[]},directionalShadowMatrix:{type:"m4v",value:[]},spotLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},direction:{type:"v3"},distance:{type:"f"},angleCos:{type:"f"},exponent:{type:"f"},decay:{type:"f"},shadow:{type:"i"},shadowBias:{type:"f"},shadowRadius:{type:"f"},shadowMapSize:{type:"v2"}}},spotShadowMap:{type:"tv",value:[]},spotShadowMatrix:{type:"m4v",value:[]},pointLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},decay:{type:"f"},distance:{type:"f"},shadow:{type:"i"},shadowBias:{type:"f"},shadowRadius:{type:"f"},shadowMapSize:{type:"v2"}}},pointShadowMap:{type:"tv",value:[]},pointShadowMatrix:{type:"m4v",value:[]},hemisphereLights:{type:"sa",value:[],properties:{direction:{type:"v3"},skyColor:{type:"c"},groundColor:{type:"c"}}}},points:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)}}},THREE.ShaderLib={basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.aomap,THREE.UniformsLib.fog]),vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.uv_pars_vertex,THREE.ShaderChunk.uv2_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.uv_vertex,THREE.ShaderChunk.uv2_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinbase_vertex,"\t#ifdef USE_ENVMAP",THREE.ShaderChunk.beginnormal_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,"\t#endif",THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.uv_pars_fragment,THREE.ShaderChunk.uv2_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.aomap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,"\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );",THREE.ShaderChunk.aomap_fragment,"\tvec3 outgoingLight = reflectedLight.indirectDiffuse;",THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.aomap,THREE.UniformsLib.lightmap,THREE.UniformsLib.emissivemap,THREE.UniformsLib.fog,THREE.UniformsLib.ambient,THREE.UniformsLib.lights,{emissive:{type:"c",value:new THREE.Color(0)}}]),vertexShader:["#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.uv_pars_vertex,THREE.ShaderChunk.uv2_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.bsdfs,THREE.ShaderChunk.lights_pars,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.uv_vertex,THREE.ShaderChunk.uv2_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.beginnormal_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_lambert_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.uv_pars_fragment,THREE.ShaderChunk.uv2_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.aomap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.emissivemap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.bsdfs,THREE.ShaderChunk.ambient_pars,THREE.ShaderChunk.lights_pars,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.shadowmask_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveLight = emissive;",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,THREE.ShaderChunk.emissivemap_fragment,"\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );",THREE.ShaderChunk.lightmap_fragment,"\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();",THREE.ShaderChunk.aomap_fragment,"\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveLight;",THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.aomap,THREE.UniformsLib.lightmap,THREE.UniformsLib.emissivemap,THREE.UniformsLib.bumpmap,THREE.UniformsLib.normalmap,THREE.UniformsLib.displacementmap,THREE.UniformsLib.fog,THREE.UniformsLib.ambient,THREE.UniformsLib.lights,{emissive:{type:"c",value:new THREE.Color(0)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30}}]),vertexShader:["#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.uv_pars_vertex,THREE.ShaderChunk.uv2_pars_vertex,THREE.ShaderChunk.displacementmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_phong_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.uv_vertex,THREE.ShaderChunk.uv2_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.beginnormal_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif",THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.displacementmap_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"\tvViewPosition = - mvPosition.xyz;",THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_phong_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.uv_pars_fragment,THREE.ShaderChunk.uv2_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.aomap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.emissivemap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.bsdfs,THREE.ShaderChunk.ambient_pars,THREE.ShaderChunk.lights_pars,THREE.ShaderChunk.lights_phong_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.bumpmap_pars_fragment,THREE.ShaderChunk.normalmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveLight = emissive;",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,THREE.ShaderChunk.normal_fragment,THREE.ShaderChunk.emissivemap_fragment,THREE.ShaderChunk.lights_phong_fragment,THREE.ShaderChunk.lights_template,THREE.ShaderChunk.aomap_fragment,"vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;",THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},standard:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.aomap,THREE.UniformsLib.lightmap,THREE.UniformsLib.emissivemap,THREE.UniformsLib.bumpmap,THREE.UniformsLib.normalmap,THREE.UniformsLib.displacementmap,THREE.UniformsLib.roughnessmap,THREE.UniformsLib.metalnessmap,THREE.UniformsLib.fog,THREE.UniformsLib.ambient,THREE.UniformsLib.lights,{emissive:{type:"c",value:new THREE.Color(0)},roughness:{type:"f",value:.5},metalness:{type:"f",value:0},envMapIntensity:{type:"f",value:1}}]),vertexShader:["#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.uv_pars_vertex,THREE.ShaderChunk.uv2_pars_vertex,THREE.ShaderChunk.displacementmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.uv_vertex,THREE.ShaderChunk.uv2_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.beginnormal_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif",THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.displacementmap_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"\tvViewPosition = - mvPosition.xyz;",THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.uv_pars_fragment,THREE.ShaderChunk.uv2_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.aomap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.emissivemap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.bsdfs,THREE.ShaderChunk.ambient_pars,THREE.ShaderChunk.lights_pars,THREE.ShaderChunk.lights_standard_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.bumpmap_pars_fragment,THREE.ShaderChunk.normalmap_pars_fragment,THREE.ShaderChunk.roughnessmap_pars_fragment,THREE.ShaderChunk.metalnessmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveLight = emissive;",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,THREE.ShaderChunk.roughnessmap_fragment,THREE.ShaderChunk.metalnessmap_fragment,THREE.ShaderChunk.normal_fragment,THREE.ShaderChunk.emissivemap_fragment,THREE.ShaderChunk.lights_standard_fragment,THREE.ShaderChunk.lights_template,THREE.ShaderChunk.aomap_fragment,"vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;",THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},points:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.points,THREE.UniformsLib.fog]),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.project_vertex,"\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif",THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphatest_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},dashed:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,{scale:{type:"f",value:1},dashSize:{type:"f",value:1},totalSize:{type:"f",value:2}}]),vertexShader:["uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")},distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new THREE.Vector3(0,0,0)}},vertexShader:["varying vec4 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.worldpos_vertex,"vWorldPosition = worldPosition;\n}"].join("\n"),fragmentShader:["uniform vec3 lightPos;\nvarying vec4 vWorldPosition;",THREE.ShaderChunk.common,"vec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res; \n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}"].join("\n")}},THREE.WebGLRenderer=function(t){function e(t,e,r,i){!0===D&&(t*=i,e*=i,r*=i),gt.clearColor(t,e,r,i)}function r(){gt.init(),gt.scissor(K.copy(at).multiplyScalar(ot)),gt.viewport($.copy(ht).multiplyScalar(ot)),e(et.r,et.g,et.b,rt)}function i(){Q=W=null,Z="",Y=-1,gt.reset()}function n(t){t.preventDefault(),i(),r(),vt.clear()}function o(t){(t=t.target).removeEventListener("dispose",o);t:{var e=vt.get(t);if(t.image&&e.__image__webglTextureCube)ft.deleteTexture(e.__image__webglTextureCube);else{if(void 0===e.__webglInit)break t;ft.deleteTexture(e.__webglTexture)}vt.delete(t)}pt.textures--}function a(t){(t=t.target).removeEventListener("dispose",a);var e=vt.get(t),r=vt.get(t.texture);if(t&&void 0!==r.__webglTexture){if(ft.deleteTexture(r.__webglTexture),t instanceof THREE.WebGLRenderTargetCube)for(r=0;6>r;r++)ft.deleteFramebuffer(e.__webglFramebuffer[r]),ft.deleteRenderbuffer(e.__webglDepthbuffer[r]);else ft.deleteFramebuffer(e.__webglFramebuffer),ft.deleteRenderbuffer(e.__webglDepthbuffer);vt.delete(t.texture),vt.delete(t)}pt.textures--}function s(t){(t=t.target).removeEventListener("dispose",s),h(t),vt.delete(t)}function h(t){var e=vt.get(t).program;t.program=void 0,void 0!==e&&Rt.releaseProgram(e)}function c(t,e){return Math.abs(e[0])-Math.abs(t[0])}function l(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function u(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function E(t,e,r,i,n){var o;r.transparent?(i=V,o=++N):(i=F,o=++B),void 0!==(o=i[o])?(o.id=t.id,o.object=t,o.geometry=e,o.material=r,o.z=ut.z,o.group=n):(o={id:t.id,object:t,geometry:e,material:r,z:ut.z,group:n},i.push(o))}function p(t,e){if(!1!==t.visible){if(t.layers.test(e.layers))if(t instanceof THREE.Light)k.push(t);else if(t instanceof THREE.Sprite)!1!==t.frustumCulled&&!0!==ct.intersectsObject(t)||G.push(t);else if(t instanceof THREE.LensFlare)z.push(t);else if(t instanceof THREE.ImmediateRenderObject)!0===j.sortObjects&&(ut.setFromMatrixPosition(t.matrixWorld),ut.applyProjection(lt)),E(t,null,t.material,ut.z,null);else if((t instanceof THREE.Mesh||t instanceof THREE.Line||t instanceof THREE.Points)&&(t instanceof THREE.SkinnedMesh&&t.skeleton.update(),(!1===t.frustumCulled||!0===ct.intersectsObject(t))&&!0===(o=t.material).visible)){!0===j.sortObjects&&(ut.setFromMatrixPosition(t.matrixWorld),ut.applyProjection(lt));var r=yt.update(t);if(o instanceof THREE.MultiMaterial)for(var i=r.groups,n=o.materials,o=0,a=i.length;o<a;o++){var s=i[o],h=n[s.materialIndex];!0===h.visible&&E(t,r,h,ut.z,s)}else E(t,r,o,ut.z,null)}for(o=0,a=(r=t.children).length;o<a;o++)p(r[o],e)}}function d(t,e,r,i){for(var n=0,o=t.length;n<o;n++){var a=(c=t[n]).object,s=c.geometry,h=void 0===i?c.material:i,c=c.group;if(a.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,a.matrixWorld),a.normalMatrix.getNormalMatrix(a.modelViewMatrix),a instanceof THREE.ImmediateRenderObject){f(h);var l=m(e,r,h,a);Z="",a.render(function(t){j.renderBufferImmediate(t,l,h)})}else j.renderBufferDirect(e,r,s,h,a,c)}}function f(t){t.side!==THREE.DoubleSide?gt.enable(ft.CULL_FACE):gt.disable(ft.CULL_FACE),gt.setFlipSided(t.side===THREE.BackSide),!0===t.transparent?gt.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha):gt.setBlending(THREE.NoBlending),gt.setDepthFunc(t.depthFunc),gt.setDepthTest(t.depthTest),gt.setDepthWrite(t.depthWrite),gt.setColorWrite(t.colorWrite),gt.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function m(t,e,r,i){tt=0;var n=vt.get(r);if(void 0===n.program&&(r.needsUpdate=!0),void 0!==n.lightsHash&&n.lightsHash!==Et.hash&&(r.needsUpdate=!0),r.needsUpdate){t:{var o=vt.get(r),a=Rt.getParameters(r,Et,e,i),c=Rt.getProgramCode(r,a),l=o.program,u=!0;if(void 0===l)r.addEventListener("dispose",s);else if(l.code!==c)h(r);else{if(void 0!==a.shaderID)break t;u=!1}if(u&&(a.shaderID?(l=THREE.ShaderLib[a.shaderID],o.__webglShader={name:r.type,uniforms:THREE.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}):o.__webglShader={name:r.type,uniforms:r.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader},r.__webglShader=o.__webglShader,l=Rt.acquireProgram(r,a,c),o.program=l,r.program=l),a=l.getAttributes(),r.morphTargets)for(c=r.numSupportedMorphTargets=0;c<j.maxMorphTargets;c++)0<=a["morphTarget"+c]&&r.numSupportedMorphTargets++;if(r.morphNormals)for(c=r.numSupportedMorphNormals=0;c<j.maxMorphNormals;c++)0<=a["morphNormal"+c]&&r.numSupportedMorphNormals++;o.uniformsList=[];var E,a=o.__webglShader.uniforms,c=o.program.getUniforms();for(E in a)(l=c[E])&&o.uniformsList.push([o.__webglShader.uniforms[E],l]);for((r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshStandardMaterial||r.lights)&&(o.lightsHash=Et.hash,a.ambientLightColor.value=Et.ambient,a.directionalLights.value=Et.directional,a.spotLights.value=Et.spot,a.pointLights.value=Et.point,a.hemisphereLights.value=Et.hemi,a.directionalShadowMap.value=Et.directionalShadowMap,a.directionalShadowMatrix.value=Et.directionalShadowMatrix,a.spotShadowMap.value=Et.spotShadowMap,a.spotShadowMatrix.value=Et.spotShadowMatrix,a.pointShadowMap.value=Et.pointShadowMap,a.pointShadowMatrix.value=Et.pointShadowMatrix),o.hasDynamicUniforms=!1,E=0,a=o.uniformsList.length;E<a;E++)if(!0===o.uniformsList[E][0].dynamic){o.hasDynamicUniforms=!0;break}}r.needsUpdate=!1}if(l=c=u=!1,o=n.program,E=o.getUniforms(),a=n.__webglShader.uniforms,o.id!==W&&(ft.useProgram(o.program),W=o.id,l=c=u=!0),r.id!==Y&&(Y=r.id,c=!0),(u||t!==Q)&&(ft.uniformMatrix4fv(E.projectionMatrix,!1,t.projectionMatrix.elements),Tt.logarithmicDepthBuffer&&ft.uniform1f(E.logDepthBufFC,2/(Math.log(t.far+1)/Math.LN2)),t!==Q&&(Q=t,l=c=!0),(r instanceof THREE.ShaderMaterial||r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshStandardMaterial||r.envMap)&&void 0!==E.cameraPosition&&(ut.setFromMatrixPosition(t.matrixWorld),ft.uniform3f(E.cameraPosition,ut.x,ut.y,ut.z)),(r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshBasicMaterial||r instanceof THREE.MeshStandardMaterial||r instanceof THREE.ShaderMaterial||r.skinning)&&void 0!==E.viewMatrix&&ft.uniformMatrix4fv(E.viewMatrix,!1,t.matrixWorldInverse.elements)),r.skinning&&(i.bindMatrix&&void 0!==E.bindMatrix&&ft.uniformMatrix4fv(E.bindMatrix,!1,i.bindMatrix.elements),i.bindMatrixInverse&&void 0!==E.bindMatrixInverse&&ft.uniformMatrix4fv(E.bindMatrixInverse,!1,i.bindMatrixInverse.elements),Tt.floatVertexTextures&&i.skeleton&&i.skeleton.useVertexTexture?(void 0!==E.boneTexture&&(u=T(),ft.uniform1i(E.boneTexture,u),j.setTexture(i.skeleton.boneTexture,u)),void 0!==E.boneTextureWidth&&ft.uniform1i(E.boneTextureWidth,i.skeleton.boneTextureWidth),void 0!==E.boneTextureHeight&&ft.uniform1i(E.boneTextureHeight,i.skeleton.boneTextureHeight)):i.skeleton&&i.skeleton.boneMatrices&&void 0!==E.boneGlobalMatrices&&ft.uniformMatrix4fv(E.boneGlobalMatrices,!1,i.skeleton.boneMatrices)),c){if((r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshStandardMaterial||r.lights)&&(c=l,a.ambientLightColor.needsUpdate=c,a.directionalLights.needsUpdate=c,a.pointLights.needsUpdate=c,a.spotLights.needsUpdate=c,a.hemisphereLights.needsUpdate=c),e&&r.fog&&(a.fogColor.value=e.color,e instanceof THREE.Fog?(a.fogNear.value=e.near,a.fogFar.value=e.far):e instanceof THREE.FogExp2&&(a.fogDensity.value=e.density)),r instanceof THREE.MeshBasicMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshStandardMaterial){a.opacity.value=r.opacity,a.diffuse.value=r.color,r.emissive&&a.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),a.map.value=r.map,a.specularMap.value=r.specularMap,a.alphaMap.value=r.alphaMap,r.aoMap&&(a.aoMap.value=r.aoMap,a.aoMapIntensity.value=r.aoMapIntensity);var p;r.map?p=r.map:r.specularMap?p=r.specularMap:r.displacementMap?p=r.displacementMap:r.normalMap?p=r.normalMap:r.bumpMap?p=r.bumpMap:r.roughnessMap?p=r.roughnessMap:r.metalnessMap?p=r.metalnessMap:r.alphaMap?p=r.alphaMap:r.emissiveMap&&(p=r.emissiveMap),void 0!==p&&(p instanceof THREE.WebGLRenderTarget&&(p=p.texture),e=p.offset,p=p.repeat,a.offsetRepeat.value.set(e.x,e.y,p.x,p.y)),a.envMap.value=r.envMap,a.flipEnvMap.value=r.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,a.reflectivity.value=r.reflectivity,a.refractionRatio.value=r.refractionRatio}r instanceof THREE.LineBasicMaterial?(a.diffuse.value=r.color,a.opacity.value=r.opacity):r instanceof THREE.LineDashedMaterial?(a.diffuse.value=r.color,a.opacity.value=r.opacity,a.dashSize.value=r.dashSize,a.totalSize.value=r.dashSize+r.gapSize,a.scale.value=r.scale):r instanceof THREE.PointsMaterial?(a.diffuse.value=r.color,a.opacity.value=r.opacity,a.size.value=r.size*ot,a.scale.value=S.clientHeight/2,a.map.value=r.map,null!==r.map&&(p=r.map.offset,r=r.map.repeat,a.offsetRepeat.value.set(p.x,p.y,r.x,r.y))):r instanceof THREE.MeshLambertMaterial?(r.lightMap&&(a.lightMap.value=r.lightMap,a.lightMapIntensity.value=r.lightMapIntensity),r.emissiveMap&&(a.emissiveMap.value=r.emissiveMap)):r instanceof THREE.MeshPhongMaterial?(a.specular.value=r.specular,a.shininess.value=Math.max(r.shininess,1e-4),r.lightMap&&(a.lightMap.value=r.lightMap,a.lightMapIntensity.value=r.lightMapIntensity),r.emissiveMap&&(a.emissiveMap.value=r.emissiveMap),r.bumpMap&&(a.bumpMap.value=r.bumpMap,a.bumpScale.value=r.bumpScale),r.normalMap&&(a.normalMap.value=r.normalMap,a.normalScale.value.copy(r.normalScale)),r.displacementMap&&(a.displacementMap.value=r.displacementMap,a.displacementScale.value=r.displacementScale,a.displacementBias.value=r.displacementBias)):r instanceof THREE.MeshStandardMaterial?(a.roughness.value=r.roughness,a.metalness.value=r.metalness,r.roughnessMap&&(a.roughnessMap.value=r.roughnessMap),r.metalnessMap&&(a.metalnessMap.value=r.metalnessMap),r.lightMap&&(a.lightMap.value=r.lightMap,a.lightMapIntensity.value=r.lightMapIntensity),r.emissiveMap&&(a.emissiveMap.value=r.emissiveMap),r.bumpMap&&(a.bumpMap.value=r.bumpMap,a.bumpScale.value=r.bumpScale),r.normalMap&&(a.normalMap.value=r.normalMap,a.normalScale.value.copy(r.normalScale)),r.displacementMap&&(a.displacementMap.value=r.displacementMap,a.displacementScale.value=r.displacementScale,a.displacementBias.value=r.displacementBias),r.envMap&&(a.envMapIntensity.value=r.envMapIntensity)):r instanceof THREE.MeshDepthMaterial?(a.mNear.value=t.near,a.mFar.value=t.far,a.opacity.value=r.opacity):r instanceof THREE.MeshNormalMaterial&&(a.opacity.value=r.opacity),g(n.uniformsList)}if(ft.uniformMatrix4fv(E.modelViewMatrix,!1,i.modelViewMatrix.elements),E.normalMatrix&&ft.uniformMatrix3fv(E.normalMatrix,!1,i.normalMatrix.elements),void 0!==E.modelMatrix&&ft.uniformMatrix4fv(E.modelMatrix,!1,i.matrixWorld.elements),!0===n.hasDynamicUniforms){for(r=[],p=0,e=(n=n.uniformsList).length;p<e;p++)E=n[p][0],void 0!==(a=E.onUpdateCallback)&&(a.bind(E)(i,t),r.push(n[p]));g(r)}return o}function T(){var t=tt;return t>=Tt.maxTextures&&console.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+Tt.maxTextures),tt+=1,t}function g(t){for(var e,r,i=0,n=t.length;i<n;i++){var o=t[i][0];if(!1!==o.needsUpdate){var a=o.type;e=o.value;var s=t[i][1];switch(a){case"1i":ft.uniform1i(s,e);break;case"1f":ft.uniform1f(s,e);break;case"2f":ft.uniform2f(s,e[0],e[1]);break;case"3f":ft.uniform3f(s,e[0],e[1],e[2]);break;case"4f":ft.uniform4f(s,e[0],e[1],e[2],e[3]);break;case"1iv":ft.uniform1iv(s,e);break;case"3iv":ft.uniform3iv(s,e);break;case"1fv":ft.uniform1fv(s,e);break;case"2fv":ft.uniform2fv(s,e);break;case"3fv":ft.uniform3fv(s,e);break;case"4fv":ft.uniform4fv(s,e);break;case"Matrix2fv":ft.uniformMatrix2fv(s,!1,e);break;case"Matrix3fv":ft.uniformMatrix3fv(s,!1,e);break;case"Matrix4fv":ft.uniformMatrix4fv(s,!1,e);break;case"i":ft.uniform1i(s,e);break;case"f":ft.uniform1f(s,e);break;case"v2":ft.uniform2f(s,e.x,e.y);break;case"v3":ft.uniform3f(s,e.x,e.y,e.z);break;case"v4":ft.uniform4f(s,e.x,e.y,e.z,e.w);break;case"c":ft.uniform3f(s,e.r,e.g,e.b);break;case"sa":for(a=0;a<e.length;a++)for(var h in o.properties){var c=s[a][h];switch(r=e[a][h],o.properties[h].type){case"i":ft.uniform1i(c,r);break;case"f":ft.uniform1f(c,r);break;case"v2":ft.uniform2f(c,r.x,r.y);break;case"v3":ft.uniform3f(c,r.x,r.y,r.z);break;case"v4":ft.uniform4f(c,r.x,r.y,r.z,r.w);break;case"c":ft.uniform3f(c,r.r,r.g,r.b);break;case"m4":ft.uniformMatrix4fv(c,!1,r.elements)}}break;case"iv1":ft.uniform1iv(s,e);break;case"iv":ft.uniform3iv(s,e);break;case"fv1":ft.uniform1fv(s,e);break;case"fv":ft.uniform3fv(s,e);break;case"v2v":for(void 0===o._array&&(o._array=new Float32Array(2*e.length)),r=a=0,c=e.length;a<c;a++,r+=2)o._array[r+0]=e[a].x,o._array[r+1]=e[a].y;ft.uniform2fv(s,o._array);break;case"v3v":for(void 0===o._array&&(o._array=new Float32Array(3*e.length)),r=a=0,c=e.length;a<c;a++,r+=3)o._array[r+0]=e[a].x,o._array[r+1]=e[a].y,o._array[r+2]=e[a].z;ft.uniform3fv(s,o._array);break;case"v4v":for(void 0===o._array&&(o._array=new Float32Array(4*e.length)),r=a=0,c=e.length;a<c;a++,r+=4)o._array[r+0]=e[a].x,o._array[r+1]=e[a].y,o._array[r+2]=e[a].z,o._array[r+3]=e[a].w;ft.uniform4fv(s,o._array);break;case"m2":ft.uniformMatrix2fv(s,!1,e.elements);break;case"m3":ft.uniformMatrix3fv(s,!1,e.elements);break;case"m3v":for(void 0===o._array&&(o._array=new Float32Array(9*e.length)),a=0,c=e.length;a<c;a++)e[a].flattenToArrayOffset(o._array,9*a);ft.uniformMatrix3fv(s,!1,o._array);break;case"m4":ft.uniformMatrix4fv(s,!1,e.elements);break;case"m4v":for(void 0===o._array&&(o._array=new Float32Array(16*e.length)),a=0,c=e.length;a<c;a++)e[a].flattenToArrayOffset(o._array,16*a);ft.uniformMatrix4fv(s,!1,o._array);break;case"t":if(r=T(),ft.uniform1i(s,r),!e)continue;e instanceof THREE.CubeTexture||Array.isArray(e.image)&&6===e.image.length?H(e,r):e instanceof THREE.WebGLRenderTargetCube?x(e.texture,r):e instanceof THREE.WebGLRenderTarget?j.setTexture(e.texture,r):j.setTexture(e,r);break;case"tv":for(void 0===o._array&&(o._array=[]),a=0,c=o.value.length;a<c;a++)o._array[a]=T();for(ft.uniform1iv(s,o._array),a=0,c=o.value.length;a<c;a++)e=o.value[a],r=o._array[a],e&&(e instanceof THREE.CubeTexture||e.image instanceof Array&&6===e.image.length?H(e,r):e instanceof THREE.WebGLRenderTarget?j.setTexture(e.texture,r):e instanceof THREE.WebGLRenderTargetCube?x(e.texture,r):j.setTexture(e,r));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+a)}}}}function v(t,e,r){r?(ft.texParameteri(t,ft.TEXTURE_WRAP_S,w(e.wrapS)),ft.texParameteri(t,ft.TEXTURE_WRAP_T,w(e.wrapT)),ft.texParameteri(t,ft.TEXTURE_MAG_FILTER,w(e.magFilter)),ft.texParameteri(t,ft.TEXTURE_MIN_FILTER,w(e.minFilter))):(ft.texParameteri(t,ft.TEXTURE_WRAP_S,ft.CLAMP_TO_EDGE),ft.texParameteri(t,ft.TEXTURE_WRAP_T,ft.CLAMP_TO_EDGE),e.wrapS===THREE.ClampToEdgeWrapping&&e.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",e),ft.texParameteri(t,ft.TEXTURE_MAG_FILTER,M(e.magFilter)),ft.texParameteri(t,ft.TEXTURE_MIN_FILTER,M(e.minFilter)),e.minFilter!==THREE.NearestFilter&&e.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",e)),!(r=mt.get("EXT_texture_filter_anisotropic"))||e.type===THREE.FloatType&&null===mt.get("OES_texture_float_linear")||e.type===THREE.HalfFloatType&&null===mt.get("OES_texture_half_float_linear")||!(1<e.anisotropy||vt.get(e).__currentAnisotropy)||(ft.texParameterf(t,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,j.getMaxAnisotropy())),vt.get(e).__currentAnisotropy=e.anisotropy)}function y(t,e){if(t.width>e||t.height>e){var r=e/Math.max(t.width,t.height),i=document.createElement("canvas");return i.width=Math.floor(t.width*r),i.height=Math.floor(t.height*r),i.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+i.width+"x"+i.height,t),i}return t}function R(t){return THREE.Math.isPowerOfTwo(t.width)&&THREE.Math.isPowerOfTwo(t.height)}function H(t,e){var r=vt.get(t);if(6===t.image.length)if(0<t.version&&r.__version!==t.version){r.__image__webglTextureCube||(t.addEventListener("dispose",o),r.__image__webglTextureCube=ft.createTexture(),pt.textures++),gt.activeTexture(ft.TEXTURE0+e),gt.bindTexture(ft.TEXTURE_CUBE_MAP,r.__image__webglTextureCube),ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var i=t instanceof THREE.CompressedTexture,n=t.image[0]instanceof THREE.DataTexture,a=[],s=0;6>s;s++)a[s]=!j.autoScaleCubemaps||i||n?n?t.image[s].image:t.image[s]:y(t.image[s],Tt.maxCubemapSize);var h=R(a[0]),c=w(t.format),l=w(t.type);for(v(ft.TEXTURE_CUBE_MAP,t,h),s=0;6>s;s++)if(i)for(var u,E=a[s].mipmaps,p=0,d=E.length;p<d;p++)u=E[p],t.format!==THREE.RGBAFormat&&t.format!==THREE.RGBFormat?-1<gt.getCompressedTextureFormats().indexOf(c)?gt.compressedTexImage2D(ft.TEXTURE_CUBE_MAP_POSITIVE_X+s,p,c,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):gt.texImage2D(ft.TEXTURE_CUBE_MAP_POSITIVE_X+s,p,c,u.width,u.height,0,c,l,u.data);else n?gt.texImage2D(ft.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,c,a[s].width,a[s].height,0,c,l,a[s].data):gt.texImage2D(ft.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,c,c,l,a[s]);t.generateMipmaps&&h&&ft.generateMipmap(ft.TEXTURE_CUBE_MAP),r.__version=t.version,t.onUpdate&&t.onUpdate(t)}else gt.activeTexture(ft.TEXTURE0+e),gt.bindTexture(ft.TEXTURE_CUBE_MAP,r.__image__webglTextureCube)}function x(t,e){gt.activeTexture(ft.TEXTURE0+e),gt.bindTexture(ft.TEXTURE_CUBE_MAP,vt.get(t).__webglTexture)}function b(t,e,r,i){var n=w(e.texture.format),o=w(e.texture.type);gt.texImage2D(i,0,n,e.width,e.height,0,n,o,null),ft.bindFramebuffer(ft.FRAMEBUFFER,t),ft.framebufferTexture2D(ft.FRAMEBUFFER,r,i,vt.get(e.texture).__webglTexture,0),ft.bindFramebuffer(ft.FRAMEBUFFER,null)}function _(t,e){ft.bindRenderbuffer(ft.RENDERBUFFER,t),e.depthBuffer&&!e.stencilBuffer?(ft.renderbufferStorage(ft.RENDERBUFFER,ft.DEPTH_COMPONENT16,e.width,e.height),ft.framebufferRenderbuffer(ft.FRAMEBUFFER,ft.DEPTH_ATTACHMENT,ft.RENDERBUFFER,t)):e.depthBuffer&&e.stencilBuffer?(ft.renderbufferStorage(ft.RENDERBUFFER,ft.DEPTH_STENCIL,e.width,e.height),ft.framebufferRenderbuffer(ft.FRAMEBUFFER,ft.DEPTH_STENCIL_ATTACHMENT,ft.RENDERBUFFER,t)):ft.renderbufferStorage(ft.RENDERBUFFER,ft.RGBA4,e.width,e.height),ft.bindRenderbuffer(ft.RENDERBUFFER,null)}function M(t){return t===THREE.NearestFilter||t===THREE.NearestMipMapNearestFilter||t===THREE.NearestMipMapLinearFilter?ft.NEAREST:ft.LINEAR}function w(t){var e;if(t===THREE.RepeatWrapping)return ft.REPEAT;if(t===THREE.ClampToEdgeWrapping)return ft.CLAMP_TO_EDGE;if(t===THREE.MirroredRepeatWrapping)return ft.MIRRORED_REPEAT;if(t===THREE.NearestFilter)return ft.NEAREST;if(t===THREE.NearestMipMapNearestFilter)return ft.NEAREST_MIPMAP_NEAREST;if(t===THREE.NearestMipMapLinearFilter)return ft.NEAREST_MIPMAP_LINEAR;if(t===THREE.LinearFilter)return ft.LINEAR;if(t===THREE.LinearMipMapNearestFilter)return ft.LINEAR_MIPMAP_NEAREST;if(t===THREE.LinearMipMapLinearFilter)return ft.LINEAR_MIPMAP_LINEAR;if(t===THREE.UnsignedByteType)return ft.UNSIGNED_BYTE;if(t===THREE.UnsignedShort4444Type)return ft.UNSIGNED_SHORT_4_4_4_4;if(t===THREE.UnsignedShort5551Type)return ft.UNSIGNED_SHORT_5_5_5_1;if(t===THREE.UnsignedShort565Type)return ft.UNSIGNED_SHORT_5_6_5;if(t===THREE.ByteType)return ft.BYTE;if(t===THREE.ShortType)return ft.SHORT;if(t===THREE.UnsignedShortType)return ft.UNSIGNED_SHORT;if(t===THREE.IntType)return ft.INT;if(t===THREE.UnsignedIntType)return ft.UNSIGNED_INT;if(t===THREE.FloatType)return ft.FLOAT;if(null!==(e=mt.get("OES_texture_half_float"))&&t===THREE.HalfFloatType)return e.HALF_FLOAT_OES;if(t===THREE.AlphaFormat)return ft.ALPHA;if(t===THREE.RGBFormat)return ft.RGB;if(t===THREE.RGBAFormat)return ft.RGBA;if(t===THREE.LuminanceFormat)return ft.LUMINANCE;if(t===THREE.LuminanceAlphaFormat)return ft.LUMINANCE_ALPHA;if(t===THREE.AddEquation)return ft.FUNC_ADD;if(t===THREE.SubtractEquation)return ft.FUNC_SUBTRACT;if(t===THREE.ReverseSubtractEquation)return ft.FUNC_REVERSE_SUBTRACT;if(t===THREE.ZeroFactor)return ft.ZERO;if(t===THREE.OneFactor)return ft.ONE;if(t===THREE.SrcColorFactor)return ft.SRC_COLOR;if(t===THREE.OneMinusSrcColorFactor)return ft.ONE_MINUS_SRC_COLOR;if(t===THREE.SrcAlphaFactor)return ft.SRC_ALPHA;if(t===THREE.OneMinusSrcAlphaFactor)return ft.ONE_MINUS_SRC_ALPHA;if(t===THREE.DstAlphaFactor)return ft.DST_ALPHA;if(t===THREE.OneMinusDstAlphaFactor)return ft.ONE_MINUS_DST_ALPHA;if(t===THREE.DstColorFactor)return ft.DST_COLOR;if(t===THREE.OneMinusDstColorFactor)return ft.ONE_MINUS_DST_COLOR;if(t===THREE.SrcAlphaSaturateFactor)return ft.SRC_ALPHA_SATURATE;if(null!==(e=mt.get("WEBGL_compressed_texture_s3tc"))){if(t===THREE.RGB_S3TC_DXT1_Format)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===THREE.RGBA_S3TC_DXT1_Format)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===THREE.RGBA_S3TC_DXT3_Format)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===THREE.RGBA_S3TC_DXT5_Format)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(null!==(e=mt.get("WEBGL_compressed_texture_pvrtc"))){if(t===THREE.RGB_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===THREE.RGB_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===THREE.RGBA_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===THREE.RGBA_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(null!==(e=mt.get("WEBGL_compressed_texture_etc1"))&&t===THREE.RGB_ETC1_Format)return e.COMPRESSED_RGB_ETC1_WEBGL;if(null!==(e=mt.get("EXT_blend_minmax"))){if(t===THREE.MinEquation)return e.MIN_EXT;if(t===THREE.MaxEquation)return e.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var S=void 0!==(t=t||{}).canvas?t.canvas:document.createElement("canvas"),C=void 0!==t.context?t.context:null,L=void 0!==t.alpha&&t.alpha,A=void 0===t.depth||t.depth,P=void 0===t.stencil||t.stencil,U=void 0!==t.antialias&&t.antialias,D=void 0===t.premultipliedAlpha||t.premultipliedAlpha,I=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,k=[],F=[],B=-1,V=[],N=-1,O=new Float32Array(8),G=[],z=[];this.domElement=S,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.gammaFactor=2,this.gammaOutput=this.gammaInput=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0;var j=this,W=null,X=null,q=null,Y=-1,Z="",Q=null,K=new THREE.Vector4,J=null,$=new THREE.Vector4,tt=0,et=new THREE.Color(0),rt=0,it=S.width,nt=S.height,ot=1,at=new THREE.Vector4(0,0,it,nt),st=!1,ht=new THREE.Vector4(0,0,it,nt),ct=new THREE.Frustum,lt=new THREE.Matrix4,ut=new THREE.Vector3,Et={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[],shadowsPointLight:0},pt={geometries:0,textures:0},dt={calls:0,vertices:0,faces:0,points:0};this.info={render:dt,memory:pt,programs:null};var ft;try{if(L={alpha:L,depth:A,stencil:P,antialias:U,premultipliedAlpha:D,preserveDrawingBuffer:I},null===(ft=C||S.getContext("webgl",L)||S.getContext("experimental-webgl",L))){if(null!==S.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}S.addEventListener("webglcontextlost",n,!1)}catch(t){console.error("THREE.WebGLRenderer: "+t)}var mt=new THREE.WebGLExtensions(ft);mt.get("OES_texture_float"),mt.get("OES_texture_float_linear"),mt.get("OES_texture_half_float"),mt.get("OES_texture_half_float_linear"),mt.get("OES_standard_derivatives"),mt.get("ANGLE_instanced_arrays"),mt.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var Tt=new THREE.WebGLCapabilities(ft,mt,t),gt=new THREE.WebGLState(ft,mt,w),vt=new THREE.WebGLProperties,yt=new THREE.WebGLObjects(ft,vt,this.info),Rt=new THREE.WebGLPrograms(this,Tt),Ht=new THREE.WebGLLights;this.info.programs=Rt.programs;var xt=new THREE.WebGLBufferRenderer(ft,mt,dt),bt=new THREE.WebGLIndexedBufferRenderer(ft,mt,dt);r(),this.context=ft,this.capabilities=Tt,this.extensions=mt,this.properties=vt,this.state=gt;var _t=new THREE.WebGLShadowMap(this,Et,yt);this.shadowMap=_t;var Mt=new THREE.SpritePlugin(this,G),wt=new THREE.LensFlarePlugin(this,z);this.getContext=function(){return ft},this.getContextAttributes=function(){return ft.getContextAttributes()},this.forceContextLoss=function(){mt.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){var t;return function(){if(void 0!==t)return t;var e=mt.get("EXT_texture_filter_anisotropic");return t=null!==e?ft.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return Tt.precision},this.getPixelRatio=function(){return ot},this.setPixelRatio=function(t){void 0!==t&&(ot=t,this.setSize(ht.z,ht.w,!1))},this.getSize=function(){return{width:it,height:nt}},this.setSize=function(t,e,r){it=t,nt=e,S.width=t*ot,S.height=e*ot,!1!==r&&(S.style.width=t+"px",S.style.height=e+"px"),this.setViewport(0,0,t,e)},this.setViewport=function(t,e,r,i){gt.viewport(ht.set(t,e,r,i))},this.setScissor=function(t,e,r,i){gt.scissor(at.set(t,e,r,i))},this.setScissorTest=function(t){gt.setScissorTest(st=t)},this.getClearColor=function(){return et},this.setClearColor=function(t,r){et.set(t),rt=void 0!==r?r:1,e(et.r,et.g,et.b,rt)},this.getClearAlpha=function(){return rt},this.setClearAlpha=function(t){rt=t,e(et.r,et.g,et.b,rt)},this.clear=function(t,e,r){var i=0;(void 0===t||t)&&(i|=ft.COLOR_BUFFER_BIT),(void 0===e||e)&&(i|=ft.DEPTH_BUFFER_BIT),(void 0===r||r)&&(i|=ft.STENCIL_BUFFER_BIT),ft.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,r,i){this.setRenderTarget(t),this.clear(e,r,i)},this.resetGLState=i,this.dispose=function(){S.removeEventListener("webglcontextlost",n,!1)},this.renderBufferImmediate=function(t,e,r){gt.initAttributes();var i=vt.get(t);if(t.hasPositions&&!i.position&&(i.position=ft.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=ft.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=ft.createBuffer()),t.hasColors&&!i.color&&(i.color=ft.createBuffer()),e=e.getAttributes(),t.hasPositions&&(ft.bindBuffer(ft.ARRAY_BUFFER,i.position),ft.bufferData(ft.ARRAY_BUFFER,t.positionArray,ft.DYNAMIC_DRAW),gt.enableAttribute(e.position),ft.vertexAttribPointer(e.position,3,ft.FLOAT,!1,0,0)),t.hasNormals){if(ft.bindBuffer(ft.ARRAY_BUFFER,i.normal),"MeshPhongMaterial"!==r.type&&"MeshStandardMaterial"!==r.type&&r.shading===THREE.FlatShading)for(var n=0,o=3*t.count;n<o;n+=9){var a=t.normalArray,s=(a[n+0]+a[n+3]+a[n+6])/3,h=(a[n+1]+a[n+4]+a[n+7])/3,c=(a[n+2]+a[n+5]+a[n+8])/3;a[n+0]=s,a[n+1]=h,a[n+2]=c,a[n+3]=s,a[n+4]=h,a[n+5]=c,a[n+6]=s,a[n+7]=h,a[n+8]=c}ft.bufferData(ft.ARRAY_BUFFER,t.normalArray,ft.DYNAMIC_DRAW),gt.enableAttribute(e.normal),ft.vertexAttribPointer(e.normal,3,ft.FLOAT,!1,0,0)}t.hasUvs&&r.map&&(ft.bindBuffer(ft.ARRAY_BUFFER,i.uv),ft.bufferData(ft.ARRAY_BUFFER,t.uvArray,ft.DYNAMIC_DRAW),gt.enableAttribute(e.uv),ft.vertexAttribPointer(e.uv,2,ft.FLOAT,!1,0,0)),t.hasColors&&r.vertexColors!==THREE.NoColors&&(ft.bindBuffer(ft.ARRAY_BUFFER,i.color),ft.bufferData(ft.ARRAY_BUFFER,t.colorArray,ft.DYNAMIC_DRAW),gt.enableAttribute(e.color),ft.vertexAttribPointer(e.color,3,ft.FLOAT,!1,0,0)),gt.disableUnusedAttributes(),ft.drawArrays(ft.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,r,i,n,o){f(i);var a=m(t,e,i,n),s=!1;if((t=r.id+"_"+a.id+"_"+i.wireframe)!==Z&&(Z=t,s=!0),void 0!==(e=n.morphTargetInfluences)){t=[];for(var h=0,s=e.length;h<s;h++){p=e[h];t.push([p,h])}t.sort(c),8<t.length&&(t.length=8);for(var l=r.morphAttributes,h=0,s=t.length;h<s;h++)p=t[h],O[h]=p[0],0!==p[0]?(e=p[1],!0===i.morphTargets&&l.position&&r.addAttribute("morphTarget"+h,l.position[e]),!0===i.morphNormals&&l.normal&&r.addAttribute("morphNormal"+h,l.normal[e])):(!0===i.morphTargets&&r.removeAttribute("morphTarget"+h),!0===i.morphNormals&&r.removeAttribute("morphNormal"+h));null!==(t=a.getUniforms()).morphTargetInfluences&&ft.uniform1fv(t.morphTargetInfluences,O),s=!0}if(e=r.index,h=r.attributes.position,!0===i.wireframe&&(e=yt.getWireframeAttribute(r)),null!==e?(t=bt).setIndex(e):t=xt,s){var u,s=void 0;if(r instanceof THREE.InstancedBufferGeometry&&null===(u=mt.get("ANGLE_instanced_arrays")))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{void 0===s&&(s=0),gt.initAttributes();var E,p=r.attributes,a=a.getAttributes(),l=i.defaultAttributeValues;for(E in a){var d=a[E];if(0<=d)if(void 0!==(R=p[E])){var T=R.itemSize,g=yt.getAttributeBuffer(R);if(R instanceof THREE.InterleavedBufferAttribute){var v=R.data,y=v.stride,R=R.offset;v instanceof THREE.InstancedInterleavedBuffer?(gt.enableAttributeAndDivisor(d,v.meshPerAttribute,u),void 0===r.maxInstancedCount&&(r.maxInstancedCount=v.meshPerAttribute*v.count)):gt.enableAttribute(d),ft.bindBuffer(ft.ARRAY_BUFFER,g),ft.vertexAttribPointer(d,T,ft.FLOAT,!1,y*v.array.BYTES_PER_ELEMENT,(s*y+R)*v.array.BYTES_PER_ELEMENT)}else R instanceof THREE.InstancedBufferAttribute?(gt.enableAttributeAndDivisor(d,R.meshPerAttribute,u),void 0===r.maxInstancedCount&&(r.maxInstancedCount=R.meshPerAttribute*R.count)):gt.enableAttribute(d),ft.bindBuffer(ft.ARRAY_BUFFER,g),ft.vertexAttribPointer(d,T,ft.FLOAT,!1,0,s*T*4)}else if(void 0!==l&&void 0!==(T=l[E]))switch(T.length){case 2:ft.vertexAttrib2fv(d,T);break;case 3:ft.vertexAttrib3fv(d,T);break;case 4:ft.vertexAttrib4fv(d,T);break;default:ft.vertexAttrib1fv(d,T)}}gt.disableUnusedAttributes()}null!==e&&ft.bindBuffer(ft.ELEMENT_ARRAY_BUFFER,yt.getAttributeBuffer(e))}if(u=1/0,null!==e?u=e.count:void 0!==h&&(u=h.count),E=r.drawRange.start,e=r.drawRange.count,h=null!==o?o.start:0,s=null!==o?o.count:1/0,o=Math.max(0,E,h),u=Math.min(0+u,E+e,h+s)-1,u=Math.max(0,u-o+1),n instanceof THREE.Mesh)if(!0===i.wireframe)gt.setLineWidth(i.wireframeLinewidth*(null===X?ot:1)),t.setMode(ft.LINES);else switch(n.drawMode){case THREE.TrianglesDrawMode:t.setMode(ft.TRIANGLES);break;case THREE.TriangleStripDrawMode:t.setMode(ft.TRIANGLE_STRIP);break;case THREE.TriangleFanDrawMode:t.setMode(ft.TRIANGLE_FAN)}else n instanceof THREE.Line?(void 0===(i=i.linewidth)&&(i=1),gt.setLineWidth(i*(null===X?ot:1)),n instanceof THREE.LineSegments?t.setMode(ft.LINES):t.setMode(ft.LINE_STRIP)):n instanceof THREE.Points&&t.setMode(ft.POINTS);r instanceof THREE.InstancedBufferGeometry&&0<r.maxInstancedCount?t.renderInstances(r,o,u):t.render(o,u)},this.render=function(t,e,r,i){if(!1==e instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var n=t.fog;Z="",Y=-1,Q=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.matrixWorldInverse.getInverse(e.matrixWorld),lt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),ct.setFromMatrix(lt),k.length=0,N=B=-1,G.length=0,z.length=0,p(t,e),F.length=B+1,V.length=N+1,!0===j.sortObjects&&(F.sort(l),V.sort(u));var o,a,s,h,c,E,f=k,m=0,T=0,g=0,v=e.matrixWorldInverse,y=0,H=0,x=0,b=0,_=0;for(o=Et.shadowsPointLight=0,a=f.length;o<a;o++)if(s=f[o],h=s.color,c=s.intensity,E=s.distance,s instanceof THREE.AmbientLight)m+=h.r*c,T+=h.g*c,g+=h.b*c;else if(s instanceof THREE.DirectionalLight){var M=Ht.get(s);M.color.copy(s.color).multiplyScalar(s.intensity),M.direction.setFromMatrixPosition(s.matrixWorld),ut.setFromMatrixPosition(s.target.matrixWorld),M.direction.sub(ut),M.direction.transformDirection(v),(M.shadow=s.castShadow)&&(M.shadowBias=s.shadow.bias,M.shadowRadius=s.shadow.radius,M.shadowMapSize=s.shadow.mapSize,Et.shadows[_++]=s),Et.directionalShadowMap[y]=s.shadow.map,Et.directionalShadowMatrix[y]=s.shadow.matrix,Et.directional[y++]=M}else s instanceof THREE.SpotLight?((M=Ht.get(s)).position.setFromMatrixPosition(s.matrixWorld),M.position.applyMatrix4(v),M.color.copy(h).multiplyScalar(c),M.distance=E,M.direction.setFromMatrixPosition(s.matrixWorld),ut.setFromMatrixPosition(s.target.matrixWorld),M.direction.sub(ut),M.direction.transformDirection(v),M.angleCos=Math.cos(s.angle),M.exponent=s.exponent,M.decay=0===s.distance?0:s.decay,(M.shadow=s.castShadow)&&(M.shadowBias=s.shadow.bias,M.shadowRadius=s.shadow.radius,M.shadowMapSize=s.shadow.mapSize,Et.shadows[_++]=s),Et.spotShadowMap[x]=s.shadow.map,Et.spotShadowMatrix[x]=s.shadow.matrix,Et.spot[x++]=M):s instanceof THREE.PointLight?((M=Ht.get(s)).position.setFromMatrixPosition(s.matrixWorld),M.position.applyMatrix4(v),M.color.copy(s.color).multiplyScalar(s.intensity),M.distance=s.distance,M.decay=0===s.distance?0:s.decay,(M.shadow=s.castShadow)&&(M.shadowBias=s.shadow.bias,M.shadowRadius=s.shadow.radius,M.shadowMapSize=s.shadow.mapSize,Et.shadows[_++]=s),Et.pointShadowMap[H]=s.shadow.map,void 0===Et.pointShadowMatrix[H]&&(Et.pointShadowMatrix[H]=new THREE.Matrix4),ut.setFromMatrixPosition(s.matrixWorld).negate(),Et.pointShadowMatrix[H].identity().setPosition(ut),Et.point[H++]=M):s instanceof THREE.HemisphereLight&&((M=Ht.get(s)).direction.setFromMatrixPosition(s.matrixWorld),M.direction.transformDirection(v),M.direction.normalize(),M.skyColor.copy(s.color).multiplyScalar(c),M.groundColor.copy(s.groundColor).multiplyScalar(c),Et.hemi[b++]=M);Et.ambient[0]=m,Et.ambient[1]=T,Et.ambient[2]=g,Et.directional.length=y,Et.spot.length=x,Et.point.length=H,Et.hemi.length=b,Et.shadows.length=_,Et.hash=y+","+H+","+x+","+b+","+_,_t.render(t,e),dt.calls=0,dt.vertices=0,dt.faces=0,dt.points=0,void 0===r&&(r=null),this.setRenderTarget(r),(this.autoClear||i)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),t.overrideMaterial?(i=t.overrideMaterial,d(F,e,n,i),d(V,e,n,i)):(gt.setBlending(THREE.NoBlending),d(F,e,n),d(V,e,n)),Mt.render(t,e),wt.render(t,e,$),r&&(t=r.texture).generateMipmaps&&R(r)&&t.minFilter!==THREE.NearestFilter&&t.minFilter!==THREE.LinearFilter&&(t=r instanceof THREE.WebGLRenderTargetCube?ft.TEXTURE_CUBE_MAP:ft.TEXTURE_2D,r=vt.get(r.texture).__webglTexture,gt.bindTexture(t,r),ft.generateMipmap(t),gt.bindTexture(t,null)),gt.setDepthTest(!0),gt.setDepthWrite(!0),gt.setColorWrite(!0)}},this.setFaceCulling=function(t,e){t===THREE.CullFaceNone?gt.disable(ft.CULL_FACE):(e===THREE.FrontFaceDirectionCW?ft.frontFace(ft.CW):ft.frontFace(ft.CCW),t===THREE.CullFaceBack?ft.cullFace(ft.BACK):t===THREE.CullFaceFront?ft.cullFace(ft.FRONT):ft.cullFace(ft.FRONT_AND_BACK),gt.enable(ft.CULL_FACE))},this.setTexture=function(t,e){var r=vt.get(t);if(0<t.version&&r.__version!==t.version)if(void 0===(n=t.image))console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else if(!1===n.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t);else{void 0===r.__webglInit&&(r.__webglInit=!0,t.addEventListener("dispose",o),r.__webglTexture=ft.createTexture(),pt.textures++),gt.activeTexture(ft.TEXTURE0+e),gt.bindTexture(ft.TEXTURE_2D,r.__webglTexture),ft.pixelStorei(ft.UNPACK_FLIP_Y_WEBGL,t.flipY),ft.pixelStorei(ft.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),ft.pixelStorei(ft.UNPACK_ALIGNMENT,t.unpackAlignment);var i=y(t.image,Tt.maxTextureSize);(t.wrapS!==THREE.ClampToEdgeWrapping||t.wrapT!==THREE.ClampToEdgeWrapping||t.minFilter!==THREE.NearestFilter&&t.minFilter!==THREE.LinearFilter)&&!1===R(i)&&((n=i)instanceof HTMLImageElement||n instanceof HTMLCanvasElement?((a=document.createElement("canvas")).width=THREE.Math.nearestPowerOfTwo(n.width),a.height=THREE.Math.nearestPowerOfTwo(n.height),a.getContext("2d").drawImage(n,0,0,a.width,a.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+n.width+"x"+n.height+"). Resized to "+a.width+"x"+a.height,n),i=a):i=n);var n=R(i),a=w(t.format),s=w(t.type);v(ft.TEXTURE_2D,t,n);var h=t.mipmaps;if(t instanceof THREE.DataTexture)if(0<h.length&&n){for(var c=0,l=h.length;c<l;c++)i=h[c],gt.texImage2D(ft.TEXTURE_2D,c,a,i.width,i.height,0,a,s,i.data);t.generateMipmaps=!1}else gt.texImage2D(ft.TEXTURE_2D,0,a,i.width,i.height,0,a,s,i.data);else if(t instanceof THREE.CompressedTexture)for(c=0,l=h.length;c<l;c++)i=h[c],t.format!==THREE.RGBAFormat&&t.format!==THREE.RGBFormat?-1<gt.getCompressedTextureFormats().indexOf(a)?gt.compressedTexImage2D(ft.TEXTURE_2D,c,a,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):gt.texImage2D(ft.TEXTURE_2D,c,a,i.width,i.height,0,a,s,i.data);else if(0<h.length&&n){for(c=0,l=h.length;c<l;c++)i=h[c],gt.texImage2D(ft.TEXTURE_2D,c,a,a,s,i);t.generateMipmaps=!1}else gt.texImage2D(ft.TEXTURE_2D,0,a,a,s,i);t.generateMipmaps&&n&&ft.generateMipmap(ft.TEXTURE_2D),r.__version=t.version,t.onUpdate&&t.onUpdate(t)}else gt.activeTexture(ft.TEXTURE0+e),gt.bindTexture(ft.TEXTURE_2D,r.__webglTexture)},this.setRenderTarget=function(t){if((X=t)&&void 0===vt.get(t).__webglFramebuffer){var e=vt.get(t),r=vt.get(t.texture);t.addEventListener("dispose",a),r.__webglTexture=ft.createTexture(),pt.textures++;var i=t instanceof THREE.WebGLRenderTargetCube,n=THREE.Math.isPowerOfTwo(t.width)&&THREE.Math.isPowerOfTwo(t.height);if(i){e.__webglFramebuffer=[];for(var o=0;6>o;o++)e.__webglFramebuffer[o]=ft.createFramebuffer()}else e.__webglFramebuffer=ft.createFramebuffer();if(i){for(gt.bindTexture(ft.TEXTURE_CUBE_MAP,r.__webglTexture),v(ft.TEXTURE_CUBE_MAP,t.texture,n),o=0;6>o;o++)b(e.__webglFramebuffer[o],t,ft.COLOR_ATTACHMENT0,ft.TEXTURE_CUBE_MAP_POSITIVE_X+o);t.texture.generateMipmaps&&n&&ft.generateMipmap(ft.TEXTURE_CUBE_MAP),gt.bindTexture(ft.TEXTURE_CUBE_MAP,null)}else gt.bindTexture(ft.TEXTURE_2D,r.__webglTexture),v(ft.TEXTURE_2D,t.texture,n),b(e.__webglFramebuffer,t,ft.COLOR_ATTACHMENT0,ft.TEXTURE_2D),t.texture.generateMipmaps&&n&&ft.generateMipmap(ft.TEXTURE_2D),gt.bindTexture(ft.TEXTURE_2D,null);if(t.depthBuffer){if(e=vt.get(t),t instanceof THREE.WebGLRenderTargetCube)for(e.__webglDepthbuffer=[],r=0;6>r;r++)ft.bindFramebuffer(ft.FRAMEBUFFER,e.__webglFramebuffer[r]),e.__webglDepthbuffer[r]=ft.createRenderbuffer(),_(e.__webglDepthbuffer[r],t);else ft.bindFramebuffer(ft.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=ft.createRenderbuffer(),_(e.__webglDepthbuffer,t);ft.bindFramebuffer(ft.FRAMEBUFFER,null)}}e=t instanceof THREE.WebGLRenderTargetCube,t?(r=vt.get(t),r=e?r.__webglFramebuffer[t.activeCubeFace]:r.__webglFramebuffer,K.copy(t.scissor),J=t.scissorTest,$.copy(t.viewport)):(r=null,K.copy(at).multiplyScalar(ot),J=st,$.copy(ht).multiplyScalar(ot)),q!==r&&(ft.bindFramebuffer(ft.FRAMEBUFFER,r),q=r),gt.scissor(K),gt.setScissorTest(J),gt.viewport($),e&&(e=vt.get(t.texture),ft.framebufferTexture2D(ft.FRAMEBUFFER,ft.COLOR_ATTACHMENT0,ft.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,e.__webglTexture,0))},this.readRenderTargetPixels=function(t,e,r,i,n,o){if(!1==t instanceof THREE.WebGLRenderTarget)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var a=vt.get(t).__webglFramebuffer;if(a){var s=!1;a!==q&&(ft.bindFramebuffer(ft.FRAMEBUFFER,a),s=!0);try{var h=t.texture;h.format!==THREE.RGBAFormat&&w(h.format)!==ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):h.type===THREE.UnsignedByteType||w(h.type)===ft.getParameter(ft.IMPLEMENTATION_COLOR_READ_TYPE)||h.type===THREE.FloatType&&mt.get("WEBGL_color_buffer_float")||h.type===THREE.HalfFloatType&&mt.get("EXT_color_buffer_half_float")?ft.checkFramebufferStatus(ft.FRAMEBUFFER)===ft.FRAMEBUFFER_COMPLETE?ft.readPixels(e,r,i,n,w(h.format),w(h.type),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{s&&ft.bindFramebuffer(ft.FRAMEBUFFER,q)}}}}},THREE.WebGLRenderTarget=function(t,e,r){this.uuid=THREE.Math.generateUUID(),this.width=t,this.height=e,this.scissor=new THREE.Vector4(0,0,t,e),this.scissorTest=!1,this.viewport=new THREE.Vector4(0,0,t,e),void 0===(r=r||{}).minFilter&&(r.minFilter=THREE.LinearFilter),this.texture=new THREE.Texture(void 0,void 0,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy),this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer},THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.shareDepthFrom=t.shareDepthFrom,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube=function(t,e,r){THREE.WebGLRenderTarget.call(this,t,e,r),this.activeCubeFace=0},THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube,THREE.WebGLBufferRenderer=function(t,e,r){var i;this.setMode=function(t){i=t},this.render=function(e,n){t.drawArrays(i,e,n),r.calls++,r.vertices+=n,i===t.TRIANGLES&&(r.faces+=n/3)},this.renderInstances=function(n){var o=e.get("ANGLE_instanced_arrays");if(null===o)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{var a=n.attributes.position,s=0,s=a instanceof THREE.InterleavedBufferAttribute?a.data.count:a.count;o.drawArraysInstancedANGLE(i,0,s,n.maxInstancedCount),r.calls++,r.vertices+=s*n.maxInstancedCount,i===t.TRIANGLES&&(r.faces+=n.maxInstancedCount*s/3)}}},THREE.WebGLIndexedBufferRenderer=function(t,e,r){var i,n,o;this.setMode=function(t){i=t},this.setIndex=function(r){r.array instanceof Uint32Array&&e.get("OES_element_index_uint")?(n=t.UNSIGNED_INT,o=4):(n=t.UNSIGNED_SHORT,o=2)},this.render=function(e,a){t.drawElements(i,a,n,e*o),r.calls++,r.vertices+=a,i===t.TRIANGLES&&(r.faces+=a/3)},this.renderInstances=function(a,s,h){var c=e.get("ANGLE_instanced_arrays");null===c?console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(c.drawElementsInstancedANGLE(i,h,n,s*o,a.maxInstancedCount),r.calls++,r.vertices+=h*a.maxInstancedCount,i===t.TRIANGLES&&(r.faces+=a.maxInstancedCount*h/3))}},THREE.WebGLExtensions=function(t){var e={};this.get=function(r){if(void 0!==e[r])return e[r];var i;switch(r){case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":i=t.getExtension("WEBGL_compressed_texture_etc1");break;default:i=t.getExtension(r)}return null===i&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),e[r]=i}},THREE.WebGLCapabilities=function(t,e,r){function i(e){if("highp"===e){if(0<t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision&&0<t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision)return"highp";e="mediump"}return"mediump"===e&&0<t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision&&0<t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision?"mediump":"lowp"}this.getMaxPrecision=i,this.precision=void 0!==r.precision?r.precision:"highp",this.logarithmicDepthBuffer=void 0!==r.logarithmicDepthBuffer&&r.logarithmicDepthBuffer,this.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxVertexTextures=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxCubemapSize=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),this.maxAttributes=t.getParameter(t.MAX_VERTEX_ATTRIBS),this.maxVertexUniforms=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),this.maxVaryings=t.getParameter(t.MAX_VARYING_VECTORS),this.maxFragmentUniforms=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),this.vertexTextures=0<this.maxVertexTextures,this.floatFragmentTextures=!!e.get("OES_texture_float"),this.floatVertexTextures=this.vertexTextures&&this.floatFragmentTextures,(r=i(this.precision))!==this.precision&&(console.warn("THREE.WebGLRenderer:",this.precision,"not supported, using",r,"instead."),this.precision=r),this.logarithmicDepthBuffer&&(this.logarithmicDepthBuffer=!!e.get("EXT_frag_depth"))},THREE.WebGLGeometries=function(t,e,r){function i(t){var a=t.target;null!==(t=o[a.id]).index&&n(t.index);var s,h=t.attributes;for(s in h)n(h[s]);a.removeEventListener("dispose",i),delete o[a.id],(s=e.get(a)).wireframe&&n(s.wireframe),e.delete(a),(a=e.get(t)).wireframe&&n(a.wireframe),e.delete(t),r.memory.geometries--}function n(r){var i;void 0!==(i=r instanceof THREE.InterleavedBufferAttribute?e.get(r.data).__webglBuffer:e.get(r).__webglBuffer)&&(t.deleteBuffer(i),r instanceof THREE.InterleavedBufferAttribute?e.delete(r.data):e.delete(r))}var o={};this.get=function(t){var e=t.geometry;if(void 0!==o[e.id])return o[e.id];e.addEventListener("dispose",i);var n;return e instanceof THREE.BufferGeometry?n=e:e instanceof THREE.Geometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new THREE.BufferGeometry).setFromObject(t)),n=e._bufferGeometry),o[e.id]=n,r.memory.geometries++,n}},THREE.WebGLLights=function(){var t={};this.get=function(e){if(void 0!==t[e.id])return t[e.id];var r;switch(e.type){case"DirectionalLight":r={direction:new THREE.Vector3,color:new THREE.Color,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new THREE.Vector2};break;case"SpotLight":r={position:new THREE.Vector3,direction:new THREE.Vector3,color:new THREE.Color,distance:0,angleCos:0,exponent:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new THREE.Vector2};break;case"PointLight":r={position:new THREE.Vector3,color:new THREE.Color,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new THREE.Vector2};break;case"HemisphereLight":r={direction:new THREE.Vector3,skyColor:new THREE.Color,groundColor:new THREE.Color}}return t[e.id]=r}},THREE.WebGLObjects=function(t,e,r){function i(r,i){var n=r instanceof THREE.InterleavedBufferAttribute?r.data:r,o=e.get(n);void 0===o.__webglBuffer?(o.__webglBuffer=t.createBuffer(),t.bindBuffer(i,o.__webglBuffer),t.bufferData(i,n.array,n.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW),o.version=n.version):o.version!==n.version&&(t.bindBuffer(i,o.__webglBuffer),!1===n.dynamic||-1===n.updateRange.count?t.bufferSubData(i,0,n.array):0===n.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(i,n.updateRange.offset*n.array.BYTES_PER_ELEMENT,n.array.subarray(n.updateRange.offset,n.updateRange.offset+n.updateRange.count)),n.updateRange.count=0),o.version=n.version)}function n(t,e,r){if(e>r){var i=e;e=r,r=i}return i=t[e],void 0===i?(t[e]=[r],!0):-1===i.indexOf(r)&&(i.push(r),!0)}var o=new THREE.WebGLGeometries(t,e,r);this.getAttributeBuffer=function(t){return t instanceof THREE.InterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer},this.getWireframeAttribute=function(r){var o=e.get(r);if(void 0!==o.wireframe)return o.wireframe;var a=[],s=r.index;if(r=(h=r.attributes).position,null!==s)for(var h={},s=s.array,c=0,l=s.length;c<l;c+=3){var u=s[c+0],E=s[c+1],p=s[c+2];n(h,u,E)&&a.push(u,E),n(h,E,p)&&a.push(E,p),n(h,p,u)&&a.push(p,u)}else for(s=h.position.array,c=0,l=s.length/3-1;c<l;c+=3)u=c+0,E=c+1,p=c+2,a.push(u,E,E,p,p,u);return a=new THREE.BufferAttribute(new(65535<r.count?Uint32Array:Uint16Array)(a),1),i(a,t.ELEMENT_ARRAY_BUFFER),o.wireframe=a},this.update=function(e){var r=o.get(e);e.geometry instanceof THREE.Geometry&&r.updateFromObject(e),e=r.index;a=r.attributes;null!==e&&i(e,t.ELEMENT_ARRAY_BUFFER);for(var n in a)i(a[n],t.ARRAY_BUFFER);e=r.morphAttributes;for(n in e)for(var a=e[n],s=0,h=a.length;s<h;s++)i(a[s],t.ARRAY_BUFFER);return r}},THREE.WebGLProgram=function(){function t(t,e,i){return t=t||{},[t.derivatives||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(r).join("\n")}function e(t){var e,r=[];for(e in t){var i=t[e];!1!==i&&r.push("#define "+e+" "+i)}return r.join("\n")}function r(t){return""!==t}function i(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function n(t){return t.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,r,i){for(t="",e=parseInt(e);e<parseInt(r);e++)t+=i.replace(/\[ i \]/g,"[ "+e+" ]");return t})}var o=0,a=/^([\w\d_]+)\.([\w\d_]+)$/,s=/^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,h=/^([\w\d_]+)\[0\]$/;return function(c,l,u,E){var p=c.context,d=u.extensions,f=u.defines,m=u.__webglShader.vertexShader,T=u.__webglShader.fragmentShader,g="SHADOWMAP_TYPE_BASIC";E.shadowMapType===THREE.PCFShadowMap?g="SHADOWMAP_TYPE_PCF":E.shadowMapType===THREE.PCFSoftShadowMap&&(g="SHADOWMAP_TYPE_PCF_SOFT");var v="ENVMAP_TYPE_CUBE",y="ENVMAP_MODE_REFLECTION",R="ENVMAP_BLENDING_MULTIPLY";if(E.envMap){switch(u.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:v="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:v="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:v="ENVMAP_TYPE_SPHERE"}switch(u.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:y="ENVMAP_MODE_REFRACTION"}switch(u.combine){case THREE.MultiplyOperation:R="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:R="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:R="ENVMAP_BLENDING_ADD"}}var H=0<c.gammaFactor?c.gammaFactor:1,d=t(d,E,c.extensions),x=e(f),b=p.createProgram();u instanceof THREE.RawShaderMaterial?c=f="":(f=["precision "+E.precision+" float;","precision "+E.precision+" int;","#define SHADER_NAME "+u.__webglShader.name,x,E.supportsVertexTextures?"#define VERTEX_TEXTURES":"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+H,"#define MAX_BONES "+E.maxBones,E.map?"#define USE_MAP":"",E.envMap?"#define USE_ENVMAP":"",E.envMap?"#define "+y:"",E.lightMap?"#define USE_LIGHTMAP":"",E.aoMap?"#define USE_AOMAP":"",E.emissiveMap?"#define USE_EMISSIVEMAP":"",E.bumpMap?"#define USE_BUMPMAP":"",E.normalMap?"#define USE_NORMALMAP":"",E.displacementMap&&E.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",E.specularMap?"#define USE_SPECULARMAP":"",E.roughnessMap?"#define USE_ROUGHNESSMAP":"",E.metalnessMap?"#define USE_METALNESSMAP":"",E.alphaMap?"#define USE_ALPHAMAP":"",E.vertexColors?"#define USE_COLOR":"",E.flatShading?"#define FLAT_SHADED":"",E.skinning?"#define USE_SKINNING":"",E.useVertexTexture?"#define BONE_TEXTURE":"",E.morphTargets?"#define USE_MORPHTARGETS":"",E.morphNormals&&!1===E.flatShading?"#define USE_MORPHNORMALS":"",E.doubleSided?"#define DOUBLE_SIDED":"",E.flipSided?"#define FLIP_SIDED":"",E.shadowMapEnabled?"#define USE_SHADOWMAP":"",E.shadowMapEnabled?"#define "+g:"",0<E.pointLightShadows?"#define POINT_LIGHT_SHADOWS":"",E.sizeAttenuation?"#define USE_SIZEATTENUATION":"",E.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",E.logarithmicDepthBuffer&&c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(r).join("\n"),c=[d,"precision "+E.precision+" float;","precision "+E.precision+" int;","#define SHADER_NAME "+u.__webglShader.name,x,E.alphaTest?"#define ALPHATEST "+E.alphaTest:"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+H,E.useFog&&E.fog?"#define USE_FOG":"",E.useFog&&E.fogExp?"#define FOG_EXP2":"",E.map?"#define USE_MAP":"",E.envMap?"#define USE_ENVMAP":"",E.envMap?"#define "+v:"",E.envMap?"#define "+y:"",E.envMap?"#define "+R:"",E.lightMap?"#define USE_LIGHTMAP":"",E.aoMap?"#define USE_AOMAP":"",E.emissiveMap?"#define USE_EMISSIVEMAP":"",E.bumpMap?"#define USE_BUMPMAP":"",E.normalMap?"#define USE_NORMALMAP":"",E.specularMap?"#define USE_SPECULARMAP":"",E.roughnessMap?"#define USE_ROUGHNESSMAP":"",E.metalnessMap?"#define USE_METALNESSMAP":"",E.alphaMap?"#define USE_ALPHAMAP":"",E.vertexColors?"#define USE_COLOR":"",E.flatShading?"#define FLAT_SHADED":"",E.doubleSided?"#define DOUBLE_SIDED":"",E.flipSided?"#define FLIP_SIDED":"",E.shadowMapEnabled?"#define USE_SHADOWMAP":"",E.shadowMapEnabled?"#define "+g:"",0<E.pointLightShadows?"#define POINT_LIGHT_SHADOWS":"",E.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",E.logarithmicDepthBuffer&&c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",E.envMap&&c.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(r).join("\n")),m=i(m,E),T=i(T,E),!1==u instanceof THREE.ShaderMaterial&&(m=n(m),T=n(T)),T=c+T,m=THREE.WebGLShader(p,p.VERTEX_SHADER,f+m),T=THREE.WebGLShader(p,p.FRAGMENT_SHADER,T),p.attachShader(b,m),p.attachShader(b,T),void 0!==u.index0AttributeName?p.bindAttribLocation(b,0,u.index0AttributeName):!0===E.morphTargets&&p.bindAttribLocation(b,0,"position"),p.linkProgram(b),E=p.getProgramInfoLog(b),g=p.getShaderInfoLog(m),v=p.getShaderInfoLog(T),R=y=!0,!1===p.getProgramParameter(b,p.LINK_STATUS)?(y=!1,console.error("THREE.WebGLProgram: shader error: ",p.getError(),"gl.VALIDATE_STATUS",p.getProgramParameter(b,p.VALIDATE_STATUS),"gl.getProgramInfoLog",E,g,v)):""!==E?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",E):""!==g&&""!==v||(R=!1),R&&(this.diagnostics={runnable:y,material:u,programLog:E,vertexShader:{log:g,prefix:f},fragmentShader:{log:v,prefix:c}}),p.deleteShader(m),p.deleteShader(T);var _;this.getUniforms=function(){if(void 0===_){for(var t={},e=p.getProgramParameter(b,p.ACTIVE_UNIFORMS),r=0;r<e;r++){var i=p.getActiveUniform(b,r).name,n=p.getUniformLocation(b,i);if(o=a.exec(i)){var i=o[1],o=o[2];(c=t[i])||(c=t[i]={}),c[o]=n}else if(o=s.exec(i)){var c=o[1],i=o[2],o=o[3],l=t[c];l||(l=t[c]=[]),(c=l[i])||(c=l[i]={}),c[o]=n}else(o=h.exec(i))?(c=o[1],t[c]=n):t[i]=n}_=t}return _};var M;return this.getAttributes=function(){if(void 0===M){for(var t={},e=p.getProgramParameter(b,p.ACTIVE_ATTRIBUTES),r=0;r<e;r++){var i=p.getActiveAttrib(b,r).name;t[i]=p.getAttribLocation(b,i)}M=t}return M},this.destroy=function(){p.deleteProgram(b),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=o++,this.code=l,this.usedTimes=1,this.program=b,this.vertexShader=m,this.fragmentShader=T,this}}(),THREE.WebGLPrograms=function(t,e){var r=[],i={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshStandardMaterial:"standard",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},n="precision supportsVertexTextures map envMap envMapMode lightMap aoMap emissiveMap bumpMap normalMap displacementMap specularMap roughnessMap metalnessMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals numDirLights numPointLights numSpotLights numHemiLights shadowMapEnabled pointLightShadows shadowMapType alphaTest doubleSided flipSided".split(" ");this.getParameters=function(r,n,o,a){var s,h=i[r.type];e.floatVertexTextures&&a&&a.skeleton&&a.skeleton.useVertexTexture?s=1024:(s=Math.floor((e.maxVertexUniforms-20)/4),void 0!==a&&a instanceof THREE.SkinnedMesh&&(s=Math.min(a.skeleton.bones.length,s))<a.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+a.skeleton.bones.length+", this GPU supports just "+s+" (try OpenGL instead of ANGLE)"));var c=t.getPrecision();return null!==r.precision&&(c=e.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",c,"instead."),{shaderID:h,precision:c,supportsVertexTextures:e.vertexTextures,map:!!r.map,envMap:!!r.envMap,envMapMode:r.envMap&&r.envMap.mapping,lightMap:!!r.lightMap,aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,combine:r.combine,vertexColors:r.vertexColors,fog:o,useFog:r.fog,fogExp:o instanceof THREE.FogExp2,flatShading:r.shading===THREE.FlatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:e.logarithmicDepthBuffer,skinning:r.skinning,maxBones:s,useVertexTexture:e.floatVertexTextures&&a&&a.skeleton&&a.skeleton.useVertexTexture,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numHemiLights:n.hemi.length,pointLightShadows:n.shadowsPointLight,shadowMapEnabled:t.shadowMap.enabled&&a.receiveShadow&&0<n.shadows.length,shadowMapType:t.shadowMap.type,alphaTest:r.alphaTest,doubleSided:r.side===THREE.DoubleSide,flipSided:r.side===THREE.BackSide}},this.getProgramCode=function(t,e){var r=[];if(e.shaderID?r.push(e.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)r.push(i),r.push(t.defines[i]);for(i=0;i<n.length;i++){var o=n[i];r.push(o),r.push(e[o])}return r.join()},this.acquireProgram=function(e,i,n){for(var o,a=0,s=r.length;a<s;a++){var h=r[a];if(h.code===n){++(o=h).usedTimes;break}}return void 0===o&&(o=new THREE.WebGLProgram(t,n,e,i),r.push(o)),o},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},this.programs=r},THREE.WebGLProperties=function(){var t={};this.get=function(e){e=e.uuid;var r=t[e];return void 0===r&&(r={},t[e]=r),r},this.delete=function(e){delete t[e.uuid]},this.clear=function(){t={}}},THREE.WebGLShader=function(){function t(t){t=t.split("\n");for(var e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}return function(e,r,i){var n=e.createShader(r);return e.shaderSource(n,i),e.compileShader(n),!1===e.getShaderParameter(n,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",r===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(n),t(i)),n}}(),THREE.WebGLShadowMap=function(t,e,r){function i(t,e,r,i){var n=t.geometry,o=null,o=E,a=t.customDepthMaterial;return r&&(o=p,a=t.customDistanceMaterial),a?o=a:(t=t instanceof THREE.SkinnedMesh&&e.skinning,a=0,void 0!==n.morphTargets&&0<n.morphTargets.length&&e.morphTargets&&(a|=1),t&&(a|=2),o=o[a]),o.visible=e.visible,o.wireframe=e.wireframe,o.wireframeLinewidth=e.wireframeLinewidth,r&&void 0!==o.uniforms.lightPos&&o.uniforms.lightPos.value.copy(i),o}function n(t,e,r){if(!1!==t.visible){t.layers.test(e.layers)&&(t instanceof THREE.Mesh||t instanceof THREE.Line||t instanceof THREE.Points)&&t.castShadow&&(!1===t.frustumCulled||!0===s.intersectsObject(t))&&!0===t.material.visible&&(t.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,t.matrixWorld),u.push(t));for(var i=0,o=(t=t.children).length;i<o;i++)n(t[i],e,r)}}for(var o=t.context,a=t.state,s=new THREE.Frustum,h=new THREE.Matrix4,c=new THREE.Vector3,l=new THREE.Vector3,u=[],E=Array(4),p=Array(4),d=[new THREE.Vector3(1,0,0),new THREE.Vector3(-1,0,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1),new THREE.Vector3(0,1,0),new THREE.Vector3(0,-1,0)],f=[new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,-1)],m=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],T=THREE.ShaderLib.depthRGBA,g=THREE.UniformsUtils.clone(T.uniforms),v=THREE.ShaderLib.distanceRGBA,y=THREE.UniformsUtils.clone(v.uniforms),R=0;4!==R;++R){var H=0!=(1&R),x=0!=(2&R),b=new THREE.ShaderMaterial({uniforms:g,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,morphTargets:H,skinning:x});b._shadowPass=!0,E[R]=b,(H=new THREE.ShaderMaterial({uniforms:y,vertexShader:v.vertexShader,fragmentShader:v.fragmentShader,morphTargets:H,skinning:x}))._shadowPass=!0,p[R]=H}var _=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=THREE.PCFShadowMap,this.cullFace=THREE.CullFaceFront,this.render=function(E,p){var T,g;if(!1!==_.enabled&&(!1!==_.autoUpdate||!1!==_.needsUpdate)){a.clearColor(1,1,1,1),a.disable(o.BLEND),a.enable(o.CULL_FACE),o.frontFace(o.CCW),o.cullFace(_.cullFace===THREE.CullFaceFront?o.FRONT:o.BACK),a.setDepthTest(!0),a.setScissorTest(!1);for(var v=e.shadows,y=0,R=v.length;y<R;y++){var H=v[y],x=H.shadow,b=x.camera,M=x.mapSize;if(H instanceof THREE.PointLight){T=6,g=!0;var w=M.x/4,S=M.y/2;m[0].set(2*w,S,w,S),m[1].set(0,S,w,S),m[2].set(3*w,S,w,S),m[3].set(w,S,w,S),m[4].set(3*w,0,w,S),m[5].set(w,0,w,S)}else T=1,g=!1;for(null===x.map&&(x.map=new THREE.WebGLRenderTarget(M.x,M.y,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}),H instanceof THREE.SpotLight&&(b.aspect=M.x/M.y),b.updateProjectionMatrix()),M=x.map,x=x.matrix,l.setFromMatrixPosition(H.matrixWorld),b.position.copy(l),t.setRenderTarget(M),t.clear(),M=0;M<T;M++)for(g?(c.copy(b.position),c.add(d[M]),b.up.copy(f[M]),b.lookAt(c),a.viewport(m[M])):(c.setFromMatrixPosition(H.target.matrixWorld),b.lookAt(c)),b.updateMatrixWorld(),b.matrixWorldInverse.getInverse(b.matrixWorld),x.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),x.multiply(b.projectionMatrix),x.multiply(b.matrixWorldInverse),h.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),s.setFromMatrix(h),u.length=0,n(E,p,b),w=0,S=u.length;w<S;w++){var C=u[w],L=r.update(C);if((P=C.material)instanceof THREE.MultiMaterial)for(var A=L.groups,P=P.materials,U=0,D=A.length;U<D;U++){var I=A[U],k=P[I.materialIndex];!0===k.visible&&(k=i(C,k,g,l),t.renderBufferDirect(b,null,L,k,C,I))}else k=i(C,P,g,l),t.renderBufferDirect(b,null,L,k,C,null)}t.resetGLState()}T=t.getClearColor(),g=t.getClearAlpha(),t.setClearColor(T,g),a.enable(o.BLEND),_.cullFace===THREE.CullFaceFront&&o.cullFace(o.BACK),t.resetGLState(),_.needsUpdate=!1}}},THREE.WebGLState=function(t,e,r){var i=this,n=new THREE.Vector4,o=new Uint8Array(16),a=new Uint8Array(16),s=new Uint8Array(16),h={},c=null,l=null,u=null,E=null,p=null,d=null,f=null,m=null,T=null,g=null,v=null,y=null,R=null,H=null,x=null,b=null,_=null,M=null,w=null,S=null,C=null,L=null,A=null,P=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),U=void 0,D={},I=new THREE.Vector4,k=null,F=null,B=new THREE.Vector4,V=new THREE.Vector4;this.init=function(){this.clearColor(0,0,0,1),this.clearDepth(1),this.clearStencil(0),this.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),t.frontFace(t.CCW),t.cullFace(t.BACK),this.enable(t.CULL_FACE),this.enable(t.BLEND),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA)},this.initAttributes=function(){for(var t=0,e=o.length;t<e;t++)o[t]=0},this.enableAttribute=function(r){o[r]=1,0===a[r]&&(t.enableVertexAttribArray(r),a[r]=1),0!==s[r]&&(e.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(r,0),s[r]=0)},this.enableAttributeAndDivisor=function(e,r,i){o[e]=1,0===a[e]&&(t.enableVertexAttribArray(e),a[e]=1),s[e]!==r&&(i.vertexAttribDivisorANGLE(e,r),s[e]=r)},this.disableUnusedAttributes=function(){for(var e=0,r=a.length;e<r;e++)a[e]!==o[e]&&(t.disableVertexAttribArray(e),a[e]=0)},this.enable=function(e){!0!==h[e]&&(t.enable(e),h[e]=!0)},this.disable=function(e){!1!==h[e]&&(t.disable(e),h[e]=!1)},this.getCompressedTextureFormats=function(){if(null===c&&(c=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var r=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),i=0;i<r.length;i++)c.push(r[i]);return c},this.setBlending=function(e,i,n,o,a,s,h){e===THREE.NoBlending?this.disable(t.BLEND):this.enable(t.BLEND),e!==l&&(e===THREE.AdditiveBlending?(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)):e===THREE.SubtractiveBlending?(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR)):e===THREE.MultiplyBlending?(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)),l=e),e===THREE.CustomBlending?(a=a||i,s=s||n,h=h||o,i===u&&a===d||(t.blendEquationSeparate(r(i),r(a)),u=i,d=a),n===E&&o===p&&s===f&&h===m||(t.blendFuncSeparate(r(n),r(o),r(s),r(h)),E=n,p=o,f=s,m=h)):m=f=d=p=E=u=null},this.setDepthFunc=function(e){if(T!==e){if(e)switch(e){case THREE.NeverDepth:t.depthFunc(t.NEVER);break;case THREE.AlwaysDepth:t.depthFunc(t.ALWAYS);break;case THREE.LessDepth:t.depthFunc(t.LESS);break;case THREE.LessEqualDepth:t.depthFunc(t.LEQUAL);break;case THREE.EqualDepth:t.depthFunc(t.EQUAL);break;case THREE.GreaterEqualDepth:t.depthFunc(t.GEQUAL);break;case THREE.GreaterDepth:t.depthFunc(t.GREATER);break;case THREE.NotEqualDepth:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);T=e}},this.setDepthTest=function(e){e?this.enable(t.DEPTH_TEST):this.disable(t.DEPTH_TEST)},this.setDepthWrite=function(e){g!==e&&(t.depthMask(e),g=e)},this.setColorWrite=function(e){v!==e&&(t.colorMask(e,e,e,e),v=e)},this.setStencilFunc=function(e,r,i){R===e&&H===r&&x===i||(t.stencilFunc(e,r,i),R=e,H=r,x=i)},this.setStencilOp=function(e,r,i){b===e&&_===r&&M===i||(t.stencilOp(e,r,i),b=e,_=r,M=i)},this.setStencilTest=function(e){e?this.enable(t.STENCIL_TEST):this.disable(t.STENCIL_TEST)},this.setStencilWrite=function(e){y!==e&&(t.stencilMask(e),y=e)},this.setFlipSided=function(e){w!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),w=e)},this.setLineWidth=function(e){e!==S&&(t.lineWidth(e),S=e)},this.setPolygonOffset=function(e,r,i){e?this.enable(t.POLYGON_OFFSET_FILL):this.disable(t.POLYGON_OFFSET_FILL),!e||C===r&&L===i||(t.polygonOffset(r,i),C=r,L=i)},this.getScissorTest=function(){return A},this.setScissorTest=function(e){(A=e)?this.enable(t.SCISSOR_TEST):this.disable(t.SCISSOR_TEST)},this.activeTexture=function(e){void 0===e&&(e=t.TEXTURE0+P-1),U!==e&&(t.activeTexture(e),U=e)},this.bindTexture=function(e,r){void 0===U&&i.activeTexture();var n=D[U];void 0===n&&(n={type:void 0,texture:void 0},D[U]=n),n.type===e&&n.texture===r||(t.bindTexture(e,r),n.type=e,n.texture=r)},this.compressedTexImage2D=function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error(t)}},this.texImage2D=function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error(t)}},this.clearColor=function(e,r,i,o){n.set(e,r,i,o),!1===I.equals(n)&&(t.clearColor(e,r,i,o),I.copy(n))},this.clearDepth=function(e){k!==e&&(t.clearDepth(e),k=e)},this.clearStencil=function(e){F!==e&&(t.clearStencil(e),F=e)},this.scissor=function(e){!1===B.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),B.copy(e))},this.viewport=function(e){!1===V.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),V.copy(e))},this.reset=function(){for(var e=0;e<a.length;e++)1===a[e]&&(t.disableVertexAttribArray(e),a[e]=0);h={},w=y=g=v=l=c=null}},THREE.LensFlarePlugin=function(t,e){var r,i,n,o,a,s,h,c,l,u,E,p,d,f,m,T,g=t.context,v=t.state;this.render=function(y,R,H){if(0!==e.length){y=new THREE.Vector3;var x=H.w/H.z,b=.5*H.z,_=.5*H.w,M=16/H.w,w=new THREE.Vector2(M*x,M),S=new THREE.Vector3(1,1,0),C=new THREE.Vector2(1,1);if(void 0===d){var M=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),L=new Uint16Array([0,1,2,0,2,3]);E=g.createBuffer(),p=g.createBuffer(),g.bindBuffer(g.ARRAY_BUFFER,E),g.bufferData(g.ARRAY_BUFFER,M,g.STATIC_DRAW),g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,p),g.bufferData(g.ELEMENT_ARRAY_BUFFER,L,g.STATIC_DRAW),m=g.createTexture(),T=g.createTexture(),v.bindTexture(g.TEXTURE_2D,m),g.texImage2D(g.TEXTURE_2D,0,g.RGB,16,16,0,g.RGB,g.UNSIGNED_BYTE,null),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.NEAREST),v.bindTexture(g.TEXTURE_2D,T),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,16,16,0,g.RGBA,g.UNSIGNED_BYTE,null),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.NEAREST);var M=(f=0<g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},L=g.createProgram(),A=g.createShader(g.FRAGMENT_SHADER),P=g.createShader(g.VERTEX_SHADER),U="precision "+t.getPrecision()+" float;\n";g.shaderSource(A,U+M.fragmentShader),g.shaderSource(P,U+M.vertexShader),g.compileShader(A),g.compileShader(P),g.attachShader(L,A),g.attachShader(L,P),g.linkProgram(L),d=L,l=g.getAttribLocation(d,"position"),u=g.getAttribLocation(d,"uv"),r=g.getUniformLocation(d,"renderType"),i=g.getUniformLocation(d,"map"),n=g.getUniformLocation(d,"occlusionMap"),o=g.getUniformLocation(d,"opacity"),a=g.getUniformLocation(d,"color"),s=g.getUniformLocation(d,"scale"),h=g.getUniformLocation(d,"rotation"),c=g.getUniformLocation(d,"screenPosition")}for(g.useProgram(d),v.initAttributes(),v.enableAttribute(l),v.enableAttribute(u),v.disableUnusedAttributes(),g.uniform1i(n,0),g.uniform1i(i,1),g.bindBuffer(g.ARRAY_BUFFER,E),g.vertexAttribPointer(l,2,g.FLOAT,!1,16,0),g.vertexAttribPointer(u,2,g.FLOAT,!1,16,8),g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,p),v.disable(g.CULL_FACE),v.setDepthWrite(!1),L=0,A=e.length;L<A;L++)if(M=16/H.w,w.set(M*x,M),P=e[L],y.set(P.matrixWorld.elements[12],P.matrixWorld.elements[13],P.matrixWorld.elements[14]),y.applyMatrix4(R.matrixWorldInverse),y.applyProjection(R.projectionMatrix),S.copy(y),C.x=S.x*b+b,C.y=S.y*_+_,f||0<C.x&&C.x<H.z&&0<C.y&&C.y<H.w){v.activeTexture(g.TEXTURE0),v.bindTexture(g.TEXTURE_2D,null),v.activeTexture(g.TEXTURE1),v.bindTexture(g.TEXTURE_2D,m),g.copyTexImage2D(g.TEXTURE_2D,0,g.RGB,H.x+C.x-8,H.y+C.y-8,16,16,0),g.uniform1i(r,0),g.uniform2f(s,w.x,w.y),g.uniform3f(c,S.x,S.y,S.z),v.disable(g.BLEND),v.enable(g.DEPTH_TEST),g.drawElements(g.TRIANGLES,6,g.UNSIGNED_SHORT,0),v.activeTexture(g.TEXTURE0),v.bindTexture(g.TEXTURE_2D,T),g.copyTexImage2D(g.TEXTURE_2D,0,g.RGBA,H.x+C.x-8,H.y+C.y-8,16,16,0),g.uniform1i(r,1),v.disable(g.DEPTH_TEST),v.activeTexture(g.TEXTURE1),v.bindTexture(g.TEXTURE_2D,m),g.drawElements(g.TRIANGLES,6,g.UNSIGNED_SHORT,0),P.positionScreen.copy(S),P.customUpdateCallback?P.customUpdateCallback(P):P.updateLensFlares(),g.uniform1i(r,2),v.enable(g.BLEND);for(var U=0,D=P.lensFlares.length;U<D;U++){var I=P.lensFlares[U];.001<I.opacity&&.001<I.scale&&(S.x=I.x,S.y=I.y,S.z=I.z,M=I.size*I.scale/H.w,w.x=M*x,w.y=M,g.uniform3f(c,S.x,S.y,S.z),g.uniform2f(s,w.x,w.y),g.uniform1f(h,I.rotation),g.uniform1f(o,I.opacity),g.uniform3f(a,I.color.r,I.color.g,I.color.b),v.setBlending(I.blending,I.blendEquation,I.blendSrc,I.blendDst),t.setTexture(I.texture,1),g.drawElements(g.TRIANGLES,6,g.UNSIGNED_SHORT,0))}}v.enable(g.CULL_FACE),v.enable(g.DEPTH_TEST),v.setDepthWrite(!0),t.resetGLState()}}},THREE.SpritePlugin=function(t,e){function r(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}var i,n,o,a,s,h,c,l,u,E,p,d,f,m,T,g,v,y,R,H,x,b=t.context,_=t.state,M=new THREE.Vector3,w=new THREE.Quaternion,S=new THREE.Vector3;this.render=function(C,L){if(0!==e.length){if(void 0===H){var A=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),P=new Uint16Array([0,1,2,0,2,3]);y=b.createBuffer(),R=b.createBuffer(),b.bindBuffer(b.ARRAY_BUFFER,y),b.bufferData(b.ARRAY_BUFFER,A,b.STATIC_DRAW),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,R),b.bufferData(b.ELEMENT_ARRAY_BUFFER,P,b.STATIC_DRAW);var A=b.createProgram(),P=b.createShader(b.VERTEX_SHADER),U=b.createShader(b.FRAGMENT_SHADER);b.shaderSource(P,["precision "+t.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),b.shaderSource(U,["precision "+t.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),b.compileShader(P),b.compileShader(U),b.attachShader(A,P),b.attachShader(A,U),b.linkProgram(A),H=A,g=b.getAttribLocation(H,"position"),v=b.getAttribLocation(H,"uv"),i=b.getUniformLocation(H,"uvOffset"),n=b.getUniformLocation(H,"uvScale"),o=b.getUniformLocation(H,"rotation"),a=b.getUniformLocation(H,"scale"),s=b.getUniformLocation(H,"color"),h=b.getUniformLocation(H,"map"),c=b.getUniformLocation(H,"opacity"),l=b.getUniformLocation(H,"modelViewMatrix"),u=b.getUniformLocation(H,"projectionMatrix"),E=b.getUniformLocation(H,"fogType"),p=b.getUniformLocation(H,"fogDensity"),d=b.getUniformLocation(H,"fogNear"),f=b.getUniformLocation(H,"fogFar"),m=b.getUniformLocation(H,"fogColor"),T=b.getUniformLocation(H,"alphaTest"),(A=document.createElement("canvas")).width=8,A.height=8,(P=A.getContext("2d")).fillStyle="white",P.fillRect(0,0,8,8),(x=new THREE.Texture(A)).needsUpdate=!0}b.useProgram(H),_.initAttributes(),_.enableAttribute(g),_.enableAttribute(v),_.disableUnusedAttributes(),_.disable(b.CULL_FACE),_.enable(b.BLEND),b.bindBuffer(b.ARRAY_BUFFER,y),b.vertexAttribPointer(g,2,b.FLOAT,!1,16,0),b.vertexAttribPointer(v,2,b.FLOAT,!1,16,8),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,R),b.uniformMatrix4fv(u,!1,L.projectionMatrix.elements),_.activeTexture(b.TEXTURE0),b.uniform1i(h,0),P=A=0,(U=C.fog)?(b.uniform3f(m,U.color.r,U.color.g,U.color.b),U instanceof THREE.Fog?(b.uniform1f(d,U.near),b.uniform1f(f,U.far),b.uniform1i(E,1),P=A=1):U instanceof THREE.FogExp2&&(b.uniform1f(p,U.density),b.uniform1i(E,2),P=A=2)):(b.uniform1i(E,0),P=A=0);for(var U=0,D=e.length;U<D;U++)(k=e[U]).modelViewMatrix.multiplyMatrices(L.matrixWorldInverse,k.matrixWorld),k.z=-k.modelViewMatrix.elements[14];e.sort(r);for(var I=[],U=0,D=e.length;U<D;U++){var k=e[U],F=k.material;b.uniform1f(T,F.alphaTest),b.uniformMatrix4fv(l,!1,k.modelViewMatrix.elements),k.matrixWorld.decompose(M,w,S),I[0]=S.x,I[1]=S.y,k=0,C.fog&&F.fog&&(k=P),A!==k&&(b.uniform1i(E,k),A=k),null!==F.map?(b.uniform2f(i,F.map.offset.x,F.map.offset.y),b.uniform2f(n,F.map.repeat.x,F.map.repeat.y)):(b.uniform2f(i,0,0),b.uniform2f(n,1,1)),b.uniform1f(c,F.opacity),b.uniform3f(s,F.color.r,F.color.g,F.color.b),b.uniform1f(o,F.rotation),b.uniform2fv(a,I),_.setBlending(F.blending,F.blendEquation,F.blendSrc,F.blendDst),_.setDepthTest(F.depthTest),_.setDepthWrite(F.depthWrite),F.map&&F.map.image&&F.map.image.width?t.setTexture(F.map,0):t.setTexture(x,0),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}_.enable(b.CULL_FACE),t.resetGLState()}}},Object.defineProperties(THREE.Box2.prototype,{empty:{value:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)}}}),Object.defineProperties(THREE.Box3.prototype,{empty:{value:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)}},isIntersectionSphere:{value:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}}),Object.defineProperties(THREE.Matrix3.prototype,{multiplyVector3:{value:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)}},multiplyVector3Array:{value:function(t){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)}}}),Object.defineProperties(THREE.Matrix4.prototype,{extractPosition:{value:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)}},setRotationFromQuaternion:{value:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)}},multiplyVector3:{value:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),t.applyProjection(this)}},multiplyVector4:{value:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)}},multiplyVector3Array:{value:function(t){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)}},rotateAxis:{value:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)}},crossVector:{value:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)}},translate:{value:function(t){console.error("THREE.Matrix4: .translate() has been removed.")}},rotateX:{value:function(t){console.error("THREE.Matrix4: .rotateX() has been removed.")}},rotateY:{value:function(t){console.error("THREE.Matrix4: .rotateY() has been removed.")}},rotateZ:{value:function(t){console.error("THREE.Matrix4: .rotateZ() has been removed.")}},rotateByAxis:{value:function(t,e){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")}}}),Object.defineProperties(THREE.Plane.prototype,{isIntersectionLine:{value:function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)}}}),Object.defineProperties(THREE.Quaternion.prototype,{multiplyVector3:{value:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)}}}),Object.defineProperties(THREE.Ray.prototype,{isIntersectionBox:{value:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)}},isIntersectionPlane:{value:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)}},isIntersectionSphere:{value:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}}),Object.defineProperties(THREE.Vector3.prototype,{setEulerFromRotationMatrix:{value:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")}},setEulerFromQuaternion:{value:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")}},getPositionFromMatrix:{value:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)}},getScaleFromMatrix:{value:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)}},getColumnFromMatrix:{value:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)}}}),THREE.Face4=function(t,e,r,i,n,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new THREE.Face3(t,e,r,n,o,a)},Object.defineProperties(THREE.Object3D.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},getChildByName:{value:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)}},renderDepth:{set:function(t){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")}},translate:{value:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(t){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(THREE,{PointCloud:{value:function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new THREE.Points(t,e)}},ParticleSystem:{value:function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new THREE.Points(t,e)}}}),Object.defineProperties(THREE.Light.prototype,{onlyShadow:{set:function(t){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(t){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(t){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(THREE.BufferAttribute.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length}}}),Object.defineProperties(THREE.BufferGeometry.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}},addIndex:{value:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)}},addDrawCall:{value:function(t,e,r){void 0!==r&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)}},clearDrawCalls:{value:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()}},computeTangents:{value:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")}},computeOffsets:{value:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}}),Object.defineProperties(THREE.Material.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(t){console.warn("THREE."+this.type+": .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new THREE.Color}}}),Object.defineProperties(THREE,{PointCloudMaterial:{value:function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new THREE.PointsMaterial(t)}},ParticleBasicMaterial:{value:function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new THREE.PointsMaterial(t)}},ParticleSystemMaterial:{value:function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new THREE.PointsMaterial(t)}}}),Object.defineProperties(THREE.MeshPhongMaterial.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(t){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(THREE.ShaderMaterial.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.defineProperties(THREE.WebGLRenderer.prototype,{supportsFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")}},supportsHalfFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")}},supportsStandardDerivatives:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")}},supportsCompressedTextureS3TC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")}},supportsCompressedTexturePVRTC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")}},supportsBlendMinMax:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")}},supportsVertexTextures:{value:function(){return this.capabilities.vertexTextures}},supportsInstancedArrays:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")}},enableScissorTest:{value:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)}},initMaterial:{value:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")}},addPrePlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")}},addPostPlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")}},updateShadowMap:{value:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=t}}}),Object.defineProperties(THREE.WebGLRenderTarget.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),THREE.GeometryUtils={merge:function(t,e,r){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var i;e instanceof THREE.Mesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,r)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(t,e,r,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var n=new THREE.TextureLoader;return n.setCrossOrigin(this.crossOrigin),t=n.load(t,r,void 0,i),e&&(t.mapping=e),t},loadTextureCube:function(t,e,r,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var n=new THREE.CubeTextureLoader;return n.setCrossOrigin(this.crossOrigin),t=n.load(t,r,void 0,i),e&&(t.mapping=e),t},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}},THREE.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(t,e){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},THREE.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},THREE.MeshFaceMaterial=THREE.MultiMaterial,THREE.CurveUtils={tangentQuadraticBezier:function(t,e,r,i){return 2*(1-t)*(r-e)+2*t*(i-r)},tangentCubicBezier:function(t,e,r,i,n){return-3*e*(1-t)*(1-t)+3*r*(1-t)*(1-t)-6*t*r*(1-t)+6*t*i*(1-t)-3*t*t*i+3*t*t*n},tangentSpline:function(t,e,r,i,n){return 6*t*t-6*t+(3*t*t-4*t+1)+(-6*t*t+6*t)+(3*t*t-2*t)},interpolate:function(t,e,r,i,n){var o=n*n;return(2*e-2*r+(t=.5*(r-t))+(i=.5*(i-e)))*n*o+(-3*e+3*r-2*t-i)*o+t*n+e}},THREE.SceneUtils={createMultiMaterialObject:function(t,e){for(var r=new THREE.Group,i=0,n=e.length;i<n;i++)r.add(new THREE.Mesh(t,e[i]));return r},detach:function(t,e,r){t.applyMatrix(e.matrixWorld),e.remove(t),r.add(t)},attach:function(t,e,r){var i=new THREE.Matrix4;i.getInverse(r.matrixWorld),t.applyMatrix(i),e.remove(t),r.add(t)}},THREE.ShapeUtils={area:function(t){for(var e=t.length,r=0,i=e-1,n=0;n<e;i=n++)r+=t[i].x*t[n].y-t[n].x*t[i].y;return.5*r},triangulate:function(t,e){var r=t.length;if(3>r)return null;var i,n,o,a=[],s=[],h=[];if(0<THREE.ShapeUtils.area(t))for(n=0;n<r;n++)s[n]=n;else for(n=0;n<r;n++)s[n]=r-1-n;var c=2*r;for(n=r-1;2<r;){if(0>=c--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}r<=(i=n)&&(i=0),r<=(n=i+1)&&(n=0),r<=(o=n+1)&&(o=0);var l;t:{var u=l=void 0,E=void 0,p=void 0,d=void 0,f=void 0,m=void 0,T=void 0,g=void 0,u=t[s[i]].x,E=t[s[i]].y,p=t[s[n]].x,d=t[s[n]].y,f=t[s[o]].x,m=t[s[o]].y;if(Number.EPSILON>(p-u)*(m-E)-(d-E)*(f-u))l=!1;else{var v=void 0,y=void 0,R=void 0,H=void 0,x=void 0,b=void 0,_=void 0,M=void 0,w=void 0,S=void 0,w=M=_=g=T=void 0,v=f-p,y=m-d,R=u-f,H=E-m,x=p-u,b=d-E;for(l=0;l<r;l++)if(T=t[s[l]].x,g=t[s[l]].y,!(T===u&&g===E||T===p&&g===d||T===f&&g===m)&&(_=T-u,M=g-E,w=T-p,S=g-d,T-=f,g-=m,w=v*S-y*w,_=x*M-b*_,M=R*g-H*T,w>=-Number.EPSILON&&M>=-Number.EPSILON&&_>=-Number.EPSILON)){l=!1;break t}l=!0}}if(l){for(a.push([t[s[i]],t[s[n]],t[s[o]]]),h.push([s[i],s[n],s[o]]),i=n,o=n+1;o<r;i++,o++)s[i]=s[o];c=2*--r}}return e?h:a},triangulateShape:function(t,e){function r(t,e,r){return t.x!==e.x?t.x<e.x?t.x<=r.x&&r.x<=e.x:e.x<=r.x&&r.x<=t.x:t.y<e.y?t.y<=r.y&&r.y<=e.y:e.y<=r.y&&r.y<=t.y}function i(t,e,i,n,o){var a=e.x-t.x,s=e.y-t.y,h=n.x-i.x,c=n.y-i.y,l=t.x-i.x,u=t.y-i.y,E=s*h-a*c,p=s*l-a*u;if(Math.abs(E)>Number.EPSILON){if(0<E){if(0>p||p>E)return[];if(0>(h=c*l-h*u)||h>E)return[]}else{if(0<p||p<E)return[];if(0<(h=c*l-h*u)||h<E)return[]}return 0===h?!o||0!==p&&p!==E?[t]:[]:h===E?!o||0!==p&&p!==E?[e]:[]:0===p?[i]:p===E?[n]:(o=h/E,[{x:t.x+o*a,y:t.y+o*s}])}return 0!==p||c*l!=h*u?[]:(s=0===a&&0===s,h=0===h&&0===c,s&&h?t.x!==i.x||t.y!==i.y?[]:[t]:s?r(i,n,t)?[t]:[]:h?r(t,e,i)?[i]:[]:(0!==a?(t.x<e.x?(a=t,h=t.x,s=e,t=e.x):(a=e,h=e.x,s=t,t=t.x),i.x<n.x?(e=i,E=i.x,c=n,i=n.x):(e=n,E=n.x,c=i,i=i.x)):(t.y<e.y?(a=t,h=t.y,s=e,t=e.y):(a=e,h=e.y,s=t,t=t.y),i.y<n.y?(e=i,E=i.y,c=n,i=n.y):(e=n,E=n.y,c=i,i=i.y)),h<=E?t<E?[]:t===E?o?[]:[e]:t<=i?[e,s]:[e,c]:h>i?[]:h===i?o?[]:[a]:t<=i?[a,s]:[a,c]))}function n(t,e,r,i){var n=e.x-t.x,o=e.y-t.y;e=r.x-t.x,r=r.y-t.y;var a=i.x-t.x;return i=i.y-t.y,t=n*r-o*e,n=n*i-o*a,Math.abs(t)>Number.EPSILON?(e=a*r-i*e,0<t?0<=n&&0<=e:0<=n||0<=e):0<n}var o,a,s,h,c,l={};for(s=t.concat(),o=0,a=e.length;o<a;o++)Array.prototype.push.apply(s,e[o]);for(o=0,a=s.length;o<a;o++)c=s[o].x+":"+s[o].y,void 0!==l[c]&&console.warn("THREE.Shape: Duplicate point",c),l[c]=o;o=function(t,e){var r,o,a,s,h,c,l,u,E,p=t.concat(),d=[],f=[],m=0;for(o=e.length;m<o;m++)d.push(m);l=0;for(var T=2*d.length;0<d.length;){if(0>--T){console.log("Infinite Loop! Holes left:"+d.length+", Probably Hole outside Shape!");break}for(a=l;a<p.length;a++){for(s=p[a],o=-1,m=0;m<d.length;m++)if(h=d[m],c=s.x+":"+s.y+":"+h,void 0===f[c]){for(r=e[h],u=0;u<r.length;u++)if(h=r[u],function(t,e){var i=p.length-1,o=t-1;0>o&&(o=i);var a=t+1;return a>i&&(a=0),!!(i=n(p[t],p[o],p[a],r[e]))&&(i=r.length-1,0>(o=e-1)&&(o=i),(a=e+1)>i&&(a=0),!!(i=n(r[e],r[o],r[a],p[t])))}(a,u)&&!function(t,e){var r,n;for(r=0;r<p.length;r++)if(n=r+1,n%=p.length,0<(n=i(t,e,p[r],p[n],!0)).length)return!0;return!1}(s,h)&&!function(t,r){var n,o,a,s;for(n=0;n<d.length;n++)for(o=e[d[n]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,0<(s=i(t,r,o[a],o[s],!0)).length)return!0;return!1}(s,h)){o=u,d.splice(m,1),l=p.slice(0,a+1),h=p.slice(a),u=r.slice(o),E=r.slice(0,o+1),p=l.concat(u).concat(E).concat(h),l=a;break}if(0<=o)break;f[c]=!0}if(0<=o)break}}return p}(t,e);var u=THREE.ShapeUtils.triangulate(o,!1);for(o=0,a=u.length;o<a;o++)for(h=u[o],s=0;3>s;s++)c=h[s].x+":"+h[s].y,void 0!==(c=l[c])&&(h[s]=c);return u.concat()},isClockWise:function(t){return 0>THREE.ShapeUtils.area(t)},b2:function(t,e,r,i){var n=1-t;return n*n*e+2*(1-t)*t*r+t*t*i},b3:function(t,e,r,i,n){var o=1-t,a=1-t;return o*o*o*e+3*a*a*t*r+3*(1-t)*t*t*i+t*t*t*n}},THREE.Curve=function(){},THREE.Curve.prototype={constructor:THREE.Curve,getPoint:function(t){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(t){return t=this.getUtoTmapping(t),this.getPoint(t)},getPoints:function(t){t||(t=5);var e,r=[];for(e=0;e<=t;e++)r.push(this.getPoint(e/t));return r},getSpacedPoints:function(t){t||(t=5);var e,r=[];for(e=0;e<=t;e++)r.push(this.getPointAt(e/t));return r},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(t||(t=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,r,i=[],n=this.getPoint(0),o=0;for(i.push(0),r=1;r<=t;r++)e=this.getPoint(r/t),o+=e.distanceTo(n),i.push(o),n=e;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var r,i=this.getLengths(),n=0,o=i.length;r=e||t*i[o-1];for(var a,s=0,h=o-1;s<=h;)if(n=Math.floor(s+(h-s)/2),0>(a=i[n]-r))s=n+1;else{if(!(0<a)){h=n;break}h=n-1}return n=h,i[n]===r?n/(o-1):(s=i[n],i=(n+(r-s)/(i[n+1]-s))/(o-1))},getTangent:function(t){var e=t-1e-4;return t+=1e-4,0>e&&(e=0),1<t&&(t=1),e=this.getPoint(e),this.getPoint(t).clone().sub(e).normalize()},getTangentAt:function(t){return t=this.getUtoTmapping(t),this.getTangent(t)}},THREE.Curve.create=function(t,e){return t.prototype=Object.create(THREE.Curve.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},THREE.CurvePath=function(){this.curves=[],this.autoClose=!1},THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype),THREE.CurvePath.prototype.constructor=THREE.CurvePath,THREE.CurvePath.prototype.add=function(t){this.curves.push(t)},THREE.CurvePath.prototype.closePath=function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new THREE.LineCurve(e,t))},THREE.CurvePath.prototype.getPoint=function(t){for(var e=t*this.getLength(),r=this.getCurveLengths(),i=0;i<r.length;){if(r[i]>=e)return t=this.curves[i],e=1-(r[i]-e)/t.getLength(),t.getPointAt(e);i++}return null},THREE.CurvePath.prototype.getLength=function(){var t=this.getCurveLengths();return t[t.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,r=0,i=this.curves.length;r<i;r++)e+=this.curves[r].getLength(),t.push(e);return this.cacheLengths=t},THREE.CurvePath.prototype.createPointsGeometry=function(t){return t=this.getPoints(t),this.createGeometry(t)},THREE.CurvePath.prototype.createSpacedPointsGeometry=function(t){return t=this.getSpacedPoints(t),this.createGeometry(t)},THREE.CurvePath.prototype.createGeometry=function(t){for(var e=new THREE.Geometry,r=0,i=t.length;r<i;r++){var n=t[r];e.vertices.push(new THREE.Vector3(n.x,n.y,n.z||0))}return e},THREE.Font=function(t){this.data=t},THREE.Font.prototype={constructor:THREE.Font,generateShapes:function(t,e,r){void 0===e&&(e=100),void 0===r&&(r=4);var i=this.data;t=String(t).split("");var n=e/i.resolution,o=0;e=[];for(var a=0;a<t.length;a++){var s;s=n;var h=o,c=i.glyphs[t[a]]||i.glyphs["?"];if(c){var l=new THREE.Path,u=[],E=THREE.ShapeUtils.b2,p=THREE.ShapeUtils.b3,d=void 0,f=void 0,m=f=d=void 0,T=void 0,g=void 0,v=void 0,y=void 0,R=void 0,T=void 0;if(c.o)for(var H=c._cachedOutline||(c._cachedOutline=c.o.split(" ")),x=0,b=H.length;x<b;)switch(H[x++]){case"m":d=H[x++]*s+h,f=H[x++]*s,l.moveTo(d,f);break;case"l":d=H[x++]*s+h,f=H[x++]*s,l.lineTo(d,f);break;case"q":if(d=H[x++]*s+h,f=H[x++]*s,g=H[x++]*s+h,v=H[x++]*s,l.quadraticCurveTo(g,v,d,f),T=u[u.length-1])for(var m=T.x,T=T.y,_=1;_<=r;_++){var M=_/r;E(M,m,g,d),E(M,T,v,f)}break;case"b":if(d=H[x++]*s+h,f=H[x++]*s,g=H[x++]*s+h,v=H[x++]*s,y=H[x++]*s+h,R=H[x++]*s,l.bezierCurveTo(g,v,y,R,d,f),T=u[u.length-1])for(m=T.x,T=T.y,_=1;_<=r;_++)M=_/r,p(M,m,g,y,d),p(M,T,v,R,f)}s={offset:c.ha*s,path:l}}else s=void 0;o+=s.offset,e.push(s.path)}for(r=[],i=0,t=e.length;i<t;i++)Array.prototype.push.apply(r,e[i].toShapes());return r}},THREE.Path=function(t){THREE.CurvePath.call(this),this.actions=[],t&&this.fromPoints(t)},THREE.Path.prototype=Object.create(THREE.CurvePath.prototype),THREE.Path.prototype.constructor=THREE.Path,THREE.Path.prototype.fromPoints=function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,r=t.length;e<r;e++)this.lineTo(t[e].x,t[e].y)},THREE.Path.prototype.moveTo=function(t,e){this.actions.push({action:"moveTo",args:[t,e]})},THREE.Path.prototype.lineTo=function(t,e){var r=this.actions[this.actions.length-1].args,r=new THREE.LineCurve(new THREE.Vector2(r[r.length-2],r[r.length-1]),new THREE.Vector2(t,e));this.curves.push(r),this.actions.push({action:"lineTo",args:[t,e]})},THREE.Path.prototype.quadraticCurveTo=function(t,e,r,i){var n=this.actions[this.actions.length-1].args,n=new THREE.QuadraticBezierCurve(new THREE.Vector2(n[n.length-2],n[n.length-1]),new THREE.Vector2(t,e),new THREE.Vector2(r,i));this.curves.push(n),this.actions.push({action:"quadraticCurveTo",args:[t,e,r,i]})},THREE.Path.prototype.bezierCurveTo=function(t,e,r,i,n,o){var a=this.actions[this.actions.length-1].args,a=new THREE.CubicBezierCurve(new THREE.Vector2(a[a.length-2],a[a.length-1]),new THREE.Vector2(t,e),new THREE.Vector2(r,i),new THREE.Vector2(n,o));this.curves.push(a),this.actions.push({action:"bezierCurveTo",args:[t,e,r,i,n,o]})},THREE.Path.prototype.splineThru=function(t){var e=Array.prototype.slice.call(arguments),r=this.actions[this.actions.length-1].args,r=[new THREE.Vector2(r[r.length-2],r[r.length-1])];Array.prototype.push.apply(r,t),r=new THREE.SplineCurve(r),this.curves.push(r),this.actions.push({action:"splineThru",args:e})},THREE.Path.prototype.arc=function(t,e,r,i,n,o){var a=this.actions[this.actions.length-1].args;this.absarc(t+a[a.length-2],e+a[a.length-1],r,i,n,o)},THREE.Path.prototype.absarc=function(t,e,r,i,n,o){this.absellipse(t,e,r,r,i,n,o)},THREE.Path.prototype.ellipse=function(t,e,r,i,n,o,a,s){var h=this.actions[this.actions.length-1].args;this.absellipse(t+h[h.length-2],e+h[h.length-1],r,i,n,o,a,s)},THREE.Path.prototype.absellipse=function(t,e,r,i,n,o,a,s){var h=[t,e,r,i,n,o,a,s||0];t=new THREE.EllipseCurve(t,e,r,i,n,o,a,s),this.curves.push(t),t=t.getPoint(1),h.push(t.x),h.push(t.y),this.actions.push({action:"ellipse",args:h})},THREE.Path.prototype.getSpacedPoints=function(t){t||(t=40);for(var e=[],r=0;r<t;r++)e.push(this.getPoint(r/t));return this.autoClose&&e.push(e[0]),e},THREE.Path.prototype.getPoints=function(t){t=t||12;for(var e,r,i,n,o,a,s,h,c,l,u=THREE.ShapeUtils.b2,E=THREE.ShapeUtils.b3,p=[],d=0,f=this.actions.length;d<f;d++){var m=(c=this.actions[d]).args;switch(c.action){case"moveTo":case"lineTo":p.push(new THREE.Vector2(m[0],m[1]));break;case"quadraticCurveTo":for(e=m[2],r=m[3],o=m[0],a=m[1],0<p.length?(c=p[p.length-1],s=c.x,h=c.y):(c=this.actions[d-1].args,s=c[c.length-2],h=c[c.length-1]),m=1;m<=t;m++)l=m/t,c=u(l,s,o,e),l=u(l,h,a,r),p.push(new THREE.Vector2(c,l));break;case"bezierCurveTo":for(e=m[4],r=m[5],o=m[0],a=m[1],i=m[2],n=m[3],0<p.length?(c=p[p.length-1],s=c.x,h=c.y):(c=this.actions[d-1].args,s=c[c.length-2],h=c[c.length-1]),m=1;m<=t;m++)l=m/t,c=E(l,s,o,i,e),l=E(l,h,a,n,r),p.push(new THREE.Vector2(c,l));break;case"splineThru":for(c=this.actions[d-1].args,l=[new THREE.Vector2(c[c.length-2],c[c.length-1])],c=t*m[0].length,l=l.concat(m[0]),l=new THREE.SplineCurve(l),m=1;m<=c;m++)p.push(l.getPointAt(m/c));break;case"arc":for(e=m[0],r=m[1],a=m[2],i=m[3],c=m[4],o=!!m[5],s=c-i,h=2*t,m=1;m<=h;m++)l=m/h,o||(l=1-l),l=i+l*s,c=e+a*Math.cos(l),l=r+a*Math.sin(l),p.push(new THREE.Vector2(c,l));break;case"ellipse":e=m[0],r=m[1],a=m[2],n=m[3],i=m[4],c=m[5],o=!!m[6];var T=m[7];s=c-i,h=2*t;var g,v;for(0!==T&&(g=Math.cos(T),v=Math.sin(T)),m=1;m<=h;m++){if(l=m/h,o||(l=1-l),l=i+l*s,c=e+a*Math.cos(l),l=r+n*Math.sin(l),0!==T){var y=c;c=(y-e)*g-(l-r)*v+e,l=(y-e)*v+(l-r)*g+r}p.push(new THREE.Vector2(c,l))}}}return t=p[p.length-1],Math.abs(t.x-p[0].x)<Number.EPSILON&&Math.abs(t.y-p[0].y)<Number.EPSILON&&p.splice(p.length-1,1),this.autoClose&&p.push(p[0]),p},THREE.Path.prototype.toShapes=function(t,e){function r(t){for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r],o=new THREE.Shape;o.actions=n.actions,o.curves=n.curves,e.push(o)}return e}var i=THREE.ShapeUtils.isClockWise,n=function(t){for(var e=[],r=new THREE.Path,i=0,n=t.length;i<n;i++){var o=t[i],a=o.args;"moveTo"===(o=o.action)&&0!==r.actions.length&&(e.push(r),r=new THREE.Path),r[o].apply(r,a)}return 0!==r.actions.length&&e.push(r),e}(this.actions);if(0===n.length)return[];if(!0===e)return r(n);var o,a,s,h=[];if(1===n.length)return a=n[0],s=new THREE.Shape,s.actions=a.actions,s.curves=a.curves,h.push(s),h;var c=!i(n[0].getPoints()),c=t?!c:c;s=[];var l,u=[],E=[],p=0;u[p]=void 0,E[p]=[];for(var d=0,f=n.length;d<f;d++)a=n[d],l=a.getPoints(),o=i(l),(o=t?!o:o)?(!c&&u[p]&&p++,u[p]={s:new THREE.Shape,p:l},u[p].s.actions=a.actions,u[p].s.curves=a.curves,c&&p++,E[p]=[]):E[p].push({h:a,p:l[0]});if(!u[0])return r(n);if(1<u.length){for(d=!1,a=[],i=0,n=u.length;i<n;i++)s[i]=[];for(i=0,n=u.length;i<n;i++)for(o=E[i],c=0;c<o.length;c++){for(p=o[c],l=!0,f=0;f<u.length;f++)(function(t,e){for(var r=e.length,i=!1,n=r-1,o=0;o<r;n=o++){var a=e[n],s=e[o],h=s.x-a.x,c=s.y-a.y;if(Math.abs(c)>Number.EPSILON){if(0>c&&(a=e[o],h=-h,s=e[n],c=-c),!(t.y<a.y||t.y>s.y))if(t.y===a.y){if(t.x===a.x)return!0}else{if(0==(n=c*(t.x-a.x)-h*(t.y-a.y)))return!0;0>n||(i=!i)}}else if(t.y===a.y&&(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x))return!0}return i})(p.p,u[f].p)&&(i!==f&&a.push({froms:i,tos:f,hole:c}),l?(l=!1,s[f].push(p)):d=!0);l&&s[i].push(p)}0<a.length&&(d||(E=s))}for(d=0,i=u.length;d<i;d++)for(s=u[d].s,h.push(s),a=E[d],n=0,o=a.length;n<o;n++)s.holes.push(a[n].h);return h},THREE.Shape=function(){THREE.Path.apply(this,arguments),this.holes=[]},THREE.Shape.prototype=Object.create(THREE.Path.prototype),THREE.Shape.prototype.constructor=THREE.Shape,THREE.Shape.prototype.extrude=function(t){return new THREE.ExtrudeGeometry(this,t)},THREE.Shape.prototype.makeGeometry=function(t){return new THREE.ShapeGeometry(this,t)},THREE.Shape.prototype.getPointsHoles=function(t){for(var e=[],r=0,i=this.holes.length;r<i;r++)e[r]=this.holes[r].getPoints(t);return e},THREE.Shape.prototype.extractAllPoints=function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},THREE.Shape.prototype.extractPoints=function(t){return this.extractAllPoints(t)},THREE.LineCurve=function(t,e){this.v1=t,this.v2=e},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(t){var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},THREE.LineCurve.prototype.getPointAt=function(t){return this.getPoint(t)},THREE.LineCurve.prototype.getTangent=function(t){return this.v2.clone().sub(this.v1).normalize()},THREE.QuadraticBezierCurve=function(t,e,r){this.v0=t,this.v1=e,this.v2=r},THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve,THREE.QuadraticBezierCurve.prototype.getPoint=function(t){var e=THREE.ShapeUtils.b2;return new THREE.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y))},THREE.QuadraticBezierCurve.prototype.getTangent=function(t){var e=THREE.CurveUtils.tangentQuadraticBezier;return new THREE.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y)).normalize()},THREE.CubicBezierCurve=function(t,e,r,i){this.v0=t,this.v1=e,this.v2=r,this.v3=i},THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve,THREE.CubicBezierCurve.prototype.getPoint=function(t){var e=THREE.ShapeUtils.b3;return new THREE.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y))},THREE.CubicBezierCurve.prototype.getTangent=function(t){var e=THREE.CurveUtils.tangentCubicBezier;return new THREE.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()},THREE.SplineCurve=function(t){this.points=void 0==t?[]:t},THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.SplineCurve.prototype.constructor=THREE.SplineCurve,THREE.SplineCurve.prototype.getPoint=function(t){t*=(n=this.points).length-1,t-=o=Math.floor(t);var e=n[0===o?o:o-1],r=n[o],i=n[o>n.length-2?n.length-1:o+1],n=n[o>n.length-3?n.length-1:o+2],o=THREE.CurveUtils.interpolate;return new THREE.Vector2(o(e.x,r.x,i.x,n.x,t),o(e.y,r.y,i.y,n.y,t))},THREE.EllipseCurve=function(t,e,r,i,n,o,a,s){this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.EllipseCurve.prototype.getPoint=function(t){0>(r=this.aEndAngle-this.aStartAngle)&&(r+=2*Math.PI),r>2*Math.PI&&(r-=2*Math.PI),r=!0===this.aClockwise?this.aEndAngle+(1-t)*(2*Math.PI-r):this.aStartAngle+t*r,t=this.aX+this.xRadius*Math.cos(r);var e=this.aY+this.yRadius*Math.sin(r);if(0!==this.aRotation){var r=Math.cos(this.aRotation),i=Math.sin(this.aRotation),n=t;t=(n-this.aX)*r-(e-this.aY)*i+this.aX,e=(n-this.aX)*i+(e-this.aY)*r+this.aY}return new THREE.Vector2(t,e)},THREE.ArcCurve=function(t,e,r,i,n,o){THREE.EllipseCurve.call(this,t,e,r,r,i,n,o)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(t,e){this.v1=t,this.v2=e},function(t){var e=new THREE.Vector3;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(t,e,r){this.v0=t,this.v1=e,this.v2=r},function(t){var e=THREE.ShapeUtils.b2;return new THREE.Vector3(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y),e(t,this.v0.z,this.v1.z,this.v2.z))}),THREE.CubicBezierCurve3=THREE.Curve.create(function(t,e,r,i){this.v0=t,this.v1=e,this.v2=r,this.v3=i},function(t){var e=THREE.ShapeUtils.b3;return new THREE.Vector3(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),THREE.SplineCurve3=THREE.Curve.create(function(t){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=void 0==t?[]:t},function(t){t*=(n=this.points).length-1,t-=o=Math.floor(t);var e=n[0==o?o:o-1],r=n[o],i=n[o>n.length-2?n.length-1:o+1],n=n[o>n.length-3?n.length-1:o+2],o=THREE.CurveUtils.interpolate;return new THREE.Vector3(o(e.x,r.x,i.x,n.x,t),o(e.y,r.y,i.y,n.y,t),o(e.z,r.z,i.z,n.z,t))}),THREE.CatmullRomCurve3=function(){function t(){}var e=new THREE.Vector3,r=new t,i=new t,n=new t;return t.prototype.init=function(t,e,r,i){this.c0=t,this.c1=r,this.c2=-3*t+3*e-2*r-i,this.c3=2*t-2*e+r+i},t.prototype.initNonuniformCatmullRom=function(t,e,r,i,n,o,a){t=((e-t)/n-(r-t)/(n+o)+(r-e)/o)*o,i=((r-e)/o-(i-e)/(o+a)+(i-r)/a)*o,this.init(e,r,t,i)},t.prototype.initCatmullRom=function(t,e,r,i,n){this.init(e,r,n*(r-t),n*(i-e))},t.prototype.calc=function(t){var e=t*t;return this.c0+this.c1*t+this.c2*e+this.c3*e*t},THREE.Curve.create(function(t){this.points=t||[],this.closed=!1},function(t){var o,a,s=this.points;2>(a=s.length)&&console.log("duh, you need at least 2 points"),t*=a-(this.closed?0:1),t-=o=Math.floor(t),this.closed?o+=0<o?0:(Math.floor(Math.abs(o)/s.length)+1)*s.length:0===t&&o===a-1&&(o=a-2,t=1);var h,c,l;if(this.closed||0<o?h=s[(o-1)%a]:(e.subVectors(s[0],s[1]).add(s[0]),h=e),c=s[o%a],l=s[(o+1)%a],this.closed||o+2<a?s=s[(o+2)%a]:(e.subVectors(s[a-1],s[a-2]).add(s[a-1]),s=e),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var u="chordal"===this.type?.5:.25;a=Math.pow(h.distanceToSquared(c),u),o=Math.pow(c.distanceToSquared(l),u),u=Math.pow(l.distanceToSquared(s),u),1e-4>o&&(o=1),1e-4>a&&(a=o),1e-4>u&&(u=o),r.initNonuniformCatmullRom(h.x,c.x,l.x,s.x,a,o,u),i.initNonuniformCatmullRom(h.y,c.y,l.y,s.y,a,o,u),n.initNonuniformCatmullRom(h.z,c.z,l.z,s.z,a,o,u)}else"catmullrom"===this.type&&(a=void 0!==this.tension?this.tension:.5,r.initCatmullRom(h.x,c.x,l.x,s.x,a),i.initCatmullRom(h.y,c.y,l.y,s.y,a),n.initCatmullRom(h.z,c.z,l.z,s.z,a));return new THREE.Vector3(r.calc(t),i.calc(t),n.calc(t))})}(),THREE.ClosedSplineCurve3=function(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),THREE.CatmullRomCurve3.call(this,t),this.type="catmullrom",this.closed=!0},THREE.ClosedSplineCurve3.prototype=Object.create(THREE.CatmullRomCurve3.prototype),THREE.BoxGeometry=function(t,e,r,i,n,o){function a(t,e,r,i,n,o,a,h){var c,l=s.widthSegments,u=s.heightSegments,E=n/2,p=o/2,d=s.vertices.length;"x"===t&&"y"===e||"y"===t&&"x"===e?c="z":"x"===t&&"z"===e||"z"===t&&"x"===e?(c="y",u=s.depthSegments):("z"===t&&"y"===e||"y"===t&&"z"===e)&&(c="x",l=s.depthSegments);var f=l+1,m=u+1,T=n/l,g=o/u,v=new THREE.Vector3;for(v[c]=0<a?1:-1,n=0;n<m;n++)for(o=0;o<f;o++){var y=new THREE.Vector3;y[t]=(o*T-E)*r,y[e]=(n*g-p)*i,y[c]=a,s.vertices.push(y)}for(n=0;n<u;n++)for(o=0;o<l;o++)p=o+f*n,t=o+f*(n+1),e=o+1+f*(n+1),r=o+1+f*n,i=new THREE.Vector2(o/l,1-n/u),a=new THREE.Vector2(o/l,1-(n+1)/u),c=new THREE.Vector2((o+1)/l,1-(n+1)/u),E=new THREE.Vector2((o+1)/l,1-n/u),(p=new THREE.Face3(p+d,t+d,r+d)).normal.copy(v),p.vertexNormals.push(v.clone(),v.clone(),v.clone()),p.materialIndex=h,s.faces.push(p),s.faceVertexUvs[0].push([i,a,E]),(p=new THREE.Face3(t+d,e+d,r+d)).normal.copy(v),p.vertexNormals.push(v.clone(),v.clone(),v.clone()),p.materialIndex=h,s.faces.push(p),s.faceVertexUvs[0].push([a.clone(),c,E.clone()])}THREE.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:n,depthSegments:o},this.widthSegments=i||1,this.heightSegments=n||1,this.depthSegments=o||1;var s=this;n=e/2,o=r/2,a("z","y",-1,-1,r,e,i=t/2,0),a("z","y",1,-1,r,e,-i,1),a("x","z",1,1,t,r,n,2),a("x","z",1,-1,t,r,-n,3),a("x","y",1,-1,t,e,o,4),a("x","y",-1,-1,t,e,-o,5),this.mergeVertices()},THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry,THREE.CubeGeometry=THREE.BoxGeometry,THREE.CircleGeometry=function(t,e,r,i){THREE.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:i},this.fromBufferGeometry(new THREE.CircleBufferGeometry(t,e,r,i))},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry,THREE.CircleBufferGeometry=function(t,e,r,i){THREE.BufferGeometry.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:i},t=t||50,e=void 0!==e?Math.max(3,e):8,r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var n=e+2,o=new Float32Array(3*n),a=new Float32Array(3*n),n=new Float32Array(2*n);a[2]=1,n[0]=.5,n[1]=.5;for(var s=0,h=3,c=2;s<=e;s++,h+=3,c+=2){var l=r+s/e*i;o[h]=t*Math.cos(l),o[h+1]=t*Math.sin(l),a[h+2]=1,n[c]=(o[h]/t+1)/2,n[c+1]=(o[h+1]/t+1)/2}for(r=[],h=1;h<=e;h++)r.push(h,h+1,0);this.setIndex(new THREE.BufferAttribute(new Uint16Array(r),1)),this.addAttribute("position",new THREE.BufferAttribute(o,3)),this.addAttribute("normal",new THREE.BufferAttribute(a,3)),this.addAttribute("uv",new THREE.BufferAttribute(n,2)),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,t)},THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry,THREE.CylinderGeometry=function(t,e,r,i,n,o,a,s){THREE.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:r,radialSegments:i,heightSegments:n,openEnded:o,thetaStart:a,thetaLength:s},t=void 0!==t?t:20,e=void 0!==e?e:20,r=void 0!==r?r:100,i=i||8,n=n||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var h,c,l=r/2,u=[],E=[];for(c=0;c<=n;c++){var p=[],d=[],f=(m=c/n)*(e-t)+t;for(h=0;h<=i;h++){T=h/i;(g=new THREE.Vector3).x=f*Math.sin(T*s+a),g.y=-m*r+l,g.z=f*Math.cos(T*s+a),this.vertices.push(g),p.push(this.vertices.length-1),d.push(new THREE.Vector2(T,1-m))}u.push(p),E.push(d)}for(r=(e-t)/r,h=0;h<i;h++)for(0!==t?(a=this.vertices[u[0][h]].clone(),s=this.vertices[u[0][h+1]].clone()):(a=this.vertices[u[1][h]].clone(),s=this.vertices[u[1][h+1]].clone()),a.setY(Math.sqrt(a.x*a.x+a.z*a.z)*r).normalize(),s.setY(Math.sqrt(s.x*s.x+s.z*s.z)*r).normalize(),c=0;c<n;c++){var p=u[c][h],d=u[c+1][h],m=u[c+1][h+1],f=u[c][h+1],T=a.clone(),g=a.clone(),v=s.clone(),y=s.clone(),R=E[c][h].clone(),H=E[c+1][h].clone(),x=E[c+1][h+1].clone(),b=E[c][h+1].clone();this.faces.push(new THREE.Face3(p,d,f,[T,g,y])),this.faceVertexUvs[0].push([R,H,b]),this.faces.push(new THREE.Face3(d,m,f,[g.clone(),v,y.clone()])),this.faceVertexUvs[0].push([H.clone(),x,b.clone()])}if(!1===o&&0<t)for(this.vertices.push(new THREE.Vector3(0,l,0)),h=0;h<i;h++)p=u[0][h],d=u[0][h+1],m=this.vertices.length-1,T=new THREE.Vector3(0,1,0),g=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),R=E[0][h].clone(),H=E[0][h+1].clone(),x=new THREE.Vector2(H.x,0),this.faces.push(new THREE.Face3(p,d,m,[T,g,v],void 0,1)),this.faceVertexUvs[0].push([R,H,x]);if(!1===o&&0<e)for(this.vertices.push(new THREE.Vector3(0,-l,0)),h=0;h<i;h++)p=u[n][h+1],d=u[n][h],m=this.vertices.length-1,T=new THREE.Vector3(0,-1,0),g=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),R=E[n][h+1].clone(),H=E[n][h].clone(),x=new THREE.Vector2(H.x,1),this.faces.push(new THREE.Face3(p,d,m,[T,g,v],void 0,2)),this.faceVertexUvs[0].push([R,H,x]);this.computeFaceNormals()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry,THREE.EdgesGeometry=function(t,e){THREE.BufferGeometry.call(this);var r,i=Math.cos(THREE.Math.degToRad(void 0!==e?e:1)),n=[0,0],o={},a=["a","b","c"];t instanceof THREE.BufferGeometry?(r=new THREE.Geometry).fromBufferGeometry(t):r=t.clone(),r.mergeVertices(),r.computeFaceNormals();for(var s=r.vertices,h=0,c=(r=r.faces).length;h<c;h++)for(var l=r[h],u=0;3>u;u++){n[0]=l[a[u]],n[1]=l[a[(u+1)%3]],n.sort(function(t,e){return t-e});var E=n.toString();void 0===o[E]?o[E]={vert1:n[0],vert2:n[1],face1:h,face2:void 0}:o[E].face2=h}n=[];for(E in o)(void 0===(a=o[E]).face2||r[a.face1].normal.dot(r[a.face2].normal)<=i)&&(h=s[a.vert1],n.push(h.x),n.push(h.y),n.push(h.z),h=s[a.vert2],n.push(h.x),n.push(h.y),n.push(h.z));this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(n),3))},THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry,THREE.ExtrudeGeometry=function(t,e){void 0!==t&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),this.computeFaceNormals())},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry,THREE.ExtrudeGeometry.prototype.addShapeList=function(t,e){for(var r=t.length,i=0;i<r;i++)this.addShape(t[i],e)},THREE.ExtrudeGeometry.prototype.addShape=function(t,e){function r(t,e,r){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(r).add(t)}function i(t,e,r){var i=1,i=t.x-e.x,n=t.y-e.y,o=r.x-t.x,a=r.y-t.y,s=i*i+n*n;if(Math.abs(i*a-n*o)>Number.EPSILON){var h=Math.sqrt(s),c=Math.sqrt(o*o+a*a),s=e.x-n/h;if(e=e.y+i/h,o=((r.x-a/c-s)*a-(r.y+o/c-e)*o)/(i*a-n*o),r=s+i*o-t.x,t=e+n*o-t.y,2>=(i=r*r+t*t))return new THREE.Vector2(r,t);i=Math.sqrt(i/2)}else t=!1,i>Number.EPSILON?o>Number.EPSILON&&(t=!0):i<-Number.EPSILON?o<-Number.EPSILON&&(t=!0):Math.sign(n)===Math.sign(a)&&(t=!0),t?(r=-n,t=i,i=Math.sqrt(s)):(r=i,t=n,i=Math.sqrt(s/2));return new THREE.Vector2(r/i,t/i)}function n(t,e){var r,i;for(B=t.length;0<=--B;){r=B,0>(i=B-1)&&(i=t.length-1);for(var n=0,o=g+2*f,n=0;n<o;n++){var a=(a=e+r+(s=k*n))+M,s=(s=e+i+s)+M,h=(h=e+i+(c=k*(n+1)))+M,c=(c=e+r+c)+M;_.faces.push(new THREE.Face3(a,s,c,null,null,1)),_.faces.push(new THREE.Face3(s,h,c,null,null,1)),a=R.generateSideWallUV(_,a,s,h,c),_.faceVertexUvs[0].push([a[0],a[1],a[3]]),_.faceVertexUvs[0].push([a[1],a[2],a[3]])}}}function o(t,e,r){_.vertices.push(new THREE.Vector3(t,e,r))}function a(t,e,r){t+=M,e+=M,r+=M,_.faces.push(new THREE.Face3(t,e,r,null,null,0)),t=R.generateTopUV(_,t,e,r),_.faceVertexUvs[0].push(t)}var s,h,c,l,u,E=void 0!==e.amount?e.amount:100,p=void 0!==e.bevelThickness?e.bevelThickness:6,d=void 0!==e.bevelSize?e.bevelSize:p-2,f=void 0!==e.bevelSegments?e.bevelSegments:3,m=void 0===e.bevelEnabled||e.bevelEnabled,T=void 0!==e.curveSegments?e.curveSegments:12,g=void 0!==e.steps?e.steps:1,v=e.extrudePath,y=!1,R=void 0!==e.UVGenerator?e.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;v&&(s=v.getSpacedPoints(g),y=!0,m=!1,h=void 0!==e.frames?e.frames:new THREE.TubeGeometry.FrenetFrames(v,g,!1),c=new THREE.Vector3,l=new THREE.Vector3,u=new THREE.Vector3),m||(d=p=f=0);var H,x,b,_=this,M=this.vertices.length,T=(v=t.extractPoints(T)).shape,w=v.holes;if(v=!THREE.ShapeUtils.isClockWise(T)){for(T=T.reverse(),x=0,b=w.length;x<b;x++)H=w[x],THREE.ShapeUtils.isClockWise(H)&&(w[x]=H.reverse());v=!1}var S=THREE.ShapeUtils.triangulateShape(T,w),C=T;for(x=0,b=w.length;x<b;x++)H=w[x],T=T.concat(H);var L,A,P,U,D,I,k=T.length,F=S.length,v=[],B=0;for(L=(P=C.length)-1,A=B+1;B<P;B++,L++,A++)L===P&&(L=0),A===P&&(A=0),v[B]=i(C[B],C[L],C[A]);var V,N=[],O=v.concat();for(x=0,b=w.length;x<b;x++){for(H=w[x],V=[],B=0,L=(P=H.length)-1,A=B+1;B<P;B++,L++,A++)L===P&&(L=0),A===P&&(A=0),V[B]=i(H[B],H[L],H[A]);N.push(V),O=O.concat(V)}for(L=0;L<f;L++){for(U=p*(1-(P=L/f)),A=d*Math.sin(P*Math.PI/2),B=0,P=C.length;B<P;B++)D=r(C[B],v[B],A),o(D.x,D.y,-U);for(x=0,b=w.length;x<b;x++)for(H=w[x],V=N[x],B=0,P=H.length;B<P;B++)D=r(H[B],V[B],A),o(D.x,D.y,-U)}for(A=d,B=0;B<k;B++)D=m?r(T[B],O[B],A):T[B],y?(l.copy(h.normals[0]).multiplyScalar(D.x),c.copy(h.binormals[0]).multiplyScalar(D.y),u.copy(s[0]).add(l).add(c),o(u.x,u.y,u.z)):o(D.x,D.y,0);for(P=1;P<=g;P++)for(B=0;B<k;B++)D=m?r(T[B],O[B],A):T[B],y?(l.copy(h.normals[P]).multiplyScalar(D.x),c.copy(h.binormals[P]).multiplyScalar(D.y),u.copy(s[P]).add(l).add(c),o(u.x,u.y,u.z)):o(D.x,D.y,E/g*P);for(L=f-1;0<=L;L--){for(U=p*(1-(P=L/f)),A=d*Math.sin(P*Math.PI/2),B=0,P=C.length;B<P;B++)D=r(C[B],v[B],A),o(D.x,D.y,E+U);for(x=0,b=w.length;x<b;x++)for(H=w[x],V=N[x],B=0,P=H.length;B<P;B++)D=r(H[B],V[B],A),y?o(D.x,D.y+s[g-1].y,s[g-1].x+U):o(D.x,D.y,E+U)}!function(){if(m){var t;for(t=0*k,B=0;B<F;B++)I=S[B],a(I[2]+t,I[1]+t,I[0]+t);for(t=g+2*f,t*=k,B=0;B<F;B++)I=S[B],a(I[0]+t,I[1]+t,I[2]+t)}else{for(B=0;B<F;B++)I=S[B],a(I[2],I[1],I[0]);for(B=0;B<F;B++)I=S[B],a(I[0]+k*g,I[1]+k*g,I[2]+k*g)}}(),function(){var t=0;for(n(C,t),t+=C.length,x=0,b=w.length;x<b;x++)H=w[x],n(H,t),t+=H.length}()},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(t,e,r,i){return t=t.vertices,e=t[e],r=t[r],i=t[i],[new THREE.Vector2(e.x,e.y),new THREE.Vector2(r.x,r.y),new THREE.Vector2(i.x,i.y)]},generateSideWallUV:function(t,e,r,i,n){return t=t.vertices,e=t[e],r=t[r],i=t[i],n=t[n],.01>Math.abs(e.y-r.y)?[new THREE.Vector2(e.x,1-e.z),new THREE.Vector2(r.x,1-r.z),new THREE.Vector2(i.x,1-i.z),new THREE.Vector2(n.x,1-n.z)]:[new THREE.Vector2(e.y,1-e.z),new THREE.Vector2(r.y,1-r.z),new THREE.Vector2(i.y,1-i.z),new THREE.Vector2(n.y,1-n.z)]}},THREE.ShapeGeometry=function(t,e){THREE.Geometry.call(this),this.type="ShapeGeometry",!1===Array.isArray(t)&&(t=[t]),this.addShapeList(t,e),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry,THREE.ShapeGeometry.prototype.addShapeList=function(t,e){for(var r=0,i=t.length;r<i;r++)this.addShape(t[r],e);return this},THREE.ShapeGeometry.prototype.addShape=function(t,e){void 0===e&&(e={});var r,i,n,o=e.material,a=void 0===e.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:e.UVGenerator,s=this.vertices.length,h=(r=t.extractPoints(void 0!==e.curveSegments?e.curveSegments:12)).shape,c=r.holes;if(!THREE.ShapeUtils.isClockWise(h))for(h=h.reverse(),r=0,i=c.length;r<i;r++)n=c[r],THREE.ShapeUtils.isClockWise(n)&&(c[r]=n.reverse());var l=THREE.ShapeUtils.triangulateShape(h,c);for(r=0,i=c.length;r<i;r++)n=c[r],h=h.concat(n);for(c=h.length,i=l.length,r=0;r<c;r++)n=h[r],this.vertices.push(new THREE.Vector3(n.x,n.y,0));for(r=0;r<i;r++)c=l[r],h=c[0]+s,n=c[1]+s,c=c[2]+s,this.faces.push(new THREE.Face3(h,n,c,null,null,o)),this.faceVertexUvs[0].push(a.generateTopUV(this,h,n,c))},THREE.LatheGeometry=function(t,e,r,i){THREE.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},e=e||12,r=r||0,i=i||2*Math.PI;for(var n=1/(t.length-1),o=1/e,a=0,s=e;a<=s;a++)for(var h=r+a*o*i,c=Math.sin(h),l=Math.cos(h),h=0,u=t.length;h<u;h++){var E=t[h];(p=new THREE.Vector3).x=E.x*c,p.y=E.y,p.z=E.x*l,this.vertices.push(p)}for(r=t.length,a=0,s=e;a<s;a++)for(h=0,u=t.length-1;h<u;h++){i=(e=h+r*a)+r;var c=e+1+r,l=e+1,p=h*n,d=(E=a*o)+o,f=p+n;this.faces.push(new THREE.Face3(e,i,l)),this.faceVertexUvs[0].push([new THREE.Vector2(E,p),new THREE.Vector2(d,p),new THREE.Vector2(E,f)]),this.faces.push(new THREE.Face3(i,c,l)),this.faceVertexUvs[0].push([new THREE.Vector2(d,p),new THREE.Vector2(d,f),new THREE.Vector2(E,f)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry,THREE.PlaneGeometry=function(t,e,r,i){THREE.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:i},this.fromBufferGeometry(new THREE.PlaneBufferGeometry(t,e,r,i))},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry,THREE.PlaneBufferGeometry=function(t,e,r,i){THREE.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:i};var n=t/2,o=e/2,a=(r=Math.floor(r)||1)+1,s=(i=Math.floor(i)||1)+1,h=t/r,c=e/i;e=new Float32Array(a*s*3),t=new Float32Array(a*s*3);for(var l=new Float32Array(a*s*2),u=0,E=0,p=0;p<s;p++)for(var d=p*c-o,f=0;f<a;f++)e[u]=f*h-n,e[u+1]=-d,t[u+2]=1,l[E]=f/r,l[E+1]=1-p/i,u+=3,E+=2;for(u=0,n=new(65535<e.length/3?Uint32Array:Uint16Array)(r*i*6),p=0;p<i;p++)for(f=0;f<r;f++)o=f+a*(p+1),s=f+1+a*(p+1),h=f+1+a*p,n[u]=f+a*p,n[u+1]=o,n[u+2]=h,n[u+3]=o,n[u+4]=s,n[u+5]=h,u+=6;this.setIndex(new THREE.BufferAttribute(n,1)),this.addAttribute("position",new THREE.BufferAttribute(e,3)),this.addAttribute("normal",new THREE.BufferAttribute(t,3)),this.addAttribute("uv",new THREE.BufferAttribute(l,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingGeometry=function(t,e,r,i,n,o){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:r,phiSegments:i,thetaStart:n,thetaLength:o},t=t||0,e=e||50,n=void 0!==n?n:0,o=void 0!==o?o:2*Math.PI,r=void 0!==r?Math.max(3,r):8;var a,s=[],h=t,c=(e-t)/(i=void 0!==i?Math.max(1,i):8);for(t=0;t<i+1;t++){for(a=0;a<r+1;a++){var l=new THREE.Vector3,u=n+a/r*o;l.x=h*Math.cos(u),l.y=h*Math.sin(u),this.vertices.push(l),s.push(new THREE.Vector2((l.x/e+1)/2,(l.y/e+1)/2))}h+=c}for(e=new THREE.Vector3(0,0,1),t=0;t<i;t++)for(n=t*(r+1),a=0;a<r;a++)o=u=a+n,c=u+r+1,l=u+r+2,this.faces.push(new THREE.Face3(o,c,l,[e.clone(),e.clone(),e.clone()])),this.faceVertexUvs[0].push([s[o].clone(),s[c].clone(),s[l].clone()]),o=u,c=u+r+2,l=u+1,this.faces.push(new THREE.Face3(o,c,l,[e.clone(),e.clone(),e.clone()])),this.faceVertexUvs[0].push([s[o].clone(),s[c].clone(),s[l].clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,h)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(t,e,r,i,n,o,a){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:i,phiLength:n,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new THREE.SphereBufferGeometry(t,e,r,i,n,o,a))},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.SphereBufferGeometry=function(t,e,r,i,n,o,a){THREE.BufferGeometry.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:i,phiLength:n,thetaStart:o,thetaLength:a},t=t||50,e=Math.max(3,Math.floor(e)||8),r=Math.max(2,Math.floor(r)||6),i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;for(var s=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),h=(e+1)*(r+1),c=new THREE.BufferAttribute(new Float32Array(3*h),3),l=new THREE.BufferAttribute(new Float32Array(3*h),3),h=new THREE.BufferAttribute(new Float32Array(2*h),2),u=0,E=[],p=new THREE.Vector3,d=0;d<=r;d++){for(var f=[],m=d/r,T=0;T<=e;T++){var g=T/e,v=-t*Math.cos(i+g*n)*Math.sin(o+m*a),y=t*Math.cos(o+m*a),R=t*Math.sin(i+g*n)*Math.sin(o+m*a);p.set(v,y,R).normalize(),c.setXYZ(u,v,y,R),l.setXYZ(u,p.x,p.y,p.z),h.setXY(u,g,1-m),f.push(u),u++}E.push(f)}for(i=[],d=0;d<r;d++)for(T=0;T<e;T++)n=E[d][T+1],a=E[d][T],u=E[d+1][T],p=E[d+1][T+1],(0!==d||0<o)&&i.push(n,a,p),(d!==r-1||s<Math.PI)&&i.push(a,u,p);this.setIndex(new(65535<c.count?THREE.Uint32Attribute:THREE.Uint16Attribute)(i,1)),this.addAttribute("position",c),this.addAttribute("normal",l),this.addAttribute("uv",h),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,t)},THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry,THREE.TextGeometry=function(t,e){var r=(e=e||{}).font;if(!1==r instanceof THREE.Font)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new THREE.Geometry;r=r.generateShapes(t,e.size,e.curveSegments),e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),THREE.ExtrudeGeometry.call(this,r,e),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusGeometry=function(t,e,r,i,n){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:i,arc:n},t=t||100,e=e||40,r=r||8,i=i||6,n=n||2*Math.PI;for(var o=new THREE.Vector3,a=[],s=[],h=0;h<=r;h++)for(var c=0;c<=i;c++){var l=c/i*n,u=h/r*Math.PI*2;o.x=t*Math.cos(l),o.y=t*Math.sin(l);var E=new THREE.Vector3;E.x=(t+e*Math.cos(u))*Math.cos(l),E.y=(t+e*Math.cos(u))*Math.sin(l),E.z=e*Math.sin(u),this.vertices.push(E),a.push(new THREE.Vector2(c/i,h/r)),s.push(E.clone().sub(o).normalize())}for(h=1;h<=r;h++)for(c=1;c<=i;c++)t=(i+1)*h+c-1,e=(i+1)*(h-1)+c-1,n=(i+1)*(h-1)+c,o=(i+1)*h+c,l=new THREE.Face3(t,e,o,[s[t].clone(),s[e].clone(),s[o].clone()]),this.faces.push(l),this.faceVertexUvs[0].push([a[t].clone(),a[e].clone(),a[o].clone()]),l=new THREE.Face3(e,n,o,[s[e].clone(),s[n].clone(),s[o].clone()]),this.faces.push(l),this.faceVertexUvs[0].push([a[e].clone(),a[n].clone(),a[o].clone()]);this.computeFaceNormals()},THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry,THREE.TorusKnotGeometry=function(t,e,r,i,n,o,a){function s(t,e,r,i,n){var o=Math.cos(t),a=Math.sin(t);return t*=e/r,e=Math.cos(t),o*=i*(2+e)*.5,a=i*(2+e)*a*.5,i=n*i*Math.sin(t)*.5,new THREE.Vector3(o,a,i)}THREE.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:i,p:n,q:o,heightScale:a},t=t||100,e=e||40,r=r||64,i=i||8,n=n||2,o=o||3,a=a||1;for(var h=Array(r),c=new THREE.Vector3,l=new THREE.Vector3,u=new THREE.Vector3,E=0;E<r;++E){h[E]=Array(i);var p=s(d=E/r*2*n*Math.PI,o,n,t,a),d=s(d+.01,o,n,t,a);for(c.subVectors(d,p),l.addVectors(d,p),u.crossVectors(c,l),l.crossVectors(u,c),u.normalize(),l.normalize(),d=0;d<i;++d){var f=d/i*2*Math.PI,m=-e*Math.cos(f),f=e*Math.sin(f),T=new THREE.Vector3;T.x=p.x+m*l.x+f*u.x,T.y=p.y+m*l.y+f*u.y,T.z=p.z+m*l.z+f*u.z,h[E][d]=this.vertices.push(T)-1}}for(E=0;E<r;++E)for(d=0;d<i;++d)n=(E+1)%r,o=(d+1)%i,t=h[E][d],e=h[n][d],n=h[n][o],o=h[E][o],a=new THREE.Vector2(E/r,d/i),c=new THREE.Vector2((E+1)/r,d/i),l=new THREE.Vector2((E+1)/r,(d+1)/i),u=new THREE.Vector2(E/r,(d+1)/i),this.faces.push(new THREE.Face3(t,e,o)),this.faceVertexUvs[0].push([a,c,u]),this.faces.push(new THREE.Face3(e,n,o)),this.faceVertexUvs[0].push([c.clone(),l,u.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry,THREE.TubeGeometry=function(t,e,r,i,n,o){THREE.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:t,segments:e,radius:r,radialSegments:i,closed:n,taper:o},e=e||64,r=r||1,i=i||8,n=n||!1,o=o||THREE.TubeGeometry.NoTaper;var a,s,h,c,l,u,E,p,d,f,m=[],T=e+1,g=new THREE.Vector3;for(d=(p=new THREE.TubeGeometry.FrenetFrames(t,e,n)).normals,f=p.binormals,this.tangents=p.tangents,this.normals=d,this.binormals=f,p=0;p<T;p++)for(m[p]=[],h=p/(T-1),E=t.getPointAt(h),a=d[p],s=f[p],l=r*o(h),h=0;h<i;h++)c=h/i*2*Math.PI,u=-l*Math.cos(c),c=l*Math.sin(c),g.copy(E),g.x+=u*a.x+c*s.x,g.y+=u*a.y+c*s.y,g.z+=u*a.z+c*s.z,m[p][h]=this.vertices.push(new THREE.Vector3(g.x,g.y,g.z))-1;for(p=0;p<e;p++)for(h=0;h<i;h++)o=n?(p+1)%e:p+1,T=(h+1)%i,t=m[p][h],r=m[o][h],o=m[o][T],T=m[p][T],g=new THREE.Vector2(p/e,h/i),d=new THREE.Vector2((p+1)/e,h/i),f=new THREE.Vector2((p+1)/e,(h+1)/i),a=new THREE.Vector2(p/e,(h+1)/i),this.faces.push(new THREE.Face3(t,r,T)),this.faceVertexUvs[0].push([g,d,a]),this.faces.push(new THREE.Face3(r,o,T)),this.faceVertexUvs[0].push([d.clone(),f,a.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry,THREE.TubeGeometry.NoTaper=function(t){return 1},THREE.TubeGeometry.SinusoidalTaper=function(t){return Math.sin(Math.PI*t)},THREE.TubeGeometry.FrenetFrames=function(t,e,r){var i=new THREE.Vector3,n=[],o=[],a=[],s=new THREE.Vector3,h=new THREE.Matrix4;e+=1;var c,l,u;for(this.tangents=n,this.normals=o,this.binormals=a,c=0;c<e;c++)l=c/(e-1),n[c]=t.getTangentAt(l),n[c].normalize();for(o[0]=new THREE.Vector3,a[0]=new THREE.Vector3,t=Number.MAX_VALUE,c=Math.abs(n[0].x),l=Math.abs(n[0].y),u=Math.abs(n[0].z),c<=t&&(t=c,i.set(1,0,0)),l<=t&&(t=l,i.set(0,1,0)),u<=t&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),o[0].crossVectors(n[0],s),a[0].crossVectors(n[0],o[0]),c=1;c<e;c++)o[c]=o[c-1].clone(),a[c]=a[c-1].clone(),s.crossVectors(n[c-1],n[c]),s.length()>Number.EPSILON&&(s.normalize(),i=Math.acos(THREE.Math.clamp(n[c-1].dot(n[c]),-1,1)),o[c].applyMatrix4(h.makeRotationAxis(s,i))),a[c].crossVectors(n[c],o[c]);if(r)for(i=Math.acos(THREE.Math.clamp(o[0].dot(o[e-1]),-1,1)),i/=e-1,0<n[0].dot(s.crossVectors(o[0],o[e-1]))&&(i=-i),c=1;c<e;c++)o[c].applyMatrix4(h.makeRotationAxis(n[c],i*c)),a[c].crossVectors(n[c],o[c])},THREE.PolyhedronGeometry=function(t,e,r,i){function n(t){var e=t.normalize().clone();e.index=s.vertices.push(e)-1;var r=Math.atan2(t.z,-t.x)/2/Math.PI+.5;return t=Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5,e.uv=new THREE.Vector2(r,1-t),e}function o(t,e,r,i){i=new THREE.Face3(t.index,e.index,r.index,[t.clone(),e.clone(),r.clone()],void 0,i),s.faces.push(i),f.copy(t).add(e).add(r).divideScalar(3),i=Math.atan2(f.z,-f.x),s.faceVertexUvs[0].push([a(t.uv,t,i),a(e.uv,e,i),a(r.uv,r,i)])}function a(t,e,r){return 0>r&&1===t.x&&(t=new THREE.Vector2(t.x-1,t.y)),0===e.x&&0===e.z&&(t=new THREE.Vector2(r/2/Math.PI+.5,t.y)),t.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:i},r=r||1,i=i||0;for(var s=this,h=0,c=t.length;h<c;h+=3)n(new THREE.Vector3(t[h],t[h+1],t[h+2]));t=this.vertices;for(var l=[],u=h=0,c=e.length;h<c;h+=3,u++){var E=t[e[h]],p=t[e[h+1]],d=t[e[h+2]];l[u]=new THREE.Face3(E.index,p.index,d.index,[E.clone(),p.clone(),d.clone()],void 0,u)}for(var f=new THREE.Vector3,h=0,c=l.length;h<c;h++)!function(t,e){for(var r=Math.pow(2,e),i=n(s.vertices[t.a]),a=n(s.vertices[t.b]),h=n(s.vertices[t.c]),c=[],l=t.materialIndex,u=0;u<=r;u++){c[u]=[];for(var E=n(i.clone().lerp(h,u/r)),p=n(a.clone().lerp(h,u/r)),d=r-u,f=0;f<=d;f++)c[u][f]=0===f&&u===r?E:n(E.clone().lerp(p,f/d))}for(u=0;u<r;u++)for(f=0;f<2*(r-u)-1;f++)i=Math.floor(f/2),0==f%2?o(c[u][i+1],c[u+1][i],c[u][i],l):o(c[u][i+1],c[u+1][i+1],c[u+1][i],l)}(l[h],i);for(h=0,c=this.faceVertexUvs[0].length;h<c;h++)e=this.faceVertexUvs[0][h],i=e[0].x,t=e[1].x,l=e[2].x,u=Math.max(i,t,l),E=Math.min(i,t,l),.9<u&&.1>E&&(.2>i&&(e[0].x+=1),.2>t&&(e[1].x+=1),.2>l&&(e[2].x+=1));for(h=0,c=this.vertices.length;h<c;h++)this.vertices[h].multiplyScalar(r);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,r)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry,THREE.DodecahedronGeometry=function(t,e){var r=(1+Math.sqrt(5))/2,i=1/r;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}},THREE.DodecahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype),THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry,THREE.IcosahedronGeometry=function(t,e){var r=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}},THREE.IcosahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype);THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry,THREE.OctahedronGeometry=function(t,e){THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}},THREE.OctahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype),THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry,THREE.TetrahedronGeometry=function(t,e){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}},THREE.TetrahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype),THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry,THREE.ParametricGeometry=function(t,e,r){THREE.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:r};var i,n,o,a,s=this.vertices,h=this.faces,c=this.faceVertexUvs[0],l=e+1;for(i=0;i<=r;i++)for(a=i/r,n=0;n<=e;n++)o=n/e,o=t(o,a),s.push(o);var u,E,p,d;for(i=0;i<r;i++)for(n=0;n<e;n++)t=i*l+n,s=i*l+n+1,a=(i+1)*l+n+1,o=(i+1)*l+n,u=new THREE.Vector2(n/e,i/r),E=new THREE.Vector2((n+1)/e,i/r),p=new THREE.Vector2((n+1)/e,(i+1)/r),d=new THREE.Vector2(n/e,(i+1)/r),h.push(new THREE.Face3(t,s,o)),c.push([u,E,d]),h.push(new THREE.Face3(s,a,o)),c.push([E.clone(),p,d.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry,THREE.WireframeGeometry=function(t){function e(t,e){return t-e}THREE.BufferGeometry.call(this);var r=[0,0],i={},n=["a","b","c"];if(t instanceof THREE.Geometry){var o=t.vertices,a=t.faces,s=0,h=new Uint32Array(6*a.length);t=0;for(var c=a.length;t<c;t++)for(var l=a[t],u=0;3>u;u++){r[0]=l[n[u]],r[1]=l[n[(u+1)%3]],r.sort(e);var E=r.toString();void 0===i[E]&&(h[2*s]=r[0],h[2*s+1]=r[1],i[E]=!0,s++)}for(r=new Float32Array(6*s),t=0,c=s;t<c;t++)for(u=0;2>u;u++)i=o[h[2*t+u]],s=6*t+3*u,r[s+0]=i.x,r[s+1]=i.y,r[s+2]=i.z;this.addAttribute("position",new THREE.BufferAttribute(r,3))}else if(t instanceof THREE.BufferGeometry){if(null!==t.index){for(c=t.index.array,o=t.attributes.position,s=0,0===(n=t.groups).length&&t.addGroup(0,c.length),h=new Uint32Array(2*c.length),a=0,l=n.length;a<l;++a){u=(t=n[a]).start,E=t.count,t=u;for(var p=u+E;t<p;t+=3)for(u=0;3>u;u++)r[0]=c[t+u],r[1]=c[t+(u+1)%3],r.sort(e),E=r.toString(),void 0===i[E]&&(h[2*s]=r[0],h[2*s+1]=r[1],i[E]=!0,s++)}for(r=new Float32Array(6*s),t=0,c=s;t<c;t++)for(u=0;2>u;u++)s=6*t+3*u,i=h[2*t+u],r[s+0]=o.getX(i),r[s+1]=o.getY(i),r[s+2]=o.getZ(i)}else for(o=t.attributes.position.array,s=o.length/3,h=s/3,r=new Float32Array(6*s),t=0,c=h;t<c;t++)for(u=0;3>u;u++)s=18*t+6*u,h=9*t+3*u,r[s+0]=o[h],r[s+1]=o[h+1],r[s+2]=o[h+2],i=9*t+(u+1)%3*3,r[s+3]=o[i],r[s+4]=o[i+1],r[s+5]=o[i+2];this.addAttribute("position",new THREE.BufferAttribute(r,3))}},THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.WireframeGeometry.prototype.constructor=THREE.WireframeGeometry,THREE.AxisHelper=function(t){t=t||1;var e=new Float32Array([0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t]),r=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);(t=new THREE.BufferGeometry).addAttribute("position",new THREE.BufferAttribute(e,3)),t.addAttribute("color",new THREE.BufferAttribute(r,3)),e=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),THREE.LineSegments.call(this,t,e)},THREE.AxisHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.AxisHelper.prototype.constructor=THREE.AxisHelper,THREE.ArrowHelper=function(){var t=new THREE.Geometry;t.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var e=new THREE.CylinderGeometry(0,.5,1,5,1);return e.translate(0,-.5,0),function(r,i,n,o,a,s){THREE.Object3D.call(this),void 0===o&&(o=16776960),void 0===n&&(n=1),void 0===a&&(a=.2*n),void 0===s&&(s=.2*a),this.position.copy(i),this.line=new THREE.Line(t,new THREE.LineBasicMaterial({color:o})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new THREE.Mesh(e,new THREE.MeshBasicMaterial({color:o})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(r),this.setLength(n,a,s)}}(),THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper,THREE.ArrowHelper.prototype.setDirection=function(){var t,e=new THREE.Vector3;return function(r){.99999<r.y?this.quaternion.set(0,0,0,1):-.99999>r.y?this.quaternion.set(1,0,0,0):(e.set(r.z,0,-r.x).normalize(),t=Math.acos(r.y),this.quaternion.setFromAxisAngle(e,t))}}(),THREE.ArrowHelper.prototype.setLength=function(t,e,r){void 0===e&&(e=.2*t),void 0===r&&(r=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},THREE.BoxHelper=function(t){var e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new THREE.BufferGeometry;i.setIndex(new THREE.BufferAttribute(e,1)),i.addAttribute("position",new THREE.BufferAttribute(r,3)),THREE.LineSegments.call(this,i,new THREE.LineBasicMaterial({color:16776960})),void 0!==t&&this.update(t)},THREE.BoxHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.BoxHelper.prototype.constructor=THREE.BoxHelper,THREE.BoxHelper.prototype.update=function(){var t=new THREE.Box3;return function(e){if(t.setFromObject(e),!t.isEmpty()){e=t.min;var r=t.max,i=this.geometry.attributes.position,n=i.array;n[0]=r.x,n[1]=r.y,n[2]=r.z,n[3]=e.x,n[4]=r.y,n[5]=r.z,n[6]=e.x,n[7]=e.y,n[8]=r.z,n[9]=r.x,n[10]=e.y,n[11]=r.z,n[12]=r.x,n[13]=r.y,n[14]=e.z,n[15]=e.x,n[16]=r.y,n[17]=e.z,n[18]=e.x,n[19]=e.y,n[20]=e.z,n[21]=r.x,n[22]=e.y,n[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),THREE.BoundingBoxHelper=function(t,e){var r=void 0!==e?e:8947848;this.object=t,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:r,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper,THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(t){function e(t,e,i){r(t,i),r(e,i)}function r(t,e){i.vertices.push(new THREE.Vector3),i.colors.push(new THREE.Color(e)),void 0===o[t]&&(o[t]=[]),o[t].push(i.vertices.length-1)}var i=new THREE.Geometry,n=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),o={};e("n1","n2",16755200),e("n2","n4",16755200),e("n4","n3",16755200),e("n3","n1",16755200),e("f1","f2",16755200),e("f2","f4",16755200),e("f4","f3",16755200),e("f3","f1",16755200),e("n1","f1",16755200),e("n2","f2",16755200),e("n3","f3",16755200),e("n4","f4",16755200),e("p","n1",16711680),e("p","n2",16711680),e("p","n3",16711680),e("p","n4",16711680),e("u1","u2",43775),e("u2","u3",43775),e("u3","u1",43775),e("c","t",16777215),e("p","c",3355443),e("cn1","cn2",3355443),e("cn3","cn4",3355443),e("cf1","cf2",3355443),e("cf3","cf4",3355443),THREE.LineSegments.call(this,i,n),this.camera=t,this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.CameraHelper.prototype.constructor=THREE.CameraHelper,THREE.CameraHelper.prototype.update=function(){function t(t,o,a,s){if(i.set(o,a,s).unproject(n),void 0!==(t=r[t]))for(o=0,a=t.length;o<a;o++)e.vertices[t[o]].copy(i)}var e,r,i=new THREE.Vector3,n=new THREE.Camera;return function(){e=this.geometry,r=this.pointMap,n.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-1,-1,-1),t("n2",1,-1,-1),t("n3",-1,1,-1),t("n4",1,1,-1),t("f1",-1,-1,1),t("f2",1,-1,1),t("f3",-1,1,1),t("f4",1,1,1),t("u1",.7,1.1,-1),t("u2",-.7,1.1,-1),t("u3",0,2,-1),t("cf1",-1,0,1),t("cf2",1,0,1),t("cf3",0,-1,1),t("cf4",0,1,1),t("cn1",-1,0,-1),t("cn2",1,0,-1),t("cn3",0,-1,-1),t("cn4",0,1,-1),e.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(t,e){THREE.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,e=e||1;var r=new THREE.Geometry;r.vertices.push(new THREE.Vector3(-e,e,0),new THREE.Vector3(e,e,0),new THREE.Vector3(e,-e,0),new THREE.Vector3(-e,-e,0),new THREE.Vector3(-e,e,0));var i=new THREE.LineBasicMaterial({fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Line(r,i),this.add(this.lightPlane),(r=new THREE.Geometry).vertices.push(new THREE.Vector3,new THREE.Vector3),(i=new THREE.LineBasicMaterial({fog:!1})).color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(r,i),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper,THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Vector3;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),r.subVectors(e,t),this.lightPlane.lookAt(r),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(r),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),THREE.EdgesHelper=function(t,e,r){e=void 0!==e?e:16777215,THREE.LineSegments.call(this,new THREE.EdgesGeometry(t.geometry,r),new THREE.LineBasicMaterial({color:e})),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},THREE.EdgesHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper,THREE.FaceNormalsHelper=function(t,e,r,i){this.object=t,this.size=void 0!==e?e:1,t=void 0!==r?r:16776960,i=void 0!==i?i:1,e=0,(r=this.object.geometry)instanceof THREE.Geometry?e=r.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead."),r=new THREE.BufferGeometry,e=new THREE.Float32Attribute(6*e,3),r.addAttribute("position",e),THREE.LineSegments.call(this,r,new THREE.LineBasicMaterial({color:t,linewidth:i})),this.matrixAutoUpdate=!1,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper,THREE.FaceNormalsHelper.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Matrix3;return function(){this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);for(var i=this.object.matrixWorld,n=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=0,h=0,c=(o=o.faces).length;h<c;h++){var l=o[h],u=l.normal;t.copy(a[l.a]).add(a[l.b]).add(a[l.c]).divideScalar(3).applyMatrix4(i),e.copy(u).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),n.setXYZ(s,t.x,t.y,t.z),s+=1,n.setXYZ(s,e.x,e.y,e.z),s+=1}return n.needsUpdate=!0,this}}(),THREE.GridHelper=function(t,e){var r=new THREE.Geometry,i=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var n=-t;n<=t;n+=e){r.vertices.push(new THREE.Vector3(-t,0,n),new THREE.Vector3(t,0,n),new THREE.Vector3(n,0,-t),new THREE.Vector3(n,0,t));var o=0===n?this.color1:this.color2;r.colors.push(o,o,o,o)}THREE.LineSegments.call(this,r,i)},THREE.GridHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.GridHelper.prototype.constructor=THREE.GridHelper,THREE.GridHelper.prototype.setColors=function(t,e){this.color1.set(t),this.color2.set(e),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(t,e){THREE.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var r=new THREE.SphereGeometry(e,4,2);r.rotateX(-Math.PI/2);for(var i=0;8>i;i++)r.faces[i].color=this.colors[4>i?0:1];i=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0}),this.lightSphere=new THREE.Mesh(r,i),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper,THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var t=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(t,e){this.light=t,this.light.updateMatrixWorld();var r=new THREE.SphereGeometry(e,4,2),i=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper,THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SkeletonHelper=function(t){this.bones=this.getBoneList(t);for(var e=new THREE.Geometry,r=0;r<this.bones.length;r++)this.bones[r].parent instanceof THREE.Bone&&(e.vertices.push(new THREE.Vector3),e.vertices.push(new THREE.Vector3),e.colors.push(new THREE.Color(0,0,1)),e.colors.push(new THREE.Color(0,1,0)));e.dynamic=!0,r=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0}),THREE.LineSegments.call(this,e,r),this.root=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.update()},THREE.SkeletonHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.SkeletonHelper.prototype.constructor=THREE.SkeletonHelper,THREE.SkeletonHelper.prototype.getBoneList=function(t){var e=[];t instanceof THREE.Bone&&e.push(t);for(var r=0;r<t.children.length;r++)e.push.apply(e,this.getBoneList(t.children[r]));return e},THREE.SkeletonHelper.prototype.update=function(){for(var t=this.geometry,e=(new THREE.Matrix4).getInverse(this.root.matrixWorld),r=new THREE.Matrix4,i=0,n=0;n<this.bones.length;n++){var o=this.bones[n];o.parent instanceof THREE.Bone&&(r.multiplyMatrices(e,o.matrixWorld),t.vertices[i].setFromMatrixPosition(r),r.multiplyMatrices(e,o.parent.matrixWorld),t.vertices[i+1].setFromMatrixPosition(r),i+=2)}t.verticesNeedUpdate=!0,t.computeBoundingSphere()},THREE.SpotLightHelper=function(t){THREE.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,(t=new THREE.CylinderGeometry(0,1,1,8,1,!0)).translate(0,-.5,0),t.rotateX(-Math.PI/2);var e=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(t,e),this.add(this.cone),this.update()},THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper,THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},THREE.SpotLightHelper.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(){var r=this.light.distance?this.light.distance:1e4,i=r*Math.tan(this.light.angle);this.cone.scale.set(i,i,r),t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e.sub(t)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),THREE.VertexNormalsHelper=function(t,e,r,i){this.object=t,this.size=void 0!==e?e:1,t=void 0!==r?r:16711680,i=void 0!==i?i:1,e=0,(r=this.object.geometry)instanceof THREE.Geometry?e=3*r.faces.length:r instanceof THREE.BufferGeometry&&(e=r.attributes.normal.count),r=new THREE.BufferGeometry,e=new THREE.Float32Attribute(6*e,3),r.addAttribute("position",e),THREE.LineSegments.call(this,r,new THREE.LineBasicMaterial({color:t,linewidth:i})),this.matrixAutoUpdate=!1,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Matrix3;return function(){var i=["a","b","c"];this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);var n=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a instanceof THREE.Geometry)for(var s=a.vertices,h=a.faces,c=a=0,l=h.length;c<l;c++)for(var u=h[c],E=0,p=u.vertexNormals.length;E<p;E++){var d=u.vertexNormals[E];t.copy(s[u[i[E]]]).applyMatrix4(n),e.copy(d).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),o.setXYZ(a,t.x,t.y,t.z),a+=1,o.setXYZ(a,e.x,e.y,e.z),a+=1}else if(a instanceof THREE.BufferGeometry)for(i=a.attributes.position,s=a.attributes.normal,E=a=0,p=i.count;E<p;E++)t.set(i.getX(E),i.getY(E),i.getZ(E)).applyMatrix4(n),e.set(s.getX(E),s.getY(E),s.getZ(E)),e.applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),o.setXYZ(a,t.x,t.y,t.z),a+=1,o.setXYZ(a,e.x,e.y,e.z),a+=1;return o.needsUpdate=!0,this}}(),THREE.WireframeHelper=function(t,e){var r=void 0!==e?e:16777215;THREE.LineSegments.call(this,new THREE.WireframeGeometry(t.geometry),new THREE.LineBasicMaterial({color:r})),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(t){THREE.Object3D.call(this),this.material=t,this.render=function(t){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(t,e){THREE.Mesh.call(this,t,e),this.animationsMap={},this.animationsList=[];var r=this.geometry.morphTargets.length;this.createAnimation("__default",0,r-1,r/1),this.setAnimationWeight("__default",1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(t,e,r,i){e={start:e,end:r,length:r-e+1,fps:i,duration:(r-e)/i,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[t]=e,this.animationsList.push(e)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(t){for(var e,r=/([a-z]+)_?(\d+)/i,i={},n=this.geometry,o=0,a=n.morphTargets.length;o<a;o++){var s=n.morphTargets[o].name.match(r);if(s&&1<s.length){var h=s[1];i[h]||(i[h]={start:1/0,end:-1/0}),o<(s=i[h]).start&&(s.start=o),o>s.end&&(s.end=o),e||(e=h)}}for(h in i)s=i[h],this.createAnimation(h,s.start,s.end,t);this.firstAnimation=e},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(t){(t=this.animationsMap[t])&&(t.direction=1,t.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(t){(t=this.animationsMap[t])&&(t.direction=-1,t.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(t,e){var r=this.animationsMap[t];r&&(r.fps=e,r.duration=(r.end-r.start)/r.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(t,e){var r=this.animationsMap[t];r&&(r.duration=e,r.fps=(r.end-r.start)/r.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(t,e){var r=this.animationsMap[t];r&&(r.weight=e)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(t,e){var r=this.animationsMap[t];r&&(r.time=e)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(t){var e=0;return(t=this.animationsMap[t])&&(e=t.time),e},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(t){var e=-1;return(t=this.animationsMap[t])&&(e=t.duration),e},THREE.MorphBlendMesh.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(t){(t=this.animationsMap[t])&&(t.active=!1)},THREE.MorphBlendMesh.prototype.update=function(t){for(var e=0,r=this.animationsList.length;e<r;e++){var i=this.animationsList[e];if(i.active){var n=i.duration/i.length;i.time+=i.direction*t,i.mirroredLoop?(i.time>i.duration||0>i.time)&&(i.direction*=-1,i.time>i.duration&&(i.time=i.duration,i.directionBackwards=!0),0>i.time&&(i.time=0,i.directionBackwards=!1)):(i.time%=i.duration,0>i.time&&(i.time+=i.duration));var o=i.start+THREE.Math.clamp(Math.floor(i.time/n),0,i.length-1),a=i.weight;o!==i.currentFrame&&(this.morphTargetInfluences[i.lastFrame]=0,this.morphTargetInfluences[i.currentFrame]=1*a,this.morphTargetInfluences[o]=0,i.lastFrame=i.currentFrame,i.currentFrame=o),n=i.time%n/n,i.directionBackwards&&(n=1-n),i.currentFrame!==i.lastFrame?(this.morphTargetInfluences[i.currentFrame]=n*a,this.morphTargetInfluences[i.lastFrame]=(1-n)*a):this.morphTargetInfluences[i.currentFrame]=a}}};var Util=function(){function t(){}return t.prototype.webgl=function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}},t}(),ITEM_DATA_NAME="clouds";Clouds.prototype={VERSION:"2.2.0",defaults:{imageCloud:"",cloudSpeed:1,skyColor:"#ffffff",skyColorPower:50,cameraControl:!1,cameraXSpeed:.01,cameraYSpeed:.02,cloudData:[]},cameraNearClipPlane:1,cameraFarClipPlane:1e3,vFOV:60,init:function(t,e){this.container=t,this.config=e,this.create()},create:function(){if(!this.util().webgl())throw Error("Your browser does not support WebGL.");this.resetListeners(),this.resetScene(),this.load()},load:function(){var t={};t.cloud=this.config.imageCloud;var e=0,r=0;for(var i in t)t.hasOwnProperty(i)&&e++;for(var i in t)if(t.hasOwnProperty(i)){var n=new XMLHttpRequest;n.open("GET",t[i],!0),n.crossOrigin="Anonymous",n.responseType="arraybuffer",n.customKey=i,n.onload=$.proxy(function(i){var n=i.currentTarget;if(n.status>=400)return n.onerror(i);var o=new Blob([n.response]),a=new Image;a.src=window.URL.createObjectURL(o),a.onload=$.proxy(function(i){t[i.customKey]=a,++r==e&&(this.applyListeners(),this.buildScene(t),this.renderScene())},this,n)},this),n.onerror=$.proxy(function(t){var e=t.currentTarget;throw Error("Cannot load resource "+e.responseURL+". Status code ["+e.status+"]")},this),n.send()}},buildScene:function(t){var e=this.container.width(),r=this.container.height();this.aspect=e/r,this.scene=new THREE.Scene,this.camera=new THREE.PerspectiveCamera(this.vFOV,this.aspect,this.cameraNearClipPlane,this.cameraFarClipPlane),this.camera.position.z=this.cameraFarClipPlane,this.scene.add(this.camera);var i=this.createTexture(t,"cloud");this.buildClouds(i),this.renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(e,r),this.container.append(this.renderer.domElement)},buildClouds:function(t){var e={uniforms:{texCloud:{type:"t",value:null},skyColor:{type:"c",value:null},fogFar:{type:"f",value:null},fogNear:{type:"f",value:null},horizonLength:{type:"f",value:null}},vs:["varying vec2 vUv;","void main()","{","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fs:["uniform sampler2D texCloud;","uniform vec3 skyColor;","uniform float fogFar;","uniform float fogNear;","uniform float horizonLength;","varying vec2 vUv;","void main()","{","float distance = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = smoothstep( fogNear, fogFar, distance );","gl_FragColor = texture2D( texCloud, vUv );","if(distance >= (horizonLength - 200.0)) {","gl_FragColor.a *= 1.0 - ((distance - (horizonLength - 200.0)) / 200.0);","} else if(distance <= 200.0) {","gl_FragColor.a *= (distance / 200.0);","}","gl_FragColor = mix( gl_FragColor, vec4( skyColor, gl_FragColor.w ), fogFactor );","}"].join("\n")};e.uniforms.texCloud.value=t;var r=1-.01*Math.min(Math.max(parseInt(this.config.skyColorPower,10),0),100),i=new THREE.Fog(this.config.skyColor,this.cameraFarClipPlane*r,this.cameraFarClipPlane);e.uniforms.skyColor.value=i.color,e.uniforms.fogFar.value=i.far,e.uniforms.fogNear.value=i.near,e.uniforms.horizonLength.value=this.cameraFarClipPlane;for(var n=new THREE.ShaderMaterial({uniforms:e.uniforms,vertexShader:e.vs,fragmentShader:e.fs,depthWrite:!1,depthTest:!1,transparent:!0}),o=Math.tan(this.vFOV/2*Math.PI/180)*this.cameraFarClipPlane*2*2,a=o*this.aspect,s=new THREE.Geometry,h=0;h<this.cameraFarClipPlane;h++){for(var c=new THREE.PlaneGeometry(128,128),l=Math.random()*a-a/2,u=-Math.random()*Math.random()*o/40-o/20,E=h,p=Math.random()*Math.PI,d=2*Math.random()+.5,f=0;f<this.config.cloudData.length;f++)if(this.config.cloudData[f].i==h){var m=this.config.cloudData[f];m.hasOwnProperty("x")&&(l=m.x*a-a/2),m.hasOwnProperty("y")&&(u=m.y*o-o/2),m.hasOwnProperty("rotate")&&(p=m.rotate*Math.PI),m.hasOwnProperty("scale")&&(d=m.scale);break}c.center(),c.rotateZ(p),c.scale(d,d,1),c.translate(l,u,E),s.merge(c)}var T=new THREE.Mesh(s,n);this.scene.add(T),(T=new THREE.Mesh(s,n)).position.z=-this.cameraFarClipPlane,this.scene.add(T)},resetScene:function(){this.animationId&&cancelAnimationFrame(this.animationId),this.renderer=null,this.scene=null,this.camera=null,this.container.empty()},renderScene:function(){this.animationId=requestAnimationFrame($.proxy(this.renderScene,this)),this.camera.position.z-=this.config.cloudSpeed,this.camera.position.z<0&&(this.camera.position.z=this.cameraFarClipPlane),this.camera.position.x+=(this.cameraX.value-this.camera.position.x)*this.config.cameraXSpeed,this.camera.position.y+=(this.cameraY.value-this.camera.position.y)*this.config.cameraYSpeed,this.camera.rotation.z+=.05*(this.cameraRotation.value-this.camera.rotation.z),this.renderer.render(this.scene,this.camera)},pause:function(){this.animationId&&cancelAnimationFrame(this.animationId)},play:function(){this.renderScene()},applyListeners:function(){this.config.cameraControl&&(this.container.on("mousemove.clouds",$.proxy(this.onMouseMove,this)),this.container.on("touchmove.clouds",$.proxy(this.onMouseMove,this))),$(window).on("resize.clouds",$.proxy(this.onWindowResize,this))},resetListeners:function(){this.container.off("mousemove.clouds"),this.container.off("touchmove.clouds"),$(window).off("resize.clouds")},onMouseMove:function(t){var e=this.getMousePositionPower("touchmove"==t.type?t.originalEvent.targetTouches[0]:t);this.cameraX.value=e.x<0?e.x*Math.abs(this.cameraX.min):e.x*Math.abs(this.cameraX.max),this.cameraY.value=e.y<0?e.y*Math.abs(this.cameraY.min):e.y*Math.abs(this.cameraY.max),this.cameraRotation.value=.03*e.x},onWindowResize:function(t){this.aspect=this.container.width()/this.container.height(),this.camera.aspect=this.aspect,this.camera.updateProjectionMatrix(),this.renderer.setSize(this.container.width(),this.container.height())},destroy:function(){this.resetListeners(),this.resetScene()},getMousePositionPower:function(t){var e=this.container.get(0).getBoundingClientRect(),r={},i=(e.right-e.left)/2,n=(e.bottom-e.top)/2,o=this.container.offset();return r.x=(t.pageX-o.left-i)/i,r.y=(n-(t.pageY-o.top))/n,r},createTexture:function(t,e){var r=new THREE.Texture;return r.image=t[e],r.needsUpdate=!0,r},util:function(){return null!=this._util?this._util:this._util=new Util}},$.clouds=function(t,e){if("support"==t){new Util;return!!this.util().webgl()}},$.fn.clouds=function(t,e){return this.each(function(){var e=$(this),r=e.data(ITEM_DATA_NAME),i=$.isPlainObject(t)?t:{};if("destroy"!=t)if("pause"!=t)if("play"!=t)if(r){var n=$.extend({},r.config,i);r.init(e,n)}else r=new Clouds(e,n=$.extend({},Clouds.prototype.defaults,i)),e.data(ITEM_DATA_NAME,r);else{if(!r)throw Error("Calling 'play' method on not initialized instance is forbidden");r.play()}else{if(!r)throw Error("Calling 'pause' method on not initialized instance is forbidden");r.pause()}else{if(!r)throw Error("Calling 'destroy' method on not initialized instance is forbidden");r.destroy()}})};var config={imageCloud:weather_press_data_from_php.weather_press_Plugin_Path+"/public/images/cloud-white.png",skyColor:"#8c9793",skyColorPower:100,cloudSpeed:1.5,cameraControl:!0,cloudData:[{i:0,x:.5,y:.4,scale:3},{i:150,x:.5,y:.4,scale:5},{i:300,x:.5,y:.4,scale:6},{i:450,x:.5,y:.4,scale:6},{i:600,x:.5,y:.4,scale:7},{i:10,x:.35,y:.45,scale:2},{i:160,x:.35,y:.45,scale:4},{i:310,x:.35,y:.45,scale:5},{i:460,x:.35,y:.45,scale:5},{i:610,x:.35,y:.45,scale:6},{i:20,x:.65,y:.45,scale:2},{i:170,x:.65,y:.45,scale:4},{i:320,x:.65,y:.45,scale:5},{i:470,x:.65,y:.45,scale:5},{i:620,x:.65,y:.45,scale:6}]},clouds=$("#weather_press_scene_container");clouds.clouds(config);   
    569397
    570398}//end of if weather_Press_LayoutContainer exists   
  • weather-press/trunk/public/partials/weather-press-public-display.php

    r1697235 r1759591  
    1111 *
    1212 * @link       https://www.weather-press.com
    13  * @since      4.0 Rises
     13 * @since      4.5
    1414 *
    1515 * @package    Weather_Press
     
    5252}
    5353</script>
    54 <?php
    5554
    56 $weather_press_langStyle = '';
     55<div id='weather-press-layoutContainer' class='weather-press-layoutContainer'>
    5756
    58 if( $weather_press_Current_Language=='AR' ) {
    59    
    60     $weather_press_langStyle = 'text-align:right;';
    61 }
     57    <div id="weather-press-loader" class="weather-press-loader animated flipOutX">
     58       
     59        <div class="weather-press-closeIcon" data-weatherpressclose="weather-press-loader"></div>
     60        <div style='clear:both'></div>
     61       
     62        <div class="weather-press-signature">Weather Press</div>
     63       
     64        <div class="weather-press-outputs">
     65           
     66            <span class="weather-press-outputs-content" style="">Loading ...</span>
    6267
    63 ?>
    64 <div id='weather-press-layoutContainer'>
    65 
    66     <div id='weather-press-loader' class='weather-press-loader animated'>
    67        
    68         <div class='weather-press-closeIcon' data-weatherpressclose='weather-press-loader'></div>
    69        
    70         <div class='weather-press-signature'>Weather Press</div>
    71        
    72         <div class='weather-press-outputs'>
    73            
    74             <span class='weather-press-outputs-content' style='<?php echo $weather_press_langStyle; ?>'>Loading ...</span>
    75 
    76             <span class='weather-press-outputs-notice'>
    77 
    78                 you are <em>sharing</em> a weather <em>API key with all free users</em>, which can cause frequent <em>wrong</em> or <em>missing</em> weather results, please consider to go premium and set your own weather API key for <em>your own use</em>.
     68            <span class="weather-press-outputs-notice">
    7969
    8070            </span>         
    8171           
    82             <span class='weather-press-outputs-toPremium'>
     72            <span class="weather-press-outputs-toPremium">
    8373
    84                 <a href='https://www.weather-press.com/weather-press-store' target='blank' >Go Premium Now ?</a>
     74                <a href="https://goo.gl/nQBz6O" target="blank">Go Premium Now ?</a>
    8575           
    8676            </span>
     
    9080    </div>
    9181
     82    <div class='weather-press-block-top'>
    9283   
    93     <div class='weather-press-bgLevel2Container'>   
     84        <div class='weather-press-cities-nav-container'>
    9485       
    95         <div class='weather-press-bgLevel2'></div>
     86            <div class='weather-press-cities-nav-sub-container'>
    9687       
     88                <div class='weather-press-arrows-container'>
     89               
     90                    <ul class='weather-press-cities-navs'>
     91                   
     92                        <li id='weather-press-cities-navs-top'></li>
     93                        <li id='weather-press-cities-navs-bottom'></li>
     94                   
     95                    </ul>
     96               
     97                </div>
     98           
     99                <span id='weather-press-city-name' title='Main city'>Main city</span>
     100           
     101                <span id='weather-press-display-image' title='current location image'></span>
     102           
     103            </div>
     104       
     105        </div>
     106       
     107        <div class='weather-press-cities-list-container'>
     108       
     109            <ul class='weather-press-cities-list'>
     110       
     111                <li class='deep'></li>
     112                <li></li>
     113                <li class='main-location'><?php echo $wpress_Main_Location; ?></li><!-- Main location -->
     114                <li><?php echo $wpress_Secondary_Location_Bottom; ?></li><!-- secondary location -->
     115                <li class='deep'></li>
     116
     117            </ul>
     118       
     119        </div>
     120   
    97121    </div>
    98    
    99     <div class='weather-press-bgLevel3'></div>
    100122
    101     <ul class='weather-press-mainList weather-press-mainListTop'>
    102    
    103         <li class='weather-press-citiesListContainer'><!-- cities list block -->
     123    <div class='weather-press-block-bottom'>
     124
     125        <div id='weather_press_scene_container' class='weather_press_scene_container'></div>
     126
     127        <div class='weather-press-forecast-nav-container'>
    104128       
    105             <ul class='weather-press-citiesList'>
    106            
    107                 <li class='weather-press-deep1' data-weatherpressads='1'><a href='https://www.weather-press.com/weather-press-store' target='blank'> &nbsp </a></li>
    108                
    109                 <li class='weather-press-deep2' data-weatherpressads='1'></li><!-- secondary location nbr 1 -->
    110                
    111                 <li class='weather-press-centred' data-weatherpressads='0'><?php echo $wpress_Main_Location; ?></li><!-- Main location -->
    112                
    113                 <li class='weather-press-deep2' data-weatherpressads='0'><?php echo $wpress_Secondary_Location_Bottom; ?></li><!-- secondary location nbr 2 -->
    114                
    115                 <li class='weather-press-deep1' data-weatherpressads='1'><a href='https://www.weather-press.com/weather-press-store' target='blank'> &nbsp </a></li>
    116            
     129            <ul class='weather-press-forecast-navs'>
     130                   
     131                <li id='weather-press-forecast-navs-left'></li>
     132                <li id='weather-press-forecast-navs-right'></li>
     133                   
    117134            </ul>
    118135       
    119         </li>
     136        </div>
     137   
     138        <div class='weather-press-forecast-list-container'>
    120139       
    121         <li class='weather-press-rightTopBlock'><!-- current date, current temp and weather icon -->
    122        
    123             <ul>
     140            <ul class='weather-press-forecast-list'>
     141
     142                <li id='weather_press_forecast_node_0'><!-- forecast item -->
    124143               
    125                 <li class='weather-press-icon'>
    126                
    127                     <img src='<?php echo WEATHER_PRESS_PATH . '/public/images/demo-1.svg' ; ?>' alt='current weather icon'/>
    128                
    129                 </li>
    130                
    131                 <li class='weather-press-currentTemp'>
    132                
    133                     <span class='weather-press-currentTempValue'>00°</span>
    134                     <!--<span class='weather-press-currentTempUnit'>c</span>-->
     144                    <ul class='weather-press-forecast-item'>
    135145                   
    136                 </li>
    137            
    138             </ul>       
    139        
    140         </li>
    141        
    142     </ul>
    143        
    144     <ul class='weather-press-mainList'>
    145        
    146         <li class='weather-press-fullWidthBlock weather-press-conditionsBlock' style='<?php echo $weather_press_langStyle; ?>'><!-- conditions block -->
    147        
    148                                 <?php
    149                                     if( $weather_press_Current_Language=='AR' ) {echo '<script language=javascript>Ar_Date();</script>';}
     146                        <li class='weather-press-date'>
     147                       
     148                            <?php
     149                                if( $weather_press_Current_Language=='AR' ) {echo '<script language=javascript>Ar_Date();</script>';}
    150150
    151                                     else if( $weather_press_Current_Language=='EN' ) { echo strftime("%A %d %m"); }
     151                                else if( $weather_press_Current_Language=='EN' ) { echo date('l \t\h\e jS'); }
    152152
    153                                     else { echo '???'; }
    154                                 ?>
    155        
    156         </li>
    157        
    158         <li class='weather-press-fullWidthBlock weather-press-optionsBlock'><!-- options icons block -->
    159        
    160             <ul>
    161            
    162                 <li class='weather-press-geoLoc' title='Premium feature'></li>
     153                                else { echo '???'; }
     154                            ?>
     155                       
     156                        </li>
     157                       
     158                        <li class='weather-press-temp'>00°</li>
    163159
    164                 <li class='weather-press-refrech'></li>
     160                        <li  class='weather-press-condition-img'>
     161                            <img src='<?php echo WEATHER_PRESS_PATH . '/public/images/demo-1.svg' ; ?>' alt='current condition'/>
     162                        </li>
    165163
    166                 <li class='weather-press-forecasts'>
    167                
    168                     <ul>
    169                    
    170                         <li class='weather-press-forecasts-mainStatus weather-press-forecast-active'></li><!-- back to the main status -->
     164                        <li class='weather-press-minMax'>
    171165                       
    172                         <li title='Premium daily forecast feature' data-weatherpressforecastDays='0'></li>
     166                            <ul>
    173167
    174                         <li title='Premium daily forecast feature' data-weatherpressforecastDays='1'></li>
     168                                <li class='weather-press-min-temp'>00°</li>
     169                                <li class='weather-press-temp-gauge'><div class='weather-press-gauge-gradient'></div></li>
     170                                <li class='weather-press-max-temp'>00°</li>
    175171
    176                         <li title='Premium daily forecast feature' data-weatherpressforecastDays='2'></li>
     172                            </ul>
     173                       
     174                        </li>
    177175                   
    178176                    </ul>
    179177               
    180178                </li>
    181            
    182             </ul>
     179
     180                <div id="weather-press-forecast-loader" class="weather-press-forecast-loader"></div>               
     181               
     182            </ul>
    183183       
    184         </li>
    185        
    186         <li class='weather-press-fullWidthBlock weather-press-forecastBlock' id='weatherPressForecastBlock'><!-- forecast block -->
    187            
    188             <div id='weather-press-chart-loader' class='weather-press-chart-loader'></div>
    189            
    190             <div class="weather-press-chartContainer ct-chart ct-golden-section">
    191            
    192                 <div class='weather-press-chartLabel' id='weather-press-chartLabel'></div>
    193            
    194             </div>
    195            
    196         </li>
    197        
    198         <li class='weather-press-fullWidthBlock weather-press-forecastToolsList'>
    199        
    200             <div class='weather-press-forecastTools'>
    201            
    202                 <ul>
    203                
    204                     <li class='weather-press-tempTool weather-press-tempTool-active'></li>
    205 
    206                     <li class='weather-press-humidTool' title='Premium feature'></li>
    207                    
    208                     <li class='weather-press-windTool' title='Premium feature'></li>
    209 
    210                 </ul>
    211            
    212             </div>     
    213        
    214         </li>
     184        </div>
    215185   
    216     </ul>
     186    </div>
    217187   
    218 <!-- ******************************  demo item  ******************************************-->   
     188    <div class='weather-press-block-middle'>
    219189   
    220     <div class='weather-press-dailyForecast animated'><!-- daily foracast block -->
    221    
    222         <div class='weather-press-closeIcon' data-weatherpressclose='weather-press-dailyForecast'></div>
    223    
    224         <ul class='weather-press-dailyForecast-mainUl'>
    225        
    226             <li class='weather-press-dailyForecast-mainItem'>
    227            
    228                 <ul>
    229                
    230                     <li class='weather-press-forecastDate'>Premium daily forecast feature</li>
    231 
    232                     <li class='weather-press-forecastIconTemp'>
    233                    
    234                         <ul>
    235                        
    236                             <li><img src='<?php echo WEATHER_PRESS_PATH . '/public/images/demo-1.png' ; ?>' alt='forecast weather icon'/></li>
    237 
    238                             <li>22°</li>
    239                        
    240                         </ul>
    241                    
    242                     </li>
    243                    
    244                     <li class='weather-press-forecastDetails'>
    245                    
    246                         <ul>
    247                        
    248                             <li>
    249                            
    250                                 <span class='weather-press-forecastDetails-text'>10° / 25°</span>
    251                                 <span class='weather-press-forecastMinmaxIcon'></span>
    252                            
    253                             </li>
    254 
    255                             <li>
    256                            
    257                                 <span class='weather-press-forecastDetails-text'>44%</span>
    258                                 <span class='weather-press-forecastHumidityIcon'></span>                           
    259                            
    260                             </li>
    261 
    262                             <li>
    263                            
    264                                 <span class='weather-press-forecastDetails-text'>11 m/s</span>
    265                                 <span class='weather-press-forecastWindIcon'></span>                           
    266                            
    267                             </li>
    268                        
    269                         </ul>
    270                    
    271                     </li>
    272                
    273                 </ul>
    274            
    275             </li>
    276             <!-- ******************************  demo item  ******************************************-->
    277             <li class='weather-press-dailyForecast-mainItem'>
    278            
    279                 <ul>
    280                
    281                     <li class='weather-press-forecastDate'>Premium daily forecast feature</li>
    282 
    283                     <li class='weather-press-forecastIconTemp'>
    284                    
    285                         <ul>
    286                        
    287                             <li><img src='<?php echo WEATHER_PRESS_PATH . '/public/images/demo-2.png' ; ?>' alt='forecast weather icon'/></li>
    288 
    289                             <li>23°</li>
    290                        
    291                         </ul>
    292                    
    293                     </li>
    294                    
    295                     <li class='weather-press-forecastDetails'>
    296                    
    297                         <ul>
    298                        
    299                             <li>
    300                            
    301                                 <span class='weather-press-forecastDetails-text'>10° / 25°</span>
    302                                 <span class='weather-press-forecastMinmaxIcon'></span>
    303                            
    304                             </li>
    305 
    306                             <li>
    307                            
    308                                 <span class='weather-press-forecastDetails-text'>44%</span>
    309                                 <span class='weather-press-forecastHumidityIcon'></span>                           
    310                            
    311                             </li>
    312 
    313                             <li>
    314                            
    315                                 <span class='weather-press-forecastDetails-text'>11 m/s</span>
    316                                 <span class='weather-press-forecastWindIcon'></span>                           
    317                            
    318                             </li>
    319                        
    320                         </ul>
    321                    
    322                     </li>
    323                
    324                 </ul>
    325            
    326             </li>
    327             <!-- ******************************  demo item  ******************************************-->
    328             <li class='weather-press-dailyForecast-mainItem'>
    329            
    330                 <ul>
    331                
    332                     <li class='weather-press-forecastDate'>Premium daily forecast feature</li>
    333 
    334                     <li class='weather-press-forecastIconTemp'>
    335                    
    336                         <ul>
    337                        
    338                             <li><img src='<?php echo WEATHER_PRESS_PATH . '/public/images/demo-3.png' ; ?>' alt='forecast weather icon'/></li>
    339 
    340                             <li>24°</li>
    341                        
    342                         </ul>
    343                    
    344                     </li>
    345                    
    346                     <li class='weather-press-forecastDetails'>
    347                    
    348                         <ul>
    349                        
    350                             <li>
    351                            
    352                                 <span class='weather-press-forecastDetails-text'>10° / 25°</span>
    353                                 <span class='weather-press-forecastMinmaxIcon'></span>
    354                            
    355                             </li>
    356 
    357                             <li>
    358                            
    359                                 <span class='weather-press-forecastDetails-text'>44%</span>
    360                                 <span class='weather-press-forecastHumidityIcon'></span>                           
    361                            
    362                             </li>
    363 
    364                             <li>
    365                            
    366                                 <span class='weather-press-forecastDetails-text'>11 m/s</span>
    367                                 <span class='weather-press-forecastWindIcon'></span>                           
    368                            
    369                             </li>
    370                        
    371                         </ul>
    372                    
    373                     </li>
    374                
    375                 </ul>
    376            
    377             </li>           
    378        
    379         </ul>
    380    
    381     </div><!-- end of the daily forecast container -->
    382    
    383     <div class='weather-press-navRectangle'>
    384    
    385         <span id='weather-press-navRectangle-mainLocation' title=''></span>
    386        
    387         <ul><!-- cities list navigations -->
    388        
    389             <li id='weather-press-citiesNavTop'></li>
    390 
    391             <li id='weather-press-citiesNavBottom'></li>
    392        
    393         </ul>
     190        <img src='<?php echo WEATHER_PRESS_PATH . '/public/images/sample.gif' ; ?>' alt='city image'/>
    394191   
    395192    </div>
    396193
     194    <div id='weather_press_brand' class='weather_press_brandy'><a href='https://goo.gl/4rmB8o' title='weather press' target='_blank'>weather press &copy; </a></div>
     195
    397196</div><!-- main container -->
  • weather-press/trunk/weather-press.php

    r1725621 r1759591  
    99 * Plugin URI:        https://www.weather-press.com
    1010 * Description:       You need an amazing wordpress weather plugin & widget ?? ...Weather Press offer you more !
    11  * Version:           4.4
     11 * Version:           4.5
    1212 * Author:            Zied Bouzidi
    1313 * Author URI:        https://www.weather-press.com/founder
Note: See TracChangeset for help on using the changeset viewer.