/*! jQuery UI - v1.12.1 - 2016-09-14
* http://jqueryui.com
* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
function CountUp(n,t,i,r,u,f){for(var c=0,s=["webkit","moz","ms","o"],h,e,o=0;o<s.length&&!window.requestAnimationFrame;++o)window.requestAnimationFrame=window[s[o]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[o]+"CancelAnimationFrame"]||window[s[o]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(n){var t=(new Date).getTime(),i=Math.max(0,16-(t-c)),r=window.setTimeout(function(){n(t+i)},i);return c=t+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(h in f)f.hasOwnProperty(h)&&(this.options[h]=f[h]);this.options.separator==""&&(this.options.useGrouping=!1),this.options.prefix==null&&(this.options.prefix=""),this.options.suffix==null&&(this.options.suffix=""),e=this,this.d=typeof n=="string"?document.getElementById(n):n,this.startVal=Number(t),this.endVal=Number(i),this.countDown=this.startVal>this.endVal,this.startTime=null,this.timestamp=null,this.remaining=null,this.frameVal=this.startVal,this.rAF=null,this.decimals=Math.max(0,r||0),this.dec=Math.pow(10,this.decimals),this.duration=u*1e3||2e3,this.version=function(){return"1.4.0"},this.printValue=function(n){var t=isNaN(n)?"--":e.formatNumber(n);e.d.tagName=="INPUT"?this.d.value=t:e.d.tagName=="text"?this.d.textContent=t:this.d.innerHTML=t},this.easeOutExpo=function(n,t,i,r){return i*(-Math.pow(2,-10*n/r)+1)*1024/1023+t},this.count=function(n){var t,i;e.startTime===null&&(e.startTime=n),e.timestamp=n,t=n-e.startTime,e.remaining=e.duration-t,e.options.useEasing?e.countDown?(i=e.easeOutExpo(t,0,e.startVal-e.endVal,e.duration),e.frameVal=e.startVal-i):e.frameVal=e.easeOutExpo(t,e.startVal,e.endVal-e.startVal,e.duration):e.countDown?(i=(e.startVal-e.endVal)*(t/e.duration),e.frameVal=e.startVal-i):e.frameVal=e.startVal+(e.endVal-e.startVal)*(t/e.duration),e.frameVal=e.countDown?e.frameVal<e.endVal?e.endVal:e.frameVal:e.frameVal>e.endVal?e.endVal:e.frameVal,e.frameVal=Math.round(e.frameVal*e.dec)/e.dec,e.printValue(e.frameVal),t<e.duration?e.rAF=requestAnimationFrame(e.count):e.callback!=null&&e.callback()},this.start=function(n){return e.callback=n,isNaN(e.endVal)||isNaN(e.startVal)?(console.log("countUp error: startVal or endVal is not a number"),e.printValue()):e.rAF=requestAnimationFrame(e.count),!1},this.pauseResume=function(){e.paused?(e.paused=!1,e.startTime=null,e.duration=e.remaining,e.startVal=e.frameVal,requestAnimationFrame(e.count)):(e.paused=!0,cancelAnimationFrame(e.rAF))},this.stop=function(){cancelAnimationFrame(e.rAF)},this.resume=function(){e.stop(),e.startTime=null,e.duration=e.remaining,e.startVal=e.frameVal,requestAnimationFrame(e.count)},this.reset=function(){e.paused=!1,e.startTime=null,e.startVal=t,cancelAnimationFrame(e.rAF),e.printValue(e.startVal)},this.update=function(n){cancelAnimationFrame(e.rAF),e.paused=!1,e.startTime=null,e.startVal=e.frameVal,e.endVal=Number(n),e.countDown=e.startVal>e.endVal,e.rAF=requestAnimationFrame(e.count)},this.formatNumber=function(n){n=n.toFixed(e.decimals)+"";var i,t,u,r;if(i=n.split("."),t=i[0],u=i.length>1?e.options.decimal+i[1]:"",r=/(\d+)(\d{3})/,e.options.useGrouping)while(r.test(t))t=t.replace(r,"$1"+e.options.separator+"$2");return e.options.prefix+t+u+e.options.suffix},e.printValue(e.startVal)}var _gsScope,fakeCars,app;(function(n){"function"==typeof define&&define.amd?define(["jquery"],n):n(jQuery)})(function(n){function b(n){for(var t=n.css("visibility");"inherit"===t;)n=n.parent(),t=n.css("visibility");return"hidden"!==t}function k(n){for(var t,i;n.length&&n[0]!==document;){if(t=n.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(n.css("zIndex"),10),!isNaN(i)&&0!==i))return i;n=n.parent()}return 0}function c(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},n.extend(this._defaults,this.regional[""]),this.regional.en=n.extend(!0,{},this.regional[""]),this.regional["en-US"]=n.extend(!0,{},this.regional.en),this.dpDiv=l(n("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'><\/div>"))}function l(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",i,function(){n(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&n(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&n(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,a)}function a(){n.datepicker._isDisabledDatepicker(i.inline?i.dpDiv.parent()[0]:i.input[0])||(n(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),n(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&n(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&n(this).addClass("ui-datepicker-next-hover"))}function u(t,i){n.extend(t,i);for(var r in i)null==i[r]&&(t[r]=i[r]);return t}function t(n){return function(){var t=this.element.val();n.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}var v,o,p,w,i,r,e;n.ui=n.ui||{},n.ui.version="1.12.1",v=0,o=Array.prototype.slice,n.cleanData=function(t){return function(i){for(var r,u,f=0;null!=(u=i[f]);f++)try{r=n._data(u,"events"),r&&r.remove&&n(u).triggerHandler("remove")}catch(e){}t(i)}}(n.cleanData),n.widget=function(t,i,r){var f,u,o,h={},e=t.split(".")[0],s;return t=t.split(".")[1],s=e+"-"+t,r||(r=i,i=n.Widget),n.isArray(r)&&(r=n.extend.apply(null,[{}].concat(r))),n.expr[":"][s.toLowerCase()]=function(t){return!!n.data(t,s)},n[e]=n[e]||{},f=n[e][t],u=n[e][t]=function(n,t){return this._createWidget?(arguments.length&&this._createWidget(n,t),void 0):new u(n,t)},n.extend(u,f,{version:r.version,_proto:n.extend({},r),_childConstructors:[]}),o=new i,o.options=n.widget.extend({},o.options),n.each(r,function(t,r){return n.isFunction(r)?(h[t]=function(){function n(){return i.prototype[t].apply(this,arguments)}function u(n){return i.prototype[t].apply(this,n)}return function(){var t,i=this._super,f=this._superApply;return this._super=n,this._superApply=u,t=r.apply(this,arguments),this._super=i,this._superApply=f,t}}(),void 0):(h[t]=r,void 0)}),u.prototype=n.widget.extend(o,{widgetEventPrefix:f?o.widgetEventPrefix||t:t},h,{constructor:u,namespace:e,widgetName:t,widgetFullName:s}),f?(n.each(f._childConstructors,function(t,i){var r=i.prototype;n.widget(r.namespace+"."+r.widgetName,u,i._proto)}),delete f._childConstructors):i._childConstructors.push(u),n.widget.bridge(t,u),u},n.widget.extend=function(t){for(var i,r,f=o.call(arguments,1),u=0,e=f.length;e>u;u++)for(i in f[u])r=f[u][i],f[u].hasOwnProperty(i)&&void 0!==r&&(t[i]=n.isPlainObject(r)?n.isPlainObject(t[i])?n.widget.extend({},t[i],r):n.widget.extend({},r):r);return t},n.widget.bridge=function(t,i){var r=i.prototype.widgetFullName||t;n.fn[t]=function(u){var s="string"==typeof u,e=o.call(arguments,1),f=this;return s?this.length||"instance"!==u?this.each(function(){var i,o=n.data(this,r);return"instance"===u?(f=o,!1):o?n.isFunction(o[u])&&"_"!==u.charAt(0)?(i=o[u].apply(o,e),i!==o&&void 0!==i?(f=i&&i.jquery?f.pushStack(i.get()):i,!1):void 0):n.error("no such method '"+u+"' for "+t+" widget instance"):n.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+u+"'")}):f=void 0:(e.length&&(u=n.widget.extend.apply(null,[u].concat(e))),this.each(function(){var t=n.data(this,r);t?(t.option(u||{}),t._init&&t._init()):n.data(this,r,new i(u,this))})),f}},n.Widget=function(){},n.Widget._childConstructors=[],n.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,i){i=n(i||this.defaultElement||this)[0],this.element=n(i),this.uuid=v++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=n(),this.hoverable=n(),this.focusable=n(),this.classesElementLookup={},i!==this&&(n.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(n){n.target===i&&this.destroy()}}),this.document=n(i.style?i.ownerDocument:i.document||i),this.window=n(this.document[0].defaultView||this.document[0].parentWindow)),this.options=n.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:n.noop,_create:n.noop,_init:n.noop,destroy:function(){var t=this;this._destroy(),n.each(this.classesElementLookup,function(n,i){t._removeClass(i,n)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:n.noop,widget:function(){return this.element},option:function(t,i){var r,u,f,e=t;if(0===arguments.length)return n.widget.extend({},this.options);if("string"==typeof t)if(e={},r=t.split("."),t=r.shift(),r.length){for(u=e[t]=n.widget.extend({},this.options[t]),f=0;r.length-1>f;f++)u[r[f]]=u[r[f]]||{},u=u[r[f]];if(t=r.pop(),1===arguments.length)return void 0===u[t]?null:u[t];u[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];e[t]=i}return this._setOptions(e),this},_setOptions:function(n){var t;for(t in n)this._setOption(t,n[t]);return this},_setOption:function(n,t){return"classes"===n&&this._setOptionClasses(t),this.options[n]=t,"disabled"===n&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var i,u,r;for(i in t)r=this.classesElementLookup[i],t[i]!==this.options.classes[i]&&r&&r.length&&(u=n(r.get()),this._removeClass(r,i),u.addClass(this._classes({element:u,keys:i,classes:t,add:!0})))},_setOptionDisabled:function(n){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!n),n&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){function r(r,f){for(var o,e=0;r.length>e;e++)o=u.classesElementLookup[r[e]]||n(),o=t.add?n(n.unique(o.get().concat(t.element.get()))):n(o.not(t.element).get()),u.classesElementLookup[r[e]]=o,i.push(r[e]),f&&t.classes[r[e]]&&i.push(t.classes[r[e]])}var i=[],u=this;return t=n.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&r(t.keys.match(/\S+/g)||[],!0),t.extra&&r(t.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(t){var i=this;n.each(i.classesElementLookup,function(r,u){-1!==n.inArray(t.target,u)&&(i.classesElementLookup[r]=n(u.not(t.target).get()))})},_removeClass:function(n,t,i){return this._toggleClass(n,t,i,!1)},_addClass:function(n,t,i){return this._toggleClass(n,t,i,!0)},_toggleClass:function(n,t,i,r){r="boolean"==typeof r?r:i;var u="string"==typeof n||null===n,f={extra:u?t:i,keys:u?n:t,element:u?this.element:n,add:r};return f.element.toggleClass(this._classes(f),r),this},_on:function(t,i,r){var f,u=this;"boolean"!=typeof t&&(r=i,i=t,t=!1),r?(i=f=n(i),this.bindings=this.bindings.add(i)):(r=i,i=this.element,f=this.widget()),n.each(r,function(r,e){function o(){if(t||u.options.disabled!==!0&&!n(this).hasClass("ui-state-disabled"))return("string"==typeof e?u[e]:e).apply(u,arguments)}"string"!=typeof e&&(o.guid=e.guid=e.guid||o.guid||n.guid++);var s=r.match(/^([\w:-]*)\s*(.*)$/),h=s[1]+u.eventNamespace,c=s[2];c?f.on(h,c,o):i.on(h,o)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(i).off(i),this.bindings=n(this.bindings.not(t).get()),this.focusable=n(this.focusable.not(t).get()),this.hoverable=n(this.hoverable.not(t).get())},_delay:function(n,t){function r(){return("string"==typeof n?i[n]:n).apply(i,arguments)}var i=this;return setTimeout(r,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(n(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(n(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(n(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(n(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,i,r){var u,f,e=this.options[t];if(r=r||{},i=n.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],f=i.originalEvent)for(u in f)u in i||(i[u]=f[u]);return this.element.trigger(i,r),!(n.isFunction(e)&&e.apply(this.element[0],[i].concat(r))===!1||i.isDefaultPrevented())}},n.each({show:"fadeIn",hide:"fadeOut"},function(t,i){n.Widget.prototype["_"+t]=function(r,u,f){"string"==typeof u&&(u={effect:u});var o,e=u?u===!0||"number"==typeof u?i:u.effect||i:t;u=u||{},"number"==typeof u&&(u={duration:u}),o=!n.isEmptyObject(u),u.complete=f,u.delay&&r.delay(u.delay),o&&n.effects&&n.effects.effect[e]?r[t](u):e!==t&&r[e]?r[e](u.duration,u.easing,f):r.queue(function(i){n(this)[t](),f&&f.call(r[0]),i()})}}),n.widget,function(){function f(n,t,i){return[parseFloat(n[0])*(c.test(n[0])?t/100:1),parseFloat(n[1])*(c.test(n[1])?i/100:1)]}function i(t,i){return parseInt(n.css(t,i),10)||0}function l(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:n.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}var u,r=Math.max,t=Math.abs,e=/left|center|right/,o=/top|center|bottom/,s=/[\+\-]\d+(\.[\d]+)?%?/,h=/^\w+/,c=/%$/,a=n.fn.position;n.position={scrollbarWidth:function(){if(void 0!==u)return u;var r,i,t=n("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'><\/div><\/div>"),f=t.children()[0];return n("body").append(t),r=f.offsetWidth,t.css("overflow","scroll"),i=f.offsetWidth,r===i&&(i=t[0].clientWidth),t.remove(),u=r-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),r=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),u="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,f="scroll"===r||"auto"===r&&t.height<t.element[0].scrollHeight;return{width:f?n.position.scrollbarWidth():0,height:u?n.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=n(t||window),r=n.isWindow(i[0]),u=!!i[0]&&9===i[0].nodeType,f=!r&&!u;return{element:i,isWindow:r,isDocument:u,offset:f?n(t).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},n.fn.position=function(u){if(!u||!u.of)return a.apply(this,arguments);u=n.extend({},u);var w,c,v,p,y,k,d=n(u.of),nt=n.position.getWithinInfo(u.within),tt=n.position.getScrollInfo(nt),b=(u.collision||"flip").split(" "),g={};return k=l(d),d[0].preventDefault&&(u.at="left top"),c=k.width,v=k.height,p=k.offset,y=n.extend({},p),n.each(["my","at"],function(){var t,i,n=(u[this]||"").split(" ");1===n.length&&(n=e.test(n[0])?n.concat(["center"]):o.test(n[0])?["center"].concat(n):["center","center"]),n[0]=e.test(n[0])?n[0]:"center",n[1]=o.test(n[1])?n[1]:"center",t=s.exec(n[0]),i=s.exec(n[1]),g[this]=[t?t[0]:0,i?i[0]:0],u[this]=[h.exec(n[0])[0],h.exec(n[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===u.at[0]?y.left+=c:"center"===u.at[0]&&(y.left+=c/2),"bottom"===u.at[1]?y.top+=v:"center"===u.at[1]&&(y.top+=v/2),w=f(g.at,c,v),y.left+=w[0],y.top+=w[1],this.each(function(){var a,k,o=n(this),s=o.outerWidth(),h=o.outerHeight(),it=i(this,"marginLeft"),rt=i(this,"marginTop"),ut=s+it+i(this,"marginRight")+tt.width,ft=h+rt+i(this,"marginBottom")+tt.height,e=n.extend({},y),l=f(g.my,o.outerWidth(),o.outerHeight());"right"===u.my[0]?e.left-=s:"center"===u.my[0]&&(e.left-=s/2),"bottom"===u.my[1]?e.top-=h:"center"===u.my[1]&&(e.top-=h/2),e.left+=l[0],e.top+=l[1],a={marginLeft:it,marginTop:rt},n.each(["left","top"],function(t,i){n.ui.position[b[t]]&&n.ui.position[b[t]][i](e,{targetWidth:c,targetHeight:v,elemWidth:s,elemHeight:h,collisionPosition:a,collisionWidth:ut,collisionHeight:ft,offset:[w[0]+l[0],w[1]+l[1]],my:u.my,at:u.at,within:nt,elem:o})}),u.using&&(k=function(n){var i=p.left-e.left,a=i+c-s,f=p.top-e.top,y=f+v-h,l={target:{element:d,left:p.left,top:p.top,width:c,height:v},element:{element:o,left:e.left,top:e.top,width:s,height:h},horizontal:0>a?"left":i>0?"right":"center",vertical:0>y?"top":f>0?"bottom":"middle"};s>c&&c>t(i+a)&&(l.horizontal="center"),h>v&&v>t(f+y)&&(l.vertical="middle"),l.important=r(t(i),t(a))>r(t(f),t(y))?"horizontal":"vertical",u.using.call(this,n,l)}),o.offset(n.extend(e,{using:k}))})},n.ui.position={fit:{left:function(n,t){var h,e=t.within,u=e.isWindow?e.scrollLeft:e.offset.left,o=e.width,s=n.left-t.collisionPosition.marginLeft,i=u-s,f=s+t.collisionWidth-o-u;t.collisionWidth>o?i>0&&0>=f?(h=n.left+i+t.collisionWidth-o-u,n.left+=i-h):n.left=f>0&&0>=i?u:i>f?u+o-t.collisionWidth:u:i>0?n.left+=i:f>0?n.left-=f:n.left=r(n.left-s,n.left)},top:function(n,t){var h,o=t.within,u=o.isWindow?o.scrollTop:o.offset.top,e=t.within.height,s=n.top-t.collisionPosition.marginTop,i=u-s,f=s+t.collisionHeight-e-u;t.collisionHeight>e?i>0&&0>=f?(h=n.top+i+t.collisionHeight-e-u,n.top+=i-h):n.top=f>0&&0>=i?u:i>f?u+e-t.collisionHeight:u:i>0?n.top+=i:f>0?n.top-=f:n.top=r(n.top-s,n.top)}},flip:{left:function(n,i){var o,s,r=i.within,y=r.offset.left+r.scrollLeft,c=r.width,h=r.isWindow?r.scrollLeft:r.offset.left,l=n.left-i.collisionPosition.marginLeft,a=l-h,v=l+i.collisionWidth-c-h,u="left"===i.my[0]?-i.elemWidth:"right"===i.my[0]?i.elemWidth:0,f="left"===i.at[0]?i.targetWidth:"right"===i.at[0]?-i.targetWidth:0,e=-2*i.offset[0];0>a?(o=n.left+u+f+e+i.collisionWidth-c-y,(0>o||t(a)>o)&&(n.left+=u+f+e)):v>0&&(s=n.left-i.collisionPosition.marginLeft+u+f+e-h,(s>0||v>t(s))&&(n.left+=u+f+e))},top:function(n,i){var o,s,r=i.within,y=r.offset.top+r.scrollTop,c=r.height,h=r.isWindow?r.scrollTop:r.offset.top,l=n.top-i.collisionPosition.marginTop,a=l-h,v=l+i.collisionHeight-c-h,p="top"===i.my[1],u=p?-i.elemHeight:"bottom"===i.my[1]?i.elemHeight:0,f="top"===i.at[1]?i.targetHeight:"bottom"===i.at[1]?-i.targetHeight:0,e=-2*i.offset[1];0>a?(s=n.top+u+f+e+i.collisionHeight-c-y,(0>s||t(a)>s)&&(n.top+=u+f+e)):v>0&&(o=n.top-i.collisionPosition.marginTop+u+f+e-h,(o>0||v>t(o))&&(n.top+=u+f+e))}},flipfit:{left:function(){n.ui.position.flip.left.apply(this,arguments),n.ui.position.fit.left.apply(this,arguments)},top:function(){n.ui.position.flip.top.apply(this,arguments),n.ui.position.fit.top.apply(this,arguments)}}}}(),n.ui.position,n.extend(n.expr[":"],{data:n.expr.createPseudo?n.expr.createPseudo(function(t){return function(i){return!!n.data(i,t)}}):function(t,i,r){return!!n.data(t,r[3])}}),n.fn.extend({disableSelection:function(){var n="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(n+".ui-disableSelection",function(n){n.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var f="ui-effects-",s="ui-effects-style",h="ui-effects-animated",y=n;n.effects={effect:{}},function(n,t){function f(n,t,i){var r=h[t.type]||{};return null==n?i||!t.def?null:t.def:(n=r.floor?~~n:parseFloat(n),isNaN(n)?t.def:r.mod?(n+r.mod)%r.mod:0>n?0:n>r.max?r.max:n)}function s(f){var o=i(),s=o._rgba=[];return f=f.toLowerCase(),r(v,function(n,i){var r,h=i.re.exec(f),c=h&&i.parse(h),e=i.space||"rgba";return c?(r=o[e](c),o[u[e].cache]=r[u[e].cache],s=o._rgba=r._rgba,!1):t}),s.length?("0,0,0,0"===s.join()&&n.extend(s,e.transparent),o):e[f]}function o(n,t,i){return i=(i+1)%1,1>6*i?n+6*(t-n)*i:1>2*i?t:2>3*i?n+6*(t-n)*(2/3-i):n}var e,a=/^([\-+])=\s*(\d+\.?\d*)/,v=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(n){return[n[1],n[2],n[3],n[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(n){return[2.55*n[1],2.55*n[2],2.55*n[3],n[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(n){return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(n){return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(n){return[n[1],n[2]/100,n[3]/100,n[4]]}}],i=n.Color=function(t,i,r,u){return new n.Color.fn.parse(t,i,r,u)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},h={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=i.support={},l=n("<p>")[0],r=n.each;l.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=l.style.backgroundColor.indexOf("rgba")>-1,r(u,function(n,t){t.cache="_"+n,t.props.alpha={idx:3,type:"percent",def:1}}),i.fn=n.extend(i.prototype,{parse:function(o,h,c,l){if(o===t)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=n(o).css(h),h=t);var a=this,v=n.type(o),y=this._rgba=[];return h!==t&&(o=[o,h,c,l],v="array"),"string"===v?this.parse(s(o)||e._default):"array"===v?(r(u.rgba.props,function(n,t){y[t.idx]=f(o[t.idx],t)}),this):"object"===v?(o instanceof i?r(u,function(n,t){o[t.cache]&&(a[t.cache]=o[t.cache].slice())}):r(u,function(t,i){var u=i.cache;r(i.props,function(n,t){if(!a[u]&&i.to){if("alpha"===n||null==o[n])return;a[u]=i.to(a._rgba)}a[u][t.idx]=f(o[n],t,!0)}),a[u]&&0>n.inArray(null,a[u].slice(0,3))&&(a[u][3]=1,i.from&&(a._rgba=i.from(a[u])))}),this):t},is:function(n){var o=i(n),f=!0,e=this;return r(u,function(n,i){var s,u=o[i.cache];return u&&(s=e[i.cache]||i.to&&i.to(e._rgba)||[],r(i.props,function(n,i){return null!=u[i.idx]?f=u[i.idx]===s[i.idx]:t})),f}),f},_space:function(){var n=[],t=this;return r(u,function(i,r){t[r.cache]&&n.push(i)}),n.pop()},transition:function(n,t){var e=i(n),c=e._space(),o=u[c],l=0===this.alpha()?i("transparent"):this,a=l[o.cache]||o.to(l._rgba),s=a.slice();return e=e[o.cache],r(o.props,function(n,i){var c=i.idx,r=a[c],u=e[c],o=h[i.type]||{};null!==u&&(null===r?s[c]=u:(o.mod&&(u-r>o.mod/2?r+=o.mod:r-u>o.mod/2&&(r-=o.mod)),s[c]=f((u-r)*t+r,i)))}),this[c](s)},blend:function(t){if(1===this._rgba[3])return this;var r=this._rgba.slice(),u=r.pop(),f=i(t)._rgba;return i(n.map(r,function(n,t){return(1-u)*f[t]+u*n}))},toRgbaString:function(){var i="rgba(",t=n.map(this._rgba,function(n,t){return null==n?t>2?1:0:n});return 1===t[3]&&(t.pop(),i="rgb("),i+t.join()+")"},toHslaString:function(){var i="hsla(",t=n.map(this.hsla(),function(n,t){return null==n&&(n=t>2?1:0),t&&3>t&&(n=Math.round(100*n)+"%"),n});return 1===t[3]&&(t.pop(),i="hsl("),i+t.join()+")"},toHexString:function(t){var i=this._rgba.slice(),r=i.pop();return t&&i.push(~~(255*r)),"#"+n.map(i,function(n){return n=(n||0).toString(16),1===n.length?"0"+n:n}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),i.fn.parse.prototype=i.fn,u.hsla.to=function(n){if(null==n[0]||null==n[1]||null==n[2])return[null,null,null,n[3]];var s,h,i=n[0]/255,r=n[1]/255,f=n[2]/255,c=n[3],u=Math.max(i,r,f),e=Math.min(i,r,f),t=u-e,o=u+e,l=.5*o;return s=e===u?0:i===u?60*(r-f)/t+360:r===u?60*(f-i)/t+120:60*(i-r)/t+240,h=0===t?0:.5>=l?t/o:t/(2-o),[Math.round(s)%360,h,l,null==c?1:c]},u.hsla.from=function(n){if(null==n[0]||null==n[1]||null==n[2])return[null,null,null,n[3]];var r=n[0]/360,u=n[1],t=n[2],e=n[3],i=.5>=t?t*(1+u):t+u-t*u,f=2*t-i;return[Math.round(255*o(f,i,r+1/3)),Math.round(255*o(f,i,r)),Math.round(255*o(f,i,r-1/3)),e]},r(u,function(u,e){var s=e.props,o=e.cache,h=e.to,c=e.from;i.fn[u]=function(u){if(h&&!this[o]&&(this[o]=h(this._rgba)),u===t)return this[o].slice();var l,a=n.type(u),v="array"===a||"object"===a?u:arguments,e=this[o].slice();return r(s,function(n,t){var i=v["object"===a?n:t.idx];null==i&&(i=e[t.idx]),e[t.idx]=f(i,t)}),c?(l=i(c(e)),l[o]=e,l):i(e)},r(s,function(t,r){i.fn[t]||(i.fn[t]=function(i){var f,e=n.type(i),h="alpha"===t?this._hsla?"hsla":"rgba":u,o=this[h](),s=o[r.idx];return"undefined"===e?s:("function"===e&&(i=i.call(this,s),e=n.type(i)),null==i&&r.empty?this:("string"===e&&(f=a.exec(i),f&&(i=s+parseFloat(f[2])*("+"===f[1]?1:-1))),o[r.idx]=i,this[h](o)))})})}),i.hook=function(t){var u=t.split(" ");r(u,function(t,r){n.cssHooks[r]={set:function(t,u){var o,f,e="";if("transparent"!==u&&("string"!==n.type(u)||(o=s(u)))){if(u=i(o||u),!c.rgba&&1!==u._rgba[3]){for(f="backgroundColor"===r?t.parentNode:t;(""===e||"transparent"===e)&&f&&f.style;)try{e=n.css(f,"backgroundColor"),f=f.parentNode}catch(h){}u=u.blend(e&&"transparent"!==e?e:"_default")}u=u.toRgbaString()}try{t.style[r]=u}catch(h){}}},n.fx.step[r]=function(t){t.colorInit||(t.start=i(t.elem,r),t.end=i(t.end),t.colorInit=!0),n.cssHooks[r].set(t.elem,t.start.transition(t.end,t.pos))}})},i.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),n.cssHooks.borderColor={expand:function(n){var t={};return r(["Top","Right","Bottom","Left"],function(i,r){t["border"+r+"Color"]=n}),t}},e=n.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(y),function(){function t(t){var r,u,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,f={};if(i&&i.length&&i[0]&&i[i[0]])for(u=i.length;u--;)r=i[u],"string"==typeof i[r]&&(f[n.camelCase(r)]=i[r]);else for(r in i)"string"==typeof i[r]&&(f[r]=i[r]);return f}function i(t,i){var r,f,e={};for(r in i)f=i[r],t[r]!==f&&(u[r]||(n.fx.step[r]||!isNaN(parseFloat(f)))&&(e[r]=f));return e}var r=["add","remove","toggle"],u={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};n.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){n.fx.step[i]=function(n){("none"===n.end||n.setAttr)&&(1!==n.pos||n.setAttr)||(y.style(n.elem,i,n.end),n.setAttr=!0)}}),n.fn.addBack||(n.fn.addBack=function(n){return this.add(null==n?this.prevObject:this.prevObject.filter(n))}),n.effects.animateClass=function(u,f,e,o){var s=n.speed(f,e,o);return this.queue(function(){var o,e=n(this),h=e.attr("class")||"",f=s.children?e.find("*").addBack():e;f=f.map(function(){var i=n(this);return{el:i,start:t(this)}}),o=function(){n.each(r,function(n,t){u[t]&&e[t+"Class"](u[t])})},o(),f=f.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),e.attr("class",h),f=f.map(function(){var i=this,t=n.Deferred(),r=n.extend({},s,{queue:!1,complete:function(){t.resolve(i)}});return this.el.animate(this.diff,r),t.promise()}),n.when.apply(n,f.get()).done(function(){o(),n.each(arguments,function(){var t=this.el;n.each(this.diff,function(n){t.css(n,"")})}),s.complete.call(e[0])})})},n.fn.extend({addClass:function(t){return function(i,r,u,f){return r?n.effects.animateClass.call(this,{add:i},r,u,f):t.apply(this,arguments)}}(n.fn.addClass),removeClass:function(t){return function(i,r,u,f){return arguments.length>1?n.effects.animateClass.call(this,{remove:i},r,u,f):t.apply(this,arguments)}}(n.fn.removeClass),toggleClass:function(t){return function(i,r,u,f,e){return"boolean"==typeof r||void 0===r?u?n.effects.animateClass.call(this,r?{add:i}:{remove:i},u,f,e):t.apply(this,arguments):n.effects.animateClass.call(this,{toggle:i},r,u,f)}}(n.fn.toggleClass),switchClass:function(t,i,r,u,f){return n.effects.animateClass.call(this,{add:i,remove:t},r,u,f)}})}(),function(){function t(t,i,r,u){return n.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),n.isFunction(i)&&(u=i,r=null,i={}),("number"==typeof i||n.fx.speeds[i])&&(u=r,r=i,i={}),n.isFunction(r)&&(u=r,r=null),i&&n.extend(t,i),r=r||i.duration,t.duration=n.fx.off?0:"number"==typeof r?r:r in n.fx.speeds?n.fx.speeds[r]:n.fx.speeds._default,t.complete=u||i.complete,t}function i(t){return!t||"number"==typeof t||n.fx.speeds[t]?!0:"string"!=typeof t||n.effects.effect[t]?n.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}function r(n,t){var r=t.outerWidth(),u=t.outerHeight(),i=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(n)||["",0,r,u,0];return{top:parseFloat(i[1])||0,right:"auto"===i[2]?r:parseFloat(i[2]),bottom:"auto"===i[3]?u:parseFloat(i[3]),left:parseFloat(i[4])||0}}n.expr&&n.expr.filters&&n.expr.filters.animated&&(n.expr.filters.animated=function(t){return function(i){return!!n(i).data(h)||t(i)}}(n.expr.filters.animated)),n.uiBackCompat!==!1&&n.extend(n.effects,{save:function(n,t){for(var i=0,r=t.length;r>i;i++)null!==t[i]&&n.data(f+t[i],n[0].style[t[i]])},restore:function(n,t){for(var r,i=0,u=t.length;u>i;i++)null!==t[i]&&(r=n.data(f+t[i]),n.css(t[i],r))},setMode:function(n,t){return"toggle"===t&&(t=n.is(":hidden")?"show":"hide"),t},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),float:t.css("float")},u=n("<div><\/div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),f={width:t.width(),height:t.height()},r=document.activeElement;try{r.id}catch(e){r=document.body}return t.wrap(u),(t[0]===r||n.contains(t[0],r))&&n(r).trigger("focus"),u=t.parent(),"static"===t.css("position")?(u.css({position:"relative"}),t.css({position:"relative"})):(n.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),n.each(["top","left","bottom","right"],function(n,r){i[r]=t.css(r),isNaN(parseInt(i[r],10))&&(i[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(f),u.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||n.contains(t[0],i))&&n(i).trigger("focus")),t}}),n.extend(n.effects,{version:"1.12.1",define:function(t,i,r){return r||(r=i,i="effect"),n.effects.effect[t]=r,n.effects.effect[t].mode=i,r},scaledDimensions:function(n,t,i){if(0===t)return{height:0,width:0,outerHeight:0,outerWidth:0};var r="horizontal"!==i?(t||100)/100:1,u="vertical"!==i?(t||100)/100:1;return{height:n.height()*u,width:n.width()*r,outerHeight:n.outerHeight()*u,outerWidth:n.outerWidth()*r}},clipToBox:function(n){return{width:n.clip.right-n.clip.left,height:n.clip.bottom-n.clip.top,left:n.clip.left,top:n.clip.top}},unshift:function(n,t,i){var r=n.queue();t>1&&r.splice.apply(r,[1,0].concat(r.splice(t,i))),n.dequeue()},saveStyle:function(n){n.data(s,n[0].style.cssText)},restoreStyle:function(n){n[0].style.cssText=n.data(s)||"",n.removeData(s)},mode:function(n,t){var i=n.is(":hidden");return"toggle"===t&&(t=i?"show":"hide"),(i?"hide"===t:"show"===t)&&(t="none"),t},getBaseline:function(n,t){var i,r;switch(n[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=n[0]/t.height}switch(n[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=n[1]/t.width}return{x:r,y:i}},createPlaceholder:function(t){var i,r=t.css("position"),u=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(r)&&(r="absolute",i=n("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(f+"placeholder",i)),t.css({position:r,left:u.left,top:u.top}),i},removePlaceholder:function(n){var t=f+"placeholder",i=n.data(t);i&&(i.remove(),n.removeData(t))},cleanUp:function(t){n.effects.restoreStyle(t),n.effects.removePlaceholder(t)},setTransition:function(t,i,r,u){return u=u||{},n.each(i,function(n,i){var f=t.cssUnit(i);f[0]>0&&(u[i]=f[0]*r+f[1])}),u}}),n.fn.extend({effect:function(){function o(t){function c(){o.removeData(h),n.effects.cleanUp(o),"hide"===i.mode&&o.hide(),s()}function s(){n.isFunction(f)&&f.call(o[0]),n.isFunction(t)&&t()}var o=n(this);i.mode=l.shift(),n.uiBackCompat===!1||u?"none"===i.mode?(o[r](),s()):e.call(o[0],i,c):(o.is(":hidden")?"hide"===r:"show"===r)?(o[r](),s()):e.call(o[0],i,s)}var i=t.apply(this,arguments),e=n.effects.effect[i.effect],u=e.mode,s=i.queue,c=s||"fx",f=i.complete,r=i.mode,l=[],a=function(t){var f=n(this),i=n.effects.mode(f,r)||u;f.data(h,!0),l.push(i),u&&("show"===i||i===u&&"hide"===i)&&f.show(),u&&"none"===i||n.effects.saveStyle(f),n.isFunction(t)&&t()};return n.fx.off||!e?r?this[r](i.duration,f):this.each(function(){f&&f.call(this)}):s===!1?this.each(a).each(o):this.queue(c,a).queue(c,o)},show:function(n){return function(r){if(i(r))return n.apply(this,arguments);var u=t.apply(this,arguments);return u.mode="show",this.effect.call(this,u)}}(n.fn.show),hide:function(n){return function(r){if(i(r))return n.apply(this,arguments);var u=t.apply(this,arguments);return u.mode="hide",this.effect.call(this,u)}}(n.fn.hide),toggle:function(n){return function(r){if(i(r)||"boolean"==typeof r)return n.apply(this,arguments);var u=t.apply(this,arguments);return u.mode="toggle",this.effect.call(this,u)}}(n.fn.toggle),cssUnit:function(t){var i=this.css(t),r=[];return n.each(["em","px","%","pt"],function(n,t){i.indexOf(t)>0&&(r=[parseFloat(i),t])}),r},cssClip:function(n){return n?this.css("clip","rect("+n.top+"px "+n.right+"px "+n.bottom+"px "+n.left+"px)"):r(this.css("clip"),this)},transfer:function(t,i){var u=n(this),r=n(t.to),f="fixed"===r.css("position"),e=n("body"),o=f?e.scrollTop():0,s=f?e.scrollLeft():0,h=r.offset(),l={top:h.top-o,left:h.left-s,height:r.innerHeight(),width:r.innerWidth()},c=u.offset(),a=n("<div class='ui-effects-transfer'><\/div>").appendTo("body").addClass(t.className).css({top:c.top-o,left:c.left-s,height:u.innerHeight(),width:u.innerWidth(),position:f?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){a.remove(),n.isFunction(i)&&i()})}}),n.fx.step.clip=function(t){t.clipInit||(t.start=n(t.elem).cssClip(),"string"==typeof t.end&&(t.end=r(t.end,t.elem)),t.clipInit=!0),n(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})}}(),function(){var t={};n.each(["Quad","Cubic","Quart","Quint","Expo"],function(n,i){t[i]=function(t){return Math.pow(t,n+2)}}),n.extend(t,{Sine:function(n){return 1-Math.cos(n*Math.PI/2)},Circ:function(n){return 1-Math.sqrt(1-n*n)},Elastic:function(n){return 0===n||1===n?n:-Math.pow(2,8*(n-1))*Math.sin((80*(n-1)-7.5)*Math.PI/15)},Back:function(n){return n*n*(3*n-2)},Bounce:function(n){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>n;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-n,2)}}),n.each(t,function(t,i){n.easing["easeIn"+t]=i,n.easing["easeOut"+t]=function(n){return 1-i(1-n)},n.easing["easeInOut"+t]=function(n){return.5>n?i(2*n)/2:1-i(-2*n+2)/2}})}(),p=n.effects,n.effects.define("blind","hide",function(t,i){var e={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},u=n(this),o=t.direction||"up",s=u.cssClip(),r={clip:n.extend({},s)},f=n.effects.createPlaceholder(u);r.clip[e[o][0]]=r.clip[e[o][1]],"show"===t.mode&&(u.cssClip(r.clip),f&&f.css(n.effects.clipToBox(r)),r.clip=s),f&&f.animate(n.effects.clipToBox(r),t.duration,t.easing),u.animate(r,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),n.effects.define("bounce",function(t,i){var e,o,a,u=n(this),p=t.mode,s="hide"===p,w="show"===p,h=t.direction||"up",r=t.distance,v=t.times||5,b=2*v+(w||s?1:0),c=t.duration/b,l=t.easing,f="up"===h||"down"===h?"top":"left",y="up"===h||"left"===h,k=0,d=u.queue().length;for(n.effects.createPlaceholder(u),a=u.css(f),r||(r=u["top"===f?"outerHeight":"outerWidth"]()/3),w&&(o={opacity:1},o[f]=a,u.css("opacity",0).css(f,y?2*-r:2*r).animate(o,c,l)),s&&(r/=Math.pow(2,v-1)),o={},o[f]=a;v>k;k++)e={},e[f]=(y?"-=":"+=")+r,u.animate(e,c,l).animate(o,c,l),r=s?2*r:r/2;s&&(e={opacity:0},e[f]=(y?"-=":"+=")+r,u.animate(e,c,l)),u.queue(i),n.effects.unshift(u,d,b+1)}),n.effects.define("clip","hide",function(t,i){var r,u={},f=n(this),e=t.direction||"vertical",o="both"===e,s=o||"horizontal"===e,h=o||"vertical"===e;r=f.cssClip(),u.clip={top:h?(r.bottom-r.top)/2:r.top,right:s?(r.right-r.left)/2:r.right,bottom:h?(r.bottom-r.top)/2:r.bottom,left:s?(r.right-r.left)/2:r.left},n.effects.createPlaceholder(f),"show"===t.mode&&(f.cssClip(u.clip),u.clip=r),f.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),n.effects.define("drop","hide",function(t,i){var e,u=n(this),h=t.mode,c="show"===h,f=t.direction||"left",o="up"===f||"down"===f?"top":"left",s="up"===f||"left"===f?"-=":"+=",l="+="===s?"-=":"+=",r={opacity:0};n.effects.createPlaceholder(u),e=t.distance||u["top"===o?"outerHeight":"outerWidth"](!0)/2,r[o]=s+e,c&&(u.css(r),r[o]=l+e,r.opacity=1),u.animate(r,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),n.effects.define("explode","hide",function(t,i){function b(){p.push(this),p.length===e*c&&k()}function k(){o.css({visibility:"visible"}),n(p).remove(),i()}for(var u,l,a,v,y,e=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=e,o=n(this),d=t.mode,f="show"===d,w=o.show().css("visibility","hidden").offset(),s=Math.ceil(o.outerWidth()/c),h=Math.ceil(o.outerHeight()/e),p=[],r=0;e>r;r++)for(a=w.top+r*h,y=r-(e-1)/2,u=0;c>u;u++)l=w.left+u*s,v=u-(c-1)/2,o.clone().appendTo("body").wrap("<div><\/div>").css({position:"absolute",visibility:"visible",left:-u*s,top:-r*h}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:s,height:h,left:l+(f?v*s:0),top:a+(f?y*h:0),opacity:f?0:1}).animate({left:l+(f?0:v*s),top:a+(f?0:y*h),opacity:f?1:0},t.duration||500,t.easing,b)}),n.effects.define("fade","toggle",function(t,i){var r="show"===t.mode;n(this).css("opacity",r?0:1).animate({opacity:r?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),n.effects.define("fold","hide",function(t,i){var u=n(this),l=t.mode,v="show"===l,y="hide"===l,o=t.size||15,a=/([0-9]+)%/.exec(o),p=!!t.horizFirst,f=p?["right","bottom"]:["bottom","right"],s=t.duration/2,h=n.effects.createPlaceholder(u),e=u.cssClip(),c={clip:n.extend({},e)},r={clip:n.extend({},e)},w=[e[f[0]],e[f[1]]],b=u.queue().length;a&&(o=parseInt(a[1],10)/100*w[y?0:1]),c.clip[f[0]]=o,r.clip[f[0]]=o,r.clip[f[1]]=0,v&&(u.cssClip(r.clip),h&&h.css(n.effects.clipToBox(r)),r.clip=e),u.queue(function(i){h&&h.animate(n.effects.clipToBox(c),s,t.easing).animate(n.effects.clipToBox(r),s,t.easing),i()}).animate(c,s,t.easing).animate(r,s,t.easing).queue(i),n.effects.unshift(u,b,4)}),n.effects.define("highlight","show",function(t,i){var r=n(this),u={backgroundColor:r.css("backgroundColor")};"hide"===t.mode&&(u.opacity=0),n.effects.saveStyle(r),r.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),n.effects.define("size",function(t,i){var l,r,p,u=n(this),v=["fontSize"],s=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],w=t.mode,y="effect"!==w,c=t.scale||"both",b=t.origin||["middle","center"],k=u.css("position"),a=u.position(),o=n.effects.scaledDimensions(u),f=t.from||o,e=t.to||n.effects.scaledDimensions(u,0);n.effects.createPlaceholder(u),"show"===w&&(p=f,f=e,e=p),r={from:{y:f.height/o.height,x:f.width/o.width},to:{y:e.height/o.height,x:e.width/o.width}},("box"===c||"both"===c)&&(r.from.y!==r.to.y&&(f=n.effects.setTransition(u,s,r.from.y,f),e=n.effects.setTransition(u,s,r.to.y,e)),r.from.x!==r.to.x&&(f=n.effects.setTransition(u,h,r.from.x,f),e=n.effects.setTransition(u,h,r.to.x,e))),("content"===c||"both"===c)&&r.from.y!==r.to.y&&(f=n.effects.setTransition(u,v,r.from.y,f),e=n.effects.setTransition(u,v,r.to.y,e)),b&&(l=n.effects.getBaseline(b,o),f.top=(o.outerHeight-f.outerHeight)*l.y+a.top,f.left=(o.outerWidth-f.outerWidth)*l.x+a.left,e.top=(o.outerHeight-e.outerHeight)*l.y+a.top,e.left=(o.outerWidth-e.outerWidth)*l.x+a.left),u.css(f),("content"===c||"both"===c)&&(s=s.concat(["marginTop","marginBottom"]).concat(v),h=h.concat(["marginLeft","marginRight"]),u.find("*[width]").each(function(){var i=n(this),u=n.effects.scaledDimensions(i),f={height:u.height*r.from.y,width:u.width*r.from.x,outerHeight:u.outerHeight*r.from.y,outerWidth:u.outerWidth*r.from.x},e={height:u.height*r.to.y,width:u.width*r.to.x,outerHeight:u.height*r.to.y,outerWidth:u.width*r.to.x};r.from.y!==r.to.y&&(f=n.effects.setTransition(i,s,r.from.y,f),e=n.effects.setTransition(i,s,r.to.y,e)),r.from.x!==r.to.x&&(f=n.effects.setTransition(i,h,r.from.x,f),e=n.effects.setTransition(i,h,r.to.x,e)),y&&n.effects.saveStyle(i),i.css(f),i.animate(e,t.duration,t.easing,function(){y&&n.effects.restoreStyle(i)})})),u.animate(e,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){var t=u.offset();0===e.opacity&&u.css("opacity",f.opacity),y||(u.css("position","static"===k?"relative":k).offset(t),n.effects.saveStyle(u)),i()}})}),n.effects.define("scale",function(t,i){var u=n(this),f=t.mode,e=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"effect"!==f?0:100),r=n.extend(!0,{from:n.effects.scaledDimensions(u),to:n.effects.scaledDimensions(u,e,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(r.from.opacity=1,r.to.opacity=0),n.effects.effect.size.call(this,r,i)}),n.effects.define("puff","hide",function(t,i){var r=n.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});n.effects.effect.scale.call(this,r,i)}),n.effects.define("pulsate","show",function(t,i){var r=n(this),e=t.mode,o="show"===e,c="hide"===e,l=o||c,f=2*(t.times||5)+(l?1:0),s=t.duration/f,u=0,h=1,a=r.queue().length;for((o||!r.is(":visible"))&&(r.css("opacity",0).show(),u=1);f>h;h++)r.animate({opacity:u},s,t.easing),u=1-u;r.animate({opacity:u},s,t.easing),r.queue(i),n.effects.unshift(r,a,f+1)}),n.effects.define("shake",function(t,i){var l=1,r=n(this),f=t.direction||"left",e=t.distance||20,a=t.times||3,v=2*a+1,u=Math.round(t.duration/v),o="up"===f||"down"===f?"top":"left",s="up"===f||"left"===f,h={},c={},y={},p=r.queue().length;for(n.effects.createPlaceholder(r),h[o]=(s?"-=":"+=")+e,c[o]=(s?"+=":"-=")+2*e,y[o]=(s?"-=":"+=")+2*e,r.animate(h,u,t.easing);a>l;l++)r.animate(c,u,t.easing).animate(y,u,t.easing);r.animate(c,u,t.easing).animate(h,u/2,t.easing).queue(i),n.effects.unshift(r,p,v+1)}),n.effects.define("slide","show",function(t,i){var s,o,u=n(this),h={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},c=t.mode,f=t.direction||"left",e="up"===f||"down"===f?"top":"left",l="up"===f||"left"===f,a=t.distance||u["top"===e?"outerHeight":"outerWidth"](!0),r={};n.effects.createPlaceholder(u),s=u.cssClip(),o=u.position()[e],r[e]=(l?-1:1)*a+o,r.clip=u.cssClip(),r.clip[h[f][1]]=r.clip[h[f][0]],"show"===c&&(u.cssClip(r.clip),u.css(e,r[e]),r.clip=s,r[e]=o),u.animate(r,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),n.uiBackCompat!==!1&&(p=n.effects.define("transfer",function(t,i){n(this).transfer(t,i)})),n.ui.focusable=function(t,i){var u,f,e,r,o,s=t.nodeName.toLowerCase();return"area"===s?(u=t.parentNode,f=u.name,t.href&&f&&"map"===u.nodeName.toLowerCase()?(e=n("img[usemap='#"+f+"']"),e.length>0&&e.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(s)?(r=!t.disabled,r&&(o=n(t).closest("fieldset")[0],o&&(r=!o.disabled))):r="a"===s?t.href||i:i,r&&n(t).is(":visible")&&b(n(t)))},n.extend(n.expr[":"],{focusable:function(t){return n.ui.focusable(t,null!=n.attr(t,"tabindex"))}}),n.ui.focusable,n.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):n(this[0].form)},n.ui.formResetMixin={_formResetHandler:function(){var t=n(this);setTimeout(function(){var i=t.data("ui-form-reset-instances");n.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var n=this.form.data("ui-form-reset-instances")||[];n.length||this.form.on("reset.ui-form-reset",this._formResetHandler),n.push(this),this.form.data("ui-form-reset-instances",n)}},_unbindFormResetHandler:function(){if(this.form.length){var t=this.form.data("ui-form-reset-instances");t.splice(n.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===n.fn.jquery.substring(0,3)&&(n.each(["Width","Height"],function(t,i){function r(t,i,r,u){return n.each(e,function(){i-=parseFloat(n.css(t,"padding"+this))||0,r&&(i-=parseFloat(n.css(t,"border"+this+"Width"))||0),u&&(i-=parseFloat(n.css(t,"margin"+this))||0)}),i}var e="Width"===i?["Left","Right"]:["Top","Bottom"],u=i.toLowerCase(),f={innerWidth:n.fn.innerWidth,innerHeight:n.fn.innerHeight,outerWidth:n.fn.outerWidth,outerHeight:n.fn.outerHeight};n.fn["inner"+i]=function(t){return void 0===t?f["inner"+i].call(this):this.each(function(){n(this).css(u,r(this,t)+"px")})},n.fn["outer"+i]=function(t,e){return"number"!=typeof t?f["outer"+i].call(this,t):this.each(function(){n(this).css(u,r(this,t,!0,e)+"px")})}}),n.fn.addBack=function(n){return this.add(null==n?this.prevObject:this.prevObject.filter(n))}),n.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},n.ui.escapeSelector=function(){var n=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(t){return t.replace(n,"\\$1")}}(),n.fn.labels=function(){var t,r,u,i,f;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(i=this.eq(0).parents("label"),u=this.attr("id"),u&&(t=this.eq(0).parents().last(),f=t.add(t.length?t.siblings():this.siblings()),r="label[for='"+n.ui.escapeSelector(u)+"']",i=i.add(f.find(r).addBack(r))),this.pushStack(i))},n.fn.scrollParent=function(t){var i=this.css("position"),u="absolute"===i,f=t?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var t=n(this);return u&&"static"===t.css("position")?!1:f.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&r.length?r:n(this[0].ownerDocument||document)},n.extend(n.expr[":"],{tabbable:function(t){var i=n.attr(t,"tabindex"),r=null!=i;return(!r||i>=0)&&n.ui.focusable(t,r)}}),n.fn.extend({uniqueId:function(){var n=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&n(this).removeAttr("id")})}}),n.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=n(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():n()}},_createIcons:function(){var i,r,t=this.options.icons;t&&(i=n("<span>"),this._addClass(i,"ui-accordion-header-icon","ui-icon "+t.header),i.prependTo(this.headers),r=this.active.children(".ui-accordion-header-icon"),this._removeClass(r,t.header)._addClass(r,null,t.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var n;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),n=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&n.css("height","")},_setOption:function(n,t){return"active"===n?(this._activate(t),void 0):("event"===n&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(n,t),"collapsible"!==n||t||this.options.active!==!1||this._activate(0),"icons"===n&&(this._destroyIcons(),t&&this._createIcons()),void 0)},_setOptionDisabled:function(n){this._super(n),this.element.attr("aria-disabled",n),this._toggleClass(null,"ui-state-disabled",!!n),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!n)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=n.ui.keyCode,u=this.headers.length,f=this.headers.index(t.target),r=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:r=this.headers[(f+1)%u];break;case i.LEFT:case i.UP:r=this.headers[(f-1+u)%u];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:r=this.headers[0];break;case i.END:r=this.headers[u-1]}r&&(n(t.target).attr("tabIndex",-1),n(r).attr("tabIndex",0),n(r).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===n.ui.keyCode.UP&&t.ctrlKey&&n(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=n()):t.active===!1?this._activate(0):this.active.length&&!n.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=n()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,n=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),n&&(this._off(t.not(this.headers)),this._off(n.not(this.panels)))},_refresh:function(){var t,i=this.options,r=i.heightStyle,u=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=n(this),r=t.uniqueId().attr("id"),i=t.next(),u=i.uniqueId().attr("id");t.attr("aria-controls",u),i.attr("aria-labelledby",r)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===r?(t=u.height(),this.element.siblings(":visible").each(function(){var i=n(this),r=i.css("position");"absolute"!==r&&"fixed"!==r&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=n(this).outerHeight(!0)}),this.headers.next().each(function(){n(this).height(Math.max(0,t-n(this).innerHeight()+n(this).height()))}).css("overflow","auto")):"auto"===r&&(t=0,this.headers.next().each(function(){var i=n(this).is(":visible");i||n(this).show(),t=Math.max(t,n(this).css("height","").height()),i||n(this).hide()}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:n.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):n()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&n.each(t.split(" "),function(n,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e,o,i=this.options,u=this.active,r=n(t.currentTarget),f=r[0]===u[0],s=f&&i.collapsible,c=s?n():r.next(),l=u.next(),h={oldHeader:u,oldPanel:l,newHeader:s?n():r,newPanel:c};t.preventDefault(),f&&!i.collapsible||this._trigger("beforeActivate",t,h)===!1||(i.active=s?!1:this.headers.index(r),this.active=f?n():r,this._toggle(h),this._removeClass(u,"ui-accordion-header-active","ui-state-active"),i.icons&&(e=u.children(".ui-accordion-header-icon"),this._removeClass(e,null,i.icons.activeHeader)._addClass(e,null,i.icons.header)),f||(this._removeClass(r,"ui-accordion-header-collapsed")._addClass(r,"ui-accordion-header-active","ui-state-active"),i.icons&&(o=r.children(".ui-accordion-header-icon"),this._removeClass(o,null,i.icons.header)._addClass(o,null,i.icons.activeHeader)),this._addClass(r.next(),"ui-accordion-content-active")))},_toggle:function(t){var r=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=r,this.prevHide=i,this.options.animate?this._animate(r,i,t):(i.hide(),r.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),r.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):r.length&&this.headers.filter(function(){return 0===parseInt(n(this).attr("tabIndex"),10)}).attr("tabIndex",-1),r.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(n,t,i){var h,r,u,c=this,o=0,l=n.css("box-sizing"),a=n.length&&(!t.length||n.index()<t.index()),e=this.options.animate||{},f=a&&e.down||e,s=function(){c._toggleComplete(i)};return"number"==typeof f&&(u=f),"string"==typeof f&&(r=f),r=r||f.easing||e.easing,u=u||f.duration||e.duration,t.length?n.length?(h=n.show().outerHeight(),t.animate(this.hideProps,{duration:u,easing:r,step:function(n,t){t.now=Math.round(n)}}),n.hide().animate(this.showProps,{duration:u,easing:r,complete:s,step:function(n,i){i.now=Math.round(n),"height"!==i.prop?"content-box"===l&&(o+=i.now):"content"!==c.options.heightStyle&&(i.now=Math.round(h-t.outerHeight()-o),o=0)}}),void 0):t.animate(this.hideProps,u,r,s):n.animate(this.showProps,u,r,s)},_toggleComplete:function(n){var t=n.oldPanel,i=t.prev();this._removeClass(t,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,n)}}),n.ui.safeActiveElement=function(n){var t;try{t=n.activeElement}catch(i){t=n.body}return t||(t=n.body),t.nodeName||(t=n.body),t},n.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(n){n.preventDefault()},"click .ui-menu-item":function(t){var i=n(t.target),r=n(n.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&r.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var r=n(t.target).closest(".ui-menu-item"),i=n(t.currentTarget);r[0]===i[0]&&(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(n,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(n,i)},blur:function(t){this._delay(function(){var i=!n.contains(this.element[0],n.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(n){this._closeOnDocumentClick(n)&&this.collapseAll(n),this.mouseHandled=!1}})},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=t.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var t=n(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var i,u,r,f,e=!0;switch(t.keyCode){case n.ui.keyCode.PAGE_UP:this.previousPage(t);break;case n.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case n.ui.keyCode.HOME:this._move("first","first",t);break;case n.ui.keyCode.END:this._move("last","last",t);break;case n.ui.keyCode.UP:this.previous(t);break;case n.ui.keyCode.DOWN:this.next(t);break;case n.ui.keyCode.LEFT:this.collapse(t);break;case n.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case n.ui.keyCode.ENTER:case n.ui.keyCode.SPACE:this._activate(t);break;case n.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=!1,u=this.previousFilter||"",f=!1,r=t.keyCode>=96&&105>=t.keyCode?""+(t.keyCode-96):String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),r===u?f=!0:r=u+r,i=this._filterMenuItems(r),i=f&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(r=String.fromCharCode(t.keyCode),i=this._filterMenuItems(r)),i.length?(this.focus(t,i),this.previousFilter=r,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}e&&t.preventDefault()},_activate:function(n){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(n):this.select(n))},refresh:function(){var u,t,f,i,e,r=this,s=this.options.icons.submenu,o=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),f=o.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=n(this),i=t.prev(),u=n("<span>").data("ui-menu-submenu-caret",!0);r._addClass(u,"ui-menu-icon","ui-icon "+s),i.attr("aria-haspopup","true").prepend(u),t.attr("aria-labelledby",i.attr("id"))}),this._addClass(f,"ui-menu","ui-widget ui-widget-content ui-front"),u=o.add(this.element),t=u.find(this.options.items),t.not(".ui-menu-item").each(function(){var t=n(this);r._isDivider(t)&&r._addClass(t,"ui-menu-divider","ui-widget-content")}),i=t.not(".ui-menu-item, .ui-menu-divider"),e=i.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(e,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!n.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(n,t){if("icons"===n){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,t.submenu)}this._super(n,t)},_setOptionDisabled:function(n){this._super(n),this.element.attr("aria-disabled",n+""),this._toggleClass(null,"ui-state-disabled",!!n)},focus:function(n,t){var i,r,u;this.blur(n,n&&"focus"===n.type),this._scrollIntoView(t),this.active=t.first(),r=this.active.children(".ui-menu-item-wrapper"),this._addClass(r,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),u=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(u,null,"ui-state-active"),n&&"keydown"===n.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&n&&/^mouse/.test(n.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",n,{item:t})},_scrollIntoView:function(t){var e,o,i,r,u,f;this._hasScroll()&&(e=parseFloat(n.css(this.activeMenu[0],"borderTopWidth"))||0,o=parseFloat(n.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-e-o,r=this.activeMenu.scrollTop(),u=this.activeMenu.height(),f=t.outerHeight(),0>i?this.activeMenu.scrollTop(r+i):i+f>u&&this.activeMenu.scrollTop(r+i-u+f))},blur:function(n,t){t||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",n,{item:this.active}),this.active=null)},_startOpening:function(n){clearTimeout(this.timer),"true"===n.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(n)},this.delay))},_open:function(t){var i=n.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var r=i?this.element:n(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this._removeClass(r.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=r},this.delay)},_close:function(n){n||(n=this.active?this.active.parent():this.element),n.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(t){return!n(t.target).closest(".ui-menu").length},_isDivider:function(n){return!/[^\-\u2014\u2013\s]/.test(n.text())},collapse:function(n){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(n,t))},expand:function(n){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(n,t)}))},next:function(n){this._move("next","first",n)},previous:function(n){this._move("prev","last",n)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(n,t,i){var r;this.active&&(r="first"===n||"last"===n?this.active["first"===n?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[n+"All"](".ui-menu-item").eq(0)),r&&r.length&&this.active||(r=this.activeMenu.find(this.options.items)[t]()),this.focus(i,r)},nextPage:function(t){var i,r,u;return this.active?(this.isLastItem()||(this._hasScroll()?(r=this.active.offset().top,u=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=n(this),0>i.offset().top-r-u}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,r,u;return this.active?(this.isFirstItem()||(this._hasScroll()?(r=this.active.offset().top,u=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=n(this),i.offset().top-r+u>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||n(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),r=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return r.test(n.trim(n(this).children(".ui-menu-item-wrapper").text()))})}}),n.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,r,u=this.element[0].nodeName.toLowerCase(),f="textarea"===u,e="input"===u;this.isMultiLine=f||!e&&this._isContentEditable(this.element),this.valueMethod=this.element[f||e?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(u){if(this.element.prop("readOnly"))return t=!0,r=!0,i=!0,void 0;t=!1,r=!1,i=!1;var f=n.ui.keyCode;switch(u.keyCode){case f.PAGE_UP:t=!0,this._move("previousPage",u);break;case f.PAGE_DOWN:t=!0,this._move("nextPage",u);break;case f.UP:t=!0,this._keyEvent("previous",u);break;case f.DOWN:t=!0,this._keyEvent("next",u);break;case f.ENTER:this.menu.active&&(t=!0,u.preventDefault(),this.menu.select(u));break;case f.TAB:this.menu.active&&this.menu.select(u);break;case f.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(u),u.preventDefault());break;default:i=!0,this._searchTimeout(u)}},keypress:function(r){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&r.preventDefault(),void 0;if(!i){var u=n.ui.keyCode;switch(r.keyCode){case u.PAGE_UP:this._move("previousPage",r);break;case u.PAGE_DOWN:this._move("nextPage",r);break;case u.UP:this._keyEvent("previous",r);break;case u.DOWN:this._keyEvent("next",r)}}},input:function(n){return r?(r=!1,n.preventDefault(),void 0):(this._searchTimeout(n),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(n){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(n),this._change(n),void 0)}}),this._initSource(),this.menu=n("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==n.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(t,i){var r,u;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){n(t.target).trigger(t.originalEvent)}),void 0):(u=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:u})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(u.value),r=i.item.attr("aria-label")||u.value,r&&n.trim(r).length&&(this.liveRegion.children().hide(),n("<div>").text(r).appendTo(this.liveRegion)),void 0)},menuselect:function(t,i){var r=i.item.data("ui-autocomplete-item"),u=this.previous;this.element[0]!==n.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=u,this._delay(function(){this.previous=u,this.selectedItem=r})),!1!==this._trigger("select",t,{item:r})&&this._value(r.value),this.term=this._value(),this.close(t),this.selectedItem=r}}),this.liveRegion=n("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(n,t){this._super(n,t),"source"===n&&this._initSource(),"appendTo"===n&&this.menu.element.appendTo(this._appendTo()),"disabled"===n&&t&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var i=this.menu.element[0];return t.target===this.element[0]||t.target===i||n.contains(i,t.target)},_closeOnClickOutside:function(n){this._isEventTargetInWidget(n)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?n(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_initSource:function(){var i,r,t=this;n.isArray(this.options.source)?(i=this.options.source,this.source=function(t,r){r(n.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(r=this.options.source,this.source=function(i,u){t.xhr&&t.xhr.abort(),t.xhr=n.ajax({url:r,data:i,dataType:"json",success:function(n){u(n)},error:function(){u([])}})}):this.source=this.options.source},_searchTimeout:function(n){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),r=n.altKey||n.ctrlKey||n.metaKey||n.shiftKey;t&&(!t||i||r)||(this.selectedItem=null,this.search(null,n))},this.options.delay)},search:function(n,t){return n=null!=n?n:this._value(),this.term=this._value(),n.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(n):void 0},_search:function(n){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:n},this._response())},_response:function(){var t=++this.requestIndex;return n.proxy(function(n){t===this.requestIndex&&this.__response(n),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(n){n&&(n=this._normalize(n)),this._trigger("response",null,{content:n}),!this.options.disabled&&n&&n.length&&!this.cancelSearch?(this._suggest(n),this._trigger("open")):this._close()},close:function(n){this.cancelSearch=!0,this._close(n)},_close:function(n){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",n))},_change:function(n){this.previous!==this._value()&&this._trigger("change",n,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:n.map(t,function(t){return"string"==typeof t?{label:t,value:t}:n.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(n.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var n=this.menu.element;n.outerWidth(Math.max(n.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var r=this;n.each(i,function(n,i){r._renderItemData(t,i)})},_renderItemData:function(n,t){return this._renderItem(n,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return n("<li>").append(n("<div>").text(i.label)).appendTo(t)},_move:function(n,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(n)||this.menu.isLastItem()&&/^next/.test(n)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[n](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(n,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(n,t),t.preventDefault())},_isContentEditable:function(n){if(!n.length)return!1;var t=n.prop("contentEditable");return"inherit"===t?this._isContentEditable(n.parent()):"true"===t}}),n.extend(n.ui.autocomplete,{escapeRegex:function(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var r=RegExp(n.ui.autocomplete.escapeRegex(i),"i");return n.grep(t,function(n){return r.test(n.label||n.value||n)})}}),n.widget("ui.autocomplete",n.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(n){return n+(n>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),n("<div>").text(i).appendTo(this.liveRegion))}}),n.ui.autocomplete,w=/ui-corner-([a-z]){2,6}/g,n.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var t=this,i=[];n.each(this.options.items,function(r,u){var f,e={};if(u)return"controlgroupLabel"===r?(f=t.element.find(u),f.each(function(){var t=n(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'><\/span>")}),t._addClass(f,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(f.get()),void 0):(n.fn[r]&&(e=t["_"+r+"Options"]?t["_"+r+"Options"]("middle"):{classes:{}},t.element.find(u).each(function(){var u=n(this),f=u[r]("instance"),o=n.widget.extend({},e),s;"button"===r&&u.parent(".ui-spinner").length||(f||(f=u[r]()[r]("instance")),f&&(o.classes=t._resolveClassesValues(o.classes,f)),u[r](o),s=u[r]("widget"),n.data(s[0],"ui-controlgroup-data",f?f:u[r]("instance")),i.push(s[0]))})),void 0)}),this.childWidgets=n(n.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(t){this.childWidgets.each(function(){var r=n(this),i=r.data("ui-controlgroup-data");i&&i[t]&&i[t]()})},_updateCornerClass:function(n,t){var i=this._buildSimpleOptions(t,"label").classes.label;this._removeClass(n,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(n,null,i)},_buildSimpleOptions:function(n,t){var i="vertical"===this.options.direction,r={classes:{}};return r.classes[t]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[n],r},_spinnerOptions:function(n){var t=this._buildSimpleOptions(n,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(n){return this._buildSimpleOptions(n,"ui-button")},_checkboxradioOptions:function(n){return this._buildSimpleOptions(n,"ui-checkboxradio-label")},_selectmenuOptions:function(n){var t="vertical"===this.options.direction;return{width:t?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(t?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(t?"top":"left")},last:{"ui-selectmenu-button-open":t?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(t?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[n]}},_resolveClassesValues:function(t,i){var r={};return n.each(t,function(u){var f=i.options.classes[u]||"";f=n.trim(f.replace(w,"")),r[u]=(f+" "+t[u]).replace(/\s+/g," ")}),r},_setOption:function(n,t){return"direction"===n&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(n,t),"disabled"===n?(this._callChildMethod(t?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var t,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),t=this.childWidgets,this.options.onlyVisible&&(t=t.filter(":visible")),t.length&&(n.each(["first","last"],function(n,r){var u=t[r]().data("ui-controlgroup-data"),f;u&&i["_"+u.widgetName+"Options"]?(f=i["_"+u.widgetName+"Options"](1===t.length?"only":r),f.classes=i._resolveClassesValues(f.classes,u),u.element[u.widgetName](f)):i._updateCornerClass(t[r](),r)}),this._callChildMethod("refresh"))}}),n.widget("ui.checkboxradio",[n.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,i,u=this,r=this._super()||{};return this._readType(),i=this.element.labels(),this.label=n(i[i.length-1]),this.label.length||n.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){u.originalLabel+=3===this.nodeType?n(this).text():this.outerHTML}),this.originalLabel&&(r.label=this.originalLabel),t=this.element[0].disabled,null!=t&&(r.disabled=t),r},_create:function(){var n=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),n&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||n.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t,i=this.element[0].name,r="input[name='"+n.ui.escapeSelector(i)+"']";return i?(t=this.form.length?n(this.form[0].elements).filter(r):n(r).filter(function(){return 0===n(this).form().length}),t.not(this.element)):n([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=n(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(n,t){if("label"!==n||t)return(this._super(n,t),"disabled"===n?(this._toggleClass(this.label,null,"ui-state-disabled",t),this.element[0].disabled=t,void 0):(this.refresh(),void 0))},_updateIcon:function(t){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=n("<span>"),this.iconSpace=n("<span> <\/span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var n=this.label.contents().not(this.element[0]);this.icon&&(n=n.not(this.icon[0])),this.iconSpace&&(n=n.not(this.iconSpace[0])),n.remove(),this.label.append(this.options.label)},refresh:function(){var n=this.element[0].checked,t=this.element[0].disabled;this._updateIcon(n),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",n),null!==this.options.label&&this._updateLabel(),t!==this.options.disabled&&this._setOptions({disabled:t})}}]),n.ui.checkboxradio,n.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var n,t=this._super()||{};return this.isInput=this.element.is("input"),n=this.element[0].disabled,null!=n&&(t.disabled=n),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(t.label=this.originalLabel),t},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===n.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,i){var u="iconPosition"!==t,r=u?this.options.iconPosition:i,f="top"===r||"bottom"===r;this.icon?u&&this._removeClass(this.icon,null,this.options.icon):(this.icon=n("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),u&&this._addClass(this.icon,null,i),this._attachIcon(r),f?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=n("<span> <\/span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(r))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(n){this.icon[/^(?:end|bottom)/.test(n)?"before":"after"](this.iconSpace)},_attachIcon:function(n){this.element[/^(?:end|bottom)/.test(n)?"append":"prepend"](this.icon)},_setOptions:function(n){var t=void 0===n.showLabel?this.options.showLabel:n.showLabel,i=void 0===n.icon?this.options.icon:n.icon;t||i||(n.showLabel=!0),this._super(n)},_setOption:function(n,t){"icon"===n&&(t?this._updateIcon(n,t):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===n&&this._updateIcon(n,t),"showLabel"===n&&(this._toggleClass("ui-button-icon-only",null,!t),this._updateTooltip()),"label"===n&&(this.isInput?this.element.val(t):(this.element.html(t),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(n,t),"disabled"===n&&(this._toggleClass(null,"ui-state-disabled",t),this.element[0].disabled=t,t&&this.element.blur())},refresh:function(){var n=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");n!==this.options.disabled&&this._setOptions({disabled:n}),this._updateTooltip()}}),n.uiBackCompat!==!1&&(n.widget("ui.button",n.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(n,t){return"text"===n?(this._super("showLabel",t),void 0):("showLabel"===n&&(this.options.text=t),"icon"===n&&(this.options.icons.primary=t),"icons"===n&&(t.primary?(this._super("icon",t.primary),this._super("iconPosition","beginning")):t.secondary&&(this._super("icon",t.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),n.fn.button=function(t){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?t.apply(this,arguments):(n.ui.checkboxradio||n.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(n.fn.button),n.fn.buttonset=function(){return n.ui.controlgroup||n.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),n.ui.button,n.extend(n.ui,{datepicker:{version:"1.12.1"}}),n.extend(c.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(n){return u(this._defaults,n||{}),this},_attachDatepicker:function(t,i){var r,f,u;r=t.nodeName.toLowerCase(),f="div"===r||"span"===r,t.id||(this.uuid+=1,t.id="dp"+this.uuid),u=this._newInst(n(t),f),u.settings=n.extend({},i||{}),"input"===r?this._connectDatepicker(t,u):f&&this._inlineDatepicker(t,u)},_newInst:function(t,i){var r=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:r,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?l(n("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'><\/div>")):this.dpDiv}},_connectDatepicker:function(t,i){var r=n(t);i.append=n([]),i.trigger=n([]),r.hasClass(this.markerClassName)||(this._attachments(r,i),r.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),n.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var u,r,f,e=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),e&&(i.append=n("<span class='"+this._appendClass+"'>"+e+"<\/span>"),t[o?"before":"after"](i.append)),t.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),u=this._get(i,"showOn"),("focus"===u||"both"===u)&&t.on("focus",this._showDatepicker),("button"===u||"both"===u)&&(r=this._get(i,"buttonText"),f=this._get(i,"buttonImage"),i.trigger=n(this._get(i,"buttonImageOnly")?n("<img/>").addClass(this._triggerClass).attr({src:f,alt:r,title:r}):n("<button type='button'><\/button>").addClass(this._triggerClass).html(f?n("<img/>").attr({src:f,alt:r,title:r}):r)),t[o?"before":"after"](i.trigger),i.trigger.on("click",function(){return n.datepicker._datepickerShowing&&n.datepicker._lastInput===t[0]?n.datepicker._hideDatepicker():n.datepicker._datepickerShowing&&n.datepicker._lastInput!==t[0]?(n.datepicker._hideDatepicker(),n.datepicker._showDatepicker(t[0])):n.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(n){if(this._get(n,"autoSize")&&!n.inline){var r,u,f,t,i=new Date(2009,11,20),e=this._get(n,"dateFormat");e.match(/[DM]/)&&(r=function(n){for(u=0,f=0,t=0;n.length>t;t++)n[t].length>u&&(u=n[t].length,f=t);return f},i.setMonth(r(this._get(n,e.match(/MM/)?"monthNames":"monthNamesShort"))),i.setDate(r(this._get(n,e.match(/DD/)?"dayNames":"dayNamesShort"))+20-i.getDay())),n.input.attr("size",this._formatDate(n,i).length)}},_inlineDatepicker:function(t,i){var r=n(t);r.hasClass(this.markerClassName)||(r.addClass(this.markerClassName).append(i.dpDiv),n.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,r,f,e){var s,h,c,l,a,o=this._dialogInst;return o||(this.uuid+=1,s="dp"+this.uuid,this._dialogInput=n("<input type='text' id='"+s+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),n("body").append(this._dialogInput),o=this._dialogInst=this._newInst(this._dialogInput,!1),o.settings={},n.data(this._dialogInput[0],"datepicker",o)),u(o.settings,f||{}),i=i&&i.constructor===Date?this._formatDate(o,i):i,this._dialogInput.val(i),this._pos=e?e.length?e:[e.pageX,e.pageY]:null,this._pos||(h=document.documentElement.clientWidth,c=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,a=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+l,c/2-150+a]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),o.settings.onSelect=r,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),n.blockUI&&n.blockUI(this.dpDiv),n.data(this._dialogInput[0],"datepicker",o),this},_destroyDatepicker:function(t){var r,u=n(t),f=n.data(t,"datepicker");u.hasClass(this.markerClassName)&&(r=t.nodeName.toLowerCase(),n.removeData(t,"datepicker"),"input"===r?(f.append.remove(),f.trigger.remove(),u.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===r||"span"===r)&&u.removeClass(this.markerClassName).empty(),i===f&&(i=null))},_enableDatepicker:function(t){var i,r,u=n(t),f=n.data(t,"datepicker");u.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,f.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(r=u.children("."+this._inlineClass),r.children().removeClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=n.map(this._disabledInputs,function(n){return n===t?null:n}))},_disableDatepicker:function(t){var i,r,u=n(t),f=n.data(t,"datepicker");u.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,f.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(r=u.children("."+this._inlineClass),r.children().addClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=n.map(this._disabledInputs,function(n){return n===t?null:n}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(n){if(!n)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===n)return!0;return!1},_getInst:function(t){try{return n.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(t,i,r){var e,h,o,s,f=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?n.extend({},n.datepicker._defaults):f?"all"===i?n.extend({},f.settings):this._get(f,i):null:(e=i||{},"string"==typeof i&&(e={},e[i]=r),f&&(this._curInst===f&&this._hideDatepicker(),h=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(f,"min"),s=this._getMinMaxDate(f,"max"),u(f.settings,e),null!==o&&void 0!==e.dateFormat&&void 0===e.minDate&&(f.settings.minDate=this._formatDate(f,o)),null!==s&&void 0!==e.dateFormat&&void 0===e.maxDate&&(f.settings.maxDate=this._formatDate(f,s)),"disabled"in e&&(e.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(n(t),f),this._autoSize(f),this._setDate(f,h),this._updateAlternate(f),this._updateDatepicker(f)),void 0)},_changeDatepicker:function(n,t,i){this._optionDatepicker(n,t,i)},_refreshDatepicker:function(n){var t=this._getInst(n);t&&this._updateDatepicker(t)},_setDateDatepicker:function(n,t){var i=this._getInst(n);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(n,t){var i=this._getInst(n);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var u,e,f,i=n.datepicker._getInst(t.target),r=!0,o=i.dpDiv.is(".ui-datepicker-rtl");if(i._keyEvent=!0,n.datepicker._datepickerShowing)switch(t.keyCode){case 9:n.datepicker._hideDatepicker(),r=!1;break;case 13:return f=n("td."+n.datepicker._dayOverClass+":not(."+n.datepicker._currentClass+")",i.dpDiv),f[0]&&n.datepicker._selectDay(t.target,i.selectedMonth,i.selectedYear,f[0]),u=n.datepicker._get(i,"onSelect"),u?(e=n.datepicker._formatDate(i),u.apply(i.input?i.input[0]:null,[e,i])):n.datepicker._hideDatepicker(),!1;case 27:n.datepicker._hideDatepicker();break;case 33:n.datepicker._adjustDate(t.target,t.ctrlKey?-n.datepicker._get(i,"stepBigMonths"):-n.datepicker._get(i,"stepMonths"),"M");break;case 34:n.datepicker._adjustDate(t.target,t.ctrlKey?+n.datepicker._get(i,"stepBigMonths"):+n.datepicker._get(i,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&n.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&n.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&n.datepicker._adjustDate(t.target,t.ctrlKey?-n.datepicker._get(i,"stepBigMonths"):-n.datepicker._get(i,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&n.datepicker._adjustDate(t.target,t.ctrlKey?+n.datepicker._get(i,"stepBigMonths"):+n.datepicker._get(i,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?n.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,r,u=n.datepicker._getInst(t.target);if(n.datepicker._get(u,"constrainInput"))return(i=n.datepicker._possibleChars(n.datepicker._get(u,"dateFormat")),r=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">r||!i||i.indexOf(r)>-1)},_doKeyUp:function(t){var r,i=n.datepicker._getInst(t.target);if(i.input.val()!==i.lastVal)try{r=n.datepicker.parseDate(n.datepicker._get(i,"dateFormat"),i.input?i.input.val():null,n.datepicker._getFormatConfig(i)),r&&(n.datepicker._setDateFromField(i),n.datepicker._updateAlternate(i),n.datepicker._updateDatepicker(i))}catch(u){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=n("input",t.parentNode)[0]),!n.datepicker._isDisabledDatepicker(t)&&n.datepicker._lastInput!==t){var i,o,s,r,f,e,h;i=n.datepicker._getInst(t),n.datepicker._curInst&&n.datepicker._curInst!==i&&(n.datepicker._curInst.dpDiv.stop(!0,!0),i&&n.datepicker._datepickerShowing&&n.datepicker._hideDatepicker(n.datepicker._curInst.input[0])),o=n.datepicker._get(i,"beforeShow"),s=o?o.apply(t,[t,i]):{},s!==!1&&(u(i.settings,s),i.lastVal=null,n.datepicker._lastInput=t,n.datepicker._setDateFromField(i),n.datepicker._inDialog&&(t.value=""),n.datepicker._pos||(n.datepicker._pos=n.datepicker._findPos(t),n.datepicker._pos[1]+=t.offsetHeight),r=!1,n(t).parents().each(function(){return r|="fixed"===n(this).css("position"),!r}),f={left:n.datepicker._pos[0],top:n.datepicker._pos[1]},n.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),n.datepicker._updateDatepicker(i),f=n.datepicker._checkOffset(i,f,r),i.dpDiv.css({position:n.datepicker._inDialog&&n.blockUI?"static":r?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"}),i.inline||(e=n.datepicker._get(i,"showAnim"),h=n.datepicker._get(i,"duration"),i.dpDiv.css("z-index",k(n(t))+1),n.datepicker._datepickerShowing=!0,n.effects&&n.effects.effect[e]?i.dpDiv.show(e,n.datepicker._get(i,"showOptions"),h):i.dpDiv[e||"show"](e?h:null),n.datepicker._shouldFocusInput(i)&&i.input.trigger("focus"),n.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,i=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var r,u=this._getNumberOfMonths(t),f=u[1],e=t.dpDiv.find("."+this._dayOverClass+" a");e.length>0&&a.apply(e.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&t.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",17*f+"em"),t.dpDiv[(1!==u[0]||1!==u[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===n.datepicker._curInst&&n.datepicker._datepickerShowing&&n.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(r=t.yearshtml,setTimeout(function(){r===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),r=t.yearshtml=null},0))},_shouldFocusInput:function(n){return n.input&&n.input.is(":visible")&&!n.input.is(":disabled")&&!n.input.is(":focus")},_checkOffset:function(t,i,r){var u=t.dpDiv.outerWidth(),f=t.dpDiv.outerHeight(),h=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,e=document.documentElement.clientWidth+(r?0:n(document).scrollLeft()),s=document.documentElement.clientHeight+(r?0:n(document).scrollTop());return i.left-=this._get(t,"isRTL")?u-h:0,i.left-=r&&i.left===t.input.offset().left?n(document).scrollLeft():0,i.top-=r&&i.top===t.input.offset().top+o?n(document).scrollTop():0,i.left-=Math.min(i.left,i.left+u>e&&e>u?Math.abs(i.left+u-e):0),i.top-=Math.min(i.top,i.top+f>s&&s>f?Math.abs(f+o):0),i},_findPos:function(t){for(var i,r=this._getInst(t),u=this._get(r,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||n.expr.filters.hidden(t));)t=t[u?"previousSibling":"nextSibling"];return i=n(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var r,f,u,e,i=this._curInst;!i||t&&i!==n.data(t,"datepicker")||this._datepickerShowing&&(r=this._get(i,"showAnim"),f=this._get(i,"duration"),u=function(){n.datepicker._tidyDialog(i)},n.effects&&(n.effects.effect[r]||n.effects[r])?i.dpDiv.hide(r,n.datepicker._get(i,"showOptions"),f,u):i.dpDiv["slideDown"===r?"slideUp":"fadeIn"===r?"fadeOut":"hide"](r?f:null,u),r||u(),this._datepickerShowing=!1,e=this._get(i,"onClose"),e&&e.apply(i.input?i.input[0]:null,[i.input?i.input.val():"",i]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),n.blockUI&&(n.unblockUI(),n("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(n){n.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(n.datepicker._curInst){var i=n(t.target),r=n.datepicker._getInst(i[0]);(i[0].id===n.datepicker._mainDivId||0!==i.parents("#"+n.datepicker._mainDivId).length||i.hasClass(n.datepicker.markerClassName)||i.closest("."+n.datepicker._triggerClass).length||!n.datepicker._datepickerShowing||n.datepicker._inDialog&&n.blockUI)&&(!i.hasClass(n.datepicker.markerClassName)||n.datepicker._curInst===r)||n.datepicker._hideDatepicker()}},_adjustDate:function(t,i,r){var f=n(t),u=this._getInst(f[0]);this._isDisabledDatepicker(f[0])||(this._adjustInstDate(u,i+("M"===r?this._get(u,"showCurrentAtPos"):0),r),this._updateDatepicker(u))},_gotoToday:function(t){var r,u=n(t),i=this._getInst(u[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(r=new Date,i.selectedDay=r.getDate(),i.drawMonth=i.selectedMonth=r.getMonth(),i.drawYear=i.selectedYear=r.getFullYear()),this._notifyChange(i),this._adjustDate(u)},_selectMonthYear:function(t,i,r){var f=n(t),u=this._getInst(f[0]);u["selected"+("M"===r?"Month":"Year")]=u["draw"+("M"===r?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(u),this._adjustDate(f)},_selectDay:function(t,i,r,u){var f,e=n(t);n(u).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0])||(f=this._getInst(e[0]),f.selectedDay=f.currentDay=n("a",u).html(),f.selectedMonth=f.currentMonth=i,f.selectedYear=f.currentYear=r,this._selectDate(t,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear)))},_clearDate:function(t){var i=n(t);this._selectDate(i,"")},_selectDate:function(t,i){var u,f=n(t),r=this._getInst(f[0]);i=null!=i?i:this._formatDate(r),r.input&&r.input.val(i),this._updateAlternate(r),u=this._get(r,"onSelect"),u?u.apply(r.input?r.input[0]:null,[i,r]):r.input&&r.input.trigger("change"),r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],"object"!=typeof r.input[0]&&r.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var i,r,u,f=this._get(t,"altField");f&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),r=this._getDate(t),u=this.formatDate(i,r,this._getFormatConfig(t)),n(f).val(u))},noWeekends:function(n){var t=n.getDay();return[t>0&&6>t,""]},iso8601Week:function(n){var i,t=new Date(n.getTime());return t.setDate(t.getDate()+4-(t.getDay()||7)),i=t.getTime(),t.setMonth(0),t.setDate(1),Math.floor(Math.round((i-t)/864e5)/7)+1},parseDate:function(t,i,r){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;for(var a,v,u,f=0,y=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff,d="string"!=typeof y?y:(new Date).getFullYear()%100+parseInt(y,10),g=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,nt=(r?r.dayNames:null)||this._defaults.dayNames,tt=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,it=(r?r.monthNames:null)||this._defaults.monthNames,e=-1,s=-1,h=-1,p=-1,w=!1,l=function(n){var i=t.length>o+1&&t.charAt(o+1)===n;return i&&o++,i},c=function(n){var u=l(n),r="@"===n?14:"!"===n?20:"y"===n&&u?4:"o"===n?3:2,e="y"===n?r:1,o=RegExp("^\\d{"+e+","+r+"}"),t=i.substring(f).match(o);if(!t)throw"Missing number at position "+f;return f+=t[0].length,parseInt(t[0],10)},k=function(t,r,u){var e=-1,o=n.map(l(t)?u:r,function(n,t){return[[t,n]]}).sort(function(n,t){return-(n[1].length-t[1].length)});if(n.each(o,function(n,t){var r=t[1];if(i.substr(f,r.length).toLowerCase()===r.toLowerCase())return(e=t[0],f+=r.length,!1)}),-1!==e)return e+1;throw"Unknown name at position "+f;},b=function(){if(i.charAt(f)!==t.charAt(o))throw"Unexpected literal at position "+f;f++},o=0;t.length>o;o++)if(w)"'"!==t.charAt(o)||l("'")?b():w=!1;else switch(t.charAt(o)){case"d":h=c("d");break;case"D":k("D",g,nt);break;case"o":p=c("o");break;case"m":s=c("m");break;case"M":s=k("M",tt,it);break;case"y":e=c("y");break;case"@":u=new Date(c("@")),e=u.getFullYear(),s=u.getMonth()+1,h=u.getDate();break;case"!":u=new Date((c("!")-this._ticksTo1970)/1e4),e=u.getFullYear(),s=u.getMonth()+1,h=u.getDate();break;case"'":l("'")?b():w=!0;break;default:b()}if(i.length>f&&(v=i.substr(f),!/^\s+/.test(v)))throw"Extra/unparsed characters found in date: "+v;if(-1===e?e=(new Date).getFullYear():100>e&&(e+=(new Date).getFullYear()-(new Date).getFullYear()%100+(d>=e?0:-100)),p>-1)for(s=1,h=p;;){if(a=this._getDaysInMonth(e,s-1),a>=h)break;s++,h-=a}if(u=this._daylightSavingAdjust(new Date(e,s-1,h)),u.getFullYear()!==e||u.getMonth()+1!==s||u.getDate()!==h)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864e9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(n,t,i){if(!t)return"";var u,h=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,c=(i?i.dayNames:null)||this._defaults.dayNames,l=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,a=(i?i.monthNames:null)||this._defaults.monthNames,f=function(t){var i=n.length>u+1&&n.charAt(u+1)===t;return i&&u++,i},e=function(n,t,i){var r=""+t;if(f(n))for(;i>r.length;)r="0"+r;return r},s=function(n,t,i,r){return f(n)?r[t]:i[t]},r="",o=!1;if(t)for(u=0;n.length>u;u++)if(o)"'"!==n.charAt(u)||f("'")?r+=n.charAt(u):o=!1;else switch(n.charAt(u)){case"d":r+=e("d",t.getDate(),2);break;case"D":r+=s("D",t.getDay(),h,c);break;case"o":r+=e("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":r+=e("m",t.getMonth()+1,2);break;case"M":r+=s("M",t.getMonth(),l,a);break;case"y":r+=f("y")?t.getFullYear():(10>t.getFullYear()%100?"0":"")+t.getFullYear()%100;break;case"@":r+=t.getTime();break;case"!":r+=1e4*t.getTime()+this._ticksTo1970;break;case"'":f("'")?r+="'":o=!0;break;default:r+=n.charAt(u)}return r},_possibleChars:function(n){for(var i="",r=!1,u=function(i){var r=n.length>t+1&&n.charAt(t+1)===i;return r&&t++,r},t=0;n.length>t;t++)if(r)"'"!==n.charAt(t)||u("'")?i+=n.charAt(t):r=!1;else switch(n.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":u("'")?i+="'":r=!0;break;default:i+=n.charAt(t)}return i},_get:function(n,t){return void 0!==n.settings[t]?n.settings[t]:this._defaults[t]},_setDateFromField:function(n,t){if(n.input.val()!==n.lastVal){var f=this._get(n,"dateFormat"),r=n.lastVal=n.input?n.input.val():null,u=this._getDefaultDate(n),i=u,e=this._getFormatConfig(n);try{i=this.parseDate(f,r,e)||u}catch(o){r=t?"":r}n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear(),n.currentDay=r?i.getDate():0,n.currentMonth=r?i.getMonth():0,n.currentYear=r?i.getFullYear():0,this._adjustInstDate(n)}},_getDefaultDate:function(n){return this._restrictMinMax(n,this._determineDate(n,this._get(n,"defaultDate"),new Date))},_determineDate:function(t,i,r){var f=function(n){var t=new Date;return t.setDate(t.getDate()+n),t},e=function(i){try{return n.datepicker.parseDate(n.datepicker._get(t,"dateFormat"),i,n.datepicker._getFormatConfig(t))}catch(h){}for(var o=(i.toLowerCase().match(/^c/)?n.datepicker._getDate(t):null)||new Date,f=o.getFullYear(),e=o.getMonth(),r=o.getDate(),s=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,u=s.exec(i);u;){switch(u[2]||"d"){case"d":case"D":r+=parseInt(u[1],10);break;case"w":case"W":r+=7*parseInt(u[1],10);break;case"m":case"M":e+=parseInt(u[1],10),r=Math.min(r,n.datepicker._getDaysInMonth(f,e));break;case"y":case"Y":f+=parseInt(u[1],10),r=Math.min(r,n.datepicker._getDaysInMonth(f,e))}u=s.exec(i)}return new Date(f,e,r)},u=null==i||""===i?r:"string"==typeof i?e(i):"number"==typeof i?isNaN(i)?r:f(i):new Date(i.getTime());return u=u&&"Invalid Date"==""+u?r:u,u&&(u.setHours(0),u.setMinutes(0),u.setSeconds(0),u.setMilliseconds(0)),this._daylightSavingAdjust(u)},_daylightSavingAdjust:function(n){return n?(n.setHours(n.getHours()>12?n.getHours()+2:0),n):null},_setDate:function(n,t,i){var u=!t,f=n.selectedMonth,e=n.selectedYear,r=this._restrictMinMax(n,this._determineDate(n,t,new Date));n.selectedDay=n.currentDay=r.getDate(),n.drawMonth=n.selectedMonth=n.currentMonth=r.getMonth(),n.drawYear=n.selectedYear=n.currentYear=r.getFullYear(),f===n.selectedMonth&&e===n.selectedYear||i||this._notifyChange(n),this._adjustInstDate(n),n.input&&n.input.val(u?"":this._formatDate(n))},_getDate:function(n){return!n.currentYear||n.input&&""===n.input.val()?null:this._daylightSavingAdjust(new Date(n.currentYear,n.currentMonth,n.currentDay))},_attachHandlers:function(t){var r=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){n.datepicker._adjustDate(i,-r,"M")},next:function(){n.datepicker._adjustDate(i,+r,"M")},hide:function(){n.datepicker._hideDatepicker()},today:function(){n.datepicker._gotoToday(i)},selectDay:function(){return n.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return n.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return n.datepicker._selectMonthYear(i,this,"Y"),!1}};n(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(n){var b,s,rt,h,ut,k,ft,et,ri,c,ot,ui,fi,ei,oi,st,g,si,ht,nt,o,y,ct,p,lt,l,u,at,vt,yt,pt,tt,wt,i,bt,kt,d,a,it,dt=new Date,gt=this._daylightSavingAdjust(new Date(dt.getFullYear(),dt.getMonth(),dt.getDate())),f=this._get(n,"isRTL"),li=this._get(n,"showButtonPanel"),hi=this._get(n,"hideIfNoPrevNext"),ni=this._get(n,"navigationAsDateFormat"),e=this._getNumberOfMonths(n),ai=this._get(n,"showCurrentAtPos"),ci=this._get(n,"stepMonths"),ti=1!==e[0]||1!==e[1],ii=this._daylightSavingAdjust(n.currentDay?new Date(n.currentYear,n.currentMonth,n.currentDay):new Date(9999,9,9)),w=this._getMinMaxDate(n,"min"),v=this._getMinMaxDate(n,"max"),t=n.drawMonth-ai,r=n.drawYear;if(0>t&&(t+=12,r--),v)for(b=this._daylightSavingAdjust(new Date(v.getFullYear(),v.getMonth()-e[0]*e[1]+1,v.getDate())),b=w&&w>b?w:b;this._daylightSavingAdjust(new Date(r,t,1))>b;)t--,0>t&&(t=11,r--);for(n.drawMonth=t,n.drawYear=r,s=this._get(n,"prevText"),s=ni?this.formatDate(s,this._daylightSavingAdjust(new Date(r,t-ci,1)),this._getFormatConfig(n)):s,rt=this._canAdjustMonth(n,-1,r,t)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(f?"e":"w")+"'>"+s+"<\/span><\/a>":hi?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(f?"e":"w")+"'>"+s+"<\/span><\/a>",h=this._get(n,"nextText"),h=ni?this.formatDate(h,this._daylightSavingAdjust(new Date(r,t+ci,1)),this._getFormatConfig(n)):h,ut=this._canAdjustMonth(n,1,r,t)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+h+"'><span class='ui-icon ui-icon-circle-triangle-"+(f?"w":"e")+"'>"+h+"<\/span><\/a>":hi?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+h+"'><span class='ui-icon ui-icon-circle-triangle-"+(f?"w":"e")+"'>"+h+"<\/span><\/a>",k=this._get(n,"currentText"),ft=this._get(n,"gotoCurrent")&&n.currentDay?ii:gt,k=ni?this.formatDate(k,ft,this._getFormatConfig(n)):k,et=n.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(n,"closeText")+"<\/button>",ri=li?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(f?et:"")+(this._isInRange(n,ft)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+k+"<\/button>":"")+(f?"":et)+"<\/div>":"",c=parseInt(this._get(n,"firstDay"),10),c=isNaN(c)?0:c,ot=this._get(n,"showWeek"),ui=this._get(n,"dayNames"),fi=this._get(n,"dayNamesMin"),ei=this._get(n,"monthNames"),oi=this._get(n,"monthNamesShort"),st=this._get(n,"beforeShowDay"),g=this._get(n,"showOtherMonths"),si=this._get(n,"selectOtherMonths"),ht=this._getDefaultDate(n),nt="",y=0;e[0]>y;y++){for(ct="",this.maxRows=4,p=0;e[1]>p;p++){if(lt=this._daylightSavingAdjust(new Date(r,t,n.selectedDay)),l=" ui-corner-all",u="",ti){if(u+="<div class='ui-datepicker-group",e[1]>1)switch(p){case 0:u+=" ui-datepicker-group-first",l=" ui-corner-"+(f?"right":"left");break;case e[1]-1:u+=" ui-datepicker-group-last",l=" ui-corner-"+(f?"left":"right");break;default:u+=" ui-datepicker-group-middle",l=""}u+="'>"}for(u+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+l+"'>"+(/all|left/.test(l)&&0===y?f?ut:rt:"")+(/all|right/.test(l)&&0===y?f?rt:ut:"")+this._generateMonthYearHeader(n,t,r,w,v,y>0||p>0,ei,oi)+"<\/div><table class='ui-datepicker-calendar'><thead><tr>",at=ot?"<th class='ui-datepicker-week-col'>"+this._get(n,"weekHeader")+"<\/th>":"",o=0;7>o;o++)vt=(o+c)%7,at+="<th scope='col'"+((o+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+ui[vt]+"'>"+fi[vt]+"<\/span><\/th>";for(u+=at+"<\/tr><\/thead><tbody>",yt=this._getDaysInMonth(r,t),r===n.selectedYear&&t===n.selectedMonth&&(n.selectedDay=Math.min(n.selectedDay,yt)),pt=(this._getFirstDayOfMonth(r,t)-c+7)%7,tt=Math.ceil((pt+yt)/7),wt=ti?this.maxRows>tt?this.maxRows:tt:tt,this.maxRows=wt,i=this._daylightSavingAdjust(new Date(r,t,1-pt)),bt=0;wt>bt;bt++){for(u+="<tr>",kt=ot?"<td class='ui-datepicker-week-col'>"+this._get(n,"calculateWeek")(i)+"<\/td>":"",o=0;7>o;o++)d=st?st.apply(n.input?n.input[0]:null,[i]):[!0,""],a=i.getMonth()!==t,it=a&&!si||!d[0]||w&&w>i||v&&i>v,kt+="<td class='"+((o+c+6)%7>=5?" ui-datepicker-week-end":"")+(a?" ui-datepicker-other-month":"")+(i.getTime()===lt.getTime()&&t===n.selectedMonth&&n._keyEvent||ht.getTime()===i.getTime()&&ht.getTime()===lt.getTime()?" "+this._dayOverClass:"")+(it?" "+this._unselectableClass+" ui-state-disabled":"")+(a&&!g?"":" "+d[1]+(i.getTime()===ii.getTime()?" "+this._currentClass:"")+(i.getTime()===gt.getTime()?" ui-datepicker-today":""))+"'"+(a&&!g||!d[2]?"":" title='"+d[2].replace(/'/g,"&#39;")+"'")+(it?"":" data-handler='selectDay' data-event='click' data-month='"+i.getMonth()+"' data-year='"+i.getFullYear()+"'")+">"+(a&&!g?"&#xa0;":it?"<span class='ui-state-default'>"+i.getDate()+"<\/span>":"<a class='ui-state-default"+(i.getTime()===gt.getTime()?" ui-state-highlight":"")+(i.getTime()===ii.getTime()?" ui-state-active":"")+(a?" ui-priority-secondary":"")+"' href='#'>"+i.getDate()+"<\/a>")+"<\/td>",i.setDate(i.getDate()+1),i=this._daylightSavingAdjust(i);u+=kt+"<\/tr>"}t++,t>11&&(t=0,r++),u+="<\/tbody><\/table>"+(ti?"<\/div>"+(e[0]>0&&p===e[1]-1?"<div class='ui-datepicker-row-break'><\/div>":""):""),ct+=u}nt+=ct}return nt+ri,n._keyEvent=!1,nt},_generateMonthYearHeader:function(n,t,i,r,u,f,e,o){var k,d,h,v,y,p,s,a,w=this._get(n,"changeMonth"),b=this._get(n,"changeYear"),g=this._get(n,"showMonthAfterYear"),c="<div class='ui-datepicker-title'>",l="";if(f||!w)l+="<span class='ui-datepicker-month'>"+e[t]+"<\/span>";else{for(k=r&&r.getFullYear()===i,d=u&&u.getFullYear()===i,l+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!k||h>=r.getMonth())&&(!d||u.getMonth()>=h)&&(l+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"<\/option>");l+="<\/select>"}if(g||(c+=l+(!f&&w&&b?"":"&#xa0;")),!n.yearshtml)if(n.yearshtml="",f||!b)c+="<span class='ui-datepicker-year'>"+i+"<\/span>";else{for(v=this._get(n,"yearRange").split(":"),y=(new Date).getFullYear(),p=function(n){var t=n.match(/c[+\-].*/)?i+parseInt(n.substring(1),10):n.match(/[+\-].*/)?y+parseInt(n,10):parseInt(n,10);return isNaN(t)?y:t},s=p(v[0]),a=Math.max(s,p(v[1]||"")),s=r?Math.max(s,r.getFullYear()):s,a=u?Math.min(a,u.getFullYear()):a,n.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";a>=s;s++)n.yearshtml+="<option value='"+s+"'"+(s===i?" selected='selected'":"")+">"+s+"<\/option>";n.yearshtml+="<\/select>",c+=n.yearshtml,n.yearshtml=null}return c+this._get(n,"yearSuffix"),g&&(c+=(!f&&w&&b?"":"&#xa0;")+l),c+="<\/div>"},_adjustInstDate:function(n,t,i){var u=n.selectedYear+("Y"===i?t:0),f=n.selectedMonth+("M"===i?t:0),e=Math.min(n.selectedDay,this._getDaysInMonth(u,f))+("D"===i?t:0),r=this._restrictMinMax(n,this._daylightSavingAdjust(new Date(u,f,e)));n.selectedDay=r.getDate(),n.drawMonth=n.selectedMonth=r.getMonth(),n.drawYear=n.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(n)},_restrictMinMax:function(n,t){var i=this._getMinMaxDate(n,"min"),r=this._getMinMaxDate(n,"max"),u=i&&i>t?i:t;return r&&u>r?r:u},_notifyChange:function(n){var t=this._get(n,"onChangeMonthYear");t&&t.apply(n.input?n.input[0]:null,[n.selectedYear,n.selectedMonth+1,n])},_getNumberOfMonths:function(n){var t=this._get(n,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(n,t){return this._determineDate(n,this._get(n,t+"Date"),null)},_getDaysInMonth:function(n,t){return 32-this._daylightSavingAdjust(new Date(n,t,32)).getDate()},_getFirstDayOfMonth:function(n,t){return new Date(n,t,1).getDay()},_canAdjustMonth:function(n,t,i,r){var f=this._getNumberOfMonths(n),u=this._daylightSavingAdjust(new Date(i,r+(0>t?t:f[0]*f[1]),1));return 0>t&&u.setDate(this._getDaysInMonth(u.getFullYear(),u.getMonth())),this._isInRange(n,u)},_isInRange:function(n,t){var i,f,e=this._getMinMaxDate(n,"min"),o=this._getMinMaxDate(n,"max"),r=null,u=null,s=this._get(n,"yearRange");return s&&(i=s.split(":"),f=(new Date).getFullYear(),r=parseInt(i[0],10),u=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=f),i[1].match(/[+\-].*/)&&(u+=f)),(!e||t.getTime()>=e.getTime())&&(!o||t.getTime()<=o.getTime())&&(!r||t.getFullYear()>=r)&&(!u||u>=t.getFullYear())},_getFormatConfig:function(n){var t=this._get(n,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(n,"dayNamesShort"),dayNames:this._get(n,"dayNames"),monthNamesShort:this._get(n,"monthNamesShort"),monthNames:this._get(n,"monthNames")}},_formatDate:function(n,t,i,r){t||(n.currentDay=n.selectedDay,n.currentMonth=n.selectedMonth,n.currentYear=n.selectedYear);var u=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(r,i,t)):this._daylightSavingAdjust(new Date(n.currentYear,n.currentMonth,n.currentDay));return this.formatDate(this._get(n,"dateFormat"),u,this._getFormatConfig(n))}}),n.fn.datepicker=function(t){if(!this.length)return this;n.datepicker.initialized||(n(document).on("mousedown",n.datepicker._checkExternalClick),n.datepicker.initialized=!0),0===n("#"+n.datepicker._mainDivId).length&&n("body").append(n.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this].concat(i)):n.datepicker._attachDatepicker(this,t)}):n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this[0]].concat(i))},n.datepicker=new c,n.datepicker.initialized=!1,n.datepicker.uuid=(new Date).getTime(),n.datepicker.version="1.12.1",n.datepicker,n.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),r=!1,n(document).on("mouseup",function(){r=!1}),n.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,function(n){return t._mouseDown(n)}).on("click."+this.widgetName,function(i){if(!0===n.data(i.target,t.widgetName+".preventClickEvent"))return(n.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1)}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!r){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,u=1===t.which,f="string"==typeof this.options.cancel&&t.target.nodeName?n(t.target).closest(this.options.cancel).length:!1;return u&&!f&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===n.data(t.target,this.widgetName+".preventClickEvent")&&n.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(n){return i._mouseMove(n)},this._mouseUpDelegate=function(n){return i._mouseUp(n)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),r=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(n.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&n.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,r=!1,t.preventDefault()},_mouseDistanceMet:function(n){return Math.max(Math.abs(this._mouseDownEvent.pageX-n.pageX),Math.abs(this._mouseDownEvent.pageY-n.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),n.ui.plugin={add:function(t,i,r){var u,f=n.ui[t].prototype;for(u in r)f.plugins[u]=f.plugins[u]||[],f.plugins[u].push([i,r[u]])},call:function(n,t,i,r){var u,f=n.plugins[t];if(f&&(r||n.element[0].parentNode&&11!==n.element[0].parentNode.nodeType))for(u=0;f.length>u;u++)n.options[f[u][0]]&&f[u][1].apply(n.element,i)}},n.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&n(t).trigger("blur")},n.widget("ui.draggable",n.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(n,t){this._super(n,t),"handle"===n&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||n(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blurActiveElement(t),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=n(this);return n("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=n.ui.safeActiveElement(this.document[0]),r=n(t.target);r.closest(i).length||n.ui.safeBlur(i)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),n.ui.ddmanager&&(n.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===n(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),n.ui.ddmanager&&!i.dropBehaviour&&n.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),n.ui.ddmanager&&n.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(n){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:n.pageX-this.offset.left,top:n.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp(new n.Event("mouseup",t)),!1;this.position=r.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",n.ui.ddmanager&&n.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var r=this,i=!1;return n.ui.ddmanager&&!this.options.dropBehaviour&&(i=n.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||this.options.revert===!0||n.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?n(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){r._trigger("stop",t)!==!1&&r._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),n.ui.ddmanager&&n.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),n.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new n.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return this.options.handle?!!n(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var r=this.options,u=n.isFunction(r.helper),i=u?n(r.helper.apply(this.element[0],[t])):"clone"===r.helper?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo("parent"===r.appendTo?this.element[0].parentNode:r.appendTo),u&&i[0]===this.element[0]&&this._setPositionRelative(),i[0]===this.element[0]||/(fixed|absolute)/.test(i.css("position"))||i.css("position","absolute"),i},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),n.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(n){return/(html|body)/i.test(n.tagName)||n===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&n.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var n=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:n.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:n.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var f,t,i,r=this.options,u=this.document[0];return this.relativeContainer=null,r.containment?"window"===r.containment?(this.containment=[n(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,n(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,n(window).scrollLeft()+n(window).width()-this.helperProportions.width-this.margins.left,n(window).scrollTop()+(n(window).height()||u.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===r.containment?(this.containment=[0,0,n(u).width()-this.helperProportions.width-this.margins.left,(n(u).height()||u.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):r.containment.constructor===Array?(this.containment=r.containment,void 0):("parent"===r.containment&&(r.containment=this.helper[0].parentNode),t=n(r.containment),i=t[0],i&&(f=/(scroll|auto)/.test(t.css("overflow")),this.containment=[(parseInt(t.css("borderLeftWidth"),10)||0)+(parseInt(t.css("paddingLeft"),10)||0),(parseInt(t.css("borderTopWidth"),10)||0)+(parseInt(t.css("paddingTop"),10)||0),(f?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t.css("borderRightWidth"),10)||0)-(parseInt(t.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t.css("borderBottomWidth"),10)||0)-(parseInt(t.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=t),void 0):(this.containment=null,void 0)},_convertPositionTo:function(n,t){t||(t=this.position);var i="absolute"===n?1:-1,r=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)*i}},_generatePosition:function(n,t){var i,s,u,f,r=this.options,h=this._isRootNode(this.scrollParent[0]),e=n.pageX,o=n.pageY;return h&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,n.pageX-this.offset.click.left<i[0]&&(e=i[0]+this.offset.click.left),n.pageY-this.offset.click.top<i[1]&&(o=i[1]+this.offset.click.top),n.pageX-this.offset.click.left>i[2]&&(e=i[2]+this.offset.click.left),n.pageY-this.offset.click.top>i[3]&&(o=i[3]+this.offset.click.top)),r.grid&&(u=r.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,o=i?u-this.offset.click.top>=i[1]||u-this.offset.click.top>i[3]?u:u-this.offset.click.top>=i[1]?u-r.grid[1]:u+r.grid[1]:u,f=r.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,e=i?f-this.offset.click.left>=i[0]||f-this.offset.click.left>i[2]?f:f-this.offset.click.left>=i[0]?f-r.grid[0]:f+r.grid[0]:f),"y"===r.axis&&(e=this.originalPageX),"x"===r.axis&&(o=this.originalPageY)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:h?0:this.offset.scroll.top),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:h?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,i,r){return r=r||this._uiHash(),n.ui.plugin.call(this,t,[i,r,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),r.offset=this.positionAbs),n.Widget.prototype._trigger.call(this,t,i,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),n.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,r){var u=n.extend({},i,{item:r.element});r.sortables=[],n(r.options.connectToSortable).each(function(){var i=n(this).sortable("instance");i&&!i.options.disabled&&(r.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,u))})},stop:function(t,i,r){var u=n.extend({},i,{item:r.element});r.cancelHelperRemoval=!1,n.each(r.sortables,function(){var n=this;n.isOver?(n.isOver=0,r.cancelHelperRemoval=!0,n.cancelHelperRemoval=!1,n._storedCSS={position:n.placeholder.css("position"),top:n.placeholder.css("top"),left:n.placeholder.css("left")},n._mouseStop(t),n.options.helper=n.options._helper):(n.cancelHelperRemoval=!0,n._trigger("deactivate",t,u))})},drag:function(t,i,r){n.each(r.sortables,function(){var f=!1,u=this;u.positionAbs=r.positionAbs,u.helperProportions=r.helperProportions,u.offset.click=r.offset.click,u._intersectsWith(u.containerCache)&&(f=!0,n.each(r.sortables,function(){return this.positionAbs=r.positionAbs,this.helperProportions=r.helperProportions,this.offset.click=r.offset.click,this!==u&&this._intersectsWith(this.containerCache)&&n.contains(u.element[0],this.element[0])&&(f=!1),f})),f?(u.isOver||(u.isOver=1,r._parent=i.helper.parent(),u.currentItem=i.helper.appendTo(u.element).data("ui-sortable-item",!0),u.options._helper=u.options.helper,u.options.helper=function(){return i.helper[0]},t.target=u.currentItem[0],u._mouseCapture(t,!0),u._mouseStart(t,!0,!0),u.offset.click.top=r.offset.click.top,u.offset.click.left=r.offset.click.left,u.offset.parent.left-=r.offset.parent.left-u.offset.parent.left,u.offset.parent.top-=r.offset.parent.top-u.offset.parent.top,r._trigger("toSortable",t),r.dropped=u.element,n.each(r.sortables,function(){this.refreshPositions()}),r.currentItem=r.element,u.fromOutside=r),u.currentItem&&(u._mouseDrag(t),i.position=u.position)):u.isOver&&(u.isOver=0,u.cancelHelperRemoval=!0,u.options._revert=u.options.revert,u.options.revert=!1,u._trigger("out",t,u._uiHash(u)),u._mouseStop(t,!0),u.options.revert=u.options._revert,u.options.helper=u.options._helper,u.placeholder&&u.placeholder.remove(),i.helper.appendTo(r._parent),r._refreshOffsets(t),i.position=r._generatePosition(t,!0),r._trigger("fromSortable",t),r.dropped=!1,n.each(r.sortables,function(){this.refreshPositions()}))})}}),n.ui.plugin.add("draggable","cursor",{start:function(t,i,r){var u=n("body"),f=r.options;u.css("cursor")&&(f._cursor=u.css("cursor")),u.css("cursor",f.cursor)},stop:function(t,i,r){var u=r.options;u._cursor&&n("body").css("cursor",u._cursor)}}),n.ui.plugin.add("draggable","opacity",{start:function(t,i,r){var u=n(i.helper),f=r.options;u.css("opacity")&&(f._opacity=u.css("opacity")),u.css("opacity",f.opacity)},stop:function(t,i,r){var u=r.options;u._opacity&&n(i.helper).css("opacity",u._opacity)}}),n.ui.plugin.add("draggable","scroll",{start:function(n,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,r){var u=r.options,o=!1,e=r.scrollParentNotHidden[0],f=r.document[0];e!==f&&"HTML"!==e.tagName?(u.axis&&"x"===u.axis||(r.overflowOffset.top+e.offsetHeight-t.pageY<u.scrollSensitivity?e.scrollTop=o=e.scrollTop+u.scrollSpeed:t.pageY-r.overflowOffset.top<u.scrollSensitivity&&(e.scrollTop=o=e.scrollTop-u.scrollSpeed)),u.axis&&"y"===u.axis||(r.overflowOffset.left+e.offsetWidth-t.pageX<u.scrollSensitivity?e.scrollLeft=o=e.scrollLeft+u.scrollSpeed:t.pageX-r.overflowOffset.left<u.scrollSensitivity&&(e.scrollLeft=o=e.scrollLeft-u.scrollSpeed))):(u.axis&&"x"===u.axis||(t.pageY-n(f).scrollTop()<u.scrollSensitivity?o=n(f).scrollTop(n(f).scrollTop()-u.scrollSpeed):n(window).height()-(t.pageY-n(f).scrollTop())<u.scrollSensitivity&&(o=n(f).scrollTop(n(f).scrollTop()+u.scrollSpeed))),u.axis&&"y"===u.axis||(t.pageX-n(f).scrollLeft()<u.scrollSensitivity?o=n(f).scrollLeft(n(f).scrollLeft()-u.scrollSpeed):n(window).width()-(t.pageX-n(f).scrollLeft())<u.scrollSensitivity&&(o=n(f).scrollLeft(n(f).scrollLeft()+u.scrollSpeed)))),o!==!1&&n.ui.ddmanager&&!u.dropBehaviour&&n.ui.ddmanager.prepareOffsets(r,t)}}),n.ui.plugin.add("draggable","snap",{start:function(t,i,r){var u=r.options;r.snapElements=[],n(u.snap.constructor!==String?u.snap.items||":data(ui-draggable)":u.snap).each(function(){var t=n(this),i=t.offset();this!==r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,r){for(var e,o,s,h,c,a,l,v,w,b=r.options,f=b.snapTolerance,y=i.offset.left,k=y+r.helperProportions.width,p=i.offset.top,d=p+r.helperProportions.height,u=r.snapElements.length-1;u>=0;u--)c=r.snapElements[u].left-r.margins.left,a=c+r.snapElements[u].width,l=r.snapElements[u].top-r.margins.top,v=l+r.snapElements[u].height,c-f>k||y>a+f||l-f>d||p>v+f||!n.contains(r.snapElements[u].item.ownerDocument,r.snapElements[u].item)?(r.snapElements[u].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,n.extend(r._uiHash(),{snapItem:r.snapElements[u].item})),r.snapElements[u].snapping=!1):("inner"!==b.snapMode&&(e=f>=Math.abs(l-d),o=f>=Math.abs(v-p),s=f>=Math.abs(c-k),h=f>=Math.abs(a-y),e&&(i.position.top=r._convertPositionTo("relative",{top:l-r.helperProportions.height,left:0}).top),o&&(i.position.top=r._convertPositionTo("relative",{top:v,left:0}).top),s&&(i.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left),h&&(i.position.left=r._convertPositionTo("relative",{top:0,left:a}).left)),w=e||o||s||h,"outer"!==b.snapMode&&(e=f>=Math.abs(l-p),o=f>=Math.abs(v-d),s=f>=Math.abs(c-y),h=f>=Math.abs(a-k),e&&(i.position.top=r._convertPositionTo("relative",{top:l,left:0}).top),o&&(i.position.top=r._convertPositionTo("relative",{top:v-r.helperProportions.height,left:0}).top),s&&(i.position.left=r._convertPositionTo("relative",{top:0,left:c}).left),h&&(i.position.left=r._convertPositionTo("relative",{top:0,left:a-r.helperProportions.width}).left)),!r.snapElements[u].snapping&&(e||o||s||h||w)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,n.extend(r._uiHash(),{snapItem:r.snapElements[u].item})),r.snapElements[u].snapping=e||o||s||h||w)}}),n.ui.plugin.add("draggable","stack",{start:function(t,i,r){var f,e=r.options,u=n.makeArray(n(e.stack)).sort(function(t,i){return(parseInt(n(t).css("zIndex"),10)||0)-(parseInt(n(i).css("zIndex"),10)||0)});u.length&&(f=parseInt(n(u[0]).css("zIndex"),10)||0,n(u).each(function(t){n(this).css("zIndex",f+t)}),this.css("zIndex",f+u.length))}}),n.ui.plugin.add("draggable","zIndex",{start:function(t,i,r){var u=n(i.helper),f=r.options;u.css("zIndex")&&(f._zIndex=u.css("zIndex")),u.css("zIndex",f.zIndex)},stop:function(t,i,r){var u=r.options;u._zIndex&&n(i.helper).css("zIndex",u._zIndex)}}),n.ui.draggable,n.widget("ui.resizable",n.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(n){return parseFloat(n)||0},_isNumber:function(n){return!isNaN(parseFloat(n))},_hasScroll:function(t,i){if("hidden"===n(t).css("overflow"))return!1;var r=i&&"left"===i?"scrollLeft":"scrollTop",u=!1;return t[r]>0?!0:(t[r]=1,u=t[r]>0,t[r]=0,u)},_create:function(){var r,t=this.options,i=this;this._addClass("ui-resizable"),n.extend(this,{_aspectRatio:!!t.aspectRatio,aspectRatio:t.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:t.helper||t.ghost||t.animate?t.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(n("<div class='ui-wrapper' style='overflow: hidden;'><\/div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,r={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(r),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(r),this._proportionallyResize()),this._setupHandles(),t.autoHide&&n(this.element).on("mouseenter",function(){t.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){t.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){n(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(n,t){switch(this._super(n,t),n){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var i,r,u,o,t,f=this.options,e=this;if(this.handles=f.handles||(n(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=n(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),u=this.handles.split(","),this.handles={},r=0;u.length>r;r++)i=n.trim(u[r]),o="ui-resizable-"+i,t=n("<div>"),this._addClass(t,"ui-resizable-handle "+o),t.css({zIndex:f.zIndex}),this.handles[i]=".ui-resizable-"+i,this.element.append(t);this._renderAxis=function(t){var i,r,u,f;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=n(this.handles[i]),this._on(this.handles[i],{mousedown:e._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(r=n(this.handles[i],this.element),f=/sw|ne|nw|se|n|s/.test(i)?r.outerHeight():r.outerWidth(),u=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(u,f),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){e.resizing||(this.className&&(t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),e.axis=t&&t[1]?t[1]:"se")}),f.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var r,i,u=!1;for(r in this.handles)i=n(this.handles[r])[0],(i===t.target||n.contains(i,t.target))&&(u=!0);return!this.options.disabled&&u},_mouseStart:function(t){var u,f,e,r=this.options,i=this.element;return this.resizing=!0,this._renderProxy(),u=this._num(this.helper.css("left")),f=this._num(this.helper.css("top")),r.containment&&(u+=n(r.containment).scrollLeft()||0,f+=n(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:u,top:f},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:i.width(),height:i.height()},this.originalSize=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()},this.sizeDiff={width:i.outerWidth()-i.width(),height:i.outerHeight()-i.height()},this.originalPosition={left:u,top:f},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,e=n(".ui-resizable-"+this.axis).css("cursor"),n("body").css("cursor","auto"===e?this.axis+"-resize":e),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,r,u=this.originalMousePosition,e=this.axis,o=t.pageX-u.left||0,s=t.pageY-u.top||0,f=this._change[e];return this._updatePrevProperties(),f?(i=f.apply(this,[t,o,s]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),r=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),n.isEmptyObject(r)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var r,u,f,e,o,s,h,c=this.options,i=this;return this._helper&&(r=this._proportionallyResizeElements,u=r.length&&/textarea/i.test(r[0].nodeName),f=u&&this._hasScroll(r[0],"left")?0:i.sizeDiff.height,e=u?0:i.sizeDiff.width,o={width:i.helper.width()-e,height:i.helper.height()-f},s=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,h=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null,c.animate||this.element.css(n.extend(o,{top:h,left:s})),i.helper.height(i.size.height),i.helper.width(i.size.width),this._helper&&!c.animate&&this._proportionallyResize()),n("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var n={};return this.position.top!==this.prevPosition.top&&(n.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(n.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(n.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(n.height=this.size.height+"px"),this.helper.css(n),n},_updateVirtualBoundaries:function(n){var r,u,f,e,t,i=this.options;t={minWidth:this._isNumber(i.minWidth)?i.minWidth:0,maxWidth:this._isNumber(i.maxWidth)?i.maxWidth:1/0,minHeight:this._isNumber(i.minHeight)?i.minHeight:0,maxHeight:this._isNumber(i.maxHeight)?i.maxHeight:1/0},(this._aspectRatio||n)&&(r=t.minHeight*this.aspectRatio,f=t.minWidth/this.aspectRatio,u=t.maxHeight*this.aspectRatio,e=t.maxWidth/this.aspectRatio,r>t.minWidth&&(t.minWidth=r),f>t.minHeight&&(t.minHeight=f),t.maxWidth>u&&(t.maxWidth=u),t.maxHeight>e&&(t.maxHeight=e)),this._vBoundaries=t},_updateCache:function(n){this.offset=this.helper.offset(),this._isNumber(n.left)&&(this.position.left=n.left),this._isNumber(n.top)&&(this.position.top=n.top),this._isNumber(n.height)&&(this.size.height=n.height),this._isNumber(n.width)&&(this.size.width=n.width)},_updateRatio:function(n){var t=this.position,i=this.size,r=this.axis;return this._isNumber(n.height)?n.width=n.height*this.aspectRatio:this._isNumber(n.width)&&(n.height=n.width/this.aspectRatio),"sw"===r&&(n.left=t.left+(i.width-n.width),n.top=null),"nw"===r&&(n.top=t.top+(i.height-n.height),n.left=t.left+(i.width-n.width)),n},_respectSize:function(n){var t=this._vBoundaries,i=this.axis,r=this._isNumber(n.width)&&t.maxWidth&&t.maxWidth<n.width,u=this._isNumber(n.height)&&t.maxHeight&&t.maxHeight<n.height,f=this._isNumber(n.width)&&t.minWidth&&t.minWidth>n.width,e=this._isNumber(n.height)&&t.minHeight&&t.minHeight>n.height,o=this.originalPosition.left+this.originalSize.width,s=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return f&&(n.width=t.minWidth),e&&(n.height=t.minHeight),r&&(n.width=t.maxWidth),u&&(n.height=t.maxHeight),f&&h&&(n.left=o-t.minWidth),r&&h&&(n.left=o-t.maxWidth),e&&c&&(n.top=s-t.minHeight),u&&c&&(n.top=s-t.maxHeight),n.width||n.height||n.left||!n.top?n.width||n.height||n.top||!n.left||(n.left=null):n.top=null,n},_getPaddingPlusBorderDimensions:function(n){for(var t=0,i=[],r=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],u=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")];4>t;t++)i[t]=parseFloat(r[t])||0,i[t]+=parseFloat(u[t])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var n,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)n=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(n)),n.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||n("<div style='overflow:hidden;'><\/div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(n,t){return{width:this.originalSize.width+t}},w:function(n,t){var i=this.originalSize,r=this.originalPosition;return{left:r.left+t,width:i.width-t}},n:function(n,t,i){var r=this.originalSize,u=this.originalPosition;return{top:u.top+i,height:r.height-i}},s:function(n,t,i){return{height:this.originalSize.height+i}},se:function(t,i,r){return n.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,r]))},sw:function(t,i,r){return n.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,r]))},ne:function(t,i,r){return n.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,r]))},nw:function(t,i,r){return n.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,r]))}},_propagate:function(t,i){n.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),n.ui.plugin.add("resizable","animate",{stop:function(t){var i=n(this).resizable("instance"),u=i.options,r=i._proportionallyResizeElements,f=r.length&&/textarea/i.test(r[0].nodeName),s=f&&i._hasScroll(r[0],"left")?0:i.sizeDiff.height,h=f?0:i.sizeDiff.width,c={width:i.size.width-h,height:i.size.height-s},e=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(n.extend(c,o&&e?{top:o,left:e}:{}),{duration:u.animateDuration,easing:u.animateEasing,step:function(){var u={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};r&&r.length&&n(r[0]).css({width:u.width,height:u.height}),i._updateCache(u),i._propagate("resize",t)}})}}),n.ui.plugin.add("resizable","containment",{start:function(){var r,f,e,o,s,h,c,t=n(this).resizable("instance"),l=t.options,a=t.element,u=l.containment,i=u instanceof n?u.get(0):/parent/.test(u)?a.parent().get(0):u;i&&(t.containerElement=n(i),/document/.test(u)||u===document?(t.containerOffset={left:0,top:0},t.containerPosition={left:0,top:0},t.parentData={element:n(document),left:0,top:0,width:n(document).width(),height:n(document).height()||document.body.parentNode.scrollHeight}):(r=n(i),f=[],n(["Top","Right","Left","Bottom"]).each(function(n,i){f[n]=t._num(r.css("padding"+i))}),t.containerOffset=r.offset(),t.containerPosition=r.position(),t.containerSize={height:r.innerHeight()-f[3],width:r.innerWidth()-f[1]},e=t.containerOffset,o=t.containerSize.height,s=t.containerSize.width,h=t._hasScroll(i,"left")?i.scrollWidth:s,c=t._hasScroll(i)?i.scrollHeight:o,t.parentData={element:i,left:e.left,top:e.top,width:h,height:c}))},resize:function(t){var o,s,h,c,i=n(this).resizable("instance"),v=i.options,r=i.containerOffset,l=i.position,f=i._aspectRatio||t.shiftKey,e={top:0,left:0},a=i.containerElement,u=!0;a[0]!==document&&/static/.test(a.css("position"))&&(e=r),l.left<(i._helper?r.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-r.left:i.position.left-e.left),f&&(i.size.height=i.size.width/i.aspectRatio,u=!1),i.position.left=v.helper?r.left:0),l.top<(i._helper?r.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-r.top:i.position.top),f&&(i.size.width=i.size.height*i.aspectRatio,u=!1),i.position.top=i._helper?r.top:0),h=i.containerElement.get(0)===i.element.parent().get(0),c=/relative|absolute/.test(i.containerElement.css("position")),h&&c?(i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top):(i.offset.left=i.element.offset().left,i.offset.top=i.element.offset().top),o=Math.abs(i.sizeDiff.width+(i._helper?i.offset.left-e.left:i.offset.left-r.left)),s=Math.abs(i.sizeDiff.height+(i._helper?i.offset.top-e.top:i.offset.top-r.top)),o+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-o,f&&(i.size.height=i.size.width/i.aspectRatio,u=!1)),s+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-s,f&&(i.size.width=i.size.height*i.aspectRatio,u=!1)),u||(i.position.left=i.prevPosition.left,i.position.top=i.prevPosition.top,i.size.width=i.prevSize.width,i.size.height=i.prevSize.height)},stop:function(){var t=n(this).resizable("instance"),r=t.options,u=t.containerOffset,f=t.containerPosition,e=t.containerElement,i=n(t.helper),o=i.offset(),s=i.outerWidth()-t.sizeDiff.width,h=i.outerHeight()-t.sizeDiff.height;t._helper&&!r.animate&&/relative/.test(e.css("position"))&&n(this).css({left:o.left-f.left-u.left,width:s,height:h}),t._helper&&!r.animate&&/static/.test(e.css("position"))&&n(this).css({left:o.left-f.left-u.left,width:s,height:h})}}),n.ui.plugin.add("resizable","alsoResize",{start:function(){var t=n(this).resizable("instance"),i=t.options;n(i.alsoResize).each(function(){var t=n(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var r=n(this).resizable("instance"),e=r.options,u=r.originalSize,f=r.originalPosition,o={height:r.size.height-u.height||0,width:r.size.width-u.width||0,top:r.position.top-f.top||0,left:r.position.left-f.left||0};n(e.alsoResize).each(function(){var t=n(this),u=n(this).data("ui-resizable-alsoresize"),r={},f=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];n.each(f,function(n,t){var i=(u[t]||0)+(o[t]||0);i&&i>=0&&(r[t]=i||null)}),t.css(r)})},stop:function(){n(this).removeData("ui-resizable-alsoresize")}}),n.ui.plugin.add("resizable","ghost",{start:function(){var t=n(this).resizable("instance"),i=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),n.uiBackCompat!==!1&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=n(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=n(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),n.ui.plugin.add("resizable","grid",{resize:function(){var h,t=n(this).resizable("instance"),i=t.options,y=t.size,o=t.originalSize,s=t.originalPosition,c=t.axis,l="number"==typeof i.grid?[i.grid,i.grid]:i.grid,f=l[0]||1,e=l[1]||1,a=Math.round((y.width-o.width)/f)*f,v=Math.round((y.height-o.height)/e)*e,r=o.width+a,u=o.height+v,p=i.maxWidth&&r>i.maxWidth,w=i.maxHeight&&u>i.maxHeight,b=i.minWidth&&i.minWidth>r,k=i.minHeight&&i.minHeight>u;i.grid=l,b&&(r+=f),k&&(u+=e),p&&(r-=f),w&&(u-=e),/^(se|s|e)$/.test(c)?(t.size.width=r,t.size.height=u):/^(ne)$/.test(c)?(t.size.width=r,t.size.height=u,t.position.top=s.top-v):/^(sw)$/.test(c)?(t.size.width=r,t.size.height=u,t.position.left=s.left-a):((0>=u-e||0>=r-f)&&(h=t._getPaddingPlusBorderDimensions(this)),u-e>0?(t.size.height=u,t.position.top=s.top-v):(u=e-h.height,t.size.height=u,t.position.top=s.top+o.height-u),r-f>0?(t.size.width=r,t.position.left=s.left-a):(r=f-h.width,t.size.width=r,t.position.left=s.left+o.width-r))}}),n.ui.resizable,n.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=n(this).css(t).offset().top;0>i&&n(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&n.fn.draggable&&this._makeDraggable(),this.options.resizable&&n.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?n(t):this.document.find(t||"body").eq(0)},_destroy:function(){var n,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),n=t.parent.children().eq(t.index),n.length&&n[0]!==this.element[0]?n.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:n.noop,enable:n.noop,close:function(t){var i=this;this._isOpen&&this._trigger("beforeClose",t)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||n.ui.safeBlur(n.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var r=!1,f=this.uiDialog.siblings(".ui-front:visible").map(function(){return+n(this).css("z-index")}).get(),u=Math.max.apply(null,f);return u>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",u+1),r=!0),r&&!i&&this._trigger("focus",t),r},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=n(n.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var n=this._focusedElement;n||(n=this.element.find("[autofocus]")),n.length||(n=this.element.find(":tabbable")),n.length||(n=this.uiDialogButtonPane.find(":tabbable")),n.length||(n=this.uiDialogTitlebarClose.filter(":tabbable")),n.length||(n=this.uiDialog),n.eq(0).trigger("focus")},_keepFocus:function(t){function i(){var t=n.ui.safeActiveElement(this.document[0]),i=this.uiDialog[0]===t||n.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=n("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===n.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===n.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),r=i.filter(":first"),u=i.filter(":last");t.target!==u[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==r[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){u.trigger("focus")}),t.preventDefault()):(this._delay(function(){r.trigger("focus")}),t.preventDefault())}},mousedown:function(n){this._moveToTop(n)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=n("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){n(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=n("<button type='button'><\/button>").button({label:n("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(n){n.preventDefault(),this.close(n)}}),t=n("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(n){this.options.title?n.text(this.options.title):n.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=n("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=n("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var i=this,t=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),n.isEmptyObject(t)||n.isArray(t)&&!t.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(n.each(t,function(t,r){var u,f;r=n.isFunction(r)?{click:r,text:t}:r,r=n.extend({type:"button"},r),u=r.click,f={icon:r.icon,iconPosition:r.iconPosition,showLabel:r.showLabel,icons:r.icons,text:r.text},delete r.click,delete r.icon,delete r.iconPosition,delete r.showLabel,delete r.icons,"boolean"==typeof r.text&&delete r.text,n("<button><\/button>",r).button(f).appendTo(i.uiButtonSet).on("click",function(){u.apply(i.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function i(n){return{position:n.position,offset:n.offset}}var t=this,r=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(r,u){t._addClass(n(this),"ui-dialog-dragging"),t._blockFrames(),t._trigger("dragStart",r,i(u))},drag:function(n,r){t._trigger("drag",n,i(r))},stop:function(u,f){var e=f.offset.left-t.document.scrollLeft(),o=f.offset.top-t.document.scrollTop();r.position={my:"left top",at:"left"+(e>=0?"+":"")+e+" top"+(o>=0?"+":"")+o,of:t.window},t._removeClass(n(this),"ui-dialog-dragging"),t._unblockFrames(),t._trigger("dragStop",u,i(f))}})},_makeResizable:function(){function r(n){return{originalPosition:n.originalPosition,originalSize:n.originalSize,position:n.position,size:n.size}}var t=this,i=this.options,u=i.resizable,f=this.uiDialog.css("position"),e="string"==typeof u?u:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:e,start:function(i,u){t._addClass(n(this),"ui-dialog-resizing"),t._blockFrames(),t._trigger("resizeStart",i,r(u))},resize:function(n,i){t._trigger("resize",n,r(i))},stop:function(u,f){var e=t.uiDialog.offset(),o=e.left-t.document.scrollLeft(),s=e.top-t.document.scrollTop();i.height=t.uiDialog.height(),i.width=t.uiDialog.width(),i.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" top"+(s>=0?"+":"")+s,of:t.window},t._removeClass(n(this),"ui-dialog-resizing"),t._unblockFrames(),t._trigger("resizeStop",u,r(f))}}).css("position",f)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=n(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=n.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var n=this.document.data("ui-dialog-instances");return n||(n=[],this.document.data("ui-dialog-instances",n)),n},_minHeight:function(){var n=this.options;return"auto"===n.height?n.minHeight:Math.min(n.minHeight,n.height)},_position:function(){var n=this.uiDialog.is(":visible");n||this.uiDialog.show(),this.uiDialog.position(this.options.position),n||this.uiDialog.hide()},_setOptions:function(t){var i=this,r=!1,u={};n.each(t,function(n,t){i._setOption(n,t),n in i.sizeRelatedOptions&&(r=!0),n in i.resizableRelatedOptions&&(u[n]=t)}),r&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",u)},_setOption:function(t,i){var f,u,r=this.uiDialog;"disabled"!==t&&(this._super(t,i),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:n("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&(f=r.is(":data(ui-draggable)"),f&&!i&&r.draggable("destroy"),!f&&i&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(u=r.is(":data(ui-resizable)"),u&&!i&&r.resizable("destroy"),u&&"string"==typeof i&&r.resizable("option","handles",i),u||i===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,i,r,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),t=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),i=Math.max(0,n.minHeight-t),r="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-t):"none","auto"===n.height?this.element.css({minHeight:i,maxHeight:r,height:"auto"}):this.element.height(Math.max(0,n.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=n(this);return n("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return n(t.target).closest(".ui-dialog").length?!0:!!n(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(n){t||this._allowInteraction(n)||(n.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=n("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var n=this.document.data("ui-dialog-overlays")-1;n?this.document.data("ui-dialog-overlays",n):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),n.uiBackCompat!==!1&&n.widget("ui.dialog",n.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(n,t){"dialogClass"===n&&this.uiDialog.removeClass(this.options.dialogClass).addClass(t),this._superApply(arguments)}}),n.ui.dialog,n.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,r=i.accept;this.isover=!1,this.isout=!0,this.accept=n.isFunction(r)?r:function(n){return n.is(r)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){n.ui.ddmanager.droppables[t]=n.ui.ddmanager.droppables[t]||[],n.ui.ddmanager.droppables[t].push(this)},_splice:function(n){for(var t=0;n.length>t;t++)n[t]===this&&n.splice(t,1)},_destroy:function(){var t=n.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,i){if("accept"===t)this.accept=n.isFunction(i)?i:function(n){return n.is(i)};else if("scope"===t){var r=n.ui.ddmanager.droppables[this.options.scope];this._splice(r),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=n.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=n.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=n.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=n.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var r=i||n.ui.ddmanager.current,u=!1;return r&&(r.currentItem||r.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=n(this).droppable("instance");if(i.options.greedy&&!i.options.disabled&&i.options.scope===r.options.scope&&i.accept.call(i.element[0],r.currentItem||r.element)&&e(r,n.extend(i,{offset:i.element.offset()}),i.options.tolerance,t))return(u=!0,!1)}),u?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",t,this.ui(r)),this.element):!1):!1},ui:function(n){return{draggable:n.currentItem||n.element,helper:n.helper,position:n.position,offset:n.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),e=n.ui.intersect=function(){function n(n,t,i){return n>=t&&t+i>n}return function(t,i,r,u){if(!i.offset)return!1;var o=(t.positionAbs||t.position.absolute).left+t.margins.left,s=(t.positionAbs||t.position.absolute).top+t.margins.top,h=o+t.helperProportions.width,c=s+t.helperProportions.height,f=i.offset.left,e=i.offset.top,l=f+i.proportions().width,a=e+i.proportions().height;switch(r){case"fit":return o>=f&&l>=h&&s>=e&&a>=c;case"intersect":return o+t.helperProportions.width/2>f&&l>h-t.helperProportions.width/2&&s+t.helperProportions.height/2>e&&a>c-t.helperProportions.height/2;case"pointer":return n(u.pageY,e,i.proportions().height)&&n(u.pageX,f,i.proportions().width);case"touch":return(s>=e&&a>=s||c>=e&&a>=c||e>s&&c>a)&&(o>=f&&l>=o||h>=f&&l>=h||f>o&&h>l);default:return!1}}}(),n.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var r,f,u=n.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,e=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();n:for(r=0;u.length>r;r++)if(!(u[r].options.disabled||t&&!u[r].accept.call(u[r].element[0],t.currentItem||t.element))){for(f=0;e.length>f;f++)if(e[f]===u[r].element[0]){u[r].proportions().height=0;continue n}u[r].visible="none"!==u[r].element.css("display"),u[r].visible&&("mousedown"===o&&u[r]._activate.call(u[r],i),u[r].offset=u[r].element.offset(),u[r].proportions({width:u[r].element[0].offsetWidth,height:u[r].element[0].offsetHeight}))}},drop:function(t,i){var r=!1;return n.each((n.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e(t,this,this.options.tolerance,i)&&(r=this._drop.call(this,i)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),r},dragStart:function(t,i){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||n.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&n.ui.ddmanager.prepareOffsets(t,i),n.each(n.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var r,o,f,s=e(t,this,this.options.tolerance,i),u=!s&&this.isover?"isout":s&&!this.isover?"isover":null;u&&(this.options.greedy&&(o=this.options.scope,f=this.element.parents(":data(ui-droppable)").filter(function(){return n(this).droppable("instance").options.scope===o}),f.length&&(r=n(f[0]).droppable("instance"),r.greedyChild="isover"===u)),r&&"isover"===u&&(r.isover=!1,r.isout=!0,r._out.call(r,i)),this[u]=!0,this["isout"===u?"isover":"isout"]=!1,this["isover"===u?"_over":"_out"].call(this,i),r&&"isout"===u&&(r.isout=!1,r.isover=!0,r._over.call(r,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||n.ui.ddmanager.prepareOffsets(t,i)}},n.uiBackCompat!==!1&&n.widget("ui.droppable",n.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),n.ui.droppable,n.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=n("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(n){return void 0===n?this.options.value:(this.options.value=this._constrainedValue(n),this._refreshValue(),void 0)},_constrainedValue:function(n){return void 0===n&&(n=this.options.value),this.indeterminate=n===!1,"number"!=typeof n&&(n=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,n))},_setOptions:function(n){var t=n.value;delete n.value,this._super(n),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(n,t){"max"===n&&(t=Math.max(this.min,t)),this._super(n,t)},_setOptionDisabled:function(n){this._super(n),this.element.attr("aria-disabled",n),this._toggleClass(null,"ui-state-disabled",!!n)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=n("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),n.widget("ui.selectable",n.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t.elementPos=n(t.element[0]).offset(),t.selectees=n(t.options.filter,t.element[0]),t._addClass(t.selectees,"ui-selectee"),t.selectees.each(function(){var i=n(this),u=i.offset(),r={left:u.left-t.elementPos.left,top:u.top-t.elementPos.top};n.data(this,"selectable-item",{element:this,$element:i,left:r.left,top:r.top,right:r.left+i.outerWidth(),bottom:r.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=n("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(t){var i=this,r=this.options;this.opos=[t.pageX,t.pageY],this.elementPos=n(this.element[0]).offset(),this.options.disabled||(this.selectees=n(r.filter,this.element[0]),this._trigger("start",t),n(r.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=n.data(this,"selectable-item");r.startselected=!0,t.metaKey||t.ctrlKey||(i._removeClass(r.$element,"ui-selected"),r.selected=!1,i._addClass(r.$element,"ui-unselecting"),r.unselecting=!0,i._trigger("unselecting",t,{unselecting:r.element}))}),n(t.target).parents().addBack().each(function(){var u,r=n.data(this,"selectable-item");if(r)return(u=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected"),i._removeClass(r.$element,u?"ui-unselecting":"ui-selected")._addClass(r.$element,u?"ui-selecting":"ui-unselecting"),r.unselecting=!u,r.selecting=u,r.selected=u,u?i._trigger("selecting",t,{selecting:r.element}):i._trigger("unselecting",t,{unselecting:r.element}),!1)}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var o,i=this,s=this.options,r=this.opos[0],u=this.opos[1],f=t.pageX,e=t.pageY;return r>f&&(o=f,f=r,r=o),u>e&&(o=e,e=u,u=o),this.helper.css({left:r,top:u,width:f-r,height:e-u}),this.selectees.each(function(){var o=n.data(this,"selectable-item"),c=!1,h={};o&&o.element!==i.element[0]&&(h.left=o.left+i.elementPos.left,h.right=o.right+i.elementPos.left,h.top=o.top+i.elementPos.top,h.bottom=o.bottom+i.elementPos.top,"touch"===s.tolerance?c=!(h.left>f||r>h.right||h.top>e||u>h.bottom):"fit"===s.tolerance&&(c=h.left>r&&f>h.right&&h.top>u&&e>h.bottom),c?(o.selected&&(i._removeClass(o.$element,"ui-selected"),o.selected=!1),o.unselecting&&(i._removeClass(o.$element,"ui-unselecting"),o.unselecting=!1),o.selecting||(i._addClass(o.$element,"ui-selecting"),o.selecting=!0,i._trigger("selecting",t,{selecting:o.element}))):(o.selecting&&((t.metaKey||t.ctrlKey)&&o.startselected?(i._removeClass(o.$element,"ui-selecting"),o.selecting=!1,i._addClass(o.$element,"ui-selected"),o.selected=!0):(i._removeClass(o.$element,"ui-selecting"),o.selecting=!1,o.startselected&&(i._addClass(o.$element,"ui-unselecting"),o.unselecting=!0),i._trigger("unselecting",t,{unselecting:o.element}))),o.selected&&(t.metaKey||t.ctrlKey||o.startselected||(i._removeClass(o.$element,"ui-selected"),o.selected=!1,i._addClass(o.$element,"ui-unselecting"),o.unselecting=!0,i._trigger("unselecting",t,{unselecting:o.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,n(".ui-unselecting",this.element[0]).each(function(){var r=n.data(this,"selectable-item");i._removeClass(r.$element,"ui-unselecting"),r.unselecting=!1,r.startselected=!1,i._trigger("unselected",t,{unselected:r.element})}),n(".ui-selecting",this.element[0]).each(function(){var r=n.data(this,"selectable-item");i._removeClass(r.$element,"ui-selecting")._addClass(r.$element,"ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,i._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),n.widget("ui.selectmenu",[n.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=n()},_drawButton:function(){var t,i=this,r=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(n){this.button.focus(),n.preventDefault()}}),this.element.hide(),this.button=n("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=n("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(r).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var t=this;this.menu=n("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=n("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(n,i){n.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),n)},focus:function(n,i){var r=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&r.index!==t.focusIndex&&(t._trigger("focus",n,{item:r}),t.isOpen||t._select(r,n)),t.focusIndex=r.index,t.button.attr("aria-activedescendant",t.menuItems.eq(r.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var n,t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(n=this._getSelectedItem(),this.menuInstance.focus(null,n),this._setAria(n.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(n){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",n)))},_position:function(){this.menuWrap.position(n.extend({of:this.button},this.options.position))},close:function(n){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",n))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var i=n("<span>");return this._setText(i,t.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(t,i){var r=this,u="";n.each(i,function(i,f){var e;f.optgroup!==u&&(e=n("<li>",{text:f.optgroup}),r._addClass(e,"ui-selectmenu-optgroup","ui-menu-divider"+(f.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),e.appendTo(t),u=f.optgroup),r._renderItemData(t,f)})},_renderItemData:function(n,t){return this._renderItem(n,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var r=n("<li>"),u=n("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(r,null,"ui-state-disabled"),this._setText(u,i.label),r.append(u).appendTo(t)},_setText:function(n,t){t?n.text(t):n.html("&#160;")},_move:function(n,t){var i,r,u=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),u+=":not(.ui-state-disabled)"),r="first"===n||"last"===n?i["first"===n?"prevAll":"nextAll"](u).eq(-1):i[n+"All"](u).eq(0),r.length&&this.menuInstance.focus(t,r)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(n){this[this.isOpen?"close":"open"](n)},_setSelection:function(){var n;this.range&&(window.getSelection?(n=window.getSelection(),n.removeAllRanges(),n.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(n(t.target).closest(".ui-selectmenu-menu, #"+n.ui.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var n;window.getSelection?(n=window.getSelection(),n.rangeCount&&(this.range=n.getRangeAt(0))):this.range=document.selection.createRange()},click:function(n){this._setSelection(),this._toggle(n)},keydown:function(t){var i=!0;switch(t.keyCode){case n.ui.keyCode.TAB:case n.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case n.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case n.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case n.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case n.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case n.ui.keyCode.LEFT:this._move("prev",t);break;case n.ui.keyCode.RIGHT:this._move("next",t);break;case n.ui.keyCode.HOME:case n.ui.keyCode.PAGE_UP:this._move("first",t);break;case n.ui.keyCode.END:case n.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(n){var t=this.menuItems.eq(this.focusIndex).parent("li");t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),n)},_select:function(n,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=n.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(n)),this._setAria(n),this._trigger("select",t,{item:n}),n.index!==i&&this._trigger("change",t,{item:n}),this.close(t)},_setAria:function(n){var t=this.menuItems.eq(n.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(n,t){if("icons"===n){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,t.button)}this._super(n,t),"appendTo"===n&&this.menuWrap.appendTo(this._appendTo()),"width"===n&&this._resizeButton()},_setOptionDisabled:function(n){this._super(n),this.menuInstance.option("disabled",n),this.button.attr("aria-disabled",n),this._toggleClass(this.button,null,"ui-state-disabled",n),this.element.prop("disabled",n),n?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?n(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var n=this.options.width;return n===!1?(this.button.css("width",""),void 0):(null===n&&(n=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(n),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var n=this._super();return n.disabled=this.element.prop("disabled"),n},_parseOptions:function(t){var r=this,i=[];t.each(function(t,u){i.push(r._parseOption(n(u),t))}),this.items=i},_parseOption:function(n,t){var i=n.parent("optgroup");return{element:n,index:t,value:n.val(),label:n.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||n.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),n.widget("ui.slider",n.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var r,i,u=this.options,t=this.element.find(".ui-slider-handle"),f=[];for(i=u.values&&u.values.length||1,t.length>i&&(t.slice(i).remove(),t=t.slice(0,i)),r=t.length;i>r;r++)f.push("<span tabindex='0'><\/span>");this.handles=t.add(n(f.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){n(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:n.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=n("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===t.range||"max"===t.range)&&this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var s,f,r,i,u,h,e,c,o=this,l=this.options;return l.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),s={x:t.pageX,y:t.pageY},f=this._normValueFromMouse(s),r=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(f-o.values(t));(r>e||r===e&&(t===o._lastChangedValue||o.values(t)===l.min))&&(r=e,i=n(this),u=t)}),h=this._start(t,u),h===!1?!1:(this._mouseSliding=!0,this._handleIndex=u,this._addClass(i,null,"ui-state-active"),i.trigger("focus"),e=i.offset(),c=!n(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=c?{left:0,top:0}:{left:t.pageX-e.left-i.width()/2,top:t.pageY-e.top-i.height()/2-(parseInt(i.css("borderTopWidth"),10)||0)-(parseInt(i.css("borderBottomWidth"),10)||0)+(parseInt(i.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,u,f),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(n){var t={x:n.pageX,y:n.pageY},i=this._normValueFromMouse(t);return this._slide(n,this._handleIndex,i),!1},_mouseStop:function(n){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(n,this._handleIndex),this._change(n,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(n){var i,r,t,u,f;return"horizontal"===this.orientation?(i=this.elementSize.width,r=n.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(i=this.elementSize.height,r=n.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=r/i,t>1&&(t=1),0>t&&(t=0),"vertical"===this.orientation&&(t=1-t),u=this._valueMax()-this._valueMin(),f=this._valueMin()+t*u,this._trimAlignValue(f)},_uiHash:function(n,t,i){var r={handle:this.handles[n],handleIndex:n,value:void 0!==t?t:this.value()};return this._hasMultipleValues()&&(r.value=void 0!==t?t:this.values(n),r.values=i||this.values()),r},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(n,t){return this._trigger("start",n,this._uiHash(t))},_slide:function(n,t,i){var u,r,f=this.value(),e=this.values();this._hasMultipleValues()&&(r=this.values(t?0:1),f=this.values(t),2===this.options.values.length&&this.options.range===!0&&(i=0===t?Math.min(r,i):Math.max(r,i)),e[t]=i),i!==f&&(u=this._trigger("slide",n,this._uiHash(t,i,e)),u!==!1&&(this._hasMultipleValues()?this.values(t,i):this.value(i)))},_stop:function(n,t){this._trigger("stop",n,this._uiHash(t))},_change:function(n,t){this._keySliding||this._mouseSliding||(this._lastChangedValue=t,this._trigger("change",n,this._uiHash(t)))},value:function(n){return arguments.length?(this.options.value=this._trimAlignValue(n),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var u,f,r;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!n.isArray(arguments[0]))return this._hasMultipleValues()?this._values(t):this.value();for(u=this.options.values,f=arguments[0],r=0;u.length>r;r+=1)u[r]=this._trimAlignValue(f[r]),this._change(null,r);this._refreshValue()},_setOption:function(t,i){var r,u=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),n.isArray(this.options.values)&&(u=this.options.values.length),this._super(t,i),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),r=u-1;r>=0;r--)this._change(null,r);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(n){this._super(n),this._toggleClass(null,"ui-state-disabled",!!n)},_value:function(){var n=this.options.value;return this._trimAlignValue(n)},_values:function(n){var r,t,i;if(arguments.length)return r=this.options.values[n],r=this._trimAlignValue(r);if(this._hasMultipleValues()){for(t=this.options.values.slice(),i=0;t.length>i;i+=1)t[i]=this._trimAlignValue(t[i]);return t}return[]},_trimAlignValue:function(n){if(this._valueMin()>=n)return this._valueMin();if(n>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(n-this._valueMin())%t,r=n-i;return 2*Math.abs(i)>=t&&(r+=i>0?t:-t),parseFloat(r.toFixed(5))},_calculateNewMax:function(){var n=this.options.max,i=this._valueMin(),t=this.options.step,r=Math.round((n-i)/t)*t;n=r+i,n>this.options.max&&(n-=t),this.max=parseFloat(n.toFixed(this._precision()))},_precision:function(){var n=this._precisionOf(this.options.step);return null!==this.options.min&&(n=Math.max(n,this._precisionOf(this.options.min))),n},_precisionOf:function(n){var t=""+n,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(n){"vertical"===n&&this.range.css({width:"",left:""}),"horizontal"===n&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var s,t,c,f,h,e=this.options.range,i=this.options,r=this,u=this._animateOff?!1:i.animate,o={};this._hasMultipleValues()?this.handles.each(function(f){t=100*((r.values(f)-r._valueMin())/(r._valueMax()-r._valueMin())),o["horizontal"===r.orientation?"left":"bottom"]=t+"%",n(this).stop(1,1)[u?"animate":"css"](o,i.animate),r.options.range===!0&&("horizontal"===r.orientation?(0===f&&r.range.stop(1,1)[u?"animate":"css"]({left:t+"%"},i.animate),1===f&&r.range[u?"animate":"css"]({width:t-s+"%"},{queue:!1,duration:i.animate})):(0===f&&r.range.stop(1,1)[u?"animate":"css"]({bottom:t+"%"},i.animate),1===f&&r.range[u?"animate":"css"]({height:t-s+"%"},{queue:!1,duration:i.animate}))),s=t}):(c=this.value(),f=this._valueMin(),h=this._valueMax(),t=h!==f?100*((c-f)/(h-f)):0,o["horizontal"===this.orientation?"left":"bottom"]=t+"%",this.handle.stop(1,1)[u?"animate":"css"](o,i.animate),"min"===e&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:t+"%"},i.animate),"max"===e&&"horizontal"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({width:100-t+"%"},i.animate),"min"===e&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:t+"%"},i.animate),"max"===e&&"vertical"===this.orientation&&this.range.stop(1,1)[u?"animate":"css"]({height:100-t+"%"},i.animate))},_handleEvents:{keydown:function(t){var e,r,i,u,f=n(t.target).data("ui-slider-handle-index");switch(t.keyCode){case n.ui.keyCode.HOME:case n.ui.keyCode.END:case n.ui.keyCode.PAGE_UP:case n.ui.keyCode.PAGE_DOWN:case n.ui.keyCode.UP:case n.ui.keyCode.RIGHT:case n.ui.keyCode.DOWN:case n.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(n(t.target),null,"ui-state-active"),e=this._start(t,f),e===!1))return}switch(u=this.options.step,r=i=this._hasMultipleValues()?this.values(f):this.value(),t.keyCode){case n.ui.keyCode.HOME:i=this._valueMin();break;case n.ui.keyCode.END:i=this._valueMax();break;case n.ui.keyCode.PAGE_UP:i=this._trimAlignValue(r+(this._valueMax()-this._valueMin())/this.numPages);break;case n.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(r-(this._valueMax()-this._valueMin())/this.numPages);break;case n.ui.keyCode.UP:case n.ui.keyCode.RIGHT:if(r===this._valueMax())return;i=this._trimAlignValue(r+u);break;case n.ui.keyCode.DOWN:case n.ui.keyCode.LEFT:if(r===this._valueMin())return;i=this._trimAlignValue(r-u)}this._slide(t,f,i)},keyup:function(t){var i=n(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),this._removeClass(n(t.target),null,"ui-state-active"))}}}),n.widget("ui.sortable",n.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(n,t,i){return n>=t&&t+i>n},_isFloating:function(n){return/left|right/.test(n.css("float"))||/inline|table-cell/.test(n.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(n,t){this._super(n,t),"handle"===n&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),n.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var n=this.items.length-1;n>=0;n--)this.items[n].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var r=null,f=!1,u=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),n(t.target).parents().each(function(){if(n.data(this,u.widgetName+"-item")===u)return(r=n(this),!1)}),n.data(t.target,u.widgetName+"-item")===u&&(r=n(t.target)),r?!this.options.handle||i||(n(this.options.handle,r).find("*").addBack().each(function(){this===t.target&&(f=!0)}),f)?(this.currentItem=r,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,r){var f,e,u=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},n.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,u.cursorAt&&this._adjustOffsetFromHelper(u.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),u.containment&&this._setContainment(),u.cursor&&"auto"!==u.cursor&&(e=this.document.find("body"),this.storedCursor=e.css("cursor"),e.css("cursor",u.cursor),this.storedStylesheet=n("<style>*{ cursor: "+u.cursor+" !important; }<\/style>").appendTo(e)),u.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",u.opacity)),u.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",u.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!r)for(f=this.containers.length-1;f>=0;f--)this.containers[f]._trigger("activate",t,this._uiHash(this));return n.ui.ddmanager&&(n.ui.ddmanager.current=this),n.ui.ddmanager&&!u.dropBehaviour&&n.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,u,f,o,i=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-this.overflowOffset.top<i.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-i.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-this.overflowOffset.left<i.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-i.scrollSpeed)):(t.pageY-this.document.scrollTop()<i.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-i.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<i.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+i.scrollSpeed)),t.pageX-this.document.scrollLeft()<i.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-i.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<i.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+i.scrollSpeed))),r!==!1&&n.ui.ddmanager&&!i.dropBehaviour&&n.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e=this.items.length-1;e>=0;e--)if(u=this.items[e],f=u.item[0],o=this._intersectsWithPointer(u),o&&u.instance===this.currentContainer&&f!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==f&&!n.contains(this.placeholder[0],f)&&("semi-dynamic"===this.options.type?!n.contains(this.element[0],f):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(u))break;this._rearrange(t,u),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),n.ui.ddmanager&&n.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(n.ui.ddmanager&&!this.options.dropBehaviour&&n.ui.ddmanager.drop(this,t),this.options.revert){var e=this,f=this.placeholder.offset(),r=this.options.axis,u={};r&&"x"!==r||(u.left=f.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),r&&"y"!==r||(u.top=f.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,n(this.helper).animate(u,parseInt(this.options.revert,10)||500,function(){e._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new n.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),n.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?n(this.domPosition.prev).after(this.currentItem):n(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var r=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},n(r).each(function(){var r=(n(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);r&&i.push((t.key||r[1]+"[]")+"="+(t.key&&t.expression?r[1]:r[2]))}),!i.length&&t.key&&i.push(t.key+"="),i.join("&")},toArray:function(t){var r=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},r.each(function(){i.push(n(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(n){var t=this.positionAbs.left,h=t+this.helperProportions.width,i=this.positionAbs.top,c=i+this.helperProportions.height,r=n.left,f=r+n.width,u=n.top,e=u+n.height,o=this.offset.click.top,s=this.offset.click.left,l="x"===this.options.axis||i+o>u&&e>i+o,a="y"===this.options.axis||t+s>r&&f>t+s,v=l&&a;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>n[this.floating?"width":"height"]?v:t+this.helperProportions.width/2>r&&f>h-this.helperProportions.width/2&&i+this.helperProportions.height/2>u&&e>c-this.helperProportions.height/2},_intersectsWithPointer:function(n){var t,i,r="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,n.top,n.height),u="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,n.left,n.width),f=r&&u;return f?(t=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===t?2:1:t&&("down"===t?2:1)):!1},_intersectsWithSides:function(n){var r=this._isOverAxis(this.positionAbs.top+this.offset.click.top,n.top+n.height/2,n.height),u=this._isOverAxis(this.positionAbs.left+this.offset.click.left,n.left+n.width/2,n.width),t=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();return this.floating&&i?"right"===i&&u||"left"===i&&!u:t&&("down"===t&&r||"up"===t&&!r)},_getDragVerticalDirection:function(){var n=this.positionAbs.top-this.lastPositionAbs.top;return 0!==n&&(n>0?"down":"up")},_getDragHorizontalDirection:function(){var n=this.positionAbs.left-this.lastPositionAbs.left;return 0!==n&&(n>0?"right":"left")},refresh:function(n){return this._refreshItems(n),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var n=this.options;return n.connectWith.constructor===String?[n.connectWith]:n.connectWith},_getItemsAsjQuery:function(t){function h(){s.push(this)}var r,u,e,i,s=[],f=[],o=this._connectWith();if(o&&t)for(r=o.length-1;r>=0;r--)for(e=n(o[r],this.document[0]),u=e.length-1;u>=0;u--)i=n.data(e[u],this.widgetFullName),i&&i!==this&&!i.options.disabled&&f.push([n.isFunction(i.options.items)?i.options.items.call(i.element):n(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i]);for(f.push([n.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):n(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),r=f.length-1;r>=0;r--)f[r][0].each(h);return n(s)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=n.grep(this.items,function(n){for(var i=0;t.length>i;i++)if(t[i]===n.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var r,u,e,i,o,s,h,l,a=this.items,f=[[n.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):n(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(r=c.length-1;r>=0;r--)for(e=n(c[r],this.document[0]),u=e.length-1;u>=0;u--)i=n.data(e[u],this.widgetFullName),i&&i!==this&&!i.options.disabled&&(f.push([n.isFunction(i.options.items)?i.options.items.call(i.element[0],t,{item:this.currentItem}):n(i.options.items,i.element),i]),this.containers.push(i));for(r=f.length-1;r>=0;r--)for(o=f[r][1],s=f[r][0],u=0,l=s.length;l>u;u++)h=n(s[u]),h.data(this.widgetName+"-item",o),a.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var r,f,u,i=this.items.length-1;i>=0;i--)r=this.items[i],r.instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0]||(f=this.options.toleranceElement?n(this.options.toleranceElement,r.item):r.item,t||(r.width=f.outerWidth(),r.height=f.outerHeight()),u=f.offset(),r.left=u.left,r.top=u.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)u=this.containers[i].element.offset(),this.containers[i].containerCache.left=u.left,this.containers[i].containerCache.top=u.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var r,i=t.options;i.placeholder&&i.placeholder.constructor!==String||(r=i.placeholder,i.placeholder={element:function(){var u=t.currentItem[0].nodeName.toLowerCase(),i=n("<"+u+">",t.document[0]);return t._addClass(i,"ui-sortable-placeholder",r||t.currentItem[0].className)._removeClass(i,"ui-sortable-helper"),"tbody"===u?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),n("<tr>",t.document[0]).appendTo(i)):"tr"===u?t._createTrPlaceholder(t.currentItem,i):"img"===u&&i.attr("src",t.currentItem.attr("src")),r||i.css("visibility","hidden"),i},update:function(n,u){(!r||i.forcePlaceholderSize)&&(u.height()||u.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),u.width()||u.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=n(i.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),i.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var r=this;t.children().each(function(){n("<td>&#160;<\/td>",r.document[0]).attr("colspan",n(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){for(var u,c,f,a,v,o,l,s,h,e=null,i=null,r=this.containers.length-1;r>=0;r--)if(!n.contains(this.currentItem[0],this.containers[r].element[0]))if(this._intersectsWith(this.containers[r].containerCache)){if(e&&n.contains(this.containers[r].element[0],e.element[0]))continue;e=this.containers[r],i=r}else this.containers[r].containerCache.over&&(this.containers[r]._trigger("out",t,this._uiHash(this)),this.containers[r].containerCache.over=0);if(e)if(1===this.containers.length)this.containers[i].containerCache.over||(this.containers[i]._trigger("over",t,this._uiHash(this)),this.containers[i].containerCache.over=1);else{for(c=1e4,f=null,s=e.floating||this._isFloating(this.currentItem),a=s?"left":"top",v=s?"width":"height",h=s?"pageX":"pageY",u=this.items.length-1;u>=0;u--)n.contains(this.containers[i].element[0],this.items[u].item[0])&&this.items[u].item[0]!==this.currentItem[0]&&(o=this.items[u].item.offset()[a],l=!1,t[h]-o>this.items[u][v]/2&&(l=!0),c>Math.abs(t[h]-o)&&(c=Math.abs(t[h]-o),f=this.items[u],this.direction=l?"up":"down"));if(!f&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[i])return this.currentContainer.containerCache.over||(this.containers[i]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;f?this._rearrange(t,f,null,!0):this._rearrange(t,null,this.containers[i].element,!0),this._trigger("change",t,this._uiHash()),this.containers[i]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[i],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[i]._trigger("over",t,this._uiHash(this)),this.containers[i].containerCache.over=1}},_createHelper:function(t){var r=this.options,i=n.isFunction(r.helper)?n(r.helper.apply(this.element[0],[t,this.currentItem])):"clone"===r.helper?this.currentItem.clone():this.currentItem;return i.parents("body").length||n("parent"!==r.appendTo?r.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0]),i[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!i[0].style.width||r.forceHelperSize)&&i.width(this.currentItem.width()),(!i[0].style.height||r.forceHelperSize)&&i.height(this.currentItem.height()),i},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),n.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&n.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&n.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var n=this.currentItem.position();return{top:n.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:n.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,r,u,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),("document"===i.containment||"window"===i.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=n(i.containment)[0],r=n(i.containment).offset(),u="hidden"!==n(t).css("overflow"),this.containment=[r.left+(parseInt(n(t).css("borderLeftWidth"),10)||0)+(parseInt(n(t).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(n(t).css("borderTopWidth"),10)||0)+(parseInt(n(t).css("paddingTop"),10)||0)-this.margins.top,r.left+(u?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(n(t).css("borderLeftWidth"),10)||0)-(parseInt(n(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(u?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(n(t).css("borderTopWidth"),10)||0)-(parseInt(n(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var r="absolute"===t?1:-1,u="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&n.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,f=/(html|body)/i.test(u[0].tagName);return{top:i.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():f?0:u.scrollTop())*r,left:i.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():f?0:u.scrollLeft())*r}},_generatePosition:function(t){var r,u,i=this.options,f=t.pageX,e=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&n.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(e=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(e=this.containment[3]+this.offset.click.top)),i.grid&&(r=this.originalPageY+Math.round((e-this.originalPageY)/i.grid[1])*i.grid[1],e=this.containment?r-this.offset.click.top>=this.containment[1]&&r-this.offset.click.top<=this.containment[3]?r:r-this.offset.click.top>=this.containment[1]?r-i.grid[1]:r+i.grid[1]:r,u=this.originalPageX+Math.round((f-this.originalPageX)/i.grid[0])*i.grid[0],f=this.containment?u-this.offset.click.left>=this.containment[0]&&u-this.offset.click.left<=this.containment[2]?u:u-this.offset.click.left>=this.containment[0]?u-i.grid[0]:u+i.grid[0]:u)),{top:e-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:o.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:o.scrollLeft())}},_rearrange:function(n,t,i,r){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var u=this.counter;this._delay(function(){u===this.counter&&this.refreshPositions(!r)})},_clear:function(n,t){function u(n,t,i){return function(r){i._trigger(n,r,t._uiHash(t))}}this.reverting=!1;var i,r=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&r.push(function(n){this._trigger("receive",n,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||r.push(function(n){this._trigger("update",n,this._uiHash())}),this!==this.currentContainer&&(t||(r.push(function(n){this._trigger("remove",n,this._uiHash())}),r.push(function(n){return function(t){n._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(n){return function(t){n._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)t||r.push(u("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(u("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",n,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(i=0;r.length>i;i++)r[i].call(this,n);this._trigger("stop",n,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){n.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||n([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),n.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t=this._super(),i=this.element;return n.each(["min","max","step"],function(n,r){var u=i.attr(r);null!=u&&u.length&&(t[r]=u)}),t},_events:{keydown:function(n){this._start(n)&&this._keydown(n)&&n.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(n){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",n),void 0)},mousewheel:function(n,t){if(t){if(!this.spinning&&!this._start(n))return!1;this._spin((t>0?1:-1)*this.options.step,n),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(n)},100),n.preventDefault()}},"mousedown .ui-spinner-button":function(t){function r(){var t=this.element[0]===n.ui.safeActiveElement(this.document[0]);t||(this.element.trigger("focus"),this.previous=i,this._delay(function(){this.previous=i}))}var i;i=this.element[0]===n.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)}),this._start(t)!==!1&&this._repeat(null,n(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(n(t.currentTarget).hasClass("ui-state-active"))return this._start(t)===!1?!1:(this._repeat(null,n(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a><\/a><a><\/a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var r=this.options,i=n.ui.keyCode;switch(t.keyCode){case i.UP:return this._repeat(null,1,t),!0;case i.DOWN:return this._repeat(null,-1,t),!0;case i.PAGE_UP:return this._repeat(null,r.page,t),!0;case i.PAGE_DOWN:return this._repeat(null,-r.page,t),!0}return!1},_start:function(n){return this.spinning||this._trigger("start",n)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(n,t,i){n=n||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},n),this._spin(t*this.options.step,i)},_spin:function(n,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+n*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?n.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var n=this._precisionOf(this.options.step);return null!==this.options.min&&(n=Math.max(n,this._precisionOf(this.options.min))),n},_precisionOf:function(n){var t=""+n,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(n){var r,i,t=this.options;return r=null!==t.min?t.min:0,i=n-r,i=Math.round(i/t.step)*t.step,n=r+i,n=parseFloat(n.toFixed(this._precision())),null!==t.max&&n>t.max?t.max:null!==t.min&&t.min>n?t.min:n},_stop:function(n){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",n))},_setOption:function(n,t){var u,i,r;return"culture"===n||"numberFormat"===n?(u=this._parse(this.element.val()),this.options[n]=t,this.element.val(this._format(u)),void 0):(("max"===n||"min"===n||"step"===n)&&"string"==typeof t&&(t=this._parse(t)),"icons"===n&&(i=this.buttons.first().find(".ui-icon"),this._removeClass(i,null,this.options.icons.up),this._addClass(i,null,t.up),r=this.buttons.last().find(".ui-icon"),this._removeClass(r,null,this.options.icons.down),this._addClass(r,null,t.down)),this._super(n,t),void 0)},_setOptionDisabled:function(n){this._super(n),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!n),this.element.prop("disabled",!!n),this.buttons.button(n?"disable":"enable")},_setOptions:t(function(n){this._super(n)}),_parse:function(n){return"string"==typeof n&&""!==n&&(n=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(n,10,this.options.culture):+n),""===n||isNaN(n)?null:n},_format:function(n){return""===n?"":window.Globalize&&this.options.numberFormat?Globalize.format(n,this.options.numberFormat,this.options.culture):n},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var n=this.value();return null===n?!1:n===this._adjustValue(n)},_value:function(n,t){var i;""!==n&&(i=this._parse(n),null!==i&&(t||(i=this._adjustValue(i)),n=this._format(i))),this.element.val(n),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(n){this._stepUp(n)}),_stepUp:function(n){this._start()&&(this._spin((n||1)*this.options.step),this._stop())},stepDown:t(function(n){this._stepDown(n)}),_stepDown:function(n){this._start()&&(this._spin((n||1)*-this.options.step),this._stop())},pageUp:t(function(n){this._stepUp((n||1)*this.options.page)}),pageDown:t(function(n){this._stepDown((n||1)*this.options.page)}),value:function(n){return arguments.length?(t(this._value).call(this,n),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),n.uiBackCompat!==!1&&n.widget("ui.spinner",n.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a><\/a><a><\/a>"}}),n.ui.spinner,n.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var n=/#.*$/;return function(t){var i,r;i=t.href.replace(n,""),r=location.href.replace(n,"");try{i=decodeURIComponent(i)}catch(u){}try{r=decodeURIComponent(r)}catch(u){}return t.hash.length>1&&i===r}}(),_create:function(){var i=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),n.isArray(t.disabled)&&(t.disabled=n.unique(t.disabled.concat(n.map(this.tabs.filter(".ui-state-disabled"),function(n){return i.tabs.index(n)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(t.active):n(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,r=location.hash.substring(1);return null===t&&(r&&this.tabs.each(function(i,u){if(n(u).attr("aria-controls")===r)return(t=i,!1)}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):n()}},_tabKeydown:function(t){var r=n(n.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(r),u=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case n.ui.keyCode.RIGHT:case n.ui.keyCode.DOWN:i++;break;case n.ui.keyCode.UP:case n.ui.keyCode.LEFT:u=!1,i--;break;case n.ui.keyCode.END:i=this.anchors.length-1;break;case n.ui.keyCode.HOME:i=0;break;case n.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(i),void 0;case n.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(i===this.options.active?!1:i),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,u),t.ctrlKey||t.metaKey||(r.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===n.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===n.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===n.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function u(){return t>r&&(t=0),0>t&&(t=r),t}for(var r=this.tabs.length-1;-1!==n.inArray(u(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(n,t){return n=this._findNextTab(n,t),this.tabs.eq(n).trigger("focus"),n},_setOption:function(n,t){return"active"===n?(this._activate(t),void 0):(this._super(n,t),"collapsible"===n&&(this._toggleClass("ui-tabs-collapsible",null,t),t||this.options.active!==!1||this._activate(0)),"event"===n&&this._setupEvents(t),"heightStyle"===n&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(n){return n?n.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=n.map(i.filter(".ui-state-disabled"),function(n){return i.index(n)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!n.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=n()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=n()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,r=this.anchors,u=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){n(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){n(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return n("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=n(),this.anchors.each(function(i,r){var f,u,e,s=n(r).uniqueId().attr("id"),o=n(r).closest("li"),h=o.attr("aria-controls");t._isLocal(r)?(f=r.hash,e=f.substring(1),u=t.element.find(t._sanitizeSelector(f))):(e=o.attr("aria-controls")||n({}).uniqueId()[0].id,f="#"+e,u=t.element.find(f),u.length||(u=t._createPanel(e),u.insertAfter(t.panels[i-1]||t.tablist)),u.attr("aria-live","polite")),u.length&&(t.panels=t.panels.add(u)),h&&o.data("ui-tabs-aria-controls",h),o.attr({"aria-controls":e,"aria-labelledby":s}),u.attr("aria-labelledby",s)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(r.not(this.anchors)),this._off(u.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return n("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var i,u,r;for(n.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),r=0;u=this.tabs[r];r++)i=n(u),t===!0||-1!==n.inArray(r,t)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,t===!0)},_setupEvents:function(t){var i={};t&&n.each(t.split(" "),function(n,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(n){n.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,r=this.element.parent();"fill"===t?(i=r.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=n(this),r=t.css("position");"absolute"!==r&&"fixed"!==r&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=n(this).outerHeight(!0)}),this.panels.each(function(){n(this).height(Math.max(0,i-n(this).innerHeight()+n(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,n(this).height("").height())}).height(i))},_eventHandler:function(t){var u=this.options,r=this.active,c=n(t.currentTarget),i=c.closest("li"),f=i[0]===r[0],e=f&&u.collapsible,o=e?n():this._getPanelForTab(i),s=r.length?this._getPanelForTab(r):n(),h={oldTab:r,oldPanel:s,newTab:e?n():i,newPanel:o};t.preventDefault(),i.hasClass("ui-state-disabled")||i.hasClass("ui-tabs-loading")||this.running||f&&!u.collapsible||this._trigger("beforeActivate",t,h)===!1||(u.active=e?!1:this.tabs.index(i),this.active=f?n():i,this.xhr&&this.xhr.abort(),s.length||o.length||n.error("jQuery UI Tabs: Mismatching fragment identifier."),o.length&&this.load(this.tabs.index(i),t),this._toggle(t,h))},_toggle:function(t,i){function e(){r.running=!1,r._trigger("activate",t,i)}function o(){r._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),u.length&&r.options.show?r._show(u,r.options.show,e):(u.show(),e())}var r=this,u=i.newPanel,f=i.oldPanel;this.running=!0,f.length&&this.options.hide?this._hide(f,this.options.hide,function(){r._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),o()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),f.hide(),o()),f.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),u.length&&f.length?i.oldTab.attr("tabIndex",-1):u.length&&this.tabs.filter(function(){return 0===n(this).attr("tabIndex")}).attr("tabIndex",-1),u.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var r,i=this._findActive(t);i[0]!==this.active[0]&&(i.length||(i=this.active),r=i.find(".ui-tabs-anchor")[0],this._eventHandler({target:r,currentTarget:r,preventDefault:n.noop}))},_findActive:function(t){return t===!1?n():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+n.ui.escapeSelector(t)+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){n.data(this,"ui-tabs-destroy")?n(this).remove():n(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=n(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=n.isArray(i)?n.map(i,function(n){return n!==t?n:null}):n.map(this.tabs,function(n,i){return i!==t?i:null})),this._setOptionDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==n.inArray(t,i))return;i=n.isArray(i)?n.merge([t],i).sort():[t]}this._setOptionDisabled(i)}},load:function(t,i){t=this._getIndex(t);var r=this,u=this.tabs.eq(t),e=u.find(".ui-tabs-anchor"),f=this._getPanelForTab(u),o={tab:u,panel:f},s=function(n,t){"abort"===t&&r.panels.stop(!1,!0),r._removeClass(u,"ui-tabs-loading"),f.removeAttr("aria-busy"),n===r.xhr&&delete r.xhr};this._isLocal(e[0])||(this.xhr=n.ajax(this._ajaxSettings(e,i,o)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(u,"ui-tabs-loading"),f.attr("aria-busy","true"),this.xhr.done(function(n,t,u){setTimeout(function(){f.html(n),r._trigger("load",i,o),s(u,t)},1)}).fail(function(n,t){setTimeout(function(){s(n,t)},1)})))},_ajaxSettings:function(t,i,r){var u=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,f){return u._trigger("beforeLoad",i,n.extend({jqXHR:t,ajaxSettings:f},r))}}},_getPanelForTab:function(t){var i=n(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),n.uiBackCompat!==!1&&n.widget("ui.tabs",n.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),n.ui.tabs,n.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=n(this).attr("title")||"";return n("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",n.trim(r.join(" ")))},_removeDescribedBy:function(t){var u=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),r=n.inArray(u,i);-1!==r&&i.splice(r,1),t.removeData("ui-tooltip-id"),i=n.trim(i.join(" ")),i?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=n("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=n([])},_setOption:function(t,i){var r=this;this._super(t,i),"content"===t&&n.each(this.tooltips,function(n,t){r._updateContent(t.element)})},_setOptionDisabled:function(n){this[n?"_disable":"_enable"]()},_disable:function(){var t=this;n.each(this.tooltips,function(i,r){var u=n.Event("blur");u.target=u.currentTarget=r.element[0],t.close(u,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=n(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=n(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=n([])},open:function(t){var r=this,i=n(t?t.target:this.element).closest(this.options.items);i.length&&!i.data("ui-tooltip-id")&&(i.attr("title")&&i.data("ui-tooltip-title",i.attr("title")),i.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&i.parents().each(function(){var i,t=n(this);t.data("ui-tooltip-open")&&(i=n.Event("blur"),i.target=i.currentTarget=this,r.close(i,!0)),t.attr("title")&&(t.uniqueId(),r.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._registerCloseHandlers(t,i),this._updateContent(i,t))},_updateContent:function(n,t){var r,i=this.options.content,u=this,f=t?t.type:null;return"string"==typeof i||i.nodeType||i.jquery?this._open(t,n,i):(r=i.call(n[0],function(i){u._delay(function(){n.data("ui-tooltip-open")&&(t&&(t.type=f),this._open(t,n,i))})}),r&&this._open(t,n,r),void 0)},_open:function(t,i,r){function o(n){s.of=n,u.is(":hidden")||u.position(s)}var f,u,h,e,s=n.extend({},this.options.position);if(r){if(f=this._find(i))return f.tooltip.find(".ui-tooltip-content").html(r),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),f=this._tooltip(i),u=f.tooltip,this._addDescribedBy(i,u.attr("id")),u.find(".ui-tooltip-content").html(r),this.liveRegion.children().hide(),e=n("<div>").html(u.find(".ui-tooltip-content").html()),e.removeAttr("name").find("[name]").removeAttr("name"),e.removeAttr("id").find("[id]").removeAttr("id"),e.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:o}),o(t)):u.position(n.extend({of:i},this.options.position)),u.hide(),this._show(u,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){u.is(":visible")&&(o(s.of),clearInterval(h))},n.fx.interval)),this._trigger("open",t,{tooltip:u})}},_registerCloseHandlers:function(t,i){var r={keyup:function(t){if(t.keyCode===n.ui.keyCode.ESCAPE){var r=n.Event(t);r.currentTarget=i[0],this.close(r,!0)}}};i[0]!==this.element[0]&&(r.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(r.mouseleave="close"),t&&"focusin"!==t.type||(r.focusout="close"),this._on(!0,i,r)},close:function(t){var u,f=this,i=n(t?t.currentTarget:this.element),r=this._find(i);return r?(u=r.tooltip,r.closing||(clearInterval(this.delayedShow),i.data("ui-tooltip-title")&&!i.attr("title")&&i.attr("title",i.data("ui-tooltip-title")),this._removeDescribedBy(i),r.hiding=!0,u.stop(!0),this._hide(u,this.options.hide,function(){f._removeTooltip(n(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&n.each(this.parents,function(t,i){n(i.element).attr("title",i.title),delete f.parents[t]}),r.closing=!0,this._trigger("close",t,{tooltip:u}),r.hiding||(r.closing=!1)),void 0):(i.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=n("<div>").attr("role","tooltip"),r=n("<div>").appendTo(i),u=i.uniqueId().attr("id");return this._addClass(r,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(t)),this.tooltips[u]={element:t,tooltip:i}},_find:function(n){var t=n.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(n){n.remove(),delete this.tooltips[n.attr("id")]},_appendTo:function(n){var t=n.closest(".ui-front, dialog");return t.length||(t=this.document[0].body),t},_destroy:function(){var t=this;n.each(this.tooltips,function(i,r){var f=n.Event("blur"),u=r.element;f.target=f.currentTarget=u[0],t.close(f,!0),n("#"+i).remove(),u.data("ui-tooltip-title")&&(u.attr("title")||u.attr("title",u.data("ui-tooltip-title")),u.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),n.uiBackCompat!==!1&&n.widget("ui.tooltip",n.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var n=this._superApply(arguments);return this.options.tooltipClass&&n.tooltip.addClass(this.options.tooltipClass),n}}),n.ui.tooltip});
/*!
 * jQuery UI Touch Punch 0.2.3
 *
 * Copyright 2011–2014, Dave Furfero
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * Depends:
 *  jquery.ui.widget.js
 *  jquery.ui.mouse.js
 */
!function(n){function t(n,t){if(!(n.originalEvent.touches.length>1)){n.preventDefault();var i=n.originalEvent.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(r)}}if(n.support.touch="ontouchend"in document,n.support.touch){var r,i=n.ui.mouse.prototype,u=i._mouseInit,f=i._mouseDestroy;i._touchStart=function(n){var i=this;!r&&i._mouseCapture(n.originalEvent.changedTouches[0])&&(r=!0,i._touchMoved=!1,t(n,"mouseover"),t(n,"mousemove"),t(n,"mousedown"))},i._touchMove=function(n){r&&(this._touchMoved=!0,t(n,"mousemove"))},i._touchEnd=function(n){r&&(t(n,"mouseup"),t(n,"mouseout"),this._touchMoved||t(n,"click"),r=!1)},i._mouseInit=function(){var t=this;t.element.bind({touchstart:n.proxy(t,"_touchStart"),touchmove:n.proxy(t,"_touchMove"),touchend:n.proxy(t,"_touchEnd")}),u.call(t)},i._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:n.proxy(t,"_touchStart"),touchmove:n.proxy(t,"_touchMove"),touchend:n.proxy(t,"_touchEnd")}),f.call(t)}}}(jQuery);
/*!
 * VERSION: 1.19.1
 * DATE: 2017-01-17
 * UPDATES AND DOCS AT: http://greensock.com
 * 
 * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
 *
 * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
 * This work is subject to the terms at http://greensock.com/standard-license or for
 * Club GreenSock members, the software agreement that was issued with your membership.
 * 
 * @author: Jack Doyle, jack@greensock.com
 **/
_gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(n,t,i){var s=function(n){for(var i=[],r=n.length,t=0;t!==r;i.push(n[t++]));return i},l=function(n,t,i){var u,r,f=n.cycle;for(u in f)r=f[u],n[u]="function"==typeof r?r(i,t[i]):r[i%r.length];delete n.cycle},r=function(n,t,u){i.call(this,n,t,u),this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._dirty=!0,this.render=r.prototype.render},f=1e-10,e=i._internals,a=e.isSelector,v=e.isArray,u=r.prototype=i.to({},.1,{}),y=[],o,h,c;return r.version="1.19.1",u.constructor=r,u.kill()._gc=!1,r.killTweensOf=r.killDelayedCallsTo=i.killTweensOf,r.getTweensOf=i.getTweensOf,r.lagSmoothing=i.lagSmoothing,r.ticker=i.ticker,r.render=i.render,u.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),i.prototype.invalidate.call(this)},u.updateTo=function(n,t){var u,h=this.ratio,f=this.vars.immediateRender||n.immediateRender,e,o,s,r;t&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay));for(u in n)this.vars[u]=n[u];if(this._initted||f)if(t)this._initted=!1,f&&this.render(0,!0,!0);else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&i._onPluginEvent("_onDisable",this),this._time/this._duration>.998)e=this._totalTime,this.render(0,!0,!1),this._initted=!1,this.render(e,!0,!1);else if(this._initted=!1,this._init(),this._time>0||f)for(s=1/(1-h),r=this._firstPT;r;)o=r.s+r.c,r.c*=s,r.s=o-r.c,r=r._next;return this},u.render=function(n,t,i){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var a,s,o,y,r,c,v,p,k=this._dirty?this.totalDuration():this._totalDuration,w=this._time,l=this._totalTime,b=this._cycle,u=this._duration,h=this._rawPrevTime;if(n>=k-1e-7&&n>=0?(this._totalTime=k,this._cycle=this._repeat,this._yoyo&&0!=(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=u,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(a=!0,s="onComplete",i=i||this._timeline.autoRemoveChildren),0===u&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(n=0),(0>h||0>=n&&n>=-1e-7||h===f&&"isPause"!==this.data)&&h!==n&&(i=!0,h>f&&(s="onReverseComplete")),this._rawPrevTime=p=!t||n||h===n?n:f)):1e-7>n?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==l||0===u&&h>0)&&(s="onReverseComplete",a=this._reversed),0>n&&(this._active=!1,0===u&&(this._initted||!this.vars.lazy||i)&&(h>=0&&(i=!0),this._rawPrevTime=p=!t||n||h===n?n:f)),this._initted||(i=!0)):(this._totalTime=this._time=n,0!==this._repeat&&(y=u+this._repeatDelay,this._cycle=this._totalTime/y>>0,0!==this._cycle&&this._cycle===this._totalTime/y&&n>=l&&this._cycle--,this._time=this._totalTime-this._cycle*y,this._yoyo&&0!=(1&this._cycle)&&(this._time=u-this._time),this._time>u?this._time=u:this._time<0&&(this._time=0)),this._easeType?(r=this._time/u,c=this._easeType,v=this._easePower,(1===c||3===c&&r>=.5)&&(r=1-r),3===c&&(r*=2),1===v?r*=r:2===v?r*=r*r:3===v?r*=r*r*r:4===v&&(r*=r*r*r*r),this.ratio=1===c?1-r:2===c?r:this._time/u<.5?r/2:1-r/2):this.ratio=this._ease.getRatio(this._time/u)),w===this._time&&!i&&b===this._cycle)return void(l!==this._totalTime&&this._onUpdate&&(t||this._callback("onUpdate")));if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=w,this._totalTime=l,this._rawPrevTime=h,this._cycle=b,e.lazyTweens.push(this),void(this._lazy=[n,t]);this._time&&!a?this.ratio=this._ease.getRatio(this._time/u):a&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==w&&n>=0&&(this._active=!0),0===l&&(2===this._initted&&n>0&&this._init(),this._startAt&&(n>=0?this._startAt.render(n,t,i):s||(s="_dummyGS")),this.vars.onStart&&(0!==this._totalTime||0===u)&&(t||this._callback("onStart"))),o=this._firstPT;o;)o.f?o.t[o.p](o.c*this.ratio+o.s):o.t[o.p]=o.c*this.ratio+o.s,o=o._next;this._onUpdate&&(0>n&&this._startAt&&this._startTime&&this._startAt.render(n,t,i),t||(this._totalTime!==l||s)&&this._callback("onUpdate")),this._cycle!==b&&(t||this._gc||this.vars.onRepeat&&this._callback("onRepeat")),s&&(!this._gc||i)&&(0>n&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(n,t,i),a&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!t&&this.vars[s]&&this._callback(s),0===u&&this._rawPrevTime===f&&p!==f&&(this._rawPrevTime=0))},r.to=function(n,t,i){return new r(n,t,i)},r.from=function(n,t,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new r(n,t,i)},r.fromTo=function(n,t,i,u){return u.startAt=i,u.immediateRender=0!=u.immediateRender&&0!=i.immediateRender,new r(n,t,u)},r.staggerTo=r.allTo=function(n,t,u,f,e,o,h){f=f||0;var b,c,p,w,d=0,g=[],nt=function(){u.onComplete&&u.onComplete.apply(u.onCompleteScope||this,arguments),e.apply(h||u.callbackScope||this,o||y)},tt=u.cycle,k=u.startAt&&u.startAt.cycle;for(v(n)||("string"==typeof n&&(n=i.selector(n)||n),a(n)&&(n=s(n))),n=n||[],0>f&&(n=s(n),n.reverse(),f*=-1),b=n.length-1,p=0;b>=p;p++){c={};for(w in u)c[w]=u[w];if(tt&&(l(c,n,p),null!=c.duration&&(t=c.duration,delete c.duration)),k){k=c.startAt={};for(w in u.startAt)k[w]=u.startAt[w];l(c.startAt,n,p)}c.delay=d+(c.delay||0),p===b&&e&&(c.onComplete=nt),g[p]=new r(n[p],t,c),d+=f}return g},r.staggerFrom=r.allFrom=function(n,t,i,u,f,e,o){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,r.staggerTo(n,t,i,u,f,e,o)},r.staggerFromTo=r.allFromTo=function(n,t,i,u,f,e,o,s){return u.startAt=i,u.immediateRender=0!=u.immediateRender&&0!=i.immediateRender,r.staggerTo(n,t,u,f,e,o,s)},r.delayedCall=function(n,t,i,u,f){return new r(t,0,{delay:n,onComplete:t,onCompleteParams:i,callbackScope:u,onReverseComplete:t,onReverseCompleteParams:i,immediateRender:!1,useFrames:f,overwrite:0})},r.set=function(n,t){return new r(n,0,t)},r.isTweening=function(n){return i.getTweensOf(n,!0).length>0},o=function(n,t){for(var u=[],f=0,r=n._first;r;)r instanceof i?u[f++]=r:(t&&(u[f++]=r),u=u.concat(o(r,t)),f=u.length),r=r._next;return u},h=r.getAllTweens=function(t){return o(n._rootTimeline,t).concat(o(n._rootFramesTimeline,t))},r.killAll=function(n,i,r,u){null==i&&(i=!0),null==r&&(r=!0);for(var o,f,s=h(0!=u),c=s.length,l=i&&r&&u,e=0;c>e;e++)f=s[e],(l||f instanceof t||(o=f.target===f.vars.onComplete)&&r||i&&!o)&&(n?f.totalTime(f._reversed?0:f.totalDuration()):f._enabled(!1,!1))},r.killChildTweensOf=function(n,t){if(null!=n){var f,o,h,u,l,c=e.tweenLookup;if("string"==typeof n&&(n=i.selector(n)||n),a(n)&&(n=s(n)),v(n))for(u=n.length;--u>-1;)r.killChildTweensOf(n[u],t);else{f=[];for(h in c)for(o=c[h].target.parentNode;o;)o===n&&(f=f.concat(c[h].tweens)),o=o.parentNode;for(l=f.length,u=0;l>u;u++)t&&f[u].totalTime(f[u].totalDuration()),f[u]._enabled(!1,!1)}}},c=function(n,i,r,u){i=i!==!1,r=r!==!1,u=u!==!1;for(var e,f,o=h(u),c=i&&r&&u,s=o.length;--s>-1;)f=o[s],(c||f instanceof t||(e=f.target===f.vars.onComplete)&&r||i&&!e)&&f.paused(n)},r.pauseAll=function(n,t,i){c(!0,n,t,i)},r.resumeAll=function(n,t,i){c(!1,n,t,i)},r.globalTimeScale=function(t){var r=n._rootTimeline,u=i.ticker.time;return arguments.length?(t=t||f,r._startTime=u-(u-r._startTime)*r._timeScale/t,r=n._rootFramesTimeline,u=i.ticker.frame,r._startTime=u-(u-r._startTime)*r._timeScale/t,r._timeScale=n._rootTimeline._timeScale=t,t):r._timeScale},u.progress=function(n,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!=(1&this._cycle)?1-n:n)+this._cycle*(this._duration+this._repeatDelay),t):this._time/this.duration()},u.totalProgress=function(n,t){return arguments.length?this.totalTime(this.totalDuration()*n,t):this._totalTime/this.totalDuration()},u.time=function(n,t){return arguments.length?(this._dirty&&this.totalDuration(),n>this._duration&&(n=this._duration),this._yoyo&&0!=(1&this._cycle)?n=this._duration-n+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(n+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(n,t)):this._time},u.duration=function(t){return arguments.length?n.prototype.duration.call(this,t):this._duration},u.totalDuration=function(n){return arguments.length?-1===this._repeat?this:this.duration((n-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},u.repeat=function(n){return arguments.length?(this._repeat=n,this._uncache(!0)):this._repeat},u.repeatDelay=function(n){return arguments.length?(this._repeatDelay=n,this._uncache(!0)):this._repeatDelay},u.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},r},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(n,t,i){var u=function(n){t.call(this,n),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var r,u,i=this.vars;for(u in i)r=i[u],f(r)&&-1!==r.join("").indexOf("{self}")&&(i[u]=this._swapSelfInParams(r));f(i.tweens)&&this.add(i.tweens,0,i.align,i.stagger)},e=1e-10,o=i._internals,y=u._internals={},p=o.isSelector,f=o.isArray,h=o.lazyTweens,c=o.lazyRender,s=_gsScope._gsDefine.globals,l=function(n){var t,i={};for(t in n)i[t]=n[t];return i},a=function(n,t,i){var u,r,f=n.cycle;for(u in f)r=f[u],n[u]="function"==typeof r?r(i,t[i]):r[i%r.length];delete n.cycle},w=y.pauseCallback=function(){},v=function(n){for(var i=[],r=n.length,t=0;t!==r;i.push(n[t++]));return i},r=u.prototype=new t;return u.version="1.19.1",r.constructor=u,r.kill()._gc=r._forcingPlayhead=r._hasPause=!1,r.to=function(n,t,r,u){var f=r.repeat&&s.TweenMax||i;return t?this.add(new f(n,t,r),u):this.set(n,r,u)},r.from=function(n,t,r,u){return this.add((r.repeat&&s.TweenMax||i).from(n,t,r),u)},r.fromTo=function(n,t,r,u,f){var e=u.repeat&&s.TweenMax||i;return t?this.add(e.fromTo(n,t,r,u),f):this.set(n,u,f)},r.staggerTo=function(n,t,r,f,e,o,s,h){var c,y,w=new u({onComplete:o,onCompleteParams:s,callbackScope:h,smoothChildTiming:this.smoothChildTiming}),b=r.cycle;for("string"==typeof n&&(n=i.selector(n)||n),n=n||[],p(n)&&(n=v(n)),f=f||0,0>f&&(n=v(n),n.reverse(),f*=-1),y=0;y<n.length;y++)c=l(r),c.startAt&&(c.startAt=l(c.startAt),c.startAt.cycle&&a(c.startAt,n,y)),b&&(a(c,n,y),null!=c.duration&&(t=c.duration,delete c.duration)),w.to(n[y],t,c,y*f);return this.add(w,e)},r.staggerFrom=function(n,t,i,r,u,f,e,o){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(n,t,i,r,u,f,e,o)},r.staggerFromTo=function(n,t,i,r,u,f,e,o,s){return r.startAt=i,r.immediateRender=0!=r.immediateRender&&0!=i.immediateRender,this.staggerTo(n,t,r,u,f,e,o,s)},r.call=function(n,t,r,u){return this.add(i.delayedCall(0,n,t,r),u)},r.set=function(n,t,r){return r=this._parseTimeOrLabel(r,0,!0),null==t.immediateRender&&(t.immediateRender=r===this._time&&!this._paused),this.add(new i(n,0,t),r)},u.exportRoot=function(n,t){n=n||{},null==n.smoothChildTiming&&(n.smoothChildTiming=!0);var r,o,f=new u(n),e=f._timeline;for(null==t&&(t=!0),e._remove(f,!0),f._startTime=0,f._rawPrevTime=f._time=f._totalTime=e._time,r=e._first;r;)o=r._next,t&&r instanceof i&&r.target===r.vars.onComplete||f.add(r,r._startTime-r._delay),r=o;return e.add(f,0),f},r.add=function(r,e,o,s){var l,v,a,h,c,y;if("number"!=typeof e&&(e=this._parseTimeOrLabel(e,0,!0,r)),!(r instanceof n)){if(r instanceof Array||r&&r.push&&f(r)){for(o=o||"normal",s=s||0,l=e,v=r.length,a=0;v>a;a++)f(h=r[a])&&(h=new u({tweens:h})),this.add(h,l),"string"!=typeof h&&"function"!=typeof h&&("sequence"===o?l=h._startTime+h.totalDuration()/h._timeScale:"start"===o&&(h._startTime-=h.delay())),l+=s;return this._uncache(!0)}if("string"==typeof r)return this.addLabel(r,e);if("function"!=typeof r)throw"Cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedCall(0,r)}if(t.prototype.add.call(this,r,e),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(c=this,y=c.rawTime()>r._startTime;c._timeline;)y&&c._timeline.smoothChildTiming?c.totalTime(c._totalTime,!0):c._gc&&c._enabled(!0,!1),c=c._timeline;return this},r.remove=function(t){var r,i;if(t instanceof n)return this._remove(t,!1),r=t._timeline=t.vars.useFrames?n._rootFramesTimeline:n._rootTimeline,t._startTime=(t._paused?t._pauseTime:r._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this;if(t instanceof Array||t&&t.push&&f(t)){for(i=t.length;--i>-1;)this.remove(t[i]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},r._remove=function(n,i){t.prototype._remove.call(this,n,i);var r=this._last;return r?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},r.append=function(n,t){return this.add(n,this._parseTimeOrLabel(null,t,!0,n))},r.insert=r.insertMultiple=function(n,t,i,r){return this.add(n,t||0,i,r)},r.appendMultiple=function(n,t,i,r){return this.add(n,this._parseTimeOrLabel(null,t,!0,n),i,r)},r.addLabel=function(n,t){return this._labels[n]=this._parseTimeOrLabel(t),this},r.addPause=function(n,t,r,u){var f=i.delayedCall(0,w,r,u||this);return f.vars.onComplete=f.vars.onReverseComplete=t,f.data="isPause",this._hasPause=!0,this.add(f,n)},r.removeLabel=function(n){return delete this._labels[n],this},r.getLabelTime=function(n){return null!=this._labels[n]?this._labels[n]:-1},r._parseTimeOrLabel=function(t,i,r,u){var e;if(u instanceof n&&u.timeline===this)this.remove(u);else if(u&&(u instanceof Array||u.push&&f(u)))for(e=u.length;--e>-1;)u[e]instanceof n&&u[e].timeline===this&&this.remove(u[e]);if("string"==typeof i)return this._parseTimeOrLabel(i,r&&"number"==typeof t&&null==this._labels[i]?t-this.duration():0,r);if(i=i||0,"string"==typeof t&&(isNaN(t)||null!=this._labels[t])){if(e=t.indexOf("="),-1===e)return null==this._labels[t]?r?this._labels[t]=this.duration()+i:i:this._labels[t]+i;i=parseInt(t.charAt(e-1)+"1",10)*Number(t.substr(e+1)),t=e>1?this._parseTimeOrLabel(t.substr(0,e-1),0,r):this.duration()}else null==t&&(t=this.duration());return Number(t)+i},r.seek=function(n,t){return this.totalTime("number"==typeof n?n:this._parseTimeOrLabel(n),t!==!1)},r.stop=function(){return this.paused(!0)},r.gotoAndPlay=function(n,t){return this.play(n,t)},r.gotoAndStop=function(n,t){return this.pause(n,t)},r.render=function(n,t,i){this._gc&&this._enabled(!0,!1);var r,s,v,f,l,u,a,y=this._dirty?this.totalDuration():this._totalDuration,o=this._time,w=this._startTime,b=this._timeScale,p=this._paused;if(n>=y-1e-7&&n>=0)this._totalTime=this._time=y,this._reversed||this._hasPausedChild()||(s=!0,f="onComplete",l=!!this._timeline.autoRemoveChildren,0===this._duration&&(0>=n&&n>=-1e-7||this._rawPrevTime<0||this._rawPrevTime===e)&&this._rawPrevTime!==n&&this._first&&(l=!0,this._rawPrevTime>e&&(f="onReverseComplete"))),this._rawPrevTime=this._duration||!t||n||this._rawPrevTime===n?n:e,n=y+.0001;else if(1e-7>n)if(this._totalTime=this._time=0,(0!==o||0===this._duration&&this._rawPrevTime!==e&&(this._rawPrevTime>0||0>n&&this._rawPrevTime>=0))&&(f="onReverseComplete",s=this._reversed),0>n)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(l=s=!0,f="onReverseComplete"):this._rawPrevTime>=0&&this._first&&(l=!0),this._rawPrevTime=n;else{if(this._rawPrevTime=this._duration||!t||n||this._rawPrevTime===n?n:e,0===n&&s)for(r=this._first;r&&0===r._startTime;)r._duration||(s=!1),r=r._next;n=0,this._initted||(l=!0)}else{if(this._hasPause&&!this._forcingPlayhead&&!t){if(n>=o)for(r=this._first;r&&r._startTime<=n&&!u;)r._duration||"isPause"!==r.data||r.ratio||0===r._startTime&&0===this._rawPrevTime||(u=r),r=r._next;else for(r=this._last;r&&r._startTime>=n&&!u;)r._duration||"isPause"===r.data&&r._rawPrevTime>0&&(u=r),r=r._prev;u&&(this._time=n=u._startTime,this._totalTime=n+this._cycle*(this._totalDuration+this._repeatDelay))}this._totalTime=this._time=this._rawPrevTime=n}if(this._time!==o&&this._first||i||l||u){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==o&&n>0&&(this._active=!0),0===o&&this.vars.onStart&&(0===this._time&&this._duration||t||this._callback("onStart")),a=this._time,a>=o)for(r=this._first;r&&(v=r._next,a===this._time&&(!this._paused||p));)(r._active||r._startTime<=a&&!r._paused&&!r._gc)&&(u===r&&this.pause(),r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(n-r._startTime)*r._timeScale,t,i):r.render((n-r._startTime)*r._timeScale,t,i)),r=v;else for(r=this._last;r&&(v=r._prev,a===this._time&&(!this._paused||p));){if(r._active||r._startTime<=o&&!r._paused&&!r._gc){if(u===r){for(u=r._prev;u&&u.endTime()>this._time;)u.render(u._reversed?u.totalDuration()-(n-u._startTime)*u._timeScale:(n-u._startTime)*u._timeScale,t,i),u=u._prev;u=null,this.pause()}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(n-r._startTime)*r._timeScale,t,i):r.render((n-r._startTime)*r._timeScale,t,i)}r=v}this._onUpdate&&(t||(h.length&&c(),this._callback("onUpdate"))),f&&(this._gc||(w===this._startTime||b!==this._timeScale)&&(0===this._time||y>=this.totalDuration())&&(s&&(h.length&&c(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!t&&this.vars[f]&&this._callback(f)))}},r._hasPausedChild=function(){for(var n=this._first;n;){if(n._paused||n instanceof u&&n._hasPausedChild())return!0;n=n._next}return!1},r.getChildren=function(n,t,r,u){u=u||-9999999999;for(var e=[],f=this._first,o=0;f;)f._startTime<u||(f instanceof i?t!==!1&&(e[o++]=f):(r!==!1&&(e[o++]=f),n!==!1&&(e=e.concat(f.getChildren(!0,t,r)),o=e.length))),f=f._next;return e},r.getTweensOf=function(n,t){var r,u,f=this._gc,e=[],o=0;for(f&&this._enabled(!0,!0),r=i.getTweensOf(n),u=r.length;--u>-1;)(r[u].timeline===this||t&&this._contains(r[u]))&&(e[o++]=r[u]);return f&&this._enabled(!1,!0),e},r.recent=function(){return this._recent},r._contains=function(n){for(var t=n.timeline;t;){if(t===this)return!0;t=t.timeline}return!1},r.shiftChildren=function(n,t,i){i=i||0;for(var u,r=this._first,f=this._labels;r;)r._startTime>=i&&(r._startTime+=n),r=r._next;if(t)for(u in f)f[u]>=i&&(f[u]+=n);return this._uncache(!0)},r._kill=function(n,t){if(!n&&!t)return this._enabled(!1,!1);for(var i=t?this.getTweensOf(t):this.getChildren(!0,!0,!1),r=i.length,u=!1;--r>-1;)i[r]._kill(n,t)&&(u=!0);return u},r.clear=function(n){var t=this.getChildren(!1,!0,!0),i=t.length;for(this._time=this._totalTime=0;--i>-1;)t[i]._enabled(!1,!1);return n!==!1&&(this._labels={}),this._uncache(!0)},r.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return n.prototype.invalidate.call(this)},r._enabled=function(n,i){if(n===this._gc)for(var r=this._first;r;)r._enabled(n,!0),r=r._next;return t.prototype._enabled.call(this,n,i)},r.totalTime=function(){this._forcingPlayhead=!0;var t=n.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,t},r.duration=function(n){return arguments.length?(0!==this.duration()&&0!==n&&this.timeScale(this._duration/n),this):(this._dirty&&this.totalDuration(),this._duration)},r.totalDuration=function(n){if(!arguments.length){if(this._dirty){for(var f,r,i=0,t=this._last,u=999999999999;t;)f=t._prev,t._dirty&&t.totalDuration(),t._startTime>u&&this._sortChildren&&!t._paused?this.add(t,t._startTime-t._delay):u=t._startTime,t._startTime<0&&!t._paused&&(i-=t._startTime,this._timeline.smoothChildTiming&&(this._startTime+=t._startTime/this._timeScale),this.shiftChildren(-t._startTime,!1,-9999999999),u=0),r=t._startTime+t._totalDuration/t._timeScale,r>i&&(i=r),t=f;this._duration=this._totalDuration=i,this._dirty=!1}return this._totalDuration}return n&&this.totalDuration()?this.timeScale(this._totalDuration/n):this},r.paused=function(t){if(!t)for(var i=this._first,r=this._time;i;)i._startTime===r&&"isPause"===i.data&&(i._rawPrevTime=0),i=i._next;return n.prototype.paused.apply(this,arguments)},r.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===n._rootFramesTimeline},r.rawTime=function(n){return n&&(this._paused||this._repeat&&this.time()>0&&this.totalProgress()<1)?this._totalTime%(this._duration+this._repeatDelay):this._paused?this._totalTime:(this._timeline.rawTime(n)-this._startTime)*this._timeScale},u},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(n,t,i){var f=function(t){n.call(this,t),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},u=1e-10,e=t._internals,o=e.lazyTweens,s=e.lazyRender,h=_gsScope._gsDefine.globals,c=new i(null,null,1,0),r=f.prototype=new n;return r.constructor=f,r.kill()._gc=!1,f.version="1.19.1",r.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),n.prototype.invalidate.call(this)},r.addCallback=function(n,i,r,u){return this.add(t.delayedCall(0,n,r,u),i)},r.removeCallback=function(n,t){if(n)if(null==t)this._kill(null,n);else for(var i=this.getTweensOf(n,!1),r=i.length,u=this._parseTimeOrLabel(t);--r>-1;)i[r]._startTime===u&&i[r]._enabled(!1,!1);return this},r.removePause=function(t){return this.removeCallback(n._internals.pauseCallback,t)},r.tweenTo=function(n,i){i=i||{};var f,e,r,u={ease:c,useFrames:this.usesFrames(),immediateRender:!1},o=i.repeat&&h.TweenMax||t;for(e in i)u[e]=i[e];return u.time=this._parseTimeOrLabel(n),f=Math.abs(Number(u.time)-this._time)/this._timeScale||.001,r=new o(this,f,u),u.onStart=function(){r.target.paused(!0),r.vars.time!==r.target.time()&&f===r.duration()&&r.duration(Math.abs(r.vars.time-r.target.time())/r.target._timeScale),i.onStart&&i.onStart.apply(i.onStartScope||i.callbackScope||r,i.onStartParams||[])},r},r.tweenFromTo=function(n,t,i){i=i||{},n=this._parseTimeOrLabel(n),i.startAt={onComplete:this.seek,onCompleteParams:[n],callbackScope:this},i.immediateRender=i.immediateRender!==!1;var r=this.tweenTo(t,i);return r.duration(Math.abs(r.vars.time-n)/this._timeScale||.001)},r.render=function(n,t,i){this._gc&&this._enabled(!0,!1);var r,y,w,l,a,b,f,k,g=this._dirty?this.totalDuration():this._totalDuration,e=this._duration,h=this._time,d=this._totalTime,it=this._startTime,rt=this._timeScale,c=this._rawPrevTime,nt=this._paused,v=this._cycle;if(n>=g-1e-7&&n>=0)this._locked||(this._totalTime=g,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(y=!0,l="onComplete",a=!!this._timeline.autoRemoveChildren,0===this._duration&&(0>=n&&n>=-1e-7||0>c||c===u)&&c!==n&&this._first&&(a=!0,c>u&&(l="onReverseComplete"))),this._rawPrevTime=this._duration||!t||n||this._rawPrevTime===n?n:u,this._yoyo&&0!=(1&this._cycle)?this._time=n=0:(this._time=e,n=e+.0001);else if(1e-7>n)if(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==h||0===e&&c!==u&&(c>0||0>n&&c>=0)&&!this._locked)&&(l="onReverseComplete",y=this._reversed),0>n)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(a=y=!0,l="onReverseComplete"):c>=0&&this._first&&(a=!0),this._rawPrevTime=n;else{if(this._rawPrevTime=e||!t||n||this._rawPrevTime===n?n:u,0===n&&y)for(r=this._first;r&&0===r._startTime;)r._duration||(y=!1),r=r._next;n=0,this._initted||(a=!0)}else if(0===e&&0>c&&(a=!0),this._time=this._rawPrevTime=n,this._locked||(this._totalTime=n,0!==this._repeat&&(b=e+this._repeatDelay,this._cycle=this._totalTime/b>>0,0!==this._cycle&&this._cycle===this._totalTime/b&&n>=d&&this._cycle--,this._time=this._totalTime-this._cycle*b,this._yoyo&&0!=(1&this._cycle)&&(this._time=e-this._time),this._time>e?(this._time=e,n=e+.0001):this._time<0?this._time=n=0:n=this._time)),this._hasPause&&!this._forcingPlayhead&&!t&&e>n){if(n=this._time,n>=h||this._repeat&&v!==this._cycle)for(r=this._first;r&&r._startTime<=n&&!f;)r._duration||"isPause"!==r.data||r.ratio||0===r._startTime&&0===this._rawPrevTime||(f=r),r=r._next;else for(r=this._last;r&&r._startTime>=n&&!f;)r._duration||"isPause"===r.data&&r._rawPrevTime>0&&(f=r),r=r._prev;f&&(this._time=n=f._startTime,this._totalTime=n+this._cycle*(this._totalDuration+this._repeatDelay))}if(this._cycle!==v&&!this._locked){var p=this._yoyo&&0!=(1&v),ut=p===(this._yoyo&&0!=(1&this._cycle)),ft=this._totalTime,tt=this._cycle,et=this._rawPrevTime,ot=this._time;if(this._totalTime=v*e,this._cycle<v?p=!p:this._totalTime+=e,this._time=h,this._rawPrevTime=0===e?c-.0001:c,this._cycle=v,this._locked=!0,h=p?0:e,this.render(h,t,0===e),t||this._gc||this.vars.onRepeat&&(this._cycle=tt,this._locked=!1,this._callback("onRepeat")),h!==this._time)return;if(ut&&(this._cycle=v,this._locked=!0,h=p?e+.0001:-.0001,this.render(h,!0,!1)),this._locked=!1,this._paused&&!nt)return;this._time=ot,this._totalTime=ft,this._cycle=tt,this._rawPrevTime=et}if(!(this._time!==h&&this._first||i||a||f))return void(d!==this._totalTime&&this._onUpdate&&(t||this._callback("onUpdate")));if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==d&&n>0&&(this._active=!0),0===d&&this.vars.onStart&&(0===this._totalTime&&this._totalDuration||t||this._callback("onStart")),k=this._time,k>=h)for(r=this._first;r&&(w=r._next,k===this._time&&(!this._paused||nt));)(r._active||r._startTime<=this._time&&!r._paused&&!r._gc)&&(f===r&&this.pause(),r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(n-r._startTime)*r._timeScale,t,i):r.render((n-r._startTime)*r._timeScale,t,i)),r=w;else for(r=this._last;r&&(w=r._prev,k===this._time&&(!this._paused||nt));){if(r._active||r._startTime<=h&&!r._paused&&!r._gc){if(f===r){for(f=r._prev;f&&f.endTime()>this._time;)f.render(f._reversed?f.totalDuration()-(n-f._startTime)*f._timeScale:(n-f._startTime)*f._timeScale,t,i),f=f._prev;f=null,this.pause()}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(n-r._startTime)*r._timeScale,t,i):r.render((n-r._startTime)*r._timeScale,t,i)}r=w}this._onUpdate&&(t||(o.length&&s(),this._callback("onUpdate"))),l&&(this._locked||this._gc||(it===this._startTime||rt!==this._timeScale)&&(0===this._time||g>=this.totalDuration())&&(y&&(o.length&&s(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!t&&this.vars[l]&&this._callback(l)))},r.getActive=function(n,t,i){null==n&&(n=!0),null==t&&(t=!0),null==i&&(i=!1);for(var u,f=[],e=this.getChildren(n,t,i),o=0,s=e.length,r=0;s>r;r++)u=e[r],u.isActive()&&(f[o++]=u);return f},r.getLabelAfter=function(n){n||0!==n&&(n=this._time);for(var i=this.getLabelsArray(),r=i.length,t=0;r>t;t++)if(i[t].time>n)return i[t].name;return null},r.getLabelBefore=function(n){null==n&&(n=this._time);for(var t=this.getLabelsArray(),i=t.length;--i>-1;)if(t[i].time<n)return t[i].name;return null},r.getLabelsArray=function(){var n,t=[],i=0;for(n in this._labels)t[i++]={time:this._labels[n],name:n};return t.sort(function(n,t){return n.time-t.time}),t},r.invalidate=function(){return this._locked=!1,n.prototype.invalidate.call(this)},r.progress=function(n,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!=(1&this._cycle)?1-n:n)+this._cycle*(this._duration+this._repeatDelay),t):this._time/this.duration()},r.totalProgress=function(n,t){return arguments.length?this.totalTime(this.totalDuration()*n,t):this._totalTime/this.totalDuration()},r.totalDuration=function(t){return arguments.length?-1!==this._repeat&&t?this.timeScale(this.totalDuration()/t):this:(this._dirty&&(n.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},r.time=function(n,t){return arguments.length?(this._dirty&&this.totalDuration(),n>this._duration&&(n=this._duration),this._yoyo&&0!=(1&this._cycle)?n=this._duration-n+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(n+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(n,t)):this._time},r.repeat=function(n){return arguments.length?(this._repeat=n,this._uncache(!0)):this._repeat},r.repeatDelay=function(n){return arguments.length?(this._repeatDelay=n,this._uncache(!0)):this._repeatDelay},r.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},r.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.getLabelBefore(this._time+1e-8)},f},!0),function(){var h=180/Math.PI,n=[],t=[],i=[],f={},c=_gsScope._gsDefine.globals,u=function(n,t,i,r){i===r&&(i=r-(r-t)/1e6),n===t&&(t=n+(i-n)/1e6),this.a=n,this.b=t,this.c=i,this.d=r,this.da=r-n,this.ca=i-n,this.ba=t-n},l=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",e=function(n,t,i,r){var e={a:n},u={},f={},o={c:r},s=(n+t)/2,a=(t+i)/2,h=(i+r)/2,c=(s+a)/2,l=(a+h)/2,v=(l-c)/8;return e.b=s+(n-s)/4,u.b=c+v,e.c=u.a=(e.b+u.b)/2,u.c=f.a=(c+l)/2,f.b=l-v,o.b=h+(r-h)/4,f.c=o.a=(f.b+o.b)/2,[e,u,f,o]},a=function(r,u,f,o,s){for(var y,c,nt,h,p,b,g,tt,l,k,d,it,rt=r.length-1,w=0,a=r[0].a,v=0;rt>v;v++)h=r[w],y=h.a,c=h.d,nt=r[w+1].d,s?(k=n[v],d=t[v],it=(d+k)*u*.25/(o?.5:i[v]||.5),p=c-(c-y)*(o?.5*u:0!==k?it/k:0),b=c+(nt-c)*(o?.5*u:0!==d?it/d:0),g=c-(p+((b-p)*(3*k/(k+d)+.5)/4||0))):(p=c-(c-y)*u*.5,b=c+(nt-c)*u*.5,g=c-(p+b)/2),p+=g,b+=g,h.c=tt=p,h.b=0!==v?a:a=h.a+.6*(h.c-h.a),h.da=c-y,h.ca=tt-y,h.ba=a-y,f?(l=e(y,a,tt,c),r.splice(w,1,l[0],l[1],l[2],l[3]),w+=4):w++,a=b;h=r[w],h.b=a,h.c=a+.4*(h.d-a),h.da=h.d-h.a,h.ca=h.c-h.a,h.ba=a-h.a,f&&(l=e(h.a,a,h.c,h.d),r.splice(w,1,l[0],l[1],l[2],l[3]))},v=function(i,r,f,e){var c,o,l,s,v,a,h=[];if(e)for(i=[e].concat(i),o=i.length;--o>-1;)"string"==typeof(a=i[o][r])&&"="===a.charAt(1)&&(i[o][r]=e[r]+Number(a.charAt(0)+a.substr(2)));if(c=i.length-2,0>c)return h[0]=new u(i[0][r],0,0,i[-1>c?0:1][r]),h;for(o=0;c>o;o++)l=i[o][r],s=i[o+1][r],h[o]=new u(l,0,0,s),f&&(v=i[o+2][r],n[o]=(n[o]||0)+(s-l)*(s-l),t[o]=(t[o]||0)+(v-s)*(v-s));return h[o]=new u(i[o][r],0,0,i[o+1][r]),h},o=function(r,u,e,o,s,h){var c,y,w,p,g,nt,k,tt,d={},b=[],it=h||r[0];s="string"==typeof s?","+s+",":l,null==u&&(u=1);for(y in r[0])b.push(y);if(r.length>1){for(tt=r[r.length-1],k=!0,c=b.length;--c>-1;)if(y=b[c],Math.abs(it[y]-tt[y])>.05){k=!1;break}k&&(r=r.concat(),h&&r.unshift(h),r.push(r[1]),h=r[r.length-3])}for(n.length=t.length=i.length=0,c=b.length;--c>-1;)y=b[c],f[y]=-1!==s.indexOf(","+y+","),d[y]=v(r,y,f[y],h);for(c=n.length;--c>-1;)n[c]=Math.sqrt(n[c]),t[c]=Math.sqrt(t[c]);if(!o){for(c=b.length;--c>-1;)if(f[y])for(w=d[b[c]],nt=w.length-1,p=0;nt>p;p++)g=w[p+1].da/t[p]+w[p].da/n[p]||0,i[p]=(i[p]||0)+g*g;for(c=i.length;--c>-1;)i[c]=Math.sqrt(i[c])}for(c=b.length,p=e?4:1;--c>-1;)y=b[c],w=d[y],a(w,u,e,o,f[y]),k&&(w.splice(0,p),w.splice(w.length-p,p));return d},y=function(n,t,i){t=t||"soft";var o,a,v,w,f,y,r,c,s,e,h,b={},l="cubic"===t?3:2,k="soft"===t,p=[];if(k&&i&&(n=[i].concat(n)),null==n||n.length<l+1)throw"invalid Bezier data";for(s in n[0])p.push(s);for(y=p.length;--y>-1;){for(s=p[y],b[s]=f=[],e=0,c=n.length,r=0;c>r;r++)o=null==i?n[r][s]:"string"==typeof(h=n[r][s])&&"="===h.charAt(1)?i[s]+Number(h.charAt(0)+h.substr(2)):Number(h),k&&r>1&&c-1>r&&(f[e++]=(o+f[e-2])/2),f[e++]=o;for(c=e-l+1,e=0,r=0;c>r;r+=l)o=f[r],a=f[r+1],v=f[r+2],w=2===l?0:f[r+3],f[e++]=h=3===l?new u(o,a,v,w):new u(o,(2*a+o)/3,(2*a+v)/3,v);f.length=e}return b},p=function(n,t,i){for(var e,s,o,a,v,y,r,u,h,f,c,p=1/i,l=n.length;--l>-1;)for(f=n[l],o=f.a,a=f.d-o,v=f.c-o,y=f.b-o,e=s=0,u=1;i>=u;u++)r=p*u,h=1-r,e=s-(s=(r*r*a+3*h*(r*v+h*y))*r),c=l*i+u-1,t[c]=(t[c]||0)+e*e},w=function(n,t){t=t>>0||6;var s,i,h,r,f=[],c=[],u=0,e=0,a=t-1,l=[],o=[];for(s in n)p(n[s],f,t);for(h=f.length,i=0;h>i;i++)u+=Math.sqrt(f[i]),r=i%t,o[r]=u,r===a&&(e+=u,r=i/t>>0,l[r]=o,c[r]=e,u=0,o=[]);return{length:e,lengths:c,segments:l}},r=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.7",API:2,global:!0,init:function(n,t,i){var c;this._target=n,t instanceof Array&&(t={values:t}),this._func={},this._mod={},this._props=[],this._timeRes=null==t.timeResolution?6:parseInt(t.timeResolution,10);var r,a,f,e,l,s=t.values||[],h={},v=s[0],u=t.autoRotate||i.vars.orientToBezier;this._autoRotate=u?u instanceof Array?u:[["x","y","rotation",u===!0?0:Number(u)||0]]:null;for(r in v)this._props.push(r);for(f=this._props.length;--f>-1;)r=this._props[f],this._overwriteProps.push(r),a=this._func[r]="function"==typeof n[r],h[r]=a?n[r.indexOf("set")||"function"!=typeof n["get"+r.substr(3)]?r:"get"+r.substr(3)]():parseFloat(n[r]),l||h[r]!==s[0][r]&&(l=h);if((this._beziers="cubic"!==t.type&&"quadratic"!==t.type&&"soft"!==t.type?o(s,isNaN(t.curviness)?1:t.curviness,!1,"thruBasic"===t.type,t.correlate,l):y(s,t.type,h),this._segCount=this._beziers[r].length,this._timeRes)&&(c=w(this._beziers,this._timeRes),this._length=c.length,this._lengths=c.lengths,this._segments=c.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length),u=this._autoRotate)for(this._initialRotations=[],u[0]instanceof Array||(this._autoRotate=u=[u]),f=u.length;--f>-1;){for(e=0;3>e;e++)r=u[f][e],this._func[r]="function"==typeof n[r]?n[r.indexOf("set")||"function"!=typeof n["get"+r.substr(3)]?r:"get"+r.substr(3)]:!1;r=u[f][2],this._initialRotations[f]=(this._func[r]?this._func[r].call(this._target):this._target[r])||0,this._overwriteProps.push(r)}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(n){var c,d,t,u,i,r,o,w,v,f,l=this._segCount,g=this._func,a=this._target,it=n!==this._startRatio,e,b,k,y,p,nt,tt,s;if(this._timeRes){if(v=this._lengths,f=this._curSeg,n*=this._length,t=this._li,n>this._l2&&l-1>t){for(w=l-1;w>t&&(this._l2=v[++t])<=n;);this._l1=v[t-1],this._li=t,this._curSeg=f=this._segments[t],this._s2=f[this._s1=this._si=0]}else if(n<this._l1&&t>0){for(;t>0&&(this._l1=v[--t])>=n;);0===t&&n<this._l1?this._l1=0:t++,this._l2=v[t],this._li=t,this._curSeg=f=this._segments[t],this._s1=f[(this._si=f.length-1)-1]||0,this._s2=f[this._si]}if(c=t,n-=this._l1,t=this._si,n>this._s2&&t<f.length-1){for(w=f.length-1;w>t&&(this._s2=f[++t])<=n;);this._s1=f[t-1],this._si=t}else if(n<this._s1&&t>0){for(;t>0&&(this._s1=f[--t])>=n;);0===t&&n<this._s1?this._s1=0:t++,this._s2=f[t],this._si=t}r=(t+(n-this._s1)/(this._s2-this._s1))*this._prec||0}else c=0>n?0:n>=1?l-1:l*n>>0,r=(n-c*(1/l))*l;for(d=1-r,t=this._props.length;--t>-1;)u=this._props[t],i=this._beziers[u][c],o=(r*r*i.da+3*d*(r*i.ca+d*i.ba))*r+i.a,this._mod[u]&&(o=this._mod[u](o,a)),g[u]?a[u](o):a[u]=o;if(this._autoRotate)for(s=this._autoRotate,t=s.length;--t>-1;)u=s[t][2],nt=s[t][3]||0,tt=s[t][4]===!0?1:h,i=this._beziers[s[t][0]],e=this._beziers[s[t][1]],i&&e&&(i=i[c],e=e[c],b=i.a+(i.b-i.a)*r,y=i.b+(i.c-i.b)*r,b+=(y-b)*r,y+=(i.c+(i.d-i.c)*r-y)*r,k=e.a+(e.b-e.a)*r,p=e.b+(e.c-e.b)*r,k+=(p-k)*r,p+=(e.c+(e.d-e.c)*r-p)*r,o=it?Math.atan2(p-k,y-b)*tt+nt:this._initialRotations[t],this._mod[u]&&(o=this._mod[u](o,a)),g[u]?a[u](o):a[u]=o)}}),s=r.prototype;r.bezierThrough=o,r.cubicToQuadratic=e,r._autoCSS=!0,r.quadraticToCubic=function(n,t,i){return new u(n,(2*t+n)/3,(2*t+i)/3,i)},r._cssRegister=function(){var t=c.CSSPlugin;if(t){var n=t._internals,i=n._parseToProxy,u=n._setPluginRatio,f=n.CSSPropTween;n._registerComplexSpecialProp("bezier",{parser:function(n,t,e,o,s,h){t instanceof Array&&(t={values:t}),h=new r;var a,v,l,p=t.values,y=p.length-1,w=[],c={};if(0>y)return s;for(a=0;y>=a;a++)l=i(n,p[a],o,s,h,y!==a),w[a]=l.end;for(v in t)c[v]=t[v];return c.values=w,s=new f(n,"bezier",0,0,l.pt,2),s.data=l,s.plugin=h,s.setRatio=u,0===c.autoRotate&&(c.autoRotate=!0),!c.autoRotate||c.autoRotate instanceof Array||(a=c.autoRotate===!0?0:Number(c.autoRotate),c.autoRotate=null!=l.end.left?[["left","top","rotation",a,!1]]:null!=l.end.x?[["x","y","rotation",a,!1]]:!1),c.autoRotate&&(o._transform||o._enableTransforms(!1),l.autoRotate=o._target._gsTransform,l.proxy.rotation=l.autoRotate.rotation||0,o._overwriteProps.push("rotation")),h._onInitTween(l.proxy,c,o._tween),s}})}},s._mod=function(n){for(var t,i=this._overwriteProps,r=i.length;--r>-1;)t=n[i[r]],t&&"function"==typeof t&&(this._mod[i[r]]=t)},s._kill=function(n){var r,t,i=this._props;for(r in this._beziers)if(r in n)for(delete this._beziers[r],delete this._func[r],t=i.length;--t>-1;)i[t]===r&&i.splice(t,1);if(i=this._autoRotate)for(t=i.length;--t>-1;)n[i[t][2]]&&i.splice(t,1);return this._super._kill.call(this,n)}}(),_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(n,t){var ct,ti,e,oi,r=function(){n.call(this,"css"),this._overwriteProps.length=0,this.setRatio=r.prototype.setRatio},ru=_gsScope._gsDefine.globals,v={},i=r.prototype=new n("css"),gr,ht,nu,tu,iu,ni;i.constructor=r,r.version="1.19.1",r.API=2,r.defaultTransformPerspective=0,r.defaultSkewType="compensated",r.defaultSmoothOrigin=!0,i="px",r.suffixMap={top:i,right:i,bottom:i,left:i,width:i,height:i,fontSize:i,padding:i,margin:i,perspective:i,lineHeight:""};var si,er,hi,ci,or,ot,it,nt,lt=/(?:\-|\.|\b)(\d|\.|e\-)+/g,li=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,ai=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,vi=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,at=/(?:\d|\-|\+|=|#|\.)*/g,yi=/opacity *= *([^)]*)/i,uu=/opacity:([^;]*)/i,fu=/alpha\(opacity *=.+?\)/i,eu=/^(rgb|hsl)/,sr=/([A-Z])/g,hr=/-([a-z])/gi,ou=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,cr=function(n,t){return t.toUpperCase()},su=/(?:Left|Right|Width)/i,hu=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,cu=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,k=/,(?=[^\)]*(?:\(|$))/gi,lu=/[\s,\(]/i,a=Math.PI/180,rt=180/Math.PI,ii={},au={style:{}},y=_gsScope.document||{createElement:function(){return au}},ri=function(n,t){return y.createElementNS?y.createElementNS(t||"http://www.w3.org/1999/xhtml",n):y.createElement(n)},d=ri("div"),pi=ri("img"),p=r._internals={_specialProps:v},g=(_gsScope.navigator||{}).userAgent||"",ut=function(){var t=g.indexOf("Android"),n=ri("a");return hi=-1!==g.indexOf("Safari")&&-1===g.indexOf("Chrome")&&(-1===t||parseFloat(g.substr(t+8,2))>3),or=hi&&parseFloat(g.substr(g.indexOf("Version/")+8,2))<6,ci=-1!==g.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(g)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(g))&&(ot=parseFloat(RegExp.$1)),n?(n.style.cssText="top:1px;opacity:.55;",/^0.55/.test(n.style.opacity)):!1}(),lr=function(n){return yi.test("string"==typeof n?n:(n.currentStyle?n.currentStyle.filter:n.style.filter)||"")?parseFloat(RegExp.$1)/100:1},ar=function(n){_gsScope.console&&console.log(n)},vr="",wi="",vt=function(n,t){t=t||d;var r,i,u=t.style;if(void 0!==u[n])return n;for(n=n.charAt(0).toUpperCase()+n.substr(1),r=["O","Moz","ms","Ms","Webkit"],i=5;--i>-1&&void 0===u[r[i]+n];);return i>=0?(wi=3===i?"ms":r[i],vr="-"+wi.toLowerCase()+"-",wi+n):null},ft=y.defaultView?y.defaultView.getComputedStyle:function(){},u=r.getStyle=function(n,t,i,r,u){var f;return ut||"opacity"!==t?(!r&&n.style[t]?f=n.style[t]:(i=i||ft(n))?f=i[t]||i.getPropertyValue(t)||i.getPropertyValue(t.replace(sr,"-$1").toLowerCase()):n.currentStyle&&(f=n.currentStyle[t]),null==u||f&&"none"!==f&&"auto"!==f&&"auto auto"!==f?f:u):lr(n)},w=p.convertToPixels=function(n,i,f,e,o){if("px"===e||!e)return f;if("auto"===e||!f)return 0;var s,h,a,l=su.test(i),c=n,v=d.style,p=0>f,b=1===f;if(p&&(f=-f),b&&(f*=100),"%"===e&&-1!==i.indexOf("border"))s=f/100*(l?n.clientWidth:n.clientHeight);else{if(v.cssText="border:0 solid red;position:"+u(n,"position")+";line-height:0;","%"!==e&&c.appendChild&&"v"!==e.charAt(0)&&"rem"!==e)v[l?"borderLeftWidth":"borderTopWidth"]=f+e;else{if(c=n.parentNode||y.body,h=c._gsCache,a=t.ticker.frame,h&&l&&h.time===a)return h.width*f/100;v[l?"width":"height"]=f+e}c.appendChild(d),s=parseFloat(d[l?"offsetWidth":"offsetHeight"]),c.removeChild(d),l&&"%"===e&&r.cacheWidths!==!1&&(h=c._gsCache=c._gsCache||{},h.time=a,h.width=s/f*100),0!==s||o||(s=w(n,i,f,e,!0))}return b&&(s/=100),p?-s:s},yr=p.calculateOffset=function(n,t,i){if("absolute"!==u(n,"position",i))return 0;var r="left"===t?"Left":"Top",f=u(n,"margin"+r,i);return n["offset"+r]-(w(n,t,parseFloat(f),f.replace(at,""))||0)},yt=function(n,t){var r,u,f,i={};if(t=t||ft(n,null))if(r=t.length)for(;--r>-1;)f=t[r],(-1===f.indexOf("-transform")||tr===f)&&(i[f.replace(hr,cr)]=t.getPropertyValue(f));else for(r in t)(-1===r.indexOf("Transform")||h===r)&&(i[r]=t[r]);else if(t=n.currentStyle||n.style)for(r in t)"string"==typeof r&&void 0===i[r]&&(i[r.replace(hr,cr)]=t[r]);return ut||(i.opacity=lr(n)),u=gt(n,t,!1),i.rotation=u.rotation,i.skewX=u.skewX,i.scaleX=u.scaleX,i.scaleY=u.scaleY,i.x=u.x,i.y=u.y,b&&(i.z=u.z,i.rotationX=u.rotationX,i.rotationY=u.rotationY,i.scaleZ=u.scaleZ),i.filters&&delete i.filters,i},bi=function(n,t,i,r,u){var e,f,o,s={},h=n.style;for(f in i)"cssText"!==f&&"length"!==f&&isNaN(f)&&(t[f]!==(e=i[f])||u&&u[f])&&-1===f.indexOf("Origin")&&("number"==typeof e||"string"==typeof e)&&(s[f]="auto"!==e||"left"!==f&&"top"!==f?""!==e&&"auto"!==e&&"none"!==e||"string"!=typeof t[f]||""===t[f].replace(vi,"")?e:0:yr(n,f),void 0!==h[f]&&(o=new nr(h,f,h[f],o)));if(r)for(f in r)"className"!==f&&(s[f]=r[f]);return{difs:s,firstMPT:o}},vu={width:["Left","Right"],height:["Top","Bottom"]},yu=["marginLeft","marginRight","marginTop","marginBottom"],pu=function(n,t,i){if("svg"===(n.nodeName+"").toLowerCase())return(i||ft(n))[t]||0;if(n.getCTM&&rr(n))return n.getBBox()[t]||0;var r=parseFloat("width"===t?n.offsetWidth:n.offsetHeight),f=vu[t],e=f.length;for(i=i||ft(n,null);--e>-1;)r-=parseFloat(u(n,"padding"+f[e],i,!0))||0,r-=parseFloat(u(n,"border"+f[e]+"Width",i,!0))||0;return r},et=function(n,t){if("contain"===n||"auto"===n||"auto auto"===n)return n+" ";(null==n||""===n)&&(n="0 0");var f,r=n.split(" "),i=-1!==n.indexOf("left")?"0%":-1!==n.indexOf("right")?"100%":r[0],u=-1!==n.indexOf("top")?"0%":-1!==n.indexOf("bottom")?"100%":r[1];if(r.length>3&&!t){for(r=n.split(", ").join(",").split(","),n=[],f=0;f<r.length;f++)n.push(et(r[f]));return n.join(",")}return null==u?u="center"===i?"50%":"0":"center"===u&&(u="50%"),("center"===i||isNaN(parseFloat(i))&&-1===(i+"").indexOf("="))&&(i="50%"),n=i+" "+u+(r.length>2?" "+r[2]:""),t&&(t.oxp=-1!==i.indexOf("%"),t.oyp=-1!==u.indexOf("%"),t.oxr="="===i.charAt(1),t.oyr="="===u.charAt(1),t.ox=parseFloat(i.replace(vi,"")),t.oy=parseFloat(u.replace(vi,"")),t.v=n),t||n},pt=function(n,t){return"function"==typeof n&&(n=n(nt,it)),"string"==typeof n&&"="===n.charAt(1)?parseInt(n.charAt(0)+"1",10)*parseFloat(n.substr(2)):parseFloat(n)-parseFloat(t)||0},c=function(n,t){return"function"==typeof n&&(n=n(nt,it)),null==n?t:"string"==typeof n&&"="===n.charAt(1)?parseInt(n.charAt(0)+"1",10)*parseFloat(n.substr(2))+t:parseFloat(n)||0},wt=function(n,t,i,r){var f,o,u,e,s,h=1e-6;return"function"==typeof n&&(n=n(nt,it)),null==n?e=t:"number"==typeof n?e=n:(f=360,o=n.split("_"),s="="===n.charAt(1),u=(s?parseInt(n.charAt(0)+"1",10)*parseFloat(o[0].substr(2)):parseFloat(o[0]))*(-1===n.indexOf("rad")?1:rt)-(s?0:t),o.length&&(r&&(r[i]=t+u),-1!==n.indexOf("short")&&(u%=f,u!==u%(f/2)&&(u=0>u?u+f:u-f)),-1!==n.indexOf("_cw")&&0>u?u=(u+9999999999*f)%f-(u/f|0)*f:-1!==n.indexOf("ccw")&&u>0&&(u=(u-9999999999*f)%f-(u/f|0)*f)),e=t+u),h>e&&e>-h&&(e=0),e},bt={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ki=function(n,t,i){return n=0>n?n+1:n>1?n-1:n,255*(1>6*n?t+(i-t)*n*6:.5>n?i:2>3*n?t+(i-t)*(2/3-n)*6:t)+.5|0},ui=r.parseColor=function(n,t){var i,u,r,f,o,h,e,s,c,l,a;if(n)if("number"==typeof n)i=[n>>16,n>>8&255,255&n];else{if(","===n.charAt(n.length-1)&&(n=n.substr(0,n.length-1)),bt[n])i=bt[n];else if("#"===n.charAt(0))4===n.length&&(u=n.charAt(1),r=n.charAt(2),f=n.charAt(3),n="#"+u+u+r+r+f+f),n=parseInt(n.substr(1),16),i=[n>>16,n>>8&255,255&n];else if("hsl"===n.substr(0,3))if(i=a=n.match(lt),t){if(-1!==n.indexOf("="))return n.match(li)}else o=Number(i[0])%360/360,h=Number(i[1])/100,e=Number(i[2])/100,r=.5>=e?e*(h+1):e+h-e*h,u=2*e-r,i.length>3&&(i[3]=Number(n[3])),i[0]=ki(o+1/3,u,r),i[1]=ki(o,u,r),i[2]=ki(o-1/3,u,r);else i=n.match(lt)||bt.transparent;i[0]=Number(i[0]),i[1]=Number(i[1]),i[2]=Number(i[2]),i.length>3&&(i[3]=Number(i[3]))}else i=bt.black;return t&&!a&&(u=i[0]/255,r=i[1]/255,f=i[2]/255,s=Math.max(u,r,f),c=Math.min(u,r,f),e=(s+c)/2,s===c?o=h=0:(l=s-c,h=e>.5?l/(2-s-c):l/(s+c),o=s===u?(r-f)/l+(f>r?6:0):s===r?(f-u)/l+2:(u-r)/l+4,o*=60),i[0]=o+.5|0,i[1]=100*h+.5|0,i[2]=100*e+.5|0),i},pr=function(n,t){for(var i,f,e=n.match(l)||[],r=0,o=e.length?"":n,u=0;u<e.length;u++)i=e[u],f=n.substr(r,n.indexOf(i,r)-r),r+=f.length+i.length,i=ui(i,t),3===i.length&&i.push(1),o+=f+(t?"hsla("+i[0]+","+i[1]+"%,"+i[2]+"%,"+i[3]:"rgba("+i.join(","))+")";return o+n.substr(r)},l="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b";for(i in bt)l+="|"+i+"\\b";l=new RegExp(l+")","gi"),r.colorStringFilter=function(n){var t,i=n[0]+n[1];l.test(i)&&(t=-1!==i.indexOf("hsl(")||-1!==i.indexOf("hsla("),n[0]=pr(n[0],t),n[1]=pr(n[1],t)),l.lastIndex=0},t.defaultStringFilter||(t.defaultStringFilter=r.colorStringFilter);var di=function(n,t,i,r){if(null==n)return function(n){return n};var e,s=t?(n.match(l)||[""])[0]:"",f=n.split(s).join("").match(ai)||[],h=n.substr(0,n.indexOf(f[0])),c=")"===n.charAt(n.length-1)?")":"",o=-1!==n.indexOf(" ")?" ":",",u=f.length,a=u>0?f[0].replace(lt,""):"";return u?e=t?function(n){var p,v,t,y;if("number"==typeof n)n+=a;else if(r&&k.test(n)){for(y=n.replace(k,"|").split("|"),t=0;t<y.length;t++)y[t]=e(y[t]);return y.join(",")}if(p=(n.match(l)||[s])[0],v=n.split(p).join("").match(ai)||[],t=v.length,u>t--)for(;++t<u;)v[t]=i?v[(t-1)/2|0]:f[t];return h+v.join(o)+o+p+c+(-1!==n.indexOf("inset")?" inset":"")}:function(n){var s,l,t;if("number"==typeof n)n+=a;else if(r&&k.test(n)){for(l=n.replace(k,"|").split("|"),t=0;t<l.length;t++)l[t]=e(l[t]);return l.join(",")}if(s=n.match(ai)||[],t=s.length,u>t--)for(;++t<u;)s[t]=i?s[(t-1)/2|0]:f[t];return h+s.join(o)+c}:function(n){return n}},gi=function(n){return n=n.split(","),function(t,i,r,u,f,e,o){var s,h=(i+"").split(" ");for(o={},s=0;4>s;s++)o[n[s]]=h[s]=h[s]||h[(s-1)/2>>0];return u.parse(t,o,f,e)}},nr=(p._setPluginRatio=function(n){this.plugin.setRatio(n);for(var r,t,f,e,o,u=this.data,s=u.proxy,i=u.firstMPT,h=1e-6;i;)r=s[i.v],i.r?r=Math.round(r):h>r&&r>-h&&(r=0),i.t[i.p]=r,i=i._next;if(u.autoRotate&&(u.autoRotate.rotation=u.mod?u.mod(s.rotation,this.t):s.rotation),1===n||0===n)for(i=u.firstMPT,o=1===n?"e":"b";i;){if(t=i.t,t.type){if(1===t.type){for(e=t.xs0+t.s+t.xs1,f=1;f<t.l;f++)e+=t["xn"+f]+t["xs"+(f+1)];t[o]=e}}else t[o]=t.s+t.xs0;i=i._next}},function(n,t,i,r,u){this.t=n,this.p=t,this.v=i,this.r=u,r&&(r._prev=this,this._next=r)}),o=(p._parseToProxy=function(n,t,i,r,u,f){var c,e,o,s,v,h=r,l={},a={},y=i._transform,p=ii;for(i._transform=null,ii=t,r=v=i.parse(n,t,r,u),ii=p,f&&(i._transform=y,h&&(h._prev=null,h._prev&&(h._prev._next=null)));r&&r!==h;){if(r.type<=1&&(e=r.p,a[e]=r.s+r.c,l[e]=r.s,f||(s=new nr(r,"s",e,s,r.r),r.c=0),1===r.type))for(c=r.l;--c>0;)o="xn"+c,e=r.p+"_"+o,a[e]=r.data[o],l[e]=r[o],f||(s=new nr(r,o,e,s,r.rxp[o]));r=r._next}return{proxy:l,end:a,firstMPT:s,pt:v}},p.CSSPropTween=function(n,t,i,r,u,f,e,s,h,c,l){this.t=n,this.p=t,this.s=i,this.c=r,this.n=e||t,n instanceof o||oi.push(this.n),this.r=s,this.type=f||0,h&&(this.pr=h,ct=!0),this.b=void 0===c?i:c,this.e=void 0===l?i+r:l,u&&(this._next=u,u._prev=this)}),fi=function(n,t,i,r,u,f){var e=new o(n,t,i,r-i,u,-1,f);return e.b=i,e.e=e.xs0=r,e},kt=r.parseComplex=function(n,t,i,u,f,e,s,h,c,a){i=i||e||"","function"==typeof u&&(u=u(nt,it)),s=new o(n,t,0,0,s,a?2:1,null,!1,h,i,u),u+="",f&&l.test(u+i)&&(u=[i,u],r.colorStringFilter(u),i=u[0],u=u[1]);var p,g,tt,v,y,ot,st,ft,b,ht,rt,w,ct,d=i.split(", ").join(",").split(" "),et=u.split(", ").join(",").split(" "),at=d.length,vt=si!==!1;for((-1!==u.indexOf(",")||-1!==i.indexOf(","))&&(d=d.join(" ").replace(k,", ").split(" "),et=et.join(" ").replace(k,", ").split(" "),at=d.length),at!==et.length&&(d=(e||"").split(" "),at=d.length),s.plugin=c,s.setRatio=a,l.lastIndex=0,p=0;at>p;p++)if(v=d[p],y=et[p],ft=parseFloat(v),ft||0===ft)s.appendXtra("",ft,pt(y,ft),y.replace(li,""),vt&&-1!==y.indexOf("px"),!0);else if(f&&l.test(v))w=y.indexOf(")")+1,w=")"+(w?y.substr(w):""),ct=-1!==y.indexOf("hsl")&&ut,v=ui(v,ct),y=ui(y,ct),b=v.length+y.length>6,b&&!ut&&0===y[3]?(s["xs"+s.l]+=s.l?" transparent":"transparent",s.e=s.e.split(et[p]).join("transparent")):(ut||(b=!1),ct?s.appendXtra(b?"hsla(":"hsl(",v[0],pt(y[0],v[0]),",",!1,!0).appendXtra("",v[1],pt(y[1],v[1]),"%,",!1).appendXtra("",v[2],pt(y[2],v[2]),b?"%,":"%"+w,!1):s.appendXtra(b?"rgba(":"rgb(",v[0],y[0]-v[0],",",!0,!0).appendXtra("",v[1],y[1]-v[1],",",!0).appendXtra("",v[2],y[2]-v[2],b?",":w,!0),b&&(v=v.length<4?1:v[3],s.appendXtra("",v,(y.length<4?1:y[3])-v,w,!1))),l.lastIndex=0;else if(ot=v.match(lt)){if(st=y.match(li),!st||st.length!==ot.length)return s;for(tt=0,g=0;g<ot.length;g++)rt=ot[g],ht=v.indexOf(rt,tt),s.appendXtra(v.substr(tt,ht-tt),Number(rt),pt(st[g],rt),"",vt&&"px"===v.substr(ht+rt.length,2),0===g),tt=ht+rt.length;s["xs"+s.l]+=v.substr(tt)}else s["xs"+s.l]+=s.l||s["xs"+s.l]?" "+y:y;if(-1!==u.indexOf("=")&&s.data){for(w=s.xs0+s.data.s,p=1;p<s.l;p++)w+=s["xs"+p]+s.data["xn"+p];s.e=w+s["xs"+p]}return s.l||(s.type=-1,s.xs0=s.e),s.xfirst||s},s=9;for(i=o.prototype,i.l=i.pr=0;--s>0;)i["xn"+s]=0,i["xs"+s]="";i.xs0="",i._next=i._prev=i.xfirst=i.data=i.plugin=i.setRatio=i.rxp=null,i.appendXtra=function(n,t,i,r,u,f){var e=this,s=e.l;return e["xs"+s]+=f&&(s||e["xs"+s])?" "+n:n||"",i||0===s||e.plugin?(e.l++,e.type=e.setRatio?2:1,e["xs"+e.l]=r||"",s>0?(e.data["xn"+s]=t+i,e.rxp["xn"+s]=u,e["xn"+s]=t,e.plugin||(e.xfirst=new o(e,"xn"+s,t,i,e.xfirst||e,0,e.n,u,e.pr),e.xfirst.xs0=0),e):(e.data={s:t+i},e.rxp={},e.s=t,e.c=i,e.r=u,e)):(e["xs"+s]+=t+(r||""),e)};var wr=function(n,t){t=t||{},this.p=t.prefix?vt(n)||n:n,v[n]=v[this.p]=this,this.format=t.formatter||di(t.defaultValue,t.color,t.collapsible,t.multi),t.parser&&(this.parse=t.parser),this.clrs=t.color,this.multi=t.multi,this.keyword=t.keyword,this.dflt=t.defaultValue,this.pr=t.priority||0},f=p._registerComplexSpecialProp=function(n,t,i){"object"!=typeof t&&(t={parser:i});var r,e,u=n.split(","),f=t.defaultValue;for(i=i||[f],r=0;r<u.length;r++)t.prefix=0===r&&t.prefix,t.defaultValue=i[r]||f,e=new wr(u[r],t)},wu=p._registerPluginProp=function(n){if(!v[n]){var t=n.charAt(0).toUpperCase()+n.substr(1)+"Plugin";f(n,{parser:function(n,i,r,u,f,e,o){var s=ru.com.greensock.plugins[t];return s?(s._cssRegister(),v[r].parse(n,i,r,u,f,e,o)):(ar("Error: "+t+" js file not loaded."),f)}})}};i=wr.prototype,i.parseComplex=function(n,t,i,r,u,f){var e,o,s,a,c,l,h=this.keyword;if(this.multi&&(k.test(i)||k.test(t)?(o=t.replace(k,"|").split("|"),s=i.replace(k,"|").split("|")):h&&(o=[t],s=[i])),s){for(a=s.length>o.length?s.length:o.length,e=0;a>e;e++)t=o[e]=o[e]||this.dflt,i=s[e]=s[e]||this.dflt,h&&(c=t.indexOf(h),l=i.indexOf(h),c!==l&&(-1===l?o[e]=o[e].split(h).join(""):-1===c&&(o[e]+=" "+h)));t=o.join(", "),i=s.join(", ")}return kt(n,this.p,t,i,this.clrs,this.dflt,r,this.pr,u,f)},i.parse=function(n,t,i,r,f,o){return this.parseComplex(n.style,this.format(u(n,this.p,e,!1,this.dflt)),this.format(t),f,o)},r.registerSpecialProp=function(n,t,i){f(n,{parser:function(n,r,u,f,e,s){var h=new o(n,u,0,0,e,2,u,!1,i);return h.plugin=s,h.setRatio=t(n,r,f._tween,u),h},priority:i})},r.useSVGTransformAttr=!0;var tt,br="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),h=vt("transform"),tr=vr+"transform",dt=vt("transformOrigin"),b=null!==vt("perspective"),ei=p.Transform=function(){this.perspective=parseFloat(r.defaultTransformPerspective)||0,this.force3D=r.defaultForce3D!==!1&&b?r.defaultForce3D||"auto":!1},bu=_gsScope.SVGElement,kr=function(n,t,i){var r,u=y.createElementNS("http://www.w3.org/2000/svg",n),f=/([a-z])([A-Z])/g;for(r in i)u.setAttributeNS(null,r.replace(f,"$1-$2").toLowerCase(),i[r]);return t.appendChild(u),u},st=y.documentElement||{},ku=function(){var t,n,r,i=ot||/Android/i.test(g)&&!_gsScope.chrome;return y.createElementNS&&!i&&(t=kr("svg",st),n=kr("rect",t,{width:100,height:50,x:100}),r=n.getBoundingClientRect().width,n.style[dt]="50% 50%",n.style[h]="scaleX(0.5)",i=r===n.getBoundingClientRect().width&&!(ci&&b),st.removeChild(t)),i}(),ir=function(n,t,i,u,f,e){var l,a,v,y,p,w,o,b,k,d,g,c,nt,tt,s=n._gsTransform,h=fr(n,!0);s&&(nt=s.xOrigin,tt=s.yOrigin),(!u||(l=u.split(" ")).length<2)&&(o=n.getBBox(),0===o.x&&0===o.y&&o.width+o.height===0&&(o={x:parseFloat(n.hasAttribute("x")?n.getAttribute("x"):n.hasAttribute("cx")?n.getAttribute("cx"):0)||0,y:parseFloat(n.hasAttribute("y")?n.getAttribute("y"):n.hasAttribute("cy")?n.getAttribute("cy"):0)||0,width:0,height:0}),t=et(t).split(" "),l=[(-1!==t[0].indexOf("%")?parseFloat(t[0])/100*o.width:parseFloat(t[0]))+o.x,(-1!==t[1].indexOf("%")?parseFloat(t[1])/100*o.height:parseFloat(t[1]))+o.y]),i.xOrigin=y=parseFloat(l[0]),i.yOrigin=p=parseFloat(l[1]),u&&h!==ur&&(w=h[0],o=h[1],b=h[2],k=h[3],d=h[4],g=h[5],c=w*k-o*b,c&&(a=y*(k/c)+p*(-b/c)+(b*g-k*d)/c,v=y*(-o/c)+p*(w/c)-(w*g-o*d)/c,y=i.xOrigin=l[0]=a,p=i.yOrigin=l[1]=v)),s&&(e&&(i.xOffset=s.xOffset,i.yOffset=s.yOffset,s=i),f||f!==!1&&r.defaultSmoothOrigin!==!1?(a=y-nt,v=p-tt,s.xOffset+=a*h[0]+v*h[2]-a,s.yOffset+=a*h[1]+v*h[3]-v):s.xOffset=s.yOffset=0),e||n.setAttribute("data-svg-origin",l.join(" "))},dr=function(n){var t,i=ri("svg",this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=this.parentNode,u=this.nextSibling,f=this.style.cssText;if(st.appendChild(i),i.appendChild(this),this.style.display="block",n)try{t=this.getBBox(),this._originalGetBBox=this.getBBox,this.getBBox=dr}catch(e){}else this._originalGetBBox&&(t=this._originalGetBBox());return u?r.insertBefore(this,u):r.appendChild(this),st.removeChild(i),this.style.cssText=f,t},du=function(n){try{return n.getBBox()}catch(t){return dr.call(n,!0)}},rr=function(n){return!(!(bu&&n.getCTM&&du(n))||n.parentNode&&!n.ownerSVGElement)},ur=[1,0,0,1,0,0],fr=function(n,t){var f,i,r,e,c,l,a=n._gsTransform||new ei,v=1e5,o=n.style;if(h?i=u(n,tr,null,!0):n.currentStyle&&(i=n.currentStyle.filter.match(hu),i=i&&4===i.length?[i[0].substr(4),Number(i[2].substr(4)),Number(i[1].substr(4)),i[3].substr(4),a.x||0,a.y||0].join(","):""),f=!i||"none"===i||"matrix(1, 0, 0, 1, 0, 0)"===i,f&&h&&((l="none"===ft(n).display)||!n.parentNode)&&(l&&(e=o.display,o.display="block"),n.parentNode||(c=1,st.appendChild(n)),i=u(n,tr,null,!0),f=!i||"none"===i||"matrix(1, 0, 0, 1, 0, 0)"===i,e?o.display=e:l&&ht(o,"display"),c&&st.removeChild(n)),(a.svg||n.getCTM&&rr(n))&&(f&&-1!==(o[h]+"").indexOf("matrix")&&(i=o[h],f=0),r=n.getAttribute("transform"),f&&r&&(-1!==r.indexOf("matrix")?(i=r,f=0):-1!==r.indexOf("translate")&&(i="matrix(1,0,0,1,"+r.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",")+")",f=0))),f)return ur;for(r=(i||"").match(lt)||[],s=r.length;--s>-1;)e=Number(r[s]),r[s]=(c=e-(e|=0))?(c*v+(0>c?-.5:.5)|0)/v+e:e;return t&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r},gt=p.getTransform=function(n,i,f,e){if(n._gsTransform&&f&&!e)return n._gsTransform;var s,pt,kt,gt,ut,nt,o=f?n._gsTransform||new ei:new ei,ni=o.scaleX<0,ti=2e-5,ft=1e5,fi=b?parseFloat(u(n,dt,i,!1,"0 0 0").split(" ")[2])||o.zOrigin||0:0,oi=parseFloat(r.defaultTransformPerspective)||0;if(o.svg=!(!n.getCTM||!rr(n)),o.svg&&(ir(n,u(n,dt,i,!1,"50% 50%")+"",o,n.getAttribute("data-svg-origin")),tt=r.useSVGTransformAttr||ku),s=fr(n),s!==ur){if(16===s.length){var wt,et,bt,c,l,k=s[0],p=s[1],st=s[2],si=s[3],it=s[4],v=s[5],d=s[6],hi=s[7],ct=s[8],w=s[9],y=s[10],ii=s[12],ri=s[13],ot=s[14],g=s[11],a=Math.atan2(d,y);o.zOrigin&&(ot=-o.zOrigin,ii=ct*ot-s[12],ri=w*ot-s[13],ot=y*ot+o.zOrigin-s[14]),o.rotationX=a*rt,a&&(c=Math.cos(-a),l=Math.sin(-a),wt=it*c+ct*l,et=v*c+w*l,bt=d*c+y*l,ct=it*-l+ct*c,w=v*-l+w*c,y=d*-l+y*c,g=hi*-l+g*c,it=wt,v=et,d=bt),a=Math.atan2(-st,y),o.rotationY=a*rt,a&&(c=Math.cos(-a),l=Math.sin(-a),wt=k*c-ct*l,et=p*c-w*l,bt=st*c-y*l,w=p*l+w*c,y=st*l+y*c,g=si*l+g*c,k=wt,p=et,st=bt),a=Math.atan2(p,k),o.rotation=a*rt,a&&(c=Math.cos(-a),l=Math.sin(-a),k=k*c+it*l,et=p*c+v*l,v=p*-l+v*c,d=st*-l+d*c,p=et),o.rotationX&&Math.abs(o.rotationX)+Math.abs(o.rotation)>359.9&&(o.rotationX=o.rotation=0,o.rotationY=180-o.rotationY),o.scaleX=(Math.sqrt(k*k+p*p)*ft+.5|0)/ft,o.scaleY=(Math.sqrt(v*v+w*w)*ft+.5|0)/ft,o.scaleZ=(Math.sqrt(d*d+y*y)*ft+.5|0)/ft,o.rotationX||o.rotationY?o.skewX=0:(o.skewX=it||v?Math.atan2(it,v)*rt+o.rotation:o.skewX||0,Math.abs(o.skewX)>90&&Math.abs(o.skewX)<270&&(ni?(o.scaleX*=-1,o.skewX+=o.rotation<=0?180:-180,o.rotation+=o.rotation<=0?180:-180):(o.scaleY*=-1,o.skewX+=o.skewX<=0?180:-180))),o.perspective=g?1/(0>g?-g:g):0,o.x=ii,o.y=ri,o.z=ot,o.svg&&(o.x-=o.xOrigin-(o.xOrigin*k-o.yOrigin*it),o.y-=o.yOrigin-(o.yOrigin*p-o.xOrigin*v))}else if(!b||e||!s.length||o.x!==s[4]||o.y!==s[5]||!o.rotationX&&!o.rotationY){var ui=s.length>=6,lt=ui?s[0]:1,at=s[1]||0,vt=s[2]||0,yt=ui?s[3]:1;o.x=s[4]||0,o.y=s[5]||0,kt=Math.sqrt(lt*lt+at*at),gt=Math.sqrt(yt*yt+vt*vt),ut=lt||at?Math.atan2(at,lt)*rt:o.rotation||0,nt=vt||yt?Math.atan2(vt,yt)*rt+ut:o.skewX||0,Math.abs(nt)>90&&Math.abs(nt)<270&&(ni?(kt*=-1,nt+=0>=ut?180:-180,ut+=0>=ut?180:-180):(gt*=-1,nt+=0>=nt?180:-180)),o.scaleX=kt,o.scaleY=gt,o.rotation=ut,o.skewX=nt,b&&(o.rotationX=o.rotationY=o.z=0,o.perspective=oi,o.scaleZ=1),o.svg&&(o.x-=o.xOrigin-(o.xOrigin*lt+o.yOrigin*vt),o.y-=o.yOrigin-(o.xOrigin*at+o.yOrigin*yt))}o.zOrigin=fi;for(pt in o)o[pt]<ti&&o[pt]>-ti&&(o[pt]=0)}return f&&(n._gsTransform=o,o.svg&&(tt&&n.style[h]?t.delayedCall(.001,function(){ht(n.style,h)}):!tt&&n.getAttribute("transform")&&t.delayedCall(.001,function(){n.removeAttribute("transform")}))),o},gu=function(n){var o,p,t=this.data,nt=-t.rotation*a,ut=nt+t.skewX*a,e=1e5,h=(Math.cos(nt)*t.scaleX*e|0)/e,u=(Math.sin(nt)*t.scaleX*e|0)/e,f=(Math.sin(ut)*-t.scaleY*e|0)/e,c=(Math.cos(ut)*t.scaleY*e|0)/e,d=this.t.style,g=this.t.currentStyle,k,y,ft,et;if(g){p=u,u=-f,f=-p,o=g.filter,d.filter="";var i,r,l=this.t.offsetWidth,v=this.t.offsetHeight,tt="absolute"!==g.position,b="progid:DXImageTransform.Microsoft.Matrix(M11="+h+", M12="+u+", M21="+f+", M22="+c,it=t.x+l*t.xPercent/100,rt=t.y+v*t.yPercent/100;if(null!=t.ox&&(i=(t.oxp?l*t.ox*.01:t.ox)-l/2,r=(t.oyp?v*t.oy*.01:t.oy)-v/2,it+=i-(i*h+r*u),rt+=r-(i*f+r*c)),tt?(i=l/2,r=v/2,b+=", Dx="+(i-(i*h+r*u)+it)+", Dy="+(r-(i*f+r*c)+rt)+")"):b+=", sizingMethod='auto expand')",d.filter=-1!==o.indexOf("DXImageTransform.Microsoft.Matrix(")?o.replace(cu,b):b+" "+o,(0===n||1===n)&&1===h&&0===u&&0===f&&1===c&&(tt&&-1===b.indexOf("Dx=0, Dy=0")||yi.test(o)&&100!==parseFloat(RegExp.$1)||-1===o.indexOf(o.indexOf("Alpha"))&&d.removeAttribute("filter")),!tt)for(et=8>ot?1:-1,i=t.ieOffsetX||0,r=t.ieOffsetY||0,t.ieOffsetX=Math.round((l-((0>h?-h:h)*l+(0>u?-u:u)*v))/2+it),t.ieOffsetY=Math.round((v-((0>c?-c:c)*v+(0>f?-f:f)*l))/2+rt),s=0;4>s;s++)y=yu[s],k=g[y],p=-1!==k.indexOf("px")?parseFloat(k):w(this.t,y,parseFloat(k),k.replace(at,""))||0,ft=p!==t[y]?2>s?-t.ieOffsetX:-t.ieOffsetY:2>s?i-t.ieOffsetX:r-t.ieOffsetY,d[y]=(t[y]=Math.round(p-ft*(0===s||2===s?1:et)))+"px"}},nf=p.set3DTransformRatio=p.setTransformRatio=function(n){var r,c,l,nt,v,y,it,vt,yt,ut,pt,wt,ft,ct,i,f,e,ni,g,o,s,bt,et,t=this.data,kt=this.t.style,u=t.rotation,dt=t.rotationX,gt=t.rotationY,k=t.scaleX,d=t.scaleY,rt=t.scaleZ,p=t.x,w=t.y,ot=t.z,lt=t.svg,st=t.perspective,ti=t.force3D,ht=t.skewY,at=t.skewX;if(ht&&(at+=ht,u+=ht),((1===n||0===n)&&"auto"===ti&&(this.tween._totalTime===this.tween._totalDuration||!this.tween._totalTime)||!ti)&&!ot&&!st&&!gt&&!dt&&1===rt||tt&&lt||!b)return void(u||at||lt?(u*=a,bt=at*a,et=1e5,c=Math.cos(u)*k,v=Math.sin(u)*k,l=Math.sin(u-bt)*-d,y=Math.cos(u-bt)*d,bt&&"simple"===t.skewType&&(r=Math.tan(bt-ht*a),r=Math.sqrt(1+r*r),l*=r,y*=r,ht&&(r=Math.tan(ht*a),r=Math.sqrt(1+r*r),c*=r,v*=r)),lt&&(p+=t.xOrigin-(t.xOrigin*c+t.yOrigin*l)+t.xOffset,w+=t.yOrigin-(t.xOrigin*v+t.yOrigin*y)+t.yOffset,tt&&(t.xPercent||t.yPercent)&&(i=this.t.getBBox(),p+=.01*t.xPercent*i.width,w+=.01*t.yPercent*i.height),i=1e-6,i>p&&p>-i&&(p=0),i>w&&w>-i&&(w=0)),g=(c*et|0)/et+","+(v*et|0)/et+","+(l*et|0)/et+","+(y*et|0)/et+","+p+","+w+")",lt&&tt?this.t.setAttribute("transform","matrix("+g):kt[h]=(t.xPercent||t.yPercent?"translate("+t.xPercent+"%,"+t.yPercent+"%) matrix(":"matrix(")+g):kt[h]=(t.xPercent||t.yPercent?"translate("+t.xPercent+"%,"+t.yPercent+"%) matrix(":"matrix(")+k+",0,0,"+d+","+p+","+w+")");if(ci&&(i=.0001,i>k&&k>-i&&(k=rt=2e-5),i>d&&d>-i&&(d=rt=2e-5),!st||t.z||t.rotationX||t.rotationY||(st=0)),u||at)u*=a,f=c=Math.cos(u),e=v=Math.sin(u),at&&(u-=at*a,f=Math.cos(u),e=Math.sin(u),"simple"===t.skewType&&(r=Math.tan((at-ht)*a),r=Math.sqrt(1+r*r),f*=r,e*=r,t.skewY&&(r=Math.tan(ht*a),r=Math.sqrt(1+r*r),c*=r,v*=r))),l=-e,y=f;else{if(!(gt||dt||1!==rt||st||lt))return void(kt[h]=(t.xPercent||t.yPercent?"translate("+t.xPercent+"%,"+t.yPercent+"%) translate3d(":"translate3d(")+p+"px,"+w+"px,"+ot+"px)"+(1!==k||1!==d?" scale("+k+","+d+")":""));c=y=1,l=v=0}ut=1,nt=it=vt=yt=pt=wt=0,ft=st?-1/st:0,ct=t.zOrigin,i=1e-6,o=",",s="0",u=gt*a,u&&(f=Math.cos(u),e=Math.sin(u),vt=-e,pt=ft*-e,nt=c*e,it=v*e,ut=f,ft*=f,c*=f,v*=f),u=dt*a,u&&(f=Math.cos(u),e=Math.sin(u),r=l*f+nt*e,ni=y*f+it*e,yt=ut*e,wt=ft*e,nt=l*-e+nt*f,it=y*-e+it*f,ut*=f,ft*=f,l=r,y=ni),1!==rt&&(nt*=rt,it*=rt,ut*=rt,ft*=rt),1!==d&&(l*=d,y*=d,yt*=d,wt*=d),1!==k&&(c*=k,v*=k,vt*=k,pt*=k),(ct||lt)&&(ct&&(p+=nt*-ct,w+=it*-ct,ot+=ut*-ct+ct),lt&&(p+=t.xOrigin-(t.xOrigin*c+t.yOrigin*l)+t.xOffset,w+=t.yOrigin-(t.xOrigin*v+t.yOrigin*y)+t.yOffset),i>p&&p>-i&&(p=s),i>w&&w>-i&&(w=s),i>ot&&ot>-i&&(ot=0)),g=t.xPercent||t.yPercent?"translate("+t.xPercent+"%,"+t.yPercent+"%) matrix3d(":"matrix3d(",g+=(i>c&&c>-i?s:c)+o+(i>v&&v>-i?s:v)+o+(i>vt&&vt>-i?s:vt),g+=o+(i>pt&&pt>-i?s:pt)+o+(i>l&&l>-i?s:l)+o+(i>y&&y>-i?s:y),dt||gt||1!==rt?(g+=o+(i>yt&&yt>-i?s:yt)+o+(i>wt&&wt>-i?s:wt)+o+(i>nt&&nt>-i?s:nt),g+=o+(i>it&&it>-i?s:it)+o+(i>ut&&ut>-i?s:ut)+o+(i>ft&&ft>-i?s:ft)+o):g+=",0,0,0,0,1,0,",g+=p+o+w+o+ot+o+(st?1+-ot/st:1)+")",kt[h]=g};for(i=ei.prototype,i.x=i.y=i.z=i.skewX=i.skewY=i.rotation=i.rotationX=i.rotationY=i.zOrigin=i.xPercent=i.yPercent=i.xOffset=i.yOffset=0,i.scaleX=i.scaleY=i.scaleZ=1,f("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",{parser:function(n,t,i,f,s,l,a){var pt,st;if(f._lastParsedTransform===a)return s;f._lastParsedTransform=a,st=a.scale&&"function"==typeof a.scale?a.scale:0,"function"==typeof a[i]&&(pt=a[i],a[i]=t),st&&(a.scale=st(nt,n));var w,rt,at,vt,ot,ut,ft,ht,g,yt=n._gsTransform,bt=n.style,kt=1e-6,ni=br.length,v=a,ct={},lt="transformOrigin",p=gt(n,e,!0,v.parseTransform),k=v.transform&&("function"==typeof v.transform?v.transform(nt,it):v.transform);if(f._transform=p,k&&"string"==typeof k&&h)rt=d.style,rt[h]=k,rt.display="block",rt.position="absolute",y.body.appendChild(d),w=gt(d,null,!1),p.svg&&(ut=p.xOrigin,ft=p.yOrigin,w.x-=p.xOffset,w.y-=p.yOffset,(v.transformOrigin||v.svgOrigin)&&(k={},ir(n,et(v.transformOrigin),k,v.svgOrigin,v.smoothOrigin,!0),ut=k.xOrigin,ft=k.yOrigin,w.x-=k.xOffset-p.xOffset,w.y-=k.yOffset-p.yOffset),(ut||ft)&&(ht=fr(d,!0),w.x-=ut-(ut*ht[0]+ft*ht[2]),w.y-=ft-(ut*ht[1]+ft*ht[3]))),y.body.removeChild(d),w.perspective||(w.perspective=p.perspective),null!=v.xPercent&&(w.xPercent=c(v.xPercent,p.xPercent)),null!=v.yPercent&&(w.yPercent=c(v.yPercent,p.yPercent));else if("object"==typeof v){if(w={scaleX:c(null!=v.scaleX?v.scaleX:v.scale,p.scaleX),scaleY:c(null!=v.scaleY?v.scaleY:v.scale,p.scaleY),scaleZ:c(v.scaleZ,p.scaleZ),x:c(v.x,p.x),y:c(v.y,p.y),z:c(v.z,p.z),xPercent:c(v.xPercent,p.xPercent),yPercent:c(v.yPercent,p.yPercent),perspective:c(v.transformPerspective,p.perspective)},ot=v.directionalRotation,null!=ot)if("object"==typeof ot)for(rt in ot)v[rt]=ot[rt];else v.rotation=ot;"string"==typeof v.x&&-1!==v.x.indexOf("%")&&(w.x=0,w.xPercent=c(v.x,p.xPercent)),"string"==typeof v.y&&-1!==v.y.indexOf("%")&&(w.y=0,w.yPercent=c(v.y,p.yPercent)),w.rotation=wt("rotation"in v?v.rotation:"shortRotation"in v?v.shortRotation+"_short":"rotationZ"in v?v.rotationZ:p.rotation,p.rotation,"rotation",ct),b&&(w.rotationX=wt("rotationX"in v?v.rotationX:"shortRotationX"in v?v.shortRotationX+"_short":p.rotationX||0,p.rotationX,"rotationX",ct),w.rotationY=wt("rotationY"in v?v.rotationY:"shortRotationY"in v?v.shortRotationY+"_short":p.rotationY||0,p.rotationY,"rotationY",ct)),w.skewX=wt(v.skewX,p.skewX),w.skewY=wt(v.skewY,p.skewY)}for(b&&null!=v.force3D&&(p.force3D=v.force3D,vt=!0),p.skewType=v.skewType||p.skewType||r.defaultSkewType,at=p.force3D||p.z||p.rotationX||p.rotationY||w.z||w.rotationX||w.rotationY||w.perspective,at||null==v.scale||(w.scaleZ=1);--ni>-1;)g=br[ni],k=w[g]-p[g],(k>kt||-kt>k||null!=v[g]||null!=ii[g])&&(vt=!0,s=new o(p,g,p[g],k,s),g in ct&&(s.e=ct[g]),s.xs0=0,s.plugin=l,f._overwriteProps.push(s.n));return k=v.transformOrigin,p.svg&&(k||v.svgOrigin)&&(ut=p.xOffset,ft=p.yOffset,ir(n,et(k),w,v.svgOrigin,v.smoothOrigin),s=fi(p,"xOrigin",(yt?p:w).xOrigin,w.xOrigin,s,lt),s=fi(p,"yOrigin",(yt?p:w).yOrigin,w.yOrigin,s,lt),(ut!==p.xOffset||ft!==p.yOffset)&&(s=fi(p,"xOffset",yt?ut:p.xOffset,p.xOffset,s,lt),s=fi(p,"yOffset",yt?ft:p.yOffset,p.yOffset,s,lt)),k="0px 0px"),(k||b&&at&&p.zOrigin)&&(h?(vt=!0,g=dt,k=(k||u(n,g,e,!1,"50% 50%"))+"",s=new o(bt,g,0,0,s,-1,lt),s.b=bt[g],s.plugin=l,b?(rt=p.zOrigin,k=k.split(" "),p.zOrigin=(k.length>2&&(0===rt||"0px"!==k[2])?parseFloat(k[2]):rt)||0,s.xs0=s.e=k[0]+" "+(k[1]||"50%")+" 0px",s=new o(p,"zOrigin",0,0,s,-1,s.n),s.b=rt,s.xs0=s.e=p.zOrigin):s.xs0=s.e=k):et(k+"",p)),vt&&(f._transformType=p.svg&&tt||!at&&3!==this._transformType?2:3),pt&&(a[i]=pt),st&&(a.scale=st),s},prefix:!0}),f("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),f("borderRadius",{defaultValue:"0px",parser:function(n,t,i,r,f){t=this.format(t);var tt,l,d,h,o,s,p,a,it,rt,c,v,g,b,k,nt,y=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],ut=n.style;for(it=parseFloat(n.offsetWidth),rt=parseFloat(n.offsetHeight),tt=t.split(" "),l=0;l<y.length;l++)this.p.indexOf("border")&&(y[l]=vt(y[l])),o=h=u(n,y[l],e,!1,"0px"),-1!==o.indexOf(" ")&&(h=o.split(" "),o=h[0],h=h[1]),s=d=tt[l],p=parseFloat(o),v=o.substr((p+"").length),g="="===s.charAt(1),g?(a=parseInt(s.charAt(0)+"1",10),s=s.substr(2),a*=parseFloat(s),c=s.substr((a+"").length-(0>a?1:0))||""):(a=parseFloat(s),c=s.substr((a+"").length)),""===c&&(c=ti[i]||v),c!==v&&(b=w(n,"borderLeft",p,v),k=w(n,"borderTop",p,v),"%"===c?(o=b/it*100+"%",h=k/rt*100+"%"):"em"===c?(nt=w(n,"borderLeft",1,"em"),o=b/nt+"em",h=k/nt+"em"):(o=b+"px",h=k+"px"),g&&(s=parseFloat(o)+a+c,d=parseFloat(h)+a+c)),f=kt(ut,y[l],o+" "+h,s+" "+d,!1,"0px",f);return f},prefix:!0,formatter:di("0px 0px 0px 0px",!1,!0)}),f("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius",{defaultValue:"0px",parser:function(n,t,i,r,f){return kt(n.style,i,this.format(u(n,i,e,!1,"0px 0px")),this.format(t),!1,"0px",f)},prefix:!0,formatter:di("0px 0px",!1,!0)}),f("backgroundPosition",{defaultValue:"0 0",parser:function(n,t,i,r,f,o){var c,b,h,y,p,l,w="background-position",a=e||ft(n,null),s=this.format((a?ot?a.getPropertyValue(w+"-x")+" "+a.getPropertyValue(w+"-y"):a.getPropertyValue(w):n.currentStyle.backgroundPositionX+" "+n.currentStyle.backgroundPositionY)||"0 0"),v=this.format(t);if(-1!==s.indexOf("%")!=(-1!==v.indexOf("%"))&&v.split(",").length<2&&(l=u(n,"backgroundImage").replace(ou,""),l&&"none"!==l)){for(c=s.split(" "),b=v.split(" "),pi.setAttribute("src",l),h=2;--h>-1;)s=c[h],y=-1!==s.indexOf("%"),y!==(-1!==b[h].indexOf("%"))&&(p=0===h?n.offsetWidth-pi.width:n.offsetHeight-pi.height,c[h]=y?parseFloat(s)/100*p+"px":parseFloat(s)/p*100+"%");s=c.join(" ")}return this.parseComplex(n.style,s,v,f,o)},formatter:et}),f("backgroundSize",{defaultValue:"0 0",formatter:function(n){return n+"",et(-1===n.indexOf(" ")?n+" "+n:n)}}),f("perspective",{defaultValue:"0px",prefix:!0}),f("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),f("transformStyle",{prefix:!0}),f("backfaceVisibility",{prefix:!0}),f("userSelect",{prefix:!0}),f("margin",{parser:gi("marginTop,marginRight,marginBottom,marginLeft")}),f("padding",{parser:gi("paddingTop,paddingRight,paddingBottom,paddingLeft")}),f("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(n,t,i,r,f,o){var c,s,h;return 9>ot?(s=n.currentStyle,h=8>ot?" ":",",c="rect("+s.clipTop+h+s.clipRight+h+s.clipBottom+h+s.clipLeft+")",t=this.format(t).split(",").join(h)):(c=this.format(u(n,this.p,e,!1,this.dflt)),t=this.format(t)),this.parseComplex(n.style,c,t,f,o)}}),f("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),f("autoRound,strictUnits",{parser:function(n,t,i,r,u){return u}}),f("border",{defaultValue:"0px solid #000",parser:function(n,t,i,r,f,o){var s=u(n,"borderTopWidth",e,!1,"0px"),c=this.format(t).split(" "),h=c[0].replace(at,"");return"px"!==h&&(s=parseFloat(s)/w(n,"borderTopWidth",1,h)+h),this.parseComplex(n.style,this.format(s+" "+u(n,"borderTopStyle",e,!1,"solid")+" "+u(n,"borderTopColor",e,!1,"#000")),c.join(" "),f,o)},color:!0,formatter:function(n){var t=n.split(" ");return t[0]+" "+(t[1]||"solid")+" "+(n.match(l)||["#000"])[0]}}),f("borderWidth",{parser:gi("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),f("float,cssFloat,styleFloat",{parser:function(n,t,i,r,u){var f=n.style,e="cssFloat"in f?"cssFloat":"styleFloat";return new o(f,e,0,0,u,-1,i,!1,0,f[e],t)}}),gr=function(n){var f,i=this.t,t=i.filter||u(this.data,"filter")||"",r=this.s+this.c*n|0;100===r&&(-1===t.indexOf("atrix(")&&-1===t.indexOf("radient(")&&-1===t.indexOf("oader(")?(i.removeAttribute("filter"),f=!u(this.data,"filter")):(i.filter=t.replace(fu,""),f=!0)),f||(this.xn1&&(i.filter=t=t||"alpha(opacity="+r+")"),-1===t.indexOf("pacity")?0===r&&this.xn1||(i.filter=t+" alpha(opacity="+r+")"):i.filter=t.replace(yi,"opacity="+r))},f("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(n,t,i,r,f,s){var h=parseFloat(u(n,"opacity",e,!1,"1")),c=n.style,l="autoAlpha"===i;return"string"==typeof t&&"="===t.charAt(1)&&(t=("-"===t.charAt(0)?-1:1)*parseFloat(t.substr(2))+h),l&&1===h&&"hidden"===u(n,"visibility",e)&&0!==t&&(h=0),ut?f=new o(c,"opacity",h,t-h,f):(f=new o(c,"opacity",100*h,100*(t-h),f),f.xn1=l?1:0,c.zoom=1,f.type=2,f.b="alpha(opacity="+f.s+")",f.e="alpha(opacity="+(f.s+f.c)+")",f.data=n,f.plugin=s,f.setRatio=gr),l&&(f=new o(c,"visibility",0,0,f,-1,null,!1,0,0!==h?"inherit":"hidden",0===t?"hidden":"inherit"),f.xs0="inherit",r._overwriteProps.push(f.n),r._overwriteProps.push(i)),f}}),ht=function(n,t){t&&(n.removeProperty?(("ms"===t.substr(0,2)||"webkit"===t.substr(0,6))&&(t="-"+t),n.removeProperty(t.replace(sr,"-$1").toLowerCase())):n.removeAttribute(t))},nu=function(n){if(this.t._gsClassPT=this,1===n||0===n){this.t.setAttribute("class",0===n?this.b:this.e);for(var t=this.data,i=this.t.style;t;)t.v?i[t.p]=t.v:ht(i,t.p),t=t._next;1===n&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)},f("className",{parser:function(n,t,i,r,u,f,s){var c,y,l,a,h,v=n.getAttribute("class")||"",p=n.style.cssText;if(u=r._classNamePT=new o(n,i,0,0,u,2),u.setRatio=nu,u.pr=-11,ct=!0,u.b=v,y=yt(n,e),l=n._gsClassPT){for(a={},h=l.data;h;)a[h.p]=1,h=h._next;l.setRatio(1)}return n._gsClassPT=u,u.e="="!==t.charAt(1)?t:v.replace(new RegExp("(?:\\s|^)"+t.substr(2)+"(?![\\w-])"),"")+("+"===t.charAt(0)?" "+t.substr(2):""),n.setAttribute("class",u.e),c=bi(n,y,yt(n),s,a),n.setAttribute("class",v),u.data=c.firstMPT,n.style.cssText=p,u=u.xfirst=r.parse(n,c.difs,u,f)}}),tu=function(n){if((1===n||0===n)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var i,t,r,u,f,e=this.t.style,o=v.transform.parse;if("all"===this.e)e.cssText="",u=!0;else for(i=this.e.split(" ").join("").split(","),r=i.length;--r>-1;)t=i[r],v[t]&&(v[t].parse===o?u=!0:t="transformOrigin"===t?dt:v[t].p),ht(e,t);u&&(ht(e,h),f=this.t._gsTransform,f&&(f.svg&&(this.t.removeAttribute("data-svg-origin"),this.t.removeAttribute("transform")),delete this.t._gsTransform))}},f("clearProps",{parser:function(n,t,i,r,u){return u=new o(n,i,0,0,u,2),u.setRatio=tu,u.e=t,u.pr=-10,u.data=r._tween,ct=!0,u}}),i="bezier,throwProps,physicsProps,physics2D".split(","),s=i.length;s--;)wu(i[s]);return i=r.prototype,i._firstPT=i._lastParsedTransform=i._transform=null,i._onInitTween=function(n,t,i,f){if(!n.nodeType)return!1;this._target=it=n,this._tween=i,this._vars=t,nt=f,si=t.autoRound,ct=!1,ti=t.suffixMap||r.suffixMap,e=ft(n,""),oi=this._overwriteProps;var a,c,s,y,b,k,w,p,d,l=n.style;if(er&&""===l.zIndex&&(a=u(n,"zIndex",e),("auto"===a||""===a)&&this._addLazySet(l,"zIndex",0)),"string"==typeof t&&(y=l.cssText,a=yt(n,e),l.cssText=y+";"+t,a=bi(n,a,yt(n)).difs,!ut&&uu.test(t)&&(a.opacity=parseFloat(RegExp.$1)),t=a,l.cssText=y),this._firstPT=t.className?c=v.className.parse(n,t.className,"className",this,null,null,t):c=this.parse(n,t,null),this._transformType){for(d=3===this._transformType,h?hi&&(er=!0,""===l.zIndex&&(w=u(n,"zIndex",e),("auto"===w||""===w)&&this._addLazySet(l,"zIndex",0)),or&&this._addLazySet(l,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(d?"visible":"hidden"))):l.zoom=1,s=c;s&&s._next;)s=s._next;p=new o(n,"transform",0,0,null,2),this._linkCSSP(p,null,s),p.setRatio=h?nf:gu,p.data=this._transform||gt(n,e,!0),p.tween=i,p.pr=-1,oi.pop()}if(ct){for(;c;){for(k=c._next,s=y;s&&s.pr>c.pr;)s=s._next;(c._prev=s?s._prev:b)?c._prev._next=c:y=c,(c._next=s)?s._prev=c:b=c,c=k}this._firstPT=y}return!0},i.parse=function(n,t,i,r){var f,d,h,c,a,s,y,l,p,b,k=n.style;for(f in t)s=t[f],"function"==typeof s&&(s=s(nt,it)),d=v[f],d?i=d.parse(n,s,f,this,i,r,t):(a=u(n,f,e)+"",p="string"==typeof s,"color"===f||"fill"===f||"stroke"===f||-1!==f.indexOf("Color")||p&&eu.test(s)?(p||(s=ui(s),s=(s.length>3?"rgba(":"rgb(")+s.join(",")+")"),i=kt(k,f,a,s,!0,"transparent",i,0,r)):p&&lu.test(s)?i=kt(k,f,a,s,!0,null,i,0,r):(h=parseFloat(a),y=h||0===h?a.substr((h+"").length):"",(""===a||"auto"===a)&&("width"===f||"height"===f?(h=pu(n,f,e),y="px"):"left"===f||"top"===f?(h=yr(n,f,e),y="px"):(h="opacity"!==f?0:1,y="")),b=p&&"="===s.charAt(1),b?(c=parseInt(s.charAt(0)+"1",10),s=s.substr(2),c*=parseFloat(s),l=s.replace(at,"")):(c=parseFloat(s),l=p?s.replace(at,""):""),""===l&&(l=f in ti?ti[f]:y),s=c||0===c?(b?c+h:c)+l:t[f],y!==l&&""!==l&&(c||0===c)&&h&&(h=w(n,f,h,y),"%"===l?(h/=w(n,f,100,"%")/100,t.strictUnits!==!0&&(a=h+"%")):"em"===l||"rem"===l||"vw"===l||"vh"===l?h/=w(n,f,1,l):"px"!==l&&(c=w(n,f,c,l),l="px"),b&&(c||0===c)&&(s=c+h+l)),b&&(c+=h),!h&&0!==h||!c&&0!==c?void 0!==k[f]&&(s||s+""!="NaN"&&null!=s)?(i=new o(k,f,c||h||0,0,i,-1,f,!1,0,a,s),i.xs0="none"!==s||"display"!==f&&-1===f.indexOf("Style")?s:a):ar("invalid "+f+" tween value: "+t[f]):(i=new o(k,f,h,c-h,i,0,f,si!==!1&&("px"===l||"zIndex"===f),0,a,s),i.xs0=l))),r&&i&&!i.plugin&&(i.plugin=r);return i},i.setRatio=function(n){var r,u,i,t=this._firstPT,f=1e-6;if(1!==n||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(n||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;t;){if(r=t.c*n+t.s,t.r?r=Math.round(r):f>r&&r>-f&&(r=0),t.type)if(1===t.type)if(i=t.l,2===i)t.t[t.p]=t.xs0+r+t.xs1+t.xn1+t.xs2;else if(3===i)t.t[t.p]=t.xs0+r+t.xs1+t.xn1+t.xs2+t.xn2+t.xs3;else if(4===i)t.t[t.p]=t.xs0+r+t.xs1+t.xn1+t.xs2+t.xn2+t.xs3+t.xn3+t.xs4;else if(5===i)t.t[t.p]=t.xs0+r+t.xs1+t.xn1+t.xs2+t.xn2+t.xs3+t.xn3+t.xs4+t.xn4+t.xs5;else{for(u=t.xs0+r+t.xs1,i=1;i<t.l;i++)u+=t["xn"+i]+t["xs"+(i+1)];t.t[t.p]=u}else-1===t.type?t.t[t.p]=t.xs0:t.setRatio&&t.setRatio(n);else t.t[t.p]=r+t.xs0;t=t._next}else for(;t;)2!==t.type?t.t[t.p]=t.b:t.setRatio(n),t=t._next;else for(;t;){if(2!==t.type)if(t.r&&-1!==t.type)if(r=Math.round(t.s+t.c),t.type){if(1===t.type){for(i=t.l,u=t.xs0+r+t.xs1,i=1;i<t.l;i++)u+=t["xn"+i]+t["xs"+(i+1)];t.t[t.p]=u}}else t.t[t.p]=r+t.xs0;else t.t[t.p]=t.e;else t.setRatio(n);t=t._next}},i._enableTransforms=function(n){this._transform=this._transform||gt(this._target,e,!0),this._transformType=this._transform.svg&&tt||!n&&3!==this._transformType?2:3},iu=function(){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)},i._addLazySet=function(n,t,i){var r=this._firstPT=new o(n,t,0,0,this._firstPT,2);r.e=i,r.setRatio=iu,r.data=this},i._linkCSSP=function(n,t,i,r){return n&&(t&&(t._prev=n),n._next&&(n._next._prev=n._prev),n._prev?n._prev._next=n._next:this._firstPT===n&&(this._firstPT=n._next,r=!0),i?i._next=n:r||null!==this._firstPT||(this._firstPT=n),n._next=t,n._prev=i),n},i._mod=function(n){for(var t=this._firstPT;t;)"function"==typeof n[t.p]&&n[t.p]===Math.round&&(t.r=1),t=t._next},i._kill=function(t){var i,f,r,u=t;if(t.autoAlpha||t.alpha){u={};for(f in t)u[f]=t[f];u.opacity=1,u.autoAlpha&&(u.visibility=1)}for(t.className&&(i=this._classNamePT)&&(r=i.xfirst,r&&r._prev?this._linkCSSP(r._prev,i._next,r._prev._prev):r===this._firstPT&&(this._firstPT=i._next),i._next&&this._linkCSSP(i._next,i._next._next,r._prev),this._classNamePT=null),i=this._firstPT;i;)i.plugin&&i.plugin!==f&&i.plugin._kill&&(i.plugin._kill(t),f=i.plugin),i=i._next;return n.prototype._kill.call(this,u)},ni=function(n,t,i){var e,u,r,f;if(n.slice)for(u=n.length;--u>-1;)ni(n[u],t,i);else for(e=n.childNodes,u=e.length;--u>-1;)r=e[u],f=r.type,r.style&&(t.push(yt(r)),i&&i.push(r)),1!==f&&9!==f&&11!==f||!r.childNodes.length||ni(r,t,i)},r.cascadeTo=function(n,i,r){var u,f,e,h,o=t.to(n,i,r),l=[o],c=[],a=[],s=[],v=t._internals.reservedProps;for(n=o._targets||o.target,ni(n,c,s),o.render(i,!0,!0),ni(n,a),o.render(0,!0,!0),o._enabled(!0),u=s.length;--u>-1;)if(f=bi(s[u],c[u],a[u]),f.firstMPT){f=f.difs;for(e in r)v[e]&&(f[e]=r[e]);h={};for(e in f)h[e]=c[u][e];l.push(t.fromTo(s[u],i,h,f))}return l},n.activate([r]),r},!0),function(){var t=_gsScope._gsDefine.plugin({propName:"roundProps",version:"1.6.0",priority:-1,API:2,init:function(n,t,i){return this._tween=i,!0}}),i=function(n){for(;n;)n.f||n.blob||(n.m=Math.round),n=n._next},n=t.prototype;n._onInitAllProps=function(){for(var f,n,r,t=this._tween,e=t.vars.roundProps.join?t.vars.roundProps:t.vars.roundProps.split(","),u=e.length,o={},s=t._propLookup.roundProps;--u>-1;)o[e[u]]=Math.round;for(u=e.length;--u>-1;)for(f=e[u],n=t._firstPT;n;)r=n._next,n.pg?n.t._mod(o):n.n===f&&(2===n.f&&n.t?i(n.t._firstPT):(this._add(n.t,f,n.s,n.c),r&&(r._prev=n._prev),n._prev?n._prev._next=r:t._firstPT===n&&(t._firstPT=r),n._next=n._prev=null,t._propLookup[f]=s)),n=r;return!1},n._add=function(n,t,i,r){this._addTween(n,t,i,i+r,t,Math.round),this._overwriteProps.push(t)}}(),function(){_gsScope._gsDefine.plugin({propName:"attr",API:2,version:"0.6.0",init:function(n,t,i,r){var u,f;if("function"!=typeof n.setAttribute)return!1;for(u in t)f=t[u],"function"==typeof f&&(f=f(r,n)),this._addTween(n,"setAttribute",n.getAttribute(u)+"",f+"",u,!1,u),this._overwriteProps.push(u);return!0}})}(),_gsScope._gsDefine.plugin({propName:"directionalRotation",version:"0.3.0",API:2,init:function(n,t,i,r){"object"!=typeof t&&(t={rotation:t}),this.finals={};var f,o,h,s,u,c,e=t.useRadians===!0?2*Math.PI:360,l=1e-6;for(f in t)"useRadians"!==f&&(s=t[f],"function"==typeof s&&(s=s(r,n)),c=(s+"").split("_"),o=c[0],h=parseFloat("function"!=typeof n[f]?n[f]:n[f.indexOf("set")||"function"!=typeof n["get"+f.substr(3)]?f:"get"+f.substr(3)]()),s=this.finals[f]="string"==typeof o&&"="===o.charAt(1)?h+parseInt(o.charAt(0)+"1",10)*Number(o.substr(2)):Number(o)||0,u=s-h,c.length&&(o=c.join("_"),-1!==o.indexOf("short")&&(u%=e,u!==u%(e/2)&&(u=0>u?u+e:u-e)),-1!==o.indexOf("_cw")&&0>u?u=(u+9999999999*e)%e-(u/e|0)*e:-1!==o.indexOf("ccw")&&u>0&&(u=(u-9999999999*e)%e-(u/e|0)*e)),(u>l||-l>u)&&(this._addTween(n,f,h,h+u,f),this._overwriteProps.push(f)));return!0},set:function(n){var t;if(1!==n)this._super.setRatio.call(this,n);else for(t=this._firstPT;t;)t.f?t.t[t.p](this.finals[t.p]):t.t[t.p]=this.finals[t.p],t=t._next}})._autoCSS=!0,_gsScope._gsDefine("easing.Back",["easing.Ease"],function(n){var f,u,s,a=_gsScope.GreenSockGlobals||_gsScope,p=a.com.greensock,v=2*Math.PI,y=Math.PI/2,r=p._class,t=function(t,i){var u=r("easing."+t,function(){},!0),f=u.prototype=new n;return f.constructor=u,f.getRatio=i,u},h=n.register||function(){},e=function(n,t,i,u){var f=r("easing."+n,{easeOut:new t,easeIn:new i,easeInOut:new u},!0);return h(f,n),f},c=function(n,t,i){this.t=n,this.v=t,i&&(this.next=i,i.prev=this,this.c=i.v-t,this.gap=i.t-n)},l=function(t,i){var u=r("easing."+t,function(n){this._p1=n||0===n?n:1.70158,this._p2=1.525*this._p1},!0),f=u.prototype=new n;return f.constructor=u,f.getRatio=i,f.config=function(n){return new u(n)},u},w=e("Back",l("BackOut",function(n){return(n-=1)*n*((this._p1+1)*n+this._p1)+1}),l("BackIn",function(n){return n*n*((this._p1+1)*n-this._p1)}),l("BackInOut",function(n){return(n*=2)<1?.5*n*n*((this._p2+1)*n-this._p2):.5*((n-=2)*n*((this._p2+1)*n+this._p2)+2)})),o=r("easing.SlowMo",function(n,t,i){t=t||0===t?t:.7,null==n?n=.7:n>1&&(n=1),this._p=1!==n?t:0,this._p1=(1-n)/2,this._p2=n,this._p3=this._p1+this._p2,this._calcEnd=i===!0},!0),i=o.prototype=new n;return i.constructor=o,i.getRatio=function(n){var t=n+(.5-n)*this._p;return n<this._p1?this._calcEnd?1-(n=1-n/this._p1)*n:t-(n=1-n/this._p1)*n*n*n*t:n>this._p3?this._calcEnd?1-(n=(n-this._p3)/this._p1)*n:t+(n-t)*(n=(n-this._p3)/this._p1)*n*n*n:this._calcEnd?1:t},o.ease=new o(.7,.7),i.config=o.config=function(n,t,i){return new o(n,t,i)},f=r("easing.SteppedEase",function(n){n=n||1,this._p1=1/n,this._p2=n+1},!0),i=f.prototype=new n,i.constructor=f,i.getRatio=function(n){return 0>n?n=0:n>=1&&(n=.999999999),(this._p2*n>>0)*this._p1},i.config=f.config=function(n){return new f(n)},u=r("easing.RoughEase",function(t){t=t||{};for(var i,r,u,f,h,e,l=t.taper||"none",a=[],w=0,v=0|(t.points||20),o=v,y=t.randomize!==!1,b=t.clamp===!0,p=t.template instanceof n?t.template:null,s="number"==typeof t.strength?.4*t.strength:.4;--o>-1;)i=y?Math.random():1/v*o,r=p?p.getRatio(i):i,"none"===l?u=s:"out"===l?(f=1-i,u=f*f*s):"in"===l?u=i*i*s:.5>i?(f=2*i,u=f*f*.5*s):(f=2*(1-i),u=f*f*.5*s),y?r+=Math.random()*u-.5*u:o%2?r+=.5*u:r-=.5*u,b&&(r>1?r=1:0>r&&(r=0)),a[w++]={x:i,y:r};for(a.sort(function(n,t){return n.x-t.x}),e=new c(1,1,null),o=v;--o>-1;)h=a[o],e=new c(h.x,h.y,e);this._prev=new c(0,0,0!==e.t?e:e.next)},!0),i=u.prototype=new n,i.constructor=u,i.getRatio=function(n){var t=this._prev;if(n>t.t){for(;t.next&&n>=t.t;)t=t.next;t=t.prev}else for(;t.prev&&n<=t.t;)t=t.prev;return this._prev=t,t.v+(n-t.t)/t.gap*t.c},i.config=function(n){return new u(n)},u.ease=new u,e("Bounce",t("BounceOut",function(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}),t("BounceIn",function(n){return(n=1-n)<1/2.75?1-7.5625*n*n:2/2.75>n?1-(7.5625*(n-=1.5/2.75)*n+.75):2.5/2.75>n?1-(7.5625*(n-=2.25/2.75)*n+.9375):1-(7.5625*(n-=2.625/2.75)*n+.984375)}),t("BounceInOut",function(n){var t=.5>n;return n=t?1-2*n:2*n-1,n=1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375,t?.5*(1-n):.5*n+.5})),e("Circ",t("CircOut",function(n){return Math.sqrt(1-(n-=1)*n)}),t("CircIn",function(n){return-(Math.sqrt(1-n*n)-1)}),t("CircInOut",function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)})),s=function(t,i,u){var f=r("easing."+t,function(n,t){this._p1=n>=1?n:1,this._p2=(t||u)/(1>n?n:1),this._p3=this._p2/v*(Math.asin(1/this._p1)||0),this._p2=v/this._p2},!0),e=f.prototype=new n;return e.constructor=f,e.getRatio=i,e.config=function(n,t){return new f(n,t)},f},e("Elastic",s("ElasticOut",function(n){return this._p1*Math.pow(2,-10*n)*Math.sin((n-this._p3)*this._p2)+1},.3),s("ElasticIn",function(n){return-(this._p1*Math.pow(2,10*(n-=1))*Math.sin((n-this._p3)*this._p2))},.3),s("ElasticInOut",function(n){return(n*=2)<1?-.5*this._p1*Math.pow(2,10*(n-=1))*Math.sin((n-this._p3)*this._p2):this._p1*Math.pow(2,-10*(n-=1))*Math.sin((n-this._p3)*this._p2)*.5+1},.45)),e("Expo",t("ExpoOut",function(n){return 1-Math.pow(2,-10*n)}),t("ExpoIn",function(n){return Math.pow(2,10*(n-1))-.001}),t("ExpoInOut",function(n){return(n*=2)<1?.5*Math.pow(2,10*(n-1)):.5*(2-Math.pow(2,-10*(n-1)))})),e("Sine",t("SineOut",function(n){return Math.sin(n*y)}),t("SineIn",function(n){return-Math.cos(n*y)+1}),t("SineInOut",function(n){return-.5*(Math.cos(Math.PI*n)-1)})),r("easing.EaseLookup",{find:function(t){return n.map[t]}},!0),h(a.SlowMo,"SlowMo","ease,"),h(u,"RoughEase","ease,"),h(f,"SteppedEase","ease,"),w},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(n,t){"use strict";var g={},ut=n.document,ht=n.GreenSockGlobals=n.GreenSockGlobals||n,at,o,yt,ot,c;if(!ht.TweenLite){var s,f,i,u,h,gt=function(n){for(var r=n.split("."),i=ht,t=0;t<r.length;t++)i[r[t]]=i=i[r[t]]||{};return i},y=gt("com.greensock"),e=1e-10,ni=function(n){for(var i=[],r=n.length,t=0;t!==r;i.push(n[t++]));return i},ti=function(){},nt=function(){var n=Object.prototype.toString,t=n.call([]);return function(i){return null!=i&&(i instanceof Array||"object"==typeof i&&!!i.push&&n.call(i)===t)}}(),tt={},ii=function(i,r,u,f){this.sc=tt[i]?tt[i].sc:[],tt[i]=this,this.gsClass=null,this.func=u;var e=[];this.check=function(o){for(var l,a,c,h,v,s=r.length,y=s;--s>-1;)(l=tt[r[s]]||new ii(r[s],[])).gsClass?(e[s]=l.gsClass,y--):o&&l.sc.push(this);if(0===y&&u){if(a=("com.greensock."+i).split("."),c=a.pop(),h=gt(a.join("."))[c]=this.gsClass=u.apply(u,e),f)if(ht[c]=g[c]=h,v="undefined"!=typeof module&&module.exports,!v&&"function"==typeof define&&define.amd)define((n.GreenSockAMDPath?n.GreenSockAMDPath+"/":"")+i.split(".").pop(),[],function(){return h});else if(v)if(i===t){module.exports=g[t]=h;for(s in g)h[s]=g[s]}else g[t]&&(g[t][c]=h);for(s=0;s<this.sc.length;s++)this.sc[s].check()}},this.check(!0)},ct=n._gsDefine=function(n,t,i,r){return new ii(n,t,i,r)},l=y._class=function(n,t,i){return t=t||function(){},ct(n,[],function(){return t},i),t};ct.globals=ht;var ri=[0,0,1,1],a=l("easing.Ease",function(n,t,i,r){this._func=n,this._type=i||0,this._power=r||0,this._params=t?ri.concat(t):ri},!0),ft=a.map={},lt=a.register=function(n,t,i,r){for(var o,u,e,f,s=t.split(","),h=s.length,c=(i||"easeIn,easeOut,easeInOut").split(",");--h>-1;)for(u=s[h],o=r?l("easing."+u,null,!0):y.easing[u]||{},e=c.length;--e>-1;)f=c[e],ft[u+"."+f]=ft[f+u]=o[f]=n.getRatio?n:n[f]||new n};for(i=a.prototype,i._calcEnd=!1,i.getRatio=function(n){if(this._func)return this._params[0]=n,this._func.apply(null,this._params);var i=this._type,r=this._power,t=1===i?1-n:2===i?n:.5>n?2*n:2*(1-n);return 1===r?t*=t:2===r?t*=t*t:3===r?t*=t*t*t:4===r&&(t*=t*t*t*t),1===i?1-t:2===i?t:.5>n?t/2:1-t/2},s=["Linear","Quad","Cubic","Quart","Quint,Strong"],f=s.length;--f>-1;)i=s[f]+",Power"+f,lt(new a(null,null,1,f),i,"easeOut",!0),lt(new a(null,null,2,f),i,"easeIn"+(0===f?",easeNone":"")),lt(new a(null,null,3,f),i,"easeInOut");ft.linear=y.easing.Linear.easeIn,ft.swing=y.easing.Quad.easeInOut,at=l("events.EventDispatcher",function(n){this._listeners={},this._eventTarget=n||this}),i=at.prototype,i.addEventListener=function(n,t,i,r,f){f=f||0;var s,o,e=this._listeners[n],c=0;for(this!==u||h||u.wake(),null==e&&(this._listeners[n]=e=[]),o=e.length;--o>-1;)s=e[o],s.c===t&&s.s===i?e.splice(o,1):0===c&&s.pr<f&&(c=o+1);e.splice(c,0,{c:t,s:i,up:r,pr:f})},i.removeEventListener=function(n,t){var i,r=this._listeners[n];if(r)for(i=r.length;--i>-1;)if(r[i].c===t)return void r.splice(i,1)},i.dispatchEvent=function(n){var r,u,t,i=this._listeners[n];if(i)for(r=i.length,r>1&&(i=i.slice(0)),u=this._eventTarget;--r>-1;)t=i[r],t&&(t.up?t.c.call(t.s||u,{type:n,target:u}):t.c.call(t.s||u))};var et=n.requestAnimationFrame,vt=n.cancelAnimationFrame,it=Date.now||function(){return(new Date).getTime()},w=it();for(s=["ms","moz","webkit","o"],f=s.length;--f>-1&&!et;)et=n[s[f]+"RequestAnimationFrame"],vt=n[s[f]+"CancelAnimationFrame"]||n[s[f]+"CancelRequestAnimationFrame"];l("Ticker",function(n,t){var r,a,f,s,c,i=this,v=it(),o=t!==!1&&et?"auto":!1,l=500,p=33,b="tick",y=function(n){var t,e,u=it()-w;u>l&&(v+=u-p),w+=u,i.time=(w-v)/1e3,t=i.time-c,(!r||t>0||n===!0)&&(i.frame++,c+=t+(t>=s?.004:s-t),e=!0),n!==!0&&(f=a(y)),e&&i.dispatchEvent(b)};at.call(i),i.time=i.frame=0,i.tick=function(){y(!0)},i.lagSmoothing=function(n,t){l=n||1/e,p=Math.min(t,l,0)},i.sleep=function(){null!=f&&(o&&vt?vt(f):clearTimeout(f),a=ti,f=null,i===u&&(h=!1))},i.wake=function(n){null!==f?i.sleep():n?v+=-w+(w=it()):i.frame>10&&(w=it()-l+5),a=0===r?ti:o&&et?et:function(n){return setTimeout(n,1e3*(c-i.time)+1|0)},i===u&&(h=!0),y(2)},i.fps=function(n){return arguments.length?(r=n,s=1/(r||60),c=this.time+s,void i.wake()):r},i.useRAF=function(n){return arguments.length?(i.sleep(),o=n,void i.fps(r)):o},i.fps(n),setTimeout(function(){"auto"===o&&i.frame<5&&"hidden"!==ut.visibilityState&&i.useRAF(!1)},1500)}),i=y.Ticker.prototype=new y.events.EventDispatcher,i.constructor=y.Ticker,o=l("core.Animation",function(n,t){if(this.vars=t=t||{},this._duration=this._totalDuration=n||0,this._delay=Number(t.delay)||0,this._timeScale=1,this._active=t.immediateRender===!0,this.data=t.data,this._reversed=t.reversed===!0,p){h||u.wake();var i=this.vars.useFrames?d:p;i.add(this,i._time),this.vars.paused&&this.paused(!0)}}),u=o.ticker=new y.Ticker,i=o.prototype,i._dirty=i._gc=i._initted=i._paused=!1,i._totalTime=i._time=0,i._rawPrevTime=-1,i._next=i._last=i._onUpdate=i._timeline=i.timeline=null,i._paused=!1,yt=function(){h&&it()-w>2e3&&u.wake(),setTimeout(yt,2e3)},yt(),i.play=function(n,t){return null!=n&&this.seek(n,t),this.reversed(!1).paused(!1)},i.pause=function(n,t){return null!=n&&this.seek(n,t),this.paused(!0)},i.resume=function(n,t){return null!=n&&this.seek(n,t),this.paused(!1)},i.seek=function(n,t){return this.totalTime(Number(n),t!==!1)},i.restart=function(n,t){return this.reversed(!1).paused(!1).totalTime(n?-this._delay:0,t!==!1,!0)},i.reverse=function(n,t){return null!=n&&this.seek(n||this.totalDuration(),t),this.reversed(!0).paused(!1)},i.render=function(){},i.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,(this._gc||!this.timeline)&&this._enabled(!0),this},i.isActive=function(){var t,n=this._timeline,i=this._startTime;return!n||!this._gc&&!this._paused&&n.isActive()&&(t=n.rawTime(!0))>=i&&t<i+this.totalDuration()/this._timeScale},i._enabled=function(n,t){return h||u.wake(),this._gc=!n,this._active=this.isActive(),t!==!0&&(n&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!n&&this.timeline&&this._timeline._remove(this,!0)),!1},i._kill=function(){return this._enabled(!1,!1)},i.kill=function(n,t){return this._kill(n,t),this},i._uncache=function(n){for(var t=n?this:this.timeline;t;)t._dirty=!0,t=t.timeline;return this},i._swapSelfInParams=function(n){for(var t=n.length,i=n.concat();--t>-1;)"{self}"===n[t]&&(i[t]=this);return i},i._callback=function(n){var i=this.vars,r=i[n],t=i[n+"Params"],u=i[n+"Scope"]||i.callbackScope||this,f=t?t.length:0;switch(f){case 0:r.call(u);break;case 1:r.call(u,t[0]);break;case 2:r.call(u,t[0],t[1]);break;default:r.apply(u,t)}},i.eventCallback=function(n,t,i,r){if("on"===(n||"").substr(0,2)){var u=this.vars;if(1===arguments.length)return u[n];null==t?delete u[n]:(u[n]=t,u[n+"Params"]=nt(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,u[n+"Scope"]=r),"onUpdate"===n&&(this._onUpdate=t)}return this},i.delay=function(n){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+n-this._delay),this._delay=n,this):this._delay},i.duration=function(n){return arguments.length?(this._duration=this._totalDuration=n,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==n&&this.totalTime(this._totalTime*(n/this._duration),!0),this):(this._dirty=!1,this._duration)},i.totalDuration=function(n){return this._dirty=!1,arguments.length?this.duration(n):this._totalDuration},i.time=function(n,t){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(n>this._duration?this._duration:n,t)):this._time},i.totalTime=function(n,t,i){if(h||u.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>n&&!i&&(n+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var f=this._totalDuration,r=this._timeline;if(n>f&&!i&&(n=f),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?f-n:n)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==n||0===this._duration)&&(v.length&&rt(),this.render(n,t,!1),v.length&&rt())}return this},i.progress=i.totalProgress=function(n,t){var i=this.duration();return arguments.length?this.totalTime(i*n,t):i?this._time/i:this.ratio},i.startTime=function(n){return arguments.length?(n!==this._startTime&&(this._startTime=n,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,n-this._delay)),this):this._startTime},i.endTime=function(n){return this._startTime+(0!=n?this.totalDuration():this.duration())/this._timeScale},i.timeScale=function(n){if(!arguments.length)return this._timeScale;if(n=n||e,this._timeline&&this._timeline.smoothChildTiming){var t=this._pauseTime,i=t||0===t?t:this._timeline.totalTime();this._startTime=i-(i-this._startTime)*this._timeScale/n}return this._timeScale=n,this._uncache(!1)},i.reversed=function(n){return arguments.length?(n!=this._reversed&&(this._reversed=n,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},i.paused=function(n){if(!arguments.length)return this._paused;var t,r,i=this._timeline;return n!=this._paused&&i&&(h||n||u.wake(),t=i.rawTime(),r=t-this._pauseTime,!n&&i.smoothChildTiming&&(this._startTime+=r,this._uncache(!1)),this._pauseTime=n?t:null,this._paused=n,this._active=this.isActive(),!n&&0!==r&&this._initted&&this.duration()&&(t=i.smoothChildTiming?this._totalTime:(t-this._startTime)/this._timeScale,this.render(t,t===this._totalTime,!0))),this._gc&&!n&&this._enabled(!0,!1),this},ot=l("core.SimpleTimeline",function(n){o.call(this,0,n),this.autoRemoveChildren=this.smoothChildTiming=!0}),i=ot.prototype=new o,i.constructor=ot,i.kill()._gc=!1,i._first=i._last=i._recent=null,i._sortChildren=!1,i.add=i.insert=function(n,t){var i,r;if(n._startTime=Number(t||0)+n._delay,n._paused&&this!==n._timeline&&(n._pauseTime=n._startTime+(this.rawTime()-n._startTime)/n._timeScale),n.timeline&&n.timeline._remove(n,!0),n.timeline=n._timeline=this,n._gc&&n._enabled(!0,!0),i=this._last,this._sortChildren)for(r=n._startTime;i&&i._startTime>r;)i=i._prev;return i?(n._next=i._next,i._next=n):(n._next=this._first,this._first=n),n._next?n._next._prev=n:this._last=n,n._prev=i,this._recent=n,this._timeline&&this._uncache(!0),this},i._remove=function(n,t){return n.timeline===this&&(t||n._enabled(!1,!0),n._prev?n._prev._next=n._next:this._first===n&&(this._first=n._next),n._next?n._next._prev=n._prev:this._last===n&&(this._last=n._prev),n._next=n._prev=n.timeline=null,n===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},i.render=function(n,t,i){var u,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=n;r;)u=r._next,(r._active||n>=r._startTime&&!r._paused)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(n-r._startTime)*r._timeScale,t,i):r.render((n-r._startTime)*r._timeScale,t,i)),r=u},i.rawTime=function(){return h||u.wake(),this._totalTime};var r=l("TweenLite",function(t,i,u){if(o.call(this,i,u),this.render=r.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:r.selector(t)||t;var s,f,h,l=t.jquery||t.length&&t!==n&&t[0]&&(t[0]===n||t[0].nodeType&&t[0].style&&!t.nodeType),c=this.vars.overwrite;if(this._overwrite=c=null==c?si[r.defaultOverwrite]:"number"==typeof c?c>>0:si[c],(l||t instanceof Array||t.push&&nt(t))&&"number"!=typeof t[0])for(this._targets=h=ni(t),this._propLookup=[],this._siblings=[],s=0;s<h.length;s++)f=h[s],f?"string"!=typeof f?f.length&&f!==n&&f[0]&&(f[0]===n||f[0].nodeType&&f[0].style&&!f.nodeType)?(h.splice(s--,1),this._targets=h=h.concat(ni(f))):(this._siblings[s]=st(f,this,!1),1===c&&this._siblings[s].length>1&&dt(f,this,null,1,this._siblings[s])):(f=h[s--]=r.selector(f),"string"==typeof f&&h.splice(s+1,1)):h.splice(s--,1);else this._propLookup={},this._siblings=st(t,this,!1),1===c&&this._siblings.length>1&&dt(t,this,null,1,this._siblings);(this.vars.immediateRender||0===i&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-e,this.render(Math.min(0,-this._delay)))},!0),pt=function(t){return t&&t.length&&t!==n&&t[0]&&(t[0]===n||t[0].nodeType&&t[0].style&&!t.nodeType)},ai=function(n,t){var i,r={};for(i in n)kt[i]||i in t&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!b[i]||b[i]&&b[i]._autoCSS)||(r[i]=n[i],delete n[i]);n.css=r};i=r.prototype=new o,i.constructor=r,i.kill()._gc=!1,i.ratio=0,i._firstPT=i._targets=i._overwrittenProps=i._startAt=null,i._notifyPluginsOfEnabled=i._lazy=!1,r.version="1.19.1",r.defaultEase=i._ease=new a(null,null,1,1),r.defaultOverwrite="auto",r.ticker=u,r.autoSleep=120,r.lagSmoothing=function(n,t){u.lagSmoothing(n,t)},r.selector=n.$||n.jQuery||function(t){var i=n.$||n.jQuery;return i?(r.selector=i,i(t)):"undefined"==typeof ut?t:ut.querySelectorAll?ut.querySelectorAll(t):ut.getElementById("#"===t.charAt(0)?t.substr(1):t)};var v=[],wt={},ui=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,fi=function(n){for(var i,t=this._firstPT,r=1e-6;t;)i=t.blob?1===n?this.end:n?this.join(""):this.start:t.c*n+t.s,t.m?i=t.m(i,this._target||t.t):r>i&&i>-r&&!t.blob&&(i=0),t.f?t.fp?t.t[t.p](t.fp,i):t.t[t.p](i):t.t[t.p]=i,t=t._next},ei=function(n,t,i,r){var l,v,a,e,y,c,f,u=[],s=0,o="",h=0;for(u.start=n,u.end=t,n=u[0]=n+"",t=u[1]=t+"",i&&(i(u),n=u[0],t=u[1]),u.length=0,l=n.match(ui)||[],v=t.match(ui)||[],r&&(r._next=null,r.blob=1,u._firstPT=u._applyPT=r),y=v.length,e=0;y>e;e++)f=v[e],c=t.substr(s,t.indexOf(f,s)-s),o+=c||!e?c:",",s+=c.length,h?h=(h+1)%5:"rgba("===c.substr(-5)&&(h=1),f===l[e]||l.length<=e?o+=f:(o&&(u.push(o),o=""),a=parseFloat(l[e]),u.push(a),u._firstPT={_next:u._firstPT,t:u,p:u.length-1,s:a,c:("="===f.charAt(1)?parseInt(f.charAt(0)+"1",10)*parseFloat(f.substr(2)):parseFloat(f)-a)||0,f:0,m:h&&4>h?Math.round:0}),s+=f.length;return o+t.substr(s),o&&u.push(o),u.setRatio=fi,u},oi=function(n,t,i,u,f,e,o,s,h){"function"==typeof u&&(u=u(h||0,n));var y,p=typeof n[t],v="function"!==p?"":t.indexOf("set")||"function"!=typeof n["get"+t.substr(3)]?t:"get"+t.substr(3),l="get"!==i?i:v?o?n[v](o):n[v]():n[t],a="string"==typeof u&&"="===u.charAt(1),c={t:n,p:t,s:l,f:"function"===p,pg:0,n:f||t,m:e?"function"==typeof e?e:Math.round:0,pr:0,c:a?parseInt(u.charAt(0)+"1",10)*parseFloat(u.substr(2)):parseFloat(u)-l||0};return("number"!=typeof l||"number"!=typeof u&&!a)&&(o||isNaN(l)||!a&&isNaN(u)||"boolean"==typeof l||"boolean"==typeof u?(c.fp=o,y=ei(l,a?c.s+c.c:u,s||r.defaultStringFilter,c),c={t:y,p:"setRatio",s:0,c:1,f:2,pg:0,n:f||t,pr:0,m:0}):(c.s=parseFloat(l),a||(c.c=parseFloat(u)-c.s||0))),c.c?((c._next=this._firstPT)&&(c._next._prev=c),this._firstPT=c,c):void 0},bt=r._internals={isArray:nt,isSelector:pt,lazyTweens:v,blobDif:ei},b=r._plugins={},k=bt.tweenLookup={},vi=0,kt=bt.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1,id:1},si={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},d=o._rootFramesTimeline=new ot,p=o._rootTimeline=new ot,hi=30,rt=bt.lazyRender=function(){var n,t=v.length;for(wt={};--t>-1;)n=v[t],n&&n._lazy!==!1&&(n.render(n._lazy[0],n._lazy[1],!0),n._lazy=!1);v.length=0};p._startTime=u.time,d._startTime=u.frame,p._active=d._active=!0,setTimeout(rt,1),o._updateRoot=r.render=function(){var i,t,n;if(v.length&&rt(),p.render((u.time-p._startTime)*p._timeScale,!1,!1),d.render((u.frame-d._startTime)*d._timeScale,!1,!1),v.length&&rt(),u.frame>=hi){hi=u.frame+(parseInt(r.autoSleep,10)||120);for(n in k){for(t=k[n].tweens,i=t.length;--i>-1;)t[i]._gc&&t.splice(i,1);0===t.length&&delete k[n]}if(n=p._first,(!n||n._paused)&&r.autoSleep&&!d._first&&1===u._listeners.tick.length){for(;n&&n._paused;)n=n._next;n||u.sleep()}}},u.addEventListener("tick",o._updateRoot);var st=function(n,t,i){var r,f,u=n._gsTweenID;if(k[u||(n._gsTweenID=u="t"+vi++)]||(k[u]={target:n,tweens:[]}),t&&(r=k[u].tweens,r[f=r.length]=t,i))for(;--f>-1;)r[f]===t&&r.splice(f,1);return k[u].tweens},ci=function(n,t,i,u){var e,o,f=n.vars.onOverwrite;return f&&(e=f(n,t,i,u)),f=r.onOverwrite,f&&(o=f(n,t,i,u)),e!==!1&&o!==!1},dt=function(n,t,i,r,u){var o,s,f,y;if(1===r||r>=4){for(y=u.length,o=0;y>o;o++)if((f=u[o])!==t)f._gc||f._kill(null,n,t)&&(s=!0);else if(5===r)break;return s}var h,c=t._startTime+e,l=[],a=0,v=0===t._duration;for(o=u.length;--o>-1;)(f=u[o])===t||f._gc||f._paused||(f._timeline!==t._timeline?(h=h||li(t,0,v),0===li(f,h,v)&&(l[a++]=f)):f._startTime<=c&&f._startTime+f.totalDuration()/f._timeScale>c&&((v||!f._initted)&&c-f._startTime<=2e-10||(l[a++]=f)));for(o=a;--o>-1;)if(f=l[o],2===r&&f._kill(i,n,t)&&(s=!0),2!==r||!f._firstPT&&f._initted){if(2!==r&&!ci(f,t))continue;f._enabled(!1,!1)&&(s=!0)}return s},li=function(n,t,i){for(var u=n._timeline,f=u._timeScale,r=n._startTime;u._timeline;){if(r+=u._startTime,f*=u._timeScale,u._paused)return-100;u=u._timeline}return r/f,r>t?r-t:i&&r===t||!n._initted&&2*e>r-t?e:(r+=n.totalDuration()/n._timeScale/f)>t+e?0:r-t-e};if(i._init=function(){var u,h,n,f,e,c,t=this.vars,s=this._overwrittenProps,l=this._duration,o=!!t.immediateRender,i=t.ease;if(t.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),e={};for(f in t.startAt)e[f]=t.startAt[f];if(e.overwrite=!1,e.immediateRender=!0,e.lazy=o&&t.lazy!==!1,e.startAt=e.delay=null,this._startAt=r.to(this.target,0,e),o)if(this._time>0)this._startAt=null;else if(0!==l)return}else if(t.runBackwards&&0!==l)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{0!==this._time&&(o=!1),n={};for(f in t)kt[f]&&"autoCSS"!==f||(n[f]=t[f]);if(n.overwrite=0,n.data="isFromStart",n.lazy=o&&t.lazy!==!1,n.immediateRender=o,this._startAt=r.to(this.target,0,n),o){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=i=i?i instanceof a?i:"function"==typeof i?new a(i,t.easeParams):ft[i]||r.defaultEase:r.defaultEase,t.easeParams instanceof Array&&i.config&&(this._ease=i.config.apply(i,t.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(c=this._targets.length,u=0;c>u;u++)this._initProps(this._targets[u],this._propLookup[u]={},this._siblings[u],s?s[u]:null,u)&&(h=!0);else h=this._initProps(this.target,this._propLookup,this._siblings,s,0);if(h&&r._onPluginEvent("_onInitAllProps",this),s&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),t.runBackwards)for(n=this._firstPT;n;)n.s+=n.c,n.c=-n.c,n=n._next;this._onUpdate=t.onUpdate,this._initted=!0},i._initProps=function(t,i,r,u,f){var e,c,l,o,h,s;if(null==t)return!1;wt[t._gsTweenID]&&rt(),this.vars.css||t.style&&t!==n&&t.nodeType&&b.css&&this.vars.autoCSS!==!1&&ai(this.vars,t);for(e in this.vars)if(s=this.vars[e],kt[e])s&&(s instanceof Array||s.push&&nt(s))&&-1!==s.join("").indexOf("{self}")&&(this.vars[e]=s=this._swapSelfInParams(s,this));else if(b[e]&&(o=new b[e])._onInitTween(t,this.vars[e],this,f)){for(this._firstPT=h={_next:this._firstPT,t:o,p:"setRatio",s:0,c:1,f:1,n:e,pg:1,pr:o._priority,m:0},c=o._overwriteProps.length;--c>-1;)i[o._overwriteProps[c]]=this._firstPT;(o._priority||o._onInitAllProps)&&(l=!0),(o._onDisable||o._onEnable)&&(this._notifyPluginsOfEnabled=!0),h._next&&(h._next._prev=h)}else i[e]=oi.call(this,t,e,"get",s,e,0,null,this.vars.stringFilter,f);return u&&this._kill(u,t)?this._initProps(t,i,r,u,f):this._overwrite>1&&this._firstPT&&r.length>1&&dt(t,this,i,this._overwrite,r)?(this._kill(i,t),this._initProps(t,i,r,u,f)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(wt[t._gsTweenID]=!0),l)},i.render=function(n,t,i){var h,s,u,y,c=this._time,f=this._duration,o=this._rawPrevTime;if(n>=f-1e-7&&n>=0)this._totalTime=this._time=f,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(h=!0,s="onComplete",i=i||this._timeline.autoRemoveChildren),0===f&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(n=0),(0>o||0>=n&&n>=-1e-7||o===e&&"isPause"!==this.data)&&o!==n&&(i=!0,o>e&&(s="onReverseComplete")),this._rawPrevTime=y=!t||n||o===n?n:e);else if(1e-7>n)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==c||0===f&&o>0)&&(s="onReverseComplete",h=this._reversed),0>n&&(this._active=!1,0===f&&(this._initted||!this.vars.lazy||i)&&(o>=0&&(o!==e||"isPause"!==this.data)&&(i=!0),this._rawPrevTime=y=!t||n||o===n?n:e)),this._initted||(i=!0);else if(this._totalTime=this._time=n,this._easeType){var r=n/f,l=this._easeType,a=this._easePower;(1===l||3===l&&r>=.5)&&(r=1-r),3===l&&(r*=2),1===a?r*=r:2===a?r*=r*r:3===a?r*=r*r*r:4===a&&(r*=r*r*r*r),this.ratio=1===l?1-r:2===l?r:.5>n/f?r/2:1-r/2}else this.ratio=this._ease.getRatio(n/f);if(this._time!==c||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=c,this._rawPrevTime=o,v.push(this),void(this._lazy=[n,t]);this._time&&!h?this.ratio=this._ease.getRatio(this._time/f):h&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==c&&n>=0&&(this._active=!0),0===c&&(this._startAt&&(n>=0?this._startAt.render(n,t,i):s||(s="_dummyGS")),this.vars.onStart&&(0!==this._time||0===f)&&(t||this._callback("onStart"))),u=this._firstPT;u;)u.f?u.t[u.p](u.c*this.ratio+u.s):u.t[u.p]=u.c*this.ratio+u.s,u=u._next;this._onUpdate&&(0>n&&this._startAt&&n!==-.0001&&this._startAt.render(n,t,i),t||(this._time!==c||h||i)&&this._callback("onUpdate")),s&&(!this._gc||i)&&(0>n&&this._startAt&&!this._onUpdate&&n!==-.0001&&this._startAt.render(n,t,i),h&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!t&&this.vars[s]&&this._callback(s),0===f&&this._rawPrevTime===e&&y!==e&&(this._rawPrevTime=0))}},i._kill=function(n,t,i){if("all"===n&&(n=null),null==n&&(null==t||t===this.target))return this._lazy=!1,this._enabled(!1,!1);t="string"!=typeof t?t||this._targets||this.target:r.selector(t)||t;var f,s,o,u,e,c,l,a,h,v=i&&this._time&&i._startTime===this._startTime&&this._timeline===i._timeline;if((nt(t)||pt(t))&&"number"!=typeof t[0])for(f=t.length;--f>-1;)this._kill(n,t[f],i)&&(c=!0);else{if(this._targets){for(f=this._targets.length;--f>-1;)if(t===this._targets[f]){e=this._propLookup[f]||{},this._overwrittenProps=this._overwrittenProps||[],s=this._overwrittenProps[f]=n?this._overwrittenProps[f]||{}:"all";break}}else{if(t!==this.target)return!1;e=this._propLookup,s=this._overwrittenProps=n?this._overwrittenProps||{}:"all"}if(e){if(l=n||e,a=n!==s&&"all"!==s&&n!==e&&("object"!=typeof n||!n._tempKill),i&&(r.onOverwrite||this.vars.onOverwrite)){for(o in l)e[o]&&(h||(h=[]),h.push(o));if((h||!n)&&!ci(this,i,t,h))return!1}for(o in l)(u=e[o])&&(v&&(u.f?u.t[u.p](u.s):u.t[u.p]=u.s,c=!0),u.pg&&u.t._kill(l)&&(c=!0),u.pg&&0!==u.t._overwriteProps.length||(u._prev?u._prev._next=u._next:u===this._firstPT&&(this._firstPT=u._next),u._next&&(u._next._prev=u._prev),u._next=u._prev=null),delete e[o]),a&&(s[o]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return c},i.invalidate=function(){return this._notifyPluginsOfEnabled&&r._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],o.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-e,this.render(Math.min(0,-this._delay))),this},i._enabled=function(n,t){if(h||u.wake(),n&&this._gc){var i,f=this._targets;if(f)for(i=f.length;--i>-1;)this._siblings[i]=st(f[i],this,!0);else this._siblings=st(this.target,this,!0)}return o.prototype._enabled.call(this,n,t),this._notifyPluginsOfEnabled&&this._firstPT?r._onPluginEvent(n?"_onEnable":"_onDisable",this):!1},r.to=function(n,t,i){return new r(n,t,i)},r.from=function(n,t,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new r(n,t,i)},r.fromTo=function(n,t,i,u){return u.startAt=i,u.immediateRender=0!=u.immediateRender&&0!=i.immediateRender,new r(n,t,u)},r.delayedCall=function(n,t,i,u,f){return new r(t,0,{delay:n,onComplete:t,onCompleteParams:i,callbackScope:u,onReverseComplete:t,onReverseCompleteParams:i,immediateRender:!1,lazy:!1,useFrames:f,overwrite:0})},r.set=function(n,t){return new r(n,0,t)},r.getTweensOf=function(n,t){if(null==n)return[];n="string"!=typeof n?n:r.selector(n)||n;var i,u,f,e;if((nt(n)||pt(n))&&"number"!=typeof n[0]){for(i=n.length,u=[];--i>-1;)u=u.concat(r.getTweensOf(n[i],t));for(i=u.length;--i>-1;)for(e=u[i],f=i;--f>-1;)e===u[f]&&u.splice(i,1)}else for(u=st(n).concat(),i=u.length;--i>-1;)(u[i]._gc||t&&!u[i].isActive())&&u.splice(i,1);return u},r.killTweensOf=r.killDelayedCallsTo=function(n,t,i){"object"==typeof t&&(i=t,t=!1);for(var u=r.getTweensOf(n,t),f=u.length;--f>-1;)u[f]._kill(i,n)},c=l("plugins.TweenPlugin",function(n,t){this._overwriteProps=(n||"").split(","),this._propName=this._overwriteProps[0],this._priority=t||0,this._super=c.prototype},!0),i=c.prototype,c.version="1.19.0",c.API=2,i._firstPT=null,i._addTween=oi,i.setRatio=fi,i._kill=function(n){var i,r=this._overwriteProps,t=this._firstPT;if(null!=n[this._propName])this._overwriteProps=[];else for(i=r.length;--i>-1;)null!=n[r[i]]&&r.splice(i,1);for(;t;)null!=n[t.n]&&(t._next&&(t._next._prev=t._prev),t._prev?(t._prev._next=t._next,t._prev=null):this._firstPT===t&&(this._firstPT=t._next)),t=t._next;return!1},i._mod=i._roundProps=function(n){for(var i,t=this._firstPT;t;)i=n[this._propName]||null!=t.n&&n[t.n.split(this._propName+"_").join("")],i&&"function"==typeof i&&(2===t.f?t.t._applyPT.m=i:t.m=i),t=t._next},r._onPluginEvent=function(n,t){var f,r,u,e,o,i=t._firstPT;if("_onInitAllProps"===n){for(;i;){for(o=i._next,r=u;r&&r.pr>i.pr;)r=r._next;(i._prev=r?r._prev:e)?i._prev._next=i:u=i,(i._next=r)?r._prev=i:e=i,i=o}i=t._firstPT=u}for(;i;)i.pg&&"function"==typeof i.t[n]&&i.t[n]()&&(f=!0),i=i._next;return f},c.activate=function(n){for(var t=n.length;--t>-1;)n[t].API===c.API&&(b[(new n[t])._propName]=n[t]);return!0},ct.plugin=function(n){if(!(n&&n.propName&&n.init&&n.API))throw"illegal plugin definition.";var i,r=n.propName,e=n.priority||0,o=n.overwriteProps,u={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},t=l("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){c.call(this,r,e),this._overwriteProps=o||[]},n.global===!0),f=t.prototype=new c(r);f.constructor=t,t.API=n.API;for(i in u)"function"==typeof n[i]&&(f[u[i]]=n[i]);return t.version=n.version,c.activate([t]),t},s=n._gsQueue){for(f=0;f<s.length;f++)s[f]();for(i in tt)tt[i].func||n.console.log("GSAP encountered missing dependency: "+i)}h=!1}}("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,"TweenMax");
/*!
 * VERSION: 1.3.7
 * DATE: 2017-01-17
 * UPDATES AND DOCS AT: http://greensock.com
 *
 * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
 * This work is subject to the terms at http://greensock.com/standard-license or for
 * Club GreenSock members, the software agreement that was issued with your membership.
 * 
 * @author: Jack Doyle, jack@greensock.com
 **/
_gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";var h=180/Math.PI,n=[],t=[],i=[],f={},c=_gsScope._gsDefine.globals,u=function(n,t,i,r){i===r&&(i=r-(r-t)/1e6),n===t&&(t=n+(i-n)/1e6),this.a=n,this.b=t,this.c=i,this.d=r,this.da=r-n,this.ca=i-n,this.ba=t-n},l=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",e=function(n,t,i,r){var e={a:n},u={},f={},o={c:r},s=(n+t)/2,a=(t+i)/2,h=(i+r)/2,c=(s+a)/2,l=(a+h)/2,v=(l-c)/8;return e.b=s+(n-s)/4,u.b=c+v,e.c=u.a=(e.b+u.b)/2,u.c=f.a=(c+l)/2,f.b=l-v,o.b=h+(r-h)/4,f.c=o.a=(f.b+o.b)/2,[e,u,f,o]},a=function(r,u,f,o,s){for(var y,c,nt,h,p,b,g,tt,l,k,d,it,rt=r.length-1,w=0,a=r[0].a,v=0;rt>v;v++)h=r[w],y=h.a,c=h.d,nt=r[w+1].d,s?(k=n[v],d=t[v],it=(d+k)*u*.25/(o?.5:i[v]||.5),p=c-(c-y)*(o?.5*u:0!==k?it/k:0),b=c+(nt-c)*(o?.5*u:0!==d?it/d:0),g=c-(p+((b-p)*(3*k/(k+d)+.5)/4||0))):(p=c-(c-y)*u*.5,b=c+(nt-c)*u*.5,g=c-(p+b)/2),p+=g,b+=g,h.c=tt=p,h.b=0!==v?a:a=h.a+.6*(h.c-h.a),h.da=c-y,h.ca=tt-y,h.ba=a-y,f?(l=e(y,a,tt,c),r.splice(w,1,l[0],l[1],l[2],l[3]),w+=4):w++,a=b;h=r[w],h.b=a,h.c=a+.4*(h.d-a),h.da=h.d-h.a,h.ca=h.c-h.a,h.ba=a-h.a,f&&(l=e(h.a,a,h.c,h.d),r.splice(w,1,l[0],l[1],l[2],l[3]))},v=function(i,r,f,e){var a,o,c,s,v,l,h=[];if(e)for(i=[e].concat(i),o=i.length;--o>-1;)"string"==typeof(l=i[o][r])&&"="===l.charAt(1)&&(i[o][r]=e[r]+Number(l.charAt(0)+l.substr(2)));if(a=i.length-2,0>a)return h[0]=new u(i[0][r],0,0,i[0][r]),h;for(o=0;a>o;o++)c=i[o][r],s=i[o+1][r],h[o]=new u(c,0,0,s),f&&(v=i[o+2][r],n[o]=(n[o]||0)+(s-c)*(s-c),t[o]=(t[o]||0)+(v-s)*(v-s));return h[o]=new u(i[o][r],0,0,i[o+1][r]),h},o=function(r,u,e,o,s,h){var c,y,w,p,g,nt,k,tt,d={},b=[],it=h||r[0];s="string"==typeof s?","+s+",":l,null==u&&(u=1);for(y in r[0])b.push(y);if(r.length>1){for(tt=r[r.length-1],k=!0,c=b.length;--c>-1;)if(y=b[c],Math.abs(it[y]-tt[y])>.05){k=!1;break}k&&(r=r.concat(),h&&r.unshift(h),r.push(r[1]),h=r[r.length-3])}for(n.length=t.length=i.length=0,c=b.length;--c>-1;)y=b[c],f[y]=-1!==s.indexOf(","+y+","),d[y]=v(r,y,f[y],h);for(c=n.length;--c>-1;)n[c]=Math.sqrt(n[c]),t[c]=Math.sqrt(t[c]);if(!o){for(c=b.length;--c>-1;)if(f[y])for(w=d[b[c]],nt=w.length-1,p=0;nt>p;p++)g=w[p+1].da/t[p]+w[p].da/n[p]||0,i[p]=(i[p]||0)+g*g;for(c=i.length;--c>-1;)i[c]=Math.sqrt(i[c])}for(c=b.length,p=e?4:1;--c>-1;)y=b[c],w=d[y],a(w,u,e,o,f[y]),k&&(w.splice(0,p),w.splice(w.length-p,p));return d},y=function(n,t,i){t=t||"soft";var o,a,v,w,f,y,r,c,s,e,h,b={},l="cubic"===t?3:2,k="soft"===t,p=[];if(k&&i&&(n=[i].concat(n)),null==n||n.length<l+1)throw"invalid Bezier data";for(s in n[0])p.push(s);for(y=p.length;--y>-1;){for(s=p[y],b[s]=f=[],e=0,c=n.length,r=0;c>r;r++)o=null==i?n[r][s]:"string"==typeof(h=n[r][s])&&"="===h.charAt(1)?i[s]+Number(h.charAt(0)+h.substr(2)):Number(h),k&&r>1&&c-1>r&&(f[e++]=(o+f[e-2])/2),f[e++]=o;for(c=e-l+1,e=0,r=0;c>r;r+=l)o=f[r],a=f[r+1],v=f[r+2],w=2===l?0:f[r+3],f[e++]=h=3===l?new u(o,a,v,w):new u(o,(2*a+o)/3,(2*a+v)/3,v);f.length=e}return b},p=function(n,t,i){for(var e,s,o,a,v,y,r,u,h,f,c,p=1/i,l=n.length;--l>-1;)for(f=n[l],o=f.a,a=f.d-o,v=f.c-o,y=f.b-o,e=s=0,u=1;i>=u;u++)r=p*u,h=1-r,e=s-(s=(r*r*a+3*h*(r*v+h*y))*r),c=l*i+u-1,t[c]=(t[c]||0)+e*e},w=function(n,t){t=t>>0||6;var s,i,h,r,f=[],c=[],u=0,e=0,a=t-1,l=[],o=[];for(s in n)p(n[s],f,t);for(h=f.length,i=0;h>i;i++)u+=Math.sqrt(f[i]),r=i%t,o[r]=u,r===a&&(e+=u,r=i/t>>0,l[r]=o,c[r]=e,u=0,o=[]);return{length:e,lengths:c,segments:l}},r=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.7",API:2,global:!0,init:function(n,t,i){var c;this._target=n,t instanceof Array&&(t={values:t}),this._func={},this._mod={},this._props=[],this._timeRes=null==t.timeResolution?6:parseInt(t.timeResolution,10);var r,a,f,e,l,s=t.values||[],h={},v=s[0],u=t.autoRotate||i.vars.orientToBezier;this._autoRotate=u?u instanceof Array?u:[["x","y","rotation",u===!0?0:Number(u)||0]]:null;for(r in v)this._props.push(r);for(f=this._props.length;--f>-1;)r=this._props[f],this._overwriteProps.push(r),a=this._func[r]="function"==typeof n[r],h[r]=a?n[r.indexOf("set")||"function"!=typeof n["get"+r.substr(3)]?r:"get"+r.substr(3)]():parseFloat(n[r]),l||h[r]!==s[0][r]&&(l=h);if((this._beziers="cubic"!==t.type&&"quadratic"!==t.type&&"soft"!==t.type?o(s,isNaN(t.curviness)?1:t.curviness,!1,"thruBasic"===t.type,t.correlate,l):y(s,t.type,h),this._segCount=this._beziers[r].length,this._timeRes)&&(c=w(this._beziers,this._timeRes),this._length=c.length,this._lengths=c.lengths,this._segments=c.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length),u=this._autoRotate)for(this._initialRotations=[],u[0]instanceof Array||(this._autoRotate=u=[u]),f=u.length;--f>-1;){for(e=0;3>e;e++)r=u[f][e],this._func[r]="function"==typeof n[r]?n[r.indexOf("set")||"function"!=typeof n["get"+r.substr(3)]?r:"get"+r.substr(3)]:!1;r=u[f][2],this._initialRotations[f]=(this._func[r]?this._func[r].call(this._target):this._target[r])||0,this._overwriteProps.push(r)}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(n){var c,d,t,u,i,r,o,w,v,f,l=this._segCount,g=this._func,a=this._target,it=n!==this._startRatio,e,b,k,y,p,nt,tt,s;if(this._timeRes){if(v=this._lengths,f=this._curSeg,n*=this._length,t=this._li,n>this._l2&&l-1>t){for(w=l-1;w>t&&(this._l2=v[++t])<=n;);this._l1=v[t-1],this._li=t,this._curSeg=f=this._segments[t],this._s2=f[this._s1=this._si=0]}else if(n<this._l1&&t>0){for(;t>0&&(this._l1=v[--t])>=n;);0===t&&n<this._l1?this._l1=0:t++,this._l2=v[t],this._li=t,this._curSeg=f=this._segments[t],this._s1=f[(this._si=f.length-1)-1]||0,this._s2=f[this._si]}if(c=t,n-=this._l1,t=this._si,n>this._s2&&t<f.length-1){for(w=f.length-1;w>t&&(this._s2=f[++t])<=n;);this._s1=f[t-1],this._si=t}else if(n<this._s1&&t>0){for(;t>0&&(this._s1=f[--t])>=n;);0===t&&n<this._s1?this._s1=0:t++,this._s2=f[t],this._si=t}r=(t+(n-this._s1)/(this._s2-this._s1))*this._prec||0}else c=0>n?0:n>=1?l-1:l*n>>0,r=(n-c*(1/l))*l;for(d=1-r,t=this._props.length;--t>-1;)u=this._props[t],i=this._beziers[u][c],o=(r*r*i.da+3*d*(r*i.ca+d*i.ba))*r+i.a,this._mod[u]&&(o=this._mod[u](o,a)),g[u]?a[u](o):a[u]=o;if(this._autoRotate)for(s=this._autoRotate,t=s.length;--t>-1;)u=s[t][2],nt=s[t][3]||0,tt=s[t][4]===!0?1:h,i=this._beziers[s[t][0]],e=this._beziers[s[t][1]],i&&e&&(i=i[c],e=e[c],b=i.a+(i.b-i.a)*r,y=i.b+(i.c-i.b)*r,b+=(y-b)*r,y+=(i.c+(i.d-i.c)*r-y)*r,k=e.a+(e.b-e.a)*r,p=e.b+(e.c-e.b)*r,k+=(p-k)*r,p+=(e.c+(e.d-e.c)*r-p)*r,o=it?Math.atan2(p-k,y-b)*tt+nt:this._initialRotations[t],this._mod[u]&&(o=this._mod[u](o,a)),g[u]?a[u](o):a[u]=o)}}),s=r.prototype;r.bezierThrough=o,r.cubicToQuadratic=e,r._autoCSS=!0,r.quadraticToCubic=function(n,t,i){return new u(n,(2*t+n)/3,(2*t+i)/3,i)},r._cssRegister=function(){var t=c.CSSPlugin;if(t){var n=t._internals,i=n._parseToProxy,u=n._setPluginRatio,f=n.CSSPropTween;n._registerComplexSpecialProp("bezier",{parser:function(n,t,e,o,s,h){t instanceof Array&&(t={values:t}),h=new r;var a,v,l,p=t.values,y=p.length-1,w=[],c={};if(0>y)return s;for(a=0;y>=a;a++)l=i(n,p[a],o,s,h,y!==a),w[a]=l.end;for(v in t)c[v]=t[v];return c.values=w,s=new f(n,"bezier",0,0,l.pt,2),s.data=l,s.plugin=h,s.setRatio=u,0===c.autoRotate&&(c.autoRotate=!0),!c.autoRotate||c.autoRotate instanceof Array||(a=c.autoRotate===!0?0:Number(c.autoRotate),c.autoRotate=null!=l.end.left?[["left","top","rotation",a,!1]]:null!=l.end.x?[["x","y","rotation",a,!1]]:!1),c.autoRotate&&(o._transform||o._enableTransforms(!1),l.autoRotate=o._target._gsTransform,l.proxy.rotation=l.autoRotate.rotation||0,o._overwriteProps.push("rotation")),h._onInitTween(l.proxy,c,o._tween),s}})}},s._mod=function(n){for(var t,i=this._overwriteProps,r=i.length;--r>-1;)t=n[i[r]],t&&"function"==typeof t&&(this._mod[i[r]]=t)},s._kill=function(n){var r,t,i=this._props;for(r in this._beziers)if(r in n)for(delete this._beziers[r],delete this._func[r],t=i.length;--t>-1;)i[t]===r&&i.splice(t,1);if(i=this._autoRotate)for(t=i.length;--t>-1;)n[i[t][2]]&&i.splice(t,1);return this._super._kill.call(this,n)}}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(n){"use strict";var t=function(){return(_gsScope.GreenSockGlobals||_gsScope)[n]};"function"==typeof define&&define.amd?define(["TweenLite"],t):"undefined"!=typeof module&&module.exports&&(require("../TweenLite.js"),module.exports=t())}("BezierPlugin");
/*!
 * VERSION: 1.8.1
 * DATE: 2017-01-17
 * UPDATES AND DOCS AT: http://greensock.com
 *
 * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
 * This work is subject to the terms at http://greensock.com/standard-license or for
 * Club GreenSock members, the software agreement that was issued with your membership.
 * 
 * @author: Jack Doyle, jack@greensock.com
 **/
_gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";var t=document.documentElement,n=_gsScope,i=function(i,r){var u="x"===r?"Width":"Height",f="scroll"+u,o="client"+u,e=document.body;return i===n||i===t||i===e?Math.max(t[f],e[f])-(n["inner"+u]||t[o]||e[o]):i[f]-i["offset"+u]},o=function(t){return"string"==typeof t&&(t=TweenLite.selector(t)),t.length&&t!==n&&t[0]&&t[0].style&&!t.nodeType&&(t=t[0]),t===n||t.nodeType&&t.style?t:null},u=function(i,r){var u="scroll"+("x"===r?"Left":"Top");return i===n&&(null!=i.pageXOffset?u="page"+r.toUpperCase()+"Offset":i=null!=t[u]?t:document.body),function(){return i[u]}},f=function(i,r){var e=o(i).getBoundingClientRect(),s=!r||r===n||r===document.body,h=(s?t:r).getBoundingClientRect(),f={x:e.left-h.left,y:e.top-h.top};return!s&&r&&(f.x+=u(r,"x")(),f.y+=u(r,"y")()),f},e=function(n,t,r){var u=typeof n;return"number"===u||"string"===u&&"="===n.charAt(1)?n:"max"===n?i(t,r):Math.min(i(t,r),f(n,t)[r])},r=_gsScope._gsDefine.plugin({propName:"scrollTo",API:2,global:!0,version:"1.8.1",init:function(t,i,r){return this._wdw=t===n,this._target=t,this._tween=r,"object"!=typeof i?(i={y:i},"string"==typeof i.y&&"max"!==i.y&&"="!==i.y.charAt(1)&&(i.x=i.y)):i.nodeType&&(i={y:i,x:i}),this.vars=i,this._autoKill=i.autoKill!==!1,this.getX=u(t,"x"),this.getY=u(t,"y"),this.x=this.xPrev=this.getX(),this.y=this.yPrev=this.getY(),null!=i.x?(this._addTween(this,"x",this.x,e(i.x,t,"x")-(i.offsetX||0),"scrollTo_x",!0),this._overwriteProps.push("scrollTo_x")):this.skipX=!0,null!=i.y?(this._addTween(this,"y",this.y,e(i.y,t,"y")-(i.offsetY||0),"scrollTo_y",!0),this._overwriteProps.push("scrollTo_y")):this.skipY=!0,!0},set:function(t){this._super.setRatio.call(this,t);var f=this._wdw||!this.skipX?this.getX():this.xPrev,e=this._wdw||!this.skipY?this.getY():this.yPrev,o=e-this.yPrev,s=f-this.xPrev,u=r.autoKillThreshold;this.x<0&&(this.x=0),this.y<0&&(this.y=0),this._autoKill&&(!this.skipX&&(s>u||-u>s)&&f<i(this._target,"x")&&(this.skipX=!0),!this.skipY&&(o>u||-u>o)&&e<i(this._target,"y")&&(this.skipY=!0),this.skipX&&this.skipY&&(this._tween.kill(),this.vars.onAutoKill&&this.vars.onAutoKill.apply(this.vars.onAutoKillScope||this._tween,this.vars.onAutoKillParams||[]))),this._wdw?n.scrollTo(this.skipX?f:this.x,this.skipY?e:this.y):(this.skipY||(this._target.scrollTop=this.y),this.skipX||(this._target.scrollLeft=this.x)),this.xPrev=this.x,this.yPrev=this.y}}),s=r.prototype;r.max=i,r.getOffset=f,r.autoKillThreshold=7,s._kill=function(n){return n.scrollTo_x&&(this.skipX=!0),n.scrollTo_y&&(this.skipY=!0),this._super._kill.call(this,n)}}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(n){"use strict";var t=function(){return(_gsScope.GreenSockGlobals||_gsScope)[n]};"function"==typeof define&&define.amd?define(["TweenLite"],t):"undefined"!=typeof module&&module.exports&&(require("../TweenLite.js"),module.exports=t())}("ScrollToPlugin");
/*! ScrollMagic v2.0.5 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
!function(n,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():n.ScrollMagic=t()}(this,function(){"use strict";var t=function(){},r,u,i,n;return t.version="2.0.5",window.addEventListener("mousewheel",function(){}),r="data-scrollmagic-pin-spacer",t.Controller=function(i){var k,d,et="ScrollMagic.Controller",ot="FORWARD",g="REVERSE",nt="PAUSED",w=u.defaults,e=this,f=n.extend({},w,i),o=[],s=!1,l=0,a=nt,h=!0,v=0,y=!0,st=function(){for(var t in f)w.hasOwnProperty(t)||delete f[t];if(f.container=n.get.elements(f.container)[0],!f.container)throw et+" init failed.";h=f.container===window||f.container===document.body||!document.body.contains(f.container),h&&(f.container=window),v=b(),f.container.addEventListener("resize",c),f.container.addEventListener("scroll",c),f.refreshInterval=parseInt(f.refreshInterval)||w.refreshInterval,tt()},tt=function(){f.refreshInterval>0&&(d=window.setTimeout(ht,f.refreshInterval))},it=function(){return f.vertical?n.get.scrollTop(f.container):n.get.scrollLeft(f.container)},b=function(){return f.vertical?n.get.height(f.container):n.get.width(f.container)},rt=this._setScrollPos=function(t){f.vertical?h?window.scrollTo(n.get.scrollLeft(),t):f.container.scrollTop=t:h?window.scrollTo(t,n.get.scrollTop()):f.container.scrollLeft=t},ut=function(){var t,r,i;y&&s&&(t=n.type.Array(s)?s:o.slice(0),s=!1,r=l,l=e.scrollPos(),i=l-r,0!==i&&(a=i>0?ot:g),a===g&&t.reverse(),t.forEach(function(n){n.update(!0)}))},ft=function(){k=n.rAF(ut)},c=function(n){"resize"==n.type&&(v=b(),a=nt),s!==!0&&(s=!0,ft())},ht=function(){if(!h&&v!=b()){var n;try{n=new Event("resize",{bubbles:!1,cancelable:!1})}catch(t){n=document.createEvent("Event"),n.initEvent("resize",!1,!1)}f.container.dispatchEvent(n)}o.forEach(function(n){n.refresh()}),tt()},p;return this._options=f,p=function(n){if(n.length<=1)return n;var t=n.slice(0);return t.sort(function(n,t){return n.scrollOffset()>t.scrollOffset()?1:-1}),t},this.addScene=function(i){if(n.type.Array(i))i.forEach(function(n){e.addScene(n)});else if(i instanceof t.Scene)if(i.controller()!==e)i.addTo(e);else if(o.indexOf(i)<0){o.push(i),o=p(o),i.on("shift.controller_sort",function(){o=p(o)});for(var r in f.globalSceneOptions)i[r]&&i[r].call(i,f.globalSceneOptions[r])}return e},this.removeScene=function(t){if(n.type.Array(t))t.forEach(function(n){e.removeScene(n)});else{var i=o.indexOf(t);i>-1&&(t.off("shift.controller_sort"),o.splice(i,1),t.remove())}return e},this.updateScene=function(i,r){return n.type.Array(i)?i.forEach(function(n){e.updateScene(n,r)}):r?i.update(!0):s!==!0&&i instanceof t.Scene&&(s=s||[],-1==s.indexOf(i)&&s.push(i),s=p(s),ft()),e},this.update=function(n){return c({type:"resize"}),n&&ut(),e},this.scrollTo=function(i,u){var o;if(n.type.Number(i))rt.call(f.container,i,u);else if(i instanceof t.Scene)i.controller()===e&&e.scrollTo(i.scrollOffset(),u);else if(n.type.Function(i))rt=i;else if(o=n.get.elements(i)[0],o){for(;o.parentNode.hasAttribute(r);)o=o.parentNode;var s=f.vertical?"top":"left",c=n.get.offset(f.container),l=n.get.offset(o);h||(c[s]-=e.scrollPos()),e.scrollTo(l[s]-c[s],u)}return e},this.scrollPos=function(t){return arguments.length?(n.type.Function(t)&&(it=t),e):it.call(e)},this.info=function(n){var t={size:v,vertical:f.vertical,scrollPos:l,scrollDirection:a,container:f.container,isDocument:h};return arguments.length?void 0!==t[n]?t[n]:void 0:t},this.loglevel=function(){return e},this.enabled=function(n){return arguments.length?(y!=n&&(y=!!n,e.updateScene(o,!0)),e):y},this.destroy=function(t){window.clearTimeout(d);for(var i=o.length;i--;)o[i].destroy(t);return f.container.removeEventListener("resize",c),f.container.removeEventListener("scroll",c),n.cAF(k),null},st(),e},u={defaults:{container:window,vertical:!0,globalSceneOptions:{},loglevel:2,refreshInterval:100}},t.Controller.addOption=function(n,t){u.defaults[n]=t},t.Controller.extend=function(i){var r=this;t.Controller=function(){return r.apply(this,arguments),this.$super=n.extend({},this),i.apply(this,arguments)||this},n.extend(t.Controller,r),t.Controller.prototype=r.prototype,t.Controller.prototype.constructor=t.Controller},t.Scene=function(u){var y,o,p="BEFORE",l="DURING",g="AFTER",nt=i.defaults,f=this,h=n.extend({},nt,u),c=p,a=0,v={start:0,end:0},tt=0,it=!0,yt=function(){var n,t;for(n in h)nt.hasOwnProperty(n)||delete h[n];for(t in nt)pt(t);st()},w={},e,s,ft,k;this.on=function(t,i){return n.type.Function(i)&&(t=t.trim().split(" "),t.forEach(function(n){var r=n.split("."),t=r[0],u=r[1];"*"!=t&&(w[t]||(w[t]=[]),w[t].push({namespace:u||"",callback:i}))})),f},this.off=function(n,t){return n?(n=n.trim().split(" "),n.forEach(function(n){var i=n.split("."),r=i[0],u=i[1]||"",f="*"===r?Object.keys(w):[r];f.forEach(function(n){for(var f,i=w[n]||[],r=i.length;r--;)f=i[r],!f||u!==f.namespace&&"*"!==u||t&&t!=f.callback||i.splice(r,1);i.length||delete w[n]})}),f):f},this.trigger=function(n,i){if(n){var r=n.trim().split("."),u=r[0],e=r[1],o=w[u];o&&o.forEach(function(n){e&&e!==n.namespace||n.callback.call(f,new t.Event(u,n.namespace,f,i))})}return f},f.on("change.internal",function(n){"loglevel"!==n.what&&"tweenChanges"!==n.what&&("triggerElement"===n.what?et():"reverse"===n.what&&f.update())}).on("shift.internal",function(){ht(),f.update()}),this.addTo=function(n){return n instanceof t.Controller&&o!=n&&(o&&o.removeScene(f),o=n,st(),ct(!0),et(!0),ht(),o.info("container").addEventListener("resize",lt),n.addScene(f),f.trigger("add",{controller:o}),f.update()),f},this.enabled=function(n){return arguments.length?(it!=n&&(it=!!n,f.update(!0)),f):it},this.remove=function(){if(o){o.info("container").removeEventListener("resize",lt);var n=o;o=void 0,n.removeScene(f),f.trigger("remove")}return f},this.destroy=function(n){return f.trigger("destroy",{reset:n}),f.remove(),f.off("*.*"),null},this.update=function(n){if(o)if(n)if(o.enabled()&&it){var i,t=o.info("scrollPos");i=h.duration>0?(t-v.start)/(v.end-v.start):t>=v.start?1:0,f.trigger("update",{startPos:v.start,endPos:v.end,scrollPos:t}),f.progress(i)}else e&&c===l&&b(!0);else o.updateScene(f,!1);return f},this.refresh=function(){return ct(),et(),f},this.progress=function(n){if(arguments.length){var t=!1,u=c,s=o?o.info("scrollDirection"):"PAUSED",r=h.reverse||n>=a;if(0===h.duration?(t=a!=n,a=1>n&&r?0:1,c=0===a?p:l):0>n&&c!==p&&r?(a=0,c=p,t=!0):n>=0&&1>n&&r?(a=n,c=l,t=!0):n>=1&&c!==g?(a=1,c=g,t=!0):c!==l||r||b(),t){var v={progress:a,state:c,scrollDirection:s},e=c!=u,i=function(n){f.trigger(n,v)};e&&u!==l&&(i("enter"),i(u===p?"start":"end")),i("progress"),e&&c!==l&&(i(c===p?"start":"end"),i("leave"))}return f}return a};var ht=function(){v={start:tt+h.offset},o&&h.triggerElement&&(v.start-=o.info("size")*h.triggerHook),v.end=v.start+h.duration},ct=function(n){if(y){var t="duration";at(t,y.call(f))&&!n&&(f.trigger("change",{what:t,newval:h[t]}),f.trigger("shift",{reason:t}))}},et=function(t){var u=0,i=h.triggerElement,l,a;if(o&&i){for(var e=o.info(),c=n.get.offset(e.container),s=e.vertical?"top":"left";i.parentNode.hasAttribute(r);)i=i.parentNode;l=n.get.offset(i),e.isDocument||(c[s]-=o.scrollPos()),u=l[s]-c[s]}a=u!=tt,tt=u,a&&!t&&f.trigger("shift",{reason:"triggerElementPosition"})},lt=function(){h.triggerHook>0&&f.trigger("shift",{reason:"containerResize"})},ot=n.extend(i.validate,{duration:function(t){if(n.type.String(t)&&t.match(/^(\.|\d)*\d+%$/)){var i=parseFloat(t)/100;t=function(){return o?o.info("size")*i:0}}if(n.type.Function(t)){y=t;try{t=parseFloat(y())}catch(r){t=-1}}if(t=parseFloat(t),!n.type.Number(t)||0>t)throw y?(y=void 0,0):0;return t}}),st=function(n){n=arguments.length?[n]:Object.keys(ot),n.forEach(function(n){var t;if(ot[n])try{t=ot[n](h[n])}catch(i){t=nt[n]}finally{h[n]=t}})},at=function(n,t){var i=!1,r=h[n];return h[n]!=t&&(h[n]=t,st(n),i=r!=h[n]),i},pt=function(n){f[n]||(f[n]=function(t){return arguments.length?("duration"===n&&(y=void 0),at(n,t)&&(f.trigger("change",{what:n,newval:h[n]}),i.shifts.indexOf(n)>-1&&f.trigger("shift",{reason:n})),f):h[n]})};this.controller=function(){return o},this.state=function(){return c},this.scrollOffset=function(){return v.start},this.triggerPosition=function(){var n=h.offset;return o&&(n+=h.triggerElement?tt:o.info("size")*f.triggerHook()),n};f.on("shift.internal",function(n){var t="duration"===n.reason;(c===g&&t||c===l&&0===h.duration)&&b(),t&&d()}).on("progress.internal",function(){b()}).on("add.internal",function(){d()}).on("destroy.internal",function(n){f.removePin(n.reset)});var b=function(t){var r,i,u,f,y,w;e&&o&&(r=o.info(),i=s.spacer.firstChild,t||c!==l?(u={position:s.inFlow?"relative":"absolute",top:0,left:0},f=n.css(i,"position")!=u.position,s.pushFollowers?h.duration>0&&(c===g&&0===parseFloat(n.css(s.spacer,"padding-top"))?f=!0:c===p&&0===parseFloat(n.css(s.spacer,"padding-bottom"))&&(f=!0)):u[r.vertical?"top":"left"]=h.duration*a,n.css(i,u),f&&d()):("fixed"!=n.css(i,"position")&&(n.css(i,{position:"fixed"}),d()),y=n.get.offset(s.spacer,!0),w=h.reverse||0===h.duration?r.scrollPos-v.start:Math.round(a*h.duration*10)/10,y[r.vertical?"top":"left"]+=w,n.css(s.spacer.firstChild,{top:y.top,left:y.left})))},d=function(){if(e&&o&&s.inFlow){var i=c===l,r=o.info("vertical"),u=s.spacer.firstChild,f=n.isMarginCollapseType(n.css(s.spacer,"display")),t={};s.relSize.width||s.relSize.autoFullWidth?i?n.css(e,{width:n.get.width(s.spacer)}):n.css(e,{width:"100%"}):(t["min-width"]=n.get.width(r?e:u,!0,!0),t.width=i?t["min-width"]:"auto"),s.relSize.height?i?n.css(e,{height:n.get.height(s.spacer)-(s.pushFollowers?h.duration:0)}):n.css(e,{height:"100%"}):(t["min-height"]=n.get.height(r?u:e,!0,!f),t.height=i?t["min-height"]:"auto"),s.pushFollowers&&(t["padding"+(r?"Top":"Left")]=h.duration*a,t["padding"+(r?"Bottom":"Right")]=h.duration*(1-a)),n.css(s.spacer,t)}},rt=function(){o&&e&&c===l&&!o.info("isDocument")&&b()},vt=function(){o&&e&&c===l&&((s.relSize.width||s.relSize.autoFullWidth)&&n.get.width(window)!=n.get.width(s.spacer.parentNode)||s.relSize.height&&n.get.height(window)!=n.get.height(s.spacer.parentNode))&&d()},ut=function(n){o&&e&&c===l&&!o.info("isDocument")&&(n.preventDefault(),o._setScrollPos(o.info("scrollPos")-((n.wheelDelta||n[o.info("vertical")?"wheelDeltaY":"wheelDeltaX"])/3||30*-n.detail)))};return this.setPin=function(t,i){var a,c,u,l,y,p;if((i=n.extend({},{pushFollowers:!0,spacerClass:"scrollmagic-pin-spacer"},i),t=n.get.elements(t)[0],!t)||"fixed"===n.css(t,"position"))return f;if(e){if(e===t)return f;f.removePin()}e=t,a=e.parentNode.style.display,c=["top","left","bottom","right","margin","marginLeft","marginRight","marginTop","marginBottom"],e.parentNode.style.display="none";var o="absolute"!=n.css(e,"position"),v=n.css(e,c.concat(["display"])),h=n.css(e,["width","height"]);return e.parentNode.style.display=a,!o&&i.pushFollowers&&(i.pushFollowers=!1),u=e.parentNode.insertBefore(document.createElement("div"),e),l=n.extend(v,{position:o?"relative":"absolute",boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"}),(o||n.extend(l,n.css(e,["width","height"])),n.css(u,l),u.setAttribute(r,""),n.addClass(u,i.spacerClass),s={spacer:u,relSize:{width:"%"===h.width.slice(-1),height:"%"===h.height.slice(-1),autoFullWidth:"auto"===h.width&&o&&n.isMarginCollapseType(v.display)},pushFollowers:i.pushFollowers,inFlow:o},e.___origStyle)||(e.___origStyle={},y=e.style,p=c.concat(["width","height","position","boxSizing","mozBoxSizing","webkitBoxSizing"]),p.forEach(function(n){e.___origStyle[n]=y[n]||""})),s.relSize.width&&n.css(u,{width:h.width}),s.relSize.height&&n.css(u,{height:h.height}),u.appendChild(e),n.css(e,{position:o?"relative":"absolute",margin:"auto",top:"auto",left:"auto",bottom:"auto",right:"auto"}),(s.relSize.width||s.relSize.autoFullWidth)&&n.css(e,{boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"}),window.addEventListener("scroll",rt),window.addEventListener("resize",rt),window.addEventListener("resize",vt),e.addEventListener("mousewheel",ut),e.addEventListener("DOMMouseScroll",ut),b(),f},this.removePin=function(t){var i,u,h;return e&&((c===l&&b(!0),t||!o)&&(i=s.spacer.firstChild,i.hasAttribute(r)&&(u=s.spacer.style,h=["margin","marginLeft","marginRight","marginTop","marginBottom"],margins={},h.forEach(function(n){margins[n]=u[n]||""}),n.css(i,margins)),s.spacer.parentNode.insertBefore(i,s.spacer),s.spacer.parentNode.removeChild(s.spacer),e.parentNode.hasAttribute(r)||(n.css(e,e.___origStyle),delete e.___origStyle)),window.removeEventListener("scroll",rt),window.removeEventListener("resize",rt),window.removeEventListener("resize",vt),e.removeEventListener("mousewheel",ut),e.removeEventListener("DOMMouseScroll",ut),e=void 0),f},k=[],f.on("destroy.internal",function(n){f.removeClassToggle(n.reset)}),this.setClassToggle=function(t,i){var r=n.get.elements(t);return 0!==r.length&&n.type.String(i)?(k.length>0&&f.removeClassToggle(),ft=i,k=r,f.on("enter.internal_class leave.internal_class",function(t){var i="enter"===t.type?n.addClass:n.removeClass;k.forEach(function(n){i(n,ft)})}),f):f},this.removeClassToggle=function(t){return t&&k.forEach(function(t){n.removeClass(t,ft)}),f.off("start.internal_class end.internal_class"),ft=void 0,k=[],f},yt(),f},i={defaults:{duration:0,offset:0,triggerElement:void 0,triggerHook:.5,reverse:!0,loglevel:2},validate:{offset:function(t){if(t=parseFloat(t),!n.type.Number(t))throw 0;return t},triggerElement:function(t){if(t=t||void 0){var i=n.get.elements(t)[0];if(!i)throw 0;t=i}return t},triggerHook:function(t){var i={onCenter:.5,onEnter:1,onLeave:0};if(n.type.Number(t))t=Math.max(0,Math.min(parseFloat(t),1));else{if(!(t in i))throw 0;t=i[t]}return t},reverse:function(n){return!!n}},shifts:["duration","offset","triggerHook"]},t.Scene.addOption=function(n,t,r,u){n in i.defaults||(i.defaults[n]=t,i.validate[n]=r,u&&i.shifts.push(n))},t.Scene.extend=function(i){var r=this;t.Scene=function(){return r.apply(this,arguments),this.$super=n.extend({},this),i.apply(this,arguments)||this},n.extend(t.Scene,r),t.Scene.prototype=r.prototype,t.Scene.prototype.constructor=t.Scene},t.Event=function(n,t,i,r){r=r||{};for(var u in r)this[u]=r[u];return this.type=n,this.target=this.currentTarget=i,this.namespace=t||"",this.timeStamp=this.timestamp=Date.now(),this},n=t._util=function(n){var i,r={},e=function(n){return parseFloat(n)||0},h=function(t){return t.currentStyle?t.currentStyle:n.getComputedStyle(t)},l=function(i,r,u,f){var s,o;if(r=r===document?n:r,r===n)f=!1;else if(!t.DomElement(r))return 0;return i=i.charAt(0).toUpperCase()+i.substr(1).toLowerCase(),s=(u?r["offset"+i]||r["outer"+i]:r["client"+i]||r["inner"+i])||0,u&&f&&(o=h(r),s+="Height"===i?e(o.marginTop)+e(o.marginBottom):e(o.marginLeft)+e(o.marginRight)),s},c=function(n){return n.replace(/^[^a-z]+([a-z])/g,"$1").replace(/-([a-z])/g,function(n){return n[1].toUpperCase()})},t,u;r.extend=function(n){for(n=n||{},i=1;i<arguments.length;i++)if(arguments[i])for(var t in arguments[i])arguments[i].hasOwnProperty(t)&&(n[t]=arguments[i][t]);return n},r.isMarginCollapseType=function(n){return["block","flex","list-item","table","-webkit-box"].indexOf(n)>-1};var a=0,o=["ms","moz","webkit","o"],f=n.requestAnimationFrame,s=n.cancelAnimationFrame;for(i=0;!f&&i<o.length;++i)f=n[o[i]+"RequestAnimationFrame"],s=n[o[i]+"CancelAnimationFrame"]||n[o[i]+"CancelRequestAnimationFrame"];return f||(f=function(t){var i=(new Date).getTime(),r=Math.max(0,16-(i-a)),u=n.setTimeout(function(){t(i+r)},r);return a=i+r,u}),s||(s=function(t){n.clearTimeout(t)}),r.rAF=f.bind(n),r.cAF=s.bind(n),t=r.type=function(n){return Object.prototype.toString.call(n).replace(/^\[object (.+)\]$/,"$1").toLowerCase()},t.String=function(n){return"string"===t(n)},t.Function=function(n){return"function"===t(n)},t.Array=function(n){return Array.isArray(n)},t.Number=function(n){return!t.Array(n)&&n-parseFloat(n)+1>=0},t.DomElement=function(n){return"object"==typeof HTMLElement?n instanceof HTMLElement:n&&"object"==typeof n&&null!==n&&1===n.nodeType&&"string"==typeof n.nodeName},u=r.get={},u.elements=function(i){var r=[],f,o,e;if(t.String(i))try{i=document.querySelectorAll(i)}catch(s){return r}if("nodelist"===t(i)||t.Array(i))for(f=0,o=r.length=i.length;o>f;f++)e=i[f],r[f]=t.DomElement(e)?e:u.elements(e);else(t.DomElement(i)||i===document||i===n)&&(r=[i]);return r},u.scrollTop=function(t){return t&&"number"==typeof t.scrollTop?t.scrollTop:n.pageYOffset||0},u.scrollLeft=function(t){return t&&"number"==typeof t.scrollLeft?t.scrollLeft:n.pageXOffset||0},u.width=function(n,t,i){return l("width",n,t,i)},u.height=function(n,t,i){return l("height",n,t,i)},u.offset=function(n,t){var i={top:0,left:0},r;return n&&n.getBoundingClientRect&&(r=n.getBoundingClientRect(),i.top=r.top,i.left=r.left,t||(i.top+=u.scrollTop(),i.left+=u.scrollLeft())),i},r.addClass=function(n,t){t&&(n.classList?n.classList.add(t):n.className+=" "+t)},r.removeClass=function(n,t){t&&(n.classList?n.classList.remove(t):n.className=n.className.replace(RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))},r.css=function(n,i){var u,e,f,r;if(t.String(i))return h(n)[c(i)];if(t.Array(i))return u={},e=h(n),i.forEach(function(n){u[n]=e[c(n)]}),u;for(f in i)r=i[f],r==parseFloat(r)&&(r+="px"),n.style[c(f)]=r},r}(window||{}),t});
/*! ScrollMagic v2.0.5 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
!function(n,t){"function"==typeof define&&define.amd?define(["ScrollMagic","TweenMax","TimelineMax"],t):"object"==typeof exports?(require("gsap"),t(require("scrollmagic"),TweenMax,TimelineMax)):t(n.ScrollMagic||n.jQuery&&n.jQuery.ScrollMagic,n.TweenMax||n.TweenLite,n.TimelineMax||n.TimelineLite)}(this,function(n,t,i){"use strict";n.Scene.addOption("tweenChanges",!1,function(n){return!!n}),n.Scene.extend(function(){var n,r=this,u;r.on("progress.plugin_gsap",function(){u()}),r.on("destroy.plugin_gsap",function(n){r.removeTween(n.reset)}),u=function(){if(n){var t=r.progress(),i=r.state();n.repeat&&-1===n.repeat()?"DURING"===i&&n.paused()?n.play():"DURING"===i||n.paused()||n.pause():t!=n.progress()&&(0===r.duration()?t>0?n.play():n.reverse():r.tweenChanges()&&n.tweenTo?n.tweenTo(t*n.duration()):n.progress(t).pause())}},r.setTween=function(f,e,o){var s;arguments.length>1&&(arguments.length<3&&(o=e,e=1),f=t.to(f,e,o));try{s=i?new i({smoothChildTiming:!0}).add(f):f,s.pause()}catch(h){return r}return n&&r.removeTween(),n=s,f.repeat&&-1===f.repeat()&&(n.repeat(-1),n.yoyo(f.yoyo())),u(),r},r.removeTween=function(t){return n&&(t&&n.progress(0).pause(),n.kill(),n=void 0),r}})});
/*! ScrollMagic v2.0.5 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
!function(n,t){"function"==typeof define&&define.amd?define(["ScrollMagic"],t):t("object"==typeof exports?require("scrollmagic"):n.ScrollMagic||n.jQuery&&n.jQuery.ScrollMagic)}(this,function(n){"use strict";var u="0.85em",f="9999",r=15,t=n._util,e=0,o,i;n.Scene.extend(function(){var i,n=this;n.addIndicators=function(r){if(!i)r=t.extend({},{name:"",indent:0,parent:void 0,colorStart:"green",colorEnd:"red",colorTrigger:"blue"},r),e++,i=new o(n,r),n.on("add.plugin_addIndicators",i.add),n.on("remove.plugin_addIndicators",i.remove),n.on("destroy.plugin_addIndicators",n.removeIndicators),n.controller()&&i.add();return n},n.removeIndicators=function(){return i&&(i.remove(),this.off("*.plugin_addIndicators"),i=void 0),n}}),n.Controller.addOption("addIndicators",!1),n.Controller.extend(function(){var s=this,c=s.info(),i=c.container,h=c.isDocument,u=c.vertical,e={groups:[]},o,f;return this._indicators=e,o=function(){e.updateBoundsPositions()},f=function(){e.updateTriggerGroupPositions()},i.addEventListener("resize",f),h||(window.addEventListener("resize",f),window.addEventListener("scroll",f)),i.addEventListener("resize",o),i.addEventListener("scroll",o),this._indicators.updateBoundsPositions=function(n){for(var o,s,f,h=n?[t.extend({},n.triggerGroup,{members:[n]})]:e.groups,c=h.length,l={},a=u?"left":"top",v=u?"width":"height",y=u?t.get.scrollLeft(i)+t.get.width(i)-r:t.get.scrollTop(i)+t.get.height(i)-r;c--;)for(f=h[c],o=f.members.length,s=t.get[v](f.element.firstChild);o--;)l[a]=y-s,t.css(f.members[o].bounds,l)},this._indicators.updateTriggerGroupPositions=function(n){for(var f,o,c,a,l,v=n?[n]:e.groups,y=v.length,b=h?document.body:i,p=h?{top:0,left:0}:t.get.offset(b,!0),w=u?t.get.width(i)-r:t.get.height(i)-r,k=u?"width":"height",d=u?"Y":"X";y--;)f=v[y],o=f.element,c=f.triggerHook*s.info("size"),a=t.get[k](o.firstChild.firstChild),l=c>a?"translate"+d+"(-100%)":"",t.css(o,{top:p.top+(u?c:w-f.members[0].options.indent),left:p.left+(u?w-f.members[0].options.indent:c)}),t.css(o.firstChild.firstChild,{"-ms-transform":l,"-webkit-transform":l,transform:l})},this._indicators.updateTriggerGroupLabel=function(n){var t="trigger"+(n.members.length>1?"":" "+n.members[0].options.name),i=n.element.firstChild.firstChild,r=i.textContent!==t;r&&(i.textContent=t,u&&e.updateBoundsPositions())},this.addScene=function(t){this._options.addIndicators&&t instanceof n.Scene&&t.controller()===s&&t.addIndicators(),this.$super.addScene.apply(this,arguments)},this.destroy=function(){i.removeEventListener("resize",f),h||(window.removeEventListener("resize",f),window.removeEventListener("scroll",f)),i.removeEventListener("resize",o),i.removeEventListener("scroll",o),this.$super.destroy.apply(this,arguments)},s}),o=function(n,r){var s,f,u=this,o=i.bounds(),l=i.start(r.colorStart),c=i.end(r.colorEnd),h=r.parent&&t.get.elements(r.parent)[0];r.name=r.name||e,l.firstChild.textContent+=" "+r.name,c.textContent+=" "+r.name,o.appendChild(l),o.appendChild(c),u.options=r,u.bounds=o,u.triggerGroup=void 0,this.add=function(){f=n.controller(),s=f.info("vertical");var i=f.info("isDocument");h||(h=i?document.body:f.info("container")),i||"static"!==t.css(h,"position")||t.css(h,{position:"relative"}),n.on("change.plugin_addIndicators",v),n.on("shift.plugin_addIndicators",a),w(),y(),setTimeout(function(){f._indicators.updateBoundsPositions(u)},0)},this.remove=function(){if(u.triggerGroup){if(n.off("change.plugin_addIndicators",v),n.off("shift.plugin_addIndicators",a),u.triggerGroup.members.length>1){var t=u.triggerGroup;t.members.splice(t.members.indexOf(u),1),f._indicators.updateTriggerGroupLabel(t),f._indicators.updateTriggerGroupPositions(t),u.triggerGroup=void 0}else p();k()}};var a=function(){y()},v=function(n){"triggerHook"===n.what&&w()},b=function(){var n=f.info("vertical");t.css(l.firstChild,{"border-bottom-width":n?1:0,"border-right-width":n?0:1,bottom:n?-1:r.indent,right:n?r.indent:-1,padding:n?"0 8px":"2px 4px"}),t.css(c,{"border-top-width":n?1:0,"border-left-width":n?0:1,top:n?"100%":"",right:n?r.indent:"",bottom:n?"":r.indent,left:n?"":"100%",padding:n?"0 8px":"2px 4px"}),h.appendChild(o)},k=function(){o.parentNode.removeChild(o)},y=function(){o.parentNode!==h&&b();var i={};i[s?"top":"left"]=n.triggerPosition(),i[s?"height":"width"]=n.duration(),t.css(o,i),t.css(c,{display:n.duration()>0?"":"none"})},d=function(){var o=i.trigger(r.colorTrigger),h={},e;h[s?"right":"bottom"]=0,h[s?"border-top-width":"border-left-width"]=1,t.css(o.firstChild,h),t.css(o.firstChild.firstChild,{padding:s?"0 8px 3px 8px":"3px 4px"}),document.body.appendChild(o),e={triggerHook:n.triggerHook(),element:o,members:[u]},f._indicators.groups.push(e),u.triggerGroup=e,f._indicators.updateTriggerGroupLabel(e),f._indicators.updateTriggerGroupPositions(e)},p=function(){f._indicators.groups.splice(f._indicators.groups.indexOf(u.triggerGroup),1),u.triggerGroup.element.parentNode.removeChild(u.triggerGroup.element),u.triggerGroup=void 0},w=function(){var i=n.triggerHook(),o=.0001,t,r,e;if(!(u.triggerGroup&&Math.abs(u.triggerGroup.triggerHook-i)<o)){for(r=f._indicators.groups,e=r.length;e--;)if(t=r[e],Math.abs(t.triggerHook-i)<o)return u.triggerGroup&&(1===u.triggerGroup.members.length?p():(u.triggerGroup.members.splice(u.triggerGroup.members.indexOf(u),1),f._indicators.updateTriggerGroupLabel(u.triggerGroup),f._indicators.updateTriggerGroupPositions(u.triggerGroup))),t.members.push(u),u.triggerGroup=t,void f._indicators.updateTriggerGroupLabel(t);if(u.triggerGroup){if(1===u.triggerGroup.members.length)return u.triggerGroup.triggerHook=i,void f._indicators.updateTriggerGroupPositions(u.triggerGroup);u.triggerGroup.members.splice(u.triggerGroup.members.indexOf(u),1),f._indicators.updateTriggerGroupLabel(u.triggerGroup),f._indicators.updateTriggerGroupPositions(u.triggerGroup),u.triggerGroup=void 0}d()}}},i={start:function(n){var r=document.createElement("div"),i;return r.textContent="start",t.css(r,{position:"absolute",overflow:"visible","border-width":0,"border-style":"solid",color:n,"border-color":n}),i=document.createElement("div"),t.css(i,{position:"absolute",overflow:"visible",width:0,height:0}),i.appendChild(r),i},end:function(n){var i=document.createElement("div");return i.textContent="end",t.css(i,{position:"absolute",overflow:"visible","border-width":0,"border-style":"solid",color:n,"border-color":n}),i},bounds:function(){var n=document.createElement("div");return t.css(n,{position:"absolute",overflow:"visible","white-space":"nowrap","pointer-events":"none","font-size":u}),n.style.zIndex=f,n},trigger:function(n){var e=document.createElement("div"),r,i;return e.textContent="trigger",t.css(e,{position:"relative"}),r=document.createElement("div"),t.css(r,{position:"absolute",overflow:"visible","border-width":0,"border-style":"solid",color:n,"border-color":n}),r.appendChild(e),i=document.createElement("div"),t.css(i,{position:"fixed",overflow:"visible","white-space":"nowrap","pointer-events":"none","font-size":u}),i.style.zIndex=f,i.appendChild(r),i}}});
/*!
 * VERSION: 0.2.1
 * DATE: 2017-01-17
 * UPDATES AND DOCS AT: http://greensock.com
 *
 * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
 * This work is subject to the terms at http://greensock.com/standard-license or for
 * Club GreenSock members, the software agreement that was issued with your membership.
 *
 * @author: Jack Doyle, jack@greensock.com
 **/
_gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("easing.CustomEase",["easing.Ease"],function(n){var e=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,o=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,s=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/gi,h=/[cLlsS]/g,u="CustomEase only accepts Cubic Bezier data.",i=function(n,t,r,u,f,e,o,s,h,c,l){var w,b=(n+r)/2,k=(t+u)/2,d=(r+f)/2,g=(u+e)/2,nt=(f+o)/2,tt=(e+s)/2,it=(b+d)/2,rt=(k+g)/2,ut=(d+nt)/2,ft=(g+tt)/2,y=(it+ut)/2,p=(rt+ft)/2,a=o-n,v=s-t,et=Math.abs((r-o)*v-(u-s)*a),ot=Math.abs((f-o)*v-(e-s)*a);return c||(c=[{x:n,y:t},{x:o,y:s}],l=1),c.splice(l||c.length-1,0,{x:y,y:p}),(et+ot)*(et+ot)>h*(a*a+v*v)&&(w=c.length,i(n,t,b,k,it,rt,y,p,h,c,l),i(y,p,ut,ft,nt,tt,o,s,h,c,l+1+(c.length-w))),c},c=function(n){for(var h,c,l,v,t,y,p,w,k,d,a=(n+"").replace(s,function(n){var t=+n;return.0001>t&&t>-.0001?0:t}).match(o)||[],b=[],f=0,e=0,g=a.length,i=2,r=0;g>r;r++)if(w=l,isNaN(a[r])?(l=a[r].toUpperCase(),v=l!==a[r]):r--,h=+a[r+1],c=+a[r+2],v&&(h+=f,c+=e),r||(y=h,p=c),"M"===l)t&&t.length<8&&(b.length-=1,i=0),f=y=h,e=p=c,t=[h,c],i=2,b.push(t),r+=2,l="L";else if("C"===l)t||(t=[0,0]),t[i++]=h,t[i++]=c,v||(f=e=0),t[i++]=f+1*a[r+3],t[i++]=e+1*a[r+4],t[i++]=f+=1*a[r+5],t[i++]=e+=1*a[r+6],r+=6;else if("S"===l)"C"===w||"S"===w?(k=f-t[i-4],d=e-t[i-3],t[i++]=f+k,t[i++]=e+d):(t[i++]=f,t[i++]=e),t[i++]=h,t[i++]=c,v||(f=e=0),t[i++]=f+=1*a[r+3],t[i++]=e+=1*a[r+4],r+=4;else{if("L"!==l&&"Z"!==l)throw u;"Z"===l&&(h=y,c=p,t.closed=!0),("L"===l||Math.abs(f-h)>.5||Math.abs(e-c)>.5)&&(t[i++]=f+(h-f)/3,t[i++]=e+(c-e)/3,t[i++]=f+2*(h-f)/3,t[i++]=e+2*(c-e)/3,t[i++]=h,t[i++]=c,"L"===l&&(r+=2)),f=h,e=c}return b[0]},l=function(n){for(var r=n.length,i=999999999999,t=1;r>t;t+=6)+n[t]<i&&(i=+n[t]);return i},a=function(n,t,i){i||0===i||(i=Math.max(+n[n.length-1],+n[1]));for(var o=-1*+n[0],e=-i,u=n.length,s=1/(+n[u-2]+o),f=-t||(Math.abs(+n[u-1]-+n[1])<.01*(+n[u-2]-+n[0])?l(n)+e:+n[u-1]+e),f=f?1/f:-s,r=0;u>r;r+=2)n[r]=(+n[r]+o)*s,n[r+1]=(+n[r+1]+e)*f},f=function(n){var t=this.lookup[n*this.l|0]||this.lookup[this.l-1];return t.nx<n&&(t=t.n),t.y+(n-t.x)/t.cx*t.cy},t=function(t,i,r){this._calcEnd=!0,this.id=t,t&&(n.map[t]=this),this.getRatio=f,this.setData(i,r)},r=t.prototype=new n;return r.constructor=t,r.setData=function(n,t){n=n||"0,0,1,1";var l,y,w,r,b,k,o,s,d,g,v=n.match(e),p=1,f=[];if(t=t||{},g=t.precision||1,this.data=n,this.lookup=[],this.points=f,this.fast=1>=g,(h.test(n)||-1!==n.indexOf("M")&&-1===n.indexOf("C"))&&(v=c(n)),l=v.length,4===l)v.unshift(0,0),v.push(1,1),l=8;else if((l-2)%6)throw u;for((0!=+v[0]||1!=+v[l-2])&&a(v,t.height,t.originY),this.rawBezier=v,r=2;l>r;r+=6)y={x:+v[r-2],y:+v[r-1]},w={x:+v[r+4],y:+v[r+5]},f.push(y,w),i(y.x,y.y,+v[r],+v[r+1],+v[r+2],+v[r+3],w.x,w.y,1/(2e5*g),f,f.length-1);for(l=f.length,r=0;l>r;r++)o=f[r],s=f[r-1]||o,o.x>s.x||s.y!==o.y&&s.x===o.x||o===s?(s.cx=o.x-s.x,s.cy=o.y-s.y,s.n=o,s.nx=o.x,this.fast&&r>1&&Math.abs(s.cy/s.cx-f[r-2].cy/f[r-2].cx)>2&&(this.fast=!1),s.cx<p&&(s.cx?p=s.cx:(s.cx=.001,r===l-1&&(s.x-=.001,p=Math.min(p,.001),this.fast=!1)))):(f.splice(r--,1),l--);if(l=1/p+1|0,this.l=l,b=1/l,k=0,o=f[0],this.fast){for(r=0;l>r;r++)d=r*b,o.nx<d&&(o=f[++k]),y=o.y+(d-o.x)/o.cx*o.cy,this.lookup[r]={x:d,cx:b,y:y,cy:0,nx:9},r&&(this.lookup[r-1].cy=y-this.lookup[r-1].y);this.lookup[l-1].cy=f[f.length-1].y-y}else{for(r=0;l>r;r++)o.nx<r*b&&(o=f[++k]),this.lookup[r]=o;k<f.length-1&&(this.lookup[r-1]=f[f.length-2])}return this._calcEnd=1!==f[f.length-1].y||0!==f[0].y,this},r.getRatio=f,r.getSVGData=function(n){return t.getSVGData(this,n)},t.create=function(n,i,r){return new t(n,i,r)},t.version="0.2.1",t.bezierToPoints=i,t.get=function(t){return n.map[t]},t.getSVGData=function(t,i){i=i||{};var f,w,u,l,v,y,e,k,o,s,r=1e3,b=i.width||100,h=i.height||100,a=i.x||0,c=(i.y||0)+h,p=i.path;if(i.invert&&(h=-h,c=0),t=t.getRatio?t:n.map[t]||console.log("No ease found: ",t),t.rawBezier){for(f=[],e=t.rawBezier.length,u=0;e>u;u+=2)f.push(((a+t.rawBezier[u]*b)*r|0)/r+","+((c+t.rawBezier[u+1]*-h)*r|0)/r);f[0]="M"+f[0],f[1]="C"+f[1]}else for(f=["M"+a+","+c],e=Math.max(5,200*(i.precision||1)),l=1/e,e+=2,k=5/e,o=((a+l*b)*r|0)/r,s=((c+t.getRatio(l)*-h)*r|0)/r,w=(s-c)/(o-a),u=2;e>u;u++)v=((a+u*l*b)*r|0)/r,y=((c+t.getRatio(u*l)*-h)*r|0)/r,(Math.abs((y-s)/(v-o)-w)>k||u===e-1)&&(f.push(o+","+s),w=(y-s)/(v-o)),o=v,s=y;return p&&("string"==typeof p?document.querySelector(p):p).setAttribute("d",f.join(" ")),f.join(" ")},t},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(n){"use strict";var t=function(){return(_gsScope.GreenSockGlobals||_gsScope)[n]};"function"==typeof define&&define.amd?define(["TweenLite"],t):"undefined"!=typeof module&&module.exports&&(require("../TweenLite.js"),module.exports=t())}("CustomEase"),function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(n=n||self,t(n.THREE={}))}(this,function(n){function hi(){}function i(n,t){this.x=n||0,this.y=t||0}function lt(n,t,i,r){this._x=n||0,this._y=t||0,this._z=i||0,this._w=void 0!==r?r:1}function t(n,t,i){this.x=n||0,this.y=t||0,this.z=i||0}function ft(){this.elements=[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.")}function k(n,t,r,u,f,e,o,s,h,c){Object.defineProperty(this,"id",{value:yg++}),this.uuid=a.generateUUID(),this.name="",this.image=void 0!==n?n:k.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:k.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:1001,this.wrapT=void 0!==u?u:1001,this.magFilter=void 0!==f?f:1006,this.minFilter=void 0!==e?e:1008,this.anisotropy=void 0!==h?h:1,this.format=void 0!==o?o:1023,this.type=void 0!==s?s:1009,this.offset=new i(0,0),this.repeat=new i(1,1),this.center=new i(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ft,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:3e3,this.version=0,this.onUpdate=null}function p(n,t,i,r){this.x=n||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1}function wt(n,t,i){this.width=n,this.height=t,this.scissor=new p(0,0,n,t),this.scissorTest=!1,this.viewport=new p(0,0,n,t),i=i||{},this.texture=new k(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.image={},this.texture.image.width=n,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==i.generateMipmaps?i.generateMipmaps:!1,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:1006,this.depthBuffer=void 0!==i.depthBuffer?i.depthBuffer:!0,this.stencilBuffer=void 0!==i.stencilBuffer?i.stencilBuffer:!0,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function rp(n,t,i){wt.call(this,n,t,i),this.samples=4}function v(){this.elements=[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.")}function tf(n,t,i,r){this._x=n||0,this._y=t||0,this._z=i||0,this._order=r||tf.DefaultOrder}function up(){this.mask=1}function u(){Object.defineProperty(this,"id",{value:ift++}),this.uuid=a.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=u.DefaultUp.clone();var r=new t,n=new tf,i=new lt,f=new t(1,1,1);n._onChange(function(){i.setFromEuler(n,!1)}),i._onChange(function(){n.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:r},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:f},modelViewMatrix:{value:new v},normalMatrix:{value:new ft}}),this.matrix=new v,this.matrixWorld=new v,this.matrixAutoUpdate=u.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new up,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function ih(){u.call(this),this.type="Scene",this.overrideMaterial=this.fog=this.background=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function ir(n,i){this.min=void 0!==n?n:new t(Infinity,Infinity,Infinity),this.max=void 0!==i?i:new t(-Infinity,-Infinity,-Infinity)}function fp(n,t,i,r,u){for(var f=0,e=n.length-3;f<=e;f+=3){re.fromArray(n,f);var c=u.x*Math.abs(re.x)+u.y*Math.abs(re.y)+u.z*Math.abs(re.z),o=t.dot(re),s=i.dot(re),h=r.dot(re);if(Math.max(-Math.max(o,s,h),Math.min(o,s,h))>c)return!1}return!0}function pr(n,i){this.center=void 0!==n?n:new t,this.radius=void 0!==i?i:0}function rf(n,i){this.origin=void 0!==n?n:new t,this.direction=void 0!==i?i:new t}function ci(n,i){this.normal=void 0!==n?n:new t(1,0,0),this.constant=void 0!==i?i:0}function et(n,i,r){this.a=void 0!==n?n:new t,this.b=void 0!==i?i:new t,this.c=void 0!==r?r:new t}function e(n,t,i){return void 0===t&&void 0===i?this.set(n):this.setRGB(n,t,i)}function ep(n,t,i){return 0>i&&(i+=1),1<i&&--i,i<1/6?n+6*(t-n)*i:.5>i?t:i<2/3?n+6*(t-n)*(2/3-i):n}function op(n){return.04045>n?.0773993808*n:Math.pow(.9478672986*n+.0521327014,2.4)}function sp(n){return.0031308>n?12.92*n:1.055*Math.pow(n,.41666)-.055}function ye(n,i,r,u,f,o){this.a=n,this.b=i,this.c=r,this.normal=u&&u.isVector3?u:new t,this.vertexNormals=Array.isArray(u)?u:[],this.color=f&&f.isColor?f:new e,this.vertexColors=Array.isArray(f)?f:[],this.materialIndex=void 0!==o?o:0}function l(){Object.defineProperty(this,"id",{value:tn++}),this.uuid=a.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexTangents=this.flatShading=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null,this.depthFunc=3,this.depthWrite=this.depthTest=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilZPass=this.stencilZFail=this.stencilFail=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipShadows=this.clipIntersection=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetUnits=this.polygonOffsetFactor=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.toneMapped=this.visible=!0,this.userData={},this.needsUpdate=!0}function gt(n){l.call(this),this.type="MeshBasicMaterial",this.color=new e(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.envMap=this.alphaMap=this.specularMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphTargets=this.skinning=!1,this.setValues(n)}function c(n,t,i){if(Array.isArray(n))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=n,this.itemSize=t,this.count=void 0!==n?n.length/t:0,this.normalized=!0===i,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function rh(n,t,i){c.call(this,new Int8Array(n),t,i)}function uh(n,t,i){c.call(this,new Uint8Array(n),t,i)}function fh(n,t,i){c.call(this,new Uint8ClampedArray(n),t,i)}function eh(n,t,i){c.call(this,new Int16Array(n),t,i)}function uf(n,t,i){c.call(this,new Uint16Array(n),t,i)}function oh(n,t,i){c.call(this,new Int32Array(n),t,i)}function ff(n,t,i){c.call(this,new Uint32Array(n),t,i)}function r(n,t,i){c.call(this,new Float32Array(n),t,i)}function sh(n,t,i){c.call(this,new Float64Array(n),t,i)}function bk(){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}function kk(n){if(0===n.length)return-Infinity;for(var i=n[0],t=1,r=n.length;t<r;++t)n[t]>i&&(i=n[t]);return i}function f(){Object.defineProperty(this,"id",{value:hft+=2}),this.uuid=a.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:Infinity},this.userData={}}function tt(n,t){u.call(this),this.type="Mesh",this.geometry=void 0!==n?n:new f,this.material=void 0!==t?t:new gt({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}function dk(n,t,i,r,u,f,e,o){return null===(1===t.side?r.intersectTriangle(e,f,u,!0,o):r.intersectTriangle(u,f,e,2!==t.side,o))?null:(fy.copy(o),fy.applyMatrix4(n.matrixWorld),t=i.ray.origin.distanceTo(fy),t<i.near||t>i.far?null:{distance:t,point:fy.clone(),object:n})}function ra(n,t,r,u,f,e,o,s,h,c,l){var a,p,v,y;if(ee.fromBufferAttribute(f,h),oe.fromBufferAttribute(f,c),se.fromBufferAttribute(f,l),f=n.morphTargetInfluences,t.morphTargets&&e&&f){for(vb.set(0,0,0),yb.set(0,0,0),pb.set(0,0,0),a=0,p=e.length;a<p;a++)v=f[a],y=e[a],0!==v&&(un.fromBufferAttribute(y,h),fn.fromBufferAttribute(y,c),en.fromBufferAttribute(y,l),vb.addScaledVector(un.sub(ee),v),yb.addScaledVector(fn.sub(oe),v),pb.addScaledVector(en.sub(se),v));ee.add(vb),oe.add(yb),se.add(pb)}return(n=dk(n,t,r,u,ee,oe,se,ll))&&(o&&(ws.fromBufferAttribute(o,h),bs.fromBufferAttribute(o,c),ks.fromBufferAttribute(o,l),n.uv=et.getUV(ll,ee,oe,se,ws,bs,ks,new i)),s&&(ws.fromBufferAttribute(s,h),bs.fromBufferAttribute(s,c),ks.fromBufferAttribute(s,l),n.uv2=et.getUV(ll,ee,oe,se,ws,bs,ks,new i)),o=new ye(h,c,l),et.getNormal(ee,oe,se,o.normal),n.face=o),n}function h(){Object.defineProperty(this,"id",{value:cft+=2}),this.uuid=a.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.verticesNeedUpdate=this.elementsNeedUpdate=!1}function ef(n){var r={},i,u,t;for(i in n){r[i]={};for(u in n[i])t=n[i][u],r[i][u]=t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture)?t.clone():Array.isArray(t)?t.slice():t}return r}function bt(n){for(var r,u,i={},t=0;t<n.length;t++){r=ef(n[t]);for(u in r)i[u]=r[u]}return i}function at(n){l.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.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!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,this.uniformsNeedUpdate=!1,void 0!==n&&(void 0!==n.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(n))}function rr(){u.call(this),this.type="Camera",this.matrixWorldInverse=new v,this.projectionMatrix=new v,this.projectionMatrixInverse=new v}function it(n,t,i,r){rr.call(this),this.type="PerspectiveCamera",this.fov=void 0!==n?n:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function pe(n,i,r,f){var e,o,s,h,c,l;u.call(this),this.type="CubeCamera",e=new it(90,1,n,i),e.up.set(0,-1,0),e.lookAt(new t(1,0,0)),this.add(e),o=new it(90,1,n,i),o.up.set(0,-1,0),o.lookAt(new t(-1,0,0)),this.add(o),s=new it(90,1,n,i),s.up.set(0,0,1),s.lookAt(new t(0,1,0)),this.add(s),h=new it(90,1,n,i),h.up.set(0,0,-1),h.lookAt(new t(0,-1,0)),this.add(h),c=new it(90,1,n,i),c.up.set(0,-1,0),c.lookAt(new t(0,0,1)),this.add(c),l=new it(90,1,n,i),l.up.set(0,-1,0),l.lookAt(new t(0,0,-1)),this.add(l),f=f||{format:1022,magFilter:1006,minFilter:1006},this.renderTarget=new su(r,r,f),this.renderTarget.texture.name="CubeCamera",this.update=function(n,t){null===this.parent&&this.updateMatrixWorld();var r=n.getRenderTarget(),i=this.renderTarget,u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,n.setRenderTarget(i,0),n.render(t,e),n.setRenderTarget(i,1),n.render(t,o),n.setRenderTarget(i,2),n.render(t,s),n.setRenderTarget(i,3),n.render(t,h),n.setRenderTarget(i,4),n.render(t,c),i.texture.generateMipmaps=u,n.setRenderTarget(i,5),n.render(t,l),n.setRenderTarget(r)},this.clear=function(n,t,i,r){for(var f=n.getRenderTarget(),e=this.renderTarget,u=0;6>u;u++)n.setRenderTarget(e,u),n.clear(t,i,r);n.setRenderTarget(f)}}function su(n,t,i){wt.call(this,n,t,i)}function of(n,t,i,r,u,f,e,o,s,h,c,l){k.call(this,null,f,e,o,s,h,r,u,c,l),this.image={data:n||null,width:t||1,height:i||1},this.magFilter=void 0!==s?s:1003,this.minFilter=void 0!==h?h:1003,this.flipY=this.generateMipmaps=!1,this.unpackAlignment=1,this.needsUpdate=!0}function hh(n,t,i,r,u,f){this.planes=[void 0!==n?n:new ci,void 0!==t?t:new ci,void 0!==i?i:new ci,void 0!==r?r:new ci,void 0!==u?u:new ci,void 0!==f?f:new ci]}function hp(){function r(u,f){!1!==n&&(i(u,f),t.requestAnimationFrame(r))}var t=null,n=!1,i=null;return{start:function(){!0!==n&&null!==i&&(t.requestAnimationFrame(r),n=!0)},stop:function(){n=!1},setAnimationLoop:function(n){i=n},setContext:function(n){t=n}}}function ytt(n){function i(t,i){var r=t.array,f=t.usage,u=n.createBuffer();return n.bindBuffer(i,u),n.bufferData(i,r,f),t.onUploadCallback(),i=5126,r instanceof Float32Array?i=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?i=5123:r instanceof Int16Array?i=5122:r instanceof Uint32Array?i=5125:r instanceof Int32Array?i=5124:r instanceof Int8Array?i=5120:r instanceof Uint8Array&&(i=5121),{buffer:u,type:i,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}var t=new WeakMap;return{get:function(n){return n.isInterleavedBufferAttribute&&(n=n.data),t.get(n)},remove:function(i){i.isInterleavedBufferAttribute&&(i=i.data);var r=t.get(i);r&&(n.deleteBuffer(r.buffer),t.delete(i))},update:function(r,u){var e,o,f;r.isInterleavedBufferAttribute&&(r=r.data),e=t.get(r),void 0===e?t.set(r,i(r,u)):e.version<r.version&&(o=r.array,f=r.updateRange,n.bindBuffer(u,e.buffer),-1===f.count?n.bufferSubData(u,0,o):(n.bufferSubData(u,f.offset*o.BYTES_PER_ELEMENT,o.subarray(f.offset,f.offset+f.count)),f.count=-1),e.version=r.version)}}}function ch(n,t,i,r){h.call(this),this.type="PlaneGeometry",this.parameters={width:n,height:t,widthSegments:i,heightSegments:r},this.fromBufferGeometry(new sf(n,t,i,r)),this.mergeVertices()}function sf(n,t,i,u){var e,s,y;f.call(this),this.type="PlaneBufferGeometry",this.parameters={width:n,height:t,widthSegments:i,heightSegments:u},n=n||1,t=t||1,e=n/2,s=t/2,i=Math.floor(i)||1,u=Math.floor(u)||1;var o=i+1,h=u+1,p=n/i,w=t/u,c=[],a=[],v=[],l=[];for(n=0;n<h;n++)for(y=n*w-s,t=0;t<o;t++)a.push(t*p-e,-y,0),v.push(0,0,1),l.push(t/i),l.push(1-n/u);for(n=0;n<u;n++)for(t=0;t<i;t++)e=t+o*(n+1),s=t+1+o*(n+1),h=t+1+o*n,c.push(t+o*n,e,h),c.push(e,s,h);this.setIndex(c),this.setAttribute("position",new r(a,3)),this.setAttribute("normal",new r(v,3)),this.setAttribute("uv",new r(l,2))}function ptt(n,t,i,r){function l(n,i){t.buffers.color.setClear(n.r,n.g,n.b,i,r)}var c=new e(0),o=0,f,u,s=null,h=0;return{getClearColor:function(){return c},setClearColor:function(n,t){c.set(n),o=void 0!==t?t:1,l(c,o)},getClearAlpha:function(){return o},setClearAlpha:function(n){o=n,l(c,o)},render:function(t,r,e,a){r=r.background,e=n.vr,(e=e.getSession&&e.getSession())&&"additive"===e.environmentBlendMode&&(r=null),null===r?(l(c,o),s=null,h=0):r&&r.isColor&&(l(r,1),a=!0,s=null,h=0),(n.autoClear||a)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),r&&(r.isCubeTexture||r.isWebGLRenderTargetCube)?(void 0===u&&(u=new tt(new al(1,1,1),new at({type:"BackgroundCubeMaterial",uniforms:ef(ar.cube.uniforms),vertexShader:ar.cube.vertexShader,fragmentShader:ar.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(n,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.tCube.value}}),i.update(u)),a=r.isWebGLRenderTargetCube?r.texture:r,u.material.uniforms.tCube.value=a,u.material.uniforms.tFlip.value=r.isWebGLRenderTargetCube?1:-1,(s!==r||h!==a.version)&&(u.material.needsUpdate=!0,s=r,h=a.version),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(void 0===f&&(f=new tt(new sf(2,2),new at({type:"BackgroundMaterial",uniforms:ef(ar.background.uniforms),vertexShader:ar.background.vertexShader,fragmentShader:ar.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),f.geometry.deleteAttribute("normal"),Object.defineProperty(f.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(f)),f.material.uniforms.t2D.value=r,!0===r.matrixAutoUpdate&&r.updateMatrix(),f.material.uniforms.uvTransform.value.copy(r.matrix),(s!==r||h!==r.version)&&(f.material.needsUpdate=!0,s=r,h=r.version),t.unshift(f,f.geometry,f.material,0,0,null))}}}function wtt(n,t,i,r){var f=r.isWebGL2,u;this.setMode=function(n){u=n},this.render=function(t,r){n.drawArrays(u,t,r),i.update(r,u)},this.renderInstances=function(r,e,o,s){if(0!==s){if(f){r=n;var h="drawArraysInstanced"}else if(r=t.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",null===r){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}r[h](u,e,o,s),i.update(o,u,s)}}}function btt(n,t,i){function o(t){if("highp"===t){if(0<n.getShaderPrecisionFormat(35633,36338).precision&&0<n.getShaderPrecisionFormat(35632,36338).precision)return"highp";t="mediump"}return"mediump"===t&&0<n.getShaderPrecisionFormat(35633,36337).precision&&0<n.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var f,e="undefined"!=typeof WebGL2RenderingContext&&n instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&n instanceof WebGL2ComputeRenderingContext,r=void 0!==i.precision?i.precision:"highp",u=o(r);u!==r&&(console.warn("THREE.WebGLRenderer:",r,"not supported, using",u,"instead."),r=u),i=!0===i.logarithmicDepthBuffer,u=n.getParameter(34930);var s=n.getParameter(35660),l=n.getParameter(3379),a=n.getParameter(34076),v=n.getParameter(34921),y=n.getParameter(36347),p=n.getParameter(36348),w=n.getParameter(36349),h=0<s,c=e||!!t.get("OES_texture_float"),b=h&&c,k=e?n.getParameter(36183):0;return{isWebGL2:e,getMaxAnisotropy:function(){if(void 0!==f)return f;var i=t.get("EXT_texture_filter_anisotropic");return f=null!==i?n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:o,precision:r,logarithmicDepthBuffer:i,maxTextures:u,maxVertexTextures:s,maxTextureSize:l,maxCubemapSize:a,maxAttributes:v,maxVertexUniforms:y,maxVaryings:p,maxFragmentUniforms:w,vertexTextures:h,floatFragmentTextures:c,floatVertexTextures:b,maxSamples:k}}function ktt(){function s(){n.value!==u&&(n.value=u,n.needsUpdate=0<t),f.numPlanes=t,f.numIntersection=0}function r(t,i,r,u){var s=null!==t?t.length:0,e=null;if(0!==s){if(e=n.value,!0!==u||null===e)for(u=r+4*s,i=i.matrixWorldInverse,h.getNormalMatrix(i),(null===e||e.length<u)&&(e=new Float32Array(u)),u=0;u!==s;++u,r+=4)o.copy(t[u]).applyMatrix4(i,h),o.normal.toArray(e,r),e[r+3]=o.constant;n.value=e,n.needsUpdate=!0}return f.numPlanes=s,e}var f=this,u=null,t=0,e=!1,i=!1,o=new ci,h=new ft,n={value:null,needsUpdate:!1};this.uniform=n,this.numIntersection=this.numPlanes=0,this.init=function(n,i,f){var o=0!==n.length||i||0!==t||e;return e=i,u=r(n,f,0),t=n.length,o},this.beginShadows=function(){i=!0,r(null)},this.endShadows=function(){i=!1,s()},this.setState=function(f,o,h,c,l,a){if(e&&null!==f&&0!==f.length&&(!i||h)){h=i?0:t;var y=4*h,v=l.clippingState||null;for(n.value=v,v=r(f,c,y,a),f=0;f!==y;++f)v[f]=u[f];l.clippingState=v,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=h}else i?r(null):s()}}function dtt(n){var t={};return{get:function(i){if(void 0!==t[i])return t[i];switch(i){case"WEBGL_depth_texture":var r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(i)}return null===r&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),t[i]=r}}}function gtt(n,t,i){function e(n){var o=n.target,f;n=u.get(o),null!==n.index&&t.remove(n.index);for(f in n.attributes)t.remove(n.attributes[f]);o.removeEventListener("dispose",e),u.delete(o),(f=r.get(n))&&(t.remove(f),r.delete(n)),i.memory.geometries--}function o(n){var f=[],e=n.index,i=n.attributes.position,u,c;if(null!==e)for(u=e.array,e=e.version,i=0,c=u.length;i<c;i+=3){var o=u[i+0],s=u[i+1],h=u[i+2];f.push(o,s,s,h,h,o)}else for(u=i.array,e=i.version,i=0,c=u.length/3-1;i<c;i+=3)o=i+0,s=i+1,h=i+2,f.push(o,s,s,h,h,o);f=new(65535<kk(f)?ff:uf)(f,1),f.version=e,t.update(f,34963),(u=r.get(n))&&t.remove(u),r.set(n,f)}var u=new WeakMap,r=new WeakMap;return{get:function(n,t){var r=u.get(t);return r?r:(t.addEventListener("dispose",e),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new f).setFromObject(n)),r=t._bufferGeometry),u.set(t,r),i.memory.geometries++,r)},update:function(n){var r=n.index,i=n.attributes,u,f;null!==r&&t.update(r,34963);for(u in i)t.update(i[u],34962);n=n.morphAttributes;for(u in n)for(r=n[u],i=0,f=r.length;i<f;i++)t.update(r[i],34962)},getWireframeAttribute:function(n){var i=r.get(n),t;return i?(t=n.index,null!==t&&i.version<t.version&&o(n)):o(n),r.get(n)}}}function nit(n,t,i,r){var o=r.isWebGL2,u,f,e;this.setMode=function(n){u=n},this.setIndex=function(n){f=n.type,e=n.bytesPerElement},this.render=function(t,r){n.drawElements(u,r,f,t*e),i.update(r,u)},this.renderInstances=function(r,s,h,c){if(0!==c){if(o){r=n;var l="drawElementsInstanced"}else if(r=t.get("ANGLE_instanced_arrays"),l="drawElementsInstancedANGLE",null===r){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}r[l](u,h,f,s*e,c),i.update(h,u,c)}}}function tit(){var n={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:n,programs:null,autoReset:!0,reset:function(){n.frame++,n.calls=0,n.triangles=0,n.points=0,n.lines=0},update:function(t,i,r){r=r||1,n.calls++;switch(i){case 4:n.triangles+=t/3*r;break;case 5:case 6:n.triangles+=r*(t-2);break;case 1:n.lines+=t/2*r;break;case 3:n.lines+=r*(t-1);break;case 2:n.lines+=r*t;break;case 0:n.points+=r*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function iit(n,t){return Math.abs(t[1])-Math.abs(n[1])}function rit(n){var i={},t=new Float32Array(8);return{update:function(r,u,f,e){var h=r.morphTargetInfluences,c=h.length,o,l,s;if(r=i[u.id],void 0===r){for(r=[],o=0;o<c;o++)r[o]=[o,0];i[u.id]=r}for(l=f.morphTargets&&u.morphAttributes.position,f=f.morphNormals&&u.morphAttributes.normal,o=0;o<c;o++)s=r[o],0!==s[1]&&(l&&u.deleteAttribute("morphTarget"+o),f&&u.deleteAttribute("morphNormal"+o));for(o=0;o<c;o++)s=r[o],s[0]=o,s[1]=h[o];for(r.sort(iit),o=0;8>o;o++){if((s=r[o])&&(h=s[0],c=s[1])){l&&u.setAttribute("morphTarget"+o,l[h]),f&&u.setAttribute("morphNormal"+o,f[h]),t[o]=c;continue}t[o]=0}e.getUniforms().setValue(n,"morphTargetInfluences",t)}}}function uit(n,t,i,r){var u={};return{update:function(n){var e=r.render.frame,o=n.geometry,f=t.get(n,o);return u[f.id]!==e&&(o.isGeometry&&f.updateFromObject(n),t.update(f),u[f.id]=e),n.isInstancedMesh&&i.update(n.instanceMatrix,34962),f},dispose:function(){u={}}}}function wr(n,t,i,r,u,f,e,o,s,h){n=void 0!==n?n:[],k.call(this,n,void 0!==t?t:301,i,r,u,f,void 0!==e?e:1022,o,s,h),this.flipY=!1}function we(n,t,i,r){k.call(this,null),this.image={data:n||null,width:t||1,height:i||1,depth:r||1},this.minFilter=this.magFilter=1003,this.wrapR=1001,this.flipY=this.generateMipmaps=!1,this.needsUpdate=!0}function be(n,t,i,r){k.call(this,null),this.image={data:n||null,width:t||1,height:i||1,depth:r||1},this.minFilter=this.magFilter=1003,this.wrapR=1001,this.flipY=this.generateMipmaps=!1,this.needsUpdate=!0}function ke(n,t,i){var r=n[0],u,f;if(0>=r||0<r)return n;if(u=t*i,f=hn[u],void 0===f&&(f=new Float32Array(u),hn[u]=f),0!==t)for(r.toArray(f,0),r=1,u=0;r!==t;++r)u+=i,n[r].toArray(f,u);return f}function fi(n,t){if(n.length!==t.length)return!1;for(var i=0,r=n.length;i<r;i++)if(n[i]!==t[i])return!1;return!0}function ni(n,t){for(var i=0,r=t.length;i<r;i++)n[i]=t[i]}function gk(n,t){var i=cn[t],r;for(void 0===i&&(i=new Int32Array(t),cn[t]=i),r=0;r!==t;++r)i[r]=n.allocateTextureUnit();return i}function fit(n,t){var i=this.cache;i[0]!==t&&(n.uniform1f(this.addr,t),i[0]=t)}function eit(n,t){var i=this.cache;void 0!==t.x?(i[0]!==t.x||i[1]!==t.y)&&(n.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y):fi(i,t)||(n.uniform2fv(this.addr,t),ni(i,t))}function oit(n,t){var i=this.cache;void 0!==t.x?(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(n.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z):void 0!==t.r?(i[0]!==t.r||i[1]!==t.g||i[2]!==t.b)&&(n.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b):fi(i,t)||(n.uniform3fv(this.addr,t),ni(i,t))}function sit(n,t){var i=this.cache;void 0!==t.x?(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(n.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w):fi(i,t)||(n.uniform4fv(this.addr,t),ni(i,t))}function hit(n,t){var i=this.cache,r=t.elements;void 0===r?fi(i,t)||(n.uniformMatrix2fv(this.addr,!1,t),ni(i,t)):fi(i,r)||(vn.set(r),n.uniformMatrix2fv(this.addr,!1,vn),ni(i,r))}function cit(n,t){var i=this.cache,r=t.elements;void 0===r?fi(i,t)||(n.uniformMatrix3fv(this.addr,!1,t),ni(i,t)):fi(i,r)||(an.set(r),n.uniformMatrix3fv(this.addr,!1,an),ni(i,r))}function lit(n,t){var i=this.cache,r=t.elements;void 0===r?fi(i,t)||(n.uniformMatrix4fv(this.addr,!1,t),ni(i,t)):fi(i,r)||(ln.set(r),n.uniformMatrix4fv(this.addr,!1,ln),ni(i,r))}function ait(n,t,i){var u=this.cache,r=i.allocateTextureUnit();u[0]!==r&&(n.uniform1i(this.addr,r),u[0]=r),i.safeSetTexture2D(t||on,r)}function vit(n,t,i){var u=this.cache,r=i.allocateTextureUnit();u[0]!==r&&(n.uniform1i(this.addr,r),u[0]=r),i.setTexture2DArray(t||aft,r)}function yit(n,t,i){var u=this.cache,r=i.allocateTextureUnit();u[0]!==r&&(n.uniform1i(this.addr,r),u[0]=r),i.setTexture3D(t||vft,r)}function pit(n,t,i){var u=this.cache,r=i.allocateTextureUnit();u[0]!==r&&(n.uniform1i(this.addr,r),u[0]=r),i.safeSetTextureCube(t||sn,r)}function wit(n,t){var i=this.cache;i[0]!==t&&(n.uniform1i(this.addr,t),i[0]=t)}function bit(n,t){var i=this.cache;fi(i,t)||(n.uniform2iv(this.addr,t),ni(i,t))}function kit(n,t){var i=this.cache;fi(i,t)||(n.uniform3iv(this.addr,t),ni(i,t))}function dit(n,t){var i=this.cache;fi(i,t)||(n.uniform4iv(this.addr,t),ni(i,t))}function git(n){switch(n){case 5126:return fit;case 35664:return eit;case 35665:return oit;case 35666:return sit;case 35674:return hit;case 35675:return cit;case 35676:return lit;case 35678:case 36198:return ait;case 35679:return yit;case 35680:return pit;case 36289:return vit;case 5124:case 35670:return wit;case 35667:case 35671:return bit;case 35668:case 35672:return kit;case 35669:case 35673:return dit}}function nrt(n,t){n.uniform1fv(this.addr,t)}function trt(n,t){n.uniform1iv(this.addr,t)}function irt(n,t){n.uniform2iv(this.addr,t)}function rrt(n,t){n.uniform3iv(this.addr,t)}function urt(n,t){n.uniform4iv(this.addr,t)}function frt(n,t){t=ke(t,this.size,2),n.uniform2fv(this.addr,t)}function ert(n,t){t=ke(t,this.size,3),n.uniform3fv(this.addr,t)}function ort(n,t){t=ke(t,this.size,4),n.uniform4fv(this.addr,t)}function srt(n,t){t=ke(t,this.size,4),n.uniformMatrix2fv(this.addr,!1,t)}function hrt(n,t){t=ke(t,this.size,9),n.uniformMatrix3fv(this.addr,!1,t)}function crt(n,t){t=ke(t,this.size,16),n.uniformMatrix4fv(this.addr,!1,t)}function lrt(n,t,i){var r=t.length,u=gk(i,r);for(n.uniform1iv(this.addr,u),n=0;n!==r;++n)i.safeSetTexture2D(t[n]||on,u[n])}function art(n,t,i){var r=t.length,u=gk(i,r);for(n.uniform1iv(this.addr,u),n=0;n!==r;++n)i.safeSetTextureCube(t[n]||sn,u[n])}function vrt(n){switch(n){case 5126:return nrt;case 35664:return frt;case 35665:return ert;case 35666:return ort;case 35674:return srt;case 35675:return hrt;case 35676:return crt;case 35678:return lrt;case 35680:return art;case 5124:case 35670:return trt;case 35667:case 35671:return irt;case 35668:case 35672:return rrt;case 35669:case 35673:return urt}}function yrt(n,t,i){this.id=n,this.addr=i,this.cache=[],this.setValue=git(t.type)}function nd(n,t,i){this.id=n,this.addr=i,this.cache=[],this.size=t.size,this.setValue=vrt(t.type)}function td(n){this.id=n,this.seq=[],this.map={}}function hu(n,t){var h,o;for(this.seq=[],this.map={},h=n.getProgramParameter(t,35718),o=0;o<h;++o){var i=n.getActiveUniform(t,o),c=n.getUniformLocation(t,i.name),r=this,e=i.name,l=e.length;for(oy.lastIndex=0;;){var s=oy.exec(e),a=oy.lastIndex,u=s[1],f=s[3];if("]"===s[2]&&(u|=0),void 0===f||"["===f&&a+2===l){e=r,i=void 0===f?new yrt(u,i,c):new nd(u,i,c),e.seq.push(i),e.map[i.id]=i;break}else f=r.map[u],void 0===f&&(f=new td(u),u=r,r=f,u.seq.push(r),u.map[r.id]=r),r=f}}}function id(n,t,i){return t=n.createShader(t),n.shaderSource(t,i),n.compileShader(t),t}function rd(n){switch(n){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw Error("unsupported encoding: "+n);}}function ud(n,t,i){var u=n.getShaderParameter(t,35713),r=n.getShaderInfoLog(t).trim();if(u&&""===r)return"";for(n=n.getShaderSource(t).split("\n"),t=0;t<n.length;t++)n[t]=t+1+": "+n[t];return n=n.join("\n"),"THREE.WebGLShader: gl.getShaderInfoLog() "+i+"\n"+r+n}function ua(n,t){return t=rd(t),"vec4 "+n+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function prt(n,t){return t=rd(t),"vec4 "+n+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function wrt(n,t){switch(t){case 1:t="Linear";break;case 2:t="Reinhard";break;case 3:t="Uncharted2";break;case 4:t="OptimizedCineon";break;case 5:t="ACESFilmic";break;default:throw Error("unsupported toneMapping: "+t);}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function brt(n,t,i){return n=n||{},[n.derivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(n.fragDepth||t.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",n.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(n.shaderTextureLOD||t.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(lh).join("\n")}function krt(n){var r=[],t,i;for(t in n)i=n[t],!1!==i&&r.push("#define "+t+" "+i);return r.join("\n")}function lh(n){return""!==n}function fd(n,t){return n.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function ed(n,t){return n.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function cp(n,t){if(n=y[t],void 0===n)throw Error("Can not resolve #include <"+t+">");return n.replace(kb,cp)}function od(n,t,i,r){for(n="",t=parseInt(t);t<parseInt(i);t++)n+=r.replace(/\[ i \]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return n}function sd(n){var t="precision "+n.precision+" float;\nprecision "+n.precision+" int;";return"highp"===n.precision?t+="\n#define HIGH_PRECISION":"mediump"===n.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===n.precision&&(t+="\n#define LOW_PRECISION"),t}function drt(n){var t="SHADOWMAP_TYPE_BASIC";return 1===n.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===n.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===n.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}function grt(n){var t="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:case 307:t="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:t="ENVMAP_TYPE_EQUIREC";break;case 305:t="ENVMAP_TYPE_SPHERE"}return t}function nut(n){var t="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case 302:case 304:t="ENVMAP_MODE_REFRACTION"}return t}function tut(n){var t="ENVMAP_BLENDING_MULTIPLY";if(n.envMap)switch(n.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}function iut(n,t,i,r,u,f){var e=n.getContext(),c=r.defines,s=u.vertexShader,o=u.fragmentShader,l=drt(f),a=grt(f),p=nut(f),k=tut(f),w=0<n.gammaFactor?n.gammaFactor:1,nt=f.isWebGL2?"":brt(r.extensions,f,t),b=krt(c),h=e.createProgram(),v=f.numMultiviewViews,d,g;return r.isRawShaderMaterial?(c=[b].filter(lh).join("\n"),0<c.length&&(c+="\n"),t=[nt,b].filter(lh).join("\n"),0<t.length&&(t+="\n")):(c=[sd(f),"#define SHADER_NAME "+u.name,b,f.instancing?"#define USE_INSTANCING":"",f.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+w,"#define MAX_BONES "+f.maxBones,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp2?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+p:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.normalMap&&f.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",f.normalMap&&f.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",f.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",f.displacementMap&&f.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.roughnessMap?"#define USE_ROUGHNESSMAP":"",f.metalnessMap?"#define USE_METALNESSMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexTangents?"#define USE_TANGENT":"",f.vertexColors?"#define USE_COLOR":"",f.vertexUvs?"#define USE_UV":"",f.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",f.flatShading?"#define FLAT_SHADED":"",f.skinning?"#define USE_SKINNING":"",f.useVertexTexture?"#define BONE_TEXTURE":"",f.morphTargets?"#define USE_MORPHTARGETS":"",f.morphNormals&&!1===f.flatShading?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+l:"",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&(f.isWebGL2||t.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;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#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(lh).join("\n"),t=[nt,sd(f),"#define SHADER_NAME "+u.name,b,f.alphaTest?"#define ALPHATEST "+f.alphaTest+(f.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+w,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp2?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.matcap?"#define USE_MATCAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+a:"",f.envMap?"#define "+p:"",f.envMap?"#define "+k:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.normalMap&&f.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",f.normalMap&&f.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",f.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.roughnessMap?"#define USE_ROUGHNESSMAP":"",f.metalnessMap?"#define USE_METALNESSMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.sheen?"#define USE_SHEEN":"",f.vertexTangents?"#define USE_TANGENT":"",f.vertexColors?"#define USE_COLOR":"",f.vertexUvs?"#define USE_UV":"",f.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",f.gradientMap?"#define USE_GRADIENTMAP":"",f.flatShading?"#define FLAT_SHADED":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+l:"",f.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",f.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&(f.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensions&&r.extensions.shaderTextureLOD||f.envMap)&&(f.isWebGL2||t.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==f.toneMapping?"#define TONE_MAPPING":"",0!==f.toneMapping?y.tonemapping_pars_fragment:"",0!==f.toneMapping?wrt("toneMapping",f.toneMapping):"",f.dithering?"#define DITHERING":"",f.outputEncoding||f.mapEncoding||f.matcapEncoding||f.envMapEncoding||f.emissiveMapEncoding?y.encodings_pars_fragment:"",f.mapEncoding?ua("mapTexelToLinear",f.mapEncoding):"",f.matcapEncoding?ua("matcapTexelToLinear",f.matcapEncoding):"",f.envMapEncoding?ua("envMapTexelToLinear",f.envMapEncoding):"",f.emissiveMapEncoding?ua("emissiveMapTexelToLinear",f.emissiveMapEncoding):"",f.outputEncoding?prt("linearToOutputTexel",f.outputEncoding):"",f.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(lh).join("\n")),s=s.replace(kb,cp),s=fd(s,f),s=ed(s,f),o=o.replace(kb,cp),o=fd(o,f),o=ed(o,f),s=s.replace(yn,od),o=o.replace(yn,od),f.isWebGL2&&!r.isRawShaderMaterial&&(l=!1,a=/^\s*#version\s+300\s+es\s*\n/,r.isShaderMaterial&&null!==s.match(a)&&null!==o.match(a)&&(l=!0,s=s.replace(a,""),o=o.replace(a,"")),c="#version 300 es\n\n#define attribute in\n#define varying out\n#define texture2D texture\n"+c,t=["#version 300 es\n\n#define varying in",l?"":"out highp vec4 pc_fragColor;",l?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+t,0<v&&(c=c.replace("#version 300 es\n",["#version 300 es\n\n#extension GL_OVR_multiview2 : require","layout(num_views = "+v+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n")),c=c.replace("uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;",["uniform mat4 modelViewMatrices["+v+"];","uniform mat4 projectionMatrices["+v+"];","uniform mat4 viewMatrices["+v+"];","uniform mat3 normalMatrices["+v+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]\n#define projectionMatrix projectionMatrices[VIEW_ID]\n#define viewMatrix viewMatrices[VIEW_ID]\n#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),t=t.replace("#version 300 es\n","#version 300 es\n\n#extension GL_OVR_multiview2 : require\n#define VIEW_ID gl_ViewID_OVR"),t=t.replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+v+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))),o=t+o,s=id(e,35633,c+s),o=id(e,35632,o),e.attachShader(h,s),e.attachShader(h,o),void 0!==r.index0AttributeName?e.bindAttribLocation(h,0,r.index0AttributeName):!0===f.morphTargets&&e.bindAttribLocation(h,0,"position"),e.linkProgram(h),n.debug.checkShaderErrors&&(n=e.getProgramInfoLog(h).trim(),f=e.getShaderInfoLog(s).trim(),l=e.getShaderInfoLog(o).trim(),p=a=!0,!1===e.getProgramParameter(h,35714)?(a=!1,k=ud(e,s,"vertex"),w=ud(e,o,"fragment"),console.error("THREE.WebGLProgram: shader error: ",e.getError(),"35715",e.getProgramParameter(h,35715),"gl.getProgramInfoLog",n,k,w)):""!==n?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",n):(""===f||""===l)&&(p=!1),p&&(this.diagnostics={runnable:a,material:r,programLog:n,vertexShader:{log:f,prefix:c},fragmentShader:{log:l,prefix:t}})),e.deleteShader(s),e.deleteShader(o),this.getUniforms=function(){return void 0===d&&(d=new hu(e,h)),d},this.getAttributes=function(){var t;if(void 0===g){for(var i={},r=e.getProgramParameter(h,35721),n=0;n<r;n++)t=e.getActiveAttrib(h,n).name,i[t]=e.getAttribLocation(h,t);g=i}return g},this.destroy=function(){e.deleteProgram(h),this.program=void 0},this.name=u.name,this.id=yft++,this.cacheKey=i,this.usedTimes=1,this.program=h,this.vertexShader=s,this.fragmentShader=o,this.numMultiviewViews=v,this}function rut(n,t,i){function u(n,t){if(n)n.isTexture?i=n.encoding:n.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=n.texture.encoding);else var i=3e3;return 3e3===i&&t&&(i=3007),i}var r=[],s=i.isWebGL2,h=i.logarithmicDepthBuffer,e=i.floatVertexTextures,f=i.precision,c=i.maxVertexUniforms,l=i.vertexTextures,a={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},o="precision isWebGL2 supportsVertexTextures outputEncoding instancing numMultiviewViews map mapEncoding matcap matcapEncoding envMap envMapMode envMapEncoding envMapCubeUV lightMap aoMap emissiveMap emissiveMapEncoding bumpMap normalMap objectSpaceNormalMap tangentSpaceNormalMap clearcoatNormalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors vertexTangents vertexUvs uvsVertexOnly fog useFog fogExp2 flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights numDirLightShadows numPointLightShadows numSpotLightShadows shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking dithering sheen".split(" ");this.getParameters=function(t,r,o,v,y,p,w){var d=a[t.type],b,k;return w.isSkinnedMesh?(b=w.skeleton.bones,e?b=1024:(k=Math.min(Math.floor((c-20)/4),b.length),k<b.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+b.length+" bones. This GPU supports "+k+"."),b=0):b=k)):b=0,null!==t.precision&&(f=i.getMaxPrecision(t.precision),f!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",f,"instead.")),k=n.getRenderTarget(),{isWebGL2:s,shaderID:d,precision:f,instancing:!0===w.isInstancedMesh,supportsVertexTextures:l,numMultiviewViews:k&&k.isWebGLMultiviewRenderTarget?k.numViews:0,outputEncoding:u(k?k.texture:null,n.gammaOutput),map:!!t.map,mapEncoding:u(t.map,n.gammaInput),matcap:!!t.matcap,matcapEncoding:u(t.matcap,n.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:u(t.envMap,n.gammaInput),envMapCubeUV:!!t.envMap&&(306===t.envMap.mapping||307===t.envMap.mapping),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:u(t.emissiveMap,n.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:1===t.normalMapType,tangentSpaceNormalMap:0===t.normalMapType,clearcoatNormalMap:!!t.clearcoatNormalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,sheen:!!t.sheen,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,vertexUvs:!!t.map||!!t.bumpMap||!!t.normalMap||!!t.specularMap||!!t.alphaMap||!!t.emissiveMap||!!t.roughnessMap||!!t.metalnessMap||!!t.clearcoatNormalMap||!!t.displacementMap,uvsVertexOnly:!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap)&&!!t.displacementMap,fog:!!v,useFog:t.fog,fogExp2:v&&v.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:h,skinning:t.skinning&&0<b,maxBones:b,useVertexTexture:e,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:n.maxMorphTargets,maxMorphNormals:n.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numDirLightShadows:r.directionalShadowMap.length,numPointLightShadows:r.pointShadowMap.length,numSpotLightShadows:r.spotShadowMap.length,numClippingPlanes:y,numClipIntersection:p,dithering:t.dithering,shadowMapEnabled:n.shadowMap.enabled&&0<o.length,shadowMapType:n.shadowMap.type,toneMapping:t.toneMapped?n.toneMapping:0,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:2===t.side,flipSided:1===t.side,depthPacking:void 0!==t.depthPacking?t.depthPacking:!1}},this.getProgramCacheKey=function(t,i){var r=[],u;if(i.shaderID?r.push(i.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(u in t.defines)r.push(u),r.push(t.defines[u]);for(u=0;u<o.length;u++)r.push(i[o[u]]);return r.push(t.onBeforeCompile.toString()),r.push(n.gammaOutput),r.push(n.gammaFactor),r.join()},this.acquireProgram=function(i,u,f,e){for(var o,h,s=0,c=r.length;s<c;s++)if(h=r[s],h.cacheKey===e){o=h,++o.usedTimes;break}return void 0===o&&(o=new iut(n,t,e,i,u,f),r.push(o)),o},this.releaseProgram=function(n){if(0==--n.usedTimes){var t=r.indexOf(n);r[t]=r[r.length-1],r.pop(),n.destroy()}},this.programs=r}function uut(){var n=new WeakMap;return{get:function(t){var i=n.get(t);return void 0===i&&(i={},n.set(t,i)),i},remove:function(t){n.delete(t)},update:function(t,i,r){n.get(t)[i]=r},dispose:function(){n=new WeakMap}}}function fut(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.program!==t.program?n.program.id-t.program.id:n.material.id!==t.material.id?n.material.id-t.material.id:n.z!==t.z?n.z-t.z:n.id-t.id}function eut(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.z!==t.z?t.z-n.z:n.id-t.id}function hd(){function r(n,t,r,e,o,s){var h=u[i];return void 0===h?(h={id:n.id,object:n,geometry:t,material:r,program:r.program||f,groupOrder:e,renderOrder:n.renderOrder,z:o,group:s},u[i]=h):(h.id=n.id,h.object=n,h.geometry=t,h.material=r,h.program=r.program||f,h.groupOrder=e,h.renderOrder=n.renderOrder,h.z=o,h.group=s),i++,h}var u=[],i=0,n=[],t=[],f={id:-1};return{opaque:n,transparent:t,init:function(){i=0,n.length=0,t.length=0},push:function(i,u,f,e,o,s){i=r(i,u,f,e,o,s),(!0===f.transparent?t:n).push(i)},unshift:function(i,u,f,e,o,s){i=r(i,u,f,e,o,s),(!0===f.transparent?t:n).unshift(i)},sort:function(){1<n.length&&n.sort(fut),1<t.length&&t.sort(eut)}}}function out(){function t(i){i=i.target,i.removeEventListener("dispose",t),n.delete(i)}var n=new WeakMap;return{get:function(i,r){var f=n.get(i),u;return void 0===f?(u=new hd,n.set(i,new WeakMap),n.get(i).set(r,u),i.addEventListener("dispose",t)):(u=f.get(r),void 0===u&&(u=new hd,f.set(r,u))),u},dispose:function(){n=new WeakMap}}}function sut(){var n={};return{get:function(r){if(void 0!==n[r.id])return n[r.id];switch(r.type){case"DirectionalLight":var u={direction:new t,color:new e,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"SpotLight":u={position:new t,direction:new t,color:new e,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"PointLight":u={position:new t,color:new e,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":u={direction:new t,skyColor:new e,groundColor:new e};break;case"RectAreaLight":u={color:new e,position:new t,halfWidth:new t,halfHeight:new t}}return n[r.id]=u}}}function hut(n,t){return(t.castShadow?1:0)-(n.castShadow?1:0)}function cut(){for(var i=new sut,n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},e=0;9>e;e++)n.probe.push(new t);var r=new t,f=new v,u=new v;return{setup:function(t,e,o){for(var rt,s,nt=0,tt=0,it=0,a=0;9>a;a++)n.probe[a].set(0,0,0);var v=e=0,y=0,p=0,w=0,b=0,k=0,d=0;for(o=o.matrixWorldInverse,t.sort(hut),a=0,rt=t.length;a<rt;a++){var h=t[a],g=h.color,c=h.intensity,ut=h.distance,l=h.shadow&&h.shadow.map?h.shadow.map.texture:null;if(h.isAmbientLight)nt+=g.r*c,tt+=g.g*c,it+=g.b*c;else if(h.isLightProbe)for(l=0;9>l;l++)n.probe[l].addScaledVector(h.sh.coefficients[l],c);else h.isDirectionalLight?(s=i.get(h),s.color.copy(h.color).multiplyScalar(h.intensity),s.direction.setFromMatrixPosition(h.matrixWorld),r.setFromMatrixPosition(h.target.matrixWorld),s.direction.sub(r),s.direction.transformDirection(o),(s.shadow=h.castShadow)&&(c=h.shadow,s.shadowBias=c.bias,s.shadowRadius=c.radius,s.shadowMapSize=c.mapSize,n.directionalShadowMap[e]=l,n.directionalShadowMatrix[e]=h.shadow.matrix,b++),n.directional[e]=s,e++):h.isSpotLight?(s=i.get(h),s.position.setFromMatrixPosition(h.matrixWorld),s.position.applyMatrix4(o),s.color.copy(g).multiplyScalar(c),s.distance=ut,s.direction.setFromMatrixPosition(h.matrixWorld),r.setFromMatrixPosition(h.target.matrixWorld),s.direction.sub(r),s.direction.transformDirection(o),s.coneCos=Math.cos(h.angle),s.penumbraCos=Math.cos(h.angle*(1-h.penumbra)),s.decay=h.decay,(s.shadow=h.castShadow)&&(c=h.shadow,s.shadowBias=c.bias,s.shadowRadius=c.radius,s.shadowMapSize=c.mapSize,n.spotShadowMap[y]=l,n.spotShadowMatrix[y]=h.shadow.matrix,d++),n.spot[y]=s,y++):h.isRectAreaLight?(s=i.get(h),s.color.copy(g).multiplyScalar(c),s.position.setFromMatrixPosition(h.matrixWorld),s.position.applyMatrix4(o),u.identity(),f.copy(h.matrixWorld),f.premultiply(o),u.extractRotation(f),s.halfWidth.set(.5*h.width,0,0),s.halfHeight.set(0,.5*h.height,0),s.halfWidth.applyMatrix4(u),s.halfHeight.applyMatrix4(u),n.rectArea[p]=s,p++):h.isPointLight?(s=i.get(h),s.position.setFromMatrixPosition(h.matrixWorld),s.position.applyMatrix4(o),s.color.copy(h.color).multiplyScalar(h.intensity),s.distance=h.distance,s.decay=h.decay,(s.shadow=h.castShadow)&&(c=h.shadow,s.shadowBias=c.bias,s.shadowRadius=c.radius,s.shadowMapSize=c.mapSize,s.shadowCameraNear=c.camera.near,s.shadowCameraFar=c.camera.far,n.pointShadowMap[v]=l,n.pointShadowMatrix[v]=h.shadow.matrix,k++),n.point[v]=s,v++):h.isHemisphereLight&&(s=i.get(h),s.direction.setFromMatrixPosition(h.matrixWorld),s.direction.transformDirection(o),s.direction.normalize(),s.skyColor.copy(h.color).multiplyScalar(c),s.groundColor.copy(h.groundColor).multiplyScalar(c),n.hemi[w]=s,w++)}n.ambient[0]=nt,n.ambient[1]=tt,n.ambient[2]=it,t=n.hash,(t.directionalLength!==e||t.pointLength!==v||t.spotLength!==y||t.rectAreaLength!==p||t.hemiLength!==w||t.numDirectionalShadows!==b||t.numPointShadows!==k||t.numSpotShadows!==d)&&(n.directional.length=e,n.spot.length=y,n.rectArea.length=p,n.point.length=v,n.hemi.length=w,n.directionalShadowMap.length=b,n.pointShadowMap.length=k,n.spotShadowMap.length=d,n.directionalShadowMatrix.length=b,n.pointShadowMatrix.length=k,n.spotShadowMatrix.length=d,t.directionalLength=e,t.pointLength=v,t.spotLength=y,t.rectAreaLength=p,t.hemiLength=w,t.numDirectionalShadows=b,t.numPointShadows=k,t.numSpotShadows=d,n.version=pft++)},state:n}}function cd(){var i=new cut,n=[],t=[];return{init:function(){n.length=0,t.length=0},state:{lightsArray:n,shadowsArray:t,lights:i},setupLights:function(r){i.setup(n,t,r)},pushLight:function(t){n.push(t)},pushShadow:function(n){t.push(n)}}}function lut(){function t(i){i=i.target,i.removeEventListener("dispose",t),n.delete(i)}var n=new WeakMap;return{get:function(i,r){if(!1===n.has(i)){var u=new cd;n.set(i,new WeakMap),n.get(i).set(r,u),i.addEventListener("dispose",t)}else!1===n.get(i).has(r)?(u=new cd,n.get(i).set(r,u)):u=n.get(i).get(r);return u},dispose:function(){n=new WeakMap}}}function cu(n){l.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.morphTargets=this.skinning=!1,this.displacementMap=this.alphaMap=this.map=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(n)}function lu(n){l.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new t,this.nearDistance=1,this.farDistance=1e3,this.morphTargets=this.skinning=!1,this.displacementMap=this.alphaMap=this.map=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(n)}function ld(n,t,r){function nt(n,t,i){i=n<<0|t<<1|i<<2;var r=k[i];return void 0===r&&(r=new cu({depthPacking:3201,morphTargets:n,skinning:t}),k[i]=r),r}function it(n,t,i){i=n<<0|t<<1|i<<2;var r=d[i];return void 0===r&&(r=new lu({morphTargets:n,skinning:t}),d[i]=r),r}function v(t,i,r,u,f,e){var o=t.geometry,h=nt,s=t.customDepthMaterial;return!0===r.isPointLight&&(h=it,s=t.customDistanceMaterial),void 0===s?(s=!1,!0===i.morphTargets&&(!0===o.isBufferGeometry?s=o.morphAttributes&&o.morphAttributes.position&&0<o.morphAttributes.position.length:!0===o.isGeometry&&(s=o.morphTargets&&0<o.morphTargets.length)),o=!1,!0===t.isSkinnedMesh&&(!0===i.skinning?o=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),t=h(s,o,!0===t.isInstancedMesh)):t=s,n.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length&&(s=t.uuid,h=i.uuid,o=g[s],void 0===o&&(o={},g[s]=o),s=o[h],void 0===s&&(s=t.clone(),o[h]=s),t=s),t.visible=i.visible,t.wireframe=i.wireframe,t.side=3===e?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:rt[i.side],t.clipShadows=i.clipShadows,t.clippingPlanes=i.clippingPlanes,t.clipIntersection=i.clipIntersection,t.wireframeLinewidth=i.wireframeLinewidth,t.linewidth=i.linewidth,!0===r.isPointLight&&!0===t.isMeshDistanceMaterial&&(t.referencePosition.setFromMatrixPosition(r.matrixWorld),t.nearDistance=u,t.farDistance=f),t}function y(i,r,u,f,e){var o,h,l,s;if(!1!==i.visible){if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&3===e)&&(!i.frustumCulled||w.intersectsObject(i)))if(i.modelViewMatrix.multiplyMatrices(u.matrixWorldInverse,i.matrixWorld),o=t.update(i),h=i.material,Array.isArray(h))for(var a=o.groups,c=0,p=a.length;c<p;c++)l=a[c],s=h[l.materialIndex],s&&s.visible&&(s=v(i,s,f,u.near,u.far,e),n.renderBufferDirect(u,null,o,s,i,l));else h.visible&&(s=v(i,h,f,u.near,u.far,e),n.renderBufferDirect(u,null,o,s,i,null));for(i=i.children,o=0,h=i.length;o<h;o++)y(i[o],r,u,f,e)}}var w=new hh,u=new i,e=new i,b=new p,k=[],d=[],g={},rt={0:1,1:0,2:2},o=new at({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:.125},uniforms:{shadow_pass:{value:null},resolution:{value:new i},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n  float mean = 0.0;\n  float squared_mean = 0.0;\n  \n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy  ) / resolution ) );\n  for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n    #ifdef HORIZONAL_PASS\n      vec2 distribution = decodeHalfRGBA ( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n      mean += distribution.x;\n      squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n    #else\n      float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0,  i )  * radius ) / resolution ) );\n      mean += depth;\n      squared_mean += depth * depth;\n    #endif\n  }\n  mean = mean * HALF_SAMPLE_RATE;\n  squared_mean = squared_mean * HALF_SAMPLE_RATE;\n  float std_dev = pow( squared_mean - mean * mean, 0.5 );\n  gl_FragColor = encodeHalfRGBA( vec2( mean, std_dev ) );\n}"}),s=o.clone(),a,l,h;s.defines.HORIZONAL_PASS=1,a=new f,a.setAttribute("position",new c(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3)),l=new tt(a,o),h=this,this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(i,f,c){var nt,tt,v,a,p,d,g;if(!1!==h.enabled&&(!1!==h.autoUpdate||!1!==h.needsUpdate)&&0!==i.length){var it=n.getRenderTarget(),rt=n.getActiveCubeFace(),ut=n.getActiveMipmapLevel(),k=n.state;for(k.setBlending(0),k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1),nt=0,tt=i.length;nt<tt;nt++)if(v=i[nt],a=v.shadow,void 0===a)console.warn("THREE.WebGLShadowMap:",v,"has no shadow.");else{for(u.copy(a.mapSize),p=a.getFrameExtents(),u.multiply(p),e.copy(a.mapSize),(u.x>r||u.y>r)&&(console.warn("THREE.WebGLShadowMap:",v,"has shadow exceeding max texture size, reducing"),u.x>r&&(e.x=Math.floor(r/p.x),u.x=e.x*p.x,a.mapSize.x=e.x),u.y>r&&(e.y=Math.floor(r/p.y),u.y=e.y*p.y,a.mapSize.y=e.y)),null!==a.map||a.isPointLightShadow||3!==this.type||(p={minFilter:1006,magFilter:1006,format:1023},a.map=new wt(u.x,u.y,p),a.map.texture.name=v.name+".shadowMap",a.mapPass=new wt(u.x,u.y,p),a.camera.updateProjectionMatrix()),null===a.map&&(p={minFilter:1003,magFilter:1003,format:1023},a.map=new wt(u.x,u.y,p),a.map.texture.name=v.name+".shadowMap",a.camera.updateProjectionMatrix()),n.setRenderTarget(a.map),n.clear(),p=a.getViewportCount(),d=0;d<p;d++)g=a.getViewport(d),b.set(e.x*g.x,e.y*g.y,e.x*g.z,e.y*g.w),k.viewport(b),a.updateMatrices(v,d),w=a.getFrustum(),y(f,c,a.camera,v,this.type);a.isPointLightShadow||3!==this.type||(v=a,a=c,p=t.update(l),o.uniforms.shadow_pass.value=v.map.texture,o.uniforms.resolution.value=v.mapSize,o.uniforms.radius.value=v.radius,n.setRenderTarget(v.mapPass),n.clear(),n.renderBufferDirect(a,null,p,o,l,null),s.uniforms.shadow_pass.value=v.mapPass.texture,s.uniforms.resolution.value=v.mapSize,s.uniforms.radius.value=v.radius,n.setRenderTarget(v.map),n.clear(),n.renderBufferDirect(a,null,p,s,l,null))}h.needsUpdate=!1,n.setRenderTarget(it,rt,ut)}}}function aut(n,t,i){function at(t,i,r){var f=new Uint8Array(4),u=n.createTexture();for(n.bindTexture(t,u),n.texParameteri(t,10241,9728),n.texParameteri(t,10240,9728),t=0;t<r;t++)n.texImage2D(i+t,0,6408,1,1,0,6408,5121,f);return u}function vt(i,r){y[i]=1,0===f[i]&&(n.enableVertexAttribArray(i),f[i]=1),bt[i]!==r&&((tt?n:t.get("ANGLE_instanced_arrays"))[tt?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),bt[i]=r)}function r(t){!0!==c[t]&&(n.enable(t),c[t]=!0)}function u(t){!1!==c[t]&&(n.disable(t),c[t]=!1)}function a(t,i,f,e,o,s,c,a){if(0===t)w&&(u(3042),w=!1);else if(w||(r(3042),w=!0),5!==t){if(t!==b||a!==ot){if((100!==k||100!==d)&&(n.blendEquation(32774),d=k=100),a)switch(t){case 1:n.blendFuncSeparate(1,771,1,771);break;case 2:n.blendFunc(1,1);break;case 3:n.blendFuncSeparate(0,0,769,771);break;case 4:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:n.blendFuncSeparate(770,771,1,771);break;case 2:n.blendFunc(770,1);break;case 3:n.blendFunc(0,769);break;case 4:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}et=ft=ut=rt=null,b=t,ot=a}}else o=o||i,s=s||f,c=c||e,(i!==k||o!==d)&&(n.blendEquationSeparate(h[i],h[o]),k=i,d=o),(f!==rt||e!==ut||s!==ft||c!==et)&&(n.blendFuncSeparate(l[f],l[e],l[s],l[c]),rt=f,ut=e,ft=s,et=c),b=t,ot=null}function nt(t){st!==t&&(t?n.frontFace(2304):n.frontFace(2305),st=t)}function yt(t){0!==t?(r(2884),t!==ht&&(1===t?n.cullFace(1029):2===t?n.cullFace(1028):n.cullFace(1032))):u(2884),ht=t}function pt(t,i,f){t?(r(32823),dt!==i||gt!==f)&&(n.polygonOffset(i,f),dt=i,gt=f):u(32823)}function wt(t){void 0===t&&(t=33984+ii-1),s!==t&&(n.activeTexture(t),s=t)}var tt=i.isWebGL2,v=new function(){var t=!1,i=new p,r=null,u=new p(0,0,0,0);return{setMask:function(i){r===i||t||(n.colorMask(i,i,i,i),r=i)},setLocked:function(n){t=n},setClear:function(t,r,f,e,o){!0===o&&(t*=e,r*=e,f*=e),i.set(t,r,f,e),!1===u.equals(i)&&(n.clearColor(t,r,f,e),u.copy(i))},reset:function(){t=!1,r=null,u.set(-1,0,0,0)}}},e=new function(){var t=!1,i=null,f=null,e=null;return{setTest:function(n){n?r(2929):u(2929)},setMask:function(r){i===r||t||(n.depthMask(r),i=r)},setFunc:function(t){if(f!==t){if(t)switch(t){case 0:n.depthFunc(512);break;case 1:n.depthFunc(519);break;case 2:n.depthFunc(513);break;case 3:n.depthFunc(515);break;case 4:n.depthFunc(514);break;case 5:n.depthFunc(518);break;case 6:n.depthFunc(516);break;case 7:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);f=t}},setLocked:function(n){t=n},setClear:function(t){e!==t&&(n.clearDepth(t),e=t)},reset:function(){t=!1,e=f=i=null}}},o=new function(){var t=!1,i=null,f=null,e=null,o=null,s=null,h=null,c=null,l=null;return{setTest:function(n){t||(n?r(2960):u(2960))},setMask:function(r){i===r||t||(n.stencilMask(r),i=r)},setFunc:function(t,i,r){(f!==t||e!==i||o!==r)&&(n.stencilFunc(t,i,r),f=t,e=i,o=r)},setOp:function(t,i,r){(s!==t||h!==i||c!==r)&&(n.stencilOp(t,i,r),s=t,h=i,c=r)},setLocked:function(n){t=n},setClear:function(t){l!==t&&(n.clearStencil(t),l=t)},reset:function(){t=!1,l=c=h=s=o=e=f=i=null}}},h,l;i=n.getParameter(34921);var y=new Uint8Array(i),f=new Uint8Array(i),bt=new Uint8Array(i),c={},it=null,w=null,b=null,k=null,rt=null,ut=null,d=null,ft=null,et=null,ot=!1,st=null,ht=null,kt=null,dt=null,gt=null,ii=n.getParameter(35661),ct=!1;i=0,i=n.getParameter(7938),-1!==i.indexOf("WebGL")?(i=parseFloat(/^WebGL ([0-9])/.exec(i)[1]),ct=1<=i):-1!==i.indexOf("OpenGL ES")&&(i=parseFloat(/^OpenGL ES ([0-9])/.exec(i)[1]),ct=2<=i);var s=null,g={},ni=new p,ti=new p,lt={};return lt[3553]=at(3553,3553,1),lt[34067]=at(34067,34069,6),v.setClear(0,0,0,1),e.setClear(1),o.setClear(0),r(2929),e.setFunc(3),nt(!1),yt(1),r(2884),a(0),h={100:32774,101:32778,102:32779},tt?(h[103]=32775,h[104]=32776):(i=t.get("EXT_blend_minmax"),null!==i&&(h[103]=i.MIN_EXT,h[104]=i.MIN_EXT)),l={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773},{buffers:{color:v,depth:e,stencil:o},initAttributes:function(){for(var n=0,t=y.length;n<t;n++)y[n]=0},enableAttribute:function(n){vt(n,0)},enableAttributeAndDivisor:vt,disableUnusedAttributes:function(){for(var t=0,i=f.length;t!==i;++t)f[t]!==y[t]&&(n.disableVertexAttribArray(t),f[t]=0)},enable:r,disable:u,useProgram:function(t){return it!==t?(n.useProgram(t),it=t,!0):!1},setBlending:a,setMaterial:function(n,t){2===n.side?u(2884):r(2884);var i=1===n.side;t&&(i=!i),nt(i),1===n.blending&&!1===n.transparent?a(0):a(n.blending,n.blendEquation,n.blendSrc,n.blendDst,n.blendEquationAlpha,n.blendSrcAlpha,n.blendDstAlpha,n.premultipliedAlpha),e.setFunc(n.depthFunc),e.setTest(n.depthTest),e.setMask(n.depthWrite),v.setMask(n.colorWrite),t=n.stencilWrite,o.setTest(t),t&&(o.setMask(n.stencilWriteMask),o.setFunc(n.stencilFunc,n.stencilRef,n.stencilFuncMask),o.setOp(n.stencilFail,n.stencilZFail,n.stencilZPass)),pt(n.polygonOffset,n.polygonOffsetFactor,n.polygonOffsetUnits)},setFlipSided:nt,setCullFace:yt,setLineWidth:function(t){t!==kt&&(ct&&n.lineWidth(t),kt=t)},setPolygonOffset:pt,setScissorTest:function(n){n?r(3089):u(3089)},activeTexture:wt,bindTexture:function(t,i){null===s&&wt();var r=g[s];void 0===r&&(r={type:void 0,texture:void 0},g[s]=r),(r.type!==t||r.texture!==i)&&(n.bindTexture(t,i||lt[t]),r.type=t,r.texture=i)},unbindTexture:function(){var t=g[s];void 0!==t&&void 0!==t.type&&(n.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{n.compressedTexImage2D.apply(n,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{n.texImage2D.apply(n,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{n.texImage3D.apply(n,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===ni.equals(t)&&(n.scissor(t.x,t.y,t.z,t.w),ni.copy(t))},viewport:function(t){!1===ti.equals(t)&&(n.viewport(t.x,t.y,t.z,t.w),ti.copy(t))},reset:function(){for(var t=0;t<f.length;t++)1===f[t]&&(n.disableVertexAttribArray(t),f[t]=0);c={},s=null,g={},ht=st=b=it=null,v.reset(),e.reset(),o.reset()}}}function vut(n,t,i,r,u,f,e){function tt(n,t){return bt?new OffscreenCanvas(n,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function it(n,t,i,r){var u=1;if((n.width>r||n.height>r)&&(u=r/Math.max(n.width,n.height)),1>u||!0===t){if("undefined"!=typeof HTMLImageElement&&n instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&n instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&n instanceof ImageBitmap)return r=t?a.floorPowerOfTwo:Math.floor,t=r(u*n.width),u=r(u*n.height),void 0===d&&(d=tt(t,u)),i=i?tt(t,u):d,i.width=t,i.height=u,i.getContext("2d").drawImage(n,0,0,t,u),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+n.width+"x"+n.height+") to ("+t+"x"+u+")."),i;"data"in n&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+n.width+"x"+n.height+").")}return n}function s(n){return a.isPowerOfTwo(n.width)&&a.isPowerOfTwo(n.height)}function h(n,t){return n.generateMipmaps&&t&&1003!==n.minFilter&&1006!==n.minFilter}function c(t,i,u,f){n.generateMipmap(t),r.get(i).__maxMipLevel=Math.log(Math.max(u,f))*Math.LOG2E}function l(n,i){if(!1===o)return n;var r=n;return 6403===n&&(5126===i&&(r=33326),5131===i&&(r=33325),5121===i&&(r=33321)),6407===n&&(5126===i&&(r=34837),5131===i&&(r=34843),5121===i&&(r=32849)),6408===n&&(5126===i&&(r=34836),5131===i&&(r=34842),5121===i&&(r=32856)),33325===r||33326===r||34842===r||34836===r?t.get("EXT_color_buffer_float"):(34843===r||34837===r)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),r}function rt(n){return 1003===n||1004===n||1005===n?9728:9729}function ut(t){t=t.target,t.removeEventListener("dispose",ut);var i=r.get(t);void 0!==i.__webglInit&&(n.deleteTexture(i.__webglTexture),r.remove(t)),t.isVideoTexture&&k.delete(t),e.memory.textures--}function ft(t){var u,i,f;if(t=t.target,t.removeEventListener("dispose",ft),u=r.get(t),i=r.get(t.texture),t){if(void 0!==i.__webglTexture&&n.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(i=0;6>i;i++)n.deleteFramebuffer(u.__webglFramebuffer[i]),u.__webglDepthbuffer&&n.deleteRenderbuffer(u.__webglDepthbuffer[i]);else n.deleteFramebuffer(u.__webglFramebuffer),u.__webglDepthbuffer&&n.deleteRenderbuffer(u.__webglDepthbuffer);if(t.isWebGLMultiviewRenderTarget)for(n.deleteTexture(u.__webglColorTexture),n.deleteTexture(u.__webglDepthStencilTexture),e.memory.textures-=2,i=0,f=u.__webglViewFramebuffers.length;i<f;i++)n.deleteFramebuffer(u.__webglViewFramebuffers[i]);r.remove(t.texture),r.remove(t)}e.memory.textures--}function p(n,t){var f=r.get(n),u;if(n.isVideoTexture&&(u=e.render.frame,k.get(n)!==u&&(k.set(n,u),n.update())),0<n.version&&f.__version!==n.version)if(u=n.image,void 0===u)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(!1===u.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{w(f,n,t);return}i.activeTexture(33984+t),i.bindTexture(3553,f.__webglTexture)}function et(t,u){var w,a,b,e,p,y;if(6===t.image.length)if(w=r.get(t),0<t.version&&w.__version!==t.version){for(st(w,t),i.activeTexture(33984+u),i.bindTexture(34067,w.__webglTexture),n.pixelStorei(37440,t.flipY),a=t&&t.isCompressedTexture,u=t.image[0]&&t.image[0].isDataTexture,b=[],e=0;6>e;e++)b[e]=a||u?u?t.image[e].image:t.image[e]:it(t.image[e],!1,!0,yt);var nt=b[0],tt=s(nt)||o,k=f.convert(t.format),d=f.convert(t.type),g=l(k,d);if(v(34067,t,tt),a){for(e=0;6>e;e++)for(p=b[e].mipmaps,a=0;a<p.length;a++)y=p[a],1023!==t.format&&1022!==t.format?null!==k?i.compressedTexImage2D(34069+e,a,g,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(34069+e,a,g,y.width,y.height,0,k,d,y.data);w.__maxMipLevel=p.length-1}else{for(p=t.mipmaps,e=0;6>e;e++)if(u)for(i.texImage2D(34069+e,0,g,b[e].width,b[e].height,0,k,d,b[e].data),a=0;a<p.length;a++)y=p[a],y=y.image[e].image,i.texImage2D(34069+e,a+1,g,y.width,y.height,0,k,d,y.data);else for(i.texImage2D(34069+e,0,g,k,d,b[e]),a=0;a<p.length;a++)y=p[a],i.texImage2D(34069+e,a+1,g,k,d,y.image[e]);w.__maxMipLevel=p.length}if(h(t,tt)&&c(34067,t,nt.width,nt.height),w.__version=t.version,t.onUpdate)t.onUpdate(t)}else i.activeTexture(33984+u),i.bindTexture(34067,w.__webglTexture)}function ot(n,t){i.activeTexture(33984+t),i.bindTexture(34067,r.get(n).__webglTexture)}function v(i,f,e){e?(n.texParameteri(i,10242,nt[f.wrapS]),n.texParameteri(i,10243,nt[f.wrapT]),32879!==i&&35866!==i||n.texParameteri(i,32882,nt[f.wrapR]),n.texParameteri(i,10240,lt[f.magFilter]),n.texParameteri(i,10241,lt[f.minFilter])):(n.texParameteri(i,10242,33071),n.texParameteri(i,10243,33071),32879!==i&&35866!==i||n.texParameteri(i,32882,33071),1001===f.wrapS&&1001===f.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(i,10240,rt(f.magFilter)),n.texParameteri(i,10241,rt(f.minFilter)),1003!==f.minFilter&&1006!==f.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),(e=t.get("EXT_texture_filter_anisotropic"))&&(1015!==f.type||null!==t.get("OES_texture_float_linear"))&&(1016!==f.type||null!==(o||t.get("OES_texture_half_float_linear")))&&(1<f.anisotropy||r.get(f).__currentAnisotropy)&&(n.texParameterf(i,e.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(f.anisotropy,u.getMaxAnisotropy())),r.get(f).__currentAnisotropy=f.anisotropy)}function st(t,i){void 0===t.__webglInit&&(t.__webglInit=!0,i.addEventListener("dispose",ut),t.__webglTexture=n.createTexture(),e.memory.textures++)}function w(t,r,u){var e=3553,p,a,k;r.isDataTexture2DArray&&(e=35866),r.isDataTexture3D&&(e=32879),st(t,r),i.activeTexture(33984+u),i.bindTexture(e,t.__webglTexture),n.pixelStorei(37440,r.flipY),n.pixelStorei(37441,r.premultiplyAlpha),n.pixelStorei(3317,r.unpackAlignment),u=o?!1:1001!==r.wrapS||1001!==r.wrapT||1003!==r.minFilter&&1006!==r.minFilter,u=u&&!1===s(r.image),u=it(r.image,u,!1,pt);var d=s(u)||o,b=f.convert(r.format),w=f.convert(r.type),y=l(b,w);if(v(e,r,d),p=r.mipmaps,r.isDepthTexture){if(y=6402,1015===r.type){if(!1===o)throw Error("Float Depth Texture only supported in WebGL2.0");y=36012}else o&&(y=33189);1026===r.format&&6402===y&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,w=f.convert(r.type)),1027===r.format&&(y=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,w=f.convert(r.type))),i.texImage2D(3553,0,y,u.width,u.height,0,b,w,null)}else if(r.isDataTexture)if(0<p.length&&d){for(a=0,k=p.length;a<k;a++)e=p[a],i.texImage2D(3553,a,y,e.width,e.height,0,b,w,e.data);r.generateMipmaps=!1,t.__maxMipLevel=p.length-1}else i.texImage2D(3553,0,y,u.width,u.height,0,b,w,u.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(a=0,k=p.length;a<k;a++)e=p[a],1023!==r.format&&1022!==r.format?null!==b?i.compressedTexImage2D(3553,a,y,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(3553,a,y,e.width,e.height,0,b,w,e.data);t.__maxMipLevel=p.length-1}else if(r.isDataTexture2DArray)i.texImage3D(35866,0,y,u.width,u.height,u.depth,0,b,w,u.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)i.texImage3D(32879,0,y,u.width,u.height,u.depth,0,b,w,u.data),t.__maxMipLevel=0;else if(0<p.length&&d){for(a=0,k=p.length;a<k;a++)e=p[a],i.texImage2D(3553,a,y,b,w,e);r.generateMipmaps=!1,t.__maxMipLevel=p.length-1}else i.texImage2D(3553,0,y,b,w,u),t.__maxMipLevel=0;if(h(r,d)&&c(3553,r,u.width,u.height),t.__version=r.version,r.onUpdate)r.onUpdate(r)}function ht(t,u,e,o){var s=f.convert(u.texture.format),h=f.convert(u.texture.type),c=l(s,h);i.texImage2D(o,0,c,u.width,u.height,0,s,h,null),n.bindFramebuffer(36160,t),n.framebufferTexture2D(36160,e,o,r.get(u.texture).__webglTexture,0),n.bindFramebuffer(36160,null)}function b(t,i,r){if(n.bindRenderbuffer(36161,t),i.depthBuffer&&!i.stencilBuffer)r?(r=y(i),n.renderbufferStorageMultisample(36161,r,33189,i.width,i.height)):n.renderbufferStorage(36161,33189,i.width,i.height),n.framebufferRenderbuffer(36160,36096,36161,t);else if(i.depthBuffer&&i.stencilBuffer)r?(r=y(i),n.renderbufferStorageMultisample(36161,r,35056,i.width,i.height)):n.renderbufferStorage(36161,34041,i.width,i.height),n.framebufferRenderbuffer(36160,33306,36161,t);else{t=f.convert(i.texture.format);var u=f.convert(i.texture.type);t=l(t,u),r?(r=y(i),n.renderbufferStorageMultisample(36161,r,t,i.width,i.height)):n.renderbufferStorage(36161,t,i.width,i.height)}n.bindRenderbuffer(36161,null)}function y(n){return o&&n.isWebGLMultisampleRenderTarget?Math.min(wt,n.samples):0}var o=u.isWebGL2,ct=u.maxTextures,yt=u.maxCubemapSize,pt=u.maxTextureSize,wt=u.maxSamples,k=new WeakMap,d,bt="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d"),g=0,nt={1e3:10497,1001:33071,1002:33648},lt={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987},at=!1,vt=!1;this.allocateTextureUnit=function(){var n=g;return n>=ct&&console.warn("THREE.WebGLTextures: Trying to use "+n+" texture units while this GPU supports only "+ct),g+=1,n},this.resetTextureUnits=function(){g=0},this.setTexture2D=p,this.setTexture2DArray=function(n,t){var u=r.get(n);0<n.version&&u.__version!==n.version?w(u,n,t):(i.activeTexture(33984+t),i.bindTexture(35866,u.__webglTexture))},this.setTexture3D=function(n,t){var u=r.get(n);0<n.version&&u.__version!==n.version?w(u,n,t):(i.activeTexture(33984+t),i.bindTexture(32879,u.__webglTexture))},this.setTextureCube=et,this.setTextureCubeDynamic=ot,this.setupRenderTarget=function(u){var a=r.get(u),k=r.get(u.texture),w,g,nt,rt,it;u.addEventListener("dispose",ft),k.__webglTexture=n.createTexture(),e.memory.textures++;var ut=!0===u.isWebGLRenderTargetCube,d=!0===u.isWebGLMultisampleRenderTarget,et=!0===u.isWebGLMultiviewRenderTarget,tt=s(u)||o;if(ut)for(a.__webglFramebuffer=[],w=0;6>w;w++)a.__webglFramebuffer[w]=n.createFramebuffer();else if(a.__webglFramebuffer=n.createFramebuffer(),d)o?(a.__webglMultisampledFramebuffer=n.createFramebuffer(),a.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,a.__webglColorRenderbuffer),d=f.convert(u.texture.format),g=f.convert(u.texture.type),d=l(d,g),g=y(u),n.renderbufferStorageMultisample(36161,g,d,u.width,u.height),n.bindFramebuffer(36160,a.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,a.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),u.depthBuffer&&(a.__webglDepthRenderbuffer=n.createRenderbuffer(),b(a.__webglDepthRenderbuffer,u,!0)),n.bindFramebuffer(36160,null)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(et){for(w=u.width,nt=u.height,d=u.numViews,n.bindFramebuffer(36160,a.__webglFramebuffer),rt=t.get("OVR_multiview2"),e.memory.textures+=2,g=n.createTexture(),n.bindTexture(35866,g),n.texParameteri(35866,10240,9728),n.texParameteri(35866,10241,9728),n.texImage3D(35866,0,32856,w,nt,d,0,6408,5121,null),rt.framebufferTextureMultiviewOVR(36160,36064,g,0,0,d),it=n.createTexture(),n.bindTexture(35866,it),n.texParameteri(35866,10240,9728),n.texParameteri(35866,10241,9728),n.texImage3D(35866,0,35056,w,nt,d,0,34041,34042,null),rt.framebufferTextureMultiviewOVR(36160,33306,it,0,0,d),nt=Array(d),w=0;w<d;++w)nt[w]=n.createFramebuffer(),n.bindFramebuffer(36160,nt[w]),n.framebufferTextureLayer(36160,36064,g,0,w);a.__webglColorTexture=g,a.__webglDepthStencilTexture=it,a.__webglViewFramebuffers=nt,n.bindFramebuffer(36160,null),n.bindTexture(35866,null)}if(ut){for(i.bindTexture(34067,k.__webglTexture),v(34067,u.texture,tt),w=0;6>w;w++)ht(a.__webglFramebuffer[w],u,36064,34069+w);h(u.texture,tt)&&c(34067,u.texture,u.width,u.height),i.bindTexture(34067,null)}else et||(i.bindTexture(3553,k.__webglTexture),v(3553,u.texture,tt),ht(a.__webglFramebuffer,u,36064,3553),h(u.texture,tt)&&c(3553,u.texture,u.width,u.height),i.bindTexture(3553,null));if(u.depthBuffer){if(a=r.get(u),k=!0===u.isWebGLRenderTargetCube,u.depthTexture){if(k)throw Error("target.depthTexture not supported in Cube render targets");if(u&&u.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,a.__webglFramebuffer),!u.depthTexture||!u.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(r.get(u.depthTexture).__webglTexture&&u.depthTexture.image.width===u.width&&u.depthTexture.image.height===u.height||(u.depthTexture.image.width=u.width,u.depthTexture.image.height=u.height,u.depthTexture.needsUpdate=!0),p(u.depthTexture,0),a=r.get(u.depthTexture).__webglTexture,1026===u.depthTexture.format)n.framebufferTexture2D(36160,36096,3553,a,0);else if(1027===u.depthTexture.format)n.framebufferTexture2D(36160,33306,3553,a,0);else throw Error("Unknown depthTexture format");}else if(k)for(a.__webglDepthbuffer=[],k=0;6>k;k++)n.bindFramebuffer(36160,a.__webglFramebuffer[k]),a.__webglDepthbuffer[k]=n.createRenderbuffer(),b(a.__webglDepthbuffer[k],u);else n.bindFramebuffer(36160,a.__webglFramebuffer),a.__webglDepthbuffer=n.createRenderbuffer(),b(a.__webglDepthbuffer,u);n.bindFramebuffer(36160,null)}},this.updateRenderTargetMipmap=function(n){var u=n.texture,t=s(n)||o,f;h(u,t)&&(t=n.isWebGLRenderTargetCube?34067:3553,f=r.get(u).__webglTexture,i.bindTexture(t,f),c(t,u,n.width,n.height),i.bindTexture(t,null))},this.updateMultisampleRenderTarget=function(t){var i,f,u;t.isWebGLMultisampleRenderTarget&&(o?(i=r.get(t),n.bindFramebuffer(36008,i.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,i.__webglFramebuffer),i=t.width,f=t.height,u=16384,t.depthBuffer&&(u|=256),t.stencilBuffer&&(u|=1024),n.blitFramebuffer(0,0,i,f,0,0,i,f,u,9728)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."))},this.safeSetTexture2D=function(n,t){n&&n.isWebGLRenderTarget&&(!1===at&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),at=!0),n=n.texture),p(n,t)},this.safeSetTextureCube=function(n,t){n&&n.isWebGLRenderTargetCube&&(!1===vt&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),vt=!0),n=n.texture),n&&n.isCubeTexture||Array.isArray(n.image)&&6===n.image.length?et(n,t):ot(n,t)}}function ad(n,t,i){var r=i.isWebGL2;return{convert:function(n){if(1009===n)return 5121;if(1017===n)return 32819;if(1018===n)return 32820;if(1019===n)return 33635;if(1010===n)return 5120;if(1011===n)return 5122;if(1012===n)return 5123;if(1013===n)return 5124;if(1014===n)return 5125;if(1015===n)return 5126;if(1016===n){if(r)return 5131;var i=t.get("OES_texture_half_float");return null!==i?i.HALF_FLOAT_OES:null}if(1021===n)return 6406;if(1022===n)return 6407;if(1023===n)return 6408;if(1024===n)return 6409;if(1025===n)return 6410;if(1026===n)return 6402;if(1027===n)return 34041;if(1028===n)return 6403;if(33776===n||33777===n||33778===n||33779===n)if(i=t.get("WEBGL_compressed_texture_s3tc"),null!==i){if(33776===n)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(35840===n||35841===n||35842===n||35843===n)if(i=t.get("WEBGL_compressed_texture_pvrtc"),null!==i){if(35840===n)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;return 36196===n?(i=t.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null):37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n?(i=t.get("WEBGL_compressed_texture_astc"),null!==i?n:null):1020===n?r?34042:(i=t.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function lp(n,t,i,r){wt.call(this,n,t,r),this.stencilBuffer=this.depthBuffer=!1,this.numViews=i}function yut(n,t){function s(n){return n.isArrayCamera?n.cameras:(h[0]=n,h)}function a(n){if(void 0===n.isArrayCamera)return!0;if(n=n.cameras,n.length>l)return!1;for(var t=1,i=n.length;t<i;t++)if(n[0].viewport.z!==n[t].viewport.z||n[0].viewport.w!==n[t].viewport.w)return!1;return!0}var y=n.extensions,p=n.properties,u,e,o,r,h,f,c,l=0;this.isAvailable=function(){if(void 0===c){var n=y.get("OVR_multiview2");if(c=null!==n&&!1===t.getContextAttributes().antialias)for(l=t.getParameter(n.MAX_VIEWS_OVR),u=new lp(0,0,2),f=new i,r=[],o=[],h=[],n=0;n<l;n++)r[n]=new v,o[n]=new ft}return c},this.attachCamera=function(t){if(!1!==a(t)){if((e=n.getRenderTarget())?f.set(e.width,e.height):n.getDrawingBufferSize(f),t.isArrayCamera){var i=t.cameras[0].viewport;u.setSize(i.z,i.w),u.setNumViews(t.cameras.length)}else u.setSize(f.x,f.y),u.setNumViews(2);n.setRenderTarget(u)}},this.detachCamera=function(i){var s;if(u===n.getRenderTarget()){n.setRenderTarget(e);var r=u,v=r.numViews,h=p.get(r).__webglViewFramebuffers,c=r.width;if(r=r.height,i.isArrayCamera)for(s=0;s<v;s++){var o=i.cameras[s].viewport,l=o.x,a=o.y,y=l+o.z;o=a+o.w,t.bindFramebuffer(36008,h[s]),t.blitFramebuffer(0,0,c,r,l,a,y,o,16384,9728)}else t.bindFramebuffer(36008,h[0]),t.blitFramebuffer(0,0,c,r,0,0,f.x,f.y,16384,9728)}},this.updateCameraProjectionMatricesUniform=function(n,i){n=s(n);for(var u=0;u<n.length;u++)r[u].copy(n[u].projectionMatrix);i.setValue(t,"projectionMatrices",r)},this.updateCameraViewMatricesUniform=function(n,i){n=s(n);for(var u=0;u<n.length;u++)r[u].copy(n[u].matrixWorldInverse);i.setValue(t,"viewMatrices",r)},this.updateObjectMatricesUniforms=function(n,i,u){i=s(i);for(var f=0;f<i.length;f++)r[f].multiplyMatrices(i[f].matrixWorldInverse,n.matrixWorld),o[f].getNormalMatrix(r[f]);u.setValue(t,"modelViewMatrices",r),u.setValue(t,"normalMatrices",o)}}function de(){u.call(this),this.type="Group"}function ah(n){it.call(this),this.cameras=n||[]}function vd(n,t,i){db.setFromMatrixPosition(t.matrixWorld),gb.setFromMatrixPosition(i.matrixWorld);var s=db.distanceTo(gb),r=t.projectionMatrix.elements,o=i.projectionMatrix.elements,u=r[14]/(r[10]-1);i=r[14]/(r[10]+1);var h=(r[9]+1)/r[5],c=(r[9]-1)/r[5],f=(r[8]-1)/r[0],e=(o[8]+1)/o[0];r=u*f,o=u*e,e=s/(-f+e),f=e*-f,t.matrixWorld.decompose(n.position,n.quaternion,n.scale),n.translateX(f),n.translateZ(e),n.matrixWorld.compose(n.position,n.quaternion,n.scale),n.matrixWorldInverse.getInverse(n.matrixWorld),t=u+e,u=i+e,n.projectionMatrix.makePerspective(r-f,o+(s-f),h*i/u*t,c*i/u*t,t,u)}function ap(n){function a(){return null!==f&&!0===f.isPresenting}function et(){if(a()){var t=f.getEyeParameters("left");e=2*t.renderWidth*rt,h=t.renderHeight*rt,st=n.getPixelRatio(),n.getSize(d),n.setDrawingBufferSize(e,h,1),u.viewport.set(0,0,e/2,h),r.viewport.set(e/2,0,e/2,h),l.start(),g.dispatchEvent({type:"sessionstart"})}else g.enabled&&n.setDrawingBufferSize(d.width,d.height,st),l.stop(),g.dispatchEvent({type:"sessionend"})}function ot(n,t){null!==t&&4===t.length&&n.set(t[0]*e,t[1]*h,t[2]*e,t[3]*h)}var e,h,g=this,f=null,o=null,nt=null,w=[],s=new v,tt=new v,rt=1,b="local-floor",r,y,d,st,c,l;"undefined"!=typeof window&&"VRFrameData"in window&&(o=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",et,!1));var ut=new v,k=new lt,ft=new t,u=new it;u.viewport=new p,u.layers.enable(1),r=new it,r.viewport=new p,r.layers.enable(2),y=new ah([u,r]),y.layers.enable(1),y.layers.enable(2),d=new i,c=[],this.enabled=!1,this.getController=function(n){var t=w[n];return void 0===t&&(t=new de,t.matrixAutoUpdate=!1,t.visible=!1,w[n]=t),t},this.getDevice=function(){return f},this.setDevice=function(n){void 0!==n&&(f=n),l.setContext(n)},this.setFramebufferScaleFactor=function(n){rt=n},this.setReferenceSpaceType=function(n){b=n},this.setPoseTarget=function(n){void 0!==n&&(nt=n)},this.getCamera=function(n){var t="local-floor"===b?1.6:0,i,h,l;if(!1===a())return n.position.set(0,t,0),n.rotation.set(0,0,0),n;f.depthNear=n.near,f.depthFar=n.far,f.getFrameData(o),"local-floor"===b&&(i=f.stageParameters,i?s.fromArray(i.sittingToStandingTransform):s.makeTranslation(0,t,0)),t=o.pose,i=null!==nt?nt:n,i.matrix.copy(s),i.matrix.decompose(i.position,i.quaternion,i.scale),null!==t.orientation&&(k.fromArray(t.orientation),i.quaternion.multiply(k)),null!==t.position&&(k.setFromRotationMatrix(s),ft.fromArray(t.position),ft.applyQuaternion(k),i.position.add(ft)),i.updateMatrixWorld(),u.near=n.near,r.near=n.near,u.far=n.far,r.far=n.far,u.matrixWorldInverse.fromArray(o.leftViewMatrix),r.matrixWorldInverse.fromArray(o.rightViewMatrix),tt.getInverse(s),"local-floor"===b&&(u.matrixWorldInverse.multiply(tt),r.matrixWorldInverse.multiply(tt)),n=i.parent,null!==n&&(ut.getInverse(n.matrixWorld),u.matrixWorldInverse.multiply(ut),r.matrixWorldInverse.multiply(ut)),u.matrixWorld.getInverse(u.matrixWorldInverse),r.matrixWorld.getInverse(r.matrixWorldInverse),u.projectionMatrix.fromArray(o.leftProjectionMatrix),r.projectionMatrix.fromArray(o.rightProjectionMatrix),vd(y,u,r),n=f.getLayers(),n.length&&(n=n[0],ot(u.viewport,n.leftBounds),ot(r.viewport,n.rightBounds));n:for(n=0;n<w.length;n++){t=w[n];t:{i=n;for(var e=navigator.getGamepads&&navigator.getGamepads(),v=0,p=e.length;v<p;v++)if(h=e[v],h&&("Daydream Controller"===h.id||"Gear VR Controller"===h.id||"Oculus Go Controller"===h.id||"OpenVR Gamepad"===h.id||h.id.startsWith("Oculus Touch")||h.id.startsWith("HTC Vive Focus")||h.id.startsWith("Spatial Controller"))&&(l=h.hand,0===i&&(""===l||"right"===l)||1===i&&"left"===l)){i=h;break t}i=void 0}if(void 0!==i&&void 0!==i.pose){if(null===i.pose)break n;e=i.pose,!1===e.hasPosition&&t.position.set(.2,-.6,-.05),null!==e.position&&t.position.fromArray(e.position),null!==e.orientation&&t.quaternion.fromArray(e.orientation),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrix.premultiply(s),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixWorldNeedsUpdate=!0,t.visible=!0,e="Daydream Controller"===i.id?0:1,void 0===c[n]&&(c[n]=!1),c[n]!==i.buttons[e].pressed&&(c[n]=i.buttons[e].pressed,!0===c[n]?t.dispatchEvent({type:"selectstart"}):(t.dispatchEvent({type:"selectend"}),t.dispatchEvent({type:"select"})))}else t.visible=!1}return y},this.getStandingMatrix=function(){return s},this.isPresenting=a,l=new hp,this.setAnimationLoop=function(n){l.setAnimationLoop(n),a()&&l.start()},this.submitFrame=function(){a()&&f.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",et)},this.setFrameOfReferenceType=function(){console.warn("THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}function yd(n,t){function y(){return null!==i&&null!==o}function c(n){for(var t=0;t<u.length;t++)a[t]===n.inputSource&&u[t].dispatchEvent({type:n.type})}function g(){n.setFramebuffer(null),n.setRenderTarget(n.getRenderTarget()),e.stop(),k.dispatchEvent({type:"sessionend"})}function nt(n){o=n,e.setContext(i),e.start(),k.dispatchEvent({type:"sessionstart"})}function w(){for(var o,n,r,f,e,t=0;t<u.length;t++){o=t;n:{for(n=i.inputSources,r=0;r<n.length;r++){if(f=n[r],e=f.handedness,0===t&&("none"===e||"right"===e)){n=f;break n}if(1===t&&"left"===e){n=f;break n}}n=void 0}a[o]=n}}function b(n,t){null===t?n.matrixWorld.copy(n.matrix):n.matrixWorld.multiplyMatrices(t.matrixWorld,n.matrix),n.matrixWorldInverse.getInverse(n.matrixWorld)}var k=this,i=null,o=null,d="local-floor",l=null,u=[],a=[],s=new it,f,r,h,e;s.layers.enable(1),s.viewport=new p,f=new it,f.layers.enable(2),f.viewport=new p,r=new ah([s,f]),r.layers.enable(1),r.layers.enable(2),this.enabled=!1,this.getController=function(n){var t=u[n];return void 0===t&&(t=new de,t.matrixAutoUpdate=!1,t.visible=!1,u[n]=t),t},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(n){d=n},this.getSession=function(){return i},this.setSession=function(n){i=n,null!==i&&(i.addEventListener("select",c),i.addEventListener("selectstart",c),i.addEventListener("selectend",c),i.addEventListener("end",g),i.updateRenderState({baseLayer:new XRWebGLLayer(i,t)}),i.requestReferenceSpace(d).then(nt),i.addEventListener("inputsourceschange",w),w())},this.getCamera=function(n){var i,u,t;if(y()){for(i=n.parent,u=r.cameras,b(r,i),t=0;t<u.length;t++)b(u[t],i);for(n.matrixWorld.copy(r.matrixWorld),n=n.children,t=0,i=n.length;t<i;t++)n[t].updateMatrixWorld(!0);return vd(r,s,f),r}return n},this.isPresenting=y,h=null,e=new hp,e.setAnimationLoop(function(t,f){var e,c,s;if(l=f.getViewerPose(o),null!==l)for(e=l.views,c=i.renderState.baseLayer,n.setFramebuffer(c.framebuffer),s=0;s<e.length;s++){var p=e[s],y=c.getViewport(p),v=r.cameras[s];v.matrix.fromArray(p.transform.inverse.matrix).getInverse(v.matrix),v.projectionMatrix.fromArray(p.projectionMatrix),v.viewport.set(y.x,y.y,y.width,y.height),0===s&&r.matrix.copy(v.matrix)}for(s=0;s<u.length;s++){if(e=u[s],(c=a[s])&&(c=f.getPose(c.targetRaySpace,o),null!==c)){e.matrix.fromArray(c.transform.matrix),e.matrix.decompose(e.position,e.rotation,e.scale),e.visible=!0;continue}e.visible=!1}h&&h(t)}),this.setAnimationLoop=function(n){h=n},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new v},this.getDevice=function(){console.warn("THREE.WebXRManager: getDevice() has been deprecated.")},this.setDevice=function(){console.warn("THREE.WebXRManager: setDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}function vp(n){function di(){e=new dtt(r),l=new btt(r,e,n),!1===l.isWebGL2&&(e.get("WEBGL_depth_texture"),e.get("OES_texture_float"),e.get("OES_texture_half_float"),e.get("OES_texture_half_float_linear"),e.get("OES_standard_derivatives"),e.get("OES_element_index_uint"),e.get("ANGLE_instanced_arrays")),e.get("OES_texture_float_linear"),tt=new ad(r,e,l),u=new aut(r,e,l),u.scissor(bt.copy(at).multiplyScalar(c).floor()),u.viewport(ot.copy(lt).multiplyScalar(c).floor()),g=new tit(r),y=new uut,d=new vut(r,e,u,y,l,tt,g),vt=new ytt(r),bi=new gtt(r,vt,g),yt=new uit(r,bi,vt,g),lr=new rit(r),ht=new rut(f,e,l),oi=new out,pt=new lut,et=new ptt(f,u,yt,or),vr=new wtt(r,e,g,l),yr=new nit(r,e,g,l),g.programs=ht.programs,f.capabilities=l,f.extensions=e,f.properties=y,f.renderLists=oi,f.state=u,f.info=g}function gi(n){n.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),li=!0}function nr(){console.log("THREE.WebGLRenderer: Context Restored."),li=!1,di()}function tr(n){n=n.target,n.removeEventListener("dispose",tr),ir(n),y.remove(n)}function ir(n){var t=y.get(n).program;n.program=void 0,void 0!==t&&ht.releaseProgram(t)}function pr(n,t){n.render(function(n){f.renderBufferImmediate(n,t)})}function rr(n,t,i,r){var e,u,c,o;if(!1!==n.visible){if(n.layers.test(t.layers))if(n.isGroup)i=n.renderOrder;else if(n.isLOD)!0===n.autoUpdate&&n.update(t);else if(n.isLight)s.pushLight(n),n.castShadow&&s.pushShadow(n);else if(n.isSprite)(!n.frustumCulled||pi.intersectsSprite(n))&&(r&&ft.setFromMatrixPosition(n.matrixWorld).applyMatrix4(kt),e=yt.update(n),u=n.material,u.visible&&b.push(n,e,u,i,ft.z,null));else if(n.isImmediateRenderObject)r&&ft.setFromMatrixPosition(n.matrixWorld).applyMatrix4(kt),b.push(n,null,n.material,i,ft.z,null);else if((n.isMesh||n.isLine||n.isPoints)&&(n.isSkinnedMesh&&n.skeleton.frame!==g.render.frame&&(n.skeleton.update(),n.skeleton.frame=g.render.frame),!n.frustumCulled||pi.intersectsObject(n)))if(r&&ft.setFromMatrixPosition(n.matrixWorld).applyMatrix4(kt),e=yt.update(n),u=n.material,Array.isArray(u))for(var l=e.groups,f=0,h=l.length;f<h;f++)c=l[f],o=u[c.materialIndex],o&&o.visible&&b.push(n,e,o,i,ft.z,c);else u.visible&&b.push(n,e,u,i,ft.z,null);for(n=n.children,f=0,h=n.length;f<h;f++)rr(n[f],t,i,r)}}function gt(n,t,i,r){for(var e,o=0,v=n.length;o<v;o++){var f=n[o],h=f.object,c=f.geometry,l=void 0===r?f.material:r;if(f=f.group,i.isArrayCamera)if(fi=i,w.enabled&&it.isAvailable())hi(h,t,i,c,l,f);else for(var y=i.cameras,a=0,p=y.length;a<p;a++)e=y[a],h.layers.test(e.layers)&&(u.viewport(ot.copy(e.viewport)),s.setupLights(e),hi(h,t,e,c,l,f));else fi=null,hi(h,t,i,c,l,f)}}function hi(n,t,i,r,e,o){n.onBeforeRender(f,t,i,r,e,o);if(s=pt.get(t,fi||i),n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld),n.normalMatrix.getNormalMatrix(n.modelViewMatrix),n.isImmediateRenderObject){u.setMaterial(e);var h=ur(i,t.fog,e,n);ri=wt=null,ui=!1,pr(n,h)}else f.renderBufferDirect(i,t.fog,r,e,n,o);n.onAfterRender(f,t,i,r,e,o);s=pt.get(t,fi||i)}function ci(n,t,i){var r=y.get(n),u=s.state.lights,h=u.state.version;i=ht.getParameters(n,u.state,s.state.shadowsArray,t,k.numPlanes,k.numIntersection,i);var e=ht.getProgramCacheKey(n,i),o=r.program,c=!0;if(void 0===o)n.addEventListener("dispose",tr);else if(o.cacheKey!==e)ir(n);else{if(r.lightsStateVersion!==h)r.lightsStateVersion=h;else if(void 0!==i.shaderID)return;c=!1}if(c&&(i.shaderID?(e=ar[i.shaderID],r.shader={name:n.type,uniforms:ef(e.uniforms),vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}):r.shader={name:n.type,uniforms:n.uniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader},n.onBeforeCompile(r.shader,f),e=ht.getProgramCacheKey(n,i),o=ht.acquireProgram(n,r.shader,i,e),r.program=o,n.program=o),i=o.getAttributes(),n.morphTargets)for(e=n.numSupportedMorphTargets=0;e<f.maxMorphTargets;e++)0<=i["morphTarget"+e]&&n.numSupportedMorphTargets++;if(n.morphNormals)for(e=n.numSupportedMorphNormals=0;e<f.maxMorphNormals;e++)0<=i["morphNormal"+e]&&n.numSupportedMorphNormals++;i=r.shader.uniforms,(n.isShaderMaterial||n.isRawShaderMaterial)&&!0!==n.clipping||(r.numClippingPlanes=k.numPlanes,r.numIntersection=k.numIntersection,i.clippingPlanes=k.uniform),r.fog=t,r.needsLights=n.isMeshLambertMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.isShadowMaterial||n.isShaderMaterial&&!0===n.lights,r.lightsStateVersion=h,r.needsLights&&(i.ambientLightColor.value=u.state.ambient,i.lightProbe.value=u.state.probe,i.directionalLights.value=u.state.directional,i.spotLights.value=u.state.spot,i.rectAreaLights.value=u.state.rectArea,i.pointLights.value=u.state.point,i.hemisphereLights.value=u.state.hemi,i.directionalShadowMap.value=u.state.directionalShadowMap,i.directionalShadowMatrix.value=u.state.directionalShadowMatrix,i.spotShadowMap.value=u.state.spotShadowMap,i.spotShadowMatrix.value=u.state.spotShadowMatrix,i.pointShadowMap.value=u.state.pointShadowMap,i.pointShadowMatrix.value=u.state.pointShadowMatrix),n=r.program.getUniforms(),n=hu.seqWithValue(n.seq,i),r.uniformsList=n}function ur(n,t,i,e){var p,nt,v,h,g,ot,ht,tt,et;d.resetTextureUnits(),p=y.get(i),nt=s.state.lights,ei&&(wi||n!==ct)&&k.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,n,p,n===ct&&i.id===ii),!1===i.needsUpdate&&(void 0===p.program?i.needsUpdate=!0:i.fog&&p.fog!==t?i.needsUpdate=!0:p.needsLights&&p.lightsStateVersion!==nt.state.version?i.needsUpdate=!0:void 0===p.numClippingPlanes||p.numClippingPlanes===k.numPlanes&&p.numIntersection===k.numIntersection||(i.needsUpdate=!0)),i.needsUpdate&&(ci(i,t,e),i.needsUpdate=!1);var w=!1,b=!1,st=!1;return nt=p.program,v=nt.getUniforms(),h=p.shader.uniforms,u.useProgram(nt.program)&&(st=b=w=!0),i.id!==ii&&(ii=i.id,b=!0),(w||ct!==n)&&(0<nt.numMultiviewViews?it.updateCameraProjectionMatricesUniform(n,v):v.setValue(r,"projectionMatrix",n.projectionMatrix),l.logarithmicDepthBuffer&&v.setValue(r,"logDepthBufFC",2/(Math.log(n.far+1)/Math.LN2)),ct!==n&&(ct=n,st=b=!0),(i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap)&&(w=v.map.cameraPosition,void 0!==w&&w.setValue(r,ft.setFromMatrixPosition(n.matrixWorld))),(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&v.setValue(r,"isOrthographic",!0===n.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&(0<nt.numMultiviewViews?it.updateCameraViewMatricesUniform(n,v):v.setValue(r,"viewMatrix",n.matrixWorldInverse))),i.skinning&&(v.setOptional(r,e,"bindMatrix"),v.setOptional(r,e,"bindMatrixInverse"),w=e.skeleton)&&(g=w.bones,l.floatVertexTextures?(void 0===w.boneTexture&&(g=Math.sqrt(4*g.length),g=a.ceilPowerOfTwo(g),g=Math.max(g,4),ot=new Float32Array(g*g*4),ot.set(w.boneMatrices),ht=new of(ot,g,g,1023,1015),w.boneMatrices=ot,w.boneTexture=ht,w.boneTextureSize=g),v.setValue(r,"boneTexture",w.boneTexture,d),v.setValue(r,"boneTextureSize",w.boneTextureSize)):v.setOptional(r,w,"boneMatrices")),(b||p.receiveShadow!==e.receiveShadow)&&(p.receiveShadow=e.receiveShadow,v.setValue(r,"receiveShadow",e.receiveShadow)),b&&(v.setValue(r,"toneMappingExposure",f.toneMappingExposure),v.setValue(r,"toneMappingWhitePoint",f.toneMappingWhitePoint),p.needsLights&&(b=st,h.ambientLightColor.needsUpdate=b,h.lightProbe.needsUpdate=b,h.directionalLights.needsUpdate=b,h.pointLights.needsUpdate=b,h.spotLights.needsUpdate=b,h.rectAreaLights.needsUpdate=b,h.hemisphereLights.needsUpdate=b),t&&i.fog&&(h.fogColor.value.copy(t.color),t.isFog?(h.fogNear.value=t.near,h.fogFar.value=t.far):t.isFogExp2&&(h.fogDensity.value=t.density)),i.isMeshBasicMaterial?rt(h,i):i.isMeshLambertMaterial?(rt(h,i),i.emissiveMap&&(h.emissiveMap.value=i.emissiveMap)):i.isMeshPhongMaterial?(rt(h,i),i.isMeshToonMaterial?(fr(h,i),i.gradientMap&&(h.gradientMap.value=i.gradientMap)):fr(h,i)):i.isMeshStandardMaterial?(rt(h,i),i.isMeshPhysicalMaterial?(er(h,i),h.reflectivity.value=i.reflectivity,h.clearcoat.value=i.clearcoat,h.clearcoatRoughness.value=i.clearcoatRoughness,i.sheen&&h.sheen.value.copy(i.sheen),i.clearcoatNormalMap&&(h.clearcoatNormalScale.value.copy(i.clearcoatNormalScale),h.clearcoatNormalMap.value=i.clearcoatNormalMap,1===i.side&&h.clearcoatNormalScale.value.negate()),h.transparency.value=i.transparency):er(h,i)):i.isMeshMatcapMaterial?(rt(h,i),i.matcap&&(h.matcap.value=i.matcap),i.bumpMap&&(h.bumpMap.value=i.bumpMap,h.bumpScale.value=i.bumpScale,1===i.side&&(h.bumpScale.value*=-1)),i.normalMap&&(h.normalMap.value=i.normalMap,h.normalScale.value.copy(i.normalScale),1===i.side&&h.normalScale.value.negate()),i.displacementMap&&(h.displacementMap.value=i.displacementMap,h.displacementScale.value=i.displacementScale,h.displacementBias.value=i.displacementBias)):i.isMeshDepthMaterial?(rt(h,i),i.displacementMap&&(h.displacementMap.value=i.displacementMap,h.displacementScale.value=i.displacementScale,h.displacementBias.value=i.displacementBias)):i.isMeshDistanceMaterial?(rt(h,i),i.displacementMap&&(h.displacementMap.value=i.displacementMap,h.displacementScale.value=i.displacementScale,h.displacementBias.value=i.displacementBias),h.referencePosition.value.copy(i.referencePosition),h.nearDistance.value=i.nearDistance,h.farDistance.value=i.farDistance):i.isMeshNormalMaterial?(rt(h,i),i.bumpMap&&(h.bumpMap.value=i.bumpMap,h.bumpScale.value=i.bumpScale,1===i.side&&(h.bumpScale.value*=-1)),i.normalMap&&(h.normalMap.value=i.normalMap,h.normalScale.value.copy(i.normalScale),1===i.side&&h.normalScale.value.negate()),i.displacementMap&&(h.displacementMap.value=i.displacementMap,h.displacementScale.value=i.displacementScale,h.displacementBias.value=i.displacementBias)):i.isLineBasicMaterial?(h.diffuse.value.copy(i.color),h.opacity.value=i.opacity,i.isLineDashedMaterial&&(h.dashSize.value=i.dashSize,h.totalSize.value=i.dashSize+i.gapSize,h.scale.value=i.scale)):i.isPointsMaterial?(h.diffuse.value.copy(i.color),h.opacity.value=i.opacity,h.size.value=i.size*c,h.scale.value=.5*ut,i.map&&(h.map.value=i.map),i.alphaMap&&(h.alphaMap.value=i.alphaMap),i.map?tt=i.map:i.alphaMap&&(tt=i.alphaMap),void 0!==tt&&(!0===tt.matrixAutoUpdate&&tt.updateMatrix(),h.uvTransform.value.copy(tt.matrix))):i.isSpriteMaterial?(h.diffuse.value.copy(i.color),h.opacity.value=i.opacity,h.rotation.value=i.rotation,i.map&&(h.map.value=i.map),i.alphaMap&&(h.alphaMap.value=i.alphaMap),i.map?et=i.map:i.alphaMap&&(et=i.alphaMap),void 0!==et&&(!0===et.matrixAutoUpdate&&et.updateMatrix(),h.uvTransform.value.copy(et.matrix))):i.isShadowMaterial&&(h.color.value.copy(i.color),h.opacity.value=i.opacity),void 0!==h.ltc_1&&(h.ltc_1.value=o.LTC_1),void 0!==h.ltc_2&&(h.ltc_2.value=o.LTC_2),hu.upload(r,p.uniformsList,h,d),i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(hu.upload(r,p.uniformsList,h,d),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&v.setValue(r,"center",e.center),0<nt.numMultiviewViews?it.updateObjectMatricesUniforms(e,n,v):(v.setValue(r,"modelViewMatrix",e.modelViewMatrix),v.setValue(r,"normalMatrix",e.normalMatrix)),v.setValue(r,"modelMatrix",e.matrixWorld),nt}function rt(n,t){if(n.opacity.value=t.opacity,t.color&&n.diffuse.value.copy(t.color),t.emissive&&n.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(n.map.value=t.map),t.alphaMap&&(n.alphaMap.value=t.alphaMap),t.specularMap&&(n.specularMap.value=t.specularMap),t.envMap&&(n.envMap.value=t.envMap,n.flipEnvMap.value=t.envMap.isCubeTexture?-1:1,n.reflectivity.value=t.reflectivity,n.refractionRatio.value=t.refractionRatio,n.maxMipLevel.value=y.get(t.envMap).__maxMipLevel),t.lightMap&&(n.lightMap.value=t.lightMap,n.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(n.aoMap.value=t.aoMap,n.aoMapIntensity.value=t.aoMapIntensity),t.map)var i=t.map;else t.specularMap?i=t.specularMap:t.displacementMap?i=t.displacementMap:t.normalMap?i=t.normalMap:t.bumpMap?i=t.bumpMap:t.roughnessMap?i=t.roughnessMap:t.metalnessMap?i=t.metalnessMap:t.alphaMap?i=t.alphaMap:t.emissiveMap&&(i=t.emissiveMap);void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),n.uvTransform.value.copy(i.matrix))}function fr(n,t){n.specular.value.copy(t.specular),n.shininess.value=Math.max(t.shininess,.0001),t.emissiveMap&&(n.emissiveMap.value=t.emissiveMap),t.bumpMap&&(n.bumpMap.value=t.bumpMap,n.bumpScale.value=t.bumpScale,1===t.side&&(n.bumpScale.value*=-1)),t.normalMap&&(n.normalMap.value=t.normalMap,n.normalScale.value.copy(t.normalScale),1===t.side&&n.normalScale.value.negate()),t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias)}function er(n,t){n.roughness.value=t.roughness,n.metalness.value=t.metalness,t.roughnessMap&&(n.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(n.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(n.emissiveMap.value=t.emissiveMap),t.bumpMap&&(n.bumpMap.value=t.bumpMap,n.bumpScale.value=t.bumpScale,1===t.side&&(n.bumpScale.value*=-1)),t.normalMap&&(n.normalMap.value=t.normalMap,n.normalScale.value.copy(t.normalScale),1===t.side&&n.normalScale.value.negate()),t.displacementMap&&(n.displacementMap.value=t.displacementMap,n.displacementScale.value=t.displacementScale,n.displacementBias.value=t.displacementBias),t.envMap&&(n.envMapIntensity.value=t.envMapIntensity)}var wt,r,e,l,u,g,y,d,vt,bi,yt,ht,oi,pt,et,lr,vr,yr,tt,w,it,ki,si,dt;n=n||{};var h=void 0!==n.canvas?n.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),wr=void 0!==n.context?n.context:null,ni=void 0!==n.alpha?n.alpha:!1,br=void 0!==n.depth?n.depth:!0,kr=void 0!==n.stencil?n.stencil:!0,dr=void 0!==n.antialias?n.antialias:!1,or=void 0!==n.premultipliedAlpha?n.premultipliedAlpha:!0,gr=void 0!==n.preserveDrawingBuffer?n.preserveDrawingBuffer:!1,nu=void 0!==n.powerPreference?n.powerPreference:"default",tu=void 0!==n.failIfMajorPerformanceCaveat?n.failIfMajorPerformanceCaveat:!1,b=null,s=null;this.domElement=h,this.debug={checkShaderErrors:!0},this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1,this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var f=this,li=!1,ai=null,sr=0,hr=0,nt=null,ti=null,ii=-1,ri=wt=null,ui=!1,ct=null,fi=null,ot=new p,bt=new p,vi=null,st=h.width,ut=h.height,c=1,lt=new p(0,0,st,ut),at=new p(0,0,st,ut),yi=!1,pi=new hh,k=new ktt,ei=!1,wi=!1,kt=new v,ft=new t;try{if(ni={alpha:ni,depth:br,stencil:kr,antialias:dr,premultipliedAlpha:or,preserveDrawingBuffer:gr,powerPreference:nu,failIfMajorPerformanceCaveat:tu,xrCompatible:!0},h.addEventListener("webglcontextlost",gi,!1),h.addEventListener("webglcontextrestored",nr,!1),r=wr||h.getContext("webgl",ni)||h.getContext("experimental-webgl",ni),null===r){if(null!==h.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===r.getShaderPrecisionFormat&&(r.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(cr){throw console.error("THREE.WebGLRenderer: "+cr.message),cr;}di(),w="undefined"!=typeof navigator&&"xr"in navigator&&"isSessionSupported"in navigator.xr?new yd(f,r):new ap(f),this.vr=w,it=new yut(f,r),ki=new ld(f,yt,l.maxTextureSize),this.shadowMap=ki,this.getContext=function(){return r},this.getContextAttributes=function(){return r.getContextAttributes()},this.forceContextLoss=function(){var n=e.get("WEBGL_lose_context");n&&n.loseContext()},this.forceContextRestore=function(){var n=e.get("WEBGL_lose_context");n&&n.restoreContext()},this.getPixelRatio=function(){return c},this.setPixelRatio=function(n){void 0!==n&&(c=n,this.setSize(st,ut,!1))},this.getSize=function(n){return void 0===n&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),n=new i),n.set(st,ut)},this.setSize=function(n,t,i){w.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(st=n,ut=t,h.width=Math.floor(n*c),h.height=Math.floor(t*c),!1!==i&&(h.style.width=n+"px",h.style.height=t+"px"),this.setViewport(0,0,n,t))},this.getDrawingBufferSize=function(n){return void 0===n&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),n=new i),n.set(st*c,ut*c).floor()},this.setDrawingBufferSize=function(n,t,i){st=n,ut=t,c=i,h.width=Math.floor(n*i),h.height=Math.floor(t*i),this.setViewport(0,0,n,t)},this.getCurrentViewport=function(n){return void 0===n&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),n=new p),n.copy(ot)},this.getViewport=function(n){return n.copy(lt)},this.setViewport=function(n,t,i,r){n.isVector4?lt.set(n.x,n.y,n.z,n.w):lt.set(n,t,i,r),u.viewport(ot.copy(lt).multiplyScalar(c).floor())},this.getScissor=function(n){return n.copy(at)},this.setScissor=function(n,t,i,r){n.isVector4?at.set(n.x,n.y,n.z,n.w):at.set(n,t,i,r),u.scissor(bt.copy(at).multiplyScalar(c).floor())},this.getScissorTest=function(){return yi},this.setScissorTest=function(n){u.setScissorTest(yi=n)},this.getClearColor=function(){return et.getClearColor()},this.setClearColor=function(){et.setClearColor.apply(et,arguments)},this.getClearAlpha=function(){return et.getClearAlpha()},this.setClearAlpha=function(){et.setClearAlpha.apply(et,arguments)},this.clear=function(n,t,i){var u=0;(void 0===n||n)&&(u|=16384),(void 0===t||t)&&(u|=256),(void 0===i||i)&&(u|=1024),r.clear(u)},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.dispose=function(){h.removeEventListener("webglcontextlost",gi,!1),h.removeEventListener("webglcontextrestored",nr,!1),oi.dispose(),pt.dispose(),y.dispose(),yt.dispose(),w.dispose(),dt.stop()},this.renderBufferImmediate=function(n,t){u.initAttributes();var i=y.get(n);n.hasPositions&&!i.position&&(i.position=r.createBuffer()),n.hasNormals&&!i.normal&&(i.normal=r.createBuffer()),n.hasUvs&&!i.uv&&(i.uv=r.createBuffer()),n.hasColors&&!i.color&&(i.color=r.createBuffer()),t=t.getAttributes(),n.hasPositions&&(r.bindBuffer(34962,i.position),r.bufferData(34962,n.positionArray,35048),u.enableAttribute(t.position),r.vertexAttribPointer(t.position,3,5126,!1,0,0)),n.hasNormals&&(r.bindBuffer(34962,i.normal),r.bufferData(34962,n.normalArray,35048),u.enableAttribute(t.normal),r.vertexAttribPointer(t.normal,3,5126,!1,0,0)),n.hasUvs&&(r.bindBuffer(34962,i.uv),r.bufferData(34962,n.uvArray,35048),u.enableAttribute(t.uv),r.vertexAttribPointer(t.uv,2,5126,!1,0,0)),n.hasColors&&(r.bindBuffer(34962,i.color),r.bufferData(34962,n.colorArray,35048),u.enableAttribute(t.color),r.vertexAttribPointer(t.color,3,5126,!1,0,0)),u.disableUnusedAttributes(),r.drawArrays(4,0,n.count),n.count=0},this.renderBufferDirect=function(n,t,i,f,o,s){var v=o.isMesh&&0>o.matrixWorld.determinant(),b,tt,it,d,ut,h,a,rt,k,g,et,p;if(u.setMaterial(f,v),b=ur(n,t,f,o),tt=!1,(wt!==i.id||ri!==b.id||ui!==(!0===f.wireframe))&&(wt=i.id,ri=b.id,ui=!0===f.wireframe,tt=!0),o.morphTargetInfluences&&(lr.update(o,i,f,b),tt=!0),v=i.index,it=i.attributes.position,t=1,!0===f.wireframe&&(v=bi.getWireframeAttribute(i),t=2),n=vr,null!==v&&(d=vt.get(v),n=yr,n.setIndex(d)),tt){if(!1!==l.isWebGL2||!o.isInstancedMesh&&!i.isInstancedBufferGeometry||null!==e.get("ANGLE_instanced_arrays")){u.initAttributes(),tt=i.attributes,b=b.getAttributes(),ut=f.defaultAttributeValues;for(p in b)if(h=b[p],0<=h)if(a=tt[p],void 0!==a){var w=a.normalized,ft=a.itemSize,y=vt.get(a);void 0!==y&&(rt=y.buffer,k=y.type,y=y.bytesPerElement,a.isInterleavedBufferAttribute?(g=a.data,et=g.stride,a=a.offset,g&&g.isInstancedInterleavedBuffer?(u.enableAttributeAndDivisor(h,g.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=g.meshPerAttribute*g.count)):u.enableAttribute(h),r.bindBuffer(34962,rt),r.vertexAttribPointer(h,ft,k,w,et*y,a*y)):(a.isInstancedBufferAttribute?(u.enableAttributeAndDivisor(h,a.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=a.meshPerAttribute*a.count)):u.enableAttribute(h),r.bindBuffer(34962,rt),r.vertexAttribPointer(h,ft,k,w,0,0)))}else if("instanceMatrix"===p)y=vt.get(o.instanceMatrix),void 0!==y&&(rt=y.buffer,k=y.type,u.enableAttributeAndDivisor(h+0,1),u.enableAttributeAndDivisor(h+1,1),u.enableAttributeAndDivisor(h+2,1),u.enableAttributeAndDivisor(h+3,1),r.bindBuffer(34962,rt),r.vertexAttribPointer(h+0,4,k,!1,64,0),r.vertexAttribPointer(h+1,4,k,!1,64,16),r.vertexAttribPointer(h+2,4,k,!1,64,32),r.vertexAttribPointer(h+3,4,k,!1,64,48));else if(void 0!==ut&&(w=ut[p],void 0!==w))switch(w.length){case 2:r.vertexAttrib2fv(h,w);break;case 3:r.vertexAttrib3fv(h,w);break;case 4:r.vertexAttrib4fv(h,w);break;default:r.vertexAttrib1fv(h,w)}u.disableUnusedAttributes()}null!==v&&r.bindBuffer(34963,d.buffer)}if(d=Infinity,null!==v?d=v.count:void 0!==it&&(d=it.count),v=i.drawRange.start*t,it=null!==s?s.start*t:0,p=Math.max(v,it),s=Math.max(0,Math.min(d,v+i.drawRange.count*t,it+(null!==s?s.count*t:Infinity))-1-p+1),0!==s){if(o.isMesh)if(!0===f.wireframe)u.setLineWidth(f.wireframeLinewidth*(null===nt?c:1)),n.setMode(1);else switch(o.drawMode){case 0:n.setMode(4);break;case 1:n.setMode(5);break;case 2:n.setMode(6)}else o.isLine?(f=f.linewidth,void 0===f&&(f=1),u.setLineWidth(f*(null===nt?c:1)),o.isLineSegments?n.setMode(1):o.isLineLoop?n.setMode(2):n.setMode(3)):o.isPoints?n.setMode(0):o.isSprite&&n.setMode(4);o.isInstancedMesh?n.renderInstances(i,p,s,o.count):i.isInstancedBufferGeometry?n.renderInstances(i,p,s,i.maxInstancedCount):n.render(p,s)}},this.compile=function(n,t){s=pt.get(n,t),s.init(),n.traverse(function(n){n.isLight&&(s.pushLight(n),n.castShadow&&s.pushShadow(n))}),s.setupLights(t),n.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var i=0;i<t.material.length;i++)ci(t.material[i],n.fog,t);else ci(t.material,n.fog,t)})},si=null,dt=new hp,dt.setAnimationLoop(function(n){w.isPresenting()||si&&si(n)}),"undefined"!=typeof window&&dt.setContext(window),this.setAnimationLoop=function(n){si=n,w.setAnimationLoop(n),dt.start()},this.render=function(n,t,i,r){var e,o;void 0!==i&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),e=i),void 0!==r&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),o=r),t&&t.isCamera?li||(ri=wt=null,ui=!1,ii=-1,ct=null,!0===n.autoUpdate&&n.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),w.enabled&&(t=w.getCamera(t)),s=pt.get(n,t),s.init(),n.onBeforeRender(f,n,t,e||nt),kt.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),pi.setFromMatrix(kt),wi=this.localClippingEnabled,ei=k.init(this.clippingPlanes,wi,t),b=oi.get(n,t),b.init(),rr(n,t,0,f.sortObjects),!0===f.sortObjects&&b.sort(),ei&&k.beginShadows(),ki.render(s.state.shadowsArray,n,t),s.setupLights(t),ei&&k.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==e&&this.setRenderTarget(e),w.enabled&&it.isAvailable()&&it.attachCamera(t),et.render(b,n,t,o),i=b.opaque,r=b.transparent,n.overrideMaterial?(e=n.overrideMaterial,i.length&&gt(i,n,t,e),r.length&&gt(r,n,t,e)):(i.length&&gt(i,n,t),r.length&&gt(r,n,t)),n.onAfterRender(f,n,t),null!==nt&&(d.updateRenderTargetMipmap(nt),d.updateMultisampleRenderTarget(nt)),u.buffers.depth.setTest(!0),u.buffers.depth.setMask(!0),u.buffers.color.setMask(!0),u.setPolygonOffset(!1),w.enabled&&(it.isAvailable()&&it.detachCamera(t),w.submitFrame()),s=b=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(n){ai!==n&&null===nt&&r.bindFramebuffer(36160,n),ai=n},this.getActiveCubeFace=function(){return sr},this.getActiveMipmapLevel=function(){return hr},this.getRenderTarget=function(){return nt},this.setRenderTarget=function(n,t,i){nt=n,sr=t,hr=i,n&&void 0===y.get(n).__webglFramebuffer&&d.setupRenderTarget(n);var f=ai,e=!1;n?(f=y.get(n).__webglFramebuffer,n.isWebGLRenderTargetCube?(f=f[t||0],e=!0):f=n.isWebGLMultisampleRenderTarget?y.get(n).__webglMultisampledFramebuffer:f,ot.copy(n.viewport),bt.copy(n.scissor),vi=n.scissorTest):(ot.copy(lt).multiplyScalar(c).floor(),bt.copy(at).multiplyScalar(c).floor(),vi=yi),ti!==f&&(r.bindFramebuffer(36160,f),ti=f),u.viewport(ot),u.scissor(bt),u.setScissorTest(vi),e&&(n=y.get(n.texture),r.framebufferTexture2D(36160,36064,34069+(t||0),n.__webglTexture,i||0))},this.readRenderTargetPixels=function(n,t,i,u,f,o,s){var h;if(n&&n.isWebGLRenderTarget){if(h=y.get(n).__webglFramebuffer,n.isWebGLRenderTargetCube&&void 0!==s&&(h=h[s]),h){s=!1,h!==ti&&(r.bindFramebuffer(36160,h),s=!0);try{var v=n.texture,a=v.format,c=v.type;1023!==a&&tt.convert(a)!==r.getParameter(35739)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===c||tt.convert(c)===r.getParameter(35738)||1015===c&&(l.isWebGL2||e.get("OES_texture_float")||e.get("WEBGL_color_buffer_float"))||1016===c&&(l.isWebGL2?e.get("EXT_color_buffer_float"):e.get("EXT_color_buffer_half_float"))?36053===r.checkFramebufferStatus(36160)?0<=t&&t<=n.width-u&&0<=i&&i<=n.height-f&&r.readPixels(t,i,u,f,tt.convert(a),tt.convert(c),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&&r.bindFramebuffer(36160,ti)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(n,t,i){var f,e,o;void 0===i&&(i=0),f=Math.pow(2,-i),e=Math.floor(t.image.width*f),f=Math.floor(t.image.height*f),o=tt.convert(t.format),d.setTexture2D(t,0),r.copyTexImage2D(3553,i,o,n.x,n.y,e,f,0),u.unbindTexture()},this.copyTextureToTexture=function(n,t,i,f){var s=t.image.width,h=t.image.height,e=tt.convert(i.format),o=tt.convert(i.type);d.setTexture2D(i,0),t.isDataTexture?r.texSubImage2D(3553,f||0,n.x,n.y,s,h,e,o,t.image.data):r.texSubImage2D(3553,f||0,n.x,n.y,e,o,t.image),u.unbindTexture()},this.initTexture=function(n){d.setTexture2D(n,0),u.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function fa(n,t){this.name="",this.color=new e(n),this.density=void 0!==t?t:.00025}function ea(n,t,i){this.name="",this.color=new e(n),this.near=void 0!==t?t:1,this.far=void 0!==i?i:1e3}function br(n,t){this.array=n,this.stride=t,this.count=void 0!==n?n.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function vh(n,t,i,r){this.data=n,this.itemSize=t,this.offset=i,this.normalized=!0===r}function au(n){l.call(this),this.type="SpriteMaterial",this.color=new e(16777215),this.alphaMap=this.map=null,this.rotation=0,this.transparent=this.sizeAttenuation=!0,this.setValues(n)}function yh(n){if(u.call(this),this.type="Sprite",void 0===ds){ds=new f;var t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]);t=new br(t,5),ds.setIndex([0,1,2,0,2,3]),ds.setAttribute("position",new vh(t,3,0,!1)),ds.setAttribute("uv",new vh(t,2,3,!1))}this.geometry=ds,this.material=void 0!==n?n:new au,this.center=new i(.5,.5)}function oa(n,t,i,r,u,f){th.subVectors(n,i).addScalar(.5).multiply(r),void 0!==u?(pl.x=f*th.x-u*th.y,pl.y=u*th.x+f*th.y):pl.copy(th),n.copy(t),n.x+=pl.x,n.y+=pl.y,n.applyMatrix4(pn)}function ph(){u.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function wh(n,t){n&&n.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),tt.call(this,n,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new v,this.bindMatrixInverse=new v}function sa(n,t){if(n=n||[],this.bones=n.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else for(console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[],n=0,t=this.bones.length;n<t;n++)this.boneInverses.push(new v)}function yp(){u.call(this),this.type="Bone"}function ha(n,t,i){tt.call(this,n,t),this.instanceMatrix=new c(new Float32Array(16*i),16),this.count=i}function b(n){l.call(this),this.type="LineBasicMaterial",this.color=new e(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.setValues(n)}function st(n,t,i){1===i&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),u.call(this),this.type="Line",this.geometry=void 0!==n?n:new f,this.material=void 0!==t?t:new b({color:16777215*Math.random()})}function d(n,t){st.call(this,n,t),this.type="LineSegments"}function ca(n,t){st.call(this,n,t),this.type="LineLoop"}function li(n){l.call(this),this.type="PointsMaterial",this.color=new e(16777215),this.alphaMap=this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(n)}function ge(n,t){u.call(this),this.type="Points",this.geometry=void 0!==n?n:new f,this.material=void 0!==t?t:new li({color:16777215*Math.random()}),this.updateMorphTargets()}function pp(n,i,r,u,f,e,o){var s=rk.distanceSqToPoint(n);s<r&&(r=new t,rk.closestPointToPoint(n,r),r.applyMatrix4(u),n=f.ray.origin.distanceTo(r),n<f.near||n>f.far||e.push({distance:n,distanceToRay:Math.sqrt(s),point:r,index:i,face:null,object:o}))}function wp(n,t,i,r,u,f,e,o,s){k.call(this,n,t,i,r,u,f,e,o,s),this.format=void 0!==e?e:1022,this.minFilter=void 0!==f?f:1006,this.magFilter=void 0!==u?u:1006,this.generateMipmaps=!1}function no(n,t,i,r,u,f,e,o,s,h,c,l){k.call(this,null,f,e,o,s,h,r,u,c,l),this.image={width:t,height:i},this.mipmaps=n,this.generateMipmaps=this.flipY=!1}function bh(n,t,i,r,u,f,e,o,s){k.call(this,n,t,i,r,u,f,e,o,s),this.needsUpdate=!0}function kh(n,t,i,r,u,f,e,o,s,h){if(h=void 0!==h?h:1026,1026!==h&&1027!==h)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),k.call(this,null,r,u,f,e,o,h,i,s),this.image={width:n,height:t},this.magFilter=void 0!==e?e:1003,this.minFilter=void 0!==o?o:1003,this.generateMipmaps=this.flipY=!1}function to(n){var c,u,v,o,y,p;f.call(this),this.type="WireframeGeometry";var a=[],e,l,w,s=[0,0],h={},i=["a","b","c"];if(n&&n.isGeometry){for(c=n.faces,u=0,l=c.length;u<l;u++)for(v=c[u],e=0;3>e;e++)o=v[i[e]],y=v[i[(e+1)%3]],s[0]=Math.min(o,y),s[1]=Math.max(o,y),o=s[0]+","+s[1],void 0===h[o]&&(h[o]={index1:s[0],index2:s[1]});for(o in h)u=h[o],i=n.vertices[u.index1],a.push(i.x,i.y,i.z),i=n.vertices[u.index2],a.push(i.x,i.y,i.z)}else if(n&&n.isBufferGeometry)if(i=new t,null!==n.index){for(c=n.attributes.position,v=n.index,p=n.groups,0===p.length&&(p=[{start:0,count:v.count,materialIndex:0}]),n=0,w=p.length;n<w;++n)for(u=p[n],e=u.start,l=u.count,u=e,l=e+l;u<l;u+=3)for(e=0;3>e;e++)o=v.getX(u+e),y=v.getX(u+(e+1)%3),s[0]=Math.min(o,y),s[1]=Math.max(o,y),o=s[0]+","+s[1],void 0===h[o]&&(h[o]={index1:s[0],index2:s[1]});for(o in h)u=h[o],i.fromBufferAttribute(c,u.index1),a.push(i.x,i.y,i.z),i.fromBufferAttribute(c,u.index2),a.push(i.x,i.y,i.z)}else for(c=n.attributes.position,u=0,l=c.count/3;u<l;u++)for(e=0;3>e;e++)h=3*u+e,i.fromBufferAttribute(c,h),a.push(i.x,i.y,i.z),h=3*u+(e+1)%3,i.fromBufferAttribute(c,h),a.push(i.x,i.y,i.z);this.setAttribute("position",new r(a,3))}function dh(n,t,i){h.call(this),this.type="ParametricGeometry",this.parameters={func:n,slices:t,stacks:i},this.fromBufferGeometry(new io(n,t,i)),this.mergeVertices()}function io(n,i,u){var v,c,l;f.call(this),this.type="ParametricBufferGeometry",this.parameters={func:n,slices:i,stacks:u};var y=[],b=[],k=[],d=[],a=new t,e=new t,h=new t,p=new t,w=new t,o,s;for(3>n.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter."),v=i+1,o=0;o<=u;o++)for(c=o/u,s=0;s<=i;s++)l=s/i,n(l,c,e),b.push(e.x,e.y,e.z),0<=l-1e-5?(n(l-1e-5,c,h),p.subVectors(e,h)):(n(l+1e-5,c,h),p.subVectors(h,e)),0<=c-1e-5?(n(l,c-1e-5,h),w.subVectors(e,h)):(n(l,c+1e-5,h),w.subVectors(h,e)),a.crossVectors(p,w).normalize(),k.push(a.x,a.y,a.z),d.push(l,c);for(o=0;o<u;o++)for(s=0;s<i;s++)n=o*v+s+1,a=(o+1)*v+s+1,e=(o+1)*v+s,y.push(o*v+s,n,e),y.push(n,a,e);this.setIndex(y),this.setAttribute("position",new r(b,3)),this.setAttribute("normal",new r(k,3)),this.setAttribute("uv",new r(d,2))}function gh(n,t,i,r){h.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:n,indices:t,radius:i,detail:r},this.fromBufferGeometry(new kt(n,t,i,r)),this.mergeVertices()}function kt(n,u,e,o){function c(n){s.push(n.x,n.y,n.z)}function l(t,i){t*=3,i.x=n[t+0],i.y=n[t+1],i.z=n[t+2]}function a(n,t,i,r){0>r&&1===n.x&&(h[t]=n.x-1),0===i.x&&0===i.z&&(h[t]=r/2/Math.PI+.5)}f.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:n,indices:u,radius:e,detail:o},e=e||1,o=o||0;var s=[],h=[];(function(n){for(var h=new t,a=new t,v=new t,s=0;s<u.length;s+=3){l(u[s+0],h),l(u[s+1],a),l(u[s+2],v);for(var r,f=h,b=a,y=v,o=Math.pow(2,n),e=[],i=0;i<=o;i++){e[i]=[];var p=f.clone().lerp(y,i/o),k=b.clone().lerp(y,i/o),w=o-i;for(r=0;r<=w;r++)e[i][r]=0===r&&i===o?p:p.clone().lerp(k,r/w)}for(i=0;i<o;i++)for(r=0;r<2*(o-i)-1;r++)f=Math.floor(r/2),0==r%2?(c(e[i][f+1]),c(e[i+1][f]),c(e[i][f])):(c(e[i][f+1]),c(e[i+1][f+1]),c(e[i+1][f]))}})(o),function(n){for(var r=new t,i=0;i<s.length;i+=3)r.x=s[i+0],r.y=s[i+1],r.z=s[i+2],r.normalize().multiplyScalar(n),s[i+0]=r.x,s[i+1]=r.y,s[i+2]=r.z}(e),function(){for(var l,n=new t,r=0;r<s.length;r+=3)n.x=s[r+0],n.y=s[r+1],n.z=s[r+2],h.push(Math.atan2(n.z,-n.x)/2/Math.PI+.5,1-(Math.atan2(-n.y,Math.sqrt(n.x*n.x+n.z*n.z))/Math.PI+.5));n=new t,r=new t;for(var e=new t,o=new t,c=new i,v=new i,y=new i,u=0,f=0;u<s.length;u+=9,f+=6)n.set(s[u+0],s[u+1],s[u+2]),r.set(s[u+3],s[u+4],s[u+5]),e.set(s[u+6],s[u+7],s[u+8]),c.set(h[f+0],h[f+1]),v.set(h[f+2],h[f+3]),y.set(h[f+4],h[f+5]),o.copy(n).add(r).add(e).divideScalar(3),l=Math.atan2(o.z,-o.x),a(c,f+0,n,l),a(v,f+2,r,l),a(y,f+4,e,l);for(n=0;n<h.length;n+=6)r=h[n+0],e=h[n+2],o=h[n+4],c=Math.min(r,e,o),.9<Math.max(r,e,o)&&.1>c&&(.2>r&&(h[n+0]+=1),.2>e&&(h[n+2]+=1),.2>o&&(h[n+4]+=1))}(),this.setAttribute("position",new r(s,3)),this.setAttribute("normal",new r(s.slice(),3)),this.setAttribute("uv",new r(h,2)),0===o?this.computeVertexNormals():this.normalizeNormals()}function nc(n,t){h.call(this),this.type="TetrahedronGeometry",this.parameters={radius:n,detail:t},this.fromBufferGeometry(new ro(n,t)),this.mergeVertices()}function ro(n,t){kt.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],n,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:n,detail:t}}function tc(n,t){h.call(this),this.type="OctahedronGeometry",this.parameters={radius:n,detail:t},this.fromBufferGeometry(new hf(n,t)),this.mergeVertices()}function hf(n,t){kt.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],n,t),this.type="OctahedronBufferGeometry",this.parameters={radius:n,detail:t}}function ic(n,t){h.call(this),this.type="IcosahedronGeometry",this.parameters={radius:n,detail:t},this.fromBufferGeometry(new uo(n,t)),this.mergeVertices()}function uo(n,t){var i=(1+Math.sqrt(5))/2;kt.call(this,[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,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],n,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:n,detail:t}}function rc(n,t){h.call(this),this.type="DodecahedronGeometry",this.parameters={radius:n,detail:t},this.fromBufferGeometry(new fo(n,t)),this.mergeVertices()}function fo(n,t){var i=(1+Math.sqrt(5))/2,r=1/i;kt.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,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],[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],n,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:n,detail:t}}function uc(n,t,i,r,u,f){h.call(this),this.type="TubeGeometry",this.parameters={path:n,tubularSegments:t,radius:i,radialSegments:r,closed:u},void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed."),n=new cf(n,t,i,r,u),this.tangents=n.tangents,this.normals=n.normals,this.binormals=n.binormals,this.fromBufferGeometry(n),this.mergeVertices()}function cf(n,u,e,o,s){function b(t){var r,i,f;for(y=n.getPointAt(t/u,y),r=a.normals[t],t=a.binormals[t],c=0;c<=o;c++)i=c/o*Math.PI*2,f=Math.sin(i),i=-Math.cos(i),l.x=i*r.x+f*t.x,l.y=i*r.y+f*t.y,l.z=i*r.z+f*t.z,l.normalize(),d.push(l.x,l.y,l.z),v.x=y.x+e*l.x,v.y=y.y+e*l.y,v.z=y.z+e*l.z,k.push(v.x,v.y,v.z)}var a;f.call(this),this.type="TubeBufferGeometry",this.parameters={path:n,tubularSegments:u,radius:e,radialSegments:o,closed:s},u=u||64,e=e||1,o=o||8,s=s||!1,a=n.computeFrenetFrames(u,s),this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;for(var v=new t,l=new t,p=new i,y=new t,c,k=[],d=[],g=[],w=[],h=0;h<u;h++)b(h);for(b(!1===s?u:0),h=0;h<=u;h++)for(c=0;c<=o;c++)p.x=h/u,p.y=c/o,g.push(p.x,p.y);(function(){for(c=1;c<=u;c++)for(h=1;h<=o;h++){var n=(o+1)*c+(h-1),i=(o+1)*c+h,t=(o+1)*(c-1)+h;w.push((o+1)*(c-1)+(h-1),n,t),w.push(n,i,t)}})(),this.setIndex(w),this.setAttribute("position",new r(k,3)),this.setAttribute("normal",new r(d,3)),this.setAttribute("uv",new r(g,2))}function fc(n,t,i,r,u,f,e){h.call(this),this.type="TorusKnotGeometry",this.parameters={radius:n,tube:t,tubularSegments:i,radialSegments:r,p:u,q:f},void 0!==e&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new eo(n,t,i,r,u,f)),this.mergeVertices()}function eo(n,i,u,e,o,s){function tt(n,t,i,r,u){var f=Math.sin(n);t=i/t*n,i=Math.cos(t),u.x=r*(2+i)*.5*Math.cos(n),u.y=r*(2+i)*f*.5,u.z=r*Math.sin(t)*.5}var h,y,b;f.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:n,tube:i,tubularSegments:u,radialSegments:e,p:o,q:s},n=n||1,i=i||.4,u=Math.floor(u)||64,e=Math.floor(e)||8,o=o||2,s=s||3;for(var k=[],it=[],rt=[],d=[],l=new t,w=new t,a=new t,g=new t,p=new t,nt=new t,v=new t,c=0;c<=u;++c)for(h=c/u*o*Math.PI*2,tt(h,o,s,n,a),tt(h+.01,o,s,n,g),nt.subVectors(g,a),v.addVectors(g,a),p.crossVectors(nt,v),v.crossVectors(p,nt),p.normalize(),v.normalize(),h=0;h<=e;++h)y=h/e*Math.PI*2,b=-i*Math.cos(y),y=i*Math.sin(y),l.x=a.x+(b*v.x+y*p.x),l.y=a.y+(b*v.y+y*p.y),l.z=a.z+(b*v.z+y*p.z),it.push(l.x,l.y,l.z),w.subVectors(l,a).normalize(),rt.push(w.x,w.y,w.z),d.push(c/u),d.push(h/e);for(h=1;h<=u;h++)for(c=1;c<=e;c++)n=(e+1)*h+(c-1),i=(e+1)*h+c,o=(e+1)*(h-1)+c,k.push((e+1)*(h-1)+(c-1),n,o),k.push(n,i,o);this.setIndex(k),this.setAttribute("position",new r(it,3)),this.setAttribute("normal",new r(rt,3)),this.setAttribute("uv",new r(d,2))}function ec(n,t,i,r,u){h.call(this),this.type="TorusGeometry",this.parameters={radius:n,tube:t,radialSegments:i,tubularSegments:r,arc:u},this.fromBufferGeometry(new oo(n,t,i,r,u)),this.mergeVertices()}function oo(n,i,u,e,o){var l,v;f.call(this),this.type="TorusBufferGeometry",this.parameters={radius:n,tube:i,radialSegments:u,tubularSegments:e,arc:o},n=n||1,i=i||.4,u=Math.floor(u)||8,e=Math.floor(e)||6,o=o||2*Math.PI;for(var y=[],b=[],k=[],p=[],w=new t,c=new t,a=new t,h,s=0;s<=u;s++)for(h=0;h<=e;h++)l=h/e*o,v=s/u*Math.PI*2,c.x=(n+i*Math.cos(v))*Math.cos(l),c.y=(n+i*Math.cos(v))*Math.sin(l),c.z=i*Math.sin(v),b.push(c.x,c.y,c.z),w.x=n*Math.cos(l),w.y=n*Math.sin(l),a.subVectors(c,w).normalize(),k.push(a.x,a.y,a.z),p.push(h/e),p.push(s/u);for(s=1;s<=u;s++)for(h=1;h<=e;h++)n=(e+1)*(s-1)+h-1,i=(e+1)*(s-1)+h,o=(e+1)*s+h,y.push((e+1)*s+h-1,n,o),y.push(n,i,o);this.setIndex(y),this.setAttribute("position",new r(b,3)),this.setAttribute("normal",new r(k,3)),this.setAttribute("uv",new r(p,2))}function pd(n,t,i,r,u){for(var f,s=0,e=t,o=i-r;e<i;e+=r)s+=(n[o]-n[e])*(n[e+1]+n[o+1]),o=e;if(u===0<s)for(u=t;u<i;u+=r)f=kd(u,n[u],n[u+1],f);else for(u=i-r;u>=t;u-=r)f=kd(u,n[u],n[u+1],f);return f&&lf(f,f.next)&&(cc(f),f=f.next),f}function oc(n,t){if(!n)return n;t||(t=n);do{var i=!1;if(n.steiner||!lf(n,n.next)&&0!==ht(n.prev,n,n.next))n=n.next;else{if(cc(n),n=t=n.prev,n===n.next)break;i=!0}}while(i||n!==t);return t}function sc(n,t,i,r,u,f,e){var c,s,l,a,v,p,y,o,h;if(n){if(!e&&f){c=n,s=c;do null===s.z&&(s.z=bp(s.x,s.y,r,u,f)),s.prevZ=s.prev,s=s.nextZ=s.next;while(s!==c);s.prevZ.nextZ=null,s.prevZ=null,c=s,y=1;do{for(s=c,o=c=null,a=0;s;){for(a++,h=s,l=v=0;l<y&&(v++,h=h.nextZ,h);l++);for(p=y;0<v||0<p&&h;)0!==v&&(0===p||!h||s.z<=h.z)?(l=s,s=s.nextZ,v--):(l=h,h=h.nextZ,p--),o?o.nextZ=l:c=l,l.prevZ=o,o=l;s=h}o.nextZ=null,y*=2}while(1<a)}for(c=n;n.prev!==n.next;){if(s=n.prev,h=n.next,f)o=put(n,r,u,f);else n:if(o=n,a=o.prev,v=o,y=o.next,0<=ht(a,v,y))o=!1;else{for(l=o.next.next;l!==o.prev;){if(so(a.x,a.y,v.x,v.y,y.x,y.y,l.x,l.y)&&0<=ht(l.prev,l,l.next)){o=!1;break n}l=l.next}o=!0}if(o)t.push(s.i/i),t.push(n.i/i),t.push(h.i/i),cc(n),c=n=h.next;else if(n=h,n===c){if(e){if(1===e){e=t,c=i,s=n;do h=s.prev,o=s.next.next,!lf(h,o)&&wd(h,s,s.next,o)&&hc(h,o)&&hc(o,h)&&(e.push(h.i/c),e.push(s.i/c),e.push(o.i/c),cc(s),cc(s.next),s=n=o),s=s.next;while(s!==n);n=s,sc(n,t,i,r,u,f,2)}else if(2===e)n:{e=n;do{for(c=e.next.next;c!==e.prev;){if(s=e.i!==c.i){if(s=e,h=c,o=s.next.i!==h.i&&s.prev.i!==h.i){t:{o=s;do{if(o.i!==s.i&&o.next.i!==s.i&&o.i!==h.i&&o.next.i!==h.i&&wd(o,o.next,s,h)){o=!0;break t}o=o.next}while(o!==s);o=!1}o=!o}if(o=o&&hc(s,h)&&hc(h,s)){o=s,a=!1,v=(s.x+h.x)/2,h=(s.y+h.y)/2;do o.y>h!=o.next.y>h&&o.next.y!==o.y&&v<(o.next.x-o.x)*(h-o.y)/(o.next.y-o.y)+o.x&&(a=!a),o=o.next;while(o!==s);o=a}s=o}if(s){n=bd(e,c),e=oc(e,e.next),n=oc(n,n.next),sc(e,t,i,r,u,f),sc(n,t,i,r,u,f);break n}c=c.next}e=e.next}while(e!==n)}}else sc(oc(n),t,i,r,u,f,1);break}}}}function put(n,t,i,r){var f=n.prev,u=n.next;if(0<=ht(f,n,u))return!1;var o=f.x>n.x?f.x>u.x?f.x:u.x:n.x>u.x?n.x:u.x,s=f.y>n.y?f.y>u.y?f.y:u.y:n.y>u.y?n.y:u.y,e=bp(f.x<n.x?f.x<u.x?f.x:u.x:n.x<u.x?n.x:u.x,f.y<n.y?f.y<u.y?f.y:u.y:n.y<u.y?n.y:u.y,t,i,r);for(t=bp(o,s,t,i,r),i=n.prevZ,r=n.nextZ;i&&i.z>=e&&r&&r.z<=t;){if(i!==n.prev&&i!==n.next&&so(f.x,f.y,n.x,n.y,u.x,u.y,i.x,i.y)&&0<=ht(i.prev,i,i.next)||(i=i.prevZ,r!==n.prev&&r!==n.next&&so(f.x,f.y,n.x,n.y,u.x,u.y,r.x,r.y)&&0<=ht(r.prev,r,r.next)))return!1;r=r.nextZ}for(;i&&i.z>=e;){if(i!==n.prev&&i!==n.next&&so(f.x,f.y,n.x,n.y,u.x,u.y,i.x,i.y)&&0<=ht(i.prev,i,i.next))return!1;i=i.prevZ}for(;r&&r.z<=t;){if(r!==n.prev&&r!==n.next&&so(f.x,f.y,n.x,n.y,u.x,u.y,r.x,r.y)&&0<=ht(r.prev,r,r.next))return!1;r=r.nextZ}return!0}function wut(n,t){return n.x-t.x}function but(n,t){var i=t,f=n.x,r=n.y,o=-Infinity,e,u,s,h,c;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y&&(e=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y),e<=f&&e>o)){if(o=e,e===f){if(r===i.y)return i;if(r===i.next.y)return i.next}u=i.x<i.next.x?i:i.next}i=i.next}while(i!==t);if(!u)return null;if(f===o)return u.prev;for(t=u,e=u.x,s=u.y,h=Infinity,i=u.next;i!==t;)f>=i.x&&i.x>=e&&f!==i.x&&so(r<s?f:o,r,e,s,r<s?o:f,r,i.x,i.y)&&(c=Math.abs(r-i.y)/(f-i.x),(c<h||c===h&&i.x>u.x)&&hc(i,n)&&(u=i,h=c)),i=i.next;return u}function bp(n,t,i,r,u){return n=32767*(n-i)*u,t=32767*(t-r)*u,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,(n|n<<1)&1431655765|((t|t<<1)&1431655765)<<1}function kut(n){var t=n,i=n;do(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next;while(t!==n);return i}function so(n,t,i,r,u,f,e,o){return 0<=(u-e)*(t-o)-(n-e)*(f-o)&&0<=(n-e)*(r-o)-(i-e)*(t-o)&&0<=(i-e)*(f-o)-(u-e)*(r-o)}function ht(n,t,i){return(t.y-n.y)*(i.x-t.x)-(t.x-n.x)*(i.y-t.y)}function lf(n,t){return n.x===t.x&&n.y===t.y}function wd(n,t,i,r){return lf(n,i)&&lf(t,r)||lf(n,r)&&lf(i,t)?!0:0<ht(n,t,i)!=0<ht(n,t,r)&&0<ht(i,r,n)!=0<ht(i,r,t)}function hc(n,t){return 0>ht(n.prev,n,n.next)?0<=ht(n,t,n.next)&&0<=ht(n,n.prev,t):0>ht(n,t,n.prev)||0>ht(n,n.next,t)}function bd(n,t){var r=new kp(n.i,n.x,n.y),i=new kp(t.i,t.x,t.y),u=n.next,f=t.prev;return n.next=t,t.prev=n,r.next=u,u.prev=r,i.next=r,r.prev=i,f.next=i,i.prev=f,i}function kd(n,t,i,r){return n=new kp(n,t,i),r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function cc(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function kp(n,t,i){this.i=n,this.x=t,this.y=i,this.nextZ=this.prevZ=this.z=this.next=this.prev=null,this.steiner=!1}function dd(n){var t=n.length;2<t&&n[t-1].equals(n[0])&&n.pop()}function gd(n,t){for(var i=0;i<t.length;i++)n.push(t[i].x),n.push(t[i].y)}function af(n,t){h.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:n,options:t},this.fromBufferGeometry(new ur(n,t)),this.mergeVertices()}function ur(n,u){function c(n){function st(n,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(n)}function ri(n,t,r){var f=n.x-t.x,u=n.y-t.y,e=r.x-n.x,o=r.y-n.y,s=f*f+u*u,h,c;if(Math.abs(f*o-u*e)>Number.EPSILON){if(h=Math.sqrt(s),c=Math.sqrt(e*e+o*o),s=t.x-u/h,t=t.y+f/h,o=((r.x-o/c-s)*o-(r.y+e/c-t)*e)/(f*o-u*e),e=s+f*o-n.x,f=t+u*o-n.y,u=e*e+f*f,2>=u)return new i(e,f);u=Math.sqrt(u/2)}else n=!1,f>Number.EPSILON?e>Number.EPSILON&&(n=!0):f<-Number.EPSILON?e<-Number.EPSILON&&(n=!0):Math.sign(u)===Math.sign(o)&&(n=!0),n?(e=-u,u=Math.sqrt(s)):(e=f,f=u,u=Math.sqrt(s/2));return new i(e/u,f/u)}function ui(n,t){var h,u,f,c;for(r=n.length;0<=--r;)for(h=r,u=r-1,0>u&&(u=n.length-1),c=b+2*ft,f=0;f<c;f++){var i=d*f,s=d*(f+1),l=t+u+i,a=t+u+s;s=t+h+s,nt(t+h+i),nt(l),nt(s),nt(l),nt(a),nt(s),i=e.length/3,i=fi.generateSideWallUV(o,e,i-6,i-3,i-2,i-1),tt(i[0]),tt(i[1]),tt(i[3]),tt(i[1]),tt(i[2]),tt(i[3])}}function g(n,t,i){ht.push(n),ht.push(t),ht.push(i)}function wt(n,t,i){nt(n),nt(t),nt(i),n=e.length/3,n=fi.generateTopUV(o,e,n-3,n-2,n-1),tt(n[0]),tt(n[1]),tt(n[2])}function nt(n){e.push(ht[3*n]),e.push(ht[3*n+1]),e.push(ht[3*n+2])}function tt(n){s.push(n.x),s.push(n.y)}var ht=[],it=void 0!==u.curveSegments?u.curveSegments:12,b=void 0!==u.steps?u.steps:1,bt=void 0!==u.depth?u.depth:100,lt=void 0!==u.bevelEnabled?u.bevelEnabled:!0,kt=void 0!==u.bevelThickness?u.bevelThickness:6,dt=void 0!==u.bevelSize?u.bevelSize:kt-2,gt=void 0!==u.bevelOffset?u.bevelOffset:0,ft=void 0!==u.bevelSegments?u.bevelSegments:3,et=u.extrudePath,fi=void 0!==u.UVGenerator?u.UVGenerator:rtt,at,vt,w,p,h,l,ct,k,a,d,y,yt,pt,ut,ot,c;if(void 0!==u.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),bt=u.amount),at=!1,et){vt=et.getSpacedPoints(b),at=!0,lt=!1;var ni=et.computeFrenetFrames(b,!1),ti=new t,ii=new t,rt=new t}if(lt||(gt=dt=kt=ft=0),it=n.extractPoints(it),n=it.shape,p=it.holes,!vr.isClockWise(n))for(n=n.reverse(),h=0,w=p.length;h<w;h++)l=p[h],vr.isClockWise(l)&&(p[h]=l.reverse());for(ct=vr.triangulateShape(n,p),k=n,h=0,w=p.length;h<w;h++)l=p[h],n=n.concat(l);d=n.length,yt=ct.length,it=[];var r=0,f=k.length,v=f-1;for(a=r+1;r<f;r++,v++,a++)v===f&&(v=0),a===f&&(a=0),it[r]=ri(k[r],k[v],k[a]);for(et=[],pt=it.concat(),h=0,w=p.length;h<w;h++){for(l=p[h],ut=[],r=0,f=l.length,v=f-1,a=r+1;r<f;r++,v++,a++)v===f&&(v=0),a===f&&(a=0),ut[r]=ri(l[r],l[v],l[a]);et.push(ut),pt=pt.concat(ut)}for(v=0;v<ft;v++){for(f=v/ft,ot=kt*Math.cos(f*Math.PI/2),a=dt*Math.sin(f*Math.PI/2)+gt,r=0,f=k.length;r<f;r++)c=st(k[r],it[r],a),g(c.x,c.y,-ot);for(h=0,w=p.length;h<w;h++)for(l=p[h],ut=et[h],r=0,f=l.length;r<f;r++)c=st(l[r],ut[r],a),g(c.x,c.y,-ot)}for(a=dt+gt,r=0;r<d;r++)c=lt?st(n[r],pt[r],a):n[r],at?(ii.copy(ni.normals[0]).multiplyScalar(c.x),ti.copy(ni.binormals[0]).multiplyScalar(c.y),rt.copy(vt[0]).add(ii).add(ti),g(rt.x,rt.y,rt.z)):g(c.x,c.y,0);for(f=1;f<=b;f++)for(r=0;r<d;r++)c=lt?st(n[r],pt[r],a):n[r],at?(ii.copy(ni.normals[f]).multiplyScalar(c.x),ti.copy(ni.binormals[f]).multiplyScalar(c.y),rt.copy(vt[f]).add(ii).add(ti),g(rt.x,rt.y,rt.z)):g(c.x,c.y,bt/b*f);for(v=ft-1;0<=v;v--){for(f=v/ft,ot=kt*Math.cos(f*Math.PI/2),a=dt*Math.sin(f*Math.PI/2)+gt,r=0,f=k.length;r<f;r++)c=st(k[r],it[r],a),g(c.x,c.y,bt+ot);for(h=0,w=p.length;h<w;h++)for(l=p[h],ut=et[h],r=0,f=l.length;r<f;r++)c=st(l[r],ut[r],a),at?g(c.x,c.y+vt[b-1].y,vt[b-1].x+ot):g(c.x,c.y,bt+ot)}(function(){var t=e.length/3,n;if(lt){for(n=0*d,r=0;r<yt;r++)y=ct[r],wt(y[2]+n,y[1]+n,y[0]+n);for(n=d*(b+2*ft),r=0;r<yt;r++)y=ct[r],wt(y[0]+n,y[1]+n,y[2]+n)}else{for(r=0;r<yt;r++)y=ct[r],wt(y[2],y[1],y[0]);for(r=0;r<yt;r++)y=ct[r],wt(y[0]+d*b,y[1]+d*b,y[2]+d*b)}o.addGroup(t,e.length/3-t,0)})(),function(){var t=e.length/3,n=0;for(ui(k,n),n+=k.length,h=0,w=p.length;h<w;h++)l=p[h],ui(l,n),n+=l.length;o.addGroup(t,e.length/3-t,1)}()}f.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:n,options:u},n=Array.isArray(n)?n:[n];for(var o=this,e=[],s=[],h=0,l=n.length;h<l;h++)c(n[h]);this.setAttribute("position",new r(e,3)),this.setAttribute("uv",new r(s,2)),this.computeVertexNormals()}function ng(n,t,i){if(i.shapes=[],Array.isArray(n))for(var r=0,u=n.length;r<u;r++)i.shapes.push(n[r].uuid);else i.shapes.push(n.uuid);return void 0!==t.extrudePath&&(i.options.extrudePath=t.extrudePath.toJSON()),i}function lc(n,t){h.call(this),this.type="TextGeometry",this.parameters={text:n,parameters:t},this.fromBufferGeometry(new ho(n,t)),this.mergeVertices()}function ho(n,t){t=t||{};var i=t.font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new h;n=i.generateShapes(n,t.size),t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),ur.call(this,n,t),this.type="TextBufferGeometry"}function ac(n,t,i,r,u,f,e){h.call(this),this.type="SphereGeometry",this.parameters={radius:n,widthSegments:t,heightSegments:i,phiStart:r,phiLength:u,thetaStart:f,thetaLength:e},this.fromBufferGeometry(new vu(n,t,i,r,u,f,e)),this.mergeVertices()}function vu(n,i,u,e,o,s,h){var w;f.call(this),this.type="SphereBufferGeometry",this.parameters={radius:n,widthSegments:i,heightSegments:u,phiStart:e,phiLength:o,thetaStart:s,thetaLength:h},n=n||1,i=Math.max(3,Math.floor(i)||8),u=Math.max(2,Math.floor(u)||6),e=void 0!==e?e:0,o=void 0!==o?o:2*Math.PI,s=void 0!==s?s:0,h=void 0!==h?h:Math.PI;for(var d=Math.min(s+h,Math.PI),l,rt=0,v=[],a=new t,y=new t,b=[],g=[],nt=[],tt=[],c=0;c<=u;c++){var it=[],p=c/u,k=0;for(0==c&&0==s?k=.5/i:c==u&&d==Math.PI&&(k=-.5/i),l=0;l<=i;l++)w=l/i,a.x=-n*Math.cos(e+w*o)*Math.sin(s+p*h),a.y=n*Math.cos(s+p*h),a.z=n*Math.sin(e+w*o)*Math.sin(s+p*h),g.push(a.x,a.y,a.z),y.copy(a).normalize(),nt.push(y.x,y.y,y.z),tt.push(w+k,1-p),it.push(rt++);v.push(it)}for(c=0;c<u;c++)for(l=0;l<i;l++)n=v[c][l+1],e=v[c][l],o=v[c+1][l],h=v[c+1][l+1],(0!==c||0<s)&&b.push(n,e,h),(c!==u-1||d<Math.PI)&&b.push(e,o,h);this.setIndex(b),this.setAttribute("position",new r(g,3)),this.setAttribute("normal",new r(nt,3)),this.setAttribute("uv",new r(tt,2))}function vc(n,t,i,r,u,f){h.call(this),this.type="RingGeometry",this.parameters={innerRadius:n,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:u,thetaLength:f},this.fromBufferGeometry(new co(n,t,i,r,u,f)),this.mergeVertices()}function co(n,u,e,o,s,h){f.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:n,outerRadius:u,thetaSegments:e,phiSegments:o,thetaStart:s,thetaLength:h},n=n||.5,u=u||1,s=void 0!==s?s:0,h=void 0!==h?h:2*Math.PI,e=void 0!==e?Math.max(3,e):8,o=void 0!==o?Math.max(1,o):1;for(var p=[],w=[],b=[],k=[],v=n,d=(u-n)/o,l=new t,y=new i,c,a=0;a<=o;a++){for(c=0;c<=e;c++)n=s+c/e*h,l.x=v*Math.cos(n),l.y=v*Math.sin(n),w.push(l.x,l.y,l.z),b.push(0,0,1),y.x=(l.x/u+1)/2,y.y=(l.y/u+1)/2,k.push(y.x,y.y);v+=d}for(a=0;a<o;a++)for(u=a*(e+1),c=0;c<e;c++)n=c+u,s=n+e+1,h=n+e+2,v=n+1,p.push(n,s,v),p.push(s,h,v);this.setIndex(p),this.setAttribute("position",new r(w,3)),this.setAttribute("normal",new r(b,3)),this.setAttribute("uv",new r(k,2))}function yc(n,t,i,r){h.call(this),this.type="LatheGeometry",this.parameters={points:n,segments:t,phiStart:i,phiLength:r},this.fromBufferGeometry(new lo(n,t,i,r)),this.mergeVertices()}function lo(n,u,e,o){f.call(this),this.type="LatheBufferGeometry",this.parameters={points:n,segments:u,phiStart:e,phiLength:o},u=Math.floor(u)||12,e=e||0,o=o||2*Math.PI,o=a.clamp(o,0,2*Math.PI);for(var c=[],v=[],y=[],w=1/u,l=new t,p=new i,h=0;h<=u;h++)for(var s=e+h*w*o,b=Math.sin(s),k=Math.cos(s),s=0;s<=n.length-1;s++)l.x=n[s].x*b,l.y=n[s].y,l.z=n[s].x*k,v.push(l.x,l.y,l.z),p.x=h/u,p.y=s/(n.length-1),y.push(p.x,p.y);for(h=0;h<u;h++)for(s=0;s<n.length-1;s++)e=s+h*n.length,w=e+n.length,l=e+n.length+1,p=e+1,c.push(e,w,p),c.push(w,l,p);if(this.setIndex(c),this.setAttribute("position",new r(v,3)),this.setAttribute("uv",new r(y,2)),this.computeVertexNormals(),o===2*Math.PI)for(o=this.attributes.normal.array,c=new t,v=new t,y=new t,e=u*n.length*3,s=h=0;h<n.length;h++,s+=3)c.x=o[s+0],c.y=o[s+1],c.z=o[s+2],v.x=o[e+s+0],v.y=o[e+s+1],v.z=o[e+s+2],y.addVectors(c,v).normalize(),o[s+0]=o[e+s+0]=y.x,o[s+1]=o[e+s+1]=y.y,o[s+2]=o[e+s+2]=y.z}function vf(n,t){h.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:n,curveSegments:t},this.fromBufferGeometry(new yf(n,t)),this.mergeVertices()}function yf(n,t){function o(n){var f,l=e.length/3,i,o,r,a;for(n=n.extractPoints(t),i=n.shape,o=n.holes,!1===vr.isClockWise(i)&&(i=i.reverse()),n=0,f=o.length;n<f;n++)r=o[n],!0===vr.isClockWise(r)&&(o[n]=r.reverse());for(a=vr.triangulateShape(i,o),n=0,f=o.length;n<f;n++)r=o[n],i=i.concat(r);for(n=0,f=i.length;n<f;n++)r=i[n],e.push(r.x,r.y,0),h.push(0,0,1),c.push(r.x,r.y);for(n=0,f=a.length;n<f;n++)i=a[n],s.push(i[0]+l,i[1]+l,i[2]+l),u+=3}var i;f.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:n,curveSegments:t},t=t||12;var s=[],e=[],h=[],c=[],l=0,u=0;if(!1===Array.isArray(n))o(n);else for(i=0;i<n.length;i++)o(n[i]),this.addGroup(l,u,i),l+=u,u=0;this.setIndex(s),this.setAttribute("position",new r(e,3)),this.setAttribute("normal",new r(h,3)),this.setAttribute("uv",new r(c,2))}function tg(n,t){if(t.shapes=[],Array.isArray(n))for(var i=0,r=n.length;i<r;i++)t.shapes.push(n[i].uuid);else t.shapes.push(n.uuid);return t}function ao(n,t){var v,u,s,w,y,l,o,p;f.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},v=[],t=Math.cos(a.DEG2RAD*(void 0!==t?t:1));var i=[0,0],c={},e=["a","b","c"];for(n.isBufferGeometry?(u=new h,u.fromBufferGeometry(n)):u=n.clone(),u.mergeVertices(),u.computeFaceNormals(),n=u.vertices,u=u.faces,s=0,w=u.length;s<w;s++)for(y=u[s],l=0;3>l;l++)o=y[e[l]],p=y[e[(l+1)%3]],i[0]=Math.min(o,p),i[1]=Math.max(o,p),o=i[0]+","+i[1],void 0===c[o]?c[o]={index1:i[0],index2:i[1],face1:s,face2:void 0}:c[o].face2=s;for(o in c)(i=c[o],void 0===i.face2||u[i.face1].normal.dot(u[i.face2].normal)<=t)&&(e=n[i.index1],v.push(e.x,e.y,e.z),e=n[i.index2],v.push(e.x,e.y,e.z));this.setAttribute("position",new r(v,3))}function pf(n,t,i,r,u,f,e,o){h.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:n,radiusBottom:t,height:i,radialSegments:r,heightSegments:u,openEnded:f,thetaStart:e,thetaLength:o},this.fromBufferGeometry(new kr(n,t,i,r,u,f,e,o)),this.mergeVertices()}function kr(n,u,e,o,s,h,c,l){function nt(r){for(var s=new i,e=new t,nt=0,it=!0===r?n:u,y=!0===r?1:-1,ut=v,rt,h,tt,f=1;f<=o;f++)p.push(0,g*y,0),w.push(0,y,0),b.push(.5,.5),v++;for(rt=v,f=0;f<=o;f++)h=f/o*l+c,tt=Math.cos(h),h=Math.sin(h),e.x=it*h,e.y=g*y,e.z=it*tt,p.push(e.x,e.y,e.z),w.push(0,y,0),s.x=.5*tt+.5,s.y=.5*h*y+.5,b.push(s.x,s.y),v++;for(f=0;f<o;f++)s=ut+f,e=rt+f,!0===r?a.push(e,e+1,s):a.push(e+1,e,s),nt+=3;d.addGroup(k,nt,!0===r?1:2),k+=nt}var d;f.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:n,radiusBottom:u,height:e,radialSegments:o,heightSegments:s,openEnded:h,thetaStart:c,thetaLength:l},d=this,n=void 0!==n?n:1,u=void 0!==u?u:1,e=e||1,o=Math.floor(o)||8,s=Math.floor(s)||1,h=void 0!==h?h:!1,c=void 0!==c?c:0,l=void 0!==l?l:2*Math.PI;var a=[],p=[],w=[],b=[],v=0,y=[],g=e/2,k=0;(function(){for(var i,h=new t,f=new t,it=0,tt=(u-n)/e,r=0;r<=s;r++){var ut=[],rt=r/s,ft=rt*(u-n)+n;for(i=0;i<=o;i++){var et=i/o,nt=et*l+c,ot=Math.sin(nt);nt=Math.cos(nt),f.x=ft*ot,f.y=-rt*e+g,f.z=ft*nt,p.push(f.x,f.y,f.z),h.set(ot,tt,nt).normalize(),w.push(h.x,h.y,h.z),b.push(et,1-rt),ut.push(v++)}y.push(ut)}for(i=0;i<o;i++)for(r=0;r<s;r++)h=y[r+1][i],f=y[r+1][i+1],tt=y[r][i+1],a.push(y[r][i],h,tt),a.push(h,f,tt),it+=6;d.addGroup(k,it,0),k+=it})(),!1===h&&(0<n&&nt(!0),0<u&&nt(!1)),this.setIndex(a),this.setAttribute("position",new r(p,3)),this.setAttribute("normal",new r(w,3)),this.setAttribute("uv",new r(b,2))}function pc(n,t,i,r,u,f,e){pf.call(this,0,n,t,i,r,u,f,e),this.type="ConeGeometry",this.parameters={radius:n,height:t,radialSegments:i,heightSegments:r,openEnded:u,thetaStart:f,thetaLength:e}}function wc(n,t,i,r,u,f,e){kr.call(this,0,n,t,i,r,u,f,e),this.type="ConeBufferGeometry",this.parameters={radius:n,height:t,radialSegments:i,heightSegments:r,openEnded:u,thetaStart:f,thetaLength:e}}function bc(n,t,i,r){h.call(this),this.type="CircleGeometry",this.parameters={radius:n,segments:t,thetaStart:i,thetaLength:r},this.fromBufferGeometry(new vo(n,t,i,r)),this.mergeVertices()}function vo(n,u,e,o){var a,p;f.call(this),this.type="CircleBufferGeometry",this.parameters={radius:n,segments:u,thetaStart:e,thetaLength:o},n=n||1,u=void 0!==u?Math.max(3,u):8,e=void 0!==e?e:0,o=void 0!==o?o:2*Math.PI;var w=[],h=[],v=[],y=[],s,c=new t,l=new i;for(h.push(0,0,0),v.push(0,0,1),y.push(.5,.5),a=0,s=3;a<=u;a++,s+=3)p=e+a/u*o,c.x=n*Math.cos(p),c.y=n*Math.sin(p),h.push(c.x,c.y,c.z),v.push(0,0,1),l.x=(h[s]/n+1)/2,l.y=(h[s+1]/n+1)/2,y.push(l.x,l.y);for(s=1;s<=u;s++)w.push(s,s+1,0);this.setIndex(w),this.setAttribute("position",new r(h,3)),this.setAttribute("normal",new r(v,3)),this.setAttribute("uv",new r(y,2))}function wf(n){l.call(this),this.type="ShadowMaterial",this.color=new e(0),this.transparent=!0,this.setValues(n)}function yo(n){at.call(this,n),this.type="RawShaderMaterial"}function fr(n){l.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new e(16777215),this.metalness=this.roughness=.5,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new e(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new i(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.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(n)}function bf(n){fr.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoatRoughness=this.clearcoat=0,this.sheen=null,this.clearcoatNormalScale=new i(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(n)}function ai(n){l.call(this),this.type="MeshPhongMaterial",this.color=new e(16777215),this.specular=new e(1118481),this.shininess=30,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new e(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.specularMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(n)}function kf(n){ai.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(n)}function df(n){l.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.morphNormals=this.morphTargets=this.skinning=this.fog=!1,this.setValues(n)}function gf(n){l.call(this),this.type="MeshLambertMaterial",this.color=new e(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new e(0),this.emissiveIntensity=1,this.envMap=this.alphaMap=this.specularMap=this.emissiveMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(n)}function ne(n){l.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new e(16777215),this.bumpMap=this.map=this.matcap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(n)}function te(n){b.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(n)}function ti(n,t,i,r){this.parameterPositions=n,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i}function la(n,t,i,r){ti.call(this,n,t,i,r),this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function kc(n,t,i,r){ti.call(this,n,t,i,r)}function aa(n,t,i,r){ti.call(this,n,t,i,r)}function ct(n,t,i,r){if(void 0===n)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+n);this.name=n,this.times=ut.convertArray(t,this.TimeBufferType),this.values=ut.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function va(n,t,i){ct.call(this,n,t,i)}function ya(n,t,i,r){ct.call(this,n,t,i,r)}function po(n,t,i,r){ct.call(this,n,t,i,r)}function pa(n,t,i,r){ti.call(this,n,t,i,r)}function dc(n,t,i,r){ct.call(this,n,t,i,r)}function wa(n,t,i,r){ct.call(this,n,t,i,r)}function wo(n,t,i,r){ct.call(this,n,t,i,r)}function ei(n,t,i){this.name=n,this.tracks=i,this.duration=void 0!==t?t:-1,this.uuid=a.generateUUID(),0>this.duration&&this.resetDuration()}function dut(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return po;case"vector":case"vector2":case"vector3":case"vector4":return wo;case"color":return ya;case"quaternion":return dc;case"bool":case"boolean":return va;case"string":return wa}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+n);}function gut(n){var t,i,r;if(void 0===n.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");return t=dut(n.type),void 0===n.times&&(i=[],r=[],ut.flattenJSON(n.keys,i,r,"value"),n.times=i,n.values=r),void 0!==t.parse?t.parse(n):new t(n.name,n.times,n.values,n.interpolation)}function dp(n,t,i){var r=this,o=!1,f=0,e=0,s=void 0,u=[];this.onStart=void 0,this.onLoad=n,this.onProgress=t,this.onError=i,this.itemStart=function(n){if(e++,!1===o&&void 0!==r.onStart)r.onStart(n,f,e);o=!0},this.itemEnd=function(n){if(f++,void 0!==r.onProgress)r.onProgress(n,f,e);f===e&&(o=!1,void 0!==r.onLoad)&&r.onLoad()},this.itemError=function(n){if(void 0!==r.onError)r.onError(n)},this.resolveURL=function(n){return s?s(n):n},this.setURLModifier=function(n){return s=n,this},this.addHandler=function(n,t){return u.push(n,t),this},this.removeHandler=function(n){return n=u.indexOf(n),-1!==n&&u.splice(n,2),this},this.getHandler=function(n){for(var r,t=0,i=u.length;t<i;t+=2)if(r=u[t+1],u[t].test(n))return r;return null}}function w(n){this.manager=void 0!==n?n:uk,this.crossOrigin="anonymous",this.resourcePath=this.path=""}function oi(n){w.call(this,n)}function gp(n){w.call(this,n)}function nw(n){w.call(this,n)}function ba(n){w.call(this,n)}function bo(n){w.call(this,n)}function ka(n){w.call(this,n)}function da(n){w.call(this,n)}function s(){this.type="Curve",this.arcLengthDivisions=200}function ii(n,t,i,r,u,f,e,o){s.call(this),this.type="EllipseCurve",this.aX=n||0,this.aY=t||0,this.xRadius=i||1,this.yRadius=r||1,this.aStartAngle=u||0,this.aEndAngle=f||2*Math.PI,this.aClockwise=e||!1,this.aRotation=o||0}function ko(n,t,i,r,u,f){ii.call(this,n,t,i,i,r,u,f),this.type="ArcCurve"}function tw(){var n=0,t=0,i=0,r=0;return{initCatmullRom:function(u,f,e,o,s){u=s*(e-u),o=s*(o-f),n=f,t=u,i=-3*f+3*e-2*u-o,r=2*f-2*e+u+o},initNonuniformCatmullRom:function(u,f,e,o,s,h,c){u=((f-u)/s-(e-u)/(s+h)+(e-f)/h)*h,o=((e-f)/h-(o-f)/(h+c)+(o-e)/c)*h,n=f,t=u,i=-3*f+3*e-2*u-o,r=2*f-2*e+u+o},calc:function(u){var f=u*u;return n+t*u+i*f+r*f*u}}}function vt(n,t,i,r){s.call(this),this.type="CatmullRomCurve3",this.points=n||[],this.closed=t||!1,this.curveType=i||"centripetal",this.tension=r||.5}function ig(n,t,i,r,u){t=.5*(r-t),u=.5*(u-i);var f=n*n;return(2*i-2*r+t+u)*n*f+(-3*i+3*r-2*t-u)*f+t*n+i}function gc(n,t,i,r){var u=1-n;return u*u*t+2*(1-n)*n*i+n*n*r}function nl(n,t,i,r,u){var f=1-n,e=1-n;return f*f*f*t+3*e*e*n*i+3*(1-n)*n*n*r+n*n*n*u}function vi(n,t,r,u){s.call(this),this.type="CubicBezierCurve",this.v0=n||new i,this.v1=t||new i,this.v2=r||new i,this.v3=u||new i}function er(n,i,r,u){s.call(this),this.type="CubicBezierCurve3",this.v0=n||new t,this.v1=i||new t,this.v2=r||new t,this.v3=u||new t}function dt(n,t){s.call(this),this.type="LineCurve",this.v1=n||new i,this.v2=t||new i}function yi(n,i){s.call(this),this.type="LineCurve3",this.v1=n||new t,this.v2=i||new t}function pi(n,t,r){s.call(this),this.type="QuadraticBezierCurve",this.v0=n||new i,this.v1=t||new i,this.v2=r||new i}function or(n,i,r){s.call(this),this.type="QuadraticBezierCurve3",this.v0=n||new t,this.v1=i||new t,this.v2=r||new t}function wi(n){s.call(this),this.type="SplineCurve",this.points=n||[]}function dr(){s.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function bi(n){dr.call(this),this.type="Path",this.currentPoint=new i,n&&this.setFromPoints(n)}function yu(n){bi.call(this,n),this.uuid=a.generateUUID(),this.type="Shape",this.holes=[]}function g(n,t){u.call(this),this.type="Light",this.color=new e(n),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function ga(n,t,i){g.call(this,n,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(u.DefaultUp),this.updateMatrix(),this.groundColor=new e(t)}function sr(n){this.camera=n,this.bias=0,this.radius=1,this.mapSize=new i(512,512),this.mapPass=this.map=null,this.matrix=new v,this._frustum=new hh,this._frameExtents=new i(1,1),this._viewportCount=1,this._viewports=[new p(0,0,1,1)]}function nv(){sr.call(this,new it(50,1,.5,500))}function tv(n,t,i,r,f,e){g.call(this,n,t),this.type="SpotLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.target=new u,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(n){this.intensity=n/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==f?f:0,this.decay=void 0!==e?e:1,this.shadow=new nv}function iw(){sr.call(this,new it(90,1,.5,500)),this._frameExtents=new i(4,2),this._viewportCount=6,this._viewports=[new p(2,1,1,1),new p(0,1,1,1),new p(3,1,1,1),new p(1,1,1,1),new p(3,0,1,1),new p(1,0,1,1)],this._cubeDirections=[new t(1,0,0),new t(-1,0,0),new t(0,0,1),new t(0,0,-1),new t(0,1,0),new t(0,-1,0)],this._cubeUps=[new t(0,1,0),new t(0,1,0),new t(0,1,0),new t(0,1,0),new t(0,0,1),new t(0,0,-1)]}function iv(n,t,i,r){g.call(this,n,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(n){this.intensity=n/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==r?r:1,this.shadow=new iw}function tl(n,t,i,r,u,f){rr.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==n?n:-1,this.right=void 0!==t?t:1,this.top=void 0!==i?i:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==u?u:.1,this.far=void 0!==f?f:2e3,this.updateProjectionMatrix()}function rv(){sr.call(this,new tl(-5,5,5,-5,.5,500))}function uv(n,t){g.call(this,n,t),this.type="DirectionalLight",this.position.copy(u.DefaultUp),this.updateMatrix(),this.target=new u,this.shadow=new rv}function fv(n,t){g.call(this,n,t),this.type="AmbientLight",this.castShadow=void 0}function ev(n,t,i,r){g.call(this,n,t),this.type="RectAreaLight",this.width=void 0!==i?i:10,this.height=void 0!==r?r:10}function ov(n){w.call(this,n),this.textures={}}function sv(){f.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function hv(n,t,i,r){"number"==typeof i&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),c.call(this,n,t,i),this.meshPerAttribute=r||1}function cv(n){w.call(this,n)}function lv(n){w.call(this,n)}function rw(n){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),w.call(this,n),this.options=void 0}function uw(){this.type="ShapePath",this.color=new e,this.subPaths=[],this.currentPath=null}function fw(n){this.type="Font",this.data=n}function ew(n){w.call(this,n)}function av(n){w.call(this,n)}function vv(){this.coefficients=[];for(var n=0;9>n;n++)this.coefficients.push(new t)}function ki(n,t){g.call(this,void 0,t),this.sh=void 0!==n?n:new vv}function ow(n,i,r){ki.call(this,void 0,r),n=(new e).set(n),r=(new e).set(i),i=new t(n.r,n.g,n.b),n=new t(r.r,r.g,r.b),r=Math.sqrt(Math.PI);var u=r*Math.sqrt(.75);this.sh.coefficients[0].copy(i).add(n).multiplyScalar(r),this.sh.coefficients[1].copy(i).sub(n).multiplyScalar(u)}function sw(n,t){ki.call(this,void 0,t),n=(new e).set(n),this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}function rg(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new it,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new it,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function hw(n){this.autoStart=void 0!==n?n:!0,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1}function cw(){u.call(this),this.type="AudioListener",this.context=dy.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new hw}function go(n){u.call(this),this.type="Audio",this.listener=n,this.context=n.context,this.gain=this.context.createGain(),this.gain.connect(n.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.offset=this.loopEnd=this.loopStart=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._pausedAt=this._startedAt=0,this.filters=[]}function lw(n){go.call(this,n),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function aw(n,t){this.analyser=n.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),n.getOutput().connect(this.analyser)}function vw(n,t,i){this.binding=n,this.valueSize=i,n=Float64Array;switch(t){case"quaternion":t=this._slerp;break;case"string":case"bool":n=Array,t=this._select;break;default:t=this._lerp}this.buffer=new n(4*i),this._mixBufferRegion=t,this.referenceCount=this.useCount=this.cumulativeWeight=0}function ug(n,t,i){i=i||yt.parseTrackName(t),this._targetGroup=n,this._bindings=n.subscribe_(t,i)}function yt(n,t,i){this.path=t,this.parsedPath=i||yt.parseTrackName(t),this.node=yt.findNode(n,this.parsedPath.nodeName)||n,this.rootNode=n}function fg(){var i,n,r,t;for(this.uuid=a.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0,i={},this._indicesByUUID=i,n=0,r=arguments.length;n!==r;++n)i[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={},t=this,this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}function eg(n,t,i){var u,r,f;for(this._mixer=n,this._clip=t,this._localRoot=i||null,n=t.tracks,t=n.length,i=Array(t),u={endingStart:2400,endingEnd:2400},r=0;r!==t;++r)f=n[r].createInterpolant(null),i[r]=f,f.settings=u;this._interpolantSettings=u,this._interpolants=i,this._propertyBindings=Array(t),this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1,this.repetitions=Infinity,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0}function yw(n){this._root=n,this._initMemoryManager(),this.time=this._accuIndex=0,this.timeScale=1}function yv(n,t){"string"==typeof n&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),n=t),this.value=n}function pw(n,t,i){br.call(this,n,t),this.meshPerAttribute=i||1}function og(n,t,i,r){this.ray=new rf(n,t),this.near=i||0,this.far=r||Infinity,this.camera=null,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}}})}function sg(n,t){return n.distance-t.distance}function ww(n,t,i,r){if(!1!==n.visible&&(n.raycast(t,i),!0===r)){n=n.children,r=0;for(var u=n.length;r<u;r++)ww(n[r],t,i,!0)}}function hg(n,t,i){return this.radius=void 0!==n?n:1,this.phi=void 0!==t?t:0,this.theta=void 0!==i?i:0,this}function cg(n,t,i){return this.radius=void 0!==n?n:1,this.theta=void 0!==t?t:0,this.y=void 0!==i?i:0,this}function bw(n,t){this.min=void 0!==n?n:new i(Infinity,Infinity),this.max=void 0!==t?t:new i(-Infinity,-Infinity)}function kw(n,i){this.start=void 0!==n?n:new t,this.end=void 0!==i?i:new t}function il(n){u.call(this),this.material=n,this.render=function(){}}function rl(n,t,i,u){this.object=n,this.size=void 0!==t?t:1,n=void 0!==i?i:16711680,u=void 0!==u?u:1,t=0,(i=this.object.geometry)&&i.isGeometry?t=3*i.faces.length:i&&i.isBufferGeometry&&(t=i.attributes.normal.count),i=new f,t=new r(6*t,3),i.setAttribute("position",t),d.call(this,i,new b({color:n,linewidth:u})),this.matrixAutoUpdate=!1,this.update()}function ns(n,t){var i,e,o,s;for(u.call(this),this.light=n,this.light.updateMatrixWorld(),this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,n=new f,t=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,e=1;32>i;i++,e++)o=i/32*Math.PI*2,s=e/32*Math.PI*2,t.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1);n.setAttribute("position",new r(t,3)),t=new b({fog:!1}),this.cone=new d(n,t),this.add(this.cone),this.update()}function lg(n){var t=[],i;for(n&&n.isBone&&t.push(n),i=0;i<n.children.length;i++)t.push.apply(t,lg(n.children[i]));return t}function ts(n){for(var l,i=lg(n),u=new f,t=[],o=[],s=new e(0,0,1),h=new e(0,1,0),c=0;c<i.length;c++)l=i[c],l.parent&&l.parent.isBone&&(t.push(0,0,0),t.push(0,0,0),o.push(s.r,s.g,s.b),o.push(h.r,h.g,h.b));u.setAttribute("position",new r(t,3)),u.setAttribute("color",new r(o,3)),t=new b({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0}),d.call(this,u,t),this.root=n,this.bones=i,this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1}function is(n,t,i){this.light=n,this.light.updateMatrixWorld(),this.color=i,n=new vu(t,4,2),t=new gt({wireframe:!0,fog:!1}),tt.call(this,n,t),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function rs(n,t){this.type="RectAreaLightHelper",this.light=n,this.color=t,n=new f,n.setAttribute("position",new r([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere(),t=new b({fog:!1}),st.call(this,n,t),n=new f,n.setAttribute("position",new r([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),n.computeBoundingSphere(),this.add(new tt(n,new gt({side:1,fog:!1}))),this.update()}function us(n,t,i){u.call(this),this.light=n,this.light.updateMatrixWorld(),this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,n=new hf(t),n.rotateY(.5*Math.PI),this.material=new gt({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2),t=n.getAttribute("position"),t=new Float32Array(3*t.count),n.setAttribute("color",new c(t,3)),this.add(new tt(n,this.material)),this.update()}function fs(n,t){this.lightProbe=n,this.size=t,n=new at({defines:{GAMMA_OUTPUT:""},uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:"varying vec3 vNormal;\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"#define RECIPROCAL_PI 0.318309886\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n\t// matrix is assumed to be orthogonal\n\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\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// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\t// normal is assumed to have unit length\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\t// band 1\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\t// band 2\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nuniform vec3 sh[ 9 ]; // sh coefficients\nuniform float intensity; // light probe intensity\nvarying vec3 vNormal;\nvoid main() {\n\tvec3 normal = normalize( vNormal );\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );\n\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;\n\toutgoingLight = linearToOutput( outgoingLight );\n\tgl_FragColor = vec4( outgoingLight, 1.0 );\n}"}),t=new vu(1,32,16),tt.call(this,t,n),this.onBeforeRender()}function pv(n,t,i,u){var l;n=n||10,t=t||10,i=new e(void 0!==i?i:4473924),u=new e(void 0!==u?u:8947848);var v=t/2,y=n/t,s=n/2;n=[];for(var h=[],a=0,o=0,c=-s;a<=t;a++,c+=y)n.push(-s,0,c,s,0,c),n.push(c,0,-s,c,0,s),l=a===v?i:u,l.toArray(h,o),o+=3,l.toArray(h,o),o+=3,l.toArray(h,o),o+=3,l.toArray(h,o),o+=3;t=new f,t.setAttribute("position",new r(n,3)),t.setAttribute("color",new r(h,3)),i=new b({vertexColors:2}),d.call(this,t,i)}function wv(n,t,i,u,o,s){var a,v,l,h,y,c,p;for(n=n||10,t=t||16,i=i||8,u=u||64,o=new e(void 0!==o?o:4473924),s=new e(void 0!==s?s:8947848),a=[],v=[],l=0;l<=t;l++)h=l/t*2*Math.PI,y=Math.sin(h)*n,h=Math.cos(h)*n,a.push(0,0,0),a.push(y,0,h),c=l&1?o:s,v.push(c.r,c.g,c.b),v.push(c.r,c.g,c.b);for(l=0;l<=i;l++)for(c=l&1?o:s,p=n-n/i*l,t=0;t<u;t++)h=t/u*2*Math.PI,y=Math.sin(h)*p,h=Math.cos(h)*p,a.push(y,0,h),v.push(c.r,c.g,c.b),h=(t+1)/u*2*Math.PI,y=Math.sin(h)*p,h=Math.cos(h)*p,a.push(y,0,h),v.push(c.r,c.g,c.b);n=new f,n.setAttribute("position",new r(a,3)),n.setAttribute("color",new r(v,3)),a=new b({vertexColors:2}),d.call(this,n,a)}function es(n,t,i,r){this.audio=n,this.range=t||1,this.divisionsInnerAngle=i||16,this.divisionsOuterAngle=r||2,n=new f,t=new Float32Array(3*(3*(this.divisionsInnerAngle+2*this.divisionsOuterAngle)+3)),n.setAttribute("position",new c(t,3)),t=new b({color:65280}),i=new b({color:16776960}),st.call(this,n,[i,t]),this.update()}function ul(n,t,i,u){this.object=n,this.size=void 0!==t?t:1,n=void 0!==i?i:16776960,u=void 0!==u?u:1,t=0,(i=this.object.geometry)&&i.isGeometry?t=i.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead."),i=new f,t=new r(6*t,3),i.setAttribute("position",t),d.call(this,i,new b({color:n,linewidth:u})),this.matrixAutoUpdate=!1,this.update()}function os(n,t,i){u.call(this),this.light=n,this.light.updateMatrixWorld(),this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===t&&(t=1),n=new f,n.setAttribute("position",new r([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3)),t=new b({fog:!1}),this.lightPlane=new st(n,t),this.add(this.lightPlane),n=new f,n.setAttribute("position",new r([0,0,0,0,0,1],3)),this.targetLine=new st(n,t),this.add(this.targetLine),this.update()}function fl(n){function t(n,t,i){a(n,i),a(t,i)}function a(n,t){c.push(0,0,0),v.push(t.r,t.g,t.b),void 0===o[n]&&(o[n]=[]),o[n].push(c.length/3-1)}var h=new f,y=new b({color:16777215,vertexColors:1}),c=[],v=[],o={},i=new e(16755200),s=new e(16711680),l=new e(43775),p=new e(16777215),u=new e(3355443);t("n1","n2",i),t("n2","n4",i),t("n4","n3",i),t("n3","n1",i),t("f1","f2",i),t("f2","f4",i),t("f4","f3",i),t("f3","f1",i),t("n1","f1",i),t("n2","f2",i),t("n3","f3",i),t("n4","f4",i),t("p","n1",s),t("p","n2",s),t("p","n3",s),t("p","n4",s),t("u1","u2",l),t("u2","u3",l),t("u3","u1",l),t("c","t",p),t("p","c",u),t("cn1","cn2",u),t("cn3","cn4",u),t("cf1","cf2",u),t("cf3","cf4",u),h.setAttribute("position",new r(c,3)),h.setAttribute("color",new r(v,3)),d.call(this,h,y),this.camera=n,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=n.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function rt(n,t,i,r,u,f,e){if(ta.set(u,f,e).unproject(r),n=t[n],void 0!==n)for(i=i.getAttribute("position"),t=0,r=n.length;t<r;t++)i.setXYZ(n[t],ta.x,ta.y,ta.z)}function gr(n,t){this.object=n,void 0===t&&(t=16776960),n=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]);var r=new Float32Array(24),i=new f;i.setIndex(new c(n,1)),i.setAttribute("position",new c(r,3)),d.call(this,i,new b({color:t})),this.matrixAutoUpdate=!1,this.update()}function el(n,t){this.type="Box3Helper",this.box=n,t=t||16776960,n=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]);var i=new f;i.setIndex(new c(n,1)),i.setAttribute("position",new r([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),d.call(this,i,new b({color:t})),this.geometry.computeBoundingSphere()}function ol(n,t,i){this.type="PlaneHelper",this.plane=n,this.size=void 0===t?1:t,n=void 0!==i?i:16776960,t=new f,t.setAttribute("position",new r([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,0,1,0,0,0],3)),t.computeBoundingSphere(),st.call(this,t,new b({color:n})),t=new f,t.setAttribute("position",new r([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),t.computeBoundingSphere(),this.add(new tt(t,new gt({color:n,opacity:.2,transparent:!0,depthWrite:!1})))}function nu(n,i,e,o,s,h){u.call(this),void 0===n&&(n=new t(0,0,1)),void 0===i&&(i=new t(0,0,0)),void 0===e&&(e=1),void 0===o&&(o=16776960),void 0===s&&(s=.2*e),void 0===h&&(h=.2*s),void 0===ip&&(ip=new f,ip.setAttribute("position",new r([0,0,0,0,1,0],3)),wk=new kr(0,.5,1,5,1),wk.translate(0,-.5,0)),this.position.copy(i),this.line=new st(ip,new b({color:o})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new tt(wk,new gt({color:o})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(n),this.setLength(e,s,h)}function sl(n){n=n||1;var t=[0,0,0,n,0,0,0,0,0,0,n,0,0,0,0,0,0,n];n=new f,n.setAttribute("position",new r(t,3)),n.setAttribute("color",new r([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),t=new b({vertexColors:2}),d.call(this,n,t)}function ag(n){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),vt.call(this,n),this.type="catmullrom",this.closed=!0}function vg(n){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),vt.call(this,n),this.type="catmullrom"}function dw(n){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),vt.call(this,n),this.type="catmullrom"}var ot,ss,a,bv,gw,pu,hs,tu,yg,nb,tb,dg,tn,he,vl,oy,db,gb,bl,tk,ik,kn,kl,dl,itt,vr,rtt,pt,utt,ut,gu,uk,si,py,wy,by,ky,dy,sk,hk,ck,lk,gl,vk,ta,nt,ia,pk,ip,wk;for(void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(n){return"number"==typeof n&&isFinite(n)&&Math.floor(n)===n}),void 0===Math.sign&&(Math.sign=function(n){return 0>n?-1:0<n?1:+n}),!1==("name"in Function.prototype)&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(n){var u,i,t,r;if(void 0===n||null===n)throw new TypeError("Cannot convert undefined or null to object");for(u=Object(n),i=1;i<arguments.length;i++)if(t=arguments[i],void 0!==t&&null!==t)for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(u[r]=t[r]);return u}),Object.assign(hi.prototype,{addEventListener:function(n,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[n]&&(i[n]=[]),-1===i[n].indexOf(t)&&i[n].push(t)},hasEventListener:function(n,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[n]&&-1!==i[n].indexOf(t)},removeEventListener:function(n,t){void 0!==this._listeners&&(n=this._listeners[n],void 0!==n&&(t=n.indexOf(t),-1!==t&&n.splice(t,1)))},dispatchEvent:function(n){var t,i,r;if(void 0!==this._listeners&&(t=this._listeners[n.type],void 0!==t))for(n.target=this,t=t.slice(0),i=0,r=t.length;i<r;i++)t[i].call(this,n)}}),ot=[],ss=0;256>ss;ss++)ot[ss]=(16>ss?"0":"")+ss.toString(16);a={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var n=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(ot[n&255]+ot[n>>8&255]+ot[n>>16&255]+ot[n>>24&255]+"-"+ot[t&255]+ot[t>>8&255]+"-"+ot[t>>16&15|64]+ot[t>>24&255]+"-"+ot[i&63|128]+ot[i>>8&255]+"-"+ot[i>>16&255]+ot[i>>24&255]+ot[r&255]+ot[r>>8&255]+ot[r>>16&255]+ot[r>>24&255]).toUpperCase()},clamp:function(n,t,i){return Math.max(t,Math.min(i,n))},euclideanModulo:function(n,t){return(n%t+t)%t},mapLinear:function(n,t,i,r,u){return r+(n-t)*(u-r)/(i-t)},lerp:function(n,t,i){return(1-i)*n+i*t},smoothstep:function(n,t,i){return n<=t?0:n>=i?1:(n=(n-t)/(i-t),n*n*(3-2*n))},smootherstep:function(n,t,i){return n<=t?0:n>=i?1:(n=(n-t)/(i-t),n*n*n*(n*(6*n-15)+10))},randInt:function(n,t){return n+Math.floor(Math.random()*(t-n+1))},randFloat:function(n,t){return n+Math.random()*(t-n)},randFloatSpread:function(n){return n*(.5-Math.random())},degToRad:function(n){return n*a.DEG2RAD},radToDeg:function(n){return n*a.RAD2DEG},isPowerOfTwo:function(n){return 0==(n&n-1)&&0!==n},ceilPowerOfTwo:function(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))},floorPowerOfTwo:function(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}},Object.defineProperties(i.prototype,{width:{get:function(){return this.x},set:function(n){this.x=n}},height:{get:function(){return this.y},set:function(n){this.y=n}}}),Object.assign(i.prototype,{isVector2:!0,set:function(n,t){return this.x=n,this.y=t,this},setScalar:function(n){return this.y=this.x=n,this},setX:function(n){return this.x=n,this},setY:function(n){return this.y=n,this},setComponent:function(n,t){switch(n){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+n);}return this},getComponent:function(n){switch(n){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+n);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(n){return this.x=n.x,this.y=n.y,this},add:function(n,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(n,t)):(this.x+=n.x,this.y+=n.y,this)},addScalar:function(n){return this.x+=n,this.y+=n,this},addVectors:function(n,t){return this.x=n.x+t.x,this.y=n.y+t.y,this},addScaledVector:function(n,t){return this.x+=n.x*t,this.y+=n.y*t,this},sub:function(n,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(n,t)):(this.x-=n.x,this.y-=n.y,this)},subScalar:function(n){return this.x-=n,this.y-=n,this},subVectors:function(n,t){return this.x=n.x-t.x,this.y=n.y-t.y,this},multiply:function(n){return this.x*=n.x,this.y*=n.y,this},multiplyScalar:function(n){return this.x*=n,this.y*=n,this},divide:function(n){return this.x/=n.x,this.y/=n.y,this},divideScalar:function(n){return this.multiplyScalar(1/n)},applyMatrix3:function(n){var t=this.x,i=this.y;return n=n.elements,this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this},min:function(n){return this.x=Math.min(this.x,n.x),this.y=Math.min(this.y,n.y),this},max:function(n){return this.x=Math.max(this.x,n.x),this.y=Math.max(this.y,n.y),this},clamp:function(n,t){return this.x=Math.max(n.x,Math.min(t.x,this.x)),this.y=Math.max(n.y,Math.min(t.y,this.y)),this},clampScalar:function(n,t){return this.x=Math.max(n,Math.min(t,this.x)),this.y=Math.max(n,Math.min(t,this.y)),this},clampLength:function(n,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(n,Math.min(t,i)))},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(n){return this.x*n.x+this.y*n.y},cross:function(n){return this.x*n.y-this.y*n.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var n=Math.atan2(this.y,this.x);return 0>n&&(n+=2*Math.PI),n},distanceTo:function(n){return Math.sqrt(this.distanceToSquared(n))},distanceToSquared:function(n){var t=this.x-n.x;return n=this.y-n.y,t*t+n*n},manhattanDistanceTo:function(n){return Math.abs(this.x-n.x)+Math.abs(this.y-n.y)},setLength:function(n){return this.normalize().multiplyScalar(n)},lerp:function(n,t){return this.x+=(n.x-this.x)*t,this.y+=(n.y-this.y)*t,this},lerpVectors:function(n,t,i){return this.subVectors(t,n).multiplyScalar(i).add(n)},equals:function(n){return n.x===this.x&&n.y===this.y},fromArray:function(n,t){return void 0===t&&(t=0),this.x=n[t],this.y=n[t+1],this},toArray:function(n,t){return void 0===n&&(n=[]),void 0===t&&(t=0),n[t]=this.x,n[t+1]=this.y,n},fromBufferAttribute:function(n,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=n.getX(t),this.y=n.getY(t),this},rotateAround:function(n,t){var u=Math.cos(t),i,r;return t=Math.sin(t),i=this.x-n.x,r=this.y-n.y,this.x=i*u-r*t+n.x,this.y=i*t+r*u+n.y,this}}),Object.assign(lt,{slerp:function(n,t,i,r){return i.copy(n).slerp(t,r)},slerpFlat:function(n,t,i,r,u,f,e){var o=i[r+0],s=i[r+1],h=i[r+2],v,y;if(i=i[r+3],r=u[f+0],v=u[f+1],y=u[f+2],u=u[f+3],i!==u||o!==r||s!==v||h!==y){f=1-e;var c=o*r+s*v+h*y+i*u,l=0<=c?1:-1,a=1-c*c;a>Number.EPSILON&&(a=Math.sqrt(a),c=Math.atan2(a,c*l),f=Math.sin(f*c)/a,e=Math.sin(e*c)/a),l*=e,o=o*f+r*l,s=s*f+v*l,h=h*f+y*l,i=i*f+u*l,f===1-e&&(e=1/Math.sqrt(o*o+s*s+h*h+i*i),o*=e,s*=e,h*=e,i*=e)}n[t]=o,n[t+1]=s,n[t+2]=h,n[t+3]=i}}),Object.defineProperties(lt.prototype,{x:{get:function(){return this._x},set:function(n){this._x=n,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(n){this._y=n,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(n){this._z=n,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(n){this._w=n,this._onChangeCallback()}}}),Object.assign(lt.prototype,{isQuaternion:!0,set:function(n,t,i,r){return this._x=n,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(n){return this._x=n.x,this._y=n.y,this._z=n.z,this._w=n.w,this._onChangeCallback(),this},setFromEuler:function(n,t){if(!n||!n.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=n._x,u=n._y,f=n._z;n=n.order;var i=Math.cos,s=Math.sin,e=i(r/2),o=i(u/2);return i=i(f/2),r=s(r/2),u=s(u/2),f=s(f/2),"XYZ"===n?(this._x=r*o*i+e*u*f,this._y=e*u*i-r*o*f,this._z=e*o*f+r*u*i,this._w=e*o*i-r*u*f):"YXZ"===n?(this._x=r*o*i+e*u*f,this._y=e*u*i-r*o*f,this._z=e*o*f-r*u*i,this._w=e*o*i+r*u*f):"ZXY"===n?(this._x=r*o*i-e*u*f,this._y=e*u*i+r*o*f,this._z=e*o*f+r*u*i,this._w=e*o*i-r*u*f):"ZYX"===n?(this._x=r*o*i-e*u*f,this._y=e*u*i+r*o*f,this._z=e*o*f-r*u*i,this._w=e*o*i+r*u*f):"YZX"===n?(this._x=r*o*i+e*u*f,this._y=e*u*i+r*o*f,this._z=e*o*f-r*u*i,this._w=e*o*i-r*u*f):"XZY"===n&&(this._x=r*o*i-e*u*f,this._y=e*u*i-r*o*f,this._z=e*o*f+r*u*i,this._w=e*o*i+r*u*f),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(n,t){t/=2;var i=Math.sin(t);return this._x=n.x*i,this._y=n.y*i,this._z=n.z*i,this._w=Math.cos(t),this._onChangeCallback(),this},setFromRotationMatrix:function(n){var i=n.elements,t=i[0],h;n=i[4];var u=i[8],f=i[1],r=i[5],e=i[9],o=i[2],s=i[6];return i=i[10],h=t+r+i,0<h?(t=.5/Math.sqrt(h+1),this._w=.25/t,this._x=(s-e)*t,this._y=(u-o)*t,this._z=(f-n)*t):t>r&&t>i?(t=2*Math.sqrt(1+t-r-i),this._w=(s-e)/t,this._x=.25*t,this._y=(n+f)/t,this._z=(u+o)/t):r>i?(t=2*Math.sqrt(1+r-t-i),this._w=(u-o)/t,this._x=(n+f)/t,this._y=.25*t,this._z=(e+s)/t):(t=2*Math.sqrt(1+i-t-r),this._w=(f-n)/t,this._x=(u+o)/t,this._y=(e+s)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(n,t){var i=n.dot(t)+1;return 1e-6>i?(i=0,Math.abs(n.x)>Math.abs(n.z)?(this._x=-n.y,this._y=n.x,this._z=0):(this._x=0,this._y=-n.z,this._z=n.y)):(this._x=n.y*t.z-n.z*t.y,this._y=n.z*t.x-n.x*t.z,this._z=n.x*t.y-n.y*t.x),this._w=i,this.normalize()},angleTo:function(n){return 2*Math.acos(Math.abs(a.clamp(this.dot(n),-1,1)))},rotateTowards:function(n,t){var i=this.angleTo(n);return 0===i?this:(this.slerp(n,Math.min(1,t/i)),this)},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(n){return this._x*n._x+this._y*n._y+this._z*n._z+this._w*n._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 n=this.length();return 0===n?(this._z=this._y=this._x=0,this._w=1):(n=1/n,this._x*=n,this._y*=n,this._z*=n,this._w*=n),this._onChangeCallback(),this},multiply:function(n,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(n,t)):this.multiplyQuaternions(this,n)},premultiply:function(n){return this.multiplyQuaternions(n,this)},multiplyQuaternions:function(n,t){var i=n._x,r=n._y,u=n._z;n=n._w;var f=t._x,e=t._y,o=t._z;return t=t._w,this._x=i*t+n*f+r*o-u*e,this._y=r*t+n*e+u*f-i*o,this._z=u*t+n*o+i*e-r*f,this._w=n*t-i*f-r*e-u*o,this._onChangeCallback(),this},slerp:function(n,t){var o;if(0===t)return this;if(1===t)return this.copy(n);var r=this._x,u=this._y,f=this._z,e=this._w,i=e*n._w+r*n._x+u*n._y+f*n._z;return(0>i?(this._w=-n._w,this._x=-n._x,this._y=-n._y,this._z=-n._z,i=-i):this.copy(n),1<=i)?(this._w=e,this._x=r,this._y=u,this._z=f,this):(n=1-i*i,n<=Number.EPSILON)?(i=1-t,this._w=i*e+t*this._w,this._x=i*r+t*this._x,this._y=i*u+t*this._y,this._z=i*f+t*this._z,this.normalize(),this._onChangeCallback(),this):(n=Math.sqrt(n),o=Math.atan2(n,i),i=Math.sin((1-t)*o)/n,t=Math.sin(t*o)/n,this._w=e*i+this._w*t,this._x=r*i+this._x*t,this._y=u*i+this._y*t,this._z=f*i+this._z*t,this._onChangeCallback(),this)},equals:function(n){return n._x===this._x&&n._y===this._y&&n._z===this._z&&n._w===this._w},fromArray:function(n,t){return void 0===t&&(t=0),this._x=n[t],this._y=n[t+1],this._z=n[t+2],this._w=n[t+3],this._onChangeCallback(),this},toArray:function(n,t){return void 0===n&&(n=[]),void 0===t&&(t=0),n[t]=this._x,n[t+1]=this._y,n[t+2]=this._z,n[t+3]=this._w,n},_onChange:function(n){return this._onChangeCallback=n,this},_onChangeCallback:function(){}}),bv=new t,gw=new lt,Object.assign(t.prototype,{isVector3:!0,set:function(n,t,i){return this.x=n,this.y=t,this.z=i,this},setScalar:function(n){return this.z=this.y=this.x=n,this},setX:function(n){return this.x=n,this},setY:function(n){return this.y=n,this},setZ:function(n){return this.z=n,this},setComponent:function(n,t){switch(n){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+n);}return this},getComponent:function(n){switch(n){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+n);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(n){return this.x=n.x,this.y=n.y,this.z=n.z,this},add:function(n,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(n,t)):(this.x+=n.x,this.y+=n.y,this.z+=n.z,this)},addScalar:function(n){return this.x+=n,this.y+=n,this.z+=n,this},addVectors:function(n,t){return this.x=n.x+t.x,this.y=n.y+t.y,this.z=n.z+t.z,this},addScaledVector:function(n,t){return this.x+=n.x*t,this.y+=n.y*t,this.z+=n.z*t,this},sub:function(n,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(n,t)):(this.x-=n.x,this.y-=n.y,this.z-=n.z,this)},subScalar:function(n){return this.x-=n,this.y-=n,this.z-=n,this},subVectors:function(n,t){return this.x=n.x-t.x,this.y=n.y-t.y,this.z=n.z-t.z,this},multiply:function(n,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(n,t)):(this.x*=n.x,this.y*=n.y,this.z*=n.z,this)},multiplyScalar:function(n){return this.x*=n,this.y*=n,this.z*=n,this},multiplyVectors:function(n,t){return this.x=n.x*t.x,this.y=n.y*t.y,this.z=n.z*t.z,this},applyEuler:function(n){return n&&n.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(gw.setFromEuler(n))},applyAxisAngle:function(n,t){return this.applyQuaternion(gw.setFromAxisAngle(n,t))},applyMatrix3:function(n){var t=this.x,i=this.y,r=this.z;return n=n.elements,this.x=n[0]*t+n[3]*i+n[6]*r,this.y=n[1]*t+n[4]*i+n[7]*r,this.z=n[2]*t+n[5]*i+n[8]*r,this},applyMatrix4:function(n){var t=this.x,i=this.y,r=this.z,u;return n=n.elements,u=1/(n[3]*t+n[7]*i+n[11]*r+n[15]),this.x=(n[0]*t+n[4]*i+n[8]*r+n[12])*u,this.y=(n[1]*t+n[5]*i+n[9]*r+n[13])*u,this.z=(n[2]*t+n[6]*i+n[10]*r+n[14])*u,this},applyQuaternion:function(n){var t=this.x,f=this.y,e=this.z,i=n.x,r=n.y,u=n.z;n=n.w;var o=n*t+r*e-u*f,s=n*f+u*t-i*e,h=n*e+i*f-r*t;return t=-i*t-r*f-u*e,this.x=o*n+t*-i+s*-u-h*-r,this.y=s*n+t*-r+h*-i-o*-u,this.z=h*n+t*-u+o*-r-s*-i,this},project:function(n){return this.applyMatrix4(n.matrixWorldInverse).applyMatrix4(n.projectionMatrix)},unproject:function(n){return this.applyMatrix4(n.projectionMatrixInverse).applyMatrix4(n.matrixWorld)},transformDirection:function(n){var t=this.x,i=this.y,r=this.z;return n=n.elements,this.x=n[0]*t+n[4]*i+n[8]*r,this.y=n[1]*t+n[5]*i+n[9]*r,this.z=n[2]*t+n[6]*i+n[10]*r,this.normalize()},divide:function(n){return this.x/=n.x,this.y/=n.y,this.z/=n.z,this},divideScalar:function(n){return this.multiplyScalar(1/n)},min:function(n){return this.x=Math.min(this.x,n.x),this.y=Math.min(this.y,n.y),this.z=Math.min(this.z,n.z),this},max:function(n){return this.x=Math.max(this.x,n.x),this.y=Math.max(this.y,n.y),this.z=Math.max(this.z,n.z),this},clamp:function(n,t){return this.x=Math.max(n.x,Math.min(t.x,this.x)),this.y=Math.max(n.y,Math.min(t.y,this.y)),this.z=Math.max(n.z,Math.min(t.z,this.z)),this},clampScalar:function(n,t){return this.x=Math.max(n,Math.min(t,this.x)),this.y=Math.max(n,Math.min(t,this.y)),this.z=Math.max(n,Math.min(t,this.z)),this},clampLength:function(n,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(n,Math.min(t,i)))},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(n){return this.x*n.x+this.y*n.y+this.z*n.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)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(n){return this.normalize().multiplyScalar(n)},lerp:function(n,t){return this.x+=(n.x-this.x)*t,this.y+=(n.y-this.y)*t,this.z+=(n.z-this.z)*t,this},lerpVectors:function(n,t,i){return this.subVectors(t,n).multiplyScalar(i).add(n)},cross:function(n,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(n,t)):this.crossVectors(this,n)},crossVectors:function(n,t){var u=n.x,f=n.y,i,r;return n=n.z,i=t.x,r=t.y,t=t.z,this.x=f*t-n*r,this.y=n*i-u*t,this.z=u*r-f*i,this},projectOnVector:function(n){var t=n.dot(this)/n.lengthSq();return this.copy(n).multiplyScalar(t)},projectOnPlane:function(n){return bv.copy(this).projectOnVector(n),this.sub(bv)},reflect:function(n){return this.sub(bv.copy(n).multiplyScalar(2*this.dot(n)))},angleTo:function(n){var t=Math.sqrt(this.lengthSq()*n.lengthSq());return 0===t&&console.error("THREE.Vector3: angleTo() can't handle zero length vectors."),n=this.dot(n)/t,Math.acos(a.clamp(n,-1,1))},distanceTo:function(n){return Math.sqrt(this.distanceToSquared(n))},distanceToSquared:function(n){var t=this.x-n.x,i=this.y-n.y;return n=this.z-n.z,t*t+i*i+n*n},manhattanDistanceTo:function(n){return Math.abs(this.x-n.x)+Math.abs(this.y-n.y)+Math.abs(this.z-n.z)},setFromSpherical:function(n){return this.setFromSphericalCoords(n.radius,n.phi,n.theta)},setFromSphericalCoords:function(n,t,i){var r=Math.sin(t)*n;return this.x=r*Math.sin(i),this.y=Math.cos(t)*n,this.z=r*Math.cos(i),this},setFromCylindrical:function(n){return this.setFromCylindricalCoords(n.radius,n.theta,n.y)},setFromCylindricalCoords:function(n,t,i){return this.x=n*Math.sin(t),this.y=i,this.z=n*Math.cos(t),this},setFromMatrixPosition:function(n){return n=n.elements,this.x=n[12],this.y=n[13],this.z=n[14],this},setFromMatrixScale:function(n){var t=this.setFromMatrixColumn(n,0).length(),i=this.setFromMatrixColumn(n,1).length();return n=this.setFromMatrixColumn(n,2).length(),this.x=t,this.y=i,this.z=n,this},setFromMatrixColumn:function(n,t){return this.fromArray(n.elements,4*t)},equals:function(n){return n.x===this.x&&n.y===this.y&&n.z===this.z},fromArray:function(n,t){return void 0===t&&(t=0),this.x=n[t],this.y=n[t+1],this.z=n[t+2],this},toArray:function(n,t){return void 0===n&&(n=[]),void 0===t&&(t=0),n[t]=this.x,n[t+1]=this.y,n[t+2]=this.z,n},fromBufferAttribute:function(n,t,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=n.getX(t),this.y=n.getY(t),this.z=n.getZ(t),this}}),pu=new t,Object.assign(ft.prototype,{isMatrix3:!0,set:function(n,t,i,r,u,f,e,o,s){var h=this.elements;return h[0]=n,h[1]=r,h[2]=e,h[3]=t,h[4]=u,h[5]=o,h[6]=i,h[7]=f,h[8]=s,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(n){var t=this.elements;return n=n.elements,t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(n){return n=n.elements,this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this},applyToBufferAttribute:function(n){for(var t=0,i=n.count;t<i;t++)pu.x=n.getX(t),pu.y=n.getY(t),pu.z=n.getZ(t),pu.applyMatrix3(this),n.setXYZ(t,pu.x,pu.y,pu.z);return n},multiply:function(n){return this.multiplyMatrices(this,n)},premultiply:function(n){return this.multiplyMatrices(n,this)},multiplyMatrices:function(n,t){var i=n.elements,r=t.elements;t=this.elements,n=i[0];var u=i[3],f=i[6],e=i[1],o=i[4],s=i[7],h=i[2],c=i[5];i=i[8];var l=r[0],a=r[3],v=r[6],y=r[1],p=r[4],w=r[7],b=r[2],k=r[5];return r=r[8],t[0]=n*l+u*y+f*b,t[3]=n*a+u*p+f*k,t[6]=n*v+u*w+f*r,t[1]=e*l+o*y+s*b,t[4]=e*a+o*p+s*k,t[7]=e*v+o*w+s*r,t[2]=h*l+c*y+i*b,t[5]=h*a+c*p+i*k,t[8]=h*v+c*w+i*r,this},multiplyScalar:function(n){var t=this.elements;return t[0]*=n,t[3]*=n,t[6]*=n,t[1]*=n,t[4]*=n,t[7]*=n,t[2]*=n,t[5]*=n,t[8]*=n,this},determinant:function(){var n=this.elements,t=n[0],i=n[1],r=n[2],u=n[3],f=n[4],e=n[5],o=n[6],s=n[7];return n=n[8],t*f*n-t*e*s-i*u*n+i*e*o+r*u*s-r*f*o},getInverse:function(n,t){var i;n&&n.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument."),i=n.elements,n=this.elements;var r=i[0],u=i[1],f=i[2],e=i[3],o=i[4],s=i[5],h=i[6],c=i[7];i=i[8];var l=i*o-s*c,a=s*h-i*e,v=c*e-o*h,y=r*l+u*a+f*v;if(0===y){if(!0===t)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()}return t=1/y,n[0]=l*t,n[1]=(f*c-i*u)*t,n[2]=(s*u-f*o)*t,n[3]=a*t,n[4]=(i*r-f*h)*t,n[5]=(f*e-s*r)*t,n[6]=v*t,n[7]=(u*h-c*r)*t,n[8]=(o*r-u*e)*t,this},transpose:function(){var n=this.elements,t=n[1];return n[1]=n[3],n[3]=t,t=n[2],n[2]=n[6],n[6]=t,t=n[5],n[5]=n[7],n[7]=t,this},getNormalMatrix:function(n){return this.setFromMatrix4(n).getInverse(this).transpose()},transposeIntoArray:function(n){var t=this.elements;return n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],this},setUvTransform:function(n,t,i,r,u,f,e){var o=Math.cos(u);u=Math.sin(u),this.set(i*o,i*u,-i*(o*f+u*e)+f+n,-r*u,r*o,-r*(-u*f+o*e)+e+t,0,0,1)},scale:function(n,t){var i=this.elements;return i[0]*=n,i[3]*=n,i[6]*=n,i[1]*=t,i[4]*=t,i[7]*=t,this},rotate:function(n){var i=Math.cos(n);n=Math.sin(n);var t=this.elements,r=t[0],u=t[3],f=t[6],e=t[1],o=t[4],s=t[7];return t[0]=i*r+n*e,t[3]=i*u+n*o,t[6]=i*f+n*s,t[1]=-n*r+i*e,t[4]=-n*u+i*o,t[7]=-n*f+i*s,this},translate:function(n,t){var i=this.elements;return i[0]+=n*i[2],i[3]+=n*i[5],i[6]+=n*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this},equals:function(n){var i=this.elements,t;for(n=n.elements,t=0;9>t;t++)if(i[t]!==n[t])return!1;return!0},fromArray:function(n,t){void 0===t&&(t=0);for(var i=0;9>i;i++)this.elements[i]=n[i+t];return this},toArray:function(n,t){void 0===n&&(n=[]),void 0===t&&(t=0);var i=this.elements;return n[t]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=i[3],n[t+4]=i[4],n[t+5]=i[5],n[t+6]=i[6],n[t+7]=i[7],n[t+8]=i[8],n}}),tu={getDataURL:function(n){if("undefined"==typeof HTMLCanvasElement)return n.src;if(!(n instanceof HTMLCanvasElement)){void 0===hs&&(hs=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),hs.width=n.width,hs.height=n.height;var t=hs.getContext("2d");n instanceof ImageData?t.putImageData(n,0,0):t.drawImage(n,0,0,n.width,n.height),n=hs}return 2048<n.width||2048<n.height?n.toDataURL("image/jpeg",.6):n.toDataURL("image/png")}},yg=0,k.DEFAULT_IMAGE=void 0,k.DEFAULT_MAPPING=300,k.prototype=Object.assign(Object.create(hi.prototype),{constructor:k,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.name=n.name,this.image=n.image,this.mipmaps=n.mipmaps.slice(0),this.mapping=n.mapping,this.wrapS=n.wrapS,this.wrapT=n.wrapT,this.magFilter=n.magFilter,this.minFilter=n.minFilter,this.anisotropy=n.anisotropy,this.format=n.format,this.type=n.type,this.offset.copy(n.offset),this.repeat.copy(n.repeat),this.center.copy(n.center),this.rotation=n.rotation,this.matrixAutoUpdate=n.matrixAutoUpdate,this.matrix.copy(n.matrix),this.generateMipmaps=n.generateMipmaps,this.premultiplyAlpha=n.premultiplyAlpha,this.flipY=n.flipY,this.unpackAlignment=n.unpackAlignment,this.encoding=n.encoding,this},toJSON:function(n){var f=void 0===n||"string"==typeof n,i,t,r,u,e;if(!f&&void 0!==n.textures[this.uuid])return n.textures[this.uuid];if(i={metadata:{version:4.5,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],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment},void 0!==this.image){if(t=this.image,void 0===t.uuid&&(t.uuid=a.generateUUID()),!f&&void 0===n.images[t.uuid]){if(Array.isArray(t))for(r=[],u=0,e=t.length;u<e;u++)r.push(tu.getDataURL(t[u]));else r=tu.getDataURL(t);n.images[t.uuid]={uuid:t.uuid,url:r}}i.image=t.uuid}return f||(n.textures[this.uuid]=i),i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(n){if(300!==this.mapping)return n;if(n.applyMatrix3(this.matrix),0>n.x||1<n.x)switch(this.wrapS){case 1e3:n.x-=Math.floor(n.x);break;case 1001:n.x=0>n.x?0:1;break;case 1002:n.x=1===Math.abs(Math.floor(n.x)%2)?Math.ceil(n.x)-n.x:n.x-Math.floor(n.x)}if(0>n.y||1<n.y)switch(this.wrapT){case 1e3:n.y-=Math.floor(n.y);break;case 1001:n.y=0>n.y?0:1;break;case 1002:n.y=1===Math.abs(Math.floor(n.y)%2)?Math.ceil(n.y)-n.y:n.y-Math.floor(n.y)}return this.flipY&&(n.y=1-n.y),n}}),Object.defineProperty(k.prototype,"needsUpdate",{set:function(n){!0===n&&this.version++}}),Object.defineProperties(p.prototype,{width:{get:function(){return this.z},set:function(n){this.z=n}},height:{get:function(){return this.w},set:function(n){this.w=n}}}),Object.assign(p.prototype,{isVector4:!0,set:function(n,t,i,r){return this.x=n,this.y=t,this.z=i,this.w=r,this},setScalar:function(n){return this.w=this.z=this.y=this.x=n,this},setX:function(n){return this.x=n,this},setY:function(n){return this.y=n,this},setZ:function(n){return this.z=n,this},setW:function(n){return this.w=n,this},setComponent:function(n,t){switch(n){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+n);}return this},getComponent:function(n){switch(n){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: "+n);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(n){return this.x=n.x,this.y=n.y,this.z=n.z,this.w=void 0!==n.w?n.w:1,this},add:function(n,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(n,t)):(this.x+=n.x,this.y+=n.y,this.z+=n.z,this.w+=n.w,this)},addScalar:function(n){return this.x+=n,this.y+=n,this.z+=n,this.w+=n,this},addVectors:function(n,t){return this.x=n.x+t.x,this.y=n.y+t.y,this.z=n.z+t.z,this.w=n.w+t.w,this},addScaledVector:function(n,t){return this.x+=n.x*t,this.y+=n.y*t,this.z+=n.z*t,this.w+=n.w*t,this},sub:function(n,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(n,t)):(this.x-=n.x,this.y-=n.y,this.z-=n.z,this.w-=n.w,this)},subScalar:function(n){return this.x-=n,this.y-=n,this.z-=n,this.w-=n,this},subVectors:function(n,t){return this.x=n.x-t.x,this.y=n.y-t.y,this.z=n.z-t.z,this.w=n.w-t.w,this},multiplyScalar:function(n){return this.x*=n,this.y*=n,this.z*=n,this.w*=n,this},applyMatrix4:function(n){var t=this.x,i=this.y,r=this.z,u=this.w;return n=n.elements,this.x=n[0]*t+n[4]*i+n[8]*r+n[12]*u,this.y=n[1]*t+n[5]*i+n[9]*r+n[13]*u,this.z=n[2]*t+n[6]*i+n[10]*r+n[14]*u,this.w=n[3]*t+n[7]*i+n[11]*r+n[15]*u,this},divideScalar:function(n){return this.multiplyScalar(1/n)},setAxisAngleFromQuaternion:function(n){this.w=2*Math.acos(n.w);var t=Math.sqrt(1-n.w*n.w);return.0001>t?(this.x=1,this.z=this.y=0):(this.x=n.x/t,this.y=n.y/t,this.z=n.z/t),this},setAxisAngleFromRotationMatrix:function(n){n=n.elements;var e=n[0],t=n[4],u=n[8],h=n[1],o=n[5],f=n[9],i=n[2],r=n[6],s=n[10];return.01>Math.abs(t-h)&&.01>Math.abs(u-i)&&.01>Math.abs(f-r)?.1>Math.abs(t+h)&&.1>Math.abs(u+i)&&.1>Math.abs(f+r)&&.1>Math.abs(e+o+s-3)?(this.set(1,0,0,0),this):(n=Math.PI,e=(e+1)/2,o=(o+1)/2,s=(s+1)/2,t=(t+h)/4,u=(u+i)/4,f=(f+r)/4,e>o&&e>s?.01>e?(r=0,t=i=.707106781):(r=Math.sqrt(e),i=t/r,t=u/r):o>s?.01>o?(r=.707106781,i=0,t=.707106781):(i=Math.sqrt(o),r=t/i,t=f/i):.01>s?(i=r=.707106781,t=0):(t=Math.sqrt(s),r=u/t,i=f/t),this.set(r,i,t,n),this):(n=Math.sqrt((r-f)*(r-f)+(u-i)*(u-i)+(h-t)*(h-t)),.001>Math.abs(n)&&(n=1),this.x=(r-f)/n,this.y=(u-i)/n,this.z=(h-t)/n,this.w=Math.acos((e+o+s-1)/2),this)},min:function(n){return this.x=Math.min(this.x,n.x),this.y=Math.min(this.y,n.y),this.z=Math.min(this.z,n.z),this.w=Math.min(this.w,n.w),this},max:function(n){return this.x=Math.max(this.x,n.x),this.y=Math.max(this.y,n.y),this.z=Math.max(this.z,n.z),this.w=Math.max(this.w,n.w),this},clamp:function(n,t){return this.x=Math.max(n.x,Math.min(t.x,this.x)),this.y=Math.max(n.y,Math.min(t.y,this.y)),this.z=Math.max(n.z,Math.min(t.z,this.z)),this.w=Math.max(n.w,Math.min(t.w,this.w)),this},clampScalar:function(n,t){return this.x=Math.max(n,Math.min(t,this.x)),this.y=Math.max(n,Math.min(t,this.y)),this.z=Math.max(n,Math.min(t,this.z)),this.w=Math.max(n,Math.min(t,this.w)),this},clampLength:function(n,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(n,Math.min(t,i)))},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(n){return this.x*n.x+this.y*n.y+this.z*n.z+this.w*n.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)},manhattanLength: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()||1)},setLength:function(n){return this.normalize().multiplyScalar(n)},lerp:function(n,t){return this.x+=(n.x-this.x)*t,this.y+=(n.y-this.y)*t,this.z+=(n.z-this.z)*t,this.w+=(n.w-this.w)*t,this},lerpVectors:function(n,t,i){return this.subVectors(t,n).multiplyScalar(i).add(n)},equals:function(n){return n.x===this.x&&n.y===this.y&&n.z===this.z&&n.w===this.w},fromArray:function(n,t){return void 0===t&&(t=0),this.x=n[t],this.y=n[t+1],this.z=n[t+2],this.w=n[t+3],this},toArray:function(n,t){return void 0===n&&(n=[]),void 0===t&&(t=0),n[t]=this.x,n[t+1]=this.y,n[t+2]=this.z,n[t+3]=this.w,n},fromBufferAttribute:function(n,t,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=n.getX(t),this.y=n.getY(t),this.z=n.getZ(t),this.w=n.getW(t),this}}),wt.prototype=Object.assign(Object.create(hi.prototype),{constructor:wt,isWebGLRenderTarget:!0,setSize:function(n,t){(this.width!==n||this.height!==t)&&(this.width=n,this.height=t,this.texture.image.width=n,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,n,t),this.scissor.set(0,0,n,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.width=n.width,this.height=n.height,this.viewport.copy(n.viewport),this.texture=n.texture.clone(),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),rp.prototype=Object.assign(Object.create(wt.prototype),{constructor:rp,isWebGLMultisampleRenderTarget:!0,copy:function(n){return wt.prototype.copy.call(this,n),this.samples=n.samples,this}});var ri=new t,di=new v,nft=new t(0,0,0),tft=new t(1,1,1),wu=new t,kv=new t,ui=new t;Object.assign(v.prototype,{isMatrix4:!0,set:function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p){var w=this.elements;return w[0]=n,w[4]=t,w[8]=i,w[12]=r,w[1]=u,w[5]=f,w[9]=e,w[13]=o,w[2]=s,w[6]=h,w[10]=c,w[14]=l,w[3]=a,w[7]=v,w[11]=y,w[15]=p,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 v).fromArray(this.elements)},copy:function(n){var t=this.elements;return n=n.elements,t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(n){var t=this.elements;return n=n.elements,t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(n,t,i){return n.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(n,t,i){return this.set(n.x,t.x,i.x,0,n.y,t.y,i.y,0,n.z,t.z,i.z,0,0,0,0,1),this},extractRotation:function(n){var t=this.elements,i=n.elements,r=1/ri.setFromMatrixColumn(n,0).length(),u=1/ri.setFromMatrixColumn(n,1).length();return n=1/ri.setFromMatrixColumn(n,2).length(),t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*u,t[5]=i[5]*u,t[6]=i[6]*u,t[7]=0,t[8]=i[8]*n,t[9]=i[9]*n,t[10]=i[10]*n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(n){var f,e;n&&n.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,i=n.x,r=n.y,u=n.z,o=Math.cos(i);if(i=Math.sin(i),f=Math.cos(r),r=Math.sin(r),e=Math.cos(u),u=Math.sin(u),"XYZ"===n.order){n=o*e;var s=o*u,h=i*e,c=i*u;t[0]=f*e,t[4]=-f*u,t[8]=r,t[1]=s+h*r,t[5]=n-c*r,t[9]=-i*f,t[2]=c-n*r,t[6]=h+s*r,t[10]=o*f}else"YXZ"===n.order?(n=f*e,s=f*u,h=r*e,c=r*u,t[0]=n+c*i,t[4]=h*i-s,t[8]=o*r,t[1]=o*u,t[5]=o*e,t[9]=-i,t[2]=s*i-h,t[6]=c+n*i,t[10]=o*f):"ZXY"===n.order?(n=f*e,s=f*u,h=r*e,c=r*u,t[0]=n-c*i,t[4]=-o*u,t[8]=h+s*i,t[1]=s+h*i,t[5]=o*e,t[9]=c-n*i,t[2]=-o*r,t[6]=i,t[10]=o*f):"ZYX"===n.order?(n=o*e,s=o*u,h=i*e,c=i*u,t[0]=f*e,t[4]=h*r-s,t[8]=n*r+c,t[1]=f*u,t[5]=c*r+n,t[9]=s*r-h,t[2]=-r,t[6]=i*f,t[10]=o*f):"YZX"===n.order?(n=o*f,s=o*r,h=i*f,c=i*r,t[0]=f*e,t[4]=c-n*u,t[8]=h*u+s,t[1]=u,t[5]=o*e,t[9]=-i*e,t[2]=-r*e,t[6]=s*u+h,t[10]=n-c*u):"XZY"===n.order&&(n=o*f,s=o*r,h=i*f,c=i*r,t[0]=f*e,t[4]=-u,t[8]=r*e,t[1]=n*u+c,t[5]=o*e,t[9]=s*u-h,t[2]=h*u-s,t[6]=i*e,t[10]=c*u+n);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(n){return this.compose(nft,n,tft)},lookAt:function(n,t,i){var r=this.elements;return ui.subVectors(n,t),0===ui.lengthSq()&&(ui.z=1),ui.normalize(),wu.crossVectors(i,ui),0===wu.lengthSq()&&(1===Math.abs(i.z)?ui.x+=.0001:ui.z+=.0001,ui.normalize(),wu.crossVectors(i,ui)),wu.normalize(),kv.crossVectors(ui,wu),r[0]=wu.x,r[4]=kv.x,r[8]=ui.x,r[1]=wu.y,r[5]=kv.y,r[9]=ui.y,r[2]=wu.z,r[6]=kv.z,r[10]=ui.z,this},multiply:function(n,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(n,t)):this.multiplyMatrices(this,n)},premultiply:function(n){return this.multiplyMatrices(n,this)},multiplyMatrices:function(n,t){var i=n.elements,r=t.elements;t=this.elements,n=i[0];var u=i[4],f=i[8],e=i[12],o=i[1],s=i[5],h=i[9],c=i[13],l=i[2],a=i[6],v=i[10],y=i[14],p=i[3],w=i[7],b=i[11];i=i[15];var k=r[0],d=r[4],g=r[8],nt=r[12],tt=r[1],it=r[5],rt=r[9],ut=r[13],ft=r[2],et=r[6],ot=r[10],st=r[14],ht=r[3],ct=r[7],lt=r[11];return r=r[15],t[0]=n*k+u*tt+f*ft+e*ht,t[4]=n*d+u*it+f*et+e*ct,t[8]=n*g+u*rt+f*ot+e*lt,t[12]=n*nt+u*ut+f*st+e*r,t[1]=o*k+s*tt+h*ft+c*ht,t[5]=o*d+s*it+h*et+c*ct,t[9]=o*g+s*rt+h*ot+c*lt,t[13]=o*nt+s*ut+h*st+c*r,t[2]=l*k+a*tt+v*ft+y*ht,t[6]=l*d+a*it+v*et+y*ct,t[10]=l*g+a*rt+v*ot+y*lt,t[14]=l*nt+a*ut+v*st+y*r,t[3]=p*k+w*tt+b*ft+i*ht,t[7]=p*d+w*it+b*et+i*ct,t[11]=p*g+w*rt+b*ot+i*lt,t[15]=p*nt+w*ut+b*st+i*r,this},multiplyScalar:function(n){var t=this.elements;return t[0]*=n,t[4]*=n,t[8]*=n,t[12]*=n,t[1]*=n,t[5]*=n,t[9]*=n,t[13]*=n,t[2]*=n,t[6]*=n,t[10]*=n,t[14]*=n,t[3]*=n,t[7]*=n,t[11]*=n,t[15]*=n,this},applyToBufferAttribute:function(n){for(var t=0,i=n.count;t<i;t++)ri.x=n.getX(t),ri.y=n.getY(t),ri.z=n.getZ(t),ri.applyMatrix4(this),n.setXYZ(t,ri.x,ri.y,ri.z);return n},determinant:function(){var n=this.elements,t=n[0],i=n[4],r=n[8],u=n[12],f=n[1],e=n[5],o=n[9],s=n[13],h=n[2],c=n[6],l=n[10],a=n[14];return n[3]*(+u*o*c-r*s*c-u*e*l+i*s*l+r*e*a-i*o*a)+n[7]*(+t*o*a-t*s*l+u*f*l-r*f*a+r*s*h-u*o*h)+n[11]*(+t*s*c-t*e*a-u*f*c+i*f*a+u*e*h-i*s*h)+n[15]*(-r*e*h-t*o*c+t*e*l+r*f*c-i*f*l+i*o*h)},transpose:function(){var n=this.elements,t=n[1];return n[1]=n[4],n[4]=t,t=n[2],n[2]=n[8],n[8]=t,t=n[6],n[6]=n[9],n[9]=t,t=n[3],n[3]=n[12],n[12]=t,t=n[7],n[7]=n[13],n[13]=t,t=n[11],n[11]=n[14],n[14]=t,this},setPosition:function(n,t,i){var r=this.elements;return n.isVector3?(r[12]=n.x,r[13]=n.y,r[14]=n.z):(r[12]=n,r[13]=t,r[14]=i),this},getInverse:function(n,t){var b=this.elements,i=n.elements;n=i[0];var r=i[1],u=i[2],f=i[3],e=i[4],o=i[5],s=i[6],h=i[7],c=i[8],l=i[9],a=i[10],v=i[11],y=i[12],p=i[13],w=i[14];i=i[15];var k=l*w*h-p*a*h+p*s*v-o*w*v-l*s*i+o*a*i,d=y*a*h-c*w*h-y*s*v+e*w*v+c*s*i-e*a*i,g=c*p*h-y*l*h+y*o*v-e*p*v-c*o*i+e*l*i,nt=y*l*s-c*p*s-y*o*a+e*p*a+c*o*w-e*l*w,tt=n*k+r*d+u*g+f*nt;if(0===tt){if(!0===t)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()}return t=1/tt,b[0]=k*t,b[1]=(p*a*f-l*w*f-p*u*v+r*w*v+l*u*i-r*a*i)*t,b[2]=(o*w*f-p*s*f+p*u*h-r*w*h-o*u*i+r*s*i)*t,b[3]=(l*s*f-o*a*f-l*u*h+r*a*h+o*u*v-r*s*v)*t,b[4]=d*t,b[5]=(c*w*f-y*a*f+y*u*v-n*w*v-c*u*i+n*a*i)*t,b[6]=(y*s*f-e*w*f-y*u*h+n*w*h+e*u*i-n*s*i)*t,b[7]=(e*a*f-c*s*f+c*u*h-n*a*h-e*u*v+n*s*v)*t,b[8]=g*t,b[9]=(y*l*f-c*p*f-y*r*v+n*p*v+c*r*i-n*l*i)*t,b[10]=(e*p*f-y*o*f+y*r*h-n*p*h-e*r*i+n*o*i)*t,b[11]=(c*o*f-e*l*f-c*r*h+n*l*h+e*r*v-n*o*v)*t,b[12]=nt*t,b[13]=(c*p*u-y*l*u+y*r*a-n*p*a-c*r*w+n*l*w)*t,b[14]=(y*o*u-e*p*u-y*r*s+n*p*s+e*r*w-n*o*w)*t,b[15]=(e*l*u-c*o*u+c*r*s-n*l*s-e*r*a+n*o*a)*t,this},scale:function(n){var t=this.elements,i=n.x,r=n.y;return n=n.z,t[0]*=i,t[4]*=r,t[8]*=n,t[1]*=i,t[5]*=r,t[9]*=n,t[2]*=i,t[6]*=r,t[10]*=n,t[3]*=i,t[7]*=r,t[11]*=n,this},getMaxScaleOnAxis:function(){var n=this.elements;return Math.sqrt(Math.max(n[0]*n[0]+n[1]*n[1]+n[2]*n[2],n[4]*n[4]+n[5]*n[5]+n[6]*n[6],n[8]*n[8]+n[9]*n[9]+n[10]*n[10]))},makeTranslation:function(n,t,i){return this.set(1,0,0,n,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(n){var t=Math.cos(n);return n=Math.sin(n),this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(n){var t=Math.cos(n);return n=Math.sin(n),this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(n){var t=Math.cos(n);return n=Math.sin(n),this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(n,t){var u=Math.cos(t),r,e;t=Math.sin(t);var o=1-u,f=n.x,i=n.y;return n=n.z,r=o*f,e=o*i,this.set(r*f+u,r*i-t*n,r*n+t*i,0,r*i+t*n,e*i+u,e*n-t*f,0,r*n-t*i,e*n+t*f,o*n*n+u,0,0,0,0,1),this},makeScale:function(n,t,i){return this.set(n,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(n,t,i){return this.set(1,t,i,0,n,1,i,0,n,t,1,0,0,0,0,1),this},compose:function(n,t,i){var r=this.elements,f=t._x,e=t._y,o=t._z,s=t._w,c=f+f,h=e+e,u=o+o,a,v,l;return t=f*c,a=f*h,f*=u,v=e*h,e*=u,o*=u,c*=s,h*=s,s*=u,u=i.x,l=i.y,i=i.z,r[0]=(1-(v+o))*u,r[1]=(a+s)*u,r[2]=(f-h)*u,r[3]=0,r[4]=(a-s)*l,r[5]=(1-(t+o))*l,r[6]=(e+c)*l,r[7]=0,r[8]=(f+h)*i,r[9]=(e-c)*i,r[10]=(1-(t+v))*i,r[11]=0,r[12]=n.x,r[13]=n.y,r[14]=n.z,r[15]=1,this},decompose:function(n,t,i){var r=this.elements,u=ri.set(r[0],r[1],r[2]).length(),e=ri.set(r[4],r[5],r[6]).length(),o=ri.set(r[8],r[9],r[10]).length(),f;return 0>this.determinant()&&(u=-u),n.x=r[12],n.y=r[13],n.z=r[14],di.copy(this),n=1/u,r=1/e,f=1/o,di.elements[0]*=n,di.elements[1]*=n,di.elements[2]*=n,di.elements[4]*=r,di.elements[5]*=r,di.elements[6]*=r,di.elements[8]*=f,di.elements[9]*=f,di.elements[10]*=f,t.setFromRotationMatrix(di),i.x=u,i.y=e,i.z=o,this},makePerspective:function(n,t,i,r,u,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var e=this.elements;return e[0]=2*u/(t-n),e[4]=0,e[8]=(t+n)/(t-n),e[12]=0,e[1]=0,e[5]=2*u/(i-r),e[9]=(i+r)/(i-r),e[13]=0,e[2]=0,e[6]=0,e[10]=-(f+u)/(f-u),e[14]=-2*f*u/(f-u),e[3]=0,e[7]=0,e[11]=-1,e[15]=0,this},makeOrthographic:function(n,t,i,r,u,f){var e=this.elements,o=1/(t-n),s=1/(i-r),h=1/(f-u);return e[0]=2*o,e[4]=0,e[8]=0,e[12]=-((t+n)*o),e[1]=0,e[5]=2*s,e[9]=0,e[13]=-((i+r)*s),e[2]=0,e[6]=0,e[10]=-2*h,e[14]=-((f+u)*h),e[3]=0,e[7]=0,e[11]=0,e[15]=1,this},equals:function(n){var i=this.elements,t;for(n=n.elements,t=0;16>t;t++)if(i[t]!==n[t])return!1;return!0},fromArray:function(n,t){void 0===t&&(t=0);for(var i=0;16>i;i++)this.elements[i]=n[i+t];return this},toArray:function(n,t){void 0===n&&(n=[]),void 0===t&&(t=0);var i=this.elements;return n[t]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=i[3],n[t+4]=i[4],n[t+5]=i[5],n[t+6]=i[6],n[t+7]=i[7],n[t+8]=i[8],n[t+9]=i[9],n[t+10]=i[10],n[t+11]=i[11],n[t+12]=i[12],n[t+13]=i[13],n[t+14]=i[14],n[t+15]=i[15],n}}),nb=new v,tb=new lt,tf.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),tf.DefaultOrder="XYZ",Object.defineProperties(tf.prototype,{x:{get:function(){return this._x},set:function(n){this._x=n,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(n){this._y=n,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(n){this._z=n,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(n){this._order=n,this._onChangeCallback()}}}),Object.assign(tf.prototype,{isEuler:!0,set:function(n,t,i,r){return this._x=n,this._y=t,this._z=i,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(n){return this._x=n._x,this._y=n._y,this._z=n._z,this._order=n._order,this._onChangeCallback(),this},setFromRotationMatrix:function(n,t,i){var u=a.clamp,r=n.elements;n=r[0];var e=r[4],o=r[8],s=r[1],f=r[5],h=r[9],c=r[2],l=r[6];return r=r[10],t=t||this._order,"XYZ"===t?(this._y=Math.asin(u(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-h,r),this._z=Math.atan2(-e,n)):(this._x=Math.atan2(l,f),this._z=0)):"YXZ"===t?(this._x=Math.asin(-u(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(o,r),this._z=Math.atan2(s,f)):(this._y=Math.atan2(-c,n),this._z=0)):"ZXY"===t?(this._x=Math.asin(u(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(-c,r),this._z=Math.atan2(-e,f)):(this._y=0,this._z=Math.atan2(s,n))):"ZYX"===t?(this._y=Math.asin(-u(c,-1,1)),.9999999>Math.abs(c)?(this._x=Math.atan2(l,r),this._z=Math.atan2(s,n)):(this._x=0,this._z=Math.atan2(-e,f))):"YZX"===t?(this._z=Math.asin(u(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-h,f),this._y=Math.atan2(-c,n)):(this._x=0,this._y=Math.atan2(o,r))):"XZY"===t?(this._z=Math.asin(-u(e,-1,1)),.9999999>Math.abs(e)?(this._x=Math.atan2(l,f),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-h,r),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==i&&this._onChangeCallback(),this},setFromQuaternion:function(n,t,i){return nb.makeRotationFromQuaternion(n),this.setFromRotationMatrix(nb,t,i)},setFromVector3:function(n,t){return this.set(n.x,n.y,n.z,t||this._order)},reorder:function(n){return tb.setFromEuler(this),this.setFromQuaternion(tb,n)},equals:function(n){return n._x===this._x&&n._y===this._y&&n._z===this._z&&n._order===this._order},fromArray:function(n){return this._x=n[0],this._y=n[1],this._z=n[2],void 0!==n[3]&&(this._order=n[3]),this._onChangeCallback(),this},toArray:function(n,t){return void 0===n&&(n=[]),void 0===t&&(t=0),n[t]=this._x,n[t+1]=this._y,n[t+2]=this._z,n[t+3]=this._order,n},toVector3:function(n){return n?n.set(this._x,this._y,this._z):new t(this._x,this._y,this._z)},_onChange:function(n){return this._onChangeCallback=n,this},_onChangeCallback:function(){}}),Object.assign(up.prototype,{set:function(n){this.mask=1<<n|0},enable:function(n){this.mask=this.mask|1<<n|0},enableAll:function(){this.mask=-1},toggle:function(n){this.mask^=1<<n|0},disable:function(n){this.mask&=~(1<<n|0)},disableAll:function(){this.mask=0},test:function(n){return 0!=(this.mask&n.mask)}});var ift=0,pg=new t,cs=new lt,iu=new v,dv=new t,hl=new t,rft=new t,uft=new lt,wg=new t(1,0,0),bg=new t(0,1,0),kg=new t(0,0,1),fft={type:"added"},eft={type:"removed"};u.DefaultUp=new t(0,1,0),u.DefaultMatrixAutoUpdate=!0,u.prototype=Object.assign(Object.create(hi.prototype),{constructor:u,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(n){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(n),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(n){return this.quaternion.premultiply(n),this},setRotationFromAxisAngle:function(n,t){this.quaternion.setFromAxisAngle(n,t)},setRotationFromEuler:function(n){this.quaternion.setFromEuler(n,!0)},setRotationFromMatrix:function(n){this.quaternion.setFromRotationMatrix(n)},setRotationFromQuaternion:function(n){this.quaternion.copy(n)},rotateOnAxis:function(n,t){return cs.setFromAxisAngle(n,t),this.quaternion.multiply(cs),this},rotateOnWorldAxis:function(n,t){return cs.setFromAxisAngle(n,t),this.quaternion.premultiply(cs),this},rotateX:function(n){return this.rotateOnAxis(wg,n)},rotateY:function(n){return this.rotateOnAxis(bg,n)},rotateZ:function(n){return this.rotateOnAxis(kg,n)},translateOnAxis:function(n,t){return pg.copy(n).applyQuaternion(this.quaternion),this.position.add(pg.multiplyScalar(t)),this},translateX:function(n){return this.translateOnAxis(wg,n)},translateY:function(n){return this.translateOnAxis(bg,n)},translateZ:function(n){return this.translateOnAxis(kg,n)},localToWorld:function(n){return n.applyMatrix4(this.matrixWorld)},worldToLocal:function(n){return n.applyMatrix4(iu.getInverse(this.matrixWorld))},lookAt:function(n,t,i){n.isVector3?dv.copy(n):dv.set(n,t,i),n=this.parent,this.updateWorldMatrix(!0,!1),hl.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?iu.lookAt(hl,dv,this.up):iu.lookAt(dv,hl,this.up),this.quaternion.setFromRotationMatrix(iu),n&&(iu.extractRotation(n.matrixWorld),cs.setFromRotationMatrix(iu),this.quaternion.premultiply(cs.inverse()))},add:function(n){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return n===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",n),this):(n&&n.isObject3D?(null!==n.parent&&n.parent.remove(n),n.parent=this,this.children.push(n),n.dispatchEvent(fft)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",n),this)},remove:function(n){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}return t=this.children.indexOf(n),-1!==t&&(n.parent=null,this.children.splice(t,1),n.dispatchEvent(eft)),this},attach:function(n){return this.updateWorldMatrix(!0,!1),iu.getInverse(this.matrixWorld),null!==n.parent&&(n.parent.updateWorldMatrix(!0,!1),iu.multiply(n.parent.matrixWorld)),n.applyMatrix(iu),n.updateWorldMatrix(!1,!1),this.add(n),this},getObjectById:function(n){return this.getObjectByProperty("id",n)},getObjectByName:function(n){return this.getObjectByProperty("name",n)},getObjectByProperty:function(n,t){var i,u,r;if(this[n]===t)return this;for(i=0,u=this.children.length;i<u;i++)if(r=this.children[i].getObjectByProperty(n,t),void 0!==r)return r},getWorldPosition:function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),n=new t),this.updateMatrixWorld(!0),n.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),n=new lt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(hl,n,rft),n},getWorldScale:function(n){return void 0===n&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),n=new t),this.updateMatrixWorld(!0),this.matrixWorld.decompose(hl,uft,n),n},getWorldDirection:function(n){void 0===n&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),n=new t),this.updateMatrixWorld(!0);var i=this.matrixWorld.elements;return n.set(i[8],i[9],i[10]).normalize()},raycast:function(){},traverse:function(n){n(this);for(var i=this.children,t=0,r=i.length;t<r;t++)i[t].traverse(n)},traverseVisible:function(n){if(!1!==this.visible){n(this);for(var i=this.children,t=0,r=i.length;t<r;t++)i[t].traverseVisible(n)}},traverseAncestors:function(n){var t=this.parent;null!==t&&(n(t),t.traverseAncestors(n))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(n){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,n=!0);for(var i=this.children,t=0,r=i.length;t<r;t++)i[t].updateMatrixWorld(n)},updateWorldMatrix:function(n,t){var i=this.parent;if(!0===n&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(n=this.children,t=0,i=n.length;t<i;t++)n[t].updateWorldMatrix(!1,!0)},toJSON:function(n){function e(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(n)),i.uuid}function o(n){var i=[],r,t;for(r in n)t=n[r],delete t.metadata,i.push(t);return i}var s=void 0===n||"string"==typeof n,u={},t,i,r,f,h;if(s&&(n={geometries:{},materials:{},textures:{},images:{},shapes:{}},u.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"}),t={},t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),!0===this.castShadow&&(t.castShadow=!0),!0===this.receiveShadow&&(t.receiveShadow=!0),!1===this.visible&&(t.visible=!1),!1===this.frustumCulled&&(t.frustumCulled=!1),0!==this.renderOrder&&(t.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(t.userData=this.userData),t.layers=this.layers.mask,t.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(t.matrixAutoUpdate=!1),this.isMesh&&0!==this.drawMode&&(t.drawMode=this.drawMode),this.isInstancedMesh&&(t.type="InstancedMesh",t.count=this.count,t.instanceMatrix=this.instanceMatrix.toJSON()),(this.isMesh||this.isLine||this.isPoints)&&(t.geometry=e(n.geometries,this.geometry),i=this.geometry.parameters,void 0!==i&&void 0!==i.shapes))if(i=i.shapes,Array.isArray(i))for(r=0,f=i.length;r<f;r++)e(n.shapes,i[r]);else e(n.shapes,i);if(void 0!==this.material)if(Array.isArray(this.material)){for(i=[],r=0,f=this.material.length;r<f;r++)i.push(e(n.materials,this.material[r]));t.material=i}else t.material=e(n.materials,this.material);if(0<this.children.length)for(t.children=[],r=0;r<this.children.length;r++)t.children.push(this.children[r].toJSON(n).object);return s&&(s=o(n.geometries),r=o(n.materials),f=o(n.textures),h=o(n.images),i=o(n.shapes),0<s.length&&(u.geometries=s),0<r.length&&(u.materials=r),0<f.length&&(u.textures=f),0<h.length&&(u.images=h),0<i.length&&(u.shapes=i)),u.object=t,u},clone:function(n){return(new this.constructor).copy(this,n)},copy:function(n,t){if(void 0===t&&(t=!0),this.name=n.name,this.up.copy(n.up),this.position.copy(n.position),this.quaternion.copy(n.quaternion),this.scale.copy(n.scale),this.matrix.copy(n.matrix),this.matrixWorld.copy(n.matrixWorld),this.matrixAutoUpdate=n.matrixAutoUpdate,this.matrixWorldNeedsUpdate=n.matrixWorldNeedsUpdate,this.layers.mask=n.layers.mask,this.visible=n.visible,this.castShadow=n.castShadow,this.receiveShadow=n.receiveShadow,this.frustumCulled=n.frustumCulled,this.renderOrder=n.renderOrder,this.userData=JSON.parse(JSON.stringify(n.userData)),!0===t)for(t=0;t<n.children.length;t++)this.add(n.children[t].clone());return this}}),ih.prototype=Object.assign(Object.create(u.prototype),{constructor:ih,isScene:!0,copy:function(n,t){return u.prototype.copy.call(this,n,t),null!==n.background&&(this.background=n.background.clone()),null!==n.fog&&(this.fog=n.fog.clone()),null!==n.overrideMaterial&&(this.overrideMaterial=n.overrideMaterial.clone()),this.autoUpdate=n.autoUpdate,this.matrixAutoUpdate=n.matrixAutoUpdate,this},toJSON:function(n){var t=u.prototype.toJSON.call(this,n);return null!==this.background&&(t.object.background=this.background.toJSON(n)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var ru=[new t,new t,new t,new t,new t,new t,new t,new t],hr=new t,ls=new t,as=new t,vs=new t,bu=new t,ku=new t,ie=new t,cl=new t,gv=new t,ny=new t,re=new t;Object.assign(ir.prototype,{isBox3:!0,set:function(n,t){return this.min.copy(n),this.max.copy(t),this},setFromArray:function(n){for(var f=Infinity,e=Infinity,o=Infinity,s=-Infinity,h=-Infinity,c=-Infinity,t=0,l=n.length;t<l;t+=3){var i=n[t],r=n[t+1],u=n[t+2];i<f&&(f=i),r<e&&(e=r),u<o&&(o=u),i>s&&(s=i),r>h&&(h=r),u>c&&(c=u)}return this.min.set(f,e,o),this.max.set(s,h,c),this},setFromBufferAttribute:function(n){for(var f=Infinity,e=Infinity,o=Infinity,s=-Infinity,h=-Infinity,c=-Infinity,t=0,l=n.count;t<l;t++){var i=n.getX(t),r=n.getY(t),u=n.getZ(t);i<f&&(f=i),r<e&&(e=r),u<o&&(o=u),i>s&&(s=i),r>h&&(h=r),u>c&&(c=u)}return this.min.set(f,e,o),this.max.set(s,h,c),this},setFromPoints:function(n){this.makeEmpty();for(var t=0,i=n.length;t<i;t++)this.expandByPoint(n[t]);return this},setFromCenterAndSize:function(n,t){return t=hr.copy(t).multiplyScalar(.5),this.min.copy(n).sub(t),this.max.copy(n).add(t),this},setFromObject:function(n){return this.makeEmpty(),this.expandByObject(n)},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.min.copy(n.min),this.max.copy(n.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-Infinity,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(n){return void 0===n&&(console.warn("THREE.Box3: .getCenter() target is now required"),n=new t),this.isEmpty()?n.set(0,0,0):n.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(n){return void 0===n&&(console.warn("THREE.Box3: .getSize() target is now required"),n=new t),this.isEmpty()?n.set(0,0,0):n.subVectors(this.max,this.min)},expandByPoint:function(n){return this.min.min(n),this.max.max(n),this},expandByVector:function(n){return this.min.sub(n),this.max.add(n),this},expandByScalar:function(n){return this.min.addScalar(-n),this.max.addScalar(n),this},expandByObject:function(n){var r,t,i;if(n.updateWorldMatrix(!1,!1),t=n.geometry,void 0!==t)if(t.isGeometry)for(i=t.vertices,t=0,r=i.length;t<r;t++)hr.copy(i[t]),hr.applyMatrix4(n.matrixWorld),this.expandByPoint(hr);else if(t.isBufferGeometry&&(i=t.attributes.position,void 0!==i))for(t=0,r=i.count;t<r;t++)hr.fromBufferAttribute(i,t).applyMatrix4(n.matrixWorld),this.expandByPoint(hr);for(n=n.children,t=0,r=n.length;t<r;t++)this.expandByObject(n[t]);return this},containsPoint:function(n){return n.x<this.min.x||n.x>this.max.x||n.y<this.min.y||n.y>this.max.y||n.z<this.min.z||n.z>this.max.z?!1:!0},containsBox:function(n){return this.min.x<=n.min.x&&n.max.x<=this.max.x&&this.min.y<=n.min.y&&n.max.y<=this.max.y&&this.min.z<=n.min.z&&n.max.z<=this.max.z},getParameter:function(n,i){return void 0===i&&(console.warn("THREE.Box3: .getParameter() target is now required"),i=new t),i.set((n.x-this.min.x)/(this.max.x-this.min.x),(n.y-this.min.y)/(this.max.y-this.min.y),(n.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(n){return n.max.x<this.min.x||n.min.x>this.max.x||n.max.y<this.min.y||n.min.y>this.max.y||n.max.z<this.min.z||n.min.z>this.max.z?!1:!0},intersectsSphere:function(n){return this.clampPoint(n.center,hr),hr.distanceToSquared(n.center)<=n.radius*n.radius},intersectsPlane:function(n){if(0<n.normal.x)var t=n.normal.x*this.min.x,i=n.normal.x*this.max.x;else t=n.normal.x*this.max.x,i=n.normal.x*this.min.x;return 0<n.normal.y?(t+=n.normal.y*this.min.y,i+=n.normal.y*this.max.y):(t+=n.normal.y*this.max.y,i+=n.normal.y*this.min.y),0<n.normal.z?(t+=n.normal.z*this.min.z,i+=n.normal.z*this.max.z):(t+=n.normal.z*this.max.z,i+=n.normal.z*this.min.z),t<=-n.constant&&i>=-n.constant},intersectsTriangle:function(n){return this.isEmpty()?!1:(this.getCenter(cl),gv.subVectors(this.max,cl),ls.subVectors(n.a,cl),as.subVectors(n.b,cl),vs.subVectors(n.c,cl),bu.subVectors(as,ls),ku.subVectors(vs,as),ie.subVectors(ls,vs),n=[0,-bu.z,bu.y,0,-ku.z,ku.y,0,-ie.z,ie.y,bu.z,0,-bu.x,ku.z,0,-ku.x,ie.z,0,-ie.x,-bu.y,bu.x,0,-ku.y,ku.x,0,-ie.y,ie.x,0],!fp(n,ls,as,vs,gv))?!1:(n=[1,0,0,0,1,0,0,0,1],!fp(n,ls,as,vs,gv))?!1:(ny.crossVectors(bu,ku),n=[ny.x,ny.y,ny.z],fp(n,ls,as,vs,gv))},clampPoint:function(n,i){return void 0===i&&(console.warn("THREE.Box3: .clampPoint() target is now required"),i=new t),i.copy(n).clamp(this.min,this.max)},distanceToPoint:function(n){return hr.copy(n).clamp(this.min,this.max).sub(n).length()},getBoundingSphere:function(n){return void 0===n&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(n.center),n.radius=.5*this.getSize(hr).length(),n},intersect:function(n){return this.min.max(n.min),this.max.min(n.max),this.isEmpty()&&this.makeEmpty(),this},union:function(n){return this.min.min(n.min),this.max.max(n.max),this},applyMatrix4:function(n){return this.isEmpty()?this:(ru[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(n),ru[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(n),ru[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(n),ru[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(n),ru[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(n),ru[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(n),ru[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(n),ru[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(n),this.setFromPoints(ru),this)},translate:function(n){return this.min.add(n),this.max.add(n),this},equals:function(n){return n.min.equals(this.min)&&n.max.equals(this.max)}}),dg=new ir,Object.assign(pr.prototype,{set:function(n,t){return this.center.copy(n),this.radius=t,this},setFromPoints:function(n,t){var r=this.center,i,u;for(void 0!==t?r.copy(t):dg.setFromPoints(n).getCenter(r),i=t=0,u=n.length;i<u;i++)t=Math.max(t,r.distanceToSquared(n[i]));return this.radius=Math.sqrt(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.center.copy(n.center),this.radius=n.radius,this},empty:function(){return 0>=this.radius},containsPoint:function(n){return n.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(n){return n.distanceTo(this.center)-this.radius},intersectsSphere:function(n){var t=this.radius+n.radius;return n.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(n){return n.intersectsSphere(this)},intersectsPlane:function(n){return Math.abs(n.distanceToPoint(this.center))<=this.radius},clampPoint:function(n,i){var r=this.center.distanceToSquared(n);return void 0===i&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),i=new t),i.copy(n),r>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(n){return void 0===n&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),n=new ir),n.set(this.center,this.center),n.expandByScalar(this.radius),n},applyMatrix4:function(n){return this.center.applyMatrix4(n),this.radius*=n.getMaxScaleOnAxis(),this},translate:function(n){return this.center.add(n),this},equals:function(n){return n.center.equals(this.center)&&n.radius===this.radius}});var uu=new t,ib=new t,ty=new t,du=new t,rb=new t,iy=new t,ub=new t;Object.assign(rf.prototype,{set:function(n,t){return this.origin.copy(n),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.origin.copy(n.origin),this.direction.copy(n.direction),this},at:function(n,i){return void 0===i&&(console.warn("THREE.Ray: .at() target is now required"),i=new t),i.copy(this.direction).multiplyScalar(n).add(this.origin)},lookAt:function(n){return this.direction.copy(n).sub(this.origin).normalize(),this},recast:function(n){return this.origin.copy(this.at(n,uu)),this},closestPointToPoint:function(n,i){return void 0===i&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),i=new t),i.subVectors(n,this.origin),n=i.dot(this.direction),0>n?i.copy(this.origin):i.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(n){return Math.sqrt(this.distanceSqToPoint(n))},distanceSqToPoint:function(n){var t=uu.subVectors(n,this.origin).dot(this.direction);return 0>t?this.origin.distanceToSquared(n):(uu.copy(this.direction).multiplyScalar(t).add(this.origin),uu.distanceToSquared(n))},distanceSqToSegment:function(n,t,i,r){var h;ib.copy(n).add(t).multiplyScalar(.5),ty.copy(t).sub(n).normalize(),du.copy(this.origin).sub(ib);var f=.5*n.distanceTo(t),u=-this.direction.dot(ty),o=du.dot(this.direction),e=-du.dot(ty),s=du.lengthSq(),c=Math.abs(1-u*u);return 0<c?(n=u*e-o,t=u*o-e,h=f*c,0<=n?t>=-h?t<=h?(f=1/c,n*=f,t*=f,u=n*(n+u*t+2*o)+t*(u*n+t+2*e)+s):(t=f,n=Math.max(0,-(u*t+o)),u=-n*n+t*(t+2*e)+s):(t=-f,n=Math.max(0,-(u*t+o)),u=-n*n+t*(t+2*e)+s):t<=-h?(n=Math.max(0,-(-u*f+o)),t=0<n?-f:Math.min(Math.max(-f,-e),f),u=-n*n+t*(t+2*e)+s):t<=h?(n=0,t=Math.min(Math.max(-f,-e),f),u=t*(t+2*e)+s):(n=Math.max(0,-(u*f+o)),t=0<n?f:Math.min(Math.max(-f,-e),f),u=-n*n+t*(t+2*e)+s)):(t=0<u?-f:f,n=Math.max(0,-(u*t+o)),u=-n*n+t*(t+2*e)+s),i&&i.copy(this.direction).multiplyScalar(n).add(this.origin),r&&r.copy(ty).multiplyScalar(t).add(ib),u},intersectSphere:function(n,t){uu.subVectors(n.center,this.origin);var i=uu.dot(this.direction),r=uu.dot(uu)-i*i;return(n=n.radius*n.radius,r>n)?null:(n=Math.sqrt(n-r),r=i-n,i+=n,0>r&&0>i?null:0>r?this.at(i,t):this.at(r,t))},intersectsSphere:function(n){return this.distanceSqToPoint(n.center)<=n.radius*n.radius},distanceToPlane:function(n){var t=n.normal.dot(this.direction);return 0===t?0===n.distanceToPoint(this.origin)?0:null:(n=-(this.origin.dot(n.normal)+n.constant)/t,0<=n?n:null)},intersectPlane:function(n,t){return n=this.distanceToPlane(n),null===n?null:this.at(n,t)},intersectsPlane:function(n){var t=n.distanceToPoint(this.origin);return 0===t||0>n.normal.dot(this.direction)*t?!0:!1},intersectBox:function(n,t){var i=1/this.direction.x,e=1/this.direction.y,o=1/this.direction.z,u=this.origin,r,f;return(0<=i?(r=(n.min.x-u.x)*i,i*=n.max.x-u.x):(r=(n.max.x-u.x)*i,i*=n.min.x-u.x),0<=e?(f=(n.min.y-u.y)*e,e*=n.max.y-u.y):(f=(n.max.y-u.y)*e,e*=n.min.y-u.y),r>e||f>i)?null:((f>r||r!==r)&&(r=f),(e<i||i!==i)&&(i=e),0<=o?(f=(n.min.z-u.z)*o,n=(n.max.z-u.z)*o):(f=(n.max.z-u.z)*o,n=(n.min.z-u.z)*o),r>n||f>i)?null:((f>r||r!==r)&&(r=f),(n<i||i!==i)&&(i=n),0>i?null:this.at(0<=r?r:i,t))},intersectsBox:function(n){return null!==this.intersectBox(n,uu)},intersectTriangle:function(n,t,i,r,u){if(rb.subVectors(t,n),iy.subVectors(i,n),ub.crossVectors(rb,iy),t=this.direction.dot(ub),0<t){if(r)return null;r=1}else if(0>t)r=-1,t=-t;else return null;return(du.subVectors(this.origin,n),n=r*this.direction.dot(iy.crossVectors(du,iy)),0>n)?null:(i=r*this.direction.dot(rb.cross(du)),0>i||n+i>t)?null:(n=-r*du.dot(ub),0>n?null:this.at(n/t,u))},applyMatrix4:function(n){return this.origin.applyMatrix4(n),this.direction.transformDirection(n),this},equals:function(n){return n.origin.equals(this.origin)&&n.direction.equals(this.direction)}});var fb=new t,oft=new t,sft=new ft;Object.assign(ci.prototype,{isPlane:!0,set:function(n,t){return this.normal.copy(n),this.constant=t,this},setComponents:function(n,t,i,r){return this.normal.set(n,t,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(n,t){return this.normal.copy(n),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(n,t,i){return t=fb.subVectors(i,t).cross(oft.subVectors(n,t)).normalize(),this.setFromNormalAndCoplanarPoint(t,n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.normal.copy(n.normal),this.constant=n.constant,this},normalize:function(){var n=1/this.normal.length();return this.normal.multiplyScalar(n),this.constant*=n,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(n){return this.normal.dot(n)+this.constant},distanceToSphere:function(n){return this.distanceToPoint(n.center)-n.radius},projectPoint:function(n,i){return void 0===i&&(console.warn("THREE.Plane: .projectPoint() target is now required"),i=new t),i.copy(this.normal).multiplyScalar(-this.distanceToPoint(n)).add(n)},intersectLine:function(n,i){void 0===i&&(console.warn("THREE.Plane: .intersectLine() target is now required"),i=new t);var u=n.delta(fb),r=this.normal.dot(u);if(0===r){if(0===this.distanceToPoint(n.start))return i.copy(n.start)}else if(r=-(n.start.dot(this.normal)+this.constant)/r,!(0>r||1<r))return i.copy(u).multiplyScalar(r).add(n.start)},intersectsLine:function(n){var t=this.distanceToPoint(n.start);return n=this.distanceToPoint(n.end),0>t&&0<n||0>n&&0<t},intersectsBox:function(n){return n.intersectsPlane(this)},intersectsSphere:function(n){return n.intersectsPlane(this)},coplanarPoint:function(n){return void 0===n&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),n=new t),n.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(n,t){return t=t||sft.getNormalMatrix(n),n=this.coplanarPoint(fb).applyMatrix4(n),t=this.normal.applyMatrix3(t).normalize(),this.constant=-n.dot(t),this},translate:function(n){return this.constant-=n.dot(this.normal),this},equals:function(n){return n.normal.equals(this.normal)&&n.constant===this.constant}});var gi=new t,fu=new t,eb=new t,eu=new t,ys=new t,ps=new t,gg=new t,ob=new t,sb=new t,hb=new t;Object.assign(et,{getNormal:function(n,i,r,u){return void 0===u&&(console.warn("THREE.Triangle: .getNormal() target is now required"),u=new t),u.subVectors(r,i),gi.subVectors(n,i),u.cross(gi),n=u.lengthSq(),0<n?u.multiplyScalar(1/Math.sqrt(n)):u.set(0,0,0)},getBarycoord:function(n,i,r,u,f){var e,o;return(gi.subVectors(u,i),fu.subVectors(r,i),eb.subVectors(n,i),n=gi.dot(gi),i=gi.dot(fu),r=gi.dot(eb),e=fu.dot(fu),u=fu.dot(eb),o=n*e-i*i,void 0===f&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),f=new t),0===o)?f.set(-2,-1,-1):(o=1/o,e=(e*r-i*u)*o,n=(n*u-i*r)*o,f.set(1-e-n,n,e))},containsPoint:function(n,t,i,r){return et.getBarycoord(n,t,i,r,eu),0<=eu.x&&0<=eu.y&&1>=eu.x+eu.y},getUV:function(n,t,i,r,u,f,e,o){return this.getBarycoord(n,t,i,r,eu),o.set(0,0),o.addScaledVector(u,eu.x),o.addScaledVector(f,eu.y),o.addScaledVector(e,eu.z),o},isFrontFacing:function(n,t,i,r){return gi.subVectors(i,t),fu.subVectors(n,t),0>gi.cross(fu).dot(r)?!0:!1}}),Object.assign(et.prototype,{set:function(n,t,i){return this.a.copy(n),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(n,t,i,r){return this.a.copy(n[t]),this.b.copy(n[i]),this.c.copy(n[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.a.copy(n.a),this.b.copy(n.b),this.c.copy(n.c),this},getArea:function(){return gi.subVectors(this.c,this.b),fu.subVectors(this.a,this.b),.5*gi.cross(fu).length()},getMidpoint:function(n){return void 0===n&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),n=new t),n.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(n){return et.getNormal(this.a,this.b,this.c,n)},getPlane:function(n){return void 0===n&&(console.warn("THREE.Triangle: .getPlane() target is now required"),n=new ci),n.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(n,t){return et.getBarycoord(n,this.a,this.b,this.c,t)},getUV:function(n,t,i,r,u){return et.getUV(n,this.a,this.b,this.c,t,i,r,u)},containsPoint:function(n){return et.containsPoint(n,this.a,this.b,this.c)},isFrontFacing:function(n){return et.isFrontFacing(this.a,this.b,this.c,n)},intersectsBox:function(n){return n.intersectsTriangle(this)},closestPointToPoint:function(n,i){var r,u,f,l,o,s;void 0===i&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),i=new t);var h=this.a,e=this.b,c=this.c;return(ys.subVectors(e,h),ps.subVectors(c,h),ob.subVectors(n,h),r=ys.dot(ob),u=ps.dot(ob),0>=r&&0>=u)?i.copy(h):(sb.subVectors(n,e),f=ys.dot(sb),l=ps.dot(sb),0<=f&&l<=f)?i.copy(e):(o=r*l-f*u,0>=o&&0<=r&&0>=f)?(e=r/(r-f),i.copy(h).addScaledVector(ys,e)):(hb.subVectors(n,c),n=ys.dot(hb),s=ps.dot(hb),0<=s&&n<=s)?i.copy(c):(r=n*u-r*s,0>=r&&0<=u&&0>=s)?(o=u/(u-s),i.copy(h).addScaledVector(ps,o)):(u=f*s-n*l,0>=u&&0<=l-f&&0<=n-s)?(gg.subVectors(c,e),o=(l-f)/(l-f+(n-s)),i.copy(e).addScaledVector(gg,o)):(c=1/(u+r+o),e=r*c,o*=c,i.copy(h).addScaledVector(ys,e).addScaledVector(ps,o))},equals:function(n){return n.a.equals(this.a)&&n.b.equals(this.b)&&n.c.equals(this.c)}});var nn={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,rebeccapurple:6697881,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},nr={h:0,s:0,l:0},ry={h:0,s:0,l:0};Object.assign(e.prototype,{isColor:!0,r:1,g:1,b:1,set:function(n){return n&&n.isColor?this.copy(n):"number"==typeof n?this.setHex(n):"string"==typeof n&&this.setStyle(n),this},setScalar:function(n){return this.b=this.g=this.r=n,this},setHex:function(n){return n=Math.floor(n),this.r=(n>>16&255)/255,this.g=(n>>8&255)/255,this.b=(n&255)/255,this},setRGB:function(n,t,i){return this.r=n,this.g=t,this.b=i,this},setHSL:function(n,t,i){return n=a.euclideanModulo(n,1),t=a.clamp(t,0,1),i=a.clamp(i,0,1),0===t?this.r=this.g=this.b=i:(t=.5>=i?i*(1+t):i+t-i*t,i=2*i-t,this.r=ep(i,t,n+1/3),this.g=ep(i,t,n),this.b=ep(i,t,n-1/3)),this},setStyle:function(n){function r(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+n+" will be ignored.")}var t,i,u,f;if(t=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(n)){i=t[2];switch(t[1]){case"rgb":case"rgba":if(t=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,r(t[5]),this;if(t=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,r(t[5]),this;break;case"hsl":case"hsla":if(t=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return i=parseFloat(t[1])/360,u=parseInt(t[2],10)/100,f=parseInt(t[3],10)/100,r(t[5]),this.setHSL(i,u,f)}}else if(t=/^#([A-Fa-f0-9]+)$/.exec(n)){if(t=t[1],i=t.length,3===i)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===i)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return n&&0<n.length?this.setColorName(n):this},setColorName:function(n){var t=nn[n];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+n),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(n){return this.r=n.r,this.g=n.g,this.b=n.b,this},copyGammaToLinear:function(n,t){return void 0===t&&(t=2),this.r=Math.pow(n.r,t),this.g=Math.pow(n.g,t),this.b=Math.pow(n.b,t),this},copyLinearToGamma:function(n,t){return void 0===t&&(t=2),t=0<t?1/t:1,this.r=Math.pow(n.r,t),this.g=Math.pow(n.g,t),this.b=Math.pow(n.b,t),this},convertGammaToLinear:function(n){return this.copyGammaToLinear(this,n),this},convertLinearToGamma:function(n){return this.copyLinearToGamma(this,n),this},copySRGBToLinear:function(n){return this.r=op(n.r),this.g=op(n.g),this.b=op(n.b),this},copyLinearToSRGB:function(n){return this.r=sp(n.r),this.g=sp(n.g),this.b=sp(n.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),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(n){var e;void 0===n&&(console.warn("THREE.Color: .getHSL() target is now required"),n={h:0,s:0,l:0});var o=this.r,i=this.g,r=this.b,u=Math.max(o,i,r),t=Math.min(o,i,r),f,s=(t+u)/2;if(t===u)t=f=0;else{e=u-t,t=.5>=s?e/(u+t):e/(2-u-t);switch(u){case o:f=(i-r)/e+(i<r?6:0);break;case i:f=(r-o)/e+2;break;case r:f=(o-i)/e+4}f/=6}return n.h=f,n.s=t,n.l=s,n},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(n,t,i){return this.getHSL(nr),nr.h+=n,nr.s+=t,nr.l+=i,this.setHSL(nr.h,nr.s,nr.l),this},add:function(n){return this.r+=n.r,this.g+=n.g,this.b+=n.b,this},addColors:function(n,t){return this.r=n.r+t.r,this.g=n.g+t.g,this.b=n.b+t.b,this},addScalar:function(n){return this.r+=n,this.g+=n,this.b+=n,this},sub:function(n){return this.r=Math.max(0,this.r-n.r),this.g=Math.max(0,this.g-n.g),this.b=Math.max(0,this.b-n.b),this},multiply:function(n){return this.r*=n.r,this.g*=n.g,this.b*=n.b,this},multiplyScalar:function(n){return this.r*=n,this.g*=n,this.b*=n,this},lerp:function(n,t){return this.r+=(n.r-this.r)*t,this.g+=(n.g-this.g)*t,this.b+=(n.b-this.b)*t,this},lerpHSL:function(n,t){this.getHSL(nr),n.getHSL(ry),n=a.lerp(nr.h,ry.h,t);var i=a.lerp(nr.s,ry.s,t);return t=a.lerp(nr.l,ry.l,t),this.setHSL(n,i,t),this},equals:function(n){return n.r===this.r&&n.g===this.g&&n.b===this.b},fromArray:function(n,t){return void 0===t&&(t=0),this.r=n[t],this.g=n[t+1],this.b=n[t+2],this},toArray:function(n,t){return void 0===n&&(n=[]),void 0===t&&(t=0),n[t]=this.r,n[t+1]=this.g,n[t+2]=this.b,n},toJSON:function(){return this.getHex()}}),e.NAMES=nn,Object.assign(ye.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(n){this.a=n.a,this.b=n.b,this.c=n.c,this.normal.copy(n.normal),this.color.copy(n.color),this.materialIndex=n.materialIndex;for(var t=0,i=n.vertexNormals.length;t<i;t++)this.vertexNormals[t]=n.vertexNormals[t].clone();for(t=0,i=n.vertexColors.length;t<i;t++)this.vertexColors[t]=n.vertexColors[t].clone();return this}}),tn=0,l.prototype=Object.assign(Object.create(hi.prototype),{constructor:l,isMaterial:!0,onBeforeCompile:function(){},setValues:function(n){var r,t,i;if(void 0!==n)for(r in n)t=n[r],void 0===t?console.warn("THREE.Material: '"+r+"' parameter is undefined."):"shading"===r?(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t?!0:!1):(i=this[r],void 0===i?console.warn("THREE."+this.type+": '"+r+"' is not a property of this material."):i&&i.isColor?i.set(t):i&&i.isVector3&&t&&t.isVector3?i.copy(t):this[r]=t)},toJSON:function(n){function r(n){var i=[],r,t;for(r in n)t=n[r],delete t.metadata,i.push(t);return i}var i=void 0===n||"string"==typeof n,t;return i&&(n={textures:{},images:{}}),t={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}},t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),this.color&&this.color.isColor&&(t.color=this.color.getHex()),void 0!==this.roughness&&(t.roughness=this.roughness),void 0!==this.metalness&&(t.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(t.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(t.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(t.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(t.specular=this.specular.getHex()),void 0!==this.shininess&&(t.shininess=this.shininess),void 0!==this.clearcoat&&(t.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(t.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(t.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(n).uuid,t.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(t.map=this.map.toJSON(n).uuid),this.matcap&&this.matcap.isTexture&&(t.matcap=this.matcap.toJSON(n).uuid),this.alphaMap&&this.alphaMap.isTexture&&(t.alphaMap=this.alphaMap.toJSON(n).uuid),this.lightMap&&this.lightMap.isTexture&&(t.lightMap=this.lightMap.toJSON(n).uuid),this.aoMap&&this.aoMap.isTexture&&(t.aoMap=this.aoMap.toJSON(n).uuid,t.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(t.bumpMap=this.bumpMap.toJSON(n).uuid,t.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(t.normalMap=this.normalMap.toJSON(n).uuid,t.normalMapType=this.normalMapType,t.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(t.displacementMap=this.displacementMap.toJSON(n).uuid,t.displacementScale=this.displacementScale,t.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(t.roughnessMap=this.roughnessMap.toJSON(n).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(t.metalnessMap=this.metalnessMap.toJSON(n).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(t.emissiveMap=this.emissiveMap.toJSON(n).uuid),this.specularMap&&this.specularMap.isTexture&&(t.specularMap=this.specularMap.toJSON(n).uuid),this.envMap&&this.envMap.isTexture&&(t.envMap=this.envMap.toJSON(n).uuid,t.reflectivity=this.reflectivity,t.refractionRatio=this.refractionRatio,void 0!==this.combine&&(t.combine=this.combine),void 0!==this.envMapIntensity&&(t.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(t.gradientMap=this.gradientMap.toJSON(n).uuid),void 0!==this.size&&(t.size=this.size),void 0!==this.sizeAttenuation&&(t.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(t.blending=this.blending),!0===this.flatShading&&(t.flatShading=this.flatShading),0!==this.side&&(t.side=this.side),0!==this.vertexColors&&(t.vertexColors=this.vertexColors),1>this.opacity&&(t.opacity=this.opacity),!0===this.transparent&&(t.transparent=this.transparent),t.depthFunc=this.depthFunc,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,t.stencilWrite=this.stencilWrite,t.stencilWriteMask=this.stencilWriteMask,t.stencilFunc=this.stencilFunc,t.stencilRef=this.stencilRef,t.stencilFuncMask=this.stencilFuncMask,t.stencilFail=this.stencilFail,t.stencilZFail=this.stencilZFail,t.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(t.rotation=this.rotation),!0===this.polygonOffset&&(t.polygonOffset=!0),0!==this.polygonOffsetFactor&&(t.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(t.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(t.linewidth=this.linewidth),void 0!==this.dashSize&&(t.dashSize=this.dashSize),void 0!==this.gapSize&&(t.gapSize=this.gapSize),void 0!==this.scale&&(t.scale=this.scale),!0===this.dithering&&(t.dithering=!0),0<this.alphaTest&&(t.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(t.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(t.wireframe=this.wireframe),1<this.wireframeLinewidth&&(t.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(t.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(t.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(t.morphTargets=!0),!0===this.morphNormals&&(t.morphNormals=!0),!0===this.skinning&&(t.skinning=!0),!1===this.visible&&(t.visible=!1),!1===this.toneMapped&&(t.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(t.userData=this.userData),i&&(i=r(n.textures),n=r(n.images),0<i.length&&(t.textures=i),0<n.length&&(t.images=n)),t},clone:function(){return(new this.constructor).copy(this)},copy:function(n){var i,r,u,t;if(this.name=n.name,this.fog=n.fog,this.blending=n.blending,this.side=n.side,this.flatShading=n.flatShading,this.vertexTangents=n.vertexTangents,this.vertexColors=n.vertexColors,this.opacity=n.opacity,this.transparent=n.transparent,this.blendSrc=n.blendSrc,this.blendDst=n.blendDst,this.blendEquation=n.blendEquation,this.blendSrcAlpha=n.blendSrcAlpha,this.blendDstAlpha=n.blendDstAlpha,this.blendEquationAlpha=n.blendEquationAlpha,this.depthFunc=n.depthFunc,this.depthTest=n.depthTest,this.depthWrite=n.depthWrite,this.stencilWriteMask=n.stencilWriteMask,this.stencilFunc=n.stencilFunc,this.stencilRef=n.stencilRef,this.stencilFuncMask=n.stencilFuncMask,this.stencilFail=n.stencilFail,this.stencilZFail=n.stencilZFail,this.stencilZPass=n.stencilZPass,this.stencilWrite=n.stencilWrite,i=n.clippingPlanes,r=null,null!==i)for(u=i.length,r=Array(u),t=0;t!==u;++t)r[t]=i[t].clone();return this.clippingPlanes=r,this.clipIntersection=n.clipIntersection,this.clipShadows=n.clipShadows,this.shadowSide=n.shadowSide,this.colorWrite=n.colorWrite,this.precision=n.precision,this.polygonOffset=n.polygonOffset,this.polygonOffsetFactor=n.polygonOffsetFactor,this.polygonOffsetUnits=n.polygonOffsetUnits,this.dithering=n.dithering,this.alphaTest=n.alphaTest,this.premultipliedAlpha=n.premultipliedAlpha,this.visible=n.visible,this.toneMapped=n.toneMapped,this.userData=JSON.parse(JSON.stringify(n.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),gt.prototype=Object.create(l.prototype),gt.prototype.constructor=gt,gt.prototype.isMeshBasicMaterial=!0,gt.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.specularMap=n.specularMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.combine=n.combine,this.reflectivity=n.reflectivity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this},Object.defineProperty(c.prototype,"needsUpdate",{set:function(n){!0===n&&this.version++}}),Object.assign(c.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(n){return this.usage=n,this},copy:function(n){return this.name=n.name,this.array=new n.array.constructor(n.array),this.itemSize=n.itemSize,this.count=n.count,this.normalized=n.normalized,this.usage=n.usage,this},copyAt:function(n,t,i){n*=this.itemSize,i*=t.itemSize;for(var r=0,u=this.itemSize;r<u;r++)this.array[n+r]=t.array[i+r];return this},copyArray:function(n){return this.array.set(n),this},copyColorsArray:function(n){for(var t,r=this.array,u=0,i=0,f=n.length;i<f;i++)t=n[i],void 0===t&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),t=new e),r[u++]=t.r,r[u++]=t.g,r[u++]=t.b;return this},copyVector2sArray:function(n){for(var t,u=this.array,f=0,r=0,e=n.length;r<e;r++)t=n[r],void 0===t&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),t=new i),u[f++]=t.x,u[f++]=t.y;return this},copyVector3sArray:function(n){for(var i,u=this.array,f=0,r=0,e=n.length;r<e;r++)i=n[r],void 0===i&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),i=new t),u[f++]=i.x,u[f++]=i.y,u[f++]=i.z;return this},copyVector4sArray:function(n){for(var t,i=this.array,r=0,u=0,f=n.length;u<f;u++)t=n[u],void 0===t&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",u),t=new p),i[r++]=t.x,i[r++]=t.y,i[r++]=t.z,i[r++]=t.w;return this},set:function(n,t){return void 0===t&&(t=0),this.array.set(n,t),this},getX:function(n){return this.array[n*this.itemSize]},setX:function(n,t){return this.array[n*this.itemSize]=t,this},getY:function(n){return this.array[n*this.itemSize+1]},setY:function(n,t){return this.array[n*this.itemSize+1]=t,this},getZ:function(n){return this.array[n*this.itemSize+2]},setZ:function(n,t){return this.array[n*this.itemSize+2]=t,this},getW:function(n){return this.array[n*this.itemSize+3]},setW:function(n,t){return this.array[n*this.itemSize+3]=t,this},setXY:function(n,t,i){return n*=this.itemSize,this.array[n+0]=t,this.array[n+1]=i,this},setXYZ:function(n,t,i,r){return n*=this.itemSize,this.array[n+0]=t,this.array[n+1]=i,this.array[n+2]=r,this},setXYZW:function(n,t,i,r,u){return n*=this.itemSize,this.array[n+0]=t,this.array[n+1]=i,this.array[n+2]=r,this.array[n+3]=u,this},onUpload:function(n){return this.onUploadCallback=n,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),rh.prototype=Object.create(c.prototype),rh.prototype.constructor=rh,uh.prototype=Object.create(c.prototype),uh.prototype.constructor=uh,fh.prototype=Object.create(c.prototype),fh.prototype.constructor=fh,eh.prototype=Object.create(c.prototype),eh.prototype.constructor=eh,uf.prototype=Object.create(c.prototype),uf.prototype.constructor=uf,oh.prototype=Object.create(c.prototype),oh.prototype.constructor=oh,ff.prototype=Object.create(c.prototype),ff.prototype.constructor=ff,r.prototype=Object.create(c.prototype),r.prototype.constructor=r,sh.prototype=Object.create(c.prototype),sh.prototype.constructor=sh,Object.assign(bk.prototype,{computeGroups:function(n){var r=[],u=void 0,i,f,t;for(n=n.faces,i=0;i<n.length;i++)f=n[i],f.materialIndex!==u&&(u=f.materialIndex,void 0!==t&&(t.count=3*i-t.start,r.push(t)),t={start:3*i,materialIndex:u});void 0!==t&&(t.count=3*i-t.start,r.push(t)),this.groups=r},fromGeometry:function(n){var y=n.faces,e=n.vertices,o=n.faceVertexUvs,b=o[0]&&0<o[0].length,k=o[1]&&0<o[1].length,p=n.morphTargets,w=p.length,s,r,h,c,l,u,t,f;if(0<w){for(s=[],r=0;r<w;r++)s[r]={name:p[r].name,data:[]};this.morphTargets.position=s}if(h=n.morphNormals,c=h.length,0<c){for(l=[],r=0;r<c;r++)l[r]={name:h[r].name,data:[]};this.morphTargets.normal=l}var a=n.skinIndices,v=n.skinWeights,d=a.length===e.length,g=v.length===e.length;for(0<e.length&&0===y.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),r=0;r<y.length;r++){for(u=y[r],this.vertices.push(e[u.a],e[u.b],e[u.c]),t=u.vertexNormals,3===t.length?this.normals.push(t[0],t[1],t[2]):(t=u.normal,this.normals.push(t,t,t)),t=u.vertexColors,3===t.length?this.colors.push(t[0],t[1],t[2]):(t=u.color,this.colors.push(t,t,t)),!0===b&&(t=o[0][r],void 0!==t?this.uvs.push(t[0],t[1],t[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",r),this.uvs.push(new i,new i,new i))),!0===k&&(t=o[1][r],void 0!==t?this.uvs2.push(t[0],t[1],t[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",r),this.uvs2.push(new i,new i,new i))),t=0;t<w;t++)f=p[t].vertices,s[t].data.push(f[u.a],f[u.b],f[u.c]);for(t=0;t<c;t++)f=h[t].vertexNormals[r],l[t].data.push(f.a,f.b,f.c);d&&this.skinIndices.push(a[u.a],a[u.b],a[u.c]),g&&this.skinWeights.push(v[u.a],v[u.b],v[u.c])}return this.computeGroups(n),this.verticesNeedUpdate=n.verticesNeedUpdate,this.normalsNeedUpdate=n.normalsNeedUpdate,this.colorsNeedUpdate=n.colorsNeedUpdate,this.uvsNeedUpdate=n.uvsNeedUpdate,this.groupsNeedUpdate=n.groupsNeedUpdate,null!==n.boundingSphere&&(this.boundingSphere=n.boundingSphere.clone()),null!==n.boundingBox&&(this.boundingBox=n.boundingBox.clone()),this}});var hft=1,cr=new v,cb=new u,uy=new t,ue=new ir,lb=new ir,tr=new t;f.prototype=Object.assign(Object.create(hi.prototype),{constructor:f,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(n){this.index=Array.isArray(n)?new(65535<kk(n)?ff:uf)(n,1):n},getAttribute:function(n){return this.attributes[n]},setAttribute:function(n,t){return this.attributes[n]=t,this},deleteAttribute:function(n){return delete this.attributes[n],this},addGroup:function(n,t,i){this.groups.push({start:n,count:t,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(n,t){this.drawRange.start=n,this.drawRange.count=t},applyMatrix:function(n){var i=this.attributes.position,t;return void 0!==i&&(n.applyToBufferAttribute(i),i.needsUpdate=!0),t=this.attributes.normal,void 0!==t&&(i=(new ft).getNormalMatrix(n),i.applyToBufferAttribute(t),t.needsUpdate=!0),t=this.attributes.tangent,void 0!==t&&(i=(new ft).getNormalMatrix(n),i.applyToBufferAttribute(t),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(n){return cr.makeRotationX(n),this.applyMatrix(cr),this},rotateY:function(n){return cr.makeRotationY(n),this.applyMatrix(cr),this},rotateZ:function(n){return cr.makeRotationZ(n),this.applyMatrix(cr),this},translate:function(n,t,i){return cr.makeTranslation(n,t,i),this.applyMatrix(cr),this},scale:function(n,t,i){return cr.makeScale(n,t,i),this.applyMatrix(cr),this},lookAt:function(n){return cb.lookAt(n),cb.updateMatrix(),this.applyMatrix(cb.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(uy).negate(),this.translate(uy.x,uy.y,uy.z),this},setFromObject:function(n){var t=n.geometry,i;return n.isPoints||n.isLine?(n=new r(3*t.vertices.length,3),i=new r(3*t.colors.length,3),this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",i.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length&&(n=new r(t.lineDistances.length,1),this.setAttribute("lineDistance",n.copyArray(t.lineDistances))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())):n.isMesh&&t&&t.isGeometry&&this.fromGeometry(t),this},setFromPoints:function(n){for(var t,u=[],i=0,f=n.length;i<f;i++)t=n[i],u.push(t.x,t.y,t.z||0);return this.setAttribute("position",new r(u,3)),this},updateFromObject:function(n){var t=n.geometry,i;if(n.isMesh){if(i=t.__directGeometry,!0===t.elementsNeedUpdate&&(i=void 0,t.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(t);i.verticesNeedUpdate=t.verticesNeedUpdate,i.normalsNeedUpdate=t.normalsNeedUpdate,i.colorsNeedUpdate=t.colorsNeedUpdate,i.uvsNeedUpdate=t.uvsNeedUpdate,i.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=i}return!0===t.verticesNeedUpdate&&(i=this.attributes.position,void 0!==i&&(i.copyVector3sArray(t.vertices),i.needsUpdate=!0),t.verticesNeedUpdate=!1),!0===t.normalsNeedUpdate&&(i=this.attributes.normal,void 0!==i&&(i.copyVector3sArray(t.normals),i.needsUpdate=!0),t.normalsNeedUpdate=!1),!0===t.colorsNeedUpdate&&(i=this.attributes.color,void 0!==i&&(i.copyColorsArray(t.colors),i.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(i=this.attributes.uv,void 0!==i&&(i.copyVector2sArray(t.uvs),i.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(i=this.attributes.lineDistance,void 0!==i&&(i.copyArray(t.lineDistances),i.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(n.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(n){return n.__directGeometry=(new bk).fromGeometry(n),this.fromDirectGeometry(n.__directGeometry)},fromDirectGeometry:function(n){var t=new Float32Array(3*n.vertices.length),i,u,e;this.setAttribute("position",new c(t,3).copyVector3sArray(n.vertices)),0<n.normals.length&&(t=new Float32Array(3*n.normals.length),this.setAttribute("normal",new c(t,3).copyVector3sArray(n.normals))),0<n.colors.length&&(t=new Float32Array(3*n.colors.length),this.setAttribute("color",new c(t,3).copyColorsArray(n.colors))),0<n.uvs.length&&(t=new Float32Array(2*n.uvs.length),this.setAttribute("uv",new c(t,2).copyVector2sArray(n.uvs))),0<n.uvs2.length&&(t=new Float32Array(2*n.uvs2.length),this.setAttribute("uv2",new c(t,2).copyVector2sArray(n.uvs2))),this.groups=n.groups;for(i in n.morphTargets){t=[];for(var o=n.morphTargets[i],f=0,s=o.length;f<s;f++)u=o[f],e=new r(3*u.data.length,3),e.name=u.name,t.push(e.copyVector3sArray(u.data));this.morphAttributes[i]=t}return 0<n.skinIndices.length&&(i=new r(4*n.skinIndices.length,4),this.setAttribute("skinIndex",i.copyVector4sArray(n.skinIndices))),0<n.skinWeights.length&&(i=new r(4*n.skinWeights.length,4),this.setAttribute("skinWeight",i.copyVector4sArray(n.skinWeights))),null!==n.boundingSphere&&(this.boundingSphere=n.boundingSphere.clone()),null!==n.boundingBox&&(this.boundingBox=n.boundingBox.clone()),this},computeBoundingBox:function(){var n,t,i;if(null===this.boundingBox&&(this.boundingBox=new ir),n=this.attributes.position,t=this.morphAttributes.position,void 0!==n){if(this.boundingBox.setFromBufferAttribute(n),t)for(n=0,i=t.length;n<i;n++)ue.setFromBufferAttribute(t[n]),this.boundingBox.expandByPoint(ue.min),this.boundingBox.expandByPoint(ue.max)}else this.boundingBox.makeEmpty();(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,i,e,n,r,f,u,o;if(null===this.boundingSphere&&(this.boundingSphere=new pr),t=this.attributes.position,i=this.morphAttributes.position,t){if(e=this.boundingSphere.center,ue.setFromBufferAttribute(t),i)for(n=0,r=i.length;n<r;n++)f=i[n],lb.setFromBufferAttribute(f),ue.expandByPoint(lb.min),ue.expandByPoint(lb.max);for(ue.getCenter(e),u=0,n=0,r=t.count;n<r;n++)tr.fromBufferAttribute(t,n),u=Math.max(u,e.distanceToSquared(tr));if(i)for(n=0,r=i.length;n<r;n++)for(f=i[n],t=0,o=f.count;t<o;t++)tr.fromBufferAttribute(f,t),u=Math.max(u,e.distanceToSquared(tr));this.boundingSphere.radius=Math.sqrt(u),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 f=this.index,e=this.attributes,u,p,h,l;if(e.position){if(u=e.position.array,void 0===e.normal)this.setAttribute("normal",new c(new Float32Array(u.length),3));else for(var r=e.normal.array,n=0,s=r.length;n<s;n++)r[n]=0;r=e.normal.array;var a=new t,o=new t,v=new t,i=new t,y=new t;if(f)for(p=f.array,n=0,s=f.count;n<s;n+=3)f=3*p[n+0],h=3*p[n+1],l=3*p[n+2],a.fromArray(u,f),o.fromArray(u,h),v.fromArray(u,l),i.subVectors(v,o),y.subVectors(a,o),i.cross(y),r[f]+=i.x,r[f+1]+=i.y,r[f+2]+=i.z,r[h]+=i.x,r[h+1]+=i.y,r[h+2]+=i.z,r[l]+=i.x,r[l+1]+=i.y,r[l+2]+=i.z;else for(n=0,s=u.length;n<s;n+=9)a.fromArray(u,n),o.fromArray(u,n+3),v.fromArray(u,n+6),i.subVectors(v,o),y.subVectors(a,o),i.cross(y),r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r[n+3]=i.x,r[n+4]=i.y,r[n+5]=i.z,r[n+6]=i.x,r[n+7]=i.y,r[n+8]=i.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(n,t){var f,i,u;if(n&&n.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.")),f=this.attributes;for(i in f)if(void 0!==n.attributes[i]){var o=f[i].array,r=n.attributes[i],s=r.array,e=r.itemSize*t;for(r=Math.min(s.length,o.length-e),u=0;u<r;u++,e++)o[e]=s[u]}return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",n)},normalizeNormals:function(){for(var t=this.attributes.normal,n=0,i=t.count;n<i;n++)tr.x=t.getX(n),tr.y=t.getY(n),tr.z=t.getZ(n),tr.normalize(),t.setXYZ(n,tr.x,tr.y,tr.z)},toNonIndexed:function(){function h(n,t){var u=n.array,r;n=n.itemSize;for(var f=new u.constructor(t.length*n),e,o=0,i=0,s=t.length;i<s;i++)for(e=t[i]*n,r=0;r<n;r++)f[o++]=u[e++];return new c(f,n)}var n,e,o,s,l;if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var u=new f,r=this.index.array,t=this.attributes,i;for(i in t)n=t[i],n=h(n,r),u.setAttribute(i,n);e=this.morphAttributes;for(i in e){for(o=[],s=e[i],t=0,l=s.length;t<l;t++)n=s[t],n=h(n,r),o.push(n);u.morphAttributes[i]=o}for(r=this.groups,t=0,i=r.length;t<i;t++)n=r[t],u.addGroup(n.start,n.count,n.materialIndex);return u},toJSON:function(){var i={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}},t,r,u,f,n;if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),0<Object.keys(this.userData).length&&(i.userData=this.userData),void 0!==this.parameters){t=this.parameters;for(n in t)void 0!==t[n]&&(i[n]=t[n]);return i}i.data={attributes:{}},t=this.index,null!==t&&(i.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)}),r=this.attributes;for(n in r)t=r[n],u=t.toJSON(),""!==t.name&&(u.name=t.name),i.data.attributes[n]=u;r={},f=!1;for(n in this.morphAttributes){for(var s=this.morphAttributes[n],e=[],o=0,h=s.length;o<h;o++)t=s[o],u=t.toJSON(),""!==t.name&&(u.name=t.name),e.push(u);0<e.length&&(r[n]=e,f=!0)}return f&&(i.data.morphAttributes=r),n=this.groups,0<n.length&&(i.data.groups=JSON.parse(JSON.stringify(n))),n=this.boundingSphere,null!==n&&(i.data.boundingSphere={center:n.center.toArray(),radius:n.radius}),i},clone:function(){return(new f).copy(this)},copy:function(n){var u,i,r,f,e,t;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingSphere=this.boundingBox=null,this.name=n.name,i=n.index,null!==i&&this.setIndex(i.clone()),i=n.attributes;for(t in i)this.setAttribute(t,i[t].clone());r=n.morphAttributes;for(t in r){for(f=[],e=r[t],i=0,u=e.length;i<u;i++)f.push(e[i].clone());this.morphAttributes[t]=f}for(t=n.groups,i=0,u=t.length;i<u;i++)r=t[i],this.addGroup(r.start,r.count,r.materialIndex);return t=n.boundingBox,null!==t&&(this.boundingBox=t.clone()),t=n.boundingSphere,null!==t&&(this.boundingSphere=t.clone()),this.drawRange.start=n.drawRange.start,this.drawRange.count=n.drawRange.count,this.userData=n.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var rn=new v,fe=new rf,ab=new pr,ee=new t,oe=new t,se=new t,un=new t,fn=new t,en=new t,vb=new t,yb=new t,pb=new t,ws=new i,bs=new i,ks=new i,ll=new t,fy=new t;tt.prototype=Object.assign(Object.create(u.prototype),{constructor:tt,isMesh:!0,setDrawMode:function(n){this.drawMode=n},copy:function(n){return u.prototype.copy.call(this,n),this.drawMode=n.drawMode,void 0!==n.morphTargetInfluences&&(this.morphTargetInfluences=n.morphTargetInfluences.slice()),void 0!==n.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},n.morphTargetDictionary)),this},updateMorphTargets:function(){var n=this.geometry,t,i,r;if(n.isBufferGeometry){if(n=n.morphAttributes,t=Object.keys(n),0<t.length&&(i=n[t[0]],void 0!==i))for(this.morphTargetInfluences=[],this.morphTargetDictionary={},n=0,t=i.length;n<t;n++)r=i[n].name||String(n),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=n}else n=n.morphTargets,void 0!==n&&0<n.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},raycast:function(n,t){var r=this.geometry,c=this.material,h=this.matrixWorld,s,u,v,y;if(void 0!==c&&(null===r.boundingSphere&&r.computeBoundingSphere(),ab.copy(r.boundingSphere),ab.applyMatrix4(h),!1!==n.ray.intersectsSphere(ab)&&(rn.getInverse(h),fe.copy(n.ray).applyMatrix4(rn),null===r.boundingBox||!1!==fe.intersectsBox(r.boundingBox))))if(0!==this.drawMode)console.warn("THREE.Mesh: TriangleStripDrawMode and TriangleFanDrawMode are not supported by .raycast().");else if(r.isBufferGeometry){s=r.index,h=r.attributes.position;var a=r.morphAttributes.position,p=r.attributes.uv,w=r.attributes.uv2,b=r.groups,o=r.drawRange,l,d;if(null!==s)if(Array.isArray(c))for(u=0,l=b.length;u<l;u++){var f=b[u],k=c[f.materialIndex],e=Math.max(f.start,o.start);for(d=r=Math.min(f.start+f.count,o.start+o.count);e<d;e+=3)r=s.getX(e),v=s.getX(e+1),y=s.getX(e+2),(r=ra(this,k,n,fe,h,a,p,w,r,v,y))&&(r.faceIndex=Math.floor(e/3),r.face.materialIndex=f.materialIndex,t.push(r))}else for(e=Math.max(0,o.start),r=Math.min(s.count,o.start+o.count),u=e,l=r;u<l;u+=3)(r=s.getX(u),v=s.getX(u+1),y=s.getX(u+2),r=ra(this,c,n,fe,h,a,p,w,r,v,y))&&(r.faceIndex=Math.floor(u/3),t.push(r));else if(void 0!==h)if(Array.isArray(c))for(u=0,l=b.length;u<l;u++)for(f=b[u],k=c[f.materialIndex],e=Math.max(f.start,o.start),d=r=Math.min(f.start+f.count,o.start+o.count);e<d;e+=3)(r=e,v=e+1,y=e+2,r=ra(this,k,n,fe,h,a,p,w,r,v,y))&&(r.faceIndex=Math.floor(e/3),r.face.materialIndex=f.materialIndex,t.push(r));else for(e=Math.max(0,o.start),r=Math.min(h.count,o.start+o.count),u=e,l=r;u<l;u+=3)(r=u,v=u+1,y=u+2,r=ra(this,c,n,fe,h,a,p,w,r,v,y))&&(r.faceIndex=Math.floor(u/3),t.push(r))}else if(r.isGeometry)for(h=Array.isArray(c),a=r.vertices,p=r.faces,r=r.faceVertexUvs[0],0<r.length&&(s=r),u=0,l=p.length;u<l;u++)(f=p[u],r=h?c[f.materialIndex]:c,void 0!==r&&(w=a[f.a],b=a[f.b],o=a[f.c],r=dk(this,r,n,fe,w,b,o,ll)))&&(s&&s[u]&&(k=s[u],ws.copy(k[0]),bs.copy(k[1]),ks.copy(k[2]),r.uv=et.getUV(ll,w,b,o,ws,bs,ks,new i)),r.face=f,r.faceIndex=u,t.push(r))},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var cft=0,lr=new v,wb=new u,ey=new t;h.prototype=Object.assign(Object.create(hi.prototype),{constructor:h,isGeometry:!0,applyMatrix:function(n){for(var i,f,u=(new ft).getNormalMatrix(n),t=0,r=this.vertices.length;t<r;t++)this.vertices[t].applyMatrix4(n);for(t=0,r=this.faces.length;t<r;t++)for(n=this.faces[t],n.normal.applyMatrix3(u).normalize(),i=0,f=n.vertexNormals.length;i<f;i++)n.vertexNormals[i].applyMatrix3(u).normalize();return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0,this},rotateX:function(n){return lr.makeRotationX(n),this.applyMatrix(lr),this},rotateY:function(n){return lr.makeRotationY(n),this.applyMatrix(lr),this},rotateZ:function(n){return lr.makeRotationZ(n),this.applyMatrix(lr),this},translate:function(n,t,i){return lr.makeTranslation(n,t,i),this.applyMatrix(lr),this},scale:function(n,t,i){return lr.makeScale(n,t,i),this.applyMatrix(lr),this},lookAt:function(n){return wb.lookAt(n),wb.updateMatrix(),this.applyMatrix(wb.matrix),this},fromBufferGeometry:function(n){function c(n,r,u,f){var e=void 0===p?[]:[o.colors[n].clone(),o.colors[r].clone(),o.colors[u].clone()],s=void 0===l?[]:[(new t).fromArray(l,3*n),(new t).fromArray(l,3*r),(new t).fromArray(l,3*u)];f=new ye(n,r,u,s,e,f),o.faces.push(f),void 0!==a&&o.faceVertexUvs[0].push([(new i).fromArray(a,2*n),(new i).fromArray(a,2*r),(new i).fromArray(a,2*u)]),void 0!==h&&o.faceVertexUvs[1].push([(new i).fromArray(h,2*n),(new i).fromArray(h,2*r),(new i).fromArray(h,2*u)])}var o=this,u=null!==n.index?n.index.array:void 0,r=n.attributes,v,y,f;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var s=r.position.array,l=void 0!==r.normal?r.normal.array:void 0,p=void 0!==r.color?r.color.array:void 0,a=void 0!==r.uv?r.uv.array:void 0,h=void 0!==r.uv2?r.uv2.array:void 0;for(void 0!==h&&(this.faceVertexUvs[1]=[]),r=0;r<s.length;r+=3)o.vertices.push((new t).fromArray(s,r)),void 0!==p&&o.colors.push((new e).fromArray(p,r));if(v=n.groups,0<v.length)for(r=0;r<v.length;r++)for(s=v[r],y=s.start,f=y,y+=s.count;f<y;f+=3)void 0!==u?c(u[f],u[f+1],u[f+2],s.materialIndex):c(f,f+1,f+2,s.materialIndex);else if(void 0!==u)for(r=0;r<u.length;r+=3)c(u[r],u[r+1],u[r+2]);else for(r=0;r<s.length/3;r+=3)c(r,r+1,r+2);return this.computeFaceNormals(),null!==n.boundingBox&&(this.boundingBox=n.boundingBox.clone()),null!==n.boundingSphere&&(this.boundingSphere=n.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ey).negate(),this.translate(ey.x,ey.y,ey.z),this},normalize:function(){var t,n,i;return this.computeBoundingSphere(),t=this.boundingSphere.center,n=this.boundingSphere.radius,n=0===n?1:1/n,i=new v,i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var n=new t,u=new t,r=0,e=this.faces.length;r<e;r++){var i=this.faces[r],o=this.vertices[i.a],f=this.vertices[i.b];n.subVectors(this.vertices[i.c],f),u.subVectors(o,f),n.cross(u),n.normalize(),i.normal.copy(n)}},computeVertexNormals:function(n){var i,r,u,e,o;for(void 0===n&&(n=!0),r=Array(this.vertices.length),u=0,i=this.vertices.length;u<i;u++)r[u]=new t;if(n)for(e=new t,o=new t,n=0,u=this.faces.length;n<u;n++){i=this.faces[n];var f=this.vertices[i.a],s=this.vertices[i.b],h=this.vertices[i.c];e.subVectors(h,s),o.subVectors(f,s),e.cross(o),r[i.a].add(e),r[i.b].add(e),r[i.c].add(e)}else for(this.computeFaceNormals(),n=0,u=this.faces.length;n<u;n++)i=this.faces[n],r[i.a].add(i.normal),r[i.b].add(i.normal),r[i.c].add(i.normal);for(u=0,i=this.vertices.length;u<i;u++)r[u].normalize();for(n=0,u=this.faces.length;n<u;n++)i=this.faces[n],f=i.vertexNormals,3===f.length?(f[0].copy(r[i.a]),f[1].copy(r[i.b]),f[2].copy(r[i.c])):(f[0]=r[i.a].clone(),f[1]=r[i.b].clone(),f[2]=r[i.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var r,i,n,t;for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)n=this.faces[i],t=n.vertexNormals,3===t.length?(t[0].copy(n.normal),t[1].copy(n.normal),t[2].copy(n.normal)):(t[0]=n.normal.clone(),t[1]=n.normal.clone(),t[2]=n.normal.clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var s,r=0,n,i,e,o,c,f,u=this.faces.length;r<u;r++)for(n=this.faces[r],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),i=0,s=n.vertexNormals.length;i<s;i++)n.__originalVertexNormals[i]?n.__originalVertexNormals[i].copy(n.vertexNormals[i]):n.__originalVertexNormals[i]=n.vertexNormals[i].clone();for(e=new h,e.faces=this.faces,i=0,s=this.morphTargets.length;i<s;i++){if(!this.morphNormals[i])for(this.morphNormals[i]={},this.morphNormals[i].faceNormals=[],this.morphNormals[i].vertexNormals=[],n=this.morphNormals[i].faceNormals,o=this.morphNormals[i].vertexNormals,r=0,u=this.faces.length;r<u;r++)c=new t,f={a:new t,b:new t,c:new t},n.push(c),o.push(f);for(o=this.morphNormals[i],e.vertices=this.morphTargets[i].vertices,e.computeFaceNormals(),e.computeVertexNormals(),r=0,u=this.faces.length;r<u;r++)n=this.faces[r],c=o.faceNormals[r],f=o.vertexNormals[r],c.copy(n.normal),f.a.copy(n.vertexNormals[0]),f.b.copy(n.vertexNormals[1]),f.c.copy(n.vertexNormals[2])}for(r=0,u=this.faces.length;r<u;r++)n=this.faces[r],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new ir),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new pr),this.boundingSphere.setFromPoints(this.vertices)},merge:function(n,t,i){var r,o,s,y;if(n&&n.isGeometry){var e,c=this.vertices.length,h=this.vertices,u=n.vertices,l=this.faces,v=n.faces,f=this.colors,a=n.colors;for(void 0===i&&(i=0),void 0!==t&&(e=(new ft).getNormalMatrix(t)),r=0,o=u.length;r<o;r++)s=u[r].clone(),void 0!==t&&s.applyMatrix4(t),h.push(s);for(r=0,o=a.length;r<o;r++)f.push(a[r].clone());for(r=0,o=v.length;r<o;r++){for(u=v[r],y=u.vertexNormals,a=u.vertexColors,f=new ye(u.a+c,u.b+c,u.c+c),f.normal.copy(u.normal),void 0!==e&&f.normal.applyMatrix3(e).normalize(),t=0,h=y.length;t<h;t++)s=y[t].clone(),void 0!==e&&s.applyMatrix3(e).normalize(),f.vertexNormals.push(s);for(f.color.copy(u.color),t=0,h=a.length;t<h;t++)s=a[t],f.vertexColors.push(s.clone());f.materialIndex=u.materialIndex+i,l.push(f)}for(r=0,o=n.faceVertexUvs.length;r<o;r++)for(i=n.faceVertexUvs[r],void 0===this.faceVertexUvs[r]&&(this.faceVertexUvs[r]=[]),t=0,h=i.length;t<h;t++){for(e=i[t],c=[],l=0,v=e.length;l<v;l++)c.push(e[l].clone());this.faceVertexUvs[r].push(c)}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",n)},mergeMesh:function(n){n&&n.isMesh?(n.matrixAutoUpdate&&n.updateMatrix(),this.merge(n.geometry,n.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",n)},mergeVertices:function(){for(var u={},e=[],r=[],n=Math.pow(10,4),t=0,i,f=this.vertices.length;t<f;t++)i=this.vertices[t],i=Math.round(i.x*n)+"_"+Math.round(i.y*n)+"_"+Math.round(i.z*n),void 0===u[i]?(u[i]=t,e.push(this.vertices[t]),r[t]=e.length-1):r[t]=r[u[i]];for(u=[],t=0,f=this.faces.length;t<f;t++)for(n=this.faces[t],n.a=r[n.a],n.b=r[n.b],n.c=r[n.c],n=[n.a,n.b,n.c],i=0;3>i;i++)if(n[i]===n[(i+1)%3]){u.push(t);break}for(t=u.length-1;0<=t;t--)for(n=u[t],this.faces.splice(n,1),r=0,f=this.faceVertexUvs.length;r<f;r++)this.faceVertexUvs[r].splice(n,1);return t=this.vertices.length-e.length,this.vertices=e,t},setFromPoints:function(n){var i,u,r;for(this.vertices=[],i=0,u=n.length;i<u;i++)r=n[i],this.vertices.push(new t(r.x,r.y,r.z||0));return this},sortFacesByMaterialIndex:function(){for(var f,e,t,i,o,r=this.faces,u=r.length,n=0;n<u;n++)r[n]._id=n;for(r.sort(function(n,t){return n.materialIndex-t.materialIndex}),f=this.faceVertexUvs[0],e=this.faceVertexUvs[1],f&&f.length===u&&(t=[]),e&&e.length===u&&(i=[]),n=0;n<u;n++)o=r[n]._id,t&&t.push(f[o]),i&&i.push(e[o]);t&&(this.faceVertexUvs[0]=t),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){function f(n,t,i){return i?n|1<<t:n&~(1<<t)}function h(n){var t=n.x.toString()+n.y.toString()+n.z.toString();return void 0!==l[t]?l[t]:(l[t]=b.length/3,b.push(n.x,n.y,n.z),l[t])}function c(n){var t=n.r.toString()+n.g.toString()+n.b.toString();return void 0!==v[t]?v[t]:(v[t]=a.length,a.push(n.getHex()),v[t])}function w(n){var t=n.x.toString()+n.y.toString();return void 0!==p[t]?p[t]:(p[t]=y.length/2,y.push(n.x,n.y),p[t])}var u={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}},e,i,r;if(u.uuid=this.uuid,u.type=this.type,""!==this.name&&(u.name=this.name),void 0!==this.parameters){e=this.parameters;for(i in e)void 0!==e[i]&&(u[i]=e[i]);return u}for(e=[],i=0;i<this.vertices.length;i++)r=this.vertices[i],e.push(r.x,r.y,r.z);r=[];var b=[],l={},a=[],v={},y=[],p={};for(i=0;i<this.faces.length;i++){var n=this.faces[i],o=void 0!==this.faceVertexUvs[0][i],s=0<n.normal.length(),k=0<n.vertexNormals.length,d=1!==n.color.r||1!==n.color.g||1!==n.color.b,g=0<n.vertexColors.length,t=0;t=f(t,0,0),t=f(t,1,!0),t=f(t,2,!1),t=f(t,3,o),t=f(t,4,s),t=f(t,5,k),t=f(t,6,d),t=f(t,7,g),r.push(t),r.push(n.a,n.b,n.c),r.push(n.materialIndex),o&&(o=this.faceVertexUvs[0][i],r.push(w(o[0]),w(o[1]),w(o[2]))),s&&r.push(h(n.normal)),k&&(s=n.vertexNormals,r.push(h(s[0]),h(s[1]),h(s[2]))),d&&r.push(c(n.color)),g&&(n=n.vertexColors,r.push(c(n[0]),c(n[1]),c(n[2])))}return u.data={},u.data.vertices=e,u.data.normals=b,0<a.length&&(u.data.colors=a),0<y.length&&(u.data.uvs=[y]),u.data.faces=r,u},clone:function(){return(new h).copy(this)},copy:function(n){var u,e,f,i,t,o;for(this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.name=n.name,i=n.vertices,t=0,u=i.length;t<u;t++)this.vertices.push(i[t].clone());for(i=n.colors,t=0,u=i.length;t<u;t++)this.colors.push(i[t].clone());for(i=n.faces,t=0,u=i.length;t<u;t++)this.faces.push(i[t].clone());for(t=0,u=n.faceVertexUvs.length;t<u;t++)for(o=n.faceVertexUvs[t],void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),i=0,e=o.length;i<e;i++){var s=o[i],h=[],r=0;for(f=s.length;r<f;r++)h.push(s[r].clone());this.faceVertexUvs[t].push(h)}for(r=n.morphTargets,t=0,u=r.length;t<u;t++){if(f={},f.name=r[t].name,void 0!==r[t].vertices)for(f.vertices=[],i=0,e=r[t].vertices.length;i<e;i++)f.vertices.push(r[t].vertices[i].clone());if(void 0!==r[t].normals)for(f.normals=[],i=0,e=r[t].normals.length;i<e;i++)f.normals.push(r[t].normals[i].clone());this.morphTargets.push(f)}for(r=n.morphNormals,t=0,u=r.length;t<u;t++){if(f={},void 0!==r[t].vertexNormals)for(f.vertexNormals=[],i=0,e=r[t].vertexNormals.length;i<e;i++)o=r[t].vertexNormals[i],s={},s.a=o.a.clone(),s.b=o.b.clone(),s.c=o.c.clone(),f.vertexNormals.push(s);if(void 0!==r[t].faceNormals)for(f.faceNormals=[],i=0,e=r[t].faceNormals.length;i<e;i++)f.faceNormals.push(r[t].faceNormals[i].clone());this.morphNormals.push(f)}for(i=n.skinWeights,t=0,u=i.length;t<u;t++)this.skinWeights.push(i[t].clone());for(i=n.skinIndices,t=0,u=i.length;t<u;t++)this.skinIndices.push(i[t].clone());for(i=n.lineDistances,t=0,u=i.length;t<u;t++)this.lineDistances.push(i[t]);return t=n.boundingBox,null!==t&&(this.boundingBox=t.clone()),t=n.boundingSphere,null!==t&&(this.boundingSphere=t.clone()),this.elementsNeedUpdate=n.elementsNeedUpdate,this.verticesNeedUpdate=n.verticesNeedUpdate,this.uvsNeedUpdate=n.uvsNeedUpdate,this.normalsNeedUpdate=n.normalsNeedUpdate,this.colorsNeedUpdate=n.colorsNeedUpdate,this.lineDistancesNeedUpdate=n.lineDistancesNeedUpdate,this.groupsNeedUpdate=n.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var bb=function(n){function t(t,i,r,u,f,e){n.call(this),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:r,widthSegments:u,heightSegments:f,depthSegments:e},this.fromBufferGeometry(new al(t,i,r,u,f,e)),this.mergeVertices()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t}(h),al=function(n){function i(i,u,f,e,o,s){function h(n,i,r,u,f,e,o,s,h,b,k){var rt=e/h,ut=o/b,ft=e/2,et=o/2,ot=s/2,it;o=h+1;for(var st=b+1,tt=e=0,d,nt=new t,g=0;g<st;g++)for(it=g*ut-et,d=0;d<o;d++)nt[n]=(d*rt-ft)*u,nt[i]=it*f,nt[r]=ot,y.push(nt.x,nt.y,nt.z),nt[n]=0,nt[i]=0,nt[r]=0<s?1:-1,p.push(nt.x,nt.y,nt.z),a.push(d/h),a.push(1-g/b),e+=1;for(g=0;g<b;g++)for(d=0;d<h;d++)n=c+d+o*(g+1),i=c+(d+1)+o*(g+1),r=c+(d+1)+o*g,l.push(c+d+o*g,n,r),l.push(n,i,r),tt+=6;v.addGroup(w,tt,k),w+=tt,c+=e}var v;n.call(this),this.type="BoxBufferGeometry",this.parameters={width:i,height:u,depth:f,widthSegments:e,heightSegments:o,depthSegments:s},v=this,i=i||1,u=u||1,f=f||1,e=Math.floor(e)||1,o=Math.floor(o)||1,s=Math.floor(s)||1;var l=[],y=[],p=[],a=[],c=0,w=0;h("z","y","x",-1,-1,f,u,i,s,o,0),h("z","y","x",1,-1,f,u,-i,s,o,1),h("x","z","y",1,1,i,f,u,e,s,2),h("x","z","y",1,-1,i,f,-u,e,s,3),h("x","y","z",1,-1,i,u,f,e,o,4),h("x","y","z",-1,-1,i,u,-f,e,o,5),this.setIndex(l),this.setAttribute("position",new r(y,3)),this.setAttribute("normal",new r(p,3)),this.setAttribute("uv",new r(a,2))}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i}(f),lft={clone:ef,merge:bt};at.prototype=Object.create(l.prototype),at.prototype.constructor=at,at.prototype.isShaderMaterial=!0,at.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.fragmentShader=n.fragmentShader,this.vertexShader=n.vertexShader,this.uniforms=ef(n.uniforms),this.defines=Object.assign({},n.defines),this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.lights=n.lights,this.clipping=n.clipping,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this.extensions=n.extensions,this},at.prototype.toJSON=function(n){var i=l.prototype.toJSON.call(this,n),r,t,u;i.uniforms={};for(r in this.uniforms)t=this.uniforms[r].value,i.uniforms[r]=t&&t.isTexture?{type:"t",value:t.toJSON(n).uuid}:t&&t.isColor?{type:"c",value:t.getHex()}:t&&t.isVector2?{type:"v2",value:t.toArray()}:t&&t.isVector3?{type:"v3",value:t.toArray()}:t&&t.isVector4?{type:"v4",value:t.toArray()}:t&&t.isMatrix3?{type:"m3",value:t.toArray()}:t&&t.isMatrix4?{type:"m4",value:t.toArray()}:{value:t};0<Object.keys(this.defines).length&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader,n={};for(u in this.extensions)!0===this.extensions[u]&&(n[u]=!0);return 0<Object.keys(n).length&&(i.extensions=n),i},rr.prototype=Object.assign(Object.create(u.prototype),{constructor:rr,isCamera:!0,copy:function(n,t){return u.prototype.copy.call(this,n,t),this.matrixWorldInverse.copy(n.matrixWorldInverse),this.projectionMatrix.copy(n.projectionMatrix),this.projectionMatrixInverse.copy(n.projectionMatrixInverse),this},getWorldDirection:function(n){void 0===n&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),n=new t),this.updateMatrixWorld(!0);var i=this.matrixWorld.elements;return n.set(-i[8],-i[9],-i[10]).normalize()},updateMatrixWorld:function(n){u.prototype.updateMatrixWorld.call(this,n),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),it.prototype=Object.assign(Object.create(rr.prototype),{constructor:it,isPerspectiveCamera:!0,copy:function(n,t){return rr.prototype.copy.call(this,n,t),this.fov=n.fov,this.zoom=n.zoom,this.near=n.near,this.far=n.far,this.focus=n.focus,this.aspect=n.aspect,this.view=null===n.view?null:Object.assign({},n.view),this.filmGauge=n.filmGauge,this.filmOffset=n.filmOffset,this},setFocalLength:function(n){n=.5*this.getFilmHeight()/n,this.fov=2*a.RAD2DEG*Math.atan(n),this.updateProjectionMatrix()},getFocalLength:function(){var n=Math.tan(.5*a.DEG2RAD*this.fov);return.5*this.getFilmHeight()/n},getEffectiveFOV:function(){return 2*a.RAD2DEG*Math.atan(Math.tan(.5*a.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(n,t,i,r,u,f){this.aspect=n/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=n,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=u,this.view.height=f,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var f=this.near,t=f*Math.tan(.5*a.DEG2RAD*this.fov)/this.zoom,i=2*t,r=this.aspect*i,u=-.5*r,n=this.view,e,o;null!==this.view&&this.view.enabled&&(e=n.fullWidth,o=n.fullHeight,u+=n.offsetX*r/e,t-=n.offsetY*i/o,r*=n.width/e,i*=n.height/o),n=this.filmOffset,0!==n&&(u+=f*n/this.getFilmWidth()),this.projectionMatrix.makePerspective(u,u+r,t,t-i,f,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(n){return n=u.prototype.toJSON.call(this,n),n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,null!==this.view&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}),pe.prototype=Object.create(u.prototype),pe.prototype.constructor=pe,su.prototype=Object.create(wt.prototype),su.prototype.constructor=su,su.prototype.isWebGLRenderTargetCube=!0,su.prototype.fromEquirectangularTexture=function(n,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var r=new ih,i=new at({type:"CubemapFromEquirect",uniforms:ef({tEquirect:{value:null}}),vertexShader:"varying vec3 vWorldDirection;\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",fragmentShader:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}",side:1,blending:0});return i.uniforms.tEquirect.value=t,t=new tt(new al(5,5,5),i),r.add(t),i=new pe(1,10,1),i.renderTarget=this,i.renderTarget.texture.name="CubeCameraTexture",i.update(n,r),t.geometry.dispose(),t.material.dispose(),this},of.prototype=Object.create(k.prototype),of.prototype.constructor=of,of.prototype.isDataTexture=!0,he=new pr,vl=new t,Object.assign(hh.prototype,{set:function(n,t,i,r,u,f){var e=this.planes;return e[0].copy(n),e[1].copy(t),e[2].copy(i),e[3].copy(r),e[4].copy(u),e[5].copy(f),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){for(var i=this.planes,t=0;6>t;t++)i[t].copy(n.planes[t]);return this},setFromMatrix:function(n){var i=this.planes,t=n.elements;n=t[0];var e=t[1],o=t[2],r=t[3],s=t[4],h=t[5],c=t[6],u=t[7],l=t[8],a=t[9],v=t[10],f=t[11],y=t[12],p=t[13],w=t[14];return t=t[15],i[0].setComponents(r-n,u-s,f-l,t-y).normalize(),i[1].setComponents(r+n,u+s,f+l,t+y).normalize(),i[2].setComponents(r+e,u+h,f+a,t+p).normalize(),i[3].setComponents(r-e,u-h,f-a,t-p).normalize(),i[4].setComponents(r-o,u-c,f-v,t-w).normalize(),i[5].setComponents(r+o,u+c,f+v,t+w).normalize(),this},intersectsObject:function(n){var t=n.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),he.copy(t.boundingSphere).applyMatrix4(n.matrixWorld),this.intersectsSphere(he)},intersectsSprite:function(n){return he.center.set(0,0,0),he.radius=.70710678118654757,he.applyMatrix4(n.matrixWorld),this.intersectsSphere(he)},intersectsSphere:function(n){var i=this.planes,r=n.center,t;for(n=-n.radius,t=0;6>t;t++)if(i[t].distanceToPoint(r)<n)return!1;return!0},intersectsBox:function(n){for(var t,r=this.planes,i=0;6>i;i++)if(t=r[i],vl.x=0<t.normal.x?n.max.x:n.min.x,vl.y=0<t.normal.y?n.max.y:n.min.y,vl.z=0<t.normal.z?n.max.z:n.min.z,0>t.distanceToPoint(vl))return!1;return!0},containsPoint:function(n){for(var i=this.planes,t=0;6>t;t++)if(0>i[t].distanceToPoint(n))return!1;return!0}});var y={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\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\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\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}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE  = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS  = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\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 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha  = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\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#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\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}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n  return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale =  bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value )  {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t}  else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = 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#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\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",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = 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\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t  vec3 reflectVec = reflect( -viewDir, normal );\n\t\t  reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t  vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = 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\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, 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\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = 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\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\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",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#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\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\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\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\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 coneCos;\n\t\tfloat penumbraCos;\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\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\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\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying 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\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\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)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? 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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? 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 ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\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#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",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",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",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",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\t#ifdef USE_TANGENT\n\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, normalScale, normalMap );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec2 normalScale, in sampler2D normalMap ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy *= normalScale;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tbool frontFacing = dot( cross( S, T ), N ) > 0.0;\n\t\t\tmapN.xy *= ( float( frontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 vTBN = mat3( tangent, bitangent, clearcoatNormal );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = clearcoatNormalScale * mapN.xy;\n\t\tclearcoatNormal = normalize( vTBN * mapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatNormalScale, clearcoatNormalMap );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 encodeHalfRGBA ( vec2 v ) {\n\tvec4 encoded = vec4( 0.0 );\n\tconst vec2 offset = vec2( 1.0 / 255.0, 0.0 );\n\tencoded.xy = vec2( v.x, fract( v.x * 255.0 ) );\n\tencoded.xy = encoded.xy - ( encoded.yy * offset );\n\tencoded.zw = vec2( v.y, fract( v.y * 255.0 ) );\n\tencoded.zw = encoded.zw - ( encoded.ww * offset );\n\treturn encoded;\n}\nvec2 decodeHalfRGBA( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn decodeHalfRGBA( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\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 ) + 0.5 ) * texelSize;\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\tfloat shadow = 1.0;\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\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\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( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), 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( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), 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 / 17.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\tshadow = (\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#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\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, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, 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.yyx, 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.yxy, 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.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",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",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\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 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",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\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",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\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",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",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\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();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},o={common:{diffuse:{value:new e(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ft},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new i(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:.00025},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new e(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new e(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ft}},sprite:{diffuse:{value:new e(15658734)},opacity:{value:1},center:{value:new i(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ft}}},ar={basic:{uniforms:bt([o.common,o.specularmap,o.envmap,o.aomap,o.lightmap,o.fog]),vertexShader:y.meshbasic_vert,fragmentShader:y.meshbasic_frag},lambert:{uniforms:bt([o.common,o.specularmap,o.envmap,o.aomap,o.lightmap,o.emissivemap,o.fog,o.lights,{emissive:{value:new e(0)}}]),vertexShader:y.meshlambert_vert,fragmentShader:y.meshlambert_frag},phong:{uniforms:bt([o.common,o.specularmap,o.envmap,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.gradientmap,o.fog,o.lights,{emissive:{value:new e(0)},specular:{value:new e(1118481)},shininess:{value:30}}]),vertexShader:y.meshphong_vert,fragmentShader:y.meshphong_frag},standard:{uniforms:bt([o.common,o.envmap,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.roughnessmap,o.metalnessmap,o.fog,o.lights,{emissive:{value:new e(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:y.meshphysical_vert,fragmentShader:y.meshphysical_frag},matcap:{uniforms:bt([o.common,o.bumpmap,o.normalmap,o.displacementmap,o.fog,{matcap:{value:null}}]),vertexShader:y.meshmatcap_vert,fragmentShader:y.meshmatcap_frag},points:{uniforms:bt([o.points,o.fog]),vertexShader:y.points_vert,fragmentShader:y.points_frag},dashed:{uniforms:bt([o.common,o.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:y.linedashed_vert,fragmentShader:y.linedashed_frag},depth:{uniforms:bt([o.common,o.displacementmap]),vertexShader:y.depth_vert,fragmentShader:y.depth_frag},normal:{uniforms:bt([o.common,o.bumpmap,o.normalmap,o.displacementmap,{opacity:{value:1}}]),vertexShader:y.normal_vert,fragmentShader:y.normal_frag},sprite:{uniforms:bt([o.sprite,o.fog]),vertexShader:y.sprite_vert,fragmentShader:y.sprite_frag},background:{uniforms:{uvTransform:{value:new ft},t2D:{value:null}},vertexShader:y.background_vert,fragmentShader:y.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:y.cube_vert,fragmentShader:y.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:y.equirect_vert,fragmentShader:y.equirect_frag},distanceRGBA:{uniforms:bt([o.common,o.displacementmap,{referencePosition:{value:new t},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:y.distanceRGBA_vert,fragmentShader:y.distanceRGBA_frag},shadow:{uniforms:bt([o.lights,o.fog,{color:{value:new e(0)},opacity:{value:1}}]),vertexShader:y.shadow_vert,fragmentShader:y.shadow_frag}};ar.physical={uniforms:bt([ar.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new e(0)},clearcoatNormalScale:{value:new i(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:y.meshphysical_vert,fragmentShader:y.meshphysical_frag},ch.prototype=Object.create(h.prototype),ch.prototype.constructor=ch,sf.prototype=Object.create(f.prototype),sf.prototype.constructor=sf,wr.prototype=Object.create(k.prototype),wr.prototype.constructor=wr,wr.prototype.isCubeTexture=!0,Object.defineProperty(wr.prototype,"images",{get:function(){return this.image},set:function(n){this.image=n}}),we.prototype=Object.create(k.prototype),we.prototype.constructor=we,we.prototype.isDataTexture2DArray=!0,be.prototype=Object.create(k.prototype),be.prototype.constructor=be,be.prototype.isDataTexture3D=!0;var on=new k,aft=new we,vft=new be,sn=new wr,hn=[],cn=[],ln=new Float32Array(16),an=new Float32Array(9),vn=new Float32Array(4);nd.prototype.updateCache=function(n){var t=this.cache;n instanceof Float32Array&&t.length!==n.length&&(this.cache=new Float32Array(n.length)),ni(t,n)},td.prototype.setValue=function(n,t,i){for(var u,f=this.seq,r=0,e=f.length;r!==e;++r)u=f[r],u.setValue(n,t[u.id],i)},oy=/([\w\d_]+)(\])?(\[|\.)?/g,hu.prototype.setValue=function(n,t,i,r){t=this.map[t],void 0!==t&&t.setValue(n,i,r)},hu.prototype.setOptional=function(n,t,i){t=t[i],void 0!==t&&this.setValue(n,i,t)},hu.upload=function(n,t,i,r){for(var f,e,u=0,o=t.length;u!==o;++u)f=t[u],e=i[f.id],!1!==e.needsUpdate&&f.setValue(n,e.value,r)},hu.seqWithValue=function(n,t){for(var r,u=[],i=0,f=n.length;i!==f;++i)r=n[i],r.id in t&&u.push(r);return u};var yft=0,kb=/^[ \t]*#include +<([\w\d./]+)>/gm,yn=/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,pft=0;cu.prototype=Object.create(l.prototype),cu.prototype.constructor=cu,cu.prototype.isMeshDepthMaterial=!0,cu.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.depthPacking=n.depthPacking,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.map=n.map,this.alphaMap=n.alphaMap,this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this},lu.prototype=Object.create(l.prototype),lu.prototype.constructor=lu,lu.prototype.isMeshDistanceMaterial=!0,lu.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.referencePosition.copy(n.referencePosition),this.nearDistance=n.nearDistance,this.farDistance=n.farDistance,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.map=n.map,this.alphaMap=n.alphaMap,this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this},lp.prototype=Object.assign(Object.create(wt.prototype),{constructor:lp,isWebGLMultiviewRenderTarget:!0,copy:function(n){return wt.prototype.copy.call(this,n),this.numViews=n.numViews,this},setNumViews:function(n){return this.numViews!==n&&(this.numViews=n,this.dispose()),this}}),de.prototype=Object.assign(Object.create(u.prototype),{constructor:de,isGroup:!0}),ah.prototype=Object.assign(Object.create(it.prototype),{constructor:ah,isArrayCamera:!0}),db=new t,gb=new t,Object.assign(ap.prototype,hi.prototype),Object.assign(yd.prototype,hi.prototype),Object.assign(fa.prototype,{isFogExp2:!0,clone:function(){return new fa(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(ea.prototype,{isFog:!0,clone:function(){return new ea(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(br.prototype,"needsUpdate",{set:function(n){!0===n&&this.version++}}),Object.assign(br.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(n){return this.usage=n,this},copy:function(n){return this.array=new n.array.constructor(n.array),this.count=n.count,this.stride=n.stride,this.usage=n.usage,this},copyAt:function(n,t,i){n*=this.stride,i*=t.stride;for(var r=0,u=this.stride;r<u;r++)this.array[n+r]=t.array[i+r];return this},set:function(n,t){return void 0===t&&(t=0),this.array.set(n,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(n){return this.onUploadCallback=n,this}}),Object.defineProperties(vh.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(vh.prototype,{isInterleavedBufferAttribute:!0,setX:function(n,t){return this.data.array[n*this.data.stride+this.offset]=t,this},setY:function(n,t){return this.data.array[n*this.data.stride+this.offset+1]=t,this},setZ:function(n,t){return this.data.array[n*this.data.stride+this.offset+2]=t,this},setW:function(n,t){return this.data.array[n*this.data.stride+this.offset+3]=t,this},getX:function(n){return this.data.array[n*this.data.stride+this.offset]},getY:function(n){return this.data.array[n*this.data.stride+this.offset+1]},getZ:function(n){return this.data.array[n*this.data.stride+this.offset+2]},getW:function(n){return this.data.array[n*this.data.stride+this.offset+3]},setXY:function(n,t,i){return n=n*this.data.stride+this.offset,this.data.array[n+0]=t,this.data.array[n+1]=i,this},setXYZ:function(n,t,i,r){return n=n*this.data.stride+this.offset,this.data.array[n+0]=t,this.data.array[n+1]=i,this.data.array[n+2]=r,this},setXYZW:function(n,t,i,r,u){return n=n*this.data.stride+this.offset,this.data.array[n+0]=t,this.data.array[n+1]=i,this.data.array[n+2]=r,this.data.array[n+3]=u,this}}),au.prototype=Object.create(l.prototype),au.prototype.constructor=au,au.prototype.isSpriteMaterial=!0,au.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.alphaMap=n.alphaMap,this.rotation=n.rotation,this.sizeAttenuation=n.sizeAttenuation,this};var ds,yl=new t,gs=new t,nh=new t,th=new i,pl=new i,pn=new v,sy=new t,wl=new t,hy=new t,wn=new i,nk=new i,bn=new i;yh.prototype=Object.assign(Object.create(u.prototype),{constructor:yh,isSprite:!0,raycast:function(n,t){var r,f,u,e;(null===n.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),gs.setFromMatrixScale(this.matrixWorld),pn.copy(n.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(n.camera.matrixWorldInverse,this.matrixWorld),nh.setFromMatrixPosition(this.modelViewMatrix),n.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&gs.multiplyScalar(-nh.z),r=this.material.rotation,0!==r&&(f=Math.cos(r),u=Math.sin(r)),r=this.center,oa(sy.set(-.5,-.5,0),nh,r,gs,u,f),oa(wl.set(.5,-.5,0),nh,r,gs,u,f),oa(hy.set(.5,.5,0),nh,r,gs,u,f),wn.set(0,0),nk.set(1,0),bn.set(1,1),e=n.ray.intersectTriangle(sy,wl,hy,!1,yl),null!==e||(oa(wl.set(-.5,.5,0),nh,r,gs,u,f),nk.set(0,1),e=n.ray.intersectTriangle(sy,hy,wl,!1,yl),null!==e))&&(u=n.ray.origin.distanceTo(yl),u<n.near||u>n.far||t.push({distance:u,point:yl.clone(),uv:et.getUV(yl,sy,wl,hy,wn,nk,bn,new i),face:null,object:this}))},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(n){return u.prototype.copy.call(this,n),void 0!==n.center&&this.center.copy(n.center),this}}),bl=new t,tk=new t,ph.prototype=Object.assign(Object.create(u.prototype),{constructor:ph,isLOD:!0,copy:function(n){var t,r,i;for(u.prototype.copy.call(this,n,!1),n=n.levels,t=0,r=n.length;t<r;t++)i=n[t],this.addLevel(i.object.clone(),i.distance);return this},addLevel:function(n,t){void 0===t&&(t=0),t=Math.abs(t);for(var r=this.levels,i=0;i<r.length&&!(t<r[i].distance);i++);return r.splice(i,0,{distance:t,object:n}),this.add(n),this},getObjectForDistance:function(n){for(var i=this.levels,t=1,r=i.length;t<r&&!(n<i[t].distance);t++);return i[t-1].object},raycast:function(n,t){bl.setFromMatrixPosition(this.matrixWorld);var i=n.ray.origin.distanceTo(bl);this.getObjectForDistance(i).raycast(n,t)},update:function(n){var i=this.levels,t,r;if(1<i.length){for(bl.setFromMatrixPosition(n.matrixWorld),tk.setFromMatrixPosition(this.matrixWorld),n=bl.distanceTo(tk),i[0].object.visible=!0,t=1,r=i.length;t<r;t++)if(n>=i[t].distance)i[t-1].object.visible=!1,i[t].object.visible=!0;else break;for(;t<r;t++)i[t].object.visible=!1}},toJSON:function(n){var i;n=u.prototype.toJSON.call(this,n),n.object.levels=[];for(var r=this.levels,t=0,f=r.length;t<f;t++)i=r[t],n.object.levels.push({object:i.object.uuid,distance:i.distance});return n}}),wh.prototype=Object.assign(Object.create(tt.prototype),{constructor:wh,isSkinnedMesh:!0,bind:function(n,t){this.skeleton=n,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var r,n=new p,i=this.geometry.attributes.skinWeight,t=0,u=i.count;t<u;t++)n.x=i.getX(t),n.y=i.getY(t),n.z=i.getZ(t),n.w=i.getW(t),r=1/n.manhattanLength(),Infinity!==r?n.multiplyScalar(r):n.set(1,0,0,0),i.setXYZW(t,n.x,n.y,n.z,n.w)},updateMatrixWorld:function(n){tt.prototype.updateMatrixWorld.call(this,n),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ik=new v,kn=new v,Object.assign(sa.prototype,{calculateInverses:function(){var n,i,t;for(this.boneInverses=[],n=0,i=this.bones.length;n<i;n++)t=new v,this.bones[n]&&t.getInverse(this.bones[n].matrixWorld),this.boneInverses.push(t)},pose:function(){for(var n,t=0,i=this.bones.length;t<i;t++)(n=this.bones[t])&&n.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,i=this.bones.length;t<i;t++)(n=this.bones[t])&&(n.parent&&n.parent.isBone?(n.matrix.getInverse(n.parent.matrixWorld),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))},update:function(){for(var t=this.bones,r=this.boneInverses,u=this.boneMatrices,i=this.boneTexture,n=0,f=t.length;n<f;n++)ik.multiplyMatrices(t[n]?t[n].matrixWorld:kn,r[n]),ik.toArray(u,16*n);void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new sa(this.bones,this.boneInverses)},getBoneByName:function(n){for(var i,t=0,r=this.bones.length;t<r;t++)if(i=this.bones[t],i.name===n)return i}}),yp.prototype=Object.assign(Object.create(u.prototype),{constructor:yp,isBone:!0}),ha.prototype=Object.assign(Object.create(tt.prototype),{constructor:ha,isInstancedMesh:!0,raycast:function(){},setMatrixAt:function(n,t){t.toArray(this.instanceMatrix.array,16*n)},updateMorphTargets:function(){}}),b.prototype=Object.create(l.prototype),b.prototype.constructor=b,b.prototype.isLineBasicMaterial=!0,b.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.linewidth=n.linewidth,this.linecap=n.linecap,this.linejoin=n.linejoin,this};var dn=new t,gn=new t,ntt=new v,cy=new rf,ly=new pr;st.prototype=Object.assign(Object.create(u.prototype),{constructor:st,isLine:!0,computeLineDistances:function(){var i=this.geometry;if(i.isBufferGeometry)if(null===i.index){for(var u=i.attributes.position,t=[0],n=1,f=u.count;n<f;n++)dn.fromBufferAttribute(u,n-1),gn.fromBufferAttribute(u,n),t[n]=t[n-1],t[n]+=dn.distanceTo(gn);i.setAttribute("lineDistance",new r(t,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(i.isGeometry)for(u=i.vertices,t=i.lineDistances,t[0]=0,n=1,f=u.length;n<f;n++)t[n]=t[n-1],t[n]+=u[n-1].distanceTo(u[n]);return this},raycast:function(n,i){var s=n.linePrecision,r=this.geometry,e=this.matrixWorld,o,h,f,a,c,l,v,u;if(null===r.boundingSphere&&r.computeBoundingSphere(),ly.copy(r.boundingSphere),ly.applyMatrix4(e),ly.radius+=s,!1!==n.ray.intersectsSphere(ly))if(ntt.getInverse(e),cy.copy(n.ray).applyMatrix4(ntt),s/=(this.scale.x+this.scale.y+this.scale.z)/3,s*=s,o=new t,h=new t,e=new t,f=new t,a=this&&this.isLineSegments?2:1,r.isBufferGeometry)if(c=r.index,l=r.attributes.position.array,null!==c)for(c=c.array,r=0,v=c.length-1;r<v;r+=a)u=c[r+1],o.fromArray(l,3*c[r]),h.fromArray(l,3*u),u=cy.distanceSqToSegment(o,h,f,e),u>s||(f.applyMatrix4(this.matrixWorld),u=n.ray.origin.distanceTo(f),u<n.near||u>n.far||i.push({distance:u,point:e.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this}));else for(r=0,v=l.length/3-1;r<v;r+=a)o.fromArray(l,3*r),h.fromArray(l,3*r+3),u=cy.distanceSqToSegment(o,h,f,e),u>s||(f.applyMatrix4(this.matrixWorld),u=n.ray.origin.distanceTo(f),u<n.near||u>n.far||i.push({distance:u,point:e.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this}));else if(r.isGeometry)for(o=r.vertices,h=o.length,r=0;r<h-1;r+=a)u=cy.distanceSqToSegment(o[r],o[r+1],f,e),u>s||(f.applyMatrix4(this.matrixWorld),u=n.ray.origin.distanceTo(f),u<n.near||u>n.far||i.push({distance:u,point:e.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this}))},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),kl=new t,dl=new t,d.prototype=Object.assign(Object.create(st.prototype),{constructor:d,isLineSegments:!0,computeLineDistances:function(){var i=this.geometry;if(i.isBufferGeometry)if(null===i.index){for(var u=i.attributes.position,t=[],n=0,f=u.count;n<f;n+=2)kl.fromBufferAttribute(u,n),dl.fromBufferAttribute(u,n+1),t[n]=0===n?0:t[n-1],t[n+1]=t[n]+kl.distanceTo(dl);i.setAttribute("lineDistance",new r(t,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(i.isGeometry)for(u=i.vertices,t=i.lineDistances,n=0,f=u.length;n<f;n+=2)kl.copy(u[n]),dl.copy(u[n+1]),t[n]=0===n?0:t[n-1],t[n+1]=t[n]+kl.distanceTo(dl);return this}}),ca.prototype=Object.assign(Object.create(st.prototype),{constructor:ca,isLineLoop:!0}),li.prototype=Object.create(l.prototype),li.prototype.constructor=li,li.prototype.isPointsMaterial=!0,li.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.alphaMap=n.alphaMap,this.size=n.size,this.sizeAttenuation=n.sizeAttenuation,this.morphTargets=n.morphTargets,this};var ttt=new v,rk=new rf,ay=new pr,vy=new t;ge.prototype=Object.assign(Object.create(u.prototype),{constructor:ge,isPoints:!0,raycast:function(n,t){var r=this.geometry,e=this.matrixWorld,u=n.params.Points.threshold,i,f,s,o;if(null===r.boundingSphere&&r.computeBoundingSphere(),ay.copy(r.boundingSphere),ay.applyMatrix4(e),ay.radius+=u,!1!==n.ray.intersectsSphere(ay))if(ttt.getInverse(e),rk.copy(n.ray).applyMatrix4(ttt),u/=(this.scale.x+this.scale.y+this.scale.z)/3,u*=u,r.isBufferGeometry)if(i=r.index,r=r.attributes.position.array,null!==i)for(f=i.array,i=0,s=f.length;i<s;i++)o=f[i],vy.fromArray(r,3*o),pp(vy,o,u,e,n,t,this);else for(i=0,f=r.length/3;i<f;i++)vy.fromArray(r,3*i),pp(vy,i,u,e,n,t,this);else for(r=r.vertices,i=0,f=r.length;i<f;i++)pp(r[i],i,u,e,n,t,this)},updateMorphTargets:function(){var n=this.geometry,t,i,r;if(n.isBufferGeometry){if(n=n.morphAttributes,t=Object.keys(n),0<t.length&&(i=n[t[0]],void 0!==i))for(this.morphTargetInfluences=[],this.morphTargetDictionary={},n=0,t=i.length;n<t;n++)r=i[n].name||String(n),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=n}else n=n.morphTargets,void 0!==n&&0<n.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),wp.prototype=Object.assign(Object.create(k.prototype),{constructor:wp,isVideoTexture:!0,update:function(){var n=this.image;n.readyState>=n.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),no.prototype=Object.create(k.prototype),no.prototype.constructor=no,no.prototype.isCompressedTexture=!0,bh.prototype=Object.create(k.prototype),bh.prototype.constructor=bh,bh.prototype.isCanvasTexture=!0,kh.prototype=Object.create(k.prototype),kh.prototype.constructor=kh,kh.prototype.isDepthTexture=!0,to.prototype=Object.create(f.prototype),to.prototype.constructor=to,dh.prototype=Object.create(h.prototype),dh.prototype.constructor=dh,io.prototype=Object.create(f.prototype),io.prototype.constructor=io,gh.prototype=Object.create(h.prototype),gh.prototype.constructor=gh,kt.prototype=Object.create(f.prototype),kt.prototype.constructor=kt,nc.prototype=Object.create(h.prototype),nc.prototype.constructor=nc,ro.prototype=Object.create(kt.prototype),ro.prototype.constructor=ro,tc.prototype=Object.create(h.prototype),tc.prototype.constructor=tc,hf.prototype=Object.create(kt.prototype),hf.prototype.constructor=hf,ic.prototype=Object.create(h.prototype),ic.prototype.constructor=ic,uo.prototype=Object.create(kt.prototype),uo.prototype.constructor=uo,rc.prototype=Object.create(h.prototype),rc.prototype.constructor=rc,fo.prototype=Object.create(kt.prototype),fo.prototype.constructor=fo,uc.prototype=Object.create(h.prototype),uc.prototype.constructor=uc,cf.prototype=Object.create(f.prototype),cf.prototype.constructor=cf,cf.prototype.toJSON=function(){var n=f.prototype.toJSON.call(this);return n.path=this.parameters.path.toJSON(),n},fc.prototype=Object.create(h.prototype),fc.prototype.constructor=fc,eo.prototype=Object.create(f.prototype),eo.prototype.constructor=eo,ec.prototype=Object.create(h.prototype),ec.prototype.constructor=ec,oo.prototype=Object.create(f.prototype),oo.prototype.constructor=oo,itt={triangulate:function(n,t,i){var e,u,a,r,s,y,h,c;i=i||2;var f=t&&t.length,v=f?t[0]*i:n.length,o=pd(n,0,v,i,!0),l=[];if(!o||o.next===o.prev)return l;if(f){for(u=i,f=[],r=0,a=t.length;r<a;r++)s=t[r]*u,y=r<a-1?t[r+1]*u:n.length,s=pd(n,s,y,u,!1),s===s.next&&(s.steiner=!0),f.push(kut(s));for(f.sort(wut),r=0;r<f.length;r++)t=f[r],u=o,(u=but(t,u))&&(t=bd(u,t),oc(t,t.next)),o=oc(o,o.next)}if(n.length>80*i){for(h=e=n[0],c=f=n[1],u=i;u<v;u+=i)r=n[u],t=n[u+1],r<h&&(h=r),t<c&&(c=t),r>e&&(e=r),t>f&&(f=t);e=Math.max(e-h,f-c),e=0!==e?1/e:0}return sc(o,l,i,h,c,e),l}},vr={area:function(n){for(var r=n.length,u=0,i=r-1,t=0;t<r;i=t++)u+=n[i].x*n[t].y-n[t].x*n[i].y;return.5*u},isClockWise:function(n){return 0>vr.area(n)},triangulateShape:function(n,t){var i=[],u=[],f=[],r;for(dd(n),gd(i,n),r=n.length,t.forEach(dd),n=0;n<t.length;n++)u.push(r),r+=t[n].length,gd(i,t[n]);for(t=itt.triangulate(i,u),n=0;n<t.length;n+=3)f.push(t.slice(n,n+3));return f}},af.prototype=Object.create(h.prototype),af.prototype.constructor=af,af.prototype.toJSON=function(){var n=h.prototype.toJSON.call(this);return ng(this.parameters.shapes,this.parameters.options,n)},ur.prototype=Object.create(f.prototype),ur.prototype.constructor=ur,ur.prototype.toJSON=function(){var n=f.prototype.toJSON.call(this);return ng(this.parameters.shapes,this.parameters.options,n)},rtt={generateTopUV:function(n,t,r,u,f){n=t[3*u],u=t[3*u+1];var e=t[3*f];return f=t[3*f+1],[new i(t[3*r],t[3*r+1]),new i(n,u),new i(e,f)]},generateSideWallUV:function(n,t,r,u,f,e){var o,h,s,c,l,a,v;return n=t[3*r],o=t[3*r+1],r=t[3*r+2],h=t[3*u],s=t[3*u+1],u=t[3*u+2],c=t[3*f],l=t[3*f+1],f=t[3*f+2],a=t[3*e],v=t[3*e+1],t=t[3*e+2],.01>Math.abs(o-s)?[new i(n,1-r),new i(h,1-u),new i(c,1-f),new i(a,1-t)]:[new i(o,1-r),new i(s,1-u),new i(l,1-f),new i(v,1-t)]}},lc.prototype=Object.create(h.prototype),lc.prototype.constructor=lc,ho.prototype=Object.create(ur.prototype),ho.prototype.constructor=ho,ac.prototype=Object.create(h.prototype),ac.prototype.constructor=ac,vu.prototype=Object.create(f.prototype),vu.prototype.constructor=vu,vc.prototype=Object.create(h.prototype),vc.prototype.constructor=vc,co.prototype=Object.create(f.prototype),co.prototype.constructor=co,yc.prototype=Object.create(h.prototype),yc.prototype.constructor=yc,lo.prototype=Object.create(f.prototype),lo.prototype.constructor=lo,vf.prototype=Object.create(h.prototype),vf.prototype.constructor=vf,vf.prototype.toJSON=function(){var n=h.prototype.toJSON.call(this);return tg(this.parameters.shapes,n)},yf.prototype=Object.create(f.prototype),yf.prototype.constructor=yf,yf.prototype.toJSON=function(){var n=f.prototype.toJSON.call(this);return tg(this.parameters.shapes,n)},ao.prototype=Object.create(f.prototype),ao.prototype.constructor=ao,pf.prototype=Object.create(h.prototype),pf.prototype.constructor=pf,kr.prototype=Object.create(f.prototype),kr.prototype.constructor=kr,pc.prototype=Object.create(pf.prototype),pc.prototype.constructor=pc,wc.prototype=Object.create(kr.prototype),wc.prototype.constructor=wc,bc.prototype=Object.create(h.prototype),bc.prototype.constructor=bc,vo.prototype=Object.create(f.prototype),vo.prototype.constructor=vo,pt=Object.freeze({__proto__:null,WireframeGeometry:to,ParametricGeometry:dh,ParametricBufferGeometry:io,TetrahedronGeometry:nc,TetrahedronBufferGeometry:ro,OctahedronGeometry:tc,OctahedronBufferGeometry:hf,IcosahedronGeometry:ic,IcosahedronBufferGeometry:uo,DodecahedronGeometry:rc,DodecahedronBufferGeometry:fo,PolyhedronGeometry:gh,PolyhedronBufferGeometry:kt,TubeGeometry:uc,TubeBufferGeometry:cf,TorusKnotGeometry:fc,TorusKnotBufferGeometry:eo,TorusGeometry:ec,TorusBufferGeometry:oo,TextGeometry:lc,TextBufferGeometry:ho,SphereGeometry:ac,SphereBufferGeometry:vu,RingGeometry:vc,RingBufferGeometry:co,PlaneGeometry:ch,PlaneBufferGeometry:sf,LatheGeometry:yc,LatheBufferGeometry:lo,ShapeGeometry:vf,ShapeBufferGeometry:yf,ExtrudeGeometry:af,ExtrudeBufferGeometry:ur,EdgesGeometry:ao,ConeGeometry:pc,ConeBufferGeometry:wc,CylinderGeometry:pf,CylinderBufferGeometry:kr,CircleGeometry:bc,CircleBufferGeometry:vo,BoxGeometry:bb,BoxBufferGeometry:al}),wf.prototype=Object.create(l.prototype),wf.prototype.constructor=wf,wf.prototype.isShadowMaterial=!0,wf.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this},yo.prototype=Object.create(at.prototype),yo.prototype.constructor=yo,yo.prototype.isRawShaderMaterial=!0,fr.prototype=Object.create(l.prototype),fr.prototype.constructor=fr,fr.prototype.isMeshStandardMaterial=!0,fr.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.defines={STANDARD:""},this.color.copy(n.color),this.roughness=n.roughness,this.metalness=n.metalness,this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.emissive.copy(n.emissive),this.emissiveMap=n.emissiveMap,this.emissiveIntensity=n.emissiveIntensity,this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalMapType=n.normalMapType,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.roughnessMap=n.roughnessMap,this.metalnessMap=n.metalnessMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.envMapIntensity=n.envMapIntensity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this},bf.prototype=Object.create(fr.prototype),bf.prototype.constructor=bf,bf.prototype.isMeshPhysicalMaterial=!0,bf.prototype.copy=function(n){return fr.prototype.copy.call(this,n),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=n.reflectivity,this.clearcoat=n.clearcoat,this.clearcoatRoughness=n.clearcoatRoughness,this.sheen=n.sheen?(this.sheen||new e).copy(n.sheen):null,this.clearcoatNormalMap=n.clearcoatNormalMap,this.clearcoatNormalScale.copy(n.clearcoatNormalScale),this.transparency=n.transparency,this},ai.prototype=Object.create(l.prototype),ai.prototype.constructor=ai,ai.prototype.isMeshPhongMaterial=!0,ai.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.specular.copy(n.specular),this.shininess=n.shininess,this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.emissive.copy(n.emissive),this.emissiveMap=n.emissiveMap,this.emissiveIntensity=n.emissiveIntensity,this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalMapType=n.normalMapType,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.specularMap=n.specularMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.combine=n.combine,this.reflectivity=n.reflectivity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this},kf.prototype=Object.create(ai.prototype),kf.prototype.constructor=kf,kf.prototype.isMeshToonMaterial=!0,kf.prototype.copy=function(n){return ai.prototype.copy.call(this,n),this.gradientMap=n.gradientMap,this},df.prototype=Object.create(l.prototype),df.prototype.constructor=df,df.prototype.isMeshNormalMaterial=!0,df.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalMapType=n.normalMapType,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this},gf.prototype=Object.create(l.prototype),gf.prototype.constructor=gf,gf.prototype.isMeshLambertMaterial=!0,gf.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.color.copy(n.color),this.map=n.map,this.lightMap=n.lightMap,this.lightMapIntensity=n.lightMapIntensity,this.aoMap=n.aoMap,this.aoMapIntensity=n.aoMapIntensity,this.emissive.copy(n.emissive),this.emissiveMap=n.emissiveMap,this.emissiveIntensity=n.emissiveIntensity,this.specularMap=n.specularMap,this.alphaMap=n.alphaMap,this.envMap=n.envMap,this.combine=n.combine,this.reflectivity=n.reflectivity,this.refractionRatio=n.refractionRatio,this.wireframe=n.wireframe,this.wireframeLinewidth=n.wireframeLinewidth,this.wireframeLinecap=n.wireframeLinecap,this.wireframeLinejoin=n.wireframeLinejoin,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this},ne.prototype=Object.create(l.prototype),ne.prototype.constructor=ne,ne.prototype.isMeshMatcapMaterial=!0,ne.prototype.copy=function(n){return l.prototype.copy.call(this,n),this.defines={MATCAP:""},this.color.copy(n.color),this.matcap=n.matcap,this.map=n.map,this.bumpMap=n.bumpMap,this.bumpScale=n.bumpScale,this.normalMap=n.normalMap,this.normalMapType=n.normalMapType,this.normalScale.copy(n.normalScale),this.displacementMap=n.displacementMap,this.displacementScale=n.displacementScale,this.displacementBias=n.displacementBias,this.alphaMap=n.alphaMap,this.skinning=n.skinning,this.morphTargets=n.morphTargets,this.morphNormals=n.morphNormals,this},te.prototype=Object.create(b.prototype),te.prototype.constructor=te,te.prototype.isLineDashedMaterial=!0,te.prototype.copy=function(n){return b.prototype.copy.call(this,n),this.scale=n.scale,this.dashSize=n.dashSize,this.gapSize=n.gapSize,this},utt=Object.freeze({__proto__:null,ShadowMaterial:wf,SpriteMaterial:au,RawShaderMaterial:yo,ShaderMaterial:at,PointsMaterial:li,MeshPhysicalMaterial:bf,MeshStandardMaterial:fr,MeshPhongMaterial:ai,MeshToonMaterial:kf,MeshNormalMaterial:df,MeshLambertMaterial:gf,MeshDepthMaterial:cu,MeshDistanceMaterial:lu,MeshBasicMaterial:gt,MeshMatcapMaterial:ne,LineDashedMaterial:te,LineBasicMaterial:b,Material:l}),ut={arraySlice:function(n,t,i){return ut.isTypedArray(n)?new n.constructor(n.subarray(t,void 0!==i?i:n.length)):n.slice(t,i)},convertArray:function(n,t,i){return!n||!i&&n.constructor===t?n:"number"==typeof t.BYTES_PER_ELEMENT?new t(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){for(var r=n.length,i=Array(r),t=0;t!==r;++t)i[t]=t;return i.sort(function(t,i){return n[t]-n[i]}),i},sortedArray:function(n,t,i){for(var s,r,u=n.length,f=new n.constructor(u),e=0,o=0;o!==u;++e)for(s=i[e]*t,r=0;r!==t;++r)f[o++]=n[s+r];return f},flattenJSON:function(n,t,i,r){for(var f,e=1,u=n[0];void 0!==u&&void 0===u[r];)u=n[e++];if(void 0!==u&&(f=u[r],void 0!==f))if(Array.isArray(f)){do f=u[r],void 0!==f&&(t.push(u.time),i.push.apply(i,f)),u=n[e++];while(void 0!==u)}else if(void 0!==f.toArray){do f=u[r],void 0!==f&&(t.push(u.time),f.toArray(i,i.length)),u=n[e++];while(void 0!==u)}else do f=u[r],void 0!==f&&(t.push(u.time),i.push(f)),u=n[e++];while(void 0!==u)},subclip:function(n,t,i,r,u){var s,e;for(u=u||30,n=n.clone(),n.name=t,s=[],t=0;t<n.tracks.length;++t){for(var f=n.tracks[t],c=f.getValueSize(),h=[],l=[],o=0;o<f.times.length;++o)if(e=f.times[o]*u,!(e<i||e>=r))for(h.push(f.times[o]),e=0;e<c;++e)l.push(f.values[o*c+e]);0!==h.length&&(f.times=ut.convertArray(h,f.times.constructor),f.values=ut.convertArray(l,f.values.constructor),s.push(f))}for(n.tracks=s,i=Infinity,t=0;t<n.tracks.length;++t)i>n.tracks[t].times[0]&&(i=n.tracks[t].times[0]);for(t=0;t<n.tracks.length;++t)n.tracks[t].shift(-1*i);return n.resetDuration(),n}},Object.assign(ti.prototype,{evaluate:function(n){var u=this.parameterPositions,t=this._cachedIndex,r=u[t],i=u[t-1],f;n:{t:{i:{r:if(!(n<r)){for(f=t+2;;){if(void 0===r){if(n<i)break r;return this._cachedIndex=t=u.length,this.afterEnd_(t-1,n,i)}if(t===f)break;if(i=r,r=u[++t],n<r)break t}r=u.length;break i}if(n>=i)break n;else{for(f=u[1],n<f&&(t=2,i=f),f=t-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,n,r);if(t===f)break;if(r=i,i=u[--t-1],n>=i)break t}r=t,t=0}}for(;t<r;)i=t+r>>>1,n<u[i]?r=i:t=i+1;if(r=u[t],i=u[t-1],void 0===i)return this._cachedIndex=0,this.beforeStart_(0,n,r);if(void 0===r)return this._cachedIndex=t=u.length,this.afterEnd_(t-1,i,n)}this._cachedIndex=t,this.intervalChanged_(t,i,r)}return this.interpolate_(t,i,n,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(n){var i=this.resultBuffer,u=this.sampleValues,r=this.valueSize,t;for(n*=r,t=0;t!==r;++t)i[t]=u[n+t];return i},interpolate_:function(){throw Error("call to abstract method");},intervalChanged_:function(){}}),Object.assign(ti.prototype,{beforeStart_:ti.prototype.copySampleValue_,afterEnd_:ti.prototype.copySampleValue_}),la.prototype=Object.assign(Object.create(ti.prototype),{constructor:la,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(n,t,i){var r=this.parameterPositions,u=n-2,f=n+1,e=r[u],o=r[f];if(void 0===e)switch(this.getSettings_().endingStart){case 2401:u=n,e=2*t-i;break;case 2402:u=r.length-2,e=t+r[u]-r[u+1];break;default:u=n,e=i}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:f=n,o=2*i-t;break;case 2402:f=1,o=i+r[1]-r[0];break;default:f=n-1,o=t}n=.5*(i-t),r=this.valueSize,this._weightPrev=n/(t-e),this._weightNext=n/(o-i),this._offsetPrev=u*r,this._offsetNext=f*r},interpolate_:function(n,t,i,r){var h=this.resultBuffer,o=this.sampleValues,s=this.valueSize;n*=s;var c=n-s,l=this._offsetPrev,a=this._offsetNext,u=this._weightPrev,e=this._weightNext,f=(i-t)/(r-t);for(i=f*f,r=i*f,t=-u*r+2*u*i-u*f,u=(1+u)*r+(-1.5-2*u)*i+(-.5+u)*f+1,f=(-1-e)*r+(1.5+e)*i+.5*f,e=e*r-e*i,i=0;i!==s;++i)h[i]=t*o[l+i]+u*o[c+i]+f*o[n+i]+e*o[a+i];return h}}),kc.prototype=Object.assign(Object.create(ti.prototype),{constructor:kc,interpolate_:function(n,t,i,r){var f=this.resultBuffer,e=this.sampleValues,u=this.valueSize,o;for(n*=u,o=n-u,t=(i-t)/(r-t),i=1-t,r=0;r!==u;++r)f[r]=e[o+r]*i+e[n+r]*t;return f}}),aa.prototype=Object.assign(Object.create(ti.prototype),{constructor:aa,interpolate_:function(n){return this.copySampleValue_(n-1)}}),Object.assign(ct,{toJSON:function(n){var t=n.constructor,i;return void 0!==t.toJSON?t=t.toJSON(n):(t={name:n.name,times:ut.convertArray(n.times,Array),values:ut.convertArray(n.values,Array)},i=n.getInterpolation(),i!==n.DefaultInterpolation&&(t.interpolation=i)),t.type=n.ValueTypeName,t}}),Object.assign(ct.prototype,{constructor:ct,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(n){return new aa(this.times,this.values,this.getValueSize(),n)},InterpolantFactoryMethodLinear:function(n){return new kc(this.times,this.values,this.getValueSize(),n)},InterpolantFactoryMethodSmooth:function(n){return new la(this.times,this.values,this.getValueSize(),n)},setInterpolation:function(n){switch(n){case 2300:var t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){if(t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name,void 0===this.createInterpolant)if(n!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t);return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(n){if(0!==n)for(var i=this.times,t=0,r=i.length;t!==r;++t)i[t]+=n;return this},scale:function(n){if(1!==n)for(var i=this.times,t=0,r=i.length;t!==r;++t)i[t]*=n;return this},trim:function(n,t){for(var u=this.times,f=u.length,r=0,i=f-1;r!==f&&u[r]<n;)++r;for(;-1!==i&&u[i]>t;)--i;return++i,(0!==r||i!==f)&&(r>=i&&(i=Math.max(i,1),r=i-1),n=this.getValueSize(),this.times=ut.arraySlice(u,r,i),this.values=ut.arraySlice(this.values,r*n,i*n)),this},validate:function(){var r=!0,t=this.getValueSize(),f,u,e,n,i;for(0!=t-Math.floor(t)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),r=!1),f=this.times,t=this.values,u=f.length,0===u&&(console.error("THREE.KeyframeTrack: Track is empty.",this),r=!1),e=null,n=0;n!==u;n++){if(i=f[n],"number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,n,i),r=!1;break}if(null!==e&&e>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,n,i,e),r=!1;break}e=i}if(void 0!==t&&ut.isTypedArray(t))for(n=0,f=t.length;n!==f;++n)if(u=t[n],isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,n,u),r=!1;break}return r},optimize:function(){for(var e,n,h,r=this.times,f=this.values,t=this.getValueSize(),c=2302===this.getInterpolation(),i=1,s=r.length-1,u=1;u<s;++u){if(e=!1,n=r[u],n!==r[u+1]&&(1!==u||n!==n[0]))if(c)e=!0;else{var o=u*t,l=o-t,a=o+t;for(n=0;n!==t;++n)if(h=f[o+n],h!==f[l+n]||h!==f[a+n]){e=!0;break}}if(e){if(u!==i)for(r[i]=r[u],e=u*t,o=i*t,n=0;n!==t;++n)f[o+n]=f[e+n];++i}}if(0<s){for(r[i]=r[s],e=s*t,o=i*t,n=0;n!==t;++n)f[o+n]=f[e+n];++i}return i!==r.length&&(this.times=ut.arraySlice(r,0,i),this.values=ut.arraySlice(f,0,i*t)),this},clone:function(){var n=ut.arraySlice(this.times,0),t=ut.arraySlice(this.values,0);return n=new this.constructor(this.name,n,t),n.createInterpolant=this.createInterpolant,n}}),va.prototype=Object.assign(Object.create(ct.prototype),{constructor:va,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ya.prototype=Object.assign(Object.create(ct.prototype),{constructor:ya,ValueTypeName:"color"}),po.prototype=Object.assign(Object.create(ct.prototype),{constructor:po,ValueTypeName:"number"}),pa.prototype=Object.assign(Object.create(ti.prototype),{constructor:pa,interpolate_:function(n,t,i,r){var f=this.resultBuffer,e=this.sampleValues,u=this.valueSize;for(n*=u,t=(i-t)/(r-t),i=n+u;n!==i;n+=4)lt.slerpFlat(f,0,e,n-u,e,n,t);return f}}),dc.prototype=Object.assign(Object.create(ct.prototype),{constructor:dc,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(n){return new pa(this.times,this.values,this.getValueSize(),n)},InterpolantFactoryMethodSmooth:void 0}),wa.prototype=Object.assign(Object.create(ct.prototype),{constructor:wa,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),wo.prototype=Object.assign(Object.create(ct.prototype),{constructor:wo,ValueTypeName:"vector"}),Object.assign(ei,{parse:function(n){for(var i=[],r=n.tracks,u=1/(n.fps||1),t=0,f=r.length;t!==f;++t)i.push(gut(r[t]).scale(u));return new ei(n.name,n.duration,i)},toJSON:function(n){var i=[],r=n.tracks,t,u;for(n={name:n.name,duration:n.duration,tracks:i,uuid:n.uuid},t=0,u=r.length;t!==u;++t)i.push(ct.toJSON(r[t]));return n},CreateFromMorphTargetSequence:function(n,t,i,r){for(var u,f,s,o=t.length,h=[],e=0;e<o;e++)u=[],f=[],u.push((e+o-1)%o,e,(e+1)%o),f.push(0,1,0),s=ut.getKeyframeOrder(u),u=ut.sortedArray(u,1,s),f=ut.sortedArray(f,1,s),r||0!==u[0]||(u.push(o),f.push(f[0])),h.push(new po(".morphTargetInfluences["+t[e].name+"]",u,f).scale(1/i));return new ei(n,-1,h)},findByName:function(n,t){var i=n;for(Array.isArray(n)||(i=n.geometry&&n.geometry.animations||n.animations),n=0;n<i.length;n++)if(i[n].name===t)return i[n];return null},CreateClipsFromMorphTargetSequences:function(n,t,i){for(var o,r,u,f={},e=0,s=n.length;e<s;e++)o=n[e],r=o.name.match(/^([\w-]*?)([\d]+)$/),r&&1<r.length&&(u=r[1],(r=f[u])||(f[u]=r=[]),r.push(o));n=[];for(u in f)n.push(ei.CreateFromMorphTargetSequence(u,f[u],t,i));return n},parseAnimation:function(n,t){var o,i,r,u,h,c,l,a;if(!n)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;var s=function(n,t,i,r,u){if(0!==i.length){var f=[],e=[];ut.flattenJSON(i,f,e,r),0!==f.length&&u.push(new n(t,f,e))}},f=[],v=n.name||"default",e=n.length||-1,y=n.fps||30;for(n=n.hierarchy||[],o=0;o<n.length;o++)if(i=n[o].keys,i&&0!==i.length)if(i[0].morphTargets){for(e={},r=0;r<i.length;r++)if(i[r].morphTargets)for(u=0;u<i[r].morphTargets.length;u++)e[i[r].morphTargets[u]]=-1;for(h in e){for(c=[],l=[],u=0;u!==i[r].morphTargets.length;++u)a=i[r],c.push(a.time),l.push(a.morphTarget===h?1:0);f.push(new po(".morphTargetInfluence["+h+"]",c,l))}e=e.length*(y||1)}else r=".bones["+t[o].name+"]",s(wo,r+".position",i,"pos",f),s(dc,r+".quaternion",i,"rot",f),s(wo,r+".scale",i,"scl",f);return 0===f.length?null:new ei(v,e,f)}}),Object.assign(ei.prototype,{resetDuration:function(){for(var i,n=0,t=0,r=this.tracks.length;t!==r;++t)i=this.tracks[t],n=Math.max(n,i.times[i.times.length-1]);return this.duration=n,this},trim:function(){for(var n=0;n<this.tracks.length;n++)this.tracks[n].trim(0,this.duration);return this},validate:function(){for(var n=!0,t=0;t<this.tracks.length;t++)n=n&&this.tracks[t].validate();return n},optimize:function(){for(var n=0;n<this.tracks.length;n++)this.tracks[n].optimize();return this},clone:function(){for(var t=[],n=0;n<this.tracks.length;n++)t.push(this.tracks[n].clone());return new ei(this.name,this.duration,t)}}),gu={enabled:!1,files:{},add:function(n,t){!1!==this.enabled&&(this.files[n]=t)},get:function(n){if(!1!==this.enabled)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}},uk=new dp,Object.assign(w.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(n){return this.crossOrigin=n,this},setPath:function(n){return this.path=n,this},setResourcePath:function(n){return this.resourcePath=n,this}}),si={},oi.prototype=Object.assign(Object.create(w.prototype),{constructor:oi,load:function(n,t,i,r){var f,h,u,o,l,c,s,e;if(void 0===n&&(n=""),void 0!==this.path&&(n=this.path+n),n=this.manager.resolveURL(n),f=this,h=gu.get(n),void 0!==h)return f.manager.itemStart(n),setTimeout(function(){t&&t(h),f.manager.itemEnd(n)},0),h;if(void 0!==si[n])si[n].push({onLoad:t,onProgress:i,onError:r});else{if(u=n.match(/^data:(.*?)(;base64)?,(.*)$/),u){i=u[1],o=!!u[2],u=u[3],u=decodeURIComponent(u),o&&(u=atob(u));try{l=(this.responseType||"").toLowerCase();switch(l){case"arraybuffer":case"blob":for(c=new Uint8Array(u.length),o=0;o<u.length;o++)c[o]=u.charCodeAt(o);s="blob"===l?new Blob([c.buffer],{type:i}):c.buffer;break;case"document":s=(new DOMParser).parseFromString(u,i);break;case"json":s=JSON.parse(u);break;default:s=u}setTimeout(function(){t&&t(s),f.manager.itemEnd(n)},0)}catch(a){setTimeout(function(){r&&r(a),f.manager.itemError(n),f.manager.itemEnd(n)},0)}}else{si[n]=[],si[n].push({onLoad:t,onProgress:i,onError:r}),e=new XMLHttpRequest,e.open("GET",n,!0),e.addEventListener("load",function(t){var o=this.response,u=si[n],i,e,r;if(delete si[n],200===this.status||0===this.status){for(0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),gu.add(n,o),i=0,e=u.length;i<e;i++)if(r=u[i],r.onLoad)r.onLoad(o)}else{for(i=0,e=u.length;i<e;i++)if(r=u[i],r.onError)r.onError(t);f.manager.itemError(n)}f.manager.itemEnd(n)},!1),e.addEventListener("progress",function(t){for(var r,u=si[n],i=0,f=u.length;i<f;i++)if(r=u[i],r.onProgress)r.onProgress(t)},!1),e.addEventListener("error",function(t){var u=si[n],i,e,r;for(delete si[n],i=0,e=u.length;i<e;i++)if(r=u[i],r.onError)r.onError(t);f.manager.itemError(n),f.manager.itemEnd(n)},!1),e.addEventListener("abort",function(t){var u=si[n],i,e,r;for(delete si[n],i=0,e=u.length;i<e;i++)if(r=u[i],r.onError)r.onError(t);f.manager.itemError(n),f.manager.itemEnd(n)},!1),void 0!==this.responseType&&(e.responseType=this.responseType),void 0!==this.withCredentials&&(e.withCredentials=this.withCredentials),e.overrideMimeType&&e.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(o in this.requestHeader)e.setRequestHeader(o,this.requestHeader[o]);e.send(null)}return f.manager.itemStart(n),e}},setResponseType:function(n){return this.responseType=n,this},setWithCredentials:function(n){return this.withCredentials=n,this},setMimeType:function(n){return this.mimeType=n,this},setRequestHeader:function(n){return this.requestHeader=n,this}}),gp.prototype=Object.assign(Object.create(w.prototype),{constructor:gp,load:function(n,t,i,r){var u=this,f=new oi(u.manager);f.setPath(u.path),f.load(n,function(n){t(u.parse(JSON.parse(n)))},i,r)},parse:function(n){for(var r,i=[],t=0;t<n.length;t++)r=ei.parse(n[t]),i.push(r);return i}}),nw.prototype=Object.assign(Object.create(w.prototype),{constructor:nw,load:function(n,t,i,r){function c(o){e.load(n[o],function(n){n=s.parse(n,!0),f[o]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},h+=1,6===h&&(1===n.mipmapCount&&(u.minFilter=1006),u.format=n.format,u.needsUpdate=!0,t&&t(u))},i,r)}var s=this,f=[],u=new no,e;if(u.image=f,e=new oi(this.manager),e.setPath(this.path),e.setResponseType("arraybuffer"),Array.isArray(n))for(var h=0,o=0,l=n.length;o<l;++o)c(o);else e.load(n,function(n){var e,i,r;if(n=s.parse(n,!0),n.isCubemap)for(e=n.mipmaps.length/n.mipmapCount,i=0;i<e;i++)for(f[i]={mipmaps:[]},r=0;r<n.mipmapCount;r++)f[i].mipmaps.push(n.mipmaps[i*n.mipmapCount+r]),f[i].format=n.format,f[i].width=n.width,f[i].height=n.height;else u.image.width=n.width,u.image.height=n.height,u.mipmaps=n.mipmaps;1===n.mipmapCount&&(u.minFilter=1006),u.format=n.format,u.needsUpdate=!0,t&&t(u)},i,r);return u}}),ba.prototype=Object.assign(Object.create(w.prototype),{constructor:ba,load:function(n,t,i,r){var e=this,u=new of,f=new oi(this.manager);return f.setResponseType("arraybuffer"),f.setPath(this.path),f.load(n,function(n){(n=e.parse(n))&&(void 0!==n.image?u.image=n.image:void 0!==n.data&&(u.image.width=n.width,u.image.height=n.height,u.image.data=n.data),u.wrapS=void 0!==n.wrapS?n.wrapS:1001,u.wrapT=void 0!==n.wrapT?n.wrapT:1001,u.magFilter=void 0!==n.magFilter?n.magFilter:1006,u.minFilter=void 0!==n.minFilter?n.minFilter:1006,u.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(u.format=n.format),void 0!==n.type&&(u.type=n.type),void 0!==n.mipmaps&&(u.mipmaps=n.mipmaps,u.minFilter=1008),1===n.mipmapCount&&(u.minFilter=1006),u.needsUpdate=!0,t&&t(u,n))},i,r),u}}),bo.prototype=Object.assign(Object.create(w.prototype),{constructor:bo,load:function(n,t,i,r){function o(){u.removeEventListener("load",o,!1),u.removeEventListener("error",s,!1),gu.add(n,this),t&&t(this),f.manager.itemEnd(n)}function s(t){u.removeEventListener("load",o,!1),u.removeEventListener("error",s,!1),r&&r(t),f.manager.itemError(n),f.manager.itemEnd(n)}var f,e,u;return(void 0!==this.path&&(n=this.path+n),n=this.manager.resolveURL(n),f=this,e=gu.get(n),void 0!==e)?(f.manager.itemStart(n),setTimeout(function(){t&&t(e),f.manager.itemEnd(n)},0),e):(u=document.createElementNS("http://www.w3.org/1999/xhtml","img"),u.addEventListener("load",o,!1),u.addEventListener("error",s,!1),"data:"!==n.substr(0,5)&&void 0!==this.crossOrigin&&(u.crossOrigin=this.crossOrigin),f.manager.itemStart(n),u.src=n,u)}}),ka.prototype=Object.assign(Object.create(w.prototype),{constructor:ka,load:function(n,t,i,r){function o(i){f.load(n[i],function(n){u.images[i]=n,e++,6===e&&(u.needsUpdate=!0,t&&t(u))},void 0,r)}var u=new wr,f=new bo(this.manager),e;for(f.setCrossOrigin(this.crossOrigin),f.setPath(this.path),e=0,i=0;i<n.length;++i)o(i);return u}}),da.prototype=Object.assign(Object.create(w.prototype),{constructor:da,load:function(n,t,i,r){var u=new k,f=new bo(this.manager);return f.setCrossOrigin(this.crossOrigin),f.setPath(this.path),f.load(n,function(i){u.image=i,i=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data:image\/jpeg/),u.format=i?1022:1023,u.needsUpdate=!0,void 0!==t&&t(u)},i,r),u}}),Object.assign(s.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(n,t){return n=this.getUtoTmapping(n),this.getPoint(n,t)},getPoints:function(n){void 0===n&&(n=5);for(var i=[],t=0;t<=n;t++)i.push(this.getPoint(t/n));return i},getSpacedPoints:function(n){void 0===n&&(n=5);for(var i=[],t=0;t<=n;t++)i.push(this.getPointAt(t/n));return i},getLength:function(){var n=this.getLengths();return n[n.length-1]},getLengths:function(n){var r;if(void 0===n&&(n=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===n+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var i=[],u=this.getPoint(0),t,f=0;for(i.push(0),t=1;t<=n;t++)r=this.getPoint(t/n),f+=r.distanceTo(u),i.push(f),u=r;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(n,t){var r=this.getLengths(),f=r.length,i,u,e;for(t=t?t:n*r[f-1],i=0,u=f-1;i<=u;)if(n=Math.floor(i+(u-i)/2),e=r[n]-t,0>e)i=n+1;else if(0<e)u=n-1;else{u=n;break}return(n=u,r[n]===t)?n/(f-1):(i=r[n],(n+(t-i)/(r[n+1]-i))/(f-1))},getTangent:function(n){var t=n-.0001;return n+=.0001,0>t&&(t=0),1<n&&(n=1),t=this.getPoint(t),this.getPoint(n).clone().sub(t).normalize()},getTangentAt:function(n){return n=this.getUtoTmapping(n),this.getTangent(n)},computeFrenetFrames:function(n,i){for(var e=new t,u=[],f=[],o=[],s=new t,l=new v,h,c,y,r=0;r<=n;r++)h=r/n,u[r]=this.getTangentAt(h),u[r].normalize();for(f[0]=new t,o[0]=new t,r=Number.MAX_VALUE,h=Math.abs(u[0].x),c=Math.abs(u[0].y),y=Math.abs(u[0].z),h<=r&&(r=h,e.set(1,0,0)),c<=r&&(r=c,e.set(0,1,0)),y<=r&&e.set(0,0,1),s.crossVectors(u[0],e).normalize(),f[0].crossVectors(u[0],s),o[0].crossVectors(u[0],f[0]),r=1;r<=n;r++)f[r]=f[r-1].clone(),o[r]=o[r-1].clone(),s.crossVectors(u[r-1],u[r]),s.length()>Number.EPSILON&&(s.normalize(),e=Math.acos(a.clamp(u[r-1].dot(u[r]),-1,1)),f[r].applyMatrix4(l.makeRotationAxis(s,e))),o[r].crossVectors(u[r],f[r]);if(!0===i)for(e=Math.acos(a.clamp(f[0].dot(f[n]),-1,1)),e/=n,0<u[0].dot(s.crossVectors(f[0],f[n]))&&(e=-e),r=1;r<=n;r++)f[r].applyMatrix4(l.makeRotationAxis(u[r],e*r)),o[r].crossVectors(u[r],f[r]);return{tangents:u,normals:f,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.arcLengthDivisions=n.arcLengthDivisions,this},toJSON:function(){var n={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return n.arcLengthDivisions=this.arcLengthDivisions,n.type=this.type,n},fromJSON:function(n){return this.arcLengthDivisions=n.arcLengthDivisions,this}}),ii.prototype=Object.create(s.prototype),ii.prototype.constructor=ii,ii.prototype.isEllipseCurve=!0,ii.prototype.getPoint=function(n,t){var f;t=t||new i;for(var u=2*Math.PI,r=this.aEndAngle-this.aStartAngle,e=Math.abs(r)<Number.EPSILON;0>r;)r+=u;for(;r>u;)r-=u;return r<Number.EPSILON&&(r=e?0:u),!0!==this.aClockwise||e||(r=r===u?-u:r-u),u=this.aStartAngle+n*r,n=this.aX+this.xRadius*Math.cos(u),f=this.aY+this.yRadius*Math.sin(u),0!==this.aRotation&&(u=Math.cos(this.aRotation),r=Math.sin(this.aRotation),e=n-this.aX,f-=this.aY,n=e*u-f*r+this.aX,f=e*r+f*u+this.aY),t.set(n,f)},ii.prototype.copy=function(n){return s.prototype.copy.call(this,n),this.aX=n.aX,this.aY=n.aY,this.xRadius=n.xRadius,this.yRadius=n.yRadius,this.aStartAngle=n.aStartAngle,this.aEndAngle=n.aEndAngle,this.aClockwise=n.aClockwise,this.aRotation=n.aRotation,this},ii.prototype.toJSON=function(){var n=s.prototype.toJSON.call(this);return n.aX=this.aX,n.aY=this.aY,n.xRadius=this.xRadius,n.yRadius=this.yRadius,n.aStartAngle=this.aStartAngle,n.aEndAngle=this.aEndAngle,n.aClockwise=this.aClockwise,n.aRotation=this.aRotation,n},ii.prototype.fromJSON=function(n){return s.prototype.fromJSON.call(this,n),this.aX=n.aX,this.aY=n.aY,this.xRadius=n.xRadius,this.yRadius=n.yRadius,this.aStartAngle=n.aStartAngle,this.aEndAngle=n.aEndAngle,this.aClockwise=n.aClockwise,this.aRotation=n.aRotation,this},ko.prototype=Object.create(ii.prototype),ko.prototype.constructor=ko,ko.prototype.isArcCurve=!0;var yy=new t,fk=new tw,ek=new tw,ok=new tw;vt.prototype=Object.create(s.prototype),vt.prototype.constructor=vt,vt.prototype.isCatmullRomCurve3=!0,vt.prototype.getPoint=function(n,i){var r,f,u,o,s,h,e;return i=i||new t,r=this.points,f=r.length,n*=f-(this.closed?0:1),u=Math.floor(n),n-=u,this.closed?u+=0<u?0:(Math.floor(Math.abs(u)/f)+1)*f:0===n&&u===f-1&&(u=f-2,n=1),this.closed||0<u?o=r[(u-1)%f]:(yy.subVectors(r[0],r[1]).add(r[0]),o=yy),s=r[u%f],h=r[(u+1)%f],this.closed||u+2<f?r=r[(u+2)%f]:(yy.subVectors(r[f-1],r[f-2]).add(r[f-1]),r=yy),"centripetal"===this.curveType||"chordal"===this.curveType?(e="chordal"===this.curveType?.5:.25,f=Math.pow(o.distanceToSquared(s),e),u=Math.pow(s.distanceToSquared(h),e),e=Math.pow(h.distanceToSquared(r),e),.0001>u&&(u=1),.0001>f&&(f=u),.0001>e&&(e=u),fk.initNonuniformCatmullRom(o.x,s.x,h.x,r.x,f,u,e),ek.initNonuniformCatmullRom(o.y,s.y,h.y,r.y,f,u,e),ok.initNonuniformCatmullRom(o.z,s.z,h.z,r.z,f,u,e)):"catmullrom"===this.curveType&&(fk.initCatmullRom(o.x,s.x,h.x,r.x,this.tension),ek.initCatmullRom(o.y,s.y,h.y,r.y,this.tension),ok.initCatmullRom(o.z,s.z,h.z,r.z,this.tension)),i.set(fk.calc(n),ek.calc(n),ok.calc(n)),i},vt.prototype.copy=function(n){s.prototype.copy.call(this,n),this.points=[];for(var t=0,i=n.points.length;t<i;t++)this.points.push(n.points[t].clone());return this.closed=n.closed,this.curveType=n.curveType,this.tension=n.tension,this},vt.prototype.toJSON=function(){var n=s.prototype.toJSON.call(this),t,i;for(n.points=[],t=0,i=this.points.length;t<i;t++)n.points.push(this.points[t].toArray());return n.closed=this.closed,n.curveType=this.curveType,n.tension=this.tension,n},vt.prototype.fromJSON=function(n){var i,r,u;for(s.prototype.fromJSON.call(this,n),this.points=[],i=0,r=n.points.length;i<r;i++)u=n.points[i],this.points.push((new t).fromArray(u));return this.closed=n.closed,this.curveType=n.curveType,this.tension=n.tension,this},vi.prototype=Object.create(s.prototype),vi.prototype.constructor=vi,vi.prototype.isCubicBezierCurve=!0,vi.prototype.getPoint=function(n,t){t=t||new i;var r=this.v0,u=this.v1,f=this.v2,e=this.v3;return t.set(nl(n,r.x,u.x,f.x,e.x),nl(n,r.y,u.y,f.y,e.y)),t},vi.prototype.copy=function(n){return s.prototype.copy.call(this,n),this.v0.copy(n.v0),this.v1.copy(n.v1),this.v2.copy(n.v2),this.v3.copy(n.v3),this},vi.prototype.toJSON=function(){var n=s.prototype.toJSON.call(this);return n.v0=this.v0.toArray(),n.v1=this.v1.toArray(),n.v2=this.v2.toArray(),n.v3=this.v3.toArray(),n},vi.prototype.fromJSON=function(n){return s.prototype.fromJSON.call(this,n),this.v0.fromArray(n.v0),this.v1.fromArray(n.v1),this.v2.fromArray(n.v2),this.v3.fromArray(n.v3),this},er.prototype=Object.create(s.prototype),er.prototype.constructor=er,er.prototype.isCubicBezierCurve3=!0,er.prototype.getPoint=function(n,i){i=i||new t;var r=this.v0,u=this.v1,f=this.v2,e=this.v3;return i.set(nl(n,r.x,u.x,f.x,e.x),nl(n,r.y,u.y,f.y,e.y),nl(n,r.z,u.z,f.z,e.z)),i},er.prototype.copy=function(n){return s.prototype.copy.call(this,n),this.v0.copy(n.v0),this.v1.copy(n.v1),this.v2.copy(n.v2),this.v3.copy(n.v3),this},er.prototype.toJSON=function(){var n=s.prototype.toJSON.call(this);return n.v0=this.v0.toArray(),n.v1=this.v1.toArray(),n.v2=this.v2.toArray(),n.v3=this.v3.toArray(),n},er.prototype.fromJSON=function(n){return s.prototype.fromJSON.call(this,n),this.v0.fromArray(n.v0),this.v1.fromArray(n.v1),this.v2.fromArray(n.v2),this.v3.fromArray(n.v3),this},dt.prototype=Object.create(s.prototype),dt.prototype.constructor=dt,dt.prototype.isLineCurve=!0,dt.prototype.getPoint=function(n,t){return t=t||new i,1===n?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(n).add(this.v1)),t},dt.prototype.getPointAt=function(n,t){return this.getPoint(n,t)},dt.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},dt.prototype.copy=function(n){return s.prototype.copy.call(this,n),this.v1.copy(n.v1),this.v2.copy(n.v2),this},dt.prototype.toJSON=function(){var n=s.prototype.toJSON.call(this);return n.v1=this.v1.toArray(),n.v2=this.v2.toArray(),n},dt.prototype.fromJSON=function(n){return s.prototype.fromJSON.call(this,n),this.v1.fromArray(n.v1),this.v2.fromArray(n.v2),this},yi.prototype=Object.create(s.prototype),yi.prototype.constructor=yi,yi.prototype.isLineCurve3=!0,yi.prototype.getPoint=function(n,i){return i=i||new t,1===n?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(n).add(this.v1)),i},yi.prototype.getPointAt=function(n,t){return this.getPoint(n,t)},yi.prototype.copy=function(n){return s.prototype.copy.call(this,n),this.v1.copy(n.v1),this.v2.copy(n.v2),this},yi.prototype.toJSON=function(){var n=s.prototype.toJSON.call(this);return n.v1=this.v1.toArray(),n.v2=this.v2.toArray(),n},yi.prototype.fromJSON=function(n){return s.prototype.fromJSON.call(this,n),this.v1.fromArray(n.v1),this.v2.fromArray(n.v2),this},pi.prototype=Object.create(s.prototype),pi.prototype.constructor=pi,pi.prototype.isQuadraticBezierCurve=!0,pi.prototype.getPoint=function(n,t){t=t||new i;var r=this.v0,u=this.v1,f=this.v2;return t.set(gc(n,r.x,u.x,f.x),gc(n,r.y,u.y,f.y)),t},pi.prototype.copy=function(n){return s.prototype.copy.call(this,n),this.v0.copy(n.v0),this.v1.copy(n.v1),this.v2.copy(n.v2),this},pi.prototype.toJSON=function(){var n=s.prototype.toJSON.call(this);return n.v0=this.v0.toArray(),n.v1=this.v1.toArray(),n.v2=this.v2.toArray(),n},pi.prototype.fromJSON=function(n){return s.prototype.fromJSON.call(this,n),this.v0.fromArray(n.v0),this.v1.fromArray(n.v1),this.v2.fromArray(n.v2),this},or.prototype=Object.create(s.prototype),or.prototype.constructor=or,or.prototype.isQuadraticBezierCurve3=!0,or.prototype.getPoint=function(n,i){i=i||new t;var r=this.v0,u=this.v1,f=this.v2;return i.set(gc(n,r.x,u.x,f.x),gc(n,r.y,u.y,f.y),gc(n,r.z,u.z,f.z)),i},or.prototype.copy=function(n){return s.prototype.copy.call(this,n),this.v0.copy(n.v0),this.v1.copy(n.v1),this.v2.copy(n.v2),this},or.prototype.toJSON=function(){var n=s.prototype.toJSON.call(this);return n.v0=this.v0.toArray(),n.v1=this.v1.toArray(),n.v2=this.v2.toArray(),n},or.prototype.fromJSON=function(n){return s.prototype.fromJSON.call(this,n),this.v0.fromArray(n.v0),this.v1.fromArray(n.v1),this.v2.fromArray(n.v2),this},wi.prototype=Object.create(s.prototype),wi.prototype.constructor=wi,wi.prototype.isSplineCurve=!0,wi.prototype.getPoint=function(n,t){var r,u;t=t||new i,r=this.points,u=(r.length-1)*n,n=Math.floor(u),u-=n;var f=r[0===n?n:n-1],e=r[n],o=r[n>r.length-2?r.length-1:n+1];return r=r[n>r.length-3?r.length-1:n+2],t.set(ig(u,f.x,e.x,o.x,r.x),ig(u,f.y,e.y,o.y,r.y)),t},wi.prototype.copy=function(n){s.prototype.copy.call(this,n),this.points=[];for(var t=0,i=n.points.length;t<i;t++)this.points.push(n.points[t].clone());return this},wi.prototype.toJSON=function(){var t=s.prototype.toJSON.call(this),n,i;for(t.points=[],n=0,i=this.points.length;n<i;n++)t.points.push(this.points[n].toArray());return t},wi.prototype.fromJSON=function(n){var t,r,u;for(s.prototype.fromJSON.call(this,n),this.points=[],t=0,r=n.points.length;t<r;t++)u=n.points[t],this.points.push((new i).fromArray(u));return this},py=Object.freeze({__proto__:null,ArcCurve:ko,CatmullRomCurve3:vt,CubicBezierCurve:vi,CubicBezierCurve3:er,EllipseCurve:ii,LineCurve:dt,LineCurve3:yi,QuadraticBezierCurve:pi,QuadraticBezierCurve3:or,SplineCurve:wi}),dr.prototype=Object.assign(Object.create(s.prototype),{constructor:dr,add:function(n){this.curves.push(n)},closePath:function(){var n=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);n.equals(t)||this.curves.push(new dt(t,n))},getPoint:function(n){var i=n*this.getLength(),t=this.getCurveLengths();for(n=0;n<t.length;){if(t[n]>=i)return i=t[n]-i,n=this.curves[n],t=n.getLength(),n.getPointAt(0===t?0:1-i/t);n++}return null},getLength:function(){var n=this.getCurveLengths();return n[n.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],i=0,n=0,r=this.curves.length;n<r;n++)i+=this.curves[n].getLength(),t.push(i);return this.cacheLengths=t},getSpacedPoints:function(n){void 0===n&&(n=40);for(var t=[],i=0;i<=n;i++)t.push(this.getPoint(i/n));return this.autoClose&&t.push(t[0]),t},getPoints:function(n){var t,r,u;n=n||12;for(var i=[],f,e=0,o=this.curves;e<o.length;e++)for(t=o[e],t=t.getPoints(t&&t.isEllipseCurve?2*n:t&&(t.isLineCurve||t.isLineCurve3)?1:t&&t.isSplineCurve?n*t.points.length:n),r=0;r<t.length;r++)u=t[r],f&&f.equals(u)||(i.push(u),f=u);return this.autoClose&&1<i.length&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},copy:function(n){s.prototype.copy.call(this,n),this.curves=[];for(var t=0,i=n.curves.length;t<i;t++)this.curves.push(n.curves[t].clone());return this.autoClose=n.autoClose,this},toJSON:function(){var n=s.prototype.toJSON.call(this),t,i;for(n.autoClose=this.autoClose,n.curves=[],t=0,i=this.curves.length;t<i;t++)n.curves.push(this.curves[t].toJSON());return n},fromJSON:function(n){var t,r,i;for(s.prototype.fromJSON.call(this,n),this.autoClose=n.autoClose,this.curves=[],t=0,r=n.curves.length;t<r;t++)i=n.curves[t],this.curves.push((new py[i.type]).fromJSON(i));return this}}),bi.prototype=Object.assign(Object.create(dr.prototype),{constructor:bi,setFromPoints:function(n){this.moveTo(n[0].x,n[0].y);for(var t=1,i=n.length;t<i;t++)this.lineTo(n[t].x,n[t].y);return this},moveTo:function(n,t){return this.currentPoint.set(n,t),this},lineTo:function(n,t){var r=new dt(this.currentPoint.clone(),new i(n,t));return this.curves.push(r),this.currentPoint.set(n,t),this},quadraticCurveTo:function(n,t,r,u){return n=new pi(this.currentPoint.clone(),new i(n,t),new i(r,u)),this.curves.push(n),this.currentPoint.set(r,u),this},bezierCurveTo:function(n,t,r,u,f,e){return n=new vi(this.currentPoint.clone(),new i(n,t),new i(r,u),new i(f,e)),this.curves.push(n),this.currentPoint.set(f,e),this},splineThru:function(n){var t=[this.currentPoint.clone()].concat(n);return t=new wi(t),this.curves.push(t),this.currentPoint.copy(n[n.length-1]),this},arc:function(n,t,i,r,u,f){return this.absarc(n+this.currentPoint.x,t+this.currentPoint.y,i,r,u,f),this},absarc:function(n,t,i,r,u,f){return this.absellipse(n,t,i,i,r,u,f),this},ellipse:function(n,t,i,r,u,f,e,o){return this.absellipse(n+this.currentPoint.x,t+this.currentPoint.y,i,r,u,f,e,o),this},absellipse:function(n,t,i,r,u,f,e,o){return n=new ii(n,t,i,r,u,f,e,o),0<this.curves.length&&(t=n.getPoint(0),t.equals(this.currentPoint)||this.lineTo(t.x,t.y)),this.curves.push(n),n=n.getPoint(1),this.currentPoint.copy(n),this},copy:function(n){return dr.prototype.copy.call(this,n),this.currentPoint.copy(n.currentPoint),this},toJSON:function(){var n=dr.prototype.toJSON.call(this);return n.currentPoint=this.currentPoint.toArray(),n},fromJSON:function(n){return dr.prototype.fromJSON.call(this,n),this.currentPoint.fromArray(n.currentPoint),this}}),yu.prototype=Object.assign(Object.create(bi.prototype),{constructor:yu,getPointsHoles:function(n){for(var i=[],t=0,r=this.holes.length;t<r;t++)i[t]=this.holes[t].getPoints(n);return i},extractPoints:function(n){return{shape:this.getPoints(n),holes:this.getPointsHoles(n)}},copy:function(n){bi.prototype.copy.call(this,n),this.holes=[];for(var t=0,i=n.holes.length;t<i;t++)this.holes.push(n.holes[t].clone());return this},toJSON:function(){var n=bi.prototype.toJSON.call(this),t,i;for(n.uuid=this.uuid,n.holes=[],t=0,i=this.holes.length;t<i;t++)n.holes.push(this.holes[t].toJSON());return n},fromJSON:function(n){var t,i,r;for(bi.prototype.fromJSON.call(this,n),this.uuid=n.uuid,this.holes=[],t=0,i=n.holes.length;t<i;t++)r=n.holes[t],this.holes.push((new bi).fromJSON(r));return this}}),g.prototype=Object.assign(Object.create(u.prototype),{constructor:g,isLight:!0,copy:function(n){return u.prototype.copy.call(this,n),this.color.copy(n.color),this.intensity=n.intensity,this},toJSON:function(n){return n=u.prototype.toJSON.call(this,n),n.object.color=this.color.getHex(),n.object.intensity=this.intensity,void 0!==this.groundColor&&(n.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(n.object.distance=this.distance),void 0!==this.angle&&(n.object.angle=this.angle),void 0!==this.decay&&(n.object.decay=this.decay),void 0!==this.penumbra&&(n.object.penumbra=this.penumbra),void 0!==this.shadow&&(n.object.shadow=this.shadow.toJSON()),n}}),ga.prototype=Object.assign(Object.create(g.prototype),{constructor:ga,isHemisphereLight:!0,copy:function(n){return g.prototype.copy.call(this,n),this.groundColor.copy(n.groundColor),this}}),Object.assign(sr.prototype,{_projScreenMatrix:new v,_lightPositionWorld:new t,_lookTarget:new t,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(n){var t=this.camera,i=this.matrix,r=this._projScreenMatrix,u=this._lookTarget,f=this._lightPositionWorld;f.setFromMatrixPosition(n.matrixWorld),t.position.copy(f),u.setFromMatrixPosition(n.target.matrixWorld),t.lookAt(u),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromMatrix(r),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)},getViewport:function(n){return this._viewports[n]},getFrameExtents:function(){return this._frameExtents},copy:function(n){return this.camera=n.camera.clone(),this.bias=n.bias,this.radius=n.radius,this.mapSize.copy(n.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var n={};return 0!==this.bias&&(n.bias=this.bias),1!==this.radius&&(n.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(n.mapSize=this.mapSize.toArray()),n.camera=this.camera.toJSON(!1).object,delete n.camera.matrix,n}}),nv.prototype=Object.assign(Object.create(sr.prototype),{constructor:nv,isSpotLightShadow:!0,updateMatrices:function(n){var t=this.camera,i=2*a.RAD2DEG*n.angle,r=this.mapSize.width/this.mapSize.height,u=n.distance||t.far;(i!==t.fov||r!==t.aspect||u!==t.far)&&(t.fov=i,t.aspect=r,t.far=u,t.updateProjectionMatrix()),sr.prototype.updateMatrices.call(this,n)}}),tv.prototype=Object.assign(Object.create(g.prototype),{constructor:tv,isSpotLight:!0,copy:function(n){return g.prototype.copy.call(this,n),this.distance=n.distance,this.angle=n.angle,this.penumbra=n.penumbra,this.decay=n.decay,this.target=n.target.clone(),this.shadow=n.shadow.clone(),this}}),iw.prototype=Object.assign(Object.create(sr.prototype),{constructor:iw,isPointLightShadow:!0,updateMatrices:function(n,t){void 0===t&&(t=0);var i=this.camera,e=this.matrix,r=this._lightPositionWorld,u=this._lookTarget,f=this._projScreenMatrix;r.setFromMatrixPosition(n.matrixWorld),i.position.copy(r),u.copy(i.position),u.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(u),i.updateMatrixWorld(),e.makeTranslation(-r.x,-r.y,-r.z),f.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromMatrix(f)}}),iv.prototype=Object.assign(Object.create(g.prototype),{constructor:iv,isPointLight:!0,copy:function(n){return g.prototype.copy.call(this,n),this.distance=n.distance,this.decay=n.decay,this.shadow=n.shadow.clone(),this}}),tl.prototype=Object.assign(Object.create(rr.prototype),{constructor:tl,isOrthographicCamera:!0,copy:function(n,t){return rr.prototype.copy.call(this,n,t),this.left=n.left,this.right=n.right,this.top=n.top,this.bottom=n.bottom,this.near=n.near,this.far=n.far,this.zoom=n.zoom,this.view=null===n.view?null:Object.assign({},n.view),this},setViewOffset:function(n,t,i,r,u,f){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=n,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=u,this.view.height=f,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var i=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),t=(this.right+this.left)/2,r=(this.top+this.bottom)/2,u=t-i,f;t+=i,i=r+n,n=r-n,null!==this.view&&this.view.enabled&&(t=this.zoom/(this.view.width/this.view.fullWidth),n=this.zoom/(this.view.height/this.view.fullHeight),f=(this.right-this.left)/this.view.width,r=(this.top-this.bottom)/this.view.height,u+=this.view.offsetX/t*f,t=u+this.view.width/t*f,i-=this.view.offsetY/n*r,n=i-this.view.height/n*r),this.projectionMatrix.makeOrthographic(u,t,i,n,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(n){return n=u.prototype.toJSON.call(this,n),n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,null!==this.view&&(n.object.view=Object.assign({},this.view)),n}}),rv.prototype=Object.assign(Object.create(sr.prototype),{constructor:rv,isDirectionalLightShadow:!0,updateMatrices:function(n){sr.prototype.updateMatrices.call(this,n)}}),uv.prototype=Object.assign(Object.create(g.prototype),{constructor:uv,isDirectionalLight:!0,copy:function(n){return g.prototype.copy.call(this,n),this.target=n.target.clone(),this.shadow=n.shadow.clone(),this}}),fv.prototype=Object.assign(Object.create(g.prototype),{constructor:fv,isAmbientLight:!0}),ev.prototype=Object.assign(Object.create(g.prototype),{constructor:ev,isRectAreaLight:!0,copy:function(n){return g.prototype.copy.call(this,n),this.width=n.width,this.height=n.height,this},toJSON:function(n){return n=g.prototype.toJSON.call(this,n),n.object.width=this.width,n.object.height=this.height,n}}),ov.prototype=Object.assign(Object.create(w.prototype),{constructor:ov,load:function(n,t,i,r){var u=this,f=new oi(u.manager);f.setPath(u.path),f.load(n,function(n){t(u.parse(JSON.parse(n)))},i,r)},parse:function(n){function f(n){return void 0===h[n]&&console.warn("THREE.MaterialLoader: Undefined texture",n),h[n]}var h=this.textures,r=new utt[n.type],u,o,s;if(void 0!==n.uuid&&(r.uuid=n.uuid),void 0!==n.name&&(r.name=n.name),void 0!==n.color&&r.color.setHex(n.color),void 0!==n.roughness&&(r.roughness=n.roughness),void 0!==n.metalness&&(r.metalness=n.metalness),void 0!==n.sheen&&(r.sheen=(new e).setHex(n.sheen)),void 0!==n.emissive&&r.emissive.setHex(n.emissive),void 0!==n.specular&&r.specular.setHex(n.specular),void 0!==n.shininess&&(r.shininess=n.shininess),void 0!==n.clearcoat&&(r.clearcoat=n.clearcoat),void 0!==n.clearcoatRoughness&&(r.clearcoatRoughness=n.clearcoatRoughness),void 0!==n.vertexColors&&(r.vertexColors=n.vertexColors),void 0!==n.fog&&(r.fog=n.fog),void 0!==n.flatShading&&(r.flatShading=n.flatShading),void 0!==n.blending&&(r.blending=n.blending),void 0!==n.combine&&(r.combine=n.combine),void 0!==n.side&&(r.side=n.side),void 0!==n.opacity&&(r.opacity=n.opacity),void 0!==n.transparent&&(r.transparent=n.transparent),void 0!==n.alphaTest&&(r.alphaTest=n.alphaTest),void 0!==n.depthTest&&(r.depthTest=n.depthTest),void 0!==n.depthWrite&&(r.depthWrite=n.depthWrite),void 0!==n.colorWrite&&(r.colorWrite=n.colorWrite),void 0!==n.stencilWrite&&(r.stencilWrite=n.stencilWrite),void 0!==n.stencilWriteMask&&(r.stencilWriteMask=n.stencilWriteMask),void 0!==n.stencilFunc&&(r.stencilFunc=n.stencilFunc),void 0!==n.stencilRef&&(r.stencilRef=n.stencilRef),void 0!==n.stencilFuncMask&&(r.stencilFuncMask=n.stencilFuncMask),void 0!==n.stencilFail&&(r.stencilFail=n.stencilFail),void 0!==n.stencilZFail&&(r.stencilZFail=n.stencilZFail),void 0!==n.stencilZPass&&(r.stencilZPass=n.stencilZPass),void 0!==n.wireframe&&(r.wireframe=n.wireframe),void 0!==n.wireframeLinewidth&&(r.wireframeLinewidth=n.wireframeLinewidth),void 0!==n.wireframeLinecap&&(r.wireframeLinecap=n.wireframeLinecap),void 0!==n.wireframeLinejoin&&(r.wireframeLinejoin=n.wireframeLinejoin),void 0!==n.rotation&&(r.rotation=n.rotation),1!==n.linewidth&&(r.linewidth=n.linewidth),void 0!==n.dashSize&&(r.dashSize=n.dashSize),void 0!==n.gapSize&&(r.gapSize=n.gapSize),void 0!==n.scale&&(r.scale=n.scale),void 0!==n.polygonOffset&&(r.polygonOffset=n.polygonOffset),void 0!==n.polygonOffsetFactor&&(r.polygonOffsetFactor=n.polygonOffsetFactor),void 0!==n.polygonOffsetUnits&&(r.polygonOffsetUnits=n.polygonOffsetUnits),void 0!==n.skinning&&(r.skinning=n.skinning),void 0!==n.morphTargets&&(r.morphTargets=n.morphTargets),void 0!==n.morphNormals&&(r.morphNormals=n.morphNormals),void 0!==n.dithering&&(r.dithering=n.dithering),void 0!==n.visible&&(r.visible=n.visible),void 0!==n.toneMapped&&(r.toneMapped=n.toneMapped),void 0!==n.userData&&(r.userData=n.userData),void 0!==n.uniforms)for(u in n.uniforms){o=n.uniforms[u],r.uniforms[u]={};switch(o.type){case"t":r.uniforms[u].value=f(o.value);break;case"c":r.uniforms[u].value=(new e).setHex(o.value);break;case"v2":r.uniforms[u].value=(new i).fromArray(o.value);break;case"v3":r.uniforms[u].value=(new t).fromArray(o.value);break;case"v4":r.uniforms[u].value=(new p).fromArray(o.value);break;case"m3":r.uniforms[u].value=(new ft).fromArray(o.value);case"m4":r.uniforms[u].value=(new v).fromArray(o.value);break;default:r.uniforms[u].value=o.value}}if(void 0!==n.defines&&(r.defines=n.defines),void 0!==n.vertexShader&&(r.vertexShader=n.vertexShader),void 0!==n.fragmentShader&&(r.fragmentShader=n.fragmentShader),void 0!==n.extensions)for(s in n.extensions)r.extensions[s]=n.extensions[s];return void 0!==n.shading&&(r.flatShading=1===n.shading),void 0!==n.size&&(r.size=n.size),void 0!==n.sizeAttenuation&&(r.sizeAttenuation=n.sizeAttenuation),void 0!==n.map&&(r.map=f(n.map)),void 0!==n.matcap&&(r.matcap=f(n.matcap)),void 0!==n.alphaMap&&(r.alphaMap=f(n.alphaMap),r.transparent=!0),void 0!==n.bumpMap&&(r.bumpMap=f(n.bumpMap)),void 0!==n.bumpScale&&(r.bumpScale=n.bumpScale),void 0!==n.normalMap&&(r.normalMap=f(n.normalMap)),void 0!==n.normalMapType&&(r.normalMapType=n.normalMapType),void 0!==n.normalScale&&(u=n.normalScale,!1===Array.isArray(u)&&(u=[u,u]),r.normalScale=(new i).fromArray(u)),void 0!==n.displacementMap&&(r.displacementMap=f(n.displacementMap)),void 0!==n.displacementScale&&(r.displacementScale=n.displacementScale),void 0!==n.displacementBias&&(r.displacementBias=n.displacementBias),void 0!==n.roughnessMap&&(r.roughnessMap=f(n.roughnessMap)),void 0!==n.metalnessMap&&(r.metalnessMap=f(n.metalnessMap)),void 0!==n.emissiveMap&&(r.emissiveMap=f(n.emissiveMap)),void 0!==n.emissiveIntensity&&(r.emissiveIntensity=n.emissiveIntensity),void 0!==n.specularMap&&(r.specularMap=f(n.specularMap)),void 0!==n.envMap&&(r.envMap=f(n.envMap)),void 0!==n.envMapIntensity&&(r.envMapIntensity=n.envMapIntensity),void 0!==n.reflectivity&&(r.reflectivity=n.reflectivity),void 0!==n.refractionRatio&&(r.refractionRatio=n.refractionRatio),void 0!==n.lightMap&&(r.lightMap=f(n.lightMap)),void 0!==n.lightMapIntensity&&(r.lightMapIntensity=n.lightMapIntensity),void 0!==n.aoMap&&(r.aoMap=f(n.aoMap)),void 0!==n.aoMapIntensity&&(r.aoMapIntensity=n.aoMapIntensity),void 0!==n.gradientMap&&(r.gradientMap=f(n.gradientMap)),void 0!==n.clearcoatNormalMap&&(r.clearcoatNormalMap=f(n.clearcoatNormalMap)),void 0!==n.clearcoatNormalScale&&(r.clearcoatNormalScale=(new i).fromArray(n.clearcoatNormalScale)),r},setTextures:function(n){return this.textures=n,this}}),wy={decodeText:function(n){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(n);for(var t="",i=0,r=n.length;i<r;i++)t+=String.fromCharCode(n[i]);try{return decodeURIComponent(escape(t))}catch(u){return t}},extractUrlBase:function(n){var t=n.lastIndexOf("/");return-1===t?"./":n.substr(0,t+1)}},sv.prototype=Object.assign(Object.create(f.prototype),{constructor:sv,isInstancedBufferGeometry:!0,copy:function(n){return f.prototype.copy.call(this,n),this.maxInstancedCount=n.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var n=f.prototype.toJSON.call(this);return n.maxInstancedCount=this.maxInstancedCount,n.isInstancedBufferGeometry=!0,n}}),hv.prototype=Object.assign(Object.create(c.prototype),{constructor:hv,isInstancedBufferAttribute:!0,copy:function(n){return c.prototype.copy.call(this,n),this.meshPerAttribute=n.meshPerAttribute,this},toJSON:function(){var n=c.prototype.toJSON.call(this);return n.meshPerAttribute=this.meshPerAttribute,n.isInstancedBufferAttribute=!0,n}}),cv.prototype=Object.assign(Object.create(w.prototype),{constructor:cv,load:function(n,t,i,r){var u=this,f=new oi(u.manager);f.setPath(u.path),f.load(n,function(n){t(u.parse(JSON.parse(n)))},i,r)},parse:function(n){var o=n.isInstancedBufferGeometry?new sv:new f,i=n.data.index,u,e,r,s,h,l,a;void 0!==i&&(u=new by[i.type](i.array),o.setIndex(new c(u,1))),i=n.data.attributes;for(e in i)r=i[e],u=new by[r.type](r.array),u=new(r.isInstancedBufferAttribute?hv:c)(u,r.itemSize,r.normalized),void 0!==r.name&&(u.name=r.name),o.setAttribute(e,u);if(s=n.data.morphAttributes,s)for(e in s){for(h=s[e],l=[],i=0,a=h.length;i<a;i++)r=h[i],u=new by[r.type](r.array),u=new c(u,r.itemSize,r.normalized),void 0!==r.name&&(u.name=r.name),l.push(u);o.morphAttributes[e]=l}if(e=n.data.groups||n.data.drawcalls||n.data.offsets,void 0!==e)for(i=0,r=e.length;i!==r;++i)u=e[i],o.addGroup(u.start,u.count,u.materialIndex);return i=n.data.boundingSphere,void 0!==i&&(e=new t,void 0!==i.center&&e.fromArray(i.center),o.boundingSphere=new pr(e,i.radius)),n.name&&(o.name=n.name),n.userData&&(o.userData=n.userData),o}}),by={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array},lv.prototype=Object.assign(Object.create(w.prototype),{constructor:lv,load:function(n,t,i,r){var f=this,u=""===this.path?wy.extractUrlBase(n):this.path;this.resourcePath=this.resourcePath||u,u=new oi(f.manager),u.setPath(this.path),u.load(n,function(i){var u=null;try{u=JSON.parse(i)}catch(e){void 0!==r&&r(e),console.error("THREE:ObjectLoader: Can't parse "+n+".",e.message);return}i=u.metadata,void 0===i||void 0===i.type||"geometry"===i.type.toLowerCase()?console.error("THREE.ObjectLoader: Can't load "+n):f.parse(u,t)},i,r)},parse:function(n,t){var u=this.parseShape(n.shapes),i,r;return u=this.parseGeometries(n.geometries,u),i=this.parseImages(n.images,function(){void 0!==t&&t(r)}),i=this.parseTextures(n.textures,i),i=this.parseMaterials(n.materials,i),r=this.parseObject(n.object,u,i),n.animations&&(r.animations=this.parseAnimations(n.animations)),void 0!==n.images&&0!==n.images.length||void 0===t||t(r),r},parseShape:function(n){var r={},t,u,i;if(void 0!==n)for(t=0,u=n.length;t<u;t++)i=(new yu).fromJSON(n[t]),r[i.uuid]=i;return r},parseGeometries:function(n,t){var s={},i,r,u,f,e;if(void 0!==n)for(var h=new cv,o=0,c=n.length;o<c;o++){i=n[o];switch(i.type){case"PlaneGeometry":case"PlaneBufferGeometry":r=new pt[i.type](i.width,i.height,i.widthSegments,i.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":r=new pt[i.type](i.width,i.height,i.depth,i.widthSegments,i.heightSegments,i.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":r=new pt[i.type](i.radius,i.segments,i.thetaStart,i.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":r=new pt[i.type](i.radiusTop,i.radiusBottom,i.height,i.radialSegments,i.heightSegments,i.openEnded,i.thetaStart,i.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":r=new pt[i.type](i.radius,i.height,i.radialSegments,i.heightSegments,i.openEnded,i.thetaStart,i.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":r=new pt[i.type](i.radius,i.widthSegments,i.heightSegments,i.phiStart,i.phiLength,i.thetaStart,i.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":r=new pt[i.type](i.radius,i.detail);break;case"RingGeometry":case"RingBufferGeometry":r=new pt[i.type](i.innerRadius,i.outerRadius,i.thetaSegments,i.phiSegments,i.thetaStart,i.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":r=new pt[i.type](i.radius,i.tube,i.radialSegments,i.tubularSegments,i.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":r=new pt[i.type](i.radius,i.tube,i.tubularSegments,i.radialSegments,i.p,i.q);break;case"TubeGeometry":case"TubeBufferGeometry":r=new pt[i.type]((new py[i.path.type]).fromJSON(i.path),i.tubularSegments,i.radius,i.radialSegments,i.closed);break;case"LatheGeometry":case"LatheBufferGeometry":r=new pt[i.type](i.points,i.segments,i.phiStart,i.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":r=new pt[i.type](i.vertices,i.indices,i.radius,i.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(r=[],u=0,f=i.shapes.length;u<f;u++)e=t[i.shapes[u]],r.push(e);r=new pt[i.type](r,i.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(r=[],u=0,f=i.shapes.length;u<f;u++)e=t[i.shapes[u]],r.push(e);u=i.options.extrudePath,void 0!==u&&(i.options.extrudePath=(new py[u.type]).fromJSON(u)),r=new pt[i.type](r,i.options);break;case"BufferGeometry":case"InstancedBufferGeometry":r=h.parse(i);break;case"Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?r=(new THREE.LegacyJSONLoader).parse(i,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+i.type+'"');continue}r.uuid=i.uuid,void 0!==i.name&&(r.name=i.name),!0===r.isBufferGeometry&&void 0!==i.userData&&(r.userData=i.userData),s[i.uuid]=r}return s},parseMaterials:function(n,t){var r={},o={},f,h,i,s,e,u;if(void 0!==n)for(f=new ov,f.setTextures(t),t=0,h=n.length;t<h;t++)if(i=n[t],"MultiMaterial"===i.type){for(s=[],e=0;e<i.materials.length;e++)u=i.materials[e],void 0===r[u.uuid]&&(r[u.uuid]=f.parse(u)),s.push(r[u.uuid]);o[i.uuid]=s}else void 0===r[i.uuid]&&(r[i.uuid]=f.parse(i)),o[i.uuid]=r[i.uuid];return o},parseAnimations:function(n){for(var i,u,r=[],t=0;t<n.length;t++)i=n[t],u=ei.parse(i),void 0!==i.uuid&&(u.uuid=i.uuid),r.push(u);return r},parseImages:function(n,t){function h(n){return u.manager.itemStart(n),s.load(n,function(){u.manager.itemEnd(n)},void 0,function(){u.manager.itemError(n),u.manager.itemEnd(n)})}var u=this,f={},s,c,i,e,o,l,r;if(void 0!==n&&0<n.length)for(t=new dp(t),s=new bo(t),s.setCrossOrigin(this.crossOrigin),t=0,c=n.length;t<c;t++)if(i=n[t],e=i.url,Array.isArray(e))for(f[i.uuid]=[],o=0,l=e.length;o<l;o++)r=e[o],r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(r)?r:u.resourcePath+r,f[i.uuid].push(h(r));else r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(i.url)?i.url:u.resourcePath+i.url,f[i.uuid]=h(r);return f},parseTextures:function(n,t){function u(n,t){return"number"==typeof n?n:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",n),t[n])}var e={},f,o,i,r;if(void 0!==n)for(f=0,o=n.length;f<o;f++)i=n[f],void 0===i.image&&console.warn('THREE.ObjectLoader: No "image" specified for',i.uuid),void 0===t[i.image]&&console.warn("THREE.ObjectLoader: Undefined image",i.image),r=Array.isArray(t[i.image])?new wr(t[i.image]):new k(t[i.image]),r.needsUpdate=!0,r.uuid=i.uuid,void 0!==i.name&&(r.name=i.name),void 0!==i.mapping&&(r.mapping=u(i.mapping,wft)),void 0!==i.offset&&r.offset.fromArray(i.offset),void 0!==i.repeat&&r.repeat.fromArray(i.repeat),void 0!==i.center&&r.center.fromArray(i.center),void 0!==i.rotation&&(r.rotation=i.rotation),void 0!==i.wrap&&(r.wrapS=u(i.wrap[0],ftt),r.wrapT=u(i.wrap[1],ftt)),void 0!==i.format&&(r.format=i.format),void 0!==i.type&&(r.type=i.type),void 0!==i.encoding&&(r.encoding=i.encoding),void 0!==i.minFilter&&(r.minFilter=u(i.minFilter,ett)),void 0!==i.magFilter&&(r.magFilter=u(i.magFilter,ett)),void 0!==i.anisotropy&&(r.anisotropy=i.anisotropy),void 0!==i.flipY&&(r.flipY=i.flipY),void 0!==i.premultiplyAlpha&&(r.premultiplyAlpha=i.premultiplyAlpha),void 0!==i.unpackAlignment&&(r.unpackAlignment=i.unpackAlignment),e[i.uuid]=r;return e},parseObject:function(n,t,i){function h(n){return void 0===t[n]&&console.warn("THREE.ObjectLoader: Undefined geometry",n),t[n]}function s(n){var t;if(void 0!==n){if(Array.isArray(n)){for(var u=[],r=0,f=n.length;r<f;r++)t=n[r],void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),u.push(i[t]);return u}return void 0===i[n]&&console.warn("THREE.ObjectLoader: Undefined material",n),i[n]}}var r,f,o,l;switch(n.type){case"Scene":r=new ih,void 0!==n.background&&Number.isInteger(n.background)&&(r.background=new e(n.background)),void 0!==n.fog&&("Fog"===n.fog.type?r.fog=new ea(n.fog.color,n.fog.near,n.fog.far):"FogExp2"===n.fog.type&&(r.fog=new fa(n.fog.color,n.fog.density)));break;case"PerspectiveCamera":r=new it(n.fov,n.aspect,n.near,n.far),void 0!==n.focus&&(r.focus=n.focus),void 0!==n.zoom&&(r.zoom=n.zoom),void 0!==n.filmGauge&&(r.filmGauge=n.filmGauge),void 0!==n.filmOffset&&(r.filmOffset=n.filmOffset),void 0!==n.view&&(r.view=Object.assign({},n.view));break;case"OrthographicCamera":r=new tl(n.left,n.right,n.top,n.bottom,n.near,n.far),void 0!==n.zoom&&(r.zoom=n.zoom),void 0!==n.view&&(r.view=Object.assign({},n.view));break;case"AmbientLight":r=new fv(n.color,n.intensity);break;case"DirectionalLight":r=new uv(n.color,n.intensity);break;case"PointLight":r=new iv(n.color,n.intensity,n.distance,n.decay);break;case"RectAreaLight":r=new ev(n.color,n.intensity,n.width,n.height);break;case"SpotLight":r=new tv(n.color,n.intensity,n.distance,n.angle,n.penumbra,n.decay);break;case"HemisphereLight":r=new ga(n.color,n.groundColor,n.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":r=h(n.geometry),f=s(n.material),r=r.bones&&0<r.bones.length?new wh(r,f):new tt(r,f);break;case"InstancedMesh":r=h(n.geometry),f=s(n.material),o=n.instanceMatrix,r=new ha(r,f,n.count),r.instanceMatrix=new c(new Float32Array(o.array),16);break;case"LOD":r=new ph;break;case"Line":r=new st(h(n.geometry),s(n.material),n.mode);break;case"LineLoop":r=new ca(h(n.geometry),s(n.material));break;case"LineSegments":r=new d(h(n.geometry),s(n.material));break;case"PointCloud":case"Points":r=new ge(h(n.geometry),s(n.material));break;case"Sprite":r=new yh(s(n.material));break;case"Group":r=new de;break;default:r=new u}if(r.uuid=n.uuid,void 0!==n.name&&(r.name=n.name),void 0!==n.matrix?(r.matrix.fromArray(n.matrix),void 0!==n.matrixAutoUpdate&&(r.matrixAutoUpdate=n.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==n.position&&r.position.fromArray(n.position),void 0!==n.rotation&&r.rotation.fromArray(n.rotation),void 0!==n.quaternion&&r.quaternion.fromArray(n.quaternion),void 0!==n.scale&&r.scale.fromArray(n.scale)),void 0!==n.castShadow&&(r.castShadow=n.castShadow),void 0!==n.receiveShadow&&(r.receiveShadow=n.receiveShadow),n.shadow&&(void 0!==n.shadow.bias&&(r.shadow.bias=n.shadow.bias),void 0!==n.shadow.radius&&(r.shadow.radius=n.shadow.radius),void 0!==n.shadow.mapSize&&r.shadow.mapSize.fromArray(n.shadow.mapSize),void 0!==n.shadow.camera&&(r.shadow.camera=this.parseObject(n.shadow.camera))),void 0!==n.visible&&(r.visible=n.visible),void 0!==n.frustumCulled&&(r.frustumCulled=n.frustumCulled),void 0!==n.renderOrder&&(r.renderOrder=n.renderOrder),void 0!==n.userData&&(r.userData=n.userData),void 0!==n.layers&&(r.layers.mask=n.layers),void 0!==n.drawMode&&r.setDrawMode(n.drawMode),void 0!==n.children)for(o=n.children,f=0;f<o.length;f++)r.add(this.parseObject(o[f],t,i));if("LOD"===n.type)for(n=n.levels,o=0;o<n.length;o++)f=n[o],l=r.getObjectByProperty("uuid",f.object),void 0!==l&&r.addLevel(l,f.distance);return r}});var wft={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},ftt={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},ett={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};rw.prototype=Object.assign(Object.create(w.prototype),{constructor:rw,setOptions:function(n){return this.options=n,this},load:function(n,t,i,r){void 0===n&&(n=""),void 0!==this.path&&(n=this.path+n),n=this.manager.resolveURL(n);var u=this,f=gu.get(n);if(void 0!==f)return u.manager.itemStart(n),setTimeout(function(){t&&t(f),u.manager.itemEnd(n)},0),f;fetch(n).then(function(n){return n.blob()}).then(function(n){return void 0===u.options?createImageBitmap(n):createImageBitmap(n,u.options)}).then(function(i){gu.add(n,i),t&&t(i),u.manager.itemEnd(n)}).catch(function(t){r&&r(t),u.manager.itemError(n),u.manager.itemEnd(n)}),u.manager.itemStart(n)}}),Object.assign(uw.prototype,{moveTo:function(n,t){return this.currentPath=new bi,this.subPaths.push(this.currentPath),this.currentPath.moveTo(n,t),this},lineTo:function(n,t){return this.currentPath.lineTo(n,t),this},quadraticCurveTo:function(n,t,i,r){return this.currentPath.quadraticCurveTo(n,t,i,r),this},bezierCurveTo:function(n,t,i,r,u,f){return this.currentPath.bezierCurveTo(n,t,i,r,u,f),this},splineThru:function(n){return this.currentPath.splineThru(n),this},toShapes:function(n,t){function v(n){for(var u,i,r=[],t=0,f=n.length;t<f;t++)u=n[t],i=new yu,i.curves=u.curves,r.push(i);return r}function p(n,t){for(var h=t.length,o=!1,r=h-1,e=0;e<h;r=e++){var i=t[r],u=t[e],s=u.x-i.x,f=u.y-i.y;if(Math.abs(f)>Number.EPSILON){if(0>f&&(i=t[e],s=-s,u=t[r],f=-f),!(n.y<i.y||n.y>u.y))if(n.y===i.y){if(n.x===i.x)return!0}else{if(r=f*(n.x-i.x)-s*(n.y-i.y),0===r)return!0;0>r||(o=!o)}}else if(n.y===i.y&&(u.x<=n.x&&n.x<=i.x||i.x<=n.x&&n.x<=u.x))return!0}return o}var r=vr.isClockWise,i=this.subPaths,o,s,c,e,y,h,l;if(0===i.length)return[];if(!0===t)return v(i);if(t=[],1===i.length)return o=i[0],s=new yu,s.curves=o.curves,t.push(s),t;c=!r(i[0].getPoints()),c=n?!c:c,s=[];var f=[],a=[],u=0;for(f[u]=void 0,a[u]=[],e=0,y=i.length;e<y;e++)o=i[e],h=o.getPoints(),l=r(h),(l=n?!l:l)?(!c&&f[u]&&u++,f[u]={s:new yu,p:h},f[u].s.curves=o.curves,c&&u++,a[u]=[]):a[u].push({h:o,p:h[0]});if(!f[0])return v(i);if(1<f.length){for(e=!1,n=[],r=0,i=f.length;r<i;r++)s[r]=[];for(r=0,i=f.length;r<i;r++)for(o=a[r],l=0;l<o.length;l++){for(c=o[l],u=!0,h=0;h<f.length;h++)p(c.p,f[h].p)&&(r!==h&&n.push({froms:r,tos:h,hole:l}),u?(u=!1,s[h].push(c)):e=!0);u&&s[r].push(c)}0<n.length&&(e||(a=s))}for(e=0,r=f.length;e<r;e++)for(s=f[e].s,t.push(s),n=a[e],i=0,o=n.length;i<o;i++)s.holes.push(n[i].h);return t}}),Object.assign(fw.prototype,{isFont:!0,generateShapes:function(n,t){var v,a,l,g,i,f,u,tt,h,c;void 0===t&&(t=100),v=[],a=t,t=this.data,l=Array.from?Array.from(n):String(n).split(""),a/=t.resolution,g=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*a,n=[];for(var y=0,nt=0,p=0;p<l.length;p++)if(i=l[p],"\n"===i)y=0,nt-=g;else{f=i,i=a;var e=y,o=nt,r=t,s=r.glyphs[f]||r.glyphs["?"];if(s){if(f=new uw,s.o)for(r=s._cachedOutline||(s._cachedOutline=s.o.split(" ")),u=0,tt=r.length;u<tt;)switch(r[u++]){case"m":h=r[u++]*i+e,c=r[u++]*i+o,f.moveTo(h,c);break;case"l":h=r[u++]*i+e,c=r[u++]*i+o,f.lineTo(h,c);break;case"q":var w=r[u++]*i+e,b=r[u++]*i+o,k=r[u++]*i+e,d=r[u++]*i+o;f.quadraticCurveTo(k,d,w,b);break;case"b":w=r[u++]*i+e,b=r[u++]*i+o,k=r[u++]*i+e,d=r[u++]*i+o,h=r[u++]*i+e,c=r[u++]*i+o,f.bezierCurveTo(k,d,h,c,w,b)}i={offsetX:s.ha*i,path:f}}else console.error('THREE.Font: character "'+f+'" does not exists in font family '+r.familyName+"."),i=void 0;y+=i.offsetX,n.push(i.path)}for(t=0,l=n.length;t<l;t++)Array.prototype.push.apply(v,n[t].toShapes());return v}}),ew.prototype=Object.assign(Object.create(w.prototype),{constructor:ew,load:function(n,t,i,r){var f=this,u=new oi(this.manager);u.setPath(this.path),u.load(n,function(n){try{var i=JSON.parse(n)}catch(r){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(n.substring(65,n.length-2))}n=f.parse(i),t&&t(n)},i,r)},parse:function(n){return new fw(n)}}),dy={getContext:function(){return void 0===ky&&(ky=new(window.AudioContext||window.webkitAudioContext)),ky},setContext:function(n){ky=n}},av.prototype=Object.assign(Object.create(w.prototype),{constructor:av,load:function(n,t,i,r){var u=new oi(this.manager);u.setResponseType("arraybuffer"),u.setPath(this.path),u.load(n,function(n){n=n.slice(0),dy.getContext().decodeAudioData(n,function(n){t(n)})},i,r)}}),Object.assign(vv.prototype,{isSphericalHarmonics3:!0,set:function(n){for(var t=0;9>t;t++)this.coefficients[t].copy(n[t]);return this},zero:function(){for(var n=0;9>n;n++)this.coefficients[n].set(0,0,0);return this},getAt:function(n,t){var r=n.x,u=n.y,i;return n=n.z,i=this.coefficients,t.copy(i[0]).multiplyScalar(.282095),t.addScale(i[1],.488603*u),t.addScale(i[2],.488603*n),t.addScale(i[3],.488603*r),t.addScale(i[4],1.092548*r*u),t.addScale(i[5],1.092548*u*n),t.addScale(i[6],.315392*(3*n*n-1)),t.addScale(i[7],1.092548*r*n),t.addScale(i[8],.546274*(r*r-u*u)),t},getIrradianceAt:function(n,t){var r=n.x,u=n.y,i;return n=n.z,i=this.coefficients,t.copy(i[0]).multiplyScalar(.886227),t.addScale(i[1],1.023328*u),t.addScale(i[2],1.023328*n),t.addScale(i[3],1.023328*r),t.addScale(i[4],.858086*r*u),t.addScale(i[5],.858086*u*n),t.addScale(i[6],.743125*n*n-.247708),t.addScale(i[7],.858086*r*n),t.addScale(i[8],.429043*(r*r-u*u)),t},add:function(n){for(var t=0;9>t;t++)this.coefficients[t].add(n.coefficients[t]);return this},scale:function(n){for(var t=0;9>t;t++)this.coefficients[t].multiplyScalar(n);return this},lerp:function(n,t){for(var i=0;9>i;i++)this.coefficients[i].lerp(n.coefficients[i],t);return this},equals:function(n){for(var t=0;9>t;t++)if(!this.coefficients[t].equals(n.coefficients[t]))return!1;return!0},copy:function(n){return this.set(n.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(n,t){void 0===t&&(t=0);for(var r=this.coefficients,i=0;9>i;i++)r[i].fromArray(n,t+3*i);return this},toArray:function(n,t){void 0===n&&(n=[]),void 0===t&&(t=0);for(var r=this.coefficients,i=0;9>i;i++)r[i].toArray(n,t+3*i);return n}}),Object.assign(vv,{getBasisAt:function(n,t){var i=n.x,r=n.y;n=n.z,t[0]=.282095,t[1]=.488603*r,t[2]=.488603*n,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*n,t[6]=.315392*(3*n*n-1),t[7]=1.092548*i*n,t[8]=.546274*(i*i-r*r)}}),ki.prototype=Object.assign(Object.create(g.prototype),{constructor:ki,isLightProbe:!0,copy:function(n){return g.prototype.copy.call(this,n),this.sh.copy(n.sh),this.intensity=n.intensity,this},toJSON:function(n){return g.prototype.toJSON.call(this,n)}}),ow.prototype=Object.assign(Object.create(ki.prototype),{constructor:ow,isHemisphereLightProbe:!0,copy:function(n){return ki.prototype.copy.call(this,n),this},toJSON:function(n){return ki.prototype.toJSON.call(this,n)}}),sw.prototype=Object.assign(Object.create(ki.prototype),{constructor:sw,isAmbientLightProbe:!0,copy:function(n){return ki.prototype.copy.call(this,n),this},toJSON:function(n){return ki.prototype.toJSON.call(this,n)}}),sk=new v,hk=new v,Object.assign(rg.prototype,{update:function(n){var t=this._cache,r;if(t.focus!==n.focus||t.fov!==n.fov||t.aspect!==n.aspect*this.aspect||t.near!==n.near||t.far!==n.far||t.zoom!==n.zoom||t.eyeSep!==this.eyeSep){t.focus=n.focus,t.fov=n.fov,t.aspect=n.aspect*this.aspect,t.near=n.near,t.far=n.far,t.zoom=n.zoom,t.eyeSep=this.eyeSep;var u=n.projectionMatrix.clone(),i=t.eyeSep/2,f=i*t.near/t.focus,e=t.near*Math.tan(a.DEG2RAD*t.fov*.5)/t.zoom;hk.elements[12]=-i,sk.elements[12]=i,i=-e*t.aspect+f,r=e*t.aspect+f,u.elements[0]=2*t.near/(r-i),u.elements[8]=(r+i)/(r-i),this.cameraL.projectionMatrix.copy(u),i=-e*t.aspect-f,r=e*t.aspect-f,u.elements[0]=2*t.near/(r-i),u.elements[8]=(r+i)/(r-i),this.cameraR.projectionMatrix.copy(u)}this.cameraL.matrixWorld.copy(n.matrixWorld).multiply(hk),this.cameraR.matrixWorld.copy(n.matrixWorld).multiply(sk)}}),Object.assign(hw.prototype,{start:function(){this.oldTime=this.startTime=("undefined"==typeof performance?Date:performance).now(),this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.autoStart=this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var n=0,t;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(t=("undefined"==typeof performance?Date:performance).now(),n=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=n),n)}});var ce=new t,ott=new lt,bft=new t,le=new t;cw.prototype=Object.assign(Object.create(u.prototype),{constructor:cw,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(n){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=n,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(n){return this.gain.gain.setTargetAtTime(n,this.context.currentTime,.01),this},updateMatrixWorld:function(n){var i,t;u.prototype.updateMatrixWorld.call(this,n),n=this.context.listener,i=this.up,this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ce,ott,bft),le.set(0,0,-1).applyQuaternion(ott),n.positionX?(t=this.context.currentTime+this.timeDelta,n.positionX.linearRampToValueAtTime(ce.x,t),n.positionY.linearRampToValueAtTime(ce.y,t),n.positionZ.linearRampToValueAtTime(ce.z,t),n.forwardX.linearRampToValueAtTime(le.x,t),n.forwardY.linearRampToValueAtTime(le.y,t),n.forwardZ.linearRampToValueAtTime(le.z,t),n.upX.linearRampToValueAtTime(i.x,t),n.upY.linearRampToValueAtTime(i.y,t),n.upZ.linearRampToValueAtTime(i.z,t)):(n.setPosition(ce.x,ce.y,ce.z),n.setOrientation(le.x,le.y,le.z,i.x,i.y,i.z))}}),go.prototype=Object.assign(Object.create(u.prototype),{constructor:go,getOutput:function(){return this.gain},setNodeSource:function(n){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=n,this.connect(),this},setMediaElementSource:function(n){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(n),this.connect(),this},setMediaStreamSource:function(n){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(n),this.connect(),this},setBuffer:function(n){return this.buffer=n,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(n){if(void 0===n&&(n=0),!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 return this._startedAt=this.context.currentTime+n,n=this.context.createBufferSource(),n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()},pause:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this},stop:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var n=1,t=this.filters.length;n<t;n++)this.filters[n-1].connect(this.filters[n]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var n=1,t=this.filters.length;n<t;n++)this.filters[n-1].disconnect(this.filters[n]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(n){return n||(n=[]),!0===this.isPlaying?(this.disconnect(),this.filters=n,this.connect()):this.filters=n,this},setDetune:function(n){return this.detune=n,void 0!==this.source.detune?(!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this):void 0},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(n){return this.setFilters(n?[n]:[])},setPlaybackRate:function(n){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.playbackRate=n,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(n){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.loop=n,!0===this.isPlaying&&(this.source.loop=this.loop),this},setLoopStart:function(n){return this.loopStart=n,this},setLoopEnd:function(n){return this.loopEnd=n,this},getVolume:function(){return this.gain.gain.value},setVolume:function(n){return this.gain.gain.setTargetAtTime(n,this.context.currentTime,.01),this}});var ae=new t,stt=new lt,kft=new t,ve=new t;lw.prototype=Object.assign(Object.create(go.prototype),{constructor:lw,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(n){return this.panner.refDistance=n,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(n){return this.panner.rolloffFactor=n,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(n){return this.panner.distanceModel=n,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(n){return this.panner.maxDistance=n,this},setDirectionalCone:function(n,t,i){return this.panner.coneInnerAngle=n,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this},updateMatrixWorld:function(n){if(u.prototype.updateMatrixWorld.call(this,n),!0!==this.hasPlaybackControl||!1!==this.isPlaying)if(this.matrixWorld.decompose(ae,stt,kft),ve.set(0,0,1).applyQuaternion(stt),n=this.panner,n.positionX){var t=this.context.currentTime+this.listener.timeDelta;n.positionX.linearRampToValueAtTime(ae.x,t),n.positionY.linearRampToValueAtTime(ae.y,t),n.positionZ.linearRampToValueAtTime(ae.z,t),n.orientationX.linearRampToValueAtTime(ve.x,t),n.orientationY.linearRampToValueAtTime(ve.y,t),n.orientationZ.linearRampToValueAtTime(ve.z,t)}else n.setPosition(ae.x,ae.y,ae.z),n.setOrientation(ve.x,ve.y,ve.z)}}),Object.assign(aw.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var i=0,n=this.getFrequencyData(),t=0;t<n.length;t++)i+=n[t];return i/n.length}}),Object.assign(vw.prototype,{accumulate:function(n,t){var u=this.buffer,r=this.valueSize,i;if(n=n*r+r,i=this.cumulativeWeight,0===i){for(i=0;i!==r;++i)u[n+i]=u[i];i=t}else i+=t,this._mixBufferRegion(u,n,0,t/i,r);this.cumulativeWeight=i},apply:function(n){var t=this.valueSize,r=this.buffer,i,u,f;for(n=n*t+t,i=this.cumulativeWeight,u=this.binding,this.cumulativeWeight=0,1>i&&this._mixBufferRegion(r,n,3*t,1-i,t),i=t,f=t+t;i!==f;++i)if(r[i]!==r[i+t]){u.setValue(r,n);break}},saveOriginalState:function(){var t=this.buffer,i=this.valueSize,r=3*i,n;for(this.binding.getValue(t,r),n=i;n!==r;++n)t[n]=t[r+n%i];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(n,t,i,r,u){if(.5<=r)for(r=0;r!==u;++r)n[t+r]=n[i+r]},_slerp:function(n,t,i,r){lt.slerpFlat(n,t,n,t,n,i,r)},_lerp:function(n,t,i,r,u){for(var e,o=1-r,f=0;f!==u;++f)e=t+f,n[e]=n[e]*o+n[i+f]*r}});var dft=/[\[\]\.:\/]/g,gft="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",net=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),tet=/(WCOD+)?/.source.replace("WCOD",gft),iet=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),ret=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),uet=new RegExp("^"+net+tet+iet+ret+"$"),fet=["material","materials","bones"];Object.assign(ug.prototype,{getValue:function(n,t){this.bind();var i=this._bindings[this._targetGroup.nCachedObjects_];void 0!==i&&i.getValue(n,t)},setValue:function(n,t){for(var r=this._bindings,i=this._targetGroup.nCachedObjects_,u=r.length;i!==u;++i)r[i].setValue(n,t)},bind:function(){for(var t=this._bindings,n=this._targetGroup.nCachedObjects_,i=t.length;n!==i;++n)t[n].bind()},unbind:function(){for(var t=this._bindings,n=this._targetGroup.nCachedObjects_,i=t.length;n!==i;++n)t[n].unbind()}}),Object.assign(yt,{Composite:ug,create:function(n,t,i){return n&&n.isAnimationObjectGroup?new yt.Composite(n,t,i):new yt(n,t,i)},sanitizeNodeName:function(n){return n.replace(/\s/g,"_").replace(dft,"")},parseTrackName:function(n){var t=uet.exec(n),i,r;if(!t)throw Error("PropertyBinding: Cannot parse trackName: "+n);if(t={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=t.nodeName&&t.nodeName.lastIndexOf("."),void 0!==i&&-1!==i&&(r=t.nodeName.substring(i+1),-1!==fet.indexOf(r)&&(t.nodeName=t.nodeName.substring(0,i),t.objectName=r)),null===t.propertyName||0===t.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+n);return t},findNode:function(n,t){var i,r;return!t||""===t||"root"===t||"."===t||-1===t||t===n.name||t===n.uuid?n:n.skeleton&&(i=n.skeleton.getBoneByName(t),void 0!==i)?i:n.children&&(r=function(n){for(var i,u=0;u<n.length;u++)if(i=n[u],i.name===t||i.uuid===t||(i=r(i.children)))return i;return null},n=r(n.children))?n:null}}),Object.assign(yt.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(n,t){n[t]=this.node[this.propertyName]},function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)n[t++]=r[i]},function(n,t){n[t]=this.resolvedProperty[this.propertyIndex]},function(n,t){this.resolvedProperty.toArray(n,t)}],SetterByBindingTypeAndVersioning:[[function(n,t){this.targetObject[this.propertyName]=n[t]},function(n,t){this.targetObject[this.propertyName]=n[t],this.targetObject.needsUpdate=!0},function(n,t){this.targetObject[this.propertyName]=n[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)r[i]=n[t++]},function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)r[i]=n[t++];this.targetObject.needsUpdate=!0},function(n,t){for(var r=this.resolvedProperty,i=0,u=r.length;i!==u;++i)r[i]=n[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(n,t){this.resolvedProperty[this.propertyIndex]=n[t]},function(n,t){this.resolvedProperty[this.propertyIndex]=n[t],this.targetObject.needsUpdate=!0},function(n,t){this.resolvedProperty[this.propertyIndex]=n[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(n,t){this.resolvedProperty.fromArray(n,t)},function(n,t){this.resolvedProperty.fromArray(n,t),this.targetObject.needsUpdate=!0},function(n,t){this.resolvedProperty.fromArray(n,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(n,t){this.bind(),this.getValue(n,t)},setValue:function(n,t){this.bind(),this.setValue(n,t)},bind:function(){var n=this.node,r=this.parsedPath,t=r.objectName,f=r.propertyName,u=r.propertyIndex,i;if(n||(this.node=n=yt.findNode(this.rootNode,r.nodeName)||this.rootNode),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,n){if(t){i=r.objectIndex;switch(t){case"materials":if(!n.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!n.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}n=n.material.materials;break;case"bones":if(!n.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}for(n=n.skeleton.bones,t=0;t<n.length;t++)if(n[t].name===i){i=t;break}break;default:if(void 0===n[t]){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}n=n[t]}if(void 0!==i){if(void 0===n[i]){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,n);return}n=n[i]}}if(i=n[f],void 0===i)console.error("THREE.PropertyBinding: Trying to update property for track: "+r.nodeName+"."+f+" but it wasn't found.",n);else{if(r=this.Versioning.None,this.targetObject=n,void 0!==n.needsUpdate?r=this.Versioning.NeedsUpdate:void 0!==n.matrixWorldNeedsUpdate&&(r=this.Versioning.MatrixWorldNeedsUpdate),t=this.BindingType.Direct,void 0!==u){if("morphTargetInfluences"===f){if(!n.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(n.geometry.isBufferGeometry){if(!n.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}for(t=0;t<this.node.geometry.morphAttributes.position.length;t++)if(n.geometry.morphAttributes.position[t].name===u){u=t;break}}else{if(!n.geometry.morphTargets){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);return}for(t=0;t<this.node.geometry.morphTargets.length;t++)if(n.geometry.morphTargets[t].name===u){u=t;break}}}t=this.BindingType.ArrayElement,this.resolvedProperty=i,this.propertyIndex=u}else void 0!==i.fromArray&&void 0!==i.toArray?(t=this.BindingType.HasFromToArray,this.resolvedProperty=i):Array.isArray(i)?(t=this.BindingType.EntireArray,this.resolvedProperty=i):this.propertyName=f;this.getValue=this.GetterByBindingType[t],this.setValue=this.SetterByBindingTypeAndVersioning[t][r]}}else console.error("THREE.PropertyBinding: 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(yt.prototype,{_getValue_unbound:yt.prototype.getValue,_setValue_unbound:yt.prototype.setValue}),Object.assign(fg.prototype,{isAnimationObjectGroup:!0,add:function(){for(var r,u,e,s,i=this._objects,w=i.length,h=this.nCachedObjects_,o=this._indicesByUUID,a=this._paths,v=this._parsedPaths,c=this._bindings,y=c.length,p=void 0,l=0,b=arguments.length;l!==b;++l){var f=arguments[l],n=f.uuid,t=o[n];if(void 0===t)for(t=w++,o[n]=t,i.push(f),n=0,r=y;n!==r;++n)c[n].push(new yt(f,a[n],v[n]));else if(t<h)for(p=i[t],u=--h,r=i[u],o[r.uuid]=t,i[t]=r,o[n]=u,i[u]=f,n=0,r=y;n!==r;++n)e=c[n],s=e[t],e[t]=e[u],void 0===s&&(s=new yt(f,a[n],v[n])),e[u]=s;else i[t]!==p&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h},remove:function(){for(var r,n,c,f=this._objects,e=this.nCachedObjects_,o=this._indicesByUUID,h=this._bindings,l=h.length,s=0,a=arguments.length;s!==a;++s){var t=arguments[s],u=t.uuid,i=o[u];if(void 0!==i&&i>=e)for(r=e++,n=f[r],o[n.uuid]=i,f[i]=n,o[u]=r,f[r]=t,t=0,u=l;t!==u;++t)n=h[t],c=n[i],n[i]=n[r],n[r]=c}this.nCachedObjects_=e},uncache:function(){for(var r,u,t,v,i=this._objects,l=i.length,s=this.nCachedObjects_,e=this._indicesByUUID,h=this._bindings,a=h.length,c=0,y=arguments.length;c!==y;++c)if(r=arguments[c].uuid,u=e[r],void 0!==u)if(delete e[r],u<s){r=--s;var n=i[r],o=--l,f=i[o];for(e[n.uuid]=u,i[u]=n,e[f.uuid]=r,i[r]=f,i.pop(),n=0,f=a;n!==f;++n)t=h[n],v=t[o],t[u]=t[r],t[r]=v,t.pop()}else for(o=--l,f=i[o],e[f.uuid]=u,i[u]=f,i.pop(),n=0,f=a;n!==f;++n)t=h[n],t[u]=t[o],t.pop();this.nCachedObjects_=s},subscribe_:function(n,t){var i=this._bindingsIndicesByPath,r=i[n],u=this._bindings;if(void 0!==r)return u[r];var o=this._paths,s=this._parsedPaths,f=this._objects,h=this.nCachedObjects_,e=Array(f.length);for(r=u.length,i[n]=r,o.push(n),s.push(t),u.push(e),i=h,r=f.length;i!==r;++i)e[i]=new yt(f[i],n,t);return e},unsubscribe_:function(n){var e=this._bindingsIndicesByPath,t=e[n];if(void 0!==t){var u=this._paths,f=this._parsedPaths,i=this._bindings,r=i.length-1,o=i[r];e[n[r]]=t,i[t]=o,i.pop(),f[t]=f[r],f.pop(),u[t]=u[r],u.pop()}}}),Object.assign(eg.prototype,{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(n){return this._startTime=n,this},setLoop:function(n,t){return this.loop=n,this.repetitions=t,this},setEffectiveWeight:function(n){return this.weight=n,this._effectiveWeight=this.enabled?n:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(n){return this._scheduleFading(n,0,1)},fadeOut:function(n){return this._scheduleFading(n,1,0)},crossFadeFrom:function(n,t,i){if(n.fadeOut(t),this.fadeIn(t),i){i=this._clip.duration;var r=n._clip.duration,u=i/r;n.warp(1,r/i,t),this.warp(u,1,t)}return this},crossFadeTo:function(n,t,i){return n.crossFadeFrom(this,t,i)},stopFading:function(){var n=this._weightInterpolant;return null!==n&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(n)),this},setEffectiveTimeScale:function(n){return this.timeScale=n,this._effectiveTimeScale=this.paused?0:n,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(n){return this.timeScale=this._clip.duration/n,this.stopWarping()},syncWith:function(n){return this.time=n.time,this.timeScale=n.timeScale,this.stopWarping()},halt:function(n){return this.warp(this._effectiveTimeScale,0,n)},warp:function(n,t,i){var u=this._mixer,f=u.time,r=this._timeScaleInterpolant,e=this.timeScale;return null===r&&(this._timeScaleInterpolant=r=u._lendControlInterpolant()),u=r.parameterPositions,r=r.sampleValues,u[0]=f,u[1]=f+i,r[0]=n/e,r[1]=t/e,this},stopWarping:function(){var n=this._timeScaleInterpolant;return null!==n&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(n)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(n,t,i,r){var u,f,e;if(this.enabled){if(u=this._startTime,null!==u){if(t=(n-u)*i,0>t||0===i)return;this._startTime=null,t*=i}if(t*=this._updateTimeScale(n),i=this._updateTime(t),n=this._updateWeight(n),0<n)for(t=this._interpolants,u=this._propertyBindings,f=0,e=t.length;f!==e;++f)t[f].evaluate(i),u[f].accumulate(r,n)}else this._updateWeight(n)},_updateWeight:function(n){var i=0,t,r;return this.enabled&&(i=this.weight,t=this._weightInterpolant,null!==t&&(r=t.evaluate(n)[0],i*=r,n>t.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1)))),this._effectiveWeight=i},_updateTimeScale:function(n){var t=0,i,r;return this.paused||(t=this.timeScale,i=this._timeScaleInterpolant,null!==i&&(r=i.evaluate(n)[0],t*=r,n>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))),this._effectiveTimeScale=t},_updateTime:function(n){var t=this.time+n,r=this._clip.duration,u=this.loop,i=this._loopCount,f=2202===u,e;if(0===n)return-1===i?t:f&&1==(i&1)?r-t:t;if(2200===u)n:{if(-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1)),t>=r)t=r;else if(0>t)t=0;else{this.time=t;break n}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:0>n?-1:1})}else if(-1===i&&(0<=n?(i=0,this._setEndings(!0,0===this.repetitions,f)):this._setEndings(0===this.repetitions,!0,f)),t>=r||0>t?(u=Math.floor(t/r),t-=r*u,i+=Math.abs(u),e=this.repetitions-i,0>=e?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t=0<n?r:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<n?1:-1})):(1===e?(n=0>n,this._setEndings(n,!n,f)):this._setEndings(!1,!1,f),this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:u}))):this.time=t,f&&1==(i&1))return r-t;return t},_setEndings:function(n,t,i){var r=this._interpolantSettings;i?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=n?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(n,t,i){var u=this._mixer,f=u.time,r=this._weightInterpolant;return null===r&&(this._weightInterpolant=r=u._lendControlInterpolant()),u=r.parameterPositions,r=r.sampleValues,u[0]=f,r[0]=t,u[1]=f+n,r[1]=i,this}}),yw.prototype=Object.assign(Object.create(hi.prototype),{constructor:yw,_bindAction:function(n,t){var s=n._localRoot||this._root,h=n._clip.tracks,l=h.length,c=n._propertyBindings;n=n._interpolants;var u=s.uuid,r=this._bindingsByRootAndName,f=r[u];for(void 0===f&&(f={},r[u]=f),r=0;r!==l;++r){var o=h[r],e=o.name,i=f[e];if(void 0===i){if(i=c[r],void 0!==i){null===i._cacheIndex&&(++i.referenceCount,this._addInactiveBinding(i,u,e));continue}i=new vw(yt.create(s,e,t&&t._propertyBindings[r].binding.parsedPath),o.ValueTypeName,o.getValueSize()),++i.referenceCount,this._addInactiveBinding(i,u,e)}c[r]=i,n[r].resultBuffer=i.buffer}},_activateAction:function(n){var u;if(!this._isActiveAction(n)){if(null===n._cacheIndex){var i=(n._localRoot||this._root).uuid,t=n._clip.uuid,r=this._actionsByClip[t];this._bindAction(n,r&&r.knownActions[0]),this._addInactiveAction(n,t,i)}for(i=n._propertyBindings,t=0,r=i.length;t!==r;++t)u=i[t],0==u.useCount++&&(this._lendBinding(u),u.saveOriginalState());this._lendAction(n)}},_deactivateAction:function(n){var t;if(this._isActiveAction(n)){for(var r=n._propertyBindings,i=0,u=r.length;i!==u;++i)t=r[i],0==--t.useCount&&(t.restoreOriginalState(),this._takeBackBinding(t));this._takeBackAction(n)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var n=this;this.stats={actions:{get total(){return n._actions.length},get inUse(){return n._nActiveActions}},bindings:{get total(){return n._bindings.length},get inUse(){return n._nActiveBindings}},controlInterpolants:{get total(){return n._controlInterpolants.length},get inUse(){return n._nActiveControlInterpolants}}}},_isActiveAction:function(n){return n=n._cacheIndex,null!==n&&n<this._nActiveActions},_addInactiveAction:function(n,t,i){var u=this._actions,f=this._actionsByClip,r=f[t];void 0===r?(r={knownActions:[n],actionByRoot:{}},n._byClipCacheIndex=0,f[t]=r):(t=r.knownActions,n._byClipCacheIndex=t.length,t.push(n)),n._cacheIndex=u.length,u.push(n),r.actionByRoot[i]=n},_removeInactiveAction:function(n){var t=this._actions,i=t[t.length-1],r=n._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),n._cacheIndex=null,t=n._clip.uuid,i=this._actionsByClip,r=i[t];var u=r.knownActions,f=u[u.length-1],e=n._byClipCacheIndex;f._byClipCacheIndex=e,u[e]=f,u.pop(),n._byClipCacheIndex=null,delete r.actionByRoot[(n._localRoot||this._root).uuid],0===u.length&&delete i[t],this._removeInactiveBindingsForAction(n)},_removeInactiveBindingsForAction:function(n){var t,r,i;for(n=n._propertyBindings,t=0,r=n.length;t!==r;++t)i=n[t],0==--i.referenceCount&&this._removeInactiveBinding(i)},_lendAction:function(n){var t=this._actions,r=n._cacheIndex,i=this._nActiveActions++,u=t[i];n._cacheIndex=i,t[i]=n,u._cacheIndex=r,t[r]=u},_takeBackAction:function(n){var t=this._actions,r=n._cacheIndex,i=--this._nActiveActions,u=t[i];n._cacheIndex=i,t[i]=n,u._cacheIndex=r,t[r]=u},_addInactiveBinding:function(n,t,i){var u=this._bindingsByRootAndName,r=u[t],f=this._bindings;void 0===r&&(r={},u[t]=r),r[i]=n,n._cacheIndex=f.length,f.push(n)},_removeInactiveBinding:function(n){var t=this._bindings,i=n.binding,r=i.rootNode.uuid;i=i.path;var u=this._bindingsByRootAndName,f=u[r],e=t[t.length-1];n=n._cacheIndex,e._cacheIndex=n,t[n]=e,t.pop(),delete f[i],0===Object.keys(f).length&&delete u[r]},_lendBinding:function(n){var t=this._bindings,r=n._cacheIndex,i=this._nActiveBindings++,u=t[i];n._cacheIndex=i,t[i]=n,u._cacheIndex=r,t[r]=u},_takeBackBinding:function(n){var t=this._bindings,r=n._cacheIndex,i=--this._nActiveBindings,u=t[i];n._cacheIndex=i,t[i]=n,u._cacheIndex=r,t[r]=u},_lendControlInterpolant:function(){var i=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=i[t];return void 0===n&&(n=new kc(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,i[t]=n),n},_takeBackControlInterpolant:function(n){var t=this._controlInterpolants,r=n.__cacheIndex,i=--this._nActiveControlInterpolants,u=t[i];n.__cacheIndex=i,t[i]=n,u.__cacheIndex=r,t[r]=u},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(n,t){var i=t||this._root,f=i.uuid,u,r;if(i="string"==typeof n?ei.findByName(i,n):n,n=null!==i?i.uuid:n,u=this._actionsByClip[n],r=null,void 0!==u){if(r=u.actionByRoot[f],void 0!==r)return r;r=u.knownActions[0],null===i&&(i=r._clip)}return null===i?null:(t=new eg(this,i,t),this._bindAction(t,r),this._addInactiveAction(t,n,f),t)},existingAction:function(n,t){var i=t||this._root;return t=i.uuid,i="string"==typeof n?ei.findByName(i,n):n,n=this._actionsByClip[i?i.uuid:n],void 0!==n?n.actionByRoot[t]||null:null},stopAllAction:function(){for(var t=this._actions,i=this._nActiveActions,r=this._bindings,u=this._nActiveBindings,n=this._nActiveBindings=this._nActiveActions=0;n!==i;++n)t[n].reset();for(n=0;n!==u;++n)r[n].useCount=0;return this},update:function(n){n*=this.timeScale;for(var i=this._actions,u=this._nActiveActions,f=this.time+=n,e=Math.sign(n),r=this._accuIndex^=1,t=0;t!==u;++t)i[t]._update(f,n,e,r);for(n=this._bindings,i=this._nActiveBindings,t=0;t!==i;++t)n[t].apply(r);return this},setTime:function(n){for(var t=this.time=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(n)},getRoot:function(){return this._root},uncacheClip:function(n){var r=this._actions,f,t,u,s,i,e,o;if(n=n.uuid,f=this._actionsByClip,t=f[n],void 0!==t){for(t=t.knownActions,u=0,s=t.length;u!==s;++u)i=t[u],this._deactivateAction(i),e=i._cacheIndex,o=r[r.length-1],i._cacheIndex=null,i._byClipCacheIndex=null,o._cacheIndex=e,r[e]=o,r.pop(),this._removeInactiveBindingsForAction(i);delete f[n]}},uncacheRoot:function(n){var r,i,t,u;n=n.uuid,r=this._actionsByClip;for(t in r)i=r[t].actionByRoot[n],void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i));if(t=this._bindingsByRootAndName[n],void 0!==t)for(u in t)n=t[u],n.restoreOriginalState(),this._removeInactiveBinding(n)},uncacheAction:function(n,t){n=this.existingAction(n,t),null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),yv.prototype.clone=function(){return new yv(void 0===this.value.clone?this.value:this.value.clone())},pw.prototype=Object.assign(Object.create(br.prototype),{constructor:pw,isInstancedInterleavedBuffer:!0,copy:function(n){return br.prototype.copy.call(this,n),this.meshPerAttribute=n.meshPerAttribute,this}}),Object.assign(og.prototype,{linePrecision:1,set:function(n,t){this.ray.set(n,t)},setFromCamera:function(n,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(n.x,n.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(n.x,n.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(n,t,i){return i=i||[],ww(n,this,i,t),i.sort(sg),i},intersectObjects:function(n,t,i){if(i=i||[],!1===Array.isArray(n))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,u=n.length;r<u;r++)ww(n[r],this,i,t);return i.sort(sg),i}}),Object.assign(hg.prototype,{set:function(n,t,i){return this.radius=n,this.phi=t,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.radius=n.radius,this.phi=n.phi,this.theta=n.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(n){return this.setFromCartesianCoords(n.x,n.y,n.z)},setFromCartesianCoords:function(n,t,i){return this.radius=Math.sqrt(n*n+t*t+i*i),0===this.radius?this.phi=this.theta=0:(this.theta=Math.atan2(n,i),this.phi=Math.acos(a.clamp(t/this.radius,-1,1))),this}}),Object.assign(cg.prototype,{set:function(n,t,i){return this.radius=n,this.theta=t,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.radius=n.radius,this.theta=n.theta,this.y=n.y,this},setFromVector3:function(n){return this.setFromCartesianCoords(n.x,n.y,n.z)},setFromCartesianCoords:function(n,t,i){return this.radius=Math.sqrt(n*n+i*i),this.theta=Math.atan2(n,i),this.y=t,this}}),ck=new i,Object.assign(bw.prototype,{set:function(n,t){return this.min.copy(n),this.max.copy(t),this},setFromPoints:function(n){this.makeEmpty();for(var t=0,i=n.length;t<i;t++)this.expandByPoint(n[t]);return this},setFromCenterAndSize:function(n,t){return t=ck.copy(t).multiplyScalar(.5),this.min.copy(n).sub(t),this.max.copy(n).add(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.min.copy(n.min),this.max.copy(n.max),this},makeEmpty:function(){return this.min.x=this.min.y=Infinity,this.max.x=this.max.y=-Infinity,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(n){return void 0===n&&(console.warn("THREE.Box2: .getCenter() target is now required"),n=new i),this.isEmpty()?n.set(0,0):n.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(n){return void 0===n&&(console.warn("THREE.Box2: .getSize() target is now required"),n=new i),this.isEmpty()?n.set(0,0):n.subVectors(this.max,this.min)},expandByPoint:function(n){return this.min.min(n),this.max.max(n),this},expandByVector:function(n){return this.min.sub(n),this.max.add(n),this},expandByScalar:function(n){return this.min.addScalar(-n),this.max.addScalar(n),this},containsPoint:function(n){return n.x<this.min.x||n.x>this.max.x||n.y<this.min.y||n.y>this.max.y?!1:!0},containsBox:function(n){return this.min.x<=n.min.x&&n.max.x<=this.max.x&&this.min.y<=n.min.y&&n.max.y<=this.max.y},getParameter:function(n,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new i),t.set((n.x-this.min.x)/(this.max.x-this.min.x),(n.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(n){return n.max.x<this.min.x||n.min.x>this.max.x||n.max.y<this.min.y||n.min.y>this.max.y?!1:!0},clampPoint:function(n,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new i),t.copy(n).clamp(this.min,this.max)},distanceToPoint:function(n){return ck.copy(n).clamp(this.min,this.max).sub(n).length()},intersect:function(n){return this.min.max(n.min),this.max.min(n.max),this},union:function(n){return this.min.min(n.min),this.max.max(n.max),this},translate:function(n){return this.min.add(n),this.max.add(n),this},equals:function(n){return n.min.equals(this.min)&&n.max.equals(this.max)}}),lk=new t,gl=new t,Object.assign(kw.prototype,{set:function(n,t){return this.start.copy(n),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(n){return this.start.copy(n.start),this.end.copy(n.end),this},getCenter:function(n){return void 0===n&&(console.warn("THREE.Line3: .getCenter() target is now required"),n=new t),n.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(n){return void 0===n&&(console.warn("THREE.Line3: .delta() target is now required"),n=new t),n.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(n,i){return void 0===i&&(console.warn("THREE.Line3: .at() target is now required"),i=new t),this.delta(i).multiplyScalar(n).add(this.start)},closestPointToPointParameter:function(n,t){return lk.subVectors(n,this.start),gl.subVectors(this.end,this.start),n=gl.dot(gl),n=gl.dot(lk)/n,t&&(n=a.clamp(n,0,1)),n},closestPointToPoint:function(n,i,r){return n=this.closestPointToPointParameter(n,i),void 0===r&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),r=new t),this.delta(r).multiplyScalar(n).add(this.start)},applyMatrix4:function(n){return this.start.applyMatrix4(n),this.end.applyMatrix4(n),this},equals:function(n){return n.start.equals(this.start)&&n.end.equals(this.end)}}),il.prototype=Object.create(u.prototype),il.prototype.constructor=il,il.prototype.isImmediateRenderObject=!0;var yr=new t,ou=new t,ak=new ft,eet=["a","b","c"];rl.prototype=Object.create(d.prototype),rl.prototype.constructor=rl,rl.prototype.update=function(){var h;this.object.updateMatrixWorld(!0),ak.getNormalMatrix(this.object.matrixWorld);var s=this.object.matrixWorld,u=this.geometry.attributes.position,n=this.object.geometry;if(n&&n.isGeometry)for(var i=n.vertices,r=n.faces,f=n=0,c=r.length;f<c;f++)for(var e=r[f],t=0,o=e.vertexNormals.length;t<o;t++)h=e.vertexNormals[t],yr.copy(i[e[eet[t]]]).applyMatrix4(s),ou.copy(h).applyMatrix3(ak).normalize().multiplyScalar(this.size).add(yr),u.setXYZ(n,yr.x,yr.y,yr.z),n+=1,u.setXYZ(n,ou.x,ou.y,ou.z),n+=1;else if(n&&n.isBufferGeometry)for(i=n.attributes.position,r=n.attributes.normal,t=n=0,o=i.count;t<o;t++)yr.set(i.getX(t),i.getY(t),i.getZ(t)).applyMatrix4(s),ou.set(r.getX(t),r.getY(t),r.getZ(t)),ou.applyMatrix3(ak).normalize().multiplyScalar(this.size).add(yr),u.setXYZ(n,yr.x,yr.y,yr.z),n+=1,u.setXYZ(n,ou.x,ou.y,ou.z),n+=1;u.needsUpdate=!0},vk=new t,ns.prototype=Object.create(u.prototype),ns.prototype.constructor=ns,ns.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},ns.prototype.update=function(){this.light.updateMatrixWorld();var n=this.light.distance?this.light.distance:1e3,t=n*Math.tan(this.light.angle);this.cone.scale.set(t,t,n),vk.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(vk),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var nf=new t,gy=new v,yk=new v;ts.prototype=Object.create(d.prototype),ts.prototype.constructor=ts,ts.prototype.updateMatrixWorld=function(n){var f=this.bones,e=this.geometry,o=e.getAttribute("position"),i,r,t;for(yk.getInverse(this.root.matrixWorld),i=0,r=0;i<f.length;i++)t=f[i],t.parent&&t.parent.isBone&&(gy.multiplyMatrices(yk,t.matrixWorld),nf.setFromMatrixPosition(gy),o.setXYZ(r,nf.x,nf.y,nf.z),gy.multiplyMatrices(yk,t.parent.matrixWorld),nf.setFromMatrixPosition(gy),o.setXYZ(r+1,nf.x,nf.y,nf.z),r+=2);e.getAttribute("position").needsUpdate=!0,u.prototype.updateMatrixWorld.call(this,n)},is.prototype=Object.create(tt.prototype),is.prototype.constructor=is,is.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},is.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},rs.prototype=Object.create(st.prototype),rs.prototype.constructor=rs,rs.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var n=this.material.color,t=Math.max(n.r,n.g,n.b);1<t&&n.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}},rs.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()};var oet=new t,htt=new e,ctt=new e;us.prototype=Object.create(u.prototype),us.prototype.constructor=us,us.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},us.prototype.update=function(){var u=this.children[0],t,n,r,i;if(void 0!==this.color)this.material.color.set(this.color);else{for(t=u.geometry.getAttribute("color"),htt.copy(this.light.color),ctt.copy(this.light.groundColor),n=0,r=t.count;n<r;n++)i=n<r/2?htt:ctt,t.setXYZ(n,i.r,i.g,i.b);t.needsUpdate=!0}u.lookAt(oet.setFromMatrixPosition(this.light.matrixWorld).negate())},fs.prototype=Object.create(tt.prototype),fs.prototype.constructor=fs,fs.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},fs.prototype.onBeforeRender=function(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity},pv.prototype=Object.assign(Object.create(d.prototype),{constructor:pv,copy:function(n){return d.prototype.copy.call(this,n),this.geometry.copy(n.geometry),this.material.copy(n.material),this},clone:function(){return(new this.constructor).copy(this)}}),wv.prototype=Object.create(d.prototype),wv.prototype.constructor=wv,es.prototype=Object.create(st.prototype),es.prototype.constructor=es,es.prototype.update=function(){function s(i,f,s,c){for(s=(f-i)/s,r.setXYZ(e,0,0,0),t++,n=i;n<f;n+=s)o=e+t,r.setXYZ(o,Math.sin(n)*u,0,Math.cos(n)*u),r.setXYZ(o+1,Math.sin(Math.min(n+s,f))*u,0,Math.cos(Math.min(n+s,f))*u),r.setXYZ(o+2,0,0,0),t+=3;h.addGroup(e,t,c),e+=t,t=0}var i=this.audio,u=this.range,y=this.divisionsInnerAngle,c=this.divisionsOuterAngle,l=a.degToRad(i.panner.coneInnerAngle);i=a.degToRad(i.panner.coneOuterAngle);var f=l/2,v=i/2,e=0,t=0,n,o,h=this.geometry,r=h.attributes.position;h.clearGroups(),s(-v,-f,c,0),s(-f,f,y,1),s(f,v,c,0),r.needsUpdate=!0,l===i&&(this.material[0].visible=!1)},es.prototype.dispose=function(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()};var na=new t,np=new t,ltt=new ft;ul.prototype=Object.create(d.prototype),ul.prototype.constructor=ul,ul.prototype.update=function(){var t,e;this.object.updateMatrixWorld(!0),ltt.getNormalMatrix(this.object.matrixWorld);var o=this.object.matrixWorld,r=this.geometry.attributes.position,n=this.object.geometry,u=n.vertices;n=n.faces;for(var i=0,f=0,s=n.length;f<s;f++)t=n[f],e=t.normal,na.copy(u[t.a]).add(u[t.b]).add(u[t.c]).divideScalar(3).applyMatrix4(o),np.copy(e).applyMatrix3(ltt).normalize().multiplyScalar(this.size).add(na),r.setXYZ(i,na.x,na.y,na.z),i+=1,r.setXYZ(i,np.x,np.y,np.z),i+=1;r.needsUpdate=!0};var att=new t,tp=new t,vtt=new t;os.prototype=Object.create(u.prototype),os.prototype.constructor=os,os.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},os.prototype.update=function(){att.setFromMatrixPosition(this.light.matrixWorld),tp.setFromMatrixPosition(this.light.target.matrixWorld),vtt.subVectors(tp,att),this.lightPlane.lookAt(tp),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(tp),this.targetLine.scale.z=vtt.length()},ta=new t,nt=new rr,fl.prototype=Object.create(d.prototype),fl.prototype.constructor=fl,fl.prototype.update=function(){var n=this.geometry,t=this.pointMap;nt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),rt("c",t,n,nt,0,0,-1),rt("t",t,n,nt,0,0,1),rt("n1",t,n,nt,-1,-1,-1),rt("n2",t,n,nt,1,-1,-1),rt("n3",t,n,nt,-1,1,-1),rt("n4",t,n,nt,1,1,-1),rt("f1",t,n,nt,-1,-1,1),rt("f2",t,n,nt,1,-1,1),rt("f3",t,n,nt,-1,1,1),rt("f4",t,n,nt,1,1,1),rt("u1",t,n,nt,.7,1.1,-1),rt("u2",t,n,nt,-.7,1.1,-1),rt("u3",t,n,nt,0,2,-1),rt("cf1",t,n,nt,-1,0,1),rt("cf2",t,n,nt,1,0,1),rt("cf3",t,n,nt,0,-1,1),rt("cf4",t,n,nt,0,1,1),rt("cn1",t,n,nt,-1,0,-1),rt("cn2",t,n,nt,1,0,-1),rt("cn3",t,n,nt,0,-1,-1),rt("cn4",t,n,nt,0,1,-1),n.getAttribute("position").needsUpdate=!0},ia=new ir,gr.prototype=Object.create(d.prototype),gr.prototype.constructor=gr,gr.prototype.update=function(n){if(void 0!==n&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&ia.setFromObject(this.object),!ia.isEmpty()){n=ia.min;var i=ia.max,r=this.geometry.attributes.position,t=r.array;t[0]=i.x,t[1]=i.y,t[2]=i.z,t[3]=n.x,t[4]=i.y,t[5]=i.z,t[6]=n.x,t[7]=n.y,t[8]=i.z,t[9]=i.x,t[10]=n.y,t[11]=i.z,t[12]=i.x,t[13]=i.y,t[14]=n.z,t[15]=n.x,t[16]=i.y,t[17]=n.z,t[18]=n.x,t[19]=n.y,t[20]=n.z,t[21]=i.x,t[22]=n.y,t[23]=n.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},gr.prototype.setFromObject=function(n){return this.object=n,this.update(),this},gr.prototype.copy=function(n){return d.prototype.copy.call(this,n),this.object=n.object,this},gr.prototype.clone=function(){return(new this.constructor).copy(this)},el.prototype=Object.create(d.prototype),el.prototype.constructor=el,el.prototype.updateMatrixWorld=function(n){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),u.prototype.updateMatrixWorld.call(this,n))},ol.prototype=Object.create(st.prototype),ol.prototype.constructor=ol,ol.prototype.updateMatrixWorld=function(n){var t=-this.plane.constant;1e-8>Math.abs(t)&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=0>t?1:0,this.lookAt(this.plane.normal),u.prototype.updateMatrixWorld.call(this,n)},pk=new t,nu.prototype=Object.create(u.prototype),nu.prototype.constructor=nu,nu.prototype.setDirection=function(n){.99999<n.y?this.quaternion.set(0,0,0,1):-.99999>n.y?this.quaternion.set(1,0,0,0):(pk.set(n.z,0,-n.x).normalize(),this.quaternion.setFromAxisAngle(pk,Math.acos(n.y)))},nu.prototype.setLength=function(n,t,i){void 0===t&&(t=.2*n),void 0===i&&(i=.2*t),this.line.scale.set(1,Math.max(.0001,n-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=n,this.cone.updateMatrix()},nu.prototype.setColor=function(n){this.line.material.color.set(n),this.cone.material.color.set(n)},nu.prototype.copy=function(n){return u.prototype.copy.call(this,n,!1),this.line.copy(n.line),this.cone.copy(n.cone),this},nu.prototype.clone=function(){return(new this.constructor).copy(this)},sl.prototype=Object.create(d.prototype),sl.prototype.constructor=sl,s.create=function(n,t){return console.log("THREE.Curve.create() has been deprecated"),n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.getPoint=t,n},Object.assign(dr.prototype,{createPointsGeometry:function(n){return console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."),n=this.getPoints(n),this.createGeometry(n)},createSpacedPointsGeometry:function(n){return console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."),n=this.getSpacedPoints(n),this.createGeometry(n)},createGeometry:function(n){var i;console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var u=new h,r=0,f=n.length;r<f;r++)i=n[r],u.vertices.push(new t(i.x,i.y,i.z||0));return u}}),Object.assign(bi.prototype,{fromPoints:function(n){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(n)}}),ag.prototype=Object.create(vt.prototype),vg.prototype=Object.create(vt.prototype),dw.prototype=Object.create(vt.prototype),Object.assign(dw.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),pv.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},ts.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(w.prototype,{extractUrlBase:function(n){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),wy.extractUrlBase(n)}}),w.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(lv.prototype,{setTexturePath:function(n){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(n)}}),Object.assign(bw.prototype,{center:function(n){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(n)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(n){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},size:function(n){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(n)}}),Object.assign(ir.prototype,{center:function(n){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(n)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(n){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},isIntersectionSphere:function(n){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)},size:function(n){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(n)}}),kw.prototype.center=function(n){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(n)},Object.assign(a,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(n){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),a.floorPowerOfTwo(n)},nextPowerOfTwo:function(n){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),a.ceilPowerOfTwo(n)}}),Object.assign(ft.prototype,{flattenToArrayOffset:function(n,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,t)},multiplyVector3:function(n){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(n){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(n)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(v.prototype,{extractPosition:function(n){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(n)},flattenToArrayOffset:function(n,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new t).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(n){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(n)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(n){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},multiplyVector4:function(n){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(n){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),n.transformDirection(this)},crossVector:function(n){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(n){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(n)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(n,t,i,r,u,f){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(n,t,r,i,u,f)}}),ci.prototype.isIntersectionLine=function(n){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(n)},lt.prototype.multiplyVector3=function(n){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),n.applyQuaternion(this)},Object.assign(rf.prototype,{isIntersectionBox:function(n){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},isIntersectionPlane:function(n){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(n)},isIntersectionSphere:function(n){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)}}),Object.assign(et.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(n,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(n,t)},midpoint:function(n){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(n)},normal:function(n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(n)},plane:function(n){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(n)}}),Object.assign(et,{barycoordFromPoint:function(n,t,i,r,u){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),et.getBarycoord(n,t,i,r,u)},normal:function(n,t,i,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),et.getNormal(n,t,i,r)}}),Object.assign(yu.prototype,{extractAllPoints:function(n){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(n)},extrude:function(n){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new af(this,n)},makeGeometry:function(n){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new vf(this,n)}}),Object.assign(i.prototype,{fromAttribute:function(n,t,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,t,i)},distanceToManhattan:function(n){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(t.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(n){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(n)},getScaleFromMatrix:function(n){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(n)},getColumnFromMatrix:function(n,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,n)},applyProjection:function(n){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(n)},fromAttribute:function(n,t,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,t,i)},distanceToManhattan:function(n){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(p.prototype,{fromAttribute:function(n,t,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,t,i)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(h.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(u.prototype,{getChildByName:function(n){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(n)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(n,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,n)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(u.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(n){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=n}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(ph.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(sa.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),wh.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(s.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(n){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=n}}),it.prototype.setLens=function(n,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(n)},Object.defineProperties(g.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(n){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=n}},shadowCameraLeft:{set:function(n){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=n}},shadowCameraRight:{set:function(n){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=n}},shadowCameraTop:{set:function(n){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=n}},shadowCameraBottom:{set:function(n){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=n}},shadowCameraNear:{set:function(n){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=n}},shadowCameraFar:{set:function(n){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=n}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(n){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=n}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(n){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=n}},shadowMapHeight:{set:function(n){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=n}}}),Object.defineProperties(c.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(c.prototype,{setDynamic:function(n){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===n?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(f.prototype,{addIndex:function(n){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(n)},addAttribute:function(n,t,i){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===n?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(n,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(n,new c(t,i)))},addDrawCall:function(n,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(n,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(n){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(n)}}),Object.defineProperties(f.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}}}),Object.defineProperties(br.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(n){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(n)}}}),Object.assign(br.prototype,{setDynamic:function(n){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===n?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(ur.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(yv.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(l.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new e}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(n){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(n){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=n}}}),Object.defineProperties(ai.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(at.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(n){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=n}}}),Object.assign(vp.prototype,{clearTarget:function(n,t,i,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(n),this.clear(t,i,r)},animate:function(n){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(n)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(n){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(n)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(vp.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=n}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(n){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=n}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}}}),Object.defineProperties(ld.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(su.prototype,{activeCubeFace:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),Object.defineProperties(wt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=n}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(n){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=n}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=n}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(n){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=n}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(n){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=n}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(n){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=n}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(n){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=n}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(n){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=n}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(n){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=n}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(n){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=n}}}),Object.defineProperties(ap.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),Object.defineProperties(go.prototype,{load:{value:function(n){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new av).load(n,function(n){t.setBuffer(n)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),aw.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},pe.prototype.updateCubeMap=function(n,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(n,t)},tu.crossOrigin=void 0,tu.loadTexture=function(n,t,i,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var u=new da;return u.setCrossOrigin(this.crossOrigin),n=u.load(n,i,void 0,r),t&&(n.mapping=t),n},tu.loadTextureCube=function(n,t,i,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var u=new ka;return u.setCrossOrigin(this.crossOrigin),n=u.load(n,i,void 0,r),t&&(n.mapping=t),n},tu.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},tu.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"110"}})),n.ACESFilmicToneMapping=5,n.AddEquation=100,n.AddOperation=2,n.AdditiveBlending=2,n.AlphaFormat=1021,n.AlwaysDepth=1,n.AlwaysStencilFunc=519,n.AmbientLight=fv,n.AmbientLightProbe=sw,n.AnimationClip=ei,n.AnimationLoader=gp,n.AnimationMixer=yw,n.AnimationObjectGroup=fg,n.AnimationUtils=ut,n.ArcCurve=ko,n.ArrayCamera=ah,n.ArrowHelper=nu,n.Audio=go,n.AudioAnalyser=aw,n.AudioContext=dy,n.AudioListener=cw,n.AudioLoader=av,n.AxesHelper=sl,n.AxisHelper=function(n){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new sl(n)},n.BackSide=1,n.BasicDepthPacking=3200,n.BasicShadowMap=0,n.BinaryTextureLoader=function(n){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new ba(n)},n.Bone=yp,n.BooleanKeyframeTrack=va,n.BoundingBoxHelper=function(n,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new gr(n,t)},n.Box2=bw,n.Box3=ir,n.Box3Helper=el,n.BoxBufferGeometry=al,n.BoxGeometry=bb,n.BoxHelper=gr,n.BufferAttribute=c,n.BufferGeometry=f,n.BufferGeometryLoader=cv,n.ByteType=1010,n.Cache=gu,n.Camera=rr,n.CameraHelper=fl,n.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},n.CanvasTexture=bh,n.CatmullRomCurve3=vt,n.CineonToneMapping=4,n.CircleBufferGeometry=vo,n.CircleGeometry=bc,n.ClampToEdgeWrapping=1001,n.Clock=hw,n.ClosedSplineCurve3=ag,n.Color=e,n.ColorKeyframeTrack=ya,n.CompressedTexture=no,n.CompressedTextureLoader=nw,n.ConeBufferGeometry=wc,n.ConeGeometry=pc,n.CubeCamera=pe,n.CubeGeometry=bb,n.CubeReflectionMapping=301,n.CubeRefractionMapping=302,n.CubeTexture=wr,n.CubeTextureLoader=ka,n.CubeUVReflectionMapping=306,n.CubeUVRefractionMapping=307,n.CubicBezierCurve=vi,n.CubicBezierCurve3=er,n.CubicInterpolant=la,n.CullFaceBack=1,n.CullFaceFront=2,n.CullFaceFrontBack=3,n.CullFaceNone=0,n.Curve=s,n.CurvePath=dr,n.CustomBlending=5,n.CylinderBufferGeometry=kr,n.CylinderGeometry=pf,n.Cylindrical=cg,n.DataTexture=of,n.DataTexture2DArray=we,n.DataTexture3D=be,n.DataTextureLoader=ba,n.DecrementStencilOp=7683,n.DecrementWrapStencilOp=34056,n.DefaultLoadingManager=uk,n.DepthFormat=1026,n.DepthStencilFormat=1027,n.DepthTexture=kh,n.DirectionalLight=uv,n.DirectionalLightHelper=os,n.DirectionalLightShadow=rv,n.DiscreteInterpolant=aa,n.DodecahedronBufferGeometry=fo,n.DodecahedronGeometry=rc,n.DoubleSide=2,n.DstAlphaFactor=206,n.DstColorFactor=208,n.DynamicBufferAttribute=function(n,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new c(n,t).setDynamic(!0)},n.DynamicCopyUsage=35050,n.DynamicDrawUsage=35048,n.DynamicReadUsage=35049,n.EdgesGeometry=ao,n.EdgesHelper=function(n,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new d(new ao(n.geometry),new b({color:void 0!==t?t:16777215}))},n.EllipseCurve=ii,n.EqualDepth=4,n.EqualStencilFunc=514,n.EquirectangularReflectionMapping=303,n.EquirectangularRefractionMapping=304,n.Euler=tf,n.EventDispatcher=hi,n.ExtrudeBufferGeometry=ur,n.ExtrudeGeometry=af,n.Face3=ye,n.Face4=function(n,t,i,r,u,f,e){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new ye(n,t,i,u,f,e)},n.FaceColors=1,n.FaceNormalsHelper=ul,n.FileLoader=oi,n.FlatShading=1,n.Float32Attribute=function(n,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new r(n,t)},n.Float32BufferAttribute=r,n.Float64Attribute=function(n,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new sh(n,t)},n.Float64BufferAttribute=sh,n.FloatType=1015,n.Fog=ea,n.FogExp2=fa,n.Font=fw,n.FontLoader=ew,n.FrontFaceDirectionCCW=1,n.FrontFaceDirectionCW=0,n.FrontSide=0,n.Frustum=hh,n.GammaEncoding=3007,n.Geometry=h,n.GeometryUtils={merge:function(n,t,i){if(console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh){t.matrixAutoUpdate&&t.updateMatrix();var r=t.matrix;t=t.geometry}n.merge(t,r,i)},center:function(n){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),n.center()}},n.GreaterDepth=6,n.GreaterEqualDepth=5,n.GreaterEqualStencilFunc=518,n.GreaterStencilFunc=516,n.GridHelper=pv,n.Group=de,n.HalfFloatType=1016,n.HemisphereLight=ga,n.HemisphereLightHelper=us,n.HemisphereLightProbe=ow,n.IcosahedronBufferGeometry=uo,n.IcosahedronGeometry=ic,n.ImageBitmapLoader=rw,n.ImageLoader=bo,n.ImageUtils=tu,n.ImmediateRenderObject=il,n.IncrementStencilOp=7682,n.IncrementWrapStencilOp=34055,n.InstancedBufferAttribute=hv,n.InstancedBufferGeometry=sv,n.InstancedInterleavedBuffer=pw,n.InstancedMesh=ha,n.Int16Attribute=function(n,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new eh(n,t)},n.Int16BufferAttribute=eh,n.Int32Attribute=function(n,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new oh(n,t)},n.Int32BufferAttribute=oh,n.Int8Attribute=function(n,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new rh(n,t)},n.Int8BufferAttribute=rh,n.IntType=1013,n.InterleavedBuffer=br,n.InterleavedBufferAttribute=vh,n.Interpolant=ti,n.InterpolateDiscrete=2300,n.InterpolateLinear=2301,n.InterpolateSmooth=2302,n.InvertStencilOp=5386,n.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},n.KeepStencilOp=7680,n.KeyframeTrack=ct,n.LOD=ph,n.LatheBufferGeometry=lo,n.LatheGeometry=yc,n.Layers=up,n.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")},n.LessDepth=2,n.LessEqualDepth=3,n.LessEqualStencilFunc=515,n.LessStencilFunc=513,n.Light=g,n.LightProbe=ki,n.LightProbeHelper=fs,n.LightShadow=sr,n.Line=st,n.Line3=kw,n.LineBasicMaterial=b,n.LineCurve=dt,n.LineCurve3=yi,n.LineDashedMaterial=te,n.LineLoop=ca,n.LinePieces=1,n.LineSegments=d,n.LineStrip=0,n.LinearEncoding=3e3,n.LinearFilter=1006,n.LinearInterpolant=kc,n.LinearMipMapLinearFilter=1008,n.LinearMipMapNearestFilter=1007,n.LinearMipmapLinearFilter=1008,n.LinearMipmapNearestFilter=1007,n.LinearToneMapping=1,n.Loader=w,n.LoaderUtils=wy,n.LoadingManager=dp,n.LogLuvEncoding=3003,n.LoopOnce=2200,n.LoopPingPong=2202,n.LoopRepeat=2201,n.LuminanceAlphaFormat=1025,n.LuminanceFormat=1024,n.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},n.Material=l,n.MaterialLoader=ov,n.Math=a,n.Matrix3=ft,n.Matrix4=v,n.MaxEquation=104,n.Mesh=tt,n.MeshBasicMaterial=gt,n.MeshDepthMaterial=cu,n.MeshDistanceMaterial=lu,n.MeshFaceMaterial=function(n){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),n},n.MeshLambertMaterial=gf,n.MeshMatcapMaterial=ne,n.MeshNormalMaterial=df,n.MeshPhongMaterial=ai,n.MeshPhysicalMaterial=bf,n.MeshStandardMaterial=fr,n.MeshToonMaterial=kf,n.MinEquation=103,n.MirroredRepeatWrapping=1002,n.MixOperation=1,n.MultiMaterial=function(n){return void 0===n&&(n=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),n.isMultiMaterial=!0,n.materials=n,n.clone=function(){return n.slice()},n},n.MultiplyBlending=4,n.MultiplyOperation=0,n.NearestFilter=1003,n.NearestMipMapLinearFilter=1005,n.NearestMipMapNearestFilter=1004,n.NearestMipmapLinearFilter=1005,n.NearestMipmapNearestFilter=1004,n.NeverDepth=0,n.NeverStencilFunc=512,n.NoBlending=0,n.NoColors=0,n.NoToneMapping=0,n.NormalBlending=1,n.NotEqualDepth=7,n.NotEqualStencilFunc=517,n.NumberKeyframeTrack=po,n.Object3D=u,n.ObjectLoader=lv,n.ObjectSpaceNormalMap=1,n.OctahedronBufferGeometry=hf,n.OctahedronGeometry=tc,n.OneFactor=201,n.OneMinusDstAlphaFactor=207,n.OneMinusDstColorFactor=209,n.OneMinusSrcAlphaFactor=205,n.OneMinusSrcColorFactor=203,n.OrthographicCamera=tl,n.PCFShadowMap=1,n.PCFSoftShadowMap=2,n.ParametricBufferGeometry=io,n.ParametricGeometry=dh,n.Particle=function(n){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new yh(n)},n.ParticleBasicMaterial=function(n){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new li(n)},n.ParticleSystem=function(n,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new ge(n,t)},n.ParticleSystemMaterial=function(n){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new li(n)},n.Path=bi,n.PerspectiveCamera=it,n.Plane=ci,n.PlaneBufferGeometry=sf,n.PlaneGeometry=ch,n.PlaneHelper=ol,n.PointCloud=function(n,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new ge(n,t)},n.PointCloudMaterial=function(n){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new li(n)},n.PointLight=iv,n.PointLightHelper=is,n.Points=ge,n.PointsMaterial=li,n.PolarGridHelper=wv,n.PolyhedronBufferGeometry=kt,n.PolyhedronGeometry=gh,n.PositionalAudio=lw,n.PositionalAudioHelper=es,n.PropertyBinding=yt,n.PropertyMixer=vw,n.QuadraticBezierCurve=pi,n.QuadraticBezierCurve3=or,n.Quaternion=lt,n.QuaternionKeyframeTrack=dc,n.QuaternionLinearInterpolant=pa,n.REVISION="110",n.RGBADepthPacking=3201,n.RGBAFormat=1023,n.RGBA_ASTC_10x10_Format=37819,n.RGBA_ASTC_10x5_Format=37816,n.RGBA_ASTC_10x6_Format=37817,n.RGBA_ASTC_10x8_Format=37818,n.RGBA_ASTC_12x10_Format=37820,n.RGBA_ASTC_12x12_Format=37821,n.RGBA_ASTC_4x4_Format=37808,n.RGBA_ASTC_5x4_Format=37809,n.RGBA_ASTC_5x5_Format=37810,n.RGBA_ASTC_6x5_Format=37811,n.RGBA_ASTC_6x6_Format=37812,n.RGBA_ASTC_8x5_Format=37813,n.RGBA_ASTC_8x6_Format=37814,n.RGBA_ASTC_8x8_Format=37815,n.RGBA_PVRTC_2BPPV1_Format=35843,n.RGBA_PVRTC_4BPPV1_Format=35842,n.RGBA_S3TC_DXT1_Format=33777,n.RGBA_S3TC_DXT3_Format=33778,n.RGBA_S3TC_DXT5_Format=33779,n.RGBDEncoding=3006,n.RGBEEncoding=3002,n.RGBEFormat=1023,n.RGBFormat=1022,n.RGBM16Encoding=3005,n.RGBM7Encoding=3004,n.RGB_ETC1_Format=36196,n.RGB_PVRTC_2BPPV1_Format=35841,n.RGB_PVRTC_4BPPV1_Format=35840,n.RGB_S3TC_DXT1_Format=33776,n.RawShaderMaterial=yo,n.Ray=rf,n.Raycaster=og,n.RectAreaLight=ev,n.RectAreaLightHelper=rs,n.RedFormat=1028,n.ReinhardToneMapping=2,n.RepeatWrapping=1e3,n.ReplaceStencilOp=7681,n.ReverseSubtractEquation=102,n.RingBufferGeometry=co,n.RingGeometry=vc,n.Scene=ih,n.SceneUtils={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}},n.ShaderChunk=y,n.ShaderLib=ar,n.ShaderMaterial=at,n.ShadowMaterial=wf,n.Shape=yu,n.ShapeBufferGeometry=yf,n.ShapeGeometry=vf,n.ShapePath=uw,n.ShapeUtils=vr,n.ShortType=1011,n.Skeleton=sa,n.SkeletonHelper=ts,n.SkinnedMesh=wh,n.SmoothShading=2,n.Sphere=pr,n.SphereBufferGeometry=vu,n.SphereGeometry=ac,n.Spherical=hg,n.SphericalHarmonics3=vv,n.SphericalReflectionMapping=305,n.Spline=dw,n.SplineCurve=wi,n.SplineCurve3=vg,n.SpotLight=tv,n.SpotLightHelper=ns,n.SpotLightShadow=nv,n.Sprite=yh,n.SpriteMaterial=au,n.SrcAlphaFactor=204,n.SrcAlphaSaturateFactor=210,n.SrcColorFactor=202,n.StaticCopyUsage=35046,n.StaticDrawUsage=35044,n.StaticReadUsage=35045,n.StereoCamera=rg,n.StreamCopyUsage=35042,n.StreamDrawUsage=35040,n.StreamReadUsage=35041,n.StringKeyframeTrack=wa,n.SubtractEquation=101,n.SubtractiveBlending=3,n.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},n.TangentSpaceNormalMap=0,n.TetrahedronBufferGeometry=ro,n.TetrahedronGeometry=nc,n.TextBufferGeometry=ho,n.TextGeometry=lc,n.Texture=k,n.TextureLoader=da,n.TorusBufferGeometry=oo,n.TorusGeometry=ec,n.TorusKnotBufferGeometry=eo,n.TorusKnotGeometry=fc,n.Triangle=et,n.TriangleFanDrawMode=2,n.TriangleStripDrawMode=1,n.TrianglesDrawMode=0,n.TubeBufferGeometry=cf,n.TubeGeometry=uc,n.UVMapping=300,n.Uint16Attribute=function(n,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new uf(n,t)},n.Uint16BufferAttribute=uf,n.Uint32Attribute=function(n,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new ff(n,t)},n.Uint32BufferAttribute=ff,n.Uint8Attribute=function(n,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new uh(n,t)},n.Uint8BufferAttribute=uh,n.Uint8ClampedAttribute=function(n,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new fh(n,t)},n.Uint8ClampedBufferAttribute=fh,n.Uncharted2ToneMapping=3,n.Uniform=yv,n.UniformsLib=o,n.UniformsUtils=lft,n.UnsignedByteType=1009,n.UnsignedInt248Type=1020,n.UnsignedIntType=1014,n.UnsignedShort4444Type=1017,n.UnsignedShort5551Type=1018,n.UnsignedShort565Type=1019,n.UnsignedShortType=1012,n.VSMShadowMap=3,n.Vector2=i,n.Vector3=t,n.Vector4=p,n.VectorKeyframeTrack=wo,n.Vertex=function(n,i,r){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new t(n,i,r)},n.VertexColors=2,n.VertexNormalsHelper=rl,n.VideoTexture=wp,n.WebGLMultisampleRenderTarget=rp,n.WebGLRenderTarget=wt,n.WebGLRenderTargetCube=su,n.WebGLRenderer=vp,n.WebGLUtils=ad,n.WireframeGeometry=to,n.WireframeHelper=function(n,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new d(new to(n.geometry),new b({color:void 0!==t?t:16777215}))},n.WrapAroundEnding=2402,n.XHRLoader=function(n){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new oi(n)},n.ZeroCurvatureEnding=2400,n.ZeroFactor=200,n.ZeroSlopeEnding=2401,n.ZeroStencilOp=0,n.sRGBEncoding=3001,Object.defineProperty(n,"__esModule",{value:!0})}),function(){"use strict";function f(n,i,r){return(typeof i=="string"?i:i.toString()).replace(n.define||t,function(t,i,u,f){return i.indexOf("def.")===0&&(i=i.substring(4)),i in r||(u===":"?(n.defineParams&&f.replace(n.defineParams,function(n,t,u){r[i]={arg:t,text:u}}),i in r||(r[i]=f)):new Function("def","def['"+i+"']="+f)(r)),""}).replace(n.use||t,function(t,i){n.useParams&&(i=i.replace(n.useParams,function(n,t,i,u){if(r[i]&&r[i].arg&&u){var f=(i+":"+u).replace(/'|\\/g,"_");return r.__exp=r.__exp||{},r.__exp[f]=r[i].text.replace(new RegExp("(^|[^\\w$])"+r[i].arg+"([^\\w$])","g"),"$1"+u+"$2"),t+"def.__exp['"+f+"']"}}));var u=new Function("def","return "+i)(r);return u?f(n,u,r):u})}function i(n){return n.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var n={name:"doT",version:"1.1.1",templateSettings:{evaluate:/\{\{([\s\S]+?(\}?)+)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:!0,append:!0,selfcontained:!1,doNotSkipEncoded:!1},template:undefined,compile:undefined,log:!0},r,u,t;n.encodeHTMLSource=function(n){var t={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},i=n?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(n){return n?n.toString().replace(i,function(n){return t[n]||n}):""}},r=function(){return this||eval("this")}(),typeof module!="undefined"&&module.exports?module.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):window.doT=n,u={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},t=/$^/,n.template=function(e,o,s){o=o||n.templateSettings;var l=o.append?u.append:u.split,v,h=0,a,c=o.use||o.define?f(o,e,s||{}):e;c=("var out='"+(o.strip?c.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):c).replace(/'|\\/g,"\\$&").replace(o.interpolate||t,function(n,t){return l.start+i(t)+l.end}).replace(o.encode||t,function(n,t){return v=!0,l.startencode+i(t)+l.end}).replace(o.conditional||t,function(n,t,r){return t?r?"';}else if("+i(r)+"){out+='":"';}else{out+='":r?"';if("+i(r)+"){out+='":"';}out+='"}).replace(o.iterate||t,function(n,t,r,u){return t?(h+=1,a=u||"i"+h,t=i(t),"';var arr"+h+"="+t+";if(arr"+h+"){var "+r+","+a+"=-1,l"+h+"=arr"+h+".length-1;while("+a+"<l"+h+"){"+r+"=arr"+h+"["+a+"+=1];out+='"):"';} } out+='"}).replace(o.evaluate||t,function(n,t){return"';"+i(t)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,""),v&&(o.selfcontained||!r||r._encodeHTML||(r._encodeHTML=n.encodeHTMLSource(o.doNotSkipEncoded)),c="var encodeHTML = typeof _encodeHTML !== 'undefined' ? _encodeHTML : ("+n.encodeHTMLSource.toString()+"("+(o.doNotSkipEncoded||"")+"));"+c);try{return new Function(o.varname,c)}catch(y){typeof console!="undefined"&&console.log("Could not create a template function: "+c);throw y;}},n.compile=function(t,i){return n.template(t,null,i)}}();
/*!
 * uEvent 1.0.0 - to make any js object an event emitter
 * Copyright 2011 Jerome Etienne (http://jetienne.com)
 * Copyright 2015-2016 Damien "Mistic" Sorel (http://www.strangeplanet.fr)
 * Licensed under MIT (http://opensource.org/licenses/MIT)
 */
!function(n,t){"undefined"!=typeof module&&module.exports?module.exports=t():"function"==typeof define&&define.amd?define([],t):n.uEvent=t()}(this,function(){"use strict";var t=function(){return!0},i=function(){return!1},n=function(){};return n.Event=function(n,t){var i=n,r=t;Object.defineProperties(this,{type:{get:function(){return i},set:function(){},enumerable:!0},args:{get:function(){return r},set:function(){},enumerable:!0}})},n.Event.prototype={constructor:n.Event,isDefaultPrevented:i,isPropagationStopped:i,preventDefault:function(){this.isDefaultPrevented=t},stopPropagation:function(){this.isPropagationStopped=t}},n.prototype={constructor:n,on:function(n,t){if(this.__events=this.__events||{},"object"==typeof n)for(var i in n)n.hasOwnProperty(i)&&(this.__events[i]=this.__events[i]||[],this.__events[i].push(n[i]));else n.split(" ").forEach(function(n){this.__events[n]=this.__events[n]||[],this.__events[n].push(t)},this);return this},off:function(n,t){var i,r;if(this.__events=this.__events||{},"object"==typeof n)for(i in n)n.hasOwnProperty(i)&&i in this.__events&&(r=this.__events[i].indexOf(n[i]),-1!==r&&this.__events[i].splice(r,1));else n?n.split(" ").forEach(function(n){if(n in this.__events)if(t){var i=this.__events[n].indexOf(t);-1!==i&&this.__events[n].splice(i,1)}else this.__events[n].length=0},this):this.__events={};return this},once:function(n,t){if(this.__once=this.__once||{},"object"==typeof n)for(var i in n)n.hasOwnProperty(i)&&(this.__once[i]=this.__once[i]||[],this.__once[i].push(n[i]));else n.split(" ").forEach(function(n){this.__once[n]=this.__once[n]||[],this.__once[n].push(t)},this);return this},trigger:function(t){var i,f,r,e=Array.prototype.slice.call(arguments,1),u=new n.Event(t,e);if(e.push(u),this.__events&&t in this.__events)for(i=0,f=this.__events[t].length;f>i;i++)if(r=this.__events[t][i],"object"==typeof r?r.handleEvent(u):r.apply(this,e),u.isPropagationStopped())return u;if(this.__once&&t in this.__once){for(i=0,f=this.__once[t].length;f>i;i++)if(r=this.__once[t][i],"object"==typeof r?r.handleEvent(u):r.apply(this,e),u.isPropagationStopped())return delete this.__once[t],u;delete this.__once[t]}return u},change:function(t,i){var r,o,u,f=Array.prototype.slice.call(arguments,1),e=new n.Event(t,f);if(f.push(e),this.__events&&t in this.__events)for(r=0,o=this.__events[t].length;o>r;r++)if(f[0]=i,u=this.__events[t][r],i="object"==typeof u?u.handleEvent(e):u.apply(this,f),e.isPropagationStopped())return i;return i}},n.mixin=function(t,i){i=i||{},t="function"==typeof t?t.prototype:t,["on","off","once","trigger","change"].forEach(function(r){var u=i[r]||r;t[u]=n.prototype[r]}),Object.defineProperties(t,{__events:{value:null,writable:!0},__once:{value:null,writable:!0}})},n});
/*!
 * Photo Sphere Viewer 3.5.1
 * Copyright (c) 2014-2015 Jérémy Heleine
 * Copyright (c) 2015-2019 Damien "Mistic" Sorel
 * Licensed under MIT (https://opensource.org/licenses/MIT)
 */
!function(n,t){"function"==typeof define&&define.amd?define(["three","uevent","dot/doT"],t):"object"==typeof module&&module.exports?module.exports=t(require("three"),require("uevent"),require("dot/doT")):n.PhotoSphereViewer=t(n.THREE,n.uEvent,n.doT)}(this,function(n,t,i){"use strict";function r(t){var e,f;if(!(this instanceof r))return new r(t);if(r.SYSTEM.loaded||r._loadSystem(),this.config=u.clone(r.DEFAULTS),u.deepmerge(this.config,t),!t.container)throw new o("No value given for container.");if(!r.SYSTEM.isCanvasSupported)throw new o("Canvas is not supported.");if(!(r.SYSTEM.isWebGLSupported&&this.config.webgl||u.checkTHREE("CanvasRenderer","Projector")))throw new o("Missing Three.js components: CanvasRenderer, Projector. Get them from three.js-examples package.");(this.config.longitude_range&&2!==this.config.longitude_range.length&&(this.config.longitude_range=null,console.warn("PhotoSphereViewer: longitude_range must have exactly two elements.")),this.config.latitude_range?2!==this.config.latitude_range.length?(this.config.latitude_range=null,console.warn("PhotoSphereViewer: latitude_range must have exactly two elements.")):this.config.latitude_range[0]>this.config.latitude_range[1]&&(this.config.latitude_range=[this.config.latitude_range[1],this.config.latitude_range[0]],console.warn("PhotoSphereViewer: latitude_range values must be ordered.")):void 0===this.config.tilt_up_max&&void 0===this.config.tilt_down_max||(this.config.latitude_range=[void 0!==this.config.tilt_down_max?this.config.tilt_down_max-Math.PI/4:-u.HalfPI,void 0!==this.config.tilt_up_max?this.config.tilt_up_max+Math.PI/4:u.HalfPI],console.warn("PhotoSphereViewer: tilt_up_max and tilt_down_max are deprecated, use latitude_range instead.")),this.config.max_fov<this.config.min_fov)&&(e=this.config.max_fov,this.config.max_fov=this.config.min_fov,this.config.min_fov=e,console.warn("PhotoSphereViewer: max_fov cannot be lower than min_fov.")),this.config.cache_texture&&(!u.isInteger(this.config.cache_texture)||this.config.cache_texture<0)&&(this.config.cache_texture=r.DEFAULTS.cache_texture,console.warn("PhotoSphereViewer: invalid value for cache_texture")),"panorama_roll"in this.config&&(this.config.sphere_correction.roll=this.config.panorama_roll,console.warn("PhotoSphereViewer: panorama_roll is deprecated, use sphere_correction.roll instead")),"gyroscope"in this.config&&console.warn("PhotoSphereViewer: gyroscope is deprecated, the control is automatically created if DeviceOrientationControls.js is loaded"),!0===this.config.keyboard&&(this.config.keyboard=u.clone(r.DEFAULTS.keyboard)),this.config.min_fov=u.bound(this.config.min_fov,1,179),this.config.max_fov=u.bound(this.config.max_fov,1,179),this.config.default_fov=null===this.config.default_fov?this.config.max_fov/2+this.config.min_fov/2:u.bound(this.config.default_fov,this.config.min_fov,this.config.max_fov),this.config.anim_lat=null===this.config.anim_lat?this.config.default_lat:u.parseAngle(this.config.anim_lat,!0),this.config.longitude_range&&(this.config.longitude_range=this.config.longitude_range.map(function(n){return u.parseAngle(n)})),this.config.latitude_range&&(this.config.latitude_range=this.config.latitude_range.map(function(n){return u.parseAngle(n,!0)})),this.config.anim_speed=u.parseSpeed(this.config.anim_speed),this.config.caption&&!this.config.navbar&&(this.config.navbar=["caption"]),!0===this.config.fisheye?this.config.fisheye=1:!1===this.config.fisheye&&(this.config.fisheye=0),this.parent="string"==typeof t.container?document.getElementById(t.container):t.container,this.container=null,this.loader=null,this.navbar=null,this.hud=null,this.panel=null,this.tooltip=null,this.notification=null,this.overlay=null,this.canvas_container=null,this.renderer=null,this.stereoEffect=null,this.noSleep=null,this.scene=null,this.camera=null,this.mesh=null,this.raycaster=null,this.doControls=null,this.prop={needsUpdate:!0,isCubemap:void 0,position:{longitude:0,latitude:0},ready:!1,direction:null,anim_speed:0,zoom_lvl:0,vFov:0,hFov:0,aspect:0,move_speed:.1,moving:!1,zooming:!1,start_mouse_x:0,start_mouse_y:0,mouse_x:0,mouse_y:0,mouse_history:[],gyro_alpha_offset:0,pinch_dist:0,main_reqid:null,orientation_cb:null,autorotate_cb:null,animation_promise:null,loading_promise:null,start_timeout:null,dblclick_data:null,dblclick_timeout:null,cache:[],size:{width:0,height:0},pano_data:{full_width:0,full_height:0,cropped_width:0,cropped_height:0,cropped_x:0,cropped_y:0}},Object.keys(r.TEMPLATES).forEach(function(n){this.config.templates[n]||(this.config.templates[n]=r.TEMPLATES[n]),"string"==typeof this.config.templates[n]&&(this.config.templates[n]=i.template(this.config.templates[n]))},this),(this.parent.photoSphereViewer=this).container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),null!==this.config.size&&this._setViewerSize(this.config.size),this._onResize(),f=(this.config.default_fov-this.config.min_fov)/(this.config.max_fov-this.config.min_fov)*100,this.config.default_zoom_lvl=f-2*(f-50),this.prop.move_speed=n.Math.degToRad(this.config.move_speed/r.SYSTEM.pixelRatio),this.loader=new ut(this),this.loader.hide(),this.navbar=new k(this),this.navbar.hide(),this.hud=new s(this),this.hud.hide(),this.panel=new v(this),this.tooltip=new a(this.hud),this.notification=new g(this),this.overlay=new nt(this),this._bindEvents(),this.config.panorama&&this.setPanorama(this.config.panorama),this.once("render",function(){this.config.navbar&&(this.container.classList.add("psv-container--has-navbar"),this.navbar.show()),this.hud.show(),this.config.markers&&(this.config.markers.forEach(function(n){this.hud.addMarker(n,!1)},this),this.hud.renderMarkers()),!1!==this.config.time_anim&&(this.prop.start_timeout=window.setTimeout(this.startAutorotate.bind(this),this.config.time_anim)),setTimeout(function(){this._run(),this.trigger("ready")}.bind(this),0)}.bind(this)),r.SYSTEM.touchEnabled.then(function(n){n&&this.container.classList.add("psv-is-touch")}.bind(this))}function e(n){this.psv=n instanceof r?n:n.psv,this.parent=n,this.container=null,this.visible=!0,this.constructor.publicMethods&&this.constructor.publicMethods.forEach(function(n){this.psv[n]=this[n].bind(this)},this)}function s(n){e.call(this,n),this.svgContainer=null,this.markers={},this.currentMarker=null,this.hoveringMarker=null,this.prop={panelOpened:!1,panelOpening:!1,markersButton:this.psv.navbar.getNavbarButton("markers",!0)},this.create()}function ut(n){e.call(this,n),this.canvas=null,this.loader=null,this.create()}function k(n){if(e.call(this,n),this.config=this.psv.config.navbar,this.items=[],!0===this.config)this.config=u.clone(r.DEFAULTS.navbar);else if("string"==typeof this.config)this.config=this.config.split(" ");else if(!Array.isArray(this.config)){console.warn('PhotoSphereViewer: hashmap form of "navbar" is deprecated, use an array instead.');var t=this.config;this.config=[],u.forEach(t,function(n,t){n&&this.config.push(t)}.bind(this)),this.config.sort(function(n,t){return r.DEFAULTS.navbar.indexOf(n)-r.DEFAULTS.navbar.indexOf(t)})}this.create()}function d(n,t){e.call(this,n),this.content=null,this.button=null,this.prop={caption:"",width:0},this.create(),this.setCaption(t)}function g(n){e.call(this,n),this.create()}function nt(n){e.call(this,n),this.create(),this.hide()}function v(n){e.call(this,n),this.content=null,this.prop={mouse_x:0,mouse_y:0,mousedown:!1,opened:!1},this.create()}function a(n){e.call(this,n),this.config=this.psv.config.tooltip,this.prop={timeout:null},this.create()}function f(n){e.call(this,n),this.id=void 0,this.constructor.id&&(this.id=this.constructor.id),this.enabled=!0}function p(n){f.call(this,n),this.create()}function tt(n){f.call(this,n),this.create()}function ft(n,t){f.call(this,n),this.config=t,this.config.id&&(this.id=this.config.id),this.create()}function it(n){f.call(this,n),this.create()}function y(n){f.call(this,n),this.create()}function w(n){f.call(this,n),this.create()}function rt(n){f.call(this,n),this.create()}function b(n){f.call(this,n),this.create()}function c(n){f.call(this,n),this.zoom_range=null,this.zoom_value=null,this.prop={mousedown:!1,buttondown:!1,longPressInterval:null,longPressTimeout:null},this.create()}function l(n){if(!(this instanceof l))return new l(n);this._cancelled=!1,this._resolved=!1;var t=this;this._promise=new Promise(function(n,i){t._resolve=n,t._reject=i}),n&&(n.easing&&"string"!=typeof n.easing||(n.easing=l.easings[n.easing||"linear"]),this._start=null,(this._options=n).delay?this._delayTimeout=window.setTimeout(function(){this._delayTimeout=null,window.requestAnimationFrame(this._run.bind(this))}.bind(this),n.delay):window.requestAnimationFrame(this._run.bind(this)))}function o(n){this.message=n,"captureStackTrace"in Error?Error.captureStackTrace(this,o):this.stack=(new Error).stack}function h(n,t){if(!n.id)throw new o("missing marker id");if(n.image&&(!n.width||!n.height))throw new o("missing marker width/height");if((n.image||n.html)&&!(n.hasOwnProperty("x")&&n.hasOwnProperty("y")||n.hasOwnProperty("latitude")&&n.hasOwnProperty("longitude")))throw new o("missing marker position, latitude/longitude or x/y");this.psv=t,this.visible=!0,this._dynamicSize=!1;var i,f=n.id,r=h.getType(n,!1);Object.defineProperties(this,{id:{configurable:!1,enumerable:!0,get:function(){return f},set:function(){}},type:{configurable:!1,enumerable:!0,get:function(){return r},set:function(){}},$el:{configurable:!1,enumerable:!0,get:function(){return i},set:function(){}},_def:{configurable:!1,enumerable:!0,get:function(){return this[r]},set:function(n){this[r]=n}}}),(i=this.isNormal()?document.createElement("div"):this.isPolygon()?document.createElementNS(u.svgNS,"polygon"):this.isPolyline()?document.createElementNS(u.svgNS,"polyline"):document.createElementNS(u.svgNS,this.type)).id="psv-marker-"+this.id,(i.psvMarker=this).update(n)}t.mixin(r),r.prototype._run=function(n){this.trigger("before-render",n||+new Date),this.prop.needsUpdate&&(this._render(),this.prop.needsUpdate=!1),this.prop.main_reqid=window.requestAnimationFrame(this._run.bind(this))},r.prototype._render=function(){this.prop.direction=this.sphericalCoordsToVector3(this.prop.position),this.camera.position.set(0,0,0),this.camera.lookAt(this.prop.direction),this.config.fisheye&&this.camera.position.copy(this.prop.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.aspect=this.prop.aspect,this.camera.fov=this.prop.vFov,this.camera.updateProjectionMatrix(),(this.stereoEffect||this.renderer).render(this.scene,this.camera),this.trigger("render")},r.prototype._loadXMP=function(n){return this.config.usexmpdata?new Promise(function(t){var r=0,i=new XMLHttpRequest;this.config.with_credentials&&(i.withCredentials=!0),i.onreadystatechange=function(){if(4===i.readyState){if(200!==i.status&&201!==i.status&&202!==i.status&&0!==i.status)throw new o(this.container.textContent="Cannot load image");this.loader.setProgress(100);var e=i.responseText,s=e.indexOf("<x:xmpmeta"),h=e.indexOf("<\/x:xmpmeta>"),n=e.substring(s,h),f=null;-1!==s&&-1!==h&&-1!==n.indexOf("GPano:")&&((f={full_width:parseInt(u.getXMPValue(n,"FullPanoWidthPixels")),full_height:parseInt(u.getXMPValue(n,"FullPanoHeightPixels")),cropped_width:parseInt(u.getXMPValue(n,"CroppedAreaImageWidthPixels")),cropped_height:parseInt(u.getXMPValue(n,"CroppedAreaImageHeightPixels")),cropped_x:parseInt(u.getXMPValue(n,"CroppedAreaLeftPixels")),cropped_y:parseInt(u.getXMPValue(n,"CroppedAreaTopPixels"))}).full_width&&f.full_height&&f.cropped_width&&f.cropped_height||(console.warn("PhotoSphereViewer: invalid XMP data"),f=null)),t(f)}else 3===i.readyState&&this.loader.setProgress(r+=10)}.bind(this),i.onprogress=function(n){if(n.lengthComputable){var t=parseInt(n.loaded/n.total*100);r<t&&(r=t,this.loader.setProgress(r))}}.bind(this),i.onerror=function(n){throw this.container.textContent="Cannot load image",reject(n),new o("Cannot load image");}.bind(this),i.open("GET",n,!0),i.send(null)}.bind(this)):Promise.resolve(null)},r.prototype._loadTexture=function(n){var i=[],t;if(Array.isArray(n)){if(6!==n.length)throw new o("Must provide exactly 6 image paths when using cubemap.");for(t=0;t<6;t++)i[t]=n[r.CUBE_MAP[t]];n=i}else if("object"==typeof n){if(!r.CUBE_HASHMAP.every(function(t){return!!n[t]}))throw new o("Must provide exactly left, front, right, back, top, bottom when using cubemap.");r.CUBE_HASHMAP.forEach(function(t,r){i[r]=n[t]}),n=i}if(Array.isArray(n)){if(!1===this.prop.isCubemap)throw new o("The viewer was initialized with an equirectangular panorama, cannot switch to cubemap.");return this.config.fisheye&&console.warn("PhotoSphereViewer: fisheye effect with cubemap texture can generate distorsions."),this.config.cache_texture===r.DEFAULTS.cache_texture&&(this.config.cache_texture*=6),this.prop.isCubemap=!0,this._loadCubemapTexture(n)}if(!0===this.prop.isCubemap)throw new o("The viewer was initialized with an cubemap, cannot switch to equirectangular panorama.");return this.prop.isCubemap=!1,this._loadEquirectangularTexture(n)},r.prototype._loadEquirectangularTexture=function(t){if(this.config.cache_texture){var i=this.getPanoramaCache(t);if(i)return this.prop.pano_data=i.pano_data,Promise.resolve(i.image)}return this._loadXMP(t).then(function(i){return new Promise(function(f,e){var h=new n.ImageLoader,s=i?100:0;this.config.with_credentials?h.setCrossOrigin("use-credentials"):h.setCrossOrigin("anonymous"),h.load(t,function(e){var c,h,o,l;s=100,this.loader.setProgress(s),this.trigger("panorama-load-progress",t,s),!i&&this.config.pano_data&&(i=u.clone(this.config.pano_data)),i||(i={full_width:e.width,full_height:e.height,cropped_width:e.width,cropped_height:e.height,cropped_x:0,cropped_y:0}),this.prop.pano_data=i,h=Math.min(i.full_width,r.SYSTEM.maxTextureWidth)/i.full_width,1!==h||i.cropped_width!==i.full_width||i.cropped_height!==i.full_height?(o=u.clone(i),o.full_width*=h,o.full_height*=h,o.cropped_width*=h,o.cropped_height*=h,o.cropped_x*=h,o.cropped_y*=h,e.width=o.cropped_width,e.height=o.cropped_height,l=document.createElement("canvas"),l.width=o.full_width,l.height=o.full_height,l.getContext("2d").drawImage(e,o.cropped_x,o.cropped_y,o.cropped_width,o.cropped_height),c=new n.Texture(l)):c=new n.Texture(e),c.needsUpdate=!0,c.minFilter=n.LinearFilter,c.generateMipmaps=!1,this.config.cache_texture&&this._putPanoramaCache({panorama:t,image:c,pano_data:i}),f(c)}.bind(this),function(n){if(n.lengthComputable){var i=parseInt(n.loaded/n.total*100);s<i&&(s=i,this.loader.setProgress(s),this.trigger("panorama-load-progress",t,s))}}.bind(this),function(n){throw this.container.textContent="Cannot load image",e(n),new o("Cannot load image");}.bind(this))}.bind(this))}.bind(this))},r.prototype._loadCubemapTexture=function(t){return new Promise(function(i,f){var l=new n.ImageLoader,s=[0,0,0,0,0,0],h=[],c=0,a;this.config.with_credentials?l.setCrossOrigin("use-credentials"):l.setCrossOrigin("anonymous");for(var v=function(f,e){var l,o;c++,s[f]=100,this.loader.setProgress(u.sum(s)/6),this.trigger("panorama-load-progress",t[f],s[f]),l=Math.min(e.width,r.SYSTEM.maxTextureWidth/2)/e.width,1!==l?(o=document.createElement("canvas"),o.width=e.width*l,o.height=e.height*l,o.getContext("2d").drawImage(e,0,0,o.width,o.height),h[f]=new n.Texture(o)):h[f]=new n.Texture(e),this.config.cache_texture&&this._putPanoramaCache({panorama:t[f],image:h[f]}),6===c&&(h.forEach(function(t){t.needsUpdate=!0,t.minFilter=n.LinearFilter,t.generateMipmaps=!1}),i(h))},y=function(n,i){if(i.lengthComputable){var r=parseInt(i.loaded/i.total*100);r>s[n]&&(s[n]=r,this.loader.setProgress(u.sum(s)/6),this.trigger("panorama-load-progress",t[n],s[n]))}},p=function(n,t){throw this.container.textContent="Cannot load image",f(t),new o("Cannot load image "+n);},e=0;e<6;e++){if(this.config.cache_texture&&(a=this.getPanoramaCache(t[e]),a)){c++,s[e]=100,h[e]=a.image;continue}l.load(t[e],v.bind(this,e),y.bind(this,e),p.bind(this,e))}6===c&&i(h)}.bind(this))},r.prototype._setTexture=function(n){if(this.scene||this._createScene(),this.prop.isCubemap)for(var t=0;t<6;t++)this.mesh.material[t].map&&this.mesh.material[t].map.dispose(),this.mesh.material[t].map=n[t];else this.mesh.material.map&&this.mesh.material.map.dispose(),this.mesh.material.map=n;this.trigger("panorama-loaded"),this._render()},r.prototype._createScene=function(){this.raycaster=new n.Raycaster,this.renderer=r.SYSTEM.isWebGLSupported&&this.config.webgl?new n.WebGLRenderer:new n.CanvasRenderer,this.renderer.setSize(this.prop.size.width,this.prop.size.height),this.renderer.setPixelRatio(r.SYSTEM.pixelRatio);var t=r.SPHERE_RADIUS;this.prop.isCubemap&&(t*=Math.sqrt(3)),this.config.fisheye&&(t+=r.SPHERE_RADIUS),this.camera=new n.PerspectiveCamera(this.config.default_fov,this.prop.size.width/this.prop.size.height,1,t),this.camera.position.set(0,0,0),this.scene=new n.Scene,this.scene.add(this.camera),this.mesh=this.prop.isCubemap?this._createCubemap():this._createSphere(),this.scene.add(this.mesh),this.canvas_container=document.createElement("div"),this.canvas_container.className="psv-canvas-container",this.renderer.domElement.className="psv-canvas",this.container.appendChild(this.canvas_container),this.canvas_container.appendChild(this.renderer.domElement)},r.prototype._createSphere=function(t){t=t||1;var f=new n.SphereGeometry(r.SPHERE_RADIUS*t,r.SPHERE_VERTICES,r.SPHERE_VERTICES,-u.HalfPI),e=new n.MeshBasicMaterial({side:n.DoubleSide,overdraw:r.SYSTEM.isWebGLSupported&&this.config.webgl?0:1}),i=new n.Mesh(f,e);return i.scale.x=-1,i},r.prototype._setSphereCorrection=function(n,t){this.cleanSphereCorrection(t),n.rotation.set(t.tilt,t.pan,t.roll)},r.prototype._createCubemap=function(t){var i;t=t||1;for(var e=new n.BoxGeometry(2*r.SPHERE_RADIUS*t,2*r.SPHERE_RADIUS*t,2*r.SPHERE_RADIUS*t,r.CUBE_VERTICES,r.CUBE_VERTICES,r.CUBE_VERTICES),u=[],f=0;f<6;f++)u.push(new n.MeshBasicMaterial({side:n.BackSide,overdraw:r.SYSTEM.isWebGLSupported&&this.config.webgl?0:1}));return i=new n.Mesh(e,u),i.position.x-=r.SPHERE_RADIUS*t,i.position.y-=r.SPHERE_RADIUS*t,i.position.z-=r.SPHERE_RADIUS*t,i.applyMatrix((new n.Matrix4).makeScale(1,1,-1)),i},r.prototype._transition=function(t,i){var r,u=this.isExtendedPosition(i),f=void 0!==i.zoom,e,o;return(this.prop.isCubemap?(u&&(console.warn("PhotoSphereViewer: cannot perform cubemap transition to different position."),u=!1),(r=this._createCubemap(.9)).material.forEach(function(n,i){n.map=t[i],n.transparent=!0,n.opacity=0})):((r=this._createSphere(.9)).material.map=t,r.material.transparent=!0,r.material.opacity=0,i.sphere_correction&&this._setSphereCorrection(r,i.sphere_correction)),u)&&(this.cleanPosition(i),e=new n.Vector3(0,1,0),r.rotateOnWorldAxis(e,i.longitude-this.prop.position.longitude),o=new n.Vector3(0,1,0).cross(this.camera.getWorldDirection()).normalize(),r.rotateOnWorldAxis(o,i.latitude-this.prop.position.latitude),(this.config.latitude_range||this.config.longitude_range)&&(this.config.longitude_range=this.config.latitude_range=null,console.warn("PhotoSphereViewer: trying to perform transition with longitude_range and/or latitude_range, ranges cleared."))),this.scene.add(r),this.needsUpdate(),new l({properties:{opacity:{start:0,end:1},zoom:f?{start:this.prop.zoom_lvl,end:i.zoom}:void 0},duration:this.config.transition.duration,easing:"outCubic",onTick:function(n){if(this.prop.isCubemap)for(var t=0;t<6;t++)r.material[t].opacity=n.opacity;else r.material.opacity=n.opacity;f&&this.zoom(n.zoom),this.needsUpdate()}.bind(this)}).then(function(){this._setTexture(t),this.scene.remove(r),r.geometry.dispose(),r.geometry=null,u&&this.rotate(i),i.sphere_correction?this._setSphereCorrection(this.mesh,i.sphere_correction):this._setSphereCorrection(this.mesh,{})}.bind(this))},r.prototype._reverseAutorotate=function(){var n=this,t=-this.config.anim_speed,i=this.config.longitude_range;this.config.longitude_range=null,new l({properties:{speed:{start:this.config.anim_speed,end:0}},duration:300,easing:"inSine",onTick:function(t){n.config.anim_speed=t.speed}}).then(function(){return new l({properties:{speed:{start:0,end:t}},duration:300,easing:"outSine",onTick:function(t){n.config.anim_speed=t.speed}})}).then(function(){n.config.longitude_range=i,n.config.anim_speed=t})},r.prototype._putPanoramaCache=function(n){if(!this.config.cache_texture)throw new o("Cannot add panorama to cache, cache_texture is disabled");var t=this.getPanoramaCache(n.panorama);t?(t.image=n.image,t.pano_data=n.pano_data):(this.prop.cache=this.prop.cache.slice(0,this.config.cache_texture-1),this.prop.cache.unshift(n)),this.trigger("panorama-cached",n.panorama)},r.prototype._stopAll=function(){this.stopAutorotate(),this.stopAnimation(),this.stopGyroscopeControl(),this.stopStereoView()},r.MOVE_THRESHOLD=4,r.ANGLE_THRESHOLD=.003,r.DBLCLICK_DELAY=300,r.INERTIA_WINDOW=300,r.SPHERE_RADIUS=100,r.SPHERE_VERTICES=64,r.CUBE_VERTICES=8,r.CUBE_MAP=[0,2,4,5,3,1],r.CUBE_HASHMAP=["left","right","top","bottom","back","front"],r.SYSTEM={loaded:!1,pixelRatio:1,isWebGLSupported:!1,isCanvasSupported:!1,deviceOrientationSupported:null,maxTextureWidth:0,mouseWheelEvent:null,fullscreenEvent:null},r.ICONS={},r.DEFAULTS={panorama:null,container:null,caption:null,usexmpdata:!0,pano_data:null,webgl:!0,min_fov:30,max_fov:90,default_fov:null,default_long:0,default_lat:0,sphere_correction:{pan:0,tilt:0,roll:0},longitude_range:null,latitude_range:null,move_speed:1,zoom_speed:2,time_anim:2e3,anim_speed:"2rpm",anim_lat:null,fisheye:!1,navbar:["autorotate","zoom","download","markers","caption","gyroscope","stereo","fullscreen"],tooltip:{offset:5,arrow_size:7,delay:100},lang:{autorotate:"Automatic rotation",zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",download:"Download",fullscreen:"Fullscreen",markers:"Markers",gyroscope:"Gyroscope",stereo:"Stereo view",stereo_notification:"Click anywhere to exit stereo view.",please_rotate:["Please rotate your device","(or tap to continue)"],two_fingers:["Use two fingers to navigate"]},mousewheel:!0,mousewheel_factor:1,mousemove:!0,mousemove_hover:!1,touchmove_two_fingers:!1,keyboard:{ArrowUp:"rotateLatitudeUp",ArrowDown:"rotateLatitudeDown",ArrowRight:"rotateLongitudeRight",ArrowLeft:"rotateLongitudeLeft",PageUp:"zoomIn",PageDown:"zoomOut","+":"zoomIn","-":"zoomOut"," ":"toggleAutorotate"},move_inertia:!0,click_event_on_marker:!1,transition:{duration:1500,loader:!0},loading_img:null,loading_txt:"Loading...",size:null,cache_texture:0,templates:{},markers:[],with_credentials:!1},r.TEMPLATES={markersList:'<div class="psv-markers-list-container">   <h1 class="psv-markers-list-title">{{= it.config.lang.markers }}<\/h1>   <ul class="psv-markers-list">   {{~ it.markers: marker }}     <li data-psv-marker="{{= marker.id }}" class="psv-markers-list-item {{? marker.className }}{{= marker.className }}{{?}}">       {{? marker.image }}<img class="psv-markers-list-image" src="{{= marker.image }}"/>{{?}}       <p class="psv-markers-list-name">{{? marker.tooltip }}{{= marker.tooltip.content }}{{?? marker.html }}{{= marker.html }}{{??}}{{= marker.id }}{{?}}<\/p>     <\/li>   {{~}}   <\/ul> <\/div>'},r.prototype._bindEvents=function(){window.addEventListener("resize",this),this.config.mousemove&&(this.hud.container.style.cursor="move",this.config.mousemove_hover?(this.hud.container.addEventListener("mouseenter",this),this.hud.container.addEventListener("mouseleave",this)):(this.hud.container.addEventListener("mousedown",this),window.addEventListener("mouseup",this)),this.hud.container.addEventListener("touchstart",this),window.addEventListener("touchend",this),this.hud.container.addEventListener("mousemove",this),this.hud.container.addEventListener("touchmove",this)),r.SYSTEM.fullscreenEvent&&document.addEventListener(r.SYSTEM.fullscreenEvent,this),this.config.mousewheel&&this.hud.container.addEventListener(r.SYSTEM.mouseWheelEvent,this),this.on("_side-reached",function(n){this.isAutorotateEnabled()&&("left"!==n&&"right"!==n||this._reverseAutorotate())})},r.prototype._unbindEvents=function(){window.removeEventListener("resize",this),this.config.mousemove&&(this.hud.container.removeEventListener("mousedown",this),this.hud.container.removeEventListener("mouseenter",this),this.hud.container.removeEventListener("touchstart",this),window.removeEventListener("mouseup",this),window.removeEventListener("touchend",this),this.hud.container.removeEventListener("mouseleave",this),this.hud.container.removeEventListener("mousemove",this),this.hud.container.removeEventListener("touchmove",this)),r.SYSTEM.fullscreenEvent&&document.removeEventListener(r.SYSTEM.fullscreenEvent,this),this.config.mousewheel&&this.hud.container.removeEventListener(r.SYSTEM.mouseWheelEvent,this),this.off("_side-reached")},r.prototype.handleEvent=function(n){switch(n.type){case"resize":u.throttle(this._onResize(),50);break;case"keydown":this._onKeyDown(n);break;case"mousedown":case"mouseenter":this._onMouseDown(n);break;case"touchstart":this._onTouchStart(n);break;case"mouseup":case"mouseleave":this._onMouseUp(n);break;case"touchend":this._onTouchEnd(n);break;case"mousemove":this._onMouseMove(n);break;case"touchmove":this._onTouchMove(n);break;case r.SYSTEM.fullscreenEvent:this._fullscreenToggled();break;case r.SYSTEM.mouseWheelEvent:this._onMouseWheel(n)}},r.prototype._onResize=function(){this.container.clientWidth===this.prop.size.width&&this.container.clientHeight===this.prop.size.height||(this.prop.size.width=parseInt(this.container.clientWidth),this.prop.size.height=parseInt(this.container.clientHeight),this.prop.aspect=this.prop.size.width/this.prop.size.height,this.needsUpdate(),this.renderer&&(this.stereoEffect||this.renderer).setSize(this.prop.size.width,this.prop.size.height),this.trigger("size-updated",this.getSize()))},r.prototype._onKeyDown=function(n){var t=0,i=0,r=0,f=u.getEventKey(n);switch(this.config.keyboard[f]){case"rotateLatitudeUp":i=.01;break;case"rotateLatitudeDown":i=-.01;break;case"rotateLongitudeRight":t=.01;break;case"rotateLongitudeLeft":t=-.01;break;case"zoomIn":r=1;break;case"zoomOut":r=-1;break;case"toggleAutorotate":this.toggleAutorotate()}0!==r?this.zoom(this.prop.zoom_lvl+r*this.config.zoom_speed):0===i&&0===t||this.rotate({longitude:this.prop.position.longitude+t*this.prop.move_speed*this.prop.hFov,latitude:this.prop.position.latitude+i*this.prop.move_speed*this.prop.vFov})},r.prototype._onMouseDown=function(n){this._startMove(n)},r.prototype._onMouseUp=function(n){this._stopMove(n),this.isStereoEnabled()&&this.stopStereoView()},r.prototype._onMouseMove=function(n){0!==n.buttons?(n.preventDefault(),this._move(n)):this.config.mousemove_hover&&this._moveAbsolute(n)},r.prototype._onTouchStart=function(n){1===n.touches.length?this.config.touchmove_two_fingers||this._startMove(n.touches[0]):2===n.touches.length&&this._startMoveZoom(n)},r.prototype._onTouchEnd=function(n){1===n.touches.length?this._stopMoveZoom():0===n.touches.length&&(this._stopMove(n.changedTouches[0]),this.config.touchmove_two_fingers&&this.overlay.hideOverlay())},r.prototype._onTouchMove=function(n){1===n.touches.length?this.config.touchmove_two_fingers?this.overlay.showOverlay({image:r.ICONS["gesture.svg"],text:this.config.lang.two_fingers[0]}):(n.preventDefault(),this._move(n.touches[0])):2===n.touches.length&&(n.preventDefault(),this._moveZoom(n))},r.prototype._startMove=function(n){this.stopAutorotate(),this.stopAnimation().then(function(){this.prop.mouse_x=this.prop.start_mouse_x=parseInt(n.clientX),this.prop.mouse_y=this.prop.start_mouse_y=parseInt(n.clientY),this.prop.moving=!0,this.prop.zooming=!1,this.prop.mouse_history.length=0,this._logMouseMove(n)}.bind(this))},r.prototype._startMoveZoom=function(n){var t=[{x:parseInt(n.touches[0].clientX),y:parseInt(n.touches[0].clientY)},{x:parseInt(n.touches[1].clientX),y:parseInt(n.touches[1].clientY)}];this.prop.pinch_dist=Math.sqrt(Math.pow(t[0].x-t[1].x,2)+Math.pow(t[0].y-t[1].y,2)),this.prop.mouse_x=this.prop.start_mouse_x=(t[0].x+t[1].x)/2,this.prop.mouse_y=this.prop.start_mouse_x=(t[0].y+t[1].y)/2,this.prop.moving=!0,this.prop.zooming=!0},r.prototype._stopMove=function(n){u.getClosest(n.target,".psv-hud")&&this.prop.moving&&(Math.abs(n.clientX-this.prop.start_mouse_x)<r.MOVE_THRESHOLD&&Math.abs(n.clientY-this.prop.start_mouse_y)<r.MOVE_THRESHOLD?(this._click(n),this.prop.moving=!1):this.config.move_inertia&&!this.isGyroscopeEnabled()?(this._logMouseMove(n),this._stopMoveInertia(n)):this.prop.moving=!1,this.prop.mouse_history.length=0)},r.prototype._stopMoveZoom=function(){this.prop.mouse_history.length=0,this.prop.moving=!1,this.prop.zooming=!1},r.prototype._stopMoveInertia=function(n){var t=n.clientX-this.prop.mouse_history[0][1],i=n.clientY-this.prop.mouse_history[0][2],u=Math.sqrt(t*t+i*i);this.prop.animation_promise=new l({properties:{clientX:{start:n.clientX,end:n.clientX+t},clientY:{start:n.clientY,end:n.clientY+i}},duration:u*r.INERTIA_WINDOW/100,easing:"outCirc",onTick:function(n){this._move(n,!1)}.bind(this)}).finally(function(){this.prop.moving=!1}.bind(this))},r.prototype._click=function(n){var e=this.container.getBoundingClientRect(),t={target:n.target,client_x:n.clientX,client_y:n.clientY,viewer_x:parseInt(n.clientX-e.left),viewer_y:parseInt(n.clientY-e.top)},o=this.viewerCoordsToVector3({x:t.viewer_x,y:t.viewer_y}),i,f;o&&(i=this.vector3ToSphericalCoords(o),(t.longitude=i.longitude,t.latitude=i.latitude,this.prop.isCubemap)||(f=this.sphericalCoordsToTextureCoords({longitude:t.longitude,latitude:t.latitude}),t.texture_x=f.x,t.texture_y=f.y),this.prop.dblclick_timeout?(Math.abs(this.prop.dblclick_data.client_x-t.client_x)<r.MOVE_THRESHOLD&&Math.abs(this.prop.dblclick_data.client_y-t.client_y)<r.MOVE_THRESHOLD&&this.trigger("dblclick",this.prop.dblclick_data),clearTimeout(this.prop.dblclick_timeout),this.prop.dblclick_timeout=null,this.prop.dblclick_data=null):(this.trigger("click",t),this.prop.dblclick_data=u.clone(t),this.prop.dblclick_timeout=setTimeout(function(){this.prop.dblclick_timeout=null,this.prop.dblclick_data=null}.bind(this),r.DBLCLICK_DELAY)))},r.prototype._move=function(n,t){if(this.prop.moving){var i=parseInt(n.clientX),u=parseInt(n.clientY),f=(i-this.prop.mouse_x)/this.prop.size.width*this.prop.move_speed*this.prop.hFov*r.SYSTEM.pixelRatio,e=(u-this.prop.mouse_y)/this.prop.size.height*this.prop.move_speed*this.prop.vFov*r.SYSTEM.pixelRatio;this.isGyroscopeEnabled()?this.prop.gyro_alpha_offset+=f:this.rotate({longitude:this.prop.position.longitude-f,latitude:this.prop.position.latitude+e}),this.prop.mouse_x=i,this.prop.mouse_y=u,!1!==t&&this._logMouseMove(n)}},r.prototype._moveAbsolute=function(n){this.prop.moving&&this.rotate({longitude:((n.clientX-this.container.offsetLeft)/this.container.offsetWidth-.5)*u.TwoPI,latitude:-((n.clientY-this.container.offsetTop)/this.container.offsetHeight-.5)*Math.PI})},r.prototype._moveZoom=function(n){if(this.prop.zooming&&this.prop.moving){var t=[{x:parseInt(n.touches[0].clientX),y:parseInt(n.touches[0].clientY)},{x:parseInt(n.touches[1].clientX),y:parseInt(n.touches[1].clientY)}],i=Math.sqrt(Math.pow(t[0].x-t[1].x,2)+Math.pow(t[0].y-t[1].y,2)),r=80*(i-this.prop.pinch_dist)/this.prop.size.width;this.zoom(this.prop.zoom_lvl+r),this._move({clientX:(t[0].x+t[1].x)/2,clientY:(t[0].y+t[1].y)/2}),this.prop.pinch_dist=i}},r.prototype._onMouseWheel=function(n){n.preventDefault(),n.stopPropagation();var t=5*u.normalizeWheel(n).spinY;0!==t&&this.zoom(this.prop.zoom_lvl-t*this.config.mousewheel_factor)},r.prototype._fullscreenToggled=function(){var n=this.isFullscreenEnabled();this.config.keyboard&&(n?this.startKeyboardControl():this.stopKeyboardControl()),this.trigger("fullscreen-updated",n)},r.prototype._logMouseMove=function(n){var u=Date.now(),i,t;for(this.prop.mouse_history.push([u,n.clientX,n.clientY]),i=null,t=0;t<this.prop.mouse_history.length;)this.prop.mouse_history[0][t]<u-r.INERTIA_WINDOW?this.prop.mouse_history.splice(t,1):i=(i&&this.prop.mouse_history[0][t]-i>r.INERTIA_WINDOW/10?(this.prop.mouse_history.splice(0,t),t=0):t++,this.prop.mouse_history[0][t])},r.prototype.load=function(){if(!this.config.panorama)throw new o("No value given for panorama.");return this.setPanorama(this.config.panorama,!1)},r.prototype.getPosition=function(){return{longitude:this.prop.position.longitude,latitude:this.prop.position.latitude}},r.prototype.getZoomLevel=function(){return this.prop.zoom_lvl},r.prototype.getSize=function(){return{width:this.prop.size.width,height:this.prop.size.height}},r.prototype.isAutorotateEnabled=function(){return!!this.prop.autorotate_cb},r.prototype.isGyroscopeEnabled=function(){return!!this.prop.orientation_cb},r.prototype.isStereoEnabled=function(){return!!this.stereoEffect},r.prototype.isFullscreenEnabled=function(){return u.isFullscreenEnabled(this.container)},r.prototype.needsUpdate=function(){this.prop.needsUpdate=!0},r.prototype.render=function(){this._render()},r.prototype.destroy=function(){window.cancelAnimationFrame(this.prop.main_reqid),this._stopAll(),this.stopKeyboardControl(),this.stopNoSleep(),this.exitFullscreen(),this.unlockOrientation(),this._unbindEvents(),this.tooltip&&this.tooltip.destroy(),this.notification&&this.notification.destroy(),this.hud&&this.hud.destroy(),this.loader&&this.loader.destroy(),this.navbar&&this.navbar.destroy(),this.panel&&this.panel.destroy(),this.overlay&&this.overlay.destroy(),this.scene&&u.cleanTHREEScene(this.scene),this.canvas_container&&this.container.removeChild(this.canvas_container),this.parent.removeChild(this.container),delete this.parent.photoSphereViewer,delete this.parent,delete this.container,delete this.loader,delete this.navbar,delete this.hud,delete this.panel,delete this.tooltip,delete this.notification,delete this.overlay,delete this.canvas_container,delete this.renderer,delete this.noSleep,delete this.scene,delete this.camera,delete this.mesh,delete this.raycaster,delete this.passes,delete this.config,this.prop.cache.length=0},r.prototype.setPanorama=function(n,t,i){var u,f,r;if(null!==this.prop.loading_promise)throw new o("Loading already in progress");return"boolean"==typeof t&&(i=t,t=void 0),t||this.scene?t||(t={}):t={longitude:this.config.default_long,latitude:this.config.default_lat,zoom:this.config.default_zoom_lvl,sphere_correction:this.config.sphere_correction},u=this.isExtendedPosition(t),f="zoom"in t,(u||f)&&this._stopAll(),this.config.panorama=n,r=function(){this.loader.hide(),this.canvas_container.style.opacity=1,this.prop.loading_promise=null}.bind(this),i&&this.config.transition&&this.scene?(this.config.transition.loader&&this.loader.show(),this.prop.loading_promise=this._loadTexture(this.config.panorama).then(function(n){return this.loader.hide(),this._transition(n,t)}.bind(this)).then(r,r)):(this.loader.show(),this.canvas_container&&(this.canvas_container.style.opacity=0),this.prop.loading_promise=this._loadTexture(this.config.panorama).then(function(n){this._setTexture(n),t.sphere_correction&&!this.prop.isCubemap&&this._setSphereCorrection(this.mesh,t.sphere_correction),u&&this.rotate(t),f&&this.zoom(t.zoom)}.bind(this)).then(r,r)),this.prop.loading_promise},r.prototype.startAutorotate=function(){this._stopAll(),this.prop.autorotate_cb=this._getAutorotateUpdate(),this.on("before-render",this.prop.autorotate_cb),this.trigger("autorotate",!0)},r.prototype._getAutorotateUpdate=function(){var n,t;return function(i){t=void 0===n?0:i-n,n=i,this.rotate({longitude:this.prop.position.longitude+this.config.anim_speed*t/1e3,latitude:this.prop.position.latitude-(this.prop.position.latitude-this.config.anim_lat)/200})}},r.prototype.stopAutorotate=function(){this.prop.start_timeout&&(window.clearTimeout(this.prop.start_timeout),this.prop.start_timeout=null),this.isAutorotateEnabled()&&(this.off("before-render",this.prop.autorotate_cb),this.prop.autorotate_cb=null,this.trigger("autorotate",!1))},r.prototype.toggleAutorotate=function(){this.isAutorotateEnabled()?this.stopAutorotate():this.startAutorotate()},r.prototype.startGyroscopeControl=function(){if(u.checkTHREE("DeviceOrientationControls"))return r.SYSTEM.deviceOrientationSupported.then(function(t){if(!t)return console.warn("PhotoSphereViewer: gyroscope not available"),Promise.reject();this._stopAll(),this.doControls=new n.DeviceOrientationControls(this.camera),this.doControls.alphaOffset=this.prop.position.longitude,this.doControls.update();var i=this.camera.getWorldDirection(new n.Vector3),r=this.vector3ToSphericalCoords(i);this.prop.gyro_alpha_offset=r.longitude,this.prop.orientation_cb=this._getOrientationUpdate(),this.on("before-render",this.prop.orientation_cb),this.trigger("gyroscope-updated",!0)}.bind(this));throw new o("Missing Three.js components: DeviceOrientationControls. Get them from three.js-examples package.");},r.prototype._getOrientationUpdate=function(){return function(){this.doControls.alphaOffset=this.prop.gyro_alpha_offset,this.doControls.update(),this.camera.getWorldDirection(this.prop.direction),this.prop.direction.multiplyScalar(r.SPHERE_RADIUS);var n=this.vector3ToSphericalCoords(this.prop.direction);this.prop.position.longitude=n.longitude,this.prop.position.latitude=n.latitude,this.needsUpdate()}},r.prototype.stopGyroscopeControl=function(){this.isGyroscopeEnabled()&&(this.off("before-render",this.prop.orientation_cb),this.prop.orientation_cb=null,this.doControls.disconnect(),this.doControls=null,this.trigger("gyroscope-updated",!1))},r.prototype.toggleGyroscopeControl=function(){this.isGyroscopeEnabled()?this.stopGyroscopeControl():this.startGyroscopeControl()},r.prototype.startNoSleep=function(){"NoSleep"in window?(this.noSleep||(this.noSleep=new NoSleep),this.noSleep.enable()):console.warn("PhotoSphereViewer: NoSleep is not available")},r.prototype.stopNoSleep=function(){this.noSleep&&this.noSleep.disable()},r.prototype.startStereoView=function(){if(!u.checkTHREE("DeviceOrientationControls","StereoEffect"))throw new o("Missing Three.js components: StereoEffect, DeviceOrientationControls. Get them from three.js-examples package.");this.startNoSleep(),this.enterFullscreen(),this.lockOrientation(),this.startGyroscopeControl().then(function(){this.stereoEffect=new n.StereoEffect(this.renderer),this.needsUpdate(),this.hud.hide(),this.navbar.hide(),this.panel.hidePanel(),this.trigger("stereo-updated",!0),this.notification.showNotification({content:this.config.lang.stereo_notification,timeout:3e3})}.bind(this),function(){this.unlockOrientation(),this.exitFullscreen(),this.stopNoSleep()}.bind(this))},r.prototype.stopStereoView=function(){this.isStereoEnabled()&&(this.stereoEffect=null,this.needsUpdate(),this.hud.show(),this.navbar.show(),this.unlockOrientation(),this.exitFullscreen(),this.stopNoSleep(),this.stopGyroscopeControl(),this.trigger("stereo-updated",!1))},r.prototype.lockOrientation=function(){var n,t=function(){this.isStereoEnabled()&&window.innerHeight>window.innerWidth&&this.overlay.showOverlay({image:r.ICONS["mobile-rotate.svg"],text:this.config.lang.please_rotate[0],subtext:this.config.lang.please_rotate[1]}),n&&window.clearTimeout(n)};window.screen&&window.screen.orientation?(window.screen.orientation.lock("landscape").then(null,t.bind(this)),n=setTimeout(t.bind(this),500)):t.apply(this)},r.prototype.unlockOrientation=function(){window.screen&&window.screen.orientation?window.screen.orientation.unlock():this.overlay.hideOverlay()},r.prototype.toggleStereoView=function(){this.isStereoEnabled()?this.stopStereoView():this.startStereoView()},r.prototype.rotate=function(n,t){this.cleanPosition(n),t||this.applyRanges(n).forEach(this.trigger.bind(this,"_side-reached")),this.prop.position.longitude=n.longitude,this.prop.position.latitude=n.latitude,this.needsUpdate(),this.trigger("position-updated",this.getPosition())},r.prototype.animate=function(n,t){var c,h;this._stopAll();var f,o=this.isExtendedPosition(n),s="zoom"in n,e={};if(o){this.cleanPosition(n),this.applyRanges(n);var i=this.prop.position,a=Math.abs(n.longitude-i.longitude),v=Math.abs(n.latitude-i.latitude);(r.ANGLE_THRESHOLD<=a||r.ANGLE_THRESHOLD<=v)&&(c=u.getShortestArc(this.prop.position.longitude,n.longitude),e.longitude={start:i.longitude,end:i.longitude+c},e.latitude={start:i.latitude,end:n.latitude},f=this.speedToDuration(t,u.getAngle(i,n)))}return s&&(h=Math.abs(n.zoom-this.prop.zoom_lvl),1<=h&&(e.zoom={start:this.prop.zoom_lvl,end:n.zoom},f||(f=this.speedToDuration(t,Math.PI/4*h/100)))),f?(this.prop.animation_promise=new l({properties:e,duration:f,easing:"inOutSine",onTick:function(n){o&&this.rotate(n,!0),s&&this.zoom(n.zoom)}.bind(this)}),this.prop.animation_promise):(o&&this.rotate(n),s&&this.zoom(n.zoom),l.resolve())},r.prototype.stopAnimation=function(){return this.prop.animation_promise?new Promise(function(n){this.prop.animation_promise.finally(n),this.prop.animation_promise.cancel(),this.prop.animation_promise=null}.bind(this)):Promise.resolve()},r.prototype.zoom=function(t){this.prop.zoom_lvl=u.bound(t,0,100),this.prop.vFov=this.config.max_fov+this.prop.zoom_lvl/100*(this.config.min_fov-this.config.max_fov),this.prop.hFov=n.Math.radToDeg(2*Math.atan(Math.tan(n.Math.degToRad(this.prop.vFov)/2)*this.prop.aspect)),this.needsUpdate(),this.trigger("zoom-updated",this.getZoomLevel())},r.prototype.zoomIn=function(){this.prop.zoom_lvl<100&&this.zoom(this.prop.zoom_lvl+this.config.zoom_speed)},r.prototype.zoomOut=function(){0<this.prop.zoom_lvl&&this.zoom(this.prop.zoom_lvl-this.config.zoom_speed)},r.prototype.resize=function(n){n.width&&(this.container.style.width=n.width),n.height&&(this.container.style.height=n.height),this._onResize()},r.prototype.enterFullscreen=function(){u.requestFullscreen(this.container)},r.prototype.exitFullscreen=function(){this.isFullscreenEnabled()&&u.exitFullscreen()},r.prototype.toggleFullscreen=function(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()},r.prototype.startKeyboardControl=function(){window.addEventListener("keydown",this)},r.prototype.stopKeyboardControl=function(){window.removeEventListener("keydown",this)},r.prototype.preloadPanorama=function(n){if(!this.config.cache_texture)throw new o("Cannot preload panorama, cache_texture is disabled");return this._loadTexture(n)},r.prototype.clearPanoramaCache=function(n){if(!this.config.cache_texture)throw new o("Cannot clear cache, cache_texture is disabled");if(n){for(var t=0,i=this.prop.cache.length;t<i;t++)if(this.prop.cache[t].panorama===n){this.prop.cache.splice(t,1);break}}else this.prop.cache.length=0},r.prototype.getPanoramaCache=function(n){if(!this.config.cache_texture)throw new o("Cannot query cache, cache_texture is disabled");return this.prop.cache.filter(function(t){return t.panorama===n}).shift()},r._loadSystem=function(){var n=r.SYSTEM;n.loaded=!0,n.pixelRatio=window.devicePixelRatio||1,n.isWebGLSupported=u.isWebGLSupported(),n.isCanvasSupported=u.isCanvasSupported(),n.maxTextureWidth=n.isWebGLSupported?u.getMaxTextureWidth():4096,n.mouseWheelEvent=u.mouseWheelEvent(),n.fullscreenEvent=u.fullscreenEvent(),n.deviceOrientationSupported=u.isDeviceOrientationSupported(),n.touchEnabled=u.isTouchEnabled()},r.prototype._setViewerSize=function(n){["width","height"].forEach(function(t){n[t]&&(/^[0-9.]+$/.test(n[t])&&(n[t]+="px"),this.parent.style[t]=n[t])},this)},r.prototype.speedToDuration=function(n,t){if(n&&"number"==typeof n)return Math.abs(n);var i=n?u.parseSpeed(n):this.config.anim_speed;return t/Math.abs(i)*1e3},r.prototype.textureCoordsToSphericalCoords=function(n){if(this.prop.isCubemap)throw new o("Unable to use texture coords with cubemap.");var t=(n.x+this.prop.pano_data.cropped_x)/this.prop.pano_data.full_width*u.TwoPI,i=(n.y+this.prop.pano_data.cropped_y)/this.prop.pano_data.full_height*Math.PI;return{longitude:t>=Math.PI?t-Math.PI:t+Math.PI,latitude:u.HalfPI-i}},r.prototype.sphericalCoordsToTextureCoords=function(n){if(this.prop.isCubemap)throw new o("Unable to use texture coords with cubemap.");var t=n.longitude/u.TwoPI*this.prop.pano_data.full_width,i=n.latitude/Math.PI*this.prop.pano_data.full_height;return{x:parseInt(n.longitude<Math.PI?t+this.prop.pano_data.full_width/2:t-this.prop.pano_data.full_width/2)-this.prop.pano_data.cropped_x,y:parseInt(this.prop.pano_data.full_height/2-i)-this.prop.pano_data.cropped_y}},r.prototype.sphericalCoordsToVector3=function(t){return new n.Vector3(r.SPHERE_RADIUS*-Math.cos(t.latitude)*Math.sin(t.longitude),r.SPHERE_RADIUS*Math.sin(t.latitude),r.SPHERE_RADIUS*Math.cos(t.latitude)*Math.cos(t.longitude))},r.prototype.vector3ToSphericalCoords=function(n){var i=Math.acos(n.y/Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z)),t=Math.atan2(n.x,n.z);return{longitude:t<0?-t:u.TwoPI-t,latitude:u.HalfPI-i}},r.prototype.viewerCoordsToVector3=function(t){var r=new n.Vector2(2*t.x/this.prop.size.width-1,-2*t.y/this.prop.size.height+1),i;return this.raycaster.setFromCamera(r,this.camera),i=this.raycaster.intersectObjects(this.scene.children),1===i.length?i[0].point:null},r.prototype.vector3ToViewerCoords=function(n){return(n=n.clone()).project(this.camera),{x:parseInt((n.x+1)/2*this.prop.size.width),y:parseInt((1-n.y)/2*this.prop.size.height)}},r.prototype.cleanPosition=function(n){n.hasOwnProperty("x")&&n.hasOwnProperty("y")&&u.deepmerge(n,this.textureCoordsToSphericalCoords(n)),n.longitude=u.parseAngle(n.longitude),n.latitude=u.parseAngle(n.latitude,!0)},r.prototype.cleanSphereCorrection=function(n){n.pan=u.parseAngle(n.pan||0),n.tilt=u.parseAngle(n.tilt||0,!0),n.roll=u.parseAngle(n.roll||0,!0,!1)},r.prototype.isExtendedPosition=function(n){return[["x","y"],["longitude","latitude"]].some(function(t){return t[0]in n&&t[1]in n})},r.prototype.applyRanges=function(t){var i,f,r=[];return this.config.longitude_range&&(i=u.clone(this.config.longitude_range),f=n.Math.degToRad(this.prop.hFov)/2,i[0]=u.parseAngle(i[0]+f),i[1]=u.parseAngle(i[1]-f),i[0]>i[1]?t.longitude>i[1]&&t.longitude<i[0]&&(t.longitude>i[0]/2+i[1]/2?(t.longitude=i[0],r.push("left")):(t.longitude=i[1],r.push("right"))):t.longitude<i[0]?(t.longitude=i[0],r.push("left")):t.longitude>i[1]&&(t.longitude=i[1],r.push("right"))),this.config.latitude_range&&(i=u.clone(this.config.latitude_range),f=n.Math.degToRad(this.prop.vFov)/2,i[0]=u.parseAngle(Math.min(i[0]+f,i[1]),!0),i[1]=u.parseAngle(Math.max(i[1]-f,i[0]),!0),t.latitude<i[0]?(t.latitude=i[0],r.push("bottom")):t.latitude>i[1]&&(t.latitude=i[1],r.push("top"))),r},e.className=null,e.publicMethods=[],e.prototype.create=function(){this.container=document.createElement("div"),this.constructor.className&&(this.container.className=this.constructor.className),this.parent.container.appendChild(this.container)},e.prototype.destroy=function(){this.parent.container.removeChild(this.container),this.constructor.publicMethods&&this.constructor.publicMethods.forEach(function(n){delete this.psv[n]},this),delete this.container,delete this.psv,delete this.parent},e.prototype.hide=function(){this.container.style.display="none",this.visible=!1},e.prototype.show=function(){this.container.style.display="",this.visible=!0},((s.prototype=Object.create(e.prototype)).constructor=s).className="psv-hud",s.publicMethods=["addMarker","removeMarker","updateMarker","clearMarkers","getMarker","getCurrentMarker","gotoMarker","hideMarker","showMarker","toggleMarker","toggleMarkersList","showMarkersList","hideMarkersList"],s.prototype.create=function(){e.prototype.create.call(this),this.svgContainer=document.createElementNS(u.svgNS,"svg"),this.svgContainer.setAttribute("class","psv-hud-svg-container"),this.container.appendChild(this.svgContainer),this.container.addEventListener("mouseenter",this,!0),this.container.addEventListener("mouseleave",this,!0),this.container.addEventListener("mousemove",this,!0),this.psv.on("click",this),this.psv.on("dblclick",this),this.psv.on("render",this),this.psv.on("open-panel",this),this.psv.on("close-panel",this)},s.prototype.destroy=function(){this.clearMarkers(!1),this.container.removeEventListener("mouseenter",this),this.container.removeEventListener("mouseleave",this),this.container.removeEventListener("mousemove",this),this.psv.off("click",this),this.psv.off("dblclick",this),this.psv.off("render",this),this.psv.off("open-panel",this),this.psv.off("close-panel",this),delete this.svgContainer,e.prototype.destroy.call(this)},s.prototype.handleEvent=function(n){switch(n.type){case"mouseenter":this._onMouseEnter(n);break;case"mouseleave":this._onMouseLeave(n);break;case"mousemove":this._onMouseMove(n);break;case"click":this._onClick(n.args[0],n,!1);break;case"dblclick":this._onClick(n.args[0],n,!0);break;case"render":this.renderMarkers();break;case"open-panel":this._onPanelOpened();break;case"close-panel":this._onPanelClosed()}},s.prototype.addMarker=function(n,t){if(!n.id)throw new o("missing marker id");if(this.markers[n.id])throw new o('marker "'+n.id+'" already exists');var i=new h(n,this.psv);return i.isNormal()?this.container.appendChild(i.$el):this.svgContainer.appendChild(i.$el),this.markers[i.id]=i,!1!==t&&this.renderMarkers(),i},s.prototype.getMarker=function(n){var t="object"==typeof n?n.id:n;if(!this.markers[t])throw new o('cannot find marker "'+t+'"');return this.markers[t]},s.prototype.getCurrentMarker=function(){return this.currentMarker},s.prototype.updateMarker=function(n,t){var i=this.getMarker(n);return i.update(n),!1!==t&&this.renderMarkers(),i},s.prototype.removeMarker=function(n,t){(n=this.getMarker(n)).isNormal()?this.container.removeChild(n.$el):this.svgContainer.removeChild(n.$el),this.hoveringMarker===n&&this.psv.tooltip.hideTooltip(),n.destroy(),delete this.markers[n.id],!1!==t&&this.renderMarkers()},s.prototype.clearMarkers=function(n){Object.keys(this.markers).forEach(function(n){this.removeMarker(n,!1)},this),!1!==n&&this.renderMarkers()},s.prototype.gotoMarker=function(n,t){return n=this.getMarker(n),this.psv.animate(n,t).then(function(){this.psv.trigger("goto-marker-done",n)}.bind(this))},s.prototype.hideMarker=function(n){this.getMarker(n).visible=!1,this.renderMarkers()},s.prototype.showMarker=function(n){this.getMarker(n).visible=!0,this.renderMarkers()},s.prototype.toggleMarker=function(n){this.getMarker(n).visible^=!0,this.renderMarkers()},s.prototype.toggleMarkersList=function(){this.prop.panelOpened?this.hideMarkersList():this.showMarkersList()},s.prototype.showMarkersList=function(){var n=[],t;u.forEach(this.markers,function(t){n.push(t)}),t=this.psv.config.templates.markersList({markers:this.psv.change("render-markers-list",n),config:this.psv.config}),this.prop.panelOpening=!0,this.psv.panel.showPanel(t,!0),this.psv.panel.container.querySelector(".psv-markers-list").addEventListener("click",this._onClickItem.bind(this))},s.prototype.hideMarkersList=function(){this.prop.panelOpened&&this.psv.panel.hidePanel()},s.prototype.renderMarkers=function(){if(this.visible){var t=this.psv.isGyroscopeEnabled()?n.Math.radToDeg(this.psv.camera.rotation.z):0;u.forEach(this.markers,function(n){var f=n.visible,e,o,i,r;f&&n.isPoly()?(e=this._getPolyPositions(n),(f=e.length>(n.isPolygon()?2:1))&&(n.position2D=this._getPolyDimensions(n,e),o=e.map(function(n){return n.x+","+n.y}).join(" "),n.$el.setAttributeNS(null,"points",o))):f&&(i=this._getMarkerPosition(n),(f=this._isMarkerVisible(n,i))&&(n.position2D=i,r=n.getScale(this.psv.getZoomLevel()),n.isSvg()?n.$el.setAttributeNS(null,"transform","translate("+i.x+", "+i.y+")"+(1!==r?" scale("+r+", "+r+")":"")+(!n.lockRotation&&t?" rotate("+t+")":"")):n.$el.style.transform="translate3D("+i.x+"px, "+i.y+"px, 0px)"+(1!==r?" scale("+r+", "+r+")":"")+(!n.lockRotation&&t?" rotateZ("+t+"deg)":""))),u.toggleClass(n.$el,"psv-marker--visible",f)}.bind(this))}},s.prototype._isMarkerVisible=function(n,t){return 0<n.position3D.dot(this.psv.prop.direction)&&0<=t.x+n.width&&t.x-n.width<=this.psv.prop.size.width&&0<=t.y+n.height&&t.y-n.height<=this.psv.prop.size.height},s.prototype._getMarkerPosition=function(n){var r,t,i;return n._dynamicSize&&(u.toggleClass(n.$el,"psv-marker--transparent",!0),r=n.$el.style.transform,n.$el.style.transform=null,t=n.$el.getBoundingClientRect(),n.$el.style.transform=r,u.toggleClass(n.$el,"psv-marker--transparent",!1),n.width=t.right-t.left,n.height=t.bottom-t.top),i=this.psv.vector3ToViewerCoords(n.position3D),i.x-=n.width*n.anchor.left,i.y-=n.height*n.anchor.top,i},s.prototype._getPolyPositions=function(n){var i=n.positions3D.length,t=n.positions3D.map(function(n){return{vector:n,visible:0<n.dot(this.psv.prop.direction)}},this),r=[];return t.forEach(function(n,u){n.visible||[0===u?t[i-1]:t[u-1],u===i-1?t[0]:t[u+1]].forEach(function(t){t.visible&&r.push({visible:t,invisible:n,index:u})})}),r.reverse().forEach(function(n){t.splice(n.index,0,{vector:this._getPolyIntermediaryPoint(n.visible.vector,n.invisible.vector),visible:!0})},this),t.filter(function(n){return n.visible}).map(function(n){return this.psv.vector3ToViewerCoords(n.vector)},this)},s.prototype._getPolyIntermediaryPoint=function(t,i){var u=this.psv.prop.direction.clone().normalize(),o=(new n.Vector3).crossVectors(t,i).normalize(),f=(new n.Vector3).crossVectors(o,t).normalize(),e=(new n.Vector3).addVectors(t.clone().multiplyScalar(-u.dot(f)),f.clone().multiplyScalar(u.dot(t))).normalize(),s=(new n.Vector3).crossVectors(e,u);return e.applyAxisAngle(s,.01).multiplyScalar(r.SPHERE_RADIUS)},s.prototype._getPolyDimensions=function(n,t){var i=1/0,r=1/0,u=-1/0,f=-1/0;return t.forEach(function(n){i=Math.min(i,n.x),r=Math.min(r,n.y),u=Math.max(u,n.x),f=Math.max(f,n.y)}),n.width=u-i,n.height=f-r,{x:i,y:r}},s.prototype._onMouseEnter=function(n){var t;n.target&&(t=n.target.psvMarker)&&!t.isPoly()&&(this.hoveringMarker=t,this.psv.trigger("over-marker",t),t.tooltip&&this.psv.tooltip.showTooltip({content:t.tooltip.content,position:t.tooltip.position,left:t.position2D.x,top:t.position2D.y,box:{width:t.width,height:t.height}}))},s.prototype._onMouseLeave=function(n){var t;if(n.target&&(t=n.target.psvMarker)){if(t.isPoly()&&n.relatedTarget&&u.hasParent(n.relatedTarget,this.psv.tooltip.container))return;this.psv.trigger("leave-marker",t),this.hoveringMarker=null,this.psv.tooltip.hideTooltip()}},s.prototype._onMouseMove=function(n){var t,i;this.psv.prop.moving||(n.target&&(t=n.target.psvMarker)&&t.isPoly()||n.target&&u.hasParent(n.target,this.psv.tooltip.container)&&(t=this.hoveringMarker)?(this.hoveringMarker||(this.psv.trigger("over-marker",t),this.hoveringMarker=t),i=this.psv.container.getBoundingClientRect(),t.tooltip&&this.psv.tooltip.showTooltip({content:t.tooltip.content,position:t.tooltip.position,top:n.clientY-i.top-this.psv.config.tooltip.arrow_size/2,left:n.clientX-i.left-this.psv.config.tooltip.arrow_size,box:{width:2*this.psv.config.tooltip.arrow_size,height:2*this.psv.config.tooltip.arrow_size}})):this.hoveringMarker&&this.hoveringMarker.isPoly()&&(this.psv.trigger("leave-marker",this.hoveringMarker),this.hoveringMarker=null,this.psv.tooltip.hideTooltip()))},s.prototype._onClick=function(n,t,i){var r;n.target&&(r=u.getClosest(n.target,".psv-marker"))&&r.psvMarker?(this.currentMarker=r.psvMarker,this.psv.trigger("select-marker",this.currentMarker,i),this.psv.config.click_event_on_marker?n.marker=r.psvMarker:t.stopPropagation()):this.currentMarker&&(this.psv.trigger("unselect-marker",this.currentMarker),this.currentMarker=null),r&&r.psvMarker&&r.psvMarker.content?this.psv.panel.showPanel(r.psvMarker.content):this.psv.panel.prop.opened&&(t.stopPropagation(),this.psv.panel.hidePanel())},s.prototype._onClickItem=function(n){var t,i;n.target&&(t=u.getClosest(n.target,"li"))&&t.dataset.psvMarker&&(i=this.getMarker(t.dataset.psvMarker),this.psv.trigger("select-marker-list",i),this.gotoMarker(i,1e3),this.psv.panel.hidePanel())},s.prototype._onPanelOpened=function(){this.prop.panelOpening?(this.prop.panelOpening=!1,this.prop.panelOpened=!0):this.prop.panelOpened=!1,this.prop.markersButton&&this.prop.markersButton.toggleActive(this.prop.panelOpened)},s.prototype._onPanelClosed=function(){this.prop.panelOpened=!1,this.prop.panelOpening=!1,this.prop.markersButton&&this.prop.markersButton.toggleActive(!1)},((ut.prototype=Object.create(e.prototype)).constructor=ut).className="psv-loader-container",ut.prototype.create=function(){var n,t,i;e.prototype.create.call(this),t=r.SYSTEM.pixelRatio,(this.loader=document.createElement("div"),this.loader.className="psv-loader",this.container.appendChild(this.loader),this.canvas=document.createElement("canvas"),this.canvas.className="psv-loader-canvas",this.canvas.width=this.loader.clientWidth*t,this.canvas.height=this.loader.clientWidth*t,this.loader.appendChild(this.canvas),this.tickness=(this.loader.offsetWidth-this.loader.clientWidth)/2*t,this.psv.config.loading_img?((n=document.createElement("img")).className="psv-loader-image",n.src=this.psv.config.loading_img):this.psv.config.loading_txt&&((n=document.createElement("div")).className="psv-loader-text",n.innerHTML=this.psv.config.loading_txt),n)&&(i=Math.round(Math.sqrt(2*Math.pow((this.canvas.width/2-this.tickness/2)/t,2))),n.style.maxWidth=i+"px",n.style.maxHeight=i+"px",this.loader.appendChild(n))},ut.prototype.destroy=function(){delete this.loader,delete this.canvas,e.prototype.destroy.call(this)},ut.prototype.setProgress=function(n){var t=this.canvas.getContext("2d");t.clearRect(0,0,this.canvas.width,this.canvas.height),t.lineWidth=this.tickness,t.strokeStyle=u.getStyle(this.loader,"color"),t.beginPath(),t.arc(this.canvas.width/2,this.canvas.height/2,this.canvas.width/2-this.tickness/2,-Math.PI/2,n/50*Math.PI-Math.PI/2),t.stroke()},((k.prototype=Object.create(e.prototype)).constructor=k).className="psv-navbar psv-navbar--open",k.publicMethods=["showNavbar","hideNavbar","toggleNavbar","getNavbarButton"],k.prototype.create=function(){e.prototype.create.call(this),this.config.forEach(function(n){if("object"==typeof n)this.items.push(new ft(this,n));else switch(n){case p.id:this.items.push(new p(this));break;case c.id:this.items.push(new c(this));break;case it.id:this.items.push(new it(this));break;case rt.id:this.items.push(new rt(this));break;case y.id:this.items.push(new y(this));break;case b.id:this.items.push(new b(this));break;case w.id:this.items.push(new w(this));break;case"caption":this.items.push(new d(this,this.psv.config.caption));break;default:if(0!==n.indexOf("spacer"))throw new o("Unknown button "+n);console.warn("PhotoSphereViewer: navbar spacers have been removed.")}},this)},k.prototype.destroy=function(){this.items.forEach(function(n){n.destroy()}),this.items.length=0,delete this.config,e.prototype.destroy.call(this)},k.prototype.getNavbarButton=function(n,t){var i=null;return this.items.some(function(t){return t.id===n&&(i=t,!0)}),i||t||console.warn('PhotoSphereViewer: button "'+n+'" not found in the navbar.'),i},k.prototype.showNavbar=function(){this.toggleNavbar(!0)},k.prototype.hideNavbar=function(){this.toggleNavbar(!1)},k.prototype.toggleNavbar=function(n){u.toggleClass(this.container,"psv-navbar--open",n)},((d.prototype=Object.create(e.prototype)).constructor=d).className="psv-caption",d.publicMethods=["setCaption"],d.prototype.create=function(){e.prototype.create.call(this),this.button=new tt(this),this.button.hide(),this.content=document.createElement("div"),this.content.className="psv-caption-content",this.container.appendChild(this.content),window.addEventListener("resize",this)},d.prototype.destroy=function(){window.removeEventListener("resize",this),delete this.content,e.prototype.destroy.call(this)},d.prototype.handleEvent=function(n){switch(n.type){case"resize":this._onResize()}},d.prototype.setCaption=function(n){this.prop.caption=n||"",this.content.innerHTML=this.prop.caption,this.content.style.display="",this.prop.width=this.content.offsetWidth,this._onResize()},d.prototype._onResize=function(){parseInt(u.getStyle(this.container,"width"))>=this.prop.width?(this.button.hide(),this.content.style.display=""):(this.button.show(),this.content.style.display="none")},((g.prototype=Object.create(e.prototype)).constructor=g).className="psv-notification",g.publicMethods=["showNotification","hideNotification","isNotificationVisible"],g.prototype.create=function(){e.prototype.create.call(this),this.content=document.createElement("div"),this.content.className="psv-notification-content",this.container.appendChild(this.content),this.content.addEventListener("click",this.hideNotification.bind(this))},g.prototype.destroy=function(){delete this.content,e.prototype.destroy.call(this)},g.prototype.isNotificationVisible=function(){return this.container.classList.contains("psv-notification--visible")},g.prototype.showNotification=function(n){"string"==typeof n&&(n={content:n}),this.content.innerHTML=n.content,this.container.classList.add("psv-notification--visible"),this.psv.trigger("show-notification"),n.timeout&&setTimeout(this.hideNotification.bind(this),n.timeout)},g.prototype.hideNotification=function(){this.isNotificationVisible()&&(this.container.classList.remove("psv-notification--visible"),this.psv.trigger("hide-notification"))},((nt.prototype=Object.create(e.prototype)).constructor=nt).className="psv-overlay",nt.publicMethods=["showOverlay","hideOverlay","isOverlayVisible"],nt.prototype.create=function(){e.prototype.create.call(this),this.image=document.createElement("div"),this.image.className="psv-overlay-image",this.container.appendChild(this.image),this.text=document.createElement("div"),this.text.className="psv-overlay-text",this.container.appendChild(this.text),this.subtext=document.createElement("div"),this.subtext.className="psv-overlay-subtext",this.container.appendChild(this.subtext),this.container.addEventListener("click",this.hideOverlay.bind(this))},nt.prototype.destroy=function(){delete this.image,delete this.text,delete this.subtext,e.prototype.destroy.call(this)},nt.prototype.isOverlayVisible=function(){return this.visible},nt.prototype.showOverlay=function(n){"string"==typeof n&&(n={text:n}),this.image.innerHTML=n.image||"",this.text.innerHTML=n.text||"",this.subtext.innerHTML=n.subtext||"",this.show(),this.psv.trigger("show-overlay")},nt.prototype.hideOverlay=function(){this.isOverlayVisible()&&(this.hide(),this.psv.trigger("hide-overlay"))},((v.prototype=Object.create(e.prototype)).constructor=v).className="psv-panel",v.publicMethods=["showPanel","hidePanel"],v.prototype.create=function(){e.prototype.create.call(this),this.container.innerHTML='<div class="psv-panel-resizer"><\/div><div class="psv-panel-close-button"><\/div><div class="psv-panel-content"><\/div>',this.content=this.container.querySelector(".psv-panel-content"),this.container.querySelector(".psv-panel-close-button").addEventListener("click",this.hidePanel.bind(this)),this.psv.config.mousewheel&&this.container.addEventListener(r.SYSTEM.mouseWheelEvent,function(n){n.stopPropagation()});var n=this.container.querySelector(".psv-panel-resizer");n.addEventListener("mousedown",this),n.addEventListener("touchstart",this),this.psv.container.addEventListener("mouseup",this),this.psv.container.addEventListener("touchend",this),this.psv.container.addEventListener("mousemove",this),this.psv.container.addEventListener("touchmove",this)},v.prototype.destroy=function(){this.psv.container.removeEventListener("mousemove",this),this.psv.container.removeEventListener("touchmove",this),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),delete this.prop,delete this.content,e.prototype.destroy.call(this)},v.prototype.handleEvent=function(n){switch(n.type){case"mousedown":this._onMouseDown(n);break;case"touchstart":this._onTouchStart(n);break;case"mousemove":this._onMouseMove(n);break;case"touchmove":this._onTouchMove(n);break;case"mouseup":case"touchend":this._onMouseUp(n)}},v.prototype.showPanel=function(n,t){this.content.innerHTML=n,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),u.toggleClass(this.content,"psv-panel-content--no-margin",!0===t),this.prop.opened=!0,this.psv.trigger("open-panel")},v.prototype.hidePanel=function(){this.content.innerHTML=null,this.prop.opened=!1,this.container.classList.remove("psv-panel--open"),this.psv.trigger("close-panel")},v.prototype._onMouseDown=function(n){n.stopPropagation(),this._startResize(n)},v.prototype._onTouchStart=function(n){n.stopPropagation(),this._startResize(n.changedTouches[0])},v.prototype._onMouseUp=function(n){this.prop.mousedown&&(n.stopPropagation(),this.prop.mousedown=!1,this.content.classList.remove("psv-panel-content--no-interaction"))},v.prototype._onMouseMove=function(n){this.prop.mousedown&&(n.stopPropagation(),this._resize(n))},v.prototype._onTouchMove=function(n){this.prop.mousedown&&this._resize(n.touches[0])},v.prototype._startResize=function(n){this.prop.mouse_x=parseInt(n.clientX),this.prop.mouse_y=parseInt(n.clientY),this.prop.mousedown=!0,this.content.classList.add("psv-panel-content--no-interaction")},v.prototype._resize=function(n){var t=parseInt(n.clientX),i=parseInt(n.clientY);this.container.style.width=this.container.offsetWidth-(t-this.prop.mouse_x)+"px",this.prop.mouse_x=t,this.prop.mouse_y=i},((a.prototype=Object.create(e.prototype)).constructor=a).className="psv-tooltip",a.publicMethods=["showTooltip","hideTooltip","isTooltipVisible"],a.leftMap={0:"left",.5:"center",1:"right"},a.topMap={0:"top",.5:"center",1:"bottom"},a.prototype.create=function(){e.prototype.create.call(this),this.container.innerHTML='<div class="psv-tooltip-arrow"><\/div><div class="psv-tooltip-content"><\/div>',this.container.style.top="-1000px",this.container.style.left="-1000px",this.content=this.container.querySelector(".psv-tooltip-content"),this.arrow=this.container.querySelector(".psv-tooltip-arrow"),this.psv.on("render",this)},a.prototype.destroy=function(){this.psv.off("render",this),delete this.config,delete this.prop,e.prototype.destroy.call(this)},a.prototype.handleEvent=function(n){switch(n.type){case"render":this.hideTooltip()}},a.prototype.isTooltipVisible=function(){return this.container.classList.contains("psv-tooltip--visible")},a.prototype.showTooltip=function(n){var f,s,h,e,t,r;this.prop.timeout&&(window.clearTimeout(this.prop.timeout),this.prop.timeout=null);var c=this.isTooltipVisible(),i=this.container,v=this.content,l=this.arrow;if(n.position||(n.position=["top","center"]),n.box||(n.box={width:0,height:0}),"string"==typeof n.position){if(f=u.parsePosition(n.position),!(f.left in a.leftMap&&f.top in a.topMap))throw new o('unable to parse tooltip position "'+n.position+'"');n.position=[a.topMap[f.top],a.leftMap[f.left]]}if("center"===n.position[0]&&"center"===n.position[1])throw new o('unable to parse tooltip position "center center"');if(c)for(s=i.classList.length-1;0<=s;s--)h=i.classList.item(s),"psv-tooltip"!==h&&"psv-tooltip--visible"!==h&&i.classList.remove(h);else i.className="psv-tooltip";n.className&&u.addClasses(i,n.className),v.innerHTML=n.content,i.style.top="0px",i.style.left="0px",e=i.getBoundingClientRect(),t={posClass:n.position.slice(),width:e.right-e.left,height:e.bottom-e.top,top:0,left:0,arrow_top:0,arrow_left:0},this._computeTooltipPosition(t,n),r=!1,t.top<this.config.offset?(t.posClass[0]="bottom",r=!0):t.top+t.height>this.psv.prop.size.height-this.config.offset&&(t.posClass[0]="top",r=!0),t.left<this.config.offset?(t.posClass[1]="right",r=!0):t.left+t.width>this.psv.prop.size.width-this.config.offset&&(t.posClass[1]="left",r=!0),r&&this._computeTooltipPosition(t,n),i.style.top=t.top+"px",i.style.left=t.left+"px",l.style.top=t.arrow_top+"px",l.style.left=t.arrow_left+"px",i.classList.add("psv-tooltip--"+t.posClass.join("-")),c||(this.prop.timeout=window.setTimeout(function(){i.classList.add("psv-tooltip--visible"),this.prop.timeout=null,this.psv.trigger("show-tooltip")}.bind(this),this.config.delay))},a.prototype.hideTooltip=function(){this.prop.timeout&&(window.clearTimeout(this.prop.timeout),this.prop.timeout=null),this.isTooltipVisible()&&(this.container.classList.remove("psv-tooltip--visible"),this.prop.timeout=window.setTimeout(function(){this.content.innerHTML=null,this.container.style.top="-1000px",this.container.style.left="-1000px",this.prop.timeout=null}.bind(this),this.config.delay),this.psv.trigger("hide-tooltip"))},a.prototype._computeTooltipPosition=function(n,t){var i=!1;switch(n.posClass[0]){case"bottom":n.top=t.top+t.box.height+this.config.offset+this.config.arrow_size,n.arrow_top=2*-this.config.arrow_size,i=!0;break;case"center":n.top=t.top+t.box.height/2-n.height/2,n.arrow_top=n.height/2-this.config.arrow_size;break;case"top":n.top=t.top-n.height-this.config.offset-this.config.arrow_size,n.arrow_top=n.height,i=!0}switch(n.posClass[1]){case"right":n.arrow_left=i?(n.left=t.left+t.box.width/2-this.config.offset-this.config.arrow_size,this.config.offset):(n.left=t.left+t.box.width+this.config.offset+this.config.arrow_size,2*-this.config.arrow_size);break;case"center":n.left=t.left+t.box.width/2-n.width/2,n.arrow_left=n.width/2-this.config.arrow_size;break;case"left":n.arrow_left=i?(n.left=t.left-n.width+t.box.width/2+this.config.offset+this.config.arrow_size,n.width-this.config.offset-2*this.config.arrow_size):(n.left=t.left-n.width-this.config.offset-this.config.arrow_size,n.width)}},((f.prototype=Object.create(e.prototype)).constructor=f).id=null,f.icon=null,f.iconActive=null,f.prototype.create=function(){e.prototype.create.call(this),this.constructor.icon&&this._setIcon(this.constructor.icon),this.id&&this.psv.config.lang[this.id]&&(this.container.title=this.psv.config.lang[this.id]),this.container.addEventListener("click",function(n){this.enabled&&this._onClick(),n.stopPropagation()}.bind(this));var n=this.supported();"function"==typeof n.then?(this.hide(),n.then(function(n){n&&this.show()}.bind(this))):n||this.hide()},f.prototype.destroy=function(){e.prototype.destroy.call(this)},f.prototype.supported=function(){return!0},f.prototype.toggleActive=function(n){u.toggleClass(this.container,"psv-button--active",n),this.constructor.iconActive&&this._setIcon(n?this.constructor.iconActive:this.constructor.icon)},f.prototype.disable=function(){this.container.classList.add("psv-button--disabled"),this.enabled=!1},f.prototype.enable=function(){this.container.classList.remove("psv-button--disabled"),this.enabled=!0},f.prototype._setIcon=function(n,t){t||(t=this.container),n?(t.innerHTML=r.ICONS[n],t.querySelector("svg").setAttribute("class","psv-button-svg")):t.innerHTML=""},f.prototype._onClick=function(){},((p.prototype=Object.create(f.prototype)).constructor=p).id="autorotate",p.className="psv-button psv-button--hover-scale psv-autorotate-button",p.icon="play.svg",p.iconActive="play-active.svg",p.prototype.create=function(){f.prototype.create.call(this),this.psv.on("autorotate",this)},p.prototype.destroy=function(){this.psv.off("autorotate",this),f.prototype.destroy.call(this)},p.prototype.handleEvent=function(n){switch(n.type){case"autorotate":this.toggleActive(n.args[0])}},p.prototype._onClick=function(){this.psv.toggleAutorotate()},((tt.prototype=Object.create(f.prototype)).constructor=tt).id="markers",tt.className="psv-button psv-button--hover-scale psv-caption-button",tt.icon="info.svg",tt.prototype.create=function(){f.prototype.create.call(this),this.psv.on("hide-notification",this)},tt.prototype.destroy=function(){this.psv.off("hide-notification",this),f.prototype.destroy.call(this)},tt.prototype.handleEvent=function(n){switch(n.type){case"hide-notification":this.toggleActive(!1)}},tt.prototype._onClick=function(){this.psv.isNotificationVisible()?this.psv.hideNotification():(this.psv.showNotification(this.parent.prop.caption),this.toggleActive(!0))},((ft.prototype=Object.create(f.prototype)).constructor=ft).className="psv-button psv-custom-button",ft.prototype.create=function(){f.prototype.create.call(this),this.config.className&&u.addClasses(this.container,this.config.className),this.config.title&&(this.container.title=this.config.title),this.config.content&&(this.container.innerHTML=this.config.content),!1!==this.config.enabled&&!0!==this.config.disabled||this.disable(),!1!==this.config.visible&&!0!==this.config.hidden||this.hide()},ft.prototype.destroy=function(){delete this.config,f.prototype.destroy.call(this)},ft.prototype._onClick=function(){this.config.onClick&&this.config.onClick.apply(this.psv)},((it.prototype=Object.create(f.prototype)).constructor=it).id="download",it.className="psv-button psv-button--hover-scale psv-download-button",it.icon="download.svg",it.prototype._onClick=function(){var n=document.createElement("a");n.href=this.psv.config.panorama,n.download=this.psv.config.panorama,this.psv.container.appendChild(n),n.click()},((y.prototype=Object.create(f.prototype)).constructor=y).id="fullscreen",y.className="psv-button psv-button--hover-scale psv-fullscreen-button",y.icon="fullscreen-in.svg",y.iconActive="fullscreen-out.svg",y.prototype.create=function(){f.prototype.create.call(this),this.psv.on("fullscreen-updated",this)},y.prototype.destroy=function(){this.psv.off("fullscreen-updated",this),f.prototype.destroy.call(this)},y.prototype.supported=function(){return!!r.SYSTEM.fullscreenEvent},y.prototype.handleEvent=function(n){switch(n.type){case"fullscreen-updated":this.toggleActive(n.args[0])}},y.prototype._onClick=function(){this.psv.toggleFullscreen()},((w.prototype=Object.create(f.prototype)).constructor=w).id="gyroscope",w.className="psv-button psv-button--hover-scale psv-gyroscope-button",w.icon="compass.svg",w.prototype.create=function(){f.prototype.create.call(this),this.psv.on("gyroscope-updated",this)},w.prototype.destroy=function(){this.psv.off("gyroscope-updated",this),f.prototype.destroy.call(this)},w.prototype.supported=function(){return!!u.checkTHREE("DeviceOrientationControls")&&r.SYSTEM.deviceOrientationSupported},w.prototype.handleEvent=function(n){switch(n.type){case"gyroscope-updated":this.toggleActive(n.args[0])}},w.prototype._onClick=function(){this.psv.toggleGyroscopeControl()},((rt.prototype=Object.create(f.prototype)).constructor=rt).id="markers",rt.className="psv-button psv-button--hover-scale psv-markers-button",rt.icon="pin.svg",rt.prototype._onClick=function(){this.psv.hud.toggleMarkersList()},((b.prototype=Object.create(f.prototype)).constructor=b).id="stereo",b.className="psv-button psv-button--hover-scale psv-stereo-button",b.icon="stereo.svg",b.prototype.create=function(){f.prototype.create.call(this),this.psv.on("stereo-updated",this)},b.prototype.destroy=function(){this.psv.off("stereo-updated",this),f.prototype.destroy.call(this)},b.prototype.supported=function(){return!(!r.SYSTEM.fullscreenEvent||!u.checkTHREE("DeviceOrientationControls"))&&r.SYSTEM.deviceOrientationSupported},b.prototype.handleEvent=function(n){switch(n.type){case"stereo-updated":this.toggleActive(n.args[0])}},b.prototype._onClick=function(){this.psv.toggleStereoView()},((c.prototype=Object.create(f.prototype)).constructor=c).id="zoom",c.className="psv-button psv-zoom-button",c.prototype.create=function(){var n,i,t;f.prototype.create.call(this),n=document.createElement("div"),n.className="psv-zoom-button-minus",n.title=this.psv.config.lang.zoomOut,this._setIcon("zoom-out.svg",n),this.container.appendChild(n),i=document.createElement("div"),i.className="psv-zoom-button-range",this.container.appendChild(i),this.zoom_range=document.createElement("div"),this.zoom_range.className="psv-zoom-button-line",i.appendChild(this.zoom_range),this.zoom_value=document.createElement("div"),this.zoom_value.className="psv-zoom-button-handle",this.zoom_range.appendChild(this.zoom_value),t=document.createElement("div"),t.className="psv-zoom-button-plus",t.title=this.psv.config.lang.zoomIn,this._setIcon("zoom-in.svg",t),this.container.appendChild(t),this.zoom_range.addEventListener("mousedown",this),this.zoom_range.addEventListener("touchstart",this),this.psv.container.addEventListener("mousemove",this),this.psv.container.addEventListener("touchmove",this),this.psv.container.addEventListener("mouseup",this),this.psv.container.addEventListener("touchend",this),n.addEventListener("mousedown",this._zoomOut.bind(this)),t.addEventListener("mousedown",this._zoomIn.bind(this)),this.psv.on("zoom-updated",this),this.psv.once("ready",function(){this._moveZoomValue(this.psv.prop.zoom_lvl)}.bind(this))},c.prototype.destroy=function(){this._stopZoomChange(),this.psv.container.removeEventListener("mousemove",this),this.psv.container.removeEventListener("touchmove",this),this.psv.container.removeEventListener("mouseup",this),this.psv.container.removeEventListener("touchend",this),delete this.zoom_range,delete this.zoom_value,this.psv.off("zoom-updated",this),f.prototype.destroy.call(this)},c.prototype.handleEvent=function(n){switch(n.type){case"mousedown":this._initZoomChangeWithMouse(n);break;case"touchstart":this._initZoomChangeByTouch(n);break;case"mousemove":this._changeZoomWithMouse(n);break;case"touchmove":this._changeZoomByTouch(n);break;case"mouseup":case"touchend":this._stopZoomChange(n);break;case"zoom-updated":this._moveZoomValue(n.args[0])}},c.prototype._moveZoomValue=function(n){this.zoom_value.style.left=n/100*this.zoom_range.offsetWidth-this.zoom_value.offsetWidth/2+"px"},c.prototype._initZoomChangeWithMouse=function(n){this.enabled&&(this.prop.mousedown=!0,this._changeZoom(n.clientX))},c.prototype._initZoomChangeByTouch=function(n){this.enabled&&(this.prop.mousedown=!0,this._changeZoom(n.changedTouches[0].clientX))},c.prototype._zoomIn=function(){this.enabled&&(this.prop.buttondown=!0,this.psv.zoomIn(),this.prop.longPressTimeout=window.setTimeout(this._startLongPressInterval.bind(this,1),200))},c.prototype._zoomOut=function(){this.enabled&&(this.prop.buttondown=!0,this.psv.zoomOut(),this.prop.longPressTimeout=window.setTimeout(this._startLongPressInterval.bind(this,-1),200))},c.prototype._startLongPressInterval=function(n){this.prop.buttondown&&(this.prop.longPressInterval=window.setInterval(function(){this.psv.zoom(this.psv.prop.zoom_lvl+n)}.bind(this),50))},c.prototype._stopZoomChange=function(){this.enabled&&(window.clearInterval(this.prop.longPressInterval),window.clearTimeout(this.prop.longPressTimeout),this.prop.longPressInterval=null,this.prop.mousedown=!1,this.prop.buttondown=!1)},c.prototype._changeZoomWithMouse=function(n){this.enabled&&(n.preventDefault(),this._changeZoom(n.clientX))},c.prototype._changeZoomByTouch=function(n){this.enabled&&this._changeZoom(n.changedTouches[0].clientX)},c.prototype._changeZoom=function(n){if(this.prop.mousedown){var t=(parseInt(n)-this.zoom_range.getBoundingClientRect().left)/this.zoom_range.offsetWidth*100;this.psv.zoom(t)}},l.easings={linear:function(n){return n},inQuad:function(n){return n*n},outQuad:function(n){return n*(2-n)},inOutQuad:function(n){return n<.5?2*n*n:(4-2*n)*n-1},inCubic:function(n){return n*n*n},outCubic:function(n){return--n*n*n+1},inOutCubic:function(n){return n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1},inQuart:function(n){return n*n*n*n},outQuart:function(n){return 1- --n*n*n*n},inOutQuart:function(n){return n<.5?8*n*n*n*n:1-8*--n*n*n*n},inQuint:function(n){return n*n*n*n*n},outQuint:function(n){return 1+--n*n*n*n*n},inOutQuint:function(n){return n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n},inSine:function(n){return 1-Math.cos(n*(Math.PI/2))},outSine:function(n){return Math.sin(n*(Math.PI/2))},inOutSine:function(n){return.5-.5*Math.cos(Math.PI*n)},inExpo:function(n){return Math.pow(2,10*(n-1))},outExpo:function(n){return 1-Math.pow(2,-10*n)},inOutExpo:function(n){return(n=2*n-1)<0?.5*Math.pow(2,10*n):1-.5*Math.pow(2,-10*n)},inCirc:function(n){return 1-Math.sqrt(1-n*n)},outCirc:function(n){return n--,Math.sqrt(1-n*n)},inOutCirc:function(n){return(n*=2)<1?.5-.5*Math.sqrt(1-n*n):.5+.5*Math.sqrt(1-(n-=2)*n)}},l.prototype._run=function(n){if(!this._cancelled){null===this._start&&(this._start=n);var t,r=(n-this._start)/this._options.duration,i={};if(r<1){for(t in this._options.properties)this._options.properties[t]&&(i[t]=this._options.properties[t].start+(this._options.properties[t].end-this._options.properties[t].start)*this._options.easing(r));this._options.onTick(i,r),window.requestAnimationFrame(this._run.bind(this))}else{for(t in this._options.properties)this._options.properties[t]&&(i[t]=this._options.properties[t].end);this._options.onTick(i,1),window.requestAnimationFrame(function(){this._resolved=!0,this._resolve()}.bind(this))}}},l.prototype.then=function(n,t){var i=new l;return i._promise.then(null,this.cancel.bind(this)),this._promise.then(function(){i._resolve(n?n():void 0)},function(){i._reject(t?t():void 0)}),i},l.prototype.catch=function(n){return this.then(void 0,n)},l.prototype.finally=function(n){return this.then(n,n)},l.prototype.cancel=function(){this._cancelled||this._resolved||(this._cancelled=!0,this._reject(),this._delayTimeout&&(window.cancelAnimationFrame(this._delayTimeout),this._delayTimeout=null))},(o.prototype=Object.create(Error.prototype)).name="PSVError",r.Error=o.prototype.constructor=o,h.types=["image","html","polygon_px","polygon_rad","polyline_px","polyline_rad","rect","circle","ellipse","path"],h.getType=function(n,t){var i=[];if(h.types.forEach(function(t){n[t]&&i.push(t)}),0===i.length&&!t)throw new o("missing marker content, either "+h.types.join(", "));if(1<i.length)throw new o("multiple marker content, either "+h.types.join(", "));return i[0]},h.prototype.destroy=function(){delete this.$el.psvMarker},h.prototype.isNormal=function(){return"image"===this.type||"html"===this.type},h.prototype.isPoly=function(){return this.isPolygon()||this.isPolyline()},h.prototype.isPolygon=function(){return"polygon_px"===this.type||"polygon_rad"===this.type},h.prototype.isPolyline=function(){return"polyline_px"===this.type||"polyline_rad"===this.type},h.prototype.isSvg=function(){return"rect"===this.type||"circle"===this.type||"ellipse"===this.type||"path"===this.type},h.prototype.getScale=function(n){return Array.isArray(this.scale)?this.scale[0]+(this.scale[1]-this.scale[0])*l.easings.inQuad(n/100):"function"==typeof this.scale?this.scale(n):"number"==typeof this.scale?this.scale*l.easings.inQuad(n/100):1},h.prototype.update=function(n){if(n&&n!==this){var t=h.getType(n,!0);if(void 0!==t&&t!==this.type)throw new o("cannot change marker type");u.deepmerge(this,n)}this.isNormal()?this.$el.setAttribute("class","psv-marker psv-marker--normal"):this.$el.setAttribute("class","psv-marker psv-marker--svg"),this.className&&u.addClasses(this.$el,this.className),this.tooltip&&(u.addClasses(this.$el,"has-tooltip"),"string"==typeof this.tooltip&&(this.tooltip={content:this.tooltip})),this.style&&u.deepmerge(this.$el.style,this.style),this.anchor=u.parsePosition(this.anchor),this.isNormal()?this._updateNormal():this.isPolygon()?this._updatePoly("polygon_rad","polygon_px"):this.isPolyline()?this._updatePoly("polyline_rad","polyline_px"):this._updateSvg()},h.prototype._updateNormal=function(){this.width&&this.height?(this.$el.style.width=this.width+"px",this.$el.style.height=this.height+"px",this._dynamicSize=!1):this._dynamicSize=!0,this.image?this.$el.style.backgroundImage="url("+this.image+")":this.$el.innerHTML=this.html,this.$el.style.transformOrigin=100*this.anchor.left+"% "+100*this.anchor.top+"%",this.psv.cleanPosition(this),this.position3D=this.psv.sphericalCoordsToVector3(this)},h.prototype._updateSvg=function(){switch(this._dynamicSize=!0,this.type){case"rect":"number"==typeof this._def?this._def={x:0,y:0,width:this._def,height:this._def}:Array.isArray(this._def)?this._def={x:0,y:0,width:this._def[0],height:this._def[1]}:this._def.x=this._def.y=0;break;case"circle":"number"==typeof this._def?this._def={cx:this._def,cy:this._def,r:this._def}:Array.isArray(this._def)?this._def={cx:this._def[0],cy:this._def[0],r:this._def[0]}:this._def.cx=this._def.cy=this._def.r;break;case"ellipse":"number"==typeof this._def?this._def={cx:this._def,cy:this._def,rx:this._def,ry:this._def}:Array.isArray(this._def)?this._def={cx:this._def[0],cy:this._def[1],rx:this._def[0],ry:this._def[1]}:(this._def.cx=this._def.rx,this._def.cy=this._def.ry);break;case"path":"string"==typeof this._def&&(this._def={d:this._def})}Object.getOwnPropertyNames(this._def).forEach(function(n){this.$el.setAttributeNS(null,n,this._def[n])},this),this.svgStyle?Object.getOwnPropertyNames(this.svgStyle).forEach(function(n){this.$el.setAttributeNS(null,u.dasherize(n),this.svgStyle[n])},this):this.$el.setAttributeNS(null,"fill","rgba(0,0,0,0.5)"),this.psv.cleanPosition(this),this.position3D=this.psv.sphericalCoordsToVector3(this)},h.prototype._updatePoly=function(n,t){this._dynamicSize=!0,this.svgStyle?(Object.getOwnPropertyNames(this.svgStyle).forEach(function(n){this.$el.setAttributeNS(null,u.dasherize(n),this.svgStyle[n])},this),this.isPolyline()&&!this.svgStyle.fill&&this.$el.setAttributeNS(null,"fill","none")):this.isPolygon()?this.$el.setAttributeNS(null,"fill","rgba(0,0,0,0.5)"):this.isPolyline()&&(this.$el.setAttributeNS(null,"fill","none"),this.$el.setAttributeNS(null,"stroke","rgb(0,0,0)")),[this[n],this[t]].forEach(function(n){if(n&&"object"!=typeof n[0])for(var t=0;t<n.length;t++)n.splice(t,2,[n[t],n[t+1]])}),this[n]=this[t]?this[t].map(function(n){var t=this.psv.textureCoordsToSphericalCoords({x:n[0],y:n[1]});return[t.longitude,t.latitude]},this):this[n].map(function(n){return[u.parseAngle(n[0]),u.parseAngle(n[1],!0)]}),this.longitude=this[n][0][0],this.latitude=this[n][0][1],this.positions3D=this[n].map(function(n){return this.psv.sphericalCoordsToVector3({longitude:n[0],latitude:n[1]})},this)};var u={};return(r.Utils=u).TwoPI=2*Math.PI,u.HalfPI=Math.PI/2,u.svgNS="http://www.w3.org/2000/svg",u.checkTHREE=function(){for(var t=0,i=arguments.length;t<i;t++)if(!(arguments[t]in n))return!1;return!0},u.isCanvasSupported=function(){var n=document.createElement("canvas");return!(!n.getContext||!n.getContext("2d"))},u.getWebGLCtx=function(){var t=document.createElement("canvas"),n=null;return t.getContext&&["webgl","experimental-webgl","moz-webgl","webkit-3d"].some(function(i){try{return(n=t.getContext(i))&&"function"==typeof n.getParameter}catch(i){return!1}})?n:null},u.isWebGLSupported=function(){return!!window.WebGLRenderingContext&&null!==u.getWebGLCtx()},u.isDeviceOrientationSupported=function(){return new Promise(function(n){if("DeviceOrientationEvent"in window){var t=function(i){i&&null!==i.alpha&&!isNaN(i.alpha)?n(!0):n(!1),window.removeEventListener("deviceorientation",t)};window.addEventListener("deviceorientation",t,!1),setTimeout(t,2e3)}else n(!1)})},u.isTouchEnabled=function(){return new Promise(function(n){var t=function(i){n(!!i),window.removeEventListener("touchstart",t)};window.addEventListener("touchstart",t,!1),setTimeout(t,1e4)})},u.getMaxTextureWidth=function(){var n=u.getWebGLCtx();return null!==n?n.getParameter(n.MAX_TEXTURE_SIZE):0},u.toggleClass=function(n,t,i){if(n.classList)void 0===i?n.classList.toggle(t):i&&!n.classList.contains(t)?n.classList.add(t):i||n.classList.remove(t);else{var r=n.getAttribute("class")||"",u=-1!==r.indexOf(t),f=new RegExp("(?:^|\\s)"+t+"(?:\\s|$)");void 0!==i&&!i||u?i||(r=r.replace(f," ")):r+=0<r.length?" "+t:t,n.setAttribute("class",r)}},u.addClasses=function(n,t){t&&t.split(" ").forEach(function(t){u.toggleClass(n,t,!0)})},u.removeClasses=function(n,t){t&&t.split(" ").forEach(function(t){u.toggleClass(n,t,!1)})},u.hasParent=function(n,t){do if(n===t)return!0;while(n=n.parentNode);return!1},u.getClosest=function(n,t){var i=n.matches||n.msMatchesSelector;do if(i.bind(n)(t))return n;while(n=n instanceof SVGElement?n.parentNode:n.parentElement);return null},u.mouseWheelEvent=function(){return"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll"},u.getEventKey=function(n){var t=n.key||u.getEventKey.KEYMAP[n.keyCode||n.which];return t&&u.getEventKey.MS_KEYMAP[t]&&(t=u.getEventKey.MS_KEYMAP[t]),t},u.getEventKey.KEYMAP={13:"Enter",27:"Escape",32:" ",33:"PageUp",34:"PageDown",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",46:"Delete",107:"+",109:"-"},u.getEventKey.MS_KEYMAP={Add:"+",Del:"Delete",Down:"ArrowDown",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Spacebar:" ",Subtract:"-",Up:"ArrowUp"},u.fullscreenEvent=function(){var t={exitFullscreen:"fullscreenchange",webkitExitFullscreen:"webkitfullscreenchange",mozCancelFullScreen:"mozfullscreenchange",msExitFullscreen:"MSFullscreenChange"},n;for(n in t)if(t.hasOwnProperty(n)&&n in document)return t[n];return null},u.bound=function(n,t,i){return Math.max(t,Math.min(i,n))},u.isInteger=Number.isInteger||function(n){return"number"==typeof n&&isFinite(n)&&Math.floor(n)===n},u.sum=function(n){return n.reduce(function(n,t){return n+t},0)},u.dasherize=function(n){return n.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,function(n,t){return(0<t?"-":"")+n.toLowerCase()})},u.getXMPValue=function(n,t){var i;return null!==(i=n.match("<GPano:"+t+">(.*)<\/GPano:"+t+">"))?i[1]:null!==(i=n.match("GPano:"+t+'="(.*?)"'))?i[1]:null},u.isFullscreenEnabled=function(n){return(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)===n},u.requestFullscreen=function(n){(n.requestFullscreen||n.mozRequestFullScreen||n.webkitRequestFullscreen||n.msRequestFullscreen).call(n)},u.exitFullscreen=function(){(document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen).call(document)},u.getStyle=function(n,t){return window.getComputedStyle(n,null)[t]},u.getShortestArc=function(n,t){return[0,u.TwoPI,-u.TwoPI].reduce(function(i,r){return r=t-n+r,Math.abs(r)<Math.abs(i)?r:i},1/0)},u.getAngle=function(n,t){return Math.acos(Math.cos(n.latitude)*Math.cos(t.latitude)*Math.cos(n.longitude-t.longitude)+Math.sin(n.latitude)*Math.sin(t.latitude))},u.parsePosition=function(n){var t,r,i;return n?"object"==typeof n?n:(t=n.toLocaleLowerCase().split(" ").slice(0,2),1===t.length&&(t=void 0!==u.parsePosition.positions[t[0]]?[t[0],"center"]:[t[0],t[0]]),r="left"!==t[1]&&"right"!==t[1]&&"top"!==t[0]&&"bottom"!==t[0],t=t.map(function(n){return u.parsePosition.positions[n]||n}),r||t.reverse(),i=t.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/),i?{left:i[1]/100,top:i[2]/100}:{top:.5,left:.5}):{top:.5,left:.5}},u.parsePosition.positions={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},u.parseSpeed=function(t){if("string"==typeof t){t=t.toString().trim();var i=parseFloat(t.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1")),r=t.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(r.match(/(pm|per minute)$/)&&(i/=60),r){case"dpm":case"degrees per minute":case"dps":case"degrees per second":t=n.Math.degToRad(i);break;case"radians per minute":case"radians per second":t=i;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":t=i*u.TwoPI;break;default:throw new o('unknown speed unit "'+r+'"');}}return t},u.parseAngle=function(t,i,r){var f,e,s;if(void 0===r&&(r=i),"string"==typeof t){if(f=t.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/),!f)throw new o('unknown angle "'+t+'"');if(e=parseFloat(f[1]),s=f[2],s)switch(s){case"deg":case"degs":t=n.Math.degToRad(e);break;case"rad":case"rads":t=e;break;default:throw new o('unknown angle unit "'+s+'"');}else t=e}return(t=(i?t+Math.PI:t)%u.TwoPI)<0&&(t=u.TwoPI+t),i?u.bound(t-Math.PI,-Math.PI/(r?2:1),Math.PI/(r?2:1)):t},u.cleanTHREEScene=function(t){t.children.forEach(function(t){t instanceof n.Mesh&&(t.geometry&&(t.geometry.dispose(),t.geometry=null),t.material&&(t.material.materials?(t.material.materials.forEach(function(n){n.map&&(n.map.dispose(),n.map=null),n.dispose()}),t.material.materials.length=0):(t.material.map&&(t.material.map.dispose(),t.material.map=null),t.material.dispose()),t.material=null))}),t.children.length=0},u.throttle=function(n,t){var r,u,e,i=null,f=0,o=function(){f=Date.now(),i=null,e=n.apply(r,u),i||(r=u=null)};return function(){var h=Date.now(),s;return f||(f=h),s=t-(h-f),r=this,u=arguments,s<=0||t<s?(i&&(clearTimeout(i),i=null),f=h,e=n.apply(r,u),i||(r=u=null)):i||(i=setTimeout(o,s)),e}},u.isPlainObject=function(n){if("object"!=typeof n||null===n)return!1;if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===Object.prototype.toString.call(n);var t=Object.getPrototypeOf(n);return t===Object.prototype||null===t},u.deepmerge=function(n,t){var r=t;return function i(n,t){return Array.isArray(t)?(n&&Array.isArray(n)?n.length=0:n=[],t.forEach(function(t,r){n[r]=i(null,t)})):"object"==typeof t?(n&&!Array.isArray(n)||(n={}),Object.keys(t).forEach(function(f){"object"==typeof t[f]&&t[f]&&u.isPlainObject(t[f])?t[f]!=r&&(n[f]?i(n[f],t[f]):n[f]=i(null,t[f])):n[f]=t[f]})):n=t,n}(n,t)},u.clone=function(n){return u.deepmerge(null,n)},u.normalizeWheel=function(n){var u=0,t=0,i=0,r=0;return"detail"in n&&(t=n.detail),"wheelDelta"in n&&(t=-n.wheelDelta/120),"wheelDeltaY"in n&&(t=-n.wheelDeltaY/120),"wheelDeltaX"in n&&(u=-n.wheelDeltaX/120),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(u=t,t=0),i=10*u,r=10*t,"deltaY"in n&&(r=n.deltaY),"deltaX"in n&&(i=n.deltaX),(i||r)&&n.deltaMode&&(1===n.deltaMode?(i*=40,r*=40):(i*=800,r*=800)),i&&!u&&(u=i<1?-1:1),r&&!t&&(t=r<1?-1:1),{spinX:u,spinY:t,pixelX:i,pixelY:r}},u.forEach=function(n,t){for(var i in n)n.hasOwnProperty(i)&&t(n[i],i)},r.ICONS["compass.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 0a50 50 0 1 0 0 100A50 50 0 0 0 50 0zm0 88.81a38.86 38.86 0 0 1-38.81-38.8 38.86 38.86 0 0 1 38.8-38.82A38.86 38.86 0 0 1 88.82 50 38.87 38.87 0 0 1 50 88.81z"/><path d="M72.07 25.9L40.25 41.06 27.92 74.12l31.82-15.18v-.01l12.32-33.03zM57.84 54.4L44.9 42.58l21.1-10.06-8.17 21.9z"/><!--Created by iconoci from the Noun Project--><\/svg>',r.ICONS["download.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M83.3 35.6h-17V3H32.2v32.6H16.6l33.6 32.7 33-32.7z"/><path d="M83.3 64.2v16.3H16.6V64.2H-.1v32.6H100V64.2H83.3z"/><!--Created by Michael Zenaty from the Noun Project--><\/svg>',r.ICONS["fullscreen-in.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M100 40H87.1V18.8h-21V6H100zM100 93.2H66V80.3h21.1v-21H100zM34 93.2H0v-34h12.9v21.1h21zM12.9 40H0V6h34v12.9H12.8z"/><!--Created by Garrett Knoll from the Noun Project--><\/svg>',r.ICONS["fullscreen-out.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M66 7h13v21h21v13H66zM66 60.3h34v12.9H79v21H66zM0 60.3h34v34H21V73.1H0zM21 7h13v34H0V28h21z"/><!--Created by Garrett Knoll from the Noun Project--><\/svg>',r.ICONS["gesture.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z" fill="#000" fill-rule="evenodd"/><!--Created by AomAm from the Noun Project--><\/svg>',r.ICONS["info.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M28.3 26.1c-1 2.6-1.9 4.8-2.6 7-2.5 7.4-5 14.7-7.2 22-1.3 4.4.5 7.2 4.3 7.8 1.3.2 2.8.2 4.2-.1 8.2-2 11.9-8.6 15.7-15.2l-2.2 2a18.8 18.8 0 0 1-7.4 5.2 2 2 0 0 1-1.6-.2c-.2-.1 0-1 0-1.4l.8-1.8L41.9 28c.5-1.4.9-3 .7-4.4-.2-2.6-3-4.4-6.3-4.4-8.8.2-15 4.5-19.5 11.8-.2.3-.2.6-.3 1.3 3.7-2.8 6.8-6.1 11.8-6.2z"/><circle cx="39.3" cy="9.2" r="8.2"/><!--Created by Arafat Uddin from the Noun Project--><\/svg>',r.ICONS["mobile-rotate.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M66.7 19a14 14 0 0 1 13.8 12.1l-3.9-2.7c-.5-.3-1.1-.2-1.4.3-.3.5-.2 1.1.3 1.4l5.7 3.9.6.2c.3 0 .6-.2.8-.4l3.9-5.7c.3-.5.2-1.1-.3-1.4-.5-.3-1.1-.2-1.4.3l-2.4 3.5A16 16 0 0 0 66.7 17c-.6 0-1 .4-1 1s.4 1 1 1zM25 15h10c.6 0 1-.4 1-1s-.4-1-1-1H25c-.6 0-1 .4-1 1s.4 1 1 1zm-6.9 30H16l-2 .2a1 1 0 0 0-.8 1.2c.1.5.5.8 1 .8h.2l1.7-.2h2.1c.6 0 1-.4 1-1s-.5-1-1.1-1zm10 0h-4c-.6 0-1 .4-1 1s.4 1 1 1h4c.6 0 1-.4 1-1s-.4-1-1-1zM84 45H55V16A11 11 0 0 0 44 5H16A11 11 0 0 0 5 16v68a11 11 0 0 0 11 11h68a11 11 0 0 0 11-11V56a11 11 0 0 0-11-11zM16 93c-5 0-9-4-9-9V53.2c.3-.1.6-.3.7-.6a9.8 9.8 0 0 1 2-3c.4-.4.4-1 0-1.4a1 1 0 0 0-1.4 0l-1.2 1.5V16c0-5 4-9 9-9h28c5 0 9 4 9 9v68c0 5-4 9-9 9H16zm77-9c0 5-4 9-9 9H50.3c2.8-2 4.7-5.3 4.7-9V47h29c5 0 9 4 9 9v28zM38.1 45h-4c-.6 0-1 .4-1 1s.4 1 1 1h4c.6 0 1-.4 1-1s-.5-1-1-1zm9.9 0h-4c-.6 0-1 .4-1 1s.4 1 1 1h4c.6 0 1-.4 1-1s-.4-1-1-1zm38 19c-.6 0-1 .4-1 1v10c0 .6.4 1 1 1s1-.4 1-1V65c0-.6-.4-1-1-1z"/><!--Created by Anthony Bresset from the Noun Project--><\/svg>',r.ICONS["pin.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M24 0C13.8 0 5.5 8.3 5.5 18.5c0 10.07 17.57 28.64 18.32 29.42a.25.25 0 0 0 .36 0c.75-.78 18.32-19.35 18.32-29.42C42.5 8.3 34.2 0 24 0zm0 7.14a10.35 10.35 0 0 1 0 20.68 10.35 10.35 0 0 1 0-20.68z"/><!--Created by Daniele Marucci from the Noun Project--><\/svg>',r.ICONS["play-active.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41 41"><path d="M40.5 14.1c-.1-.1-1.2-.5-2.898-1-.102 0-.202-.1-.202-.2C34.5 6.5 28 2 20.5 2S6.6 6.5 3.7 12.9c0 .1-.1.1-.2.2-1.7.6-2.8 1-2.9 1l-.6.3v12.1l.6.2c.1 0 1.1.399 2.7.899.1 0 .2.101.2.199C6.3 34.4 12.9 39 20.5 39c7.602 0 14.102-4.6 16.9-11.1 0-.102.1-.102.199-.2 1.699-.601 2.699-1 2.801-1l.6-.3V14.3l-.5-.2zM6.701 11.5C9.7 7 14.8 4 20.5 4c5.8 0 10.9 3 13.8 7.5.2.3-.1.6-.399.5-3.799-1-8.799-2-13.6-2-4.7 0-9.5 1-13.2 2-.3.1-.5-.2-.4-.5zM25.1 20.3L18.7 24c-.3.2-.7 0-.7-.5v-7.4c0-.4.4-.6.7-.4l6.399 3.8c.301.1.301.6.001.8zm9.4 8.901A16.421 16.421 0 0 1 20.5 37c-5.9 0-11.1-3.1-14-7.898-.2-.302.1-.602.4-.5 3.9 1 8.9 2.1 13.6 2.1 5 0 9.9-1 13.602-2 .298-.1.5.198.398.499z"/><!--Created by Nick Bluth from the Noun Project--><\/svg>',r.ICONS["play.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 41 41"><path d="M40.5 14.1c-.1-.1-1.2-.5-2.899-1-.101 0-.2-.1-.2-.2C34.5 6.5 28 2 20.5 2S6.6 6.5 3.7 12.9c0 .1-.1.1-.2.2-1.7.6-2.8 1-2.9 1l-.6.3v12.1l.6.2c.1 0 1.1.4 2.7.9.1 0 .2.1.2.199C6.3 34.4 12.9 39 20.5 39c7.601 0 14.101-4.6 16.9-11.1 0-.101.1-.101.2-.2 1.699-.6 2.699-1 2.8-1l.6-.3V14.3l-.5-.2zM20.5 4c5.8 0 10.9 3 13.8 7.5.2.3-.1.6-.399.5-3.8-1-8.8-2-13.6-2-4.7 0-9.5 1-13.2 2-.3.1-.5-.2-.4-.5C9.7 7 14.8 4 20.5 4zm0 33c-5.9 0-11.1-3.1-14-7.899-.2-.301.1-.601.4-.5 3.9 1 8.9 2.1 13.6 2.1 5 0 9.9-1 13.601-2 .3-.1.5.2.399.5A16.422 16.422 0 0 1 20.5 37zm18.601-12.1c0 .1-.101.3-.2.3-2.5.9-10.4 3.6-18.4 3.6-7.1 0-15.6-2.699-18.3-3.6C2.1 25.2 2 25 2 24.9V16c0-.1.1-.3.2-.3 2.6-.9 10.6-3.6 18.2-3.6 7.5 0 15.899 2.7 18.5 3.6.1 0 .2.2.2.3v8.9z"/><path d="M18.7 24l6.4-3.7c.3-.2.3-.7 0-.8l-6.4-3.8c-.3-.2-.7 0-.7.4v7.4c0 .5.4.7.7.5z"/><!--Created by Nick Bluth from the Noun Project--><\/svg>',r.ICONS["stereo.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -2 16 16"><path d="M13.104 0H2.896C2.332 0 1 .392 1 .875h14C15 .392 13.668 0 13.104 0zM15 1H1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h3.534a2 2 0 0 0 1.821-1.172l1.19-2.618a.5.5 0 0 1 .91 0l1.19 2.618A2 2 0 0 0 11.466 11H15a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM4 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm8 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"/><!--Created by Idevã Batista from the Noun Project--><\/svg>',r.ICONS["zoom-in.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path d="M8.728 4.009H6.744v2.737H4.006V8.73h2.738v2.736h1.984V8.73h2.737V6.746H8.728z"/><!--Created by Ryan Canning from the Noun Project--><\/svg>',r.ICONS["zoom-out.svg"]='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path d="M4.006 6.746h7.459V8.73H4.006z"/><!--Created by Ryan Canning from the Noun Project--><\/svg>',r}),!function(n){"use strict";function v(n,t){var f,r,e,i;for(f in u)if(u.hasOwnProperty(f))for(i=u[f],r=0;r<i.mods.length;r+=1)e=i.mods[r],"function"==typeof e[n]&&e[n].apply(i.target,[t,i])}function y(t){n(window.document).bind(t+"."+r,function(n){v("document"+t,n)})}function p(){var n,i;for(n in u)u.hasOwnProperty(n)&&(i=u[n],i.responsive&&t.boot(i))}function w(n){e+=1,n.id=e,u[e]=n}function b(n){delete u[n.id]}function c(n,t,i){for(n=String(n);n.length<t;)n=String(i)+n;return n}function s(n,t,i){return n>i?i:n<t?t:n}function f(n,t,i,r){for(;n>i;)n-=r;for(;n<t;)n+=r;return n}function k(n){return n.preventDefault(),!1}function d(){window.console&&window.console.log&&window.console.log.apply(window.console,arguments)}function i(n,t,i){i&&n.bind(t+"."+r,function(t){i.apply(n,[t,n.spritespin("data")])})}function l(n){n.unbind("."+r)}function g(t){for(var i,r="string"==typeof t.source?[t.source]:t.source,e=0,u=[],h=t.preloadCount||r.length,s=!1,o=!1,c=function(){e+=1,"function"==typeof t.progress&&t.progress({index:n.inArray(this,u),loaded:e,total:r.length,percent:Math.round(e/r.length*100)}),o=o||this===u[0],!s&&e>=h&&o&&"function"==typeof t.complete&&(s=!0,t.complete(u))},f=0;f<r.length;f+=1)i=new Image,u.push(i),i.onload=i.onabort=i.onerror=c,i.src=r[f];"function"==typeof t.initiated&&t.initiated(u)}function a(n,t){var f=(t||n).width,o=(t||n).height,i,r,u;if(f*o<=1048576||(i=document.createElement("canvas"),!i||!i.getContext)||(r=i.getContext("2d"),!r))return!1;i.width=i.height=1,r.fillStyle="#FF00FF",r.fillRect(0,0,1,1),r.drawImage(n,-f+1,0);try{return u=r.getImageData(0,0,1,1).data,255===u[0]&&0===u[1]&&255===u[2]}catch(e){return d(e.message,e.stack),!1}}function nt(n){if(null!=n.naturalWidth)return{width:n.naturalWidth,height:n.naturalHeight};var t=new Image;return t.src=n.src,{width:t.width,height:t.height}}function tt(n){var t=window.devicePixelRatio||1,i=n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1;return t/i}var r="spritespin",t={},e,u,h,o;window.SpriteSpin=t,t.namespace=r,t.mods={},t.eventNames=["mousedown","mousemove","mouseup","mouseenter","mouseover","mouseleave","dblclick","mousewheel","touchstart","touchmove","touchend","touchcancel","selectstart","gesturestart","gesturechange","gestureend"],t.eventsToPrevent=["dragstart"],t.defaults={source:void 0,width:void 0,height:void 0,frames:void 0,framesX:void 0,lanes:1,sizeMode:void 0,module:"360",behavior:"drag",renderer:"canvas",lane:0,frame:0,frameTime:40,animate:!0,reverse:!1,loop:!0,stopFrame:0,wrap:!0,wrapLane:!1,sense:1,senseLane:void 0,orientation:"horizontal",detectSubsampling:!0,scrollThreshold:50,preloadCount:void 0,onInit:void 0,onProgress:void 0,onLoad:void 0,onFrame:void 0,onDraw:void 0},e=0,u={},t.instances=u,h=null;n(window).on("resize",function(){clearTimeout(h),h=setTimeout(p,100)});for(o=0;o<t.eventNames.length;o+=1)y(t.eventNames[o]);t.clamp=s,t.wrap=f,t.bind=i,t.sourceArray=function(n,t){var e=0,o=0,s=0,h=0,l=t.digits||2,i,r,u,f;for(t.frame&&(e=t.frame[0],o=t.frame[1]),t.lane&&(s=t.lane[0],h=t.lane[1]),f=[],i=s;i<=h;i+=1)for(r=e;r<=o;r+=1)u=n.replace("{lane}",c(i,l,0)),u=u.replace("{frame}",c(r,l,0)),f.push(u);return f},t.measureSource=function(n){var i=n.images[0],t=nt(i),r;1===n.images.length?(n.sourceWidth=t.width,n.sourceHeight=t.height,n.detectSubsampling&&a(i,t)&&(n.sourceWidth/=2,n.sourceHeight/=2),n.framesX=n.framesX||n.frames,n.frameWidth&&n.frameHeight)||(n.framesX?(n.frameWidth=Math.floor(n.sourceWidth/n.framesX),r=Math.ceil(n.frames*n.lanes/n.framesX),n.frameHeight=Math.floor(n.sourceHeight/r)):(n.frameWidth=t.width,n.frameHeight=t.height)):(n.sourceWidth=n.frameWidth=t.width,n.sourceHeight=n.frameHeight=t.height,a(i,t)&&(n.sourceWidth=n.frameWidth=t.width/2,n.sourceHeight=n.frameHeight=t.height/2),n.frames=n.frames||n.images.length)},t.resetInput=function(n){n.startX=n.startY=void 0,n.currentX=n.currentY=void 0,n.oldX=n.oldY=void 0,n.dX=n.dY=n.dW=0,n.ddX=n.ddY=n.ddW=0},t.updateInput=function(n,t){void 0===n.touches&&void 0!==n.originalEvent&&(n.touches=n.originalEvent.touches),t.oldX=t.currentX,t.oldY=t.currentY,void 0!==n.touches&&n.touches.length>0?(t.currentX=n.touches[0].clientX||0,t.currentY=n.touches[0].clientY||0):(t.currentX=n.clientX||0,t.currentY=n.clientY||0),void 0!==t.oldX&&void 0!==t.oldY||(t.oldX=t.currentX,t.oldY=t.currentY),void 0!==t.startX&&void 0!==t.startY||(t.startX=t.currentX,t.startY=t.currentY,t.clickframe=t.frame,t.clicklane=t.lane),t.dX=t.currentX-t.startX,t.dY=t.currentY-t.startY,t.ddX=t.currentX-t.oldX,t.ddY=t.currentY-t.oldY,t.ndX=t.dX/t.width,t.ndY=t.dY/t.height,t.nddX=t.ddX/t.width,t.nddY=t.ddY/t.height},t.updateFrame=function(n,i,r){n.lastFrame=n.frame,n.lastLane=n.lane,void 0!==i?n.frame=Number(i):n.animation&&(n.frame+=n.reverse?-1:1),n.animation?(n.frame=f(n.frame,0,n.frames-1,n.frames),n.loop||n.frame!==n.stopFrame||t.stopAnimation(n)):n.frame=n.wrap?f(n.frame,0,n.frames-1,n.frames):s(n.frame,0,n.frames-1),void 0!==r&&(n.lane=r,n.lane=n.wrapLane?f(n.lane,0,n.lanes-1,n.lanes):s(n.lane,0,n.lanes-1)),n.lastFrame==n.frame&&n.lastLane==n.lane||n.target.trigger("onFrameChanged",n),n.target.trigger("onFrame",n),n.target.trigger("onDraw",n)},t.stopAnimation=function(n){n.animate=!1,n.animation&&(window.clearInterval(n.animation),n.animation=null)},t.setAnimation=function(n){n.animate?t.requestFrame(n):t.stopAnimation(n)},t.requestFrame=function(n){n.animation||(void 0===n.frameFunction&&(n.frameFunction=function(){try{t.updateFrame(n)}catch(i){}}),n.animation=window.setInterval(n.frameFunction,n.frameTime))},t.setModules=function(i){for(var u,f,r=0;r<i.mods.length;r+=1)u=i.mods[r],"string"==typeof u&&(f=t.mods[u],f?i.mods[r]=f:n.error("No module found with name "+u))},t.displaySize=function(n){var t=Math.floor(n.width||n.frameWidth||n.target.innerWidth()),i=Math.floor(n.height||n.frameHeight||n.target.innerHeight()),r=t/i;return{width:t,height:i,aspect:r}},t.calculateInnerLayout=function(n){var i=Math.floor(n.width||n.frameWidth||n.target.innerWidth()),r=Math.floor(n.height||n.frameHeight||n.target.innerHeight()),e=i/r,o=n.frameWidth||i,s=n.frameHeight||r,u=o/s,t={width:"100%",height:"100%",top:0,left:0,bottom:0,right:0,position:"absolute",overflow:"hidden"},f=n.sizeMode;return f&&"scale"!=f?("original"==f?(t.width=o,t.height=s):"fit"==f?u>=e?(t.width=i,t.height=i/u):(t.height=r,t.width=r*u):"fill"==f?u>=e?(t.height=r,t.width=r*u):(t.width=i,t.height=i/u):(t.width=i,t.height=r),t.width=0|t.width,t.height=0|t.height,t.top=(r-t.height)/2|0,t.left=(i-t.width)/2|0,t.right=t.left,t.bottom=t.top,t):t},t.setLayout=function(n){var i,r,f,e,u;n.target.attr("unselectable","on").css({width:"",height:"","-ms-user-select":"none","-moz-user-select":"none","-khtml-user-select":"none","-webkit-user-select":"none","user-select":"none"}),i=Math.floor(n.width||n.frameWidth||n.target.innerWidth()),r=Math.floor(n.height||n.frameHeight||n.target.innerHeight()),n.responsive&&"function"==typeof window.getComputedStyle&&(f=getComputedStyle(n.target[0]),f.width&&(e=i/r,i=0|Number(f.width.replace("px","")),r=i/e|0)),n.target.css({width:i,height:r,position:"relative",overflow:"hidden"}),u=t.calculateInnerLayout(n),n.stage.css(u).hide(),n.canvas&&(n.canvasRatio=n.canvasRatio||tt(n.context),n.canvas[0].width=u.width*n.canvasRatio||i,n.canvas[0].height=u.height*n.canvasRatio||r,n.canvas.css(u).hide(),n.context.scale(n.canvasRatio,n.canvasRatio))},t.setEvents=function(n){var e,u,f,r=n.target;for(l(r),u=0;u<t.eventsToPrevent.length;u+=1)i(r,t.eventsToPrevent[u],k);for(e=0;e<n.mods.length;e+=1){for(f=n.mods[e],u=0;u<t.eventNames.length;u+=1)i(r,t.eventNames[u],f[t.eventNames[u]]);i(r,"onInit",f.onInit),i(r,"onProgress",f.onProgress),i(r,"onLoad",f.onLoad),i(r,"onFrameChanged",f.onFrameChanged),i(r,"onFrame",f.onFrame),i(r,"onDraw",f.onDraw)}i(r,"onLoad",function(n,i){t.setAnimation(i)}),i(r,"onInit",n.onInit),i(r,"onProgress",n.onProgress),i(r,"onLoad",n.onLoad),i(r,"onFrameChanged",f.onFrameChanged),i(r,"onFrame",n.onFrame),i(r,"onDraw",n.onDraw)},t.boot=function(n){t.setModules(n),t.setLayout(n),t.setEvents(n),n.target.addClass("loading").trigger("onInit",n),n.loading=!0,g({source:n.source,preloadCount:n.preloadCount,progress:function(t){n.target.trigger("onProgress",[t,n])},complete:function(i){n.images=i,n.loading=!1,t.measureSource(n),t.setLayout(n),n.stage.show(),n.target.removeClass("loading").trigger("onLoad",n).trigger("onFrame",n).trigger("onDraw",n)}})},t.create=function(i){var f=i.target,u=f.data(r),e;u?n.extend(u,i):((u=n.extend({},t.defaults,i),u.source=u.source||[],f.find("img").each(function(){u.source.push(n(this).attr("src"))}),f.empty().addClass("spritespin-instance").append("<div class='spritespin-stage'><\/div>"),"canvas"===u.renderer)&&(e=n("<canvas class='spritespin-canvas'><\/canvas>")[0],e.getContext&&e.getContext("2d")?(u.canvas=n(e),u.context=e.getContext("2d"),f.append(u.canvas),f.addClass("with-canvas")):u.renderer="image"),u.target=f,u.stage=f.find(".spritespin-stage"),f.data(r,u),w(u)),"string"==typeof u.source&&(u.source=[u.source]),u.mods&&(delete u.behavior,delete u.module),(u.behavior||u.module)&&(u.mods=[],u.behavior&&u.mods.push(u.behavior),u.module&&u.mods.push(u.module),delete u.behavior,delete u.module),t.boot(u)},t.destroy=function(n){n&&(b(n),t.stopAnimation(n),l(n.target),n.target.removeData(r))},t.registerModule=function(i,r){return t.mods[i]&&n.error("Module name is already taken: "+i),r=r||{},t.mods[i]=r,r},t.Api=function(n){this.data=n},t.extendApi=function(i){var r,u=t.Api.prototype;for(r in i)i.hasOwnProperty(r)&&(u[r]?n.error("API method is already defined: "+r):u[r]=i[r]);return u},n.fn.spritespin=function(i,u){var f,e;return"data"===i?this.data(r):"api"===i?(f=this.data(r),f.api=f.api||new t.Api(f),f.api):"destroy"===i?n(this).each(function(){t.destroy(n(this).data(r))}):(2===arguments.length&&"string"==typeof i&&(e={},e[i]=u,i=e),"object"==typeof i?(i.target=i.target||n(this),t.create(i),i.target):n.error("Invalid call to spritespin"))}}(window.jQuery||window.Zepto||window.$),function(){"use strict";var n=window.SpriteSpin;n.extendApi({isPlaying:function(){return null!==this.data.animation},isLooping:function(){return this.data.loop},toggleAnimation:function(){this.data.animate=!this.data.animate,n.setAnimation(this.data)},stopAnimation:function(){this.data.animate=!1,n.setAnimation(this.data)},startAnimation:function(){this.data.animate=!0,n.setAnimation(this.data)},loop:function(t){return this.data.loop=t,n.setAnimation(this.data),this},currentFrame:function(){return this.data.frame},updateFrame:function(t){return n.updateFrame(this.data,t),this},skipFrames:function(t){var i=this.data;return n.updateFrame(i,i.frame+(i.reverse?-t:+t)),this},nextFrame:function(){return this.skipFrames(1)},prevFrame:function(){return this.skipFrames(-1)},playTo:function(t,i){var r=this.data;if(i=i||{},i.force||r.frame!==t){if(i.nearest){var u=t-r.frame,f=t>r.frame?u-r.frames:u+r.frames,e=Math.abs(u)<Math.abs(f)?u:f;r.reverse=e<0}return r.animate=!0,r.loop=!1,r.stopFrame=t,n.setAnimation(r),this}}})}(window.jQuery||window.Zepto||window.$),function(n){"use strict";function s(n){n=n||document.documentElement,n[t.requestFullscreen]()}function h(){return document[t.exitFullscreen]()}function c(){return document[t.fullscreenEnabled]}function i(){return document[t.fullscreenElement]}function r(){return!!i()}function u(){n(document).unbind(e)}function l(t){u(),n(document).bind(e,t)}function f(){n(window).unbind(o)}function a(t){f(),n(window).bind(o,t)}var t=function(){for(var t,r,i=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,f=i.length,u={};n<f;n++)if(t=i[n],t&&t[1]in document){for(n=0,r=t.length;n<r;n++)u[i[0][n]]=t[n];return u}return!1}(),e=t.fullscreenchange+"."+SpriteSpin.namespace+"-fullscreen",o="orientationchange."+SpriteSpin.namespace+"-fullscreen";SpriteSpin.extendApi({fullscreenEnabled:c,fullscreenElement:i,exitFullscreen:h,toggleFullscreen:function(n){r()?this.requestFullscreen(n):this.exitFullscreen()},requestFullscreen:function(n){n=n||{};var o=this,t=o.data,h=t.width,c=t.height,i=t.source,v=t.sizeMode,y=t.responsive,e=function(){t.width=window.screen.width,t.height=window.screen.height,t.source=n.source||i,t.sizeMode=n.sizeMode||"fit",t.responsive=!1,SpriteSpin.boot(t)},p=function(){t.width=h,t.height=c,t.source=i,t.sizeMode=v,t.responsive=y,SpriteSpin.boot(t)};l(function(){r()?(e(),a(e)):(u(),f(),p())}),s(t.target[0])}})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";function i(n,i){if(!i.loading&&i.stage.is(":visible")){t.updateInput(n,i);var r,u,f=i.target,e=f.offset();"horizontal"===i.orientation?(r=f.innerWidth()/2,u=i.currentX-e.left):(r=f.innerHeight()/2,u=i.currentY-e.top),t.updateFrame(i,i.frame+(u>r?1:-1))}}t.registerModule("click",{mouseup:i,touchend:i})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";function u(n,i){i.loading||i.dragging||!i.stage.is(":visible")||(i.dragFrame=i.frame||0,i.dragLane=i.lane||0,i.dragging=!0,t.updateInput(n,i))}function i(n,i){i.dragging&&(i.dragging=!1,t.resetInput(i))}function r(n,i){var r,e,o;if(i.dragging){if(t.updateInput(n,i),Math.abs(i.ddX)+Math.abs(i.ddY)>i.scrollThreshold)return i.dragging=!1,void t.resetInput(i);n.preventDefault(),r=0,r="number"==typeof i.orientation?(Number(i.orientation)||0)*Math.PI/180:"horizontal"===i.orientation?0:Math.PI/2;var u=Math.sin(r),f=Math.cos(r),s=(i.nddX*f-i.nddY*u)*i.sense||0,h=(i.nddX*u+i.nddY*f)*(i.senseLane||i.sense)||0;i.dragFrame+=i.frames*s,i.dragLane+=i.lanes*h,e=Math.floor(i.dragFrame),o=Math.floor(i.dragLane),t.updateFrame(i,e,o),t.stopAnimation(i)}}t.registerModule("drag",{mousedown:u,mousemove:r,mouseup:i,documentmousemove:r,documentmouseup:i,touchstart:u,touchmove:r,touchend:i,touchcancel:i}),t.registerModule("move",{mousemove:function(n,t){u.call(this,n,t),r.call(this,n,t)},mouseleave:i,touchstart:u,touchmove:r,touchend:i,touchcancel:i})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";function r(n,i){i.loading||i.dragging||!i.stage.is(":visible")||(t.updateInput(n,i),i.dragging=!0,i.animate=!0,t.setAnimation(i))}function i(n,i){i.dragging=!1,t.resetInput(i),t.stopAnimation(i)}function u(n,i){if(i.dragging){t.updateInput(n,i);var u,r,f=i.target,e=f.offset();"horizontal"===i.orientation?(u=f.innerWidth()/2,r=(i.currentX-e().left-u)/u):(u=i.height/2,r=(i.currentY-e().top-u)/u),i.reverse=r<0,r=r<0?-r:r,i.frameTime=80*(1-r)+20,("horizontal"===i.orientation&&i.dX<i.dY||"vertical"===i.orientation&&i.dX<i.dY)&&n.preventDefault()}}t.registerModule("hold",{mousedown:r,mousemove:u,mouseup:i,mouseleave:i,touchstart:r,touchmove:u,touchend:i,touchcancel:i,onFrame:function(){n(this).spritespin("api").startAnimation()}})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";function f(n,t){t.swipeFling=t.swipeFling||10,t.swipeSnap=t.swipeSnap||.5}function r(n,i){i.loading||i.dragging||(t.updateInput(n,i),i.dragging=!0)}function u(n,i){if(i.dragging){t.updateInput(n,i);var r=i.frame,u=i.lane;t.updateFrame(i,r,u)}}function i(n,i){if(i.dragging){i.dragging=!1;var r,u,f=i.frame,s=i.lane,e=i.swipeSnap,o=i.swipeFling;"horizontal"===i.orientation?(r=i.ndX,u=i.ddX):(r=i.ndY,u=i.ddY),r>e||u>o?f=i.frame-1:(r<-e||u<-o)&&(f=i.frame+1),t.resetInput(i),t.updateFrame(i,f,s),t.stopAnimation(i)}}t.registerModule("swipe",{onLoad:f,mousedown:r,mousemove:u,mouseup:i,mouseleave:i,touchstart:r,touchmove:u,touchend:i,touchcancel:i})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";function r(t){var o=t.lane*t.frames+t.frame,r=t.frameWidth*(o%t.framesX),u=t.frameHeight*i(o/t.framesX),f,e;if("canvas"===t.renderer)return f=t.canvas[0].width/t.canvasRatio,e=t.canvas[0].height/t.canvasRatio,t.context.clearRect(0,0,f,e),void t.context.drawImage(t.images[0],r,u,t.frameWidth,t.frameHeight,0,0,f,e);r=-i(r*t.scaleWidth),u=-i(u*t.scaleHeight),"background"===t.renderer?t.stage.css({"background-image":["url('",t.source[0],"')"].join(""),"background-position":[r,"px ",u,"px"].join("")}):n(t.images).css({top:u,left:r,"max-width":"initial"})}function u(t){var i=t.lane*t.frames+t.frame,r=t.images[i],u,f;"canvas"===t.renderer?r&&r.complete!==!1&&(u=t.canvas[0].width/t.canvasRatio,f=t.canvas[0].height/t.canvasRatio,t.context.clearRect(0,0,u,f),t.context.drawImage(r,0,0,u,f)):"background"===t.renderer?t.stage.css({"background-image":["url('",t.source[i],"')"].join(""),"background-position":"0px 0px"}):(n(t.images).hide(),n(t.images[i]).show())}var i=Math.floor;t.registerModule("360",{onLoad:function(t,r){var u,f,e;(r.scaleWidth=r.width&&r.frameWidth?r.width/r.frameWidth:1,r.scaleHeight=r.height&&r.frameHeight?r.height/r.frameHeight:1,r.sourceIsSprite=1===r.images.length,r.stage.empty().css({"background-image":"none"}).show(),"canvas"===r.renderer)?(u=r.canvas[0].width/r.canvasRatio,f=r.canvas[0].height/r.canvasRatio,r.context.clearRect(0,0,u,f),r.canvas.show()):"background"===r.renderer?(r.sourceIsSprite?(u=i(r.sourceWidth*r.scaleWidth),f=i(r.sourceHeight*r.scaleHeight)):(u=i(r.frameWidth*r.scaleWidth),f=i(r.frameHeight*r.scaleHeight)),e=[u,"px ",f,"px"].join(""),r.stage.css({"background-repeat":"no-repeat","-webkit-background-size":e,"-moz-background-size":e,"-o-background-size":e,"background-size":e})):"image"===r.renderer&&(r.sourceIsSprite?(u=i(r.sourceWidth*r.scaleWidth),f=i(r.sourceHeight*r.scaleHeight)):u=f="100%",n(r.images).appendTo(r.stage).css({width:u,height:f,position:"absolute"}))},onDraw:function(n,t){t.sourceIsSprite?r(t):u(t)}})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";function f(n,i){var u=r(i),f=t.calculateInnerLayout(i);u.canvas[0].width=i.width*i.canvasRatio,u.canvas[0].height=i.height*i.canvasRatio,u.canvas.css(f).show(),u.context.scale(i.canvasRatio,i.canvasRatio),i.target.append(u.canvas)}function e(n,t){var i=r(t);o(t,i),null==i.timeout&&u(t,i)}function r(t){t.blurScope=t.blurScope||{};var i=t.blurScope;return i.canvas=i.canvas||n("<canvas class='blur-layer'><\/canvas>"),i.context=i.context||i.canvas[0].getContext("2d"),i.steps=i.steps||[],i.fadeTime=Math.max(t.blurFadeTime||200,1),i.frameTime=Math.max(t.blurFrameTime||t.frameTime,16),i.trackTime=null,i.cssBlur=!!t.blurCss,i}function o(n,t){var i=Math.abs(n.frame-n.lastFrame);i>=n.frames/2&&(i=n.frames-i),t.steps.unshift({index:n.lane*n.frames+n.frame,live:1,step:t.frameTime/t.fadeTime,d:i})}function s(n){i.length=0;for(var t=0;t<n.length;t+=1)n[t].alpha<=0&&i.push(t);for(t=0;t<i.length;t+=1)n.splice(i[t],1)}function u(n,t){t.timeout=window.setTimeout(function(){a(n,t)},t.frameTime)}function h(n,t){window.clearTimeout(t.timeout),t.timeout=null}function c(n,t){t=Math.min(Math.max(t/2-4,0),1.5),n.css({"-webkit-filter":"blur("+t+"px)",filter:"blur("+t+"px)"})}function l(n,t,i){var u=t.context,f=i.index,r=n.sourceIsSprite?n.images[0]:n.images[f],e,o;i.alpha<=0||!r||r.complete===!1||((u.globalAlpha=i.alpha,n.sourceIsSprite)?(e=n.frameWidth*(f%n.framesX),o=n.frameHeight*Math.floor(f/n.framesX),u.drawImage(r,e,o,n.frameWidth,n.frameHeight,0,0,n.width,n.height)):u.drawImage(r,0,0,n.width,n.height))}function a(n,t){if(h(n,t),t.context){var r,i,e=t.context,f=0;for(e.clearRect(0,0,n.width,n.height),r=0;r<t.steps.length;r+=1)i=t.steps[r],i.live=Math.max(i.live-i.step,0),i.alpha=Math.max(i.live-.25,0),l(n,t,i),f+=i.alpha+i.d;t.cssBlur&&c(t.canvas,f),s(t.steps),t.steps.length&&u(n,t)}}var i=[];t.registerModule("blur",{onLoad:f,onFrameChanged:e})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";function o(n,t){t.easeAbortAfterMs=u(t.easeAbortAfterMs||250,0),t.easeDamping=u(c(t.easeDamping||.9,.999),0),t.easeSamples=u(t.easeSamples||5,1),t.easeUpdateTime=u(t.easeUpdateTime||t.frameTime,16),t.easeScope={samples:[],steps:[]}}function f(n,t){t.dragging&&(r(t,t.easeScope),s(t,t.easeScope))}function i(n,t){for(var a,u,f,i=t.easeScope,s=i.samples,h=0,c=0,o=0,l=0;l<s.length;l+=1)if(f=s[l],u){if(a=f.time-u.time,a>t.easeAbortAfterMs)return h=c=o=0,r(t,i);c+=f.frame-u.frame,h+=f.lane-u.lane,o+=a,u=f}else u=f;s.length=0,o&&(i.ms=t.easeUpdateTime,i.lane=t.lane,i.lanes=0,i.laneStep=h/o*i.ms,i.frame=t.frame,i.frames=0,i.frameStep=c/o*i.ms,e(t,i))}function s(n,t){for(t.samples.push({time:(new Date).getTime(),frame:n.dragFrame,lane:n.dragLane});t.samples.length>n.easeSamples;)t.samples.shift()}function r(n,t){null!=t.timeout&&(window.clearTimeout(t.timeout),t.timeout=null)}function e(n,t){t.timeout=window.setTimeout(function(){h(n,t)},t.ms)}function h(n,i){i.lanes+=i.laneStep,i.frames+=i.frameStep,i.laneStep*=n.easeDamping,i.frameStep*=n.easeDamping;var u=Math.floor(i.frame+i.frames),f=Math.floor(i.lane+i.lanes);t.updateFrame(n,u,f),n.dragging?r(n,i):Math.abs(i.frameStep)>.005||Math.abs(i.laneStep)>.005?e(n,i):r(n,i)}var u=Math.max,c=Math.min;t.registerModule("ease",{onLoad:o,mousemove:f,mouseup:i,mouseleave:i,touchmove:f,touchend:i,touchcancel:i})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";function i(i,r){var f,e,u,o,s;for(r.galleryImages=[],r.galleryOffsets=[],r.gallerySpeed=500,r.galleryOpacity=.25,r.galleryFrame=0,r.galleryStage=r.galleryStage||n("<div/>"),r.stage.prepend(r.galleryStage),r.galleryStage.empty(),e=0,f=0;f<r.source.length;f+=1)u=n("<img src='"+r.source[f]+"'/>"),r.galleryStage.append(u),r.galleryImages.push(u),o=r.height/u[0].height,r.galleryOffsets.push(-e+(r.width-u[0].width*o)/2),e+=r.width,u.css({"max-width":"initial",opacity:r.galleryOpacity,width:r.width,height:r.height});s=t.calculateInnerLayout(r),r.galleryStage.css(s).css({width:e}),r.galleryImages[r.galleryFrame].animate({opacity:1},r.gallerySpeed)}function r(n,t){t.galleryFrame===t.frame||t.dragging?(t.dragging||t.dX!=t.gallerydX)&&(t.galleryDX=t.DX,t.galleryDDX=t.DDX,t.galleryStage.stop(!0,!0).animate({left:t.galleryOffsets[t.frame]+t.dX})):(t.galleryStage.stop(!0,!1),t.galleryStage.animate({left:t.galleryOffsets[t.frame]},t.gallerySpeed),t.galleryImages[t.galleryFrame].animate({opacity:t.galleryOpacity},t.gallerySpeed),t.galleryFrame=t.frame,t.galleryImages[t.galleryFrame].animate({opacity:1},t.gallerySpeed))}t.registerModule("gallery",{onLoad:i,onDraw:r})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";var i=Math.floor;t.registerModule("panorama",{onLoad:function(n,t){t.stage.empty().show(),t.frames=t.sourceWidth,"horizontal"===t.orientation?(t.scale=t.height/t.sourceHeight,t.frames=t.sourceWidth):(t.scale=t.width/t.sourceWidth,t.frames=t.sourceHeight);var u=i(t.sourceWidth*t.scale),f=i(t.sourceHeight*t.scale),r=[u,"px ",f,"px"].join("");t.stage.css({"max-width":"initial","background-image":["url('",t.source[0],"')"].join(""),"background-repeat":"repeat-both","-webkit-background-size":r,"-moz-background-size":r,"-o-background-size":r,"background-size":r})},onDraw:function(n,t){var r=0,u=0;"horizontal"===t.orientation?r=-i(t.frame%t.frames*t.scale):u=-i(t.frame%t.frames*t.scale),t.stage.css({"background-position":[r,"px ",u,"px"].join("")})}})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),function(n,t){"use strict";function f(t,i){i.zoomStage||(i.zoomStage=n("<div class='spritezoom-stage'><\/div>").css({width:"100%",height:"100%",top:0,left:0,bottom:0,right:0,position:"absolute"}).appendTo(i.target).hide())}function e(n,t){t.zoomStage&&t.zoomStage.remove()}function i(n,i){n.preventDefault(),i.dragging=!1,!n.touches&&n.originalEvent&&(n.touches=n.originalEvent.touches);var r,u,f,e;n.touches&&n.touches.length?(r=n.touches[0].clientX||0,u=n.touches[0].clientY||0):(r=n.clientX||0,u=n.clientY||0),r/=i.width,u/=i.height,null==i.zoomPX&&(i.zoomPX=r,i.zoomPY=u),null==i.zoomX&&(i.zoomX=r,i.zoomY=u),f=r-i.zoomPX,e=u-i.zoomPY,i.zoomPX=r,i.zoomPY=u,n.type.match(/touch/)&&(f=-f,e=-e),i.zoomX=t.clamp(i.zoomX+f,0,1),i.zoomY=t.clamp(i.zoomY+e,0,1),t.updateFrame(i)}function o(t,i){var e=i.lane*i.frames+i.frame,f=(i.zoomSource||i.source)[e],r,u;if(!f)return void n.error("'zoomSource' option is missing or it contains unsufficient number of frames.");r=i.zoomX,u=i.zoomY,null!=r&&null!=u||(r=i.zoomX=.5,u=i.zoomY=.5),r=100*r|0,u=100*u|0,i.zoomStage.css({"background-repeat":"no-repeat","background-image":["url('",f,"')"].join(""),"background-position":[r,"% ",u,"%"].join("")})}function r(t,r){var u,f,e;return(t.preventDefault(),u=(new Date).getTime(),!r.zoomClickTime)?void(r.zoomClickTime=u):(f=u-r.zoomClickTime,e=r.zoomDoubleClickTime||500,f>e?void(r.zoomClickTime=u):(r.zoomClickTime=0,void(n(this).spritespin("api").toggleZoom()&&i(t,r))))}function u(n,t){t.zoomStage.is(":visible")&&i(n,t)}function s(){var t=this.data;return t.zoomStage?t.zoomStage.is(":visible")?(t.zoomStage.fadeOut(),t.stage.fadeIn(),!1):(t.zoomStage.fadeIn(),t.stage.fadeOut(),!0):(n.error("zoom module is not initialized or is not available."),!1)}t.registerModule("zoom",{mousedown:r,touchstart:r,mousemove:u,touchmove:u,onInit:f,onDestroy:e,onDraw:o}),t.extendApi({toggleZoom:s})}(window.jQuery||window.Zepto||window.$,window.SpriteSpin),app=angular.module("mazdaApp"),app.service("productService",["$http","$q","$rootScope","$timeout","CONST","$filter",function(n,t,i,r,u){var f=this;f.getColors=function(i){var r=t.defer();return n.get(u.URL.GET_PRODUCT_COLORS+i).then(function(n){r.resolve(n.data)},function(n){r.reject(n),console.log(n)}),r.promise},f.getGallery=function(i){var r=t.defer();return n.get(u.URL.GET_PRODUCT_GALLERY+i).then(function(n){r.resolve(n.data)},function(n){r.reject(n),console.log(n)}),r.promise},f.getProperties=function(i){var r=t.defer();return n.get(u.URL.GET_PRODUCT_PROPERTIES+i).then(function(n){r.resolve(n.data)},function(n){r.reject(n),console.log(n)}),r.promise},f.getPerformance=function(i){var r=t.defer();return n.get(u.URL.GET_PRODUCT_PERFORMENCE+i).then(function(n){r.resolve(n.data)},function(n){r.reject(n),console.log(n)}),r.promise},f.getSafety=function(i){var r=t.defer();return n.get(u.URL.GET_PRODUCT_SAFETY+i).then(function(n){r.resolve(n.data)},function(n){r.reject(n),console.log(n)}),r.promise},f.getTechnology=function(i){var r=t.defer();return n.get(u.URL.GET_PRODUCT_TECHNOLOGY+i).then(function(n){r.resolve(n.data)},function(n){r.reject(n),console.log(n)}),r.promise},f.getInteriorLevel=function(i){var r=t.defer();return n.get(u.URL.GET_PRODUCT_INTERIORLEVEL+i).then(function(n){r.resolve(n.data)},function(n){r.reject(n),console.log(n)}),r.promise},f.getCatalog=function(i){var r=t.defer();return n.get(u.URL.GET_PRODUCT_CATALOG+i).then(function(n){r.resolve(n.data)},function(n){r.reject(n),console.log(n)}),r.promise},f.getNextPrev=function(i){var r=t.defer();return n.get(u.URL.GET_PRODUCT_NEXT_PREV+i).then(function(n){r.resolve(n.data)},function(n){r.reject(n),console.log(n)}),r.promise}}]),fakeCars=[{id:78,name:"mazda 1",priceFrom:2222,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car4.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/4/1.png","/Uploads/ProductPage/polution/4/2.png","/Uploads/ProductPage/polution/4/3.png",null,null,null,null,null],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/4/1.png","/Uploads/ProductPage/car_size/4/2.png","/Uploads/ProductPage/car_size/4/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null],imageStartPriceXml:[null],carModelId:7,carModelSpec:null,sort:null,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:103,name:"מפרט טכני",description:null,typeId:0,link:"/Uploads/ProductPage/Management/Mifrat/4.pdf"},{id:104,name:"קטלוג",description:null,typeId:0,link:"/Uploads/ProductPage/Management/Catalogue/4.pdf"},{id:105,name:"ספר רכב",description:null,typeId:0,link:"/Uploads/ProductPage/Management/CarBook/4.pdf"}]},{id:2,name:"MaZDa 3 Hatchback",priceFrom:128e3,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car2.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/2/1.png","/Uploads/ProductPage/polution/2/2.png","/Uploads/ProductPage/polution/2/3.png",null,null,null,null,null],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/2/1.png","/Uploads/ProductPage/car_size/2/2.png","/Uploads/ProductPage/car_size/2/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null],imageStartPriceXml:[null],carModelId:null,carModelSpec:null,sort:1,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:46,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads/ProductPage/Management/Mifrat/2.pdf"},{id:47,name:"קטלוג",description:null,typeId:2,link:"/Uploads/ProductPage/Management/Catalogue/2.pdf"},{id:48,name:"ספר רכב",description:null,typeId:3,link:"/Uploads/ProductPage/Management/CarBook/2.pdf"}]},{id:3,name:"MaZDa 3 Sedan",priceFrom:128e3,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car3.png",imagesFuelPerformanceXml:["/Uploads//ProductPage/ModelSpecifications/%D7%A6%D7%A8%D7%99%D7%9B%D7%AA%20%D7%93%D7%9C%D7%A7.jpg","/Uploads//ProductPage/ModelSpecifications/%D7%A1%D7%A8%D7%92%D7%9C%20%D7%96%D7%99%D7%94%D7%95%D7%9D.jpg","/Uploads//ProductPage/ModelSpecifications/%D7%98%D7%91%D7%9C%D7%AA%20%D7%91%D7%98%D7%99%D7%97%D7%95%D7%AA.jpg","/Uploads//ProductPage/ModelSpecifications/%D7%A1%D7%A8%D7%92%D7%9C%20%D7%91%D7%98%D7%99%D7%97%D7%95%D7%AA.jpg","/Uploads//ProductPage/ModelSpecifications/%D7%A8%D7%9E%D7%AA%20%D7%92%D7%99%D7%9E%D7%95%D7%A8%201.jpg","/Uploads//ProductPage/ModelSpecifications/%D7%A8%D7%9E%D7%AA%20%D7%92%D7%99%D7%9E%D7%95%D7%A8%202.jpg","/Uploads//ProductPage/ModelSpecifications/%D7%A8%D7%9E%D7%AA%20%D7%92%D7%99%D7%9E%D7%95%D7%A8%203.jpg","/Uploads//ProductPage/ModelSpecifications/%D7%9E%D7%A7%D7%A8%D7%90.jpg"],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/3/1.png","/Uploads/ProductPage/car_size/3/2.png","/Uploads/ProductPage/car_size/3/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null],imageStartPriceXml:[null],carModelId:1,carModelSpec:null,sort:1,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:49,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads/ProductPage/Management/Mifrat/3.pdf"},{id:50,name:"קטלוג",description:null,typeId:2,link:"/Uploads/ProductPage/Management/Catalogue/3.pdf"},{id:51,name:"ספר רכב",description:null,typeId:3,link:"/Uploads/ProductPage/Management/CarBook/3.pdf"}]},{id:4,name:"MaZDa 2 DEMIO",priceFrom:111900,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car4.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/4/1.png","/Uploads/ProductPage/polution/4/2.png","/Uploads/ProductPage/polution/4/1.png",null,null,null,null,null],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/4/1.png","/Uploads/ProductPage/car_size/4/2.png","/Uploads/ProductPage/car_size/4/3.png","/Uploads/ProductPage/car_size/4/3.png","/Uploads/ProductPage/car_size/4/3.png","/Uploads/ProductPage/car_size/4/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null,null,null,null],imageStartPriceXml:[null],carModelId:null,carModelSpec:null,sort:2,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:112,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads//ProductPage/Management/Mifrat/4.PDF"},{id:113,name:"קטלוג",description:null,typeId:2,link:"/Uploads//ProductPage/Management/Catalogue/4.pdf"},{id:114,name:"ספר רכב",description:null,typeId:3,link:"/Uploads//ProductPage/Management/CarBook/4.pdf"}]},{id:5,name:"MaZDa 2",priceFrom:99900,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car5.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/5/1.png","/Uploads/ProductPage/polution/5/2.png","/Uploads/ProductPage/polution/5/3.png",null,null,null,null,null],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/5/1.png","/Uploads/ProductPage/car_size/5/2.png","/Uploads/ProductPage/car_size/5/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null],imageStartPriceXml:[null],carModelId:null,carModelSpec:null,sort:3,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:55,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads/ProductPage/Management/Mifrat/5.pdf"},{id:56,name:"קטלוג",description:null,typeId:2,link:"/Uploads/ProductPage/Management/Catalogue/5.pdf"},{id:57,name:"ספר רכב",description:null,typeId:3,link:"/Uploads/ProductPage/Management/CarBook/5.pdf"}]},{id:6,name:"MaZDa 5",priceFrom:163e3,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car6.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/6/1.png","/Uploads/ProductPage/polution/6/2.png","/Uploads/ProductPage/polution/6/3.png"],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/6/1.png","/Uploads/ProductPage/car_size/6/2.png"],imagesAltCarExternalDimensionsXml:[null,null],imageStartPriceXml:[],carModelId:null,carModelSpec:null,sort:4,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:58,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads/ProductPage/Management/Mifrat/6.pdf"},{id:59,name:"קטלוג",description:null,typeId:2,link:"/Uploads/ProductPage/Management/Catalogue/6.pdf"},{id:60,name:"ספר רכב",description:null,typeId:3,link:"/Uploads/ProductPage/Management/CarBook/6.pdf"}]},{id:11,name:"MaZDa CX-5 4X4",priceFrom:19e4,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car7.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/11/1.png","/Uploads/ProductPage/polution/11/2.png","/Uploads/ProductPage/polution/11/3.png"],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/11/1.png","/Uploads/ProductPage/car_size/11/2.png","/Uploads/ProductPage/car_size/11/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null],imageStartPriceXml:[],carModelId:7,carModelSpec:20,sort:5,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:73,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads/ProductPage/Management/Mifrat/11.pdf"},{id:74,name:"קטלוג",description:null,typeId:2,link:"/Uploads/ProductPage/Management/Catalogue/11.pdf"},{id:75,name:"ספר רכב",description:null,typeId:3,link:"/Uploads/ProductPage/Management/CarBook/11.pdf"}]},{id:12,name:"MaZDa CX-5 4X2",priceFrom:166500,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car7.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/12/1.png","/Uploads/ProductPage/polution/12/2.png","/Uploads/ProductPage/polution/12/3.png"],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/12/1.png","/Uploads/ProductPage/car_size/12/2.png","/Uploads/ProductPage/car_size/12/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null],imageStartPriceXml:[],carModelId:7,carModelSpec:20,sort:5,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:76,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads/ProductPage/Management/Mifrat/12.pdf"},{id:77,name:"קטלוג",description:null,typeId:2,link:"/Uploads/ProductPage/Management/Catalogue/12.pdf"},{id:78,name:"ספר רכב",description:null,typeId:3,link:"/Uploads/ProductPage/Management/CarBook/12.pdf"}]},{id:13,name:"MaZDa 6 Sedan",priceFrom:167500,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car13.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/13/1.png","/Uploads/ProductPage/polution/13/2.png","/Uploads/ProductPage/polution/13/3.png"],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/13/1.png","/Uploads/ProductPage/car_size/13/2.png","/Uploads/ProductPage/car_size/13/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null],imageStartPriceXml:[],carModelId:8,carModelSpec:50,sort:6,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:79,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads/ProductPage/Management/Mifrat/13.pdf"},{id:80,name:"קטלוג",description:null,typeId:2,link:"/Uploads/ProductPage/Management/Catalogue/13.pdf"},{id:81,name:"ספר רכב",description:null,typeId:3,link:"/Uploads/ProductPage/Management/CarBook/13_20150917.pdf"}]},{id:14,name:"MaZDa 6 Wagon",priceFrom:167500,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car14.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/14/1.png","/Uploads/ProductPage/polution/14/2.png","/Uploads/ProductPage/polution/14/3.png"],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/14/1.png","/Uploads/ProductPage/car_size/14/2.png","/Uploads/ProductPage/car_size/14/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null],imageStartPriceXml:[],carModelId:8,carModelSpec:50,sort:6,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:82,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads/ProductPage/Management/Mifrat/14.pdf"},{id:83,name:"קטלוג",description:null,typeId:2,link:"/Uploads/ProductPage/Management/Catalogue/14.pdf"},{id:84,name:"ספר רכב",description:null,typeId:3,link:"/Uploads/ProductPage/Management/CarBook/14.pdf"}]},{id:15,name:"MaZDa MX5",priceFrom:235e3,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car10.png",imagesFuelPerformanceXml:["/Uploads/ProductPage/polution/10/1.png","/Uploads/ProductPage/polution/10/2.png","/Uploads/ProductPage/polution/10/3.png"],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/10/1.png","/Uploads/ProductPage/car_size/10/2.png","/Uploads/ProductPage/car_size/10/3.png"],imagesAltCarExternalDimensionsXml:[null,null,null],imageStartPriceXml:[null],carModelId:null,carModelSpec:null,sort:8,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:115,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads//ProductPage/Management/Mifrat/13236%20MAZDA%20MX-5%20C-5.pdf"},{id:116,name:"קטלוג",description:null,typeId:2,link:"/Uploads//ProductPage/Management/Catalogue/13305%20Mazda%20MX-5%20Cataloge%202015(i).pdf"},{id:117,name:"ספר רכב",description:null,typeId:3,link:"/Uploads//ProductPage/Management/CarBook/150500%20Mazda%20MX-5%20OM%2022-12-2015%20HB%20LoRes.pdf"}]},{id:48,name:"sadas 2",priceFrom:23233,typeId:1,priceNote:null,imagesGeneralXml:"/Uploads/HomePageOurCars/car4.png",imagesFuelPerformanceXml:["/Uploads/HomePageOurCars/car5.png","/Uploads/HomePageOurCars/car5.png","/Uploads/HomePageOurCars/car5.png",null,null,null,null,null],imagesCarExternalDimensionsXml:["/Uploads/ProductPage/car_size/5/2.png","/Uploads/ProductPage/car_size/5/1.png"],imagesAltCarExternalDimensionsXml:[null,null],imageStartPriceXml:[null],carModelId:null,carModelSpec:50,sort:9,carType:1,isContainer:!1,url:null,isActive:!0,hasArticle:!1,isClickToCall:!1,carModelsCatalogs:[{id:100,name:"מפרט טכני",description:null,typeId:1,link:"/Uploads/ProductPage/Management/Mifrat/14.pdf"},{id:101,name:"קטלוג",description:null,typeId:2,link:"/Uploads/ProductPage/Management/Catalogue/14.pdf"},{id:102,name:"ספר רכב",description:null,typeId:3,link:"/Uploads/ProductPage/Management/CarBook/14.pdf"}]}],angular.module("mazdaApp").controller("productController",["$scope","$timeout","$location","productService","$rootScope","$window",function(n,t,i,r,u,f){var e=this;e.model=model,e.activeColorIndex=0,e.activeFrame=0,e.completeIndex=0,e.modelPageTitle=model.modelPageTitle,e.setActiveColor=function(n){e.activeColorIndex=n},e.showLoader=!1,e.isIE=u.isIE,e.isXS=u.isXS,r.getColors(e.model.id).then(function(n){e.model.colors=n}),document.addEventListener("scroll",function(){var n=document.querySelector("#section-up");(document.body.scrollHeight-window.pageYOffset)/document.body.scrollHeight<.5?n.classList.remove("hidden"):n.classList.add("hidden")}),r.getColors(e.model.id).then(function(n){e.model.colors=n,e.model.colors.map(function(n){return n.showArrow=n.Model360Images.length>1?!0:!1,n}),u.isXS&&t(function(){function t(n){var i=u.getWindowDimensions().width,t;i>=n.virtualSize?(n.params.centeredSlides=!0,t=Math.floor(e.model.colors.length/2),n.activeIndex=t,n.update(!0),n.lockSwipes()):(n.params.centeredSlides=!1,n.params.slideToClickedSlide=!0,n.slideTo(0,0),n.update(),n.unlockSwipes())}var n=new Swiper(" #colors .swiper-container",{slidesPerView:"auto",centeredSlides:!1,loop:!1,onInit:function(n){t(n)}});u.$on("colors.enter",function(){n&&(n.slideTo(e.model.colors.length,500),setTimeout(function(){n.slideTo(0,500)},500))}),$(f).resize(function(){n&&t(n)})},500)},function(n){console.error(n)}),u.$on("color.360.change.complete",function(n,i){t(function(){e.completeIndex=i.index})})}]),app=angular.module("mazdaApp"),app.component("leadImage",{bindings:{model:"="},templateUrl:"/app/product/leadImage/leadImage.template.html",controller:["$rootScope",function(n){var t=this;t.isXS=n.isXS}]}),app=angular.module("mazdaApp"),app.component("productActions",{bindings:{model:"=",pos:"@"},templateUrl:"/app/product/productActions/productActions.template.html",controller:["$scope","$element","carModels","$timeout","CONST","$rootScope","$window","$location",function(n,t,i,r,u,f,e,o){var s=this;s.goToTestDrive=function(){if(f.isXS){var n="/partial/testdrive/?isMobile=true&id="+s.model.id,t=o.search().ref;t&&(n+="&ref="+t),e.location.href=n}else $(".navbar li.dropdown.test-drive-form").addClass("open active")},s.goToFinance=function(){e.location.href="/מחשבון-מימון?modelId="+s.model.id},s.goToShop=function(){var n="https://shop.mazda.co.il/";s.model.isInShop&&(n+=s.model.id+"?utm_medium=model&utm_source=mazda#/detailing"),n+="?utm_medium=model&utm_source=mazda",e.location.href=n}}]}),app=angular.module("mazdaApp"),app.component("threeSixty",{bindings:{model:"=",active:"=",loader:"=",index:"="},template:"<div><\/div>",controller:["$scope","$element","carModels","$timeout","CONST","$rootScope",function(n,t,i,r,u,f){function w(n){l=n.changedTouches[0].target.classList.value=="treeSixty-wrap"||n.changedTouches[0].target.offsetParent&&n.changedTouches[0].target.offsetParent.classList=="spritespin-stage"?!0:!1,s=n.touches[0].clientX,h=n.touches[0].clientY}function b(n){if(l){if(!s||!h)return;var r=n.touches[0].clientX,i=n.touches[0].clientY,u=s-r,t=h-i;Math.abs(u)>Math.abs(t)?console.log("not work!!!"):i>0?window.scroll(0,window.pageYOffset+t):window.scroll(0,window.pageYOffset+t)}s=null,h=null}function y(){if(o){p();return}console.log("element",t.children().first()),o=t.children().first().spritespin({width:1920,height:1080,source:n.getImages(),responsive:!0,animate:!1,sense:-10,renderer:a,frame:c||0,scrollThreshold:v,orientation:"horizontal",onInit:function(){e.loader=!0},onLoad:function(){p(),e.loader=!1}}).spritespin("api")}function p(){f.$broadcast("color.360.change.complete",{index:e.index})}var e=this,o=null,c=0,a="canvas",v=200,s=null,h=null,l=!1;n.getImages=function(){var t,n;if(e.model.Model360Images=e.model.Model360Images.map(function(n){return n+(f.isXS?"?width=750":"?width=1200")}),e.model.Model360Images.length>1)return e.model.Model360Images;for(t=e.model.Model360Images[0],n=0;n<23;n++)e.model.Model360Images.push(t);return e.model.Model360Images},n.showArrow=function(){return e.model.Model360Images.length>1?!0:!1},e.$onInit=function(){var i,t;if(f.isXS&&(document.addEventListener("touchstart",w,!1),document.addEventListener("touchmove",b,!1),e.model.Model360Images.map(function(n){n+="?width=750"})),f.isTouchDevice&&(a="image",v=50),e.model.Model360Images.length==1)for(e.model.dontShowArrow=!0,i=e.model.Model360Images[0],t=0;t<23;t++)e.model.Model360Images.push(i);e.active==e.index&&y(),n.$watch("$ctrl.active",function(n,t){t!=n&&(t==e.index&&o&&f.$broadcast("color.360.change.frame",{frame:o.data.frame}),n==e.index&&y())})},f.$on("color.360.change.frame",function(n,t){c=t.frame,o&&o.updateFrame(c)})}]}),app=angular.module("mazdaApp"),app.component("gallery",{bindings:{modelId:"<"},templateUrl:"/app/product/gallery/gallery.template.html",controller:["$scope","$element","$timeout","CONST","productService","$rootScope",function(n,t,i,r,u){function o(){i(function(){e=new Swiper(angular.element(t).find(" .swiper-container"),{slidesPerView:1,pagination:t.find(".swiper-pagination"),paginationClickable:!0,loop:!0,nextButton:t.find(".swiper-button-next"),prevButton:t.find(".swiper-button-prev"),a11y:!0,keyboardControl:!0,preloadImages:!1,lazyLoading:!0,lazyLoadingInPrevNext:!0})},500)}var f=this,e=null;f.$onInit=function(){u.getGallery(f.modelId).then(function(n){f.items=n,o()},function(n){console.error(n)})}}]}),app=angular.module("mazdaApp"),app.component("properties",{bindings:{modelId:"<"},templateUrl:"/app/product/properties/properties.template.html",controller:["$scope","$element","$timeout","CONST","productService","$rootScope",function(n,t,i,r,u){var f=this;f.activeIndex=0,f.$onInit=function(){u.getProperties(f.modelId).then(function(n){f.prop={outside:null,inside:null},f.inside={},f.outside={},n.map(function(n){n.IsOutside?(f.prop.outside=n,f.outside=n):(f.prop.inside=n,f.inside=n)})},function(n){console.error(n)})},f.fixPosition=function(n){screen.width>767&&setTimeout(function(){var t=window.innerHeight-n.screenY;t<280&&window.scrollBy(0,268-t)},250)},f.closeAllHotspot=function(){for(var t=document.querySelectorAll("#hotspot_popup"),n=0;n<t.length;n++)t[n].style.display="none"}}]}),app=angular.module("mazdaApp"),app.component("performance",{bindings:{modelId:"<"},templateUrl:"/app/product/performance/performance.template.html",controller:["$scope","$element","$timeout","CONST","productService","$rootScope",function(n,t,i,r,u,f){function c(){i(function(){h=new Swiper(angular.element(t).find(" .swiper-container"),{slidesPerView:1,pagination:t.find(".swiper-pagination"),paginationClickable:!0,nextButton:t.find(".swiper-button-next"),prevButton:t.find(".swiper-button-prev"),a11y:!0,keyboardControl:!0,onInit:function(n){n.slides.each(function(n,t){if($(t).find("[data-animatenumer]").length){var i=l(t);i.length>1&&(e[n]=i)}}),e.length&&s(e[0])},onSlideChangeStart:function(n){var t=e[n.activeIndex];t&&t.length&&s(t)},preloadImages:!1,lazyLoading:!0,lazyLoadingInPrevNext:!0})},500)}function s(n){n.map(function(n){n&&(n.reset(),n.start())})}function l(n){var i={useEasing:!0,useGrouping:!0,separator:",",decimal:".",prefix:"",suffix:""},t=[];return $(n).find("[data-animatenumer]").each(function(){var n=$(this);n.attr("data-animatenumer")&&t.push(new CountUp(n[0],0,parseFloat(n.attr("data-animatenumer")),v(n.attr("data-animatenumer")),3,i))}),t}function a(n){var t=(""+n).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function v(n){var t;switch(a(n)){case 1:t=1;break;case 2:t=2;break;default:t=0}return t}var o=this,h=null,e;o.activeIndex=0,e=[],o.$onInit=function(){u.getPerformance(o.modelId).then(function(n){o.items=n.Item1,c()},function(n){console.error(n)})},f.$on("performance.enter",function(){e.length&&s(e[0])})}]}),app=angular.module("mazdaApp"),app.directive("hotspots",["$rootScope","$window","$timeout",function(){return{restrict:"AE",link:function(n,t,i){function s(n,t){var f=t.getWidthInPercent().replace("%",""),s=t.getHeightInPercent().replace("%",""),h=$("#hotspot_"+n).getWidthInPercent().replace("%",""),c=$("#hotspot_"+n).getHeightInPercent().replace("%",""),l=h/2,i=c/2,r=parseInt($("#hotspot_"+n)[0].style.left.replace("%",""))+i,u=parseInt($("#hotspot_"+n)[0].style.top.replace("%",""))+i,e,o;u>s?r<f?(t.css("left",parseInt(r)+"%"),t.css("top",parseInt(u)-parseInt(s)+"%")):(e=parseInt(r)-parseInt(f),o=parseInt(u)-parseInt(s),t.css("left",e+"%"),t.css("top",o+"%")):r<f?(t.css("left",parseInt(r)-i+"%"),t.css("top",parseInt(u)+i+"%")):(e=parseInt(r)-parseInt(f)-i,o=parseInt(u)-i,t.css("left",e+"%"),t.css("top",o+"%"))}var h,c,f,r=$(t).find("#hotspot_popup"),u,e,o=function(n){var o="",l="",t,a,v;i.hotspots&&(u=$(i.hotspots).find("h3"),e=$(i.hotspots).find(".description")),t=n,a=t.attr("data-popupid"),h=t.attr("data-popuptype"),c=t.attr("data-link"),r.attr("src",""),i.hotspots?(o=t.attr("data-hotspot-title"),l=t.attr("data-hotspot-description")):(v=t.attr("data-hotspot-src"),r.attr("src",v)),$("#"+f).attr("src","/images/HotSpotClosed.png"),f==t.attr("id")?(f=t.attr("id"),i.hotspots?u.html()?(t.attr("src","/images/HotSpotClosed.png"),u.html(""),e.html("")):(t.attr("src","/images/HotSpotOpened.png"),u.html(o),e.html(l)):r.is(":visible")==!1?(r.one("load",function(){var n=$(this);n.fadeIn(),s(a,r)}).each(function(){}),t.attr("src","/images/HotSpotOpened.png")):(r.hide(),t.attr("src","/images/HotSpotClosed.png"),r.attr("src",""))):(f=t.attr("id"),r.hide(),r.one("load",function(){r.fadeIn(),s(a,r)}).each(function(){}),t.attr("src","/images/HotSpotOpened.png"),i.hotspots&&(u.html(o),e.html(l)))};$(document).on("click",".hotspot",function(){o($(this))});$(document).on("keydown",".hotspot",function(n){(n.keyCode=="32"||n.keyCode=="13")&&o($(this))});(function(n){n.fn.getWidthInPercent=function(){var t=n(this).width(),i=n(document).width(),r=t/i,u=100*r;return u+"%"}})(jQuery),function(n){n.fn.getHeightInPercent=function(){var t=n(this).height(),i=n(document).height(),r=t/i,u=100*r;return u+"%"}}(jQuery)}}}]),app=angular.module("mazdaApp"),app.directive("productScroll",["$rootScope","$window","$timeout",function(n,t,i){return{restrict:"AE",link:function(){var r=new ScrollMagic.Controller,u=$("#slide-nav").height();i(function(){function h(n){var u=n.target,i=u.getAttribute("href");i&&!$(u).hasClass("notScrolling")&&i.length>0&&(n.preventDefault(),r.scrollTo(i,i),t.history&&t.history.pushState&&history.pushState("",document.title,i))}var c=new ScrollMagic.Scene({triggerElement:"#performance",reverse:!1,triggerHook:.5}).addTo(r).on("enter",function(){n.$broadcast("performance.enter")}),l=new ScrollMagic.Scene({triggerElement:"#colors",reverse:!1,triggerHook:.9}).addTo(r).on("enter",function(){n.$broadcast("colors.enter")}),f=[],u,e,i,o,s;for($("#productNav").find("a[href]").each(function(){var n=$(this).attr("href");n&&f.push(n)}),u=0;u<f.length;u++)e=f[u],new ScrollMagic.Scene({triggerElement:e,duration:"100%",triggerHook:.025,offset:n.isXS?-140:-100}).setClassToggle('#productNav a[href="'+e+'"]:not(.notScrolling)',"active").addTo(r);i=165,r.scrollTo(function(r,u){if(n.isXS)i=140;else{var f=document.body.scrollTop,e=$(u).offset().top;i=f>=e?165:100}TweenMax.to(t,.5,{scrollTo:{y:r,offsetY:i,autoKill:!1},ease:Cubic.easeInOut})}),o=document.querySelector("#productNav"),o.addEventListener("click",h),s=document.querySelector("#section-down"),$('#productNav a[href="#"]').click(function(n){n.preventDefault(),t.history&&t.history.pushState&&history.pushState("",document.title,""),TweenMax.to(window,.5,{scrollTo:{y:0,autoKill:!1},ease:Cubic.easeInOut})}),$("#section-down").click(function(n){var i=$(this).attr("href");i&&i.length>0&&(n.preventDefault(),r.scrollTo(i,i),t.history&&window.$window.pushState&&history.pushState("",document.title,i))})},300)}}}]),app=angular.module("mazdaApp"),app.component("safety",{bindings:{modelId:"<"},templateUrl:"/app/product/safety/safety.template.html",controller:["$scope","$element","$timeout","CONST","productService","$rootScope",function(n,t,i,r,u,f){function s(){i(function(){o=new Swiper(angular.element(t).find(" .swiper-container"),{slidesPerView:"auto",a11y:!0,loop:!1,keyboardControl:!0,initialSlide:e.activeIndex,centeredSlides:!0,slideToClickedSlide:!0})},500)}var e=this,o=null;e.activeIndex=0,e.$onInit=function(){u.getSafety(e.modelId).then(function(n){e.items=n,f.isSM&&(e.activeIndex=Math.floor(e.items.length/2),s())},function(n){console.error(n)})}}]}),app=angular.module("mazdaApp"),app.component("technology",{bindings:{modelId:"<"},templateUrl:"/app/product/technology/technology.template.html",controller:["$scope","$element","$timeout","CONST","productService","$rootScope",function(n,t,i,r,u){var f=this;f.activeIndex=0,f.hotspots=[],f.hotSpotArray=[],f.firstEventCycle=!0,f.$onInit=function(){u.getTechnology(f.modelId).then(function(n){var t,i;if(f.items=n.XraySlides,f.items&&f.items.length)for(t=0;t<f.items.length;t++)i=f.items[t],t==0&&i.Hotspots.map(function(n){n.display=!0}),f.hotspots=f.hotspots.concat(i.Hotspots),f.componentDidMount()},function(n){console.error(n)});var n=t.find("#xrayWrap .structure-image");n.on("load",function(){n.css("width",n.width()+"px")});$(window).resize(function(){n.css("width",""),n.css("width",n.width()+"px")})},f.resetAllTabs=function(){for(var n=0;n<document.getElementsByClassName("XrayHotpot hotspot").length;n++)f.hotSpotArray[n]=!1,document.getElementsByClassName("XrayHotpot hotspot")[n].dataset.hotspotIsopen="false"},f.componentDidMount=function(){f.resetAllTabs();$("#xrayWrap").on("keydown"," .hotspot-wrapper",function(n){if(n.keyCode=="13"||n.keyCode=="32"){var t=n.target.id.slice(12),i=n.target.dataset.hotspotIsopen.trim();i=="false"&&f.firstEventCycle?(f.resetAllTabs(),n.target.dataset.hotspotIsopen="true",f.hotSpotArray[t-1]=!0,f.firstEventCycle=!1,setTimeout(function(){f.firstEventCycle=!0;var n=!0;document.getElementById("xrayContentWrap").setAttribute("tabindex","0"),document.getElementById("xrayContentWrap").focus(),console.log("focus-box"),document.getElementById("xrayContentWrap").addEventListener("keydown",function(i){(i.keyCode=="9"||i.keyCode=="16")&&n&&(i.preventDefault(),document.getElementById("xrayhotspot_"+t).focus(),n=!1)})},200)):f.firstEventCycle&&(f.firstEventCycle=!1,setTimeout(function(){f.firstEventCycle=!0,n.target.focus(),n.target.dataset.hotspotIsopen="false",f.hotSpotArray[t-1]=!1,document.getElementById("xrayContentWrap").removeAttribute("tabindex"),console.log("removed-tabindex")},0))}});$("#xrayWrap").on("click","xrayWrap .hotspot",function(n){var t=n.target.id.slice(12),i=n.target.dataset.hotspotIsopen.trim();f.resetAllTabs(),n.target.dataset.hotspotIsopen="true",f.hotSpotArray[t-1]=!0})}}]}),app=angular.module("mazdaApp"),app.directive("xrayDrag",["$rootScope","$window","$timeout",function(n,t,i){return{restrict:"AE",scope:{toHide:"="},link:function(n,t){i(function(){var i=$("#xrayWrap"),f=i.width()/5,h=f*3,e=i.width()/2,r=$(t),u=parseInt(r.attr("data-slider-id")),c=r.closest(".Xrayslide"),o=$("#handle"+(u+1)),s=$("#handle"+(u-1)),l=$("#xrayContentWrap").find("h3"),a=$("#xrayContentWrap").find(".description");n.toHide&&r.hide(),r.draggable({drag:function(n,t){c.css("max-width",t.position.left),i.find(".XrayHotpot_PopUp").hide(),l.html(""),a.html(""),i.find(".XrayHotpot").attr("src","/images/HotSpotClosed.png"),t.position.left<=f?(o.fadeIn(),r.addClass("left-side"),s.fadeOut()):t.position.left<=e?$.each(i.find(".XrayHotpot"),function(){$(this).data("showinslide")==u+1?$(this).fadeIn():$(this).fadeOut()}):t.position.left>=e?(r.removeClass("left-side"),o.fadeOut(),s.fadeIn(),$.each(i.find(".XrayHotpot"),function(){$(this).data("showinslide")==u?$(this).fadeIn():$(this).fadeOut()})):t.position.left>=h&&$.each(i.find(".XrayHotpot"),function(){$(this).data("showinslide")==u?$(this).fadeIn():$(this).fadeOut()})},axis:"x",containment:angular.element("#slide"+(u+1)),opacity:.35})},500)}}}]),app=angular.module("mazdaApp"),app.component("whyMazda",{bindings:{mobileSlider:"="},templateUrl:"/app/shared/whyMazda/whyMazda.template.html",controller:["$scope","$element","$timeout","CONST","$rootScope",function(n,t,i,r,u){var f=this,e=null;f.$onInit=function(){(!u.isXS||f.mobileSlider)&&i(function(){e=new Swiper(angular.element(t).find(" .swiper-container"),{slidesPerView:1,pagination:t.find(".swiper-pagination"),paginationClickable:!0,loop:!0,nextButton:t.find(".swiper-button-next"),prevButton:t.find(".swiper-button-prev"),a11y:!0,keyboardControl:!0})},500)}}]}),app=angular.module("mazdaApp"),app.component("specifications",{bindings:{modelId:"<"},templateUrl:"/app/product/specifications/specifications.template.html",controller:["$scope","$element","$timeout","CONST","productService","$rootScope",function(n,t,i,r,u,f){var e=this;e.level=[],e.showShowMore=!1,e.showAll=!1,e.showMore=function(){e.showAll=!e.showAll,e.level.map(function(n){n.isShowMore=e.showAll})},e.modelName=model.name,e.$onInit=function(){u.getInteriorLevel(e.modelId).then(function(n){e.items=n,e.items.map(function(n){if(e.level.push({isShowMore:!1}),f.isXS){if(n.ModelInteriorLines&&n.ModelInteriorLines.length>3){e.showShowMore=!0;return}}else if(n.ModelInteriorLines&&n.ModelInteriorLines.length>7){e.showShowMore=!0;return}})},function(n){console.error(n)}),u.getCatalog(e.modelId).then(function(n){e.catalog=n},function(n){console.error(n)})}}]}),app=angular.module("mazdaApp"),app.component("nextPrev",{bindings:{modelId:"<"},templateUrl:"/app/product/nextPrev/nextPrev.template.html",controller:["$scope","$element","$timeout","CONST","productService","$rootScope",function(n,t,i,r,u){var f=this;f.$onInit=function(){u.getNextPrev(f.modelId).then(function(n){f.items=n,i(function(){},500)},function(n){console.error(n)})}}]}),app=angular.module("mazdaApp"),app.directive("mobileGallery",["$rootScope","$window","$timeout",function(n,t,i){return{restrict:"AE",link:function(n,t){i(function(){var n=new Swiper(t,{slidesPerView:1,pagination:t.find(".swiper-pagination"),paginationClickable:!0,nextButton:t.find(".swiper-button-next"),prevButton:t.find(".swiper-button-prev"),a11y:!0,keyboardControl:!0,loop:!0,preloadImages:!1,lazyLoading:!0,lazyLoadingInPrevNext:!0})})}}}]),app=angular.module("mazdaApp"),app.component("panorama",{bindings:{panoramaUrl:"<"},templateUrl:"/app/product/panorama/panorama.template.html",controller:["$scope","$element","$timeout","CONST","$rootScope",function(n,t,i,r,u){var f=this;f.$onInit=function(){if(PhotoSphereViewer)var n=new PhotoSphereViewer({container:"panoramaContainer",panorama:f.panoramaUrl,navbar:!1,time_anim:!1,loading_txt:"טוען...",default_long:4.6775111109084317,default_lat:-.22410027595607618,mousewheel:!1,default_fov:u.isXS?90:60,min_fov:u.isXS?89:30})}}]})