if(function(e,t,n){function i(e,t){return typeof e===t}function r(t,n,i){var r;if("getComputedStyle"in e){r=getComputedStyle.call(e,t,n);var o=e.console;if(null!==r)i&&(r=r.getPropertyValue(i));else if(o){o[o.error?"error":"log"].call(o,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else r=!n&&t.currentStyle&&t.currentStyle[i];return r}function o(e,t){return e-1===t||e===t||e+1===t}function a(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):T?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function s(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function l(e,n,i,r){var o,s,l,u,c="modernizr",h=a("div"),d=function(){var e=t.body;return e||((e=a(T?"svg":"body")).fake=!0),e}();if(parseInt(i,10))for(;i--;)(l=a("div")).id=r?r[i]:c+(i+1),h.appendChild(l);return(o=a("style")).type="text/css",o.id="s"+c,(d.fake?d:h).appendChild(o),d.appendChild(h),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(t.createTextNode(e)),h.id=c,d.fake&&(d.style.background="",d.style.overflow="hidden",u=_.style.overflow,_.style.overflow="hidden",_.appendChild(d)),s=n(h,e),d.fake?(d.parentNode.removeChild(d),_.style.overflow=u,_.offsetHeight):h.parentNode.removeChild(h),!!s}function u(e,t){return!!~(""+e).indexOf(t)}function c(e,t){return function(){return e.apply(t,arguments)}}function h(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function d(t,i){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(h(t[o]),i))return!0;return!1}if("CSSSupportsRule"in e){for(var a=[];o--;)a.push("("+h(t[o])+":"+i+")");return l("@supports ("+(a=a.join(" or "))+") { #modernizr { position: absolute; } }",function(e){return"absolute"==r(e,null,"position")})}return n}function f(e,t,r,o){function l(){h&&(delete M.style,delete M.modElem)}if(o=!i(o,"undefined")&&o,!i(r,"undefined")){var c=d(e,r);if(!i(c,"undefined"))return c}for(var h,f,p,m,g,v=["modernizr","tspan","samp"];!M.style&&v.length;)h=!0,M.modElem=a(v.shift()),M.style=M.modElem.style;for(p=e.length,f=0;p>f;f++)if(m=e[f],g=M.style[m],u(m,"-")&&(m=s(m)),M.style[m]!==n){if(o||i(r,"undefined"))return l(),"pfx"!=t||m;try{M.style[m]=r}catch(e){}if(M.style[m]!=g)return l(),"pfx"!=t||m}return l(),!1}function p(e,t,n,r,o){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+x.join(a+" ")+a).split(" ");return i(t,"string")||i(t,"undefined")?f(s,t,r,o):function(e,t,n){var r;for(var o in e)if(e[o]in t)return!1===n?e[o]:i(r=t[e[o]],"function")?c(r,n||t):r;return!1}(s=(e+" "+H.join(a+" ")+a).split(" "),t,n)}function m(e,t,i){return p(e,n,n,t,i)}var g=[],v=[],E={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){v.push({name:e,fn:t,options:n})},addAsyncTest:function(e){v.push({name:null,fn:e})}},y=function(){};y.prototype=E,(y=new y).addTest("svg",!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect);var _=t.documentElement;y.addTest("cssall","all"in _.style);var T="svg"===_.nodeName.toLowerCase();y.addTest("inlinesvg",function(){var e=a("div");return e.innerHTML="<svg/>","http://www.w3.org/2000/svg"==("undefined"!=typeof SVGRect&&e.firstChild&&e.firstChild.namespaceURI)}),y.addTest("cssremunit",function(){var e=a("a").style;try{e.fontSize="3rem"}catch(e){}return/rem/.test(e.fontSize)});var b=E.testStyles=l;b("#modernizr { height: 50vh; }",function(t){var n=parseInt(e.innerHeight/2,10),i=parseInt(r(t,null,"height"),10);y.addTest("cssvhunit",o(i,n))}),b("#modernizr1{width: 50vmax}#modernizr2{width:50px;height:50px;overflow:scroll}#modernizr3{position:fixed;top:0;left:0;bottom:0;right:0}",function(e){var t=e.childNodes[2],n=e.childNodes[1],i=e.childNodes[0],a=parseInt((n.offsetWidth-n.clientWidth)/2,10),s=i.clientWidth/100,l=i.clientHeight/100,u=parseInt(50*Math.max(s,l),10),c=parseInt(r(t,null,"width"),10);y.addTest("cssvmaxunit",o(u,c)||o(u,c-a))},3),b("#modernizr1{width: 50vm;width:50vmin}#modernizr2{width:50px;height:50px;overflow:scroll}#modernizr3{position:fixed;top:0;left:0;bottom:0;right:0}",function(e){var t=e.childNodes[2],n=e.childNodes[1],i=e.childNodes[0],a=parseInt((n.offsetWidth-n.clientWidth)/2,10),s=i.clientWidth/100,l=i.clientHeight/100,u=parseInt(50*Math.min(s,l),10),c=parseInt(r(t,null,"width"),10);y.addTest("cssvminunit",o(u,c)||o(u,c-a))},3),b("#modernizr { width: 50vw; }",function(t){var n=parseInt(e.innerWidth/2,10),i=parseInt(r(t,null,"width"),10);y.addTest("cssvwunit",o(i,n))});var w="Moz O ms Webkit",x=E._config.usePrefixes?w.split(" "):[];E._cssomPrefixes=x;var R=function(t){var i,r=prefixes.length,o=e.CSSRule;if(void 0===o)return n;if(!t)return!1;if((i=(t=t.replace(/^@/,"")).replace(/-/g,"_").toUpperCase()+"_RULE")in o)return"@"+t;for(var a=0;r>a;a++){var s=prefixes[a];if(s.toUpperCase()+"_"+i in o)return"@-"+s.toLowerCase()+"-"+t}return!1};E.atRule=R;var H=E._config.usePrefixes?w.toLowerCase().split(" "):[];E._domPrefixes=H;var S={elem:a("modernizr")};y._q.push(function(){delete S.elem});var M={style:S.elem.style};y._q.unshift(function(){delete M.style}),E.testAllProps=p,E.testAllProps=m,y.addTest("cssgridlegacy",m("grid-columns","10px",!0)),y.addTest("cssgrid",m("grid-template-rows","none",!0)),y.addTest("flexbox",m("flexBasis","1px",!0));var C=E.prefixed=function(e,t,n){return 0===e.indexOf("@")?R(e):(-1!=e.indexOf("-")&&(e=s(e)),t?p(e,t,n):p(e,"pfx"))};y.addTest("objectfit",!!C("objectFit"),{aliases:["object-fit"]}),function(){var e,t,n,r,o,a;for(var s in v)if(v.hasOwnProperty(s)){if(e=[],(t=v[s]).name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(r=i(t.fn,"function")?t.fn():t.fn,o=0;o<e.length;o++)1===(a=e[o].split(".")).length?y[a[0]]=r:(!y[a[0]]||y[a[0]]instanceof Boolean||(y[a[0]]=new Boolean(y[a[0]])),y[a[0]][a[1]]=r),g.push((r?"":"no-")+a.join("-"))}}(),function(e){var t=_.className,n=y._config.classPrefix||"";if(T&&(t=t.baseVal),y._config.enableJSClass){var i=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(i,"$1"+n+"js$2")}y._config.enableClasses&&(t+=" "+n+e.join(" "+n),T?_.className.baseVal=t:_.className=t)}(g),delete E.addTest,delete E.addAsyncTest;for(var A=0;A<y._q.length;A++)y._q[A]();e.Modernizr=y}(window,document),function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],i=Object.getPrototypeOf,r=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,l={},u=l.toString,c=l.hasOwnProperty,h=c.toString,d=h.call(Object),f={},p=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},m=function(e){return null!=e&&e===e.window},g=e.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function E(e,t,n){var i,r,o=(n=n||g).createElement("script");if(o.text=e,t)for(i in v)(r=t[i]||t.getAttribute&&t.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function y(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[u.call(e)]||"object":typeof e}var _="3.5.1",T=function(e,t){return new T.fn.init(e,t)};function b(e){var t=!!e&&"length"in e&&e.length,n=y(e);return!p(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}T.fn=T.prototype={jquery:_,constructor:T,length:0,toArray:function(){return r.call(this)},get:function(e){return null==e?r.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return T.each(this,e)},map:function(e){return this.pushStack(T.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(T.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(T.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:a,sort:n.sort,splice:n.splice},T.extend=T.fn.extend=function(){var e,t,n,i,r,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||p(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)i=e[t],"__proto__"!==t&&a!==i&&(u&&i&&(T.isPlainObject(i)||(r=Array.isArray(i)))?(n=a[t],o=r&&!Array.isArray(n)?[]:r||T.isPlainObject(n)?n:{},r=!1,a[t]=T.extend(u,o,i)):void 0!==i&&(a[t]=i));return a},T.extend({expando:"jQuery"+(_+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==u.call(e)||(t=i(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||h.call(n)!==d))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){E(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,i=0;if(b(e))for(n=e.length;i<n&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(b(Object(e))?T.merge(n,"string"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:s.call(t,e,n)},merge:function(e,t){for(var n=+t.length,i=0,r=e.length;i<n;i++)e[r++]=t[i];return e.length=r,e},grep:function(e,t,n){for(var i=[],r=0,o=e.length,a=!n;r<o;r++)!t(e[r],r)!==a&&i.push(e[r]);return i},map:function(e,t,n){var i,r,a=0,s=[];if(b(e))for(i=e.length;a<i;a++)null!=(r=t(e[a],a,n))&&s.push(r);else for(a in e)null!=(r=t(e[a],a,n))&&s.push(r);return o(s)},guid:1,support:f}),"function"==typeof Symbol&&(T.fn[Symbol.iterator]=n[Symbol.iterator]),T.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});var w=function(e){var t,n,i,r,o,a,s,l,u,c,h,d,f,p,m,g,v,E,y,_="sizzle"+1*new Date,T=e.document,b=0,w=0,x=le(),R=le(),H=le(),S=le(),M=function(e,t){return e===t&&(h=!0),0},C={}.hasOwnProperty,A=[],k=A.pop,P=A.push,D=A.push,L=A.slice,O=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",N="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",B="\\["+N+"*("+I+")(?:"+N+"*([*^$|!~]?=)"+N+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+N+"*\\]",z=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+B+")*)|.*)\\)|)",V=new RegExp(N+"+","g"),U=new RegExp("^"+N+"+|((?:^|[^\\\\])(?:\\\\.)*)"+N+"+$","g"),j=new RegExp("^"+N+"*,"+N+"*"),W=new RegExp("^"+N+"*([>+~]|"+N+")"+N+"*"),G=new RegExp(N+"|>"),Y=new RegExp(z),q=new RegExp("^"+I+"$"),X={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},$=/HTML$/i,Z=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},ie=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},ae=_e(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{D.apply(A=L.call(T.childNodes),T.childNodes),A[T.childNodes.length].nodeType}catch(t){D={apply:A.length?function(e,t){P.apply(e,L.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function se(e,t,i,r){var o,s,u,c,h,p,v,E=t&&t.ownerDocument,T=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return i;if(!r&&(d(t),t=t||f,m)){if(11!==T&&(h=J.exec(e)))if(o=h[1]){if(9===T){if(!(u=t.getElementById(o)))return i;if(u.id===o)return i.push(u),i}else if(E&&(u=E.getElementById(o))&&y(t,u)&&u.id===o)return i.push(u),i}else{if(h[2])return D.apply(i,t.getElementsByTagName(e)),i;if((o=h[3])&&n.getElementsByClassName&&t.getElementsByClassName)return D.apply(i,t.getElementsByClassName(o)),i}if(n.qsa&&!S[e+" "]&&(!g||!g.test(e))&&(1!==T||"object"!==t.nodeName.toLowerCase())){if(v=e,E=t,1===T&&(G.test(e)||W.test(e))){for((E=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(ie,re):t.setAttribute("id",c=_)),s=(p=a(e)).length;s--;)p[s]=(c?"#"+c:":scope")+" "+ye(p[s]);v=p.join(",")}try{return D.apply(i,E.querySelectorAll(v)),i}catch(t){S(e,!0)}finally{c===_&&t.removeAttribute("id")}}}return l(e.replace(U,"$1"),t,i,r)}function le(){var e=[];return function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function ue(e){return e[_]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function he(e,t){for(var n=e.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=t}function de(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ue(function(t){return t=+t,ue(function(n,i){for(var r,o=e([],n.length,t),a=o.length;a--;)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))})})}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!$.test(t||n&&n.nodeName||"HTML")},d=se.setDocument=function(e){var t,r,a=e?e.ownerDocument||e:T;return a!=f&&9===a.nodeType&&a.documentElement&&(p=(f=a).documentElement,m=!o(f),T!=f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",oe,!1):r.attachEvent&&r.attachEvent("onunload",oe)),n.scope=ce(function(e){return p.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(f.getElementsByClassName),n.getById=ce(function(e){return p.appendChild(e).id=_,!f.getElementsByName||!f.getElementsByName(_).length}),n.getById?(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=Q.test(f.querySelectorAll))&&(ce(function(e){var t;p.appendChild(e).innerHTML="<a id='"+_+"'></a><select id='"+_+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+N+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+N+"*(?:value|"+F+")"),e.querySelectorAll("[id~="+_+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+N+"*name"+N+"*="+N+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+N+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=Q.test(E=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=E.call(e,"*"),E.call(e,"[s!='']:x"),v.push("!=",z)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(p.compareDocumentPosition),y=t||Q.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},M=t?function(e,t){if(e===t)return h=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e==f||e.ownerDocument==T&&y(T,e)?-1:t==f||t.ownerDocument==T&&y(T,t)?1:c?O(c,e)-O(c,t):0:4&i?-1:1)}:function(e,t){if(e===t)return h=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!r||!o)return e==f?-1:t==f?1:r?-1:o?1:c?O(c,e)-O(c,t):0;if(r===o)return de(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[i]===s[i];)i++;return i?de(a[i],s[i]):a[i]==T?-1:s[i]==T?1:0}),f},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!S[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var i=E.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){S(t,!0)}return 0<se(t,f,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=f&&d(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=f&&d(e);var r=i.attrHandle[t.toLowerCase()],o=r&&C.call(i.attrHandle,t.toLowerCase())?r(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(ie,re)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,i=[],r=0,o=0;if(h=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(M),h){for(;t=e[o++];)t===e[o]&&(r=i.push(o));for(;r--;)e.splice(i[r],1)}return c=null,e},r=se.getText=function(e){var t,n="",i=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[i++];)n+=r(t);return n},(i=se.selectors={cacheLength:50,createPseudo:ue,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Y.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+N+")"+e+"("+N+"|$)"))&&x(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(i){var r=se.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&-1<r.indexOf(n):"$="===t?n&&r.slice(-n.length)===n:"~="===t?-1<(" "+r.replace(V," ")+" ").indexOf(n):"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var u,c,h,d,f,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),E=!l&&!s,y=!1;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&E){for(y=(f=(u=(c=(h=(d=g)[_]||(d[_]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]||[])[0]===b&&u[1])&&u[2],d=f&&g.childNodes[f];d=++f&&d&&d[m]||(y=f=0)||p.pop();)if(1===d.nodeType&&++y&&d===t){c[e]=[b,f,y];break}}else if(E&&(y=f=(u=(c=(h=(d=t)[_]||(d[_]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]||[])[0]===b&&u[1]),!1===y)for(;(d=++f&&d&&d[m]||(y=f=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++y||(E&&((c=(h=d[_]||(d[_]={}))[d.uniqueID]||(h[d.uniqueID]={}))[e]=[b,y]),d!==t)););return(y-=r)===i||y%i==0&&0<=y/i}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return r[_]?r(t):1<r.length?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ue(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)e[i=O(e,o[a])]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ue(function(e){var t=[],n=[],i=s(e.replace(U,"$1"));return i[_]?ue(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:ue(function(e){return function(t){return 0<se(e,t).length}}),contains:ue(function(e){return e=e.replace(te,ne),function(t){return-1<(t.textContent||r(t)).indexOf(e)}}),lang:ue(function(e){return q.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return Z.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge(function(){return[0]}),last:ge(function(e,t){return[t-1]}),eq:ge(function(e,t,n){return[n<0?n+t:n]}),even:ge(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ge(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ge(function(e,t,n){for(var i=n<0?n+t:t<n?t:n;0<=--i;)e.push(i);return e}),gt:ge(function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i);return e})}}).pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=pe(t);function Ee(){}function ye(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function _e(e,t,n){var i=t.dir,r=t.next,o=r||i,a=n&&"parentNode"===o,s=w++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||a)return e(t,n,r);return!1}:function(t,n,l){var u,c,h,d=[b,s];if(l){for(;t=t[i];)if((1===t.nodeType||a)&&e(t,n,l))return!0}else for(;t=t[i];)if(1===t.nodeType||a)if(c=(h=t[_]||(t[_]={}))[t.uniqueID]||(h[t.uniqueID]={}),r&&r===t.nodeName.toLowerCase())t=t[i]||t;else{if((u=c[o])&&u[0]===b&&u[1]===s)return d[2]=u[2];if((c[o]=d)[2]=e(t,n,l))return!0}return!1}}function Te(e){return 1<e.length?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function be(e,t,n,i,r){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(n&&!n(o,i,r)||(a.push(o),u&&t.push(s)));return a}function we(e,t,n,i,r,o){return i&&!i[_]&&(i=we(i)),r&&!r[_]&&(r=we(r,o)),ue(function(o,a,s,l){var u,c,h,d=[],f=[],p=a.length,m=o||function(e,t,n){for(var i=0,r=t.length;i<r;i++)se(e,t[i],n);return n}(t||"*",s.nodeType?[s]:s,[]),g=!e||!o&&t?m:be(m,d,e,s,l),v=n?r||(o?e:p||i)?[]:a:g;if(n&&n(g,v,s,l),i)for(u=be(v,f),i(u,[],s,l),c=u.length;c--;)(h=u[c])&&(v[f[c]]=!(g[f[c]]=h));if(o){if(r||e){if(r){for(u=[],c=v.length;c--;)(h=v[c])&&u.push(g[c]=h);r(null,v=[],u,l)}for(c=v.length;c--;)(h=v[c])&&-1<(u=r?O(o,h):d[c])&&(o[u]=!(a[u]=h))}}else v=be(v===a?v.splice(p,v.length):v),r?r(null,a,v,l):D.apply(a,v)})}function xe(e){for(var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],l=a?1:0,c=_e(function(e){return e===t},s,!0),h=_e(function(e){return-1<O(t,e)},s,!0),d=[function(e,n,i){var r=!a&&(i||n!==u)||((t=n).nodeType?c(e,n,i):h(e,n,i));return t=null,r}];l<o;l++)if(n=i.relative[e[l].type])d=[_e(Te(d),n)];else{if((n=i.filter[e[l].type].apply(null,e[l].matches))[_]){for(r=++l;r<o&&!i.relative[e[r].type];r++);return we(1<l&&Te(d),1<l&&ye(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(U,"$1"),n,l<r&&xe(e.slice(l,r)),r<o&&xe(e=e.slice(r)),r<o&&ye(e))}d.push(n)}return Te(d)}return Ee.prototype=i.filters=i.pseudos,i.setFilters=new Ee,a=se.tokenize=function(e,t){var n,r,o,a,s,l,u,c=R[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=i.preFilter;s;){for(a in n&&!(r=j.exec(s))||(r&&(s=s.slice(r[0].length)||s),l.push(o=[])),n=!1,(r=W.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(U," ")}),s=s.slice(n.length)),i.filter)!(r=X[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):R(e,l).slice(0)},s=se.compile=function(e,t){var n,r,o,s,l,c,h=[],p=[],g=H[e+" "];if(!g){for(t||(t=a(e)),n=t.length;n--;)(g=xe(t[n]))[_]?h.push(g):p.push(g);(g=H(e,(r=p,s=0<(o=h).length,l=0<r.length,c=function(e,t,n,a,c){var h,p,g,v=0,E="0",y=e&&[],_=[],T=u,w=e||l&&i.find.TAG("*",c),x=b+=null==T?1:Math.random()||.1,R=w.length;for(c&&(u=t==f||t||c);E!==R&&null!=(h=w[E]);E++){if(l&&h){for(p=0,t||h.ownerDocument==f||(d(h),n=!m);g=r[p++];)if(g(h,t||f,n)){a.push(h);break}c&&(b=x)}s&&((h=!g&&h)&&v--,e&&y.push(h))}if(v+=E,s&&E!==v){for(p=0;g=o[p++];)g(y,_,t,n);if(e){if(0<v)for(;E--;)y[E]||_[E]||(_[E]=k.call(a));_=be(_)}D.apply(a,_),c&&!e&&0<_.length&&1<v+o.length&&se.uniqueSort(a)}return c&&(b=x,u=T),y},s?ue(c):c))).selector=e}return g},l=se.select=function(e,t,n,r){var o,l,u,c,h,d="function"==typeof e&&e,f=!r&&a(e=d.selector||e);if(n=n||[],1===f.length){if(2<(l=f[0]=f[0].slice(0)).length&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&i.relative[l[1].type]){if(!(t=(i.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=X.needsContext.test(e)?0:l.length;o--&&(u=l[o],!i.relative[c=u.type]);)if((h=i.find[c])&&(r=h(u.matches[0].replace(te,ne),ee.test(l[0].type)&&ve(t.parentNode)||t))){if(l.splice(o,1),!(e=r.length&&ye(l)))return D.apply(n,r),n;break}}return(d||s(e,f))(r,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=_.split("").sort(M).join("")===_,n.detectDuplicates=!!h,d(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||he("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||he("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||he(F,function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),se}(e);T.find=w,T.expr=w.selectors,T.expr[":"]=T.expr.pseudos,T.uniqueSort=T.unique=w.uniqueSort,T.text=w.getText,T.isXMLDoc=w.isXML,T.contains=w.contains,T.escapeSelector=w.escape;var x=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&T(e).is(n))break;i.push(e)}return i},R=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},H=T.expr.match.needsContext;function S(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var M=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function C(e,t,n){return p(t)?T.grep(e,function(e,i){return!!t.call(e,i,e)!==n}):t.nodeType?T.grep(e,function(e){return e===t!==n}):"string"!=typeof t?T.grep(e,function(e){return-1<s.call(t,e)!==n}):T.filter(t,e,n)}T.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?T.find.matchesSelector(i,e)?[i]:[]:T.find.matches(e,T.grep(t,function(e){return 1===e.nodeType}))},T.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!=typeof e)return this.pushStack(T(e).filter(function(){for(t=0;t<i;t++)if(T.contains(r[t],this))return!0}));for(n=this.pushStack([]),t=0;t<i;t++)T.find(e,r[t],n);return 1<i?T.uniqueSort(n):n},filter:function(e){return this.pushStack(C(this,e||[],!1))},not:function(e){return this.pushStack(C(this,e||[],!0))},is:function(e){return!!C(this,"string"==typeof e&&H.test(e)?T(e):e||[],!1).length}});var A,k=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||A,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:k.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof T?t[0]:t,T.merge(this,T.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),M.test(i[1])&&T.isPlainObject(t))for(i in t)p(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=g.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):p(e)?void 0!==n.ready?n.ready(e):e(T):T.makeArray(e,this)}).prototype=T.fn,A=T(g);var P=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};function L(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(T.contains(this,t[e]))return!0})},closest:function(e,t){var n,i=0,r=this.length,o=[],a="string"!=typeof e&&T(e);if(!H.test(e))for(;i<r;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&T.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?T.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?s.call(T(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),T.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x(e,"parentNode")},parentsUntil:function(e,t,n){return x(e,"parentNode",n)},next:function(e){return L(e,"nextSibling")},prev:function(e){return L(e,"previousSibling")},nextAll:function(e){return x(e,"nextSibling")},prevAll:function(e){return x(e,"previousSibling")},nextUntil:function(e,t,n){return x(e,"nextSibling",n)},prevUntil:function(e,t,n){return x(e,"previousSibling",n)},siblings:function(e){return R((e.parentNode||{}).firstChild,e)},children:function(e){return R(e.firstChild)},contents:function(e){return null!=e.contentDocument&&i(e.contentDocument)?e.contentDocument:(S(e,"template")&&(e=e.content||e),T.merge([],e.childNodes))}},function(e,t){T.fn[e]=function(n,i){var r=T.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=T.filter(i,r)),1<this.length&&(D[e]||T.uniqueSort(r),P.test(e)&&r.reverse()),this.pushStack(r)}});var O=/[^\x20\t\r\n\f]+/g;function F(e){return e}function N(e){throw e}function I(e,t,n,i){var r;try{e&&p(r=e.promise)?r.call(e).done(t).fail(n):e&&p(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(i))}catch(e){n.apply(void 0,[e])}}T.Callbacks=function(e){var t,n;e="string"==typeof e?(t=e,n={},T.each(t.match(O)||[],function(e,t){n[t]=!0}),n):T.extend({},e);var i,r,o,a,s=[],l=[],u=-1,c=function(){for(a=a||e.once,o=i=!0;l.length;u=-1)for(r=l.shift();++u<s.length;)!1===s[u].apply(r[0],r[1])&&e.stopOnFalse&&(u=s.length,r=!1);e.memory||(r=!1),i=!1,a&&(s=r?[]:"")},h={add:function(){return s&&(r&&!i&&(u=s.length-1,l.push(r)),function t(n){T.each(n,function(n,i){p(i)?e.unique&&h.has(i)||s.push(i):i&&i.length&&"string"!==y(i)&&t(i)})}(arguments),r&&!i&&c()),this},remove:function(){return T.each(arguments,function(e,t){for(var n;-1<(n=T.inArray(t,s,n));)s.splice(n,1),n<=u&&u--}),this},has:function(e){return e?-1<T.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=l=[],s=r="",this},disabled:function(){return!s},lock:function(){return a=l=[],r||i||(s=r=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],l.push(t),i||c()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!o}};return h},T.extend({Deferred:function(t){var n=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return T.Deferred(function(t){T.each(n,function(n,i){var r=p(e[i[4]])&&e[i[4]];o[i[1]](function(){var e=r&&r.apply(this,arguments);e&&p(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[i[0]+"With"](this,r?[e]:arguments)})}),e=null}).promise()},then:function(t,i,r){var o=0;function a(t,n,i,r){return function(){var s=this,l=arguments,u=function(){var e,u;if(!(t<o)){if((e=i.apply(s,l))===n.promise())throw new TypeError("Thenable self-resolution");u=e&&("object"==typeof e||"function"==typeof e)&&e.then,p(u)?r?u.call(e,a(o,n,F,r),a(o,n,N,r)):(o++,u.call(e,a(o,n,F,r),a(o,n,N,r),a(o,n,F,n.notifyWith))):(i!==F&&(s=void 0,l=[e]),(r||n.resolveWith)(s,l))}},c=r?u:function(){try{u()}catch(e){T.Deferred.exceptionHook&&T.Deferred.exceptionHook(e,c.stackTrace),o<=t+1&&(i!==N&&(s=void 0,l=[e]),n.rejectWith(s,l))}};t?c():(T.Deferred.getStackHook&&(c.stackTrace=T.Deferred.getStackHook()),e.setTimeout(c))}}return T.Deferred(function(e){n[0][3].add(a(0,e,p(r)?r:F,e.notifyWith)),n[1][3].add(a(0,e,p(t)?t:F)),n[2][3].add(a(0,e,p(i)?i:N))}).promise()},promise:function(e){return null!=e?T.extend(e,r):r}},o={};return T.each(n,function(e,t){var a=t[2],s=t[5];r[t[1]]=a.add,s&&a.add(function(){i=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),r.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,i=Array(n),o=r.call(arguments),a=T.Deferred(),s=function(e){return function(n){i[e]=this,o[e]=1<arguments.length?r.call(arguments):n,--t||a.resolveWith(i,o)}};if(t<=1&&(I(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||p(o[n]&&o[n].then)))return a.then();for(;n--;)I(o[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},T.readyException=function(t){e.setTimeout(function(){throw t})};var z=T.Deferred();function V(){g.removeEventListener("DOMContentLoaded",V),e.removeEventListener("load",V),T.ready()}T.fn.ready=function(e){return z.then(e).catch(function(e){T.readyException(e)}),this},T.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--T.readyWait:T.isReady)||(T.isReady=!0)!==e&&0<--T.readyWait||z.resolveWith(g,[T])}}),T.ready.then=z.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(T.ready):(g.addEventListener("DOMContentLoaded",V),e.addEventListener("load",V));var U=function(e,t,n,i,r,o,a){var s=0,l=e.length,u=null==n;if("object"===y(n))for(s in r=!0,n)U(e,t,s,n[s],!0,o,a);else if(void 0!==i&&(r=!0,p(i)||(a=!0),u&&(a?(t.call(e,i),t=null):(u=t,t=function(e,t,n){return u.call(T(e),n)})),t))for(;s<l;s++)t(e[s],n,a?i:i.call(e[s],s,t(e[s],n)));return r?e:u?t.call(e):l?t(e[0],n):o},j=/^-ms-/,W=/-([a-z])/g;function G(e,t){return t.toUpperCase()}function Y(e){return e.replace(j,"ms-").replace(W,G)}var q=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function X(){this.expando=T.expando+X.uid++}X.uid=1,X.prototype={cache:function(e){var t=e[this.expando];return t||(t={},q(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var i,r=this.cache(e);if("string"==typeof t)r[Y(t)]=n;else for(i in t)r[Y(i)]=t[i];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][Y(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,i=e[this.expando];if(void 0!==i){if(void 0!==t){n=(t=Array.isArray(t)?t.map(Y):(t=Y(t))in i?[t]:t.match(O)||[]).length;for(;n--;)delete i[t[n]]}(void 0===t||T.isEmptyObject(i))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!T.isEmptyObject(t)}};var $=new X,Z=new X,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function J(e,t,n){var i,r;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(Q,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(i))){try{n="true"===(r=n)||"false"!==r&&("null"===r?null:r===+r+""?+r:K.test(r)?JSON.parse(r):r)}catch(e){}Z.set(e,t,n)}else n=void 0;return n}T.extend({hasData:function(e){return Z.hasData(e)||$.hasData(e)},data:function(e,t,n){return Z.access(e,t,n)},removeData:function(e,t){Z.remove(e,t)},_data:function(e,t,n){return $.access(e,t,n)},_removeData:function(e,t){$.remove(e,t)}}),T.fn.extend({data:function(e,t){var n,i,r,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(r=Z.get(o),1===o.nodeType&&!$.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(i=a[n].name).indexOf("data-")&&(i=Y(i.slice(5)),J(o,i,r[i]));$.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each(function(){Z.set(this,e)}):U(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=Z.get(o,e))?n:void 0!==(n=J(o,e))?n:void 0;this.each(function(){Z.set(this,e,t)})},null,t,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Z.remove(this,e)})}}),T.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=$.get(e,t),n&&(!i||Array.isArray(n)?i=$.access(e,t,T.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=T.queue(e,t),i=n.length,r=n.shift(),o=T._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,function(){T.dequeue(e,t)},o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return $.get(e,n)||$.access(e,n,{empty:T.Callbacks("once memory").add(function(){$.remove(e,[t+"queue",n])})})}}),T.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?T.queue(this[0],e):void 0===t?this:this.each(function(){var n=T.queue(this,e,t);T._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&T.dequeue(this,e)})},dequeue:function(e){return this.each(function(){T.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,r=T.Deferred(),o=this,a=this.length,s=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=$.get(o[a],e+"queueHooks"))&&n.empty&&(i++,n.empty.add(s));return s(),r.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],ie=g.documentElement,re=function(e){return T.contains(e.ownerDocument,e)},oe={composed:!0};ie.getRootNode&&(re=function(e){return T.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&re(e)&&"none"===T.css(e,"display")};function se(e,t,n,i){var r,o,a=20,s=i?function(){return i.cur()}:function(){return T.css(e,t,"")},l=s(),u=n&&n[3]||(T.cssNumber[t]?"":"px"),c=e.nodeType&&(T.cssNumber[t]||"px"!==u&&+l)&&te.exec(T.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)T.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,T.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=u,i.start=c,i.end=r)),r}var le={};function ue(e,t){for(var n,i,r,o,a,s,l,u=[],c=0,h=e.length;c<h;c++)(i=e[c]).style&&(n=i.style.display,t?("none"===n&&(u[c]=$.get(i,"display")||null,u[c]||(i.style.display="")),""===i.style.display&&ae(i)&&(u[c]=(l=a=o=void 0,a=(r=i).ownerDocument,s=r.nodeName,(l=le[s])||(o=a.body.appendChild(a.createElement(s)),l=T.css(o,"display"),o.parentNode.removeChild(o),"none"===l&&(l="block"),le[s]=l)))):"none"!==n&&(u[c]="none",$.set(i,"display",n)));for(c=0;c<h;c++)null!=u[c]&&(e[c].style.display=u[c]);return e}T.fn.extend({show:function(){return ue(this,!0)},hide:function(){return ue(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?T(this).show():T(this).hide()})}});var ce,he,de=/^(?:checkbox|radio)$/i,fe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,pe=/^$|^module$|\/(?:java|ecma)script/i;ce=g.createDocumentFragment().appendChild(g.createElement("div")),(he=g.createElement("input")).setAttribute("type","radio"),he.setAttribute("checked","checked"),he.setAttribute("name","t"),ce.appendChild(he),f.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",f.option=!!ce.lastChild;var me={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ge(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&S(e,t)?T.merge([e],n):n}function ve(e,t){for(var n=0,i=e.length;n<i;n++)$.set(e[n],"globalEval",!t||$.get(t[n],"globalEval"))}me.tbody=me.tfoot=me.colgroup=me.caption=me.thead,me.th=me.td,f.option||(me.optgroup=me.option=[1,"<select multiple='multiple'>","</select>"]);var Ee=/<|&#?\w+;/;function ye(e,t,n,i,r){for(var o,a,s,l,u,c,h=t.createDocumentFragment(),d=[],f=0,p=e.length;f<p;f++)if((o=e[f])||0===o)if("object"===y(o))T.merge(d,o.nodeType?[o]:o);else if(Ee.test(o)){for(a=a||h.appendChild(t.createElement("div")),s=(fe.exec(o)||["",""])[1].toLowerCase(),l=me[s]||me._default,a.innerHTML=l[1]+T.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;T.merge(d,a.childNodes),(a=h.firstChild).textContent=""}else d.push(t.createTextNode(o));for(h.textContent="",f=0;o=d[f++];)if(i&&-1<T.inArray(o,i))r&&r.push(o);else if(u=re(o),a=ge(h.appendChild(o),"script"),u&&ve(a),n)for(c=0;o=a[c++];)pe.test(o.type||"")&&n.push(o);return h}var _e=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function xe(){return!1}function Re(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function He(e,t,n,i,r,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(i=i||n,n=void 0),t)He(e,s,n,i,t[s],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=xe;else if(!r)return e;return 1===o&&(a=r,(r=function(e){return T().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=T.guid++)),e.each(function(){T.event.add(this,t,r,i,n)})}function Se(e,t,n){n?($.set(e,t,!1),T.event.add(e,t,{namespace:!1,handler:function(e){var i,o,a=$.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(T.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=r.call(arguments),$.set(this,t,a),i=n(this,t),this[t](),a!==(o=$.get(this,t))||i?$.set(this,t,!1):o={},a!==o)return e.stopImmediatePropagation(),e.preventDefault(),o.value}else a.length&&($.set(this,t,{value:T.event.trigger(T.extend(a[0],T.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===$.get(e,t)&&T.event.add(e,t,we)}T.event={global:{},add:function(e,t,n,i,r){var o,a,s,l,u,c,h,d,f,p,m,g=$.get(e);if(q(e))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&T.find.matchesSelector(ie,r),n.guid||(n.guid=T.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==T&&T.event.triggered!==t.type?T.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(O)||[""]).length;u--;)f=m=(s=be.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),f&&(h=T.event.special[f]||{},f=(r?h.delegateType:h.bindType)||f,h=T.event.special[f]||{},c=T.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&T.expr.match.needsContext.test(r),namespace:p.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,i,p,a)||e.addEventListener&&e.addEventListener(f,a)),h.add&&(h.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),T.event.global[f]=!0)},remove:function(e,t,n,i,r){var o,a,s,l,u,c,h,d,f,p,m,g=$.hasData(e)&&$.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(O)||[""]).length;u--;)if(f=m=(s=be.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),f){for(h=T.event.special[f]||{},d=l[f=(i?h.delegateType:h.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!r&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(e,c));a&&!d.length&&(h.teardown&&!1!==h.teardown.call(e,p,g.handle)||T.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)T.event.remove(e,f+t[u],n,i,!0);T.isEmptyObject(l)&&$.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,a,s=new Array(arguments.length),l=T.event.fix(e),u=($.get(this,"events")||Object.create(null))[l.type]||[],c=T.event.special[l.type]||{};for(s[0]=l,t=1;t<arguments.length;t++)s[t]=arguments[t];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(a=T.event.handlers.call(this,l,u),t=0;(r=a[t++])&&!l.isPropagationStopped();)for(l.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(i=((T.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,s))&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,i,r,o,a,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&1<=e.button))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n<l;n++)void 0===a[r=(i=t[n]).selector+" "]&&(a[r]=i.needsContext?-1<T(r,this).index(u):T.find(r,this,null,[u]).length),a[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return u=this,l<t.length&&s.push({elem:u,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(T.Event.prototype,e,{enumerable:!0,configurable:!0,get:p(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[T.expando]?e:new T.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return de.test(t.type)&&t.click&&S(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return de.test(t.type)&&t.click&&S(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return de.test(t.type)&&t.click&&S(t,"input")&&$.get(t,"click")||S(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},T.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},T.Event=function(e,t){if(!(this instanceof T.Event))return new T.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:xe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&T.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[T.expando]=!0},T.Event.prototype={constructor:T.Event,isDefaultPrevented:xe,isPropagationStopped:xe,isImmediatePropagationStopped:xe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},T.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&_e.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},T.event.addProp),T.each({focus:"focusin",blur:"focusout"},function(e,t){T.event.special[e]={setup:function(){return Se(this,e,Re),!1},trigger:function(){return Se(this,e),!0},delegateType:t}}),T.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){T.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=e.relatedTarget,r=e.handleObj;return i&&(i===this||T.contains(this,i))||(e.type=r.origType,n=r.handler.apply(this,arguments),e.type=t),n}}}),T.fn.extend({on:function(e,t,n,i){return He(this,e,t,n,i)},one:function(e,t,n,i){return He(this,e,t,n,i,1)},off:function(e,t,n){var i,r;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,T(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=xe),this.each(function(){T.event.remove(this,e,n,t)})}});var Me=/<script|<style|<link/i,Ce=/checked\s*(?:[^=]|=\s*.checked.)/i,Ae=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function ke(e,t){return S(e,"table")&&S(11!==t.nodeType?t:t.firstChild,"tr")&&T(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function De(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,i,r,o,a,s;if(1===t.nodeType){if($.hasData(e)&&(s=$.get(e).events))for(r in $.remove(t,"handle events"),s)for(n=0,i=s[r].length;n<i;n++)T.event.add(t,r,s[r][n]);Z.hasData(e)&&(o=Z.access(e),a=T.extend({},o),Z.set(t,a))}}function Oe(e,t,n,i){t=o(t);var r,a,s,l,u,c,h=0,d=e.length,m=d-1,g=t[0],v=p(g);if(v||1<d&&"string"==typeof g&&!f.checkClone&&Ce.test(g))return e.each(function(r){var o=e.eq(r);v&&(t[0]=g.call(this,r,o.html())),Oe(o,t,n,i)});if(d&&(a=(r=ye(t,e[0].ownerDocument,!1,e,i)).firstChild,1===r.childNodes.length&&(r=a),a||i)){for(l=(s=T.map(ge(r,"script"),Pe)).length;h<d;h++)u=r,h!==m&&(u=T.clone(u,!0,!0),l&&T.merge(s,ge(u,"script"))),n.call(e[h],u,h);if(l)for(c=s[s.length-1].ownerDocument,T.map(s,De),h=0;h<l;h++)u=s[h],pe.test(u.type||"")&&!$.access(u,"globalEval")&&T.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?T._evalUrl&&!u.noModule&&T._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):E(u.textContent.replace(Ae,""),u,c))}return e}function Fe(e,t,n){for(var i,r=t?T.filter(t,e):e,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||T.cleanData(ge(i)),i.parentNode&&(n&&re(i)&&ve(ge(i,"script")),i.parentNode.removeChild(i));return e}T.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var i,r,o,a,s,l,u,c=e.cloneNode(!0),h=re(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||T.isXMLDoc(e)))for(a=ge(c),i=0,r=(o=ge(e)).length;i<r;i++)s=o[i],"input"===(u=(l=a[i]).nodeName.toLowerCase())&&de.test(s.type)?l.checked=s.checked:"input"!==u&&"textarea"!==u||(l.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ge(e),a=a||ge(c),i=0,r=o.length;i<r;i++)Le(o[i],a[i]);else Le(e,c);return 0<(a=ge(c,"script")).length&&ve(a,!h&&ge(e,"script")),c},cleanData:function(e){for(var t,n,i,r=T.event.special,o=0;void 0!==(n=e[o]);o++)if(q(n)){if(t=n[$.expando]){if(t.events)for(i in t.events)r[i]?T.event.remove(n,i):T.removeEvent(n,i,t.handle);n[$.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),T.fn.extend({detach:function(e){return Fe(this,e,!0)},remove:function(e){return Fe(this,e)},text:function(e){return U(this,function(e){return void 0===e?T.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Oe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ke(this,e).appendChild(e)})},prepend:function(){return Oe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ke(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Oe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Oe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(T.cleanData(ge(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return T.clone(this,e,t)})},html:function(e){return U(this,function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Me.test(e)&&!me[(fe.exec(e)||["",""])[1].toLowerCase()]){e=T.htmlPrefilter(e);try{for(;n<i;n++)1===(t=this[n]||{}).nodeType&&(T.cleanData(ge(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Oe(this,arguments,function(t){var n=this.parentNode;T.inArray(this,e)<0&&(T.cleanData(ge(this)),n&&n.replaceChild(t,this))},e)}}),T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){T.fn[e]=function(e){for(var n,i=[],r=T(e),o=r.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),T(r[s])[t](n),a.apply(i,n.get());return this.pushStack(i)}});var Ne=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=function(e,t,n){var i,r,o={};for(r in t)o[r]=e.style[r],e.style[r]=t[r];for(r in i=n.call(e),t)e.style[r]=o[r];return i},ze=new RegExp(ne.join("|"),"i");function Ve(e,t,n){var i,r,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||re(e)||(a=T.style(e,t)),!f.pixelBoxStyles()&&Ne.test(a)&&ze.test(t)&&(i=s.width,r=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=i,s.minWidth=r,s.maxWidth=o)),void 0!==a?a+"":a}function Ue(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(u).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,l=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),r=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),ie.removeChild(u),c=null}}function n(e){return Math.round(parseFloat(e))}var i,r,o,a,s,l,u=g.createElement("div"),c=g.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===c.style.backgroundClip,T.extend(f,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,i,r;return null==s&&(t=g.createElement("table"),n=g.createElement("tr"),i=g.createElement("div"),t.style.cssText="position:absolute;left:-11111px",n.style.height="1px",i.style.height="9px",ie.appendChild(t).appendChild(n).appendChild(i),r=e.getComputedStyle(n),s=3<parseInt(r.height),ie.removeChild(t)),s}}))}();var je=["Webkit","Moz","ms"],We=g.createElement("div").style,Ge={};function Ye(e){return T.cssProps[e]||Ge[e]||(e in We?e:Ge[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=je.length;n--;)if((e=je[n]+t)in We)return e}(e)||e)}var qe=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,$e={position:"absolute",visibility:"hidden",display:"block"},Ze={letterSpacing:"0",fontWeight:"400"};function Ke(e,t,n){var i=te.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function Qe(e,t,n,i,r,o){var a="width"===t?1:0,s=0,l=0;if(n===(i?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=T.css(e,n+ne[a],!0,r)),i?("content"===n&&(l-=T.css(e,"padding"+ne[a],!0,r)),"margin"!==n&&(l-=T.css(e,"border"+ne[a]+"Width",!0,r))):(l+=T.css(e,"padding"+ne[a],!0,r),"padding"!==n?l+=T.css(e,"border"+ne[a]+"Width",!0,r):s+=T.css(e,"border"+ne[a]+"Width",!0,r));return!i&&0<=o&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function Je(e,t,n){var i=Ie(e),r=(!f.boxSizingReliable()||n)&&"border-box"===T.css(e,"boxSizing",!1,i),o=r,a=Ve(e,t,i),s="offset"+t[0].toUpperCase()+t.slice(1);if(Ne.test(a)){if(!n)return a;a="auto"}return(!f.boxSizingReliable()&&r||!f.reliableTrDimensions()&&S(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===T.css(e,"display",!1,i))&&e.getClientRects().length&&(r="border-box"===T.css(e,"boxSizing",!1,i),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(r?"border":"content"),o,i,a)+"px"}function et(e,t,n,i,r){return new et.prototype.init(e,t,n,i,r)}T.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ve(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,o,a,s=Y(t),l=Xe.test(t),u=e.style;if(l||(t=Ye(s)),a=T.cssHooks[t]||T.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(r=a.get(e,!1,i))?r:u[t];"string"==(o=typeof n)&&(r=te.exec(n))&&r[1]&&(n=se(e,t,r),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=r&&r[3]||(T.cssNumber[s]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,i))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,i){var r,o,a,s=Y(t);return Xe.test(t)||(t=Ye(s)),(a=T.cssHooks[t]||T.cssHooks[s])&&"get"in a&&(r=a.get(e,!0,n)),void 0===r&&(r=Ve(e,t,i)),"normal"===r&&t in Ze&&(r=Ze[t]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),T.each(["height","width"],function(e,t){T.cssHooks[t]={get:function(e,n,i){if(n)return!qe.test(T.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,i):Be(e,$e,function(){return Je(e,t,i)})},set:function(e,n,i){var r,o=Ie(e),a=!f.scrollboxSize()&&"absolute"===o.position,s=(a||i)&&"border-box"===T.css(e,"boxSizing",!1,o),l=i?Qe(e,t,i,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Qe(e,t,"border",!1,o)-.5)),l&&(r=te.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=T.css(e,t)),Ke(0,n,l)}}}),T.cssHooks.marginLeft=Ue(f.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ve(e,"marginLeft"))||e.getBoundingClientRect().left-Be(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),T.each({margin:"",padding:"",border:"Width"},function(e,t){T.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+ne[i]+t]=o[i]||o[i-2]||o[0];return r}},"margin"!==e&&(T.cssHooks[e+t].set=Ke)}),T.fn.extend({css:function(e,t){return U(this,function(e,t,n){var i,r,o={},a=0;if(Array.isArray(t)){for(i=Ie(e),r=t.length;a<r;a++)o[t[a]]=T.css(e,t[a],!1,i);return o}return void 0!==n?T.style(e,t,n):T.css(e,t)},e,t,1<arguments.length)}}),((T.Tween=et).prototype={constructor:et,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||T.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(T.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=T.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=T.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){T.fx.step[e.prop]?T.fx.step[e.prop](e):1!==e.elem.nodeType||!T.cssHooks[e.prop]&&null==e.elem.style[Ye(e.prop)]?e.elem[e.prop]=e.now:T.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},T.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},T.fx=et.prototype.init,T.fx.step={};var tt,nt,it,rt,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(st):e.setTimeout(st,T.fx.interval),T.fx.tick())}function lt(){return e.setTimeout(function(){tt=void 0}),tt=Date.now()}function ut(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=ne[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function ct(e,t,n){for(var i,r=(ht.tweeners[t]||[]).concat(ht.tweeners["*"]),o=0,a=r.length;o<a;o++)if(i=r[o].call(n,t,e))return i}function ht(e,t,n){var i,r,o=0,a=ht.prefilters.length,s=T.Deferred().always(function(){delete l.elem}),l=function(){if(r)return!1;for(var t=tt||lt(),n=Math.max(0,u.startTime+u.duration-t),i=1-(n/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(i);return s.notifyWith(e,[u,i,n]),i<1&&a?n:(a||s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:T.extend({},t),opts:T.extend(!0,{specialEasing:{},easing:T.easing._default},n),originalProperties:t,originalOptions:n,startTime:tt||lt(),duration:n.duration,tweens:[],createTween:function(t,n){var i=T.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(i),i},stop:function(t){var n=0,i=t?u.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)u.tweens[n].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,i,r,o,a;for(n in e)if(r=t[i=Y(n)],o=e[n],Array.isArray(o)&&(r=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),(a=T.cssHooks[i])&&"expand"in a)for(n in o=a.expand(o),delete e[i],o)n in e||(e[n]=o[n],t[n]=r);else t[i]=r}(c,u.opts.specialEasing);o<a;o++)if(i=ht.prefilters[o].call(u,e,c,u.opts))return p(i.stop)&&(T._queueHooks(u.elem,u.opts.queue).stop=i.stop.bind(i)),i;return T.map(c,ct,u),p(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),T.fx.timer(T.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}T.Animation=T.extend(ht,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){p(e)?(t=e,e=["*"]):e=e.match(O);for(var n,i=0,r=e.length;i<r;i++)n=e[i],ht.tweeners[n]=ht.tweeners[n]||[],ht.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var i,r,o,a,s,l,u,c,h="width"in t||"height"in t,d=this,f={},p=e.style,m=e.nodeType&&ae(e),g=$.get(e,"fxshow");for(i in n.queue||(null==(a=T._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,T.queue(e,"fx").length||a.empty.fire()})})),t)if(r=t[i],ot.test(r)){if(delete t[i],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;m=!0}f[i]=g&&g[i]||T.style(e,i)}if((l=!T.isEmptyObject(t))||!T.isEmptyObject(f))for(i in h&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(u=g&&g.display)&&(u=$.get(e,"display")),"none"===(c=T.css(e,"display"))&&(u?c=u:(ue([e],!0),u=e.style.display||u,c=T.css(e,"display"),ue([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===T.css(e,"float")&&(l||(d.done(function(){p.display=u}),null==u&&(c=p.display,u="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=$.access(e,"fxshow",{display:u}),o&&(g.hidden=!m),m&&ue([e],!0),d.done(function(){for(i in m||ue([e]),$.remove(e,"fxshow"),f)T.style(e,i,f[i])})),l=ct(m?g[i]:0,i,d),i in g||(g[i]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?ht.prefilters.unshift(e):ht.prefilters.push(e)}}),T.speed=function(e,t,n){var i=e&&"object"==typeof e?T.extend({},e):{complete:n||!n&&t||p(e)&&e,duration:e,easing:n&&t||t&&!p(t)&&t};return T.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in T.fx.speeds?i.duration=T.fx.speeds[i.duration]:i.duration=T.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){p(i.old)&&i.old.call(this),i.queue&&T.dequeue(this,i.queue)},i},T.fn.extend({fadeTo:function(e,t,n,i){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var r=T.isEmptyObject(e),o=T.speed(t,n,i),a=function(){var t=ht(this,T.extend({},e),o);(r||$.get(this,"finish"))&&t.stop(!0)};return a.finish=a,r||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,r=null!=e&&e+"queueHooks",o=T.timers,a=$.get(this);if(r)a[r]&&a[r].stop&&i(a[r]);else for(r in a)a[r]&&a[r].stop&&at.test(r)&&i(a[r]);for(r=o.length;r--;)o[r].elem!==this||null!=e&&o[r].queue!==e||(o[r].anim.stop(n),t=!1,o.splice(r,1));!t&&n||T.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=$.get(this),i=n[e+"queue"],r=n[e+"queueHooks"],o=T.timers,a=i?i.length:0;for(n.finish=!0,T.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish})}}),T.each(["toggle","show","hide"],function(e,t){var n=T.fn[t];T.fn[t]=function(e,i,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,i,r)}}),T.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){T.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}}),T.timers=[],T.fx.tick=function(){var e,t=0,n=T.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||T.fx.stop(),tt=void 0},T.fx.timer=function(e){T.timers.push(e),T.fx.start()},T.fx.interval=13,T.fx.start=function(){nt||(nt=!0,st())},T.fx.stop=function(){nt=null},T.fx.speeds={slow:600,fast:200,_default:400},T.fn.delay=function(t,n){return t=T.fx&&T.fx.speeds[t]||t,n=n||"fx",this.queue(n,function(n,i){var r=e.setTimeout(n,t);i.stop=function(){e.clearTimeout(r)}})},it=g.createElement("input"),rt=g.createElement("select").appendChild(g.createElement("option")),it.type="checkbox",f.checkOn=""!==it.value,f.optSelected=rt.selected,(it=g.createElement("input")).value="t",it.type="radio",f.radioValue="t"===it.value;var dt,ft=T.expr.attrHandle;T.fn.extend({attr:function(e,t){return U(this,T.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){T.removeAttr(this,e)})}}),T.extend({attr:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?T.prop(e,t,n):(1===o&&T.isXMLDoc(e)||(r=T.attrHooks[t.toLowerCase()]||(T.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void T.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=T.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&S(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(O);if(r&&1===e.nodeType)for(;n=r[i++];)e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?T.removeAttr(e,n):e.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ft[t]||T.find.attr;ft[t]=function(e,t,i){var r,o,a=t.toLowerCase();return i||(o=ft[a],ft[a]=r,r=null!=n(e,t,i)?a:null,ft[a]=o),r}});var pt=/^(?:input|select|textarea|button)$/i,mt=/^(?:a|area)$/i;function gt(e){return(e.match(O)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function Et(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(O)||[]}T.fn.extend({prop:function(e,t){return U(this,T.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[T.propFix[e]||e]})}}),T.extend({prop:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&T.isXMLDoc(e)||(t=T.propFix[t]||t,r=T.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=T.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||mt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(T.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){T.propFix[this.toLowerCase()]=this}),T.fn.extend({addClass:function(e){var t,n,i,r,o,a,s,l=0;if(p(e))return this.each(function(t){T(this).addClass(e.call(this,t,vt(this)))});if((t=Et(e)).length)for(;n=this[l++];)if(r=vt(n),i=1===n.nodeType&&" "+gt(r)+" "){for(a=0;o=t[a++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(s=gt(i))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,i,r,o,a,s,l=0;if(p(e))return this.each(function(t){T(this).removeClass(e.call(this,t,vt(this)))});if(!arguments.length)return this.attr("class","");if((t=Et(e)).length)for(;n=this[l++];)if(r=vt(n),i=1===n.nodeType&&" "+gt(r)+" "){for(a=0;o=t[a++];)for(;-1<i.indexOf(" "+o+" ");)i=i.replace(" "+o+" "," ");r!==(s=gt(i))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,i="string"===n||Array.isArray(e);return"boolean"==typeof t&&i?t?this.addClass(e):this.removeClass(e):p(e)?this.each(function(n){T(this).toggleClass(e.call(this,n,vt(this),t),t)}):this.each(function(){var t,r,o,a;if(i)for(r=0,o=T(this),a=Et(e);t=a[r++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=vt(this))&&$.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":$.get(this,"__className__")||""))})},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&-1<(" "+gt(vt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;T.fn.extend({val:function(e){var t,n,i,r=this[0];return arguments.length?(i=p(e),this.each(function(n){var r;1===this.nodeType&&(null==(r=i?e.call(this,n,T(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=T.map(r,function(e){return null==e?"":e+""})),(t=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))})):r?(t=T.valHooks[r.type]||T.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(yt,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(e){var t=T.find.attr(e,"value");return null!=t?t:gt(T.text(e))}},select:{get:function(e){var t,n,i,r=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:r.length;for(i=o<0?l:a?o:0;i<l;i++)if(((n=r[i]).selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!S(n.parentNode,"optgroup"))){if(t=T(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,i,r=e.options,o=T.makeArray(t),a=r.length;a--;)((i=r[a]).selected=-1<T.inArray(T.valHooks.option.get(i),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),T.each(["radio","checkbox"],function(){T.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<T.inArray(T(e).val(),t)}},f.checkOn||(T.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),f.focusin="onfocusin"in e;var _t=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};T.extend(T.event,{trigger:function(t,n,i,r){var o,a,s,l,u,h,d,f,v=[i||g],E=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(a=f=s=i=i||g,3!==i.nodeType&&8!==i.nodeType&&!_t.test(E+T.event.triggered)&&(-1<E.indexOf(".")&&(E=(y=E.split(".")).shift(),y.sort()),u=E.indexOf(":")<0&&"on"+E,(t=t[T.expando]?t:new T.Event(E,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=y.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:T.makeArray(n,[t]),d=T.event.special[E]||{},r||!d.trigger||!1!==d.trigger.apply(i,n))){if(!r&&!d.noBubble&&!m(i)){for(l=d.delegateType||E,_t.test(l+E)||(a=a.parentNode);a;a=a.parentNode)v.push(a),s=a;s===(i.ownerDocument||g)&&v.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=v[o++])&&!t.isPropagationStopped();)f=a,t.type=1<o?l:d.bindType||E,(h=($.get(a,"events")||Object.create(null))[t.type]&&$.get(a,"handle"))&&h.apply(a,n),(h=u&&a[u])&&h.apply&&q(a)&&(t.result=h.apply(a,n),!1===t.result&&t.preventDefault());return t.type=E,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!q(i)||u&&p(i[E])&&!m(i)&&((s=i[u])&&(i[u]=null),T.event.triggered=E,t.isPropagationStopped()&&f.addEventListener(E,Tt),i[E](),t.isPropagationStopped()&&f.removeEventListener(E,Tt),T.event.triggered=void 0,s&&(i[u]=s)),t.result}},simulate:function(e,t,n){var i=T.extend(new T.Event,n,{type:e,isSimulated:!0});T.event.trigger(i,null,t)}}),T.fn.extend({trigger:function(e,t){return this.each(function(){T.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return T.event.trigger(e,t,n,!0)}}),f.focusin||T.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){T.event.simulate(t,e.target,T.event.fix(e))};T.event.special[t]={setup:function(){var i=this.ownerDocument||this.document||this,r=$.access(i,t);r||i.addEventListener(e,n,!0),$.access(i,t,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=$.access(i,t)-1;r?$.access(i,t,r):(i.removeEventListener(e,n,!0),$.remove(i,t))}}});var bt=e.location,wt={guid:Date.now()},xt=/\?/;T.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(t){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||T.error("Invalid XML: "+t),n};var Rt=/\[\]$/,Ht=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,Mt=/^(?:input|select|textarea|keygen)/i;function Ct(e,t,n,i){var r;if(Array.isArray(t))T.each(t,function(t,r){n||Rt.test(e)?i(e,r):Ct(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)});else if(n||"object"!==y(t))i(e,t);else for(r in t)Ct(e+"["+r+"]",t[r],n,i)}T.param=function(e,t){var n,i=[],r=function(e,t){var n=p(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!T.isPlainObject(e))T.each(e,function(){r(this.name,this.value)});else for(n in e)Ct(n,e[n],t,r);return i.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=T.prop(this,"elements");return e?T.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!T(this).is(":disabled")&&Mt.test(this.nodeName)&&!St.test(e)&&(this.checked||!de.test(e))}).map(function(e,t){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,function(e){return{name:t.name,value:e.replace(Ht,"\r\n")}}):{name:t.name,value:n.replace(Ht,"\r\n")}}).get()}});var At=/%20/g,kt=/#.*$/,Pt=/([?&])_=[^&]*/,Dt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ot=/^\/\//,Ft={},Nt={},It="*/".concat("*"),Bt=g.createElement("a");function zt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(O)||[];if(p(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function Vt(e,t,n,i){var r={},o=e===Nt;function a(s){var l;return r[s]=!0,T.each(e[s]||[],function(e,s){var u=s(t,n,i);return"string"!=typeof u||o||r[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),l}return a(t.dataTypes[0])||!r["*"]&&a("*")}function Ut(e,t){var n,i,r=T.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&T.extend(!0,e,i),e}Bt.href=bt.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,T.ajaxSettings),t):Ut(T.ajaxSettings,e)},ajaxPrefilter:zt(Ft),ajaxTransport:zt(Nt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,r,o,a,s,l,u,c,h,d,f=T.ajaxSetup({},n),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?T(p):T.event,v=T.Deferred(),E=T.Callbacks("once memory"),y=f.statusCode||{},_={},b={},w="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=Dt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(e,t){return null==u&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,_[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)x.always(e[x.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||w;return i&&i.abort(t),R(0,t),this}};if(v.promise(x),f.url=((t||f.url||bt.href)+"").replace(Ot,bt.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(O)||[""],null==f.crossDomain){l=g.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=T.param(f.data,f.traditional)),Vt(Ft,f,n,x),u)return x;for(h in(c=T.event&&f.global)&&0==T.active++&&T.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Lt.test(f.type),r=f.url.replace(kt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(At,"+")):(d=f.url.slice(r.length),f.data&&(f.processData||"string"==typeof f.data)&&(r+=(xt.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(Pt,"$1"),d=(xt.test(r)?"&":"?")+"_="+wt.guid+++d),f.url=r+d),f.ifModified&&(T.lastModified[r]&&x.setRequestHeader("If-Modified-Since",T.lastModified[r]),T.etag[r]&&x.setRequestHeader("If-None-Match",T.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&x.setRequestHeader("Content-Type",f.contentType),x.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+It+"; q=0.01":""):f.accepts["*"]),f.headers)x.setRequestHeader(h,f.headers[h]);if(f.beforeSend&&(!1===f.beforeSend.call(p,x,f)||u))return x.abort();if(w="abort",E.add(f.complete),x.done(f.success),x.fail(f.error),i=Vt(Nt,f,n,x)){if(x.readyState=1,c&&m.trigger("ajaxSend",[x,f]),u)return x;f.async&&0<f.timeout&&(s=e.setTimeout(function(){x.abort("timeout")},f.timeout));try{u=!1,i.send(_,R)}catch(t){if(u)throw t;R(-1,t)}}else R(-1,"No Transport");function R(t,n,a,l){var h,d,g,_,b,w=n;u||(u=!0,s&&e.clearTimeout(s),i=void 0,o=l||"",x.readyState=0<t?4:0,h=200<=t&&t<300||304===t,a&&(_=function(e,t,n){for(var i,r,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in s)if(s[r]&&s[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,x,a)),!h&&-1<T.inArray("script",f.dataTypes)&&(f.converters["text script"]=function(){}),_=function(e,t,n,i){var r,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(r in u)if((s=r.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[r]:!0!==u[r]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,_,x,h),h?(f.ifModified&&((b=x.getResponseHeader("Last-Modified"))&&(T.lastModified[r]=b),(b=x.getResponseHeader("etag"))&&(T.etag[r]=b)),204===t||"HEAD"===f.type?w="nocontent":304===t?w="notmodified":(w=_.state,d=_.data,h=!(g=_.error))):(g=w,!t&&w||(w="error",t<0&&(t=0))),x.status=t,x.statusText=(n||w)+"",h?v.resolveWith(p,[d,w,x]):v.rejectWith(p,[x,w,g]),x.statusCode(y),y=void 0,c&&m.trigger(h?"ajaxSuccess":"ajaxError",[x,f,h?d:g]),E.fireWith(p,[x,w]),c&&(m.trigger("ajaxComplete",[x,f]),--T.active||T.event.trigger("ajaxStop")))}return x},getJSON:function(e,t,n){return T.get(e,t,n,"json")},getScript:function(e,t){return T.get(e,void 0,t,"script")}}),T.each(["get","post"],function(e,t){T[t]=function(e,n,i,r){return p(n)&&(r=r||i,i=n,n=void 0),T.ajax(T.extend({url:e,type:t,dataType:r,data:n,success:i},T.isPlainObject(e)&&e))}}),T.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),T._evalUrl=function(e,t,n){return T.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){T.globalEval(e,t,n)}})},T.fn.extend({wrapAll:function(e){var t;return this[0]&&(p(e)&&(e=e.call(this[0])),t=T(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return p(e)?this.each(function(t){T(this).wrapInner(e.call(this,t))}):this.each(function(){var t=T(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=p(e);return this.each(function(n){T(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){T(this).replaceWith(this.childNodes)}),this}}),T.expr.pseudos.hidden=function(e){return!T.expr.pseudos.visible(e)},T.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var jt={0:200,1223:204},Wt=T.ajaxSettings.xhr();f.cors=!!Wt&&"withCredentials"in Wt,f.ajax=Wt=!!Wt,T.ajaxTransport(function(t){var n,i;if(f.cors||Wt&&!t.crossDomain)return{send:function(r,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)s.setRequestHeader(a,r[a]);n=function(e){return function(){n&&(n=i=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(jt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),i=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=i:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&i()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(r){if(n)throw r}},abort:function(){n&&n()}}}),T.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return T.globalEval(e),e}}}),T.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),T.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(i,r){t=T("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),g.head.appendChild(t[0])},abort:function(){n&&n()}}});var Gt,Yt=[],qt=/(=)\?(?=&|$)|\?\?/;T.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||T.expando+"_"+wt.guid++;return this[e]=!0,e}}),T.ajaxPrefilter("json jsonp",function(t,n,i){var r,o,a,s=!1!==t.jsonp&&(qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&qt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=p(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(qt,"$1"+r):!1!==t.jsonp&&(t.url+=(xt.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return a||T.error(r+" was not called"),a[0]},t.dataTypes[0]="json",o=e[r],e[r]=function(){a=arguments},i.always(function(){void 0===o?T(e).removeProp(r):e[r]=o,t[r]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(r)),a&&p(o)&&o(a[0]),a=o=void 0}),"script"}),f.createHTMLDocument=((Gt=g.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Gt.childNodes.length),T.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((i=(t=g.implementation.createHTMLDocument("")).createElement("base")).href=g.location.href,t.head.appendChild(i)):t=g),o=!n&&[],(r=M.exec(e))?[t.createElement(r[1])]:(r=ye([e],t,o),o&&o.length&&T(o).remove(),T.merge([],r.childNodes)));var i,r,o},T.fn.load=function(e,t,n){var i,r,o,a=this,s=e.indexOf(" ");return-1<s&&(i=gt(e.slice(s)),e=e.slice(0,s)),p(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),0<a.length&&T.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(i?T("<div>").append(T.parseHTML(e)).find(i):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},T.expr.pseudos.animated=function(e){return T.grep(T.timers,function(t){return e===t.elem}).length},T.offset={setOffset:function(e,t,n){var i,r,o,a,s,l,u=T.css(e,"position"),c=T(e),h={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=T.css(e,"top"),l=T.css(e,"left"),("absolute"===u||"fixed"===u)&&-1<(o+l).indexOf("auto")?(a=(i=c.position()).top,r=i.left):(a=parseFloat(o)||0,r=parseFloat(l)||0),p(t)&&(t=t.call(e,n,T.extend({},s))),null!=t.top&&(h.top=t.top-s.top+a),null!=t.left&&(h.left=t.left-s.left+r),"using"in t?t.using.call(e,h):("number"==typeof h.top&&(h.top+="px"),"number"==typeof h.left&&(h.left+="px"),c.css(h))}},T.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){T.offset.setOffset(this,e,t)});var t,n,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,i=this[0],r={top:0,left:0};if("fixed"===T.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===T.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((r=T(e).offset()).top+=T.css(e,"borderTopWidth",!0),r.left+=T.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-T.css(i,"marginTop",!0),left:t.left-r.left-T.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===T.css(e,"position");)e=e.offsetParent;return e||ie})}}),T.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;T.fn[e]=function(i){return U(this,function(e,i,r){var o;if(m(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===r)return o?o[t]:e[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):e[i]=r},e,i,arguments.length)}}),T.each(["top","left"],function(e,t){T.cssHooks[t]=Ue(f.pixelPosition,function(e,n){if(n)return n=Ve(e,t),Ne.test(n)?T(e).position()[t]+"px":n})}),T.each({Height:"height",Width:"width"},function(e,t){T.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,i){T.fn[i]=function(r,o){var a=arguments.length&&(n||"boolean"!=typeof r),s=n||(!0===r||!0===o?"margin":"border");return U(this,function(t,n,r){var o;return m(t)?0===i.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===r?T.css(t,n,s):T.style(t,n,r,s)},t,a?r:void 0,a)}})}),T.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){T.fn[t]=function(e){return this.on(t,e)}}),T.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),T.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){T.fn[t]=function(e,n){return 0<arguments.length?this.on(t,null,e,n):this.trigger(t)}});var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;T.proxy=function(e,t){var n,i,o;if("string"==typeof t&&(n=e[t],t=e,e=n),p(e))return i=r.call(arguments,2),(o=function(){return e.apply(t||this,i.concat(r.call(arguments)))}).guid=e.guid=e.guid||T.guid++,o},T.holdReady=function(e){e?T.readyWait++:T.ready(!0)},T.isArray=Array.isArray,T.parseJSON=JSON.parse,T.nodeName=S,T.isFunction=p,T.isWindow=m,T.camelCase=Y,T.type=y,T.now=Date.now,T.isNumeric=function(e){var t=T.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},T.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return T});var $t=e.jQuery,Zt=e.$;return T.noConflict=function(t){return e.$===T&&(e.$=Zt),t&&e.jQuery===T&&(e.jQuery=$t),T},void 0===t&&(e.jQuery=e.$=T),T}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Popper=t()}(this,function(){"use strict";function e(e){return e&&"[object Function]"==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var n=getComputedStyle(e,null);return t?n[t]:n}function n(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function i(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var r=t(e),o=r.overflow,a=r.overflowX,s=r.overflowY;return/(auto|scroll|overlay)/.test(o+s+a)?e:i(n(e))}function r(e){return 11===e?q:10===e?X:q||X}function o(e){if(!e)return document.documentElement;for(var n=r(10)?document.body:null,i=e.offsetParent;i===n&&e.nextElementSibling;)i=(e=e.nextElementSibling).offsetParent;var a=i&&i.nodeName;return a&&"BODY"!==a&&"HTML"!==a?-1!==["TD","TABLE"].indexOf(i.nodeName)&&"static"===t(i,"position")?o(i):i:e?e.ownerDocument.documentElement:document.documentElement}function a(e){return null===e.parentNode?e:a(e.parentNode)}function s(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?e:t,r=n?t:e,l=document.createRange();l.setStart(i,0),l.setEnd(r,0);var u=l.commonAncestorContainer;if(e!==u&&t!==u||i.contains(r))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||o(e.firstElementChild)===e)}(u)?u:o(u);var c=a(e);return c.host?s(c.host,t):s(e,a(t).host)}function l(e){var t="top"===(1<arguments.length&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var i=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||i)[t]}return e[t]}function u(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=l(t,"top"),r=l(t,"left"),o=n?-1:1;return e.top+=i*o,e.bottom+=i*o,e.left+=r*o,e.right+=r*o,e}function c(e,t){var n="x"===t?"Left":"Top",i="Left"==n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+i+"Width"],10)}function h(e,t,n,i){return V(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],r(10)?n["offset"+e]+i["margin"+("Height"===e?"Top":"Left")]+i["margin"+("Height"===e?"Bottom":"Right")]:0)}function d(){var e=document.body,t=document.documentElement,n=r(10)&&getComputedStyle(t);return{height:h("Height",e,t,n),width:h("Width",e,t,n)}}function f(e){return Q({},e,{right:e.left+e.width,bottom:e.top+e.height})}function p(e){var n={};try{if(r(10)){n=e.getBoundingClientRect();var i=l(e,"top"),o=l(e,"left");n.top+=i,n.left+=o,n.bottom+=i,n.right+=o}else n=e.getBoundingClientRect()}catch(e){}var a={left:n.left,top:n.top,width:n.right-n.left,height:n.bottom-n.top},s="HTML"===e.nodeName?d():{},u=s.width||e.clientWidth||a.right-a.left,h=s.height||e.clientHeight||a.bottom-a.top,p=e.offsetWidth-u,m=e.offsetHeight-h;if(p||m){var g=t(e);p-=c(g,"x"),m-=c(g,"y"),a.width-=p,a.height-=m}return f(a)}function m(e,n){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],a=r(10),s="HTML"===n.nodeName,l=p(e),c=p(n),h=i(e),d=t(n),m=parseFloat(d.borderTopWidth,10),g=parseFloat(d.borderLeftWidth,10);o&&"HTML"===n.nodeName&&(c.top=V(c.top,0),c.left=V(c.left,0));var v=f({top:l.top-c.top-m,left:l.left-c.left-g,width:l.width,height:l.height});if(v.marginTop=0,v.marginLeft=0,!a&&s){var E=parseFloat(d.marginTop,10),y=parseFloat(d.marginLeft,10);v.top-=m-E,v.bottom-=m-E,v.left-=g-y,v.right-=g-y,v.marginTop=E,v.marginLeft=y}return(a&&!o?n.contains(h):n===h&&"BODY"!==h.nodeName)&&(v=u(v,n)),v}function g(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,i=m(e,n),r=V(n.clientWidth,window.innerWidth||0),o=V(n.clientHeight,window.innerHeight||0),a=t?0:l(n),s=t?0:l(n,"left");return f({top:a-i.top+i.marginTop,left:s-i.left+i.marginLeft,width:r,height:o})}function v(e){var i=e.nodeName;return"BODY"!==i&&"HTML"!==i&&("fixed"===t(e,"position")||v(n(e)))}function E(e){if(!e||!e.parentElement||r())return document.documentElement;for(var n=e.parentElement;n&&"none"===t(n,"transform");)n=n.parentElement;return n||document.documentElement}function y(e,t,r,o){var a=4<arguments.length&&void 0!==arguments[4]&&arguments[4],l={top:0,left:0},u=a?E(e):s(e,t);if("viewport"===o)l=g(u,a);else{var c;"scrollParent"===o?"BODY"===(c=i(n(t))).nodeName&&(c=e.ownerDocument.documentElement):c="window"===o?e.ownerDocument.documentElement:o;var h=m(c,u,a);if("HTML"!==c.nodeName||v(u))l=h;else{var f=d(),p=f.height,y=f.width;l.top+=h.top-h.marginTop,l.bottom=p+h.top,l.left+=h.left-h.marginLeft,l.right=y+h.left}}return l.left+=r,l.top+=r,l.right-=r,l.bottom-=r,l}function _(e){return e.width*e.height}function T(e,t,n,i,r){var o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=y(n,i,o,r),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map(function(e){return Q({key:e},s[e],{area:_(s[e])})}).sort(function(e,t){return t.area-e.area}),u=l.filter(function(e){var t=e.width,i=e.height;return t>=n.clientWidth&&i>=n.clientHeight}),c=0<u.length?u[0].key:l[0].key,h=e.split("-")[1];return c+(h?"-"+h:"")}function b(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return m(n,i?E(t):s(t,n),i)}function w(e){var t=getComputedStyle(e),n=parseFloat(t.marginTop)+parseFloat(t.marginBottom),i=parseFloat(t.marginLeft)+parseFloat(t.marginRight);return{width:e.offsetWidth+i,height:e.offsetHeight+n}}function x(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function R(e,t,n){n=n.split("-")[0];var i=w(e),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",u=o?"width":"height";return r[a]=t[a]+t[l]/2-i[l]/2,r[s]=n===s?t[s]-i[u]:t[x(s)],r}function H(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function S(t,n,i){return(void 0===i?t:t.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var i=H(e,function(e){return e[t]===n});return e.indexOf(i)}(t,"name",i))).forEach(function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var i=t.function||t.fn;t.enabled&&e(i)&&(n.offsets.popper=f(n.offsets.popper),n.offsets.reference=f(n.offsets.reference),n=i(n,t))}),n}function M(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function C(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),i=0;i<t.length;i++){var r=t[i],o=r?""+r+n:e;if(void 0!==document.body.style[o])return o}return null}function A(e){var t=e.ownerDocument;return t?t.defaultView:window}function k(e,t,n,r){n.updateBound=r,A(e).addEventListener("resize",n.updateBound,{passive:!0});var o=i(e);return function e(t,n,r,o){var a="BODY"===t.nodeName,s=a?t.ownerDocument.defaultView:t;s.addEventListener(n,r,{passive:!0}),a||e(i(s.parentNode),n,r,o),o.push(s)}(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function P(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,A(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function D(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function L(e,t){Object.keys(t).forEach(function(n){var i="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&D(t[n])&&(i="px"),e.style[n]=t[n]+i})}function O(e,t,n){var i=H(e,function(e){return e.name===t}),r=!!i&&e.some(function(e){return e.name===n&&e.enabled&&e.order<i.order});if(!r){var o="`"+t+"`";console.warn("`"+n+"` modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return r}function F(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=ee.indexOf(e),i=ee.slice(n+1).concat(ee.slice(0,n));return t?i.reverse():i}function N(e,t,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),a=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=a.indexOf(H(a,function(e){return-1!==e.search(/,|\s/)}));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=-1===s?[a]:[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))];return(u=u.map(function(e,i){var r=(1===i?!o:o)?"height":"width",a=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)},[]).map(function(e){return function(e,t,n,i){var r=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],a=r[2];if(!o)return e;if(0===a.indexOf("%")){var s;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=i}return f(s)[t]/100*o}return"vh"===a||"vw"===a?("vh"===a?V(document.documentElement.clientHeight,window.innerHeight||0):V(document.documentElement.clientWidth,window.innerWidth||0))/100*o:o}(e,r,t,n)})})).forEach(function(e,t){e.forEach(function(n,i){D(n)&&(r[t]+=n*("-"===e[i-1]?-1:1))})}),r}for(var I=Math.min,B=Math.round,z=Math.floor,V=Math.max,U="undefined"!=typeof window&&"undefined"!=typeof document,j=["Edge","Trident","Firefox"],W=0,G=0;G<j.length;G+=1)if(U&&0<=navigator.userAgent.indexOf(j[G])){W=1;break}var Y=U&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},W))}},q=U&&!(!window.MSInputMethodContext||!document.documentMode),X=U&&/MSIE 10/.test(navigator.userAgent),$=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Z=function(){function e(e,t){for(var n,i=0;i<t.length;i++)(n=t[i]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),K=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Q=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},J=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],ee=J.slice(3),te="flip",ne="clockwise",ie="counterclockwise",re=function(){function t(n,i){var r=this,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};$(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=Y(this.update.bind(this)),this.options=Q({},t.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=n&&n.jquery?n[0]:n,this.popper=i&&i.jquery?i[0]:i,this.options.modifiers={},Object.keys(Q({},t.Defaults.modifiers,o.modifiers)).forEach(function(e){r.options.modifiers[e]=Q({},t.Defaults.modifiers[e]||{},o.modifiers?o.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return Q({name:e},r.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(r.reference,r.popper,r.options,t,r.state)}),this.update();var a=this.options.eventsEnabled;a&&this.enableEventListeners(),this.state.eventsEnabled=a}return Z(t,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=b(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=T(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=R(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=S(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,M(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[C("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=k(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return P.call(this)}}]),t}();return re.Utils=("undefined"==typeof window?global:window).PopperUtils,re.placements=J,re.Defaults={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets,o=r.reference,a=r.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",u=s?"width":"height",c={start:K({},l,o[l]),end:K({},l,o[l]+o[u]-a[u])};e.offsets.popper=Q({},a,c[i])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n,i=t.offset,r=e.placement,o=e.offsets,a=o.popper,s=o.reference,l=r.split("-")[0];return n=D(+i)?[+i,0]:N(i,a,s,l),"left"===l?(a.top+=n[0],a.left-=n[1]):"right"===l?(a.top+=n[0],a.left+=n[1]):"top"===l?(a.left+=n[0],a.top-=n[1]):"bottom"===l&&(a.left+=n[0],a.top+=n[1]),e.popper=a,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||o(e.instance.popper);e.instance.reference===n&&(n=o(n));var i=C("transform"),r=e.instance.popper.style,a=r.top,s=r.left,l=r[i];r.top="",r.left="",r[i]="";var u=y(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);r.top=a,r.left=s,r[i]=l,t.boundaries=u;var c=t.priority,h=e.offsets.popper,d={primary:function(e){var n=h[e];return h[e]<u[e]&&!t.escapeWithReference&&(n=V(h[e],u[e])),K({},e,n)},secondary:function(e){var n="right"===e?"left":"top",i=h[n];return h[e]>u[e]&&!t.escapeWithReference&&(i=I(h[n],u[e]-("right"===e?h.width:h.height))),K({},n,i)}};return c.forEach(function(e){var t=-1===["left","top"].indexOf(e)?"secondary":"primary";h=Q({},h,d[t](e))}),e.offsets.popper=h,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,i=t.reference,r=e.placement.split("-")[0],o=z,a=-1!==["top","bottom"].indexOf(r),s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]<o(i[l])&&(e.offsets.popper[l]=o(i[l])-n[u]),n[l]>o(i[s])&&(e.offsets.popper[l]=o(i[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,n){var i;if(!O(e.instance.modifiers,"arrow","keepTogether"))return e;var r=n.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],a=e.offsets,s=a.popper,l=a.reference,u=-1!==["left","right"].indexOf(o),c=u?"height":"width",h=u?"Top":"Left",d=h.toLowerCase(),p=u?"left":"top",m=u?"bottom":"right",g=w(r)[c];l[m]-g<s[d]&&(e.offsets.popper[d]-=s[d]-(l[m]-g)),l[d]+g>s[m]&&(e.offsets.popper[d]+=l[d]+g-s[m]),e.offsets.popper=f(e.offsets.popper);var v=l[d]+l[c]/2-g/2,E=t(e.instance.popper),y=parseFloat(E["margin"+h],10),_=parseFloat(E["border"+h+"Width"],10),T=v-e.offsets.popper[d]-y-_;return T=V(I(s[c]-g,T),0),e.arrowElement=r,e.offsets.arrow=(K(i={},d,B(T)),K(i,p,""),i),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(M(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=y(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),i=e.placement.split("-")[0],r=x(i),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case te:a=[i,r];break;case ne:a=F(i);break;case ie:a=F(i,!0);break;default:a=t.behavior}return a.forEach(function(s,l){if(i!==s||a.length===l+1)return e;i=e.placement.split("-")[0],r=x(i);var u=e.offsets.popper,c=e.offsets.reference,h=z,d="left"===i&&h(u.right)>h(c.left)||"right"===i&&h(u.left)<h(c.right)||"top"===i&&h(u.bottom)>h(c.top)||"bottom"===i&&h(u.top)<h(c.bottom),f=h(u.left)<h(n.left),p=h(u.right)>h(n.right),m=h(u.top)<h(n.top),g=h(u.bottom)>h(n.bottom),v="left"===i&&f||"right"===i&&p||"top"===i&&m||"bottom"===i&&g,E=-1!==["top","bottom"].indexOf(i),y=!!t.flipVariations&&(E&&"start"===o&&f||E&&"end"===o&&p||!E&&"start"===o&&m||!E&&"end"===o&&g);(d||v||y)&&(e.flipped=!0,(d||v)&&(i=a[l+1]),y&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=i+(o?"-"+o:""),e.offsets.popper=Q({},e.offsets.popper,R(e.instance.popper,e.offsets.reference,e.placement)),e=S(e.instance.modifiers,e,"flip"))}),e},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],i=e.offsets,r=i.popper,o=i.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return r[a?"left":"top"]=o[n]-(s?r[a?"width":"height"]:0),e.placement=x(t),e.offsets.popper=f(r),e}},hide:{order:800,enabled:!0,fn:function(e){if(!O(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=H(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,i=t.y,r=e.offsets.popper,a=H(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;void 0!==a&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var s,l,u=void 0===a?t.gpuAcceleration:a,c=p(o(e.instance.popper)),h={position:r.position},d={left:z(r.left),top:B(r.top),bottom:B(r.bottom),right:z(r.right)},f="bottom"===n?"top":"bottom",m="right"===i?"left":"right",g=C("transform");if(l="bottom"==f?-c.height+d.bottom:d.top,s="right"==m?-c.width+d.right:d.left,u&&g)h[g]="translate3d("+s+"px, "+l+"px, 0)",h[f]=0,h[m]=0,h.willChange="transform";else{var v="bottom"==f?-1:1,E="right"==m?-1:1;h[f]=l*v,h[m]=s*E,h.willChange=f+", "+m}var y={"x-placement":e.placement};return e.attributes=Q({},y,e.attributes),e.styles=Q({},h,e.styles),e.arrowStyles=Q({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){return L(e.instance.popper,e.styles),function(e,t){Object.keys(t).forEach(function(n){!1===t[n]?e.removeAttribute(n):e.setAttribute(n,t[n])})}(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&L(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,i,r){var o=b(r,t,e,n.positionFixed),a=T(n.placement,o,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),L(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},re}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,t;function n(){return e.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function r(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e){return void 0===e}function a(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function s(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function l(e,t){var n,i=[];for(n=0;n<e.length;++n)i.push(t(e[n],n));return i}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var n in t)u(t,n)&&(e[n]=t[n]);return u(t,"toString")&&(e.toString=t.toString),u(t,"valueOf")&&(e.valueOf=t.valueOf),e}function h(e,t,n,i){return St(e,t,n,i,!0).utc()}function d(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function f(e){if(null==e._isValid){var n=d(e),i=t.call(n.parsedDateParts,function(e){return null!=e}),r=!isNaN(e._d.getTime())&&n.overflow<0&&!n.empty&&!n.invalidMonth&&!n.invalidWeekday&&!n.weekdayMismatch&&!n.nullInput&&!n.invalidFormat&&!n.userInvalidated&&(!n.meridiem||n.meridiem&&i);if(e._strict&&(r=r&&0===n.charsLeftOver&&0===n.unusedTokens.length&&void 0===n.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return r;e._isValid=r}return e._isValid}function p(e){var t=h(NaN);return null!=e?c(d(t),e):d(t).userInvalidated=!0,t}t=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,i=0;i<n;i++)if(i in t&&e.call(this,t[i],i,t))return!0;return!1};var m=n.momentProperties=[];function g(e,t){var n,i,r;if(o(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),o(t._i)||(e._i=t._i),o(t._f)||(e._f=t._f),o(t._l)||(e._l=t._l),o(t._strict)||(e._strict=t._strict),o(t._tzm)||(e._tzm=t._tzm),o(t._isUTC)||(e._isUTC=t._isUTC),o(t._offset)||(e._offset=t._offset),o(t._pf)||(e._pf=d(t)),o(t._locale)||(e._locale=t._locale),m.length>0)for(n=0;n<m.length;n++)o(r=t[i=m[n]])||(e[i]=r);return e}var v=!1;function E(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===v&&(v=!0,n.updateOffset(this),v=!1)}function y(e){return e instanceof E||null!=e&&null!=e._isAMomentObject}function _(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function T(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=_(t)),n}function b(e,t,n){var i,r=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0;for(i=0;i<r;i++)(n&&e[i]!==t[i]||!n&&T(e[i])!==T(t[i]))&&a++;return a+o}function w(e){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function x(e,t){var i=!0;return c(function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,e),i){for(var r,o=[],a=0;a<arguments.length;a++){if(r="","object"==typeof arguments[a]){for(var s in r+="\n["+a+"] ",arguments[0])r+=s+": "+arguments[0][s]+", ";r=r.slice(0,-2)}else r=arguments[a];o.push(r)}w(e+"\nArguments: "+Array.prototype.slice.call(o).join("")+"\n"+(new Error).stack),i=!1}return t.apply(this,arguments)},t)}var R,H={};function S(e,t){null!=n.deprecationHandler&&n.deprecationHandler(e,t),H[e]||(w(t),H[e]=!0)}function M(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e,t){var n,i=c({},e);for(n in t)u(t,n)&&(r(e[n])&&r(t[n])?(i[n]={},c(i[n],e[n]),c(i[n],t[n])):null!=t[n]?i[n]=t[n]:delete i[n]);for(n in e)u(e,n)&&!u(t,n)&&r(e[n])&&(i[n]=c({},i[n]));return i}function A(e){null!=e&&this.set(e)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,R=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)u(e,t)&&n.push(t);return n};var k={};function P(e,t){var n=e.toLowerCase();k[n]=k[n+"s"]=k[t]=e}function D(e){return"string"==typeof e?k[e]||k[e.toLowerCase()]:void 0}function L(e){var t,n,i={};for(n in e)u(e,n)&&(t=D(n))&&(i[t]=e[n]);return i}var O={};function F(e,t){O[e]=t}function N(e,t,n){var i=""+Math.abs(e),r=t-i.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}var I=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,B=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,z={},V={};function U(e,t,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),e&&(V[e]=r),t&&(V[t[0]]=function(){return N(r.apply(this,arguments),t[1],t[2])}),n&&(V[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function j(e,t){return e.isValid()?(t=W(t,e.localeData()),z[t]=z[t]||function(e){var t,n,i,r=e.match(I);for(t=0,n=r.length;t<n;t++)V[r[t]]?r[t]=V[r[t]]:r[t]=(i=r[t]).match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"");return function(t){var i,o="";for(i=0;i<n;i++)o+=M(r[i])?r[i].call(t,e):r[i];return o}}(t),z[t](e)):e.localeData().invalidDate()}function W(e,t){var n=5;function i(e){return t.longDateFormat(e)||e}for(B.lastIndex=0;n>=0&&B.test(e);)e=e.replace(B,i),B.lastIndex=0,n-=1;return e}var G=/\d/,Y=/\d\d/,q=/\d{3}/,X=/\d{4}/,$=/[+-]?\d{6}/,Z=/\d\d?/,K=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,J=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,ie=/[+-]?\d+/,re=/Z|[+-]\d\d:?\d\d/gi,oe=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,se={};function le(e,t,n){se[e]=M(t)?t:function(e,i){return e&&n?n:t}}function ue(e,t){return u(se,e)?se[e](t._strict,t._locale):new RegExp(ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,i,r){return t||n||i||r})))}function ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var he={};function de(e,t){var n,i=t;for("string"==typeof e&&(e=[e]),a(t)&&(i=function(e,n){n[t]=T(e)}),n=0;n<e.length;n++)he[e[n]]=i}function fe(e,t){de(e,function(e,n,i,r){i._w=i._w||{},t(e,i._w,i,r)})}function pe(e,t,n){null!=t&&u(he,e)&&he[e](t,n._a,n,e)}var me=0,ge=1,ve=2,Ee=3,ye=4,_e=5,Te=6,be=7,we=8;function xe(e){return Re(e)?366:365}function Re(e){return e%4==0&&e%100!=0||e%400==0}U("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),P("year","y"),F("year",1),le("Y",ie),le("YY",Z,Y),le("YYYY",ee,X),le("YYYYY",te,$),le("YYYYYY",te,$),de(["YYYYY","YYYYYY"],me),de("YYYY",function(e,t){t[me]=2===e.length?n.parseTwoDigitYear(e):T(e)}),de("YY",function(e,t){t[me]=n.parseTwoDigitYear(e)}),de("Y",function(e,t){t[me]=parseInt(e,10)}),n.parseTwoDigitYear=function(e){return T(e)+(T(e)>68?1900:2e3)};var He,Se=Me("FullYear",!0);function Me(e,t){return function(i){return null!=i?(Ae(this,e,i),n.updateOffset(this,t),this):Ce(this,e)}}function Ce(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Ae(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Re(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),ke(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function ke(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,i=(t%(n=12)+n)%n;return e+=(t-i)/12,1===i?Re(e)?29:28:31-i%7%2}He=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},U("M",["MM",2],"Mo",function(){return this.month()+1}),U("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),U("MMMM",0,0,function(e){return this.localeData().months(this,e)}),P("month","M"),F("month",8),le("M",Z),le("MM",Z,Y),le("MMM",function(e,t){return t.monthsShortRegex(e)}),le("MMMM",function(e,t){return t.monthsRegex(e)}),de(["M","MM"],function(e,t){t[ge]=T(e)-1}),de(["MMM","MMMM"],function(e,t,n,i){var r=n._locale.monthsParse(e,i,n._strict);null!=r?t[ge]=r:d(n).invalidMonth=e});var Pe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,De="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Le="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Oe(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=T(t);else if(!a(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),ke(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Oe(this,e),n.updateOffset(this,!0),this):Ce(this,"Month")}var Ne=ae;var Ie=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,i=[],r=[],o=[];for(t=0;t<12;t++)n=h([2e3,t]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(i.sort(e),r.sort(e),o.sort(e),t=0;t<12;t++)i[t]=ce(i[t]),r[t]=ce(r[t]);for(t=0;t<24;t++)o[t]=ce(o[t]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function ze(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){var i=7+t-n;return-((7+ze(e,0,i).getUTCDay()-t)%7)+i-1}function Ue(e,t,n,i,r){var o,a,s=1+7*(t-1)+(7+n-i)%7+Ve(e,i,r);return s<=0?a=xe(o=e-1)+s:s>xe(e)?(o=e+1,a=s-xe(e)):(o=e,a=s),{year:o,dayOfYear:a}}function je(e,t,n){var i,r,o=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?i=a+We(r=e.year()-1,t,n):a>We(e.year(),t,n)?(i=a-We(e.year(),t,n),r=e.year()+1):(r=e.year(),i=a),{week:i,year:r}}function We(e,t,n){var i=Ve(e,t,n),r=Ve(e+1,t,n);return(xe(e)-i+r)/7}U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),F("week",5),F("isoWeek",5),le("w",Z),le("ww",Z,Y),le("W",Z),le("WW",Z,Y),fe(["w","ww","W","WW"],function(e,t,n,i){t[i.substr(0,1)]=T(e)});U("d",0,"do","day"),U("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),U("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),U("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),le("d",Z),le("e",Z),le("E",Z),le("dd",function(e,t){return t.weekdaysMinRegex(e)}),le("ddd",function(e,t){return t.weekdaysShortRegex(e)}),le("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,i){var r=n._locale.weekdaysParse(e,i,n._strict);null!=r?t.d=r:d(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,i){t[i]=T(e)});var Ge="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ye="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var qe="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var Xe=ae;var $e=ae;var Ze=ae;function Ke(){function e(e,t){return t.length-e.length}var t,n,i,r,o,a=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),i=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),o=this.weekdays(n,""),a.push(i),s.push(r),l.push(o),u.push(i),u.push(r),u.push(o);for(a.sort(e),s.sort(e),l.sort(e),u.sort(e),t=0;t<7;t++)s[t]=ce(s[t]),l[t]=ce(l[t]),u[t]=ce(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Je(e,t){U(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Qe),U("k",["kk",2],0,function(){return this.hours()||24}),U("hmm",0,0,function(){return""+Qe.apply(this)+N(this.minutes(),2)}),U("hmmss",0,0,function(){return""+Qe.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+N(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)}),Je("a",!0),Je("A",!1),P("hour","h"),F("hour",13),le("a",et),le("A",et),le("H",Z),le("h",Z),le("k",Z),le("HH",Z,Y),le("hh",Z,Y),le("kk",Z,Y),le("hmm",K),le("hmmss",Q),le("Hmm",K),le("Hmmss",Q),de(["H","HH"],Ee),de(["k","kk"],function(e,t,n){var i=T(e);t[Ee]=24===i?0:i}),de(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),de(["h","hh"],function(e,t,n){t[Ee]=T(e),d(n).bigHour=!0}),de("hmm",function(e,t,n){var i=e.length-2;t[Ee]=T(e.substr(0,i)),t[ye]=T(e.substr(i)),d(n).bigHour=!0}),de("hmmss",function(e,t,n){var i=e.length-4,r=e.length-2;t[Ee]=T(e.substr(0,i)),t[ye]=T(e.substr(i,2)),t[_e]=T(e.substr(r)),d(n).bigHour=!0}),de("Hmm",function(e,t,n){var i=e.length-2;t[Ee]=T(e.substr(0,i)),t[ye]=T(e.substr(i))}),de("Hmmss",function(e,t,n){var i=e.length-4,r=e.length-2;t[Ee]=T(e.substr(0,i)),t[ye]=T(e.substr(i,2)),t[_e]=T(e.substr(r))});var tt,nt=Me("Hours",!0),it={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:De,monthsShort:Le,week:{dow:0,doy:6},weekdays:Ge,weekdaysMin:qe,weekdaysShort:Ye,meridiemParse:/[ap]\.?m?\.?/i},rt={},ot={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function st(e){var t=null;if(!rt[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=tt._abbr,require("./locale/"+e),lt(t)}catch(e){}return rt[e]}function lt(e,t){var n;return e&&((n=o(t)?ct(e):ut(e,t))?tt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),tt._abbr}function ut(e,t){if(null!==t){var n,i=it;if(t.abbr=e,null!=rt[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=rt[e]._config;else if(null!=t.parentLocale)if(null!=rt[t.parentLocale])i=rt[t.parentLocale]._config;else{if(null==(n=st(t.parentLocale)))return ot[t.parentLocale]||(ot[t.parentLocale]=[]),ot[t.parentLocale].push({name:e,config:t}),null;i=n._config}return rt[e]=new A(C(i,t)),ot[e]&&ot[e].forEach(function(e){ut(e.name,e.config)}),lt(e),rt[e]}return delete rt[e],null}function ct(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return tt;if(!i(e)){if(t=st(e))return t;e=[e]}return function(e){for(var t,n,i,r,o=0;o<e.length;){for(t=(r=at(e[o]).split("-")).length,n=(n=at(e[o+1]))?n.split("-"):null;t>0;){if(i=st(r.slice(0,t).join("-")))return i;if(n&&n.length>=t&&b(r,n,!0)>=t-1)break;t--}o++}return tt}(e)}function ht(e){var t,n=e._a;return n&&-2===d(e).overflow&&(t=n[ge]<0||n[ge]>11?ge:n[ve]<1||n[ve]>ke(n[me],n[ge])?ve:n[Ee]<0||n[Ee]>24||24===n[Ee]&&(0!==n[ye]||0!==n[_e]||0!==n[Te])?Ee:n[ye]<0||n[ye]>59?ye:n[_e]<0||n[_e]>59?_e:n[Te]<0||n[Te]>999?Te:-1,d(e)._overflowDayOfYear&&(t<me||t>ve)&&(t=ve),d(e)._overflowWeeks&&-1===t&&(t=be),d(e)._overflowWeekday&&-1===t&&(t=we),d(e).overflow=t),e}function dt(e,t,n){return null!=e?e:null!=t?t:n}function ft(e){var t,i,r,o,a,s=[];if(!e._d){for(r=function(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[ve]&&null==e._a[ge]&&function(e){var t,n,i,r,o,a,s,l;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)o=1,a=4,n=dt(t.GG,e._a[me],je(Mt(),1,4).year),i=dt(t.W,1),((r=dt(t.E,1))<1||r>7)&&(l=!0);else{o=e._locale._week.dow,a=e._locale._week.doy;var u=je(Mt(),o,a);n=dt(t.gg,e._a[me],u.year),i=dt(t.w,u.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+o,(t.e<0||t.e>6)&&(l=!0)):r=o}i<1||i>We(n,o,a)?d(e)._overflowWeeks=!0:null!=l?d(e)._overflowWeekday=!0:(s=Ue(n,i,r,o,a),e._a[me]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(a=dt(e._a[me],r[me]),(e._dayOfYear>xe(a)||0===e._dayOfYear)&&(d(e)._overflowDayOfYear=!0),i=ze(a,0,e._dayOfYear),e._a[ge]=i.getUTCMonth(),e._a[ve]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Ee]&&0===e._a[ye]&&0===e._a[_e]&&0===e._a[Te]&&(e._nextDay=!0,e._a[Ee]=0),e._d=(e._useUTC?ze:function(e,t,n,i,r,o,a){var s=new Date(e,t,n,i,r,o,a);return e<100&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ee]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(d(e).weekdayMismatch=!0)}}var pt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/Z|[+-]\d\d(?::?\d\d)?/,vt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Et=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],yt=/^\/?Date\((\-?\d+)/i;function _t(e){var t,n,i,r,o,a,s=e._i,l=pt.exec(s)||mt.exec(s);if(l){for(d(e).iso=!0,t=0,n=vt.length;t<n;t++)if(vt[t][1].exec(l[1])){r=vt[t][0],i=!1!==vt[t][2];break}if(null==r)return void(e._isValid=!1);if(l[3]){for(t=0,n=Et.length;t<n;t++)if(Et[t][1].exec(l[3])){o=(l[2]||" ")+Et[t][0];break}if(null==o)return void(e._isValid=!1)}if(!i&&null!=o)return void(e._isValid=!1);if(l[4]){if(!gt.exec(l[4]))return void(e._isValid=!1);a="Z"}e._f=r+(o||"")+(a||""),Rt(e)}else e._isValid=!1}var Tt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function bt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}var wt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function xt(e){var t,n,i,r,o,a,s,l=Tt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim());if(l){var u=(t=l[4],n=l[3],i=l[2],r=l[5],o=l[6],a=l[7],s=[bt(t),Le.indexOf(n),parseInt(i,10),parseInt(r,10),parseInt(o,10)],a&&s.push(parseInt(a,10)),s);if(!function(e,t,n){return!e||Ye.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(d(n).weekdayMismatch=!0,n._isValid=!1,!1)}(l[1],u,e))return;e._a=u,e._tzm=function(e,t,n){if(e)return wt[e];if(t)return 0;var i=parseInt(n,10),r=i%100;return(i-r)/100*60+r}(l[8],l[9],l[10]),e._d=ze.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),d(e).rfc2822=!0}else e._isValid=!1}function Rt(e){if(e._f!==n.ISO_8601)if(e._f!==n.RFC_2822){e._a=[],d(e).empty=!0;var t,i,r,o,a,s=""+e._i,l=s.length,u=0;for(r=W(e._f,e._locale).match(I)||[],t=0;t<r.length;t++)o=r[t],(i=(s.match(ue(o,e))||[])[0])&&((a=s.substr(0,s.indexOf(i))).length>0&&d(e).unusedInput.push(a),s=s.slice(s.indexOf(i)+i.length),u+=i.length),V[o]?(i?d(e).empty=!1:d(e).unusedTokens.push(o),pe(o,i,e)):e._strict&&!i&&d(e).unusedTokens.push(o);d(e).charsLeftOver=l-u,s.length>0&&d(e).unusedInput.push(s),e._a[Ee]<=12&&!0===d(e).bigHour&&e._a[Ee]>0&&(d(e).bigHour=void 0),d(e).parsedDateParts=e._a.slice(0),d(e).meridiem=e._meridiem,e._a[Ee]=function(e,t,n){var i;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}(e._locale,e._a[Ee],e._meridiem),ft(e),ht(e)}else xt(e);else _t(e)}function Ht(e){var t=e._i,u=e._f;return e._locale=e._locale||ct(e._l),null===t||void 0===u&&""===t?p({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),y(t)?new E(ht(t)):(s(t)?e._d=t:i(u)?function(e){var t,n,i,r,o;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<e._f.length;r++)o=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],Rt(t),f(t)&&(o+=d(t).charsLeftOver,o+=10*d(t).unusedTokens.length,d(t).score=o,(null==i||o<i)&&(i=o,n=t));c(e,n||t)}(e):u?Rt(e):function(e){var t=e._i;o(t)?e._d=new Date(n.now()):s(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=yt.exec(e._i);null===t?(_t(e),!1===e._isValid&&(delete e._isValid,xt(e),!1===e._isValid&&(delete e._isValid,n.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):i(t)?(e._a=l(t.slice(0),function(e){return parseInt(e,10)}),ft(e)):r(t)?function(e){if(!e._d){var t=L(e._i);e._a=l([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ft(e)}}(e):a(t)?e._d=new Date(t):n.createFromInputFallback(e)}(e),f(e)||(e._d=null),e))}function St(e,t,n,o,a){var s,l={};return!0!==n&&!1!==n||(o=n,n=void 0),(r(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||i(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=n,l._i=e,l._f=t,l._strict=o,(s=new E(ht(Ht(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Mt(e,t,n,i){return St(e,t,n,i,!1)}n.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),n.ISO_8601=function(){},n.RFC_2822=function(){};var Ct=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Mt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:p()}),At=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Mt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:p()});function kt(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Mt();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var Pt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Dt(e){var t=L(e),n=t.year||0,i=t.quarter||0,r=t.month||0,o=t.week||0,a=t.day||0,s=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===He.call(Pt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,i=0;i<Pt.length;++i)if(e[Pt[i]]){if(n)return!1;parseFloat(e[Pt[i]])!==T(e[Pt[i]])&&(n=!0)}return!0}(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*s*60*60,this._days=+a+7*o,this._months=+r+3*i+12*n,this._data={},this._locale=ct(),this._bubble()}function Lt(e){return e instanceof Dt}function Ot(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,t){U(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+N(~~(e/60),2)+t+N(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),le("Z",oe),le("ZZ",oe),de(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=It(oe,e)});var Nt=/([\+\-]|\d\d)/gi;function It(e,t){var n=(t||"").match(e);if(null===n)return null;var i=((n[n.length-1]||[])+"").match(Nt)||["-",0,0],r=60*i[1]+T(i[2]);return 0===r?0:"+"===i[0]?r:-r}function Bt(e,t){var i,r;return t._isUTC?(i=t.clone(),r=(y(e)||s(e)?e.valueOf():Mt(e).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+r),n.updateOffset(i,!1),i):Mt(e).local()}function zt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Vt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}n.updateOffset=function(){};var Ut=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,jt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Wt(e,t){var n,i,r,o=e,s=null;return Lt(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:a(e)?(o={},t?o[t]=e:o.milliseconds=e):(s=Ut.exec(e))?(n="-"===s[1]?-1:1,o={y:0,d:T(s[ve])*n,h:T(s[Ee])*n,m:T(s[ye])*n,s:T(s[_e])*n,ms:T(Ot(1e3*s[Te]))*n}):(s=jt.exec(e))?(n="-"===s[1]?-1:(s[1],1),o={y:Gt(s[2],n),M:Gt(s[3],n),w:Gt(s[4],n),d:Gt(s[5],n),h:Gt(s[6],n),m:Gt(s[7],n),s:Gt(s[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(r=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Bt(t,e),e.isBefore(t)?n=Yt(e,t):((n=Yt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Mt(o.from),Mt(o.to)),(o={}).ms=r.milliseconds,o.M=r.months),i=new Dt(o),Lt(e)&&u(e,"_locale")&&(i._locale=e._locale),i}function Gt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Yt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function qt(e,t){return function(n,i){var r;return null===i||isNaN(+i)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),Xt(this,Wt(n="string"==typeof n?+n:n,i),e),this}}function Xt(e,t,i,r){var o=t._milliseconds,a=Ot(t._days),s=Ot(t._months);e.isValid()&&(r=null==r||r,s&&Oe(e,Ce(e,"Month")+s*i),a&&Ae(e,"Date",Ce(e,"Date")+a*i),o&&e._d.setTime(e._d.valueOf()+o*i),r&&n.updateOffset(e,a||s))}Wt.fn=Dt.prototype,Wt.invalid=function(){return Wt(NaN)};var $t=qt(1,"add"),Zt=qt(-1,"subtract");function Kt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(n,"months");return-(n+(t-i<0?(t-i)/(i-e.clone().add(n-1,"months")):(t-i)/(e.clone().add(n+1,"months")-i)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ct(e))&&(this._locale=t),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Jt=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function en(){return this._locale}function tn(e,t){U(0,[e,e.length],0,t)}function nn(e,t,n,i,r){var o;return null==e?je(this,i,r).year:(t>(o=We(e,i,r))&&(t=o),function(e,t,n,i,r){var o=Ue(e,t,n,i,r),a=ze(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,i,r))}U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),tn("gggg","weekYear"),tn("ggggg","weekYear"),tn("GGGG","isoWeekYear"),tn("GGGGG","isoWeekYear"),P("weekYear","gg"),P("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),le("G",ie),le("g",ie),le("GG",Z,Y),le("gg",Z,Y),le("GGGG",ee,X),le("gggg",ee,X),le("GGGGG",te,$),le("ggggg",te,$),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,i){t[i.substr(0,2)]=T(e)}),fe(["gg","GG"],function(e,t,i,r){t[r]=n.parseTwoDigitYear(e)}),U("Q",0,"Qo","quarter"),P("quarter","Q"),F("quarter",7),le("Q",G),de("Q",function(e,t){t[ge]=3*(T(e)-1)}),U("D",["DD",2],"Do","date"),P("date","D"),F("date",9),le("D",Z),le("DD",Z,Y),le("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),de(["D","DD"],ve),de("Do",function(e,t){t[ve]=T(e.match(Z)[0])});var rn=Me("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),P("dayOfYear","DDD"),F("dayOfYear",4),le("DDD",J),le("DDDD",q),de(["DDD","DDDD"],function(e,t,n){n._dayOfYear=T(e)}),U("m",["mm",2],0,"minute"),P("minute","m"),F("minute",14),le("m",Z),le("mm",Z,Y),de(["m","mm"],ye);var on=Me("Minutes",!1);U("s",["ss",2],0,"second"),P("second","s"),F("second",15),le("s",Z),le("ss",Z,Y),de(["s","ss"],_e);var an,sn=Me("Seconds",!1);for(U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),P("millisecond","ms"),F("millisecond",16),le("S",J,G),le("SS",J,Y),le("SSS",J,q),an="SSSS";an.length<=9;an+="S")le(an,ne);function ln(e,t){t[Te]=T(1e3*("0."+e))}for(an="S";an.length<=9;an+="S")de(an,ln);var un=Me("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var cn=E.prototype;function hn(e){return e}cn.add=$t,cn.calendar=function(e,t){var i=e||Mt(),r=Bt(i,this).startOf("day"),o=n.calendarFormat(this,r)||"sameElse",a=t&&(M(t[o])?t[o].call(this,i):t[o]);return this.format(a||this.localeData().calendar(o,this,Mt(i)))},cn.clone=function(){return new E(this)},cn.diff=function(e,t,n){var i,r,o;if(!this.isValid())return NaN;if(!(i=Bt(e,this)).isValid())return NaN;switch(r=6e4*(i.utcOffset()-this.utcOffset()),t=D(t)){case"year":o=Kt(this,i)/12;break;case"month":o=Kt(this,i);break;case"quarter":o=Kt(this,i)/3;break;case"second":o=(this-i)/1e3;break;case"minute":o=(this-i)/6e4;break;case"hour":o=(this-i)/36e5;break;case"day":o=(this-i-r)/864e5;break;case"week":o=(this-i-r)/6048e5;break;default:o=this-i}return n?o:_(o)},cn.endOf=function(e){return void 0===(e=D(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},cn.format=function(e){e||(e=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var t=j(this,e);return this.localeData().postformat(t)},cn.from=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||Mt(e).isValid())?Wt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},cn.fromNow=function(e){return this.from(Mt(),e)},cn.to=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||Mt(e).isValid())?Wt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},cn.toNow=function(e){return this.to(Mt(),e)},cn.get=function(e){return M(this[e=D(e)])?this[e]():this},cn.invalidAt=function(){return d(this).overflow},cn.isAfter=function(e,t){var n=y(e)?e:Mt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=D(o(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},cn.isBefore=function(e,t){var n=y(e)?e:Mt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=D(o(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},cn.isBetween=function(e,t,n,i){return("("===(i=i||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===i[1]?this.isBefore(t,n):!this.isAfter(t,n))},cn.isSame=function(e,t){var n,i=y(e)?e:Mt(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=D(t||"millisecond"))?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},cn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},cn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},cn.isValid=function(){return f(this)},cn.lang=Jt,cn.locale=Qt,cn.localeData=en,cn.max=At,cn.min=Ct,cn.parsingFlags=function(){return c({},d(this))},cn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:O[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=L(e)),i=0;i<n.length;i++)this[n[i].unit](e[n[i].unit]);else if(M(this[e=D(e)]))return this[e](t);return this},cn.startOf=function(e){switch(e=D(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},cn.subtract=Zt,cn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},cn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},cn.toDate=function(){return new Date(this.valueOf())},cn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?j(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):M(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",j(n,"Z")):j(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},cn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r=t+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+r)},cn.toJSON=function(){return this.isValid()?this.toISOString():null},cn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},cn.unix=function(){return Math.floor(this.valueOf()/1e3)},cn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},cn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},cn.year=Se,cn.isLeapYear=function(){return Re(this.year())},cn.weekYear=function(e){return nn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},cn.isoWeekYear=function(e){return nn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},cn.quarter=cn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},cn.month=Fe,cn.daysInMonth=function(){return ke(this.year(),this.month())},cn.week=cn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},cn.isoWeek=cn.isoWeeks=function(e){var t=je(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},cn.weeksInYear=function(){var e=this.localeData()._week;return We(this.year(),e.dow,e.doy)},cn.isoWeeksInYear=function(){return We(this.year(),1,4)},cn.date=rn,cn.day=cn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},cn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},cn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},cn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},cn.hour=cn.hours=nt,cn.minute=cn.minutes=on,cn.second=cn.seconds=sn,cn.millisecond=cn.milliseconds=un,cn.utcOffset=function(e,t,i){var r,o=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=It(oe,e)))return this}else Math.abs(e)<16&&!i&&(e*=60);return!this._isUTC&&t&&(r=zt(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),o!==e&&(!t||this._changeInProgress?Xt(this,Wt(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:zt(this)},cn.utc=function(e){return this.utcOffset(0,e)},cn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(zt(this),"m")),this},cn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=It(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},cn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Mt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},cn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},cn.isLocal=function(){return!!this.isValid()&&!this._isUTC},cn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},cn.isUtc=Vt,cn.isUTC=Vt,cn.zoneAbbr=function(){return this._isUTC?"UTC":""},cn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},cn.dates=x("dates accessor is deprecated. Use date instead.",rn),cn.months=x("months accessor is deprecated. Use month instead",Fe),cn.years=x("years accessor is deprecated. Use year instead",Se),cn.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),cn.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),(e=Ht(e))._a){var t=e._isUTC?h(e._a):Mt(e._a);this._isDSTShifted=this.isValid()&&b(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var dn=A.prototype;function fn(e,t,n,i){var r=ct(),o=h().set(i,t);return r[n](o,e)}function pn(e,t,n){if(a(e)&&(t=e,e=void 0),e=e||"",null!=t)return fn(e,t,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=fn(e,i,n,"month");return r}function mn(e,t,n,i){"boolean"==typeof e?(a(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,a(t)&&(n=t,t=void 0),t=t||"");var r,o=ct(),s=e?o._week.dow:0;if(null!=n)return fn(t,(n+s)%7,i,"day");var l=[];for(r=0;r<7;r++)l[r]=fn(t,(r+s)%7,i,"day");return l}dn.calendar=function(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return M(i)?i.call(t,n):i},dn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},dn.invalidDate=function(){return this._invalidDate},dn.ordinal=function(e){return this._ordinal.replace("%d",e)},dn.preparse=hn,dn.postformat=hn,dn.relativeTime=function(e,t,n,i){var r=this._relativeTime[n];return M(r)?r(e,t,n,i):r.replace(/%d/i,e)},dn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return M(n)?n(t):n.replace(/%s/i,t)},dn.set=function(e){var t,n;for(n in e)M(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},dn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pe).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},dn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pe.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},dn.monthsParse=function(e,t,n){var i,r,o;if(this._monthsParseExact)return function(e,t,n){var i,r,o,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)o=h([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(r=He.call(this._shortMonthsParse,a))?r:null:-1!==(r=He.call(this._longMonthsParse,a))?r:null:"MMM"===t?-1!==(r=He.call(this._shortMonthsParse,a))?r:-1!==(r=He.call(this._longMonthsParse,a))?r:null:-1!==(r=He.call(this._longMonthsParse,a))?r:-1!==(r=He.call(this._shortMonthsParse,a))?r:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=h([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}},dn.monthsRegex=function(e){return this._monthsParseExact?(u(this,"_monthsRegex")||Be.call(this),e?this._monthsStrictRegex:this._monthsRegex):(u(this,"_monthsRegex")||(this._monthsRegex=Ie),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},dn.monthsShortRegex=function(e){return this._monthsParseExact?(u(this,"_monthsRegex")||Be.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(u(this,"_monthsShortRegex")||(this._monthsShortRegex=Ne),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},dn.week=function(e){return je(e,this._week.dow,this._week.doy).week},dn.firstDayOfYear=function(){return this._week.doy},dn.firstDayOfWeek=function(){return this._week.dow},dn.weekdays=function(e,t){return e?i(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:i(this._weekdays)?this._weekdays:this._weekdays.standalone},dn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},dn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},dn.weekdaysParse=function(e,t,n){var i,r,o;if(this._weekdaysParseExact)return function(e,t,n){var i,r,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)o=h([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=He.call(this._weekdaysParse,a))?r:null:"ddd"===t?-1!==(r=He.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=He.call(this._minWeekdaysParse,a))?r:null:"dddd"===t?-1!==(r=He.call(this._weekdaysParse,a))?r:-1!==(r=He.call(this._shortWeekdaysParse,a))?r:-1!==(r=He.call(this._minWeekdaysParse,a))?r:null:"ddd"===t?-1!==(r=He.call(this._shortWeekdaysParse,a))?r:-1!==(r=He.call(this._weekdaysParse,a))?r:-1!==(r=He.call(this._minWeekdaysParse,a))?r:null:-1!==(r=He.call(this._minWeekdaysParse,a))?r:-1!==(r=He.call(this._weekdaysParse,a))?r:-1!==(r=He.call(this._shortWeekdaysParse,a))?r:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=h([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}},dn.weekdaysRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Ke.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Xe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},dn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Ke.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=$e),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},dn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Ke.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ze),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},dn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},dn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},lt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===T(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),n.lang=x("moment.lang is deprecated. Use moment.locale instead.",lt),n.langData=x("moment.langData is deprecated. Use moment.localeData instead.",ct);var gn=Math.abs;function vn(e,t,n,i){var r=Wt(t,n);return e._milliseconds+=i*r._milliseconds,e._days+=i*r._days,e._months+=i*r._months,e._bubble()}function En(e){return e<0?Math.floor(e):Math.ceil(e)}function yn(e){return 4800*e/146097}function _n(e){return 146097*e/4800}function Tn(e){return function(){return this.as(e)}}var bn=Tn("ms"),wn=Tn("s"),xn=Tn("m"),Rn=Tn("h"),Hn=Tn("d"),Sn=Tn("w"),Mn=Tn("M"),Cn=Tn("y");function An(e){return function(){return this.isValid()?this._data[e]:NaN}}var kn=An("milliseconds"),Pn=An("seconds"),Dn=An("minutes"),Ln=An("hours"),On=An("days"),Fn=An("months"),Nn=An("years");var In=Math.round,Bn={ss:44,s:45,m:45,h:22,d:26,M:11};var zn=Math.abs;function Vn(e){return(e>0)-(e<0)||+e}function Un(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=zn(this._milliseconds)/1e3,i=zn(this._days),r=zn(this._months);e=_(n/60),t=_(e/60),n%=60,e%=60;var o=_(r/12),a=r%=12,s=i,l=t,u=e,c=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var d=h<0?"-":"",f=Vn(this._months)!==Vn(h)?"-":"",p=Vn(this._days)!==Vn(h)?"-":"",m=Vn(this._milliseconds)!==Vn(h)?"-":"";return d+"P"+(o?f+o+"Y":"")+(a?f+a+"M":"")+(s?p+s+"D":"")+(l||u||c?"T":"")+(l?m+l+"H":"")+(u?m+u+"M":"")+(c?m+c+"S":"")}var jn=Dt.prototype;return jn.isValid=function(){return this._isValid},jn.abs=function(){var e=this._data;return this._milliseconds=gn(this._milliseconds),this._days=gn(this._days),this._months=gn(this._months),e.milliseconds=gn(e.milliseconds),e.seconds=gn(e.seconds),e.minutes=gn(e.minutes),e.hours=gn(e.hours),e.months=gn(e.months),e.years=gn(e.years),this},jn.add=function(e,t){return vn(this,e,t,1)},jn.subtract=function(e,t){return vn(this,e,t,-1)},jn.as=function(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if("month"===(e=D(e))||"year"===e)return t=this._days+i/864e5,n=this._months+yn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(_n(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}},jn.asMilliseconds=bn,jn.asSeconds=wn,jn.asMinutes=xn,jn.asHours=Rn,jn.asDays=Hn,jn.asWeeks=Sn,jn.asMonths=Mn,jn.asYears=Cn,jn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*T(this._months/12):NaN},jn._bubble=function(){var e,t,n,i,r,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*En(_n(s)+a),a=0,s=0),l.milliseconds=o%1e3,e=_(o/1e3),l.seconds=e%60,t=_(e/60),l.minutes=t%60,n=_(t/60),l.hours=n%24,a+=_(n/24),s+=r=_(yn(a)),a-=En(_n(r)),i=_(s/12),s%=12,l.days=a,l.months=s,l.years=i,this},jn.clone=function(){return Wt(this)},jn.get=function(e){return e=D(e),this.isValid()?this[e+"s"]():NaN},jn.milliseconds=kn,jn.seconds=Pn,jn.minutes=Dn,jn.hours=Ln,jn.days=On,jn.weeks=function(){return _(this.days()/7)},jn.months=Fn,jn.years=Nn,jn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var i=Wt(e).abs(),r=In(i.as("s")),o=In(i.as("m")),a=In(i.as("h")),s=In(i.as("d")),l=In(i.as("M")),u=In(i.as("y")),c=r<=Bn.ss&&["s",r]||r<Bn.s&&["ss",r]||o<=1&&["m"]||o<Bn.m&&["mm",o]||a<=1&&["h"]||a<Bn.h&&["hh",a]||s<=1&&["d"]||s<Bn.d&&["dd",s]||l<=1&&["M"]||l<Bn.M&&["MM",l]||u<=1&&["y"]||["yy",u];return c[2]=t,c[3]=+e>0,c[4]=n,function(e,t,n,i,r){return r.relativeTime(t||1,!!n,e,i)}.apply(null,c)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},jn.toISOString=Un,jn.toString=Un,jn.toJSON=Un,jn.locale=Qt,jn.localeData=en,jn.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Un),jn.lang=Jt,U("X",0,0,"unix"),U("x",0,0,"valueOf"),le("x",ie),le("X",/[+-]?\d+(\.\d{1,3})?/),de("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),de("x",function(e,t,n){n._d=new Date(T(e))}),n.version="2.22.1",e=Mt,n.fn=cn,n.min=function(){return kt("isBefore",[].slice.call(arguments,0))},n.max=function(){return kt("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=h,n.unix=function(e){return Mt(1e3*e)},n.months=function(e,t){return pn(e,t,"months")},n.isDate=s,n.locale=lt,n.invalid=p,n.duration=Wt,n.isMoment=y,n.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},n.parseZone=function(){return Mt.apply(null,arguments).parseZone()},n.localeData=ct,n.isDuration=Lt,n.monthsShort=function(e,t){return pn(e,t,"monthsShort")},n.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},n.defineLocale=ut,n.updateLocale=function(e,t){if(null!=t){var n,i,r=it;null!=(i=st(e))&&(r=i._config),(n=new A(t=C(r,t))).parentLocale=rt[e],rt[e]=n,lt(e)}else null!=rt[e]&&(null!=rt[e].parentLocale?rt[e]=rt[e].parentLocale:null!=rt[e]&&delete rt[e]);return rt[e]},n.locales=function(){return R(rt)},n.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},n.normalizeUnits=D,n.relativeTimeRounding=function(e){return void 0===e?In:"function"==typeof e&&(In=e,!0)},n.relativeTimeThreshold=function(e,t){return void 0!==Bn[e]&&(void 0===t?Bn[e]:(Bn[e]=t,"s"===e&&(Bn.ss=t-1),!0))},n.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},n.prototype=cn,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},n}),function(){var e,t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",r="__lodash_hash_undefined__",o=500,a="__lodash_placeholder__",s=1,l=2,u=4,c=1,h=2,d=1,f=2,p=4,m=8,g=16,v=32,E=64,y=128,_=256,T=512,b=30,w="...",x=800,R=16,H=1,S=2,M=1/0,C=9007199254740991,A=1.7976931348623157e308,k=NaN,P=4294967295,D=P-1,L=P>>>1,O=[["ary",y],["bind",d],["bindKey",f],["curry",m],["curryRight",g],["flip",T],["partial",v],["partialRight",E],["rearg",_]],F="[object Arguments]",N="[object Array]",I="[object AsyncFunction]",B="[object Boolean]",z="[object Date]",V="[object DOMException]",U="[object Error]",j="[object Function]",W="[object GeneratorFunction]",G="[object Map]",Y="[object Number]",q="[object Null]",X="[object Object]",$="[object Proxy]",Z="[object RegExp]",K="[object Set]",Q="[object String]",J="[object Symbol]",ee="[object Undefined]",te="[object WeakMap]",ne="[object WeakSet]",ie="[object ArrayBuffer]",re="[object DataView]",oe="[object Float32Array]",ae="[object Float64Array]",se="[object Int8Array]",le="[object Int16Array]",ue="[object Int32Array]",ce="[object Uint8Array]",he="[object Uint8ClampedArray]",de="[object Uint16Array]",fe="[object Uint32Array]",pe=/\b__p \+= '';/g,me=/\b(__p \+=) '' \+/g,ge=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ve=/&(?:amp|lt|gt|quot|#39);/g,Ee=/[&<>"']/g,ye=RegExp(ve.source),_e=RegExp(Ee.source),Te=/<%-([\s\S]+?)%>/g,be=/<%([\s\S]+?)%>/g,we=/<%=([\s\S]+?)%>/g,xe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Re=/^\w*$/,He=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Se=/[\\^$.*+?()[\]{}|]/g,Me=RegExp(Se.source),Ce=/^\s+|\s+$/g,Ae=/^\s+/,ke=/\s+$/,Pe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,De=/\{\n\/\* \[wrapped with (.+)\] \*/,Le=/,? & /,Oe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Fe=/\\(\\)?/g,Ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ie=/\w*$/,Be=/^[-+]0x[0-9a-f]+$/i,ze=/^0b[01]+$/i,Ve=/^\[object .+?Constructor\]$/,Ue=/^0o[0-7]+$/i,je=/^(?:0|[1-9]\d*)$/,We=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ge=/($^)/,Ye=/['\n\r\u2028\u2029\\]/g,qe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$e="[\\ud800-\\udfff]",Ze="["+Xe+"]",Ke="["+qe+"]",Qe="\\d+",Je="[\\u2700-\\u27bf]",et="[a-z\\xdf-\\xf6\\xf8-\\xff]",tt="[^\\ud800-\\udfff"+Xe+Qe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",nt="\\ud83c[\\udffb-\\udfff]",it="[^\\ud800-\\udfff]",rt="(?:\\ud83c[\\udde6-\\uddff]){2}",ot="[\\ud800-\\udbff][\\udc00-\\udfff]",at="[A-Z\\xc0-\\xd6\\xd8-\\xde]",st="(?:"+et+"|"+tt+")",lt="(?:"+at+"|"+tt+")",ut="(?:"+Ke+"|"+nt+")"+"?",ct="[\\ufe0e\\ufe0f]?"+ut+("(?:\\u200d(?:"+[it,rt,ot].join("|")+")[\\ufe0e\\ufe0f]?"+ut+")*"),ht="(?:"+[Je,rt,ot].join("|")+")"+ct,dt="(?:"+[it+Ke+"?",Ke,rt,ot,$e].join("|")+")",ft=RegExp("['’]","g"),pt=RegExp(Ke,"g"),mt=RegExp(nt+"(?="+nt+")|"+dt+ct,"g"),gt=RegExp([at+"?"+et+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[Ze,at,"$"].join("|")+")",lt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[Ze,at+st,"$"].join("|")+")",at+"?"+st+"+(?:['’](?:d|ll|m|re|s|t|ve))?",at+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Qe,ht].join("|"),"g"),vt=RegExp("[\\u200d\\ud800-\\udfff"+qe+"\\ufe0e\\ufe0f]"),Et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,yt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],_t=-1,Tt={};Tt[oe]=Tt[ae]=Tt[se]=Tt[le]=Tt[ue]=Tt[ce]=Tt[he]=Tt[de]=Tt[fe]=!0,Tt[F]=Tt[N]=Tt[ie]=Tt[B]=Tt[re]=Tt[z]=Tt[U]=Tt[j]=Tt[G]=Tt[Y]=Tt[X]=Tt[Z]=Tt[K]=Tt[Q]=Tt[te]=!1;var bt={};bt[F]=bt[N]=bt[ie]=bt[re]=bt[B]=bt[z]=bt[oe]=bt[ae]=bt[se]=bt[le]=bt[ue]=bt[G]=bt[Y]=bt[X]=bt[Z]=bt[K]=bt[Q]=bt[J]=bt[ce]=bt[he]=bt[de]=bt[fe]=!0,bt[U]=bt[j]=bt[te]=!1;var wt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xt=parseFloat,Rt=parseInt,Ht="object"==typeof global&&global&&global.Object===Object&&global,St="object"==typeof self&&self&&self.Object===Object&&self,Mt=Ht||St||Function("return this")(),Ct="object"==typeof exports&&exports&&!exports.nodeType&&exports,At=Ct&&"object"==typeof module&&module&&!module.nodeType&&module,kt=At&&At.exports===Ct,Pt=kt&&Ht.process,Dt=function(){try{var e=At&&At.require&&At.require("util").types;return e||Pt&&Pt.binding&&Pt.binding("util")}catch(e){}}(),Lt=Dt&&Dt.isArrayBuffer,Ot=Dt&&Dt.isDate,Ft=Dt&&Dt.isMap,Nt=Dt&&Dt.isRegExp,It=Dt&&Dt.isSet,Bt=Dt&&Dt.isTypedArray;function zt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Vt(e,t,n,i){for(var r=-1,o=null==e?0:e.length;++r<o;){var a=e[r];t(i,a,n(a),e)}return i}function Ut(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}function jt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Wt(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(!t(e[n],n,e))return!1;return!0}function Gt(e,t){for(var n=-1,i=null==e?0:e.length,r=0,o=[];++n<i;){var a=e[n];t(a,n,e)&&(o[r++]=a)}return o}function Yt(e,t){return!!(null==e?0:e.length)&&nn(e,t,0)>-1}function qt(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}function Xt(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}function $t(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}function Zt(e,t,n,i){var r=-1,o=null==e?0:e.length;for(i&&o&&(n=e[++r]);++r<o;)n=t(n,e[r],r,e);return n}function Kt(e,t,n,i){var r=null==e?0:e.length;for(i&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,e);return n}function Qt(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}var Jt=sn("length");function en(e,t,n){var i;return n(e,function(e,n,r){if(t(e,n,r))return i=n,!1}),i}function tn(e,t,n,i){for(var r=e.length,o=n+(i?1:-1);i?o--:++o<r;)if(t(e[o],o,e))return o;return-1}function nn(e,t,n){return t==t?function(e,t,n){var i=n-1,r=e.length;for(;++i<r;)if(e[i]===t)return i;return-1}(e,t,n):tn(e,on,n)}function rn(e,t,n,i){for(var r=n-1,o=e.length;++r<o;)if(i(e[r],t))return r;return-1}function on(e){return e!=e}function an(e,t){var n=null==e?0:e.length;return n?cn(e,t)/n:k}function sn(t){return function(n){return null==n?e:n[t]}}function ln(t){return function(n){return null==t?e:t[n]}}function un(e,t,n,i,r){return r(e,function(e,r,o){n=i?(i=!1,e):t(n,e,r,o)}),n}function cn(t,n){for(var i,r=-1,o=t.length;++r<o;){var a=n(t[r]);a!==e&&(i=i===e?a:i+a)}return i}function hn(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function dn(e){return function(t){return e(t)}}function fn(e,t){return Xt(t,function(t){return e[t]})}function pn(e,t){return e.has(t)}function mn(e,t){for(var n=-1,i=e.length;++n<i&&nn(t,e[n],0)>-1;);return n}function gn(e,t){for(var n=e.length;n--&&nn(t,e[n],0)>-1;);return n}var vn=ln({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","Ĳ":"IJ","ĳ":"ij","Œ":"Oe","œ":"oe","ŉ":"'n","ſ":"s"}),En=ln({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function yn(e){return"\\"+wt[e]}function _n(e){return vt.test(e)}function Tn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function bn(e,t){return function(n){return e(t(n))}}function wn(e,t){for(var n=-1,i=e.length,r=0,o=[];++n<i;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[r++]=n)}return o}function xn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Rn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Hn(e){return _n(e)?function(e){var t=mt.lastIndex=0;for(;mt.test(e);)++t;return t}(e):Jt(e)}function Sn(e){return _n(e)?function(e){return e.match(mt)||[]}(e):function(e){return e.split("")}(e)}var Mn=ln({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Cn=function qe(Xe){var $e,Ze=(Xe=null==Xe?Mt:Cn.defaults(Mt.Object(),Xe,Cn.pick(Mt,yt))).Array,Ke=Xe.Date,Qe=Xe.Error,Je=Xe.Function,et=Xe.Math,tt=Xe.Object,nt=Xe.RegExp,it=Xe.String,rt=Xe.TypeError,ot=Ze.prototype,at=Je.prototype,st=tt.prototype,lt=Xe["__core-js_shared__"],ut=at.toString,ct=st.hasOwnProperty,ht=0,dt=($e=/[^.]+$/.exec(lt&&lt.keys&&lt.keys.IE_PROTO||""))?"Symbol(src)_1."+$e:"",mt=st.toString,vt=ut.call(tt),wt=Mt._,Ht=nt("^"+ut.call(ct).replace(Se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),St=kt?Xe.Buffer:e,Ct=Xe.Symbol,At=Xe.Uint8Array,Pt=St?St.allocUnsafe:e,Dt=bn(tt.getPrototypeOf,tt),Jt=tt.create,ln=st.propertyIsEnumerable,An=ot.splice,kn=Ct?Ct.isConcatSpreadable:e,Pn=Ct?Ct.iterator:e,Dn=Ct?Ct.toStringTag:e,Ln=function(){try{var e=Bo(tt,"defineProperty");return e({},"",{}),e}catch(e){}}(),On=Xe.clearTimeout!==Mt.clearTimeout&&Xe.clearTimeout,Fn=Ke&&Ke.now!==Mt.Date.now&&Ke.now,Nn=Xe.setTimeout!==Mt.setTimeout&&Xe.setTimeout,In=et.ceil,Bn=et.floor,zn=tt.getOwnPropertySymbols,Vn=St?St.isBuffer:e,Un=Xe.isFinite,jn=ot.join,Wn=bn(tt.keys,tt),Gn=et.max,Yn=et.min,qn=Ke.now,Xn=Xe.parseInt,$n=et.random,Zn=ot.reverse,Kn=Bo(Xe,"DataView"),Qn=Bo(Xe,"Map"),Jn=Bo(Xe,"Promise"),ei=Bo(Xe,"Set"),ti=Bo(Xe,"WeakMap"),ni=Bo(tt,"create"),ii=ti&&new ti,ri={},oi=ha(Kn),ai=ha(Qn),si=ha(Jn),li=ha(ei),ui=ha(ti),ci=Ct?Ct.prototype:e,hi=ci?ci.valueOf:e,di=ci?ci.toString:e;function fi(e){if(Ms(e)&&!vs(e)&&!(e instanceof vi)){if(e instanceof gi)return e;if(ct.call(e,"__wrapped__"))return da(e)}return new gi(e)}var pi=function(){function t(){}return function(n){if(!Ss(n))return{};if(Jt)return Jt(n);t.prototype=n;var i=new t;return t.prototype=e,i}}();function mi(){}function gi(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=e}function vi(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=P,this.__views__=[]}function Ei(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function yi(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function _i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ti(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new _i;++t<n;)this.add(e[t])}function bi(e){var t=this.__data__=new yi(e);this.size=t.size}function wi(e,t){var n=vs(e),i=!n&&gs(e),r=!n&&!i&&Ts(e),o=!n&&!i&&!r&&Fs(e),a=n||i||r||o,s=a?hn(e.length,it):[],l=s.length;for(var u in e)!t&&!ct.call(e,u)||a&&("length"==u||r&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Yo(u,l))||s.push(u);return s}function xi(t){var n=t.length;return n?t[Tr(0,n-1)]:e}function Ri(e,t){return la(no(e),Li(t,0,e.length))}function Hi(e){return la(no(e))}function Si(t,n,i){(i===e||fs(t[n],i))&&(i!==e||n in t)||Pi(t,n,i)}function Mi(t,n,i){var r=t[n];ct.call(t,n)&&fs(r,i)&&(i!==e||n in t)||Pi(t,n,i)}function Ci(e,t){for(var n=e.length;n--;)if(fs(e[n][0],t))return n;return-1}function Ai(e,t,n,i){return Bi(e,function(e,r,o){t(i,e,n(e),o)}),i}function ki(e,t){return e&&io(t,rl(t),e)}function Pi(e,t,n){"__proto__"==t&&Ln?Ln(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Di(t,n){for(var i=-1,r=n.length,o=Ze(r),a=null==t;++i<r;)o[i]=a?e:Js(t,n[i]);return o}function Li(t,n,i){return t==t&&(i!==e&&(t=t<=i?t:i),n!==e&&(t=t>=n?t:n)),t}function Oi(t,n,i,r,o,a){var c,h=n&s,d=n&l,f=n&u;if(i&&(c=o?i(t,r,o,a):i(t)),c!==e)return c;if(!Ss(t))return t;var p=vs(t);if(p){if(c=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ct.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!h)return no(t,c)}else{var m=Uo(t),g=m==j||m==W;if(Ts(t))return Zr(t,h);if(m==X||m==F||g&&!o){if(c=d||g?{}:Wo(t),!h)return d?function(e,t){return io(e,Vo(e),t)}(t,function(e,t){return e&&io(t,ol(t),e)}(c,t)):function(e,t){return io(e,zo(e),t)}(t,ki(c,t))}else{if(!bt[m])return o?t:{};c=function(e,t,n){var i,r,o,a=e.constructor;switch(t){case ie:return Kr(e);case B:case z:return new a(+e);case re:return function(e,t){var n=t?Kr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case oe:case ae:case se:case le:case ue:case ce:case he:case de:case fe:return Qr(e,n);case G:return new a;case Y:case Q:return new a(e);case Z:return(o=new(r=e).constructor(r.source,Ie.exec(r))).lastIndex=r.lastIndex,o;case K:return new a;case J:return i=e,hi?tt(hi.call(i)):{}}}(t,m,h)}}a||(a=new bi);var v=a.get(t);if(v)return v;a.set(t,c),Ds(t)?t.forEach(function(e){c.add(Oi(e,n,i,e,t,a))}):Cs(t)&&t.forEach(function(e,r){c.set(r,Oi(e,n,i,r,t,a))});var E=p?e:(f?d?Po:ko:d?ol:rl)(t);return Ut(E||t,function(e,r){E&&(e=t[r=e]),Mi(c,r,Oi(e,n,i,r,t,a))}),c}function Fi(t,n,i){var r=i.length;if(null==t)return!r;for(t=tt(t);r--;){var o=i[r],a=n[o],s=t[o];if(s===e&&!(o in t)||!a(s))return!1}return!0}function Ni(t,n,r){if("function"!=typeof t)throw new rt(i);return ra(function(){t.apply(e,r)},n)}function Ii(e,n,i,r){var o=-1,a=Yt,s=!0,l=e.length,u=[],c=n.length;if(!l)return u;i&&(n=Xt(n,dn(i))),r?(a=qt,s=!1):n.length>=t&&(a=pn,s=!1,n=new Ti(n));e:for(;++o<l;){var h=e[o],d=null==i?h:i(h);if(h=r||0!==h?h:0,s&&d==d){for(var f=c;f--;)if(n[f]===d)continue e;u.push(h)}else a(n,d,r)||u.push(h)}return u}fi.templateSettings={escape:Te,evaluate:be,interpolate:we,variable:"",imports:{_:fi}},fi.prototype=mi.prototype,fi.prototype.constructor=fi,gi.prototype=pi(mi.prototype),gi.prototype.constructor=gi,vi.prototype=pi(mi.prototype),vi.prototype.constructor=vi,Ei.prototype.clear=function(){this.__data__=ni?ni(null):{},this.size=0},Ei.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ei.prototype.get=function(t){var n=this.__data__;if(ni){var i=n[t];return i===r?e:i}return ct.call(n,t)?n[t]:e},Ei.prototype.has=function(t){var n=this.__data__;return ni?n[t]!==e:ct.call(n,t)},Ei.prototype.set=function(t,n){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=ni&&n===e?r:n,this},yi.prototype.clear=function(){this.__data__=[],this.size=0},yi.prototype.delete=function(e){var t=this.__data__,n=Ci(t,e);return!(n<0||(n==t.length-1?t.pop():An.call(t,n,1),--this.size,0))},yi.prototype.get=function(t){var n=this.__data__,i=Ci(n,t);return i<0?e:n[i][1]},yi.prototype.has=function(e){return Ci(this.__data__,e)>-1},yi.prototype.set=function(e,t){var n=this.__data__,i=Ci(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},_i.prototype.clear=function(){this.size=0,this.__data__={hash:new Ei,map:new(Qn||yi),string:new Ei}},_i.prototype.delete=function(e){var t=No(this,e).delete(e);return this.size-=t?1:0,t},_i.prototype.get=function(e){return No(this,e).get(e)},_i.prototype.has=function(e){return No(this,e).has(e)},_i.prototype.set=function(e,t){var n=No(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},Ti.prototype.add=Ti.prototype.push=function(e){return this.__data__.set(e,r),this},Ti.prototype.has=function(e){return this.__data__.has(e)},bi.prototype.clear=function(){this.__data__=new yi,this.size=0},bi.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},bi.prototype.get=function(e){return this.__data__.get(e)},bi.prototype.has=function(e){return this.__data__.has(e)},bi.prototype.set=function(e,n){var i=this.__data__;if(i instanceof yi){var r=i.__data__;if(!Qn||r.length<t-1)return r.push([e,n]),this.size=++i.size,this;i=this.__data__=new _i(r)}return i.set(e,n),this.size=i.size,this};var Bi=ao(qi),zi=ao(Xi,!0);function Vi(e,t){var n=!0;return Bi(e,function(e,i,r){return n=!!t(e,i,r)}),n}function Ui(t,n,i){for(var r=-1,o=t.length;++r<o;){var a=t[r],s=n(a);if(null!=s&&(l===e?s==s&&!Os(s):i(s,l)))var l=s,u=a}return u}function ji(e,t){var n=[];return Bi(e,function(e,i,r){t(e,i,r)&&n.push(e)}),n}function Wi(e,t,n,i,r){var o=-1,a=e.length;for(n||(n=Go),r||(r=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?Wi(s,t-1,n,i,r):$t(r,s):i||(r[r.length]=s)}return r}var Gi=so(),Yi=so(!0);function qi(e,t){return e&&Gi(e,t,rl)}function Xi(e,t){return e&&Yi(e,t,rl)}function $i(e,t){return Gt(t,function(t){return xs(e[t])})}function Zi(t,n){for(var i=0,r=(n=Yr(n,t)).length;null!=t&&i<r;)t=t[ca(n[i++])];return i&&i==r?t:e}function Ki(e,t,n){var i=t(e);return vs(e)?i:$t(i,n(e))}function Qi(t){return null==t?t===e?ee:q:Dn&&Dn in tt(t)?function(t){var n=ct.call(t,Dn),i=t[Dn];try{t[Dn]=e;var r=!0}catch(e){}var o=mt.call(t);return r&&(n?t[Dn]=i:delete t[Dn]),o}(t):function(e){return mt.call(e)}(t)}function Ji(e,t){return e>t}function er(e,t){return null!=e&&ct.call(e,t)}function tr(e,t){return null!=e&&t in tt(e)}function nr(t,n,i){for(var r=i?qt:Yt,o=t[0].length,a=t.length,s=a,l=Ze(a),u=1/0,c=[];s--;){var h=t[s];s&&n&&(h=Xt(h,dn(n))),u=Yn(h.length,u),l[s]=!i&&(n||o>=120&&h.length>=120)?new Ti(s&&h):e}h=t[0];var d=-1,f=l[0];e:for(;++d<o&&c.length<u;){var p=h[d],m=n?n(p):p;if(p=i||0!==p?p:0,!(f?pn(f,m):r(c,m,i))){for(s=a;--s;){var g=l[s];if(!(g?pn(g,m):r(t[s],m,i)))continue e}f&&f.push(m),c.push(p)}}return c}function ir(t,n,i){var r=null==(t=ta(t,n=Yr(n,t)))?t:t[ca(wa(n))];return null==r?e:zt(r,t,i)}function rr(e){return Ms(e)&&Qi(e)==F}function or(t,n,i,r,o){return t===n||(null==t||null==n||!Ms(t)&&!Ms(n)?t!=t&&n!=n:function(t,n,i,r,o,a){var s=vs(t),l=vs(n),u=s?N:Uo(t),d=l?N:Uo(n),f=(u=u==F?X:u)==X,p=(d=d==F?X:d)==X,m=u==d;if(m&&Ts(t)){if(!Ts(n))return!1;s=!0,f=!1}if(m&&!f)return a||(a=new bi),s||Fs(t)?Co(t,n,i,r,o,a):function(e,t,n,i,r,o,a){switch(n){case re:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ie:return!(e.byteLength!=t.byteLength||!o(new At(e),new At(t)));case B:case z:case Y:return fs(+e,+t);case U:return e.name==t.name&&e.message==t.message;case Z:case Q:return e==t+"";case G:var s=Tn;case K:var l=i&c;if(s||(s=xn),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;i|=h,a.set(e,t);var d=Co(s(e),s(t),i,r,o,a);return a.delete(e),d;case J:if(hi)return hi.call(e)==hi.call(t)}return!1}(t,n,u,i,r,o,a);if(!(i&c)){var g=f&&ct.call(t,"__wrapped__"),v=p&&ct.call(n,"__wrapped__");if(g||v){var E=g?t.value():t,y=v?n.value():n;return a||(a=new bi),o(E,y,i,r,a)}}return!!m&&(a||(a=new bi),function(t,n,i,r,o,a){var s=i&c,l=ko(t),u=l.length,h=ko(n).length;if(u!=h&&!s)return!1;for(var d=u;d--;){var f=l[d];if(!(s?f in n:ct.call(n,f)))return!1}var p=a.get(t);if(p&&a.get(n))return p==n;var m=!0;a.set(t,n),a.set(n,t);for(var g=s;++d<u;){f=l[d];var v=t[f],E=n[f];if(r)var y=s?r(E,v,f,n,t,a):r(v,E,f,t,n,a);if(!(y===e?v===E||o(v,E,i,r,a):y)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var _=t.constructor,T=n.constructor;_!=T&&"constructor"in t&&"constructor"in n&&!("function"==typeof _&&_ instanceof _&&"function"==typeof T&&T instanceof T)&&(m=!1)}return a.delete(t),a.delete(n),m}(t,n,i,r,o,a))}(t,n,i,r,or,o))}function ar(t,n,i,r){var o=i.length,a=o,s=!r;if(null==t)return!a;for(t=tt(t);o--;){var l=i[o];if(s&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++o<a;){var u=(l=i[o])[0],d=t[u],f=l[1];if(s&&l[2]){if(d===e&&!(u in t))return!1}else{var p=new bi;if(r)var m=r(d,f,u,t,n,p);if(!(m===e?or(f,d,c|h,r,p):m))return!1}}return!0}function sr(e){return!(!Ss(e)||(t=e,dt&&dt in t))&&(xs(e)?Ht:Ve).test(ha(e));var t}function lr(e){return"function"==typeof e?e:null==e?Al:"object"==typeof e?vs(e)?pr(e[0],e[1]):fr(e):Bl(e)}function ur(e){if(!Ko(e))return Wn(e);var t=[];for(var n in tt(e))ct.call(e,n)&&"constructor"!=n&&t.push(n);return t}function cr(e){if(!Ss(e))return function(e){var t=[];if(null!=e)for(var n in tt(e))t.push(n);return t}(e);var t=Ko(e),n=[];for(var i in e)("constructor"!=i||!t&&ct.call(e,i))&&n.push(i);return n}function hr(e,t){return e<t}function dr(e,t){var n=-1,i=ys(e)?Ze(e.length):[];return Bi(e,function(e,r,o){i[++n]=t(e,r,o)}),i}function fr(e){var t=Io(e);return 1==t.length&&t[0][2]?Jo(t[0][0],t[0][1]):function(n){return n===e||ar(n,e,t)}}function pr(t,n){return Xo(t)&&Qo(n)?Jo(ca(t),n):function(i){var r=Js(i,t);return r===e&&r===n?el(i,t):or(n,r,c|h)}}function mr(t,n,i,r,o){t!==n&&Gi(n,function(a,s){if(o||(o=new bi),Ss(a))!function(t,n,i,r,o,a,s){var l=na(t,i),u=na(n,i),c=s.get(u);if(c)Si(t,i,c);else{var h=a?a(l,u,i+"",t,n,s):e,d=h===e;if(d){var f=vs(u),p=!f&&Ts(u),m=!f&&!p&&Fs(u);h=u,f||p||m?vs(l)?h=l:_s(l)?h=no(l):p?(d=!1,h=Zr(u,!0)):m?(d=!1,h=Qr(u,!0)):h=[]:ks(u)||gs(u)?(h=l,gs(l)?h=Ws(l):Ss(l)&&!xs(l)||(h=Wo(u))):d=!1}d&&(s.set(u,h),o(h,u,r,a,s),s.delete(u)),Si(t,i,h)}}(t,n,s,i,mr,r,o);else{var l=r?r(na(t,s),a,s+"",t,n,o):e;l===e&&(l=a),Si(t,s,l)}},ol)}function gr(t,n){var i=t.length;if(i)return Yo(n+=n<0?i:0,i)?t[n]:e}function vr(e,t,n){var i=-1;return t=Xt(t.length?t:[Al],dn(Fo())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(dr(e,function(e,n,r){return{criteria:Xt(t,function(t){return t(e)}),index:++i,value:e}}),function(e,t){return function(e,t,n){for(var i=-1,r=e.criteria,o=t.criteria,a=r.length,s=n.length;++i<a;){var l=Jr(r[i],o[i]);if(l){if(i>=s)return l;var u=n[i];return l*("desc"==u?-1:1)}}return e.index-t.index}(e,t,n)})}function Er(e,t,n){for(var i=-1,r=t.length,o={};++i<r;){var a=t[i],s=Zi(e,a);n(s,a)&&Hr(o,Yr(a,e),s)}return o}function yr(e,t,n,i){var r=i?rn:nn,o=-1,a=t.length,s=e;for(e===t&&(t=no(t)),n&&(s=Xt(e,dn(n)));++o<a;)for(var l=0,u=t[o],c=n?n(u):u;(l=r(s,c,l,i))>-1;)s!==e&&An.call(s,l,1),An.call(e,l,1);return e}function _r(e,t){for(var n=e?t.length:0,i=n-1;n--;){var r=t[n];if(n==i||r!==o){var o=r;Yo(r)?An.call(e,r,1):Ir(e,r)}}return e}function Tr(e,t){return e+Bn($n()*(t-e+1))}function br(e,t){var n="";if(!e||t<1||t>C)return n;do{t%2&&(n+=e),(t=Bn(t/2))&&(e+=e)}while(t);return n}function wr(e,t){return oa(ea(e,t,Al),e+"")}function xr(e){return xi(fl(e))}function Rr(e,t){var n=fl(e);return la(n,Li(t,0,n.length))}function Hr(t,n,i,r){if(!Ss(t))return t;for(var o=-1,a=(n=Yr(n,t)).length,s=a-1,l=t;null!=l&&++o<a;){var u=ca(n[o]),c=i;if(o!=s){var h=l[u];(c=r?r(h,u,l):e)===e&&(c=Ss(h)?h:Yo(n[o+1])?[]:{})}Mi(l,u,c),l=l[u]}return t}var Sr=ii?function(e,t){return ii.set(e,t),e}:Al,Mr=Ln?function(e,t){return Ln(e,"toString",{configurable:!0,enumerable:!1,value:Sl(t),writable:!0})}:Al;function Cr(e){return la(fl(e))}function Ar(e,t,n){var i=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var o=Ze(r);++i<r;)o[i]=e[i+t];return o}function kr(e,t){var n;return Bi(e,function(e,i,r){return!(n=t(e,i,r))}),!!n}function Pr(e,t,n){var i=0,r=null==e?i:e.length;if("number"==typeof t&&t==t&&r<=L){for(;i<r;){var o=i+r>>>1,a=e[o];null!==a&&!Os(a)&&(n?a<=t:a<t)?i=o+1:r=o}return r}return Dr(e,t,Al,n)}function Dr(t,n,i,r){n=i(n);for(var o=0,a=null==t?0:t.length,s=n!=n,l=null===n,u=Os(n),c=n===e;o<a;){var h=Bn((o+a)/2),d=i(t[h]),f=d!==e,p=null===d,m=d==d,g=Os(d);if(s)var v=r||m;else v=c?m&&(r||f):l?m&&f&&(r||!p):u?m&&f&&!p&&(r||!g):!p&&!g&&(r?d<=n:d<n);v?o=h+1:a=h}return Yn(a,D)}function Lr(e,t){for(var n=-1,i=e.length,r=0,o=[];++n<i;){var a=e[n],s=t?t(a):a;if(!n||!fs(s,l)){var l=s;o[r++]=0===a?0:a}}return o}function Or(e){return"number"==typeof e?e:Os(e)?k:+e}function Fr(e){if("string"==typeof e)return e;if(vs(e))return Xt(e,Fr)+"";if(Os(e))return di?di.call(e):"";var t=e+"";return"0"==t&&1/e==-M?"-0":t}function Nr(e,n,i){var r=-1,o=Yt,a=e.length,s=!0,l=[],u=l;if(i)s=!1,o=qt;else if(a>=t){var c=n?null:wo(e);if(c)return xn(c);s=!1,o=pn,u=new Ti}else u=n?[]:l;e:for(;++r<a;){var h=e[r],d=n?n(h):h;if(h=i||0!==h?h:0,s&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;n&&u.push(d),l.push(h)}else o(u,d,i)||(u!==l&&u.push(d),l.push(h))}return l}function Ir(e,t){return null==(e=ta(e,t=Yr(t,e)))||delete e[ca(wa(t))]}function Br(e,t,n,i){return Hr(e,t,n(Zi(e,t)),i)}function zr(e,t,n,i){for(var r=e.length,o=i?r:-1;(i?o--:++o<r)&&t(e[o],o,e););return n?Ar(e,i?0:o,i?o+1:r):Ar(e,i?o+1:0,i?r:o)}function Vr(e,t){var n=e;return n instanceof vi&&(n=n.value()),Zt(t,function(e,t){return t.func.apply(t.thisArg,$t([e],t.args))},n)}function Ur(e,t,n){var i=e.length;if(i<2)return i?Nr(e[0]):[];for(var r=-1,o=Ze(i);++r<i;)for(var a=e[r],s=-1;++s<i;)s!=r&&(o[r]=Ii(o[r]||a,e[s],t,n));return Nr(Wi(o,1),t,n)}function jr(t,n,i){for(var r=-1,o=t.length,a=n.length,s={};++r<o;){var l=r<a?n[r]:e;i(s,t[r],l)}return s}function Wr(e){return _s(e)?e:[]}function Gr(e){return"function"==typeof e?e:Al}function Yr(e,t){return vs(e)?e:Xo(e,t)?[e]:ua(Gs(e))}var qr=wr;function Xr(t,n,i){var r=t.length;return i=i===e?r:i,!n&&i>=r?t:Ar(t,n,i)}var $r=On||function(e){return Mt.clearTimeout(e)};function Zr(e,t){if(t)return e.slice();var n=e.length,i=Pt?Pt(n):new e.constructor(n);return e.copy(i),i}function Kr(e){var t=new e.constructor(e.byteLength);return new At(t).set(new At(e)),t}function Qr(e,t){var n=t?Kr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Jr(t,n){if(t!==n){var i=t!==e,r=null===t,o=t==t,a=Os(t),s=n!==e,l=null===n,u=n==n,c=Os(n);if(!l&&!c&&!a&&t>n||a&&s&&u&&!l&&!c||r&&s&&u||!i&&u||!o)return 1;if(!r&&!a&&!c&&t<n||c&&i&&o&&!r&&!a||l&&i&&o||!s&&o||!u)return-1}return 0}function eo(e,t,n,i){for(var r=-1,o=e.length,a=n.length,s=-1,l=t.length,u=Gn(o-a,0),c=Ze(l+u),h=!i;++s<l;)c[s]=t[s];for(;++r<a;)(h||r<o)&&(c[n[r]]=e[r]);for(;u--;)c[s++]=e[r++];return c}function to(e,t,n,i){for(var r=-1,o=e.length,a=-1,s=n.length,l=-1,u=t.length,c=Gn(o-s,0),h=Ze(c+u),d=!i;++r<c;)h[r]=e[r];for(var f=r;++l<u;)h[f+l]=t[l];for(;++a<s;)(d||r<o)&&(h[f+n[a]]=e[r++]);return h}function no(e,t){var n=-1,i=e.length;for(t||(t=Ze(i));++n<i;)t[n]=e[n];return t}function io(t,n,i,r){var o=!i;i||(i={});for(var a=-1,s=n.length;++a<s;){var l=n[a],u=r?r(i[l],t[l],l,i,t):e;u===e&&(u=t[l]),o?Pi(i,l,u):Mi(i,l,u)}return i}function ro(e,t){return function(n,i){var r=vs(n)?Vt:Ai,o=t?t():{};return r(n,e,Fo(i,2),o)}}function oo(t){return wr(function(n,i){var r=-1,o=i.length,a=o>1?i[o-1]:e,s=o>2?i[2]:e;for(a=t.length>3&&"function"==typeof a?(o--,a):e,s&&qo(i[0],i[1],s)&&(a=o<3?e:a,o=1),n=tt(n);++r<o;){var l=i[r];l&&t(n,l,r,a)}return n})}function ao(e,t){return function(n,i){if(null==n)return n;if(!ys(n))return e(n,i);for(var r=n.length,o=t?r:-1,a=tt(n);(t?o--:++o<r)&&!1!==i(a[o],o,a););return n}}function so(e){return function(t,n,i){for(var r=-1,o=tt(t),a=i(t),s=a.length;s--;){var l=a[e?s:++r];if(!1===n(o[l],l,o))break}return t}}function lo(t){return function(n){var i=_n(n=Gs(n))?Sn(n):e,r=i?i[0]:n.charAt(0),o=i?Xr(i,1).join(""):n.slice(1);return r[t]()+o}}function uo(e){return function(t){return Zt(xl(gl(t).replace(ft,"")),e,"")}}function co(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=pi(e.prototype),i=e.apply(n,t);return Ss(i)?i:n}}function ho(t){return function(n,i,r){var o=tt(n);if(!ys(n)){var a=Fo(i,3);n=rl(n),i=function(e){return a(o[e],e,o)}}var s=t(n,i,r);return s>-1?o[a?n[s]:s]:e}}function fo(t){return Ao(function(n){var r=n.length,o=r,a=gi.prototype.thru;for(t&&n.reverse();o--;){var s=n[o];if("function"!=typeof s)throw new rt(i);if(a&&!l&&"wrapper"==Lo(s))var l=new gi([],!0)}for(o=l?o:r;++o<r;){var u=Lo(s=n[o]),c="wrapper"==u?Do(s):e;l=c&&$o(c[0])&&c[1]==(y|m|v|_)&&!c[4].length&&1==c[9]?l[Lo(c[0])].apply(l,c[3]):1==s.length&&$o(s)?l[u]():l.thru(s)}return function(){var e=arguments,t=e[0];if(l&&1==e.length&&vs(t))return l.plant(t).value();for(var i=0,o=r?n[i].apply(this,e):t;++i<r;)o=n[i].call(this,o);return o}})}function po(t,n,i,r,o,a,s,l,u,c){var h=n&y,p=n&d,v=n&f,E=n&(m|g),_=n&T,b=v?e:co(t);return function d(){for(var f=arguments.length,m=Ze(f),g=f;g--;)m[g]=arguments[g];if(E)var y=Oo(d),T=function(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i}(m,y);if(r&&(m=eo(m,r,o,E)),a&&(m=to(m,a,s,E)),f-=T,E&&f<c){var w=wn(m,y);return To(t,n,po,d.placeholder,i,m,w,l,u,c-f)}var x=p?i:this,R=v?x[t]:t;return f=m.length,l?m=function(t,n){for(var i=t.length,r=Yn(n.length,i),o=no(t);r--;){var a=n[r];t[r]=Yo(a,i)?o[a]:e}return t}(m,l):_&&f>1&&m.reverse(),h&&u<f&&(m.length=u),this&&this!==Mt&&this instanceof d&&(R=b||co(R)),R.apply(x,m)}}function mo(e,t){return function(n,i){return function(e,t,n,i){return qi(e,function(e,r,o){t(i,n(e),r,o)}),i}(n,e,t(i),{})}}function go(t,n){return function(i,r){var o;if(i===e&&r===e)return n;if(i!==e&&(o=i),r!==e){if(o===e)return r;"string"==typeof i||"string"==typeof r?(i=Fr(i),r=Fr(r)):(i=Or(i),r=Or(r)),o=t(i,r)}return o}}function vo(e){return Ao(function(t){return t=Xt(t,dn(Fo())),wr(function(n){var i=this;return e(t,function(e){return zt(e,i,n)})})})}function Eo(t,n){var i=(n=n===e?" ":Fr(n)).length;if(i<2)return i?br(n,t):n;var r=br(n,In(t/Hn(n)));return _n(n)?Xr(Sn(r),0,t).join(""):r.slice(0,t)}function yo(t){return function(n,i,r){return r&&"number"!=typeof r&&qo(n,i,r)&&(i=r=e),n=zs(n),i===e?(i=n,n=0):i=zs(i),function(e,t,n,i){for(var r=-1,o=Gn(In((t-e)/(n||1)),0),a=Ze(o);o--;)a[i?o:++r]=e,e+=n;return a}(n,i,r=r===e?n<i?1:-1:zs(r),t)}}function _o(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=js(t),n=js(n)),e(t,n)}}function To(t,n,i,r,o,a,s,l,u,c){var h=n&m;n|=h?v:E,(n&=~(h?E:v))&p||(n&=~(d|f));var g=[t,n,o,h?a:e,h?s:e,h?e:a,h?e:s,l,u,c],y=i.apply(e,g);return $o(t)&&ia(y,g),y.placeholder=r,aa(y,t,n)}function bo(e){var t=et[e];return function(e,n){if(e=js(e),(n=null==n?0:Yn(Vs(n),292))&&Un(e)){var i=(Gs(e)+"e").split("e");return+((i=(Gs(t(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return t(e)}}var wo=ei&&1/xn(new ei([,-0]))[1]==M?function(e){return new ei(e)}:Ol;function xo(e){return function(t){var n=Uo(t);return n==G?Tn(t):n==K?Rn(t):function(e,t){return Xt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ro(t,n,r,o,s,l,u,c){var h=n&f;if(!h&&"function"!=typeof t)throw new rt(i);var T=o?o.length:0;if(T||(n&=~(v|E),o=s=e),u=u===e?u:Gn(Vs(u),0),c=c===e?c:Vs(c),T-=s?s.length:0,n&E){var b=o,w=s;o=s=e}var x=h?e:Do(t),R=[t,n,r,o,s,b,w,l,u,c];if(x&&function(e,t){var n=e[1],i=t[1],r=n|i,o=r<(d|f|y),s=i==y&&n==m||i==y&&n==_&&e[7].length<=t[8]||i==(y|_)&&t[7].length<=t[8]&&n==m;if(!o&&!s)return e;i&d&&(e[2]=t[2],r|=n&d?0:p);var l=t[3];if(l){var u=e[3];e[3]=u?eo(u,l,t[4]):l,e[4]=u?wn(e[3],a):t[4]}(l=t[5])&&(u=e[5],e[5]=u?to(u,l,t[6]):l,e[6]=u?wn(e[5],a):t[6]),(l=t[7])&&(e[7]=l),i&y&&(e[8]=null==e[8]?t[8]:Yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=r}(R,x),t=R[0],n=R[1],r=R[2],o=R[3],s=R[4],!(c=R[9]=R[9]===e?h?0:t.length:Gn(R[9]-T,0))&&n&(m|g)&&(n&=~(m|g)),n&&n!=d)H=n==m||n==g?function(t,n,i){var r=co(t);return function o(){for(var a=arguments.length,s=Ze(a),l=a,u=Oo(o);l--;)s[l]=arguments[l];var c=a<3&&s[0]!==u&&s[a-1]!==u?[]:wn(s,u);return(a-=c.length)<i?To(t,n,po,o.placeholder,e,s,c,e,e,i-a):zt(this&&this!==Mt&&this instanceof o?r:t,this,s)}}(t,n,c):n!=v&&n!=(d|v)||s.length?po.apply(e,R):function(e,t,n,i){var r=t&d,o=co(e);return function t(){for(var a=-1,s=arguments.length,l=-1,u=i.length,c=Ze(u+s),h=this&&this!==Mt&&this instanceof t?o:e;++l<u;)c[l]=i[l];for(;s--;)c[l++]=arguments[++a];return zt(h,r?n:this,c)}}(t,n,r,o);else var H=function(e,t,n){var i=t&d,r=co(e);return function t(){return(this&&this!==Mt&&this instanceof t?r:e).apply(i?n:this,arguments)}}(t,n,r);return aa((x?Sr:ia)(H,R),t,n)}function Ho(t,n,i,r){return t===e||fs(t,st[i])&&!ct.call(r,i)?n:t}function So(t,n,i,r,o,a){return Ss(t)&&Ss(n)&&(a.set(n,t),mr(t,n,e,So,a),a.delete(n)),t}function Mo(t){return ks(t)?e:t}function Co(t,n,i,r,o,a){var s=i&c,l=t.length,u=n.length;if(l!=u&&!(s&&u>l))return!1;var d=a.get(t);if(d&&a.get(n))return d==n;var f=-1,p=!0,m=i&h?new Ti:e;for(a.set(t,n),a.set(n,t);++f<l;){var g=t[f],v=n[f];if(r)var E=s?r(v,g,f,n,t,a):r(g,v,f,t,n,a);if(E!==e){if(E)continue;p=!1;break}if(m){if(!Qt(n,function(e,t){if(!pn(m,t)&&(g===e||o(g,e,i,r,a)))return m.push(t)})){p=!1;break}}else if(g!==v&&!o(g,v,i,r,a)){p=!1;break}}return a.delete(t),a.delete(n),p}function Ao(t){return oa(ea(t,e,Ea),t+"")}function ko(e){return Ki(e,rl,zo)}function Po(e){return Ki(e,ol,Vo)}var Do=ii?function(e){return ii.get(e)}:Ol;function Lo(e){for(var t=e.name+"",n=ri[t],i=ct.call(ri,t)?n.length:0;i--;){var r=n[i],o=r.func;if(null==o||o==e)return r.name}return t}function Oo(e){return(ct.call(fi,"placeholder")?fi:e).placeholder}function Fo(){var e=fi.iteratee||kl;return e=e===kl?lr:e,arguments.length?e(arguments[0],arguments[1]):e}function No(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function Io(e){for(var t=rl(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,Qo(r)]}return t}function Bo(t,n){var i=function(t,n){return null==t?e:t[n]}(t,n);return sr(i)?i:e}var zo=zn?function(e){return null==e?[]:(e=tt(e),Gt(zn(e),function(t){return ln.call(e,t)}))}:Ul,Vo=zn?function(e){for(var t=[];e;)$t(t,zo(e)),e=Dt(e);return t}:Ul,Uo=Qi;function jo(e,t,n){for(var i=-1,r=(t=Yr(t,e)).length,o=!1;++i<r;){var a=ca(t[i]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++i!=r?o:!!(r=null==e?0:e.length)&&Hs(r)&&Yo(a,r)&&(vs(e)||gs(e))}function Wo(e){return"function"!=typeof e.constructor||Ko(e)?{}:pi(Dt(e))}function Go(e){return vs(e)||gs(e)||!!(kn&&e&&e[kn])}function Yo(e,t){var n=typeof e;return!!(t=null==t?C:t)&&("number"==n||"symbol"!=n&&je.test(e))&&e>-1&&e%1==0&&e<t}function qo(e,t,n){if(!Ss(n))return!1;var i=typeof t;return!!("number"==i?ys(n)&&Yo(t,n.length):"string"==i&&t in n)&&fs(n[t],e)}function Xo(e,t){if(vs(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Os(e))||Re.test(e)||!xe.test(e)||null!=t&&e in tt(t)}function $o(e){var t=Lo(e),n=fi[t];if("function"!=typeof n||!(t in vi.prototype))return!1;if(e===n)return!0;var i=Do(n);return!!i&&e===i[0]}(Kn&&Uo(new Kn(new ArrayBuffer(1)))!=re||Qn&&Uo(new Qn)!=G||Jn&&"[object Promise]"!=Uo(Jn.resolve())||ei&&Uo(new ei)!=K||ti&&Uo(new ti)!=te)&&(Uo=function(t){var n=Qi(t),i=n==X?t.constructor:e,r=i?ha(i):"";if(r)switch(r){case oi:return re;case ai:return G;case si:return"[object Promise]";case li:return K;case ui:return te}return n});var Zo=lt?xs:jl;function Ko(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||st)}function Qo(e){return e==e&&!Ss(e)}function Jo(t,n){return function(i){return null!=i&&i[t]===n&&(n!==e||t in tt(i))}}function ea(t,n,i){return n=Gn(n===e?t.length-1:n,0),function(){for(var e=arguments,r=-1,o=Gn(e.length-n,0),a=Ze(o);++r<o;)a[r]=e[n+r];r=-1;for(var s=Ze(n+1);++r<n;)s[r]=e[r];return s[n]=i(a),zt(t,this,s)}}function ta(e,t){return t.length<2?e:Zi(e,Ar(t,0,-1))}function na(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ia=sa(Sr),ra=Nn||function(e,t){return Mt.setTimeout(e,t)},oa=sa(Mr);function aa(e,t,n){var i=t+"";return oa(e,function(e,t){var n=t.length;if(!n)return e;var i=n-1;return t[i]=(n>1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(Pe,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return Ut(O,function(n){var i="_."+n[0];t&n[1]&&!Yt(e,i)&&e.push(i)}),e.sort()}(function(e){var t=e.match(De);return t?t[1].split(Le):[]}(i),n)))}function sa(t){var n=0,i=0;return function(){var r=qn(),o=R-(r-i);if(i=r,o>0){if(++n>=x)return arguments[0]}else n=0;return t.apply(e,arguments)}}function la(t,n){var i=-1,r=t.length,o=r-1;for(n=n===e?r:n;++i<n;){var a=Tr(i,o),s=t[a];t[a]=t[i],t[i]=s}return t.length=n,t}var ua=function(e){var t=ss(e,function(e){return n.size===o&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(He,function(e,n,i,r){t.push(i?r.replace(Fe,"$1"):n||e)}),t});function ca(e){if("string"==typeof e||Os(e))return e;var t=e+"";return"0"==t&&1/e==-M?"-0":t}function ha(e){if(null!=e){try{return ut.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function da(e){if(e instanceof vi)return e.clone();var t=new gi(e.__wrapped__,e.__chain__);return t.__actions__=no(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var fa=wr(function(e,t){return _s(e)?Ii(e,Wi(t,1,_s,!0)):[]}),pa=wr(function(t,n){var i=wa(n);return _s(i)&&(i=e),_s(t)?Ii(t,Wi(n,1,_s,!0),Fo(i,2)):[]}),ma=wr(function(t,n){var i=wa(n);return _s(i)&&(i=e),_s(t)?Ii(t,Wi(n,1,_s,!0),e,i):[]});function ga(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:Vs(n);return r<0&&(r=Gn(i+r,0)),tn(e,Fo(t,3),r)}function va(t,n,i){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return i!==e&&(o=Vs(i),o=i<0?Gn(r+o,0):Yn(o,r-1)),tn(t,Fo(n,3),o,!0)}function Ea(e){return null!=e&&e.length?Wi(e,1):[]}function ya(t){return t&&t.length?t[0]:e}var _a=wr(function(e){var t=Xt(e,Wr);return t.length&&t[0]===e[0]?nr(t):[]}),Ta=wr(function(t){var n=wa(t),i=Xt(t,Wr);return n===wa(i)?n=e:i.pop(),i.length&&i[0]===t[0]?nr(i,Fo(n,2)):[]}),ba=wr(function(t){var n=wa(t),i=Xt(t,Wr);return(n="function"==typeof n?n:e)&&i.pop(),i.length&&i[0]===t[0]?nr(i,e,n):[]});function wa(t){var n=null==t?0:t.length;return n?t[n-1]:e}var xa=wr(Ra);function Ra(e,t){return e&&e.length&&t&&t.length?yr(e,t):e}var Ha=Ao(function(e,t){var n=null==e?0:e.length,i=Di(e,t);return _r(e,Xt(t,function(e){return Yo(e,n)?+e:e}).sort(Jr)),i});function Sa(e){return null==e?e:Zn.call(e)}var Ma=wr(function(e){return Nr(Wi(e,1,_s,!0))}),Ca=wr(function(t){var n=wa(t);return _s(n)&&(n=e),Nr(Wi(t,1,_s,!0),Fo(n,2))}),Aa=wr(function(t){var n=wa(t);return n="function"==typeof n?n:e,Nr(Wi(t,1,_s,!0),e,n)});function ka(e){if(!e||!e.length)return[];var t=0;return e=Gt(e,function(e){if(_s(e))return t=Gn(e.length,t),!0}),hn(t,function(t){return Xt(e,sn(t))})}function Pa(t,n){if(!t||!t.length)return[];var i=ka(t);return null==n?i:Xt(i,function(t){return zt(n,e,t)})}var Da=wr(function(e,t){return _s(e)?Ii(e,t):[]}),La=wr(function(e){return Ur(Gt(e,_s))}),Oa=wr(function(t){var n=wa(t);return _s(n)&&(n=e),Ur(Gt(t,_s),Fo(n,2))}),Fa=wr(function(t){var n=wa(t);return n="function"==typeof n?n:e,Ur(Gt(t,_s),e,n)}),Na=wr(ka);var Ia=wr(function(t){var n=t.length,i=n>1?t[n-1]:e;return i="function"==typeof i?(t.pop(),i):e,Pa(t,i)});function Ba(e){var t=fi(e);return t.__chain__=!0,t}function za(e,t){return t(e)}var Va=Ao(function(t){var n=t.length,i=n?t[0]:0,r=this.__wrapped__,o=function(e){return Di(e,t)};return!(n>1||this.__actions__.length)&&r instanceof vi&&Yo(i)?((r=r.slice(i,+i+(n?1:0))).__actions__.push({func:za,args:[o],thisArg:e}),new gi(r,this.__chain__).thru(function(t){return n&&!t.length&&t.push(e),t})):this.thru(o)});var Ua=ro(function(e,t,n){ct.call(e,n)?++e[n]:Pi(e,n,1)});var ja=ho(ga),Wa=ho(va);function Ga(e,t){return(vs(e)?Ut:Bi)(e,Fo(t,3))}function Ya(e,t){return(vs(e)?jt:zi)(e,Fo(t,3))}var qa=ro(function(e,t,n){ct.call(e,n)?e[n].push(t):Pi(e,n,[t])});var Xa=wr(function(e,t,n){var i=-1,r="function"==typeof t,o=ys(e)?Ze(e.length):[];return Bi(e,function(e){o[++i]=r?zt(t,e,n):ir(e,t,n)}),o}),$a=ro(function(e,t,n){Pi(e,n,t)});function Za(e,t){return(vs(e)?Xt:dr)(e,Fo(t,3))}var Ka=ro(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});var Qa=wr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&qo(e,t[0],t[1])?t=[]:n>2&&qo(t[0],t[1],t[2])&&(t=[t[0]]),vr(e,Wi(t,1),[])}),Ja=Fn||function(){return Mt.Date.now()};function es(t,n,i){return n=i?e:n,n=t&&null==n?t.length:n,Ro(t,y,e,e,e,e,n)}function ts(t,n){var r;if("function"!=typeof n)throw new rt(i);return t=Vs(t),function(){return--t>0&&(r=n.apply(this,arguments)),t<=1&&(n=e),r}}var ns=wr(function(e,t,n){var i=d;if(n.length){var r=wn(n,Oo(ns));i|=v}return Ro(e,i,t,n,r)}),is=wr(function(e,t,n){var i=d|f;if(n.length){var r=wn(n,Oo(is));i|=v}return Ro(t,i,e,n,r)});function rs(t,n,r){var o,a,s,l,u,c,h=0,d=!1,f=!1,p=!0;if("function"!=typeof t)throw new rt(i);function m(n){var i=o,r=a;return o=a=e,h=n,l=t.apply(r,i)}function g(t){var i=t-c;return c===e||i>=n||i<0||f&&t-h>=s}function v(){var e=Ja();if(g(e))return E(e);u=ra(v,function(e){var t=n-(e-c);return f?Yn(t,s-(e-h)):t}(e))}function E(t){return u=e,p&&o?m(t):(o=a=e,l)}function y(){var t=Ja(),i=g(t);if(o=arguments,a=this,c=t,i){if(u===e)return function(e){return h=e,u=ra(v,n),d?m(e):l}(c);if(f)return $r(u),u=ra(v,n),m(c)}return u===e&&(u=ra(v,n)),l}return n=js(n)||0,Ss(r)&&(d=!!r.leading,s=(f="maxWait"in r)?Gn(js(r.maxWait)||0,n):s,p="trailing"in r?!!r.trailing:p),y.cancel=function(){u!==e&&$r(u),h=0,o=c=a=u=e},y.flush=function(){return u===e?l:E(Ja())},y}var os=wr(function(e,t){return Ni(e,1,t)}),as=wr(function(e,t,n){return Ni(e,js(t)||0,n)});function ss(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new rt(i);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(ss.Cache||_i),n}function ls(e){if("function"!=typeof e)throw new rt(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ss.Cache=_i;var us=qr(function(e,t){var n=(t=1==t.length&&vs(t[0])?Xt(t[0],dn(Fo())):Xt(Wi(t,1),dn(Fo()))).length;return wr(function(i){for(var r=-1,o=Yn(i.length,n);++r<o;)i[r]=t[r].call(this,i[r]);return zt(e,this,i)})}),cs=wr(function(t,n){var i=wn(n,Oo(cs));return Ro(t,v,e,n,i)}),hs=wr(function(t,n){var i=wn(n,Oo(hs));return Ro(t,E,e,n,i)}),ds=Ao(function(t,n){return Ro(t,_,e,e,e,n)});function fs(e,t){return e===t||e!=e&&t!=t}var ps=_o(Ji),ms=_o(function(e,t){return e>=t}),gs=rr(function(){return arguments}())?rr:function(e){return Ms(e)&&ct.call(e,"callee")&&!ln.call(e,"callee")},vs=Ze.isArray,Es=Lt?dn(Lt):function(e){return Ms(e)&&Qi(e)==ie};function ys(e){return null!=e&&Hs(e.length)&&!xs(e)}function _s(e){return Ms(e)&&ys(e)}var Ts=Vn||jl,bs=Ot?dn(Ot):function(e){return Ms(e)&&Qi(e)==z};function ws(e){if(!Ms(e))return!1;var t=Qi(e);return t==U||t==V||"string"==typeof e.message&&"string"==typeof e.name&&!ks(e)}function xs(e){if(!Ss(e))return!1;var t=Qi(e);return t==j||t==W||t==I||t==$}function Rs(e){return"number"==typeof e&&e==Vs(e)}function Hs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=C}function Ss(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ms(e){return null!=e&&"object"==typeof e}var Cs=Ft?dn(Ft):function(e){return Ms(e)&&Uo(e)==G};function As(e){return"number"==typeof e||Ms(e)&&Qi(e)==Y}function ks(e){if(!Ms(e)||Qi(e)!=X)return!1;var t=Dt(e);if(null===t)return!0;var n=ct.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ut.call(n)==vt}var Ps=Nt?dn(Nt):function(e){return Ms(e)&&Qi(e)==Z};var Ds=It?dn(It):function(e){return Ms(e)&&Uo(e)==K};function Ls(e){return"string"==typeof e||!vs(e)&&Ms(e)&&Qi(e)==Q}function Os(e){return"symbol"==typeof e||Ms(e)&&Qi(e)==J}var Fs=Bt?dn(Bt):function(e){return Ms(e)&&Hs(e.length)&&!!Tt[Qi(e)]};var Ns=_o(hr),Is=_o(function(e,t){return e<=t});function Bs(e){if(!e)return[];if(ys(e))return Ls(e)?Sn(e):no(e);if(Pn&&e[Pn])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Pn]());var t=Uo(e);return(t==G?Tn:t==K?xn:fl)(e)}function zs(e){return e?(e=js(e))===M||e===-M?(e<0?-1:1)*A:e==e?e:0:0===e?e:0}function Vs(e){var t=zs(e),n=t%1;return t==t?n?t-n:t:0}function Us(e){return e?Li(Vs(e),0,P):0}function js(e){if("number"==typeof e)return e;if(Os(e))return k;if(Ss(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ss(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Ce,"");var n=ze.test(e);return n||Ue.test(e)?Rt(e.slice(2),n?2:8):Be.test(e)?k:+e}function Ws(e){return io(e,ol(e))}function Gs(e){return null==e?"":Fr(e)}var Ys=oo(function(e,t){if(Ko(t)||ys(t))io(t,rl(t),e);else for(var n in t)ct.call(t,n)&&Mi(e,n,t[n])}),qs=oo(function(e,t){io(t,ol(t),e)}),Xs=oo(function(e,t,n,i){io(t,ol(t),e,i)}),$s=oo(function(e,t,n,i){io(t,rl(t),e,i)}),Zs=Ao(Di);var Ks=wr(function(t,n){t=tt(t);var i=-1,r=n.length,o=r>2?n[2]:e;for(o&&qo(n[0],n[1],o)&&(r=1);++i<r;)for(var a=n[i],s=ol(a),l=-1,u=s.length;++l<u;){var c=s[l],h=t[c];(h===e||fs(h,st[c])&&!ct.call(t,c))&&(t[c]=a[c])}return t}),Qs=wr(function(t){return t.push(e,So),zt(sl,e,t)});function Js(t,n,i){var r=null==t?e:Zi(t,n);return r===e?i:r}function el(e,t){return null!=e&&jo(e,t,tr)}var tl=mo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=mt.call(t)),e[t]=n},Sl(Al)),nl=mo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=mt.call(t)),ct.call(e,t)?e[t].push(n):e[t]=[n]},Fo),il=wr(ir);function rl(e){return ys(e)?wi(e):ur(e)}function ol(e){return ys(e)?wi(e,!0):cr(e)}var al=oo(function(e,t,n){mr(e,t,n)}),sl=oo(function(e,t,n,i){mr(e,t,n,i)}),ll=Ao(function(e,t){var n={};if(null==e)return n;var i=!1;t=Xt(t,function(t){return t=Yr(t,e),i||(i=t.length>1),t}),io(e,Po(e),n),i&&(n=Oi(n,s|l|u,Mo));for(var r=t.length;r--;)Ir(n,t[r]);return n});var ul=Ao(function(e,t){return null==e?{}:function(e,t){return Er(e,t,function(t,n){return el(e,n)})}(e,t)});function cl(e,t){if(null==e)return{};var n=Xt(Po(e),function(e){return[e]});return t=Fo(t),Er(e,n,function(e,n){return t(e,n[0])})}var hl=xo(rl),dl=xo(ol);function fl(e){return null==e?[]:fn(e,rl(e))}var pl=uo(function(e,t,n){return t=t.toLowerCase(),e+(n?ml(t):t)});function ml(e){return wl(Gs(e).toLowerCase())}function gl(e){return(e=Gs(e))&&e.replace(We,vn).replace(pt,"")}var vl=uo(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),El=uo(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),yl=lo("toLowerCase");var _l=uo(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});var Tl=uo(function(e,t,n){return e+(n?" ":"")+wl(t)});var bl=uo(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),wl=lo("toUpperCase");function xl(t,n,i){return t=Gs(t),(n=i?e:n)===e?function(e){return Et.test(e)}(t)?function(e){return e.match(gt)||[]}(t):function(e){return e.match(Oe)||[]}(t):t.match(n)||[]}var Rl=wr(function(t,n){try{return zt(t,e,n)}catch(e){return ws(e)?e:new Qe(e)}}),Hl=Ao(function(e,t){return Ut(t,function(t){t=ca(t),Pi(e,t,ns(e[t],e))}),e});function Sl(e){return function(){return e}}var Ml=fo(),Cl=fo(!0);function Al(e){return e}function kl(e){return lr("function"==typeof e?e:Oi(e,s))}var Pl=wr(function(e,t){return function(n){return ir(n,e,t)}}),Dl=wr(function(e,t){return function(n){return ir(e,n,t)}});function Ll(e,t,n){var i=rl(t),r=$i(t,i);null!=n||Ss(t)&&(r.length||!i.length)||(n=t,t=e,e=this,r=$i(t,rl(t)));var o=!(Ss(n)&&"chain"in n&&!n.chain),a=xs(e);return Ut(r,function(n){var i=t[n];e[n]=i,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=no(this.__actions__)).push({func:i,args:arguments,thisArg:e}),n.__chain__=t,n}return i.apply(e,$t([this.value()],arguments))})}),e}function Ol(){}var Fl=vo(Xt),Nl=vo(Wt),Il=vo(Qt);function Bl(e){return Xo(e)?sn(ca(e)):function(e){return function(t){return Zi(t,e)}}(e)}var zl=yo(),Vl=yo(!0);function Ul(){return[]}function jl(){return!1}var Wl=go(function(e,t){return e+t},0),Gl=bo("ceil"),Yl=go(function(e,t){return e/t},1),ql=bo("floor");var Xl,$l=go(function(e,t){return e*t},1),Zl=bo("round"),Kl=go(function(e,t){return e-t},0);return fi.after=function(e,t){if("function"!=typeof t)throw new rt(i);return e=Vs(e),function(){if(--e<1)return t.apply(this,arguments)}},fi.ary=es,fi.assign=Ys,fi.assignIn=qs,fi.assignInWith=Xs,fi.assignWith=$s,fi.at=Zs,fi.before=ts,fi.bind=ns,fi.bindAll=Hl,fi.bindKey=is,fi.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return vs(e)?e:[e]},fi.chain=Ba,fi.chunk=function(t,n,i){n=(i?qo(t,n,i):n===e)?1:Gn(Vs(n),0);var r=null==t?0:t.length;if(!r||n<1)return[];for(var o=0,a=0,s=Ze(In(r/n));o<r;)s[a++]=Ar(t,o,o+=n);return s},fi.compact=function(e){for(var t=-1,n=null==e?0:e.length,i=0,r=[];++t<n;){var o=e[t];o&&(r[i++]=o)}return r},fi.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Ze(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return $t(vs(n)?no(n):[n],Wi(t,1))},fi.cond=function(e){var t=null==e?0:e.length,n=Fo();return e=t?Xt(e,function(e){if("function"!=typeof e[1])throw new rt(i);return[n(e[0]),e[1]]}):[],wr(function(n){for(var i=-1;++i<t;){var r=e[i];if(zt(r[0],this,n))return zt(r[1],this,n)}})},fi.conforms=function(e){return function(e){var t=rl(e);return function(n){return Fi(n,e,t)}}(Oi(e,s))},fi.constant=Sl,fi.countBy=Ua,fi.create=function(e,t){var n=pi(e);return null==t?n:ki(n,t)},fi.curry=function t(n,i,r){var o=Ro(n,m,e,e,e,e,e,i=r?e:i);return o.placeholder=t.placeholder,o},fi.curryRight=function t(n,i,r){var o=Ro(n,g,e,e,e,e,e,i=r?e:i);return o.placeholder=t.placeholder,o},fi.debounce=rs,fi.defaults=Ks,fi.defaultsDeep=Qs,fi.defer=os,fi.delay=as,fi.difference=fa,fi.differenceBy=pa,fi.differenceWith=ma,fi.drop=function(t,n,i){var r=null==t?0:t.length;return r?Ar(t,(n=i||n===e?1:Vs(n))<0?0:n,r):[]},fi.dropRight=function(t,n,i){var r=null==t?0:t.length;return r?Ar(t,0,(n=r-(n=i||n===e?1:Vs(n)))<0?0:n):[]},fi.dropRightWhile=function(e,t){return e&&e.length?zr(e,Fo(t,3),!0,!0):[]},fi.dropWhile=function(e,t){return e&&e.length?zr(e,Fo(t,3),!0):[]},fi.fill=function(t,n,i,r){var o=null==t?0:t.length;return o?(i&&"number"!=typeof i&&qo(t,n,i)&&(i=0,r=o),function(t,n,i,r){var o=t.length;for((i=Vs(i))<0&&(i=-i>o?0:o+i),(r=r===e||r>o?o:Vs(r))<0&&(r+=o),r=i>r?0:Us(r);i<r;)t[i++]=n;return t}(t,n,i,r)):[]},fi.filter=function(e,t){return(vs(e)?Gt:ji)(e,Fo(t,3))},fi.flatMap=function(e,t){return Wi(Za(e,t),1)},fi.flatMapDeep=function(e,t){return Wi(Za(e,t),M)},fi.flatMapDepth=function(t,n,i){return i=i===e?1:Vs(i),Wi(Za(t,n),i)},fi.flatten=Ea,fi.flattenDeep=function(e){return null!=e&&e.length?Wi(e,M):[]},fi.flattenDepth=function(t,n){return null!=t&&t.length?Wi(t,n=n===e?1:Vs(n)):[]},fi.flip=function(e){return Ro(e,T)},fi.flow=Ml,fi.flowRight=Cl,fi.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i},fi.functions=function(e){return null==e?[]:$i(e,rl(e))},fi.functionsIn=function(e){return null==e?[]:$i(e,ol(e))},fi.groupBy=qa,fi.initial=function(e){return null!=e&&e.length?Ar(e,0,-1):[]},fi.intersection=_a,fi.intersectionBy=Ta,fi.intersectionWith=ba,fi.invert=tl,fi.invertBy=nl,fi.invokeMap=Xa,fi.iteratee=kl,fi.keyBy=$a,fi.keys=rl,fi.keysIn=ol,fi.map=Za,fi.mapKeys=function(e,t){var n={};return t=Fo(t,3),qi(e,function(e,i,r){Pi(n,t(e,i,r),e)}),n},fi.mapValues=function(e,t){var n={};return t=Fo(t,3),qi(e,function(e,i,r){Pi(n,i,t(e,i,r))}),n},fi.matches=function(e){return fr(Oi(e,s))},fi.matchesProperty=function(e,t){return pr(e,Oi(t,s))},fi.memoize=ss,fi.merge=al,fi.mergeWith=sl,fi.method=Pl,fi.methodOf=Dl,fi.mixin=Ll,fi.negate=ls,fi.nthArg=function(e){return e=Vs(e),wr(function(t){return gr(t,e)})},fi.omit=ll,fi.omitBy=function(e,t){return cl(e,ls(Fo(t)))},fi.once=function(e){return ts(2,e)},fi.orderBy=function(t,n,i,r){return null==t?[]:(vs(n)||(n=null==n?[]:[n]),vs(i=r?e:i)||(i=null==i?[]:[i]),vr(t,n,i))},fi.over=Fl,fi.overArgs=us,fi.overEvery=Nl,fi.overSome=Il,fi.partial=cs,fi.partialRight=hs,fi.partition=Ka,fi.pick=ul,fi.pickBy=cl,fi.property=Bl,fi.propertyOf=function(t){return function(n){return null==t?e:Zi(t,n)}},fi.pull=xa,fi.pullAll=Ra,fi.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?yr(e,t,Fo(n,2)):e},fi.pullAllWith=function(t,n,i){return t&&t.length&&n&&n.length?yr(t,n,e,i):t},fi.pullAt=Ha,fi.range=zl,fi.rangeRight=Vl,fi.rearg=ds,fi.reject=function(e,t){return(vs(e)?Gt:ji)(e,ls(Fo(t,3)))},fi.remove=function(e,t){var n=[];if(!e||!e.length)return n;var i=-1,r=[],o=e.length;for(t=Fo(t,3);++i<o;){var a=e[i];t(a,i,e)&&(n.push(a),r.push(i))}return _r(e,r),n},fi.rest=function(t,n){if("function"!=typeof t)throw new rt(i);return wr(t,n=n===e?n:Vs(n))},fi.reverse=Sa,fi.sampleSize=function(t,n,i){return n=(i?qo(t,n,i):n===e)?1:Vs(n),(vs(t)?Ri:Rr)(t,n)},fi.set=function(e,t,n){return null==e?e:Hr(e,t,n)},fi.setWith=function(t,n,i,r){return r="function"==typeof r?r:e,null==t?t:Hr(t,n,i,r)},fi.shuffle=function(e){return(vs(e)?Hi:Cr)(e)},fi.slice=function(t,n,i){var r=null==t?0:t.length;return r?(i&&"number"!=typeof i&&qo(t,n,i)?(n=0,i=r):(n=null==n?0:Vs(n),i=i===e?r:Vs(i)),Ar(t,n,i)):[]},fi.sortBy=Qa,fi.sortedUniq=function(e){return e&&e.length?Lr(e):[]},fi.sortedUniqBy=function(e,t){return e&&e.length?Lr(e,Fo(t,2)):[]},fi.split=function(t,n,i){return i&&"number"!=typeof i&&qo(t,n,i)&&(n=i=e),(i=i===e?P:i>>>0)?(t=Gs(t))&&("string"==typeof n||null!=n&&!Ps(n))&&!(n=Fr(n))&&_n(t)?Xr(Sn(t),0,i):t.split(n,i):[]},fi.spread=function(e,t){if("function"!=typeof e)throw new rt(i);return t=null==t?0:Gn(Vs(t),0),wr(function(n){var i=n[t],r=Xr(n,0,t);return i&&$t(r,i),zt(e,this,r)})},fi.tail=function(e){var t=null==e?0:e.length;return t?Ar(e,1,t):[]},fi.take=function(t,n,i){return t&&t.length?Ar(t,0,(n=i||n===e?1:Vs(n))<0?0:n):[]},fi.takeRight=function(t,n,i){var r=null==t?0:t.length;return r?Ar(t,(n=r-(n=i||n===e?1:Vs(n)))<0?0:n,r):[]},fi.takeRightWhile=function(e,t){return e&&e.length?zr(e,Fo(t,3),!1,!0):[]},fi.takeWhile=function(e,t){return e&&e.length?zr(e,Fo(t,3)):[]},fi.tap=function(e,t){return t(e),e},fi.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new rt(i);return Ss(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),rs(e,t,{leading:r,maxWait:t,trailing:o})},fi.thru=za,fi.toArray=Bs,fi.toPairs=hl,fi.toPairsIn=dl,fi.toPath=function(e){return vs(e)?Xt(e,ca):Os(e)?[e]:no(ua(Gs(e)))},fi.toPlainObject=Ws,fi.transform=function(e,t,n){var i=vs(e),r=i||Ts(e)||Fs(e);if(t=Fo(t,4),null==n){var o=e&&e.constructor;n=r?i?new o:[]:Ss(e)&&xs(o)?pi(Dt(e)):{}}return(r?Ut:qi)(e,function(e,i,r){return t(n,e,i,r)}),n},fi.unary=function(e){return es(e,1)},fi.union=Ma,fi.unionBy=Ca,fi.unionWith=Aa,fi.uniq=function(e){return e&&e.length?Nr(e):[]},fi.uniqBy=function(e,t){return e&&e.length?Nr(e,Fo(t,2)):[]},fi.uniqWith=function(t,n){return n="function"==typeof n?n:e,t&&t.length?Nr(t,e,n):[]},fi.unset=function(e,t){return null==e||Ir(e,t)},fi.unzip=ka,fi.unzipWith=Pa,fi.update=function(e,t,n){return null==e?e:Br(e,t,Gr(n))},fi.updateWith=function(t,n,i,r){return r="function"==typeof r?r:e,null==t?t:Br(t,n,Gr(i),r)},fi.values=fl,fi.valuesIn=function(e){return null==e?[]:fn(e,ol(e))},fi.without=Da,fi.words=xl,fi.wrap=function(e,t){return cs(Gr(t),e)},fi.xor=La,fi.xorBy=Oa,fi.xorWith=Fa,fi.zip=Na,fi.zipObject=function(e,t){return jr(e||[],t||[],Mi)},fi.zipObjectDeep=function(e,t){return jr(e||[],t||[],Hr)},fi.zipWith=Ia,fi.entries=hl,fi.entriesIn=dl,fi.extend=qs,fi.extendWith=Xs,Ll(fi,fi),fi.add=Wl,fi.attempt=Rl,fi.camelCase=pl,fi.capitalize=ml,fi.ceil=Gl,fi.clamp=function(t,n,i){return i===e&&(i=n,n=e),i!==e&&(i=(i=js(i))==i?i:0),n!==e&&(n=(n=js(n))==n?n:0),Li(js(t),n,i)},fi.clone=function(e){return Oi(e,u)},fi.cloneDeep=function(e){return Oi(e,s|u)},fi.cloneDeepWith=function(t,n){return Oi(t,s|u,n="function"==typeof n?n:e)},fi.cloneWith=function(t,n){return Oi(t,u,n="function"==typeof n?n:e)},fi.conformsTo=function(e,t){return null==t||Fi(e,t,rl(t))},fi.deburr=gl,fi.defaultTo=function(e,t){return null==e||e!=e?t:e},fi.divide=Yl,fi.endsWith=function(t,n,i){t=Gs(t),n=Fr(n);var r=t.length,o=i=i===e?r:Li(Vs(i),0,r);return(i-=n.length)>=0&&t.slice(i,o)==n},fi.eq=fs,fi.escape=function(e){return(e=Gs(e))&&_e.test(e)?e.replace(Ee,En):e},fi.escapeRegExp=function(e){return(e=Gs(e))&&Me.test(e)?e.replace(Se,"\\$&"):e},fi.every=function(t,n,i){var r=vs(t)?Wt:Vi;return i&&qo(t,n,i)&&(n=e),r(t,Fo(n,3))},fi.find=ja,fi.findIndex=ga,fi.findKey=function(e,t){return en(e,Fo(t,3),qi)},fi.findLast=Wa,fi.findLastIndex=va,fi.findLastKey=function(e,t){return en(e,Fo(t,3),Xi)},fi.floor=ql,fi.forEach=Ga,fi.forEachRight=Ya,fi.forIn=function(e,t){return null==e?e:Gi(e,Fo(t,3),ol)},fi.forInRight=function(e,t){return null==e?e:Yi(e,Fo(t,3),ol)},fi.forOwn=function(e,t){return e&&qi(e,Fo(t,3))},fi.forOwnRight=function(e,t){return e&&Xi(e,Fo(t,3))},fi.get=Js,fi.gt=ps,fi.gte=ms,fi.has=function(e,t){return null!=e&&jo(e,t,er)},fi.hasIn=el,fi.head=ya,fi.identity=Al,fi.includes=function(e,t,n,i){e=ys(e)?e:fl(e),n=n&&!i?Vs(n):0;var r=e.length;return n<0&&(n=Gn(r+n,0)),Ls(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&nn(e,t,n)>-1},fi.indexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:Vs(n);return r<0&&(r=Gn(i+r,0)),nn(e,t,r)},fi.inRange=function(t,n,i){return n=zs(n),i===e?(i=n,n=0):i=zs(i),function(e,t,n){return e>=Yn(t,n)&&e<Gn(t,n)}(t=js(t),n,i)},fi.invoke=il,fi.isArguments=gs,fi.isArray=vs,fi.isArrayBuffer=Es,fi.isArrayLike=ys,fi.isArrayLikeObject=_s,fi.isBoolean=function(e){return!0===e||!1===e||Ms(e)&&Qi(e)==B},fi.isBuffer=Ts,fi.isDate=bs,fi.isElement=function(e){return Ms(e)&&1===e.nodeType&&!ks(e)},fi.isEmpty=function(e){if(null==e)return!0;if(ys(e)&&(vs(e)||"string"==typeof e||"function"==typeof e.splice||Ts(e)||Fs(e)||gs(e)))return!e.length;var t=Uo(e);if(t==G||t==K)return!e.size;if(Ko(e))return!ur(e).length;for(var n in e)if(ct.call(e,n))return!1;return!0},fi.isEqual=function(e,t){return or(e,t)},fi.isEqualWith=function(t,n,i){var r=(i="function"==typeof i?i:e)?i(t,n):e;return r===e?or(t,n,e,i):!!r},fi.isError=ws,fi.isFinite=function(e){return"number"==typeof e&&Un(e)},fi.isFunction=xs,fi.isInteger=Rs,fi.isLength=Hs,fi.isMap=Cs,fi.isMatch=function(e,t){return e===t||ar(e,t,Io(t))},fi.isMatchWith=function(t,n,i){return i="function"==typeof i?i:e,ar(t,n,Io(n),i)},fi.isNaN=function(e){return As(e)&&e!=+e},fi.isNative=function(e){if(Zo(e))throw new Qe(n);return sr(e)},fi.isNil=function(e){return null==e},fi.isNull=function(e){return null===e},fi.isNumber=As,fi.isObject=Ss,fi.isObjectLike=Ms,fi.isPlainObject=ks,fi.isRegExp=Ps,fi.isSafeInteger=function(e){return Rs(e)&&e>=-C&&e<=C},fi.isSet=Ds,fi.isString=Ls,fi.isSymbol=Os,fi.isTypedArray=Fs,fi.isUndefined=function(t){return t===e},fi.isWeakMap=function(e){return Ms(e)&&Uo(e)==te},fi.isWeakSet=function(e){return Ms(e)&&Qi(e)==ne},fi.join=function(e,t){return null==e?"":jn.call(e,t)},fi.kebabCase=vl,fi.last=wa,fi.lastIndexOf=function(t,n,i){var r=null==t?0:t.length;if(!r)return-1;var o=r;return i!==e&&(o=(o=Vs(i))<0?Gn(r+o,0):Yn(o,r-1)),n==n?function(e,t,n){for(var i=n+1;i--;)if(e[i]===t)return i;return i}(t,n,o):tn(t,on,o,!0)},fi.lowerCase=El,fi.lowerFirst=yl,fi.lt=Ns,fi.lte=Is,fi.max=function(t){return t&&t.length?Ui(t,Al,Ji):e},fi.maxBy=function(t,n){return t&&t.length?Ui(t,Fo(n,2),Ji):e},fi.mean=function(e){return an(e,Al)},fi.meanBy=function(e,t){return an(e,Fo(t,2))},fi.min=function(t){return t&&t.length?Ui(t,Al,hr):e},fi.minBy=function(t,n){return t&&t.length?Ui(t,Fo(n,2),hr):e},fi.stubArray=Ul,fi.stubFalse=jl,fi.stubObject=function(){return{}},fi.stubString=function(){return""},fi.stubTrue=function(){return!0},fi.multiply=$l,fi.nth=function(t,n){return t&&t.length?gr(t,Vs(n)):e},fi.noConflict=function(){return Mt._===this&&(Mt._=wt),this},fi.noop=Ol,fi.now=Ja,fi.pad=function(e,t,n){e=Gs(e);var i=(t=Vs(t))?Hn(e):0;if(!t||i>=t)return e;var r=(t-i)/2;return Eo(Bn(r),n)+e+Eo(In(r),n)},fi.padEnd=function(e,t,n){e=Gs(e);var i=(t=Vs(t))?Hn(e):0;return t&&i<t?e+Eo(t-i,n):e},fi.padStart=function(e,t,n){e=Gs(e);var i=(t=Vs(t))?Hn(e):0;return t&&i<t?Eo(t-i,n)+e:e},fi.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),Xn(Gs(e).replace(Ae,""),t||0)},fi.random=function(t,n,i){if(i&&"boolean"!=typeof i&&qo(t,n,i)&&(n=i=e),i===e&&("boolean"==typeof n?(i=n,n=e):"boolean"==typeof t&&(i=t,t=e)),t===e&&n===e?(t=0,n=1):(t=zs(t),n===e?(n=t,t=0):n=zs(n)),t>n){var r=t;t=n,n=r}if(i||t%1||n%1){var o=$n();return Yn(t+o*(n-t+xt("1e-"+((o+"").length-1))),n)}return Tr(t,n)},fi.reduce=function(e,t,n){var i=vs(e)?Zt:un,r=arguments.length<3;return i(e,Fo(t,4),n,r,Bi)},fi.reduceRight=function(e,t,n){var i=vs(e)?Kt:un,r=arguments.length<3;return i(e,Fo(t,4),n,r,zi)},fi.repeat=function(t,n,i){return n=(i?qo(t,n,i):n===e)?1:Vs(n),br(Gs(t),n)},fi.replace=function(){var e=arguments,t=Gs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},fi.result=function(t,n,i){var r=-1,o=(n=Yr(n,t)).length;for(o||(o=1,t=e);++r<o;){var a=null==t?e:t[ca(n[r])];a===e&&(r=o,a=i),t=xs(a)?a.call(t):a}return t},fi.round=Zl,fi.runInContext=qe,fi.sample=function(e){return(vs(e)?xi:xr)(e)},fi.size=function(e){if(null==e)return 0;if(ys(e))return Ls(e)?Hn(e):e.length;var t=Uo(e);return t==G||t==K?e.size:ur(e).length},fi.snakeCase=_l,fi.some=function(t,n,i){var r=vs(t)?Qt:kr;return i&&qo(t,n,i)&&(n=e),r(t,Fo(n,3))},fi.sortedIndex=function(e,t){return Pr(e,t)},fi.sortedIndexBy=function(e,t,n){return Dr(e,t,Fo(n,2))},fi.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var i=Pr(e,t);if(i<n&&fs(e[i],t))return i}return-1},fi.sortedLastIndex=function(e,t){return Pr(e,t,!0)},fi.sortedLastIndexBy=function(e,t,n){return Dr(e,t,Fo(n,2),!0)},fi.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Pr(e,t,!0)-1;if(fs(e[n],t))return n}return-1},fi.startCase=Tl,fi.startsWith=function(e,t,n){return e=Gs(e),n=null==n?0:Li(Vs(n),0,e.length),t=Fr(t),e.slice(n,n+t.length)==t},fi.subtract=Kl,fi.sum=function(e){return e&&e.length?cn(e,Al):0},fi.sumBy=function(e,t){return e&&e.length?cn(e,Fo(t,2)):0},fi.template=function(t,n,i){var r=fi.templateSettings;i&&qo(t,n,i)&&(n=e),t=Gs(t),n=Xs({},n,r,Ho);var o,a,s=Xs({},n.imports,r.imports,Ho),l=rl(s),u=fn(s,l),c=0,h=n.interpolate||Ge,d="__p += '",f=nt((n.escape||Ge).source+"|"+h.source+"|"+(h===we?Ne:Ge).source+"|"+(n.evaluate||Ge).source+"|$","g"),p="//# sourceURL="+(ct.call(n,"sourceURL")?(n.sourceURL+"").replace(/[\r\n]/g," "):"lodash.templateSources["+ ++_t+"]")+"\n";t.replace(f,function(e,n,i,r,s,l){return i||(i=r),d+=t.slice(c,l).replace(Ye,yn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),c=l+e.length,e}),d+="';\n";var m=ct.call(n,"variable")&&n.variable;m||(d="with (obj) {\n"+d+"\n}\n"),d=(a?d.replace(pe,""):d).replace(me,"$1").replace(ge,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Rl(function(){return Je(l,p+"return "+d).apply(e,u)});if(g.source=d,ws(g))throw g;return g},fi.times=function(e,t){if((e=Vs(e))<1||e>C)return[];var n=P,i=Yn(e,P);t=Fo(t),e-=P;for(var r=hn(i,t);++n<e;)t(n);return r},fi.toFinite=zs,fi.toInteger=Vs,fi.toLength=Us,fi.toLower=function(e){return Gs(e).toLowerCase()},fi.toNumber=js,fi.toSafeInteger=function(e){return e?Li(Vs(e),-C,C):0===e?e:0},fi.toString=Gs,fi.toUpper=function(e){return Gs(e).toUpperCase()},fi.trim=function(t,n,i){if((t=Gs(t))&&(i||n===e))return t.replace(Ce,"");if(!t||!(n=Fr(n)))return t;var r=Sn(t),o=Sn(n);return Xr(r,mn(r,o),gn(r,o)+1).join("")},fi.trimEnd=function(t,n,i){if((t=Gs(t))&&(i||n===e))return t.replace(ke,"");if(!t||!(n=Fr(n)))return t;var r=Sn(t);return Xr(r,0,gn(r,Sn(n))+1).join("")},fi.trimStart=function(t,n,i){if((t=Gs(t))&&(i||n===e))return t.replace(Ae,"");if(!t||!(n=Fr(n)))return t;var r=Sn(t);return Xr(r,mn(r,Sn(n))).join("")},fi.truncate=function(t,n){var i=b,r=w;if(Ss(n)){var o="separator"in n?n.separator:o;i="length"in n?Vs(n.length):i,r="omission"in n?Fr(n.omission):r}var a=(t=Gs(t)).length;if(_n(t)){var s=Sn(t);a=s.length}if(i>=a)return t;var l=i-Hn(r);if(l<1)return r;var u=s?Xr(s,0,l).join(""):t.slice(0,l);if(o===e)return u+r;if(s&&(l+=u.length-l),Ps(o)){if(t.slice(l).search(o)){var c,h=u;for(o.global||(o=nt(o.source,Gs(Ie.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var d=c.index;u=u.slice(0,d===e?l:d)}}else if(t.indexOf(Fr(o),l)!=l){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+r},fi.unescape=function(e){return(e=Gs(e))&&ye.test(e)?e.replace(ve,Mn):e},fi.uniqueId=function(e){var t=++ht;return Gs(e)+t},fi.upperCase=bl,fi.upperFirst=wl,fi.each=Ga,fi.eachRight=Ya,fi.first=ya,Ll(fi,(Xl={},qi(fi,function(e,t){ct.call(fi.prototype,t)||(Xl[t]=e)}),Xl),{chain:!1}),fi.VERSION="4.17.15",Ut(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){fi[e].placeholder=fi}),Ut(["drop","take"],function(t,n){vi.prototype[t]=function(i){i=i===e?1:Gn(Vs(i),0);var r=this.__filtered__&&!n?new vi(this):this.clone();return r.__filtered__?r.__takeCount__=Yn(i,r.__takeCount__):r.__views__.push({size:Yn(i,P),type:t+(r.__dir__<0?"Right":"")}),r},vi.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Ut(["filter","map","takeWhile"],function(e,t){var n=t+1,i=n==H||3==n;vi.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Fo(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}}),Ut(["head","last"],function(e,t){var n="take"+(t?"Right":"");vi.prototype[e]=function(){return this[n](1).value()[0]}}),Ut(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");vi.prototype[e]=function(){return this.__filtered__?new vi(this):this[n](1)}}),vi.prototype.compact=function(){return this.filter(Al)},vi.prototype.find=function(e){return this.filter(e).head()},vi.prototype.findLast=function(e){return this.reverse().find(e)},vi.prototype.invokeMap=wr(function(e,t){return"function"==typeof e?new vi(this):this.map(function(n){return ir(n,e,t)})}),vi.prototype.reject=function(e){return this.filter(ls(Fo(e)))},vi.prototype.slice=function(t,n){t=Vs(t);var i=this;return i.__filtered__&&(t>0||n<0)?new vi(i):(t<0?i=i.takeRight(-t):t&&(i=i.drop(t)),n!==e&&(i=(n=Vs(n))<0?i.dropRight(-n):i.take(n-t)),i)},vi.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},vi.prototype.toArray=function(){return this.take(P)},qi(vi.prototype,function(t,n){var i=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),o=fi[r?"take"+("last"==n?"Right":""):n],a=r||/^find/.test(n);o&&(fi.prototype[n]=function(){var n=this.__wrapped__,s=r?[1]:arguments,l=n instanceof vi,u=s[0],c=l||vs(n),h=function(e){var t=o.apply(fi,$t([e],s));return r&&d?t[0]:t};c&&i&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,f=!!this.__actions__.length,p=a&&!d,m=l&&!f;if(!a&&c){n=m?n:new vi(this);var g=t.apply(n,s);return g.__actions__.push({func:za,args:[h],thisArg:e}),new gi(g,d)}return p&&m?t.apply(this,s):(g=this.thru(h),p?r?g.value()[0]:g.value():g)})}),Ut(["pop","push","shift","sort","splice","unshift"],function(e){var t=ot[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);fi.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var r=this.value();return t.apply(vs(r)?r:[],e)}return this[n](function(n){return t.apply(vs(n)?n:[],e)})}}),qi(vi.prototype,function(e,t){var n=fi[t];if(n){var i=n.name+"";ct.call(ri,i)||(ri[i]=[]),ri[i].push({name:t,func:n})}}),ri[po(e,f).name]=[{name:"wrapper",func:e}],vi.prototype.clone=function(){var e=new vi(this.__wrapped__);return e.__actions__=no(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=no(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=no(this.__views__),e},vi.prototype.reverse=function(){if(this.__filtered__){var e=new vi(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},vi.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=vs(e),i=t<0,r=n?e.length:0,o=function(e,t,n){for(var i=-1,r=n.length;++i<r;){var o=n[i],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=Yn(t,e+a);break;case"takeRight":e=Gn(e,t-a)}}return{start:e,end:t}}(0,r,this.__views__),a=o.start,s=o.end,l=s-a,u=i?s:a-1,c=this.__iteratees__,h=c.length,d=0,f=Yn(l,this.__takeCount__);if(!n||!i&&r==l&&f==l)return Vr(e,this.__actions__);var p=[];e:for(;l--&&d<f;){for(var m=-1,g=e[u+=t];++m<h;){var v=c[m],E=v.iteratee,y=v.type,_=E(g);if(y==S)g=_;else if(!_){if(y==H)continue e;break e}}p[d++]=g}return p},fi.prototype.at=Va,fi.prototype.chain=function(){return Ba(this)},fi.prototype.commit=function(){return new gi(this.value(),this.__chain__)},fi.prototype.next=function(){this.__values__===e&&(this.__values__=Bs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}},fi.prototype.plant=function(t){for(var n,i=this;i instanceof mi;){var r=da(i);r.__index__=0,r.__values__=e,n?o.__wrapped__=r:n=r;var o=r;i=i.__wrapped__}return o.__wrapped__=t,n},fi.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof vi){var n=t;return this.__actions__.length&&(n=new vi(this)),(n=n.reverse()).__actions__.push({func:za,args:[Sa],thisArg:e}),new gi(n,this.__chain__)}return this.thru(Sa)},fi.prototype.toJSON=fi.prototype.valueOf=fi.prototype.value=function(){return Vr(this.__wrapped__,this.__actions__)},fi.prototype.first=fi.prototype.head,Pn&&(fi.prototype[Pn]=function(){return this}),fi}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Mt._=Cn,define(function(){return Cn})):At?((At.exports=Cn)._=Cn,Ct._=Cn):Mt._=Cn}.call(this),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):(e=e||self).Util=t(e.jQuery)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var t="transitionend";function n(t){var n=this,r=!1;return e(this).one(i.TRANSITION_END,function(){r=!0}),setTimeout(function(){r||i.triggerTransitionEnd(n)},t),this}var i={TRANSITION_END:"bsTransitionEnd",getUID:function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},getSelectorFromElement:function(e){var t=e.getAttribute("data-target");if(!t||"#"===t){var n=e.getAttribute("href");t=n&&"#"!==n?n.trim():""}try{return document.querySelector(t)?t:null}catch(e){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var n=e(t).css("transition-duration"),i=e(t).css("transition-delay"),r=parseFloat(n),o=parseFloat(i);return r||o?(n=n.split(",")[0],i=i.split(",")[0],1e3*(parseFloat(n)+parseFloat(i))):0},reflow:function(e){return e.offsetHeight},triggerTransitionEnd:function(n){e(n).trigger(t)},supportsTransitionEnd:function(){return Boolean(t)},isElement:function(e){return(e[0]||e).nodeType},typeCheckConfig:function(e,t,n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r],a=t[r],s=a&&i.isElement(a)?"element":null==(l=a)?""+l:{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(s))throw new Error(e.toUpperCase()+': Option "'+r+'" provided type "'+s+'" but expected type "'+o+'".')}var l},findShadowRoot:function(e){if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){var t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?i.findShadowRoot(e.parentNode):null},jQueryDetection:function(){if(void 0===e)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};return i.jQueryDetection(),e.fn.emulateTransitionEnd=n,e.event.special[i.TRANSITION_END]={bindType:t,delegateType:t,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}},i}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):(e=e||self).Button=t(e.jQuery)}(this,function(e){"use strict";function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var n="button",i=e.fn[n],r=function(){function n(e){this._element=e}var i,r,o,a=n.prototype;return a.toggle=function(){var t=!0,n=!0,i=e(this._element).closest('[data-toggle="buttons"]')[0];if(i){var r=this._element.querySelector('input:not([type="hidden"])');if(r){if("radio"===r.type)if(r.checked&&this._element.classList.contains("active"))t=!1;else{var o=i.querySelector(".active");o&&e(o).removeClass("active")}t&&("checkbox"!==r.type&&"radio"!==r.type||(r.checked=!this._element.classList.contains("active")),e(r).trigger("change")),r.focus(),n=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(n&&this._element.setAttribute("aria-pressed",!this._element.classList.contains("active")),t&&e(this._element).toggleClass("active"))},a.dispose=function(){e.removeData(this._element,"bs.button"),this._element=null},n._jQueryInterface=function(t){return this.each(function(){var i=e(this).data("bs.button");i||(i=new n(this),e(this).data("bs.button",i)),"toggle"===t&&i[t]()})},i=n,o=[{key:"VERSION",get:function(){return"4.5.0"}}],(r=null)&&t(i.prototype,r),o&&t(i,o),n}();return e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var n=t.target,i=n;if(e(n).hasClass("btn")||(n=e(n).closest(".btn")[0]),!n||n.hasAttribute("disabled")||n.classList.contains("disabled"))t.preventDefault();else{var o=n.querySelector('input:not([type="hidden"])');if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();"LABEL"===i.tagName&&o&&"checkbox"===o.type&&t.preventDefault(),r._jQueryInterface.call(e(n),"toggle")}}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){var n=e(t.target).closest(".btn")[0];e(n).toggleClass("focus",/^focus(in)?$/.test(t.type))}),e(window).on("load.bs.button.data-api",function(){for(var e=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),t=0,n=e.length;t<n;t++){var i=e[t],r=i.querySelector('input:not([type="hidden"])');r.checked||r.hasAttribute("checked")?i.classList.add("active"):i.classList.remove("active")}for(var o=0,a=(e=[].slice.call(document.querySelectorAll('[data-toggle="button"]'))).length;o<a;o++){var s=e[o];"true"===s.getAttribute("aria-pressed")?s.classList.add("active"):s.classList.remove("active")}}),e.fn[n]=r._jQueryInterface,e.fn[n].Constructor=r,e.fn[n].noConflict=function(){return e.fn[n]=i,r._jQueryInterface},r}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],t):(e=e||self).Collapse=t(e.jQuery,e.Util)}(this,function(e,t){"use strict";function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var a="collapse",s="bs.collapse",l=e.fn[a],u={toggle:!0,parent:""},c={toggle:"boolean",parent:"(string|element)"},h='[data-toggle="collapse"]',d=function(){function i(e,n){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(n),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var i=[].slice.call(document.querySelectorAll(h)),r=0,o=i.length;r<o;r++){var a=i[r],s=t.getSelectorFromElement(a),l=[].slice.call(document.querySelectorAll(s)).filter(function(t){return t===e});null!==s&&l.length>0&&(this._selector=s,this._triggerArray.push(a))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var r,l,d,f=i.prototype;return f.toggle=function(){e(this._element).hasClass("show")?this.hide():this.show()},f.show=function(){var n,r,o=this;if(!this._isTransitioning&&!e(this._element).hasClass("show")&&(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter(function(e){return"string"==typeof o._config.parent?e.getAttribute("data-parent")===o._config.parent:e.classList.contains("collapse")})).length&&(n=null),!(n&&(r=e(n).not(this._selector).data(s))&&r._isTransitioning))){var a=e.Event("show.bs.collapse");if(e(this._element).trigger(a),!a.isDefaultPrevented()){n&&(i._jQueryInterface.call(e(n).not(this._selector),"hide"),r||e(n).data(s,null));var l=this._getDimension();e(this._element).removeClass("collapse").addClass("collapsing"),this._element.style[l]=0,this._triggerArray.length&&e(this._triggerArray).removeClass("collapsed").attr("aria-expanded",!0),this.setTransitioning(!0);var u="scroll"+(l[0].toUpperCase()+l.slice(1)),c=t.getTransitionDurationFromElement(this._element);e(this._element).one(t.TRANSITION_END,function(){e(o._element).removeClass("collapsing").addClass("collapse show"),o._element.style[l]="",o.setTransitioning(!1),e(o._element).trigger("shown.bs.collapse")}).emulateTransitionEnd(c),this._element.style[l]=this._element[u]+"px"}}},f.hide=function(){var n=this;if(!this._isTransitioning&&e(this._element).hasClass("show")){var i=e.Event("hide.bs.collapse");if(e(this._element).trigger(i),!i.isDefaultPrevented()){var r=this._getDimension();this._element.style[r]=this._element.getBoundingClientRect()[r]+"px",t.reflow(this._element),e(this._element).addClass("collapsing").removeClass("collapse show");var o=this._triggerArray.length;if(o>0)for(var a=0;a<o;a++){var s=this._triggerArray[a],l=t.getSelectorFromElement(s);if(null!==l)e([].slice.call(document.querySelectorAll(l))).hasClass("show")||e(s).addClass("collapsed").attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[r]="";var u=t.getTransitionDurationFromElement(this._element);e(this._element).one(t.TRANSITION_END,function(){n.setTransitioning(!1),e(n._element).removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")}).emulateTransitionEnd(u)}}},f.setTransitioning=function(e){this._isTransitioning=e},f.dispose=function(){e.removeData(this._element,s),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},f._getConfig=function(e){return(e=o(o({},u),e)).toggle=Boolean(e.toggle),t.typeCheckConfig(a,e,c),e},f._getDimension=function(){return e(this._element).hasClass("width")?"width":"height"},f._getParent=function(){var n,r=this;t.isElement(this._config.parent)?(n=this._config.parent,void 0!==this._config.parent.jquery&&(n=this._config.parent[0])):n=document.querySelector(this._config.parent);var o='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',a=[].slice.call(n.querySelectorAll(o));return e(a).each(function(e,t){r._addAriaAndCollapsedClass(i._getTargetFromElement(t),[t])}),n},f._addAriaAndCollapsedClass=function(t,n){var i=e(t).hasClass("show");n.length&&e(n).toggleClass("collapsed",!i).attr("aria-expanded",i)},i._getTargetFromElement=function(e){var n=t.getSelectorFromElement(e);return n?document.querySelector(n):null},i._jQueryInterface=function(t){return this.each(function(){var n=e(this),r=n.data(s),a=o(o(o({},u),n.data()),"object"==typeof t&&t?t:{});if(!r&&a.toggle&&"string"==typeof t&&/show|hide/.test(t)&&(a.toggle=!1),r||(r=new i(this,a),n.data(s,r)),"string"==typeof t){if(void 0===r[t])throw new TypeError('No method named "'+t+'"');r[t]()}})},r=i,d=[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return u}}],(l=null)&&n(r.prototype,l),d&&n(r,d),i}();return e(document).on("click.bs.collapse.data-api",h,function(n){"A"===n.currentTarget.tagName&&n.preventDefault();var i=e(this),r=t.getSelectorFromElement(this),o=[].slice.call(document.querySelectorAll(r));e(o).each(function(){var t=e(this),n=t.data(s)?"toggle":i.data();d._jQueryInterface.call(t,n)})}),e.fn[a]=d._jQueryInterface,e.fn[a].Constructor=d,e.fn[a].noConflict=function(){return e.fn[a]=l,d._jQueryInterface},d}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery"),require("popper.js"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","popper.js","./util.js"],t):(e=e||self).Dropdown=t(e.jQuery,e.Popper,e.Util)}(this,function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var s="dropdown",l="bs.dropdown",u="."+l,c=e.fn[s],h=new RegExp("38|40|27"),d={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},f={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},p=function(){function r(e,t){this._element=e,this._popper=null,this._config=this._getConfig(t),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var o,c,p,m=r.prototype;return m.toggle=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")){var t=e(this._menu).hasClass("show");r._clearMenus(),t||this.show(!0)}},m.show=function(i){if(void 0===i&&(i=!1),!(this._element.disabled||e(this._element).hasClass("disabled")||e(this._menu).hasClass("show"))){var o={relatedTarget:this._element},a=e.Event("show.bs.dropdown",o),s=r._getParentFromElement(this._element);if(e(s).trigger(a),!a.isDefaultPrevented()){if(!this._inNavbar&&i){if(void 0===t)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var l=this._element;"parent"===this._config.reference?l=s:n.isElement(this._config.reference)&&(l=this._config.reference,void 0!==this._config.reference.jquery&&(l=this._config.reference[0])),"scrollParent"!==this._config.boundary&&e(s).addClass("position-static"),this._popper=new t(l,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===e(s).closest(".navbar-nav").length&&e(document.body).children().on("mouseover",null,e.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),e(this._menu).toggleClass("show"),e(s).toggleClass("show").trigger(e.Event("shown.bs.dropdown",o))}}},m.hide=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")&&e(this._menu).hasClass("show")){var t={relatedTarget:this._element},n=e.Event("hide.bs.dropdown",t),i=r._getParentFromElement(this._element);e(i).trigger(n),n.isDefaultPrevented()||(this._popper&&this._popper.destroy(),e(this._menu).toggleClass("show"),e(i).toggleClass("show").trigger(e.Event("hidden.bs.dropdown",t)))}},m.dispose=function(){e.removeData(this._element,l),e(this._element).off(u),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},m.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},m._addEventListeners=function(){var t=this;e(this._element).on("click.bs.dropdown",function(e){e.preventDefault(),e.stopPropagation(),t.toggle()})},m._getConfig=function(t){return t=a(a(a({},this.constructor.Default),e(this._element).data()),t),n.typeCheckConfig(s,t,this.constructor.DefaultType),t},m._getMenuElement=function(){if(!this._menu){var e=r._getParentFromElement(this._element);e&&(this._menu=e.querySelector(".dropdown-menu"))}return this._menu},m._getPlacement=function(){var t=e(this._element.parentNode),n="bottom-start";return t.hasClass("dropup")?n=e(this._menu).hasClass("dropdown-menu-right")?"top-end":"top-start":t.hasClass("dropright")?n="right-start":t.hasClass("dropleft")?n="left-start":e(this._menu).hasClass("dropdown-menu-right")&&(n="bottom-end"),n},m._detectNavbar=function(){return e(this._element).closest(".navbar").length>0},m._getOffset=function(){var e=this,t={};return"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=a(a({},t.offsets),e._config.offset(t.offsets,e._element)||{}),t}:t.offset=this._config.offset,t},m._getPopperConfig=function(){var e={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(e.modifiers.applyStyle={enabled:!1}),a(a({},e),this._config.popperConfig)},r._jQueryInterface=function(t){return this.each(function(){var n=e(this).data(l);if(n||(n=new r(this,"object"==typeof t?t:null),e(this).data(l,n)),"string"==typeof t){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}})},r._clearMenus=function(t){if(!t||3!==t.which&&("keyup"!==t.type||9===t.which))for(var n=[].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')),i=0,o=n.length;i<o;i++){var a=r._getParentFromElement(n[i]),s=e(n[i]).data(l),u={relatedTarget:n[i]};if(t&&"click"===t.type&&(u.clickEvent=t),s){var c=s._menu;if(e(a).hasClass("show")&&!(t&&("click"===t.type&&/input|textarea/i.test(t.target.tagName)||"keyup"===t.type&&9===t.which)&&e.contains(a,t.target))){var h=e.Event("hide.bs.dropdown",u);e(a).trigger(h),h.isDefaultPrevented()||("ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),n[i].setAttribute("aria-expanded","false"),s._popper&&s._popper.destroy(),e(c).removeClass("show"),e(a).removeClass("show").trigger(e.Event("hidden.bs.dropdown",u)))}}}},r._getParentFromElement=function(e){var t,i=n.getSelectorFromElement(e);return i&&(t=document.querySelector(i)),t||e.parentNode},r._dataApiKeydownHandler=function(t){if((/input|textarea/i.test(t.target.tagName)?!(32===t.which||27!==t.which&&(40!==t.which&&38!==t.which||e(t.target).closest(".dropdown-menu").length)):h.test(t.which))&&!this.disabled&&!e(this).hasClass("disabled")){var n=r._getParentFromElement(this),i=e(n).hasClass("show");if(i||27!==t.which){if(t.preventDefault(),t.stopPropagation(),!i||i&&(27===t.which||32===t.which))return 27===t.which&&e(n.querySelector('[data-toggle="dropdown"]')).trigger("focus"),void e(this).trigger("click");var o=[].slice.call(n.querySelectorAll(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)")).filter(function(t){return e(t).is(":visible")});if(0!==o.length){var a=o.indexOf(t.target);38===t.which&&a>0&&a--,40===t.which&&a<o.length-1&&a++,a<0&&(a=0),o[a].focus()}}}},o=r,p=[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return d}},{key:"DefaultType",get:function(){return f}}],(c=null)&&i(o.prototype,c),p&&i(o,p),r}();return e(document).on("keydown.bs.dropdown.data-api",'[data-toggle="dropdown"]',p._dataApiKeydownHandler).on("keydown.bs.dropdown.data-api",".dropdown-menu",p._dataApiKeydownHandler).on("click.bs.dropdown.data-api keyup.bs.dropdown.data-api",p._clearMenus).on("click.bs.dropdown.data-api",'[data-toggle="dropdown"]',function(t){t.preventDefault(),t.stopPropagation(),p._jQueryInterface.call(e(this),"toggle")}).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}),e.fn[s]=p._jQueryInterface,e.fn[s].Constructor=p,e.fn[s].noConflict=function(){return e.fn[s]=c,p._jQueryInterface},p}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],t):(e=e||self).Modal=t(e.jQuery,e.Util)}(this,function(e,t){"use strict";function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var a="modal",s=".bs.modal",l=e.fn.modal,u={backdrop:!0,keyboard:!0,focus:!0,show:!0},c={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},h=".modal-dialog",d=function(){function i(e,t){this._config=this._getConfig(t),this._element=e,this._dialog=e.querySelector(h),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var r,l,d,f=i.prototype;return f.toggle=function(e){return this._isShown?this.hide():this.show(e)},f.show=function(t){var n=this;if(!this._isShown&&!this._isTransitioning){e(this._element).hasClass("fade")&&(this._isTransitioning=!0);var i=e.Event("show.bs.modal",{relatedTarget:t});e(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),e(this._element).on("click.dismiss.bs.modal",'[data-dismiss="modal"]',function(e){return n.hide(e)}),e(this._dialog).on("mousedown.dismiss.bs.modal",function(){e(n._element).one("mouseup.dismiss.bs.modal",function(t){e(t.target).is(n._element)&&(n._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return n._showElement(t)}))}},f.hide=function(n){var i=this;if(n&&n.preventDefault(),this._isShown&&!this._isTransitioning){var r=e.Event("hide.bs.modal");if(e(this._element).trigger(r),this._isShown&&!r.isDefaultPrevented()){this._isShown=!1;var o=e(this._element).hasClass("fade");if(o&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),e(document).off("focusin.bs.modal"),e(this._element).removeClass("show"),e(this._element).off("click.dismiss.bs.modal"),e(this._dialog).off("mousedown.dismiss.bs.modal"),o){var a=t.getTransitionDurationFromElement(this._element);e(this._element).one(t.TRANSITION_END,function(e){return i._hideModal(e)}).emulateTransitionEnd(a)}else this._hideModal()}}},f.dispose=function(){[window,this._element,this._dialog].forEach(function(t){return e(t).off(s)}),e(document).off("focusin.bs.modal"),e.removeData(this._element,"bs.modal"),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},f.handleUpdate=function(){this._adjustDialog()},f._getConfig=function(e){return e=o(o({},u),e),t.typeCheckConfig(a,e,c),e},f._triggerBackdropTransition=function(){var n=this;if("static"===this._config.backdrop){var i=e.Event("hidePrevented.bs.modal");if(e(this._element).trigger(i),i.defaultPrevented)return;this._element.classList.add("modal-static");var r=t.getTransitionDurationFromElement(this._element);e(this._element).one(t.TRANSITION_END,function(){n._element.classList.remove("modal-static")}).emulateTransitionEnd(r),this._element.focus()}else this.hide()},f._showElement=function(n){var i=this,r=e(this._element).hasClass("fade"),o=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),e(this._dialog).hasClass("modal-dialog-scrollable")&&o?o.scrollTop=0:this._element.scrollTop=0,r&&t.reflow(this._element),e(this._element).addClass("show"),this._config.focus&&this._enforceFocus();var a=e.Event("shown.bs.modal",{relatedTarget:n}),s=function(){i._config.focus&&i._element.focus(),i._isTransitioning=!1,e(i._element).trigger(a)};if(r){var l=t.getTransitionDurationFromElement(this._dialog);e(this._dialog).one(t.TRANSITION_END,s).emulateTransitionEnd(l)}else s()},f._enforceFocus=function(){var t=this;e(document).off("focusin.bs.modal").on("focusin.bs.modal",function(n){document!==n.target&&t._element!==n.target&&0===e(t._element).has(n.target).length&&t._element.focus()})},f._setEscapeEvent=function(){var t=this;this._isShown?e(this._element).on("keydown.dismiss.bs.modal",function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()}):this._isShown||e(this._element).off("keydown.dismiss.bs.modal")},f._setResizeEvent=function(){var t=this;this._isShown?e(window).on("resize.bs.modal",function(e){return t.handleUpdate(e)}):e(window).off("resize.bs.modal")},f._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop(function(){e(document.body).removeClass("modal-open"),t._resetAdjustments(),t._resetScrollbar(),e(t._element).trigger("hidden.bs.modal")})},f._removeBackdrop=function(){this._backdrop&&(e(this._backdrop).remove(),this._backdrop=null)},f._showBackdrop=function(n){var i=this,r=e(this._element).hasClass("fade")?"fade":"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",r&&this._backdrop.classList.add(r),e(this._backdrop).appendTo(document.body),e(this._element).on("click.dismiss.bs.modal",function(e){i._ignoreBackdropClick?i._ignoreBackdropClick=!1:e.target===e.currentTarget&&i._triggerBackdropTransition()}),r&&t.reflow(this._backdrop),e(this._backdrop).addClass("show"),!n)return;if(!r)return void n();var o=t.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(t.TRANSITION_END,n).emulateTransitionEnd(o)}else if(!this._isShown&&this._backdrop){e(this._backdrop).removeClass("show");var a=function(){i._removeBackdrop(),n&&n()};if(e(this._element).hasClass("fade")){var s=t.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(t.TRANSITION_END,a).emulateTransitionEnd(s)}else a()}else n&&n()},f._adjustDialog=function(){var e=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&e&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!e&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},f._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},f._checkScrollbar=function(){var e=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(e.left+e.right)<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},f._setScrollbar=function(){var t=this;if(this._isBodyOverflowing){var n=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top")),i=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each(function(n,i){var r=i.style.paddingRight,o=e(i).css("padding-right");e(i).data("padding-right",r).css("padding-right",parseFloat(o)+t._scrollbarWidth+"px")}),e(i).each(function(n,i){var r=i.style.marginRight,o=e(i).css("margin-right");e(i).data("margin-right",r).css("margin-right",parseFloat(o)-t._scrollbarWidth+"px")});var r=document.body.style.paddingRight,o=e(document.body).css("padding-right");e(document.body).data("padding-right",r).css("padding-right",parseFloat(o)+this._scrollbarWidth+"px")}e(document.body).addClass("modal-open")},f._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"));e(t).each(function(t,n){var i=e(n).data("padding-right");e(n).removeData("padding-right"),n.style.paddingRight=i||""});var n=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each(function(t,n){var i=e(n).data("margin-right");void 0!==i&&e(n).css("margin-right",i).removeData("margin-right")});var i=e(document.body).data("padding-right");e(document.body).removeData("padding-right"),document.body.style.paddingRight=i||""},f._getScrollbarWidth=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},i._jQueryInterface=function(t,n){return this.each(function(){var r=e(this).data("bs.modal"),a=o(o(o({},u),e(this).data()),"object"==typeof t&&t?t:{});if(r||(r=new i(this,a),e(this).data("bs.modal",r)),"string"==typeof t){if(void 0===r[t])throw new TypeError('No method named "'+t+'"');r[t](n)}else a.show&&r.show(n)})},r=i,d=[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return u}}],(l=null)&&n(r.prototype,l),d&&n(r,d),i}();return e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(n){var i,r=this,a=t.getSelectorFromElement(this);a&&(i=document.querySelector(a));var s=e(i).data("bs.modal")?"toggle":o(o({},e(i).data()),e(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||n.preventDefault();var l=e(i).one("show.bs.modal",function(t){t.isDefaultPrevented()||l.one("hidden.bs.modal",function(){e(r).is(":visible")&&r.focus()})});d._jQueryInterface.call(e(i),s,this)}),e.fn.modal=d._jQueryInterface,e.fn.modal.Constructor=d,e.fn.modal.noConflict=function(){return e.fn.modal=l,d._jQueryInterface},d}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],t):(e=e||self).ScrollSpy=t(e.jQuery,e.Util)}(this,function(e,t){"use strict";function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var a="scrollspy",s=e.fn[a],l={offset:10,method:"auto",target:""},u={offset:"number",method:"string",target:"(string|element)"},c="scroll.bs.scrollspy",h=".nav-link",d=".list-group-item",f=".dropdown-item",p=function(){function i(t,n){var i=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(n),this._selector=this._config.target+" "+h+","+this._config.target+" "+d+","+this._config.target+" "+f,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,e(this._scrollElement).on(c,function(e){return i._process(e)}),this.refresh(),this._process()}var r,s,p,m=i.prototype;return m.refresh=function(){var n=this,i=this._scrollElement===this._scrollElement.window?"offset":"position",r="auto"===this._config.method?i:this._config.method,o="position"===r?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(n){var i,a=t.getSelectorFromElement(n);if(a&&(i=document.querySelector(a)),i){var s=i.getBoundingClientRect();if(s.width||s.height)return[e(i)[r]().top+o,a]}return null}).filter(function(e){return e}).sort(function(e,t){return e[0]-t[0]}).forEach(function(e){n._offsets.push(e[0]),n._targets.push(e[1])})},m.dispose=function(){e.removeData(this._element,"bs.scrollspy"),e(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},m._getConfig=function(n){if("string"!=typeof(n=o(o({},l),"object"==typeof n&&n?n:{})).target&&t.isElement(n.target)){var i=e(n.target).attr("id");i||(i=t.getUID(a),e(n.target).attr("id",i)),n.target="#"+i}return t.typeCheckConfig(a,n,u),n},m._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},m._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},m._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},m._process=function(){var e=this._getScrollTop()+this._config.offset,t=this._getScrollHeight(),n=this._config.offset+t-this._getOffsetHeight();if(this._scrollHeight!==t&&this.refresh(),e>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&e<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var r=this._offsets.length;r--;){this._activeTarget!==this._targets[r]&&e>=this._offsets[r]&&(void 0===this._offsets[r+1]||e<this._offsets[r+1])&&this._activate(this._targets[r])}}},m._activate=function(t){this._activeTarget=t,this._clear();var n=this._selector.split(",").map(function(e){return e+'[data-target="'+t+'"],'+e+'[href="'+t+'"]'}),i=e([].slice.call(document.querySelectorAll(n.join(","))));i.hasClass("dropdown-item")?(i.closest(".dropdown").find(".dropdown-toggle").addClass("active"),i.addClass("active")):(i.addClass("active"),i.parents(".nav, .list-group").prev(h+", "+d).addClass("active"),i.parents(".nav, .list-group").prev(".nav-item").children(h).addClass("active")),e(this._scrollElement).trigger("activate.bs.scrollspy",{relatedTarget:t})},m._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(e){return e.classList.contains("active")}).forEach(function(e){return e.classList.remove("active")})},i._jQueryInterface=function(t){return this.each(function(){var n=e(this).data("bs.scrollspy");if(n||(n=new i(this,"object"==typeof t&&t),e(this).data("bs.scrollspy",n)),"string"==typeof t){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}})},r=i,p=[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return l}}],(s=null)&&n(r.prototype,s),p&&n(r,p),i}();return e(window).on("load.bs.scrollspy.data-api",function(){for(var t=[].slice.call(document.querySelectorAll('[data-spy="scroll"]')),n=t.length;n--;){var i=e(t[n]);p._jQueryInterface.call(i,i.data())}}),e.fn[a]=p._jQueryInterface,e.fn[a].Constructor=p,e.fn[a].noConflict=function(){return e.fn[a]=s,p._jQueryInterface},p}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery"),require("./util.js")):"function"==typeof define&&define.amd?define(["jquery","./util.js"],t):(e=e||self).Tab=t(e.jQuery,e.Util)}(this,function(e,t){"use strict";function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var i=e.fn.tab,r=function(){function i(e){this._element=e}var r,o,a,s=i.prototype;return s.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&e(this._element).hasClass("active")||e(this._element).hasClass("disabled"))){var i,r,o=e(this._element).closest(".nav, .list-group")[0],a=t.getSelectorFromElement(this._element);if(o){var s="UL"===o.nodeName||"OL"===o.nodeName?"> li > .active":".active";r=(r=e.makeArray(e(o).find(s)))[r.length-1]}var l=e.Event("hide.bs.tab",{relatedTarget:this._element}),u=e.Event("show.bs.tab",{relatedTarget:r});if(r&&e(r).trigger(l),e(this._element).trigger(u),!u.isDefaultPrevented()&&!l.isDefaultPrevented()){a&&(i=document.querySelector(a)),this._activate(this._element,o);var c=function(){var t=e.Event("hidden.bs.tab",{relatedTarget:n._element}),i=e.Event("shown.bs.tab",{relatedTarget:r});e(r).trigger(t),e(n._element).trigger(i)};i?this._activate(i,i.parentNode,c):c()}}},s.dispose=function(){e.removeData(this._element,"bs.tab"),this._element=null},s._activate=function(n,i,r){var o=this,a=(!i||"UL"!==i.nodeName&&"OL"!==i.nodeName?e(i).children(".active"):e(i).find("> li > .active"))[0],s=r&&a&&e(a).hasClass("fade"),l=function(){return o._transitionComplete(n,a,r)};if(a&&s){var u=t.getTransitionDurationFromElement(a);e(a).removeClass("show").one(t.TRANSITION_END,l).emulateTransitionEnd(u)}else l()},s._transitionComplete=function(n,i,r){if(i){e(i).removeClass("active");var o=e(i.parentNode).find("> .dropdown-menu .active")[0];o&&e(o).removeClass("active"),"tab"===i.getAttribute("role")&&i.setAttribute("aria-selected",!1)}if(e(n).addClass("active"),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!0),t.reflow(n),n.classList.contains("fade")&&n.classList.add("show"),n.parentNode&&e(n.parentNode).hasClass("dropdown-menu")){var a=e(n).closest(".dropdown")[0];if(a){var s=[].slice.call(a.querySelectorAll(".dropdown-toggle"));e(s).addClass("active")}n.setAttribute("aria-expanded",!0)}r&&r()},i._jQueryInterface=function(t){return this.each(function(){var n=e(this),r=n.data("bs.tab");if(r||(r=new i(this),n.data("bs.tab",r)),"string"==typeof t){if(void 0===r[t])throw new TypeError('No method named "'+t+'"');r[t]()}})},r=i,a=[{key:"VERSION",get:function(){return"4.5.0"}}],(o=null)&&n(r.prototype,o),a&&n(r,a),i}();return e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',function(t){t.preventDefault(),r._jQueryInterface.call(e(this),"show")}),e.fn.tab=r._jQueryInterface,e.fn.tab.Constructor=r,e.fn.tab.noConflict=function(){return e.fn.tab=i,r._jQueryInterface},r}),function(e){if(void 0===e)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}($),function(){var e,t;e=window.jQuery,t=e(window),e.fn.stick_in_parent=function(n){var i,r,o,a,s,l,u,c,h,d,f,p,m;for(null==n&&(n={}),m=n.sticky_class,l=n.inner_scrolling,p=n.recalc_every,f=n.parent,h=n.offset_top,c=n.spacer,o=n.bottoming,null==h&&(h=0),null==f&&(f=void 0),null==l&&(l=!0),null==m&&(m="is_stuck"),i=e(document),null==o&&(o=!0),d=function(e){var t,n;return window.getComputedStyle?(e[0],t=window.getComputedStyle(e[0]),n=parseFloat(t.getPropertyValue("width"))+parseFloat(t.getPropertyValue("margin-left"))+parseFloat(t.getPropertyValue("margin-right")),"border-box"!==t.getPropertyValue("box-sizing")&&(n+=parseFloat(t.getPropertyValue("border-left-width"))+parseFloat(t.getPropertyValue("border-right-width"))+parseFloat(t.getPropertyValue("padding-left"))+parseFloat(t.getPropertyValue("padding-right"))),n):e.outerWidth(!0)},a=function(n,r,a,s,u,g,v,E){var y,_,T,b,w,x,R,H,S,M,C,A;if(!n.data("sticky_kit")){if(n.data("sticky_kit",!0),w=i.height(),R=n.parent(),null!=f&&(R=R.closest(f)),!R.length)throw"failed to find stick parent";if(T=!1,y=!1,(C=null!=c?c&&n.closest(c):e("<div />"))&&C.css("position",n.css("position")),(H=function(){var e,t,o;if(!E)return w=i.height(),e=parseInt(R.css("border-top-width"),10),t=parseInt(R.css("padding-top"),10),r=parseInt(R.css("padding-bottom"),10),a=R.offset().top+e+t,s=R.height(),T&&(T=!1,y=!1,null==c&&(n.insertAfter(C),C.detach()),n.css({position:"",top:"",width:"",bottom:""}).removeClass(m),o=!0),u=n.offset().top-(parseInt(n.css("margin-top"),10)||0)-h,g=n.outerHeight(!0),v=n.css("float"),C&&C.css({width:d(n),height:g,display:n.css("display"),"vertical-align":n.css("vertical-align"),float:v}),o?A():void 0})(),g!==s)return b=void 0,x=h,M=p,A=function(){var e,d,f,_,S,A;if(!E)return f=!1,null!=M&&(M-=1)<=0&&(M=p,H(),f=!0),f||i.height()===w||(H(),f=!0),_=t.scrollTop(),null!=b&&(d=_-b),b=_,T?(o&&(S=_+g+x>s+a,y&&!S&&(y=!1,n.css({position:"fixed",bottom:"",top:x}).trigger("sticky_kit:unbottom"))),_<u&&(T=!1,x=h,null==c&&("left"!==v&&"right"!==v||n.insertAfter(C),C.detach()),e={position:"",width:"",top:""},n.css(e).removeClass(m).trigger("sticky_kit:unstick")),l&&(A=t.height(),g+h>A&&(y||(x-=d,x=Math.max(A-g,x),x=Math.min(h,x),T&&n.css({top:x+"px"}))))):_>u&&(T=!0,(e={position:"fixed",top:x}).width="border-box"===n.css("box-sizing")?n.outerWidth()+"px":n.width()+"px",n.css(e).addClass(m),null==c&&(n.after(C),"left"!==v&&"right"!==v||C.append(n)),n.trigger("sticky_kit:stick")),T&&o&&(null==S&&(S=_+g+x>s+a),!y&&S)?(y=!0,"static"===R.css("position")&&R.css({position:"relative"}),n.css({position:"absolute",bottom:r,top:"auto"}).trigger("sticky_kit:bottom")):void 0},S=function(){return H(),A()},_=function(){if(E=!0,t.off("touchmove",A),t.off("scroll",A),t.off("resize",S),e(document.body).off("sticky_kit:recalc",S),n.off("sticky_kit:detach",_),n.removeData("sticky_kit"),n.css({position:"",bottom:"",top:"",width:""}),R.position("position",""),T)return null==c&&("left"!==v&&"right"!==v||n.insertAfter(C),C.remove()),n.removeClass(m)},t.on("touchmove",A),t.on("scroll",A),t.on("resize",S),e(document.body).on("sticky_kit:recalc",S),n.on("sticky_kit:detach",_),setTimeout(A,0)}},s=0,u=this.length;s<u;s++)r=this[s],a(e(r));return this}}.call(this),function(e){function t(t,n){var i,r=this,o=window.navigator,a=o.userAgent.toLowerCase();r.uid=e.rsModules.uid++,r.ns=".rs"+r.uid;var s,l=document.createElement("div").style,u=["webkit","Moz","ms","O"],c="",h=0;for(i=0;i<u.length;i++){var d=u[i];!c&&d+"Transform"in l&&(c=d),d=d.toLowerCase(),window.requestAnimationFrame||(window.requestAnimationFrame=window[d+"RequestAnimationFrame"],window.cancelAnimationFrame=window[d+"CancelAnimationFrame"]||window[d+"CancelRequestAnimationFrame"])}window.requestAnimationFrame||(window.requestAnimationFrame=function(e,t){var n=(new Date).getTime(),i=Math.max(0,16-(n-h)),r=window.setTimeout(function(){e(n+i)},i);return h=n+i,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)}),r.isIPAD=a.match(/(ipad)/),r.isIOS=r.isIPAD||a.match(/(iphone|ipod)/),u={},(i=function(e){return{browser:(e=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[])[1]||"",version:e[2]||"0"}}(a)).browser&&(u[i.browser]=!0,u.version=i.version),u.chrome&&(u.webkit=!0),r._browser=u,r.isAndroid=-1<a.indexOf("android"),r.slider=e(t),r.ev=e(r),r._doc=e(document),r.st=e.extend({},e.fn.royalSlider.defaults,n),r._currAnimSpeed=r.st.transitionSpeed,r._minPosOffset=0,!r.st.allowCSS3||u.webkit&&!r.st.allowCSS3OnWebkit||(i=c+(c?"T":"t"),r._useCSS3Transitions=i+"ransform"in l&&i+"ransition"in l,r._useCSS3Transitions&&(r._use3dTransform=c+(c?"P":"p")+"erspective"in l)),c=c.toLowerCase(),r._vendorPref="-"+c+"-",r._slidesHorizontal="vertical"!==r.st.slidesOrientation,r._reorderProp=r._slidesHorizontal?"left":"top",r._sizeProp=r._slidesHorizontal?"width":"height",r._prevNavItemId=-1,r._isMove="fade"!==r.st.transitionType,r._isMove||(r.st.sliderDrag=!1,r._fadeZIndex=10),r._opacityCSS="z-index:0; display:none; opacity:0;",r._newSlideId=0,r._sPosition=0,r._nextSlidePos=0,e.each(e.rsModules,function(e,t){"uid"!==e&&t.call(r)}),r.slides=[],r._idCount=0,(r.st.slides?e(r.st.slides):r.slider.children().detach()).each(function(){r._parseNode(this,!0)}),r.st.randomizeSlides&&r.slides.sort(function(){return.5-Math.random()}),r.numSlides=r.slides.length,r._refreshNumPreloadImages(),r.st.startSlideId?r.st.startSlideId>r.numSlides-1&&(r.st.startSlideId=r.numSlides-1):r.st.startSlideId=0,r._newSlideId=r.staticSlideId=r.currSlideId=r._realId=r.st.startSlideId,r.currSlide=r.slides[r.currSlideId],r._accelerationPos=0,r.pointerMultitouch=!1,r.slider.addClass((r._slidesHorizontal?"rsHor":"rsVer")+(r._isMove?"":" rsFade")),l='<div class="rsOverflow"><div class="rsContainer">',r.slidesSpacing=r.st.slidesSpacing,r._slideSize=(r._slidesHorizontal?r.slider.width():r.slider.height())+r.st.slidesSpacing,r._preload=0<r._numPreloadImages,1>=r.numSlides&&(r._loop=!1),r._loopHelpers=r._loop&&r._isMove?2===r.numSlides?1:2:0,r._maxImages=6>r.numSlides?r.numSlides:6,r._currBlockIndex=0,r._idOffset=0,r.slidesJQ=[];for(i=0;i<r.numSlides;i++)r.slidesJQ.push(e('<div style="'+(r._isMove?"":i!==r.currSlideId?r._opacityCSS:"z-index:0;")+'" class="rsSlide "></div>'));r._sliderOverflow=l=e(l+"</div></div>"),c=function(e,t,n,i,o){r._downEvent=e+t,r._moveEvent=e+n,r._upEvent=e+i,o&&(r._cancelEvent=e+o)},i=o.pointerEnabled,r.pointerEnabled=i||o.msPointerEnabled,r.pointerEnabled?(r.hasTouch=!1,r._lastItemFriction=.2,r.pointerMultitouch=1<o[(i?"m":"msM")+"axTouchPoints"],i?c("pointer","down","move","up","cancel"):c("MSPointer","Down","Move","Up","Cancel")):(r.isIOS?r._downEvent=r._moveEvent=r._upEvent=r._cancelEvent="":c("mouse","down","move","up"),"ontouchstart"in window||"createTouch"in document?(r.hasTouch=!0,r._downEvent+=" touchstart",r._moveEvent+=" touchmove",r._upEvent+=" touchend",r._cancelEvent+=" touchcancel",r._lastItemFriction=.5,r.st.sliderTouch&&(r._hasDrag=!0)):(r.hasTouch=!1,r._lastItemFriction=.2)),r.st.sliderDrag&&(r._hasDrag=!0,u.msie||u.opera?r._grabCursor=r._grabbingCursor="move":u.mozilla?(r._grabCursor="-moz-grab",r._grabbingCursor="-moz-grabbing"):u.webkit&&-1!=o.platform.indexOf("Mac")&&(r._grabCursor="-webkit-grab",r._grabbingCursor="-webkit-grabbing"),r._setGrabCursor()),r.slider.html(l),r._controlsContainer=r.st.controlsInside?r._sliderOverflow:r.slider,r._slidesContainer=r._sliderOverflow.children(".rsContainer"),r.pointerEnabled&&r._slidesContainer.css((i?"":"-ms-")+"touch-action",r._slidesHorizontal?"pan-y":"pan-x"),r._preloader=e('<div class="rsPreloader"></div>'),o=r._slidesContainer.children(".rsSlide"),r._currHolder=r.slidesJQ[r.currSlideId],r._selectedSlideHolder=0,r._eventCallbacks={dragStart:function(e){r._onDragStart(e)},dragStartThumb:function(e){r._onDragStart(e,!0)},touchmoveFix:function(){}},r._useCSS3Transitions?(r._TP="transition-property",r._TD="transition-duration",r._TTF="transition-timing-function",r._yProp=r._xProp=r._vendorPref+"transform",r._use3dTransform?(u.webkit&&!u.chrome&&r.slider.addClass("rsWebkit3d"),r._tPref1="translate3d(",r._tPref2="px, ",r._tPref3="px, 0px)"):(r._tPref1="translate(",r._tPref2="px, ",r._tPref3="px)"),r._isMove?r._slidesContainer[r._vendorPref+r._TP]=r._vendorPref+"transform":((u={})[r._vendorPref+r._TP]="opacity",u[r._vendorPref+r._TD]=r.st.transitionSpeed+"ms",u[r._vendorPref+r._TTF]=r.st.css3easeInOut,o.css(u))):(r._xProp="left",r._yProp="top"),r._slidesHorizontal&&r.slider.css("touch-action","pan-y"),e(window).on("resize"+r.ns,function(){s&&clearTimeout(s),s=setTimeout(function(){r.updateSliderSize()},50)}),r.ev.trigger("rsAfterPropsSetup"),r.updateSliderSize(),r.st.keyboardNavEnabled&&r._bindKeyboardNav(),r.st.arrowsNavHideOnTouch&&(r.hasTouch||r.pointerMultitouch)&&(r.st.arrowsNav=!1),r.st.arrowsNav&&(o=r._controlsContainer,e('<div class="rsArrow rsArrowLeft"><div class="rsArrowIcn"></div></div><div class="rsArrow rsArrowRight"><div class="rsArrowIcn"></div></div>').appendTo(o),r._arrowLeft=o.children(".rsArrowLeft").click(function(e){e.preventDefault(),r.prev()}),r._arrowRight=o.children(".rsArrowRight").click(function(e){e.preventDefault(),r.next()}),r.st.arrowsNavAutoHide&&!r.hasTouch&&(r._arrowLeft.addClass("rsHidden"),r._arrowRight.addClass("rsHidden"),o.one("mousemove.arrowshover",function(){r._arrowLeft.removeClass("rsHidden"),r._arrowRight.removeClass("rsHidden")}),o.hover(function(){r._arrowsAutoHideLocked||(r._arrowLeft.removeClass("rsHidden"),r._arrowRight.removeClass("rsHidden"))},function(){r._arrowsAutoHideLocked||(r._arrowLeft.addClass("rsHidden"),r._arrowRight.addClass("rsHidden"))})),r.ev.on("rsOnUpdateNav",function(){r._updateArrowsNav()}),r._updateArrowsNav()),r.hasTouch&&r.st.sliderTouch||!r.hasTouch&&r.st.sliderDrag?(r._bindPassiveEvent(r._slidesContainer[0],r._downEvent,r._eventCallbacks.dragStart,!1),r._bindPassiveEvent(r.slider[0],r._moveEvent,r._eventCallbacks.touchmoveFix,!1)):r.dragSuccess=!1;var f=["rsPlayBtnIcon","rsPlayBtn","rsCloseVideoBtn","rsCloseVideoIcn"];r._slidesContainer.click(function(t){if(!r.dragSuccess){var n=e(t.target).attr("class");if(-1!==e.inArray(n,f)&&r.toggleVideo())return!1;if(r.st.navigateByClick&&!r._blockActions){if(e(t.target).closest(".rsNoDrag",r._currHolder).length)return!0;r._mouseNext(t)}r.ev.trigger("rsSlideClick",t)}}).on("click.rs","a",function(e){if(r.dragSuccess)return!1;r._blockActions=!0,setTimeout(function(){r._blockActions=!1},3)}),r.ev.trigger("rsAfterInit")}e.rsModules||(e.rsModules={uid:0}),t.prototype={constructor:t,_mouseNext:function(e){(e=e[this._slidesHorizontal?"pageX":"pageY"]-this._sliderOffset)>=this._nextSlidePos?this.next():0>e&&this.prev()},_refreshNumPreloadImages:function(){var e=this.st.numImagesToPreload;(this._loop=this.st.loop)&&(2===this.numSlides?(this._loop=!1,this.st.loopRewind=!0):2>this.numSlides&&(this.st.loopRewind=this._loop=!1)),this._loop&&0<e&&(4>=this.numSlides?e=1:this.st.numImagesToPreload>(this.numSlides-1)/2&&(e=Math.floor((this.numSlides-1)/2))),this._numPreloadImages=e},_parseNode:function(t,n){function i(e,t){if(t?o.images.push(e.attr(t)):o.images.push(e.text()),a){a=!1,o.caption="src"===t?e.attr("alt"):e.contents(),o.image=o.images[0],o.videoURL=e.attr("data-rsVideo");var n=e.attr("data-rsw"),i=e.attr("data-rsh");void 0!==n&&!1!==n&&void 0!==i&&!1!==i?(o.iW=parseInt(n,10),o.iH=parseInt(i,10)):r.st.imgWidth&&r.st.imgHeight&&(o.iW=r.st.imgWidth,o.iH=r.st.imgHeight)}}var r=this,o={},a=!0;if(t=e(t),r._currContent=t,r.ev.trigger("rsBeforeParseNode",[t,o]),!o.stopParsing){if(t=r._currContent,o.id=r._idCount,o.contentAdded=!1,r._idCount++,o.images=[],o.isBig=!1,!o.hasCover){if(t.hasClass("rsImg"))var s=t,l=!0;else(s=t.find(".rsImg")).length&&(l=!0);l?(o.bigImage=s.eq(0).attr("data-rsBigImg"),s.each(function(){var t=e(this);t.is("a")?i(t,"href"):t.is("img")?i(t,"src"):i(t)})):t.is("img")&&(t.addClass("rsImg rsMainSlideImage").attr("alt","SlideImage"),i(t,"src"))}return(s=t.find(".rsCaption")).length&&(o.caption=s.remove()),o.content=t,r.ev.trigger("rsAfterParseNode",[t,o]),n&&r.slides.push(o),0===o.images.length&&(o.isLoaded=!0,o.isRendered=!1,o.isLoading=!1,o.images=null),o}},_bindKeyboardNav:function(){var e,t,n=this,i=function(e){37===e?n.prev():39===e&&n.next()};n._doc.on("keydown"+n.ns,function(r){if(!n.st.keyboardNavEnabled)return!0;if(!(n._isDragging||(t=r.keyCode,37!==t&&39!==t||e))){if(document.activeElement&&/(INPUT|SELECT|TEXTAREA)/i.test(document.activeElement.tagName))return!0;n.isFullscreen&&r.preventDefault(),i(t),e=setInterval(function(){i(t)},700)}}).on("keyup"+n.ns,function(t){e&&(clearInterval(e),e=null)})},goTo:function(e,t){e!==this.currSlideId&&this._moveTo(e,this.st.transitionSpeed,!0,!t)},destroy:function(t){this.ev.trigger("rsBeforeDestroy"),this._doc.off("keydown"+this.ns+" keyup"+this.ns),this._eventCallbacks.dragMove&&(this._unbindPassiveEvent(document,this._moveEvent,this._eventCallbacks.dragMove,!0),this._unbindPassiveEvent(document,this._upEvent,this._eventCallbacks.dragRelease,!0)),this._eventCallbacks.downEvent&&(this._unbindPassiveEvent(this._slidesContainer[0],this._downEvent,this._eventCallbacks.dragStart,!1),this._unbindPassiveEvent(this.slider[0],this._moveEvent,this._eventCallbacks.touchmoveFix,!1)),this._slidesContainer.off(this._downEvent+" click"),this.slider.data("royalSlider",null),e.removeData(this.slider,"royalSlider"),e(window).off("resize"+this.ns),this.loadingTimeout&&clearTimeout(this.loadingTimeout),t&&this.slider.remove(),this.ev=this.slider=this.slides=null},_updateBlocksContent:function(t,n){function i(n,i,a){n.isAdded?(r(i,n),o(i,n)):(a||(a=u.slidesJQ[i]),n.holder?a=n.holder:(a=u.slidesJQ[i]=e(a),n.holder=a),n.appendOnLoaded=!1,o(i,n,a),r(i,n),u._addBlockToContainer(n,a,t),n.isAdded=!0)}function r(e,n){n.contentAdded||(u.setItemHtml(n,t),t||(n.contentAdded=!0))}function o(e,t,n){u._isMove&&(n||(n=u.slidesJQ[e]),n.css(u._reorderProp,(e+u._idOffset+E)*u._slideSize))}function a(e){if(c){if(e>h-1)return a(e-h);if(0>e)return a(h+e)}return e}var s,l,u=this,c=u._loop,h=u.numSlides;if(!isNaN(n))return a(n);var d=u.currSlideId,f=t?Math.abs(u._prevSlideId-u.currSlideId)>=u.numSlides-1?0:1:u._numPreloadImages,p=Math.min(2,f),m=!1,g=!1;for(l=d;l<d+1+p;l++){var v=a(l);if((s=u.slides[v])&&(!s.isAdded||!s.positionSet)){m=!0;break}}for(l=d-1;l>d-1-p;l--)if(v=a(l),(s=u.slides[v])&&(!s.isAdded||!s.positionSet)){g=!0;break}if(m)for(l=d;l<d+f+1;l++){v=a(l);var E=Math.floor((u._realId-(d-l))/u.numSlides)*u.numSlides;(s=u.slides[v])&&i(s,v)}if(g)for(l=d-1;l>d-1-f;l--)v=a(l),E=Math.floor((u._realId-(d-l))/h)*h,(s=u.slides[v])&&i(s,v);if(!t)for(f=(p=a(d-f))>(d=a(d+f))?0:p,l=0;l<h;l++)p>d&&l>p-1||!(l<f||l>d)||(s=u.slides[l])&&s.holder&&(s.holder.detach(),s.isAdded=!1)},setItemHtml:function(t,n){var i=this,r=function(){if(t.images){if(!t.isLoading){if(t.content.hasClass("rsImg"))var n=t.content,r=!0;else n=t.content.find(".rsImg:not(img)");if(n&&!n.is("img")&&n.each(function(){var n=e(this),i='<img class="rsImg" src="'+(n.is("a")?n.attr("href"):n.text())+'" />';r?t.content=e(i):n.replaceWith(i)}),n=r?t.content:t.content.find("img.rsImg"),u(),n.eq(0).addClass("rsMainSlideImage").attr("alt","Slider Image"),t.iW&&t.iH&&(t.isLoaded||i._resizeImage(t),s()),t.isLoading=!0,t.isBig)e("<img />").on("load.rs error.rs",function(t){e(this).off("load.rs error.rs"),o([this],!0)}).attr("src",t.image);else{t.loaded=[],t.numStartedLoad=0,n=function(n){e(this).off("load.rs error.rs"),t.loaded.push(this),t.loaded.length===t.numStartedLoad&&o(t.loaded,!1)};for(var a=0;a<t.images.length;a++){var l=e("<img />");t.numStartedLoad++,l.on("load.rs error.rs",n).attr("src",t.images[a])}}}}else t.isRendered=!0,t.isLoaded=!0,t.isLoading=!1,s(!0)},o=function(e,n){if(e.length){var i=e[0];if(n!==t.isBig)(i=t.holder.children())&&1<i.length&&c();else if(t.iW&&t.iH)a();else if(t.iW=i.width,t.iH=i.height,t.iW&&t.iH)a();else{var r=new Image;r.onload=function(){r.width?(t.iW=r.width,t.iH=r.height,a()):setTimeout(function(){r.width&&(t.iW=r.width,t.iH=r.height),a()},1e3)},r.src=i.src}}else a()},a=function(){t.isLoaded=!0,t.isLoading=!1,s(),c(),l()},s=function(){if(!t.isAppended&&i.ev){var e=i.st.visibleNearby,r=t.id-i._newSlideId;n||t.appendOnLoaded||!i.st.fadeinLoadedSlide||0!==r&&(!(e||i._isAnimating||i._isDragging)||-1!==r&&1!==r)||((e={visibility:"visible",opacity:0})[i._vendorPref+"transition"]="opacity 400ms ease-in-out",t.content.css(e),setTimeout(function(){t.content.css("opacity",1)},16)),t.holder.find(".rsPreloader").length?t.holder.append(t.content):t.holder.html(t.content),t.isAppended=!0,t.isLoaded&&(i._resizeImage(t),l()),t.sizeReady||(t.sizeReady=!0,setTimeout(function(){i.ev.trigger("rsMaybeSizeReady",t)},100))}},l=function(){!t.loadedTriggered&&i.ev&&(t.isLoaded=t.loadedTriggered=!0,t.holder.trigger("rsAfterContentSet"),i.ev.trigger("rsAfterContentSet",t))},u=function(){i.st.usePreloader&&t.holder.html(i._preloader.clone())},c=function(e){i.st.usePreloader&&((e=t.holder.find(".rsPreloader")).length&&e.remove())};t.isLoaded?s():n?!i._isMove&&t.images&&t.iW&&t.iH?r():(t.holder.isWaiting=!0,u(),t.holder.slideId=-99):r()},_addBlockToContainer:function(e,t,n){this._slidesContainer.append(e.holder),e.appendOnLoaded=!1},_onDragStart:function(t,n){var i=this,r="touchstart"===t.type;if(i._isTouchGesture=r,i.ev.trigger("rsDragStart"),e(t.target).closest(".rsNoDrag",i._currHolder).length)return i.dragSuccess=!1,!0;if(!n&&i._isAnimating&&(i._wasAnimating=!0,i._stopAnimation()),i.dragSuccess=!1,i._isDragging)r&&(i._multipleTouches=!0);else{if(r&&(i._multipleTouches=!1),i._setGrabbingCursor(),r){var o=t.touches;if(!(o&&0<o.length))return;var a=o[0];1<o.length&&(i._multipleTouches=!0)}else t.preventDefault(),a=t;i._isDragging=!0,i._eventCallbacks.dragMove&&(i._unbindPassiveEvent(document,i._moveEvent,i._eventCallbacks.dragMove,!0),i._unbindPassiveEvent(document,i._upEvent,i._eventCallbacks.dragRelease,!0)),i._eventCallbacks.dragMove=function(e){i._onDragMove(e,n)},i._eventCallbacks.dragRelease=function(e){i._onDragRelease(e,n)},i._bindPassiveEvent(document,i._moveEvent,i._eventCallbacks.dragMove,!0),i._bindPassiveEvent(document,i._upEvent,i._eventCallbacks.dragRelease,!0),i._currMoveAxis="",i._hasMoved=!1,i._pageX=a.pageX,i._pageY=a.pageY,i._startPagePos=i._accelerationPos=(n?i._thumbsHorizontal:i._slidesHorizontal)?a.pageX:a.pageY,i._horDir=0,i._verDir=0,i._currRenderPosition=n?i._thumbsPosition:i._sPosition,i._startTime=(new Date).getTime(),r&&i._sliderOverflow.on(i._cancelEvent,function(e){i._onDragRelease(e,n)})}},_renderMovement:function(e,t){if(this._checkedAxis){var n=this._renderMoveTime,i=e.pageX-this._pageX,r=e.pageY-this._pageY,o=this._currRenderPosition+i,a=this._currRenderPosition+r,s=t?this._thumbsHorizontal:this._slidesHorizontal;o=s?o:a,a=this._currMoveAxis,this._hasMoved=!0,this._pageX=e.pageX,this._pageY=e.pageY,"x"===a&&0!==i?this._horDir=0<i?1:-1:"y"===a&&0!==r&&(this._verDir=0<r?1:-1),a=s?this._pageX:this._pageY,i=s?i:r,t?o>this._thumbsMinPosition?o=this._currRenderPosition+i*this._lastItemFriction:o<this._thumbsMaxPosition&&(o=this._currRenderPosition+i*this._lastItemFriction):this._loop||(0>=this.currSlideId&&0<a-this._startPagePos&&(o=this._currRenderPosition+i*this._lastItemFriction),this.currSlideId>=this.numSlides-1&&0>a-this._startPagePos&&(o=this._currRenderPosition+i*this._lastItemFriction)),this._currRenderPosition=o,200<n-this._startTime&&(this._startTime=n,this._accelerationPos=a),t?this._setThumbsPosition(this._currRenderPosition):this._isMove&&this._setPosition(this._currRenderPosition)}},_onDragMove:function(e,t){var n=this,i="touchmove"===e.type;if(!n._isTouchGesture||i){if(i){if(n._lockAxis)return;var r=e.touches;if(!r)return;if(1<r.length)return;var o=r[0]}else o=e;if(n._hasMoved||(n._useCSS3Transitions&&(t?n._thumbsContainer:n._slidesContainer).css(n._vendorPref+n._TD,"0s"),function e(){n._isDragging&&(n._animFrame=requestAnimationFrame(e),n._renderMoveEvent&&n._renderMovement(n._renderMoveEvent,t))}()),n._checkedAxis)e.preventDefault(),n._renderMoveTime=(new Date).getTime(),n._renderMoveEvent=o;else if(r=t?n._thumbsHorizontal:n._slidesHorizontal,7<(o=Math.abs(o.pageX-n._pageX)-Math.abs(o.pageY-n._pageY)-(r?-7:7))){if(r)e.preventDefault(),n._currMoveAxis="x";else if(i)return void n._completeGesture(e);n._checkedAxis=!0}else if(-7>o){if(r){if(i)return void n._completeGesture(e)}else e.preventDefault(),n._currMoveAxis="y";n._checkedAxis=!0}}},_completeGesture:function(e,t){this._lockAxis=!0,this._hasMoved=this._isDragging=!1,this._onDragRelease(e)},_onDragRelease:function(t,n){function i(e){return 100>e?100:500<e?500:e}function r(e,t){(a._isMove||n)&&(g=(-a._realId-a._idOffset)*a._slideSize,o=Math.abs(a._sPosition-g),a._currAnimSpeed=o/t,e&&(a._currAnimSpeed+=250),a._currAnimSpeed=i(a._currAnimSpeed),a._animateTo(g,!1))}var o,a=this,s=-1<t.type.indexOf("touch");if(!a._isTouchGesture||s)if(a._isTouchGesture=!1,a.ev.trigger("rsDragRelease"),a._renderMoveEvent=null,a._isDragging=!1,a._lockAxis=!1,a._checkedAxis=!1,a._renderMoveTime=0,cancelAnimationFrame(a._animFrame),a._hasMoved&&(n?a._setThumbsPosition(a._currRenderPosition):a._isMove&&a._setPosition(a._currRenderPosition)),a._eventCallbacks.dragMove&&(a._unbindPassiveEvent(document,a._moveEvent,a._eventCallbacks.dragMove,!0),a._unbindPassiveEvent(document,a._upEvent,a._eventCallbacks.dragRelease,!0)),s&&a._sliderOverflow.off(a._cancelEvent),a._setGrabCursor(),!a._hasMoved&&!a._multipleTouches&&n&&a._thumbsEnabled){var l=e(t.target).closest(".rsNavItem");l.length&&a.goTo(l.index())}else{if(l=n?a._thumbsHorizontal:a._slidesHorizontal,!a._hasMoved||"y"===a._currMoveAxis&&l||"x"===a._currMoveAxis&&!l){if(n||!a._wasAnimating)return a._wasAnimating=!1,void(a.dragSuccess=!1);if(a._wasAnimating=!1,a.st.navigateByClick)return a._mouseNext(t),void(a.dragSuccess=!0);a.dragSuccess=!0}else a.dragSuccess=!0;a._wasAnimating=!1,a._currMoveAxis="";var u=a.st.minSlideOffset;s=s?t.changedTouches[0]:t;var c=l?s.pageX:s.pageY,h=a._startPagePos,d=a.currSlideId,f=a.numSlides,p=l?a._horDir:a._verDir,m=a._loop;if(s=c-a._accelerationPos,l=(new Date).getTime()-a._startTime,l=Math.abs(s)/l,0===p||1>=f)r(!0,l);else{if(!m&&!n)if(0>=d){if(0<p)return void r(!0,l)}else if(d>=f-1&&0>p)return void r(!0,l);if(n){var g=a._thumbsPosition;if(g>a._thumbsMinPosition)g=a._thumbsMinPosition;else if(g<a._thumbsMaxPosition)g=a._thumbsMaxPosition;else{c=l*l/.006;var v=-a._thumbsPosition;if(h=a._thumbsContainerSize-a._thumbsViewportSize+a._thumbsPosition,0<s&&c>v?(l=l*(v+=a._thumbsViewportSize/(15/(c/l*.003)))/c,c=v):0>s&&c>h&&(l=l*(h+=a._thumbsViewportSize/(15/(c/l*.003)))/c,c=h),v=Math.max(Math.round(l/.003),50),(g+=c*(0>s?-1:1))>a._thumbsMinPosition)return void a._animateThumbsTo(g,v,!0,a._thumbsMinPosition,200);if(g<a._thumbsMaxPosition)return void a._animateThumbsTo(g,v,!0,a._thumbsMaxPosition,200)}a._animateThumbsTo(g,v,!0)}else v=function(e){var t=Math.floor(e/a._slideSize);return e-t*a._slideSize>u&&t++,t},h+u<c?0>p?r(!1,l):(v=v(c-h),a._moveTo(a.currSlideId-v,i(Math.abs(a._sPosition-(-a._realId-a._idOffset+v)*a._slideSize)/l),!1,!0,!0)):h-u>c?0<p?r(!1,l):(v=v(h-c),a._moveTo(a.currSlideId+v,i(Math.abs(a._sPosition-(-a._realId-a._idOffset-v)*a._slideSize)/l),!1,!0,!0)):r(!1,l)}}},_setPosition:function(e){e=this._sPosition=e,this._useCSS3Transitions?this._slidesContainer.css(this._xProp,this._tPref1+(this._slidesHorizontal?e+this._tPref2+0:0+this._tPref2+e)+this._tPref3):this._slidesContainer.css(this._slidesHorizontal?this._xProp:this._yProp,e)},updateSliderSize:function(e){if(this.slider){if(this.st.autoScaleSlider){var t=this.st.autoScaleSliderWidth,n=this.st.autoScaleSliderHeight;if(this.st.autoScaleHeight){var i=this.slider.width();i!=this.width&&(this.slider.css("height",n/t*i),i=this.slider.width());var r=this.slider.height()}else(r=this.slider.height())!=this.height&&(this.slider.css("width",t/n*r),r=this.slider.height()),i=this.slider.width()}else i=this.slider.width(),r=this.slider.height();if(e||i!=this.width||r!=this.height){for(this.width=i,this.height=r,this._wrapWidth=i,this._wrapHeight=r,this.ev.trigger("rsBeforeSizeSet"),this.ev.trigger("rsAfterSizePropSet"),this._sliderOverflow.css({width:this._wrapWidth,height:this._wrapHeight}),this._slideSize=(this._slidesHorizontal?this._wrapWidth:this._wrapHeight)+this.st.slidesSpacing,this._imagePadding=this.st.imageScalePadding,i=0;i<this.slides.length;i++)(e=this.slides[i]).positionSet=!1,e&&e.images&&e.isLoaded&&(e.isRendered=!1,this._resizeImage(e));if(this._cloneHolders)for(i=0;i<this._cloneHolders.length;i++)(e=this._cloneHolders[i]).holder.css(this._reorderProp,(e.id+this._idOffset)*this._slideSize);this._updateBlocksContent(),this._isMove&&(this._useCSS3Transitions&&this._slidesContainer.css(this._vendorPref+"transition-duration","0s"),this._setPosition((-this._realId-this._idOffset)*this._slideSize)),this.ev.trigger("rsOnUpdateNav")}this._sliderOffset=this._sliderOverflow.offset(),this._sliderOffset=this._sliderOffset[this._reorderProp]}},appendSlide:function(t,n){var i=this._parseNode(t);(isNaN(n)||n>this.numSlides)&&(n=this.numSlides),this.slides.splice(n,0,i),this.slidesJQ.splice(n,0,e('<div style="'+(this._isMove?"position:absolute;":this._opacityCSS)+'" class="rsSlide"></div>')),n<=this.currSlideId&&this.currSlideId++,this.ev.trigger("rsOnAppendSlide",[i,n]),this._refreshSlides(n),n===this.currSlideId&&this.ev.trigger("rsAfterSlideChange")},removeSlide:function(e){var t=this.slides[e];t&&(t.holder&&t.holder.remove(),e<this.currSlideId&&this.currSlideId--,this.slides.splice(e,1),this.slidesJQ.splice(e,1),this.ev.trigger("rsOnRemoveSlide",[e]),this._refreshSlides(e),e===this.currSlideId&&this.ev.trigger("rsAfterSlideChange"))},_refreshSlides:function(e){var t=this;for(e=t.numSlides,e=0>=t._realId?0:Math.floor(t._realId/e),t.numSlides=t.slides.length,0===t.numSlides?(t.currSlideId=t._idOffset=t._realId=0,t.currSlide=t._oldHolder=null):t._realId=e*t.numSlides+t.currSlideId,e=0;e<t.numSlides;e++)t.slides[e].id=e;t.currSlide=t.slides[t.currSlideId],t._currHolder=t.slidesJQ[t.currSlideId],t.currSlideId>=t.numSlides?t.goTo(t.numSlides-1):0>t.currSlideId&&t.goTo(0),t._refreshNumPreloadImages(),t._isMove&&t._slidesContainer.css(t._vendorPref+t._TD,"0ms"),t._refreshSlidesTimeout&&clearTimeout(t._refreshSlidesTimeout),t._refreshSlidesTimeout=setTimeout(function(){t._isMove&&t._setPosition((-t._realId-t._idOffset)*t._slideSize),t._updateBlocksContent(),t._isMove||t._currHolder.css({display:"block",opacity:1})},14),t.ev.trigger("rsOnUpdateNav")},_setGrabCursor:function(){this._hasDrag&&this._isMove&&(this._grabCursor?this._sliderOverflow.css("cursor",this._grabCursor):(this._sliderOverflow.removeClass("grabbing-cursor"),this._sliderOverflow.addClass("grab-cursor")))},_setGrabbingCursor:function(){this._hasDrag&&this._isMove&&(this._grabbingCursor?this._sliderOverflow.css("cursor",this._grabbingCursor):(this._sliderOverflow.removeClass("grab-cursor"),this._sliderOverflow.addClass("grabbing-cursor")))},next:function(e){this._moveTo("next",this.st.transitionSpeed,!0,!e)},prev:function(e){this._moveTo("prev",this.st.transitionSpeed,!0,!e)},_moveTo:function(e,t,n,i,r){var o=this;o.ev.trigger("rsBeforeMove",[e,i]);var a="next"===e?o.currSlideId+1:"prev"===e?o.currSlideId-1:e=parseInt(e,10);if(!o._loop){if(0>a)return void o._doBackAndForthAnim("left",!i);if(a>=o.numSlides)return void o._doBackAndForthAnim("right",!i)}o._isAnimating&&(o._stopAnimation(!0),n=!1);var s=a-o.currSlideId;a=o._prevSlideId=o.currSlideId;var l,u=o.currSlideId+s;i=o._realId,o._loop?(u=o._updateBlocksContent(!1,u),i+=s):i=u,o._newSlideId=u,o._oldHolder=o.slidesJQ[o.currSlideId],o._realId=i,o.currSlideId=o._newSlideId,o.currSlide=o.slides[o.currSlideId],o._currHolder=o.slidesJQ[o.currSlideId],u=o.st.slidesDiff;var c=0<s;s=Math.abs(s);var h=Math.floor(a/o._numPreloadImages),d=Math.floor((a+(c?u:-u))/o._numPreloadImages);if((h=(c?Math.max(h,d):Math.min(h,d))*o._numPreloadImages+(c?o._numPreloadImages-1:0))>o.numSlides-1?h=o.numSlides-1:0>h&&(h=0),(a=c?h-a:a-h)>o._numPreloadImages&&(a=o._numPreloadImages),s>a+u)for(o._idOffset+=(s-(a+u))*(c?-1:1),t*=1.4,a=0;a<o.numSlides;a++)o.slides[a].positionSet=!1;o._currAnimSpeed=t,o._updateBlocksContent(!0),r||(l=!0);var f=(-i-o._idOffset)*o._slideSize;l?setTimeout(function(){o._isWorking=!1,o._animateTo(f,e,!1,n),o.ev.trigger("rsOnUpdateNav")},0):(o._animateTo(f,e,!1,n),o.ev.trigger("rsOnUpdateNav"))},_updateArrowsNav:function(){this.st.arrowsNav&&(1>=this.numSlides?(this._arrowLeft.css("display","none"),this._arrowRight.css("display","none")):(this._arrowLeft.css("display","block"),this._arrowRight.css("display","block"),this._loop||this.st.loopRewind||(0===this.currSlideId?this._arrowLeft.addClass("rsArrowDisabled"):this._arrowLeft.removeClass("rsArrowDisabled"),this.currSlideId===this.numSlides-1?this._arrowRight.addClass("rsArrowDisabled"):this._arrowRight.removeClass("rsArrowDisabled"))))},_animateTo:function(t,n,i,r,o){function a(){var e;u&&(e=u.data("rsTimeout"))&&(u!==c&&u.css({opacity:0,display:"none",zIndex:0}),clearTimeout(e),u.data("rsTimeout","")),(e=c.data("rsTimeout"))&&(clearTimeout(e),c.data("rsTimeout",""))}var s=this,l={};if(isNaN(s._currAnimSpeed)&&(s._currAnimSpeed=400),s._sPosition=s._currRenderPosition=t,s.ev.trigger("rsBeforeAnimStart"),s._useCSS3Transitions)if(s._isMove)s._currAnimSpeed=parseInt(s._currAnimSpeed,10),i=s._vendorPref+s._TTF,l[s._vendorPref+s._TD]=s._currAnimSpeed+"ms",l[i]=r?e.rsCSS3Easing[s.st.easeInOut]:e.rsCSS3Easing[s.st.easeOut],s._slidesContainer.css(l),r||!s.hasTouch?setTimeout(function(){s._setPosition(t)},5):s._setPosition(t);else{s._currAnimSpeed=s.st.transitionSpeed;var u=s._oldHolder,c=s._currHolder;c.data("rsTimeout")&&c.css("opacity",0),a(),u&&u.data("rsTimeout",setTimeout(function(){l[s._vendorPref+s._TD]="0ms",l.zIndex=0,l.display="none",u.data("rsTimeout",""),u.css(l),setTimeout(function(){u.css("opacity",0)},16)},s._currAnimSpeed+60)),l.display="block",l.zIndex=s._fadeZIndex,l.opacity=0,l[s._vendorPref+s._TD]="0ms",l[s._vendorPref+s._TTF]=e.rsCSS3Easing[s.st.easeInOut],c.css(l),c.data("rsTimeout",setTimeout(function(){c.css(s._vendorPref+s._TD,s._currAnimSpeed+"ms"),c.data("rsTimeout",setTimeout(function(){c.css("opacity",1),c.data("rsTimeout","")},20))},20))}else s._isMove?(l[s._slidesHorizontal?s._xProp:s._yProp]=t+"px",s._slidesContainer.animate(l,s._currAnimSpeed,r?s.st.easeInOut:s.st.easeOut)):(u=s._oldHolder,(c=s._currHolder).stop(!0,!0).css({opacity:0,display:"block",zIndex:s._fadeZIndex}),s._currAnimSpeed=s.st.transitionSpeed,c.animate({opacity:1},s._currAnimSpeed,s.st.easeInOut),a(),u&&u.data("rsTimeout",setTimeout(function(){u.stop(!0,!0).css({opacity:0,display:"none",zIndex:0})},s._currAnimSpeed+60)));s._isAnimating=!0,s.loadingTimeout&&clearTimeout(s.loadingTimeout),s.loadingTimeout=o?setTimeout(function(){s.loadingTimeout=null,o.call()},s._currAnimSpeed+60):setTimeout(function(){s.loadingTimeout=null,s._animationComplete(n)},s._currAnimSpeed+60)},_stopAnimation:function(e){if(this._isAnimating=!1,clearTimeout(this.loadingTimeout),this._isMove)if(this._useCSS3Transitions){if(!e){e=this._sPosition;var t=this._currRenderPosition=this._getTransformProp();this._slidesContainer.css(this._vendorPref+this._TD,"0ms"),e!==t&&this._setPosition(t)}}else this._slidesContainer.stop(!0),this._sPosition=parseInt(this._slidesContainer.css(this._slidesHorizontal?this._xProp:this._yProp),10);else 20<this._fadeZIndex?this._fadeZIndex=10:this._fadeZIndex++},_getTransformProp:function(){var e=window.getComputedStyle(this._slidesContainer.get(0),null).getPropertyValue(this._vendorPref+"transform").replace(/^matrix\(/i,"").split(/, |\)$/g),t=0===e[0].indexOf("matrix3d");return parseInt(e[this._slidesHorizontal?t?12:4:t?13:5],10)},_getCSS3Prop:function(e,t){return this._useCSS3Transitions?this._tPref1+(t?e+this._tPref2+0:0+this._tPref2+e)+this._tPref3:e},_animationComplete:function(e){this._isMove||(this._currHolder.css("z-index",0),this._fadeZIndex=10),this._isAnimating=!1,this.staticSlideId=this.currSlideId,this._updateBlocksContent(),this._slidesMoved=!1,this.ev.trigger("rsAfterSlideChange")},_doBackAndForthAnim:function(e,t){var n=this,i=(-n._realId-n._idOffset)*n._slideSize;if(0!==n.numSlides&&!n._isAnimating)if(n.st.loopRewind)n.goTo("left"===e?n.numSlides-1:0,t);else if(n._isMove){n._currAnimSpeed=200;var r=function(){n._isAnimating=!1};n._animateTo(i+("left"===e?30:-30),"",!1,!0,function(){n._isAnimating=!1,n._animateTo(i,"",!1,!0,r)})}},_detectPassiveSupport:function(){var e=this;if(!e._passiveChecked){e._passiveChecked=!0,e._passiveParam=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e._passiveParam={passive:!1}}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}},_bindPassiveEvent:function(e,t,n,i){this._detectPassiveSupport(),t=t.split(" ");for(var r=0;r<t.length;r++)t[r]&&2<t[r].length&&e.addEventListener(t[r],n,!!i&&this._passiveParam)},_unbindPassiveEvent:function(e,t,n,i){this._detectPassiveSupport(),t=t.split(" ");for(var r=0;r<t.length;r++)t[r]&&2<t[r].length&&e.removeEventListener(t[r],n,!!i&&this._passiveParam)},_resizeImage:function(t,n){if(!t.isRendered){var i=t.content,r="rsMainSlideImage",o=e.isFunction(this.st.imageAlignCenter)?this.st.imageAlignCenter(t):this.st.imageAlignCenter,a=e.isFunction(this.st.imageScaleMode)?this.st.imageScaleMode(t):this.st.imageScaleMode;if(t.videoURL)if(r="rsVideoContainer","fill"!==a)var s=!0;else{var l=i;l.hasClass(r)||(l=l.find("."+r)),l.css({width:"100%",height:"100%"}),r="rsMainSlideImage"}if(i.hasClass(r)||(i=i.find("."+r)),i){var u=t.iW,c=t.iH;if(t.isRendered=!0,"none"!==a||o){r="fill"!==a?this._imagePadding:0,l=this._wrapWidth-2*r;var h=this._wrapHeight-2*r,d={};if("fit-if-smaller"===a&&(u>l||c>h)&&(a="fit"),"fill"===a||"fit"===a){var f=l/u,p=h/c;f="fill"==a?f>p?f:p:"fit"==a?f<p?f:p:1,u=Math.ceil(u*f,10),c=Math.ceil(c*f,10)}"none"!==a&&(d.width=u,d.height=c,s&&i.find(".rsImg").css({width:"100%",height:"100%"})),o&&(d.marginLeft=Math.floor((l-u)/2)+r,d.marginTop=Math.floor((h-c)/2)+r),i.css(d)}}}}},e.rsProto=t.prototype,e.fn.royalSlider=function(n){var i=arguments;return this.each(function(){var r=e(this);if("object"!=typeof n&&n){if((r=r.data("royalSlider"))&&r[n])return r[n].apply(r,Array.prototype.slice.call(i,1))}else r.data("royalSlider")||r.data("royalSlider",new t(r,n))})},e.fn.royalSlider.defaults={slidesSpacing:8,startSlideId:0,loop:!1,loopRewind:!1,numImagesToPreload:4,fadeinLoadedSlide:!0,slidesOrientation:"horizontal",transitionType:"move",transitionSpeed:600,controlNavigation:"bullets",controlsInside:!0,arrowsNav:!0,arrowsNavAutoHide:!0,navigateByClick:!0,randomizeSlides:!1,sliderDrag:!0,sliderTouch:!0,keyboardNavEnabled:!1,fadeInAfterLoaded:!0,allowCSS3:!0,allowCSS3OnWebkit:!0,addActiveClass:!1,autoHeight:!1,easeOut:"easeOutSine",easeInOut:"easeInOutSine",minSlideOffset:10,imageScaleMode:"fit-if-smaller",imageAlignCenter:!0,imageScalePadding:4,usePreloader:!0,autoScaleSlider:!1,autoScaleSliderWidth:800,autoScaleSliderHeight:400,autoScaleHeight:!0,arrowsNavHideOnTouch:!1,globalCaption:!1,slidesDiff:2},e.rsCSS3Easing={easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)"},e.extend(jQuery.easing,{easeInOutSine:function(e,t,n,i,r){return-i/2*(Math.cos(Math.PI*t/r)-1)+n},easeOutSine:function(e,t,n,i,r){return i*Math.sin(t/r*(Math.PI/2))+n},easeOutCubic:function(e,t,n,i,r){return i*((t=t/r-1)*t*t+1)+n}})}(jQuery,window),function(e){e.extend(e.rsProto,{_initBullets:function(){var t=this;"bullets"===t.st.controlNavigation&&(t.ev.one("rsAfterPropsSetup",function(){t._controlNavEnabled=!0,t.slider.addClass("rsWithBullets");for(var n='<div class="rsNav rsBullets">',i=0;i<t.numSlides;i++)n+='<div class="rsNavItem rsBullet"><span></span></div>';t._controlNav=n=e(n+"</div>"),t._controlNavItems=n.appendTo(t.slider).children(),t._controlNav.on("click.rs",".rsNavItem",function(n){t._thumbsDrag||t.goTo(e(this).index())})}),t.ev.on("rsOnAppendSlide",function(e,n,i){i>=t.numSlides?t._controlNav.append('<div class="rsNavItem rsBullet"><span></span></div>'):t._controlNavItems.eq(i).before('<div class="rsNavItem rsBullet"><span></span></div>'),t._controlNavItems=t._controlNav.children()}),t.ev.on("rsOnRemoveSlide",function(e,n){var i=t._controlNavItems.eq(n);i&&i.length&&(i.remove(),t._controlNavItems=t._controlNav.children())}),t.ev.on("rsOnUpdateNav",function(){var e=t.currSlideId;t._prevNavItem&&t._prevNavItem.removeClass("rsNavSelected"),(e=t._controlNavItems.eq(e)).addClass("rsNavSelected"),t._prevNavItem=e}))}}),e.rsModules.bullets=e.rsProto._initBullets}(jQuery),function(e){e.extend(e.rsProto,{_initThumbs:function(){var t=this;"thumbnails"===t.st.controlNavigation&&(t._thumbsDefaults={drag:!0,touch:!0,orientation:"horizontal",navigation:!0,arrows:!0,arrowLeft:null,arrowRight:null,spacing:4,arrowsAutoHide:!1,appendSpan:!1,transitionSpeed:600,autoCenter:!0,fitInViewport:!0,firstMargin:!0,paddingTop:0,paddingBottom:0},t.st.thumbs=e.extend({},t._thumbsDefaults,t.st.thumbs),t._firstThumbMoved=!0,!1===t.st.thumbs.firstMargin?t.st.thumbs.firstMargin=0:!0===t.st.thumbs.firstMargin&&(t.st.thumbs.firstMargin=t.st.thumbs.spacing),t.ev.on("rsBeforeParseNode",function(t,n,i){n=e(n),i.thumbnail=n.find(".rsTmb").remove(),i.thumbnail.length?i.thumbnail=e(document.createElement("div")).append(i.thumbnail).html():(i.thumbnail=n.attr("data-rsTmb"),i.thumbnail||(i.thumbnail=n.find(".rsImg").attr("data-rsTmb")),i.thumbnail=i.thumbnail?'<img src="'+i.thumbnail+'" alt="Slider Image"/>':"")}),t.ev.one("rsAfterPropsSetup",function(){t._createThumbs()}),t._prevNavItem=null,t.ev.on("rsOnUpdateNav",function(){var n=e(t._controlNavItems[t.currSlideId]);n!==t._prevNavItem&&(t._prevNavItem&&(t._prevNavItem.removeClass("rsNavSelected"),t._prevNavItem=null),t._thumbsNavigation&&t._setCurrentThumb(t.currSlideId),t._prevNavItem=n.addClass("rsNavSelected"))}),t.ev.on("rsOnAppendSlide",function(e,n,i){e="<div"+t._thumbsMargin+' class="rsNavItem rsThumb">'+t._addThumbHTML+n.thumbnail+"</div>",t._useCSS3Transitions&&t._thumbsContainer.css(t._vendorPref+"transition-duration","0ms"),i>=t.numSlides?t._thumbsContainer.append(e):t._controlNavItems.eq(i).before(e),t._controlNavItems=t._thumbsContainer.children(),t.updateThumbsSize(!0)}),t.ev.on("rsOnRemoveSlide",function(e,n){var i=t._controlNavItems.eq(n);i&&(t._useCSS3Transitions&&t._thumbsContainer.css(t._vendorPref+"transition-duration","0ms"),i.remove(),t._controlNavItems=t._thumbsContainer.children(),t.updateThumbsSize(!0))}))},_createThumbs:function(){var t,n=this,i="rsThumbs",r=n.st.thumbs,o="",a=r.spacing;n._controlNavEnabled=!0,n._thumbsHorizontal="vertical"!==r.orientation,n._thumbsMargin=t=a?' style="margin-'+(n._thumbsHorizontal?"right":"bottom")+":"+a+'px;"':"",n._thumbsPosition=0,n._isThumbsAnimating=!1,n._thumbsDrag=!1,n._thumbsNavigation=!1,n._thumbsArrows=r.arrows&&r.navigation;var s=n._thumbsHorizontal?"Hor":"Ver";n.slider.addClass("rsWithThumbs rsWithThumbs"+s),o+='<div class="rsNav rsThumbs rsThumbs'+s+'"><div class="'+i+'Container">',n._addThumbHTML=r.appendSpan?'<span class="thumbIco"></span>':"";for(var l=0;l<n.numSlides;l++)o+="<div"+t+' class="rsNavItem rsThumb">'+(s=n.slides[l]).thumbnail+n._addThumbHTML+"</div>";o=e(o+"</div></div>"),t={},r.paddingTop&&(t[n._thumbsHorizontal?"paddingTop":"paddingLeft"]=r.paddingTop),r.paddingBottom&&(t[n._thumbsHorizontal?"paddingBottom":"paddingRight"]=r.paddingBottom),o.css(t),n._thumbsContainer=e(o).find("."+i+"Container"),n._thumbsArrows&&(i+="Arrow",r.arrowLeft?n._thumbsArrowLeft=r.arrowLeft:(n._thumbsArrowLeft=e('<div class="'+i+" "+i+'Left"><div class="'+i+'Icn"></div></div>'),o.append(n._thumbsArrowLeft)),r.arrowRight?n._thumbsArrowRight=r.arrowRight:(n._thumbsArrowRight=e('<div class="'+i+" "+i+'Right"><div class="'+i+'Icn"></div></div>'),o.append(n._thumbsArrowRight)),n._thumbsArrowLeft.click(function(){var e=(Math.floor(n._thumbsPosition/n._thumbSize)+n._visibleThumbsPerView)*n._thumbSize+n.st.thumbs.firstMargin;n._animateThumbsTo(e>n._thumbsMinPosition?n._thumbsMinPosition:e)}),n._thumbsArrowRight.click(function(){var e=(Math.floor(n._thumbsPosition/n._thumbSize)-n._visibleThumbsPerView)*n._thumbSize+n.st.thumbs.firstMargin;n._animateThumbsTo(e<n._thumbsMaxPosition?n._thumbsMaxPosition:e)}),r.arrowsAutoHide&&!n.hasTouch&&(n._thumbsArrowLeft.css("opacity",0),n._thumbsArrowRight.css("opacity",0),o.one("mousemove.rsarrowshover",function(){n._thumbsNavigation&&(n._thumbsArrowLeft.css("opacity",1),n._thumbsArrowRight.css("opacity",1))}),o.hover(function(){n._thumbsNavigation&&(n._thumbsArrowLeft.css("opacity",1),n._thumbsArrowRight.css("opacity",1))},function(){n._thumbsNavigation&&(n._thumbsArrowLeft.css("opacity",0),n._thumbsArrowRight.css("opacity",0))}))),n._controlNav=o,n._controlNavItems=n._thumbsContainer.children(),n.msEnabled&&n.st.thumbs.navigation&&n._thumbsContainer.css("-ms-touch-action",n._thumbsHorizontal?"pan-y":"pan-x"),n.slider.append(o),n._thumbsEnabled=!0,n._thumbsSpacing=a,r.navigation&&n._useCSS3Transitions&&n._thumbsContainer.css(n._vendorPref+"transition-property",n._vendorPref+"transform"),n._controlNav.on("click.rs",".rsNavItem",function(t){n._thumbsDrag||n.goTo(e(this).index())}),n.ev.off("rsBeforeSizeSet.thumbs").on("rsBeforeSizeSet.thumbs",function(){n._realWrapSize=n._thumbsHorizontal?n._wrapHeight:n._wrapWidth,n.updateThumbsSize(!0)}),n.ev.off("rsAutoHeightChange.thumbs").on("rsAutoHeightChange.thumbs",function(e,t){n.updateThumbsSize(!0,t)})},updateThumbsSize:function(e,t){var n=this._controlNavItems.first(),i={},r=this._controlNavItems.length;this._thumbSize=(this._thumbsHorizontal?n.outerWidth():n.outerHeight())+this._thumbsSpacing,this._thumbsContainerSize=r*this._thumbSize-this._thumbsSpacing,i[this._thumbsHorizontal?"width":"height"]=this._thumbsContainerSize+this._thumbsSpacing,this._thumbsViewportSize=this._thumbsHorizontal?this._controlNav.width():void 0!==t?t:this._controlNav.height(),this._thumbsEnabled&&(this.isFullscreen||this.st.thumbs.fitInViewport)&&(this._thumbsHorizontal?this._wrapHeight=this._realWrapSize-this._controlNav.outerHeight():this._wrapWidth=this._realWrapSize-this._controlNav.outerWidth()),this._thumbsViewportSize&&(this._thumbsMaxPosition=-(this._thumbsContainerSize-this._thumbsViewportSize)-this.st.thumbs.firstMargin,this._thumbsMinPosition=this.st.thumbs.firstMargin,this._visibleThumbsPerView=Math.floor(this._thumbsViewportSize/this._thumbSize),this._thumbsContainerSize<this._thumbsViewportSize?(this.st.thumbs.autoCenter?this._setThumbsPosition((this._thumbsViewportSize-this._thumbsContainerSize)/2):this._setThumbsPosition(this._thumbsMinPosition),this.st.thumbs.arrows&&this._thumbsArrowLeft&&(this._thumbsArrowLeft.addClass("rsThumbsArrowDisabled"),this._thumbsArrowRight.addClass("rsThumbsArrowDisabled")),this._thumbsDrag=this._thumbsNavigation=!1,this._unbindPassiveEvent(this._controlNav[0],this._downEvent,this._eventCallbacks.dragStartThumb,!1)):this.st.thumbs.navigation&&!this._thumbsNavigation&&(this._thumbsNavigation=!0,!this.hasTouch&&this.st.thumbs.drag||this.hasTouch&&this.st.thumbs.touch)&&(this._thumbsDrag=!0,this._bindPassiveEvent(this._controlNav[0],this._downEvent,this._eventCallbacks.dragStartThumb,!1)),this._thumbsContainer.css(i),e&&t&&this._setCurrentThumb(this.currSlideId,!0))},setThumbsOrientation:function(e,t){this._thumbsEnabled&&(this.st.thumbs.orientation=e,this._controlNav.remove(),this.slider.removeClass("rsWithThumbsHor rsWithThumbsVer"),this._createThumbs(),this._unbindPassiveEvent(this._controlNav[0],this._downEvent,this._eventCallbacks.dragStartThumb,!1),t||this.updateSliderSize(!0))},_setThumbsPosition:function(e){this._thumbsPosition=e,this._useCSS3Transitions?this._thumbsContainer.css(this._xProp,this._tPref1+(this._thumbsHorizontal?e+this._tPref2+0:0+this._tPref2+e)+this._tPref3):this._thumbsContainer.css(this._thumbsHorizontal?this._xProp:this._yProp,e)},_animateThumbsTo:function(t,n,i,r,o){var a=this;if(a._thumbsNavigation){n||(n=a.st.thumbs.transitionSpeed),a._thumbsPosition=t,a._thumbsAnimTimeout&&clearTimeout(a._thumbsAnimTimeout),a._isThumbsAnimating&&(a._useCSS3Transitions||a._thumbsContainer.stop(),i=!0);var s={};a._isThumbsAnimating=!0,a._useCSS3Transitions?(s[a._vendorPref+"transition-duration"]=n+"ms",s[a._vendorPref+"transition-timing-function"]=i?e.rsCSS3Easing[a.st.easeOut]:e.rsCSS3Easing[a.st.easeInOut],a._thumbsContainer.css(s),a._setThumbsPosition(t)):(s[a._thumbsHorizontal?a._xProp:a._yProp]=t+"px",a._thumbsContainer.animate(s,n,i?"easeOutCubic":a.st.easeInOut)),r&&(a._thumbsPosition=r),a._updateThumbsArrows(),a._thumbsAnimTimeout=setTimeout(function(){a._isThumbsAnimating=!1,o&&(a._animateThumbsTo(r,o,!0),o=null)},n)}},_updateThumbsArrows:function(){this._thumbsArrows&&(this._thumbsPosition===this._thumbsMinPosition?this._thumbsArrowLeft.addClass("rsThumbsArrowDisabled"):this._thumbsArrowLeft.removeClass("rsThumbsArrowDisabled"),this._thumbsPosition===this._thumbsMaxPosition?this._thumbsArrowRight.addClass("rsThumbsArrowDisabled"):this._thumbsArrowRight.removeClass("rsThumbsArrowDisabled"))},_setCurrentThumb:function(e,t){var n=0,i=e*this._thumbSize+2*this._thumbSize-this._thumbsSpacing+this._thumbsMinPosition;if(this._thumbsNavigation){if(this._firstThumbMoved&&(t=!0,this._firstThumbMoved=!1),i+this._thumbsPosition>this._thumbsViewportSize){e===this.numSlides-1&&(n=1);var r=-e+this._visibleThumbsPerView-2+n;r=r*this._thumbSize+this._thumbsViewportSize%this._thumbSize+this._thumbsSpacing-this._thumbsMinPosition}else 0!==e?(e-1)*this._thumbSize<=-this._thumbsPosition+this._thumbsMinPosition&&e-1<=this.numSlides-this._visibleThumbsPerView&&(r=(1-e)*this._thumbSize+this._thumbsMinPosition):r=this._thumbsMinPosition;r!==this._thumbsPosition&&((n=void 0===r?this._thumbsPosition:r)>this._thumbsMinPosition?this._setThumbsPosition(this._thumbsMinPosition):n<this._thumbsMaxPosition?this._setThumbsPosition(this._thumbsMaxPosition):void 0!==r&&(t?this._setThumbsPosition(r):this._animateThumbsTo(r))),this._updateThumbsArrows()}}}),e.rsModules.thumbnails=e.rsProto._initThumbs}(jQuery),function(e){e.extend(e.rsProto,{_initTabs:function(){var t=this;"tabs"===t.st.controlNavigation&&(t.ev.on("rsBeforeParseNode",function(t,n,i){n=e(n),i.thumbnail=n.find(".rsTmb").remove(),i.thumbnail.length?i.thumbnail=e(document.createElement("div")).append(i.thumbnail).html():(i.thumbnail=n.attr("data-rsTmb"),i.thumbnail||(i.thumbnail=n.find(".rsImg").attr("data-rsTmb")),i.thumbnail=i.thumbnail?'<img src="'+i.thumbnail+'" alt="Slider Image"/>':"")}),t.ev.one("rsAfterPropsSetup",function(){t._createTabs()}),t.ev.on("rsOnAppendSlide",function(e,n,i){i>=t.numSlides?t._controlNav.append('<div class="rsNavItem rsTab">'+n.thumbnail+"</div>"):t._controlNavItems.eq(i).before('<div class="rsNavItem rsTab">'+item.thumbnail+"</div>"),t._controlNavItems=t._controlNav.children()}),t.ev.on("rsOnRemoveSlide",function(e,n){var i=t._controlNavItems.eq(n);i&&(i.remove(),t._controlNavItems=t._controlNav.children())}),t.ev.on("rsOnUpdateNav",function(){var e=t.currSlideId;t._prevNavItem&&t._prevNavItem.removeClass("rsNavSelected"),(e=t._controlNavItems.eq(e)).addClass("rsNavSelected"),t._prevNavItem=e}))},_createTabs:function(){var t=this;t._controlNavEnabled=!0;for(var n='<div class="rsNav rsTabs">',i=0;i<t.numSlides;i++)n+='<div class="rsNavItem rsTab">'+t.slides[i].thumbnail+"</div>";n=e(n+"</div>"),t._controlNav=n,t._controlNavItems=n.children(".rsNavItem"),t.slider.append(n),t._controlNav.click(function(n){(n=e(n.target).closest(".rsNavItem")).length&&t.goTo(n.index())})}}),e.rsModules.tabs=e.rsProto._initTabs}(jQuery),function(e){e.extend(e.rsProto,{_initFullscreen:function(){var t=this;t._fullscreenDefaults={enabled:!1,keyboardNav:!0,buttonFS:!0,nativeFS:!1,doubleTap:!0},t.st.fullscreen=e.extend({},t._fullscreenDefaults,t.st.fullscreen),t.st.fullscreen.enabled&&t.ev.one("rsBeforeSizeSet",function(){t._setupFullscreen()})},_setupFullscreen:function(){var t=this;if(t._fsKeyboard=!t.st.keyboardNavEnabled&&t.st.fullscreen.keyboardNav,t.st.fullscreen.nativeFS){var n={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},i=["webkit","moz","o","ms","khtml"];if(void 0!==document.cancelFullScreen)n.supportsFullScreen=!0;else for(var r=0,o=i.length;r<o;r++)if(n.prefix=i[r],void 0!==document[n.prefix+"CancelFullScreen"]){n.supportsFullScreen=!0;break}n.supportsFullScreen?(t.nativeFS=!0,n.fullScreenEventName=n.prefix+"fullscreenchange"+t.ns,n.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;default:return document[this.prefix+"FullScreen"]}},n.requestFullScreen=function(e){return""===this.prefix?e.requestFullScreen():e[this.prefix+"RequestFullScreen"]()},n.cancelFullScreen=function(e){return""===this.prefix?document.cancelFullScreen():document[this.prefix+"CancelFullScreen"]()},t._fullScreenApi=n):t._fullScreenApi=!1}t.st.fullscreen.buttonFS&&(t._fsBtn=e('<div class="rsFullscreenBtn"><div class="rsFullscreenIcn"></div></div>').appendTo(t._controlsContainer).on("click.rs",function(){t.isFullscreen?t.exitFullscreen():t.enterFullscreen()}))},enterFullscreen:function(t){var n=this;if(n._fullScreenApi){if(!t)return n._doc.on(n._fullScreenApi.fullScreenEventName,function(e){n._fullScreenApi.isFullScreen()?n.enterFullscreen(!0):n.exitFullscreen(!0)}),void n._fullScreenApi.requestFullScreen(e("html")[0]);n._fullScreenApi.requestFullScreen(e("html")[0])}if(!n._isFullscreenUpdating){var i;for(n._isFullscreenUpdating=!0,n._doc.on("keyup"+n.ns+"fullscreen",function(e){27===e.keyCode&&n.exitFullscreen()}),n._fsKeyboard&&n._bindKeyboardNav(),t=e(window),n._fsScrollTopOnEnter=t.scrollTop(),n._fsScrollLeftOnEnter=t.scrollLeft(),n._htmlStyle=e("html").attr("style"),n._bodyStyle=e("body").attr("style"),n._sliderStyle=n.slider.attr("style"),e("body, html").css({overflow:"hidden",height:"100%",width:"100%",margin:"0",padding:"0"}),n.slider.addClass("rsFullscreen"),i=0;i<n.numSlides;i++)(t=n.slides[i]).isRendered=!1,t.bigImage&&(t.isBig=!0,t.isMedLoaded=t.isLoaded,t.isMedLoading=t.isLoading,t.medImage=t.image,t.medIW=t.iW,t.medIH=t.iH,t.slideId=-99,t.bigImage!==t.medImage&&(t.sizeType="big"),t.isLoaded=t.isBigLoaded,t.isLoading=!1,t.image=t.bigImage,t.images[0]=t.bigImage,t.iW=t.bigIW,t.iH=t.bigIH,t.isAppended=t.contentAdded=!1,n._updateItemSrc(t));n.isFullscreen=!0,n._isFullscreenUpdating=!1,n.updateSliderSize(),n.ev.trigger("rsEnterFullscreen")}},exitFullscreen:function(t){var n=this;if(n._fullScreenApi){if(!t)return void n._fullScreenApi.cancelFullScreen(e("html")[0]);n._doc.off(n._fullScreenApi.fullScreenEventName)}if(!n._isFullscreenUpdating){var i;for(n._isFullscreenUpdating=!0,n._doc.off("keyup"+n.ns+"fullscreen"),n._fsKeyboard&&n._doc.off("keydown"+n.ns),e("html").attr("style",n._htmlStyle||""),e("body").attr("style",n._bodyStyle||""),i=0;i<n.numSlides;i++)(t=n.slides[i]).isRendered=!1,t.bigImage&&(t.isBig=!1,t.slideId=-99,t.isBigLoaded=t.isLoaded,t.isBigLoading=t.isLoading,t.bigImage=t.image,t.bigIW=t.iW,t.bigIH=t.iH,t.isLoaded=t.isMedLoaded,t.isLoading=!1,t.image=t.medImage,t.images[0]=t.medImage,t.iW=t.medIW,t.iH=t.medIH,t.isAppended=t.contentAdded=!1,n._updateItemSrc(t,!0),t.bigImage!==t.medImage&&(t.sizeType="med"));n.isFullscreen=!1,(t=e(window)).scrollTop(n._fsScrollTopOnEnter),t.scrollLeft(n._fsScrollLeftOnEnter),n._isFullscreenUpdating=!1,n.slider.removeClass("rsFullscreen"),n.updateSliderSize(),setTimeout(function(){n.updateSliderSize()},1),n.ev.trigger("rsExitFullscreen")}},_updateItemSrc:function(t,n){var i=t.isLoaded||t.isLoading?'<img class="rsImg rsMainSlideImage" alt="Slider image 2" src="'+t.image+'"/>':'<a class="rsImg rsMainSlideImage" href="'+t.image+'"></a>';t.content.hasClass("rsImg")?t.content=e(i):t.content.find(".rsImg").eq(0).replaceWith(i),t.isLoaded||t.isLoading||!t.holder||t.holder.html(t.content)}}),e.rsModules.fullscreen=e.rsProto._initFullscreen}(jQuery),function(e){e.extend(e.rsProto,{_initAutoplay:function(){var t,n=this;n._autoPlayDefaults={enabled:!1,stopAtAction:!0,pauseOnHover:!0,delay:2e3},!n.st.autoPlay&&n.st.autoplay&&(n.st.autoPlay=n.st.autoplay),n.st.autoPlay=e.extend({},n._autoPlayDefaults,n.st.autoPlay),n.st.autoPlay.enabled&&(n.ev.on("rsBeforeParseNode",function(n,i,r){i=e(i),(t=i.attr("data-rsDelay"))&&(r.customDelay=parseInt(t,10))}),n.ev.one("rsAfterInit",function(){n._setupAutoPlay()}),n.ev.on("rsBeforeDestroy",function(){n.stopAutoPlay(),n.slider.off("mouseenter mouseleave"),e(window).off("blur"+n.ns+" focus"+n.ns)}))},_setupAutoPlay:function(){var t=this;t.startAutoPlay(),t.ev.on("rsAfterContentSet",function(e,n){t._isDragging||t._isAnimating||!t._autoPlayEnabled||n!==t.currSlide||t._play()}),t.ev.on("rsDragRelease",function(){t._autoPlayEnabled&&t._autoPlayPaused&&(t._autoPlayPaused=!1,t._play())}),t.ev.on("rsAfterSlideChange",function(){t._autoPlayEnabled&&t._autoPlayPaused&&(t._autoPlayPaused=!1,t.currSlide.isLoaded&&t._play())}),t.ev.on("rsDragStart",function(){t._autoPlayEnabled&&(t.st.autoPlay.stopAtAction?t.stopAutoPlay():(t._autoPlayPaused=!0,t._pause()))}),t.ev.on("rsBeforeMove",function(e,n,i){t._autoPlayEnabled&&(i&&t.st.autoPlay.stopAtAction?t.stopAutoPlay():(t._autoPlayPaused=!0,t._pause()))}),t._pausedByVideo=!1,t.ev.on("rsVideoStop",function(){t._autoPlayEnabled&&(t._pausedByVideo=!1,t._play())}),t.ev.on("rsVideoPlay",function(){t._autoPlayEnabled&&(t._autoPlayPaused=!1,t._pause(),t._pausedByVideo=!0)}),e(window).on("blur"+t.ns,function(){t._autoPlayEnabled&&(t._autoPlayPaused=!0,t._pause())}).on("focus"+t.ns,function(){t._autoPlayEnabled&&t._autoPlayPaused&&(t._autoPlayPaused=!1,t._play())}),t.st.autoPlay.pauseOnHover&&(t._pausedByHover=!1,t.slider.hover(function(){t._autoPlayEnabled&&(t._autoPlayPaused=!1,t._pause(),t._pausedByHover=!0)},function(){t._autoPlayEnabled&&(t._pausedByHover=!1,t._play())}))},toggleAutoPlay:function(){this._autoPlayEnabled?this.stopAutoPlay():this.startAutoPlay()},startAutoPlay:function(){this._autoPlayEnabled=!0,this.currSlide.isLoaded&&this._play()},stopAutoPlay:function(){this._pausedByVideo=this._pausedByHover=this._autoPlayPaused=this._autoPlayEnabled=!1,this._pause()},_play:function(){var e=this;e._pausedByHover||e._pausedByVideo||(e._autoPlayRunning=!0,e._autoPlayTimeout&&clearTimeout(e._autoPlayTimeout),e._autoPlayTimeout=setTimeout(function(){if(!e._loop&&!e.st.loopRewind){var t=!0;e.st.loopRewind=!0}e.next(!0),t&&(e.st.loopRewind=!1)},e.currSlide.customDelay?e.currSlide.customDelay:e.st.autoPlay.delay))},_pause:function(){this._pausedByHover||this._pausedByVideo||(this._autoPlayRunning=!1,this._autoPlayTimeout&&(clearTimeout(this._autoPlayTimeout),this._autoPlayTimeout=null))}}),e.rsModules.autoplay=e.rsProto._initAutoplay}(jQuery),function(e){e.extend(e.rsProto,{_initVideo:function(){var t=this;t._videoDefaults={autoHideArrows:!0,autoHideControlNav:!1,autoHideBlocks:!1,autoHideCaption:!1,disableCSS3inFF:!0,youTubeCode:'<iframe src="https://www.youtube.com/embed/%id%?rel=1&showinfo=0&autoplay=1&wmode=transparent" frameborder="no"></iframe>',vimeoCode:'<iframe src="https://player.vimeo.com/video/%id%?byline=0&portrait=0&autoplay=1" frameborder="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'},t.st.video=e.extend({},t._videoDefaults,t.st.video),t.ev.on("rsBeforeSizeSet",function(){t._isVideoPlaying&&setTimeout(function(){var e=t._currHolder;e=e.hasClass("rsVideoContainer")?e:e.find(".rsVideoContainer"),t._videoFrameHolder&&t._videoFrameHolder.css({width:e.width(),height:e.height()})},32)});var n=t._browser.mozilla;t.ev.on("rsAfterParseNode",function(i,r,o){if(i=e(r),o.videoURL){t.st.video.disableCSS3inFF&&n&&(t._useCSS3Transitions=t._use3dTransform=!1),r=e('<div class="rsVideoContainer"></div>');var a=e('<div class="rsBtnCenterer"><div class="rsPlayBtn"><div class="rsPlayBtnIcon"></div></div></div>');i.hasClass("rsImg")?o.content=r.append(i).append(a):o.content.find(".rsImg").wrap(r).after(a)}}),t.ev.on("rsAfterSlideChange",function(){t.stopVideo()})},toggleVideo:function(){return this._isVideoPlaying?this.stopVideo():this.playVideo()},playVideo:function(){var t=this;if(!t._isVideoPlaying){var n=t.currSlide;if(!n.videoURL)return!1;t._playingVideoSlide=n;var i,r=t._currVideoContent=n.content;if((n=n.videoURL).match(/youtu\.be/i)||n.match(/youtube\.com/i)){var o=/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&\?]*).*/;(o=n.match(o))&&11==o[2].length&&(i=o[2]),void 0!==i&&(t._videoFrameHolder=t.st.video.youTubeCode.replace("%id%",i))}else n.match(/vimeo\.com/i)&&(o=/(www\.)?vimeo.com\/(\d+)($|\/)/,(o=n.match(o))&&(i=o[2]),void 0!==i&&(t._videoFrameHolder=t.st.video.vimeoCode.replace("%id%",i)));return t.videoObj=e(t._videoFrameHolder),t.ev.trigger("rsOnCreateVideoElement",[n]),t.videoObj.length&&(t._videoFrameHolder=e('<div class="rsVideoFrameHolder"><div class="rsPreloader"></div><div class="rsCloseVideoBtn"><div class="rsCloseVideoIcn"></div></div></div>'),t._videoFrameHolder.find(".rsPreloader").after(t.videoObj),r=r.hasClass("rsVideoContainer")?r:r.find(".rsVideoContainer"),t._videoFrameHolder.css({width:r.width(),height:r.height()}).find(".rsCloseVideoBtn").off("click.rsv").on("click.rsv",function(e){return t.stopVideo(),e.preventDefault(),e.stopPropagation(),!1}),r.append(t._videoFrameHolder),t.isIPAD&&r.addClass("rsIOSVideo"),t._toggleHiddenClass(!1),setTimeout(function(){t._videoFrameHolder.addClass("rsVideoActive")},10),t.ev.trigger("rsVideoPlay"),t._isVideoPlaying=!0),!0}return!1},stopVideo:function(){var e=this;return!!e._isVideoPlaying&&(e.isIPAD&&e.slider.find(".rsCloseVideoBtn").remove(),e._toggleHiddenClass(!0),setTimeout(function(){e.ev.trigger("rsOnDestroyVideoElement",[e.videoObj]);var t=e._videoFrameHolder.find("iframe");if(t.length)try{t.attr("src","")}catch(e){}e._videoFrameHolder.remove(),e._videoFrameHolder=null},16),e.ev.trigger("rsVideoStop"),e._isVideoPlaying=!1,!0)},_toggleHiddenClass:function(e,t){var n=[],i=this.st.video;if(i.autoHideArrows&&(this._arrowLeft&&(n.push(this._arrowLeft,this._arrowRight),this._arrowsAutoHideLocked=!e),this._fsBtn&&n.push(this._fsBtn)),i.autoHideControlNav&&this._controlNav&&n.push(this._controlNav),i.autoHideBlocks&&this._playingVideoSlide.animBlocks&&n.push(this._playingVideoSlide.animBlocks),i.autoHideCaption&&this.globalCaption&&n.push(this.globalCaption),this.slider[e?"removeClass":"addClass"]("rsVideoPlaying"),n.length)for(i=0;i<n.length;i++)e?n[i].removeClass("rsHidden"):n[i].addClass("rsHidden")}}),e.rsModules.video=e.rsProto._initVideo}(jQuery),function(e){e.extend(e.rsProto,{_initAnimatedBlocks:function(){function t(){var e=i.currSlide;if(i.currSlide&&i.currSlide.isLoaded&&i._slideWithBlocks!==e){if(0<i._animatedBlockTimeouts.length){for(n=0;n<i._animatedBlockTimeouts.length;n++)clearTimeout(i._animatedBlockTimeouts[n]);i._animatedBlockTimeouts=[]}if(0<i._blockAnimProps.length){var t;for(n=0;n<i._blockAnimProps.length;n++)(t=i._blockAnimProps[n])&&(i._useCSS3Transitions?(t.block.css(i._vendorPref+i._TD,"0s"),t.block.css(t.css)):t.block.stop(!0).css(t.css),i._slideWithBlocks=null,e.animBlocksDisplayed=!1);i._blockAnimProps=[]}e.animBlocks&&(e.animBlocksDisplayed=!0,i._slideWithBlocks=e,i._animateBlocks(e.animBlocks))}}var n,i=this;i._blockDefaults={fadeEffect:!0,moveEffect:"top",moveOffset:20,speed:400,easing:"easeOutSine",delay:200},i.st.block=e.extend({},i._blockDefaults,i.st.block),i._blockAnimProps=[],i._animatedBlockTimeouts=[],i.ev.on("rsAfterInit",function(){t()}),i.ev.on("rsBeforeParseNode",function(t,n,i){n=e(n),i.animBlocks=n.find(".rsABlock").css("display","none"),i.animBlocks.length||(n.hasClass("rsABlock")?i.animBlocks=n.css("display","none"):i.animBlocks=!1)}),i.ev.on("rsAfterContentSet",function(e,n){n.id===i.slides[i.currSlideId].id&&setTimeout(function(){t()},i.st.fadeinLoadedSlide?300:0)}),i.ev.on("rsAfterSlideChange",function(){t()})},_updateAnimBlockProps:function(e,t){setTimeout(function(){e.css(t)},6)},_animateBlocks:function(t){var n,i,r,o,a,s,l,u=this;u._animatedBlockTimeouts=[],t.each(function(t){n=e(this),i={},r={},o=null;var c=n.attr("data-move-offset");if(0<(c=c?parseInt(c,10):u.st.block.moveOffset)&&((s=n.data("move-effect"))?"none"===(s=s.toLowerCase())?s=!1:"left"!==s&&"top"!==s&&"bottom"!==s&&"right"!==s&&("none"===(s=u.st.block.moveEffect)&&(s=!1)):s=u.st.block.moveEffect,s&&"none"!==s)){var h="right"===s||"left"===s;if(l=!1,u._useCSS3Transitions){var d=0;a=u._xProp}else h?isNaN(parseInt(n.css("right"),10))?a="left":(a="right",l=!0):isNaN(parseInt(n.css("bottom"),10))?a="top":(a="bottom",l=!0),a="margin-"+a,l&&(c=-c),u._useCSS3Transitions?d=parseInt(n.css(a),10):void 0===(d=n.data("rs-start-move-prop"))&&(d=parseInt(n.css(a),10),isNaN(d)&&(d=0),n.data("rs-start-move-prop",d));r[a]=u._getCSS3Prop("top"===s||"left"===s?d-c:d+c,h),i[a]=u._getCSS3Prop(d,h)}(c=n.attr("data-fade-effect"))?"none"!==c.toLowerCase()&&"false"!==c.toLowerCase()||(c=!1):c=u.st.block.fadeEffect,c&&(r.opacity=0,i.opacity=1),(c||s)&&((o={}).hasFade=!!c,s&&(o.moveProp=a,o.hasMove=!0),o.speed=n.data("speed"),isNaN(o.speed)&&(o.speed=u.st.block.speed),o.easing=n.data("easing"),o.easing||(o.easing=u.st.block.easing),o.css3Easing=e.rsCSS3Easing[o.easing],o.delay=n.data("delay"),isNaN(o.delay)&&(o.delay=u.st.block.delay*t)),c={},u._useCSS3Transitions&&(c[u._vendorPref+u._TD]="0ms"),c.moveProp=i.moveProp,c.opacity=i.opacity,c.display="none",u._blockAnimProps.push({block:n,css:c}),u._updateAnimBlockProps(n,r),u._animatedBlockTimeouts.push(setTimeout(function(e,t,n,i){return function(){if(e.css("display","block"),n){var r={};if(u._useCSS3Transitions){var o="";n.hasMove&&(o+=n.moveProp),n.hasFade&&(n.hasMove&&(o+=", "),o+="opacity"),r[u._vendorPref+u._TP]=o,r[u._vendorPref+u._TD]=n.speed+"ms",r[u._vendorPref+u._TTF]=n.css3Easing,e.css(r),setTimeout(function(){e.css(t)},24)}else setTimeout(function(){e.animate(t,n.speed,n.easing)},16)}delete u._animatedBlockTimeouts[i]}}(n,i,o,t),6>=o.delay?12:o.delay))})}}),e.rsModules.animatedBlocks=e.rsProto._initAnimatedBlocks}(jQuery),function(e){e.extend(e.rsProto,{_initAutoHeight:function(){var e=this;if(e.st.autoHeight){var t,n,i,r=!0,o=function(o){i=e.slides[e.currSlideId],(t=i.holder)&&(n=t.height())&&void 0!==n&&n>(e.st.minAutoHeight||30)&&(e._wrapHeight=n,e._useCSS3Transitions||!o?e._sliderOverflow.css("height",n):e._sliderOverflow.stop(!0,!0).animate({height:n},e.st.transitionSpeed),e.ev.trigger("rsAutoHeightChange",n),r&&(e._useCSS3Transitions&&setTimeout(function(){e._sliderOverflow.css(e._vendorPref+"transition","height "+e.st.transitionSpeed+"ms ease-in-out")},16),r=!1))};e.ev.on("rsMaybeSizeReady.rsAutoHeight",function(e,t){i===t&&o()}),e.ev.on("rsAfterContentSet.rsAutoHeight",function(e,t){i===t&&o()}),e.slider.addClass("rsAutoHeight"),e.ev.one("rsAfterInit",function(){setTimeout(function(){o(!1),setTimeout(function(){e.slider.append('<div style="clear:both; float: none;"></div>')},16)},16)}),e.ev.on("rsBeforeAnimStart",function(){o(!0)}),e.ev.on("rsBeforeSizeSet",function(){setTimeout(function(){o(!1)},16)})}}}),e.rsModules.autoHeight=e.rsProto._initAutoHeight}(jQuery),function(e){e.extend(e.rsProto,{_initGlobalCaption:function(){var t=this;t.st.globalCaption&&(t.ev.on("rsAfterInit",function(){t.globalCaption=e('<div class="rsGCaption"></div>').appendTo(t.st.globalCaptionInside?t._sliderOverflow:t.slider),t.globalCaption.html(t.currSlide.caption||"")}),t.ev.on("rsBeforeAnimStart",function(){t.globalCaption.html(t.currSlide.caption||"")}))}}),e.rsModules.globalCaption=e.rsProto._initGlobalCaption}(jQuery),function(e){e.rsProto._initActiveClass=function(){var e,t=this;t.st.addActiveClass&&t.ev.on("rsOnUpdateNav",function(){e&&clearTimeout(e),e=setTimeout(function(){t._oldHolder&&t._oldHolder.removeClass("rsActiveSlide"),t._currHolder&&t._currHolder.addClass("rsActiveSlide"),e=null},50)})},e.rsModules.activeClass=e.rsProto._initActiveClass}(jQuery),function(e){e.extend(e.rsProto,{_initDeeplinking:function(){var t,n,i,r=this;if(r._hashDefaults={enabled:!1,change:!1,prefix:""},r.st.deeplinking=e.extend({},r._hashDefaults,r.st.deeplinking),r.st.deeplinking.enabled){var o=r.st.deeplinking.change,a=r.st.deeplinking.prefix,s="#"+a,l=function(){var e=window.location.hash;return e&&0<e.indexOf(a)&&0<=(e=parseInt(e.substring(s.length),10))?e-1:-1},u=l();-1!==u&&(r.st.startSlideId=u),o&&(e(window).on("hashchange"+r.ns,function(e){t||(0>(e=l())||(e>r.numSlides-1&&(e=r.numSlides-1),r.goTo(e)))}),r.ev.on("rsBeforeAnimStart",function(){n&&clearTimeout(n),i&&clearTimeout(i)}),r.ev.on("rsAfterSlideChange",function(){n&&clearTimeout(n),i&&clearTimeout(i),i=setTimeout(function(){t=!0,window.location.replace((""+window.location).split("#")[0]+s+(r.currSlideId+1)),n=setTimeout(function(){t=!1,n=null},60)},400)})),r.ev.on("rsBeforeDestroy",function(){n=i=null,o&&e(window).off("hashchange"+r.ns)})}}}),e.rsModules.deeplinking=e.rsProto._initDeeplinking}(jQuery),function(e,t,n){function i(e){return"#"+(e=e||location.href).replace(/^[^#]*#?(.*)$/,"$1")}var r=document,o=e.event.special,a=r.documentMode,s="onhashchange"in t&&(a===n||7<a);e.fn.hashchange=function(e){return e?this.bind("hashchange",e):this.trigger("hashchange")},e.fn.hashchange.delay=50,o.hashchange=e.extend(o.hashchange,{setup:function(){if(s)return!1;e(l.start)},teardown:function(){if(s)return!1;e(l.stop)}});var l=function(){function o(){var n=i(),r=d(u);n!==u?(h(u=n,r),e(t).trigger("hashchange")):r!==u&&(location.href=location.href.replace(/#.*/,"")+r),a=setTimeout(o,e.fn.hashchange.delay)}var a,l={},u=i(),c=function(e){return e},h=c,d=c;return l.start=function(){a||o()},l.stop=function(){a&&clearTimeout(a),a=n},t.attachEvent&&!t.addEventListener&&!s&&function(){var t,n;l.start=function(){t||(n=(n=e.fn.hashchange.src)&&n+i(),t=e('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){n||h(i()),o()}).attr("src",n||"javascript:0").insertAfter("body")[0].contentWindow,r.onpropertychange=function(){try{"title"===event.propertyName&&(t.document.title=r.title)}catch(e){}})},l.stop=c,d=function(){return i(t.location.href)},h=function(n,i){var o=t.document,a=e.fn.hashchange.domain;n!==i&&(o.title=r.title,o.open(),a&&o.write('<script>document.domain="'+a+'"<\/script>'),o.close(),t.location.hash=n)}}(),l}()}(jQuery,this),function(e){e.rsProto._initVisibleNearby=function(){var t=this;t.st.visibleNearby&&t.st.visibleNearby.enabled&&(t._vnDefaults={enabled:!0,centerArea:.6,center:!0,breakpoint:0,breakpointCenterArea:.8,hiddenOverflow:!0,navigateByCenterClick:!1},t.st.visibleNearby=e.extend({},t._vnDefaults,t.st.visibleNearby),t.ev.one("rsAfterPropsSetup",function(){t._sliderVisibleNearbyWrap=t._sliderOverflow.css("overflow","visible").wrap('<div class="rsVisibleNearbyWrap"></div>').parent(),t.st.visibleNearby.hiddenOverflow||t._sliderVisibleNearbyWrap.css("overflow","visible"),t._controlsContainer=t.st.controlsInside?t._sliderVisibleNearbyWrap:t.slider}),t.ev.on("rsAfterSizePropSet",function(){var e=t.st.visibleNearby,n=e.breakpoint&&t.width<e.breakpoint?e.breakpointCenterArea:e.centerArea;t._slidesHorizontal?(t._wrapWidth*=n,t._sliderVisibleNearbyWrap.css({height:t._wrapHeight,width:t._wrapWidth/n}),t._minPosOffset=t._wrapWidth*(1-n)/2/n):(t._wrapHeight*=n,t._sliderVisibleNearbyWrap.css({height:t._wrapHeight/n,width:t._wrapWidth}),t._minPosOffset=t._wrapHeight*(1-n)/2/n),e.navigateByCenterClick||(t._nextSlidePos=t._slidesHorizontal?t._wrapWidth:t._wrapHeight),e.center&&t._sliderOverflow.css("margin-"+(t._slidesHorizontal?"left":"top"),t._minPosOffset)}))},e.rsModules.visibleNearby=e.rsProto._initVisibleNearby}(jQuery),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(e,t,n,i){var r={features:null,bind:function(e,t,n,i){var r=(i?"remove":"add")+"EventListener";t=t.split(" ");for(var o=0;o<t.length;o++)t[o]&&e[r](t[o],n,!1)},isArray:function(e){return e instanceof Array},createEl:function(e,t){var n=document.createElement(t||"div");return e&&(n.className=e),n},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,n){r.bind(e,t,n,!0)},removeClass:function(e,t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){r.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},hasClass:function(e,t){return e.className&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},getChildByClass:function(e,t){for(var n=e.firstChild;n;){if(r.hasClass(n,t))return n;n=n.nextSibling}},arraySearch:function(e,t,n){for(var i=e.length;i--;)if(e[i][n]===t)return i;return-1},extend:function(e,t,n){for(var i in t)if(t.hasOwnProperty(i)){if(n&&e.hasOwnProperty(i))continue;e[i]=t[i]}},easing:{sine:{out:function(e){return Math.sin(e*(Math.PI/2))},inOut:function(e){return-(Math.cos(Math.PI*e)-1)/2}},cubic:{out:function(e){return--e*e*e+1}}},detectFeatures:function(){if(r.features)return r.features;var e=r.createEl().style,t="",n={};if(n.oldIE=document.all&&!document.addEventListener,n.touch="ontouchstart"in window,window.requestAnimationFrame&&(n.raf=window.requestAnimationFrame,n.caf=window.cancelAnimationFrame),n.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled,!n.pointerEvent){var i=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var o=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);o&&o.length>0&&(o=parseInt(o[1],10))>=1&&o<8&&(n.isOldIOSPhone=!0)}var a=i.match(/Android\s([0-9\.]*)/),s=a?a[1]:0;(s=parseFloat(s))>=1&&(s<4.4&&(n.isOldAndroid=!0),n.androidVersion=s),n.isMobileOpera=/opera mini|opera mobi/i.test(i)}for(var l,u,c=["transform","perspective","animationName"],h=["","webkit","Moz","ms","O"],d=0;d<4;d++){t=h[d];for(var f=0;f<3;f++)l=c[f],u=t+(t?l.charAt(0).toUpperCase()+l.slice(1):l),!n[l]&&u in e&&(n[l]=u);t&&!n.raf&&(t=t.toLowerCase(),n.raf=window[t+"RequestAnimationFrame"],n.raf&&(n.caf=window[t+"CancelAnimationFrame"]||window[t+"CancelRequestAnimationFrame"]))}if(!n.raf){var p=0;n.raf=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-p)),i=window.setTimeout(function(){e(t+n)},n);return p=t+n,i},n.caf=function(e){clearTimeout(e)}}return n.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,r.features=n,n}};r.detectFeatures(),r.features.oldIE&&(r.bind=function(e,t,n,i){t=t.split(" ");for(var r,o=(i?"detach":"attach")+"Event",a=function(){n.handleEvent.call(n)},s=0;s<t.length;s++)if(r=t[s])if("object"==typeof n&&n.handleEvent){if(i){if(!n["oldIE"+r])return!1}else n["oldIE"+r]=a;e[o]("on"+r,n["oldIE"+r])}else e[o]("on"+r,n)});var o=this,a={allowPanToNext:!0,spacing:.12,bgOpacity:1,mouseUsed:!1,loop:!0,pinchToClose:!0,closeOnScroll:!0,closeOnVerticalDrag:!0,verticalDragRange:.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:!1,focus:!0,escKey:!0,arrowKeys:!0,mainScrollEndFriction:.35,panEndFriction:.35,isClickableElement:function(e){return"A"===e.tagName},getDoubleTapZoom:function(e,t){return e?1:t.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0,scaleMode:"fit"};r.extend(a,i);var s,l,u,c,h,d,f,p,m,g,v,E,y,_,T,b,w,x,R,H,S,M,C,A,k,P,D,L,O,F,N,I,B,z,V,U,j,W,G,Y,q,X,$,Z,K,Q,J,ee,te,ne,ie,re,oe,ae,se,le,ue={x:0,y:0},ce={x:0,y:0},he={x:0,y:0},de={},fe=0,pe={},me={x:0,y:0},ge=0,ve=!0,Ee=[],ye={},_e=!1,Te=function(e,t){r.extend(o,t.publicMethods),Ee.push(e)},be=function(e){var t=Vt();return e>t-1?e-t:e<0?t+e:e},we={},xe=function(e,t){return we[e]||(we[e]=[]),we[e].push(t)},Re=function(e){var t=we[e];if(t){var n=Array.prototype.slice.call(arguments);n.shift();for(var i=0;i<t.length;i++)t[i].apply(o,n)}},He=function(){return(new Date).getTime()},Se=function(e){ae=e,o.bg.style.opacity=e*a.bgOpacity},Me=function(e,t,n,i,r){(!_e||r&&r!==o.currItem)&&(i/=r?r.fitRatio:o.currItem.fitRatio),e[M]=E+t+"px, "+n+"px"+y+" scale("+i+")"},Ce=function(e){te&&(e&&(g>o.currItem.fitRatio?_e||(Zt(o.currItem,!1,!0),_e=!0):_e&&(Zt(o.currItem),_e=!1)),Me(te,he.x,he.y,g))},Ae=function(e){e.container&&Me(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},ke=function(e,t){t[M]=E+e+"px, 0px"+y},Pe=function(e,t){if(!a.loop&&t){var n=c+(me.x*fe-e)/me.x,i=Math.round(e-ct.x);(n<0&&i>0||n>=Vt()-1&&i<0)&&(e=ct.x+i*a.mainScrollEndFriction)}ct.x=e,ke(e,h)},De=function(e,t){var n=ht[e]-pe[e];return ce[e]+ue[e]+n-n*(t/v)},Le=function(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)},Oe=function(e){e.x=Math.round(e.x),e.y=Math.round(e.y)},Fe=null,Ne=function(){Fe&&(r.unbind(document,"mousemove",Ne),r.addClass(e,"pswp--has_mouse"),a.mouseUsed=!0,Re("mouseUsed")),Fe=setTimeout(function(){Fe=null},100)},Ie=function(e,t){var n=Yt(o.currItem,de,e);return t&&(ee=n),n},Be=function(e){return e||(e=o.currItem),e.initialZoomLevel},ze=function(e){return e||(e=o.currItem),e.w>0?a.maxSpreadZoom:1},Ve=function(e,t,n,i){return i===o.currItem.initialZoomLevel?(n[e]=o.currItem.initialPosition[e],!0):(n[e]=De(e,i),n[e]>t.min[e]?(n[e]=t.min[e],!0):n[e]<t.max[e]&&(n[e]=t.max[e],!0))},Ue=function(e){var t="";a.escKey&&27===e.keyCode?t="close":a.arrowKeys&&(37===e.keyCode?t="prev":39===e.keyCode&&(t="next")),t&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||(e.preventDefault?e.preventDefault():e.returnValue=!1,o[t]()))},je=function(e){e&&(X||q||ne||j)&&(e.preventDefault(),e.stopPropagation())},We=function(){o.setScrollOffset(0,r.getScrollY())},Ge={},Ye=0,qe=function(e){Ge[e]&&(Ge[e].raf&&P(Ge[e].raf),Ye--,delete Ge[e])},Xe=function(e){Ge[e]&&qe(e),Ge[e]||(Ye++,Ge[e]={})},$e=function(){for(var e in Ge)Ge.hasOwnProperty(e)&&qe(e)},Ze=function(e,t,n,i,r,o,a){var s,l=He();Xe(e);var u=function(){if(Ge[e]){if((s=He()-l)>=i)return qe(e),o(n),void(a&&a());o((n-t)*r(s/i)+t),Ge[e].raf=k(u)}};u()},Ke={shout:Re,listen:xe,viewportSize:de,options:a,isMainScrollAnimating:function(){return ne},getZoomLevel:function(){return g},getCurrentIndex:function(){return c},isDragging:function(){return G},isZooming:function(){return Q},setScrollOffset:function(e,t){pe.x=e,F=pe.y=t,Re("updateScrollOffset",pe)},applyZoomPan:function(e,t,n,i){he.x=t,he.y=n,g=e,Ce(i)},init:function(){if(!s&&!l){var n;o.framework=r,o.template=e,o.bg=r.getChildByClass(e,"pswp__bg"),D=e.className,s=!0,N=r.detectFeatures(),k=N.raf,P=N.caf,M=N.transform,O=N.oldIE,o.scrollWrap=r.getChildByClass(e,"pswp__scroll-wrap"),o.container=r.getChildByClass(o.scrollWrap,"pswp__container"),h=o.container.style,o.itemHolders=b=[{el:o.container.children[0],wrap:0,index:-1},{el:o.container.children[1],wrap:0,index:-1},{el:o.container.children[2],wrap:0,index:-1}],b[0].el.style.display=b[2].el.style.display="none",function(){if(M){var t=N.perspective&&!A;return E="translate"+(t?"3d(":"("),void(y=N.perspective?", 0px)":")")}M="left",r.addClass(e,"pswp--ie"),ke=function(e,t){t.left=e+"px"},Ae=function(e){var t=e.fitRatio>1?1:e.fitRatio,n=e.container.style,i=t*e.w,r=t*e.h;n.width=i+"px",n.height=r+"px",n.left=e.initialPosition.x+"px",n.top=e.initialPosition.y+"px"},Ce=function(){if(te){var e=te,t=o.currItem,n=t.fitRatio>1?1:t.fitRatio,i=n*t.w,r=n*t.h;e.width=i+"px",e.height=r+"px",e.left=he.x+"px",e.top=he.y+"px"}}}(),m={resize:o.updateSize,orientationchange:function(){clearTimeout(I),I=setTimeout(function(){de.x!==o.scrollWrap.clientWidth&&o.updateSize()},500)},scroll:We,keydown:Ue,click:je};var i=N.isOldIOSPhone||N.isOldAndroid||N.isMobileOpera;for(N.animationName&&N.transform&&!i||(a.showAnimationDuration=a.hideAnimationDuration=0),n=0;n<Ee.length;n++)o["init"+Ee[n]]();t&&(o.ui=new t(o,r)).init(),Re("firstUpdate"),c=c||a.index||0,(isNaN(c)||c<0||c>=Vt())&&(c=0),o.currItem=zt(c),(N.isOldIOSPhone||N.isOldAndroid)&&(ve=!1),e.setAttribute("aria-hidden","false"),a.modal&&(ve?e.style.position="fixed":(e.style.position="absolute",e.style.top=r.getScrollY()+"px")),void 0===F&&(Re("initialLayout"),F=L=r.getScrollY());var u="pswp--open ";for(a.mainClass&&(u+=a.mainClass+" "),a.showHideOpacity&&(u+="pswp--animate_opacity "),u+=A?"pswp--touch":"pswp--notouch",u+=N.animationName?" pswp--css_animation":"",u+=N.svg?" pswp--svg":"",r.addClass(e,u),o.updateSize(),d=-1,ge=null,n=0;n<3;n++)ke((n+d)*me.x,b[n].el.style);O||r.bind(o.scrollWrap,p,o),xe("initialZoomInEnd",function(){o.setContent(b[0],c-1),o.setContent(b[2],c+1),b[0].el.style.display=b[2].el.style.display="block",a.focus&&e.focus(),r.bind(document,"keydown",o),N.transform&&r.bind(o.scrollWrap,"click",o),a.mouseUsed||r.bind(document,"mousemove",Ne),r.bind(window,"resize scroll orientationchange",o),Re("bindEvents")}),o.setContent(b[1],c),o.updateCurrItem(),Re("afterInit"),ve||(_=setInterval(function(){Ye||G||Q||g!==o.currItem.initialZoomLevel||o.updateSize()},1e3)),r.addClass(e,"pswp--visible")}},close:function(){s&&(s=!1,l=!0,Re("close"),r.unbind(window,"resize scroll orientationchange",o),r.unbind(window,"scroll",m.scroll),r.unbind(document,"keydown",o),r.unbind(document,"mousemove",Ne),N.transform&&r.unbind(o.scrollWrap,"click",o),G&&r.unbind(window,f,o),clearTimeout(I),Re("unbindEvents"),Ut(o.currItem,null,!0,o.destroy))},destroy:function(){Re("destroy"),Ft&&clearTimeout(Ft),e.setAttribute("aria-hidden","true"),e.className=D,_&&clearInterval(_),r.unbind(o.scrollWrap,p,o),r.unbind(window,"scroll",o),pt(),$e(),we=null},panTo:function(e,t,n){n||(e>ee.min.x?e=ee.min.x:e<ee.max.x&&(e=ee.max.x),t>ee.min.y?t=ee.min.y:t<ee.max.y&&(t=ee.max.y)),he.x=e,he.y=t,Ce()},handleEvent:function(e){e=e||window.event,m[e.type]&&m[e.type](e)},goTo:function(e){var t=(e=be(e))-c;ge=t,c=e,o.currItem=zt(c),fe-=t,Pe(me.x*fe),$e(),ne=!1,o.updateCurrItem()},next:function(){o.goTo(c+1)},prev:function(){o.goTo(c-1)},updateCurrZoomItem:function(e){if(e&&Re("beforeChange",0),b[1].el.children.length){var t=b[1].el.children[0];te=r.hasClass(t,"pswp__zoom-wrap")?t.style:null}else te=null;ee=o.currItem.bounds,v=g=o.currItem.initialZoomLevel,he.x=ee.center.x,he.y=ee.center.y,e&&Re("afterChange")},invalidateCurrItems:function(){T=!0;for(var e=0;e<3;e++)b[e].item&&(b[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==ge){var t,n=Math.abs(ge);if(!(e&&n<2)){o.currItem=zt(c),_e=!1,Re("beforeChange",ge),n>=3&&(d+=ge+(ge>0?-3:3),n=3);for(var i=0;i<n;i++)ge>0?(t=b.shift(),b[2]=t,ke((++d+2)*me.x,t.el.style),o.setContent(t,c-n+i+1+1)):(t=b.pop(),b.unshift(t),ke(--d*me.x,t.el.style),o.setContent(t,c+n-i-1-1));if(te&&1===Math.abs(ge)){var r=zt(w);r.initialZoomLevel!==g&&(Yt(r,de),Zt(r),Ae(r))}ge=0,o.updateCurrZoomItem(),w=c,Re("afterChange")}}},updateSize:function(t){if(!ve&&a.modal){var n=r.getScrollY();if(F!==n&&(e.style.top=n+"px",F=n),!t&&ye.x===window.innerWidth&&ye.y===window.innerHeight)return;ye.x=window.innerWidth,ye.y=window.innerHeight,e.style.height=ye.y+"px"}if(de.x=o.scrollWrap.clientWidth,de.y=o.scrollWrap.clientHeight,We(),me.x=de.x+Math.round(de.x*a.spacing),me.y=de.y,Pe(me.x*fe),Re("beforeResize"),void 0!==d){for(var i,s,l,u=0;u<3;u++)i=b[u],ke((u+d)*me.x,i.el.style),l=c+u-1,a.loop&&Vt()>2&&(l=be(l)),(s=zt(l))&&(T||s.needsUpdate||!s.bounds)?(o.cleanSlide(s),o.setContent(i,l),1===u&&(o.currItem=s,o.updateCurrZoomItem(!0)),s.needsUpdate=!1):-1===i.index&&l>=0&&o.setContent(i,l),s&&s.container&&(Yt(s,de),Zt(s),Ae(s));T=!1}v=g=o.currItem.initialZoomLevel,(ee=o.currItem.bounds)&&(he.x=ee.center.x,he.y=ee.center.y,Ce(!0)),Re("resize")},zoomTo:function(e,t,n,i,o){t&&(v=g,ht.x=Math.abs(t.x)-he.x,ht.y=Math.abs(t.y)-he.y,Le(ce,he));var a=Ie(e,!1),s={};Ve("x",a,s,e),Ve("y",a,s,e);var l=g,u=he.x,c=he.y;Oe(s);var h=function(t){1===t?(g=e,he.x=s.x,he.y=s.y):(g=(e-l)*t+l,he.x=(s.x-u)*t+u,he.y=(s.y-c)*t+c),o&&o(t),Ce(1===t)};n?Ze("customZoomTo",0,1,n,i||r.easing.sine.inOut,h):h(1)}},Qe={},Je={},et={},tt={},nt={},it=[],rt={},ot=[],at={},st=0,lt={x:0,y:0},ut=0,ct={x:0,y:0},ht={x:0,y:0},dt={x:0,y:0},ft=function(e,t){return at.x=Math.abs(e.x-t.x),at.y=Math.abs(e.y-t.y),Math.sqrt(at.x*at.x+at.y*at.y)},pt=function(){$&&(P($),$=null)},mt=function(){G&&($=k(mt),Ct())},gt=function(e,t){return!(!e||e===document)&&!(e.getAttribute("class")&&e.getAttribute("class").indexOf("pswp__scroll-wrap")>-1)&&(t(e)?e:gt(e.parentNode,t))},vt={},Et=function(e,t){return vt.prevent=!gt(e.target,a.isClickableElement),Re("preventDragEvent",e,t,vt),vt.prevent},yt=function(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t},_t=function(e,t,n){n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y)},Tt=function(){var e=he.y-o.currItem.initialPosition.y;return 1-Math.abs(e/(de.y/2))},bt={},wt={},xt=[],Rt=function(e){for(;xt.length>0;)xt.pop();return C?(le=0,it.forEach(function(e){0===le?xt[0]=e:1===le&&(xt[1]=e),le++})):e.type.indexOf("touch")>-1?e.touches&&e.touches.length>0&&(xt[0]=yt(e.touches[0],bt),e.touches.length>1&&(xt[1]=yt(e.touches[1],wt))):(bt.x=e.pageX,bt.y=e.pageY,bt.id="",xt[0]=bt),xt},Ht=function(e,t){var n,i,r,s,l=he[e]+t[e],u=t[e]>0,c=ct.x+t.x,h=ct.x-rt.x;if(n=l>ee.min[e]||l<ee.max[e]?a.panEndFriction:1,l=he[e]+t[e]*n,(a.allowPanToNext||g===o.currItem.initialZoomLevel)&&(te?"h"!==ie||"x"!==e||q||(u?(l>ee.min[e]&&(n=a.panEndFriction,ee.min[e],i=ee.min[e]-ce[e]),(i<=0||h<0)&&Vt()>1?(s=c,h<0&&c>rt.x&&(s=rt.x)):ee.min.x!==ee.max.x&&(r=l)):(l<ee.max[e]&&(n=a.panEndFriction,ee.max[e],i=ce[e]-ee.max[e]),(i<=0||h>0)&&Vt()>1?(s=c,h>0&&c<rt.x&&(s=rt.x)):ee.min.x!==ee.max.x&&(r=l))):s=c,"x"===e))return void 0!==s&&(Pe(s,!0),Z=s!==rt.x),ee.min.x!==ee.max.x&&(void 0!==r?he.x=r:Z||(he.x+=t.x*n)),void 0!==s;ne||Z||g>o.currItem.fitRatio&&(he[e]+=t[e]*n)},St=function(e){if(!("mousedown"===e.type&&e.button>0))if(Bt)e.preventDefault();else if(!W||"mousedown"!==e.type){if(Et(e,!0)&&e.preventDefault(),Re("pointerDown"),C){var t=r.arraySearch(it,e.pointerId,"id");t<0&&(t=it.length),it[t]={x:e.pageX,y:e.pageY,id:e.pointerId}}var n=Rt(e),i=n.length;K=null,$e(),G&&1!==i||(G=re=!0,r.bind(window,f,o),U=se=oe=j=Z=X=Y=q=!1,ie=null,Re("firstTouchStart",n),Le(ce,he),ue.x=ue.y=0,Le(tt,n[0]),Le(nt,tt),rt.x=me.x*fe,ot=[{x:tt.x,y:tt.y}],z=B=He(),Ie(g,!0),pt(),mt()),!Q&&i>1&&!ne&&!Z&&(v=g,q=!1,Q=Y=!0,ue.y=ue.x=0,Le(ce,he),Le(Qe,n[0]),Le(Je,n[1]),_t(Qe,Je,dt),ht.x=Math.abs(dt.x)-he.x,ht.y=Math.abs(dt.y)-he.y,J=ft(Qe,Je))}},Mt=function(e){if(e.preventDefault(),C){var t=r.arraySearch(it,e.pointerId,"id");if(t>-1){var n=it[t];n.x=e.pageX,n.y=e.pageY}}if(G){var i=Rt(e);if(ie||X||Q)K=i;else if(ct.x!==me.x*fe)ie="h";else{var o=Math.abs(i[0].x-tt.x)-Math.abs(i[0].y-tt.y);Math.abs(o)>=10&&(ie=o>0?"h":"v",K=i)}}},Ct=function(){if(K){var e=K.length;if(0!==e)if(Le(Qe,K[0]),et.x=Qe.x-tt.x,et.y=Qe.y-tt.y,Q&&e>1){if(tt.x=Qe.x,tt.y=Qe.y,!et.x&&!et.y&&function(e,t){return e.x===t.x&&e.y===t.y}(K[1],Je))return;Le(Je,K[1]),q||(q=!0,Re("zoomGestureStarted"));var t=ft(Qe,Je),n=Lt(t);n>o.currItem.initialZoomLevel+o.currItem.initialZoomLevel/15&&(se=!0);var i=1,r=Be(),s=ze();if(n<r)if(a.pinchToClose&&!se&&v<=o.currItem.initialZoomLevel){var l=1-(r-n)/(r/1.2);Se(l),Re("onPinchClose",l),oe=!0}else(i=(r-n)/r)>1&&(i=1),n=r-i*(r/3);else n>s&&((i=(n-s)/(6*r))>1&&(i=1),n=s+i*r);i<0&&(i=0),_t(Qe,Je,lt),ue.x+=lt.x-dt.x,ue.y+=lt.y-dt.y,Le(dt,lt),he.x=De("x",n),he.y=De("y",n),U=n>g,g=n,Ce()}else{if(!ie)return;if(re&&(re=!1,Math.abs(et.x)>=10&&(et.x-=K[0].x-nt.x),Math.abs(et.y)>=10&&(et.y-=K[0].y-nt.y)),tt.x=Qe.x,tt.y=Qe.y,0===et.x&&0===et.y)return;if("v"===ie&&a.closeOnVerticalDrag&&"fit"===a.scaleMode&&g===o.currItem.initialZoomLevel){ue.y+=et.y,he.y+=et.y;var u=Tt();return j=!0,Re("onVerticalDrag",u),Se(u),void Ce()}!function(e,t,n){if(e-z>50){var i=ot.length>2?ot.shift():{};i.x=t,i.y=n,ot.push(i),z=e}}(He(),Qe.x,Qe.y),X=!0,ee=o.currItem.bounds,Ht("x",et)||(Ht("y",et),Oe(he),Ce())}}},At=function(e){if(N.isOldAndroid){if(W&&"mouseup"===e.type)return;e.type.indexOf("touch")>-1&&(clearTimeout(W),W=setTimeout(function(){W=0},600))}var t;if(Re("pointerUp"),Et(e,!1)&&e.preventDefault(),C){var n=r.arraySearch(it,e.pointerId,"id");n>-1&&(t=it.splice(n,1)[0],navigator.pointerEnabled?t.type=e.pointerType||"mouse":(t.type={4:"mouse",2:"touch",3:"pen"}[e.pointerType],t.type||(t.type=e.pointerType||"mouse")))}var i,s=Rt(e),l=s.length;if("mouseup"===e.type&&(l=0),2===l)return K=null,!0;1===l&&Le(nt,s[0]),0!==l||ie||ne||(t||("mouseup"===e.type?t={x:e.pageX,y:e.pageY,type:"mouse"}:e.changedTouches&&e.changedTouches[0]&&(t={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,type:"touch"})),Re("touchRelease",e,t));var u=-1;if(0===l&&(G=!1,r.unbind(window,f,o),pt(),Q?u=0:-1!==ut&&(u=He()-ut)),ut=1===l?He():-1,i=-1!==u&&u<150?"zoom":"swipe",Q&&l<2&&(Q=!1,1===l&&(i="zoomPointerUp"),Re("zoomGestureEnded")),K=null,X||q||ne||j)if($e(),V||(V=kt()),V.calculateSwipeSpeed("x"),j)if(Tt()<a.verticalDragRange)o.close();else{var c=he.y,h=ae;Ze("verticalDrag",0,1,300,r.easing.cubic.out,function(e){he.y=(o.currItem.initialPosition.y-c)*e+c,Se((1-h)*e+h),Ce()}),Re("onVerticalDrag",1)}else{if((Z||ne)&&0===l){if(Dt(i,V))return;i="zoomPointerUp"}ne||("swipe"===i?!Z&&g>o.currItem.fitRatio&&Pt(V):Ot())}},kt=function(){var e,t,n={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(i){ot.length>1?(e=He()-z+50,t=ot[ot.length-2][i]):(e=He()-B,t=nt[i]),n.lastFlickOffset[i]=tt[i]-t,n.lastFlickDist[i]=Math.abs(n.lastFlickOffset[i]),n.lastFlickDist[i]>20?n.lastFlickSpeed[i]=n.lastFlickOffset[i]/e:n.lastFlickSpeed[i]=0,Math.abs(n.lastFlickSpeed[i])<.1&&(n.lastFlickSpeed[i]=0),n.slowDownRatio[i]=.95,n.slowDownRatioReverse[i]=1-n.slowDownRatio[i],n.speedDecelerationRatio[i]=1},calculateOverBoundsAnimOffset:function(e,t){n.backAnimStarted[e]||(he[e]>ee.min[e]?n.backAnimDestination[e]=ee.min[e]:he[e]<ee.max[e]&&(n.backAnimDestination[e]=ee.max[e]),void 0!==n.backAnimDestination[e]&&(n.slowDownRatio[e]=.7,n.slowDownRatioReverse[e]=1-n.slowDownRatio[e],n.speedDecelerationRatioAbs[e]<.05&&(n.lastFlickSpeed[e]=0,n.backAnimStarted[e]=!0,Ze("bounceZoomPan"+e,he[e],n.backAnimDestination[e],t||300,r.easing.sine.out,function(t){he[e]=t,Ce()}))))},calculateAnimOffset:function(e){n.backAnimStarted[e]||(n.speedDecelerationRatio[e]=n.speedDecelerationRatio[e]*(n.slowDownRatio[e]+n.slowDownRatioReverse[e]-n.slowDownRatioReverse[e]*n.timeDiff/10),n.speedDecelerationRatioAbs[e]=Math.abs(n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]),n.distanceOffset[e]=n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]*n.timeDiff,he[e]+=n.distanceOffset[e])},panAnimLoop:function(){if(Ge.zoomPan&&(Ge.zoomPan.raf=k(n.panAnimLoop),n.now=He(),n.timeDiff=n.now-n.lastNow,n.lastNow=n.now,n.calculateAnimOffset("x"),n.calculateAnimOffset("y"),Ce(),n.calculateOverBoundsAnimOffset("x"),n.calculateOverBoundsAnimOffset("y"),n.speedDecelerationRatioAbs.x<.05&&n.speedDecelerationRatioAbs.y<.05))return he.x=Math.round(he.x),he.y=Math.round(he.y),Ce(),void qe("zoomPan")}};return n},Pt=function(e){if(e.calculateSwipeSpeed("y"),ee=o.currItem.bounds,e.backAnimDestination={},e.backAnimStarted={},Math.abs(e.lastFlickSpeed.x)<=.05&&Math.abs(e.lastFlickSpeed.y)<=.05)return e.speedDecelerationRatioAbs.x=e.speedDecelerationRatioAbs.y=0,e.calculateOverBoundsAnimOffset("x"),e.calculateOverBoundsAnimOffset("y"),!0;Xe("zoomPan"),e.lastNow=He(),e.panAnimLoop()},Dt=function(e,t){var n,i,s;if(ne||(st=c),"swipe"===e){var l=tt.x-nt.x,u=t.lastFlickDist.x<10;l>30&&(u||t.lastFlickOffset.x>20)?i=-1:l<-30&&(u||t.lastFlickOffset.x<-20)&&(i=1)}i&&((c+=i)<0?(c=a.loop?Vt()-1:0,s=!0):c>=Vt()&&(c=a.loop?0:Vt()-1,s=!0),s&&!a.loop||(ge+=i,fe-=i,n=!0));var h,d=me.x*fe,f=Math.abs(d-ct.x);return n||d>ct.x==t.lastFlickSpeed.x>0?(h=Math.abs(t.lastFlickSpeed.x)>0?f/Math.abs(t.lastFlickSpeed.x):333,h=Math.min(h,400),h=Math.max(h,250)):h=333,st===c&&(n=!1),ne=!0,Re("mainScrollAnimStart"),Ze("mainScroll",ct.x,d,h,r.easing.cubic.out,Pe,function(){$e(),ne=!1,st=-1,(n||st!==c)&&o.updateCurrItem(),Re("mainScrollAnimComplete")}),n&&o.updateCurrItem(!0),n},Lt=function(e){return 1/J*e*v},Ot=function(){var e=g,t=Be(),n=ze();g<t?e=t:g>n&&(e=n);var i,a=ae;return oe&&!U&&!se&&g<t?(o.close(),!0):(oe&&(i=function(e){Se((1-a)*e+a)}),o.zoomTo(e,0,200,r.easing.cubic.out,i),!0)};Te("Gestures",{publicMethods:{initGestures:function(){var e=function(e,t,n,i,r){x=e+t,R=e+n,H=e+i,S=r?e+r:""};(C=N.pointerEvent)&&N.touch&&(N.touch=!1),C?navigator.pointerEnabled?e("pointer","down","move","up","cancel"):e("MSPointer","Down","Move","Up","Cancel"):N.touch?(e("touch","start","move","end","cancel"),A=!0):e("mouse","down","move","up"),f=R+" "+H+" "+S,p=x,C&&!A&&(A=navigator.maxTouchPoints>1||navigator.msMaxTouchPoints>1),o.likelyTouchDevice=A,m[x]=St,m[R]=Mt,m[H]=At,S&&(m[S]=m[H]),N.touch&&(p+=" mousedown",f+=" mousemove mouseup",m.mousedown=m[x],m.mousemove=m[R],m.mouseup=m[H]),A||(a.allowPanToNext=!1)}}});var Ft,Nt,It,Bt,zt,Vt,Ut=function(t,n,i,s){var l;Ft&&clearTimeout(Ft),Bt=!0,It=!0,t.initialLayout?(l=t.initialLayout,t.initialLayout=null):l=a.getThumbBoundsFn&&a.getThumbBoundsFn(c);var h,d,f=i?a.hideAnimationDuration:a.showAnimationDuration,p=function(){qe("initialZoom"),i?(o.template.removeAttribute("style"),o.bg.removeAttribute("style")):(Se(1),n&&(n.style.display="block"),r.addClass(e,"pswp--animated-in"),Re("initialZoom"+(i?"OutEnd":"InEnd"))),s&&s(),Bt=!1};if(!f||!l||void 0===l.x)return Re("initialZoom"+(i?"Out":"In")),g=t.initialZoomLevel,Le(he,t.initialPosition),Ce(),e.style.opacity=i?0:1,Se(1),void(f?setTimeout(function(){p()},f):p());h=u,d=!o.currItem.src||o.currItem.loadError||a.showHideOpacity,t.miniImg&&(t.miniImg.style.webkitBackfaceVisibility="hidden"),i||(g=l.w/t.w,he.x=l.x,he.y=l.y-L,o[d?"template":"bg"].style.opacity=.001,Ce()),Xe("initialZoom"),i&&!h&&r.removeClass(e,"pswp--animated-in"),d&&(i?r[(h?"remove":"add")+"Class"](e,"pswp--animate_opacity"):setTimeout(function(){r.addClass(e,"pswp--animate_opacity")},30)),Ft=setTimeout(function(){if(Re("initialZoom"+(i?"Out":"In")),i){var n=l.w/t.w,o={x:he.x,y:he.y},a=g,s=ae,u=function(t){1===t?(g=n,he.x=l.x,he.y=l.y-F):(g=(n-a)*t+a,he.x=(l.x-o.x)*t+o.x,he.y=(l.y-F-o.y)*t+o.y),Ce(),d?e.style.opacity=1-t:Se(s-t*s)};h?Ze("initialZoom",0,1,f,r.easing.cubic.out,u,p):(u(1),Ft=setTimeout(p,f+20))}else g=t.initialZoomLevel,Le(he,t.initialPosition),Ce(),Se(1),d?e.style.opacity=1:Se(1),Ft=setTimeout(p,f+20)},i?25:90)},jt={},Wt=[],Gt={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Nt.length}},Yt=function(e,t,n){if(e.src&&!e.loadError){var i=!n;if(i&&(e.vGap||(e.vGap={top:0,bottom:0}),Re("parseVerticalMargin",e)),jt.x=t.x,jt.y=t.y-e.vGap.top-e.vGap.bottom,i){var r=jt.x/e.w,o=jt.y/e.h;e.fitRatio=r<o?r:o;var s=a.scaleMode;"orig"===s?n=1:"fit"===s&&(n=e.fitRatio),n>1&&(n=1),e.initialZoomLevel=n,e.bounds||(e.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}})}if(!n)return;return function(e,t,n){var i=e.bounds;i.center.x=Math.round((jt.x-t)/2),i.center.y=Math.round((jt.y-n)/2)+e.vGap.top,i.max.x=t>jt.x?Math.round(jt.x-t):i.center.x,i.max.y=n>jt.y?Math.round(jt.y-n)+e.vGap.top:i.center.y,i.min.x=t>jt.x?0:i.center.x,i.min.y=n>jt.y?e.vGap.top:i.center.y}(e,e.w*n,e.h*n),i&&n===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds}return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds={center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}},e.initialPosition=e.bounds.center,e.bounds},qt=function(e,t,n,i,r,a){t.loadError||i&&(t.imageAppended=!0,Zt(t,i,t===o.currItem&&_e),n.appendChild(i),a&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))},Xt=function(e){e.loading=!0,e.loaded=!1;var t=e.img=r.createEl("pswp__img","img"),n=function(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,t.onload=t.onerror=null,t=null};return t.onload=n,t.onerror=function(){e.loadError=!0,n()},t.src=e.src,t},$t=function(e,t){if(e.src&&e.loadError&&e.container)return t&&(e.container.innerHTML=""),e.container.innerHTML=a.errorMsg.replace("%url%",e.src),!0},Zt=function(e,t,n){if(e.src){t||(t=e.container.lastChild);var i=n?e.w:Math.round(e.w*e.fitRatio),r=n?e.h:Math.round(e.h*e.fitRatio);e.placeholder&&!e.loaded&&(e.placeholder.style.width=i+"px",e.placeholder.style.height=r+"px"),t.style.width=i+"px",t.style.height=r+"px"}},Kt=function(){if(Wt.length){for(var e,t=0;t<Wt.length;t++)(e=Wt[t]).holder.index===e.index&&qt(e.index,e.item,e.baseDiv,e.img,0,e.clearPlaceholder);Wt=[]}};Te("Controller",{publicMethods:{lazyLoadItem:function(e){e=be(e);var t=zt(e);t&&(!t.loaded&&!t.loading||T)&&(Re("gettingData",e,t),t.src&&Xt(t))},initController:function(){r.extend(a,Gt,!0),o.items=Nt=n,zt=o.getItemAt,Vt=a.getNumItemsFn,a.loop,Vt()<3&&(a.loop=!1),xe("beforeChange",function(e){var t,n=a.preload,i=null===e||e>=0,r=Math.min(n[0],Vt()),s=Math.min(n[1],Vt());for(t=1;t<=(i?s:r);t++)o.lazyLoadItem(c+t);for(t=1;t<=(i?r:s);t++)o.lazyLoadItem(c-t)}),xe("initialLayout",function(){o.currItem.initialLayout=a.getThumbBoundsFn&&a.getThumbBoundsFn(c)}),xe("mainScrollAnimComplete",Kt),xe("initialZoomInEnd",Kt),xe("destroy",function(){for(var e,t=0;t<Nt.length;t++)(e=Nt[t]).container&&(e.container=null),e.placeholder&&(e.placeholder=null),e.img&&(e.img=null),e.preloader&&(e.preloader=null),e.loadError&&(e.loaded=e.loadError=!1);Wt=null})},getItemAt:function(e){return e>=0&&void 0!==Nt[e]&&Nt[e]},allowProgressiveImg:function(){return a.forceProgressiveLoading||!A||a.mouseUsed||screen.width>1200},setContent:function(e,t){a.loop&&(t=be(t));var n=o.getItemAt(e.index);n&&(n.container=null);var i,l=o.getItemAt(t);if(l){Re("gettingData",t,l),e.index=t,e.item=l;var u=l.container=r.createEl("pswp__zoom-wrap");if(!l.src&&l.html&&(l.html.tagName?u.appendChild(l.html):u.innerHTML=l.html),$t(l),Yt(l,de),!l.src||l.loadError||l.loaded)l.src&&!l.loadError&&((i=r.createEl("pswp__img","img")).style.opacity=1,i.src=l.src,Zt(l,i),qt(0,l,u,i));else{if(l.loadComplete=function(n){if(s){if(e&&e.index===t){if($t(n,!0))return n.loadComplete=n.img=null,Yt(n,de),Ae(n),void(e.index===c&&o.updateCurrZoomItem());n.imageAppended?!Bt&&n.placeholder&&(n.placeholder.style.display="none",n.placeholder=null):N.transform&&(ne||Bt)?Wt.push({item:n,baseDiv:u,img:n.img,index:t,holder:e,clearPlaceholder:!0}):qt(0,n,u,n.img,0,!0)}n.loadComplete=null,n.img=null,Re("imageLoadComplete",t,n)}},r.features.transform){var h="pswp__img pswp__img--placeholder";h+=l.msrc?"":" pswp__img--placeholder--blank";var d=r.createEl(h,l.msrc?"img":"");l.msrc&&(d.src=l.msrc),Zt(l,d),u.appendChild(d),l.placeholder=d}l.loading||Xt(l),o.allowProgressiveImg()&&(!It&&N.transform?Wt.push({item:l,baseDiv:u,img:l.img,index:t,holder:e}):qt(0,l,u,l.img,0,!0))}It||t!==c?Ae(l):(te=u.style,Ut(l,i||l.img)),e.el.innerHTML="",e.el.appendChild(u)}else e.el.innerHTML=""},cleanSlide:function(e){e.img&&(e.img.onload=e.img.onerror=null),e.loaded=e.loading=e.img=e.imageAppended=!1}}});var Qt,Jt,en={},tn=function(e,t,n){var i=document.createEvent("CustomEvent"),r={origEvent:e,target:e.target,releasePoint:t,pointerType:n||"touch"};i.initCustomEvent("pswpTap",!0,!0,r),e.target.dispatchEvent(i)};Te("Tap",{publicMethods:{initTap:function(){xe("firstTouchStart",o.onTapStart),xe("touchRelease",o.onTapRelease),xe("destroy",function(){en={},Qt=null})},onTapStart:function(e){e.length>1&&(clearTimeout(Qt),Qt=null)},onTapRelease:function(e,t){var n,i;if(t&&!X&&!Y&&!Ye){var o=t;if(Qt&&(clearTimeout(Qt),Qt=null,n=o,i=en,Math.abs(n.x-i.x)<25&&Math.abs(n.y-i.y)<25))return void Re("doubleTap",o);if("mouse"===t.type)return void tn(e,t,"mouse");if("BUTTON"===e.target.tagName.toUpperCase()||r.hasClass(e.target,"pswp__single-tap"))return void tn(e,t);Le(en,o),Qt=setTimeout(function(){tn(e,t),Qt=null},300)}}}}),Te("DesktopZoom",{publicMethods:{initDesktopZoom:function(){O||(A?xe("mouseUsed",function(){o.setupDesktopZoom()}):o.setupDesktopZoom(!0))},setupDesktopZoom:function(t){Jt={};var n="wheel mousewheel DOMMouseScroll";xe("bindEvents",function(){r.bind(e,n,o.handleMouseWheel)}),xe("unbindEvents",function(){Jt&&r.unbind(e,n,o.handleMouseWheel)}),o.mouseZoomedIn=!1;var i,a=function(){o.mouseZoomedIn&&(r.removeClass(e,"pswp--zoomed-in"),o.mouseZoomedIn=!1),g<1?r.addClass(e,"pswp--zoom-allowed"):r.removeClass(e,"pswp--zoom-allowed"),s()},s=function(){i&&(r.removeClass(e,"pswp--dragging"),i=!1)};xe("resize",a),xe("afterChange",a),xe("pointerDown",function(){o.mouseZoomedIn&&(i=!0,r.addClass(e,"pswp--dragging"))}),xe("pointerUp",s),t||a()},handleMouseWheel:function(e){if(g<=o.currItem.fitRatio)return a.modal&&(!a.closeOnScroll||Ye||G?e.preventDefault():M&&Math.abs(e.deltaY)>2&&(u=!0,o.close())),!0;if(e.stopPropagation(),Jt.x=0,"deltaX"in e)1===e.deltaMode?(Jt.x=18*e.deltaX,Jt.y=18*e.deltaY):(Jt.x=e.deltaX,Jt.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(Jt.x=-.16*e.wheelDeltaX),e.wheelDeltaY?Jt.y=-.16*e.wheelDeltaY:Jt.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;Jt.y=e.detail}Ie(g,!0);var t=he.x-Jt.x,n=he.y-Jt.y;(a.modal||t<=ee.min.x&&t>=ee.max.x&&n<=ee.min.y&&n>=ee.max.y)&&e.preventDefault(),o.panTo(t,n)},toggleDesktopZoom:function(t){t=t||{x:de.x/2+pe.x,y:de.y/2+pe.y};var n=a.getDoubleTapZoom(!0,o.currItem),i=g===n;o.mouseZoomedIn=!i,o.zoomTo(i?o.currItem.initialZoomLevel:n,t,333),r[(i?"remove":"add")+"Class"](e,"pswp--zoomed-in")}}});var nn,rn,on,an,sn,ln,un,cn,hn,dn,fn,pn,mn={history:!0,galleryUID:1},gn=function(){return fn.hash.substring(1)},vn=function(){nn&&clearTimeout(nn),on&&clearTimeout(on)},En=function(){var e=gn(),t={};if(e.length<5)return t;var n,i=e.split("&");for(n=0;n<i.length;n++)if(i[n]){var r=i[n].split("=");r.length<2||(t[r[0]]=r[1])}if(a.galleryPIDs){var o=t.pid;for(t.pid=0,n=0;n<Nt.length;n++)if(Nt[n].pid===o){t.pid=n;break}}else t.pid=parseInt(t.pid,10)-1;return t.pid<0&&(t.pid=0),t},yn=function(){if(on&&clearTimeout(on),Ye||G)on=setTimeout(yn,500);else{an?clearTimeout(rn):an=!0;var e=c+1,t=zt(c);t.hasOwnProperty("pid")&&(e=t.pid);var n=un+"&gid="+a.galleryUID+"&pid="+e;cn||-1===fn.hash.indexOf(n)&&(dn=!0);var i=fn.href.split("#")[0]+"#"+n;pn?"#"+n!==window.location.hash&&history[cn?"replaceState":"pushState"]("",document.title,i):cn?fn.replace(i):fn.hash=n,cn=!0,rn=setTimeout(function(){an=!1},60)}};Te("History",{publicMethods:{initHistory:function(){if(r.extend(a,mn,!0),a.history){fn=window.location,dn=!1,hn=!1,cn=!1,un=gn(),pn="pushState"in history,un.indexOf("gid=")>-1&&(un=(un=un.split("&gid=")[0]).split("?gid=")[0]),xe("afterChange",o.updateURL),xe("unbindEvents",function(){r.unbind(window,"hashchange",o.onHashChange)});var e=function(){ln=!0,hn||(dn?history.back():un?fn.hash=un:pn?history.pushState("",document.title,fn.pathname+fn.search):fn.hash=""),vn()};xe("unbindEvents",function(){u&&e()}),xe("destroy",function(){ln||e()}),xe("firstUpdate",function(){c=En().pid});var t=un.indexOf("pid=");t>-1&&"&"===(un=un.substring(0,t)).slice(-1)&&(un=un.slice(0,-1)),setTimeout(function(){s&&r.bind(window,"hashchange",o.onHashChange)},40)}},onHashChange:function(){if(gn()===un)return hn=!0,void o.close();an||(sn=!0,o.goTo(En().pid),sn=!1)},updateURL:function(){vn(),sn||(cn?nn=setTimeout(yn,800):yn())}}}),r.extend(o,Ke)}}),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipeUI_Default=t()}(this,function(){"use strict";return function(e,t){var n,i,r,o,a,s,l,u,c,h,d,f,p,m,g,v,E,y,_=this,T=!1,b=!0,w=!0,x={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(e,t){return e.title?(t.children[0].innerHTML=e.title,!0):(t.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return e.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return e.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},R=function(e){if(v)return!0;e=e||window.event,g.timeToIdle&&g.mouseUsed&&!c&&L();for(var n,i,r=(e.target||e.srcElement).getAttribute("class")||"",o=0;o<I.length;o++)(n=I[o]).onTap&&r.indexOf("pswp__"+n.name)>-1&&(n.onTap(),i=!0);if(i){e.stopPropagation&&e.stopPropagation(),v=!0;var a=t.features.isOldAndroid?600:30;setTimeout(function(){v=!1},a)}},H=function(e,n,i){t[(i?"add":"remove")+"Class"](e,"pswp__"+n)},S=function(){var e=1===g.getNumItemsFn();e!==m&&(H(i,"ui--one-slide",e),m=e)},M=function(){H(l,"share-modal--hidden",w)},C=function(){return(w=!w)?(t.removeClass(l,"pswp__share-modal--fade-in"),setTimeout(function(){w&&M()},300)):(M(),setTimeout(function(){w||t.addClass(l,"pswp__share-modal--fade-in")},30)),w||k(),!1},A=function(t){var n=(t=t||window.event).target||t.srcElement;return e.shout("shareLinkClick",t,n),!(!n.href||!n.hasAttribute("download")&&(window.open(n.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),w||C(),1))},k=function(){for(var e,t,n,i,r="",o=0;o<g.shareButtons.length;o++)e=g.shareButtons[o],t=g.getImageURLForShare(e),n=g.getPageURLForShare(e),i=g.getTextForShare(e),r+='<a href="'+e.url.replace("{{url}}",encodeURIComponent(n)).replace("{{image_url}}",encodeURIComponent(t)).replace("{{raw_image_url}}",t).replace("{{text}}",encodeURIComponent(i))+'" target="_blank" class="pswp__share--'+e.id+'"'+(e.download?"download":"")+">"+e.label+"</a>",g.parseShareButtonOut&&(r=g.parseShareButtonOut(e,r));l.children[0].innerHTML=r,l.children[0].onclick=A},P=function(e){for(var n=0;n<g.closeElClasses.length;n++)if(t.hasClass(e,"pswp__"+g.closeElClasses[n]))return!0},D=0,L=function(){clearTimeout(y),D=0,c&&_.setIdle(!1)},O=function(e){var t=(e=e||window.event).relatedTarget||e.toElement;t&&"HTML"!==t.nodeName||(clearTimeout(y),y=setTimeout(function(){_.setIdle(!0)},g.timeToIdleOutside))},F=function(e){f!==e&&(H(d,"preloader--active",!e),f=e)},N=function(n){var a=n.vGap;if(!e.likelyTouchDevice||g.mouseUsed||screen.width>g.fitControlsWidth){var s=g.barsSize;if(g.captionEl&&"auto"===s.bottom)if(o||((o=t.createEl("pswp__caption pswp__caption--fake")).appendChild(t.createEl("pswp__caption__center")),i.insertBefore(o,r),t.addClass(i,"pswp__ui--fit")),g.addCaptionHTMLFn(n,o,!0)){var l=o.clientHeight;a.bottom=parseInt(l,10)||44}else a.bottom=s.top;else a.bottom="auto"===s.bottom?0:s.bottom;a.top=s.top}else a.top=a.bottom=0},I=[{name:"caption",option:"captionEl",onInit:function(e){r=e}},{name:"share-modal",option:"shareEl",onInit:function(e){l=e},onTap:function(){C()}},{name:"button--share",option:"shareEl",onInit:function(e){s=e},onTap:function(){C()}},{name:"button--zoom",option:"zoomEl",onTap:e.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){a=e}},{name:"button--close",option:"closeEl",onTap:e.close},{name:"button--arrow--left",option:"arrowEl",onTap:e.prev},{name:"button--arrow--right",option:"arrowEl",onTap:e.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){n.isFullscreen()?n.exit():n.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){d=e}}];_.init=function(){var a;t.extend(e.options,x,!0),g=e.options,i=t.getChildByClass(e.scrollWrap,"pswp__ui"),(h=e.listen)("onVerticalDrag",function(e){b&&e<.95?_.hideControls():!b&&e>=.95&&_.showControls()}),h("onPinchClose",function(e){b&&e<.9?(_.hideControls(),a=!0):a&&!b&&e>.9&&_.showControls()}),h("zoomGestureEnded",function(){(a=!1)&&!b&&_.showControls()}),h("beforeChange",_.update),h("doubleTap",function(t){var n=e.currItem.initialZoomLevel;e.getZoomLevel()!==n?e.zoomTo(n,t,333):e.zoomTo(g.getDoubleTapZoom(!1,e.currItem),t,333)}),h("preventDragEvent",function(e,t,n){var i=e.target||e.srcElement;i&&i.getAttribute("class")&&e.type.indexOf("mouse")>-1&&(i.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(i.tagName))&&(n.prevent=!1)}),h("bindEvents",function(){t.bind(i,"pswpTap click",R),t.bind(e.scrollWrap,"pswpTap",_.onGlobalTap),e.likelyTouchDevice||t.bind(e.scrollWrap,"mouseover",_.onMouseOver)}),h("unbindEvents",function(){w||C(),E&&clearInterval(E),t.unbind(document,"mouseout",O),t.unbind(document,"mousemove",L),t.unbind(i,"pswpTap click",R),t.unbind(e.scrollWrap,"pswpTap",_.onGlobalTap),t.unbind(e.scrollWrap,"mouseover",_.onMouseOver),n&&(t.unbind(document,n.eventK,_.updateFullscreen),n.isFullscreen()&&(g.hideAnimationDuration=0,n.exit()),n=null)}),h("destroy",function(){g.captionEl&&(o&&i.removeChild(o),t.removeClass(r,"pswp__caption--empty")),l&&(l.children[0].onclick=null),t.removeClass(i,"pswp__ui--over-close"),t.addClass(i,"pswp__ui--hidden"),_.setIdle(!1)}),g.showAnimationDuration||t.removeClass(i,"pswp__ui--hidden"),h("initialZoomIn",function(){g.showAnimationDuration&&t.removeClass(i,"pswp__ui--hidden")}),h("initialZoomOut",function(){t.addClass(i,"pswp__ui--hidden")}),h("parseVerticalMargin",N),function(){var e,n,r,o=function(i){if(i)for(var o=i.length,a=0;a<o;a++){e=i[a],n=e.className;for(var s=0;s<I.length;s++)r=I[s],n.indexOf("pswp__"+r.name)>-1&&(g[r.option]?(t.removeClass(e,"pswp__element--disabled"),r.onInit&&r.onInit(e)):t.addClass(e,"pswp__element--disabled"))}};o(i.children);var a=t.getChildByClass(i,"pswp__top-bar");a&&o(a.children)}(),g.shareEl&&s&&l&&(w=!0),S(),g.timeToIdle&&h("mouseUsed",function(){t.bind(document,"mousemove",L),t.bind(document,"mouseout",O),E=setInterval(function(){2==++D&&_.setIdle(!0)},g.timeToIdle/2)}),g.fullscreenEl&&!t.features.isOldAndroid&&(n||(n=_.getFullscreenAPI()),n?(t.bind(document,n.eventK,_.updateFullscreen),_.updateFullscreen(),t.addClass(e.template,"pswp--supports-fs")):t.removeClass(e.template,"pswp--supports-fs")),g.preloaderEl&&(F(!0),h("beforeChange",function(){clearTimeout(p),p=setTimeout(function(){e.currItem&&e.currItem.loading?(!e.allowProgressiveImg()||e.currItem.img&&!e.currItem.img.naturalWidth)&&F(!1):F(!0)},g.loadingIndicatorDelay)}),h("imageLoadComplete",function(t,n){e.currItem===n&&F(!0)}))},_.setIdle=function(e){c=e,H(i,"ui--idle",e)},_.update=function(){b&&e.currItem?(_.updateIndexIndicator(),g.captionEl&&(g.addCaptionHTMLFn(e.currItem,r),H(r,"caption--empty",!e.currItem.title)),T=!0):T=!1,w||C(),S()},_.updateFullscreen=function(i){i&&setTimeout(function(){e.setScrollOffset(0,t.getScrollY())},50),t[(n.isFullscreen()?"add":"remove")+"Class"](e.template,"pswp--fs")},_.updateIndexIndicator=function(){g.counterEl&&(a.innerHTML=e.getCurrentIndex()+1+g.indexIndicatorSep+g.getNumItemsFn())},_.onGlobalTap=function(n){var i=(n=n||window.event).target||n.srcElement;if(!v)if(n.detail&&"mouse"===n.detail.pointerType){if(P(i))return void e.close();t.hasClass(i,"pswp__img")&&(1===e.getZoomLevel()&&e.getZoomLevel()<=e.currItem.fitRatio?g.clickToCloseNonZoomable&&e.close():e.toggleDesktopZoom(n.detail.releasePoint))}else if(g.tapToToggleControls&&(b?_.hideControls():_.showControls()),g.tapToClose&&(t.hasClass(i,"pswp__img")||P(i)))return void e.close()},_.onMouseOver=function(e){var t=(e=e||window.event).target||e.srcElement;H(i,"ui--over-close",P(t))},_.hideControls=function(){t.addClass(i,"pswp__ui--hidden"),b=!1},_.showControls=function(){b=!0,T||_.update(),t.removeClass(i,"pswp__ui--hidden")},_.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},_.getFullscreenAPI=function(){var t,n=document.documentElement,i="fullscreenchange";return n.requestFullscreen?t={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:i}:n.mozRequestFullScreen?t={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+i}:n.webkitRequestFullscreen?t={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+i}:n.msRequestFullscreen&&(t={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),t&&(t.enter=function(){if(u=g.closeOnScroll,g.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK)return e.template[this.enterK]();e.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},t.exit=function(){return g.closeOnScroll=u,document[this.exitK]()},t.isFullscreen=function(){return document[this.elementK]}),t}}}),"undefined"==typeof jQuery)throw new Error("Tempus Dominus Bootstrap4's requires jQuery. jQuery must be included before Tempus Dominus Bootstrap4's JavaScript.");if(function(e){var t=jQuery.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Tempus Dominus Bootstrap4's requires at least jQuery v1.9.1 but less than v4.0.0")}(),"undefined"==typeof moment)throw new Error("Tempus Dominus Bootstrap4's requires moment.js. Moment.js must be included before Tempus Dominus Bootstrap4's JavaScript.");var version=moment.version.split(".");if(version[0]<=2&&version[1]<17||version[0]>=3)throw new Error("Tempus Dominus Bootstrap4's requires at least moment.js v2.17.0 but less than v3.0.0");!function(){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(e,i){var r="datetimepicker",o=""+r,a="."+o,s={DATA_TOGGLE:'[data-toggle="'+o+'"]'},l={INPUT:r+"-input"},u={CHANGE:"change"+a,BLUR:"blur"+a,KEYUP:"keyup"+a,KEYDOWN:"keydown"+a,FOCUS:"focus"+a,CLICK_DATA_API:"click"+a+".data-api",UPDATE:"datetimepicker.update",ERROR:"datetimepicker.error",HIDE:"datetimepicker.hide",SHOW:"datetimepicker.show"},c=[{CLASS_NAME:"days",NAV_FUNCTION:"M",NAV_STEP:1},{CLASS_NAME:"months",NAV_FUNCTION:"y",NAV_STEP:1},{CLASS_NAME:"years",NAV_FUNCTION:"y",NAV_STEP:10},{CLASS_NAME:"decades",NAV_FUNCTION:"y",NAV_STEP:100}],h={up:38,38:"up",down:40,40:"down",left:37,37:"left",right:39,39:"right",tab:9,9:"tab",escape:27,27:"escape",enter:13,13:"enter",pageUp:33,33:"pageUp",pageDown:34,34:"pageDown",shift:16,16:"shift",control:17,17:"control",space:32,32:"space",t:84,84:"t",delete:46,46:"delete"},d=["times","days","months","years","decades"],f={},p={},m=0,g={timeZone:"",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,collapse:!0,locale:i.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"icon-clock",date:"icon-calendar",up:"icon-up-big",down:"icon-down-big",previous:"icon-angle-circled-left",next:"icon-angle-circled-right",today:"icon-calendar-check-o",clear:"icon-trash-empty",close:"icon-cancel"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time",selectDate:"Select Date"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",buttons:{showToday:!1,showClear:!1,showClose:!1},widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,keyBinds:{up:function(){if(!this.widget)return!1;var e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(e.clone().subtract(7,"d")):this.date(e.clone().add(this.stepping(),"m")),!0},down:function(){if(!this.widget)return this.show(),!1;var e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(e.clone().add(7,"d")):this.date(e.clone().subtract(this.stepping(),"m")),!0},"control up":function(){if(!this.widget)return!1;var e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(e.clone().subtract(1,"y")):this.date(e.clone().add(1,"h")),!0},"control down":function(){if(!this.widget)return!1;var e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(e.clone().add(1,"y")):this.date(e.clone().subtract(1,"h")),!0},left:function(){if(!this.widget)return!1;var e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(e.clone().subtract(1,"d")),!0},right:function(){if(!this.widget)return!1;var e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(e.clone().add(1,"d")),!0},pageUp:function(){if(!this.widget)return!1;var e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(e.clone().subtract(1,"M")),!0},pageDown:function(){if(!this.widget)return!1;var e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(e.clone().add(1,"M")),!0},enter:function(){return this.hide(),!0},escape:function(){return!!this.widget&&(this.hide(),!0)},"control space":function(){return!!this.widget&&(this.widget.find(".timepicker").is(":visible")&&this.widget.find('.btn[data-action="togglePeriod"]').click(),!0)},t:function(){return this.date(this.getMoment()),!0},delete:function(){return!!this.widget&&(this.clear(),!0)}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1,allowMultidate:!1,multidateSeparator:","};return function(){function v(e,t){n(this,v),this._options=this._getOptions(t),this._element=e,this._dates=[],this._datesFormatted=[],this._viewDate=null,this.unset=!0,this.component=!1,this.widget=!1,this.use24Hours=null,this.actualFormat=null,this.parseFormats=null,this.currentViewMode=null,this._int()}return v.prototype._int=function(){var t=this._element.data("target-input");this._element.is("input")?this.input=this._element:void 0!==t&&(this.input="nearest"===t?this._element.find("input"):e(t)),this._dates=[],this._dates[0]=this.getMoment(),this._viewDate=this.getMoment().clone(),e.extend(!0,this._options,this._dataToOptions()),this.options(this._options),this._initFormatting(),void 0!==this.input&&this.input.is("input")&&0!==this.input.val().trim().length?this._setValue(this._parseInputDate(this.input.val().trim()),0):this._options.defaultDate&&void 0!==this.input&&void 0===this.input.attr("placeholder")&&this._setValue(this._options.defaultDate,0),this._options.inline&&this.show()},v.prototype._update=function(){this.widget&&(this._fillDate(),this._fillTime())},v.prototype._setValue=function(e,t){var n=this.unset?null:this._dates[t],i="";if(!e)return this._options.allowMultidate&&1!==this._dates.length?(i=(i=this._element.data("date")+",").replace(n.format(this.actualFormat)+",","").replace(",,","").replace(/,\s*$/,""),this._dates.splice(t,1),this._datesFormatted.splice(t,1)):(this.unset=!0,this._dates=[],this._datesFormatted=[]),void 0!==this.input&&(this.input.val(i),this.input.trigger("input")),this._element.data("date",i),this._notifyEvent({type:v.Event.CHANGE,date:!1,oldDate:n}),void this._update();if(e=e.clone().locale(this._options.locale),this._hasTimeZone()&&e.tz(this._options.timeZone),1!==this._options.stepping&&e.minutes(Math.round(e.minutes()/this._options.stepping)*this._options.stepping).seconds(0),this._isValid(e)){if(this._dates[t]=e,this._datesFormatted[t]=e.format("YYYY-MM-DD"),this._viewDate=e.clone(),this._options.allowMultidate&&this._dates.length>1){for(var r=0;r<this._dates.length;r++)i+=""+this._dates[r].format(this.actualFormat)+this._options.multidateSeparator;i=i.replace(/,\s*$/,"")}else i=this._dates[t].format(this.actualFormat);void 0!==this.input&&(this.input.val(i),this.input.trigger("input")),this._element.data("date",i),this.unset=!1,this._update(),this._notifyEvent({type:v.Event.CHANGE,date:this._dates[t].clone(),oldDate:n})}else this._options.keepInvalid?this._notifyEvent({type:v.Event.CHANGE,date:e,oldDate:n}):void 0!==this.input&&(this.input.val(""+(this.unset?"":this._dates[t].format(this.actualFormat))),this.input.trigger("input")),this._notifyEvent({type:v.Event.ERROR,date:e,oldDate:n})},v.prototype._change=function(t){var n=e(t.target).val().trim(),i=n?this._parseInputDate(n):null;return this._setValue(i),t.stopImmediatePropagation(),!1},v.prototype._getOptions=function(t){return t=e.extend(!0,{},g,t)},v.prototype._hasTimeZone=function(){return void 0!==i.tz&&void 0!==this._options.timeZone&&null!==this._options.timeZone&&""!==this._options.timeZone},v.prototype._isEnabled=function(e){if("string"!=typeof e||e.length>1)throw new TypeError("isEnabled expects a single character string parameter");switch(e){case"y":return-1!==this.actualFormat.indexOf("Y");case"M":return-1!==this.actualFormat.indexOf("M");case"d":return-1!==this.actualFormat.toLowerCase().indexOf("d");case"h":case"H":return-1!==this.actualFormat.toLowerCase().indexOf("h");case"m":return-1!==this.actualFormat.indexOf("m");case"s":return-1!==this.actualFormat.indexOf("s");default:return!1}},v.prototype._hasTime=function(){return this._isEnabled("h")||this._isEnabled("m")||this._isEnabled("s")},v.prototype._hasDate=function(){return this._isEnabled("y")||this._isEnabled("M")||this._isEnabled("d")},v.prototype._dataToOptions=function(){var t=this._element.data(),n={};return t.dateOptions&&t.dateOptions instanceof Object&&(n=e.extend(!0,n,t.dateOptions)),e.each(this._options,function(e){var i="date"+e.charAt(0).toUpperCase()+e.slice(1);void 0!==t[i]?n[e]=t[i]:delete n[e]}),n},v.prototype._notifyEvent=function(e){e.type===v.Event.CHANGE&&e.date&&e.date.isSame(e.oldDate)||!e.date&&!e.oldDate||this._element.trigger(e)},v.prototype._viewUpdate=function(e){"y"===e&&(e="YYYY"),this._notifyEvent({type:v.Event.UPDATE,change:e,viewDate:this._viewDate.clone()})},v.prototype._showMode=function(e){this.widget&&(e&&(this.currentViewMode=Math.max(m,Math.min(3,this.currentViewMode+e))),this.widget.find(".datepicker > div").hide().filter(".datepicker-"+c[this.currentViewMode].CLASS_NAME).show())},v.prototype._isInDisabledDates=function(e){return!0===this._options.disabledDates[e.format("YYYY-MM-DD")]},v.prototype._isInEnabledDates=function(e){return!0===this._options.enabledDates[e.format("YYYY-MM-DD")]},v.prototype._isInDisabledHours=function(e){return!0===this._options.disabledHours[e.format("H")]},v.prototype._isInEnabledHours=function(e){return!0===this._options.enabledHours[e.format("H")]},v.prototype._isValid=function(t,n){if(!t.isValid())return!1;if(this._options.disabledDates&&"d"===n&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===n&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,n))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,n))return!1;if(this._options.daysOfWeekDisabled&&"d"===n&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===n||"m"===n||"s"===n)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===n||"m"===n||"s"===n)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===n||"m"===n||"s"===n)){var i=!1;if(e.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return i=!0,!1}),i)return!1}return!0},v.prototype._parseInputDate=function(e){return void 0===this._options.parseInputDate?i.isMoment(e)||(e=this.getMoment(e)):e=this._options.parseInputDate(e),e},v.prototype._keydown=function(e){var t=null,n=void 0,i=void 0,r=void 0,o=void 0,a=[],s={},l=e.which;for(n in f[l]="p",f)f.hasOwnProperty(n)&&"p"===f[n]&&(a.push(n),parseInt(n,10)!==l&&(s[n]=!0));for(n in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(n)&&"function"==typeof this._options.keyBinds[n]&&(r=n.split(" ")).length===a.length&&h[l]===r[r.length-1]){for(o=!0,i=r.length-2;i>=0;i--)if(!(h[r[i]]in s)){o=!1;break}if(o){t=this._options.keyBinds[n];break}}t&&t.call(this.widget)&&(e.stopPropagation(),e.preventDefault())},v.prototype._keyup=function(e){f[e.which]="r",p[e.which]&&(p[e.which]=!1,e.stopPropagation(),e.preventDefault())},v.prototype._indexGivenDates=function(t){var n={},i=this;return e.each(t,function(){var e=i._parseInputDate(this);e.isValid()&&(n[e.format("YYYY-MM-DD")]=!0)}),!!Object.keys(n).length&&n},v.prototype._indexGivenHours=function(t){var n={};return e.each(t,function(){n[this]=!0}),!!Object.keys(n).length&&n},v.prototype._initFormatting=function(){var e=this._options.format||"L LT",t=this;this.actualFormat=e.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return t._dates[0].localeData().longDateFormat(e)||e}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(e)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(m=2),this._isEnabled("M")&&(m=1),this._isEnabled("d")&&(m=0),this.currentViewMode=Math.max(m,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},v.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},v.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},v.prototype.getMoment=function(e){var t=void 0;return t=null==e?i():this._hasTimeZone()?i.tz(e,this.parseFormats,this._options.useStrict,this._options.timeZone):i(e,this.parseFormats,this._options.useStrict),this._hasTimeZone()&&t.tz(this._options.timeZone),t},v.prototype.toggle=function(){return this.widget?this.hide():this.show()},v.prototype.ignoreReadonly=function(e){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof e)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=e},v.prototype.options=function(t){if(0===arguments.length)return e.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");e.extend(!0,this._options,t);var n=this;e.each(this._options,function(e,t){void 0!==n[e]&&n[e](t)})},v.prototype.date=function(e,t){if(t=t||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[t].clone();if(!(null===e||"string"==typeof e||i.isMoment(e)||e instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===e?null:this._parseInputDate(e),t)},v.prototype.format=function(e){if(0===arguments.length)return this._options.format;if("string"!=typeof e&&("boolean"!=typeof e||!1!==e))throw new TypeError("format() expects a string or boolean:false parameter "+e);this._options.format=e,this.actualFormat&&this._initFormatting()},v.prototype.timeZone=function(e){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof e)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=e},v.prototype.dayViewHeaderFormat=function(e){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof e)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=e},v.prototype.extraFormats=function(e){if(0===arguments.length)return this._options.extraFormats;if(!1!==e&&!(e instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=e,this.parseFormats&&this._initFormatting()},v.prototype.disabledDates=function(t){if(0===arguments.length)return this._options.disabledDates?e.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()},v.prototype.enabledDates=function(t){if(0===arguments.length)return this._options.enabledDates?e.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()},v.prototype.daysOfWeekDisabled=function(e){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof e&&!e)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(e instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=e.reduce(function(e,t){return(t=parseInt(t,10))>6||t<0||isNaN(t)?e:(-1===e.indexOf(t)&&e.push(t),e)},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var t=0;t<this._dates.length;t++){for(var n=0;!this._isValid(this._dates[t],"d");){if(this._dates[t].add(1,"d"),31===n)throw"Tried 31 times to find a valid date";n++}this._setValue(this._dates[t],t)}this._update()},v.prototype.maxDate=function(e){if(0===arguments.length)return this._options.maxDate?this._options.maxDate.clone():this._options.maxDate;if("boolean"==typeof e&&!1===e)return this._options.maxDate=!1,this._update(),!0;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=this.getMoment()));var t=this._parseInputDate(e);if(!t.isValid())throw new TypeError("maxDate() Could not parse date parameter: "+e);if(this._options.minDate&&t.isBefore(this._options.minDate))throw new TypeError("maxDate() date parameter is before this.options.minDate: "+t.format(this.actualFormat));this._options.maxDate=t;for(var n=0;n<this._dates.length;n++)this._options.useCurrent&&!this._options.keepInvalid&&this._dates[n].isAfter(e)&&this._setValue(this._options.maxDate,n);this._viewDate.isAfter(t)&&(this._viewDate=t.clone().subtract(this._options.stepping,"m")),this._update()},v.prototype.minDate=function(e){if(0===arguments.length)return this._options.minDate?this._options.minDate.clone():this._options.minDate;if("boolean"==typeof e&&!1===e)return this._options.minDate=!1,this._update(),!0;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=this.getMoment()));var t=this._parseInputDate(e);if(!t.isValid())throw new TypeError("minDate() Could not parse date parameter: "+e);if(this._options.maxDate&&t.isAfter(this._options.maxDate))throw new TypeError("minDate() date parameter is after this.options.maxDate: "+t.format(this.actualFormat));this._options.minDate=t;for(var n=0;n<this._dates.length;n++)this._options.useCurrent&&!this._options.keepInvalid&&this._dates[n].isBefore(e)&&this._setValue(this._options.minDate,n);this._viewDate.isBefore(t)&&(this._viewDate=t.clone().add(this._options.stepping,"m")),this._update()},v.prototype.defaultDate=function(e){if(0===arguments.length)return this._options.defaultDate?this._options.defaultDate.clone():this._options.defaultDate;if(!e)return this._options.defaultDate=!1,!0;"string"==typeof e&&(e="now"===e||"moment"===e?this.getMoment():this.getMoment(e));var t=this._parseInputDate(e);if(!t.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+e);if(!this._isValid(t))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");this._options.defaultDate=t,(this._options.defaultDate&&this._options.inline||void 0!==this.input&&""===this.input.val().trim())&&this._setValue(this._options.defaultDate,0)},v.prototype.locale=function(e){if(0===arguments.length)return this._options.locale;if(!i.localeData(e))throw new TypeError("locale() locale "+e+" is not loaded from moment locales!");for(var t=0;t<this._dates.length;t++)this._dates[t].locale(this._options.locale);this._viewDate.locale(this._options.locale),this.actualFormat&&this._initFormatting(),this.widget&&(this.hide(),this.show())},v.prototype.stepping=function(e){if(0===arguments.length)return this._options.stepping;e=parseInt(e,10),(isNaN(e)||e<1)&&(e=1),this._options.stepping=e},v.prototype.useCurrent=function(e){var t=["year","month","day","hour","minute"];if(0===arguments.length)return this._options.useCurrent;if("boolean"!=typeof e&&"string"!=typeof e)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof e&&-1===t.indexOf(e.toLowerCase()))throw new TypeError("useCurrent() expects a string parameter of "+t.join(", "));this._options.useCurrent=e},v.prototype.collapse=function(e){if(0===arguments.length)return this._options.collapse;if("boolean"!=typeof e)throw new TypeError("collapse() expects a boolean parameter");if(this._options.collapse===e)return!0;this._options.collapse=e,this.widget&&(this.hide(),this.show())},v.prototype.icons=function(t){if(0===arguments.length)return e.extend({},this._options.icons);if(!(t instanceof Object))throw new TypeError("icons() expects parameter to be an Object");e.extend(this._options.icons,t),this.widget&&(this.hide(),this.show())},v.prototype.tooltips=function(t){if(0===arguments.length)return e.extend({},this._options.tooltips);if(!(t instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");e.extend(this._options.tooltips,t),this.widget&&(this.hide(),this.show())},v.prototype.useStrict=function(e){if(0===arguments.length)return this._options.useStrict;if("boolean"!=typeof e)throw new TypeError("useStrict() expects a boolean parameter");this._options.useStrict=e},v.prototype.sideBySide=function(e){if(0===arguments.length)return this._options.sideBySide;if("boolean"!=typeof e)throw new TypeError("sideBySide() expects a boolean parameter");this._options.sideBySide=e,this.widget&&(this.hide(),this.show())},v.prototype.viewMode=function(e){if(0===arguments.length)return this._options.viewMode;if("string"!=typeof e)throw new TypeError("viewMode() expects a string parameter");if(-1===v.ViewModes.indexOf(e))throw new TypeError("viewMode() parameter must be one of ("+v.ViewModes.join(", ")+") value");this._options.viewMode=e,this.currentViewMode=Math.max(v.ViewModes.indexOf(e)-1,v.MinViewModeNumber),this._showMode()},v.prototype.calendarWeeks=function(e){if(0===arguments.length)return this._options.calendarWeeks;if("boolean"!=typeof e)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");this._options.calendarWeeks=e,this._update()},v.prototype.buttons=function(t){if(0===arguments.length)return e.extend({},this._options.buttons);if(!(t instanceof Object))throw new TypeError("buttons() expects parameter to be an Object");if(e.extend(this._options.buttons,t),"boolean"!=typeof this._options.buttons.showToday)throw new TypeError("buttons.showToday expects a boolean parameter");if("boolean"!=typeof this._options.buttons.showClear)throw new TypeError("buttons.showClear expects a boolean parameter");if("boolean"!=typeof this._options.buttons.showClose)throw new TypeError("buttons.showClose expects a boolean parameter");this.widget&&(this.hide(),this.show())},v.prototype.keepOpen=function(e){if(0===arguments.length)return this._options.keepOpen;if("boolean"!=typeof e)throw new TypeError("keepOpen() expects a boolean parameter");this._options.keepOpen=e},v.prototype.focusOnShow=function(e){if(0===arguments.length)return this._options.focusOnShow;if("boolean"!=typeof e)throw new TypeError("focusOnShow() expects a boolean parameter");this._options.focusOnShow=e},v.prototype.inline=function(e){if(0===arguments.length)return this._options.inline;if("boolean"!=typeof e)throw new TypeError("inline() expects a boolean parameter");this._options.inline=e},v.prototype.clear=function(){this._setValue(null)},v.prototype.keyBinds=function(e){if(0===arguments.length)return this._options.keyBinds;this._options.keyBinds=e},v.prototype.debug=function(e){if("boolean"!=typeof e)throw new TypeError("debug() expects a boolean parameter");this._options.debug=e},v.prototype.allowInputToggle=function(e){if(0===arguments.length)return this._options.allowInputToggle;if("boolean"!=typeof e)throw new TypeError("allowInputToggle() expects a boolean parameter");this._options.allowInputToggle=e},v.prototype.keepInvalid=function(e){if(0===arguments.length)return this._options.keepInvalid;if("boolean"!=typeof e)throw new TypeError("keepInvalid() expects a boolean parameter");this._options.keepInvalid=e},v.prototype.datepickerInput=function(e){if(0===arguments.length)return this._options.datepickerInput;if("string"!=typeof e)throw new TypeError("datepickerInput() expects a string parameter");this._options.datepickerInput=e},v.prototype.parseInputDate=function(e){if(0===arguments.length)return this._options.parseInputDate;if("function"!=typeof e)throw new TypeError("parseInputDate() should be as function");this._options.parseInputDate=e},v.prototype.disabledTimeIntervals=function(t){if(0===arguments.length)return this._options.disabledTimeIntervals?e.extend({},this._options.disabledTimeIntervals):this._options.disabledTimeIntervals;if(!t)return this._options.disabledTimeIntervals=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");this._options.disabledTimeIntervals=t,this._update()},v.prototype.disabledHours=function(t){if(0===arguments.length)return this._options.disabledHours?e.extend({},this._options.disabledHours):this._options.disabledHours;if(!t)return this._options.disabledHours=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(this._options.disabledHours=this._indexGivenHours(t),this._options.enabledHours=!1,this._options.useCurrent&&!this._options.keepInvalid)for(var n=0;n<this._dates.length;n++){for(var i=0;!this._isValid(this._dates[n],"h");){if(this._dates[n].add(1,"h"),24===i)throw"Tried 24 times to find a valid date";i++}this._setValue(this._dates[n],n)}this._update()},v.prototype.enabledHours=function(t){if(0===arguments.length)return this._options.enabledHours?e.extend({},this._options.enabledHours):this._options.enabledHours;if(!t)return this._options.enabledHours=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(this._options.enabledHours=this._indexGivenHours(t),this._options.disabledHours=!1,this._options.useCurrent&&!this._options.keepInvalid)for(var n=0;n<this._dates.length;n++){for(var i=0;!this._isValid(this._dates[n],"h");){if(this._dates[n].add(1,"h"),24===i)throw"Tried 24 times to find a valid date";i++}this._setValue(this._dates[n],n)}this._update()},v.prototype.viewDate=function(e){if(0===arguments.length)return this._viewDate.clone();if(!e)return this._viewDate=(this._dates[0]||this.getMoment()).clone(),!0;if(!("string"==typeof e||i.isMoment(e)||e instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");this._viewDate=this._parseInputDate(e),this._viewUpdate()},v.prototype.allowMultidate=function(e){if("boolean"!=typeof e)throw new TypeError("allowMultidate() expects a boolean parameter");this._options.allowMultidate=e},v.prototype.multidateSeparator=function(e){if(0===arguments.length)return this._options.multidateSeparator;if("string"!=typeof e||e.length>1)throw new TypeError("multidateSeparator expects a single character string parameter");this._options.multidateSeparator=e},t(v,null,[{key:"NAME",get:function(){return r}},{key:"VERSION",get:function(){return"5.0.0-alpha12"}},{key:"DATA_KEY",get:function(){return o}},{key:"EVENT_KEY",get:function(){return a}},{key:"DATA_API_KEY",get:function(){return".data-api"}},{key:"DatePickerModes",get:function(){return c}},{key:"ViewModes",get:function(){return d}},{key:"MinViewModeNumber",get:function(){return m}},{key:"Event",get:function(){return u}},{key:"Selector",get:function(){return s}},{key:"Default",get:function(){return g},set:function(e){g=e}},{key:"ClassName",get:function(){return l}}]),v}()}(jQuery,moment);!function(t){var r=t.fn[i.NAME],o=["top","bottom","auto"],a=["left","right","auto"],s=["default","top","bottom"],l=function(e){var n=e.data("target"),r=void 0;return n||(n=e.attr("href")||"",n=/^#[a-z]/i.test(n)?n:null),0===(r=t(n)).length?r:(r.data(i.DATA_KEY)||t.extend({},r.data(),t(this).data()),r)},u=function(r){function l(e,t){n(this,l);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,r.call(this,e,t));return i._init(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(l,r),l.prototype._init=function(){if(this._element.hasClass("input-group")){var e=this._element.find(".datepickerbutton");0===e.length?this.component=this._element.find(".input-group-append"):this.component=e}},l.prototype._getDatePickerTemplate=function(){var e=t("<thead>").append(t("<tr>").append(t("<th>").addClass("prev").attr("data-action","previous").append(t("<span>").addClass(this._options.icons.previous))).append(t("<th>").addClass("picker-switch").attr("data-action","pickerSwitch").attr("colspan",this._options.calendarWeeks?"6":"5")).append(t("<th>").addClass("next").attr("data-action","next").append(t("<span>").addClass(this._options.icons.next)))),n=t("<tbody>").append(t("<tr>").append(t("<td>").attr("colspan",this._options.calendarWeeks?"8":"7")));return[t("<div>").addClass("datepicker-days").append(t("<table>").addClass("table table-sm").append(e).append(t("<tbody>"))),t("<div>").addClass("datepicker-months").append(t("<table>").addClass("table-condensed").append(e.clone()).append(n.clone())),t("<div>").addClass("datepicker-years").append(t("<table>").addClass("table-condensed").append(e.clone()).append(n.clone())),t("<div>").addClass("datepicker-decades").append(t("<table>").addClass("table-condensed").append(e.clone()).append(n.clone()))]},l.prototype._getTimePickerMainTemplate=function(){var e=t("<tr>"),n=t("<tr>"),i=t("<tr>");return this._isEnabled("h")&&(e.append(t("<td>").append(t("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.incrementHour}).addClass("btn").attr("data-action","incrementHours").append(t("<span>").addClass(this._options.icons.up)))),n.append(t("<td>").append(t("<span>").addClass("timepicker-hour").attr({"data-time-component":"hours",title:this._options.tooltips.pickHour}).attr("data-action","showHours"))),i.append(t("<td>").append(t("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.decrementHour}).addClass("btn").attr("data-action","decrementHours").append(t("<span>").addClass(this._options.icons.down))))),this._isEnabled("m")&&(this._isEnabled("h")&&(e.append(t("<td>").addClass("separator")),n.append(t("<td>").addClass("separator").html(":")),i.append(t("<td>").addClass("separator"))),e.append(t("<td>").append(t("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.incrementMinute}).addClass("btn").attr("data-action","incrementMinutes").append(t("<span>").addClass(this._options.icons.up)))),n.append(t("<td>").append(t("<span>").addClass("timepicker-minute").attr({"data-time-component":"minutes",title:this._options.tooltips.pickMinute}).attr("data-action","showMinutes"))),i.append(t("<td>").append(t("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.decrementMinute}).addClass("btn").attr("data-action","decrementMinutes").append(t("<span>").addClass(this._options.icons.down))))),this._isEnabled("s")&&(this._isEnabled("m")&&(e.append(t("<td>").addClass("separator")),n.append(t("<td>").addClass("separator").html(":")),i.append(t("<td>").addClass("separator"))),e.append(t("<td>").append(t("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.incrementSecond}).addClass("btn").attr("data-action","incrementSeconds").append(t("<span>").addClass(this._options.icons.up)))),n.append(t("<td>").append(t("<span>").addClass("timepicker-second").attr({"data-time-component":"seconds",title:this._options.tooltips.pickSecond}).attr("data-action","showSeconds"))),i.append(t("<td>").append(t("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.decrementSecond}).addClass("btn").attr("data-action","decrementSeconds").append(t("<span>").addClass(this._options.icons.down))))),this.use24Hours||(e.append(t("<td>").addClass("separator")),n.append(t("<td>").append(t("<button>").addClass("btn btn-primary").attr({"data-action":"togglePeriod",tabindex:"-1",title:this._options.tooltips.togglePeriod}))),i.append(t("<td>").addClass("separator"))),t("<div>").addClass("timepicker-picker").append(t("<table>").addClass("table-condensed").append([e,n,i]))},l.prototype._getTimePickerTemplate=function(){var e=t("<div>").addClass("timepicker-hours").append(t("<table>").addClass("table-condensed")),n=t("<div>").addClass("timepicker-minutes").append(t("<table>").addClass("table-condensed")),i=t("<div>").addClass("timepicker-seconds").append(t("<table>").addClass("table-condensed")),r=[this._getTimePickerMainTemplate()];return this._isEnabled("h")&&r.push(e),this._isEnabled("m")&&r.push(n),this._isEnabled("s")&&r.push(i),r},l.prototype._getToolbar=function(){var e=[];return this._options.buttons.showToday&&e.push(t("<td>").append(t("<a>").attr({"data-action":"today",title:this._options.tooltips.today}).append(t("<span>").addClass(this._options.icons.today)))),!this._options.sideBySide&&this._hasDate()&&this._hasTime()&&e.push(t("<td>").append(t("<a>").attr({"data-action":"togglePicker",title:this._options.tooltips.selectTime}).append(t("<span>").addClass(this._options.icons.time)))),this._options.buttons.showClear&&e.push(t("<td>").append(t("<a>").attr({"data-action":"clear",title:this._options.tooltips.clear}).append(t("<span>").addClass(this._options.icons.clear)))),this._options.buttons.showClose&&e.push(t("<td>").append(t("<a>").attr({"data-action":"close",title:this._options.tooltips.close}).append(t("<span>").addClass(this._options.icons.close)))),0===e.length?"":t("<table>").addClass("table-condensed").append(t("<tbody>").append(t("<tr>").append(e)))},l.prototype._getTemplate=function(){var e=t("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"),n=t("<div>").addClass("datepicker").append(this._getDatePickerTemplate()),i=t("<div>").addClass("timepicker").append(this._getTimePickerTemplate()),r=t("<ul>").addClass("list-unstyled"),o=t("<li>").addClass("picker-switch"+(this._options.collapse?" accordion-toggle":"")).append(this._getToolbar());return this._options.inline&&e.removeClass("dropdown-menu"),this.use24Hours&&e.addClass("usetwentyfour"),this._isEnabled("s")&&!this.use24Hours&&e.addClass("wider"),this._options.sideBySide&&this._hasDate()&&this._hasTime()?(e.addClass("timepicker-sbs"),"top"===this._options.toolbarPlacement&&e.append(o),e.append(t("<div>").addClass("row").append(n.addClass("col-md-6")).append(i.addClass("col-md-6"))),"bottom"!==this._options.toolbarPlacement&&"default"!==this._options.toolbarPlacement||e.append(o),e):("top"===this._options.toolbarPlacement&&r.append(o),this._hasDate()&&r.append(t("<li>").addClass(this._options.collapse&&this._hasTime()?"collapse":"").addClass(this._options.collapse&&this._hasTime()&&"time"===this._options.viewMode?"":"show").append(n)),"default"===this._options.toolbarPlacement&&r.append(o),this._hasTime()&&r.append(t("<li>").addClass(this._options.collapse&&this._hasDate()?"collapse":"").addClass(this._options.collapse&&this._hasDate()&&"time"===this._options.viewMode?"show":"").append(i)),"bottom"===this._options.toolbarPlacement&&r.append(o),e.append(r))},l.prototype._place=function(e){var n=e&&e.data&&e.data.picker||this,i=n._options.widgetPositioning.vertical,r=n._options.widgetPositioning.horizontal,o=void 0,a=(n.component||n._element).position(),s=(n.component||n._element).offset();if(n._options.widgetParent)o=n._options.widgetParent.append(n.widget);else if(n._element.is("input"))o=n._element.after(n.widget).parent();else{if(n._options.inline)return void(o=n._element.append(n.widget));o=n._element,n._element.children().first().after(n.widget)}if("auto"===i&&(i=s.top+1.5*n.widget.height()>=t(window).height()+t(window).scrollTop()&&n.widget.height()+n._element.outerHeight()<s.top?"top":"bottom"),"auto"===r&&(r=o.width()<s.left+n.widget.outerWidth()/2&&s.left+n.widget.outerWidth()>t(window).width()?"right":"left"),"top"===i?n.widget.addClass("top").removeClass("bottom"):n.widget.addClass("bottom").removeClass("top"),"right"===r?n.widget.addClass("float-right"):n.widget.removeClass("float-right"),"relative"!==o.css("position")&&(o=o.parents().filter(function(){return"relative"===t(this).css("position")}).first()),0===o.length)throw new Error("datetimepicker component should be placed within a relative positioned container");n.widget.css({top:"top"===i?"auto":a.top+n._element.outerHeight()+"px",bottom:"top"===i?o.outerHeight()-(o===n._element?0:a.top)+"px":"auto",left:"left"===r?(o===n._element?0:a.left)+"px":"auto",right:"left"===r?"auto":o.outerWidth()-n._element.outerWidth()-(o===n._element?0:a.left)+"px"})},l.prototype._fillDow=function(){var e=t("<tr>"),n=this._viewDate.clone().startOf("w").startOf("d");for(!0===this._options.calendarWeeks&&e.append(t("<th>").addClass("cw").text("#"));n.isBefore(this._viewDate.clone().endOf("w"));)e.append(t("<th>").addClass("dow").text(n.format("dd"))),n.add(1,"d");this.widget.find(".datepicker-days thead").append(e)},l.prototype._fillMonths=function(){for(var e=[],n=this._viewDate.clone().startOf("y").startOf("d");n.isSame(this._viewDate,"y");)e.push(t("<span>").attr("data-action","selectMonth").addClass("month").text(n.format("MMM"))),n.add(1,"M");this.widget.find(".datepicker-months td").empty().append(e)},l.prototype._updateMonths=function(){var e=this.widget.find(".datepicker-months"),n=e.find("th"),i=e.find("tbody").find("span"),r=this;n.eq(0).find("span").attr("title",this._options.tooltips.prevYear),n.eq(1).attr("title",this._options.tooltips.selectYear),n.eq(2).find("span").attr("title",this._options.tooltips.nextYear),e.find(".disabled").removeClass("disabled"),this._isValid(this._viewDate.clone().subtract(1,"y"),"y")||n.eq(0).addClass("disabled"),n.eq(1).text(this._viewDate.year()),this._isValid(this._viewDate.clone().add(1,"y"),"y")||n.eq(2).addClass("disabled"),i.removeClass("active"),this._getLastPickedDate().isSame(this._viewDate,"y")&&!this.unset&&i.eq(this._getLastPickedDate().month()).addClass("active"),i.each(function(e){r._isValid(r._viewDate.clone().month(e),"M")||t(this).addClass("disabled")})},l.prototype._getStartEndYear=function(e,t){var n=e/10,i=Math.floor(t/e)*e;return[i,i+9*n,Math.floor(t/n)*n]},l.prototype._updateYears=function(){var e=this.widget.find(".datepicker-years"),t=e.find("th"),n=this._getStartEndYear(10,this._viewDate.year()),i=this._viewDate.clone().year(n[0]),r=this._viewDate.clone().year(n[1]),o="";for(t.eq(0).find("span").attr("title",this._options.tooltips.prevDecade),t.eq(1).attr("title",this._options.tooltips.selectDecade),t.eq(2).find("span").attr("title",this._options.tooltips.nextDecade),e.find(".disabled").removeClass("disabled"),this._options.minDate&&this._options.minDate.isAfter(i,"y")&&t.eq(0).addClass("disabled"),t.eq(1).text(i.year()+"-"+r.year()),this._options.maxDate&&this._options.maxDate.isBefore(r,"y")&&t.eq(2).addClass("disabled"),o+='<span data-action="selectYear" class="year old">'+(i.year()-1)+"</span>";!i.isAfter(r,"y");)o+='<span data-action="selectYear" class="year'+(i.isSame(this._getLastPickedDate(),"y")&&!this.unset?" active":"")+(this._isValid(i,"y")?"":" disabled")+'">'+i.year()+"</span>",i.add(1,"y");o+='<span data-action="selectYear" class="year old">'+i.year()+"</span>",e.find("td").html(o)},l.prototype._updateDecades=function(){var e=this.widget.find(".datepicker-decades"),t=e.find("th"),n=this._getStartEndYear(100,this._viewDate.year()),i=this._viewDate.clone().year(n[0]),r=this._viewDate.clone().year(n[1]),o=!1,a=!1,s=void 0,l="";for(t.eq(0).find("span").attr("title",this._options.tooltips.prevCentury),t.eq(2).find("span").attr("title",this._options.tooltips.nextCentury),e.find(".disabled").removeClass("disabled"),(0===i.year()||this._options.minDate&&this._options.minDate.isAfter(i,"y"))&&t.eq(0).addClass("disabled"),t.eq(1).text(i.year()+"-"+r.year()),this._options.maxDate&&this._options.maxDate.isBefore(r,"y")&&t.eq(2).addClass("disabled"),i.year()-10<0?l+="<span>&nbsp;</span>":l+='<span data-action="selectDecade" class="decade old" data-selection="'+(i.year()+6)+'">'+(i.year()-10)+"</span>";!i.isAfter(r,"y");)s=i.year()+11,o=this._options.minDate&&this._options.minDate.isAfter(i,"y")&&this._options.minDate.year()<=s,a=this._options.maxDate&&this._options.maxDate.isAfter(i,"y")&&this._options.maxDate.year()<=s,l+='<span data-action="selectDecade" class="decade'+(this._getLastPickedDate().isAfter(i)&&this._getLastPickedDate().year()<=s?" active":"")+(this._isValid(i,"y")||o||a?"":" disabled")+'" data-selection="'+(i.year()+6)+'">'+i.year()+"</span>",i.add(10,"y");l+='<span data-action="selectDecade" class="decade old" data-selection="'+(i.year()+6)+'">'+i.year()+"</span>",e.find("td").html(l)},l.prototype._fillDate=function(){var e=this.widget.find(".datepicker-days"),n=e.find("th"),i=[],r=void 0,o=void 0,a=void 0,s=void 0;if(this._hasDate()){for(n.eq(0).find("span").attr("title",this._options.tooltips.prevMonth),n.eq(1).attr("title",this._options.tooltips.selectMonth),n.eq(2).find("span").attr("title",this._options.tooltips.nextMonth),e.find(".disabled").removeClass("disabled"),n.eq(1).text(this._viewDate.format(this._options.dayViewHeaderFormat)),this._isValid(this._viewDate.clone().subtract(1,"M"),"M")||n.eq(0).addClass("disabled"),this._isValid(this._viewDate.clone().add(1,"M"),"M")||n.eq(2).addClass("disabled"),r=this._viewDate.clone().startOf("M").startOf("w").startOf("d"),s=0;s<42;s++){if(0===r.weekday()&&(o=t("<tr>"),this._options.calendarWeeks&&o.append('<td class="cw">'+r.week()+"</td>"),i.push(o)),a="",r.isBefore(this._viewDate,"M")&&(a+=" old"),r.isAfter(this._viewDate,"M")&&(a+=" new"),this._options.allowMultidate){var l=this._datesFormatted.indexOf(r.format("YYYY-MM-DD"));-1!==l&&r.isSame(this._datesFormatted[l],"d")&&!this.unset&&(a+=" active")}else r.isSame(this._getLastPickedDate(),"d")&&!this.unset&&(a+=" active");this._isValid(r,"d")||(a+=" disabled"),r.isSame(this.getMoment(),"d")&&(a+=" today"),0!==r.day()&&6!==r.day()||(a+=" weekend"),o.append('<td data-action="selectDay" data-day="'+r.format("L")+'" class="day'+a+'">'+r.date()+"</td>"),r.add(1,"d")}e.find("tbody").empty().append(i),this._updateMonths(),this._updateYears(),this._updateDecades()}},l.prototype._fillHours=function(){var e=this.widget.find(".timepicker-hours table"),n=this._viewDate.clone().startOf("d"),i=[],r=t("<tr>");for(this._viewDate.hour()>11&&!this.use24Hours&&n.hour(12);n.isSame(this._viewDate,"d")&&(this.use24Hours||this._viewDate.hour()<12&&n.hour()<12||this._viewDate.hour()>11);)n.hour()%4==0&&(r=t("<tr>"),i.push(r)),r.append('<td data-action="selectHour" class="hour'+(this._isValid(n,"h")?"":" disabled")+'">'+n.format(this.use24Hours?"HH":"hh")+"</td>"),n.add(1,"h");e.empty().append(i)},l.prototype._fillMinutes=function(){for(var e=this.widget.find(".timepicker-minutes table"),n=this._viewDate.clone().startOf("h"),i=[],r=1===this._options.stepping?5:this._options.stepping,o=t("<tr>");this._viewDate.isSame(n,"h");)n.minute()%(4*r)==0&&(o=t("<tr>"),i.push(o)),o.append('<td data-action="selectMinute" class="minute'+(this._isValid(n,"m")?"":" disabled")+'">'+n.format("mm")+"</td>"),n.add(r,"m");e.empty().append(i)},l.prototype._fillSeconds=function(){for(var e=this.widget.find(".timepicker-seconds table"),n=this._viewDate.clone().startOf("m"),i=[],r=t("<tr>");this._viewDate.isSame(n,"m");)n.second()%20==0&&(r=t("<tr>"),i.push(r)),r.append('<td data-action="selectSecond" class="second'+(this._isValid(n,"s")?"":" disabled")+'">'+n.format("ss")+"</td>"),n.add(5,"s");e.empty().append(i)},l.prototype._fillTime=function(){var e=void 0,t=void 0,n=this.widget.find(".timepicker span[data-time-component]");this.use24Hours||(e=this.widget.find(".timepicker [data-action=togglePeriod]"),t=this._getLastPickedDate().clone().add(this._getLastPickedDate().hours()>=12?-12:12,"h"),e.text(this._getLastPickedDate().format("A")),this._isValid(t,"h")?e.removeClass("disabled"):e.addClass("disabled")),n.filter("[data-time-component=hours]").text(this._getLastPickedDate().format(this.use24Hours?"HH":"hh")),n.filter("[data-time-component=minutes]").text(this._getLastPickedDate().format("mm")),n.filter("[data-time-component=seconds]").text(this._getLastPickedDate().format("ss")),this._fillHours(),this._fillMinutes(),this._fillSeconds()},l.prototype._doAction=function(e,n){var r=this._getLastPickedDate();if(t(e.currentTarget).is(".disabled"))return!1;switch(n=n||t(e.currentTarget).data("action")){case"next":var o=i.DatePickerModes[this.currentViewMode].NAV_FUNCTION;this._viewDate.add(i.DatePickerModes[this.currentViewMode].NAV_STEP,o),this._fillDate(),this._viewUpdate(o);break;case"previous":var a=i.DatePickerModes[this.currentViewMode].NAV_FUNCTION;this._viewDate.subtract(i.DatePickerModes[this.currentViewMode].NAV_STEP,a),this._fillDate(),this._viewUpdate(a);break;case"pickerSwitch":this._showMode(1);break;case"selectMonth":var s=t(e.target).closest("tbody").find("span").index(t(e.target));this._viewDate.month(s),this.currentViewMode===i.MinViewModeNumber?(this._setValue(r.clone().year(this._viewDate.year()).month(this._viewDate.month()),this._getLastPickedDateIndex()),this._options.inline||this.hide()):(this._showMode(-1),this._fillDate()),this._viewUpdate("M");break;case"selectYear":var l=parseInt(t(e.target).text(),10)||0;this._viewDate.year(l),this.currentViewMode===i.MinViewModeNumber?(this._setValue(r.clone().year(this._viewDate.year()),this._getLastPickedDateIndex()),this._options.inline||this.hide()):(this._showMode(-1),this._fillDate()),this._viewUpdate("YYYY");break;case"selectDecade":var u=parseInt(t(e.target).data("selection"),10)||0;this._viewDate.year(u),this.currentViewMode===i.MinViewModeNumber?(this._setValue(r.clone().year(this._viewDate.year()),this._getLastPickedDateIndex()),this._options.inline||this.hide()):(this._showMode(-1),this._fillDate()),this._viewUpdate("YYYY");break;case"selectDay":var c=this._viewDate.clone();t(e.target).is(".old")&&c.subtract(1,"M"),t(e.target).is(".new")&&c.add(1,"M"),this._setValue(c.date(parseInt(t(e.target).text(),10)),this._getLastPickedDateIndex()),this._hasTime()||this._options.keepOpen||this._options.inline||this.hide();break;case"incrementHours":var h=r.clone().add(1,"h");this._isValid(h,"h")&&this._setValue(h,this._getLastPickedDateIndex());break;case"incrementMinutes":var d=r.clone().add(this._options.stepping,"m");this._isValid(d,"m")&&this._setValue(d,this._getLastPickedDateIndex());break;case"incrementSeconds":var f=r.clone().add(1,"s");this._isValid(f,"s")&&this._setValue(f,this._getLastPickedDateIndex());break;case"decrementHours":var p=r.clone().subtract(1,"h");this._isValid(p,"h")&&this._setValue(p,this._getLastPickedDateIndex());break;case"decrementMinutes":var m=r.clone().subtract(this._options.stepping,"m");this._isValid(m,"m")&&this._setValue(m,this._getLastPickedDateIndex());break;case"decrementSeconds":var g=r.clone().subtract(1,"s");this._isValid(g,"s")&&this._setValue(g,this._getLastPickedDateIndex());break;case"togglePeriod":this._setValue(r.clone().add(r.hours()>=12?-12:12,"h"),this._getLastPickedDateIndex());break;case"togglePicker":var v=t(e.target),E=v.closest("a"),y=v.closest("ul"),_=y.find(".show"),T=y.find(".collapse:not(.show)"),b=v.is("span")?v:v.find("span"),w=void 0;if(_&&_.length){if((w=_.data("collapse"))&&w.transitioning)return!0;_.collapse?(_.collapse("hide"),T.collapse("show")):(_.removeClass("show"),T.addClass("show")),b.toggleClass(this._options.icons.time+" "+this._options.icons.date),b.hasClass(this._options.icons.date)?E.attr("title",this._options.tooltips.selectDate):E.attr("title",this._options.tooltips.selectTime)}break;case"showPicker":this.widget.find(".timepicker > div:not(.timepicker-picker)").hide(),this.widget.find(".timepicker .timepicker-picker").show();break;case"showHours":this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-hours").show();break;case"showMinutes":this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-minutes").show();break;case"showSeconds":this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-seconds").show();break;case"selectHour":var x=parseInt(t(e.target).text(),10);this.use24Hours||(r.hours()>=12?12!==x&&(x+=12):12===x&&(x=0)),this._setValue(r.clone().hours(x),this._getLastPickedDateIndex()),this._doAction(e,"showPicker");break;case"selectMinute":this._setValue(r.clone().minutes(parseInt(t(e.target).text(),10)),this._getLastPickedDateIndex()),this._doAction(e,"showPicker");break;case"selectSecond":this._setValue(r.clone().seconds(parseInt(t(e.target).text(),10)),this._getLastPickedDateIndex()),this._doAction(e,"showPicker");break;case"clear":this.clear();break;case"today":var R=this.getMoment();this._isValid(R,"d")&&this._setValue(R,this._getLastPickedDateIndex())}return!1},l.prototype.hide=function(){var e=!1;this.widget&&(this.widget.find(".collapse").each(function(){var n=t(this).data("collapse");return!n||!n.transitioning||(e=!0,!1)}),e||(this.component&&this.component.hasClass("btn")&&this.component.toggleClass("active"),this.widget.hide(),t(window).off("resize",this._place()),this.widget.off("click","[data-action]"),this.widget.off("mousedown",!1),this.widget.remove(),this.widget=!1,this._notifyEvent({type:i.Event.HIDE,date:this._getLastPickedDate().clone()}),void 0!==this.input&&this.input.blur(),this._viewDate=this._getLastPickedDate().clone()))},l.prototype.show=function(){var e=void 0,n={year:function(e){return e.month(0).date(1).hours(0).seconds(0).minutes(0)},month:function(e){return e.date(1).hours(0).seconds(0).minutes(0)},day:function(e){return e.hours(0).seconds(0).minutes(0)},hour:function(e){return e.seconds(0).minutes(0)},minute:function(e){return e.seconds(0)}};if(void 0!==this.input){if(this.input.prop("disabled")||!this._options.ignoreReadonly&&this.input.prop("readonly")||this.widget)return;void 0!==this.input.val()&&0!==this.input.val().trim().length?this._setValue(this._parseInputDate(this.input.val().trim()),0):this.unset&&this._options.useCurrent&&(e=this.getMoment(),"string"==typeof this._options.useCurrent&&(e=n[this._options.useCurrent](e)),this._setValue(e,0))}else this.unset&&this._options.useCurrent&&(e=this.getMoment(),"string"==typeof this._options.useCurrent&&(e=n[this._options.useCurrent](e)),this._setValue(e,0));this.widget=this._getTemplate(),this._fillDow(),this._fillMonths(),this.widget.find(".timepicker-hours").hide(),this.widget.find(".timepicker-minutes").hide(),this.widget.find(".timepicker-seconds").hide(),this._update(),this._showMode(),t(window).on("resize",{picker:this},this._place),this.widget.on("click","[data-action]",t.proxy(this._doAction,this)),this.widget.on("mousedown",!1),this.component&&this.component.hasClass("btn")&&this.component.toggleClass("active"),this._place(),this.widget.show(),void 0!==this.input&&this._options.focusOnShow&&!this.input.is(":focus")&&this.input.focus(),this._notifyEvent({type:i.Event.SHOW})},l.prototype.destroy=function(){this.hide(),this._element.removeData(i.DATA_KEY),this._element.removeData("date")},l.prototype.disable=function(){this.hide(),this.component&&this.component.hasClass("btn")&&this.component.addClass("disabled"),void 0!==this.input&&this.input.prop("disabled",!0)},l.prototype.enable=function(){this.component&&this.component.hasClass("btn")&&this.component.removeClass("disabled"),void 0!==this.input&&this.input.prop("disabled",!1)},l.prototype.toolbarPlacement=function(e){if(0===arguments.length)return this._options.toolbarPlacement;if("string"!=typeof e)throw new TypeError("toolbarPlacement() expects a string parameter");if(-1===s.indexOf(e))throw new TypeError("toolbarPlacement() parameter must be one of ("+s.join(", ")+") value");this._options.toolbarPlacement=e,this.widget&&(this.hide(),this.show())},l.prototype.widgetPositioning=function(e){if(0===arguments.length)return t.extend({},this._options.widgetPositioning);if("[object Object]"!=={}.toString.call(e))throw new TypeError("widgetPositioning() expects an object variable");if(e.horizontal){if("string"!=typeof e.horizontal)throw new TypeError("widgetPositioning() horizontal variable must be a string");if(e.horizontal=e.horizontal.toLowerCase(),-1===a.indexOf(e.horizontal))throw new TypeError("widgetPositioning() expects horizontal parameter to be one of ("+a.join(", ")+")");this._options.widgetPositioning.horizontal=e.horizontal}if(e.vertical){if("string"!=typeof e.vertical)throw new TypeError("widgetPositioning() vertical variable must be a string");if(e.vertical=e.vertical.toLowerCase(),-1===o.indexOf(e.vertical))throw new TypeError("widgetPositioning() expects vertical parameter to be one of ("+o.join(", ")+")");this._options.widgetPositioning.vertical=e.vertical}this._update()},l.prototype.widgetParent=function(e){if(0===arguments.length)return this._options.widgetParent;if("string"==typeof e&&(e=t(e)),null!==e&&"string"!=typeof e&&!(e instanceof t))throw new TypeError("widgetParent() expects a string or a jQuery object parameter");this._options.widgetParent=e,this.widget&&(this.hide(),this.show())},l._jQueryHandleThis=function(n,r,o){var a=t(n).data(i.DATA_KEY);if("object"===(void 0===r?"undefined":e(r))&&t.extend({},i.Default,r),a||(a=new l(t(n),r),t(n).data(i.DATA_KEY,a)),"string"==typeof r){if(void 0===a[r])throw new Error('No method named "'+r+'"');return void 0===o?a[r]():a[r](o)}},l._jQueryInterface=function(e,t){return 1===this.length?l._jQueryHandleThis(this[0],e,t):this.each(function(){l._jQueryHandleThis(this,e,t)})},l}(i);t(document).on(i.Event.CLICK_DATA_API,i.Selector.DATA_TOGGLE,function(){var e=l(t(this));0!==e.length&&u._jQueryInterface.call(e,"toggle")}).on(i.Event.CHANGE,"."+i.ClassName.INPUT,function(e){var n=l(t(this));0!==n.length&&u._jQueryInterface.call(n,"_change",e)}).on(i.Event.BLUR,"."+i.ClassName.INPUT,function(e){var n=l(t(this)),r=n.data(i.DATA_KEY);0!==n.length&&(r._options.debug||window.debug||u._jQueryInterface.call(n,"hide",e))}).on(i.Event.KEYDOWN,"."+i.ClassName.INPUT,function(e){var n=l(t(this));0!==n.length&&u._jQueryInterface.call(n,"_keydown",e)}).on(i.Event.KEYUP,"."+i.ClassName.INPUT,function(e){var n=l(t(this));0!==n.length&&u._jQueryInterface.call(n,"_keyup",e)}).on(i.Event.FOCUS,"."+i.ClassName.INPUT,function(e){var n=l(t(this)),r=n.data(i.DATA_KEY);0!==n.length&&r._options.allowInputToggle&&u._jQueryInterface.call(n,r,e)}),t.fn[i.NAME]=u._jQueryInterface,t.fn[i.NAME].Constructor=u,t.fn[i.NAME].noConflict=function(){return t.fn[i.NAME]=r,u._jQueryInterface}}(jQuery)}(),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){"use strict";function t(e){var t=e.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(t)}function n(e){return function(n){var r=n.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(r)for(var o=0,a=r.length;o<a;++o){var l=r[o].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),u=t(l[0]),c=l[1]||"",h=l[3]||"",d=null;l=l[2],s.hasOwnProperty(l)&&(d=s[l],d=Number(e[d])),null!==d&&("!"===c&&(d=i(h,d)),""===c&&d<10&&(d="0"+d.toString()),n=n.replace(u,d.toString()))}return n.replace(/%%/,"%")}}function i(e,t){var n="s",i="";return e&&(1===(e=e.replace(/(:|;|\s)/gi,"").split(/\,/)).length?n=e[0]:(i=e[0],n=e[1])),Math.abs(t)>1?n:i}var r=[],o=[],a={precision:100,elapse:!1,defer:!1};o.push(/^[0-9]*$/.source),o.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),o.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),o=new RegExp(o.join("|"));var s={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},l=function(t,n,i){this.el=t,this.$el=e(t),this.interval=null,this.offset={},this.options=e.extend({},a),this.instanceNumber=r.length,r.push(this),this.$el.data("countdown-instance",this.instanceNumber),i&&("function"==typeof i?(this.$el.on("update.countdown",i),this.$el.on("stoped.countdown",i),this.$el.on("finish.countdown",i)):this.options=e.extend({},a,i)),this.setFinalDate(n),!1===this.options.defer&&this.start()};e.extend(l.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var e=this;this.update(),this.interval=setInterval(function(){e.update.call(e)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),r[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(e){this.finalDate=function(e){if(e instanceof Date)return e;if(String(e).match(o))return String(e).match(/^[0-9]*$/)&&(e=Number(e)),String(e).match(/\-/)&&(e=String(e).replace(/\-/g,"/")),new Date(e);throw new Error("Couldn't cast `"+e+"` to a date object.")}(e)},update:function(){if(0!==this.$el.closest("html").length){var t,n=void 0!==e._data(this.el,"events"),i=new Date;t=this.finalDate.getTime()-i.getTime(),t=Math.ceil(t/1e3),t=!this.options.elapse&&t<0?0:Math.abs(t),this.totalSecsLeft!==t&&n&&(this.totalSecsLeft=t,this.elapsed=i>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-i.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))}else this.remove()},dispatchEvent:function(t){var i=e.Event(t+".countdown");i.finalDate=this.finalDate,i.elapsed=this.elapsed,i.offset=e.extend({},this.offset),i.strftime=n(this.offset),this.$el.trigger(i)}}),e.fn.countdown=function(){var t=Array.prototype.slice.call(arguments,0);return this.each(function(){var n=e(this).data("countdown-instance");if(void 0!==n){var i=r[n],o=t[0];l.prototype.hasOwnProperty(o)?i[o].apply(i,t.slice(1)):null===String(o).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(i.setFinalDate.call(i,o),i.start()):e.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,o))}else new l(this,t[0],t[1])})}}),function(){window.$clamp=function(e,t){t=t||{};var n,i=window,r={clamp:t.clamp||2,useNativeClamp:void 0===t.useNativeClamp||t.useNativeClamp,splitOnChars:t.splitOnChars||[".","-","–","—"," "],animate:t.animate||!1,truncationChar:t.truncationChar||"…",truncationHTML:t.truncationHTML},o=e.style,a=e.innerHTML,s=void 0!==e.style.webkitLineClamp,l=r.clamp,u=l.indexOf&&(l.indexOf("px")>-1||l.indexOf("em")>-1);function c(e,t){return i.getComputedStyle||(i.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return"float"==t&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle&&e.currentStyle[t]?e.currentStyle[t]:null},this}),i.getComputedStyle(e,null).getPropertyValue(t)}function h(t){var n=t||e.clientHeight,i=d(e);return Math.max(Math.floor(n/i),0)}function d(e){var t=c(e,"line-height");return"normal"==t&&(t=1.2*parseInt(c(e,"font-size"))),parseInt(t)}r.truncationHTML&&((n=document.createElement("span")).innerHTML=r.truncationHTML);var f,p,m,g,v=r.splitOnChars.slice(0),E=v[0];function y(t){return t.lastChild.children&&t.lastChild.children.length>0?y(Array.prototype.slice.call(t.children).pop()):t.lastChild&&t.lastChild.nodeValue&&""!=t.lastChild.nodeValue&&t.lastChild.nodeValue!=r.truncationChar?t.lastChild:(t.lastChild.parentNode.removeChild(t.lastChild),y(e))}function _(e,t){e.nodeValue=t+r.truncationChar}if("auto"==l?l=h():u&&(l=h(parseInt(l))),s&&r.useNativeClamp)o.overflow="hidden",o.textOverflow="ellipsis",o.webkitBoxOrient="vertical",o.display="-webkit-box",o.webkitLineClamp=l,u&&(o.height=r.clamp+"px");else{var T=(g=l,d(e)*g);T<=e.clientHeight&&(m=function t(i,o){if(o){var a=i.nodeValue.replace(r.truncationChar,"");if(f||(E=v.length>0?v.shift():"",f=a.split(E)),f.length>1?(p=f.pop(),_(i,f.join(E))):f=null,n&&(i.nodeValue=i.nodeValue.replace(r.truncationChar,""),e.innerHTML=i.nodeValue+" "+n.innerHTML+r.truncationChar),f){if(e.clientHeight<=o){if(!(v.length>=0&&""!=E))return e.innerHTML;_(i,f.join(E)+E+p),f=null}}else""==E&&(_(i,""),i=y(e),v=r.splitOnChars.slice(0),E=v[0],f=null,p=null);if(!r.animate)return t(i,o);setTimeout(function(){t(i,o)},!0===r.animate?10:r.animate)}}(y(e),T))}return{original:a,clamped:m}}}(),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Noty",[],t):"object"==typeof exports?exports.Noty=t():e.Noty=t()}(this,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.css=t.deepExtend=t.animationEndEvents=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.inArray=function(e,t,n){var i=void 0;if(n){for(i in t)if(t.hasOwnProperty(i)&&t[i]===e)return!0}else for(i in t)if(t.hasOwnProperty(i)&&t[i]===e)return!0;return!1},t.stopPropagation=function(e){void 0!==(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.generateID=function(){var e="noty_"+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")+"_";return e+="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},t.outerHeight=function(e){var t=e.offsetHeight,n=window.getComputedStyle(e);return t+=parseInt(n.marginTop)+parseInt(n.marginBottom)},t.addListener=o,t.hasClass=a,t.addClass=function(e,t){var n=l(e),i=n+t;if(a(n,t))return;e.className=i.substring(1)},t.removeClass=function(e,t){var n=l(e),i=void 0;if(!a(e,t))return;i=n.replace(" "+t+" "," "),e.className=i.substring(1,i.length-1)},t.remove=s,t.classList=l,t.visibilityChangeFlow=function(){var e=void 0,t=void 0;void 0!==document.hidden?(e="hidden",t="visibilitychange"):void 0!==document.msHidden?(e="msHidden",t="msvisibilitychange"):void 0!==document.webkitHidden&&(e="webkitHidden",t="webkitvisibilitychange");function n(){r.PageHidden?setTimeout(function(){Object.keys(r.Store).forEach(function(e){r.Store.hasOwnProperty(e)&&r.Store[e].options.visibilityControl&&r.Store[e].stop()})},100):setTimeout(function(){Object.keys(r.Store).forEach(function(e){r.Store.hasOwnProperty(e)&&r.Store[e].options.visibilityControl&&r.Store[e].resume()}),r.queueRenderAll()},100)}t&&o(document,t,function(){r.PageHidden=document[e],n()});o(window,"blur",function(){r.PageHidden=!0,n()}),o(window,"focus",function(){r.PageHidden=!1,n()})},t.createAudioElements=function(e){if(e.hasSound){var t=document.createElement("audio");e.options.sounds.sources.forEach(function(e){var n=document.createElement("source");n.src=e,n.type="audio/"+e.match(/\.([^.]+)$/)[1],t.appendChild(n)}),e.barDom?e.barDom.appendChild(t):document.querySelector("body").appendChild(t),t.volume=e.options.sounds.volume,e.soundPlayed||(t.play(),e.soundPlayed=!0),t.onended=function(){s(t)}}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1));t.animationEndEvents="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";t.deepExtend=function e(t){t=t||{};for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var o in r)r.hasOwnProperty(o)&&(Array.isArray(r[o])?t[o]=r[o]:"object"===i(r[o])&&null!==r[o]?t[o]=e(t[o],r[o]):t[o]=r[o])}return t};t.css=function(){var e=["Webkit","O","Moz","ms"],t={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()}),t[n]||(t[n]=function(t){var n=document.body.style;if(t in n)return t;for(var i=e.length,r=t.charAt(0).toUpperCase()+t.slice(1),o=void 0;i--;)if((o=e[i]+r)in n)return o;return t}(n))}function i(e,t,i){t=n(t),e.style[t]=i}return function(e,t){var n=arguments,r=void 0,o=void 0;if(2===n.length)for(r in t)t.hasOwnProperty(r)&&void 0!==(o=t[r])&&t.hasOwnProperty(r)&&i(e,r,o);else i(e,n[1],n[2])}}();function o(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t=t.split(" ");for(var r=0;r<t.length;r++)document.addEventListener?e.addEventListener(t[r],n,i):document.attachEvent&&e.attachEvent("on"+t[r],n)}function a(e,t){return("string"==typeof e?e:l(e)).indexOf(" "+t+" ")>=0}function s(e){e.parentNode&&e.parentNode.removeChild(e)}function l(e){return(" "+(e&&e.className||"")+" ").replace(/\s+/gi," ")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Defaults=t.Store=t.Queues=t.DefaultMaxVisible=t.docTitle=t.DocModalCount=t.PageHidden=void 0,t.getQueueCounts=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global",t=0,n=s;l.hasOwnProperty(e)&&(n=l[e].maxVisible,Object.keys(u).forEach(function(n){u[n].options.queue!==e||u[n].closed||t++}));return{current:t,maxVisible:n}},t.addToQueue=function(e){l.hasOwnProperty(e.options.queue)||(l[e.options.queue]={maxVisible:s,queue:[]});l[e.options.queue].queue.push(e)},t.removeFromQueue=function(e){if(l.hasOwnProperty(e.options.queue)){var t=[];Object.keys(l[e.options.queue].queue).forEach(function(n){l[e.options.queue].queue[n].id!==e.id&&t.push(l[e.options.queue].queue[n])}),l[e.options.queue].queue=t}},t.queueRender=c,t.queueRenderAll=function(){Object.keys(l).forEach(function(e){c(e)})},t.ghostFix=function(e){var t=i.generateID("ghost"),n=document.createElement("div");n.setAttribute("id",t),i.css(n,{height:i.outerHeight(e.barDom)+"px"}),e.barDom.insertAdjacentHTML("afterend",n.outerHTML),i.remove(e.barDom),n=document.getElementById(t),i.addClass(n,"noty_fix_effects_height"),i.addListener(n,i.animationEndEvents,function(){i.remove(n)})},t.build=function(e){!function(e){if(e.options.container)return void(e.layoutDom=document.querySelector(e.options.container));var t="noty_layout__"+e.options.layout;e.layoutDom=document.querySelector("div#"+t),e.layoutDom||(e.layoutDom=document.createElement("div"),e.layoutDom.setAttribute("id",t),e.layoutDom.setAttribute("role","alert"),e.layoutDom.setAttribute("aria-live","polite"),i.addClass(e.layoutDom,"noty_layout"),document.querySelector("body").appendChild(e.layoutDom))}(e);var t='<div class="noty_body">'+e.options.text+"</div>"+function(e){if(h(e)){var t=document.createElement("div");return i.addClass(t,"noty_buttons"),Object.keys(e.options.buttons).forEach(function(n){t.appendChild(e.options.buttons[n].dom)}),e.options.buttons.forEach(function(e){t.appendChild(e.dom)}),t.outerHTML}return""}(e)+'<div class="noty_progressbar"></div>';e.barDom=document.createElement("div"),e.barDom.setAttribute("id",e.id),i.addClass(e.barDom,"noty_bar noty_type__"+e.options.type+" noty_theme__"+e.options.theme),e.barDom.innerHTML=t,p(e,"onTemplate")},t.hasButtons=h,t.handleModal=function(e){e.options.modal&&(0===r&&(n=document.querySelector("body"),o=document.createElement("div"),i.addClass(o,"noty_modal"),n.insertBefore(o,n.firstChild),i.addClass(o,"noty_modal_open"),i.addListener(o,i.animationEndEvents,function(){i.removeClass(o,"noty_modal_open")})),t.DocModalCount=r+=1);var n,o},t.handleModalClose=function(e){if(e.options.modal&&r>0&&(t.DocModalCount=r-=1,r<=0)){var n=document.querySelector(".noty_modal");n&&(i.removeClass(n,"noty_modal_open"),i.addClass(n,"noty_modal_close"),i.addListener(n,i.animationEndEvents,function(){i.remove(n)}))}},t.queueClose=d,t.dequeueClose=f,t.fire=p,t.openFlow=function(e){p(e,"afterShow"),d(e),i.addListener(e.barDom,"mouseenter",function(){f(e)}),i.addListener(e.barDom,"mouseleave",function(){d(e)})},t.closeFlow=function(e){delete u[e.id],e.closing=!1,p(e,"afterClose"),i.remove(e.barDom),0!==e.layoutDom.querySelectorAll(".noty_bar").length||e.options.container||i.remove(e.layoutDom);(i.inArray("docVisible",e.options.titleCount.conditions)||i.inArray("docHidden",e.options.titleCount.conditions))&&a.decrement();c(e.options.queue)};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(0));t.PageHidden=!1;var r=t.DocModalCount=0,o={originalTitle:null,count:0,changed:!1,timer:-1},a=t.docTitle={increment:function(){o.count++,a._update()},decrement:function(){o.count--,o.count<=0?a._clear():a._update()},_update:function(){var e=document.title;o.changed?document.title="("+o.count+") "+o.originalTitle:(o.originalTitle=e,document.title="("+o.count+") "+e,o.changed=!0)},_clear:function(){o.changed&&(o.count=0,document.title=o.originalTitle,o.changed=!1)}},s=t.DefaultMaxVisible=5,l=t.Queues={global:{maxVisible:s,queue:[]}},u=t.Store={};t.Defaults={type:"alert",layout:"topRight",theme:"mint",text:"",timeout:!1,progressBar:!0,closeWith:["click"],animation:{open:"noty_effects_open",close:"noty_effects_close"},id:!1,force:!1,killer:!1,queue:"global",container:!1,buttons:[],callbacks:{beforeShow:null,onShow:null,afterShow:null,onClose:null,afterClose:null,onClick:null,onHover:null,onTemplate:null},sounds:{sources:[],volume:1,conditions:[]},titleCount:{conditions:[]},modal:!1,visibilityControl:!1};function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global";if(l.hasOwnProperty(e)){var t=l[e].queue.shift();t&&t.show()}}function h(e){return!(!e.options.buttons||!Object.keys(e.options.buttons).length)}function d(e){e.options.timeout&&(e.options.progressBar&&e.progressDom&&i.css(e.progressDom,{transition:"width "+e.options.timeout+"ms linear",width:"0%"}),clearTimeout(e.closeTimer),e.closeTimer=setTimeout(function(){e.close()},e.options.timeout))}function f(e){e.options.timeout&&e.closeTimer&&(clearTimeout(e.closeTimer),e.closeTimer=-1,e.options.progressBar&&e.progressDom&&i.css(e.progressDom,{transition:"width 0ms linear",width:"100%"}))}function p(e,t){e.listeners.hasOwnProperty(t)&&e.listeners[t].forEach(function(t){"function"==typeof t&&t.apply(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotyButton=void 0;var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(0));t.NotyButton=function e(t,n,r){var o=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dom=document.createElement("button"),this.dom.innerHTML=t,this.id=a.id=a.id||i.generateID("button"),this.cb=r,Object.keys(a).forEach(function(e){o.dom.setAttribute(e,a[e])}),i.addClass(this.dom,n||"noty_btn"),this}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();t.Push=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/service-worker.js";return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.subData={},this.workerPath=t,this.listeners={onPermissionGranted:[],onPermissionDenied:[],onSubscriptionSuccess:[],onSubscriptionCancel:[],onWorkerError:[],onWorkerSuccess:[],onWorkerNotSupported:[]},this}return i(e,[{key:"on",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return"function"==typeof t&&this.listeners.hasOwnProperty(e)&&this.listeners[e].push(t),this}},{key:"fire",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.listeners.hasOwnProperty(e)&&this.listeners[e].forEach(function(e){"function"==typeof e&&e.apply(t,n)})}},{key:"create",value:function(){console.log("NOT IMPLEMENTED YET")}},{key:"isSupported",value:function(){var e=!1;try{e=window.Notification||window.webkitNotifications||navigator.mozNotification||window.external&&void 0!==window.external.msIsSiteMode()}catch(e){}return e}},{key:"getPermissionStatus",value:function(){var e="default";if(window.Notification&&window.Notification.permissionLevel)e=window.Notification.permissionLevel;else if(window.webkitNotifications&&window.webkitNotifications.checkPermission)switch(window.webkitNotifications.checkPermission()){case 1:e="default";break;case 0:e="granted";break;default:e="denied"}else window.Notification&&window.Notification.permission?e=window.Notification.permission:navigator.mozNotification?e="granted":window.external&&void 0!==window.external.msIsSiteMode()&&(e=window.external.msIsSiteMode()?"granted":"default");return e.toString().toLowerCase()}},{key:"getEndpoint",value:function(e){var t=e.endpoint,n=e.subscriptionId;return n&&-1===t.indexOf(n)&&(t+="/"+n),t}},{key:"isSWRegistered",value:function(){try{return"activated"===navigator.serviceWorker.controller.state}catch(e){return!1}}},{key:"unregisterWorker",value:function(){var e=this;"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(function(t){var n=!0,i=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){o.value.unregister(),e.fire("onSubscriptionCancel")}}catch(e){i=!0,r=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw r}}})}},{key:"requestSubscription",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this,i=this.getPermissionStatus(),r=function(i){"granted"===i?(e.fire("onPermissionGranted"),"serviceWorker"in navigator?navigator.serviceWorker.register(e.workerPath).then(function(){navigator.serviceWorker.ready.then(function(e){n.fire("onWorkerSuccess"),e.pushManager.subscribe({userVisibleOnly:t}).then(function(e){var t=e.getKey("p256dh"),i=e.getKey("auth");n.subData={endpoint:n.getEndpoint(e),p256dh:t?window.btoa(String.fromCharCode.apply(null,new Uint8Array(t))):null,auth:i?window.btoa(String.fromCharCode.apply(null,new Uint8Array(i))):null},n.fire("onSubscriptionSuccess",[n.subData])}).catch(function(e){n.fire("onWorkerError",[e])})})}):n.fire("onWorkerNotSupported")):"denied"===i&&(e.fire("onPermissionDenied"),e.unregisterWorker())};"default"===i?window.Notification&&window.Notification.requestPermission?window.Notification.requestPermission(r):window.webkitNotifications&&window.webkitNotifications.checkPermission&&window.webkitNotifications.requestPermission(r):r(i)}}]),e}()},function(e,t,n){(function(t,i){var r;r=function(){"use strict";function e(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,a=void 0,s=void 0,l=function(e,t){m[o]=e,m[o+1]=t,2===(o+=2)&&(s?s(g):T())},u="undefined"!=typeof window?window:void 0,c=u||{},h=c.MutationObserver||c.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var e=setTimeout;return function(){return e(g,1)}}var m=new Array(1e3);function g(){for(var e=0;e<o;e+=2){(0,m[e])(m[e+1]),m[e]=void 0,m[e+1]=void 0}o=0}var v,E,y,_,T=void 0;function b(e,t){var n=arguments,i=this,r=new this.constructor(R);void 0===r[x]&&U(r);var o,a=i._state;return a?(o=n[a-1],l(function(){return z(a,r,o,i._result)})):F(i,r,e,t),r}function w(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(R);return P(t,e),t}d?T=function(){return t.nextTick(g)}:h?(E=0,y=new h(g),_=document.createTextNode(""),y.observe(_,{characterData:!0}),T=function(){_.data=E=++E%2}):f?((v=new MessageChannel).port1.onmessage=g,T=function(){return v.port2.postMessage(0)}):T=void 0===u?function(){try{var e=n(9);return void 0!==(a=e.runOnLoop||e.runOnContext)?function(){a(g)}:p()}catch(e){return p()}}():p();var x=Math.random().toString(36).substring(16);function R(){}var H=void 0,S=1,M=2,C=new I;function A(e){try{return e.then}catch(e){return C.error=e,C}}function k(t,n,i){n.constructor===t.constructor&&i===b&&n.constructor.resolve===w?function(e,t){t._state===S?L(e,t._result):t._state===M?O(e,t._result):F(t,void 0,function(t){return P(e,t)},function(t){return O(e,t)})}(t,n):i===C?(O(t,C.error),C.error=null):void 0===i?L(t,n):e(i)?function(e,t,n){l(function(e){var i=!1,r=function(e,t,n,i){try{e.call(t,n,i)}catch(e){return e}}(n,t,function(n){i||(i=!0,t!==n?P(e,n):L(e,n))},function(t){i||(i=!0,O(e,t))},e._label);!i&&r&&(i=!0,O(e,r))},e)}(t,n,i):L(t,n)}function P(e,t){var n,i;e===t?O(e,new TypeError("You cannot resolve a promise with itself")):(i=typeof(n=t),null===n||"object"!==i&&"function"!==i?L(e,t):k(e,t,A(t)))}function D(e){e._onerror&&e._onerror(e._result),N(e)}function L(e,t){e._state===H&&(e._result=t,e._state=S,0!==e._subscribers.length&&l(N,e))}function O(e,t){e._state===H&&(e._state=M,e._result=t,l(D,e))}function F(e,t,n,i){var r=e._subscribers,o=r.length;e._onerror=null,r[o]=t,r[o+S]=n,r[o+M]=i,0===o&&e._state&&l(N,e)}function N(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var i=void 0,r=void 0,o=e._result,a=0;a<t.length;a+=3)i=t[a],r=t[a+n],i?z(n,i,r,o):r(o);e._subscribers.length=0}}function I(){this.error=null}var B=new I;function z(t,n,i,r){var o=e(i),a=void 0,s=void 0,l=void 0,u=void 0;if(o){if((a=function(e,t){try{return e(t)}catch(e){return B.error=e,B}}(i,r))===B?(u=!0,s=a.error,a.error=null):l=!0,n===a)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else a=r,l=!0;n._state!==H||(o&&l?P(n,a):u?O(n,s):t===S?L(n,a):t===M&&O(n,a))}var V=0;function U(e){e[x]=V++,e._state=void 0,e._result=void 0,e._subscribers=[]}function j(e,t){this._instanceConstructor=e,this.promise=new e(R),this.promise[x]||U(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?L(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&L(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}function W(e){this[x]=V++,this._result=this._state=void 0,this._subscribers=[],R!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof W?function(e,t){try{t(function(t){P(e,t)},function(t){O(e,t)})}catch(t){O(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return j.prototype._enumerate=function(e){for(var t=0;this._state===H&&t<e.length;t++)this._eachEntry(e[t],t)},j.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,i=n.resolve;if(i===w){var r=A(e);if(r===b&&e._state!==H)this._settledAt(e._state,t,e._result);else if("function"!=typeof r)this._remaining--,this._result[t]=e;else if(n===W){var o=new n(R);k(o,e,r),this._willSettleAt(o,t)}else this._willSettleAt(new n(function(t){return t(e)}),t)}else this._willSettleAt(i(e),t)},j.prototype._settledAt=function(e,t,n){var i=this.promise;i._state===H&&(this._remaining--,e===M?O(i,n):this._result[t]=n),0===this._remaining&&L(i,this._result)},j.prototype._willSettleAt=function(e,t){var n=this;F(e,void 0,function(e){return n._settledAt(S,t,e)},function(e){return n._settledAt(M,t,e)})},W.all=function(e){return new j(this,e).promise},W.race=function(e){var t=this;return r(e)?new t(function(n,i){for(var r=e.length,o=0;o<r;o++)t.resolve(e[o]).then(n,i)}):new t(function(e,t){return t(new TypeError("You must pass an array to race."))})},W.resolve=w,W.reject=function(e){var t=new this(R);return O(t,e),t},W._setScheduler=function(e){s=e},W._setAsap=function(e){l=e},W._asap=l,W.prototype={constructor:W,then:b,catch:function(e){return this.then(null,e)}},W.polyfill=function(){var e=void 0;if(void 0!==i)e=i;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=W},W.Promise=W,W},e.exports=r()}).call(t,n(7),n(8))},function(e,t){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();n(5);var r,o=n(4),a=(r=o)&&r.__esModule?r:{default:r},s=h(n(0)),l=h(n(1)),u=n(2),c=n(3);function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var d=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=s.deepExtend({},l.Defaults,t),l.Store[this.options.id]?l.Store[this.options.id]:(this.id=this.options.id||s.generateID("bar"),this.closeTimer=-1,this.barDom=null,this.layoutDom=null,this.progressDom=null,this.showing=!1,this.shown=!1,this.closed=!1,this.closing=!1,this.killable=this.options.timeout||this.options.closeWith.length>0,this.hasSound=this.options.sounds.sources.length>0,this.soundPlayed=!1,this.listeners={beforeShow:[],onShow:[],afterShow:[],onClose:[],afterClose:[],onClick:[],onHover:[],onTemplate:[]},this.promises={show:null,close:null},this.on("beforeShow",this.options.callbacks.beforeShow),this.on("onShow",this.options.callbacks.onShow),this.on("afterShow",this.options.callbacks.afterShow),this.on("onClose",this.options.callbacks.onClose),this.on("afterClose",this.options.callbacks.afterClose),this.on("onClick",this.options.callbacks.onClick),this.on("onHover",this.options.callbacks.onHover),this.on("onTemplate",this.options.callbacks.onTemplate),this)}return i(e,[{key:"on",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return"function"==typeof t&&this.listeners.hasOwnProperty(e)&&this.listeners[e].push(t),this}},{key:"show",value:function(){var t=this;if(this.showing||this.shown)return this;!0===this.options.killer?e.closeAll():"string"==typeof this.options.killer&&e.closeAll(this.options.killer);var n=l.getQueueCounts(this.options.queue);if(n.current>=n.maxVisible||l.PageHidden&&this.options.visibilityControl)return l.addToQueue(this),l.PageHidden&&this.hasSound&&s.inArray("docHidden",this.options.sounds.conditions)&&s.createAudioElements(this),l.PageHidden&&s.inArray("docHidden",this.options.titleCount.conditions)&&l.docTitle.increment(),this;if(l.Store[this.id]=this,l.fire(this,"beforeShow"),this.showing=!0,this.closing)return this.showing=!1,this;if(l.build(this),l.handleModal(this),this.options.force?this.layoutDom.insertBefore(this.barDom,this.layoutDom.firstChild):this.layoutDom.appendChild(this.barDom),this.hasSound&&!this.soundPlayed&&s.inArray("docVisible",this.options.sounds.conditions)&&s.createAudioElements(this),s.inArray("docVisible",this.options.titleCount.conditions)&&l.docTitle.increment(),this.shown=!0,this.closed=!1,l.hasButtons(this)&&Object.keys(this.options.buttons).forEach(function(e){var n=t.barDom.querySelector("#"+t.options.buttons[e].id);s.addListener(n,"click",function(n){s.stopPropagation(n),t.options.buttons[e].cb(t)})}),this.progressDom=this.barDom.querySelector(".noty_progressbar"),s.inArray("click",this.options.closeWith)&&(s.addClass(this.barDom,"noty_close_with_click"),s.addListener(this.barDom,"click",function(e){s.stopPropagation(e),l.fire(t,"onClick"),t.close()},!1)),s.addListener(this.barDom,"mouseenter",function(){l.fire(t,"onHover")},!1),this.options.timeout&&s.addClass(this.barDom,"noty_has_timeout"),this.options.progressBar&&s.addClass(this.barDom,"noty_has_progressbar"),s.inArray("button",this.options.closeWith)){s.addClass(this.barDom,"noty_close_with_button");var i=document.createElement("div");s.addClass(i,"noty_close_button"),i.innerHTML="×",this.barDom.appendChild(i),s.addListener(i,"click",function(e){s.stopPropagation(e),t.close()},!1)}return l.fire(this,"onShow"),null===this.options.animation.open?this.promises.show=new a.default(function(e){e()}):"function"==typeof this.options.animation.open?this.promises.show=new a.default(this.options.animation.open.bind(this)):(s.addClass(this.barDom,this.options.animation.open),this.promises.show=new a.default(function(e){s.addListener(t.barDom,s.animationEndEvents,function(){s.removeClass(t.barDom,t.options.animation.open),e()})})),this.promises.show.then(function(){var e=t;setTimeout(function(){l.openFlow(e)},100)}),this}},{key:"stop",value:function(){return l.dequeueClose(this),this}},{key:"resume",value:function(){return l.queueClose(this),this}},{key:"setTimeout",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){if(this.stop(),this.options.timeout=e,this.barDom){this.options.timeout?s.addClass(this.barDom,"noty_has_timeout"):s.removeClass(this.barDom,"noty_has_timeout");var t=this;setTimeout(function(){t.resume()},100)}return this})},{key:"setText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.barDom&&(this.barDom.querySelector(".noty_body").innerHTML=e),t&&(this.options.text=e),this}},{key:"setType",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.barDom&&(s.classList(this.barDom).split(" ").forEach(function(e){"noty_type__"===e.substring(0,11)&&s.removeClass(t.barDom,e)}),s.addClass(this.barDom,"noty_type__"+e));return n&&(this.options.type=e),this}},{key:"setTheme",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.barDom&&(s.classList(this.barDom).split(" ").forEach(function(e){"noty_theme__"===e.substring(0,12)&&s.removeClass(t.barDom,e)}),s.addClass(this.barDom,"noty_theme__"+e));return n&&(this.options.theme=e),this}},{key:"close",value:function(){var e=this;return this.closed?this:this.shown?(l.fire(this,"onClose"),this.closing=!0,null===this.options.animation.close||!1===this.options.animation.close?this.promises.close=new a.default(function(e){e()}):"function"==typeof this.options.animation.close?this.promises.close=new a.default(this.options.animation.close.bind(this)):(s.addClass(this.barDom,this.options.animation.close),this.promises.close=new a.default(function(t){s.addListener(e.barDom,s.animationEndEvents,function(){e.options.force?s.remove(e.barDom):l.ghostFix(e),t()})})),this.promises.close.then(function(){l.closeFlow(e),l.handleModalClose(e)}),this.closed=!0,this):(l.removeFromQueue(this),this)}}],[{key:"closeAll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object.keys(l.Store).forEach(function(t){e?l.Store[t].options.queue===e&&l.Store[t].killable&&l.Store[t].close():l.Store[t].killable&&l.Store[t].close()}),this}},{key:"clearQueue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"global";return l.Queues.hasOwnProperty(e)&&(l.Queues[e].queue=[]),this}},{key:"overrideDefaults",value:function(e){return l.Defaults=s.deepExtend({},l.Defaults,e),this}},{key:"setMaxVisible",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.DefaultMaxVisible,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"global";return l.Queues.hasOwnProperty(t)||(l.Queues[t]={maxVisible:e,queue:[]}),l.Queues[t].maxVisible=e,this}},{key:"button",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new u.NotyButton(e,t,n,i)}},{key:"version",value:function(){return"3.2.0-beta"}},{key:"Push",value:function(e){return new c.Push(e)}},{key:"Queues",get:function(){return l.Queues}},{key:"PageHidden",get:function(){return l.PageHidden}}]),e}();t.default=d,"undefined"!=typeof window&&s.visibilityChangeFlow(),e.exports=t.default},function(e,t){var n,i,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var l,u=[],c=!1,h=-1;function d(){c&&l&&(c=!1,l.length?u=l.concat(u):h=-1,u.length&&f())}function f(){if(!c){var e=s(d);c=!0;for(var t=u.length;t;){for(l=u,u=[];++h<t;)l&&l[h].run();h=-1,t=u.length}l=null,c=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||c||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){}])}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.cssVars=t()}(this,function(){"use strict";function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={mimeType:t.mimeType||null,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},i=Array.isArray(e)?e:[e],r=Array.apply(null,Array(i.length)).map(function(e){return null});function o(){return!("<"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().charAt(0))}function a(e,t){n.onError(e,i[t],t)}function s(e,t){var o=n.onSuccess(e,i[t],t);e=!1===o?"":o||e,r[t]=e,-1===r.indexOf(null)&&n.onComplete(r)}i.forEach(function(e,t){var i=document.createElement("a");i.setAttribute("href",e),i.href=String(i.href);var r=i.host!==location.host,l=document.all&&!window.atob,u=i.protocol===location.protocol;if(r&&l)if(u){var c=new XDomainRequest;c.open("GET",e),c.timeout=0,c.onprogress=Function.prototype,c.ontimeout=Function.prototype,c.onload=function(){o(c.responseText)?s(c.responseText,t):a(c,t)},c.onerror=function(e){a(c,t)},setTimeout(function(){c.send()},0)}else console.log("Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol"),a(null,t);else{var h=new XMLHttpRequest;h.open("GET",e),n.mimeType&&h.overrideMimeType&&h.overrideMimeType(n.mimeType),n.onBeforeSend(h,e,t),h.onreadystatechange=function(){4===h.readyState&&(200===h.status&&o(h.responseText)?s(h.responseText,t):a(h,t))},h.send()}})}function t(t){var i={cssComments:/\/\*[\s\S]+?\*\//g,cssImports:/(?:@import\s*)(?:url\(\s*)?(?:['"])([^'"]*)(?:['"])(?:\s*\))?(?:[^;]*;)/g},r={rootElement:t.rootElement||document,include:t.include||'style,link[rel="stylesheet"]',exclude:t.exclude||null,filter:t.filter||null,useCSSOM:t.useCSSOM||!1,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},o=Array.apply(null,r.rootElement.querySelectorAll(r.include)).filter(function(e){return t=e,n=r.exclude,!(t.matches||t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector).call(t,n);var t,n}),a=Array.apply(null,Array(o.length)).map(function(e){return null});function s(){if(-1===a.indexOf(null)){var e=a.join("");r.onComplete(e,a,o)}}function l(t,n,i,o){var l=r.onSuccess(t,i,o);!function t(n,i,o,a){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],c=u(n,o,l);c.rules.length?e(c.absoluteUrls,{onBeforeSend:function(e,t,n){r.onBeforeSend(e,i,t)},onSuccess:function(e,t,n){var o=r.onSuccess(e,i,t),a=u(e=!1===o?"":o||e,t,l);return a.rules.forEach(function(t,n){e=e.replace(t,a.absoluteRules[n])}),e},onError:function(e,r,u){s.push({xhr:e,url:r}),l.push(c.rules[u]),t(n,i,o,a,s,l)},onComplete:function(e){e.forEach(function(e,t){n=n.replace(c.rules[t],e)}),t(n,i,o,a,s,l)}}):a(n,s)}(t=void 0!==l&&!1===Boolean(l)?"":l||t,i,o,function(e,t){null===a[n]&&(t.forEach(function(e){return r.onError(e.xhr,i,e.url)}),!r.filter||r.filter.test(e)?a[n]=e:a[n]="",s())})}function u(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o={};return o.rules=(e.replace(i.cssComments,"").match(i.cssImports)||[]).filter(function(e){return-1===r.indexOf(e)}),o.urls=o.rules.map(function(e){return e.replace(i.cssImports,"$1")}),o.absoluteUrls=o.urls.map(function(e){return n(e,t)}),o.absoluteRules=o.rules.map(function(e,i){var r=o.urls[i],a=n(o.absoluteUrls[i],t);return e.replace(r,a)}),o}o.length?o.forEach(function(t,i){var o=t.getAttribute("href"),u=t.getAttribute("rel"),c="LINK"===t.nodeName&&o&&u&&"stylesheet"===u.toLowerCase(),h="STYLE"===t.nodeName;if(c)e(o,{mimeType:"text/css",onBeforeSend:function(e,n,i){r.onBeforeSend(e,t,n)},onSuccess:function(e,r,a){var s=n(o,location.href);l(e,i,t,s)},onError:function(e,n,o){a[i]="",r.onError(e,t,n),s()}});else if(h){var d=t.textContent;r.useCSSOM&&(d=Array.apply(null,t.sheet.cssRules).map(function(e){return e.cssText}).join("")),l(d,i,t,location.href)}else a[i]="",s()}):r.onComplete("",[])}function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,n=document.implementation.createHTMLDocument(""),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),i.href=t,r.href=e,r.href}function i(){for(var e=function(e){return e instanceof Object&&e.constructor===Object},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.reduce(function(t,n){return Object.keys(n).forEach(function(r){var o=t[r],a=n[r];e(o)&&e(a)?t[r]=i(o,a):t[r]=a}),t},{})}var r=o;function o(e,t,n){e instanceof RegExp&&(e=a(e,n)),t instanceof RegExp&&(t=a(t,n));var i=s(e,t,n);return i&&{start:i[0],end:i[1],pre:n.slice(0,i[0]),body:n.slice(i[0]+e.length,i[1]),post:n.slice(i[1]+t.length)}}function a(e,t){var n=t.match(e);return n?n[0]:null}function s(e,t,n){var i,r,o,a,s,l=n.indexOf(e),u=n.indexOf(t,l+1),c=l;if(l>=0&&u>0){for(i=[],o=n.length;c>=0&&!s;)c==l?(i.push(c),l=n.indexOf(e,c+1)):1==i.length?s=[i.pop(),u]:((r=i.pop())<o&&(o=r,a=u),u=n.indexOf(t,c+1)),c=l<u&&l>=0?l:u;i.length&&(s=[o,a])}return s}o.range=s;var l="--",u="var",c={dom:{},temp:{},user:{}};function h(e){var t,n,o=i({fixNestedCalc:!0,onlyVars:!0,persist:!1,preserve:!1,variables:{},onWarning:function(){}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),a=o.persist?c.dom:c.temp=JSON.parse(JSON.stringify(c.dom)),s=function(e){function t(e){throw new Error("CSS parse error: ".concat(e))}function n(t){var n=t.exec(e);if(n)return e=e.slice(n[0].length),n}function i(){n(/^\s*/)}function r(){return n(/^{\s*/)}function o(){return n(/^}/)}function a(){if(i(),"/"===e[0]&&"*"===e[1]){for(var n=2;e[n]&&("*"!==e[n]||"/"!==e[n+1]);)n++;if(!e[n])return t("end of comment is missing");var r=e.slice(2,n);return e=e.slice(n+2),{type:"comment",comment:r}}}function s(){for(var e,t=[];e=a();)t.push(e);return t}function l(){for(i();"}"===e[0];)t("extra closing bracket");var r=n(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(r)return r[0].trim().replace(/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function u(){n(/^([;\s]*)+/);var e=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g,i=n(/^(\*?[-#\/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(i){if(i=i[0].trim(),!n(/^:\s*/))return t("property missing ':'");var r=n(/^((?:\/\*.*?\*\/|'(?:\\'|.)*?'|"(?:\\"|.)*?"|\((\s*'(?:\\'|.)*?'|"(?:\\"|.)*?"|[^)]*?)\s*\)|[^};])+)/),o={type:"declaration",property:i.replace(e,""),value:r?r[0].replace(e,"").trim():""};return n(/^[;\s]*/),o}}function c(){if(!r())return t("missing '{'");for(var e,n=s();e=u();)n.push(e),n=n.concat(s());return o()?n:t("missing '}'")}function h(){i();for(var e,t=[];e=n(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),n(/^,\s*/);if(t.length)return{type:"keyframe",values:t,declarations:c()}}function d(){if(i(),"@"===e[0])return function(){var e=n(/^@([-\w]+)?keyframes\s*/);if(e){var i=e[1];if(!(e=n(/^([-\w]+)\s*/)))return t("@keyframes missing name");var a=e[1];if(!r())return t("@keyframes missing '{'");for(var l,u=s();l=h();)u.push(l),u=u.concat(s());return o()?{type:"keyframes",name:a,vendor:i,keyframes:u}:t("@keyframes missing '}'")}}()||function(){var e=n(/^@supports *([^{]+)/);if(e)return{type:"supports",supports:e[1].trim(),rules:f()}}()||function(){if(n(/^@host\s*/))return{type:"host",rules:f()}}()||function(){var e=n(/^@media *([^{]+)/);if(e)return{type:"media",media:e[1].trim(),rules:f()}}()||function(){var e=n(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(e)return{type:"custom-media",name:e[1].trim(),media:e[2].trim()}}()||function(){if(n(/^@page */))return{type:"page",selectors:l()||[],declarations:c()}}()||function(){var e=n(/^@([-\w]+)?document *([^{]+)/);if(e)return{type:"document",document:e[2].trim(),vendor:e[1]?e[1].trim():null,rules:f()}}()||function(){if(n(/^@font-face\s*/))return{type:"font-face",declarations:c()}}()||function(){var e=n(/^@(import|charset|namespace)\s*([^;]+);/);if(e)return{type:e[1],name:e[2].trim()}}()}function f(n){if(!n&&!r())return t("missing '{'");for(var i,a,u=s();e.length&&(n||"}"!==e[0])&&(i=d()||((a=l()||[]).length||t("selector missing"),{type:"rule",selectors:a,declarations:c()}));)u.push(i),u=u.concat(s());return n||o()?u:t("missing '}'")}return{type:"stylesheet",stylesheet:{rules:f(!0),errors:[]}}}(e);if(o.onlyVars&&(s.stylesheet.rules=function e(t){return t.filter(function(t){if(t.declarations){var n=t.declarations.filter(function(e){var t=e.property&&0===e.property.indexOf(l),n=e.value&&e.value.indexOf(u+"(")>-1;return t||n});return"font-face"!==t.type&&(t.declarations=n),Boolean(n.length)}return t.keyframes?Boolean(t.keyframes.filter(function(e){return Boolean(e.declarations.filter(function(e){var t=e.property&&0===e.property.indexOf(l),n=e.value&&e.value.indexOf(u+"(")>-1;return t||n}).length)}).length):!t.rules||(t.rules=e(t.rules).filter(function(e){return e.declarations&&e.declarations.length}),Boolean(t.rules.length))})}(s.stylesheet.rules)),s.stylesheet.rules.forEach(function(e){var t=[];if("rule"===e.type&&1===e.selectors.length&&":root"===e.selectors[0]&&(e.declarations.forEach(function(e,n){var i=e.property,r=e.value;i&&0===i.indexOf(l)&&(a[i]=r,t.push(n))}),!o.preserve))for(var n=t.length-1;n>=0;n--)e.declarations.splice(t[n],1)}),Object.keys(c.user).forEach(function(e){a[e]=c.user[e]}),Object.keys(o.variables).length){var h={declarations:[],selectors:[":root"],type:"rule"};Object.keys(o.variables).forEach(function(e){var t="--".concat(e.replace(/^-+/,"")),n=o.variables[e];o.persist&&(c.user[t]=n),a[t]!==n&&(a[t]=n,h.declarations.push({type:"declaration",property:t,value:n}))}),o.preserve&&h.declarations.length&&s.stylesheet.rules.push(h)}return function e(t,n){t.rules.forEach(function(i){i.rules?e(i,n):i.keyframes?i.keyframes.forEach(function(e){"keyframe"===e.type&&n(e.declarations,i)}):i.declarations&&n(i.declarations,t)})}(s.stylesheet,function(e,t){for(var n,i,r,s=0;s<e.length;s++)r=(n=e[s]).value,"declaration"===n.type&&r&&-1!==r.indexOf(u+"(")&&(i=d(r,a,o))!==n.value&&(o.preserve?(e.splice(s,0,{type:n.type,property:n.property,value:i}),s++):n.value=i)}),o.fixNestedCalc&&(t=s.stylesheet.rules,n=/(-[a-z]+-)?calc\(/,t.forEach(function(e){e.declarations&&e.declarations.forEach(function(e){for(var t=e.value,i="";n.test(t);){var o=r("calc(",")",t||"");for(t=t.slice(o.end);n.test(o.body);){var a=r(n,")",o.body);o.body="".concat(a.pre,"(").concat(a.body,")").concat(a.post)}i+="".concat(o.pre,"calc(").concat(o.body),i+=n.test(t)?"":")".concat(o.post)}e.value=i||e.value})})),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i={charset:function(e){return"@charset "+e.name+";"},comment:function(e){return 0===e.comment.indexOf("__CSSVARSPONYFILL")?"/*"+e.comment+"*/":""},"custom-media":function(e){return"@custom-media "+e.name+" "+e.media+";"},declaration:function(e){return e.property+":"+e.value+";"},document:function(e){return"@"+(e.vendor||"")+"document "+e.document+"{"+r(e.rules)+"}"},"font-face":function(e){return"@font-face{"+r(e.declarations)+"}"},host:function(e){return"@host{"+r(e.rules)+"}"},import:function(e){return"@import "+e.name+";"},keyframe:function(e){return e.values.join(",")+"{"+r(e.declarations)+"}"},keyframes:function(e){return"@"+(e.vendor||"")+"keyframes "+e.name+"{"+r(e.keyframes)+"}"},media:function(e){return"@media "+e.media+"{"+r(e.rules)+"}"},namespace:function(e){return"@namespace "+e.name+";"},page:function(e){return"@page "+(e.selectors.length?e.selectors.join(", "):"")+"{"+r(e.declarations)+"}"},rule:function(e){var t=e.declarations;if(t.length)return e.selectors.join(",")+"{"+r(t)+"}"},supports:function(e){return"@supports "+e.supports+"{"+r(e.rules)+"}"}};function r(e){for(var r="",o=0;o<e.length;o++){var a=e[o];n&&n(a);var s=i[a.type](a);s&&(r+=s,s.length&&a.selectors&&(r+=t))}return r}return r(e.stylesheet.rules)}(s)}function d(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(-1===e.indexOf("var("))return e;var o=r("(",")",e),a="CSS transform warning:";return o?"var"===o.pre.slice(-3)?0===o.body.trim().length?(n.onWarning("".concat(a," var() must contain a non-whitespace string")),e):o.pre.slice(0,-3)+function(e){var r=e.split(",")[0],o=(e.match(/(?:\s*,\s*){1}(.*)?/)||[])[1],s=t.hasOwnProperty(r)?String(t[r]):void 0,l=s||(o?String(o):void 0),u=i||e;return s||n.onWarning("".concat(a,' variable "').concat(r,'" is undefined')),l&&"undefined"!==l&&l.length>0?d(l,t,n,u):"var(".concat(u,")")}(o.body)+d(o.post,t,n):o.pre+"(".concat(d(o.body,t,n),")")+d(o.post,t,n):(-1!==e.indexOf("var(")&&n.onWarning("".concat(a,' missing closing ")" in the value "').concat(e,'"')),e)}var f="css-vars-ponyfill",p="undefined"!=typeof window,m=p&&window.CSS&&window.CSS.supports&&window.CSS.supports("(--a: 0)"),g={rootElement:p?document:null,include:"style,link[rel=stylesheet]",exclude:"",fixNestedCalc:!0,onlyLegacy:!0,onlyVars:!1,preserve:!1,shadowDOM:!1,silent:!1,updateDOM:!0,updateURLs:!0,variables:{},watch:null,onBeforeSend:function(){},onSuccess:function(){},onWarning:function(){},onError:function(){},onComplete:function(){}},v={cssComments:/\/\*[\s\S]+?\*\//g,cssKeyframes:/@(?:-\w*-)?keyframes/,cssRootRules:/(?::root\s*{\s*[^}]*})/g,cssUrls:/url\((?!['"]?(?:data|http|\/\/):)['"]?([^'")]*)['"]?\)/g,cssVars:/(?:(?::root\s*{\s*[^;]*;*\s*)|(?:var\(\s*))(--[^:)]+)(?:\s*[:)])/},E=null,y=!1;function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,n=document.implementation.createHTMLDocument(""),i=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(r),i.href=t,r.href=e,r.href}return function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=i(g,n),o=f;function a(e,t,n,i){r.silent||console.error("".concat(e,"\n"),t),r.onError(e,t,n,i)}function s(e){r.silent||console.warn(e),r.onWarning(e)}if(r.exclude="#".concat(o)+(r.exclude?",".concat(r.exclude):""),p)if("loading"!==document.readyState){var l=r.shadowDOM||r.rootElement.shadowRoot||r.rootElement.host;if(m&&r.onlyLegacy){if(r.updateDOM){var u=r.rootElement.host||(r.rootElement===document?document.documentElement:r.rootElement);Object.keys(r.variables).forEach(function(e){var t="--".concat(e.replace(/^-+/,"")),n=r.variables[e];u.style.setProperty(t,n)})}}else l&&!y?t({rootElement:g.rootElement,include:g.include,exclude:r.exclude,onSuccess:function(e,t,n){return(e.match(v.cssRootRules)||[]).join("")||!1},onComplete:function(t,n,i){h(t,{persist:!0}),y=!0,e(r)}}):(r.watch?function(t,n){if(window.MutationObserver){var i=function(e){return"LINK"===e.tagName&&-1!==(e.getAttribute("rel")||"").indexOf("stylesheet")},r=function(e){return"STYLE"===e.tagName&&(!n||e.id!==n)},o=null;E&&E.disconnect(),t.watch=g.watch,(E=new MutationObserver(function(n){var a=!1;n.forEach(function(n){if("attributes"===n.type)a=i(n.target)||r(n.target);else if("childList"===n.type){var s=Array.apply(null,n.addedNodes),l=Array.apply(null,n.removedNodes);a=[].concat(s,l).some(function(e){var t=i(e)&&!e.disabled,n=r(e)&&!e.disabled&&v.cssVars.test(e.textContent);return t||n})}a&&(clearTimeout(o),o=setTimeout(function(){e(t)},1))})})).observe(document.documentElement,{attributes:!0,attributeFilter:["disabled","href"],childList:!0,subtree:!0})}}(r,o):!1===r.watch&&E&&E.disconnect(),t({rootElement:r.rootElement,include:r.include,exclude:r.exclude,filter:r.onlyVars?v.cssVars:null,onBeforeSend:r.onBeforeSend,onSuccess:function(e,t,n){var i=r.onSuccess(e,t,n);return e=void 0!==i&&!1===Boolean(i)?"":i||e,r.updateURLs&&(e.replace(v.cssComments,"").match(v.cssUrls)||[]).forEach(function(t){var i=t.replace(v.cssUrls,"$1"),r=_(i,n);e=e.replace(t,t.replace(i,r))}),e},onError:function(e,t,n){var i=e.responseURL||_(n,location.href),r=e.statusText?"(".concat(e.statusText,")"):"Unspecified Error"+(0===e.status?" (possibly CORS related)":"");a("CSS XHR Error: ".concat(i," ").concat(e.status," ").concat(r),t,e,i)},onComplete:function(t,n,l){var u=null;t=n.map(function(e,t){return v.cssVars.test(e)?e:"/*__CSSVARSPONYFILL-".concat(t,"__*/")}).join("");try{t=h(t,{fixNestedCalc:r.fixNestedCalc,onlyVars:r.onlyVars,persist:r.updateDOM,preserve:r.preserve,variables:r.variables,onWarning:s});var d=v.cssKeyframes.test(t);if(t=t.replace(/\/\*__CSSVARSPONYFILL-(\d+)__\*\//g,function(e,t){return n[t]}),r.updateDOM&&l&&l.length){var f=l[l.length-1];(u=r.rootElement.querySelector("#".concat(o))||document.createElement("style")).setAttribute("id",o),u.textContent!==t&&(u.textContent=t),f.nextSibling!==u&&f.parentNode&&f.parentNode.insertBefore(u,f.nextSibling),d&&function(e){var t=["animation-name","-moz-animation-name","-webkit-animation-name"].filter(function(e){return getComputedStyle(document.body)[e]})[0];if(t){for(var n=e.getElementsByTagName("*"),i=[],r=0,o=n.length;r<o;r++){var a=n[r];"none"!==getComputedStyle(a)[t]&&(a.style[t]+="__CSSVARSPONYFILL-KEYFRAMES__",i.push(a))}document.body.offsetHeight;for(var s=0,l=i.length;s<l;s++){var u=i[s].style;u[t]=u[t].replace("__CSSVARSPONYFILL-KEYFRAMES__","")}}}(r.rootElement)}}catch(e){var p=!1;n.forEach(function(e,t){try{e=h(e,r)}catch(e){var n=l[t-0];p=!0,a(e.message,n)}}),p||a(e.message||e)}if(r.shadowDOM)for(var m,g=[r.rootElement].concat(function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(r.rootElement.querySelectorAll("*"))),E=0;m=g[E];++E)m.shadowRoot&&m.shadowRoot.querySelector("style")&&e(i(r,{rootElement:m.shadowRoot,variables:c.dom}));r.onComplete(t,u,JSON.parse(JSON.stringify(r.updateDOM?c.dom:c.temp)))}}))}else document.addEventListener("DOMContentLoaded",function t(i){e(n),document.removeEventListener("DOMContentLoaded",t)})}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,n){return void 0===n&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(n),n}:e(jQuery)}(function(e){var t=function(t,n){this.settings=n,this.checkSettings(),this.imgAnalyzerTimeout=null,this.entries=null,this.buildingRow={entriesBuff:[],width:0,height:0,aspectRatio:0},this.lastFetchedEntry=null,this.lastAnalyzedIndex=-1,this.yield={every:2,flushed:0},this.border=0<=n.border?n.border:n.margins,this.maxRowHeight=this.retrieveMaxRowHeight(),this.suffixRanges=this.retrieveSuffixRanges(),this.offY=this.border,this.rows=0,this.spinner={phase:0,timeSlot:150,$el:e('<div class="spinner"><span></span><span></span><span></span></div>'),intervalId:null},this.scrollBarOn=!1,this.checkWidthIntervalId=null,this.galleryWidth=t.width(),this.$gallery=t};t.prototype.getSuffix=function(e,t){var n,i;for(n=t<e?e:t,i=0;i<this.suffixRanges.length;i++)if(n<=this.suffixRanges[i])return this.settings.sizeRangeSuffixes[this.suffixRanges[i]];return this.settings.sizeRangeSuffixes[this.suffixRanges[i-1]]},t.prototype.removeSuffix=function(e,t){return e.substring(0,e.length-t.length)},t.prototype.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},t.prototype.getUsedSuffix=function(e){for(var t in this.settings.sizeRangeSuffixes)if(this.settings.sizeRangeSuffixes.hasOwnProperty(t)){if(0===this.settings.sizeRangeSuffixes[t].length)continue;if(this.endsWith(e,this.settings.sizeRangeSuffixes[t]))return this.settings.sizeRangeSuffixes[t]}return""},t.prototype.newSrc=function(e,t,n,i){var r;if(this.settings.thumbnailPath)r=this.settings.thumbnailPath(e,t,n,i);else{var o=e.match(this.settings.extension),a=null!==o?o[0]:"";r=e.replace(this.settings.extension,""),r=this.removeSuffix(r,this.getUsedSuffix(r)),r+=this.getSuffix(t,n)+a}return r},t.prototype.showImg=function(e,t){this.settings.cssAnimation?(e.addClass("entry-visible"),t&&t()):(e.stop().fadeTo(this.settings.imagesAnimationDuration,1,t),e.find(this.settings.imgSelector).stop().fadeTo(this.settings.imagesAnimationDuration,1,t))},t.prototype.extractImgSrcFromImage=function(e){var t=void 0!==e.data("safe-src")?e.data("safe-src"):e.attr("src");return e.data("jg.originalSrc",t),t},t.prototype.imgFromEntry=function(e){var t=e.find(this.settings.imgSelector);return 0===t.length?null:t},t.prototype.captionFromEntry=function(e){var t=e.find("> .caption");return 0===t.length?null:t},t.prototype.displayEntry=function(t,n,i,r,o,a){t.width(r),t.height(a),t.css("top",i),t.css("left",n);var s=this.imgFromEntry(t);if(null!==s){s.css("width",r),s.css("height",o),s.css("margin-left",-r/2),s.css("margin-top",-o/2);var l=s.attr("src"),u=this.newSrc(l,r,o,s[0]);s.one("error",function(){s.attr("src",s.data("jg.originalSrc"))});var c=function(){l!==u&&s.attr("src",u)};"skipped"===t.data("jg.loaded")?this.onImageEvent(l,e.proxy(function(){this.showImg(t,c),t.data("jg.loaded",!0)},this)):this.showImg(t,c)}else this.showImg(t);this.displayEntryCaption(t)},t.prototype.displayEntryCaption=function(e){var t=this.imgFromEntry(e);if(null!==t&&this.settings.captions){var n=this.captionFromEntry(e);if(null===n){var i=t.attr("alt");this.isValidCaption(i)||(i=e.attr("title")),this.isValidCaption(i)}null!==n&&(this.settings.cssAnimation||n.stop().fadeTo(0,this.settings.captionSettings.nonVisibleOpacity),this.addCaptionEventsHandlers(e))}else this.removeCaptionEventsHandlers(e)},t.prototype.isValidCaption=function(e){return void 0!==e&&0<e.length},t.prototype.onEntryMouseEnterForCaption=function(t){var n=this.captionFromEntry(e(t.currentTarget));this.settings.cssAnimation?n.addClass("caption-visible").removeClass("caption-hidden"):n.stop().fadeTo(this.settings.captionSettings.animationDuration,this.settings.captionSettings.visibleOpacity)},t.prototype.onEntryMouseLeaveForCaption=function(t){var n=this.captionFromEntry(e(t.currentTarget));this.settings.cssAnimation?n.removeClass("caption-visible").removeClass("caption-hidden"):n.stop().fadeTo(this.settings.captionSettings.animationDuration,this.settings.captionSettings.nonVisibleOpacity)},t.prototype.addCaptionEventsHandlers=function(t){var n=t.data("jg.captionMouseEvents");void 0===n&&(n={mouseenter:e.proxy(this.onEntryMouseEnterForCaption,this),mouseleave:e.proxy(this.onEntryMouseLeaveForCaption,this)},t.on("mouseenter",void 0,void 0,n.mouseenter),t.on("mouseleave",void 0,void 0,n.mouseleave),t.data("jg.captionMouseEvents",n))},t.prototype.removeCaptionEventsHandlers=function(e){var t=e.data("jg.captionMouseEvents");void 0!==t&&(e.off("mouseenter",void 0,t.mouseenter),e.off("mouseleave",void 0,t.mouseleave),e.removeData("jg.captionMouseEvents"))},t.prototype.clearBuildingRow=function(){this.buildingRow.entriesBuff=[],this.buildingRow.aspectRatio=0,this.buildingRow.width=0},t.prototype.prepareBuildingRow=function(e){var t,n,i,r,o,a=!0,s=0,l=this.galleryWidth-2*this.border-(this.buildingRow.entriesBuff.length-1)*this.settings.margins,u=l/this.buildingRow.aspectRatio,c=this.settings.rowHeight,h=this.buildingRow.width/l>this.settings.justifyThreshold;if(e&&"hide"===this.settings.lastRow&&!h){for(t=0;t<this.buildingRow.entriesBuff.length;t++)n=this.buildingRow.entriesBuff[t],this.settings.cssAnimation?n.removeClass("entry-visible"):(n.stop().fadeTo(0,.1),n.find("> img, > a > img").fadeTo(0,0));return-1}for(e&&!h&&"justify"!==this.settings.lastRow&&"hide"!==this.settings.lastRow&&(a=!1,0<this.rows&&(a=(c=(this.offY-this.border-this.settings.margins*this.rows)/this.rows)*this.buildingRow.aspectRatio/l>this.settings.justifyThreshold)),t=0;t<this.buildingRow.entriesBuff.length;t++)i=(n=this.buildingRow.entriesBuff[t]).data("jg.width")/n.data("jg.height"),a?(r=t===this.buildingRow.entriesBuff.length-1?l:u*i,o=u):(r=c*i,o=c),l-=Math.round(r),n.data("jg.jwidth",Math.round(r)),n.data("jg.jheight",Math.ceil(o)),(0===t||o<s)&&(s=o);return this.buildingRow.height=s,a},t.prototype.flushRow=function(e){var t,n,i,r=this.settings,o=this.border;if(n=this.prepareBuildingRow(e),e&&"hide"===r.lastRow&&-1===n)this.clearBuildingRow();else{if(this.maxRowHeight&&this.maxRowHeight<this.buildingRow.height&&(this.buildingRow.height=this.maxRowHeight),e&&("center"===r.lastRow||"right"===r.lastRow)){var a=this.galleryWidth-2*this.border-(this.buildingRow.entriesBuff.length-1)*r.margins;for(i=0;i<this.buildingRow.entriesBuff.length;i++)a-=(t=this.buildingRow.entriesBuff[i]).data("jg.jwidth");"center"===r.lastRow?o+=a/2:"right"===r.lastRow&&(o+=a)}var s=this.buildingRow.entriesBuff.length-1;for(i=0;i<=s;i++)t=this.buildingRow.entriesBuff[this.settings.rtl?s-i:i],this.displayEntry(t,o,this.offY,t.data("jg.jwidth"),t.data("jg.jheight"),this.buildingRow.height),o+=t.data("jg.jwidth")+r.margins;this.galleryHeightToSet=this.offY+this.buildingRow.height+this.border,this.setGalleryTempHeight(this.galleryHeightToSet+this.getSpinnerHeight()),(!e||this.buildingRow.height<=r.rowHeight&&n)&&(this.offY+=this.buildingRow.height+r.margins,this.rows+=1,this.clearBuildingRow(),this.settings.triggerEvent.call(this,"jg.rowflush"))}};var n=0;function i(){return e("body").height()>e(window).height()}t.prototype.rememberGalleryHeight=function(){n=this.$gallery.height(),this.$gallery.height(n)},t.prototype.setGalleryTempHeight=function(e){n=Math.max(e,n),this.$gallery.height(n)},t.prototype.setGalleryFinalHeight=function(e){n=e,this.$gallery.height(e)},t.prototype.checkWidth=function(){this.checkWidthIntervalId=setInterval(e.proxy(function(){if(this.$gallery.is(":visible")){var e=parseFloat(this.$gallery.width());i()===this.scrollBarOn?Math.abs(e-this.galleryWidth)>this.settings.refreshSensitivity&&(this.galleryWidth=e,this.rewind(),this.rememberGalleryHeight(),this.startImgAnalyzer(!0)):(this.scrollBarOn=i(),this.galleryWidth=e)}},this),this.settings.refreshTime)},t.prototype.isSpinnerActive=function(){return null!==this.spinner.intervalId},t.prototype.getSpinnerHeight=function(){return this.spinner.$el.innerHeight()},t.prototype.stopLoadingSpinnerAnimation=function(){clearInterval(this.spinner.intervalId),this.spinner.intervalId=null,this.setGalleryTempHeight(this.$gallery.height()-this.getSpinnerHeight()),this.spinner.$el.detach()},t.prototype.startLoadingSpinnerAnimation=function(){var e=this.spinner,t=e.$el.find("span");clearInterval(e.intervalId),this.$gallery.append(e.$el),this.setGalleryTempHeight(this.offY+this.buildingRow.height+this.getSpinnerHeight()),e.intervalId=setInterval(function(){e.phase<t.length?t.eq(e.phase).fadeTo(e.timeSlot,1):t.eq(e.phase-t.length).fadeTo(e.timeSlot,0),e.phase=(e.phase+1)%(2*t.length)},e.timeSlot)},t.prototype.rewind=function(){this.lastFetchedEntry=null,this.lastAnalyzedIndex=-1,this.offY=this.border,this.rows=0,this.clearBuildingRow()},t.prototype.updateEntries=function(t){var n;return t&&null!=this.lastFetchedEntry?n=e(this.lastFetchedEntry).nextAll(this.settings.selector).toArray():(this.entries=[],n=this.$gallery.children(this.settings.selector).toArray()),0<n.length&&(e.isFunction(this.settings.sort)?n=this.sortArray(n):this.settings.randomize&&(n=this.shuffleArray(n)),this.lastFetchedEntry=n[n.length-1],this.settings.filter?n=this.filterArray(n):this.resetFilters(n)),this.entries=this.entries.concat(n),!0},t.prototype.insertToGallery=function(t){var n=this;e.each(t,function(){e(this).appendTo(n.$gallery)})},t.prototype.shuffleArray=function(e){var t,n,i;for(t=e.length-1;0<t;t--)n=Math.floor(Math.random()*(t+1)),i=e[t],e[t]=e[n],e[n]=i;return this.insertToGallery(e),e},t.prototype.sortArray=function(e){return e.sort(this.settings.sort),this.insertToGallery(e),e},t.prototype.resetFilters=function(t){for(var n=0;n<t.length;n++)e(t[n]).removeClass("jg-filtered")},t.prototype.filterArray=function(t){var n=this.settings;if("string"===e.type(n.filter))return t.filter(function(t){var i=e(t);return i.is(n.filter)?(i.removeClass("jg-filtered"),!0):(i.addClass("jg-filtered").removeClass("jg-visible"),!1)});if(e.isFunction(n.filter)){for(var i=t.filter(n.filter),r=0;r<t.length;r++)-1===i.indexOf(t[r])?e(t[r]).addClass("jg-filtered").removeClass("jg-visible"):e(t[r]).removeClass("jg-filtered");return i}},t.prototype.destroy=function(){clearInterval(this.checkWidthIntervalId),e.each(this.entries,e.proxy(function(t,n){var i=e(n);i.css("width",""),i.css("height",""),i.css("top",""),i.css("left",""),i.data("jg.loaded",void 0),i.removeClass("jg-entry");var r=this.imgFromEntry(i);r.css("width",""),r.css("height",""),r.css("margin-left",""),r.css("margin-top",""),r.attr("src",r.data("jg.originalSrc")),r.data("jg.originalSrc",void 0),this.removeCaptionEventsHandlers(i);var o=this.captionFromEntry(i);i.data("jg.createdCaption")?(i.data("jg.createdCaption",void 0),null!==o&&o.remove()):null!==o&&o.fadeTo(0,1)},this)),this.$gallery.css("height",""),this.$gallery.removeClass("justified-gallery"),this.$gallery.data("jg.controller",void 0)},t.prototype.analyzeImages=function(t){for(var n=this.lastAnalyzedIndex+1;n<this.entries.length;n++){var i=e(this.entries[n]);if(!0===i.data("jg.loaded")||"skipped"===i.data("jg.loaded")){var r=this.galleryWidth-2*this.border-(this.buildingRow.entriesBuff.length-1)*this.settings.margins,o=i.data("jg.width")/i.data("jg.height");if(r/(this.buildingRow.aspectRatio+o)<this.settings.rowHeight&&(this.flushRow(!1),++this.yield.flushed>=this.yield.every))return void this.startImgAnalyzer(t);this.buildingRow.entriesBuff.push(i),this.buildingRow.aspectRatio+=o,this.buildingRow.width+=o*this.settings.rowHeight,this.lastAnalyzedIndex=n}else if("error"!==i.data("jg.loaded"))return}0<this.buildingRow.entriesBuff.length&&this.flushRow(!0),this.isSpinnerActive()&&this.stopLoadingSpinnerAnimation(),this.stopImgAnalyzerStarter(),this.settings.triggerEvent.call(this,t?"jg.resize":"jg.complete"),this.setGalleryFinalHeight(this.galleryHeightToSet)},t.prototype.stopImgAnalyzerStarter=function(){this.yield.flushed=0,null!==this.imgAnalyzerTimeout&&(clearTimeout(this.imgAnalyzerTimeout),this.imgAnalyzerTimeout=null)},t.prototype.startImgAnalyzer=function(e){var t=this;this.stopImgAnalyzerStarter(),this.imgAnalyzerTimeout=setTimeout(function(){t.analyzeImages(e)},.001)},t.prototype.onImageEvent=function(t,n,i){if(n||i){var r=new Image,o=e(r);n&&o.one("load",function(){o.off("load error"),n(r)}),i&&o.one("error",function(){o.off("load error"),i(r)}),r.src=t}},t.prototype.init=function(){var t=!1,n=!1,i=this;e.each(this.entries,function(r,o){var a=e(o),s=i.imgFromEntry(a);if(a.addClass("jg-entry"),!0!==a.data("jg.loaded")&&"skipped"!==a.data("jg.loaded"))if(null!==i.settings.rel&&a.attr("rel",i.settings.rel),null!==i.settings.target&&a.attr("target",i.settings.target),null!==s){var l=i.extractImgSrcFromImage(s);if(s.attr("src",l),!1===i.settings.waitThumbnailsLoad){var u=parseFloat(s.prop("width")),c=parseFloat(s.prop("height"));if(!isNaN(u)&&!isNaN(c))return a.data("jg.width",u),a.data("jg.height",c),a.data("jg.loaded","skipped"),n=!0,i.startImgAnalyzer(!1),!0}a.data("jg.loaded",!1),t=!0,i.isSpinnerActive()||i.startLoadingSpinnerAnimation(),i.onImageEvent(l,function(e){a.data("jg.width",e.width),a.data("jg.height",e.height),a.data("jg.loaded",!0),i.startImgAnalyzer(!1)},function(){a.data("jg.loaded","error"),i.startImgAnalyzer(!1)})}else a.data("jg.loaded",!0),a.data("jg.width",a.width()|parseFloat(a.css("width"))|1),a.data("jg.height",a.height()|parseFloat(a.css("height"))|1)}),t||n||this.startImgAnalyzer(!1),this.checkWidth()},t.prototype.checkOrConvertNumber=function(t,n){if("string"===e.type(t[n])&&(t[n]=parseFloat(t[n])),"number"!==e.type(t[n]))throw n+" must be a number";if(isNaN(t[n]))throw"invalid number for "+n},t.prototype.checkSizeRangesSuffixes=function(){if("object"!==e.type(this.settings.sizeRangeSuffixes))throw"sizeRangeSuffixes must be defined and must be an object";var t=[];for(var n in this.settings.sizeRangeSuffixes)this.settings.sizeRangeSuffixes.hasOwnProperty(n)&&t.push(n);for(var i={0:""},r=0;r<t.length;r++)if("string"===e.type(t[r]))try{i[parseInt(t[r].replace(/^[a-z]+/,""),10)]=this.settings.sizeRangeSuffixes[t[r]]}catch(t){throw"sizeRangeSuffixes keys must contains correct numbers ("+t+")"}else i[t[r]]=this.settings.sizeRangeSuffixes[t[r]];this.settings.sizeRangeSuffixes=i},t.prototype.retrieveMaxRowHeight=function(){var t=null,n=this.settings.rowHeight;if("string"===e.type(this.settings.maxRowHeight))t=this.settings.maxRowHeight.match(/^[0-9]+%$/)?n*parseFloat(this.settings.maxRowHeight.match(/^([0-9]+)%$/)[1])/100:parseFloat(this.settings.maxRowHeight);else{if("number"!==e.type(this.settings.maxRowHeight)){if(!1===this.settings.maxRowHeight||null==this.settings.maxRowHeight)return null;throw"maxRowHeight must be a number or a percentage"}t=this.settings.maxRowHeight}if(isNaN(t))throw"invalid number for maxRowHeight";return t<n&&(t=n),t},t.prototype.checkSettings=function(){this.checkSizeRangesSuffixes(),this.checkOrConvertNumber(this.settings,"rowHeight"),this.checkOrConvertNumber(this.settings,"margins"),this.checkOrConvertNumber(this.settings,"border");var t=["justify","nojustify","left","center","right","hide"];if(-1===t.indexOf(this.settings.lastRow))throw"lastRow must be one of: "+t.join(", ");if(this.checkOrConvertNumber(this.settings,"justifyThreshold"),this.settings.justifyThreshold<0||1<this.settings.justifyThreshold)throw"justifyThreshold must be in the interval [0,1]";if("boolean"!==e.type(this.settings.cssAnimation))throw"cssAnimation must be a boolean";if("boolean"!==e.type(this.settings.captions))throw"captions must be a boolean";if(this.checkOrConvertNumber(this.settings.captionSettings,"animationDuration"),this.checkOrConvertNumber(this.settings.captionSettings,"visibleOpacity"),this.settings.captionSettings.visibleOpacity<0||1<this.settings.captionSettings.visibleOpacity)throw"captionSettings.visibleOpacity must be in the interval [0, 1]";if(this.checkOrConvertNumber(this.settings.captionSettings,"nonVisibleOpacity"),this.settings.captionSettings.nonVisibleOpacity<0||1<this.settings.captionSettings.nonVisibleOpacity)throw"captionSettings.nonVisibleOpacity must be in the interval [0, 1]";if(this.checkOrConvertNumber(this.settings,"imagesAnimationDuration"),this.checkOrConvertNumber(this.settings,"refreshTime"),this.checkOrConvertNumber(this.settings,"refreshSensitivity"),"boolean"!==e.type(this.settings.randomize))throw"randomize must be a boolean";if("string"!==e.type(this.settings.selector))throw"selector must be a string";if(!1!==this.settings.sort&&!e.isFunction(this.settings.sort))throw"sort must be false or a comparison function";if(!1!==this.settings.filter&&!e.isFunction(this.settings.filter)&&"string"!==e.type(this.settings.filter))throw"filter must be false, a string or a filter function"},t.prototype.retrieveSuffixRanges=function(){var e=[];for(var t in this.settings.sizeRangeSuffixes)this.settings.sizeRangeSuffixes.hasOwnProperty(t)&&e.push(parseInt(t,10));return e.sort(function(e,t){return t<e?1:e<t?-1:0}),e},t.prototype.updateSettings=function(t){this.settings=e.extend({},this.settings,t),this.checkSettings(),this.border=0<=this.settings.border?this.settings.border:this.settings.margins,this.maxRowHeight=this.retrieveMaxRowHeight(),this.suffixRanges=this.retrieveSuffixRanges()},t.prototype.defaults={sizeRangeSuffixes:{},thumbnailPath:void 0,rowHeight:120,maxRowHeight:!1,margins:1,border:-1,lastRow:"nojustify",justifyThreshold:.9,waitThumbnailsLoad:!0,captions:!0,cssAnimation:!0,imagesAnimationDuration:500,captionSettings:{animationDuration:500,visibleOpacity:.7,nonVisibleOpacity:0},rel:null,target:null,extension:/\.[^.\\\/]+$/,refreshTime:200,refreshSensitivity:0,randomize:!1,rtl:!1,sort:!1,filter:!1,selector:"a, div:not(.spinner)",imgSelector:"> img, > a > img",triggerEvent:function(e){this.$gallery.trigger(e)}},e.fn.justifiedGallery=function(n){return this.each(function(i,r){var o=e(r);o.addClass("justified-gallery");var a=o.data("jg.controller");if(void 0===a){if(null!=n&&"object"!==e.type(n)){if("destroy"===n)return;throw"The argument must be an object"}a=new t(o,e.extend({},t.prototype.defaults,n)),o.data("jg.controller",a)}else if("norewind"===n);else{if("destroy"===n)return void a.destroy();a.updateSettings(n),a.rewind()}a.updateEntries("norewind"===n)&&a.init()})}}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.format=t()}(this,function(){"use strict";function e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var t=/[0-9\-+#]/,n=/[^\d\-+#]/g;function i(e){return e.search(t)}function r(t,n,i){var r=!1,o={value:t};t<0&&(r=!0,o.value=-o.value),o.sign=r?"-":"",o.value=Number(o.value).toFixed(n.fraction&&n.fraction.length),o.value=Number(o.value).toString();var a=n.fraction&&n.fraction.lastIndexOf("0"),s=e(o.value.split("."),2),l=s[0],u=void 0===l?"0":l,c=s[1],h=void 0===c?"":c;return(!h||h&&h.length<=a)&&(h=a<0?"":Number("0."+h).toFixed(a+1).replace("0.","")),o.integer=u,o.fraction=h,function(e,t){e.result="";var n=t.integer.split(t.separator),i=n.join(""),r=i&&i.indexOf("0");if(r>-1)for(;e.integer.length<i.length-r;)e.integer="0"+e.integer;else 0===Number(e.integer)&&(e.integer="");var o=n[1]&&n[n.length-1].length;if(o)for(var a=e.integer.length,s=a%o,l=0;l<a;l++)e.result+=e.integer.charAt(l),!((l-s+1)%o)&&l<a-o&&(e.result+=t.separator);else e.result=e.integer;e.result+=t.fraction&&e.fraction?t.decimal+e.fraction:""}(o,n),"0"!==o.result&&""!==o.result||(r=!1,o.sign=""),!r&&n.maskHasPositiveSign?o.sign="+":r&&n.maskHasPositiveSign?o.sign="-":r&&(o.sign=i&&i.enforceMaskSign&&!n.maskHasNegativeSign?"":"-"),o}return function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||isNaN(Number(t)))return t;var a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#.##",t={},r=e.length,o=i(e);t.prefix=o>0?e.substring(0,o):"";var a=i(e.split("").reverse().join("")),s=r-a,l=e.substring(s,s+1),u=s+("."===l||","===l?1:0);t.suffix=a>0?e.substring(u,r):"",t.mask=e.substring(o,u),t.maskHasNegativeSign="-"===t.mask.charAt(0),t.maskHasPositiveSign="+"===t.mask.charAt(0);var c=t.mask.match(n);return t.decimal=c&&c[c.length-1]||".",t.separator=c&&c[1]&&c[0]||",",c=t.mask.split(t.decimal),t.integer=c[0],t.fraction=c[1],t}(e),s=r(t,a,o);return a.prefix+s.sign+s.result+a.suffix}}),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t(require,exports,module):e.ouibounce=t()}(this,function(e,t,n){return function(e,t){"use strict";var n=t||{},i=n.aggressive||!1,r=p(n.sensitivity,20),o=p(n.timer,1e3),a=p(n.delay,0),s=n.callback||function(){},l=m(n.cookieExpire)||"",u=n.cookieDomain?";domain="+n.cookieDomain:"",c=n.cookieName?n.cookieName:"viewedOuibounceModal",h=!0===n.sitewide?";path=/":"",d=null,f=document.documentElement;function p(e,t){return void 0===e?t:e}function m(e){var t=24*e*60*60*1e3,n=new Date;return n.setTime(n.getTime()+t),"; expires="+n.toUTCString()}function g(e){e.clientY>r||(d=setTimeout(b,a))}function v(){d&&(clearTimeout(d),d=null)}setTimeout(function(){if(T())return;f.addEventListener("mouseleave",g),f.addEventListener("mouseenter",v),f.addEventListener("keydown",y)},o);var E=!1;function y(e){E||e.metaKey&&76===e.keyCode&&(E=!0,d=setTimeout(b,a))}function _(e,t){return function(){for(var e=document.cookie.split("; "),t={},n=e.length-1;n>=0;n--){var i=e[n].split("=");t[i[0]]=i[1]}return t}()[e]===t}function T(){return _(c,"true")&&!i}function b(){T()||(e&&(e.style.display="block"),s(),w())}function w(e){var t=e||{};void 0!==t.cookieExpire&&(l=m(t.cookieExpire)),!0===t.sitewide&&(h=";path=/"),void 0!==t.cookieDomain&&(u=";domain="+t.cookieDomain),void 0!==t.cookieName&&(c=t.cookieName),document.cookie=c+"=true"+l+u+h,f.removeEventListener("mouseleave",g),f.removeEventListener("mouseenter",v),f.removeEventListener("keydown",y)}return{fire:b,disable:w,isDisabled:T}}});var THREE={REVISION:"71"};"object"==typeof module&&(module.exports=THREE),void 0===Math.sign&&(Math.sign=function(e){return 0>e?-1:e>0?1:+e}),THREE.log=function(){console.log.apply(console,arguments)},THREE.warn=function(){console.warn.apply(console,arguments)},THREE.error=function(){console.error.apply(console,arguments)},THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},THREE.CullFaceNone=0,THREE.CullFaceBack=1,THREE.CullFaceFront=2,THREE.CullFaceFrontBack=3,THREE.FrontFaceDirectionCW=0,THREE.FrontFaceDirectionCCW=1,THREE.BasicShadowMap=0,THREE.PCFShadowMap=1,THREE.PCFSoftShadowMap=2,THREE.FrontSide=0,THREE.BackSide=1,THREE.DoubleSide=2,THREE.NoShading=0,THREE.FlatShading=1,THREE.SmoothShading=2,THREE.NoColors=0,THREE.FaceColors=1,THREE.VertexColors=2,THREE.NoBlending=0,THREE.NormalBlending=1,THREE.AdditiveBlending=2,THREE.SubtractiveBlending=3,THREE.MultiplyBlending=4,THREE.CustomBlending=5,THREE.AddEquation=100,THREE.SubtractEquation=101,THREE.ReverseSubtractEquation=102,THREE.MinEquation=103,THREE.MaxEquation=104,THREE.ZeroFactor=200,THREE.OneFactor=201,THREE.SrcColorFactor=202,THREE.OneMinusSrcColorFactor=203,THREE.SrcAlphaFactor=204,THREE.OneMinusSrcAlphaFactor=205,THREE.DstAlphaFactor=206,THREE.OneMinusDstAlphaFactor=207,THREE.DstColorFactor=208,THREE.OneMinusDstColorFactor=209,THREE.SrcAlphaSaturateFactor=210,THREE.MultiplyOperation=0,THREE.MixOperation=1,THREE.AddOperation=2,THREE.UVMapping=300,THREE.CubeReflectionMapping=301,THREE.CubeRefractionMapping=302,THREE.EquirectangularReflectionMapping=303,THREE.EquirectangularRefractionMapping=304,THREE.SphericalReflectionMapping=305,THREE.RepeatWrapping=1e3,THREE.ClampToEdgeWrapping=1001,THREE.MirroredRepeatWrapping=1002,THREE.NearestFilter=1003,THREE.NearestMipMapNearestFilter=1004,THREE.NearestMipMapLinearFilter=1005,THREE.LinearFilter=1006,THREE.LinearMipMapNearestFilter=1007,THREE.LinearMipMapLinearFilter=1008,THREE.UnsignedByteType=1009,THREE.ByteType=1010,THREE.ShortType=1011,THREE.UnsignedShortType=1012,THREE.IntType=1013,THREE.UnsignedIntType=1014,THREE.FloatType=1015,THREE.HalfFloatType=1025,THREE.UnsignedShort4444Type=1016,THREE.UnsignedShort5551Type=1017,THREE.UnsignedShort565Type=1018,THREE.AlphaFormat=1019,THREE.RGBFormat=1020,THREE.RGBAFormat=1021,THREE.LuminanceFormat=1022,THREE.LuminanceAlphaFormat=1023,THREE.RGBEFormat=THREE.RGBAFormat,THREE.RGB_S3TC_DXT1_Format=2001,THREE.RGBA_S3TC_DXT1_Format=2002,THREE.RGBA_S3TC_DXT3_Format=2003,THREE.RGBA_S3TC_DXT5_Format=2004,THREE.RGB_PVRTC_4BPPV1_Format=2100,THREE.RGB_PVRTC_2BPPV1_Format=2101,THREE.RGBA_PVRTC_4BPPV1_Format=2102,THREE.RGBA_PVRTC_2BPPV1_Format=2103,THREE.Projector=function(){THREE.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(e,t){THREE.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){THREE.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(e,t){THREE.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},THREE.CanvasRenderer=function(){THREE.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},THREE.Color=function(e){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(e)},THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(e){return e instanceof THREE.Color?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(0===t)this.r=this.g=this.b=n;else{var i=function(e,t,n){return 0>n&&(n+=1),n>1&&(n-=1),1/6>n?e+6*(t-e)*n:.5>n?t:2/3>n?e+6*(t-e)*(2/3-n):e};n=2*n-(t=.5>=n?n*(1+t):n+t-n*t),this.r=i(n,t,e+1/3),this.g=i(n,t,e),this.b=i(n,t,e-1/3)}return this},setStyle:function(e){return/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(e)?(e=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(e),this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,this):/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(e)?(e=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(e),this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,this):/^\#([0-9a-f]{6})$/i.test(e)?(e=/^\#([0-9a-f]{6})$/i.exec(e),this.setHex(parseInt(e[1],16)),this):/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(e)?(e=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e),this.setHex(parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3],16)),this):/^(\w+)$/i.test(e)?(this.setHex(THREE.ColorKeywords[e]),this):void 0},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(){var e=this.r,t=this.g,n=this.b;return this.r=e*e,this.g=t*t,this.b=n*n,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){e=e||{h:0,s:0,l:0};var t,n=this.r,i=this.g,r=this.b,o=Math.max(n,i,r),a=((l=Math.min(n,i,r))+o)/2;if(l===o)l=t=0;else{var s=o-l,l=.5>=a?s/(o+l):s/(2-o-l);switch(o){case n:t=(i-r)/s+(r>i?6:0);break;case i:t=(r-n)/s+2;break;case r:t=(n-i)/s+4}t/=6}return e.h=t,e.s=l,e.l=a,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){var i=this.getHSL();return i.h+=e,i.s+=t,i.l+=n,this.setHSL(i.h,i.s,i.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e){return this.r=e[0],this.g=e[1],this.b=e[2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}},THREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},THREE.Quaternion=function(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==i?i:1},THREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get w(){return this._w},set w(e){this._w=e,this.onChangeCallback()},set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this.onChangeCallback(),this},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(0==e instanceof THREE.Euler)throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var n=Math.cos(e._x/2),i=Math.cos(e._y/2),r=Math.cos(e._z/2),o=Math.sin(e._x/2),a=Math.sin(e._y/2),s=Math.sin(e._z/2);return"XYZ"===e.order?(this._x=o*i*r+n*a*s,this._y=n*a*r-o*i*s,this._z=n*i*s+o*a*r,this._w=n*i*r-o*a*s):"YXZ"===e.order?(this._x=o*i*r+n*a*s,this._y=n*a*r-o*i*s,this._z=n*i*s-o*a*r,this._w=n*i*r+o*a*s):"ZXY"===e.order?(this._x=o*i*r-n*a*s,this._y=n*a*r+o*i*s,this._z=n*i*s+o*a*r,this._w=n*i*r-o*a*s):"ZYX"===e.order?(this._x=o*i*r-n*a*s,this._y=n*a*r+o*i*s,this._z=n*i*s-o*a*r,this._w=n*i*r+o*a*s):"YZX"===e.order?(this._x=o*i*r+n*a*s,this._y=n*a*r+o*i*s,this._z=n*i*s-o*a*r,this._w=n*i*r-o*a*s):"XZY"===e.order&&(this._x=o*i*r-n*a*s,this._y=n*a*r-o*i*s,this._z=n*i*s+o*a*r,this._w=n*i*r+o*a*s),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t=(n=e.elements)[0];e=n[4];var n,i=n[8],r=n[1],o=n[5],a=n[9],s=n[2],l=n[6],u=t+o+(n=n[10]);return u>0?(t=.5/Math.sqrt(u+1),this._w=.25/t,this._x=(l-a)*t,this._y=(i-s)*t,this._z=(r-e)*t):t>o&&t>n?(t=2*Math.sqrt(1+t-o-n),this._w=(l-a)/t,this._x=.25*t,this._y=(e+r)/t,this._z=(i+s)/t):o>n?(t=2*Math.sqrt(1+o-t-n),this._w=(i-s)/t,this._x=(e+r)/t,this._y=.25*t,this._z=(a+l)/t):(t=2*Math.sqrt(1+n-t-o),this._w=(r-e)/t,this._x=(i+s)/t,this._y=(a+l)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t;return function(n,i){return void 0===e&&(e=new THREE.Vector3),1e-6>(t=n.dot(i)+1)?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,i),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._z=this._y=this._x=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(THREE.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var n=e._x,i=e._y,r=e._z,o=e._w,a=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+o*a+i*l-r*s,this._y=i*u+o*s+r*a-n*l,this._z=r*u+o*l+n*s-i*a,this._w=o*u-n*a-i*s-r*l,this.onChangeCallback(),this},multiplyVector3:function(e){return THREE.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,i=this._y,r=this._z,o=this._w,a=o*e._w+n*e._x+i*e._y+r*e._z;if(0>a?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;var s=Math.acos(a),l=Math.sqrt(1-a*a);return.001>Math.abs(l)?(this._w=.5*(o+this._w),this._x=.5*(n+this._x),this._y=.5*(i+this._y),this._z=.5*(r+this._z),this):(a=Math.sin((1-t)*s)/l,s=Math.sin(t*s)/l,this._w=o*a+this._w*s,this._x=n*a+this._x*s,this._y=i*a+this._y*s,this._z=r*a+this._z*s,this.onChangeCallback(),this)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}},THREE.Quaternion.slerp=function(e,t,n,i){return n.copy(e).slerp(t,i)},THREE.Vector2=function(e,t){this.x=e||0,this.y=t||0},THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(THREE.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},sub:function(e,t){return void 0!==t?(THREE.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return 0!==e?(e=1/e,this.x*=e,this.y*=e):this.y=this.x=0,this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this},clampScalar:function(){var e,t;return function(n,i){return void 0===e&&(e=new THREE.Vector2,t=new THREE.Vector2),e.set(n,n),t.set(i,i),this.clamp(e,t)}}(),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(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x;return t*t+(e=this.y-e.y)*e},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e),this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromAttribute:function(e,t,n){return void 0===n&&(n=0),t=t*e.itemSize+n,this.x=e.array[t],this.y=e.array[t+1],this},clone:function(){return new THREE.Vector2(this.x,this.y)}},THREE.Vector3=function(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){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: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(THREE.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},sub:function(e,t){return void 0!==t?(THREE.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(THREE.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(){var e;return function(t){return 0==t instanceof THREE.Euler&&THREE.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===e&&(e=new THREE.Quaternion),this.applyQuaternion(e.setFromEuler(t)),this}}(),applyAxisAngle:function(){var e;return function(t,n){return void 0===e&&(e=new THREE.Quaternion),this.applyQuaternion(e.setFromAxisAngle(t,n)),this}}(),applyMatrix3:function(e){var t=this.x,n=this.y,i=this.z;return e=e.elements,this.x=e[0]*t+e[3]*n+e[6]*i,this.y=e[1]*t+e[4]*n+e[7]*i,this.z=e[2]*t+e[5]*n+e[8]*i,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z;return e=e.elements,this.x=e[0]*t+e[4]*n+e[8]*i+e[12],this.y=e[1]*t+e[5]*n+e[9]*i+e[13],this.z=e[2]*t+e[6]*n+e[10]*i+e[14],this},applyProjection:function(e){var t=this.x,n=this.y,i=this.z,r=1/((e=e.elements)[3]*t+e[7]*n+e[11]*i+e[15]);return this.x=(e[0]*t+e[4]*n+e[8]*i+e[12])*r,this.y=(e[1]*t+e[5]*n+e[9]*i+e[13])*r,this.z=(e[2]*t+e[6]*n+e[10]*i+e[14])*r,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,o=e.y,a=e.z,s=(e=e.w)*t+o*i-a*n,l=e*n+a*t-r*i,u=e*i+r*n-o*t;t=-r*t-o*n-a*i;return this.x=s*e+t*-r+l*-a-u*-o,this.y=l*e+t*-o+u*-r-s*-a,this.z=u*e+t*-a+s*-o-l*-r,this},project:function(){var e;return function(t){return void 0===e&&(e=new THREE.Matrix4),e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyProjection(e)}}(),unproject:function(){var e;return function(t){return void 0===e&&(e=new THREE.Matrix4),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(e){var t=this.x,n=this.y,i=this.z;return e=e.elements,this.x=e[0]*t+e[4]*n+e[8]*i,this.y=e[1]*t+e[5]*n+e[9]*i,this.z=e[2]*t+e[6]*n+e[10]*i,this.normalize(),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return 0!==e?(e=1/e,this.x*=e,this.y*=e,this.z*=e):this.z=this.y=this.x=0,this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this},clampScalar:function(){var e,t;return function(n,i){return void 0===e&&(e=new THREE.Vector3,t=new THREE.Vector3),e.set(n,n,n),t.set(i,i,i),this.clamp(e,t)}}(),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(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e),this},cross:function(e,t){if(void 0!==t)return THREE.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var n=this.x,i=this.y,r=this.z;return this.x=i*e.z-r*e.y,this.y=r*e.x-n*e.z,this.z=n*e.y-i*e.x,this},crossVectors:function(e,t){var n=e.x,i=e.y,r=e.z,o=t.x,a=t.y,s=t.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-i*o,this},projectOnVector:function(){var e,t;return function(n){return void 0===e&&(e=new THREE.Vector3),e.copy(n).normalize(),t=this.dot(e),this.copy(e).multiplyScalar(t)}}(),projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new THREE.Vector3),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new THREE.Vector3),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){return e=this.dot(e)/(this.length()*e.length()),Math.acos(THREE.Math.clamp(e,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n+(e=this.z-e.z)*e},setEulerFromRotationMatrix:function(e,t){THREE.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(e,t){THREE.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return THREE.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return THREE.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return THREE.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},setFromMatrixPosition:function(e){return this.x=e.elements[12],this.y=e.elements[13],this.z=e.elements[14],this},setFromMatrixScale:function(e){var t=this.set(e.elements[0],e.elements[1],e.elements[2]).length(),n=this.set(e.elements[4],e.elements[5],e.elements[6]).length();return e=this.set(e.elements[8],e.elements[9],e.elements[10]).length(),this.x=t,this.y=n,this.z=e,this},setFromMatrixColumn:function(e,t){var n=4*e,i=t.elements;return this.x=i[n],this.y=i[n+1],this.z=i[n+2],this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromAttribute:function(e,t,n){return void 0===n&&(n=0),t=t*e.itemSize+n,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}},THREE.Vector4=function(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==i?i:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){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: "+e)}},getComponent:function(e){switch(e){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: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(THREE.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},sub:function(e,t){return void 0!==t?(THREE.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=this.w;return e=e.elements,this.x=e[0]*t+e[4]*n+e[8]*i+e[12]*r,this.y=e[1]*t+e[5]*n+e[9]*i+e[13]*r,this.z=e[2]*t+e[6]*n+e[10]*i+e[14]*r,this.w=e[3]*t+e[7]*n+e[11]*i+e[15]*r,this},divideScalar:function(e){return 0!==e?(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e):(this.z=this.y=this.x=0,this.w=1),this},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return 1e-4>t?(this.x=1,this.z=this.y=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,i,r=(e=e.elements)[0];i=e[4];var o=e[8],a=e[1],s=e[5],l=e[9];n=e[2],t=e[6];var u=e[10];return.01>Math.abs(i-a)&&.01>Math.abs(o-n)&&.01>Math.abs(l-t)?.1>Math.abs(i+a)&&.1>Math.abs(o+n)&&.1>Math.abs(l+t)&&.1>Math.abs(r+s+u-3)?(this.set(1,0,0,0),this):(e=Math.PI,u=(u+1)/2,i=(i+a)/4,o=(o+n)/4,l=(l+t)/4,(r=(r+1)/2)>(s=(s+1)/2)&&r>u?.01>r?(t=0,i=n=.707106781):(n=i/(t=Math.sqrt(r)),i=o/t):s>u?.01>s?(t=.707106781,n=0,i=.707106781):(t=i/(n=Math.sqrt(s)),i=l/n):.01>u?(n=t=.707106781,i=0):(t=o/(i=Math.sqrt(u)),n=l/i),this.set(t,n,i,e),this):(e=Math.sqrt((t-l)*(t-l)+(o-n)*(o-n)+(a-i)*(a-i)),.001>Math.abs(e)&&(e=1),this.x=(t-l)/e,this.y=(o-n)/e,this.z=(a-i)/e,this.w=Math.acos((r+s+u-1)/2),this)},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this.w>e.w&&(this.w=e.w),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this.w<e.w&&(this.w=e.w),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this.w<e.w?this.w=e.w:this.w>t.w&&(this.w=t.w),this},clampScalar:function(){var e,t;return function(n,i){return void 0===e&&(e=new THREE.Vector4,t=new THREE.Vector4),e.set(n,n,n,n),t.set(i,i,i,i),this.clamp(e,t)}}(),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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e),this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromAttribute:function(e,t,n){return void 0===n&&(n=0),t=t*e.itemSize+n,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this.w=e.array[t+3],this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}},THREE.Euler=function(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._order=i||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get order(){return this._order},set order(e){this._order=e,this.onChangeCallback()},set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||this._order,this.onChangeCallback(),this},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var i=THREE.Math.clamp;e=(h=e.elements)[0];var r=h[4],o=h[8],a=h[1],s=h[5],l=h[9],u=h[2],c=h[6],h=h[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(i(o,-1,1)),.99999>Math.abs(o)?(this._x=Math.atan2(-l,h),this._z=Math.atan2(-r,e)):(this._x=Math.atan2(c,s),this._z=0)):"YXZ"===t?(this._x=Math.asin(-i(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(o,h),this._z=Math.atan2(a,s)):(this._y=Math.atan2(-u,e),this._z=0)):"ZXY"===t?(this._x=Math.asin(i(c,-1,1)),.99999>Math.abs(c)?(this._y=Math.atan2(-u,h),this._z=Math.atan2(-r,s)):(this._y=0,this._z=Math.atan2(a,e))):"ZYX"===t?(this._y=Math.asin(-i(u,-1,1)),.99999>Math.abs(u)?(this._x=Math.atan2(c,h),this._z=Math.atan2(a,e)):(this._x=0,this._z=Math.atan2(-r,s))):"YZX"===t?(this._z=Math.asin(i(a,-1,1)),.99999>Math.abs(a)?(this._x=Math.atan2(-l,s),this._y=Math.atan2(-u,e)):(this._x=0,this._y=Math.atan2(o,h))):"XZY"===t?(this._z=Math.asin(-i(r,-1,1)),.99999>Math.abs(r)?(this._x=Math.atan2(c,s),this._y=Math.atan2(o,e)):(this._x=Math.atan2(-l,h),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var e;return function(t,n,i){return void 0===e&&(e=new THREE.Matrix4),e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,i),this}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new THREE.Quaternion;return function(t){e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}},THREE.Line3=function(e,t){this.start=void 0!==e?e:new THREE.Vector3,this.end=void 0!==t?t:new THREE.Vector3},THREE.Line3.prototype={constructor:THREE.Line3,set:function(e,t){return this.start.copy(e),this.end.copy(t),this},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},center:function(e){return(e||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return(e||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var n=t||new THREE.Vector3;return this.delta(n).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(n,i){e.subVectors(n,this.start),t.subVectors(this.end,this.start);var r=t.dot(t);r=t.dot(e)/r;return i&&(r=THREE.Math.clamp(r,0,1)),r}}(),closestPointToPoint:function(e,t,n){return e=this.closestPointToPointParameter(e,t),n=n||new THREE.Vector3,this.delta(n).multiplyScalar(e).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}},THREE.Box2=function(e,t){this.min=void 0!==e?e:new THREE.Vector2(1/0,1/0),this.max=void 0!==t?t:new THREE.Vector2(-1/0,-1/0)},THREE.Box2.prototype={constructor:THREE.Box2,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;n>t;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new THREE.Vector2;return function(t,n){var i=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}}(),copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(e){return(e||new THREE.Vector2).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){return(e||new THREE.Vector2).subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return(t||new THREE.Vector2).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return(t||new THREE.Vector2).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector2;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}},THREE.Box3=function(e,t){this.min=void 0!==e?e:new THREE.Vector3(1/0,1/0,1/0),this.max=void 0!==t?t:new THREE.Vector3(-1/0,-1/0,-1/0)},THREE.Box3.prototype={constructor:THREE.Box3,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;n>t;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new THREE.Vector3;return function(t,n){var i=e.copy(n).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}}(),setFromObject:function(){var e=new THREE.Vector3;return function(t){var n=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(t){if(void 0!==(r=t.geometry))if(r instanceof THREE.Geometry)for(var i=r.vertices,r=0,o=i.length;o>r;r++)e.copy(i[r]),e.applyMatrix4(t.matrixWorld),n.expandByPoint(e);else if(r instanceof THREE.BufferGeometry&&void 0!==r.attributes.position)for(i=r.attributes.position.array,r=0,o=i.length;o>r;r+=3)e.set(i[r],i[r+1],i[r+2]),e.applyMatrix4(t.matrixWorld),n.expandByPoint(e)}),this}}(),copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(e){return(e||new THREE.Vector3).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){return(e||new THREE.Vector3).subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return(t||new THREE.Vector3).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},clampPoint:function(e,t){return(t||new THREE.Vector3).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector3;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new THREE.Vector3;return function(t){return(t=t||new THREE.Sphere).center=this.center(),t.radius=.5*this.size(e).length(),t}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(t){return e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.makeEmpty(),this.setFromPoints(e),this}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}},THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0<arguments.length&&THREE.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")},THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(e,t,n,i,r,o,a,s,l){var u=this.elements;return u[0]=e,u[3]=t,u[6]=n,u[1]=i,u[4]=r,u[7]=o,u[2]=a,u[5]=s,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},copy:function(e){return e=e.elements,this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this},multiplyVector3:function(e){return THREE.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(e){return THREE.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)},applyToVector3Array:function(){var e=new THREE.Vector3;return function(t,n,i){void 0===n&&(n=0),void 0===i&&(i=t.length);for(var r=0;i>r;r+=3,n+=3)e.x=t[n],e.y=t[n+1],e.z=t[n+2],e.applyMatrix3(this),t[n]=e.x,t[n+1]=e.y,t[n+2]=e.z;return t}}(),multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e,t=(e=this.elements)[0],n=e[1],i=e[2],r=e[3],o=e[4],a=e[5],s=e[6],l=e[7];return t*o*(e=e[8])-t*a*l-n*r*e+n*a*s+i*r*l-i*o*s},getInverse:function(e,t){var n=e.elements,i=this.elements;if(i[0]=n[10]*n[5]-n[6]*n[9],i[1]=-n[10]*n[1]+n[2]*n[9],i[2]=n[6]*n[1]-n[2]*n[5],i[3]=-n[10]*n[4]+n[6]*n[8],i[4]=n[10]*n[0]-n[2]*n[8],i[5]=-n[6]*n[0]+n[2]*n[4],i[6]=n[9]*n[4]-n[5]*n[8],i[7]=-n[9]*n[0]+n[1]*n[8],i[8]=n[5]*n[0]-n[1]*n[4],0===(n=n[0]*i[0]+n[1]*i[3]+n[2]*i[6])){if(t)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");return THREE.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/n),this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},flattenToArrayOffset:function(e,t){var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e},getNormalMatrix:function(e){return this.getInverse(e).transpose(),this},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},fromArray:function(e){return this.elements.set(e),this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}},THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),0<arguments.length&&THREE.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(e,t,n,i,r,o,a,s,l,u,c,h,d,f,p,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=u,g[10]=c,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},copy:function(e){return this.elements.set(e.elements),this},extractPosition:function(e){return THREE.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},copyPosition:function(e){var t=this.elements;return e=e.elements,t[12]=e[12],t[13]=e[13],t[14]=e[14],this},extractBasis:function(e,t,n){var i=this.elements;return e.set(i[0],i[1],i[2]),t.set(i[4],i[5],i[6]),n.set(i[8],i[9],i[10]),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(){var e=new THREE.Vector3;return function(t){var n=this.elements;t=t.elements;var i=1/e.set(t[0],t[1],t[2]).length(),r=1/e.set(t[4],t[5],t[6]).length(),o=1/e.set(t[8],t[9],t[10]).length();return n[0]=t[0]*i,n[1]=t[1]*i,n[2]=t[2]*i,n[4]=t[4]*r,n[5]=t[5]*r,n[6]=t[6]*r,n[8]=t[8]*o,n[9]=t[9]*o,n[10]=t[10]*o,this}}(),makeRotationFromEuler:function(e){0==e instanceof THREE.Euler&&THREE.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,i=e.y,r=e.z,o=Math.cos(n),a=(n=Math.sin(n),Math.cos(i)),s=(i=Math.sin(i),Math.cos(r));r=Math.sin(r);if("XYZ"===e.order){e=o*s;var l=o*r,u=n*s,c=n*r;t[0]=a*s,t[4]=-a*r,t[8]=i,t[1]=l+u*i,t[5]=e-c*i,t[9]=-n*a,t[2]=c-e*i,t[6]=u+l*i,t[10]=o*a}else"YXZ"===e.order?(e=a*s,l=a*r,u=i*s,c=i*r,t[0]=e+c*n,t[4]=u*n-l,t[8]=o*i,t[1]=o*r,t[5]=o*s,t[9]=-n,t[2]=l*n-u,t[6]=c+e*n,t[10]=o*a):"ZXY"===e.order?(e=a*s,l=a*r,u=i*s,c=i*r,t[0]=e-c*n,t[4]=-o*r,t[8]=u+l*n,t[1]=l+u*n,t[5]=o*s,t[9]=c-e*n,t[2]=-o*i,t[6]=n,t[10]=o*a):"ZYX"===e.order?(e=o*s,l=o*r,u=n*s,c=n*r,t[0]=a*s,t[4]=u*i-l,t[8]=e*i+c,t[1]=a*r,t[5]=c*i+e,t[9]=l*i-u,t[2]=-i,t[6]=n*a,t[10]=o*a):"YZX"===e.order?(e=o*a,l=o*i,u=n*a,c=n*i,t[0]=a*s,t[4]=c-e*r,t[8]=u*r+l,t[1]=r,t[5]=o*s,t[9]=-n*s,t[2]=-i*s,t[6]=l*r+u,t[10]=e-c*r):"XZY"===e.order&&(e=o*a,l=o*i,u=n*a,c=n*i,t[0]=a*s,t[4]=-r,t[8]=i*s,t[1]=e*r+c,t[5]=o*s,t[9]=l*r-u,t[2]=u*r-l,t[6]=n*s,t[10]=c*r+e);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},setRotationFromQuaternion:function(e){return THREE.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},makeRotationFromQuaternion:function(e){var t=this.elements,n=e.x,i=e.y,r=e.z,o=e.w,a=r+r;e=n*(u=n+n);var s=n*(c=i+i),l=(n=n*a,i*c),u=(i=i*a,r=r*a,o*u),c=o*c;o*=a;return t[0]=1-(l+r),t[4]=s-o,t[8]=n+c,t[1]=s+o,t[5]=1-(e+r),t[9]=i-u,t[2]=n-c,t[6]=i+u,t[10]=1-(e+l),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3;return function(i,r,o){var a=this.elements;return n.subVectors(i,r).normalize(),0===n.length()&&(n.z=1),e.crossVectors(o,n).normalize(),0===e.length()&&(n.x+=1e-4,e.crossVectors(o,n).normalize()),t.crossVectors(n,e),a[0]=e.x,a[4]=t.x,a[8]=n.x,a[1]=e.y,a[5]=t.y,a[9]=n.y,a[2]=e.z,a[6]=t.z,a[10]=n.z,this}}(),multiply:function(e,t){return void 0!==t?(THREE.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,o=n[0],a=n[4],s=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],E=n[7],y=n[11],_=(n=n[15],i[0]),T=i[4],b=i[8],w=i[12],x=i[1],R=i[5],H=i[9],S=i[13],M=i[2],C=i[6],A=i[10],k=i[14],P=i[3],D=i[7],L=i[11];i=i[15];return r[0]=o*_+a*x+s*M+l*P,r[4]=o*T+a*R+s*C+l*D,r[8]=o*b+a*H+s*A+l*L,r[12]=o*w+a*S+s*k+l*i,r[1]=u*_+c*x+h*M+d*P,r[5]=u*T+c*R+h*C+d*D,r[9]=u*b+c*H+h*A+d*L,r[13]=u*w+c*S+h*k+d*i,r[2]=f*_+p*x+m*M+g*P,r[6]=f*T+p*R+m*C+g*D,r[10]=f*b+p*H+m*A+g*L,r[14]=f*w+p*S+m*k+g*i,r[3]=v*_+E*x+y*M+n*P,r[7]=v*T+E*R+y*C+n*D,r[11]=v*b+E*H+y*A+n*L,r[15]=v*w+E*S+y*k+n*i,this},multiplyToArray:function(e,t,n){var i=this.elements;return this.multiplyMatrices(e,t),n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},multiplyVector3:function(e){return THREE.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),e.applyProjection(this)},multiplyVector4:function(e){return THREE.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(e){return THREE.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)},applyToVector3Array:function(){var e=new THREE.Vector3;return function(t,n,i){void 0===n&&(n=0),void 0===i&&(i=t.length);for(var r=0;i>r;r+=3,n+=3)e.x=t[n],e.y=t[n+1],e.z=t[n+2],e.applyMatrix4(this),t[n]=e.x,t[n+1]=e.y,t[n+2]=e.z;return t}}(),rotateAxis:function(e){THREE.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return THREE.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},determinant:function(){var e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],o=e[1],a=e[5],s=e[9],l=e[13],u=e[2],c=e[6],h=e[10],d=e[14];return e[3]*(+r*s*c-i*l*c-r*a*h+n*l*h+i*a*d-n*s*d)+e[7]*(+t*s*d-t*l*h+r*o*h-i*o*d+i*l*u-r*s*u)+e[11]*(+t*l*c-t*a*d-r*o*c+n*o*d+r*a*u-n*l*u)+e[15]*(-i*a*u-t*s*c+t*a*h+i*o*c-n*o*h+n*s*u)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},flattenToArrayOffset:function(e,t){var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e},getPosition:function(){var e=new THREE.Vector3;return function(){THREE.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var t=this.elements;return e.set(t[12],t[13],t[14])}}(),setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var n=this.elements,i=(E=e.elements)[0],r=E[4],o=E[8],a=E[12],s=E[1],l=E[5],u=E[9],c=E[13],h=E[2],d=E[6],f=E[10],p=E[14],m=E[3],g=E[7],v=E[11],E=E[15];if(n[0]=u*p*g-c*f*g+c*d*v-l*p*v-u*d*E+l*f*E,n[4]=a*f*g-o*p*g-a*d*v+r*p*v+o*d*E-r*f*E,n[8]=o*c*g-a*u*g+a*l*v-r*c*v-o*l*E+r*u*E,n[12]=a*u*d-o*c*d-a*l*f+r*c*f+o*l*p-r*u*p,n[1]=c*f*m-u*p*m-c*h*v+s*p*v+u*h*E-s*f*E,n[5]=o*p*m-a*f*m+a*h*v-i*p*v-o*h*E+i*f*E,n[9]=a*u*m-o*c*m-a*s*v+i*c*v+o*s*E-i*u*E,n[13]=o*c*h-a*u*h+a*s*f-i*c*f-o*s*p+i*u*p,n[2]=l*p*m-c*d*m+c*h*g-s*p*g-l*h*E+s*d*E,n[6]=a*d*m-r*p*m-a*h*g+i*p*g+r*h*E-i*d*E,n[10]=r*c*m-a*l*m+a*s*g-i*c*g-r*s*E+i*l*E,n[14]=a*l*h-r*c*h-a*s*d+i*c*d+r*s*p-i*l*p,n[3]=u*d*m-l*f*m-u*h*g+s*f*g+l*h*v-s*d*v,n[7]=r*f*m-o*d*m+o*h*g-i*f*g-r*h*v+i*d*v,n[11]=o*l*m-r*u*m-o*s*g+i*u*g+r*s*v-i*l*v,n[15]=r*u*h-o*l*h+o*s*d-i*u*d-r*s*f+i*l*f,0==(n=i*n[0]+s*n[4]+h*n[8]+m*n[12])){if(t)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");return THREE.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/n),this},translate:function(e){THREE.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(e){THREE.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(e){THREE.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(e){THREE.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(e,t){THREE.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(e){var t=this.elements,n=e.x,i=e.y;return e=e.z,t[0]*=n,t[4]*=i,t[8]*=e,t[1]*=n,t[5]*=i,t[9]*=e,t[2]*=n,t[6]*=i,t[10]*=e,t[3]*=n,t[7]*=i,t[11]*=e,this},getMaxScaleOnAxis:function(){var e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],Math.max(e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10])))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e);return e=Math.sin(e),this.set(1,0,0,0,0,t,-e,0,0,e,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e);return e=Math.sin(e),this.set(t,0,e,0,0,1,0,0,-e,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e);return e=Math.sin(e),this.set(t,-e,0,0,e,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=1-n,o=e.x,a=e.y,s=e.z,l=r*o,u=r*a;return this.set(l*o+n,l*a-i*s,l*s+i*a,0,l*a+i*s,u*a+n,u*s-i*o,0,l*s-i*a,u*s+i*o,r*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},compose:function(e,t,n){return this.makeRotationFromQuaternion(t),this.scale(n),this.setPosition(e),this},decompose:function(){var e=new THREE.Vector3,t=new THREE.Matrix4;return function(n,i,r){var o=this.elements,a=e.set(o[0],o[1],o[2]).length(),s=e.set(o[4],o[5],o[6]).length(),l=e.set(o[8],o[9],o[10]).length();0>this.determinant()&&(a=-a),n.x=o[12],n.y=o[13],n.z=o[14],t.elements.set(this.elements),n=1/a;o=1/s;var u=1/l;return t.elements[0]*=n,t.elements[1]*=n,t.elements[2]*=n,t.elements[4]*=o,t.elements[5]*=o,t.elements[6]*=o,t.elements[8]*=u,t.elements[9]*=u,t.elements[10]*=u,i.setFromRotationMatrix(t),r.x=a,r.y=s,r.z=l,this}}(),makeFrustum:function(e,t,n,i,r,o){var a=this.elements;return a[0]=2*r/(t-e),a[4]=0,a[8]=(t+e)/(t-e),a[12]=0,a[1]=0,a[5]=2*r/(i-n),a[9]=(i+n)/(i-n),a[13]=0,a[2]=0,a[6]=0,a[10]=-(o+r)/(o-r),a[14]=-2*o*r/(o-r),a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(e,t,n,i){var r=-(e=n*Math.tan(THREE.Math.degToRad(.5*e)));return this.makeFrustum(r*t,e*t,r,e,n,i)},makeOrthographic:function(e,t,n,i,r,o){var a=this.elements,s=t-e,l=n-i,u=o-r;return a[0]=2/s,a[4]=0,a[8]=0,a[12]=-(t+e)/s,a[1]=0,a[5]=2/l,a[9]=0,a[13]=-(n+i)/l,a[2]=0,a[6]=0,a[10]=-2/u,a[14]=-(o+r)/u,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},fromArray:function(e){return this.elements.set(e),this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}},THREE.Ray=function(e,t){this.origin=void 0!==e?e:new THREE.Vector3,this.direction=void 0!==t?t:new THREE.Vector3},THREE.Ray.prototype={constructor:THREE.Ray,set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new THREE.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)},recast:function(){var e=new THREE.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var n=t||new THREE.Vector3;n.subVectors(e,this.origin);var i=n.dot(this.direction);return 0>i?n.copy(this.origin):n.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(){var e=new THREE.Vector3;return function(t){var n=e.subVectors(t,this.origin).dot(this.direction);return 0>n?this.origin.distanceTo(t):(e.copy(this.direction).multiplyScalar(n).add(this.origin),e.distanceTo(t))}}(),distanceSqToSegment:function(){var e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3;return function(i,r,o,a){e.copy(i).add(r).multiplyScalar(.5),t.copy(r).sub(i).normalize(),n.copy(this.origin).sub(e);var s,l=.5*i.distanceTo(r),u=-this.direction.dot(t),c=n.dot(this.direction),h=-n.dot(t),d=n.lengthSq(),f=Math.abs(1-u*u);return f>0?(r=u*c-h,s=l*f,(i=u*h-c)>=0?r>=-s?s>=r?u=(i*=l=1/f)*(i+u*(r*=l)+2*c)+r*(u*i+r+2*h)+d:(r=l,u=-(i=Math.max(0,-(u*r+c)))*i+r*(r+2*h)+d):(r=-l,u=-(i=Math.max(0,-(u*r+c)))*i+r*(r+2*h)+d):-s>=r?u=-(i=Math.max(0,-(-u*l+c)))*i+(r=i>0?-l:Math.min(Math.max(-l,-h),l))*(r+2*h)+d:s>=r?(i=0,u=(r=Math.min(Math.max(-l,-h),l))*(r+2*h)+d):u=-(i=Math.max(0,-(u*l+c)))*i+(r=i>0?l:Math.min(Math.max(-l,-h),l))*(r+2*h)+d):(r=u>0?-l:l,u=-(i=Math.max(0,-(u*r+c)))*i+r*(r+2*h)+d),o&&o.copy(this.direction).multiplyScalar(i).add(this.origin),a&&a.copy(t).multiplyScalar(r).add(e),u}}(),isIntersectionSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},intersectSphere:function(){var e=new THREE.Vector3;return function(t,n){e.subVectors(t.center,this.origin);var i=e.dot(this.direction),r=e.dot(e)-i*i,o=t.radius*t.radius;return r>o?null:(r=i-(o=Math.sqrt(o-r)),i+=o,0>r&&0>i?null:0>r?this.at(i,n):this.at(r,n))}}(),isIntersectionPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||0>e.normal.dot(this.direction)*t},distanceToPlane:function(e){var t=e.normal.dot(this.direction);return 0==t?0==e.distanceToPoint(this.origin)?0:null:(e=-(this.origin.dot(e.normal)+e.constant)/t)>=0?e:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},isIntersectionBox:function(){var e=new THREE.Vector3;return function(t){return null!==this.intersectBox(t,e)}}(),intersectBox:function(e,t){var n,i,r,o,a;i=1/this.direction.x,o=1/this.direction.y,a=1/this.direction.z;var s=this.origin;return i>=0?(n=(e.min.x-s.x)*i,i*=e.max.x-s.x):(n=(e.max.x-s.x)*i,i*=e.min.x-s.x),o>=0?(r=(e.min.y-s.y)*o,o*=e.max.y-s.y):(r=(e.max.y-s.y)*o,o*=e.min.y-s.y),n>o||r>i?null:((r>n||n!=n)&&(n=r),(i>o||i!=i)&&(i=o),a>=0?(r=(e.min.z-s.z)*a,a*=e.max.z-s.z):(r=(e.max.z-s.z)*a,a*=e.min.z-s.z),n>a||r>i?null:((r>n||n!=n)&&(n=r),(i>a||i!=i)&&(i=a),0>i?null:this.at(n>=0?n:i,t)))},intersectTriangle:function(){var e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3,i=new THREE.Vector3;return function(r,o,a,s,l){if(t.subVectors(o,r),n.subVectors(a,r),i.crossVectors(t,n),(o=this.direction.dot(i))>0){if(s)return null;s=1}else{if(!(0>o))return null;s=-1,o=-o}return e.subVectors(this.origin,r),0>(r=s*this.direction.dot(n.crossVectors(e,n)))?null:0>(a=s*this.direction.dot(t.cross(e)))||r+a>o?null:0>(r=-s*e.dot(i))?null:this.at(r/o,l)}}(),applyMatrix4:function(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}},THREE.Sphere=function(e,t){this.center=void 0!==e?e:new THREE.Vector3,this.radius=void 0!==t?t:0},THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new THREE.Box3;return function(t,n){var i=this.center;void 0!==n?i.copy(n):e.setFromPoints(t).center(i);for(var r=0,o=0,a=t.length;a>o;o++)r=Math.max(r,i.distanceToSquared(t[o]));return this.radius=Math.sqrt(r),this}}(),copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return 0>=this.radius},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},clampPoint:function(e,t){var n=this.center.distanceToSquared(e),i=t||new THREE.Vector3;return i.copy(e),n>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(e){return(e=e||new THREE.Box3).set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}},THREE.Frustum=function(e,t,n,i,r,o){this.planes=[void 0!==e?e:new THREE.Plane,void 0!==t?t:new THREE.Plane,void 0!==n?n:new THREE.Plane,void 0!==i?i:new THREE.Plane,void 0!==r?r:new THREE.Plane,void 0!==o?o:new THREE.Plane]},THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(e,t,n,i,r,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(o),this},copy:function(e){for(var t=this.planes,n=0;6>n;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes;e=(g=e.elements)[0];var n=g[1],i=g[2],r=g[3],o=g[4],a=g[5],s=g[6],l=g[7],u=g[8],c=g[9],h=g[10],d=g[11],f=g[12],p=g[13],m=g[14],g=g[15];return t[0].setComponents(r-e,l-o,d-u,g-f).normalize(),t[1].setComponents(r+e,l+o,d+u,g+f).normalize(),t[2].setComponents(r+n,l+a,d+c,g+p).normalize(),t[3].setComponents(r-n,l-a,d-c,g-p).normalize(),t[4].setComponents(r-i,l-s,d-h,g-m).normalize(),t[5].setComponents(r+i,l+s,d+h,g+m).normalize(),this},intersectsObject:function(){var e=new THREE.Sphere;return function(t){var n=t.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),e.copy(n.boundingSphere),e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){var t=this.planes,n=e.center;e=-e.radius;for(var i=0;6>i;i++)if(t[i].distanceToPoint(n)<e)return!1;return!0},intersectsBox:function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(n){for(var i=this.planes,r=0;6>r;r++){var o=i[r];e.x=0<o.normal.x?n.min.x:n.max.x,t.x=0<o.normal.x?n.max.x:n.min.x,e.y=0<o.normal.y?n.min.y:n.max.y,t.y=0<o.normal.y?n.max.y:n.min.y,e.z=0<o.normal.z?n.min.z:n.max.z,t.z=0<o.normal.z?n.max.z:n.min.z;var a=o.distanceToPoint(e);o=o.distanceToPoint(t);if(0>a&&0>o)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,n=0;6>n;n++)if(0>t[n].distanceToPoint(e))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}},THREE.Plane=function(e,t){this.normal=void 0!==e?e:new THREE.Vector3(1,0,0),this.constant=void 0!==t?t:0},THREE.Plane.prototype={constructor:THREE.Plane,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(n,i,r){return i=e.subVectors(r,i).cross(t.subVectors(n,i)).normalize(),this.setFromNormalAndCoplanarPoint(i,n),this}}(),copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(e,t){var n=this.distanceToPoint(e);return(t||new THREE.Vector3).copy(this.normal).multiplyScalar(n)},isIntersectionLine:function(e){var t=this.distanceToPoint(e.start);return e=this.distanceToPoint(e.end),0>t&&e>0||0>e&&t>0},intersectLine:function(){var e=new THREE.Vector3;return function(t,n){var i=n||new THREE.Vector3,r=t.delta(e),o=this.normal.dot(r);return 0!=o?0>(o=-(t.start.dot(this.normal)+this.constant)/o)||o>1?void 0:i.copy(r).multiplyScalar(o).add(t.start):0==this.distanceToPoint(t.start)?i.copy(t.start):void 0}}(),coplanarPoint:function(e){return(e||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Matrix3;return function(i,r){var o=r||n.getNormalMatrix(i),a=(o=e.copy(this.normal).applyMatrix3(o),this.coplanarPoint(t));return a.applyMatrix4(i),this.setFromNormalAndCoplanarPoint(o,a),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}},THREE.Math={generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=Array(36),i=0;return function(){for(var r=0;36>r;r++)8==r||13==r||18==r||23==r?n[r]="-":14==r?n[r]="4":(2>=i&&(i=33554432+16777216*Math.random()|0),e=15&i,i>>=4,n[r]=t[19==r?3&e|8:e]);return n.join("")}}(),clamp:function(e,t,n){return t>e?t:e>n?n:e},clampBottom:function(e,t){return t>e?t:e},mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},smoothstep:function(e,t,n){return t>=e?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return t>=e?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(e,t){return Math.floor(this.randFloat(e,t))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(){var e=Math.PI/180;return function(t){return t*e}}(),radToDeg:function(){var e=180/Math.PI;return function(t){return t*e}}(),isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}},THREE.Spline=function(e){function t(e,t,n,i,r,o,a){return(2*(t-n)+(e=.5*(n-e))+(i=.5*(i-t)))*a+(-3*(t-n)-2*e-i)*o+e*r+t}this.points=e;var n,i,r,o,a,s,l,u,c,h=[],d={x:0,y:0,z:0};this.initFromArray=function(e){this.points=[];for(var t=0;t<e.length;t++)this.points[t]={x:e[t][0],y:e[t][1],z:e[t][2]}},this.getPoint=function(e){return n=(this.points.length-1)*e,i=Math.floor(n),r=n-i,h[0]=0===i?i:i-1,h[1]=i,h[2]=i>this.points.length-2?this.points.length-1:i+1,h[3]=i>this.points.length-3?this.points.length-1:i+2,s=this.points[h[0]],l=this.points[h[1]],u=this.points[h[2]],c=this.points[h[3]],a=r*(o=r*r),d.x=t(s.x,l.x,u.x,c.x,r,o,a),d.y=t(s.y,l.y,u.y,c.y,r,o,a),d.z=t(s.z,l.z,u.z,c.z,r,o,a),d},this.getControlPointsArray=function(){var e,t,n=this.points.length,i=[];for(e=0;n>e;e++)t=this.points[e],i[e]=[t.x,t.y,t.z];return i},this.getLength=function(e){var t,n,i,r=t=t=0,o=new THREE.Vector3,a=new THREE.Vector3,s=[],l=0;for(s[0]=0,e||(e=100),n=this.points.length*e,o.copy(this.points[0]),e=1;n>e;e++)t=e/n,i=this.getPoint(t),a.copy(i),l+=a.distanceTo(o),o.copy(i),t*=this.points.length-1,(t=Math.floor(t))!=r&&(s[t]=l,r=t);return s[s.length]=l,{chunks:s,total:l}},this.reparametrizeByArcLength=function(e){var t,n,i,r,o,a,s=[],l=new THREE.Vector3,u=this.getLength();for(s.push(l.copy(this.points[0]).clone()),t=1;t<this.points.length;t++){for(n=u.chunks[t]-u.chunks[t-1],a=Math.ceil(e*n/u.total),r=(t-1)/(this.points.length-1),o=t/(this.points.length-1),n=1;a-1>n;n++)i=r+1/a*n*(o-r),i=this.getPoint(i),s.push(l.copy(i).clone());s.push(l.copy(this.points[t]).clone())}this.points=s}},THREE.Triangle=function(e,t,n){this.a=void 0!==e?e:new THREE.Vector3,this.b=void 0!==t?t:new THREE.Vector3,this.c=void 0!==n?n:new THREE.Vector3},THREE.Triangle.normal=function(){var e=new THREE.Vector3;return function(t,n,i,r){return(r=r||new THREE.Vector3).subVectors(i,n),e.subVectors(t,n),r.cross(e),(t=r.lengthSq())>0?r.multiplyScalar(1/Math.sqrt(t)):r.set(0,0,0)}}(),THREE.Triangle.barycoordFromPoint=function(){var e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3;return function(i,r,o,a,s){e.subVectors(a,r),t.subVectors(o,r),n.subVectors(i,r),i=e.dot(e),r=e.dot(t),o=e.dot(n);var l=t.dot(t);a=t.dot(n);var u=i*l-r*r;return s=s||new THREE.Vector3,0==u?s.set(-2,-1,-1):(l=(l*o-r*a)*(u=1/u),i=(i*a-r*o)*u,s.set(1-l-i,i,l))}}(),THREE.Triangle.containsPoint=function(){var e=new THREE.Vector3;return function(t,n,i,r){return 0<=(t=THREE.Triangle.barycoordFromPoint(t,n,i,r,e)).x&&0<=t.y&&1>=t.x+t.y}}(),THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){return(e||new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return THREE.Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){return(e||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return THREE.Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return THREE.Triangle.containsPoint(e,this.a,this.b,this.c)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)},clone:function(){return(new THREE.Triangle).copy(this)}},THREE.Clock=function(e){this.autoStart=void 0===e||e,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1},THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running&&this.start(),this.running){var t=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();e=.001*(t-this.oldTime);this.oldTime=t,this.elapsedTime+=e}return e}},THREE.EventDispatcher=function(){},THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(e){e.addEventListener=THREE.EventDispatcher.prototype.addEventListener,e.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener,e.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener,e.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=[],i=t.length,r=0;i>r;r++)n[r]=t[r];for(r=0;i>r;r++)n[r].call(this,e)}}}},function(e){e.Raycaster=function(t,n,i,r){this.ray=new e.Ray(t,n),this.near=i||0,this.far=r||1/0,this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var t=function(e,t){return e.distance-t.distance},n=function(e,t,i,r){if(e.raycast(t,i),!0===r){r=0;for(var o=(e=e.children).length;o>r;r++)n(e[r],t,i,!0)}};e.Raycaster.prototype={constructor:e.Raycaster,precision:1e-4,linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(t,n){n instanceof e.PerspectiveCamera?(this.ray.origin.copy(n.position),this.ray.direction.set(t.x,t.y,.5).unproject(n).sub(n.position).normalize()):n instanceof e.OrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld)):e.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,i){var r=[];return n(e,this,r,i),r.sort(t),r},intersectObjects:function(i,r){var o=[];if(0==i instanceof Array)return e.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),o;for(var a=0,s=i.length;s>a;a++)n(i[a],this,o,r);return o.sort(t),o}}}(THREE),THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=void 0,this.children=[],this.up=THREE.Object3D.DefaultUp.clone();var e=new THREE.Vector3,t=new THREE.Euler,n=new THREE.Quaternion,i=new THREE.Vector3(1,1,1);t.onChange(function(){n.setFromEuler(t,!1)}),n.onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:i}}),this.rotationAutoUpdate=!0,this.matrix=new THREE.Matrix4,this.matrixWorld=new THREE.Matrix4,this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!1,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0),THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){return THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order},set eulerOrder(e){THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order=e},get useQuaternion(){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(e){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(){var e=new THREE.Quaternion;return function(t,n){return e.setFromAxisAngle(t,n),this.quaternion.multiply(e),this}}(),rotateX:function(){var e=new THREE.Vector3(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new THREE.Vector3(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new THREE.Vector3(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new THREE.Vector3;return function(t,n){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(n)),this}}(),translate:function(e,t){return THREE.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},translateX:function(){var e=new THREE.Vector3(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new THREE.Vector3(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new THREE.Vector3(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new THREE.Matrix4;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new THREE.Matrix4;return function(t){e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(THREE.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e instanceof THREE.Object3D?(void 0!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):THREE.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(1<arguments.length)for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);-1!==(t=this.children.indexOf(e))&&(e.parent=void 0,e.dispatchEvent({type:"removed"}),this.children.splice(t,1))},getChildByName:function(e){return THREE.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,i=this.children.length;i>n;n++){var r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}},getWorldPosition:function(e){return e=e||new THREE.Vector3,this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(n){return n=n||new THREE.Quaternion,this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,n,t),n}}(),getWorldRotation:function(){var e=new THREE.Quaternion;return function(t){return t=t||new THREE.Euler,this.getWorldQuaternion(e),t.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new THREE.Vector3,t=new THREE.Quaternion;return function(n){return n=n||new THREE.Vector3,this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,n),n}}(),getWorldDirection:function(){var e=new THREE.Quaternion;return function(t){return t=t||new THREE.Vector3,this.getWorldQuaternion(e),t.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=0,n=this.children.length;n>t;t++)this.children[t].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=0,n=this.children.length;n>t;t++)this.children[t].traverseVisible(e)}},traverseAncestors:function(e){this.parent&&(e(this.parent),this.parent.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){!0===this.matrixAutoUpdate&&this.updateMatrix(),(!0===this.matrixWorldNeedsUpdate||!0===e)&&(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=0,n=this.children.length;n>t;t++)this.children[t].updateMatrixWorld(e)},toJSON:function(){var e={metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},t={},n={},i=function(t){if(void 0===e.materials&&(e.materials=[]),void 0===n[t.uuid]){var i=t.toJSON();delete i.metadata,n[t.uuid]=i,e.materials.push(i)}return t.uuid},r=function(n){var o={};if(o.uuid=n.uuid,o.type=n.type,""!==n.name&&(o.name=n.name),"{}"!==JSON.stringify(n.userData)&&(o.userData=n.userData),!0!==n.visible&&(o.visible=n.visible),n instanceof THREE.PerspectiveCamera)o.fov=n.fov,o.aspect=n.aspect,o.near=n.near,o.far=n.far;else if(n instanceof THREE.OrthographicCamera)o.left=n.left,o.right=n.right,o.top=n.top,o.bottom=n.bottom,o.near=n.near,o.far=n.far;else if(n instanceof THREE.AmbientLight)o.color=n.color.getHex();else if(n instanceof THREE.DirectionalLight)o.color=n.color.getHex(),o.intensity=n.intensity;else if(n instanceof THREE.PointLight)o.color=n.color.getHex(),o.intensity=n.intensity,o.distance=n.distance,o.decay=n.decay;else if(n instanceof THREE.SpotLight)o.color=n.color.getHex(),o.intensity=n.intensity,o.distance=n.distance,o.angle=n.angle,o.exponent=n.exponent,o.decay=n.decay;else if(n instanceof THREE.HemisphereLight)o.color=n.color.getHex(),o.groundColor=n.groundColor.getHex();else if(n instanceof THREE.Mesh||n instanceof THREE.Line||n instanceof THREE.PointCloud){var a=n.geometry;if(void 0===e.geometries&&(e.geometries=[]),void 0===t[a.uuid]){var s=a.toJSON();delete s.metadata,t[a.uuid]=s,e.geometries.push(s)}o.geometry=a.uuid,o.material=i(n.material),n instanceof THREE.Line&&(o.mode=n.mode)}else n instanceof THREE.Sprite&&(o.material=i(n.material));if(o.matrix=n.matrix.toArray(),0<n.children.length)for(o.children=[],a=0;a<n.children.length;a++)o.children.push(r(n.children[a]));return o};return e.object=r(this),e},clone:function(e,t){if(void 0===e&&(e=new THREE.Object3D),void 0===t&&(t=!0),e.name=this.name,e.up.copy(this.up),e.position.copy(this.position),e.quaternion.copy(this.quaternion),e.scale.copy(this.scale),e.rotationAutoUpdate=this.rotationAutoUpdate,e.matrix.copy(this.matrix),e.matrixWorld.copy(this.matrixWorld),e.matrixAutoUpdate=this.matrixAutoUpdate,e.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate,e.visible=this.visible,e.castShadow=this.castShadow,e.receiveShadow=this.receiveShadow,e.frustumCulled=this.frustumCulled,e.userData=JSON.parse(JSON.stringify(this.userData)),!0===t)for(var n=0;n<this.children.length;n++)e.add(this.children[n].clone());return e}},THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype),THREE.Object3DIdCount=0,THREE.Face3=function(e,t,n,i,r,o){this.a=e,this.b=t,this.c=n,this.normal=i instanceof THREE.Vector3?i:new THREE.Vector3,this.vertexNormals=i instanceof Array?i:[],this.color=r instanceof THREE.Color?r:new THREE.Color,this.vertexColors=r instanceof Array?r:[],this.vertexTangents=[],this.materialIndex=void 0!==o?o:0},THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var e=new THREE.Face3(this.a,this.b,this.c);e.normal.copy(this.normal),e.color.copy(this.color),e.materialIndex=this.materialIndex;for(var t=0,n=this.vertexNormals.length;n>t;t++)e.vertexNormals[t]=this.vertexNormals[t].clone();for(t=0,n=this.vertexColors.length;n>t;t++)e.vertexColors[t]=this.vertexColors[t].clone();for(t=0,n=this.vertexTangents.length;n>t;t++)e.vertexTangents[t]=this.vertexTangents[t].clone();return e}},THREE.Face4=function(e,t,n,i,r,o,a){return THREE.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new THREE.Face3(e,t,n,r,o,a)},THREE.BufferAttribute=function(e,t){this.array=e,this.itemSize=t,this.needsUpdate=!1},THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var i=0,r=this.itemSize;r>i;i++)this.array[e+i]=t.array[n+i];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},setX:function(e,t){return this.array[e*this.itemSize]=t,this},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e*=this.itemSize,this.array[e]=t,this.array[e+1]=n,this.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e*=this.itemSize,this.array[e]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this},clone:function(){return new THREE.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}},THREE.Int8Attribute=function(e,t){return THREE.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(e,t)},THREE.Uint8Attribute=function(e,t){return THREE.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(e,t)},THREE.Uint8ClampedAttribute=function(e,t){return THREE.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(e,t)},THREE.Int16Attribute=function(e,t){return THREE.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(e,t)},THREE.Uint16Attribute=function(e,t){return THREE.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(e,t)},THREE.Int32Attribute=function(e,t){return THREE.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(e,t)},THREE.Uint32Attribute=function(e,t){return THREE.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(e,t)},THREE.Float32Attribute=function(e,t){return THREE.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(e,t)},THREE.Float64Attribute=function(e,t){return THREE.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(e,t)},THREE.DynamicBufferAttribute=function(e,t){THREE.BufferAttribute.call(this,e,t),this.updateRange={offset:0,count:-1}},THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype),THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute,THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)},THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.attributes={},this.attributesKeys=[],this.offsets=this.drawcalls=[],this.boundingSphere=this.boundingBox=null},THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(e,t,n){0==t instanceof THREE.BufferAttribute?(THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[e]={array:t,itemSize:n}):(this.attributes[e]=t,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(e){return this.attributes[e]},addDrawCall:function(e,t,n){this.drawcalls.push({start:e,count:t,index:void 0!==n?n:0})},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToVector3Array(t.array),t.needsUpdate=!0),void 0!==(t=this.attributes.normal)&&((new THREE.Matrix3).getNormalMatrix(e).applyToVector3Array(t.array),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var e=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(e)),e},fromGeometry:function(e,t){t=t||{vertexColors:THREE.NoColors};var n=e.vertices,i=e.faces,r=e.faceVertexUvs,o=t.vertexColors,a=0<r[0].length,s=3==i[0].vertexNormals.length,l=new Float32Array(9*i.length);this.addAttribute("position",new THREE.BufferAttribute(l,3));var u=new Float32Array(9*i.length);if(this.addAttribute("normal",new THREE.BufferAttribute(u,3)),o!==THREE.NoColors){var c=new Float32Array(9*i.length);this.addAttribute("color",new THREE.BufferAttribute(c,3))}if(!0===a){var h=new Float32Array(6*i.length);this.addAttribute("uv",new THREE.BufferAttribute(h,2))}for(var d=0,f=0,p=0;d<i.length;d++,f+=6,p+=9){var m=i[d],g=n[m.a],v=n[m.b],E=n[m.c];l[p]=g.x,l[p+1]=g.y,l[p+2]=g.z,l[p+3]=v.x,l[p+4]=v.y,l[p+5]=v.z,l[p+6]=E.x,l[p+7]=E.y,l[p+8]=E.z,!0===s?(g=m.vertexNormals[0],v=m.vertexNormals[1],E=m.vertexNormals[2],u[p]=g.x,u[p+1]=g.y,u[p+2]=g.z,u[p+3]=v.x,u[p+4]=v.y,u[p+5]=v.z,u[p+6]=E.x,u[p+7]=E.y,u[p+8]=E.z):(g=m.normal,u[p]=g.x,u[p+1]=g.y,u[p+2]=g.z,u[p+3]=g.x,u[p+4]=g.y,u[p+5]=g.z,u[p+6]=g.x,u[p+7]=g.y,u[p+8]=g.z),o===THREE.FaceColors?(m=m.color,c[p]=m.r,c[p+1]=m.g,c[p+2]=m.b,c[p+3]=m.r,c[p+4]=m.g,c[p+5]=m.b,c[p+6]=m.r,c[p+7]=m.g,c[p+8]=m.b):o===THREE.VertexColors&&(g=m.vertexColors[0],v=m.vertexColors[1],m=m.vertexColors[2],c[p]=g.r,c[p+1]=g.g,c[p+2]=g.b,c[p+3]=v.r,c[p+4]=v.g,c[p+5]=v.b,c[p+6]=m.r,c[p+7]=m.g,c[p+8]=m.b),!0===a&&(m=r[0][d][0],g=r[0][d][1],v=r[0][d][2],h[f]=m.x,h[f+1]=m.y,h[f+2]=g.x,h[f+3]=g.y,h[f+4]=v.x,h[f+5]=v.y)}return this.computeBoundingSphere(),this},computeBoundingBox:function(){var e=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var t=this.attributes.position.array;if(t){var n=this.boundingBox;n.makeEmpty();for(var i=0,r=t.length;r>i;i+=3)e.set(t[i],t[i+1],t[i+2]),n.expandByPoint(e)}(void 0===t||0===t.length)&&(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var e=new THREE.Box3,t=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var n=this.attributes.position.array;if(n){e.makeEmpty();for(var i=this.boundingSphere.center,r=0,o=n.length;o>r;r+=3)t.set(n[r],n[r+1],n[r+2]),e.expandByPoint(t);e.center(i);var a=0;for(r=0,o=n.length;o>r;r+=3)t.set(n[r],n[r+1],n[r+2]),a=Math.max(a,i.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.attributes;if(e.position){var t=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(t.length),3));else for(var n=0,i=(s=e.normal.array).length;i>n;n++)s[n]=0;var r,o,a,s=e.normal.array,l=new THREE.Vector3,u=new THREE.Vector3,c=new THREE.Vector3,h=new THREE.Vector3,d=new THREE.Vector3;if(e.index)for(var f=e.index.array,p=0<this.offsets.length?this.offsets:[{start:0,count:f.length,index:0}],m=0,g=p.length;g>m;++m){i=p[m].start,r=p[m].count;var v=p[m].index;for(n=i,i=i+r;i>n;n+=3)r=3*(v+f[n]),o=3*(v+f[n+1]),a=3*(v+f[n+2]),l.fromArray(t,r),u.fromArray(t,o),c.fromArray(t,a),h.subVectors(c,u),d.subVectors(l,u),h.cross(d),s[r]+=h.x,s[r+1]+=h.y,s[r+2]+=h.z,s[o]+=h.x,s[o+1]+=h.y,s[o+2]+=h.z,s[a]+=h.x,s[a+1]+=h.y,s[a+2]+=h.z}else for(n=0,i=t.length;i>n;n+=9)l.fromArray(t,n),u.fromArray(t,n+3),c.fromArray(t,n+6),h.subVectors(c,u),d.subVectors(l,u),h.cross(d),s[n]=h.x,s[n+1]=h.y,s[n+2]=h.z,s[n+3]=h.x,s[n+4]=h.y,s[n+5]=h.z,s[n+6]=h.x,s[n+7]=h.y,s[n+8]=h.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},computeTangents:function(){function e(e,t,n){S.fromArray(i,3*e),M.fromArray(i,3*t),C.fromArray(i,3*n),A.fromArray(o,2*e),k.fromArray(o,2*t),P.fromArray(o,2*n),h=M.x-S.x,d=C.x-S.x,f=M.y-S.y,p=C.y-S.y,m=M.z-S.z,g=C.z-S.z,v=k.x-A.x,E=P.x-A.x,y=k.y-A.y,_=P.y-A.y,T=1/(v*_-E*y),D.set((_*h-y*d)*T,(_*f-y*p)*T,(_*m-y*g)*T),L.set((v*d-E*h)*T,(v*p-E*f)*T,(v*g-E*m)*T),l[e].add(D),l[t].add(D),l[n].add(D),u[e].add(L),u[t].add(L),u[n].add(L)}function t(e){U.fromArray(r,3*e),j.copy(U),I=l[e],z.copy(I),z.sub(U.multiplyScalar(U.dot(I))).normalize(),V.crossVectors(j,I),B=V.dot(u[e]),N=0>B?-1:1,s[4*e]=z.x,s[4*e+1]=z.y,s[4*e+2]=z.z,s[4*e+3]=N}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var n=this.attributes.index.array,i=this.attributes.position.array,r=this.attributes.normal.array,o=this.attributes.uv.array,a=i.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*a),4));for(var s=this.attributes.tangent.array,l=[],u=[],c=0;a>c;c++)l[c]=new THREE.Vector3,u[c]=new THREE.Vector3;var h,d,f,p,m,g,v,E,y,_,T,b,w,x,R,H,S=new THREE.Vector3,M=new THREE.Vector3,C=new THREE.Vector3,A=new THREE.Vector2,k=new THREE.Vector2,P=new THREE.Vector2,D=new THREE.Vector3,L=new THREE.Vector3;0===this.drawcalls.length&&this.addDrawCall(0,n.length,0);var O=this.drawcalls;c=0;for(w=O.length;w>c;++c){b=O[c].start,x=O[c].count;var F=O[c].index;a=b;for(b+=x;b>a;a+=3)e(x=F+n[a],R=F+n[a+1],H=F+n[a+2])}var N,I,B,z=new THREE.Vector3,V=new THREE.Vector3,U=new THREE.Vector3,j=new THREE.Vector3;c=0;for(w=O.length;w>c;++c)for(b=O[c].start,x=O[c].count,F=O[c].index,a=b,b+=x;b>a;a+=3)x=F+n[a],R=F+n[a+1],H=F+n[a+2],t(x),t(R),t(H)}},computeOffsets:function(e){void 0===e&&(e=65535);for(var t=this.attributes.index.array,n=this.attributes.position.array,i=t.length/3,r=new Uint16Array(t.length),o=0,a=0,s=[{start:0,count:0,index:0}],l=s[0],u=0,c=new Int32Array(6),h=new Int32Array(n.length),d=new Int32Array(n.length),f=0;f<n.length;f++)h[f]=-1,d[f]=-1;for(n=0;i>n;n++){for(var p=u=0;3>p;p++)-1==h[f=t[3*n+p]]?(c[2*p]=f,c[2*p+1]=-1,u++):h[f]<l.index?(c[2*p]=f,c[2*p+1]=-1,0):(c[2*p]=f,c[2*p+1]=h[f]);if(a+u>l.index+e)for(l={start:o,count:0,index:a},s.push(l),u=0;6>u;u+=2)(p=c[u+1])>-1&&p<l.index&&(c[u+1]=-1);for(u=0;6>u;u+=2)f=c[u],-1===(p=c[u+1])&&(p=a++),h[f]=p,d[p]=f,r[o++]=p-l.index,l.count++}return this.reorderBuffers(r,d,a),this.drawcalls=this.offsets=s},merge:function(e,t){if(0!=e instanceof THREE.BufferGeometry){void 0===t&&(t=0);var n,i=this.attributes;for(n in i)if(void 0!==e.attributes[n])for(var r=i[n].array,o=(s=e.attributes[n]).array,a=0,s=s.itemSize*t;a<o.length;a++,s++)r[s]=o[a];return this}THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e,t,n,i=this.attributes.normal.array,r=0,o=i.length;o>r;r+=3)e=i[r],t=i[r+1],n=i[r+2],e=1/Math.sqrt(e*e+t*t+n*n),i[r]*=e,i[r+1]*=e,i[r+2]*=e},reorderBuffers:function(e,t,n){var i,r={};for(i in this.attributes)"index"!=i&&(r[i]=new this.attributes[i].array.constructor(this.attributes[i].itemSize*n));for(var o=0;n>o;o++){var a=t[o];for(i in this.attributes)if("index"!=i)for(var s=this.attributes[i].array,l=this.attributes[i].itemSize,u=r[i],c=0;l>c;c++)u[o*l+c]=s[a*l+c]}for(i in this.attributes.index.array=e,this.attributes)"index"!=i&&(this.attributes[i].array=r[i],this.attributes[i].numItems=this.attributes[i].itemSize*n)},toJSON:function(){var e,t={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},n=this.attributes,i=this.offsets,r=this.boundingSphere;for(e in n){var o=n[e],a=Array.prototype.slice.call(o.array);t.data.attributes[e]={itemSize:o.itemSize,type:o.array.constructor.name,array:a}}return 0<i.length&&(t.data.offsets=JSON.parse(JSON.stringify(i))),null!==r&&(t.data.boundingSphere={center:r.center.toArray(),radius:r.radius}),t},clone:function(){var e,t=new THREE.BufferGeometry;for(e in this.attributes)t.addAttribute(e,this.attributes[e].clone());e=0;for(var n=this.offsets.length;n>e;e++){var i=this.offsets[e];t.offsets.push({start:i.start,index:i.index,count:i.count})}return t},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype),THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphColors=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.hasTangents=!1,this.dynamic=!0,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1},THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(e){for(var t=(new THREE.Matrix3).getNormalMatrix(e),n=0,i=this.vertices.length;i>n;n++)this.vertices[n].applyMatrix4(e);for(n=0,i=this.faces.length;i>n;n++){(e=this.faces[n]).normal.applyMatrix3(t).normalize();for(var r=0,o=e.vertexNormals.length;o>r;r++)e.vertexNormals[r].applyMatrix3(t).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0},fromBufferGeometry:function(e){for(var t=this,n=e.attributes,i=n.position.array,r=void 0!==n.index?n.index.array:void 0,o=void 0!==n.normal?n.normal.array:void 0,a=void 0!==n.color?n.color.array:void 0,s=void 0!==n.uv?n.uv.array:void 0,l=[],u=[],c=n=0;n<i.length;n+=3,c+=2)t.vertices.push(new THREE.Vector3(i[n],i[n+1],i[n+2])),void 0!==o&&l.push(new THREE.Vector3(o[n],o[n+1],o[n+2])),void 0!==a&&t.colors.push(new THREE.Color(a[n],a[n+1],a[n+2])),void 0!==s&&u.push(new THREE.Vector2(s[c],s[c+1]));var h=function(e,n,i){var r=void 0!==o?[l[e].clone(),l[n].clone(),l[i].clone()]:[],c=void 0!==a?[t.colors[e].clone(),t.colors[n].clone(),t.colors[i].clone()]:[];t.faces.push(new THREE.Face3(e,n,i,r,c)),void 0!==s&&t.faceVertexUvs[0].push([u[e].clone(),u[n].clone(),u[i].clone()])};if(void 0!==r)if(0<(i=e.drawcalls).length)for(n=0;n<i.length;n++){var d=(c=i[n]).start,f=c.count,p=c.index;for(c=d,d=d+f;d>c;c+=3)h(p+r[c],p+r[c+1],p+r[c+2])}else for(n=0;n<r.length;n+=3)h(r[n],r[n+1],r[n+2]);else for(n=0;n<i.length/3;n+=3)h(n,n+1,n+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(e)),e},computeFaceNormals:function(){for(var e=new THREE.Vector3,t=new THREE.Vector3,n=0,i=this.faces.length;i>n;n++){var r=this.faces[n],o=this.vertices[r.a],a=this.vertices[r.b];e.subVectors(this.vertices[r.c],a),t.subVectors(o,a),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){var t,n,i;for(i=Array(this.vertices.length),t=0,n=this.vertices.length;n>t;t++)i[t]=new THREE.Vector3;if(e){var r,o,a,s=new THREE.Vector3,l=new THREE.Vector3;for(e=0,t=this.faces.length;t>e;e++)n=this.faces[e],r=this.vertices[n.a],o=this.vertices[n.b],a=this.vertices[n.c],s.subVectors(a,o),l.subVectors(r,o),s.cross(l),i[n.a].add(s),i[n.b].add(s),i[n.c].add(s)}else for(e=0,t=this.faces.length;t>e;e++)i[(n=this.faces[e]).a].add(n.normal),i[n.b].add(n.normal),i[n.c].add(n.normal);for(t=0,n=this.vertices.length;n>t;t++)i[t].normalize();for(e=0,t=this.faces.length;t>e;e++)(n=this.faces[e]).vertexNormals[0]=i[n.a].clone(),n.vertexNormals[1]=i[n.b].clone(),n.vertexNormals[2]=i[n.c].clone()},computeMorphNormals:function(){var e,t,n,i,r;for(n=0,i=this.faces.length;i>n;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,t=r.vertexNormals.length;t>e;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var o=new THREE.Geometry;for(o.faces=this.faces,e=0,t=this.morphTargets.length;t>e;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[],r=this.morphNormals[e].faceNormals;var a,s,l=this.morphNormals[e].vertexNormals;for(n=0,i=this.faces.length;i>n;n++)a=new THREE.Vector3,s={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},r.push(a),l.push(s)}for(l=this.morphNormals[e],o.vertices=this.morphTargets[e].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,i=this.faces.length;i>n;n++)r=this.faces[n],a=l.faceNormals[n],s=l.vertexNormals[n],a.copy(r.normal),s.a.copy(r.vertexNormals[0]),s.b.copy(r.vertexNormals[1]),s.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;i>n;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeTangents:function(){var e,t,n,i,r,o,a,s,l,u,c,h,d,f,p,m,g,v=[],E=[];n=new THREE.Vector3;var y=new THREE.Vector3,_=new THREE.Vector3,T=new THREE.Vector3,b=new THREE.Vector3;for(e=0,t=this.vertices.length;t>e;e++)v[e]=new THREE.Vector3,E[e]=new THREE.Vector3;for(e=0,t=this.faces.length;t>e;e++)r=this.faces[e],o=this.faceVertexUvs[0][e],i=r.a,g=r.b,r=r.c,a=this.vertices[i],s=this.vertices[g],l=this.vertices[r],u=o[0],c=o[1],h=o[2],o=s.x-a.x,d=l.x-a.x,f=s.y-a.y,p=l.y-a.y,s=s.z-a.z,a=l.z-a.z,l=c.x-u.x,m=h.x-u.x,c=c.y-u.y,h=1/(l*(u=h.y-u.y)-m*c),n.set((u*o-c*d)*h,(u*f-c*p)*h,(u*s-c*a)*h),y.set((l*d-m*o)*h,(l*p-m*f)*h,(l*a-m*s)*h),v[i].add(n),v[g].add(n),v[r].add(n),E[i].add(y),E[g].add(y),E[r].add(y);for(y=["a","b","c","d"],e=0,t=this.faces.length;t>e;e++)for(r=this.faces[e],n=0;n<Math.min(r.vertexNormals.length,3);n++)b.copy(r.vertexNormals[n]),g=v[i=r[y[n]]],_.copy(g),_.sub(b.multiplyScalar(b.dot(g))).normalize(),T.crossVectors(r.vertexNormals[n],g),i=0>(i=T.dot(E[i]))?-1:1,r.vertexTangents[n]=new THREE.Vector4(_.x,_.y,_.z,i);this.hasTangents=!0},computeLineDistances:function(){for(var e=0,t=this.vertices,n=0,i=t.length;i>n;n++)n>0&&(e+=t[n].distanceTo(t[n-1])),this.lineDistances[n]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(0==e instanceof THREE.Geometry)THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);else{var i,r=this.vertices.length,o=this.vertices,a=e.vertices,s=this.faces,l=e.faces,u=this.faceVertexUvs[0];e=e.faceVertexUvs[0],void 0===n&&(n=0),void 0!==t&&(i=(new THREE.Matrix3).getNormalMatrix(t));for(var c=0,h=a.length;h>c;c++){var d=a[c].clone();void 0!==t&&d.applyMatrix4(t),o.push(d)}for(c=0,h=l.length;h>c;c++){var f,p=(a=l[c]).vertexNormals,m=a.vertexColors;for((d=new THREE.Face3(a.a+r,a.b+r,a.c+r)).normal.copy(a.normal),void 0!==i&&d.normal.applyMatrix3(i).normalize(),t=0,o=p.length;o>t;t++)f=p[t].clone(),void 0!==i&&f.applyMatrix3(i).normalize(),d.vertexNormals.push(f);for(d.color.copy(a.color),t=0,o=m.length;o>t;t++)f=m[t],d.vertexColors.push(f.clone());d.materialIndex=a.materialIndex+n,s.push(d)}for(c=0,h=e.length;h>c;c++)if(i=[],void 0!==(n=e[c])){for(t=0,o=n.length;o>t;t++)i.push(n[t].clone());u.push(i)}}},mergeMesh:function(e){0==e instanceof THREE.Mesh?THREE.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e):(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix))},mergeVertices:function(){var e,t,n,i={},r=[],o=[],a=Math.pow(10,4);for(t=0,n=this.vertices.length;n>t;t++)e=this.vertices[t],void 0===i[e=Math.round(e.x*a)+"_"+Math.round(e.y*a)+"_"+Math.round(e.z*a)]?(i[e]=t,r.push(this.vertices[t]),o[t]=r.length-1):o[t]=o[i[e]];for(i=[],t=0,n=this.faces.length;n>t;t++)for((a=this.faces[t]).a=o[a.a],a.b=o[a.b],a.c=o[a.c],a=[a.a,a.b,a.c],e=0;3>e;e++)if(a[e]==a[(e+1)%3]){i.push(t);break}for(t=i.length-1;t>=0;t--)for(a=i[t],this.faces.splice(a,1),o=0,n=this.faceVertexUvs.length;n>o;o++)this.faceVertexUvs[o].splice(a,1);return t=this.vertices.length-r.length,this.vertices=r,t},toJSON:function(){function e(e,t,n){return n?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==u[t]?u[t]:(u[t]=l.length/3,l.push(e.x,e.y,e.z),u[t])}function n(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==h[t]?h[t]:(h[t]=c.length,c.push(e.getHex()),h[t])}function i(e){var t=e.x.toString()+e.y.toString();return void 0!==f[t]?f[t]:(f[t]=d.length/2,d.push(e.x,e.y),f[t])}var r={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};if(""!==this.name&&(r.name=this.name),void 0!==this.parameters){var o,a=this.parameters;for(o in a)void 0!==a[o]&&(r[o]=a[o]);return r}for(a=[],o=0;o<this.vertices.length;o++){var s=this.vertices[o];a.push(s.x,s.y,s.z)}s=[];var l=[],u={},c=[],h={},d=[],f={};for(o=0;o<this.faces.length;o++){var p=this.faces[o],m=void 0!==this.faceVertexUvs[0][o],g=0<p.normal.length(),v=0<p.vertexNormals.length,E=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=0<p.vertexColors.length,_=e(_=0,0,0);_=e(_,1,!1),_=e(_,2,!1),_=e(_,3,m),_=e(_,4,g),_=e(_,5,v),_=e(_,6,E),_=e(_,7,y);s.push(_),s.push(p.a,p.b,p.c),m&&(m=this.faceVertexUvs[0][o],s.push(i(m[0]),i(m[1]),i(m[2]))),g&&s.push(t(p.normal)),v&&(g=p.vertexNormals,s.push(t(g[0]),t(g[1]),t(g[2]))),E&&s.push(n(p.color)),y&&(p=p.vertexColors,s.push(n(p[0]),n(p[1]),n(p[2])))}return r.data={},r.data.vertices=a,r.data.normals=l,0<c.length&&(r.data.colors=c),0<d.length&&(r.data.uvs=[d]),r.data.faces=s,r},clone:function(){for(var e=new THREE.Geometry,t=this.vertices,n=0,i=t.length;i>n;n++)e.vertices.push(t[n].clone());for(n=0,i=(t=this.faces).length;i>n;n++)e.faces.push(t[n].clone());for(n=0,i=this.faceVertexUvs.length;i>n;n++){t=this.faceVertexUvs[n],void 0===e.faceVertexUvs[n]&&(e.faceVertexUvs[n]=[]);for(var r=0,o=t.length;o>r;r++){for(var a=t[r],s=[],l=0,u=a.length;u>l;l++)s.push(a[l].clone());e.faceVertexUvs[n].push(s)}}return e},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype),THREE.GeometryIdCount=0,THREE.Camera=function(){THREE.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new THREE.Matrix4,this.projectionMatrix=new THREE.Matrix4},THREE.Camera.prototype=Object.create(THREE.Object3D.prototype),THREE.Camera.prototype.constructor=THREE.Camera,THREE.Camera.prototype.getWorldDirection=function(){var e=new THREE.Quaternion;return function(t){return t=t||new THREE.Vector3,this.getWorldQuaternion(e),t.set(0,0,-1).applyQuaternion(e)}}(),THREE.Camera.prototype.lookAt=function(){var e=new THREE.Matrix4;return function(t){e.lookAt(this.position,t,this.up),this.quaternion.setFromRotationMatrix(e)}}(),THREE.Camera.prototype.clone=function(e){return void 0===e&&(e=new THREE.Camera),THREE.Object3D.prototype.clone.call(this,e),e.matrixWorldInverse.copy(this.matrixWorldInverse),e.projectionMatrix.copy(this.projectionMatrix),e},THREE.CubeCamera=function(e,t,n){THREE.Object3D.call(this),this.type="CubeCamera";var i=new THREE.PerspectiveCamera(90,1,e,t);i.up.set(0,-1,0),i.lookAt(new THREE.Vector3(1,0,0)),this.add(i);var r=new THREE.PerspectiveCamera(90,1,e,t);r.up.set(0,-1,0),r.lookAt(new THREE.Vector3(-1,0,0)),this.add(r);var o=new THREE.PerspectiveCamera(90,1,e,t);o.up.set(0,0,1),o.lookAt(new THREE.Vector3(0,1,0)),this.add(o);var a=new THREE.PerspectiveCamera(90,1,e,t);a.up.set(0,0,-1),a.lookAt(new THREE.Vector3(0,-1,0)),this.add(a);var s=new THREE.PerspectiveCamera(90,1,e,t);s.up.set(0,-1,0),s.lookAt(new THREE.Vector3(0,0,1)),this.add(s);var l=new THREE.PerspectiveCamera(90,1,e,t);l.up.set(0,-1,0),l.lookAt(new THREE.Vector3(0,0,-1)),this.add(l),this.renderTarget=new THREE.WebGLRenderTargetCube(n,n,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter}),this.updateCubeMap=function(e,t){var n=this.renderTarget,u=n.generateMipmaps;n.generateMipmaps=!1,n.activeCubeFace=0,e.render(t,i,n),n.activeCubeFace=1,e.render(t,r,n),n.activeCubeFace=2,e.render(t,o,n),n.activeCubeFace=3,e.render(t,a,n),n.activeCubeFace=4,e.render(t,s,n),n.generateMipmaps=u,n.activeCubeFace=5,e.render(t,l,n)}},THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype),THREE.CubeCamera.prototype.constructor=THREE.CubeCamera,THREE.OrthographicCamera=function(e,t,n,i,r,o){THREE.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()},THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype),THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera,THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(n-e,n+e,i+t,i-t,this.near,this.far)},THREE.OrthographicCamera.prototype.clone=function(){var e=new THREE.OrthographicCamera;return THREE.Camera.prototype.clone.call(this,e),e.zoom=this.zoom,e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e.projectionMatrix.copy(this.projectionMatrix),e},THREE.PerspectiveCamera=function(e,t,n,i){THREE.Camera.call(this),this.type="PerspectiveCamera",this.zoom=1,this.fov=void 0!==e?e:50,this.aspect=void 0!==t?t:1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype),THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera,THREE.PerspectiveCamera.prototype.setLens=function(e,t){void 0===t&&(t=24),this.fov=2*THREE.Math.radToDeg(Math.atan(t/(2*e))),this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.setViewOffset=function(e,t,n,i,r,o){this.fullWidth=e,this.fullHeight=t,this.x=n,this.y=i,this.width=r,this.height=o,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var e=THREE.Math.radToDeg(2*Math.atan(Math.tan(.5*THREE.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var t=(n=this.fullWidth/this.fullHeight)*(i=-(e=Math.tan(THREE.Math.degToRad(.5*e))*this.near)),n=Math.abs(n*e-t),i=Math.abs(e-i);this.projectionMatrix.makeFrustum(t+this.x*n/this.fullWidth,t+(this.x+this.width)*n/this.fullWidth,e-(this.y+this.height)*i/this.fullHeight,e-this.y*i/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(e,this.aspect,this.near,this.far)},THREE.PerspectiveCamera.prototype.clone=function(){var e=new THREE.PerspectiveCamera;return THREE.Camera.prototype.clone.call(this,e),e.zoom=this.zoom,e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e.projectionMatrix.copy(this.projectionMatrix),e},THREE.Light=function(e){THREE.Object3D.call(this),this.type="Light",this.color=new THREE.Color(e)},THREE.Light.prototype=Object.create(THREE.Object3D.prototype),THREE.Light.prototype.constructor=THREE.Light,THREE.Light.prototype.clone=function(e){return void 0===e&&(e=new THREE.Light),THREE.Object3D.prototype.clone.call(this,e),e.color.copy(this.color),e},THREE.AmbientLight=function(e){THREE.Light.call(this,e),this.type="AmbientLight"},THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype),THREE.AmbientLight.prototype.constructor=THREE.AmbientLight,THREE.AmbientLight.prototype.clone=function(){var e=new THREE.AmbientLight;return THREE.Light.prototype.clone.call(this,e),e},THREE.AreaLight=function(e,t){THREE.Light.call(this,e),this.type="AreaLight",this.normal=new THREE.Vector3(0,-1,0),this.right=new THREE.Vector3(1,0,0),this.intensity=void 0!==t?t:1,this.height=this.width=1,this.constantAttenuation=1.5,this.linearAttenuation=.5,this.quadraticAttenuation=.1},THREE.AreaLight.prototype=Object.create(THREE.Light.prototype),THREE.AreaLight.prototype.constructor=THREE.AreaLight,THREE.DirectionalLight=function(e,t){THREE.Light.call(this,e),this.type="DirectionalLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==t?t:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraLeft=-500,this.shadowCameraTop=this.shadowCameraRight=500,this.shadowCameraBottom=-500,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowCascade=!1,this.shadowCascadeOffset=new THREE.Vector3(0,0,-1e3),this.shadowCascadeCount=2,this.shadowCascadeBias=[0,0,0],this.shadowCascadeWidth=[512,512,512],this.shadowCascadeHeight=[512,512,512],this.shadowCascadeNearZ=[-1,.99,.998],this.shadowCascadeFarZ=[.99,.998,1],this.shadowCascadeArray=[],this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype),THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight,THREE.DirectionalLight.prototype.clone=function(){var e=new THREE.DirectionalLight;return THREE.Light.prototype.clone.call(this,e),e.target=this.target.clone(),e.intensity=this.intensity,e.castShadow=this.castShadow,e.onlyShadow=this.onlyShadow,e.shadowCameraNear=this.shadowCameraNear,e.shadowCameraFar=this.shadowCameraFar,e.shadowCameraLeft=this.shadowCameraLeft,e.shadowCameraRight=this.shadowCameraRight,e.shadowCameraTop=this.shadowCameraTop,e.shadowCameraBottom=this.shadowCameraBottom,e.shadowCameraVisible=this.shadowCameraVisible,e.shadowBias=this.shadowBias,e.shadowDarkness=this.shadowDarkness,e.shadowMapWidth=this.shadowMapWidth,e.shadowMapHeight=this.shadowMapHeight,e.shadowCascade=this.shadowCascade,e.shadowCascadeOffset.copy(this.shadowCascadeOffset),e.shadowCascadeCount=this.shadowCascadeCount,e.shadowCascadeBias=this.shadowCascadeBias.slice(0),e.shadowCascadeWidth=this.shadowCascadeWidth.slice(0),e.shadowCascadeHeight=this.shadowCascadeHeight.slice(0),e.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0),e.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0),e},THREE.HemisphereLight=function(e,t,n){THREE.Light.call(this,e),this.type="HemisphereLight",this.position.set(0,100,0),this.groundColor=new THREE.Color(t),this.intensity=void 0!==n?n:1},THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype),THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight,THREE.HemisphereLight.prototype.clone=function(){var e=new THREE.HemisphereLight;return THREE.Light.prototype.clone.call(this,e),e.groundColor.copy(this.groundColor),e.intensity=this.intensity,e},THREE.PointLight=function(e,t,n,i){THREE.Light.call(this,e),this.type="PointLight",this.intensity=void 0!==t?t:1,this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1},THREE.PointLight.prototype=Object.create(THREE.Light.prototype),THREE.PointLight.prototype.constructor=THREE.PointLight,THREE.PointLight.prototype.clone=function(){var e=new THREE.PointLight;return THREE.Light.prototype.clone.call(this,e),e.intensity=this.intensity,e.distance=this.distance,e.decay=this.decay,e},THREE.SpotLight=function(e,t,n,i,r,o){THREE.Light.call(this,e),this.type="SpotLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==t?t:1,this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.exponent=void 0!==r?r:10,this.decay=void 0!==o?o:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraFov=50,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.SpotLight.prototype=Object.create(THREE.Light.prototype),THREE.SpotLight.prototype.constructor=THREE.SpotLight,THREE.SpotLight.prototype.clone=function(){var e=new THREE.SpotLight;return THREE.Light.prototype.clone.call(this,e),e.target=this.target.clone(),e.intensity=this.intensity,e.distance=this.distance,e.angle=this.angle,e.exponent=this.exponent,e.decay=this.decay,e.castShadow=this.castShadow,e.onlyShadow=this.onlyShadow,e.shadowCameraNear=this.shadowCameraNear,e.shadowCameraFar=this.shadowCameraFar,e.shadowCameraFov=this.shadowCameraFov,e.shadowCameraVisible=this.shadowCameraVisible,e.shadowBias=this.shadowBias,e.shadowDarkness=this.shadowDarkness,e.shadowMapWidth=this.shadowMapWidth,e.shadowMapHeight=this.shadowMapHeight,e},THREE.Cache={files:{},add:function(e,t){this.files[e]=t},get:function(e){return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},THREE.Loader=function(e){this.statusDomElement=(this.showStatus=e)?THREE.Loader.prototype.addStatusElement():null,this.imageLoader=new THREE.ImageLoader,this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var e=document.createElement("div");return e.style.position="absolute",e.style.right="0px",e.style.top="0px",e.style.fontSize="0.8em",e.style.textAlign="left",e.style.background="rgba(0,0,0,0.25)",e.style.color="#fff",e.style.width="120px",e.style.padding="0.5em 0.5em 0.5em 0.5em",e.style.zIndex=1e3,e.innerHTML="Loading ...",e},updateProgress:function(e){var t="Loaded ";t=e.total?t+((100*e.loaded/e.total).toFixed(0)+"%"):t+((e.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=t},extractUrlBase:function(e){return 1===(e=e.split("/")).length?"./":(e.pop(),e.join("/")+"/")},initMaterials:function(e,t){for(var n=[],i=0;i<e.length;++i)n[i]=this.createMaterial(e[i],t);return n},needsTangents:function(e){for(var t=0,n=e.length;n>t;t++)if(e[t]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(e,t){function n(e){return e=Math.log(e)/Math.LN2,Math.pow(2,Math.round(e))}function i(e,i,r,a,s,l,u){var c,h=t+r,d=THREE.Loader.Handlers.get(h);null!==d?c=d.load(h):(c=new THREE.Texture,(d=o.imageLoader).crossOrigin=o.crossOrigin,d.load(h,function(e){if(!1===THREE.Math.isPowerOfTwo(e.width)||!1===THREE.Math.isPowerOfTwo(e.height)){var t=n(e.width),i=n(e.height),r=document.createElement("canvas");r.width=t,r.height=i,r.getContext("2d").drawImage(e,0,0,t,i),c.image=r}else c.image=e;c.needsUpdate=!0})),c.sourceFile=r,a&&(c.repeat.set(a[0],a[1]),1!==a[0]&&(c.wrapS=THREE.RepeatWrapping),1!==a[1]&&(c.wrapT=THREE.RepeatWrapping)),s&&c.offset.set(s[0],s[1]),l&&(void 0!==(r={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping})[l[0]]&&(c.wrapS=r[l[0]]),void 0!==r[l[1]]&&(c.wrapT=r[l[1]])),u&&(c.anisotropy=u),e[i]=c}function r(e){return(255*e[0]<<16)+(255*e[1]<<8)+255*e[2]}var o=this,a="MeshLambertMaterial",s={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(e.shading){var l=e.shading.toLowerCase();"phong"===l?a="MeshPhongMaterial":"basic"===l&&(a="MeshBasicMaterial")}return void 0!==e.blending&&void 0!==THREE[e.blending]&&(s.blending=THREE[e.blending]),void 0!==e.transparent&&(s.transparent=e.transparent),void 0!==e.opacity&&1>e.opacity&&(s.transparent=!0),void 0!==e.depthTest&&(s.depthTest=e.depthTest),void 0!==e.depthWrite&&(s.depthWrite=e.depthWrite),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.flipSided&&(s.side=THREE.BackSide),void 0!==e.doubleSided&&(s.side=THREE.DoubleSide),void 0!==e.wireframe&&(s.wireframe=e.wireframe),void 0!==e.vertexColors&&("face"===e.vertexColors?s.vertexColors=THREE.FaceColors:e.vertexColors&&(s.vertexColors=THREE.VertexColors)),e.colorDiffuse?s.color=r(e.colorDiffuse):e.DbgColor&&(s.color=e.DbgColor),e.colorSpecular&&(s.specular=r(e.colorSpecular)),e.colorEmissive&&(s.emissive=r(e.colorEmissive)),void 0!==e.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),e.opacity=e.transparency),void 0!==e.opacity&&(s.opacity=e.opacity),e.specularCoef&&(s.shininess=e.specularCoef),e.mapDiffuse&&t&&i(s,"map",e.mapDiffuse,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy),e.mapLight&&t&&i(s,"lightMap",e.mapLight,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy),e.mapBump&&t&&i(s,"bumpMap",e.mapBump,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy),e.mapNormal&&t&&i(s,"normalMap",e.mapNormal,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy),e.mapSpecular&&t&&i(s,"specularMap",e.mapSpecular,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy),e.mapAlpha&&t&&i(s,"alphaMap",e.mapAlpha,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy),e.mapBumpScale&&(s.bumpScale=e.mapBumpScale),e.mapNormalFactor&&(s.normalScale=new THREE.Vector2(e.mapNormalFactor,e.mapNormalFactor)),a=new THREE[a](s),void 0!==e.DbgName&&(a.name=e.DbgName),a}},THREE.Loader.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=0,n=this.handlers.length;n>t;t+=2){var i=this.handlers[t+1];if(this.handlers[t].test(e))return i}return null}},THREE.XHRLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(e,t,n,i){var r=this,o=THREE.Cache.get(e);void 0!==o?t&&t(o):((o=new XMLHttpRequest).open("GET",e,!0),o.addEventListener("load",function(n){THREE.Cache.add(e,this.response),t&&t(this.response),r.manager.itemEnd(e)},!1),void 0!==n&&o.addEventListener("progress",function(e){n(e)},!1),void 0!==i&&o.addEventListener("error",function(e){i(e)},!1),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(o.responseType=this.responseType),o.send(null),r.manager.itemStart(e))},setResponseType:function(e){this.responseType=e},setCrossOrigin:function(e){this.crossOrigin=e}},THREE.ImageLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(e,t,n,i){var r=this,o=THREE.Cache.get(e);return void 0===o?((o=document.createElement("img")).addEventListener("load",function(n){THREE.Cache.add(e,this),t&&t(this),r.manager.itemEnd(e)},!1),void 0!==n&&o.addEventListener("progress",function(e){n(e)},!1),void 0!==i&&o.addEventListener("error",function(e){i(e)},!1),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.src=e,r.manager.itemStart(e),o):void t(o)},setCrossOrigin:function(e){this.crossOrigin=e}},THREE.JSONLoader=function(e){THREE.Loader.call(this,e),this.withCredentials=!1},THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype),THREE.JSONLoader.prototype.constructor=THREE.JSONLoader,THREE.JSONLoader.prototype.load=function(e,t,n){n=n&&"string"==typeof n?n:this.extractUrlBase(e),this.onLoadStart(),this.loadAjaxJSON(this,e,t,n)},THREE.JSONLoader.prototype.loadAjaxJSON=function(e,t,n,i,r){var o=new XMLHttpRequest,a=0;o.onreadystatechange=function(){if(o.readyState===o.DONE)if(200===o.status||0===o.status){if(o.responseText){var s=JSON.parse(o.responseText),l=s.metadata;if(void 0!==l){if("object"===l.type)return void THREE.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===l.type)return void THREE.error("THREE.JSONLoader: "+t+" seems to be a Scene. Use THREE.SceneLoader instead.")}s=e.parse(s,i),n(s.geometry,s.materials)}else THREE.error("THREE.JSONLoader: "+t+" seems to be unreachable or the file is empty.");e.onLoadComplete()}else THREE.error("THREE.JSONLoader: Couldn't load "+t+" ("+o.status+")");else o.readyState===o.LOADING?r&&(0===a&&(a=o.getResponseHeader("Content-Length")),r({total:a,loaded:o.responseText.length})):o.readyState===o.HEADERS_RECEIVED&&void 0!==r&&(a=o.getResponseHeader("Content-Length"))},o.open("GET",t,!0),o.withCredentials=this.withCredentials,o.send(null)},THREE.JSONLoader.prototype.parse=function(e,t){var n=new THREE.Geometry,i=void 0!==e.scale?1/e.scale:1;return function(t){var i,r,o,a,s,l,u,c,h,d,f,p,m,g=e.faces;l=e.vertices;var v=e.normals,E=e.colors,y=0;if(void 0!==e.uvs){for(i=0;i<e.uvs.length;i++)e.uvs[i].length&&y++;for(i=0;y>i;i++)n.faceVertexUvs[i]=[]}for(a=0,s=l.length;s>a;)(i=new THREE.Vector3).x=l[a++]*t,i.y=l[a++]*t,i.z=l[a++]*t,n.vertices.push(i);for(a=0,s=g.length;s>a;)if(h=1&(t=g[a++]),o=2&t,i=8&t,u=16&t,d=32&t,l=64&t,t&=128,h){if((h=new THREE.Face3).a=g[a],h.b=g[a+1],h.c=g[a+3],(f=new THREE.Face3).a=g[a+1],f.b=g[a+2],f.c=g[a+3],a+=4,o&&(o=g[a++],h.materialIndex=o,f.materialIndex=o),o=n.faces.length,i)for(i=0;y>i;i++)for(p=e.uvs[i],n.faceVertexUvs[i][o]=[],n.faceVertexUvs[i][o+1]=[],r=0;4>r;r++)m=p[2*(c=g[a++])],c=p[2*c+1],m=new THREE.Vector2(m,c),2!==r&&n.faceVertexUvs[i][o].push(m),0!==r&&n.faceVertexUvs[i][o+1].push(m);if(u&&(u=3*g[a++],h.normal.set(v[u++],v[u++],v[u]),f.normal.copy(h.normal)),d)for(i=0;4>i;i++)u=3*g[a++],d=new THREE.Vector3(v[u++],v[u++],v[u]),2!==i&&h.vertexNormals.push(d),0!==i&&f.vertexNormals.push(d);if(l&&(l=E[l=g[a++]],h.color.setHex(l),f.color.setHex(l)),t)for(i=0;4>i;i++)l=E[l=g[a++]],2!==i&&h.vertexColors.push(new THREE.Color(l)),0!==i&&f.vertexColors.push(new THREE.Color(l));n.faces.push(h),n.faces.push(f)}else{if((h=new THREE.Face3).a=g[a++],h.b=g[a++],h.c=g[a++],o&&(o=g[a++],h.materialIndex=o),o=n.faces.length,i)for(i=0;y>i;i++)for(p=e.uvs[i],n.faceVertexUvs[i][o]=[],r=0;3>r;r++)m=p[2*(c=g[a++])],c=p[2*c+1],m=new THREE.Vector2(m,c),n.faceVertexUvs[i][o].push(m);if(u&&(u=3*g[a++],h.normal.set(v[u++],v[u++],v[u])),d)for(i=0;3>i;i++)u=3*g[a++],d=new THREE.Vector3(v[u++],v[u++],v[u]),h.vertexNormals.push(d);if(l&&(l=g[a++],h.color.setHex(E[l])),t)for(i=0;3>i;i++)l=g[a++],h.vertexColors.push(new THREE.Color(E[l]));n.faces.push(h)}}(i),function(){var t=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var i=0,r=e.skinWeights.length;r>i;i+=t)n.skinWeights.push(new THREE.Vector4(e.skinWeights[i],t>1?e.skinWeights[i+1]:0,t>2?e.skinWeights[i+2]:0,t>3?e.skinWeights[i+3]:0));if(e.skinIndices)for(i=0,r=e.skinIndices.length;r>i;i+=t)n.skinIndices.push(new THREE.Vector4(e.skinIndices[i],t>1?e.skinIndices[i+1]:0,t>2?e.skinIndices[i+2]:0,t>3?e.skinIndices[i+3]:0));n.bones=e.bones,n.bones&&0<n.bones.length&&(n.skinWeights.length!==n.skinIndices.length||n.skinIndices.length!==n.vertices.length)&&THREE.warn("THREE.JSONLoader: When skinning, number of vertices ("+n.vertices.length+"), skinIndices ("+n.skinIndices.length+"), and skinWeights ("+n.skinWeights.length+") should match."),n.animation=e.animation,n.animations=e.animations}(),function(t){var i,r,o,a,s,l;if(void 0!==e.morphTargets)for(i=0,r=e.morphTargets.length;r>i;i++)for(n.morphTargets[i]={},n.morphTargets[i].name=e.morphTargets[i].name,n.morphTargets[i].vertices=[],s=n.morphTargets[i].vertices,o=0,a=(l=e.morphTargets[i].vertices).length;a>o;o+=3){var u=new THREE.Vector3;u.x=l[o]*t,u.y=l[o+1]*t,u.z=l[o+2]*t,s.push(u)}if(void 0!==e.morphColors)for(i=0,r=e.morphColors.length;r>i;i++)for(n.morphColors[i]={},n.morphColors[i].name=e.morphColors[i].name,n.morphColors[i].colors=[],a=n.morphColors[i].colors,t=0,o=(s=e.morphColors[i].colors).length;o>t;t+=3)(l=new THREE.Color(16755200)).setRGB(s[t],s[t+1],s[t+2]),a.push(l)}(i),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===e.materials||0===e.materials.length?{geometry:n}:(i=this.initMaterials(e.materials,t),this.needsTangents(i)&&n.computeTangents(),{geometry:n,materials:i})},THREE.LoadingManager=function(e,t,n){var i=this,r=0,o=0;this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++},this.itemEnd=function(e){r++,void 0!==i.onProgress&&i.onProgress(e,r,o),r===o&&void 0!==i.onLoad&&i.onLoad()}},THREE.DefaultLoadingManager=new THREE.LoadingManager,THREE.BufferGeometryLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(e,t,n,i){var r=this,o=new THREE.XHRLoader(r.manager);o.setCrossOrigin(this.crossOrigin),o.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t,n=new THREE.BufferGeometry,i=e.data.attributes;for(t in i){var r=i[t],o=new self[r.type](r.array);n.addAttribute(t,new THREE.BufferAttribute(o,r.itemSize))}return void 0!==(i=e.data.offsets)&&(n.offsets=JSON.parse(JSON.stringify(i))),void 0!==(e=e.data.boundingSphere)&&(i=new THREE.Vector3,void 0!==e.center&&i.fromArray(e.center),n.boundingSphere=new THREE.Sphere(i,e.radius)),n}},THREE.MaterialLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(e,t,n,i){var r=this,o=new THREE.XHRLoader(r.manager);o.setCrossOrigin(this.crossOrigin),o.load(e,function(e){t(r.parse(JSON.parse(e)))},n,i)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t=new THREE[e.type];if(void 0!==e.color&&t.color.setHex(e.color),void 0!==e.emissive&&t.emissive.setHex(e.emissive),void 0!==e.specular&&t.specular.setHex(e.specular),void 0!==e.shininess&&(t.shininess=e.shininess),void 0!==e.uniforms&&(t.uniforms=e.uniforms),void 0!==e.vertexShader&&(t.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(t.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(t.vertexColors=e.vertexColors),void 0!==e.shading&&(t.shading=e.shading),void 0!==e.blending&&(t.blending=e.blending),void 0!==e.side&&(t.side=e.side),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.transparent&&(t.transparent=e.transparent),void 0!==e.wireframe&&(t.wireframe=e.wireframe),void 0!==e.size&&(t.size=e.size),void 0!==e.sizeAttenuation&&(t.sizeAttenuation=e.sizeAttenuation),void 0!==e.materials)for(var n=0,i=e.materials.length;i>n;n++)t.materials.push(this.parse(e.materials[n]));return t}},THREE.ObjectLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager,this.texturePath=""},THREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(e,t,n,i){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var r=this,o=new THREE.XHRLoader(r.manager);o.setCrossOrigin(this.crossOrigin),o.load(e,function(e){r.parse(JSON.parse(e),t)},n,i)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var n=this.parseGeometries(e.geometries),i=this.parseImages(e.images,function(){void 0!==t&&t(r)}),r=(i=this.parseTextures(e.textures,i),i=this.parseMaterials(e.materials,i),this.parseObject(e.object,n,i));return void 0!==e.images&&0!==e.images.length||void 0===t||t(r),r},parseGeometries:function(e){var t={};if(void 0!==e)for(var n=new THREE.JSONLoader,i=new THREE.BufferGeometryLoader,r=0,o=e.length;o>r;r++){var a,s=e[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new THREE[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"CubeGeometry":a=new THREE.BoxGeometry(s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":a=new THREE.CircleGeometry(s.radius,s.segments);break;case"CylinderGeometry":a=new THREE.CylinderGeometry(s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded);break;case"SphereGeometry":a=new THREE.SphereGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"IcosahedronGeometry":a=new THREE.IcosahedronGeometry(s.radius,s.detail);break;case"TorusGeometry":a=new THREE.TorusGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":a=new THREE.TorusKnotGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.p,s.q,s.heightScale);break;case"BufferGeometry":a=i.parse(s);break;case"Geometry":a=n.parse(s.data).geometry}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),t[s.uuid]=a}return t},parseMaterials:function(e,t){var n={};if(void 0!==e)for(var i=function(e){return void 0===t[e]&&THREE.warn("THREE.ObjectLoader: Undefined texture",e),t[e]},r=new THREE.MaterialLoader,o=0,a=e.length;a>o;o++){var s=e[o],l=r.parse(s);l.uuid=s.uuid,void 0!==s.name&&(l.name=s.name),void 0!==s.map&&(l.map=i(s.map)),void 0!==s.bumpMap&&(l.bumpMap=i(s.bumpMap),s.bumpScale&&(l.bumpScale=new THREE.Vector2(s.bumpScale,s.bumpScale))),void 0!==s.alphaMap&&(l.alphaMap=i(s.alphaMap)),void 0!==s.envMap&&(l.envMap=i(s.envMap)),void 0!==s.normalMap&&(l.normalMap=i(s.normalMap),s.normalScale&&(l.normalScale=new THREE.Vector2(s.normalScale,s.normalScale))),void 0!==s.lightMap&&(l.lightMap=i(s.lightMap)),void 0!==s.specularMap&&(l.specularMap=i(s.specularMap)),n[s.uuid]=l}return n},parseImages:function(e,t){var n=this,i={};if(void 0!==e&&0<e.length){var r=new THREE.LoadingManager(t),o=new THREE.ImageLoader(r);o.setCrossOrigin(this.crossOrigin);r=function(e){return n.manager.itemStart(e),o.load(e,function(){n.manager.itemEnd(e)})};for(var a=0,s=e.length;s>a;a++){var l=e[a],u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.texturePath+l.url;i[l.uuid]=r(u)}}return i},parseTextures:function(e,t){var n={};if(void 0!==e)for(var i=0,r=e.length;r>i;i++){var o=e[i];void 0===o.image&&THREE.warn('THREE.ObjectLoader: No "image" speficied for',o.uuid),void 0===t[o.image]&&THREE.warn("THREE.ObjectLoader: Undefined image",o.image);var a=new THREE.Texture(t[o.image]);a.needsUpdate=!0,a.uuid=o.uuid,void 0!==o.name&&(a.name=o.name),void 0!==o.repeat&&(a.repeat=new THREE.Vector2(o.repeat[0],o.repeat[1])),void 0!==o.minFilter&&(a.minFilter=THREE[o.minFilter]),void 0!==o.magFilter&&(a.magFilter=THREE[o.magFilter]),void 0!==o.anisotropy&&(a.anisotropy=o.anisotropy),o.wrap instanceof Array&&(a.wrapS=THREE[o.wrap[0]],a.wrapT=THREE[o.wrap[1]]),n[o.uuid]=a}return n},parseObject:function(){var e=new THREE.Matrix4;return function(t,n,i){var r;r=function(e){return void 0===n[e]&&THREE.warn("THREE.ObjectLoader: Undefined geometry",e),n[e]};var o=function(e){return void 0===i[e]&&THREE.warn("THREE.ObjectLoader: Undefined material",e),i[e]};switch(t.type){case"Scene":r=new THREE.Scene;break;case"PerspectiveCamera":r=new THREE.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);break;case"OrthographicCamera":r=new THREE.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":r=new THREE.AmbientLight(t.color);break;case"DirectionalLight":r=new THREE.DirectionalLight(t.color,t.intensity);break;case"PointLight":r=new THREE.PointLight(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":r=new THREE.SpotLight(t.color,t.intensity,t.distance,t.angle,t.exponent,t.decay);break;case"HemisphereLight":r=new THREE.HemisphereLight(t.color,t.groundColor,t.intensity);break;case"Mesh":r=new THREE.Mesh(r(t.geometry),o(t.material));break;case"Line":r=new THREE.Line(r(t.geometry),o(t.material),t.mode);break;case"PointCloud":r=new THREE.PointCloud(r(t.geometry),o(t.material));break;case"Sprite":r=new THREE.Sprite(o(t.material));break;case"Group":r=new THREE.Group;break;default:r=new THREE.Object3D}if(r.uuid=t.uuid,void 0!==t.name&&(r.name=t.name),void 0!==t.matrix?(e.fromArray(t.matrix),e.decompose(r.position,r.quaternion,r.scale)):(void 0!==t.position&&r.position.fromArray(t.position),void 0!==t.rotation&&r.rotation.fromArray(t.rotation),void 0!==t.scale&&r.scale.fromArray(t.scale)),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.children)for(var a in t.children)r.add(this.parseObject(t.children[a],n,i));return r}}()},THREE.TextureLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(e,t,n,i){var r=new THREE.ImageLoader(this.manager);r.setCrossOrigin(this.crossOrigin),r.load(e,function(e){(e=new THREE.Texture(e)).needsUpdate=!0,void 0!==t&&t(e)},n,i)},setCrossOrigin:function(e){this.crossOrigin=e}},THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(){this._parser=null},THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(e,t,n,i){var r=this,o=new THREE.DataTexture,a=new THREE.XHRLoader;return a.setResponseType("arraybuffer"),a.load(e,function(e){(e=r._parser(e))&&(void 0!==e.image?o.image=e.image:void 0!==e.data&&(o.image.width=e.width,o.image.height=e.height,o.image.data=e.data),o.wrapS=void 0!==e.wrapS?e.wrapS:THREE.ClampToEdgeWrapping,o.wrapT=void 0!==e.wrapT?e.wrapT:THREE.ClampToEdgeWrapping,o.magFilter=void 0!==e.magFilter?e.magFilter:THREE.LinearFilter,o.minFilter=void 0!==e.minFilter?e.minFilter:THREE.LinearMipMapLinearFilter,o.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.format&&(o.format=e.format),void 0!==e.type&&(o.type=e.type),void 0!==e.mipmaps&&(o.mipmaps=e.mipmaps),1===e.mipmapCount&&(o.minFilter=THREE.LinearFilter),o.needsUpdate=!0,t&&t(o,e))},n,i),o}},THREE.CompressedTextureLoader=function(){this._parser=null},THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(e,t,n){var i=this,r=[],o=new THREE.CompressedTexture;o.image=r;var a=new THREE.XHRLoader;if(a.setResponseType("arraybuffer"),e instanceof Array){var s=0;n=function(n){a.load(e[n],function(e){e=i._parser(e,!0),r[n]={width:e.width,height:e.height,format:e.format,mipmaps:e.mipmaps},6===(s+=1)&&(1==e.mipmapCount&&(o.minFilter=THREE.LinearFilter),o.format=e.format,o.needsUpdate=!0,t&&t(o))})};for(var l=0,u=e.length;u>l;++l)n(l)}else a.load(e,function(e){if((e=i._parser(e,!0)).isCubemap)for(var n=e.mipmaps.length/e.mipmapCount,a=0;n>a;a++){r[a]={mipmaps:[]};for(var s=0;s<e.mipmapCount;s++)r[a].mipmaps.push(e.mipmaps[a*e.mipmapCount+s]),r[a].format=e.format,r[a].width=e.width,r[a].height=e.height}else o.image.width=e.width,o.image.height=e.height,o.mipmaps=e.mipmaps;1===e.mipmapCount&&(o.minFilter=THREE.LinearFilter),o.format=e.format,o.needsUpdate=!0,t&&t(o)});return o}},THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Material",this.side=THREE.FrontSide,this.opacity=1,this.transparent=!1,this.blending=THREE.NormalBlending,this.blendSrc=THREE.SrcAlphaFactor,this.blendDst=THREE.OneMinusSrcAlphaFactor,this.blendEquation=THREE.AddEquation,this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null,this.colorWrite=this.depthWrite=this.depthTest=!0,this.polygonOffset=!1,this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0,this._needsUpdate=this.visible=!0},THREE.Material.prototype={constructor:THREE.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(e){!0===e&&this.update(),this._needsUpdate=e},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0===n)THREE.warn("THREE.Material: '"+t+"' parameter is undefined.");else if(t in this){var i=this[t];i instanceof THREE.Color?i.set(n):i instanceof THREE.Vector3&&n instanceof THREE.Vector3?i.copy(n):this[t]="overdraw"==t?Number(n):n}}},toJSON:function(){var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};return""!==this.name&&(e.name=this.name),this instanceof THREE.MeshBasicMaterial?(e.color=this.color.getHex(),this.vertexColors!==THREE.NoColors&&(e.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&(e.blending=this.blending),this.side!==THREE.FrontSide&&(e.side=this.side)):this instanceof THREE.MeshLambertMaterial?(e.color=this.color.getHex(),e.emissive=this.emissive.getHex(),this.vertexColors!==THREE.NoColors&&(e.vertexColors=this.vertexColors),this.shading!==THREE.SmoothShading&&(e.shading=this.shading),this.blending!==THREE.NormalBlending&&(e.blending=this.blending),this.side!==THREE.FrontSide&&(e.side=this.side)):this instanceof THREE.MeshPhongMaterial?(e.color=this.color.getHex(),e.emissive=this.emissive.getHex(),e.specular=this.specular.getHex(),e.shininess=this.shininess,this.vertexColors!==THREE.NoColors&&(e.vertexColors=this.vertexColors),this.shading!==THREE.SmoothShading&&(e.shading=this.shading),this.blending!==THREE.NormalBlending&&(e.blending=this.blending),this.side!==THREE.FrontSide&&(e.side=this.side)):this instanceof THREE.MeshNormalMaterial?(this.blending!==THREE.NormalBlending&&(e.blending=this.blending),this.side!==THREE.FrontSide&&(e.side=this.side)):this instanceof THREE.MeshDepthMaterial?(this.blending!==THREE.NormalBlending&&(e.blending=this.blending),this.side!==THREE.FrontSide&&(e.side=this.side)):this instanceof THREE.PointCloudMaterial?(e.size=this.size,e.sizeAttenuation=this.sizeAttenuation,e.color=this.color.getHex(),this.vertexColors!==THREE.NoColors&&(e.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&(e.blending=this.blending)):this instanceof THREE.ShaderMaterial?(e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader):this instanceof THREE.SpriteMaterial&&(e.color=this.color.getHex()),1>this.opacity&&(e.opacity=this.opacity),!1!==this.transparent&&(e.transparent=this.transparent),!1!==this.wireframe&&(e.wireframe=this.wireframe),e},clone:function(e){return void 0===e&&(e=new THREE.Material),e.name=this.name,e.side=this.side,e.opacity=this.opacity,e.transparent=this.transparent,e.blending=this.blending,e.blendSrc=this.blendSrc,e.blendDst=this.blendDst,e.blendEquation=this.blendEquation,e.blendSrcAlpha=this.blendSrcAlpha,e.blendDstAlpha=this.blendDstAlpha,e.blendEquationAlpha=this.blendEquationAlpha,e.depthTest=this.depthTest,e.depthWrite=this.depthWrite,e.polygonOffset=this.polygonOffset,e.polygonOffsetFactor=this.polygonOffsetFactor,e.polygonOffsetUnits=this.polygonOffsetUnits,e.alphaTest=this.alphaTest,e.overdraw=this.overdraw,e.visible=this.visible,e},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Material.prototype),THREE.MaterialIdCount=0,THREE.LineBasicMaterial=function(e){THREE.Material.call(this),this.type="LineBasicMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(e)},THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial,THREE.LineBasicMaterial.prototype.clone=function(){var e=new THREE.LineBasicMaterial;return THREE.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.linewidth=this.linewidth,e.linecap=this.linecap,e.linejoin=this.linejoin,e.vertexColors=this.vertexColors,e.fog=this.fog,e},THREE.LineDashedMaterial=function(e){THREE.Material.call(this),this.type="LineDashedMaterial",this.color=new THREE.Color(16777215),this.scale=this.linewidth=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(e)},THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial,THREE.LineDashedMaterial.prototype.clone=function(){var e=new THREE.LineDashedMaterial;return THREE.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.linewidth=this.linewidth,e.scale=this.scale,e.dashSize=this.dashSize,e.gapSize=this.gapSize,e.vertexColors=this.vertexColors,e.fog=this.fog,e},THREE.MeshBasicMaterial=function(e){THREE.Material.call(this),this.type="MeshBasicMaterial",this.color=new THREE.Color(16777215),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphTargets=this.skinning=!1,this.setValues(e)},THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial,THREE.MeshBasicMaterial.prototype.clone=function(){var e=new THREE.MeshBasicMaterial;return THREE.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.alphaMap=this.alphaMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e},THREE.MeshLambertMaterial=function(e){THREE.Material.call(this),this.type="MeshLambertMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.wrapAround=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)},THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial,THREE.MeshLambertMaterial.prototype.clone=function(){var e=new THREE.MeshLambertMaterial;return THREE.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.alphaMap=this.alphaMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},THREE.MeshPhongMaterial=function(e){THREE.Material.call(this),this.type="MeshPhongMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.specular=new THREE.Color(1118481),this.shininess=30,this.wrapAround=this.metal=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.bumpMap=this.lightMap=this.map=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.envMap=this.alphaMap=this.specularMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)},THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial,THREE.MeshPhongMaterial.prototype.clone=function(){var e=new THREE.MeshPhongMaterial;return THREE.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.emissive.copy(this.emissive),e.specular.copy(this.specular),e.shininess=this.shininess,e.metal=this.metal,e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.bumpMap=this.bumpMap,e.bumpScale=this.bumpScale,e.normalMap=this.normalMap,e.normalScale.copy(this.normalScale),e.specularMap=this.specularMap,e.alphaMap=this.alphaMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},THREE.MeshDepthMaterial=function(e){THREE.Material.call(this),this.type="MeshDepthMaterial",this.wireframe=this.morphTargets=!1,this.wireframeLinewidth=1,this.setValues(e)},THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial,THREE.MeshDepthMaterial.prototype.clone=function(){var e=new THREE.MeshDepthMaterial;return THREE.Material.prototype.clone.call(this,e),e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e},THREE.MeshNormalMaterial=function(e){THREE.Material.call(this,e),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(e)},THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial,THREE.MeshNormalMaterial.prototype.clone=function(){var e=new THREE.MeshNormalMaterial;return THREE.Material.prototype.clone.call(this,e),e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e},THREE.MeshFaceMaterial=function(e){this.uuid=THREE.Math.generateUUID(),this.type="MeshFaceMaterial",this.materials=e instanceof Array?e:[]},THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},t=0,n=this.materials.length;n>t;t++)e.materials.push(this.materials[t].toJSON());return e},clone:function(){for(var e=new THREE.MeshFaceMaterial,t=0;t<this.materials.length;t++)e.materials.push(this.materials[t].clone());return e}},THREE.PointCloudMaterial=function(e){THREE.Material.call(this),this.type="PointCloudMaterial",this.color=new THREE.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(e)},THREE.PointCloudMaterial.prototype=Object.create(THREE.Material.prototype),THREE.PointCloudMaterial.prototype.constructor=THREE.PointCloudMaterial,THREE.PointCloudMaterial.prototype.clone=function(){var e=new THREE.PointCloudMaterial;return THREE.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.size=this.size,e.sizeAttenuation=this.sizeAttenuation,e.vertexColors=this.vertexColors,e.fog=this.fog,e},THREE.ParticleBasicMaterial=function(e){return THREE.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial."),new THREE.PointCloudMaterial(e)},THREE.ParticleSystemMaterial=function(e){return THREE.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial."),new THREE.PointCloudMaterial(e)},THREE.ShaderMaterial=function(e){THREE.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.attributes=null,this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.shading=THREE.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.lights=this.fog=!1,this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.setValues(e)},THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype),THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial,THREE.ShaderMaterial.prototype.clone=function(){var e=new THREE.ShaderMaterial;return THREE.Material.prototype.clone.call(this,e),e.fragmentShader=this.fragmentShader,e.vertexShader=this.vertexShader,e.uniforms=THREE.UniformsUtils.clone(this.uniforms),e.attributes=this.attributes,e.defines=this.defines,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.fog=this.fog,e.lights=this.lights,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},THREE.RawShaderMaterial=function(e){THREE.ShaderMaterial.call(this,e),this.type="RawShaderMaterial"},THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype),THREE.RawShaderMaterial.prototype.constructor=THREE.RawShaderMaterial,THREE.RawShaderMaterial.prototype.clone=function(){var e=new THREE.RawShaderMaterial;return THREE.ShaderMaterial.prototype.clone.call(this,e),e},THREE.SpriteMaterial=function(e){THREE.Material.call(this),this.type="SpriteMaterial",this.color=new THREE.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(e)},THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype),THREE.SpriteMaterial.prototype.constructor=THREE.SpriteMaterial,THREE.SpriteMaterial.prototype.clone=function(){var e=new THREE.SpriteMaterial;return THREE.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.rotation=this.rotation,e.fog=this.fog,e},THREE.Texture=function(e,t,n,i,r,o,a,s,l){Object.defineProperty(this,"id",{value:THREE.TextureIdCount++}),this.uuid=THREE.Math.generateUUID(),this.sourceFile=this.name="",this.image=void 0!==e?e:THREE.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:THREE.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==i?i:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==r?r:THREE.LinearFilter,this.minFilter=void 0!==o?o:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==l?l:1,this.format=void 0!==a?a:THREE.RGBAFormat,this.type=void 0!==s?s:THREE.UnsignedByteType,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this._needsUpdate=!1,this.onUpdate=null},THREE.Texture.DEFAULT_IMAGE=void 0,THREE.Texture.DEFAULT_MAPPING=THREE.UVMapping,THREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(e){!0===e&&this.update(),this._needsUpdate=e},clone:function(e){return void 0===e&&(e=new THREE.Texture),e.image=this.image,e.mipmaps=this.mipmaps.slice(0),e.mapping=this.mapping,e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.format=this.format,e.type=this.type,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.generateMipmaps=this.generateMipmaps,e.premultiplyAlpha=this.premultiplyAlpha,e.flipY=this.flipY,e.unpackAlignment=this.unpackAlignment,e},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype),THREE.TextureIdCount=0,THREE.CubeTexture=function(e,t,n,i,r,o,a,s,l){t=void 0!==t?t:THREE.CubeReflectionMapping,THREE.Texture.call(this,e,t,n,i,r,o,a,s,l),this.images=e},THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CubeTexture.prototype.constructor=THREE.CubeTexture,THREE.CubeTexture.clone=function(e){return void 0===e&&(e=new THREE.CubeTexture),THREE.Texture.prototype.clone.call(this,e),e.images=this.images,e},THREE.CompressedTexture=function(e,t,n,i,r,o,a,s,l,u,c){THREE.Texture.call(this,null,o,a,s,l,u,i,r,c),this.image={width:t,height:n},this.mipmaps=e,this.generateMipmaps=this.flipY=!1},THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture,THREE.CompressedTexture.prototype.clone=function(){var e=new THREE.CompressedTexture;return THREE.Texture.prototype.clone.call(this,e),e},THREE.DataTexture=function(e,t,n,i,r,o,a,s,l,u,c){THREE.Texture.call(this,null,o,a,s,l,u,i,r,c),this.image={data:e,width:t,height:n}},THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype),THREE.DataTexture.prototype.constructor=THREE.DataTexture,THREE.DataTexture.prototype.clone=function(){var e=new THREE.DataTexture;return THREE.Texture.prototype.clone.call(this,e),e},THREE.VideoTexture=function(e,t,n,i,r,o,a,s,l){THREE.Texture.call(this,e,t,n,i,r,o,a,s,l),this.generateMipmaps=!1;var u=this,c=function(){requestAnimationFrame(c),e.readyState===e.HAVE_ENOUGH_DATA&&(u.needsUpdate=!0)};c()},THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype),THREE.VideoTexture.prototype.constructor=THREE.VideoTexture,THREE.Group=function(){THREE.Object3D.call(this),this.type="Group"},THREE.Group.prototype=Object.create(THREE.Object3D.prototype),THREE.Group.prototype.constructor=THREE.Group,THREE.PointCloud=function(e,t){THREE.Object3D.call(this),this.type="PointCloud",this.geometry=void 0!==e?e:new THREE.Geometry,this.material=void 0!==t?t:new THREE.PointCloudMaterial({color:16777215*Math.random()})},THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype),THREE.PointCloud.prototype.constructor=THREE.PointCloud,THREE.PointCloud.prototype.raycast=function(){var e=new THREE.Matrix4,t=new THREE.Ray;return function(n,i){var r=this,o=r.geometry,a=n.params.PointCloud.threshold;if(e.getInverse(this.matrixWorld),t.copy(n.ray).applyMatrix4(e),null===o.boundingBox||!1!==t.isIntersectionBox(o.boundingBox)){var s=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=new THREE.Vector3;a=function(e,o){var a=t.distanceToPoint(e);if(s>a){var l=t.closestPointToPoint(e);l.applyMatrix4(r.matrixWorld);var u=n.ray.origin.distanceTo(l);i.push({distance:u,distanceToRay:a,point:l.clone(),index:o,face:null,object:r})}};if(o instanceof THREE.BufferGeometry){var u=(c=o.attributes).position.array;if(void 0!==c.index){var c=c.index.array,h=o.offsets;0===h.length&&(h=[{start:0,count:c.length,index:0}]);for(var d=0,f=h.length;f>d;++d){var p=h[d].start,m=h[d].index;for(o=p,p=p+h[d].count;p>o;o++){var g=m+c[o];l.fromArray(u,3*g),a(l,g)}}}else for(c=u.length/3,o=0;c>o;o++)l.set(u[3*o],u[3*o+1],u[3*o+2]),a(l,o)}else for(l=this.geometry.vertices,o=0;o<l.length;o++)a(l[o],o)}}}(),THREE.PointCloud.prototype.clone=function(e){return void 0===e&&(e=new THREE.PointCloud(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,e),e},THREE.ParticleSystem=function(e,t){return THREE.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud."),new THREE.PointCloud(e,t)},THREE.Line=function(e,t,n){THREE.Object3D.call(this),this.type="Line",this.geometry=void 0!==e?e:new THREE.Geometry,this.material=void 0!==t?t:new THREE.LineBasicMaterial({color:16777215*Math.random()}),this.mode=void 0!==n?n:THREE.LineStrip},THREE.LineStrip=0,THREE.LinePieces=1,THREE.Line.prototype=Object.create(THREE.Object3D.prototype),THREE.Line.prototype.constructor=THREE.Line,THREE.Line.prototype.raycast=function(){var e=new THREE.Matrix4,t=new THREE.Ray,n=new THREE.Sphere;return function(i,r){var o=(o=i.linePrecision)*o;if(null===(E=this.geometry).boundingSphere&&E.computeBoundingSphere(),n.copy(E.boundingSphere),n.applyMatrix4(this.matrixWorld),!1!==i.ray.isIntersectionSphere(n)){e.getInverse(this.matrixWorld),t.copy(i.ray).applyMatrix4(e);var a=new THREE.Vector3,s=new THREE.Vector3,l=new THREE.Vector3,u=new THREE.Vector3,c=this.mode===THREE.LineStrip?1:2;if(E instanceof THREE.BufferGeometry)if(void 0!==(d=E.attributes).index){var h=d.index.array,d=d.position.array,f=E.offsets;0===f.length&&(f=[{start:0,count:h.length,index:0}]);for(var p=0;p<f.length;p++)for(var m=f[p].start,g=f[p].count,v=f[p].index,E=m;m+g-1>E;E+=c){var y=v+h[E+1];a.fromArray(d,3*(v+h[E])),s.fromArray(d,3*y),(y=t.distanceSqToSegment(a,s,u,l))>o||((y=t.origin.distanceTo(u))<i.near||y>i.far||r.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:E,offsetIndex:p,face:null,faceIndex:null,object:this}))}}else for(d=d.position.array,E=0;E<d.length/3-1;E+=c)a.fromArray(d,3*E),s.fromArray(d,3*E+3),(y=t.distanceSqToSegment(a,s,u,l))>o||((y=t.origin.distanceTo(u))<i.near||y>i.far||r.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this}));else if(E instanceof THREE.Geometry)for(s=(a=E.vertices).length,E=0;s-1>E;E+=c)(y=t.distanceSqToSegment(a[E],a[E+1],u,l))>o||((y=t.origin.distanceTo(u))<i.near||y>i.far||r.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this}))}}}(),THREE.Line.prototype.clone=function(e){return void 0===e&&(e=new THREE.Line(this.geometry,this.material,this.mode)),THREE.Object3D.prototype.clone.call(this,e),e},THREE.Mesh=function(e,t){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new THREE.Geometry,this.material=void 0!==t?t:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1,this.morphTargetForcedOrder=[],this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=this.geometry.morphTargets.length;t>e;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=e}},THREE.Mesh.prototype.getMorphTargetIndexByName=function(e){return void 0!==this.morphTargetDictionary[e]?this.morphTargetDictionary[e]:(THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+e+" does not exist. Returning 0."),0)},THREE.Mesh.prototype.raycast=function(){var e=new THREE.Matrix4,t=new THREE.Ray,n=new THREE.Sphere,i=new THREE.Vector3,r=new THREE.Vector3,o=new THREE.Vector3;return function(a,s){if(null===(y=this.geometry).boundingSphere&&y.computeBoundingSphere(),n.copy(y.boundingSphere),n.applyMatrix4(this.matrixWorld),!1!==a.ray.isIntersectionSphere(n)&&(e.getInverse(this.matrixWorld),t.copy(a.ray).applyMatrix4(e),null===y.boundingBox||!1!==t.isIntersectionBox(y.boundingBox)))if(y instanceof THREE.BufferGeometry){var l=this.material;if(void 0!==l){var u,c,h=y.attributes,d=a.precision;if(void 0!==h.index){var f=h.index.array,p=h.position.array,m=y.offsets;0===m.length&&(m=[{start:0,count:f.length,index:0}]);for(var g=0,v=m.length;v>g;++g){h=m[g].start;for(var E=m[g].index,y=h,_=h+m[g].count;_>y;y+=3){h=E+f[y],u=E+f[y+1],c=E+f[y+2],i.fromArray(p,3*h),r.fromArray(p,3*u),o.fromArray(p,3*c);var T=l.side===THREE.BackSide?t.intersectTriangle(o,r,i,!0):t.intersectTriangle(i,r,o,l.side!==THREE.DoubleSide);if(null!==T){T.applyMatrix4(this.matrixWorld);var b=a.ray.origin.distanceTo(T);d>b||b<a.near||b>a.far||s.push({distance:b,point:T,face:new THREE.Face3(h,u,c,THREE.Triangle.normal(i,r,o)),faceIndex:null,object:this})}}}}else for(f=y=0,_=(p=h.position.array).length;_>y;y+=3,f+=9)h=y,u=y+1,c=y+2,i.fromArray(p,f),r.fromArray(p,f+3),o.fromArray(p,f+6),null!==(T=l.side===THREE.BackSide?t.intersectTriangle(o,r,i,!0):t.intersectTriangle(i,r,o,l.side!==THREE.DoubleSide))&&(T.applyMatrix4(this.matrixWorld),d>(b=a.ray.origin.distanceTo(T))||b<a.near||b>a.far||s.push({distance:b,point:T,face:new THREE.Face3(h,u,c,THREE.Triangle.normal(i,r,o)),faceIndex:null,object:this}))}}else if(y instanceof THREE.Geometry)for(p=!0===(f=this.material instanceof THREE.MeshFaceMaterial)?this.material.materials:null,d=a.precision,m=y.vertices,g=0,v=y.faces.length;v>g;g++)if(E=y.faces[g],void 0!==(l=!0===f?p[E.materialIndex]:this.material)){if(h=m[E.a],u=m[E.b],c=m[E.c],!0===l.morphTargets){T=y.morphTargets,b=this.morphTargetInfluences,i.set(0,0,0),r.set(0,0,0),o.set(0,0,0);_=0;for(var w=T.length;w>_;_++){var x=b[_];if(0!==x){var R=T[_].vertices;i.x+=(R[E.a].x-h.x)*x,i.y+=(R[E.a].y-h.y)*x,i.z+=(R[E.a].z-h.z)*x,r.x+=(R[E.b].x-u.x)*x,r.y+=(R[E.b].y-u.y)*x,r.z+=(R[E.b].z-u.z)*x,o.x+=(R[E.c].x-c.x)*x,o.y+=(R[E.c].y-c.y)*x,o.z+=(R[E.c].z-c.z)*x}}i.add(h),r.add(u),o.add(c),h=i,u=r,c=o}null!==(T=l.side===THREE.BackSide?t.intersectTriangle(c,u,h,!0):t.intersectTriangle(h,u,c,l.side!==THREE.DoubleSide))&&(T.applyMatrix4(this.matrixWorld),d>(b=a.ray.origin.distanceTo(T))||b<a.near||b>a.far||s.push({distance:b,point:T,face:E,faceIndex:g,object:this}))}}}(),THREE.Mesh.prototype.clone=function(e,t){return void 0===e&&(e=new THREE.Mesh(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,e,t),e},THREE.Bone=function(e){THREE.Object3D.call(this),this.type="Bone",this.skin=e},THREE.Bone.prototype=Object.create(THREE.Object3D.prototype),THREE.Bone.prototype.constructor=THREE.Bone,THREE.Skeleton=function(e,t,n){if(this.useVertexTexture=void 0===n||n,this.identityMatrix=new THREE.Matrix4,e=e||[],this.bones=e.slice(0),this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=e=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else for(THREE.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],t=0,e=this.bones.length;e>t;t++)this.boneInverses.push(new THREE.Matrix4)},THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var e=0,t=this.bones.length;t>e;e++){var n=new THREE.Matrix4;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},THREE.Skeleton.prototype.pose=function(){for(var e,t=0,n=this.bones.length;n>t;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;n>t;t++)(e=this.bones[t])&&(e.parent?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},THREE.Skeleton.prototype.update=function(){var e=new THREE.Matrix4;return function(){for(var t=0,n=this.bones.length;n>t;t++)e.multiplyMatrices(this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix,this.boneInverses[t]),e.flattenToArrayOffset(this.boneMatrices,16*t);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),THREE.SkinnedMesh=function(e,t,n){if(THREE.Mesh.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new THREE.Matrix4,this.bindMatrixInverse=new THREE.Matrix4,e=[],this.geometry&&void 0!==this.geometry.bones){for(var i,r,o,a,s=0,l=this.geometry.bones.length;l>s;++s)r=(i=this.geometry.bones[s]).pos,o=i.rotq,a=i.scl,t=new THREE.Bone(this),e.push(t),t.name=i.name,t.position.set(r[0],r[1],r[2]),t.quaternion.set(o[0],o[1],o[2],o[3]),void 0!==a?t.scale.set(a[0],a[1],a[2]):t.scale.set(1,1,1);for(s=0,l=this.geometry.bones.length;l>s;++s)-1!==(i=this.geometry.bones[s]).parent?e[i.parent].add(e[s]):this.add(e[s])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new THREE.Skeleton(e,void 0,n))},THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh,THREE.SkinnedMesh.prototype.bind=function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},THREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(var e=0;e<this.geometry.skinIndices.length;e++){var t=this.geometry.skinWeights[e],n=1/t.lengthManhattan();1/0!==n?t.multiplyScalar(n):t.set(1)}},THREE.SkinnedMesh.prototype.updateMatrixWorld=function(e){THREE.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):THREE.warn("THREE.SkinnedMesh unreckognized bindMode: "+this.bindMode)},THREE.SkinnedMesh.prototype.clone=function(e){return void 0===e&&(e=new THREE.SkinnedMesh(this.geometry,this.material,this.useVertexTexture)),THREE.Mesh.prototype.clone.call(this,e),e},THREE.MorphAnimMesh=function(e,t){THREE.Mesh.call(this,e,t),this.type="MorphAnimMesh",this.duration=1e3,this.mirroredLoop=!1,this.currentKeyframe=this.lastKeyframe=this.time=0,this.direction=1,this.directionBackwards=!1,this.setFrameRange(0,this.geometry.morphTargets.length-1)},THREE.MorphAnimMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphAnimMesh.prototype.constructor=THREE.MorphAnimMesh,THREE.MorphAnimMesh.prototype.setFrameRange=function(e,t){this.startKeyframe=e,this.endKeyframe=t,this.length=this.endKeyframe-this.startKeyframe+1},THREE.MorphAnimMesh.prototype.setDirectionForward=function(){this.direction=1,this.directionBackwards=!1},THREE.MorphAnimMesh.prototype.setDirectionBackward=function(){this.direction=-1,this.directionBackwards=!0},THREE.MorphAnimMesh.prototype.parseAnimations=function(){var e=this.geometry;e.animations||(e.animations={});for(var t,n=e.animations,i=/([a-z]+)_?(\d+)/,r=0,o=e.morphTargets.length;o>r;r++){var a=e.morphTargets[r].name.match(i);if(a&&1<a.length){n[a=a[1]]||(n[a]={start:1/0,end:-1/0});var s=n[a];r<s.start&&(s.start=r),r>s.end&&(s.end=r),t||(t=a)}}e.firstAnimation=t},THREE.MorphAnimMesh.prototype.setAnimationLabel=function(e,t,n){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[e]={start:t,end:n}},THREE.MorphAnimMesh.prototype.playAnimation=function(e,t){var n=this.geometry.animations[e];n?(this.setFrameRange(n.start,n.end),this.duration=(n.end-n.start)/t*1e3,this.time=0):THREE.warn("THREE.MorphAnimMesh: animation["+e+"] undefined in .playAnimation()")},THREE.MorphAnimMesh.prototype.updateAnimation=function(e){var t=this.duration/this.length;this.time+=this.direction*e,this.mirroredLoop?(this.time>this.duration||0>this.time)&&(this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)):(this.time%=this.duration,0>this.time&&(this.time+=this.duration)),(e=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/t),0,this.length-1))!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[e]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=e),t=this.time%t/t,this.directionBackwards&&(t=1-t),this.morphTargetInfluences[this.currentKeyframe]=t,this.morphTargetInfluences[this.lastKeyframe]=1-t},THREE.MorphAnimMesh.prototype.interpolateTargets=function(e,t,n){for(var i=this.morphTargetInfluences,r=0,o=i.length;o>r;r++)i[r]=0;e>-1&&(i[e]=1-n),t>-1&&(i[t]=n)},THREE.MorphAnimMesh.prototype.clone=function(e){return void 0===e&&(e=new THREE.MorphAnimMesh(this.geometry,this.material)),e.duration=this.duration,e.mirroredLoop=this.mirroredLoop,e.time=this.time,e.lastKeyframe=this.lastKeyframe,e.currentKeyframe=this.currentKeyframe,e.direction=this.direction,e.directionBackwards=this.directionBackwards,THREE.Mesh.prototype.clone.call(this,e),e},THREE.LOD=function(){THREE.Object3D.call(this),this.objects=[]},THREE.LOD.prototype=Object.create(THREE.Object3D.prototype),THREE.LOD.prototype.constructor=THREE.LOD,THREE.LOD.prototype.addLevel=function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=0;n<this.objects.length&&!(t<this.objects[n].distance);n++);this.objects.splice(n,0,{distance:t,object:e}),this.add(e)},THREE.LOD.prototype.getObjectForDistance=function(e){for(var t=1,n=this.objects.length;n>t&&!(e<this.objects[t].distance);t++);return this.objects[t-1].object},THREE.LOD.prototype.raycast=function(){var e=new THREE.Vector3;return function(t,n){e.setFromMatrixPosition(this.matrixWorld);var i=t.ray.origin.distanceTo(e);this.getObjectForDistance(i).raycast(t,n)}}(),THREE.LOD.prototype.update=function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(n){if(1<this.objects.length){e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(this.matrixWorld),n=e.distanceTo(t),this.objects[0].object.visible=!0;for(var i=1,r=this.objects.length;r>i&&n>=this.objects[i].distance;i++)this.objects[i-1].object.visible=!1,this.objects[i].object.visible=!0;for(;r>i;i++)this.objects[i].object.visible=!1}}}(),THREE.LOD.prototype.clone=function(e){void 0===e&&(e=new THREE.LOD),THREE.Object3D.prototype.clone.call(this,e);for(var t=0,n=this.objects.length;n>t;t++){var i=this.objects[t].object.clone();i.visible=0===t,e.addLevel(i,this.objects[t].distance)}return e},THREE.Sprite=function(){var e=new Uint16Array([0,1,2,0,2,3]),t=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),n=new Float32Array([0,0,1,0,1,1,0,1]),i=new THREE.BufferGeometry;return i.addAttribute("index",new THREE.BufferAttribute(e,1)),i.addAttribute("position",new THREE.BufferAttribute(t,3)),i.addAttribute("uv",new THREE.BufferAttribute(n,2)),function(e){THREE.Object3D.call(this),this.type="Sprite",this.geometry=i,this.material=void 0!==e?e:new THREE.SpriteMaterial}}(),THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype),THREE.Sprite.prototype.constructor=THREE.Sprite,THREE.Sprite.prototype.raycast=function(){var e=new THREE.Vector3;return function(t,n){e.setFromMatrixPosition(this.matrixWorld);var i=t.ray.distanceToPoint(e);i>this.scale.x||n.push({distance:i,point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(e){return void 0===e&&(e=new THREE.Sprite(this.material)),THREE.Object3D.prototype.clone.call(this,e),e},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(e,t,n,i,r){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,n,i,r)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(e,t,n,i,r,o){void 0===t&&(t=-1),void 0===n&&(n=0),void 0===o&&(o=1),void 0===r&&(r=new THREE.Color(16777215)),void 0===i&&(i=THREE.NormalBlending),n=Math.min(n,Math.max(0,n)),this.lensFlares.push({texture:e,size:t,distance:n,x:0,y:0,z:0,scale:1,rotation:1,opacity:o,color:r,blending:i})},THREE.LensFlare.prototype.updateLensFlares=function(){var e,t,n=this.lensFlares.length,i=2*-this.positionScreen.x,r=2*-this.positionScreen.y;for(e=0;n>e;e++)(t=this.lensFlares[e]).x=this.positionScreen.x+i*t.distance,t.y=this.positionScreen.y+r*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=.25*(t.wantedRotation-t.rotation)},THREE.Scene=function(){THREE.Object3D.call(this),this.type="Scene",this.overrideMaterial=this.fog=null,this.autoUpdate=!0},THREE.Scene.prototype=Object.create(THREE.Object3D.prototype),THREE.Scene.prototype.constructor=THREE.Scene,THREE.Scene.prototype.clone=function(e){return void 0===e&&(e=new THREE.Scene),THREE.Object3D.prototype.clone.call(this,e),null!==this.fog&&(e.fog=this.fog.clone()),null!==this.overrideMaterial&&(e.overrideMaterial=this.overrideMaterial.clone()),e.autoUpdate=this.autoUpdate,e.matrixAutoUpdate=this.matrixAutoUpdate,e},THREE.Fog=function(e,t,n){this.name="",this.color=new THREE.Color(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3},THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)},THREE.FogExp2=function(e,t){this.name="",this.color=new THREE.Color(e),this.density=void 0!==t?t:25e-5},THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)},THREE.ShaderChunk={},THREE.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\nfloat square( in float a ) { return a*a; }\nvec2  square( in vec2 a )  { return vec2( a.x*a.x, a.y*a.y ); }\nvec3  square( in vec3 a )  { return vec3( a.x*a.x, a.y*a.y, a.z*a.z ); }\nvec4  square( in vec4 a )  { return vec4( a.x*a.x, a.y*a.y, a.z*a.z, a.w*a.w ); }\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nvec2  saturate( in vec2 a )  { return clamp( a, 0.0, 1.0 ); }\nvec3  saturate( in vec3 a )  { return clamp( a, 0.0, 1.0 ); }\nvec4  saturate( in vec4 a )  { return clamp( a, 0.0, 1.0 ); }\nfloat average( in float a ) { return a; }\nfloat average( in vec2 a )  { return ( a.x + a.y) * 0.5; }\nfloat average( in vec3 a )  { return ( a.x + a.y + a.z) / 3.0; }\nfloat average( in vec4 a )  { return ( a.x + a.y + a.z + a.w) * 0.25; }\nfloat whiteCompliment( in float a ) { return saturate( 1.0 - a ); }\nvec2  whiteCompliment( in vec2 a )  { return saturate( vec2(1.0) - a ); }\nvec3  whiteCompliment( in vec3 a )  { return saturate( vec3(1.0) - a ); }\nvec4  whiteCompliment( in vec4 a )  { return saturate( vec4(1.0) - a ); }\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n}\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n\treturn normalize( ( vec4( normal, 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 point - distance * planeNormal;\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 pointOnLine + lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) );\n}\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n\tif ( decayExponent > 0.0 ) {\n\t  return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n\t}\n\treturn 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n\treturn pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\n",THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * attenuation;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * attenuation;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * attenuation * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * attenuation * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront += ambientLightColor;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack += ambientLightColor;\n\n#endif\n",THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n\n#endif\n",THREE.ShaderChunk.default_vertex="#ifdef USE_SKINNING\n\n\tvec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n\tvec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif",THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\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\n\t#ifdef USE_MORPHNORMALS\n\n\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n\t#else\n\n\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif",THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\n#endif",THREE.ShaderChunk.lights_phong_fragment="#ifndef FLAT_SHADED\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n\t#endif\n\n#else\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += pointLightColor[ i ] * pointDiffuseWeight * attenuation;\n\n\t\t\t\t// specular\n\n\t\tvec3 pointHalfVector = normalize( lVector + viewPosition );\n\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * attenuation * specularNormalization;\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\t// diffuse\n\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n\t\t\t#else\n\n\t\t\t\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t\t#endif\n\n\t\t\ttotalDiffuseLight += spotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n\n\t\t\t// specular\n\n\t\t\tvec3 spotHalfVector = normalize( lVector + viewPosition );\n\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\ttotalSpecularLight += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, dirVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += directionalLightColor[ i ] * dirDiffuseWeight;\n\n\t\t// specular\n\n\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n\t\t/*\n\t\t// fresnel term from skin shader\n\t\tconst float F0 = 0.128;\n\n\t\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\n\t\tfloat exponential = pow( base, 5.0 );\n\n\t\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\n\t\t*/\n\n\t\t/*\n\t\t// fresnel term from fresnel shader\n\t\tconst float mFresnelBias = 0.08;\n\t\tconst float mFresnelScale = 0.3;\n\t\tconst float mFresnelPower = 5.0;\n\n\t\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n\t\t*/\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t// \t\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\ttotalDiffuseLight += hemiColor;\n\n\t\t// specular (sky light)\n\n\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n\t\t// specular (ground light)\n\n\t\tvec3 lVectorGround = -lVector;\n\n\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n\t}\n\n#endif\n\n#ifdef METAL\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) * specular + totalSpecularLight + emissive;\n\n#else\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) + totalSpecularLight + emissive;\n\n#endif\n",THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n\tvec3 morphedNormal = vec3( 0.0 );\n\n\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n\tmorphedNormal += normal;\n\n#endif",THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n",THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\tuniform sampler2D lightMap;\n\n#endif",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif",THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor.xyz = inputToLinear( texelColor.xyz );\n\n\tdiffuseColor *= texelColor;\n\n#endif",THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n\tvUv2 = uv2;\n\n#endif",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n\tvColor.xyz = inputToLinear( color.xyz );\n\n#endif",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n\t#ifdef USE_MORPHTARGETS\n\n\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned  = bindMatrixInverse * skinned;\n\n#endif\n",THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\n#endif\n",THREE.ShaderChunk.linear_to_gamma_fragment="\n\toutgoingLight = linearToOutput( outgoingLight );\n",THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif",THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n",THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n",THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\n\tenvColor.xyz = inputToLinear( envColor.xyz );\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif",THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif",THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif",THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif",THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );\n\t\tfogFactor = whiteCompliment( fogFactor );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\toutgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\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\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",THREE.ShaderChunk.defaultnormal_vertex="#ifdef USE_SKINNING\n\n\tvec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n\tvec3 objectNormal = morphedNormal;\n\n#else\n\n\tvec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n",THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\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\n#endif",THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\toutgoingLight *= diffuseColor.xyz * texture2D( lightMap, vUv2 ).xyz;\n\n#endif",THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif",THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif",THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif",THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvec3 worldNormal = transformDirection( objectNormal, modelMatrix );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t#else\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\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\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t// NOTE: I am unsure if this is correct in linear space.  -bhouston, Dec 29, 2014\n\tshadowColor = inputToLinear( shadowColor );\n\n\toutgoingLight = outgoingLight * shadowColor;\n\n#endif\n",THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#elif defined( USE_MORPHTARGETS )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif",THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\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\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif",THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",THREE.UniformsUtils={merge:function(e){for(var t={},n=0;n<e.length;n++){var i,r=this.clone(e[n]);for(i in r)t[i]=r[i]}return t},clone:function(e){var t,n={};for(t in e)for(var i in n[t]={},e[t]){var r=e[t][i];n[t][i]=r instanceof THREE.Color||r instanceof THREE.Vector2||r instanceof THREE.Vector3||r instanceof THREE.Vector4||r instanceof THREE.Matrix4||r instanceof THREE.Texture?r.clone():r instanceof Array?r.slice():r}return n}},THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:null},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98},morphTargetInfluences:{type:"f",value:0}},bump:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},fog:{fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",value:[]},hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},pointLightDecay:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]},spotLightDecay:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:[]},shadowMapSize:{type:"v2v",value:[]},shadowBias:{type:"fv1",value:[]},shadowDarkness:{type:"fv1",value:[]},shadowMatrix:{type:"m4v",value:[]}}},THREE.ShaderLib={basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.shadowmap]),vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinbase_vertex,"\t#ifdef USE_ENVMAP",THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,"\t#endif",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{emissive:{type:"c",value:new THREE.Color(0)},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),vertexShader:["#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_lambert_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_lambert_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,"\t#ifdef DOUBLE_SIDED\n\t\tif ( gl_FrontFacing )\n\t\t\toutgoingLight += diffuseColor.rgb * vLightFront + emissive;\n\t\telse\n\t\t\toutgoingLight += diffuseColor.rgb * vLightBack + emissive;\n\t#else\n\t\toutgoingLight += diffuseColor.rgb * vLightFront + emissive;\n\t#endif",THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.bump,THREE.UniformsLib.normalmap,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{emissive:{type:"c",value:new THREE.Color(0)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),vertexShader:["#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_phong_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"\tvViewPosition = -mvPosition.xyz;",THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_phong_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_phong_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.bumpmap_pars_fragment,THREE.ShaderChunk.normalmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,THREE.ShaderChunk.lights_phong_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\tgl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( psColor, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphatest_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},dashed:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,{scale:{type:"f",value:1},dashSize:{type:"f",value:1},totalSize:{type:"f",value:2}}]),vertexShader:["uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}},THREE.WebGLRenderer=function(e){function t(e){var t=e.geometry;e=e.material;var n=t.vertices.length;if(e.attributes)for(var i in void 0===t.__webglCustomAttributesList&&(t.__webglCustomAttributesList=[]),e.attributes){var r=e.attributes[i];if(!r.__webglInitialized||r.createUniqueBuffers){r.__webglInitialized=!0;var o=1;"v2"===r.type?o=2:"v3"===r.type?o=3:"v4"===r.type?o=4:"c"===r.type&&(o=3),r.size=o,r.array=new Float32Array(n*o),r.buffer=q.createBuffer(),r.buffer.belongsToAttribute=i,r.needsUpdate=!0}t.__webglCustomAttributesList.push(r)}}function n(e,t){return e.material instanceof THREE.MeshFaceMaterial?e.material.materials[t.materialIndex]:e.material}function i(e,t,n,i){n=n.attributes;for(var r=t.attributes,o=0,a=(t=t.attributesKeys).length;a>o;o++){var s=t[o],l=r[s];if(l>=0){var u=n[s];void 0!==u?(s=u.itemSize,q.bindBuffer(q.ARRAY_BUFFER,u.buffer),me.enableAttribute(l),q.vertexAttribPointer(l,s,q.FLOAT,!1,0,i*s*4)):void 0!==e.defaultAttributeValues&&(2===e.defaultAttributeValues[s].length?q.vertexAttrib2fv(l,e.defaultAttributeValues[s]):3===e.defaultAttributeValues[s].length&&q.vertexAttrib3fv(l,e.defaultAttributeValues[s]))}}me.disableUnusedAttributes()}function r(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function o(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function a(e,t){return t[0]-e[0]}function s(e){if(!1!==e.visible){if(!(e instanceof THREE.Scene||e instanceof THREE.Group)){if(void 0===e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrix=new THREE.Matrix3,e.addEventListener("removed",Fe)),void 0!==(i=e.geometry)&&void 0===i.__webglInit)if(i.__webglInit=!0,i.addEventListener("dispose",Ne),i instanceof THREE.BufferGeometry)X.info.memory.geometries++;else if(e instanceof THREE.Mesh)h(e,i);else if(e instanceof THREE.Line){if(void 0===i.__webglVertexBuffer){i.__webglVertexBuffer=q.createBuffer(),i.__webglColorBuffer=q.createBuffer(),i.__webglLineDistanceBuffer=q.createBuffer(),X.info.memory.geometries++;var n=i.vertices.length;i.__vertexArray=new Float32Array(3*n),i.__colorArray=new Float32Array(3*n),i.__lineDistanceArray=new Float32Array(1*n),i.__webglLineCount=n,t(e),i.verticesNeedUpdate=!0,i.colorsNeedUpdate=!0,i.lineDistancesNeedUpdate=!0}}else e instanceof THREE.PointCloud&&void 0===i.__webglVertexBuffer&&(i.__webglVertexBuffer=q.createBuffer(),i.__webglColorBuffer=q.createBuffer(),X.info.memory.geometries++,n=i.vertices.length,i.__vertexArray=new Float32Array(3*n),i.__colorArray=new Float32Array(3*n),i.__webglParticleCount=n,t(e),i.verticesNeedUpdate=!0,i.colorsNeedUpdate=!0);if(void 0===e.__webglActive)if(e.__webglActive=!0,e instanceof THREE.Mesh){if(i instanceof THREE.BufferGeometry)d(V,i,e);else if(i instanceof THREE.Geometry){n=0;for(var i,r=(i=je[i.id]).length;r>n;n++)d(V,i[n],e)}}else e instanceof THREE.Line||e instanceof THREE.PointCloud?d(V,i,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&U.push({id:null,object:e,opaque:null,transparent:null,z:0});if(e instanceof THREE.Light)z.push(e);else if(e instanceof THREE.Sprite)G.push(e);else if(e instanceof THREE.LensFlare)Y.push(e);else if((i=V[e.id])&&(!1===e.frustumCulled||!0===le.intersectsObject(e)))for(n=0,r=i.length;r>n;n++){var o=i[n],a=o,l=a.object,u=a.buffer,c=l.geometry;(l=l.material)instanceof THREE.MeshFaceMaterial?(l=l.materials[c instanceof THREE.BufferGeometry?0:u.materialIndex],a.material=l,l.transparent?W.push(a):j.push(a)):l&&(a.material=l,l.transparent?W.push(a):j.push(a)),o.render=!0,!0===X.sortObjects&&(ce.setFromMatrixPosition(e.matrixWorld),ce.applyProjection(ue),o.z=ce.z)}}for(n=0,r=e.children.length;r>n;n++)s(e.children[n])}}function l(e,t,n,i,r){for(var o,a=0,s=e.length;s>a;a++){var l=(o=e[a]).object,u=o.buffer;if(_(l,t),r)o=r;else{if(!(o=o.material))continue;g(o)}X.setMaterialFaces(o),u instanceof THREE.BufferGeometry?X.renderBufferDirect(t,n,i,o,u,l):X.renderBuffer(t,n,i,o,u,l)}}function u(e,t,n,i,r,o){for(var a,s=0,l=e.length;l>s;s++){var u=(a=e[s]).object;if(u.visible){if(o)a=o;else{if(!(a=a[t]))continue;g(a)}X.renderImmediateObject(n,i,r,a,u)}}}function c(e){var t=e.object.material;t.transparent?(e.transparent=t,e.opaque=null):(e.opaque=t,e.transparent=null)}function h(e,t){var i=e.material,r=!1;if(void 0===je[t.id]||!0===t.groupsNeedUpdate){delete V[e.id];for(var o,a,s=je,l=t.id,u=(i=i instanceof THREE.MeshFaceMaterial,ge.get("OES_element_index_uint")?4294967296:65535),c=(r={},t.morphTargets.length),h=t.morphNormals.length,f={},p=[],m=0,g=t.faces.length;g>m;m++){o=t.faces[m];var v=i?o.materialIndex:0;v in r||(r[v]={hash:v,counter:0}),(o=r[v].hash+"_"+r[v].counter)in f||(a={id:We++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:c,numMorphNormals:h},f[o]=a,p.push(a)),f[o].vertices+3>u&&(r[v].counter+=1,(o=r[v].hash+"_"+r[v].counter)in f||(a={id:We++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:c,numMorphNormals:h},f[o]=a,p.push(a))),f[o].faces3.push(m),f[o].vertices+=3}s[l]=p,t.groupsNeedUpdate=!1}for(l=0,i=(s=je[t.id]).length;i>l;l++){if(void 0===(u=s[l]).__webglVertexBuffer){if((r=u).__webglVertexBuffer=q.createBuffer(),r.__webglNormalBuffer=q.createBuffer(),r.__webglTangentBuffer=q.createBuffer(),r.__webglColorBuffer=q.createBuffer(),r.__webglUVBuffer=q.createBuffer(),r.__webglUV2Buffer=q.createBuffer(),r.__webglSkinIndicesBuffer=q.createBuffer(),r.__webglSkinWeightsBuffer=q.createBuffer(),r.__webglFaceBuffer=q.createBuffer(),r.__webglLineBuffer=q.createBuffer(),h=r.numMorphTargets)for(r.__webglMorphTargetsBuffers=[],c=0;h>c;c++)r.__webglMorphTargetsBuffers.push(q.createBuffer());if(h=r.numMorphNormals)for(r.__webglMorphNormalsBuffers=[],c=0;h>c;c++)r.__webglMorphNormalsBuffers.push(q.createBuffer());if(X.info.memory.geometries++,r=u,g=(m=e).geometry,c=3*(h=r.faces3).length,f=1*h.length,p=3*h.length,h=n(m,r),r.__vertexArray=new Float32Array(3*c),r.__normalArray=new Float32Array(3*c),r.__colorArray=new Float32Array(3*c),r.__uvArray=new Float32Array(2*c),1<g.faceVertexUvs.length&&(r.__uv2Array=new Float32Array(2*c)),g.hasTangents&&(r.__tangentArray=new Float32Array(4*c)),m.geometry.skinWeights.length&&m.geometry.skinIndices.length&&(r.__skinIndexArray=new Float32Array(4*c),r.__skinWeightArray=new Float32Array(4*c)),m=null!==ge.get("OES_element_index_uint")&&f>21845?Uint32Array:Uint16Array,r.__typeArray=m,r.__faceArray=new m(3*f),r.__lineArray=new m(2*p),g=r.numMorphTargets)for(r.__morphTargetsArrays=[],m=0;g>m;m++)r.__morphTargetsArrays.push(new Float32Array(3*c));if(g=r.numMorphNormals)for(r.__morphNormalsArrays=[],m=0;g>m;m++)r.__morphNormalsArrays.push(new Float32Array(3*c));if(r.__webglFaceCount=3*f,r.__webglLineCount=2*p,h.attributes)for(f in void 0===r.__webglCustomAttributesList&&(r.__webglCustomAttributesList=[]),f=void 0,h.attributes){var E;p=h.attributes[f],m={};for(E in p)m[E]=p[E];(!m.__webglInitialized||m.createUniqueBuffers)&&(m.__webglInitialized=!0,g=1,"v2"===m.type?g=2:"v3"===m.type?g=3:"v4"===m.type?g=4:"c"===m.type&&(g=3),m.size=g,m.array=new Float32Array(c*g),m.buffer=q.createBuffer(),m.buffer.belongsToAttribute=f,p.needsUpdate=!0,m.__original=p),r.__webglCustomAttributesList.push(m)}r.__inittedArrays=!0,t.verticesNeedUpdate=!0,t.morphTargetsNeedUpdate=!0,t.elementsNeedUpdate=!0,t.uvsNeedUpdate=!0,t.normalsNeedUpdate=!0,t.tangentsNeedUpdate=!0,r=t.colorsNeedUpdate=!0}else r=!1;(r||void 0===e.__webglActive)&&d(V,u,e)}e.__webglActive=!0}function d(e,t,n){var i=n.id;e[i]=e[i]||[],e[i].push({id:i,buffer:t,object:n,material:null,z:0})}function f(e){var t=e.geometry;if(t instanceof THREE.BufferGeometry)for(var i=t.attributes,r=t.attributesKeys,o=0,a=r.length;a>o;o++){var s=r[o],l=i[s],u="index"===s?q.ELEMENT_ARRAY_BUFFER:q.ARRAY_BUFFER;void 0===l.buffer?(l.buffer=q.createBuffer(),q.bindBuffer(u,l.buffer),q.bufferData(u,l.array,l instanceof THREE.DynamicBufferAttribute?q.DYNAMIC_DRAW:q.STATIC_DRAW),l.needsUpdate=!1):!0===l.needsUpdate&&(q.bindBuffer(u,l.buffer),void 0===l.updateRange||-1===l.updateRange.count?q.bufferSubData(u,0,l.array):0===l.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(q.bufferSubData(u,l.updateRange.offset*l.array.BYTES_PER_ELEMENT,l.array.subarray(l.updateRange.offset,l.updateRange.offset+l.updateRange.count)),l.updateRange.count=0),l.needsUpdate=!1)}else if(e instanceof THREE.Mesh){!0===t.groupsNeedUpdate&&h(e,t);for(var c=je[t.id],d=(o=0,c.length);d>o;o++){var f=c[o],g=n(e,f),v=g.attributes&&p(g);if(t.verticesNeedUpdate||t.morphTargetsNeedUpdate||t.elementsNeedUpdate||t.uvsNeedUpdate||t.normalsNeedUpdate||t.colorsNeedUpdate||t.tangentsNeedUpdate||v){var E=f,y=e,_=q.DYNAMIC_DRAW,T=!t.dynamic,b=g;if(E.__inittedArrays){var w=0==b instanceof THREE.MeshPhongMaterial&&b.shading===THREE.FlatShading,x=void 0,R=void 0,H=void 0,S=void 0,M=void 0,C=void 0,A=void 0,k=void 0,P=void 0,D=void 0,L=void 0,O=void 0,F=void 0,N=void 0,I=void 0,B=void 0,z=void 0,V=void 0,U=void 0,j=void 0,W=void 0,G=void 0,Y=void 0,X=void 0,$=void 0,Z=void 0,K=void 0,Q=void 0,J=void 0,ee=void 0,te=void 0,ne=void 0,ie=void 0,re=void 0,oe=void 0,ae=void 0,se=void 0,le=void 0,ue=void 0,ce=0,he=0,de=0,fe=0,pe=0,me=0,ge=0,ve=0,Ee=0,ye=0,_e=0,Te=0,be=void 0,we=E.__vertexArray,xe=E.__uvArray,Re=E.__uv2Array,He=E.__normalArray,Se=E.__tangentArray,Me=E.__colorArray,Ce=E.__skinIndexArray,Ae=E.__skinWeightArray,ke=E.__morphTargetsArrays,Pe=E.__morphNormalsArrays,De=E.__webglCustomAttributesList,Le=void 0,Oe=E.__faceArray,Fe=E.__lineArray,Ne=y.geometry,Ie=Ne.elementsNeedUpdate,Be=Ne.uvsNeedUpdate,ze=Ne.normalsNeedUpdate,Ve=Ne.tangentsNeedUpdate,Ue=Ne.colorsNeedUpdate,We=Ne.morphTargetsNeedUpdate,Ge=Ne.vertices,Ye=E.faces3,qe=Ne.faces,Xe=Ne.faceVertexUvs[0],$e=Ne.faceVertexUvs[1],Ze=Ne.skinIndices,Ke=Ne.skinWeights,Qe=Ne.morphTargets,Je=Ne.morphNormals;if(Ne.verticesNeedUpdate){for(x=0,R=Ye.length;R>x;x++)L=Ge[(H=qe[Ye[x]]).a],O=Ge[H.b],F=Ge[H.c],we[he]=L.x,we[he+1]=L.y,we[he+2]=L.z,we[he+3]=O.x,we[he+4]=O.y,we[he+5]=O.z,we[he+6]=F.x,we[he+7]=F.y,we[he+8]=F.z,he+=9;q.bindBuffer(q.ARRAY_BUFFER,E.__webglVertexBuffer),q.bufferData(q.ARRAY_BUFFER,we,_)}if(We)for(re=0,oe=Qe.length;oe>re;re++){for(x=_e=0,R=Ye.length;R>x;x++)H=qe[le=Ye[x]],L=Qe[re].vertices[H.a],O=Qe[re].vertices[H.b],F=Qe[re].vertices[H.c],(ae=ke[re])[_e]=L.x,ae[_e+1]=L.y,ae[_e+2]=L.z,ae[_e+3]=O.x,ae[_e+4]=O.y,ae[_e+5]=O.z,ae[_e+6]=F.x,ae[_e+7]=F.y,ae[_e+8]=F.z,b.morphNormals&&(w?U=V=z=Je[re].faceNormals[le]:(z=(ue=Je[re].vertexNormals[le]).a,V=ue.b,U=ue.c),(se=Pe[re])[_e]=z.x,se[_e+1]=z.y,se[_e+2]=z.z,se[_e+3]=V.x,se[_e+4]=V.y,se[_e+5]=V.z,se[_e+6]=U.x,se[_e+7]=U.y,se[_e+8]=U.z),_e+=9;q.bindBuffer(q.ARRAY_BUFFER,E.__webglMorphTargetsBuffers[re]),q.bufferData(q.ARRAY_BUFFER,ke[re],_),b.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,E.__webglMorphNormalsBuffers[re]),q.bufferData(q.ARRAY_BUFFER,Pe[re],_))}if(Ke.length){for(x=0,R=Ye.length;R>x;x++)Y=Ke[(H=qe[Ye[x]]).a],X=Ke[H.b],$=Ke[H.c],Ae[ye]=Y.x,Ae[ye+1]=Y.y,Ae[ye+2]=Y.z,Ae[ye+3]=Y.w,Ae[ye+4]=X.x,Ae[ye+5]=X.y,Ae[ye+6]=X.z,Ae[ye+7]=X.w,Ae[ye+8]=$.x,Ae[ye+9]=$.y,Ae[ye+10]=$.z,Ae[ye+11]=$.w,Z=Ze[H.a],K=Ze[H.b],Q=Ze[H.c],Ce[ye]=Z.x,Ce[ye+1]=Z.y,Ce[ye+2]=Z.z,Ce[ye+3]=Z.w,Ce[ye+4]=K.x,Ce[ye+5]=K.y,Ce[ye+6]=K.z,Ce[ye+7]=K.w,Ce[ye+8]=Q.x,Ce[ye+9]=Q.y,Ce[ye+10]=Q.z,Ce[ye+11]=Q.w,ye+=12;ye>0&&(q.bindBuffer(q.ARRAY_BUFFER,E.__webglSkinIndicesBuffer),q.bufferData(q.ARRAY_BUFFER,Ce,_),q.bindBuffer(q.ARRAY_BUFFER,E.__webglSkinWeightsBuffer),q.bufferData(q.ARRAY_BUFFER,Ae,_))}if(Ue){for(x=0,R=Ye.length;R>x;x++)C=(H=qe[Ye[x]]).vertexColors,A=H.color,3===C.length&&b.vertexColors===THREE.VertexColors?(j=C[0],W=C[1],G=C[2]):G=W=j=A,Me[Ee]=j.r,Me[Ee+1]=j.g,Me[Ee+2]=j.b,Me[Ee+3]=W.r,Me[Ee+4]=W.g,Me[Ee+5]=W.b,Me[Ee+6]=G.r,Me[Ee+7]=G.g,Me[Ee+8]=G.b,Ee+=9;Ee>0&&(q.bindBuffer(q.ARRAY_BUFFER,E.__webglColorBuffer),q.bufferData(q.ARRAY_BUFFER,Me,_))}if(Ve&&Ne.hasTangents){for(x=0,R=Ye.length;R>x;x++)N=(k=(H=qe[Ye[x]]).vertexTangents)[0],I=k[1],B=k[2],Se[ge]=N.x,Se[ge+1]=N.y,Se[ge+2]=N.z,Se[ge+3]=N.w,Se[ge+4]=I.x,Se[ge+5]=I.y,Se[ge+6]=I.z,Se[ge+7]=I.w,Se[ge+8]=B.x,Se[ge+9]=B.y,Se[ge+10]=B.z,Se[ge+11]=B.w,ge+=12;q.bindBuffer(q.ARRAY_BUFFER,E.__webglTangentBuffer),q.bufferData(q.ARRAY_BUFFER,Se,_)}if(ze){for(x=0,R=Ye.length;R>x;x++)if(S=(H=qe[Ye[x]]).vertexNormals,M=H.normal,3===S.length&&!1===w)for(J=0;3>J;J++)te=S[J],He[me]=te.x,He[me+1]=te.y,He[me+2]=te.z,me+=3;else for(J=0;3>J;J++)He[me]=M.x,He[me+1]=M.y,He[me+2]=M.z,me+=3;q.bindBuffer(q.ARRAY_BUFFER,E.__webglNormalBuffer),q.bufferData(q.ARRAY_BUFFER,He,_)}if(Be&&Xe){for(x=0,R=Ye.length;R>x;x++)if(void 0!==(P=Xe[Ye[x]]))for(J=0;3>J;J++)ne=P[J],xe[de]=ne.x,xe[de+1]=ne.y,de+=2;de>0&&(q.bindBuffer(q.ARRAY_BUFFER,E.__webglUVBuffer),q.bufferData(q.ARRAY_BUFFER,xe,_))}if(Be&&$e){for(x=0,R=Ye.length;R>x;x++)if(void 0!==(D=$e[Ye[x]]))for(J=0;3>J;J++)ie=D[J],Re[fe]=ie.x,Re[fe+1]=ie.y,fe+=2;fe>0&&(q.bindBuffer(q.ARRAY_BUFFER,E.__webglUV2Buffer),q.bufferData(q.ARRAY_BUFFER,Re,_))}if(Ie){for(x=0,R=Ye.length;R>x;x++)Oe[pe]=ce,Oe[pe+1]=ce+1,Oe[pe+2]=ce+2,pe+=3,Fe[ve]=ce,Fe[ve+1]=ce+1,Fe[ve+2]=ce,Fe[ve+3]=ce+2,Fe[ve+4]=ce+1,Fe[ve+5]=ce+2,ve+=6,ce+=3;q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,E.__webglFaceBuffer),q.bufferData(q.ELEMENT_ARRAY_BUFFER,Oe,_),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,E.__webglLineBuffer),q.bufferData(q.ELEMENT_ARRAY_BUFFER,Fe,_)}if(De)for(J=0,ee=De.length;ee>J;J++)if((Le=De[J]).__original.needsUpdate){if(Te=0,1===Le.size){if(void 0===Le.boundTo||"vertices"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)H=qe[Ye[x]],Le.array[Te]=Le.value[H.a],Le.array[Te+1]=Le.value[H.b],Le.array[Te+2]=Le.value[H.c],Te+=3;else if("faces"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)be=Le.value[Ye[x]],Le.array[Te]=be,Le.array[Te+1]=be,Le.array[Te+2]=be,Te+=3}else if(2===Le.size){if(void 0===Le.boundTo||"vertices"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)H=qe[Ye[x]],L=Le.value[H.a],O=Le.value[H.b],F=Le.value[H.c],Le.array[Te]=L.x,Le.array[Te+1]=L.y,Le.array[Te+2]=O.x,Le.array[Te+3]=O.y,Le.array[Te+4]=F.x,Le.array[Te+5]=F.y,Te+=6;else if("faces"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)F=O=L=be=Le.value[Ye[x]],Le.array[Te]=L.x,Le.array[Te+1]=L.y,Le.array[Te+2]=O.x,Le.array[Te+3]=O.y,Le.array[Te+4]=F.x,Le.array[Te+5]=F.y,Te+=6}else if(3===Le.size){var et;if(et="c"===Le.type?["r","g","b"]:["x","y","z"],void 0===Le.boundTo||"vertices"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)H=qe[Ye[x]],L=Le.value[H.a],O=Le.value[H.b],F=Le.value[H.c],Le.array[Te]=L[et[0]],Le.array[Te+1]=L[et[1]],Le.array[Te+2]=L[et[2]],Le.array[Te+3]=O[et[0]],Le.array[Te+4]=O[et[1]],Le.array[Te+5]=O[et[2]],Le.array[Te+6]=F[et[0]],Le.array[Te+7]=F[et[1]],Le.array[Te+8]=F[et[2]],Te+=9;else if("faces"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)F=O=L=be=Le.value[Ye[x]],Le.array[Te]=L[et[0]],Le.array[Te+1]=L[et[1]],Le.array[Te+2]=L[et[2]],Le.array[Te+3]=O[et[0]],Le.array[Te+4]=O[et[1]],Le.array[Te+5]=O[et[2]],Le.array[Te+6]=F[et[0]],Le.array[Te+7]=F[et[1]],Le.array[Te+8]=F[et[2]],Te+=9;else if("faceVertices"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)L=(be=Le.value[Ye[x]])[0],O=be[1],F=be[2],Le.array[Te]=L[et[0]],Le.array[Te+1]=L[et[1]],Le.array[Te+2]=L[et[2]],Le.array[Te+3]=O[et[0]],Le.array[Te+4]=O[et[1]],Le.array[Te+5]=O[et[2]],Le.array[Te+6]=F[et[0]],Le.array[Te+7]=F[et[1]],Le.array[Te+8]=F[et[2]],Te+=9}else if(4===Le.size)if(void 0===Le.boundTo||"vertices"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)H=qe[Ye[x]],L=Le.value[H.a],O=Le.value[H.b],F=Le.value[H.c],Le.array[Te]=L.x,Le.array[Te+1]=L.y,Le.array[Te+2]=L.z,Le.array[Te+3]=L.w,Le.array[Te+4]=O.x,Le.array[Te+5]=O.y,Le.array[Te+6]=O.z,Le.array[Te+7]=O.w,Le.array[Te+8]=F.x,Le.array[Te+9]=F.y,Le.array[Te+10]=F.z,Le.array[Te+11]=F.w,Te+=12;else if("faces"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)F=O=L=be=Le.value[Ye[x]],Le.array[Te]=L.x,Le.array[Te+1]=L.y,Le.array[Te+2]=L.z,Le.array[Te+3]=L.w,Le.array[Te+4]=O.x,Le.array[Te+5]=O.y,Le.array[Te+6]=O.z,Le.array[Te+7]=O.w,Le.array[Te+8]=F.x,Le.array[Te+9]=F.y,Le.array[Te+10]=F.z,Le.array[Te+11]=F.w,Te+=12;else if("faceVertices"===Le.boundTo)for(x=0,R=Ye.length;R>x;x++)L=(be=Le.value[Ye[x]])[0],O=be[1],F=be[2],Le.array[Te]=L.x,Le.array[Te+1]=L.y,Le.array[Te+2]=L.z,Le.array[Te+3]=L.w,Le.array[Te+4]=O.x,Le.array[Te+5]=O.y,Le.array[Te+6]=O.z,Le.array[Te+7]=O.w,Le.array[Te+8]=F.x,Le.array[Te+9]=F.y,Le.array[Te+10]=F.z,Le.array[Te+11]=F.w,Te+=12;q.bindBuffer(q.ARRAY_BUFFER,Le.buffer),q.bufferData(q.ARRAY_BUFFER,Le.array,_)}T&&(delete E.__inittedArrays,delete E.__colorArray,delete E.__normalArray,delete E.__tangentArray,delete E.__uvArray,delete E.__uv2Array,delete E.__faceArray,delete E.__vertexArray,delete E.__lineArray,delete E.__skinIndexArray,delete E.__skinWeightArray)}}}t.verticesNeedUpdate=!1,t.morphTargetsNeedUpdate=!1,t.elementsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.tangentsNeedUpdate=!1,g.attributes&&m(g)}else if(e instanceof THREE.Line){if(v=(g=n(e,t)).attributes&&p(g),t.verticesNeedUpdate||t.colorsNeedUpdate||t.lineDistancesNeedUpdate||v){var tt,nt,it,rt,ot,at,st,lt,ut,ct,ht,dt,ft=q.DYNAMIC_DRAW,pt=t.vertices,mt=t.colors,gt=t.lineDistances,vt=pt.length,Et=mt.length,yt=gt.length,_t=t.__vertexArray,Tt=t.__colorArray,bt=t.__lineDistanceArray,wt=t.colorsNeedUpdate,xt=t.lineDistancesNeedUpdate,Rt=t.__webglCustomAttributesList;if(t.verticesNeedUpdate){for(tt=0;vt>tt;tt++)rt=pt[tt],_t[ot=3*tt]=rt.x,_t[ot+1]=rt.y,_t[ot+2]=rt.z;q.bindBuffer(q.ARRAY_BUFFER,t.__webglVertexBuffer),q.bufferData(q.ARRAY_BUFFER,_t,ft)}if(wt){for(nt=0;Et>nt;nt++)at=mt[nt],Tt[ot=3*nt]=at.r,Tt[ot+1]=at.g,Tt[ot+2]=at.b;q.bindBuffer(q.ARRAY_BUFFER,t.__webglColorBuffer),q.bufferData(q.ARRAY_BUFFER,Tt,ft)}if(xt){for(it=0;yt>it;it++)bt[it]=gt[it];q.bindBuffer(q.ARRAY_BUFFER,t.__webglLineDistanceBuffer),q.bufferData(q.ARRAY_BUFFER,bt,ft)}if(Rt)for(st=0,lt=Rt.length;lt>st;st++)if((dt=Rt[st]).needsUpdate&&(void 0===dt.boundTo||"vertices"===dt.boundTo)){if(ot=0,ct=dt.value.length,1===dt.size)for(ut=0;ct>ut;ut++)dt.array[ut]=dt.value[ut];else if(2===dt.size)for(ut=0;ct>ut;ut++)ht=dt.value[ut],dt.array[ot]=ht.x,dt.array[ot+1]=ht.y,ot+=2;else if(3===dt.size)if("c"===dt.type)for(ut=0;ct>ut;ut++)ht=dt.value[ut],dt.array[ot]=ht.r,dt.array[ot+1]=ht.g,dt.array[ot+2]=ht.b,ot+=3;else for(ut=0;ct>ut;ut++)ht=dt.value[ut],dt.array[ot]=ht.x,dt.array[ot+1]=ht.y,dt.array[ot+2]=ht.z,ot+=3;else if(4===dt.size)for(ut=0;ct>ut;ut++)ht=dt.value[ut],dt.array[ot]=ht.x,dt.array[ot+1]=ht.y,dt.array[ot+2]=ht.z,dt.array[ot+3]=ht.w,ot+=4;q.bindBuffer(q.ARRAY_BUFFER,dt.buffer),q.bufferData(q.ARRAY_BUFFER,dt.array,ft),dt.needsUpdate=!1}}t.verticesNeedUpdate=!1,t.colorsNeedUpdate=!1,t.lineDistancesNeedUpdate=!1,g.attributes&&m(g)}else if(e instanceof THREE.PointCloud){if(v=(g=n(e,t)).attributes&&p(g),t.verticesNeedUpdate||t.colorsNeedUpdate||v){var Ht,St,Mt,Ct,At,kt,Pt,Dt,Lt,Ot,Ft,Nt=q.DYNAMIC_DRAW,It=t.vertices,Bt=It.length,zt=t.colors,Vt=zt.length,Ut=t.__vertexArray,jt=t.__colorArray,Wt=t.colorsNeedUpdate,Gt=t.__webglCustomAttributesList;if(t.verticesNeedUpdate){for(Ht=0;Bt>Ht;Ht++)Mt=It[Ht],Ut[Ct=3*Ht]=Mt.x,Ut[Ct+1]=Mt.y,Ut[Ct+2]=Mt.z;q.bindBuffer(q.ARRAY_BUFFER,t.__webglVertexBuffer),q.bufferData(q.ARRAY_BUFFER,Ut,Nt)}if(Wt){for(St=0;Vt>St;St++)At=zt[St],jt[Ct=3*St]=At.r,jt[Ct+1]=At.g,jt[Ct+2]=At.b;q.bindBuffer(q.ARRAY_BUFFER,t.__webglColorBuffer),q.bufferData(q.ARRAY_BUFFER,jt,Nt)}if(Gt)for(kt=0,Pt=Gt.length;Pt>kt;kt++){if((Ft=Gt[kt]).needsUpdate&&(void 0===Ft.boundTo||"vertices"===Ft.boundTo))if(Lt=Ft.value.length,Ct=0,1===Ft.size)for(Dt=0;Lt>Dt;Dt++)Ft.array[Dt]=Ft.value[Dt];else if(2===Ft.size)for(Dt=0;Lt>Dt;Dt++)Ot=Ft.value[Dt],Ft.array[Ct]=Ot.x,Ft.array[Ct+1]=Ot.y,Ct+=2;else if(3===Ft.size)if("c"===Ft.type)for(Dt=0;Lt>Dt;Dt++)Ot=Ft.value[Dt],Ft.array[Ct]=Ot.r,Ft.array[Ct+1]=Ot.g,Ft.array[Ct+2]=Ot.b,Ct+=3;else for(Dt=0;Lt>Dt;Dt++)Ot=Ft.value[Dt],Ft.array[Ct]=Ot.x,Ft.array[Ct+1]=Ot.y,Ft.array[Ct+2]=Ot.z,Ct+=3;else if(4===Ft.size)for(Dt=0;Lt>Dt;Dt++)Ot=Ft.value[Dt],Ft.array[Ct]=Ot.x,Ft.array[Ct+1]=Ot.y,Ft.array[Ct+2]=Ot.z,Ft.array[Ct+3]=Ot.w,Ct+=4;q.bindBuffer(q.ARRAY_BUFFER,Ft.buffer),q.bufferData(q.ARRAY_BUFFER,Ft.array,Nt),Ft.needsUpdate=!1}}t.verticesNeedUpdate=!1,t.colorsNeedUpdate=!1,g.attributes&&m(g)}}function p(e){for(var t in e.attributes)if(e.attributes[t].needsUpdate)return!0;return!1}function m(e){for(var t in e.attributes)e.attributes[t].needsUpdate=!1}function g(e){!0===e.transparent?me.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha):me.setBlending(THREE.NoBlending),me.setDepthTest(e.depthTest),me.setDepthWrite(e.depthWrite),me.setColorWrite(e.colorWrite),me.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function v(e,t,n,i,r){var o,a,s,l;if(te=0,i.needsUpdate){i.program&&Ue(i),i.addEventListener("dispose",ze);var u,c=Ge[i.type];if(c){var h=THREE.ShaderLib[c];i.__webglShader={uniforms:THREE.UniformsUtils.clone(h.uniforms),vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}else i.__webglShader={uniforms:i.uniforms,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader};for(var d=0,f=0,p=0,m=0,g=0,v=t.length;v>g;g++){var _=t[g];_.onlyShadow||!1===_.visible||(_ instanceof THREE.DirectionalLight&&d++,_ instanceof THREE.PointLight&&f++,_ instanceof THREE.SpotLight&&p++,_ instanceof THREE.HemisphereLight&&m++)}o=d,a=f,s=p,l=m;for(var x,R=0,M=0,C=t.length;C>M;M++){var k=t[M];k.castShadow&&(k instanceof THREE.SpotLight&&R++,k instanceof THREE.DirectionalLight&&!k.shadowCascade&&R++)}if(x=R,Re&&r&&r.skeleton&&r.skeleton.useVertexTexture)u=1024;else{var P=q.getParameter(q.MAX_VERTEX_UNIFORM_VECTORS),D=Math.floor((P-20)/4);void 0!==r&&r instanceof THREE.SkinnedMesh&&((D=Math.min(r.skeleton.bones.length,D))<r.skeleton.bones.length&&THREE.warn("WebGLRenderer: too many bones - "+r.skeleton.bones.length+", this GPU supports just "+D+" (try OpenGL instead of ANGLE)")),u=D}var L={precision:A,supportsVertexTextures:xe,map:!!i.map,envMap:!!i.envMap,envMapMode:i.envMap&&i.envMap.mapping,lightMap:!!i.lightMap,bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,combine:i.combine,vertexColors:i.vertexColors,fog:n,useFog:i.fog,fogExp:n instanceof THREE.FogExp2,flatShading:i.shading===THREE.FlatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:N,skinning:i.skinning,maxBones:u,useVertexTexture:Re&&r&&r.skeleton&&r.skeleton.useVertexTexture,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:X.maxMorphTargets,maxMorphNormals:X.maxMorphNormals,maxDirLights:o,maxPointLights:a,maxSpotLights:s,maxHemiLights:l,maxShadows:x,shadowMapEnabled:X.shadowMapEnabled&&r.receiveShadow&&x>0,shadowMapType:X.shadowMapType,shadowMapDebug:X.shadowMapDebug,shadowMapCascade:X.shadowMapCascade,alphaTest:i.alphaTest,metal:i.metal,wrapAround:i.wrapAround,doubleSided:i.side===THREE.DoubleSide,flipSided:i.side===THREE.BackSide},O=[];if(c?O.push(c):(O.push(i.fragmentShader),O.push(i.vertexShader)),void 0!==i.defines)for(var F in i.defines)O.push(F),O.push(i.defines[F]);for(F in L)O.push(F),O.push(L[F]);for(var I,B=O.join(),z=0,V=$.length;V>z;z++){var U=$[z];if(U.code===B){(I=U).usedTimes++;break}}void 0===I&&(I=new THREE.WebGLProgram(X,B,i,L),$.push(I),X.info.memory.programs=$.length),i.program=I;var j=I.attributes;if(i.morphTargets){i.numSupportedMorphTargets=0;for(var W="morphTarget",G=0;G<X.maxMorphTargets;G++)0<=j[W+G]&&i.numSupportedMorphTargets++}if(i.morphNormals)for(i.numSupportedMorphNormals=0,W="morphNormal",G=0;G<X.maxMorphNormals;G++)0<=j[W+G]&&i.numSupportedMorphNormals++;for(var Y in i.uniformsList=[],i.__webglShader.uniforms){var K=i.program.uniforms[Y];K&&i.uniformsList.push([i.__webglShader.uniforms[Y],K])}i.needsUpdate=!1}i.morphTargets&&!r.__webglMorphTargetInfluences&&(r.__webglMorphTargetInfluences=new Float32Array(X.maxMorphTargets));var J=!1,ne=!1,ie=!1,re=i.program,oe=re.uniforms,ae=i.__webglShader.uniforms;if(re.id!==Z&&(q.useProgram(re.program),Z=re.id,ie=ne=J=!0),i.id!==Q&&(-1===Q&&(ie=!0),Q=i.id,ne=!0),(J||e!==ee)&&(q.uniformMatrix4fv(oe.projectionMatrix,!1,e.projectionMatrix.elements),N&&q.uniform1f(oe.logDepthBufFC,2/(Math.log(e.far+1)/Math.LN2)),e!==ee&&(ee=e),(i instanceof THREE.ShaderMaterial||i instanceof THREE.MeshPhongMaterial||i.envMap)&&null!==oe.cameraPosition&&(ce.setFromMatrixPosition(e.matrixWorld),q.uniform3f(oe.cameraPosition,ce.x,ce.y,ce.z)),(i instanceof THREE.MeshPhongMaterial||i instanceof THREE.MeshLambertMaterial||i instanceof THREE.MeshBasicMaterial||i instanceof THREE.ShaderMaterial||i.skinning)&&null!==oe.viewMatrix&&q.uniformMatrix4fv(oe.viewMatrix,!1,e.matrixWorldInverse.elements)),i.skinning)if(r.bindMatrix&&null!==oe.bindMatrix&&q.uniformMatrix4fv(oe.bindMatrix,!1,r.bindMatrix.elements),r.bindMatrixInverse&&null!==oe.bindMatrixInverse&&q.uniformMatrix4fv(oe.bindMatrixInverse,!1,r.bindMatrixInverse.elements),Re&&r.skeleton&&r.skeleton.useVertexTexture){if(null!==oe.boneTexture){var se=y();q.uniform1i(oe.boneTexture,se),X.setTexture(r.skeleton.boneTexture,se)}null!==oe.boneTextureWidth&&q.uniform1i(oe.boneTextureWidth,r.skeleton.boneTextureWidth),null!==oe.boneTextureHeight&&q.uniform1i(oe.boneTextureHeight,r.skeleton.boneTextureHeight)}else r.skeleton&&r.skeleton.boneMatrices&&null!==oe.boneGlobalMatrices&&q.uniformMatrix4fv(oe.boneGlobalMatrices,!1,r.skeleton.boneMatrices);if(ne){if(n&&i.fog&&(ae.fogColor.value=n.color,n instanceof THREE.Fog?(ae.fogNear.value=n.near,ae.fogFar.value=n.far):n instanceof THREE.FogExp2&&(ae.fogDensity.value=n.density)),i instanceof THREE.MeshPhongMaterial||i instanceof THREE.MeshLambertMaterial||i.lights){if(de){ie=!0;var le,ue,pe,me,ge,ve,Ee,ye,_e=0,Te=0,be=0,He=fe,Se=He.directional.colors,Me=He.directional.positions,Ce=He.point.colors,ke=He.point.positions,Pe=He.point.distances,De=He.point.decays,Le=He.spot.colors,Oe=He.spot.positions,Fe=He.spot.distances,Ne=He.spot.directions,Be=He.spot.anglesCos,Ve=He.spot.exponents,je=He.spot.decays,We=He.hemi.skyColors,Ye=He.hemi.groundColors,qe=He.hemi.positions,Xe=0,$e=0,Ze=0,Ke=0,Qe=0,Je=0,et=0,tt=0,nt=0,it=0,rt=0,ot=0;for(le=0,ue=t.length;ue>le;le++)(pe=t[le]).onlyShadow||(me=pe.color,Ee=pe.intensity,ye=pe.distance,pe instanceof THREE.AmbientLight?pe.visible&&(_e+=me.r,Te+=me.g,be+=me.b):pe instanceof THREE.DirectionalLight?(Qe+=1,pe.visible&&(he.setFromMatrixPosition(pe.matrixWorld),ce.setFromMatrixPosition(pe.target.matrixWorld),he.sub(ce),he.normalize(),Me[nt=3*Xe]=he.x,Me[nt+1]=he.y,Me[nt+2]=he.z,T(Se,nt,me,Ee),Xe+=1)):pe instanceof THREE.PointLight?(Je+=1,pe.visible&&(T(Ce,it=3*$e,me,Ee),ce.setFromMatrixPosition(pe.matrixWorld),ke[it]=ce.x,ke[it+1]=ce.y,ke[it+2]=ce.z,Pe[$e]=ye,De[$e]=0===pe.distance?0:pe.decay,$e+=1)):pe instanceof THREE.SpotLight?(et+=1,pe.visible&&(T(Le,rt=3*Ze,me,Ee),he.setFromMatrixPosition(pe.matrixWorld),Oe[rt]=he.x,Oe[rt+1]=he.y,Oe[rt+2]=he.z,Fe[Ze]=ye,ce.setFromMatrixPosition(pe.target.matrixWorld),he.sub(ce),he.normalize(),Ne[rt]=he.x,Ne[rt+1]=he.y,Ne[rt+2]=he.z,Be[Ze]=Math.cos(pe.angle),Ve[Ze]=pe.exponent,je[Ze]=0===pe.distance?0:pe.decay,Ze+=1)):pe instanceof THREE.HemisphereLight&&(tt+=1,pe.visible&&(he.setFromMatrixPosition(pe.matrixWorld),he.normalize(),qe[ot=3*Ke]=he.x,qe[ot+1]=he.y,qe[ot+2]=he.z,ge=pe.color,ve=pe.groundColor,T(We,ot,ge,Ee),T(Ye,ot,ve,Ee),Ke+=1)));for(le=3*Xe,ue=Math.max(Se.length,3*Qe);ue>le;le++)Se[le]=0;for(le=3*$e,ue=Math.max(Ce.length,3*Je);ue>le;le++)Ce[le]=0;for(le=3*Ze,ue=Math.max(Le.length,3*et);ue>le;le++)Le[le]=0;for(le=3*Ke,ue=Math.max(We.length,3*tt);ue>le;le++)We[le]=0;for(le=3*Ke,ue=Math.max(Ye.length,3*tt);ue>le;le++)Ye[le]=0;He.directional.length=Xe,He.point.length=$e,He.spot.length=Ze,He.hemi.length=Ke,He.ambient[0]=_e,He.ambient[1]=Te,He.ambient[2]=be,de=!1}if(ie){var at=fe;ae.ambientLightColor.value=at.ambient,ae.directionalLightColor.value=at.directional.colors,ae.directionalLightDirection.value=at.directional.positions,ae.pointLightColor.value=at.point.colors,ae.pointLightPosition.value=at.point.positions,ae.pointLightDistance.value=at.point.distances,ae.pointLightDecay.value=at.point.decays,ae.spotLightColor.value=at.spot.colors,ae.spotLightPosition.value=at.spot.positions,ae.spotLightDistance.value=at.spot.distances,ae.spotLightDirection.value=at.spot.directions,ae.spotLightAngleCos.value=at.spot.anglesCos,ae.spotLightExponent.value=at.spot.exponents,ae.spotLightDecay.value=at.spot.decays,ae.hemisphereLightSkyColor.value=at.hemi.skyColors,ae.hemisphereLightGroundColor.value=at.hemi.groundColors,ae.hemisphereLightDirection.value=at.hemi.positions,E(ae,!0)}else E(ae,!1)}if(i instanceof THREE.MeshBasicMaterial||i instanceof THREE.MeshLambertMaterial||i instanceof THREE.MeshPhongMaterial){var st;if(ae.opacity.value=i.opacity,ae.diffuse.value=i.color,ae.map.value=i.map,ae.lightMap.value=i.lightMap,ae.specularMap.value=i.specularMap,ae.alphaMap.value=i.alphaMap,i.bumpMap&&(ae.bumpMap.value=i.bumpMap,ae.bumpScale.value=i.bumpScale),i.normalMap&&(ae.normalMap.value=i.normalMap,ae.normalScale.value.copy(i.normalScale)),i.map?st=i.map:i.specularMap?st=i.specularMap:i.normalMap?st=i.normalMap:i.bumpMap?st=i.bumpMap:i.alphaMap&&(st=i.alphaMap),void 0!==st){var lt=st.offset,ut=st.repeat;ae.offsetRepeat.value.set(lt.x,lt.y,ut.x,ut.y)}ae.envMap.value=i.envMap,ae.flipEnvMap.value=i.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,ae.reflectivity.value=i.reflectivity,ae.refractionRatio.value=i.refractionRatio}if(i instanceof THREE.LineBasicMaterial)ae.diffuse.value=i.color,ae.opacity.value=i.opacity;else if(i instanceof THREE.LineDashedMaterial)ae.diffuse.value=i.color,ae.opacity.value=i.opacity,ae.dashSize.value=i.dashSize,ae.totalSize.value=i.dashSize+i.gapSize,ae.scale.value=i.scale;else if(i instanceof THREE.PointCloudMaterial){if(ae.psColor.value=i.color,ae.opacity.value=i.opacity,ae.size.value=i.size,ae.scale.value=S.height/2,ae.map.value=i.map,null!==i.map){var ct=i.map.offset,ht=i.map.repeat;ae.offsetRepeat.value.set(ct.x,ct.y,ht.x,ht.y)}}else i instanceof THREE.MeshPhongMaterial?(ae.shininess.value=i.shininess,ae.emissive.value=i.emissive,ae.specular.value=i.specular,i.wrapAround&&ae.wrapRGB.value.copy(i.wrapRGB)):i instanceof THREE.MeshLambertMaterial?(ae.emissive.value=i.emissive,i.wrapAround&&ae.wrapRGB.value.copy(i.wrapRGB)):i instanceof THREE.MeshDepthMaterial?(ae.mNear.value=e.near,ae.mFar.value=e.far,ae.opacity.value=i.opacity):i instanceof THREE.MeshNormalMaterial&&(ae.opacity.value=i.opacity);if(r.receiveShadow&&!i._shadowPass&&ae.shadowMatrix)for(var dt=0,ft=0,pt=t.length;pt>ft;ft++){var mt=t[ft];mt.castShadow&&(mt instanceof THREE.SpotLight||mt instanceof THREE.DirectionalLight&&!mt.shadowCascade)&&(ae.shadowMap.value[dt]=mt.shadowMap,ae.shadowMapSize.value[dt]=mt.shadowMapSize,ae.shadowMatrix.value[dt]=mt.shadowMatrix,ae.shadowDarkness.value[dt]=mt.shadowDarkness,ae.shadowBias.value[dt]=mt.shadowBias,dt++)}for(var gt,vt,Et,yt=i.uniformsList,_t=0,Tt=yt.length;Tt>_t;_t++){var bt=yt[_t][0];if(!1!==bt.needsUpdate){var wt=bt.type,xt=bt.value,Rt=yt[_t][1];switch(wt){case"1i":q.uniform1i(Rt,xt);break;case"1f":q.uniform1f(Rt,xt);break;case"2f":q.uniform2f(Rt,xt[0],xt[1]);break;case"3f":q.uniform3f(Rt,xt[0],xt[1],xt[2]);break;case"4f":q.uniform4f(Rt,xt[0],xt[1],xt[2],xt[3]);break;case"1iv":q.uniform1iv(Rt,xt);break;case"3iv":q.uniform3iv(Rt,xt);break;case"1fv":q.uniform1fv(Rt,xt);break;case"2fv":q.uniform2fv(Rt,xt);break;case"3fv":q.uniform3fv(Rt,xt);break;case"4fv":q.uniform4fv(Rt,xt);break;case"Matrix3fv":q.uniformMatrix3fv(Rt,!1,xt);break;case"Matrix4fv":q.uniformMatrix4fv(Rt,!1,xt);break;case"i":q.uniform1i(Rt,xt);break;case"f":q.uniform1f(Rt,xt);break;case"v2":q.uniform2f(Rt,xt.x,xt.y);break;case"v3":q.uniform3f(Rt,xt.x,xt.y,xt.z);break;case"v4":q.uniform4f(Rt,xt.x,xt.y,xt.z,xt.w);break;case"c":q.uniform3f(Rt,xt.r,xt.g,xt.b);break;case"iv1":q.uniform1iv(Rt,xt);break;case"iv":q.uniform3iv(Rt,xt);break;case"fv1":q.uniform1fv(Rt,xt);break;case"fv":q.uniform3fv(Rt,xt);break;case"v2v":void 0===bt._array&&(bt._array=new Float32Array(2*xt.length));for(var Ht=0,St=xt.length;St>Ht;Ht++)Et=2*Ht,bt._array[Et]=xt[Ht].x,bt._array[Et+1]=xt[Ht].y;q.uniform2fv(Rt,bt._array);break;case"v3v":for(void 0===bt._array&&(bt._array=new Float32Array(3*xt.length)),Ht=0,St=xt.length;St>Ht;Ht++)Et=3*Ht,bt._array[Et]=xt[Ht].x,bt._array[Et+1]=xt[Ht].y,bt._array[Et+2]=xt[Ht].z;q.uniform3fv(Rt,bt._array);break;case"v4v":for(void 0===bt._array&&(bt._array=new Float32Array(4*xt.length)),Ht=0,St=xt.length;St>Ht;Ht++)Et=4*Ht,bt._array[Et]=xt[Ht].x,bt._array[Et+1]=xt[Ht].y,bt._array[Et+2]=xt[Ht].z,bt._array[Et+3]=xt[Ht].w;q.uniform4fv(Rt,bt._array);break;case"m3":q.uniformMatrix3fv(Rt,!1,xt.elements);break;case"m3v":for(void 0===bt._array&&(bt._array=new Float32Array(9*xt.length)),Ht=0,St=xt.length;St>Ht;Ht++)xt[Ht].flattenToArrayOffset(bt._array,9*Ht);q.uniformMatrix3fv(Rt,!1,bt._array);break;case"m4":q.uniformMatrix4fv(Rt,!1,xt.elements);break;case"m4v":for(void 0===bt._array&&(bt._array=new Float32Array(16*xt.length)),Ht=0,St=xt.length;St>Ht;Ht++)xt[Ht].flattenToArrayOffset(bt._array,16*Ht);q.uniformMatrix4fv(Rt,!1,bt._array);break;case"t":if(gt=xt,vt=y(),q.uniform1i(Rt,vt),!gt)continue;if(gt instanceof THREE.CubeTexture||gt.image instanceof Array&&6===gt.image.length){var Mt=gt,Ct=vt;if(6===Mt.image.length)if(Mt.needsUpdate){Mt.image.__webglTextureCube||(Mt.addEventListener("dispose",Ie),Mt.image.__webglTextureCube=q.createTexture(),X.info.memory.textures++),q.activeTexture(q.TEXTURE0+Ct),q.bindTexture(q.TEXTURE_CUBE_MAP,Mt.image.__webglTextureCube),q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,Mt.flipY);for(var At=Mt instanceof THREE.CompressedTexture,kt=Mt.image[0]instanceof THREE.DataTexture,Pt=[],Dt=0;6>Dt;Dt++)Pt[Dt]=!X.autoScaleCubemaps||At||kt?kt?Mt.image[Dt].image:Mt.image[Dt]:w(Mt.image[Dt],we);var Lt=Pt[0],Ot=THREE.Math.isPowerOfTwo(Lt.width)&&THREE.Math.isPowerOfTwo(Lt.height),Ft=H(Mt.format),Nt=H(Mt.type);for(b(q.TEXTURE_CUBE_MAP,Mt,Ot),Dt=0;6>Dt;Dt++)if(At)for(var It,Bt=Pt[Dt].mipmaps,zt=0,Vt=Bt.length;Vt>zt;zt++)It=Bt[zt],Mt.format!==THREE.RGBAFormat&&Mt.format!==THREE.RGBFormat?-1<Ae().indexOf(Ft)?q.compressedTexImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+Dt,zt,Ft,It.width,It.height,0,It.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+Dt,zt,Ft,It.width,It.height,0,Ft,Nt,It.data);else kt?q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+Dt,0,Ft,Pt[Dt].width,Pt[Dt].height,0,Ft,Nt,Pt[Dt].data):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+Dt,0,Ft,Ft,Nt,Pt[Dt]);Mt.generateMipmaps&&Ot&&q.generateMipmap(q.TEXTURE_CUBE_MAP),Mt.needsUpdate=!1,Mt.onUpdate&&Mt.onUpdate()}else q.activeTexture(q.TEXTURE0+Ct),q.bindTexture(q.TEXTURE_CUBE_MAP,Mt.image.__webglTextureCube)}else if(gt instanceof THREE.WebGLRenderTargetCube){var Ut=gt;q.activeTexture(q.TEXTURE0+vt),q.bindTexture(q.TEXTURE_CUBE_MAP,Ut.__webglTexture)}else X.setTexture(gt,vt);break;case"tv":for(void 0===bt._array&&(bt._array=[]),Ht=0,St=bt.value.length;St>Ht;Ht++)bt._array[Ht]=y();for(q.uniform1iv(Rt,bt._array),Ht=0,St=bt.value.length;St>Ht;Ht++)gt=bt.value[Ht],vt=bt._array[Ht],gt&&X.setTexture(gt,vt);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+wt)}}}}return q.uniformMatrix4fv(oe.modelViewMatrix,!1,r._modelViewMatrix.elements),oe.normalMatrix&&q.uniformMatrix3fv(oe.normalMatrix,!1,r._normalMatrix.elements),null!==oe.modelMatrix&&q.uniformMatrix4fv(oe.modelMatrix,!1,r.matrixWorld.elements),re}function E(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLightColor.needsUpdate=t,e.directionalLightDirection.needsUpdate=t,e.pointLightColor.needsUpdate=t,e.pointLightPosition.needsUpdate=t,e.pointLightDistance.needsUpdate=t,e.pointLightDecay.needsUpdate=t,e.spotLightColor.needsUpdate=t,e.spotLightPosition.needsUpdate=t,e.spotLightDistance.needsUpdate=t,e.spotLightDirection.needsUpdate=t,e.spotLightAngleCos.needsUpdate=t,e.spotLightExponent.needsUpdate=t,e.spotLightDecay.needsUpdate=t,e.hemisphereLightSkyColor.needsUpdate=t,e.hemisphereLightGroundColor.needsUpdate=t,e.hemisphereLightDirection.needsUpdate=t}function y(){var e=te;return e>=_e&&THREE.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+_e),te+=1,e}function _(e,t){e._modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld),e._normalMatrix.getNormalMatrix(e._modelViewMatrix)}function T(e,t,n,i){e[t]=n.r*i,e[t+1]=n.g*i,e[t+2]=n.b*i}function b(e,t,n){n?(q.texParameteri(e,q.TEXTURE_WRAP_S,H(t.wrapS)),q.texParameteri(e,q.TEXTURE_WRAP_T,H(t.wrapT)),q.texParameteri(e,q.TEXTURE_MAG_FILTER,H(t.magFilter)),q.texParameteri(e,q.TEXTURE_MIN_FILTER,H(t.minFilter))):(q.texParameteri(e,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(e,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE),t.wrapS===THREE.ClampToEdgeWrapping&&t.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+t.sourceFile+" )"),q.texParameteri(e,q.TEXTURE_MAG_FILTER,R(t.magFilter)),q.texParameteri(e,q.TEXTURE_MIN_FILTER,R(t.minFilter)),t.minFilter!==THREE.NearestFilter&&t.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+t.sourceFile+" )")),(n=ge.get("EXT_texture_filter_anisotropic"))&&t.type!==THREE.FloatType&&t.type!==THREE.HalfFloatType&&(1<t.anisotropy||t.__currentAnisotropy)&&(q.texParameterf(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,X.getMaxAnisotropy())),t.__currentAnisotropy=t.anisotropy)}function w(e,t){if(e.width>t||e.height>t){var n=t/Math.max(e.width,e.height),i=document.createElement("canvas");return i.width=Math.floor(e.width*n),i.height=Math.floor(e.height*n),i.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,i.width,i.height),THREE.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+i.width+"x"+i.height,e),i}return e}function x(e,t){q.bindRenderbuffer(q.RENDERBUFFER,e),t.depthBuffer&&!t.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_COMPONENT16,t.width,t.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,e)):t.depthBuffer&&t.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_STENCIL,t.width,t.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,e)):q.renderbufferStorage(q.RENDERBUFFER,q.RGBA4,t.width,t.height)}function R(e){return e===THREE.NearestFilter||e===THREE.NearestMipMapNearestFilter||e===THREE.NearestMipMapLinearFilter?q.NEAREST:q.LINEAR}function H(e){var t;if(e===THREE.RepeatWrapping)return q.REPEAT;if(e===THREE.ClampToEdgeWrapping)return q.CLAMP_TO_EDGE;if(e===THREE.MirroredRepeatWrapping)return q.MIRRORED_REPEAT;if(e===THREE.NearestFilter)return q.NEAREST;if(e===THREE.NearestMipMapNearestFilter)return q.NEAREST_MIPMAP_NEAREST;if(e===THREE.NearestMipMapLinearFilter)return q.NEAREST_MIPMAP_LINEAR;if(e===THREE.LinearFilter)return q.LINEAR;if(e===THREE.LinearMipMapNearestFilter)return q.LINEAR_MIPMAP_NEAREST;if(e===THREE.LinearMipMapLinearFilter)return q.LINEAR_MIPMAP_LINEAR;if(e===THREE.UnsignedByteType)return q.UNSIGNED_BYTE;if(e===THREE.UnsignedShort4444Type)return q.UNSIGNED_SHORT_4_4_4_4;if(e===THREE.UnsignedShort5551Type)return q.UNSIGNED_SHORT_5_5_5_1;if(e===THREE.UnsignedShort565Type)return q.UNSIGNED_SHORT_5_6_5;if(e===THREE.ByteType)return q.BYTE;if(e===THREE.ShortType)return q.SHORT;if(e===THREE.UnsignedShortType)return q.UNSIGNED_SHORT;if(e===THREE.IntType)return q.INT;if(e===THREE.UnsignedIntType)return q.UNSIGNED_INT;if(e===THREE.FloatType)return q.FLOAT;if(null!==(t=ge.get("OES_texture_half_float"))&&e===THREE.HalfFloatType)return t.HALF_FLOAT_OES;if(e===THREE.AlphaFormat)return q.ALPHA;if(e===THREE.RGBFormat)return q.RGB;if(e===THREE.RGBAFormat)return q.RGBA;if(e===THREE.LuminanceFormat)return q.LUMINANCE;if(e===THREE.LuminanceAlphaFormat)return q.LUMINANCE_ALPHA;if(e===THREE.AddEquation)return q.FUNC_ADD;if(e===THREE.SubtractEquation)return q.FUNC_SUBTRACT;if(e===THREE.ReverseSubtractEquation)return q.FUNC_REVERSE_SUBTRACT;if(e===THREE.ZeroFactor)return q.ZERO;if(e===THREE.OneFactor)return q.ONE;if(e===THREE.SrcColorFactor)return q.SRC_COLOR;if(e===THREE.OneMinusSrcColorFactor)return q.ONE_MINUS_SRC_COLOR;if(e===THREE.SrcAlphaFactor)return q.SRC_ALPHA;if(e===THREE.OneMinusSrcAlphaFactor)return q.ONE_MINUS_SRC_ALPHA;if(e===THREE.DstAlphaFactor)return q.DST_ALPHA;if(e===THREE.OneMinusDstAlphaFactor)return q.ONE_MINUS_DST_ALPHA;if(e===THREE.DstColorFactor)return q.DST_COLOR;if(e===THREE.OneMinusDstColorFactor)return q.ONE_MINUS_DST_COLOR;if(e===THREE.SrcAlphaSaturateFactor)return q.SRC_ALPHA_SATURATE;if(null!==(t=ge.get("WEBGL_compressed_texture_s3tc"))){if(e===THREE.RGB_S3TC_DXT1_Format)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===THREE.RGBA_S3TC_DXT1_Format)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===THREE.RGBA_S3TC_DXT3_Format)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===THREE.RGBA_S3TC_DXT5_Format)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(null!==(t=ge.get("WEBGL_compressed_texture_pvrtc"))){if(e===THREE.RGB_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===THREE.RGB_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===THREE.RGBA_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===THREE.RGBA_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(null!==(t=ge.get("EXT_blend_minmax"))){if(e===THREE.MinEquation)return t.MIN_EXT;if(e===THREE.MaxEquation)return t.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var S=void 0!==(e=e||{}).canvas?e.canvas:document.createElement("canvas"),M=void 0!==e.context?e.context:null,C=1,A=void 0!==e.precision?e.precision:"highp",k=void 0!==e.alpha&&e.alpha,P=void 0===e.depth||e.depth,D=void 0===e.stencil||e.stencil,L=void 0!==e.antialias&&e.antialias,O=void 0===e.premultipliedAlpha||e.premultipliedAlpha,F=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,N=void 0!==e.logarithmicDepthBuffer&&e.logarithmicDepthBuffer,I=new THREE.Color(0),B=0,z=[],V={},U=[],j=[],W=[],G=[],Y=[];this.domElement=S,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.gammaFactor=2,this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1,this.shadowMapType=THREE.PCFShadowMap,this.shadowMapCullFace=THREE.CullFaceFront,this.shadowMapCascade=this.shadowMapDebug=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var q,X=this,$=[],Z=null,K=null,Q=-1,J="",ee=null,te=0,ne=0,ie=0,re=S.width,oe=S.height,ae=0,se=0,le=new THREE.Frustum,ue=new THREE.Matrix4,ce=new THREE.Vector3,he=new THREE.Vector3,de=!0,fe={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};try{var pe={alpha:k,depth:P,stencil:D,antialias:L,premultipliedAlpha:O,preserveDrawingBuffer:F};if(null===(q=M||S.getContext("webgl",pe)||S.getContext("experimental-webgl",pe))){if(null!==S.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}S.addEventListener("webglcontextlost",function(e){e.preventDefault(),ye(),Ee(),V={}},!1)}catch(e){THREE.error("THREE.WebGLRenderer: "+e)}var me=new THREE.WebGLState(q,H);void 0===q.getShaderPrecisionFormat&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var ge=new THREE.WebGLExtensions(q);ge.get("OES_texture_float"),ge.get("OES_texture_float_linear"),ge.get("OES_texture_half_float"),ge.get("OES_texture_half_float_linear"),ge.get("OES_standard_derivatives"),N&&ge.get("EXT_frag_depth");var ve=function(e,t,n,i){!0===O&&(e*=i,t*=i,n*=i),q.clearColor(e,t,n,i)},Ee=function(){q.clearColor(0,0,0,1),q.clearDepth(1),q.clearStencil(0),q.enable(q.DEPTH_TEST),q.depthFunc(q.LEQUAL),q.frontFace(q.CCW),q.cullFace(q.BACK),q.enable(q.CULL_FACE),q.enable(q.BLEND),q.blendEquation(q.FUNC_ADD),q.blendFunc(q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA),q.viewport(ne,ie,re,oe),ve(I.r,I.g,I.b,B)},ye=function(){ee=Z=null,J="",Q=-1,de=!0,me.reset()};Ee(),this.context=q,this.state=me;var _e=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS),Te=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS),be=q.getParameter(q.MAX_TEXTURE_SIZE),we=q.getParameter(q.MAX_CUBE_MAP_TEXTURE_SIZE),xe=Te>0,Re=xe&&ge.get("OES_texture_float"),He=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.HIGH_FLOAT),Se=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.MEDIUM_FLOAT),Me=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT),Ce=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.MEDIUM_FLOAT),Ae=function(){var e;return function(){if(void 0!==e)return e;if(e=[],ge.get("WEBGL_compressed_texture_pvrtc")||ge.get("WEBGL_compressed_texture_s3tc"))for(var t=q.getParameter(q.COMPRESSED_TEXTURE_FORMATS),n=0;n<t.length;n++)e.push(t[n]);return e}}(),ke=0<He.precision&&0<Me.precision,Pe=0<Se.precision&&0<Ce.precision;"highp"!==A||ke||(Pe?(A="mediump",THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(A="lowp",THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp."))),"mediump"!==A||Pe||(A="lowp",THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var De=new THREE.ShadowMapPlugin(this,z,V,U),Le=new THREE.SpritePlugin(this,G),Oe=new THREE.LensFlarePlugin(this,Y);this.getContext=function(){return q},this.forceContextLoss=function(){ge.get("WEBGL_lose_context").loseContext()},this.supportsVertexTextures=function(){return xe},this.supportsFloatTextures=function(){return ge.get("OES_texture_float")},this.supportsHalfFloatTextures=function(){return ge.get("OES_texture_half_float")},this.supportsStandardDerivatives=function(){return ge.get("OES_standard_derivatives")},this.supportsCompressedTextureS3TC=function(){return ge.get("WEBGL_compressed_texture_s3tc")},this.supportsCompressedTexturePVRTC=function(){return ge.get("WEBGL_compressed_texture_pvrtc")},this.supportsBlendMinMax=function(){return ge.get("EXT_blend_minmax")},this.getMaxAnisotropy=function(){var e;return function(){if(void 0!==e)return e;var t=ge.get("EXT_texture_filter_anisotropic");return e=null!==t?q.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return A},this.getPixelRatio=function(){return C},this.setPixelRatio=function(e){C=e},this.setSize=function(e,t,n){S.width=e*C,S.height=t*C,!1!==n&&(S.style.width=e+"px",S.style.height=t+"px"),this.setViewport(0,0,e,t)},this.setViewport=function(e,t,n,i){ne=e*C,ie=t*C,re=n*C,oe=i*C,q.viewport(ne,ie,re,oe)},this.setScissor=function(e,t,n,i){q.scissor(e*C,t*C,n*C,i*C)},this.enableScissorTest=function(e){e?q.enable(q.SCISSOR_TEST):q.disable(q.SCISSOR_TEST)},this.getClearColor=function(){return I},this.setClearColor=function(e,t){I.set(e),B=void 0!==t?t:1,ve(I.r,I.g,I.b,B)},this.getClearAlpha=function(){return B},this.setClearAlpha=function(e){B=e,ve(I.r,I.g,I.b,B)},this.clear=function(e,t,n){var i=0;(void 0===e||e)&&(i|=q.COLOR_BUFFER_BIT),(void 0===t||t)&&(i|=q.DEPTH_BUFFER_BIT),(void 0===n||n)&&(i|=q.STENCIL_BUFFER_BIT),q.clear(i)},this.clearColor=function(){q.clear(q.COLOR_BUFFER_BIT)},this.clearDepth=function(){q.clear(q.DEPTH_BUFFER_BIT)},this.clearStencil=function(){q.clear(q.STENCIL_BUFFER_BIT)},this.clearTarget=function(e,t,n,i){this.setRenderTarget(e),this.clear(t,n,i)},this.resetGLState=ye;var Fe=function(e){e.target.traverse(function(e){if(e.removeEventListener("remove",Fe),e instanceof THREE.Mesh||e instanceof THREE.PointCloud||e instanceof THREE.Line)delete V[e.id];else if(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)for(var t=U,n=t.length-1;n>=0;n--)t[n].object===e&&t.splice(n,1);delete e.__webglInit,delete e._modelViewMatrix,delete e._normalMatrix,delete e.__webglActive})},Ne=function(e){if((e=e.target).removeEventListener("dispose",Ne),delete e.__webglInit,e instanceof THREE.BufferGeometry){for(var t in e.attributes){void 0!==(n=e.attributes[t]).buffer&&(q.deleteBuffer(n.buffer),delete n.buffer)}X.info.memory.geometries--}else if(void 0!==(t=je[e.id])){for(var n=0,i=t.length;i>n;n++){var r=t[n];if(void 0!==r.numMorphTargets){for(var o=0,a=r.numMorphTargets;a>o;o++)q.deleteBuffer(r.__webglMorphTargetsBuffers[o]);delete r.__webglMorphTargetsBuffers}if(void 0!==r.numMorphNormals){for(o=0,a=r.numMorphNormals;a>o;o++)q.deleteBuffer(r.__webglMorphNormalsBuffers[o]);delete r.__webglMorphNormalsBuffers}Ve(r)}delete je[e.id]}else Ve(e);J=""},Ie=function(e){(e=e.target).removeEventListener("dispose",Ie),e.image&&e.image.__webglTextureCube?(q.deleteTexture(e.image.__webglTextureCube),delete e.image.__webglTextureCube):void 0!==e.__webglInit&&(q.deleteTexture(e.__webglTexture),delete e.__webglTexture,delete e.__webglInit),X.info.memory.textures--},Be=function(e){if((e=e.target).removeEventListener("dispose",Be),e&&void 0!==e.__webglTexture){if(q.deleteTexture(e.__webglTexture),delete e.__webglTexture,e instanceof THREE.WebGLRenderTargetCube)for(var t=0;6>t;t++)q.deleteFramebuffer(e.__webglFramebuffer[t]),q.deleteRenderbuffer(e.__webglRenderbuffer[t]);else q.deleteFramebuffer(e.__webglFramebuffer),q.deleteRenderbuffer(e.__webglRenderbuffer);delete e.__webglFramebuffer,delete e.__webglRenderbuffer}X.info.memory.textures--},ze=function(e){(e=e.target).removeEventListener("dispose",ze),Ue(e)},Ve=function(e){for(var t="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),n=0,i=t.length;i>n;n++){var r=t[n];void 0!==e[r]&&(q.deleteBuffer(e[r]),delete e[r])}if(void 0!==e.__webglCustomAttributesList){for(r in e.__webglCustomAttributesList)q.deleteBuffer(e.__webglCustomAttributesList[r].buffer);delete e.__webglCustomAttributesList}X.info.memory.geometries--},Ue=function(e){var t=e.program.program;if(void 0!==t){e.program=void 0;var n,i,r=!1;for(e=0,n=$.length;n>e;e++)if((i=$[e]).program===t){i.usedTimes--,0===i.usedTimes&&(r=!0);break}if(!0===r){for(r=[],e=0,n=$.length;n>e;e++)(i=$[e]).program!==t&&r.push(i);$=r,q.deleteProgram(t),X.info.memory.programs--}}};this.renderBufferImmediate=function(e,t,n){if(me.initAttributes(),e.hasPositions&&!e.__webglVertexBuffer&&(e.__webglVertexBuffer=q.createBuffer()),e.hasNormals&&!e.__webglNormalBuffer&&(e.__webglNormalBuffer=q.createBuffer()),e.hasUvs&&!e.__webglUvBuffer&&(e.__webglUvBuffer=q.createBuffer()),e.hasColors&&!e.__webglColorBuffer&&(e.__webglColorBuffer=q.createBuffer()),e.hasPositions&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglVertexBuffer),q.bufferData(q.ARRAY_BUFFER,e.positionArray,q.DYNAMIC_DRAW),me.enableAttribute(t.attributes.position),q.vertexAttribPointer(t.attributes.position,3,q.FLOAT,!1,0,0)),e.hasNormals){if(q.bindBuffer(q.ARRAY_BUFFER,e.__webglNormalBuffer),0==n instanceof THREE.MeshPhongMaterial&&n.shading===THREE.FlatShading){var i,r,o,a,s,l,u,c,h=3*e.count;for(c=0;h>c;c+=9)i=(u=e.normalArray)[c],r=u[c+1],o=u[c+2],a=u[c+3],s=u[c+4],l=u[c+5],i=(i+a+u[c+6])/3,r=(r+s+u[c+7])/3,o=(o+l+u[c+8])/3,u[c]=i,u[c+1]=r,u[c+2]=o,u[c+3]=i,u[c+4]=r,u[c+5]=o,u[c+6]=i,u[c+7]=r,u[c+8]=o}q.bufferData(q.ARRAY_BUFFER,e.normalArray,q.DYNAMIC_DRAW),me.enableAttribute(t.attributes.normal),q.vertexAttribPointer(t.attributes.normal,3,q.FLOAT,!1,0,0)}e.hasUvs&&n.map&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglUvBuffer),q.bufferData(q.ARRAY_BUFFER,e.uvArray,q.DYNAMIC_DRAW),me.enableAttribute(t.attributes.uv),q.vertexAttribPointer(t.attributes.uv,2,q.FLOAT,!1,0,0)),e.hasColors&&n.vertexColors!==THREE.NoColors&&(q.bindBuffer(q.ARRAY_BUFFER,e.__webglColorBuffer),q.bufferData(q.ARRAY_BUFFER,e.colorArray,q.DYNAMIC_DRAW),me.enableAttribute(t.attributes.color),q.vertexAttribPointer(t.attributes.color,3,q.FLOAT,!1,0,0)),me.disableUnusedAttributes(),q.drawArrays(q.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,r,o,a){if(!1!==r.visible)if(f(a),e=v(e,t,n,r,a),t=!1,(n="direct_"+o.id+"_"+e.id+"_"+(r.wireframe?1:0))!==J&&(J=n,t=!0),t&&me.initAttributes(),a instanceof THREE.Mesh){a=!0===r.wireframe?q.LINES:q.TRIANGLES;var s,l,u=o.attributes.index;if(u)if(u.array instanceof Uint32Array&&ge.get("OES_element_index_uint")?(s=q.UNSIGNED_INT,l=4):(s=q.UNSIGNED_SHORT,l=2),0===(n=o.offsets).length)t&&(i(r,e,o,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,u.buffer)),q.drawElements(a,u.array.length,s,0),X.info.render.calls++,X.info.render.vertices+=u.array.length,X.info.render.faces+=u.array.length/3;else{t=!0;for(var c=0,h=n.length;h>c;c++){var d=n[c].index;t&&(i(r,e,o,d),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,u.buffer)),q.drawElements(a,n[c].count,s,n[c].start*l),X.info.render.calls++,X.info.render.vertices+=n[c].count,X.info.render.faces+=n[c].count/3}}else t&&i(r,e,o,0),r=o.attributes.position,q.drawArrays(a,0,r.array.length/r.itemSize),X.info.render.calls++,X.info.render.vertices+=r.array.length/r.itemSize,X.info.render.faces+=r.array.length/(3*r.itemSize)}else if(a instanceof THREE.PointCloud)if(a=q.POINTS,u=o.attributes.index)if(u.array instanceof Uint32Array&&ge.get("OES_element_index_uint")?(s=q.UNSIGNED_INT,l=4):(s=q.UNSIGNED_SHORT,l=2),0===(n=o.offsets).length)t&&(i(r,e,o,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,u.buffer)),q.drawElements(a,u.array.length,s,0),X.info.render.calls++,X.info.render.points+=u.array.length;else for(1<n.length&&(t=!0),c=0,h=n.length;h>c;c++)d=n[c].index,t&&(i(r,e,o,d),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,u.buffer)),q.drawElements(a,n[c].count,s,n[c].start*l),X.info.render.calls++,X.info.render.points+=n[c].count;else if(t&&i(r,e,o,0),r=o.attributes.position,0===(n=o.offsets).length)q.drawArrays(a,0,r.array.length/3),X.info.render.calls++,X.info.render.points+=r.array.length/3;else for(c=0,h=n.length;h>c;c++)q.drawArrays(a,n[c].index,n[c].count),X.info.render.calls++,X.info.render.points+=n[c].count;else if(a instanceof THREE.Line)if(a=a.mode===THREE.LineStrip?q.LINE_STRIP:q.LINES,me.setLineWidth(r.linewidth*C),u=o.attributes.index)if(u.array instanceof Uint32Array?(s=q.UNSIGNED_INT,l=4):(s=q.UNSIGNED_SHORT,l=2),0===(n=o.offsets).length)t&&(i(r,e,o,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,u.buffer)),q.drawElements(a,u.array.length,s,0),X.info.render.calls++,X.info.render.vertices+=u.array.length;else for(1<n.length&&(t=!0),c=0,h=n.length;h>c;c++)d=n[c].index,t&&(i(r,e,o,d),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,u.buffer)),q.drawElements(a,n[c].count,s,n[c].start*l),X.info.render.calls++,X.info.render.vertices+=n[c].count;else if(t&&i(r,e,o,0),r=o.attributes.position,0===(n=o.offsets).length)q.drawArrays(a,0,r.array.length/3),X.info.render.calls++,X.info.render.vertices+=r.array.length/3;else for(c=0,h=n.length;h>c;c++)q.drawArrays(a,n[c].index,n[c].count),X.info.render.calls++,X.info.render.vertices+=n[c].count},this.renderBuffer=function(e,t,n,i,r,o){if(!1!==i.visible){if(f(o),t=(n=v(e,t,n,i,o)).attributes,e=!1,(n=r.id+"_"+n.id+"_"+(i.wireframe?1:0))!==J&&(J=n,e=!0),e&&me.initAttributes(),!i.morphTargets&&0<=t.position)e&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglVertexBuffer),me.enableAttribute(t.position),q.vertexAttribPointer(t.position,3,q.FLOAT,!1,0,0));else if(o.morphTargetBase){if(n=i.program.attributes,-1!==o.morphTargetBase&&0<=n.position?(q.bindBuffer(q.ARRAY_BUFFER,r.__webglMorphTargetsBuffers[o.morphTargetBase]),me.enableAttribute(n.position),q.vertexAttribPointer(n.position,3,q.FLOAT,!1,0,0)):0<=n.position&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglVertexBuffer),me.enableAttribute(n.position),q.vertexAttribPointer(n.position,3,q.FLOAT,!1,0,0)),o.morphTargetForcedOrder.length)for(var s,l=0,u=o.morphTargetForcedOrder,c=o.morphTargetInfluences;l<i.numSupportedMorphTargets&&l<u.length;)(s=n["morphTarget"+l])>=0&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglMorphTargetsBuffers[u[l]]),me.enableAttribute(s),q.vertexAttribPointer(s,3,q.FLOAT,!1,0,0)),(s=n["morphNormal"+l])>=0&&i.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglMorphNormalsBuffers[u[l]]),me.enableAttribute(s),q.vertexAttribPointer(s,3,q.FLOAT,!1,0,0)),o.__webglMorphTargetInfluences[l]=c[u[l]],l++;else{for(u=[],c=o.morphTargetInfluences,l=o.geometry.morphTargets,c.length>l.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),c.length=l.length),l=0,s=c.length;s>l;l++)u.push([c[l],l]);u.length>i.numSupportedMorphTargets?(u.sort(a),u.length=i.numSupportedMorphTargets):u.length>i.numSupportedMorphNormals?u.sort(a):0===u.length&&u.push([0,0]);l=0;for(var h=i.numSupportedMorphTargets;h>l;l++)if(u[l]){var d=u[l][1];(s=n["morphTarget"+l])>=0&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglMorphTargetsBuffers[d]),me.enableAttribute(s),q.vertexAttribPointer(s,3,q.FLOAT,!1,0,0)),(s=n["morphNormal"+l])>=0&&i.morphNormals&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglMorphNormalsBuffers[d]),me.enableAttribute(s),q.vertexAttribPointer(s,3,q.FLOAT,!1,0,0)),o.__webglMorphTargetInfluences[l]=c[d]}else o.__webglMorphTargetInfluences[l]=0}null!==i.program.uniforms.morphTargetInfluences&&q.uniform1fv(i.program.uniforms.morphTargetInfluences,o.__webglMorphTargetInfluences)}if(e){if(r.__webglCustomAttributesList)for(n=0,c=r.__webglCustomAttributesList.length;c>n;n++)0<=t[(u=r.__webglCustomAttributesList[n]).buffer.belongsToAttribute]&&(q.bindBuffer(q.ARRAY_BUFFER,u.buffer),me.enableAttribute(t[u.buffer.belongsToAttribute]),q.vertexAttribPointer(t[u.buffer.belongsToAttribute],u.size,q.FLOAT,!1,0,0));0<=t.color&&(0<o.geometry.colors.length||0<o.geometry.faces.length?(q.bindBuffer(q.ARRAY_BUFFER,r.__webglColorBuffer),me.enableAttribute(t.color),q.vertexAttribPointer(t.color,3,q.FLOAT,!1,0,0)):void 0!==i.defaultAttributeValues&&q.vertexAttrib3fv(t.color,i.defaultAttributeValues.color)),0<=t.normal&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglNormalBuffer),me.enableAttribute(t.normal),q.vertexAttribPointer(t.normal,3,q.FLOAT,!1,0,0)),0<=t.tangent&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglTangentBuffer),me.enableAttribute(t.tangent),q.vertexAttribPointer(t.tangent,4,q.FLOAT,!1,0,0)),0<=t.uv&&(o.geometry.faceVertexUvs[0]?(q.bindBuffer(q.ARRAY_BUFFER,r.__webglUVBuffer),me.enableAttribute(t.uv),q.vertexAttribPointer(t.uv,2,q.FLOAT,!1,0,0)):void 0!==i.defaultAttributeValues&&q.vertexAttrib2fv(t.uv,i.defaultAttributeValues.uv)),0<=t.uv2&&(o.geometry.faceVertexUvs[1]?(q.bindBuffer(q.ARRAY_BUFFER,r.__webglUV2Buffer),me.enableAttribute(t.uv2),q.vertexAttribPointer(t.uv2,2,q.FLOAT,!1,0,0)):void 0!==i.defaultAttributeValues&&q.vertexAttrib2fv(t.uv2,i.defaultAttributeValues.uv2)),i.skinning&&0<=t.skinIndex&&0<=t.skinWeight&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglSkinIndicesBuffer),me.enableAttribute(t.skinIndex),q.vertexAttribPointer(t.skinIndex,4,q.FLOAT,!1,0,0),q.bindBuffer(q.ARRAY_BUFFER,r.__webglSkinWeightsBuffer),me.enableAttribute(t.skinWeight),q.vertexAttribPointer(t.skinWeight,4,q.FLOAT,!1,0,0)),0<=t.lineDistance&&(q.bindBuffer(q.ARRAY_BUFFER,r.__webglLineDistanceBuffer),me.enableAttribute(t.lineDistance),q.vertexAttribPointer(t.lineDistance,1,q.FLOAT,!1,0,0))}me.disableUnusedAttributes(),o instanceof THREE.Mesh?(o=r.__typeArray===Uint32Array?q.UNSIGNED_INT:q.UNSIGNED_SHORT,i.wireframe?(me.setLineWidth(i.wireframeLinewidth*C),e&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,r.__webglLineBuffer),q.drawElements(q.LINES,r.__webglLineCount,o,0)):(e&&q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,r.__webglFaceBuffer),q.drawElements(q.TRIANGLES,r.__webglFaceCount,o,0)),X.info.render.calls++,X.info.render.vertices+=r.__webglFaceCount,X.info.render.faces+=r.__webglFaceCount/3):o instanceof THREE.Line?(o=o.mode===THREE.LineStrip?q.LINE_STRIP:q.LINES,me.setLineWidth(i.linewidth*C),q.drawArrays(o,0,r.__webglLineCount),X.info.render.calls++):o instanceof THREE.PointCloud&&(q.drawArrays(q.POINTS,0,r.__webglParticleCount),X.info.render.calls++,X.info.render.points+=r.__webglParticleCount)}},this.render=function(e,t,n,i){if(0==t instanceof THREE.Camera)THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var a=e.fog;J="",Q=-1,ee=null,de=!0,!0===e.autoUpdate&&e.updateMatrixWorld(),void 0===t.parent&&t.updateMatrixWorld(),e.traverse(function(e){e instanceof THREE.SkinnedMesh&&e.skeleton.update()}),t.matrixWorldInverse.getInverse(t.matrixWorld),ue.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),le.setFromMatrix(ue),z.length=0,j.length=0,W.length=0,G.length=0,Y.length=0,s(e),!0===X.sortObjects&&(j.sort(r),W.sort(o)),De.render(e,t),X.info.render.calls=0,X.info.render.vertices=0,X.info.render.faces=0,X.info.render.points=0,this.setRenderTarget(n),(this.autoClear||i)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),i=0;for(var h=U.length;h>i;i++){var d=U[i],f=d.object;f.visible&&(_(f,t),c(d))}e.overrideMaterial?(g(i=e.overrideMaterial),l(j,t,z,a,i),l(W,t,z,a,i),u(U,"",t,z,a,i)):(me.setBlending(THREE.NoBlending),l(j,t,z,a,null),u(U,"opaque",t,z,a,null),l(W,t,z,a,null),u(U,"transparent",t,z,a,null)),Le.render(e,t),Oe.render(e,t,ae,se),n&&n.generateMipmaps&&n.minFilter!==THREE.NearestFilter&&n.minFilter!==THREE.LinearFilter&&function(e){e instanceof THREE.WebGLRenderTargetCube?(q.bindTexture(q.TEXTURE_CUBE_MAP,e.__webglTexture),q.generateMipmap(q.TEXTURE_CUBE_MAP),q.bindTexture(q.TEXTURE_CUBE_MAP,null)):(q.bindTexture(q.TEXTURE_2D,e.__webglTexture),q.generateMipmap(q.TEXTURE_2D),q.bindTexture(q.TEXTURE_2D,null))}(n),me.setDepthTest(!0),me.setDepthWrite(!0),me.setColorWrite(!0)}},this.renderImmediateObject=function(e,t,n,i,r){var o=v(e,t,n,i,r);J="",X.setMaterialFaces(i),r.immediateRenderCallback?r.immediateRenderCallback(o,q,le):r.render(function(e){X.renderBufferImmediate(e,o,i)})};var je={},We=0,Ge={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(e,t){e===THREE.CullFaceNone?q.disable(q.CULL_FACE):(t===THREE.FrontFaceDirectionCW?q.frontFace(q.CW):q.frontFace(q.CCW),e===THREE.CullFaceBack?q.cullFace(q.BACK):e===THREE.CullFaceFront?q.cullFace(q.FRONT):q.cullFace(q.FRONT_AND_BACK),q.enable(q.CULL_FACE))},this.setMaterialFaces=function(e){me.setDoubleSided(e.side===THREE.DoubleSide),me.setFlipSided(e.side===THREE.BackSide)},this.uploadTexture=function(e){void 0===e.__webglInit&&(e.__webglInit=!0,e.addEventListener("dispose",Ie),e.__webglTexture=q.createTexture(),X.info.memory.textures++),q.bindTexture(q.TEXTURE_2D,e.__webglTexture),q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,e.flipY),q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),q.pixelStorei(q.UNPACK_ALIGNMENT,e.unpackAlignment),e.image=w(e.image,be);var t=e.image,n=THREE.Math.isPowerOfTwo(t.width)&&THREE.Math.isPowerOfTwo(t.height),i=H(e.format),r=H(e.type);b(q.TEXTURE_2D,e,n);var o=e.mipmaps;if(e instanceof THREE.DataTexture)if(0<o.length&&n){for(var a=0,s=o.length;s>a;a++)t=o[a],q.texImage2D(q.TEXTURE_2D,a,i,t.width,t.height,0,i,r,t.data);e.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,i,t.width,t.height,0,i,r,t.data);else if(e instanceof THREE.CompressedTexture)for(a=0,s=o.length;s>a;a++)t=o[a],e.format!==THREE.RGBAFormat&&e.format!==THREE.RGBFormat?-1<Ae().indexOf(i)?q.compressedTexImage2D(q.TEXTURE_2D,a,i,t.width,t.height,0,t.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):q.texImage2D(q.TEXTURE_2D,a,i,t.width,t.height,0,i,r,t.data);else if(0<o.length&&n){for(a=0,s=o.length;s>a;a++)t=o[a],q.texImage2D(q.TEXTURE_2D,a,i,i,r,t);e.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,i,i,r,e.image);e.generateMipmaps&&n&&q.generateMipmap(q.TEXTURE_2D),e.needsUpdate=!1,e.onUpdate&&e.onUpdate()},this.setTexture=function(e,t){q.activeTexture(q.TEXTURE0+t),e.needsUpdate?X.uploadTexture(e):q.bindTexture(q.TEXTURE_2D,e.__webglTexture)},this.setRenderTarget=function(e){var t=e instanceof THREE.WebGLRenderTargetCube;if(e&&void 0===e.__webglFramebuffer){void 0===e.depthBuffer&&(e.depthBuffer=!0),void 0===e.stencilBuffer&&(e.stencilBuffer=!0),e.addEventListener("dispose",Be),e.__webglTexture=q.createTexture(),X.info.memory.textures++;var n=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),i=H(e.format),r=H(e.type);if(t){e.__webglFramebuffer=[],e.__webglRenderbuffer=[],q.bindTexture(q.TEXTURE_CUBE_MAP,e.__webglTexture),b(q.TEXTURE_CUBE_MAP,e,n);for(var o=0;6>o;o++){e.__webglFramebuffer[o]=q.createFramebuffer(),e.__webglRenderbuffer[o]=q.createRenderbuffer(),q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,i,e.width,e.height,0,i,r,null);var a=e,s=q.TEXTURE_CUBE_MAP_POSITIVE_X+o;q.bindFramebuffer(q.FRAMEBUFFER,e.__webglFramebuffer[o]),q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,s,a.__webglTexture,0),x(e.__webglRenderbuffer[o],e)}n&&q.generateMipmap(q.TEXTURE_CUBE_MAP)}else e.__webglFramebuffer=q.createFramebuffer(),e.__webglRenderbuffer=e.shareDepthFrom?e.shareDepthFrom.__webglRenderbuffer:q.createRenderbuffer(),q.bindTexture(q.TEXTURE_2D,e.__webglTexture),b(q.TEXTURE_2D,e,n),q.texImage2D(q.TEXTURE_2D,0,i,e.width,e.height,0,i,r,null),i=q.TEXTURE_2D,q.bindFramebuffer(q.FRAMEBUFFER,e.__webglFramebuffer),q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,i,e.__webglTexture,0),e.shareDepthFrom?e.depthBuffer&&!e.stencilBuffer?q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,e.__webglRenderbuffer):e.depthBuffer&&e.stencilBuffer&&q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,e.__webglRenderbuffer):x(e.__webglRenderbuffer,e),n&&q.generateMipmap(q.TEXTURE_2D);t?q.bindTexture(q.TEXTURE_CUBE_MAP,null):q.bindTexture(q.TEXTURE_2D,null),q.bindRenderbuffer(q.RENDERBUFFER,null),q.bindFramebuffer(q.FRAMEBUFFER,null)}e?(t=t?e.__webglFramebuffer[e.activeCubeFace]:e.__webglFramebuffer,n=e.width,e=e.height,r=i=0):(t=null,n=re,e=oe,i=ne,r=ie),t!==K&&(q.bindFramebuffer(q.FRAMEBUFFER,t),q.viewport(i,r,n,e),K=t),ae=n,se=e},this.readRenderTargetPixels=function(e,t,n,i,r,o){if(e instanceof THREE.WebGLRenderTarget){if(e.__webglFramebuffer)if(e.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var a=!1;e.__webglFramebuffer!==K&&(q.bindFramebuffer(q.FRAMEBUFFER,e.__webglFramebuffer),a=!0),q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?q.readPixels(t,n,i,r,q.RGBA,q.UNSIGNED_BYTE,o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),a&&q.bindFramebuffer(q.FRAMEBUFFER,K)}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},THREE.WebGLRenderTarget=function(e,t,n){this.width=e,this.height=t,n=n||{},this.wrapS=void 0!==n.wrapS?n.wrapS:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==n.wrapT?n.wrapT:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==n.magFilter?n.magFilter:THREE.LinearFilter,this.minFilter=void 0!==n.minFilter?n.minFilter:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.format=void 0!==n.format?n.format:THREE.RGBAFormat,this.type=void 0!==n.type?n.type:THREE.UnsignedByteType,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.generateMipmaps=!0,this.shareDepthFrom=void 0!==n.shareDepthFrom?n.shareDepthFrom:null},THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(e,t){this.width=e,this.height=t},clone:function(){var e=new THREE.WebGLRenderTarget(this.width,this.height);return e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.format=this.format,e.type=this.type,e.depthBuffer=this.depthBuffer,e.stencilBuffer=this.stencilBuffer,e.generateMipmaps=this.generateMipmaps,e.shareDepthFrom=this.shareDepthFrom,e},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube=function(e,t,n){THREE.WebGLRenderTarget.call(this,e,t,n),this.activeCubeFace=0},THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube,THREE.WebGLExtensions=function(e){var t={};this.get=function(n){if(void 0!==t[n])return t[n];var i;switch(n){case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return null===i&&THREE.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=i}},THREE.WebGLProgram=function(){var e=0;return function(t,n,i,r){var o=t.context,a=i.defines,s=i.__webglShader.uniforms,l=i.attributes,u=i.__webglShader.vertexShader,c=i.__webglShader.fragmentShader,h=i.index0AttributeName;void 0===h&&!0===r.morphTargets&&(h="position");var d="SHADOWMAP_TYPE_BASIC";r.shadowMapType===THREE.PCFShadowMap?d="SHADOWMAP_TYPE_PCF":r.shadowMapType===THREE.PCFSoftShadowMap&&(d="SHADOWMAP_TYPE_PCF_SOFT");var f="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",m="ENVMAP_BLENDING_MULTIPLY";if(r.envMap){switch(i.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:f="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:f="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:f="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:p="ENVMAP_MODE_REFRACTION"}switch(i.combine){case THREE.MultiplyOperation:m="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:m="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:m="ENVMAP_BLENDING_ADD"}}var g,v,E=0<t.gammaFactor?t.gammaFactor:1;for(var y in g=[],a)!1!==(v=a[y])&&(v="#define "+y+" "+v,g.push(v));for(var _ in g=g.join("\n"),a=o.createProgram(),i instanceof THREE.RawShaderMaterial?t=i="":(i=["precision "+r.precision+" float;","precision "+r.precision+" int;",g,r.supportsVertexTextures?"#define VERTEX_TEXTURES":"",t.gammaInput?"#define GAMMA_INPUT":"",t.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+E,"#define MAX_DIR_LIGHTS "+r.maxDirLights,"#define MAX_POINT_LIGHTS "+r.maxPointLights,"#define MAX_SPOT_LIGHTS "+r.maxSpotLights,"#define MAX_HEMI_LIGHTS "+r.maxHemiLights,"#define MAX_SHADOWS "+r.maxShadows,"#define MAX_BONES "+r.maxBones,r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+p:"",r.lightMap?"#define USE_LIGHTMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals?"#define USE_MORPHNORMALS":"",r.wrapAround?"#define WRAP_AROUND":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+d:"",r.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",r.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"),t=["precision "+r.precision+" float;","precision "+r.precision+" int;",r.bumpMap||r.normalMap||r.flatShading?"#extension GL_OES_standard_derivatives : enable":"",g,"#define MAX_DIR_LIGHTS "+r.maxDirLights,"#define MAX_POINT_LIGHTS "+r.maxPointLights,"#define MAX_SPOT_LIGHTS "+r.maxSpotLights,"#define MAX_HEMI_LIGHTS "+r.maxHemiLights,"#define MAX_SHADOWS "+r.maxShadows,r.alphaTest?"#define ALPHATEST "+r.alphaTest:"",t.gammaInput?"#define GAMMA_INPUT":"",t.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+E,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+f:"",r.envMap?"#define "+p:"",r.envMap?"#define "+m:"",r.lightMap?"#define USE_LIGHTMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.flatShading?"#define FLAT_SHADED":"",r.metal?"#define METAL":"",r.wrapAround?"#define WRAP_AROUND":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+d:"",r.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",r.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n")),u=new THREE.WebGLShader(o,o.VERTEX_SHADER,i+u),c=new THREE.WebGLShader(o,o.FRAGMENT_SHADER,t+c),o.attachShader(a,u),o.attachShader(a,c),void 0!==h&&o.bindAttribLocation(a,0,h),o.linkProgram(a),h=o.getProgramInfoLog(a),!1===o.getProgramParameter(a,o.LINK_STATUS)&&THREE.error("THREE.WebGLProgram: shader error: "+o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(a,o.VALIDATE_STATUS),"gl.getPRogramInfoLog",h),""!==h&&THREE.warn("THREE.WebGLProgram: gl.getProgramInfoLog()"+h),o.deleteShader(u),o.deleteShader(c),h="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" "),r.useVertexTexture?(h.push("boneTexture"),h.push("boneTextureWidth"),h.push("boneTextureHeight")):h.push("boneGlobalMatrices"),r.logarithmicDepthBuffer&&h.push("logDepthBufFC"),s)h.push(_);for(s=h,_={},h=0,t=s.length;t>h;h++)_[d=s[h]]=o.getUniformLocation(a,d);for(this.uniforms=_,h="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" "),s=0;s<r.maxMorphTargets;s++)h.push("morphTarget"+s);for(s=0;s<r.maxMorphNormals;s++)h.push("morphNormal"+s);for(var T in l)h.push(T);for(l={},T=0,s=(r=h).length;s>T;T++)l[_=r[T]]=o.getAttribLocation(a,_);return this.attributes=l,this.attributesKeys=Object.keys(this.attributes),this.id=e++,this.code=n,this.usedTimes=1,this.program=a,this.vertexShader=u,this.fragmentShader=c,this}}(),THREE.WebGLShader=function(e,t,n){return t=e.createShader(t),e.shaderSource(t,n),e.compileShader(t),!1===e.getShaderParameter(t,e.COMPILE_STATUS)&&THREE.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(t)&&THREE.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e.getShaderInfoLog(t),function(e){e=e.split("\n");for(var t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}(n)),t},THREE.WebGLState=function(e,t){var n=new Uint8Array(16),i=new Uint8Array(16),r=null,o=null,a=null,s=null,l=null,u=null,c=null,h=null,d=null,f=null,p=null,m=null,g=null,v=null,E=null,y=null;this.initAttributes=function(){for(var e=0,t=n.length;t>e;e++)n[e]=0},this.enableAttribute=function(t){n[t]=1,0===i[t]&&(e.enableVertexAttribArray(t),i[t]=1)},this.disableUnusedAttributes=function(){for(var t=0,r=i.length;r>t;t++)i[t]!==n[t]&&(e.disableVertexAttribArray(t),i[t]=0)},this.setBlending=function(n,i,h,d,f,p,m){n!==r&&(n===THREE.NoBlending?e.disable(e.BLEND):n===THREE.AdditiveBlending?(e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)):n===THREE.SubtractiveBlending?(e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR)):n===THREE.MultiplyBlending?(e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR)):n===THREE.CustomBlending?e.enable(e.BLEND):(e.enable(e.BLEND),e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)),r=n),n===THREE.CustomBlending?(f=f||i,p=p||h,m=m||d,(i!==o||f!==l)&&(e.blendEquationSeparate(t(i),t(f)),o=i,l=f),(h!==a||d!==s||p!==u||m!==c)&&(e.blendFuncSeparate(t(h),t(d),t(p),t(m)),a=h,s=d,u=p,c=m)):c=u=l=s=a=o=null},this.setDepthTest=function(t){h!==t&&(t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),h=t)},this.setDepthWrite=function(t){d!==t&&(e.depthMask(t),d=t)},this.setColorWrite=function(t){f!==t&&(e.colorMask(t,t,t,t),f=t)},this.setDoubleSided=function(t){p!==t&&(t?e.disable(e.CULL_FACE):e.enable(e.CULL_FACE),p=t)},this.setFlipSided=function(t){m!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),m=t)},this.setLineWidth=function(t){t!==g&&(e.lineWidth(t),g=t)},this.setPolygonOffset=function(t,n,i){v!==t&&(t?e.enable(e.POLYGON_OFFSET_FILL):e.disable(e.POLYGON_OFFSET_FILL),v=t),!t||E===n&&y===i||(e.polygonOffset(n,i),E=n,y=i)},this.reset=function(){for(var e=0;e<i.length;e++)i[e]=0;m=p=f=d=h=r=null}},THREE.LensFlarePlugin=function(e,t){var n,i,r,o,a,s,l,u,c,h,d,f,p,m,g,v,E=e.context;this.render=function(y,_,T,b){if(0!==t.length){y=new THREE.Vector3;var w=b/T,x=.5*T,R=.5*b,H=16/b,S=new THREE.Vector2(H*w,H),M=new THREE.Vector3(1,1,0),C=new THREE.Vector2(1,1);if(void 0===p){H=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]);var A=new Uint16Array([0,1,2,0,2,3]);d=E.createBuffer(),f=E.createBuffer(),E.bindBuffer(E.ARRAY_BUFFER,d),E.bufferData(E.ARRAY_BUFFER,H,E.STATIC_DRAW),E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,f),E.bufferData(E.ELEMENT_ARRAY_BUFFER,A,E.STATIC_DRAW),g=E.createTexture(),v=E.createTexture(),E.bindTexture(E.TEXTURE_2D,g),E.texImage2D(E.TEXTURE_2D,0,E.RGB,16,16,0,E.RGB,E.UNSIGNED_BYTE,null),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MAG_FILTER,E.NEAREST),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MIN_FILTER,E.NEAREST),E.bindTexture(E.TEXTURE_2D,v),E.texImage2D(E.TEXTURE_2D,0,E.RGBA,16,16,0,E.RGBA,E.UNSIGNED_BYTE,null),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MAG_FILTER,E.NEAREST),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MIN_FILTER,E.NEAREST);H=(m=0<E.getParameter(E.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},A=E.createProgram();var k=E.createShader(E.FRAGMENT_SHADER),P=E.createShader(E.VERTEX_SHADER),D="precision "+e.getPrecision()+" float;\n";E.shaderSource(k,D+H.fragmentShader),E.shaderSource(P,D+H.vertexShader),E.compileShader(k),E.compileShader(P),E.attachShader(A,k),E.attachShader(A,P),E.linkProgram(A),p=A,c=E.getAttribLocation(p,"position"),h=E.getAttribLocation(p,"uv"),n=E.getUniformLocation(p,"renderType"),i=E.getUniformLocation(p,"map"),r=E.getUniformLocation(p,"occlusionMap"),o=E.getUniformLocation(p,"opacity"),a=E.getUniformLocation(p,"color"),s=E.getUniformLocation(p,"scale"),l=E.getUniformLocation(p,"rotation"),u=E.getUniformLocation(p,"screenPosition")}for(E.useProgram(p),E.enableVertexAttribArray(c),E.enableVertexAttribArray(h),E.uniform1i(r,0),E.uniform1i(i,1),E.bindBuffer(E.ARRAY_BUFFER,d),E.vertexAttribPointer(c,2,E.FLOAT,!1,16,0),E.vertexAttribPointer(h,2,E.FLOAT,!1,16,8),E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,f),E.disable(E.CULL_FACE),E.depthMask(!1),A=0,k=t.length;k>A;A++)if(H=16/b,S.set(H*w,H),P=t[A],y.set(P.matrixWorld.elements[12],P.matrixWorld.elements[13],P.matrixWorld.elements[14]),y.applyMatrix4(_.matrixWorldInverse),y.applyProjection(_.projectionMatrix),M.copy(y),C.x=M.x*x+x,C.y=M.y*R+R,m||0<C.x&&C.x<T&&0<C.y&&C.y<b){E.activeTexture(E.TEXTURE1),E.bindTexture(E.TEXTURE_2D,g),E.copyTexImage2D(E.TEXTURE_2D,0,E.RGB,C.x-8,C.y-8,16,16,0),E.uniform1i(n,0),E.uniform2f(s,S.x,S.y),E.uniform3f(u,M.x,M.y,M.z),E.disable(E.BLEND),E.enable(E.DEPTH_TEST),E.drawElements(E.TRIANGLES,6,E.UNSIGNED_SHORT,0),E.activeTexture(E.TEXTURE0),E.bindTexture(E.TEXTURE_2D,v),E.copyTexImage2D(E.TEXTURE_2D,0,E.RGBA,C.x-8,C.y-8,16,16,0),E.uniform1i(n,1),E.disable(E.DEPTH_TEST),E.activeTexture(E.TEXTURE1),E.bindTexture(E.TEXTURE_2D,g),E.drawElements(E.TRIANGLES,6,E.UNSIGNED_SHORT,0),P.positionScreen.copy(M),P.customUpdateCallback?P.customUpdateCallback(P):P.updateLensFlares(),E.uniform1i(n,2),E.enable(E.BLEND);D=0;for(var L=P.lensFlares.length;L>D;D++){var O=P.lensFlares[D];.001<O.opacity&&.001<O.scale&&(M.x=O.x,M.y=O.y,M.z=O.z,H=O.size*O.scale/b,S.x=H*w,S.y=H,E.uniform3f(u,M.x,M.y,M.z),E.uniform2f(s,S.x,S.y),E.uniform1f(l,O.rotation),E.uniform1f(o,O.opacity),E.uniform3f(a,O.color.r,O.color.g,O.color.b),e.state.setBlending(O.blending,O.blendEquation,O.blendSrc,O.blendDst),e.setTexture(O.texture,1),E.drawElements(E.TRIANGLES,6,E.UNSIGNED_SHORT,0))}}E.enable(E.CULL_FACE),E.enable(E.DEPTH_TEST),E.depthMask(!0),e.resetGLState()}}},THREE.ShadowMapPlugin=function(e,t,n,i){function r(e,t,i){if(t.visible){var o=n[t.id];if(o&&t.castShadow&&(!1===t.frustumCulled||!0===c.intersectsObject(t)))for(var a=0,s=o.length;s>a;a++){var l=o[a];t._modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),m.push(l)}for(a=0,s=t.children.length;s>a;a++)r(e,t.children[a],i)}}var o,a,s,l,u=e.context,c=new THREE.Frustum,h=new THREE.Matrix4,d=new THREE.Vector3,f=new THREE.Vector3,p=new THREE.Vector3,m=[],g=THREE.ShaderLib.depthRGBA,v=THREE.UniformsUtils.clone(g.uniforms);o=new THREE.ShaderMaterial({uniforms:v,vertexShader:g.vertexShader,fragmentShader:g.fragmentShader}),a=new THREE.ShaderMaterial({uniforms:v,vertexShader:g.vertexShader,fragmentShader:g.fragmentShader,morphTargets:!0}),s=new THREE.ShaderMaterial({uniforms:v,vertexShader:g.vertexShader,fragmentShader:g.fragmentShader,skinning:!0}),l=new THREE.ShaderMaterial({uniforms:v,vertexShader:g.vertexShader,fragmentShader:g.fragmentShader,morphTargets:!0,skinning:!0}),o._shadowPass=!0,a._shadowPass=!0,s._shadowPass=!0,l._shadowPass=!0,this.render=function(n,g){if(!1!==e.shadowMapEnabled){var v,E,y,_,T,b,w,x,R=[];for(_=0,u.clearColor(1,1,1,1),u.disable(u.BLEND),u.enable(u.CULL_FACE),u.frontFace(u.CCW),e.shadowMapCullFace===THREE.CullFaceFront?u.cullFace(u.FRONT):u.cullFace(u.BACK),e.state.setDepthTest(!0),v=0,E=t.length;E>v;v++)if((y=t[v]).castShadow)if(y instanceof THREE.DirectionalLight&&y.shadowCascade)for(T=0;T<y.shadowCascadeCount;T++){var H;if(y.shadowCascadeArray[T])H=y.shadowCascadeArray[T];else{w=y;var S=T;(H=new THREE.DirectionalLight).isVirtual=!0,H.onlyShadow=!0,H.castShadow=!0,H.shadowCameraNear=w.shadowCameraNear,H.shadowCameraFar=w.shadowCameraFar,H.shadowCameraLeft=w.shadowCameraLeft,H.shadowCameraRight=w.shadowCameraRight,H.shadowCameraBottom=w.shadowCameraBottom,H.shadowCameraTop=w.shadowCameraTop,H.shadowCameraVisible=w.shadowCameraVisible,H.shadowDarkness=w.shadowDarkness,H.shadowBias=w.shadowCascadeBias[S],H.shadowMapWidth=w.shadowCascadeWidth[S],H.shadowMapHeight=w.shadowCascadeHeight[S],H.pointsWorld=[],H.pointsFrustum=[],x=H.pointsWorld,b=H.pointsFrustum;for(var M=0;8>M;M++)x[M]=new THREE.Vector3,b[M]=new THREE.Vector3;x=w.shadowCascadeNearZ[S],w=w.shadowCascadeFarZ[S],b[0].set(-1,-1,x),b[1].set(1,-1,x),b[2].set(-1,1,x),b[3].set(1,1,x),b[4].set(-1,-1,w),b[5].set(1,-1,w),b[6].set(-1,1,w),b[7].set(1,1,w),H.originalCamera=g,(b=new THREE.Gyroscope).position.copy(y.shadowCascadeOffset),b.add(H),b.add(H.target),g.add(b),y.shadowCascadeArray[T]=H}x=T,(w=(S=y).shadowCascadeArray[x]).position.copy(S.position),w.target.position.copy(S.target.position),w.lookAt(w.target),w.shadowCameraVisible=S.shadowCameraVisible,w.shadowDarkness=S.shadowDarkness,w.shadowBias=S.shadowCascadeBias[x],b=S.shadowCascadeNearZ[x],S=S.shadowCascadeFarZ[x],(w=w.pointsFrustum)[0].z=b,w[1].z=b,w[2].z=b,w[3].z=b,w[4].z=S,w[5].z=S,w[6].z=S,w[7].z=S,R[_]=H,_++}else R[_]=y,_++;for(v=0,E=R.length;E>v;v++){if((y=R[v]).shadowMap||(T=THREE.LinearFilter,e.shadowMapType===THREE.PCFSoftShadowMap&&(T=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:T,magFilter:T,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4),!y.shadowCamera){if(y instanceof THREE.SpotLight)y.shadowCamera=new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear,y.shadowCameraFar);else{if(!(y instanceof THREE.DirectionalLight)){THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",y);continue}y.shadowCamera=new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar)}n.add(y.shadowCamera),!0===n.autoUpdate&&n.updateMatrixWorld()}if(y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),n.add(y.cameraHelper)),y.isVirtual&&H.originalCamera==g){for(T=g,_=y.shadowCamera,b=y.pointsFrustum,w=y.pointsWorld,d.set(1/0,1/0,1/0),f.set(-1/0,-1/0,-1/0),S=0;8>S;S++)(x=w[S]).copy(b[S]),x.unproject(T),x.applyMatrix4(_.matrixWorldInverse),x.x<d.x&&(d.x=x.x),x.x>f.x&&(f.x=x.x),x.y<d.y&&(d.y=x.y),x.y>f.y&&(f.y=x.y),x.z<d.z&&(d.z=x.z),x.z>f.z&&(f.z=x.z);_.left=d.x,_.right=f.x,_.top=f.y,_.bottom=d.y,_.updateProjectionMatrix()}for(_=y.shadowMap,b=y.shadowMatrix,(T=y.shadowCamera).position.setFromMatrixPosition(y.matrixWorld),p.setFromMatrixPosition(y.target.matrixWorld),T.lookAt(p),T.updateMatrixWorld(),T.matrixWorldInverse.getInverse(T.matrixWorld),y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible),y.shadowCameraVisible&&y.cameraHelper.update(),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(T.projectionMatrix),b.multiply(T.matrixWorldInverse),h.multiplyMatrices(T.projectionMatrix,T.matrixWorldInverse),c.setFromMatrix(h),e.setRenderTarget(_),e.clear(),m.length=0,r(n,n,T),y=0,_=m.length;_>y;y++)b=(w=m[y]).object,w=w.buffer,S=b.material instanceof THREE.MeshFaceMaterial?b.material.materials[0]:b.material,x=void 0!==b.geometry.morphTargets&&0<b.geometry.morphTargets.length&&S.morphTargets,M=b instanceof THREE.SkinnedMesh&&S.skinning,x=b.customDepthMaterial?b.customDepthMaterial:M?x?l:s:x?a:o,e.setMaterialFaces(S),w instanceof THREE.BufferGeometry?e.renderBufferDirect(T,t,null,x,w,b):e.renderBuffer(T,t,null,x,w,b);for(y=0,_=i.length;_>y;y++)(b=(w=i[y]).object).visible&&b.castShadow&&(b._modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,b.matrixWorld),e.renderImmediateObject(T,t,null,o,b))}v=e.getClearColor(),E=e.getClearAlpha(),u.clearColor(v.r,v.g,v.b,E),u.enable(u.BLEND),e.shadowMapCullFace===THREE.CullFaceFront&&u.cullFace(u.BACK),e.resetGLState()}}},THREE.SpritePlugin=function(e,t){function n(e,t){return e.z!==t.z?t.z-e.z:t.id-e.id}var i,r,o,a,s,l,u,c,h,d,f,p,m,g,v,E,y,_,T,b,w,x=e.context,R=new THREE.Vector3,H=new THREE.Quaternion,S=new THREE.Vector3;this.render=function(M,C){if(0!==t.length){if(void 0===b){var A=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),k=new Uint16Array([0,1,2,0,2,3]);_=x.createBuffer(),T=x.createBuffer(),x.bindBuffer(x.ARRAY_BUFFER,_),x.bufferData(x.ARRAY_BUFFER,A,x.STATIC_DRAW),x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,T),x.bufferData(x.ELEMENT_ARRAY_BUFFER,k,x.STATIC_DRAW);A=x.createProgram(),k=x.createShader(x.VERTEX_SHADER);var P=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(k,["precision "+e.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),x.shaderSource(P,["precision "+e.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),x.compileShader(k),x.compileShader(P),x.attachShader(A,k),x.attachShader(A,P),x.linkProgram(A),b=A,E=x.getAttribLocation(b,"position"),y=x.getAttribLocation(b,"uv"),i=x.getUniformLocation(b,"uvOffset"),r=x.getUniformLocation(b,"uvScale"),o=x.getUniformLocation(b,"rotation"),a=x.getUniformLocation(b,"scale"),s=x.getUniformLocation(b,"color"),l=x.getUniformLocation(b,"map"),u=x.getUniformLocation(b,"opacity"),c=x.getUniformLocation(b,"modelViewMatrix"),h=x.getUniformLocation(b,"projectionMatrix"),d=x.getUniformLocation(b,"fogType"),f=x.getUniformLocation(b,"fogDensity"),p=x.getUniformLocation(b,"fogNear"),m=x.getUniformLocation(b,"fogFar"),g=x.getUniformLocation(b,"fogColor"),v=x.getUniformLocation(b,"alphaTest"),(A=document.createElement("canvas")).width=8,A.height=8,(k=A.getContext("2d")).fillStyle="white",k.fillRect(0,0,8,8),(w=new THREE.Texture(A)).needsUpdate=!0}x.useProgram(b),x.enableVertexAttribArray(E),x.enableVertexAttribArray(y),x.disable(x.CULL_FACE),x.enable(x.BLEND),x.bindBuffer(x.ARRAY_BUFFER,_),x.vertexAttribPointer(E,2,x.FLOAT,!1,16,0),x.vertexAttribPointer(y,2,x.FLOAT,!1,16,8),x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,T),x.uniformMatrix4fv(h,!1,C.projectionMatrix.elements),x.activeTexture(x.TEXTURE0),x.uniform1i(l,0),k=A=0,(P=M.fog)?(x.uniform3f(g,P.color.r,P.color.g,P.color.b),P instanceof THREE.Fog?(x.uniform1f(p,P.near),x.uniform1f(m,P.far),x.uniform1i(d,1),k=A=1):P instanceof THREE.FogExp2&&(x.uniform1f(f,P.density),x.uniform1i(d,2),k=A=2)):(x.uniform1i(d,0),k=A=0);P=0;for(var D=t.length;D>P;P++){(O=t[P])._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,O.matrixWorld),O.z=-O._modelViewMatrix.elements[14]}t.sort(n);var L=[];for(P=0,D=t.length;D>P;P++){var O,F=(O=t[P]).material;x.uniform1f(v,F.alphaTest),x.uniformMatrix4fv(c,!1,O._modelViewMatrix.elements),O.matrixWorld.decompose(R,H,S),L[0]=S.x,L[1]=S.y,O=0,M.fog&&F.fog&&(O=k),A!==O&&(x.uniform1i(d,O),A=O),null!==F.map?(x.uniform2f(i,F.map.offset.x,F.map.offset.y),x.uniform2f(r,F.map.repeat.x,F.map.repeat.y)):(x.uniform2f(i,0,0),x.uniform2f(r,1,1)),x.uniform1f(u,F.opacity),x.uniform3f(s,F.color.r,F.color.g,F.color.b),x.uniform1f(o,F.rotation),x.uniform2fv(a,L),e.state.setBlending(F.blending,F.blendEquation,F.blendSrc,F.blendDst),e.state.setDepthTest(F.depthTest),e.state.setDepthWrite(F.depthWrite),F.map&&F.map.image&&F.map.image.width?e.setTexture(F.map,0):e.setTexture(w,0),x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}x.enable(x.CULL_FACE),e.resetGLState()}}},THREE.GeometryUtils={merge:function(e,t,n){var i;THREE.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t instanceof THREE.Mesh&&(t.matrixAutoUpdate&&t.updateMatrix(),i=t.matrix,t=t.geometry),e.merge(t,i,n)},center:function(e){return THREE.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(e,t,n,i){var r=new THREE.ImageLoader;r.crossOrigin=this.crossOrigin;var o=new THREE.Texture(void 0,t);return r.load(e,function(e){o.image=e,o.needsUpdate=!0,n&&n(o)},void 0,function(e){i&&i(e)}),o.sourceFile=e,o},loadTextureCube:function(e,t,n,i){var r=new THREE.ImageLoader;r.crossOrigin=this.crossOrigin;var o=new THREE.CubeTexture([],t);o.flipY=!1;var a=0;t=function(t){r.load(e[t],function(e){o.images[t]=e,6===(a+=1)&&(o.needsUpdate=!0,n&&n(o))},void 0,i)};for(var s=0,l=e.length;l>s;++s)t(s);return o},loadCompressedTexture:function(){THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(e,t){var n=function(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);return[e[0]/t,e[1]/t,e[2]/t]};t|=1;var i=e.width,r=e.height,o=document.createElement("canvas");o.width=i,o.height=r;var a=o.getContext("2d");a.drawImage(e,0,0);for(var s=a.getImageData(0,0,i,r).data,l=a.createImageData(i,r),u=l.data,c=0;i>c;c++)for(var h=0;r>h;h++){var d=0>h-1?0:h-1,f=h+1>r-1?r-1:h+1,p=0>c-1?0:c-1,m=c+1>i-1?i-1:c+1,g=[],v=[0,0,s[4*(h*i+c)]/255*t];for(g.push([-1,0,s[4*(h*i+p)]/255*t]),g.push([-1,-1,s[4*(d*i+p)]/255*t]),g.push([0,-1,s[4*(d*i+c)]/255*t]),g.push([1,-1,s[4*(d*i+m)]/255*t]),g.push([1,0,s[4*(h*i+m)]/255*t]),g.push([1,1,s[4*(f*i+m)]/255*t]),g.push([0,1,s[4*(f*i+c)]/255*t]),g.push([-1,1,s[4*(f*i+p)]/255*t]),d=[],p=g.length,f=0;p>f;f++){m=g[f];var E=g[(f+1)%p];m=[m[0]-v[0],m[1]-v[1],m[2]-v[2]],E=[E[0]-v[0],E[1]-v[1],E[2]-v[2]];d.push(n([m[1]*E[2]-m[2]*E[1],m[2]*E[0]-m[0]*E[2],m[0]*E[1]-m[1]*E[0]]))}for(g=[0,0,0],f=0;f<d.length;f++)g[0]+=d[f][0],g[1]+=d[f][1],g[2]+=d[f][2];g[0]/=d.length,g[1]/=d.length,g[2]/=d.length,u[v=4*(h*i+c)]=(g[0]+1)/2*255|0,u[v+1]=(g[1]+1)/2*255|0,u[v+2]=255*g[2]|0,u[v+3]=255}return a.putImageData(l,0,0),o},generateDataTexture:function(e,t,n){var i=e*t,r=new Uint8Array(3*i),o=Math.floor(255*n.r),a=Math.floor(255*n.g);n=Math.floor(255*n.b);for(var s=0;i>s;s++)r[3*s]=o,r[3*s+1]=a,r[3*s+2]=n;return(e=new THREE.DataTexture(r,e,t,THREE.RGBFormat)).needsUpdate=!0,e}},THREE.SceneUtils={createMultiMaterialObject:function(e,t){for(var n=new THREE.Object3D,i=0,r=t.length;r>i;i++)n.add(new THREE.Mesh(e,t[i]));return n},detach:function(e,t,n){e.applyMatrix(t.matrixWorld),t.remove(e),n.add(e)},attach:function(e,t,n){var i=new THREE.Matrix4;i.getInverse(n.matrixWorld),e.applyMatrix(i),t.remove(e),n.add(e)}},THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(e){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(e){var t=e.familyName.toLowerCase();return this.faces[t]=this.faces[t]||{},this.faces[t][e.cssFontWeight]=this.faces[t][e.cssFontWeight]||{},this.faces[t][e.cssFontWeight][e.cssFontStyle]=e,this.faces[t][e.cssFontWeight][e.cssFontStyle]=e},drawText:function(e){var t=this.getFace(),n=this.size/t.resolution,i=0,r=String(e).split(""),o=r.length,a=[];for(e=0;o>e;e++){var s=new THREE.Path;i=i+(s=this.extractGlyphPoints(r[e],t,n,i,s)).offset;a.push(s.path)}return{paths:a,offset:i/2}},extractGlyphPoints:function(e,t,n,i,r){var o,a,s,l,u,c,h,d,f,p,m,g=[],v=t.glyphs[e]||t.glyphs["?"];if(v){if(v.o)for(l=(t=v._cachedOutline||(v._cachedOutline=v.o.split(" "))).length,e=0;l>e;)switch(s=t[e++]){case"m":s=t[e++]*n+i,u=t[e++]*n,r.moveTo(s,u);break;case"l":s=t[e++]*n+i,u=t[e++]*n,r.lineTo(s,u);break;case"q":if(s=t[e++]*n+i,u=t[e++]*n,d=t[e++]*n+i,f=t[e++]*n,r.quadraticCurveTo(d,f,s,u),o=g[g.length-1])for(c=o.x,h=o.y,o=1,a=this.divisions;a>=o;o++){var E=o/a;THREE.Shape.Utils.b2(E,c,d,s),THREE.Shape.Utils.b2(E,h,f,u)}break;case"b":if(s=t[e++]*n+i,u=t[e++]*n,d=t[e++]*n+i,f=t[e++]*n,p=t[e++]*n+i,m=t[e++]*n,r.bezierCurveTo(d,f,p,m,s,u),o=g[g.length-1])for(c=o.x,h=o.y,o=1,a=this.divisions;a>=o;o++)E=o/a,THREE.Shape.Utils.b3(E,c,d,p,s),THREE.Shape.Utils.b3(E,h,f,m,u)}return{offset:v.ha*n,path:r}}}},THREE.FontUtils.generateShapes=function(e,t){var n=void 0!==(t=t||{}).curveSegments?t.curveSegments:4,i=void 0!==t.font?t.font:"helvetiker",r=void 0!==t.weight?t.weight:"normal",o=void 0!==t.style?t.style:"normal";for(THREE.FontUtils.size=void 0!==t.size?t.size:100,THREE.FontUtils.divisions=n,THREE.FontUtils.face=i,THREE.FontUtils.weight=r,THREE.FontUtils.style=o,i=[],r=0,o=(n=THREE.FontUtils.drawText(e).paths).length;o>r;r++)Array.prototype.push.apply(i,n[r].toShapes());return i},function(e){var t=function(e){for(var t=e.length,n=0,i=t-1,r=0;t>r;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return.5*n};e.Triangulate=function(e,n){var i=e.length;if(3>i)return null;var r,o,a,s=[],l=[],u=[];if(0<t(e))for(o=0;i>o;o++)l[o]=o;else for(o=0;i>o;o++)l[o]=i-1-o;var c=2*i;for(o=i-1;i>2;){if(0>=c--){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}var h;(r=o)>=i&&(r=0),(o=r+1)>=i&&(o=0),(a=o+1)>=i&&(a=0);e:{var d=h=void 0,f=void 0,p=void 0,m=void 0,g=(d=e[l[r]].x,e[l[r]].y),v=e[l[o]].x,E=e[l[o]].y,y=e[l[a]].x;if(1e-10>(v-d)*((f=e[l[a]].y)-g)-(E-g)*(y-d))h=!1;else{var _=void 0,T=void 0,b=void 0,w=void 0,x=(b=T=_=m=p=void 0,y-v),R=f-E,H=d-y,S=g-f,M=v-d,C=E-g;for(h=0;i>h;h++)if(p=e[l[h]].x,m=e[l[h]].y,!(p===d&&m===g||p===v&&m===E||p===y&&m===f)&&(b=p-v,w=m-E,_=M*(T=m-g)-C*(_=p-d),T=H*(m-=f)-S*(p-=y),(b=x*w-R*b)>=-1e-10&&T>=-1e-10&&_>=-1e-10)){h=!1;break e}h=!0}}if(h){for(s.push([e[l[r]],e[l[o]],e[l[a]]]),u.push([l[r],l[o],l[a]]),r=o,a=o+1;i>a;r++,a++)l[r]=l[a];c=2*--i}}return n?u:s},e.Triangulate.area=t}(THREE.FontUtils),self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace},THREE.typeface_js=self._typeface_js,THREE.Audio=function(e){THREE.Object3D.call(this),this.type="Audio",this.context=e.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain),this.autoplay=!1,this.startTime=0,this.isPlaying=!1},THREE.Audio.prototype=Object.create(THREE.Object3D.prototype),THREE.Audio.prototype.constructor=THREE.Audio,THREE.Audio.prototype.load=function(e){var t=this,n=new XMLHttpRequest;return n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(e){t.context.decodeAudioData(this.response,function(e){t.source.buffer=e,t.autoplay&&t.play()})},n.send(),this},THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)THREE.warn("THREE.Audio: Audio is already playing.");else{var e=this.context.createBufferSource();e.buffer=this.source.buffer,e.loop=this.source.loop,e.onended=this.source.onended,e.connect(this.panner),e.start(0,this.startTime),this.isPlaying=!0,this.source=e}},THREE.Audio.prototype.pause=function(){this.source.stop(),this.startTime=this.context.currentTime},THREE.Audio.prototype.stop=function(){this.source.stop(),this.startTime=0},THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1},THREE.Audio.prototype.setLoop=function(e){this.source.loop=e},THREE.Audio.prototype.setRefDistance=function(e){this.panner.refDistance=e},THREE.Audio.prototype.setRolloffFactor=function(e){this.panner.rolloffFactor=e},THREE.Audio.prototype.setVolume=function(e){this.gain.gain.value=e},THREE.Audio.prototype.updateMatrixWorld=function(){var e=new THREE.Vector3;return function(t){THREE.Object3D.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}(),THREE.AudioListener=function(){THREE.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype),THREE.AudioListener.prototype.constructor=THREE.AudioListener,THREE.AudioListener.prototype.updateMatrixWorld=function(){var e=new THREE.Vector3,t=new THREE.Quaternion,n=new THREE.Vector3,i=new THREE.Vector3,r=new THREE.Vector3,o=new THREE.Vector3;return function(a){THREE.Object3D.prototype.updateMatrixWorld.call(this,a),a=this.context.listener;var s=this.up;this.matrixWorld.decompose(e,t,n),i.set(0,0,-1).applyQuaternion(t),r.subVectors(e,o),a.setPosition(e.x,e.y,e.z),a.setOrientation(i.x,i.y,i.z,s.x,s.y,s.z),a.setVelocity(r.x,r.y,r.z),o.copy(e)}}(),THREE.Curve=function(){},THREE.Curve.prototype.getPoint=function(e){return THREE.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},THREE.Curve.prototype.getPointAt=function(e){return e=this.getUtoTmapping(e),this.getPoint(e)},THREE.Curve.prototype.getPoints=function(e){e||(e=5);var t,n=[];for(t=0;e>=t;t++)n.push(this.getPoint(t/e));return n},THREE.Curve.prototype.getSpacedPoints=function(e){e||(e=5);var t,n=[];for(t=0;e>=t;t++)n.push(this.getPointAt(t/e));return n},THREE.Curve.prototype.getLength=function(){var e=this.getLengths();return e[e.length-1]},THREE.Curve.prototype.getLengths=function(e){if(e||(e=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,i=[],r=this.getPoint(0),o=0;for(i.push(0),n=1;e>=n;n++)o+=(t=this.getPoint(n/e)).distanceTo(r),i.push(o),r=t;return this.cacheArcLengths=i},THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},THREE.Curve.prototype.getUtoTmapping=function(e,t){var n,i=this.getLengths(),r=0,o=i.length;n=t||e*i[o-1];for(var a,s=0,l=o-1;l>=s;)if(0>(a=i[r=Math.floor(s+(l-s)/2)]-n))s=r+1;else{if(!(a>0)){l=r;break}l=r-1}return i[r=l]==n?r/(o-1):i=(r+(n-(s=i[r]))/(i[r+1]-s))/(o-1)},THREE.Curve.prototype.getTangent=function(e){var t=e-1e-4;return 0>t&&(t=0),(e+=1e-4)>1&&(e=1),t=this.getPoint(t),this.getPoint(e).clone().sub(t).normalize()},THREE.Curve.prototype.getTangentAt=function(e){return e=this.getUtoTmapping(e),this.getTangent(e)},THREE.Curve.Utils={tangentQuadraticBezier:function(e,t,n,i){return 2*(1-e)*(n-t)+2*e*(i-n)},tangentCubicBezier:function(e,t,n,i,r){return-3*t*(1-e)*(1-e)+3*n*(1-e)*(1-e)-6*e*n*(1-e)+6*e*i*(1-e)-3*e*e*i+3*e*e*r},tangentSpline:function(e,t,n,i,r){return 6*e*e-6*e+(3*e*e-4*e+1)+(-6*e*e+6*e)+(3*e*e-2*e)},interpolate:function(e,t,n,i,r){var o=r*r;return(2*t-2*n+(e=.5*(n-e))+(i=.5*(i-t)))*r*o+(-3*t+3*n-2*e-i)*o+e*r+t}},THREE.Curve.create=function(e,t){return e.prototype=Object.create(THREE.Curve.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},THREE.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype),THREE.CurvePath.prototype.constructor=THREE.CurvePath,THREE.CurvePath.prototype.add=function(e){this.curves.push(e)},THREE.CurvePath.prototype.checkConnection=function(){},THREE.CurvePath.prototype.closePath=function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new THREE.LineCurve(t,e))},THREE.CurvePath.prototype.getPoint=function(e){var t=e*this.getLength(),n=this.getCurveLengths();for(e=0;e<n.length;){if(n[e]>=t)return t=1-(t=n[e]-t)/(e=this.curves[e]).getLength(),e.getPointAt(t);e++}return null},THREE.CurvePath.prototype.getLength=function(){var e=this.getCurveLengths();return e[e.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var e,t=[],n=0,i=this.curves.length;for(e=0;i>e;e++)n+=this.curves[e].getLength(),t.push(n);return this.cacheLengths=t},THREE.CurvePath.prototype.getBoundingBox=function(){var e,t,n,i,r,o,a=this.getPoints();e=t=Number.NEGATIVE_INFINITY,i=r=Number.POSITIVE_INFINITY;var s,l,u,c,h=a[0]instanceof THREE.Vector3;for(c=h?new THREE.Vector3:new THREE.Vector2,l=0,u=a.length;u>l;l++)(s=a[l]).x>e?e=s.x:s.x<i&&(i=s.x),s.y>t?t=s.y:s.y<r&&(r=s.y),h&&(s.z>n?n=s.z:s.z<o&&(o=s.z)),c.add(s);return a={minX:i,minY:r,maxX:e,maxY:t},h&&(a.maxZ=n,a.minZ=o),a},THREE.CurvePath.prototype.createPointsGeometry=function(e){return e=this.getPoints(e,!0),this.createGeometry(e)},THREE.CurvePath.prototype.createSpacedPointsGeometry=function(e){return e=this.getSpacedPoints(e,!0),this.createGeometry(e)},THREE.CurvePath.prototype.createGeometry=function(e){for(var t=new THREE.Geometry,n=0;n<e.length;n++)t.vertices.push(new THREE.Vector3(e[n].x,e[n].y,e[n].z||0));return t},THREE.CurvePath.prototype.addWrapPath=function(e){this.bends.push(e)},THREE.CurvePath.prototype.getTransformedPoints=function(e,t){var n,i,r=this.getPoints(e);for(t||(t=this.bends),n=0,i=t.length;i>n;n++)r=this.getWrapPoints(r,t[n]);return r},THREE.CurvePath.prototype.getTransformedSpacedPoints=function(e,t){var n,i,r=this.getSpacedPoints(e);for(t||(t=this.bends),n=0,i=t.length;i>n;n++)r=this.getWrapPoints(r,t[n]);return r},THREE.CurvePath.prototype.getWrapPoints=function(e,t){var n,i,r,o,a,s,l=this.getBoundingBox();for(n=0,i=e.length;i>n;n++)o=(r=e[n]).x,a=r.y,s=o/l.maxX,s=t.getUtoTmapping(s,o),o=t.getPoint(s),(s=t.getTangent(s)).set(-s.y,s.x).multiplyScalar(a),r.x=o.x+s.x,r.y=o.y+s.y;return e},THREE.Gyroscope=function(){THREE.Object3D.call(this)},THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype),THREE.Gyroscope.prototype.constructor=THREE.Gyroscope,THREE.Gyroscope.prototype.updateMatrixWorld=function(){var e=new THREE.Vector3,t=new THREE.Quaternion,n=new THREE.Vector3,i=new THREE.Vector3,r=new THREE.Quaternion,o=new THREE.Vector3;return function(a){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||a)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(i,r,o),this.matrix.decompose(e,t,n),this.matrixWorld.compose(i,t,o)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0);for(var s=0,l=this.children.length;l>s;s++)this.children[s].updateMatrixWorld(a)}}(),THREE.Path=function(e){THREE.CurvePath.call(this),this.actions=[],e&&this.fromPoints(e)},THREE.Path.prototype=Object.create(THREE.CurvePath.prototype),THREE.Path.prototype.constructor=THREE.Path,THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},THREE.Path.prototype.fromPoints=function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;n>t;t++)this.lineTo(e[t].x,e[t].y)},THREE.Path.prototype.moveTo=function(e,t){var n=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:n})},THREE.Path.prototype.lineTo=function(e,t){var n=Array.prototype.slice.call(arguments),i=this.actions[this.actions.length-1].args;i=new THREE.LineCurve(new THREE.Vector2(i[i.length-2],i[i.length-1]),new THREE.Vector2(e,t));this.curves.push(i),this.actions.push({action:THREE.PathActions.LINE_TO,args:n})},THREE.Path.prototype.quadraticCurveTo=function(e,t,n,i){var r=Array.prototype.slice.call(arguments),o=this.actions[this.actions.length-1].args;o=new THREE.QuadraticBezierCurve(new THREE.Vector2(o[o.length-2],o[o.length-1]),new THREE.Vector2(e,t),new THREE.Vector2(n,i));this.curves.push(o),this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:r})},THREE.Path.prototype.bezierCurveTo=function(e,t,n,i,r,o){var a=Array.prototype.slice.call(arguments),s=this.actions[this.actions.length-1].args;s=new THREE.CubicBezierCurve(new THREE.Vector2(s[s.length-2],s[s.length-1]),new THREE.Vector2(e,t),new THREE.Vector2(n,i),new THREE.Vector2(r,o));this.curves.push(s),this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:a})},THREE.Path.prototype.splineThru=function(e){var t=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args;n=[new THREE.Vector2(n[n.length-2],n[n.length-1])];Array.prototype.push.apply(n,e),n=new THREE.SplineCurve(n),this.curves.push(n),this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:t})},THREE.Path.prototype.arc=function(e,t,n,i,r,o){var a=this.actions[this.actions.length-1].args;this.absarc(e+a[a.length-2],t+a[a.length-1],n,i,r,o)},THREE.Path.prototype.absarc=function(e,t,n,i,r,o){this.absellipse(e,t,n,n,i,r,o)},THREE.Path.prototype.ellipse=function(e,t,n,i,r,o,a){var s=this.actions[this.actions.length-1].args;this.absellipse(e+s[s.length-2],t+s[s.length-1],n,i,r,o,a)},THREE.Path.prototype.absellipse=function(e,t,n,i,r,o,a){var s=Array.prototype.slice.call(arguments),l=new THREE.EllipseCurve(e,t,n,i,r,o,a);this.curves.push(l),l=l.getPoint(1),s.push(l.x),s.push(l.y),this.actions.push({action:THREE.PathActions.ELLIPSE,args:s})},THREE.Path.prototype.getSpacedPoints=function(e,t){e||(e=40);for(var n=[],i=0;e>i;i++)n.push(this.getPoint(i/e));return n},THREE.Path.prototype.getPoints=function(e,t){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(e,t);e=e||12;var n,i,r,o,a,s,l,u,c,h,d,f,p,m=[];for(n=0,i=this.actions.length;i>n;n++)switch(r=this.actions[n],o=r.action,r=r.args,o){case THREE.PathActions.MOVE_TO:case THREE.PathActions.LINE_TO:m.push(new THREE.Vector2(r[0],r[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:for(a=r[2],s=r[3],c=r[0],h=r[1],0<m.length?(d=(o=m[m.length-1]).x,f=o.y):(d=(o=this.actions[n-1].args)[o.length-2],f=o[o.length-1]),r=1;e>=r;r++)p=r/e,o=THREE.Shape.Utils.b2(p,d,c,a),p=THREE.Shape.Utils.b2(p,f,h,s),m.push(new THREE.Vector2(o,p));break;case THREE.PathActions.BEZIER_CURVE_TO:for(a=r[4],s=r[5],c=r[0],h=r[1],l=r[2],u=r[3],0<m.length?(d=(o=m[m.length-1]).x,f=o.y):(d=(o=this.actions[n-1].args)[o.length-2],f=o[o.length-1]),r=1;e>=r;r++)p=r/e,o=THREE.Shape.Utils.b3(p,d,c,l,a),p=THREE.Shape.Utils.b3(p,f,h,u,s),m.push(new THREE.Vector2(o,p));break;case THREE.PathActions.CSPLINE_THRU:for(o=this.actions[n-1].args,p=[new THREE.Vector2(o[o.length-2],o[o.length-1])],o=e*r[0].length,p=p.concat(r[0]),p=new THREE.SplineCurve(p),r=1;o>=r;r++)m.push(p.getPointAt(r/o));break;case THREE.PathActions.ARC:for(a=r[0],s=r[1],h=r[2],l=r[3],o=r[4],c=!!r[5],d=o-l,f=2*e,r=1;f>=r;r++)p=r/f,c||(p=1-p),p=l+p*d,o=a+h*Math.cos(p),p=s+h*Math.sin(p),m.push(new THREE.Vector2(o,p));break;case THREE.PathActions.ELLIPSE:for(a=r[0],s=r[1],h=r[2],u=r[3],l=r[4],o=r[5],c=!!r[6],d=o-l,f=2*e,r=1;f>=r;r++)p=r/f,c||(p=1-p),p=l+p*d,o=a+h*Math.cos(p),p=s+u*Math.sin(p),m.push(new THREE.Vector2(o,p))}return n=m[m.length-1],1e-10>Math.abs(n.x-m[0].x)&&1e-10>Math.abs(n.y-m[0].y)&&m.splice(m.length-1,1),t&&m.push(m[0]),m},THREE.Path.prototype.toShapes=function(e,t){function n(e){for(var t=[],n=0,i=e.length;i>n;n++){var r=e[n],o=new THREE.Shape;o.actions=r.actions,o.curves=r.curves,t.push(o)}return t}function i(e,t){for(var n=t.length,i=!1,r=n-1,o=0;n>o;r=o++){var a=t[r],s=t[o],l=s.x-a.x,u=s.y-a.y;if(1e-10<Math.abs(u)){if(0>u&&(a=t[o],l=-l,s=t[r],u=-u),!(e.y<a.y||e.y>s.y))if(e.y==a.y){if(e.x==a.x)return!0}else{if(0==(r=u*(e.x-a.x)-l*(e.y-a.y)))return!0;0>r||(i=!i)}}else if(e.y==a.y&&(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x))return!0}return i}var r=function(e){var t,n,i,r,o=[],a=new THREE.Path;for(t=0,n=e.length;n>t;t++)r=(i=e[t]).args,(i=i.action)==THREE.PathActions.MOVE_TO&&0!=a.actions.length&&(o.push(a),a=new THREE.Path),a[i].apply(a,r);return 0!=a.actions.length&&o.push(a),o}(this.actions);if(0==r.length)return[];if(!0===t)return n(r);var o,a,s,l=[];if(1==r.length)return a=r[0],(s=new THREE.Shape).actions=a.actions,s.curves=a.curves,l.push(s),l;var u=!THREE.Shape.Utils.isClockWise(r[0].getPoints());u=e?!u:u;s=[];var c,h,d,f=[],p=[],m=0;for(f[m]=void 0,p[m]=[],h=0,d=r.length;d>h;h++)c=(a=r[h]).getPoints(),o=THREE.Shape.Utils.isClockWise(c),(o=e?!o:o)?(!u&&f[m]&&m++,f[m]={s:new THREE.Shape,p:c},f[m].s.actions=a.actions,f[m].s.curves=a.curves,u&&m++,p[m]=[]):p[m].push({h:a,p:c[0]});if(!f[0])return n(r);if(1<f.length){for(h=!1,d=[],a=0,r=f.length;r>a;a++)s[a]=[];for(a=0,r=f.length;r>a;a++)for(o=p[a],u=0;u<o.length;u++){m=o[u],c=!0;for(var g=0;g<f.length;g++)i(m.p,f[g].p)&&(a!=g&&d.push({froms:a,tos:g,hole:u}),c?(c=!1,s[g].push(m)):h=!0);c&&s[a].push(m)}0<d.length&&(h||(p=s))}for(h=0,d=f.length;d>h;h++)for(s=f[h].s,l.push(s),r=0,o=(a=p[h]).length;o>r;r++)s.holes.push(a[r].h);return l},THREE.Shape=function(){THREE.Path.apply(this,arguments),this.holes=[]},THREE.Shape.prototype=Object.create(THREE.Path.prototype),THREE.Shape.prototype.constructor=THREE.Shape,THREE.Shape.prototype.extrude=function(e){return new THREE.ExtrudeGeometry(this,e)},THREE.Shape.prototype.makeGeometry=function(e){return new THREE.ShapeGeometry(this,e)},THREE.Shape.prototype.getPointsHoles=function(e){var t,n=this.holes.length,i=[];for(t=0;n>t;t++)i[t]=this.holes[t].getTransformedPoints(e,this.bends);return i},THREE.Shape.prototype.getSpacedPointsHoles=function(e){var t,n=this.holes.length,i=[];for(t=0;n>t;t++)i[t]=this.holes[t].getTransformedSpacedPoints(e,this.bends);return i},THREE.Shape.prototype.extractAllPoints=function(e){return{shape:this.getTransformedPoints(e),holes:this.getPointsHoles(e)}},THREE.Shape.prototype.extractPoints=function(e){return this.useSpacedPoints?this.extractAllSpacedPoints(e):this.extractAllPoints(e)},THREE.Shape.prototype.extractAllSpacedPoints=function(e){return{shape:this.getTransformedSpacedPoints(e),holes:this.getSpacedPointsHoles(e)}},THREE.Shape.Utils={triangulateShape:function(e,t){function n(e,t,n){return e.x!=t.x?e.x<t.x?e.x<=n.x&&n.x<=t.x:t.x<=n.x&&n.x<=e.x:e.y<t.y?e.y<=n.y&&n.y<=t.y:t.y<=n.y&&n.y<=e.y}function i(e,t,i,r,o){var a=t.x-e.x,s=t.y-e.y,l=r.x-i.x,u=r.y-i.y,c=e.x-i.x,h=e.y-i.y,d=s*l-a*u,f=s*c-a*h;if(1e-10<Math.abs(d)){if(d>0){if(0>f||f>d)return[];if(0>(l=u*c-l*h)||l>d)return[]}else{if(f>0||d>f)return[];if((l=u*c-l*h)>0||d>l)return[]}return 0==l?!o||0!=f&&f!=d?[e]:[]:l==d?!o||0!=f&&f!=d?[t]:[]:0==f?[i]:f==d?[r]:(o=l/d,[{x:e.x+o*a,y:e.y+o*s}])}return 0!=f||u*c!=l*h?[]:(l=0==l&&0==u,(s=0==a&&0==s)&&l?e.x!=i.x||e.y!=i.y?[]:[e]:s?n(i,r,e)?[e]:[]:l?n(e,t,i)?[i]:[]:(0!=a?(e.x<t.x?(a=e,l=e.x,s=t,e=t.x):(a=t,l=t.x,s=e,e=e.x),i.x<r.x?(t=i,d=i.x,u=r,i=r.x):(t=r,d=r.x,u=i,i=i.x)):(e.y<t.y?(a=e,l=e.y,s=t,e=t.y):(a=t,l=t.y,s=e,e=e.y),i.y<r.y?(t=i,d=i.y,u=r,i=r.y):(t=r,d=r.y,u=i,i=i.y)),d>=l?d>e?[]:e==d?o?[]:[t]:i>=e?[t,s]:[t,u]:l>i?[]:l==i?o?[]:[a]:i>=e?[a,s]:[a,u]))}function r(e,t,n,i){var r=t.x-e.x,o=t.y-e.y;t=n.x-e.x,n=n.y-e.y;var a=i.x-e.x;return i=i.y-e.y,e=r*n-o*t,r=r*i-o*a,1e-10<Math.abs(e)?(t=a*n-i*t,e>0?r>=0&&t>=0:r>=0||t>=0):r>0}var o,a,s,l,u,c={};for(s=e.concat(),o=0,a=t.length;a>o;o++)Array.prototype.push.apply(s,t[o]);for(o=0,a=s.length;a>o;o++)void 0!==c[u=s[o].x+":"+s[o].y]&&THREE.warn("THREE.Shape: Duplicate point",u),c[u]=o;o=function(e,t){function n(e,t){var n=g.length-1,i=e-1;0>i&&(i=n);var o=e+1;return o>n&&(o=0),!!(n=r(g[e],g[i],g[o],s[t]))&&(n=s.length-1,0>(i=t-1)&&(i=n),(o=t+1)>n&&(o=0),!!(n=r(s[t],s[i],s[o],g[e])))}function o(e,t){var n,r;for(n=0;n<g.length;n++)if(r=n+1,r%=g.length,0<(r=i(e,t,g[n],g[r],!0)).length)return!0;return!1}function a(e,n){var r,o,a,s;for(r=0;r<v.length;r++)for(o=t[v[r]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,0<(s=i(e,n,o[a],o[s],!0)).length)return!0;return!1}var s,l,u,c,h,d,f,p,m,g=e.concat(),v=[],E=[],y=0;for(l=t.length;l>y;y++)v.push(y);f=0;for(var _=2*v.length;0<v.length;){if(0>--_){console.log("Infinite Loop! Holes left:"+v.length+", Probably Hole outside Shape!");break}for(u=f;u<g.length;u++){for(c=g[u],l=-1,y=0;y<v.length;y++)if(h=v[y],void 0===E[d=c.x+":"+c.y+":"+h]){for(s=t[h],p=0;p<s.length;p++)if(h=s[p],n(u,p)&&!o(c,h)&&!a(c,h)){l=p,v.splice(y,1),f=g.slice(0,u+1),h=g.slice(u),p=s.slice(l),m=s.slice(0,l+1),g=f.concat(p).concat(m).concat(h),f=u;break}if(l>=0)break;E[d]=!0}if(l>=0)break}}return g}(e,t);var h=THREE.FontUtils.Triangulate(o,!1);for(o=0,a=h.length;a>o;o++)for(l=h[o],s=0;3>s;s++)void 0!==(u=c[u=l[s].x+":"+l[s].y])&&(l[s]=u);return h.concat()},isClockWise:function(e){return 0>THREE.FontUtils.Triangulate.area(e)},b2p0:function(e,t){var n=1-e;return n*n*t},b2p1:function(e,t){return 2*(1-e)*e*t},b2p2:function(e,t){return e*e*t},b2:function(e,t,n,i){return this.b2p0(e,t)+this.b2p1(e,n)+this.b2p2(e,i)},b3p0:function(e,t){var n=1-e;return n*n*n*t},b3p1:function(e,t){var n=1-e;return 3*n*n*e*t},b3p2:function(e,t){return 3*(1-e)*e*e*t},b3p3:function(e,t){return e*e*e*t},b3:function(e,t,n,i,r){return this.b3p0(e,t)+this.b3p1(e,n)+this.b3p2(e,i)+this.b3p3(e,r)}},THREE.LineCurve=function(e,t){this.v1=e,this.v2=t},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(e){var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},THREE.LineCurve.prototype.getPointAt=function(e){return this.getPoint(e)},THREE.LineCurve.prototype.getTangent=function(e){return this.v2.clone().sub(this.v1).normalize()},THREE.QuadraticBezierCurve=function(e,t,n){this.v0=e,this.v1=t,this.v2=n},THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve,THREE.QuadraticBezierCurve.prototype.getPoint=function(e){var t=new THREE.Vector2;return t.x=THREE.Shape.Utils.b2(e,this.v0.x,this.v1.x,this.v2.x),t.y=THREE.Shape.Utils.b2(e,this.v0.y,this.v1.y,this.v2.y),t},THREE.QuadraticBezierCurve.prototype.getTangent=function(e){var t=new THREE.Vector2;return t.x=THREE.Curve.Utils.tangentQuadraticBezier(e,this.v0.x,this.v1.x,this.v2.x),t.y=THREE.Curve.Utils.tangentQuadraticBezier(e,this.v0.y,this.v1.y,this.v2.y),t.normalize()},THREE.CubicBezierCurve=function(e,t,n,i){this.v0=e,this.v1=t,this.v2=n,this.v3=i},THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve,THREE.CubicBezierCurve.prototype.getPoint=function(e){var t;return t=THREE.Shape.Utils.b3(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e=THREE.Shape.Utils.b3(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new THREE.Vector2(t,e)},THREE.CubicBezierCurve.prototype.getTangent=function(e){var t;return t=THREE.Curve.Utils.tangentCubicBezier(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e=THREE.Curve.Utils.tangentCubicBezier(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),(t=new THREE.Vector2(t,e)).normalize(),t},THREE.SplineCurve=function(e){this.points=null==e?[]:e},THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.SplineCurve.prototype.constructor=THREE.SplineCurve,THREE.SplineCurve.prototype.getPoint=function(e){e*=(o=this.points).length-1,e-=t=Math.floor(e);var t,n=o[0==t?t:t-1],i=o[t],r=o[t>o.length-2?o.length-1:t+1],o=o[t>o.length-3?o.length-1:t+2];return(t=new THREE.Vector2).x=THREE.Curve.Utils.interpolate(n.x,i.x,r.x,o.x,e),t.y=THREE.Curve.Utils.interpolate(n.y,i.y,r.y,o.y,e),t},THREE.EllipseCurve=function(e,t,n,i,r,o,a){this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.EllipseCurve.prototype.getPoint=function(e){var t=this.aEndAngle-this.aStartAngle;return 0>t&&(t+=2*Math.PI),t>2*Math.PI&&(t-=2*Math.PI),e=!0===this.aClockwise?this.aEndAngle+(1-e)*(2*Math.PI-t):this.aStartAngle+e*t,(t=new THREE.Vector2).x=this.aX+this.xRadius*Math.cos(e),t.y=this.aY+this.yRadius*Math.sin(e),t},THREE.ArcCurve=function(e,t,n,i,r,o){THREE.EllipseCurve.call(this,e,t,n,n,i,r,o)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(e,t){this.v1=e,this.v2=t},function(e){var t=new THREE.Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(e,t,n){this.v0=e,this.v1=t,this.v2=n},function(e){var t=new THREE.Vector3;return t.x=THREE.Shape.Utils.b2(e,this.v0.x,this.v1.x,this.v2.x),t.y=THREE.Shape.Utils.b2(e,this.v0.y,this.v1.y,this.v2.y),t.z=THREE.Shape.Utils.b2(e,this.v0.z,this.v1.z,this.v2.z),t}),THREE.CubicBezierCurve3=THREE.Curve.create(function(e,t,n,i){this.v0=e,this.v1=t,this.v2=n,this.v3=i},function(e){var t=new THREE.Vector3;return t.x=THREE.Shape.Utils.b3(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t.y=THREE.Shape.Utils.b3(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),t.z=THREE.Shape.Utils.b3(e,this.v0.z,this.v1.z,this.v2.z,this.v3.z),t}),THREE.SplineCurve3=THREE.Curve.create(function(e){this.points=null==e?[]:e},function(e){e*=(o=this.points).length-1,e-=t=Math.floor(e);var t,n=o[0==t?t:t-1],i=o[t],r=o[t>o.length-2?o.length-1:t+1],o=o[t>o.length-3?o.length-1:t+2];return(t=new THREE.Vector3).x=THREE.Curve.Utils.interpolate(n.x,i.x,r.x,o.x,e),t.y=THREE.Curve.Utils.interpolate(n.y,i.y,r.y,o.y,e),t.z=THREE.Curve.Utils.interpolate(n.z,i.z,r.z,o.z,e),t}),THREE.ClosedSplineCurve3=THREE.Curve.create(function(e){this.points=null==e?[]:e},function(e){e*=(o=this.points).length-0,e-=t=Math.floor(e);var t,n=o[((t=t+(t>0?0:(Math.floor(Math.abs(t)/o.length)+1)*o.length))-1)%o.length],i=o[t%o.length],r=o[(t+1)%o.length],o=o[(t+2)%o.length];return(t=new THREE.Vector3).x=THREE.Curve.Utils.interpolate(n.x,i.x,r.x,o.x,e),t.y=THREE.Curve.Utils.interpolate(n.y,i.y,r.y,o.y,e),t.z=THREE.Curve.Utils.interpolate(n.z,i.z,r.z,o.z,e),t}),THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){THREE.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){THREE.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){THREE.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(e){if(!0===e.initialized)return e;for(var t=0;t<e.hierarchy.length;t++){for(var n=0;n<e.hierarchy[t].keys.length;n++)if(0>e.hierarchy[t].keys[n].time&&(e.hierarchy[t].keys[n].time=0),void 0!==e.hierarchy[t].keys[n].rot&&!(e.hierarchy[t].keys[n].rot instanceof THREE.Quaternion)){var i=e.hierarchy[t].keys[n].rot;e.hierarchy[t].keys[n].rot=(new THREE.Quaternion).fromArray(i)}if(e.hierarchy[t].keys.length&&void 0!==e.hierarchy[t].keys[0].morphTargets){for(i={},n=0;n<e.hierarchy[t].keys.length;n++)for(var r=0;r<e.hierarchy[t].keys[n].morphTargets.length;r++){var o=e.hierarchy[t].keys[n].morphTargets[r];i[o]=-1}for(e.hierarchy[t].usedMorphTargets=i,n=0;n<e.hierarchy[t].keys.length;n++){var a={};for(o in i){for(r=0;r<e.hierarchy[t].keys[n].morphTargets.length;r++)if(e.hierarchy[t].keys[n].morphTargets[r]===o){a[o]=e.hierarchy[t].keys[n].morphTargetsInfluences[r];break}r===e.hierarchy[t].keys[n].morphTargets.length&&(a[o]=0)}e.hierarchy[t].keys[n].morphTargetsInfluences=a}}for(n=1;n<e.hierarchy[t].keys.length;n++)e.hierarchy[t].keys[n].time===e.hierarchy[t].keys[n-1].time&&(e.hierarchy[t].keys.splice(n,1),n--);for(n=0;n<e.hierarchy[t].keys.length;n++)e.hierarchy[t].keys[n].index=n}return e.initialized=!0,e},parse:function(e){var t=function(e,n){n.push(e);for(var i=0;i<e.children.length;i++)t(e.children[i],n)},n=[];if(e instanceof THREE.SkinnedMesh)for(var i=0;i<e.skeleton.bones.length;i++)n.push(e.skeleton.bones[i]);else t(e,n);return n},play:function(e){-1===this.animations.indexOf(e)&&this.animations.push(e)},stop:function(e){-1!==(e=this.animations.indexOf(e))&&this.animations.splice(e,1)},update:function(e){for(var t=0;t<this.animations.length;t++)this.animations[t].resetBlendWeights();for(t=0;t<this.animations.length;t++)this.animations[t].update(e)}},THREE.Animation=function(e,t){this.root=e,this.data=THREE.AnimationHandler.init(t),this.hierarchy=THREE.AnimationHandler.parse(e),this.currentTime=0,this.timeScale=1,this.isPlaying=!1,this.loop=!0,this.weight=0,this.interpolationType=THREE.AnimationHandler.LINEAR},THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","scl"],play:function(e,t){this.currentTime=void 0!==e?e:0,this.weight=void 0!==t?t:1,this.isPlaying=!0,this.reset(),THREE.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1,THREE.AnimationHandler.stop(this)},reset:function(){for(var e=0,t=this.hierarchy.length;t>e;e++){var n=this.hierarchy[e];void 0===n.animationCache&&(n.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});var i=this.data.name,r=(o=n.animationCache.animations)[i];for(void 0===r&&(r={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:n.matrix},o[i]=r),n=0;3>n;n++){i=this.keyTypes[n];for(var o=this.data.hierarchy[e].keys[0],a=this.getNextKeyWith(i,e,1);a.time<this.currentTime&&a.index>o.index;)o=a,a=this.getNextKeyWith(i,e,a.index+1);r.prevKey[i]=o,r.nextKey[i]=a}}},resetBlendWeights:function(){for(var e=0,t=this.hierarchy.length;t>e;e++){var n=this.hierarchy[e].animationCache;void 0!==n&&((n=n.blending).positionWeight=0,n.quaternionWeight=0,n.scaleWeight=0)}},update:function(){var e=[],t=new THREE.Vector3,n=new THREE.Vector3,i=new THREE.Quaternion,r=function(e,t){var n,i,r,a,s,l,u=[],c=[];return n=(e.length-1)*t,n-=i=Math.floor(n),u[0]=0===i?i:i-1,u[1]=i,u[2]=i>e.length-2?i:i+1,u[3]=i>e.length-3?i:i+2,i=e[u[0]],a=e[u[1]],s=e[u[2]],l=e[u[3]],r=n*(u=n*n),c[0]=o(i[0],a[0],s[0],l[0],n,u,r),c[1]=o(i[1],a[1],s[1],l[1],n,u,r),c[2]=o(i[2],a[2],s[2],l[2],n,u,r),c},o=function(e,t,n,i,r,o,a){return(2*(t-n)+(e=.5*(n-e))+(i=.5*(i-t)))*a+(-3*(t-n)-2*e-i)*o+e*r+t};return function(o){if(!1!==this.isPlaying&&(this.currentTime+=o*this.timeScale,0!==this.weight)){o=this.data.length,(this.currentTime>o||0>this.currentTime)&&(this.loop?(this.currentTime%=o,0>this.currentTime&&(this.currentTime+=o),this.reset()):this.stop()),o=0;for(var a=this.hierarchy.length;a>o;o++)for(var s=this.hierarchy[o],l=s.animationCache.animations[this.data.name],u=s.animationCache.blending,c=0;3>c;c++){var h=this.keyTypes[c],d=l.prevKey[h],f=l.nextKey[h];if(0<this.timeScale&&f.time<=this.currentTime||0>this.timeScale&&d.time>=this.currentTime){for(d=this.data.hierarchy[o].keys[0],f=this.getNextKeyWith(h,o,1);f.time<this.currentTime&&f.index>d.index;)d=f,f=this.getNextKeyWith(h,o,f.index+1);l.prevKey[h]=d,l.nextKey[h]=f}var p=(this.currentTime-d.time)/(f.time-d.time),m=d[h],g=f[h];0>p&&(p=0),p>1&&(p=1),"pos"===h?this.interpolationType===THREE.AnimationHandler.LINEAR?(n.x=m[0]+(g[0]-m[0])*p,n.y=m[1]+(g[1]-m[1])*p,n.z=m[2]+(g[2]-m[2])*p,d=this.weight/(this.weight+u.positionWeight),s.position.lerp(n,d),u.positionWeight+=this.weight):(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)&&(e[0]=this.getPrevKeyWith("pos",o,d.index-1).pos,e[1]=m,e[2]=g,e[3]=this.getNextKeyWith("pos",o,f.index+1).pos,f=r(e,p=.33*p+.33),d=this.weight/(this.weight+u.positionWeight),u.positionWeight+=this.weight,(h=s.position).x+=(f[0]-h.x)*d,h.y+=(f[1]-h.y)*d,h.z+=(f[2]-h.z)*d,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(p=r(e,1.01*p),t.set(p[0],p[1],p[2]),t.sub(h),t.y=0,t.normalize(),p=Math.atan2(t.x,t.z),s.rotation.set(0,p,0))):"rot"===h?(THREE.Quaternion.slerp(m,g,i,p),0===u.quaternionWeight?(s.quaternion.copy(i),u.quaternionWeight=this.weight):(d=this.weight/(this.weight+u.quaternionWeight),THREE.Quaternion.slerp(s.quaternion,i,s.quaternion,d),u.quaternionWeight+=this.weight)):"scl"===h&&(n.x=m[0]+(g[0]-m[0])*p,n.y=m[1]+(g[1]-m[1])*p,n.z=m[2]+(g[2]-m[2])*p,d=this.weight/(this.weight+u.scaleWeight),s.scale.lerp(n,d),u.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(e,t,n){var i=this.data.hierarchy[t].keys;for(n=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?n<i.length-1?n:i.length-1:n%i.length;n<i.length;n++)if(void 0!==i[n][e])return i[n];return this.data.hierarchy[t].keys[0]},getPrevKeyWith:function(e,t,n){var i=this.data.hierarchy[t].keys;for(n=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?n>0?n:0:n>=0?n:n+i.length;n>=0;n--)if(void 0!==i[n][e])return i[n];return this.data.hierarchy[t].keys[i.length-1]}},THREE.KeyFrameAnimation=function(e){this.root=e.node,this.data=THREE.AnimationHandler.init(e),this.hierarchy=THREE.AnimationHandler.parse(this.root),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.loop=this.isPaused=!0,e=0;for(var t=this.hierarchy.length;t>e;e++){var n=this.data.hierarchy[e].sids,i=this.hierarchy[e];if(this.data.hierarchy[e].keys.length&&n){for(var r=0;r<n.length;r++){var o=n[r],a=this.getNextKeyWith(o,e,0);a&&a.apply(o)}i.matrixAutoUpdate=!1,this.data.hierarchy[e].node.updateMatrix(),i.matrixWorldNeedsUpdate=!0}}},THREE.KeyFrameAnimation.prototype={constructor:THREE.KeyFrameAnimation,play:function(e){if(this.currentTime=void 0!==e?e:0,!1===this.isPlaying){this.isPlaying=!0;var t,n,i=this.hierarchy.length;for(e=0;i>e;e++)t=this.hierarchy[e],void 0===(n=this.data.hierarchy[e]).animationCache&&(n.animationCache={},n.animationCache.prevKey=null,n.animationCache.nextKey=null,n.animationCache.originalMatrix=t.matrix),(t=this.data.hierarchy[e].keys).length&&(n.animationCache.prevKey=t[0],n.animationCache.nextKey=t[1],this.startTime=Math.min(t[0].time,this.startTime),this.endTime=Math.max(t[t.length-1].time,this.endTime));this.update(0)}this.isPaused=!1,THREE.AnimationHandler.play(this)},stop:function(){this.isPaused=this.isPlaying=!1,THREE.AnimationHandler.stop(this);for(var e=0;e<this.data.hierarchy.length;e++){var t=this.hierarchy[e],n=this.data.hierarchy[e];if(void 0!==n.animationCache){var i=n.animationCache.originalMatrix;i.copy(t.matrix),t.matrix=i,delete n.animationCache}}},update:function(e){if(!1!==this.isPlaying){this.currentTime+=e*this.timeScale,e=this.data.length,!0===this.loop&&this.currentTime>e&&(this.currentTime%=e),this.currentTime=Math.min(this.currentTime,e),e=0;for(var t=this.hierarchy.length;t>e;e++){var n=this.hierarchy[e],i=(r=this.data.hierarchy[e]).keys,r=r.animationCache;if(i.length){var o=r.prevKey,a=r.nextKey;if(a.time<=this.currentTime){for(;a.time<this.currentTime&&a.index>o.index;)a=i[(o=a).index+1];r.prevKey=o,r.nextKey=a}a.time>=this.currentTime?o.interpolate(a,this.currentTime):o.interpolate(a,a.time),this.data.hierarchy[e].node.updateMatrix(),n.matrixWorldNeedsUpdate=!0}}}},getNextKeyWith:function(e,t,n){for(n%=(t=this.data.hierarchy[t].keys).length;n<t.length;n++)if(t[n].hasTarget(e))return t[n];return t[0]},getPrevKeyWith:function(e,t,n){for(t=this.data.hierarchy[t].keys,n=n>=0?n:n+t.length;n>=0;n--)if(t[n].hasTarget(e))return t[n];return t[t.length-1]}},THREE.MorphAnimation=function(e){this.mesh=e,this.frames=e.morphTargetInfluences.length,this.currentTime=0,this.duration=1e3,this.loop=!0,this.currentFrame=this.lastFrame=0,this.isPlaying=!1},THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(e){if(!1!==this.isPlaying){this.currentTime+=e,!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration),e=this.duration/this.frames;var t=Math.floor(this.currentTime/e),n=this.mesh.morphTargetInfluences;t!=this.currentFrame&&(n[this.lastFrame]=0,n[this.currentFrame]=1,n[t]=0,this.lastFrame=this.currentFrame,this.currentFrame=t),n[t]=this.currentTime%e/e,n[this.lastFrame]=1-n[t]}}},THREE.BoxGeometry=function(e,t,n,i,r,o){function a(e,t,n,i,r,o,a,l){var u,c=s.widthSegments,h=s.heightSegments,d=r/2,f=o/2,p=s.vertices.length;"x"===e&&"y"===t||"y"===e&&"x"===t?u="z":"x"===e&&"z"===t||"z"===e&&"x"===t?(u="y",h=s.depthSegments):("z"===e&&"y"===t||"y"===e&&"z"===t)&&(u="x",c=s.depthSegments);var m=c+1,g=h+1,v=r/c,E=o/h,y=new THREE.Vector3;for(y[u]=a>0?1:-1,r=0;g>r;r++)for(o=0;m>o;o++){var _=new THREE.Vector3;_[e]=(o*v-d)*n,_[t]=(r*E-f)*i,_[u]=a,s.vertices.push(_)}for(r=0;h>r;r++)for(o=0;c>o;o++)f=o+m*r,e=o+m*(r+1),t=o+1+m*(r+1),n=o+1+m*r,i=new THREE.Vector2(o/c,1-r/h),a=new THREE.Vector2(o/c,1-(r+1)/h),u=new THREE.Vector2((o+1)/c,1-(r+1)/h),d=new THREE.Vector2((o+1)/c,1-r/h),(f=new THREE.Face3(f+p,e+p,n+p)).normal.copy(y),f.vertexNormals.push(y.clone(),y.clone(),y.clone()),f.materialIndex=l,s.faces.push(f),s.faceVertexUvs[0].push([i,a,d]),(f=new THREE.Face3(e+p,t+p,n+p)).normal.copy(y),f.vertexNormals.push(y.clone(),y.clone(),y.clone()),f.materialIndex=l,s.faces.push(f),s.faceVertexUvs[0].push([a.clone(),u,d.clone()])}THREE.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:o},this.widthSegments=i||1,this.heightSegments=r||1,this.depthSegments=o||1;var s=this;r=t/2,o=n/2,a("z","y",-1,-1,n,t,i=e/2,0),a("z","y",1,-1,n,t,-i,1),a("x","z",1,1,e,n,r,2),a("x","z",1,-1,e,n,-r,3),a("x","y",1,-1,e,t,o,4),a("x","y",-1,-1,e,t,-o,5),this.mergeVertices()},THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry,THREE.CircleGeometry=function(e,t,n,i){THREE.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||50,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,o=[];r=new THREE.Vector3;var a=new THREE.Vector2(.5,.5);for(this.vertices.push(r),o.push(a),r=0;t>=r;r++){var s=new THREE.Vector3,l=n+r/t*i;s.x=e*Math.cos(l),s.y=e*Math.sin(l),this.vertices.push(s),o.push(new THREE.Vector2((s.x/e+1)/2,(s.y/e+1)/2))}for(n=new THREE.Vector3(0,0,1),r=1;t>=r;r++)this.faces.push(new THREE.Face3(r,r+1,0,[n.clone(),n.clone(),n.clone()])),this.faceVertexUvs[0].push([o[r].clone(),o[r+1].clone(),a.clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,e)},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry,THREE.CubeGeometry=function(e,t,n,i,r,o){return THREE.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry."),new THREE.BoxGeometry(e,t,n,i,r,o)},THREE.CylinderGeometry=function(e,t,n,i,r,o,a,s){THREE.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s},e=void 0!==e?e:20,t=void 0!==t?t:20,n=void 0!==n?n:100,i=i||8,r=r||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var l,u,c=n/2,h=[],d=[];for(u=0;r>=u;u++){var f=[],p=[],m=(v=u/r)*(t-e)+e;for(l=0;i>=l;l++){var g=l/i;(E=new THREE.Vector3).x=m*Math.sin(g*s+a),E.y=-v*n+c,E.z=m*Math.cos(g*s+a),this.vertices.push(E),f.push(this.vertices.length-1),p.push(new THREE.Vector2(g,1-v))}h.push(f),d.push(p)}for(n=(t-e)/n,l=0;i>l;l++)for(0!==e?(a=this.vertices[h[0][l]].clone(),s=this.vertices[h[0][l+1]].clone()):(a=this.vertices[h[1][l]].clone(),s=this.vertices[h[1][l+1]].clone()),a.setY(Math.sqrt(a.x*a.x+a.z*a.z)*n).normalize(),s.setY(Math.sqrt(s.x*s.x+s.z*s.z)*n).normalize(),u=0;r>u;u++){f=h[u][l],p=h[u+1][l];var v=h[u+1][l+1],E=(m=h[u][l+1],g=a.clone(),a.clone()),y=s.clone(),_=s.clone(),T=d[u][l].clone(),b=d[u+1][l].clone(),w=d[u+1][l+1].clone(),x=d[u][l+1].clone();this.faces.push(new THREE.Face3(f,p,m,[g,E,_])),this.faceVertexUvs[0].push([T,b,x]),this.faces.push(new THREE.Face3(p,v,m,[E.clone(),y,_.clone()])),this.faceVertexUvs[0].push([b.clone(),w,x.clone()])}if(!1===o&&e>0)for(this.vertices.push(new THREE.Vector3(0,c,0)),l=0;i>l;l++)f=h[0][l],p=h[0][l+1],v=this.vertices.length-1,g=new THREE.Vector3(0,1,0),E=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),T=d[0][l].clone(),b=d[0][l+1].clone(),w=new THREE.Vector2(b.x,0),this.faces.push(new THREE.Face3(f,p,v,[g,E,y])),this.faceVertexUvs[0].push([T,b,w]);if(!1===o&&t>0)for(this.vertices.push(new THREE.Vector3(0,-c,0)),l=0;i>l;l++)f=h[r][l+1],p=h[r][l],v=this.vertices.length-1,g=new THREE.Vector3(0,-1,0),E=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),T=d[r][l+1].clone(),b=d[r][l].clone(),w=new THREE.Vector2(b.x,1),this.faces.push(new THREE.Face3(f,p,v,[g,E,y])),this.faceVertexUvs[0].push([T,b,w]);this.computeFaceNormals()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry,THREE.ExtrudeGeometry=function(e,t){void 0!==e&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",e=e instanceof Array?e:[e],this.addShapeList(e,t),this.computeFaceNormals())},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry,THREE.ExtrudeGeometry.prototype.addShapeList=function(e,t){for(var n=e.length,i=0;n>i;i++)this.addShape(e[i],t)},THREE.ExtrudeGeometry.prototype.addShape=function(e,t){function n(e,t,n){return t||THREE.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}function i(e,t,n){var i=1,r=(i=e.x-t.x,e.y-t.y),o=n.x-e.x,a=n.y-e.y,s=i*i+r*r;if(1e-10<Math.abs(i*a-r*o)){var l=Math.sqrt(s),u=Math.sqrt(o*o+a*a);s=t.x-r/l;if(t=t.y+i/l,2>=(i=(n=s+i*(o=((n.x-a/u-s)*a-(n.y+o/u-t)*o)/(i*a-r*o))-e.x)*n+(e=t+r*o-e.y)*e))return new THREE.Vector2(n,e);i=Math.sqrt(i/2)}else e=!1,i>1e-10?o>1e-10&&(e=!0):-1e-10>i?-1e-10>o&&(e=!0):Math.sign(r)==Math.sign(a)&&(e=!0),e?(n=-r,e=i,i=Math.sqrt(s)):(n=i,e=r,i=Math.sqrt(s/2));return new THREE.Vector2(n/i,e/i)}function r(e,t){var n,i;for(z=e.length;0<=--z;){n=z,0>(i=z-1)&&(i=e.length-1);var r=0,o=E+2*m;for(r=0;o>r;r++){var a=(a=t+n+(s=I*r))+M,s=(s=t+i+s)+M,l=(l=t+i+(u=I*(r+1)))+M,u=(u=t+n+u)+M;S.faces.push(new THREE.Face3(a,s,u,null,null,b)),S.faces.push(new THREE.Face3(s,l,u,null,null,b)),a=w.generateSideWallUV(S,a,s,l,u),S.faceVertexUvs[0].push([a[0],a[1],a[3]]),S.faceVertexUvs[0].push([a[1],a[2],a[3]])}}}function o(e,t,n){S.vertices.push(new THREE.Vector3(e,t,n))}function a(e,t,n){e+=M,t+=M,n+=M,S.faces.push(new THREE.Face3(e,t,n,null,null,T)),e=w.generateTopUV(S,e,t,n),S.faceVertexUvs[0].push(e)}var s,l,u,c,h,d=void 0!==t.amount?t.amount:100,f=void 0!==t.bevelThickness?t.bevelThickness:6,p=void 0!==t.bevelSize?t.bevelSize:f-2,m=void 0!==t.bevelSegments?t.bevelSegments:3,g=void 0===t.bevelEnabled||t.bevelEnabled,v=void 0!==t.curveSegments?t.curveSegments:12,E=void 0!==t.steps?t.steps:1,y=t.extrudePath,_=!1,T=t.material,b=t.extrudeMaterial,w=void 0!==t.UVGenerator?t.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;y&&(s=y.getSpacedPoints(E),_=!0,g=!1,l=void 0!==t.frames?t.frames:new THREE.TubeGeometry.FrenetFrames(y,E,!1),u=new THREE.Vector3,c=new THREE.Vector3,h=new THREE.Vector3),g||(p=f=m=0);var x,R,H,S=this,M=this.vertices.length,C=(v=(y=e.extractPoints(v)).shape,y.holes);if(y=!THREE.Shape.Utils.isClockWise(v)){for(v=v.reverse(),R=0,H=C.length;H>R;R++)x=C[R],THREE.Shape.Utils.isClockWise(x)&&(C[R]=x.reverse());y=!1}var A=THREE.Shape.Utils.triangulateShape(v,C),k=v;for(R=0,H=C.length;H>R;R++)x=C[R],v=v.concat(x);var P,D,L,O,F,N,I=v.length,B=A.length,z=(y=[],0);for(P=(L=k.length)-1,D=z+1;L>z;z++,P++,D++)P===L&&(P=0),D===L&&(D=0),y[z]=i(k[z],k[P],k[D]);var V,U=[],j=y.concat();for(R=0,H=C.length;H>R;R++){for(x=C[R],V=[],z=0,P=(L=x.length)-1,D=z+1;L>z;z++,P++,D++)P===L&&(P=0),D===L&&(D=0),V[z]=i(x[z],x[P],x[D]);U.push(V),j=j.concat(V)}for(P=0;m>P;P++){for(O=f*(1-(L=P/m)),D=p*Math.sin(L*Math.PI/2),z=0,L=k.length;L>z;z++)o((F=n(k[z],y[z],D)).x,F.y,-O);for(R=0,H=C.length;H>R;R++)for(x=C[R],V=U[R],z=0,L=x.length;L>z;z++)o((F=n(x[z],V[z],D)).x,F.y,-O)}for(D=p,z=0;I>z;z++)F=g?n(v[z],j[z],D):v[z],_?(c.copy(l.normals[0]).multiplyScalar(F.x),u.copy(l.binormals[0]).multiplyScalar(F.y),h.copy(s[0]).add(c).add(u),o(h.x,h.y,h.z)):o(F.x,F.y,0);for(L=1;E>=L;L++)for(z=0;I>z;z++)F=g?n(v[z],j[z],D):v[z],_?(c.copy(l.normals[L]).multiplyScalar(F.x),u.copy(l.binormals[L]).multiplyScalar(F.y),h.copy(s[L]).add(c).add(u),o(h.x,h.y,h.z)):o(F.x,F.y,d/E*L);for(P=m-1;P>=0;P--){for(O=f*(1-(L=P/m)),D=p*Math.sin(L*Math.PI/2),z=0,L=k.length;L>z;z++)o((F=n(k[z],y[z],D)).x,F.y,d+O);for(R=0,H=C.length;H>R;R++)for(x=C[R],V=U[R],z=0,L=x.length;L>z;z++)F=n(x[z],V[z],D),_?o(F.x,F.y+s[E-1].y,s[E-1].x+O):o(F.x,F.y,d+O)}!function(){if(g){var e;for(e=0*I,z=0;B>z;z++)a((N=A[z])[2]+e,N[1]+e,N[0]+e);for(e=E+2*m,e*=I,z=0;B>z;z++)a((N=A[z])[0]+e,N[1]+e,N[2]+e)}else{for(z=0;B>z;z++)a((N=A[z])[2],N[1],N[0]);for(z=0;B>z;z++)a((N=A[z])[0]+I*E,N[1]+I*E,N[2]+I*E)}}(),function(){var e=0;for(r(k,e),e+=k.length,R=0,H=C.length;H>R;R++)r(x=C[R],e),e+=x.length}()},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(e,t,n,i){return t=(e=e.vertices)[t],n=e[n],i=e[i],[new THREE.Vector2(t.x,t.y),new THREE.Vector2(n.x,n.y),new THREE.Vector2(i.x,i.y)]},generateSideWallUV:function(e,t,n,i,r){return t=(e=e.vertices)[t],n=e[n],i=e[i],r=e[r],.01>Math.abs(t.y-n.y)?[new THREE.Vector2(t.x,1-t.z),new THREE.Vector2(n.x,1-n.z),new THREE.Vector2(i.x,1-i.z),new THREE.Vector2(r.x,1-r.z)]:[new THREE.Vector2(t.y,1-t.z),new THREE.Vector2(n.y,1-n.z),new THREE.Vector2(i.y,1-i.z),new THREE.Vector2(r.y,1-r.z)]}},THREE.ShapeGeometry=function(e,t){THREE.Geometry.call(this),this.type="ShapeGeometry",0==e instanceof Array&&(e=[e]),this.addShapeList(e,t),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry,THREE.ShapeGeometry.prototype.addShapeList=function(e,t){for(var n=0,i=e.length;i>n;n++)this.addShape(e[n],t);return this},THREE.ShapeGeometry.prototype.addShape=function(e,t){void 0===t&&(t={});var n,i,r,o=t.material,a=void 0===t.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:t.UVGenerator,s=this.vertices.length,l=(n=e.extractPoints(void 0!==t.curveSegments?t.curveSegments:12)).shape,u=n.holes;if(!THREE.Shape.Utils.isClockWise(l))for(l=l.reverse(),n=0,i=u.length;i>n;n++)r=u[n],THREE.Shape.Utils.isClockWise(r)&&(u[n]=r.reverse());var c=THREE.Shape.Utils.triangulateShape(l,u);for(n=0,i=u.length;i>n;n++)r=u[n],l=l.concat(r);for(u=l.length,i=c.length,n=0;u>n;n++)r=l[n],this.vertices.push(new THREE.Vector3(r.x,r.y,0));for(n=0;i>n;n++)l=(u=c[n])[0]+s,r=u[1]+s,u=u[2]+s,this.faces.push(new THREE.Face3(l,r,u,null,null,o)),this.faceVertexUvs[0].push(a.generateTopUV(this,l,r,u))},THREE.LatheGeometry=function(e,t,n,i){THREE.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=t||12,n=n||0,i=i||2*Math.PI;for(var r=1/(e.length-1),o=1/t,a=0,s=t;s>=a;a++)for(var l=n+a*o*i,u=Math.cos(l),c=Math.sin(l),h=(l=0,e.length);h>l;l++){var d=e[l];(f=new THREE.Vector3).x=u*d.x-c*d.y,f.y=c*d.x+u*d.y,f.z=d.z,this.vertices.push(f)}for(n=e.length,a=0,s=t;s>a;a++)for(l=0,h=e.length-1;h>l;l++){t=c=l+n*a,i=c+n;u=c+1+n,c=c+1;var f,p=(d=a*o)+o,m=(f=l*r)+r;this.faces.push(new THREE.Face3(t,i,c)),this.faceVertexUvs[0].push([new THREE.Vector2(d,f),new THREE.Vector2(p,f),new THREE.Vector2(d,m)]),this.faces.push(new THREE.Face3(i,u,c)),this.faceVertexUvs[0].push([new THREE.Vector2(p,f),new THREE.Vector2(p,m),new THREE.Vector2(d,m)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry,THREE.PlaneGeometry=function(e,t,n,i){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint."),THREE.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new THREE.PlaneBufferGeometry(e,t,n,i))},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry,THREE.PlaneBufferGeometry=function(e,t,n,i){THREE.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};var r=e/2,o=t/2,a=(n=n||1)+1,s=(i=i||1)+1,l=e/n,u=t/i;t=new Float32Array(a*s*3),e=new Float32Array(a*s*3);for(var c=new Float32Array(a*s*2),h=0,d=0,f=0;s>f;f++)for(var p=f*u-o,m=0;a>m;m++)t[h]=m*l-r,t[h+1]=-p,e[h+2]=1,c[d]=m/n,c[d+1]=1-f/i,h+=3,d+=2;for(h=0,r=new(65535<t.length/3?Uint32Array:Uint16Array)(n*i*6),f=0;i>f;f++)for(m=0;n>m;m++)o=m+a*(f+1),s=m+1+a*(f+1),l=m+1+a*f,r[h]=m+a*f,r[h+1]=o,r[h+2]=l,r[h+3]=o,r[h+4]=s,r[h+5]=l,h+=6;this.addAttribute("index",new THREE.BufferAttribute(r,1)),this.addAttribute("position",new THREE.BufferAttribute(t,3)),this.addAttribute("normal",new THREE.BufferAttribute(e,3)),this.addAttribute("uv",new THREE.BufferAttribute(c,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingGeometry=function(e,t,n,i,r,o){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},e=e||0,t=t||50,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s=[],l=e,u=(t-e)/(i=void 0!==i?Math.max(1,i):8);for(e=0;i+1>e;e++){for(a=0;n+1>a;a++){var c=new THREE.Vector3,h=r+a/n*o;c.x=l*Math.cos(h),c.y=l*Math.sin(h),this.vertices.push(c),s.push(new THREE.Vector2((c.x/t+1)/2,(c.y/t+1)/2))}l+=u}for(t=new THREE.Vector3(0,0,1),e=0;i>e;e++)for(r=e*(n+1),a=0;n>a;a++)o=h=a+r,u=h+n+1,c=h+n+2,this.faces.push(new THREE.Face3(o,u,c,[t.clone(),t.clone(),t.clone()])),this.faceVertexUvs[0].push([s[o].clone(),s[u].clone(),s[c].clone()]),o=h,u=h+n+2,c=h+1,this.faces.push(new THREE.Face3(o,u,c,[t.clone(),t.clone(),t.clone()])),this.faceVertexUvs[0].push([s[o].clone(),s[u].clone(),s[c].clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,l)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(e,t,n,i,r,o,a){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},e=e||50,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,o=void 0!==o?o:0,a=void 0!==a?a:Math.PI;var s,l,u=[],c=[];for(l=0;n>=l;l++){var h=[],d=[];for(s=0;t>=s;s++){var f=s/t,p=l/n;(m=new THREE.Vector3).x=-e*Math.cos(i+f*r)*Math.sin(o+p*a),m.y=e*Math.cos(o+p*a),m.z=e*Math.sin(i+f*r)*Math.sin(o+p*a),this.vertices.push(m),h.push(this.vertices.length-1),d.push(new THREE.Vector2(f,1-p))}u.push(h),c.push(d)}for(l=0;n>l;l++)for(s=0;t>s;s++){i=u[l][s+1],r=u[l][s],o=u[l+1][s],a=u[l+1][s+1];h=this.vertices[i].clone().normalize(),d=this.vertices[r].clone().normalize(),f=this.vertices[o].clone().normalize(),p=this.vertices[a].clone().normalize();var m=c[l][s+1].clone(),g=c[l][s].clone(),v=c[l+1][s].clone(),E=c[l+1][s+1].clone();Math.abs(this.vertices[i].y)===e?(m.x=(m.x+g.x)/2,this.faces.push(new THREE.Face3(i,o,a,[h,f,p])),this.faceVertexUvs[0].push([m,v,E])):Math.abs(this.vertices[o].y)===e?(v.x=(v.x+E.x)/2,this.faces.push(new THREE.Face3(i,r,o,[h,d,f])),this.faceVertexUvs[0].push([m,g,v])):(this.faces.push(new THREE.Face3(i,r,a,[h,d,p])),this.faceVertexUvs[0].push([m,g,E]),this.faces.push(new THREE.Face3(r,o,a,[d.clone(),f,p.clone()])),this.faceVertexUvs[0].push([g.clone(),v,E.clone()]))}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,e)},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.TextGeometry=function(e,t){t=t||{};var n=THREE.FontUtils.generateShapes(e,t);t.amount=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),THREE.ExtrudeGeometry.call(this,n,t),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusGeometry=function(e,t,n,i,r){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},e=e||100,t=t||40,n=n||8,i=i||6,r=r||2*Math.PI;for(var o=new THREE.Vector3,a=[],s=[],l=0;n>=l;l++)for(var u=0;i>=u;u++){var c=u/i*r,h=l/n*Math.PI*2;o.x=e*Math.cos(c),o.y=e*Math.sin(c);var d=new THREE.Vector3;d.x=(e+t*Math.cos(h))*Math.cos(c),d.y=(e+t*Math.cos(h))*Math.sin(c),d.z=t*Math.sin(h),this.vertices.push(d),a.push(new THREE.Vector2(u/i,l/n)),s.push(d.clone().sub(o).normalize())}for(l=1;n>=l;l++)for(u=1;i>=u;u++)e=(i+1)*l+u-1,t=(i+1)*(l-1)+u-1,r=(i+1)*(l-1)+u,o=(i+1)*l+u,c=new THREE.Face3(e,t,o,[s[e].clone(),s[t].clone(),s[o].clone()]),this.faces.push(c),this.faceVertexUvs[0].push([a[e].clone(),a[t].clone(),a[o].clone()]),c=new THREE.Face3(t,r,o,[s[t].clone(),s[r].clone(),s[o].clone()]),this.faces.push(c),this.faceVertexUvs[0].push([a[t].clone(),a[r].clone(),a[o].clone()]);this.computeFaceNormals()},THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry,THREE.TorusKnotGeometry=function(e,t,n,i,r,o,a){function s(e,t,n,i,r){var o=Math.cos(e),a=Math.sin(e);return e*=t/n,o*=i*(2+(t=Math.cos(e)))*.5,a=i*(2+t)*a*.5,i=r*i*Math.sin(e)*.5,new THREE.Vector3(o,a,i)}THREE.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,p:r,q:o,heightScale:a},e=e||100,t=t||40,n=n||64,i=i||8,r=r||2,o=o||3,a=a||1;for(var l=Array(n),u=new THREE.Vector3,c=new THREE.Vector3,h=new THREE.Vector3,d=0;n>d;++d){l[d]=Array(i);var f=s(p=d/n*2*r*Math.PI,o,r,e,a),p=s(p+.01,o,r,e,a);for(u.subVectors(p,f),c.addVectors(p,f),h.crossVectors(u,c),c.crossVectors(h,u),h.normalize(),c.normalize(),p=0;i>p;++p){var m=p/i*2*Math.PI,g=-t*Math.cos(m),v=(m=t*Math.sin(m),new THREE.Vector3);v.x=f.x+g*c.x+m*h.x,v.y=f.y+g*c.y+m*h.y,v.z=f.z+g*c.z+m*h.z,l[d][p]=this.vertices.push(v)-1}}for(d=0;n>d;++d)for(p=0;i>p;++p)r=(d+1)%n,o=(p+1)%i,e=l[d][p],t=l[r][p],r=l[r][o],o=l[d][o],a=new THREE.Vector2(d/n,p/i),u=new THREE.Vector2((d+1)/n,p/i),c=new THREE.Vector2((d+1)/n,(p+1)/i),h=new THREE.Vector2(d/n,(p+1)/i),this.faces.push(new THREE.Face3(e,t,o)),this.faceVertexUvs[0].push([a,u,h]),this.faces.push(new THREE.Face3(t,r,o)),this.faceVertexUvs[0].push([u.clone(),c,h.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry,THREE.TubeGeometry=function(e,t,n,i,r,o){THREE.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:e,segments:t,radius:n,radialSegments:i,closed:r},t=t||64,n=n||1,i=i||8,r=r||!1,o=o||THREE.TubeGeometry.NoTaper;var a,s,l,u,c,h,d,f,p,m,g=[],v=t+1,E=new THREE.Vector3;for(p=(f=new THREE.TubeGeometry.FrenetFrames(e,t,r)).normals,m=f.binormals,this.tangents=f.tangents,this.normals=p,this.binormals=m,f=0;v>f;f++)for(g[f]=[],l=f/(v-1),d=e.getPointAt(l),a=p[f],s=m[f],c=n*o(l),l=0;i>l;l++)u=l/i*2*Math.PI,h=-c*Math.cos(u),u=c*Math.sin(u),E.copy(d),E.x+=h*a.x+u*s.x,E.y+=h*a.y+u*s.y,E.z+=h*a.z+u*s.z,g[f][l]=this.vertices.push(new THREE.Vector3(E.x,E.y,E.z))-1;for(f=0;t>f;f++)for(l=0;i>l;l++)o=r?(f+1)%t:f+1,v=(l+1)%i,e=g[f][l],n=g[o][l],o=g[o][v],v=g[f][v],E=new THREE.Vector2(f/t,l/i),p=new THREE.Vector2((f+1)/t,l/i),m=new THREE.Vector2((f+1)/t,(l+1)/i),a=new THREE.Vector2(f/t,(l+1)/i),this.faces.push(new THREE.Face3(e,n,v)),this.faceVertexUvs[0].push([E,p,a]),this.faces.push(new THREE.Face3(n,o,v)),this.faceVertexUvs[0].push([p.clone(),m,a.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry,THREE.TubeGeometry.NoTaper=function(e){return 1},THREE.TubeGeometry.SinusoidalTaper=function(e){return Math.sin(Math.PI*e)},THREE.TubeGeometry.FrenetFrames=function(e,t,n){var i,r,o,a=new THREE.Vector3,s=[],l=[],u=[],c=new THREE.Vector3,h=new THREE.Matrix4;for(t+=1,this.tangents=s,this.normals=l,this.binormals=u,i=0;t>i;i++)r=i/(t-1),s[i]=e.getTangentAt(r),s[i].normalize();for(l[0]=new THREE.Vector3,u[0]=new THREE.Vector3,e=Number.MAX_VALUE,i=Math.abs(s[0].x),r=Math.abs(s[0].y),o=Math.abs(s[0].z),e>=i&&(e=i,a.set(1,0,0)),e>=r&&(e=r,a.set(0,1,0)),e>=o&&a.set(0,0,1),c.crossVectors(s[0],a).normalize(),l[0].crossVectors(s[0],c),u[0].crossVectors(s[0],l[0]),i=1;t>i;i++)l[i]=l[i-1].clone(),u[i]=u[i-1].clone(),c.crossVectors(s[i-1],s[i]),1e-4<c.length()&&(c.normalize(),a=Math.acos(THREE.Math.clamp(s[i-1].dot(s[i]),-1,1)),l[i].applyMatrix4(h.makeRotationAxis(c,a))),u[i].crossVectors(s[i],l[i]);if(n)for(a=Math.acos(THREE.Math.clamp(l[0].dot(l[t-1]),-1,1)),a/=t-1,0<s[0].dot(c.crossVectors(l[0],l[t-1]))&&(a=-a),i=1;t>i;i++)l[i].applyMatrix4(h.makeRotationAxis(s[i],a*i)),u[i].crossVectors(s[i],l[i])},THREE.PolyhedronGeometry=function(e,t,n,i){function r(e){var t=e.normalize().clone();t.index=l.vertices.push(t)-1;var n=Math.atan2(e.z,-e.x)/2/Math.PI+.5;return e=Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5,t.uv=new THREE.Vector2(n,1-e),t}function o(e,t,n){var i=new THREE.Face3(e.index,t.index,n.index,[e.clone(),t.clone(),n.clone()]);l.faces.push(i),g.copy(e).add(t).add(n).divideScalar(3),i=Math.atan2(g.z,-g.x),l.faceVertexUvs[0].push([s(e.uv,e,i),s(t.uv,t,i),s(n.uv,n,i)])}function a(e,t){for(var n=Math.pow(2,t),i=r(l.vertices[e.a]),a=r(l.vertices[e.b]),s=r(l.vertices[e.c]),u=[],c=0;n>=c;c++){u[c]=[];for(var h=r(i.clone().lerp(s,c/n)),d=r(a.clone().lerp(s,c/n)),f=n-c,p=0;f>=p;p++)u[c][p]=0==p&&c==n?h:r(h.clone().lerp(d,p/f))}for(c=0;n>c;c++)for(p=0;2*(n-c)-1>p;p++)i=Math.floor(p/2),0==p%2?o(u[c][i+1],u[c+1][i],u[c][i]):o(u[c][i+1],u[c+1][i+1],u[c+1][i])}function s(e,t,n){return 0>n&&1===e.x&&(e=new THREE.Vector2(e.x-1,e.y)),0===t.x&&0===t.z&&(e=new THREE.Vector2(n/2/Math.PI+.5,e.y)),e.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},n=n||1,i=i||0;for(var l=this,u=0,c=e.length;c>u;u+=3)r(new THREE.Vector3(e[u],e[u+1],e[u+2]));e=this.vertices;var h=[],d=u=0;for(c=t.length;c>u;u+=3,d++){var f=e[t[u]],p=e[t[u+1]],m=e[t[u+2]];h[d]=new THREE.Face3(f.index,p.index,m.index,[f.clone(),p.clone(),m.clone()])}var g=new THREE.Vector3;for(u=0,c=h.length;c>u;u++)a(h[u],i);for(u=0,c=this.faceVertexUvs[0].length;c>u;u++)i=(t=this.faceVertexUvs[0][u])[0].x,e=t[1].x,h=t[2].x,d=Math.max(i,Math.max(e,h)),f=Math.min(i,Math.min(e,h)),d>.9&&.1>f&&(.2>i&&(t[0].x+=1),.2>e&&(t[1].x+=1),.2>h&&(t[2].x+=1));for(u=0,c=this.vertices.length;c>u;u++)this.vertices[u].multiplyScalar(n);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,n)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry,THREE.DodecahedronGeometry=function(e,t){this.parameters={radius:e,detail:t};var n=(1+Math.sqrt(5))/2,i=1/n;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t)},THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry,THREE.IcosahedronGeometry=function(e,t){var n=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,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],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}},THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry,THREE.OctahedronGeometry=function(e,t){this.parameters={radius:e,detail:t},THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}},THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry,THREE.TetrahedronGeometry=function(e,t){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}},THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry,THREE.ParametricGeometry=function(e,t,n){THREE.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n};var i,r,o,a,s,l,u,c,h=this.vertices,d=this.faces,f=this.faceVertexUvs[0],p=t+1;for(i=0;n>=i;i++)for(a=i/n,r=0;t>=r;r++)o=e(o=r/t,a),h.push(o);for(i=0;n>i;i++)for(r=0;t>r;r++)e=i*p+r,h=i*p+r+1,a=(i+1)*p+r+1,o=(i+1)*p+r,s=new THREE.Vector2(r/t,i/n),l=new THREE.Vector2((r+1)/t,i/n),u=new THREE.Vector2((r+1)/t,(i+1)/n),c=new THREE.Vector2(r/t,(i+1)/n),d.push(new THREE.Face3(e,h,o)),f.push([s,l,c]),d.push(new THREE.Face3(h,a,o)),f.push([l.clone(),u,c.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry,THREE.AxisHelper=function(e){e=e||1;var t=new Float32Array([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e]),n=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);(e=new THREE.BufferGeometry).addAttribute("position",new THREE.BufferAttribute(t,3)),e.addAttribute("color",new THREE.BufferAttribute(n,3)),t=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),THREE.Line.call(this,e,t,THREE.LinePieces)},THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype),THREE.AxisHelper.prototype.constructor=THREE.AxisHelper,THREE.ArrowHelper=function(){var e=new THREE.Geometry;e.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var t=new THREE.CylinderGeometry(0,.5,1,5,1);return t.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),function(n,i,r,o,a,s){THREE.Object3D.call(this),void 0===o&&(o=16776960),void 0===r&&(r=1),void 0===a&&(a=.2*r),void 0===s&&(s=.2*a),this.position.copy(i),this.line=new THREE.Line(e,new THREE.LineBasicMaterial({color:o})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new THREE.Mesh(t,new THREE.MeshBasicMaterial({color:o})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(n),this.setLength(r,a,s)}}(),THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper,THREE.ArrowHelper.prototype.setDirection=function(){var e,t=new THREE.Vector3;return function(n){.99999<n.y?this.quaternion.set(0,0,0,1):-.99999>n.y?this.quaternion.set(1,0,0,0):(t.set(n.z,0,-n.x).normalize(),e=Math.acos(n.y),this.quaternion.setFromAxisAngle(t,e))}}(),THREE.ArrowHelper.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,e-t,1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},THREE.BoxHelper=function(e){var t=new THREE.BufferGeometry;t.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3)),THREE.Line.call(this,t,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces),void 0!==e&&this.update(e)},THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype),THREE.BoxHelper.prototype.constructor=THREE.BoxHelper,THREE.BoxHelper.prototype.update=function(e){null===(n=e.geometry).boundingBox&&n.computeBoundingBox();var t=n.boundingBox.min,n=n.boundingBox.max,i=this.geometry.attributes.position.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=n.y,i[8]=n.z,i[9]=t.x,i[10]=t.y,i[11]=n.z,i[12]=t.x,i[13]=t.y,i[14]=n.z,i[15]=n.x,i[16]=t.y,i[17]=n.z,i[18]=n.x,i[19]=t.y,i[20]=n.z,i[21]=n.x,i[22]=n.y,i[23]=n.z,i[24]=n.x,i[25]=n.y,i[26]=t.z,i[27]=t.x,i[28]=n.y,i[29]=t.z,i[30]=t.x,i[31]=n.y,i[32]=t.z,i[33]=t.x,i[34]=t.y,i[35]=t.z,i[36]=t.x,i[37]=t.y,i[38]=t.z,i[39]=n.x,i[40]=t.y,i[41]=t.z,i[42]=n.x,i[43]=t.y,i[44]=t.z,i[45]=n.x,i[46]=n.y,i[47]=t.z,i[48]=n.x,i[49]=n.y,i[50]=n.z,i[51]=n.x,i[52]=n.y,i[53]=t.z,i[54]=t.x,i[55]=n.y,i[56]=n.z,i[57]=t.x,i[58]=n.y,i[59]=t.z,i[60]=t.x,i[61]=t.y,i[62]=n.z,i[63]=t.x,i[64]=t.y,i[65]=t.z,i[66]=n.x,i[67]=t.y,i[68]=n.z,i[69]=n.x,i[70]=t.y,i[71]=t.z,this.geometry.attributes.position.needsUpdate=!0,this.geometry.computeBoundingSphere(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},THREE.BoundingBoxHelper=function(e,t){var n=void 0!==t?t:8947848;this.object=e,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:n,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper,THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(e){function t(e,t,i){n(e,i),n(t,i)}function n(e,t){i.vertices.push(new THREE.Vector3),i.colors.push(new THREE.Color(t)),void 0===o[e]&&(o[e]=[]),o[e].push(i.vertices.length-1)}var i=new THREE.Geometry,r=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),o={};t("n1","n2",16755200),t("n2","n4",16755200),t("n4","n3",16755200),t("n3","n1",16755200),t("f1","f2",16755200),t("f2","f4",16755200),t("f4","f3",16755200),t("f3","f1",16755200),t("n1","f1",16755200),t("n2","f2",16755200),t("n3","f3",16755200),t("n4","f4",16755200),t("p","n1",16711680),t("p","n2",16711680),t("p","n3",16711680),t("p","n4",16711680),t("u1","u2",43775),t("u2","u3",43775),t("u3","u1",43775),t("c","t",16777215),t("p","c",3355443),t("cn1","cn2",3355443),t("cn3","cn4",3355443),t("cf1","cf2",3355443),t("cf3","cf4",3355443),THREE.Line.call(this,i,r,THREE.LinePieces),this.camera=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype),THREE.CameraHelper.prototype.constructor=THREE.CameraHelper,THREE.CameraHelper.prototype.update=function(){var e,t,n=new THREE.Vector3,i=new THREE.Camera,r=function(r,o,a,s){if(n.set(o,a,s).unproject(i),void 0!==(r=t[r]))for(o=0,a=r.length;a>o;o++)e.vertices[r[o]].copy(n)};return function(){e=this.geometry,t=this.pointMap,i.projectionMatrix.copy(this.camera.projectionMatrix),r("c",0,0,-1),r("t",0,0,1),r("n1",-1,-1,-1),r("n2",1,-1,-1),r("n3",-1,1,-1),r("n4",1,1,-1),r("f1",-1,-1,1),r("f2",1,-1,1),r("f3",-1,1,1),r("f4",1,1,1),r("u1",.7,1.1,-1),r("u2",-.7,1.1,-1),r("u3",0,2,-1),r("cf1",-1,0,1),r("cf2",1,0,1),r("cf3",0,-1,1),r("cf4",0,1,1),r("cn1",-1,0,-1),r("cn2",1,0,-1),r("cn3",0,-1,-1),r("cn4",0,1,-1),e.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(e,t){THREE.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,t=t||1;var n=new THREE.Geometry;n.vertices.push(new THREE.Vector3(-t,t,0),new THREE.Vector3(t,t,0),new THREE.Vector3(t,-t,0),new THREE.Vector3(-t,-t,0),new THREE.Vector3(-t,t,0));var i=new THREE.LineBasicMaterial({fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Line(n,i),this.add(this.lightPlane),(n=new THREE.Geometry).vertices.push(new THREE.Vector3,new THREE.Vector3),(i=new THREE.LineBasicMaterial({fog:!1})).color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(n,i),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper,THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var e=new THREE.Vector3,t=new THREE.Vector3,n=new THREE.Vector3;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(t,e),this.lightPlane.lookAt(n),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(n),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),THREE.EdgesHelper=function(e,t,n){t=void 0!==t?t:16777215,n=Math.cos(THREE.Math.degToRad(void 0!==n?n:1));var i,r=[0,0],o={},a=function(e,t){return e-t},s=["a","b","c"],l=new THREE.BufferGeometry;e.geometry instanceof THREE.BufferGeometry?(i=new THREE.Geometry).fromBufferGeometry(e.geometry):i=e.geometry.clone(),i.mergeVertices(),i.computeFaceNormals();for(var u=i.vertices,c=0,h=0,d=(i=i.faces).length;d>h;h++)for(var f=i[h],p=0;3>p;p++){r[0]=f[s[p]],r[1]=f[s[(p+1)%3]],r.sort(a);var m=r.toString();void 0===o[m]?(o[m]={vert1:r[0],vert2:r[1],face1:h,face2:void 0},c++):o[m].face2=h}for(m in r=new Float32Array(6*c),a=0,o)(void 0===(s=o[m]).face2||i[s.face1].normal.dot(i[s.face2].normal)<=n)&&(c=u[s.vert1],r[a++]=c.x,r[a++]=c.y,r[a++]=c.z,c=u[s.vert2],r[a++]=c.x,r[a++]=c.y,r[a++]=c.z);l.addAttribute("position",new THREE.BufferAttribute(r,3)),THREE.Line.call(this,l,new THREE.LineBasicMaterial({color:t}),THREE.LinePieces),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype),THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper,THREE.FaceNormalsHelper=function(e,t,n,i){this.object=e,this.size=void 0!==t?t:1,e=void 0!==n?n:16776960,i=void 0!==i?i:1,t=new THREE.Geometry,n=0;for(var r=this.object.geometry.faces.length;r>n;n++)t.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,t,new THREE.LineBasicMaterial({color:e,linewidth:i}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper,THREE.FaceNormalsHelper.prototype.update=function(){var e=this.geometry.vertices,t=this.object,n=t.geometry.vertices,i=t.geometry.faces,r=t.matrixWorld;t.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(r);for(var o=t=0,a=i.length;a>t;t++,o+=2){var s=i[t];e[o].copy(n[s.a]).add(n[s.b]).add(n[s.c]).divideScalar(3).applyMatrix4(r),e[o+1].copy(s.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(e[o])}return this.geometry.verticesNeedUpdate=!0,this},THREE.GridHelper=function(e,t){var n=new THREE.Geometry,i=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var r=-e;e>=r;r+=t){n.vertices.push(new THREE.Vector3(-e,0,r),new THREE.Vector3(e,0,r),new THREE.Vector3(r,0,-e),new THREE.Vector3(r,0,e));var o=0===r?this.color1:this.color2;n.colors.push(o,o,o,o)}THREE.Line.call(this,n,i,THREE.LinePieces)},THREE.GridHelper.prototype=Object.create(THREE.Line.prototype),THREE.GridHelper.prototype.constructor=THREE.GridHelper,THREE.GridHelper.prototype.setColors=function(e,t){this.color1.set(e),this.color2.set(t),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(e,t){THREE.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var n=new THREE.SphereGeometry(t,4,2);n.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var i=0;8>i;i++)n.faces[i].color=this.colors[4>i?0:1];i=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0}),this.lightSphere=new THREE.Mesh(n,i),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper,THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var e=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(e,t){this.light=e,this.light.updateMatrixWorld();var n=new THREE.SphereGeometry(t,4,2),i=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,n,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper,THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SkeletonHelper=function(e){this.bones=this.getBoneList(e);for(var t=new THREE.Geometry,n=0;n<this.bones.length;n++)this.bones[n].parent instanceof THREE.Bone&&(t.vertices.push(new THREE.Vector3),t.vertices.push(new THREE.Vector3),t.colors.push(new THREE.Color(0,0,1)),t.colors.push(new THREE.Color(0,1,0)));n=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0}),THREE.Line.call(this,t,n,THREE.LinePieces),this.root=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.update()},THREE.SkeletonHelper.prototype=Object.create(THREE.Line.prototype),THREE.SkeletonHelper.prototype.constructor=THREE.SkeletonHelper,THREE.SkeletonHelper.prototype.getBoneList=function(e){var t=[];e instanceof THREE.Bone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,this.getBoneList(e.children[n]));return t},THREE.SkeletonHelper.prototype.update=function(){for(var e=this.geometry,t=(new THREE.Matrix4).getInverse(this.root.matrixWorld),n=new THREE.Matrix4,i=0,r=0;r<this.bones.length;r++){var o=this.bones[r];o.parent instanceof THREE.Bone&&(n.multiplyMatrices(t,o.matrixWorld),e.vertices[i].setFromMatrixPosition(n),n.multiplyMatrices(t,o.parent.matrixWorld),e.vertices[i+1].setFromMatrixPosition(n),i+=2)}e.verticesNeedUpdate=!0,e.computeBoundingSphere()},THREE.SpotLightHelper=function(e){THREE.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,(e=new THREE.CylinderGeometry(0,1,1,8,1,!0)).applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),e.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var t=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(e,t),this.add(this.cone),this.update()},THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper,THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},THREE.SpotLightHelper.prototype.update=function(){var e=new THREE.Vector3,t=new THREE.Vector3;return function(){var n=this.light.distance?this.light.distance:1e4,i=n*Math.tan(this.light.angle);this.cone.scale.set(i,i,n),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),THREE.VertexNormalsHelper=function(e,t,n,i){this.object=e,this.size=void 0!==t?t:1,t=void 0!==n?n:16711680,i=void 0!==i?i:1,n=new THREE.Geometry;for(var r=0,o=(e=e.geometry.faces).length;o>r;r++)for(var a=0,s=e[r].vertexNormals.length;s>a;a++)n.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,n,new THREE.LineBasicMaterial({color:t,linewidth:i}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(e){var t=new THREE.Vector3;return function(e){e=["a","b","c","d"],this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var n=this.geometry.vertices,i=this.object.geometry.vertices,r=this.object.geometry.faces,o=this.object.matrixWorld,a=0,s=0,l=r.length;l>s;s++)for(var u=r[s],c=0,h=u.vertexNormals.length;h>c;c++){var d=u.vertexNormals[c];n[a].copy(i[u[e[c]]]).applyMatrix4(o),t.copy(d).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),t.add(n[a]),n[a+=1].copy(t),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.VertexTangentsHelper=function(e,t,n,i){this.object=e,this.size=void 0!==t?t:1,t=void 0!==n?n:255,i=void 0!==i?i:1,n=new THREE.Geometry;for(var r=0,o=(e=e.geometry.faces).length;o>r;r++)for(var a=0,s=e[r].vertexTangents.length;s>a;a++)n.vertices.push(new THREE.Vector3),n.vertices.push(new THREE.Vector3);THREE.Line.call(this,n,new THREE.LineBasicMaterial({color:t,linewidth:i}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.update()},THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper,THREE.VertexTangentsHelper.prototype.update=function(e){var t=new THREE.Vector3;return function(e){e=["a","b","c","d"],this.object.updateMatrixWorld(!0);for(var n=this.geometry.vertices,i=this.object.geometry.vertices,r=this.object.geometry.faces,o=this.object.matrixWorld,a=0,s=0,l=r.length;l>s;s++)for(var u=r[s],c=0,h=u.vertexTangents.length;h>c;c++){var d=u.vertexTangents[c];n[a].copy(i[u[e[c]]]).applyMatrix4(o),t.copy(d).transformDirection(o).multiplyScalar(this.size),t.add(n[a]),n[a+=1].copy(t),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.WireframeHelper=function(e,t){var n=void 0!==t?t:16777215,i=[0,0],r={},o=function(e,t){return e-t},a=["a","b","c"],s=new THREE.BufferGeometry;if(e.geometry instanceof THREE.Geometry){for(var l=e.geometry.vertices,u=e.geometry.faces,c=0,h=new Uint32Array(6*u.length),d=0,f=u.length;f>d;d++)for(var p=u[d],m=0;3>m;m++){i[0]=p[a[m]],i[1]=p[a[(m+1)%3]],i.sort(o),void 0===r[v=i.toString()]&&(h[2*c]=i[0],h[2*c+1]=i[1],r[v]=!0,c++)}for(i=new Float32Array(6*c),d=0,f=c;f>d;d++)for(m=0;2>m;m++)c=l[h[2*d+m]],i[(a=6*d+3*m)+0]=c.x,i[a+1]=c.y,i[a+2]=c.z;s.addAttribute("position",new THREE.BufferAttribute(i,3))}else if(e.geometry instanceof THREE.BufferGeometry){if(void 0!==e.geometry.attributes.index){l=e.geometry.attributes.position.array,f=e.geometry.attributes.index.array,c=0,0===(u=e.geometry.drawcalls).length&&(u=[{count:f.length,index:0,start:0}]);h=new Uint32Array(2*f.length),p=0;for(var g=u.length;g>p;++p){m=u[p].start;for(var v=u[p].count,E=(a=u[p].index,d=m,m+v);E>d;d+=3)for(m=0;3>m;m++)i[0]=a+f[d+m],i[1]=a+f[d+(m+1)%3],i.sort(o),void 0===r[v=i.toString()]&&(h[2*c]=i[0],h[2*c+1]=i[1],r[v]=!0,c++)}for(i=new Float32Array(6*c),d=0,f=c;f>d;d++)for(m=0;2>m;m++)a=6*d+3*m,c=3*h[2*d+m],i[a+0]=l[c],i[a+1]=l[c+1],i[a+2]=l[c+2]}else for(h=(c=(l=e.geometry.attributes.position.array).length/3)/3,i=new Float32Array(6*c),d=0,f=h;f>d;d++)for(m=0;3>m;m++)h=9*d+3*m,i[(a=18*d+6*m)+0]=l[h],i[a+1]=l[h+1],i[a+2]=l[h+2],c=9*d+(m+1)%3*3,i[a+3]=l[c],i[a+4]=l[c+1],i[a+5]=l[c+2];s.addAttribute("position",new THREE.BufferAttribute(i,3))}THREE.Line.call(this,s,new THREE.LineBasicMaterial({color:n}),THREE.LinePieces),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(e){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(e,t){THREE.Mesh.call(this,e,t),this.animationsMap={},this.animationsList=[];var n=this.geometry.morphTargets.length;this.createAnimation("__default",0,n-1,n/1),this.setAnimationWeight("__default",1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(e,t,n,i){t={startFrame:t,endFrame:n,length:n-t+1,fps:i,duration:(n-t)/i,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[e]=t,this.animationsList.push(t)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(e){for(var t,n=/([a-z]+)_?(\d+)/,i={},r=this.geometry,o=0,a=r.morphTargets.length;a>o;o++){var s=r.morphTargets[o].name.match(n);if(s&&1<s.length){var l=s[1];i[l]||(i[l]={start:1/0,end:-1/0}),o<(s=i[l]).start&&(s.start=o),o>s.end&&(s.end=o),t||(t=l)}}for(l in i)s=i[l],this.createAnimation(l,s.start,s.end,e);this.firstAnimation=t},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){(e=this.animationsMap[e])&&(e.direction=1,e.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){(e=this.animationsMap[e])&&(e.direction=-1,e.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var n=this.animationsMap[e];n&&(n.fps=t,n.duration=(n.end-n.start)/n.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var n=this.animationsMap[e];n&&(n.duration=t,n.fps=(n.end-n.start)/n.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var n=this.animationsMap[e];n&&(n.weight=t)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var n=this.animationsMap[e];n&&(n.time=t)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0;return(e=this.animationsMap[e])&&(t=e.time),t},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1;return(e=this.animationsMap[e])&&(t=e.duration),t},THREE.MorphBlendMesh.prototype.playAnimation=function(e){var t=this.animationsMap[e];t?(t.time=0,t.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+e+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(e){(e=this.animationsMap[e])&&(e.active=!1)},THREE.MorphBlendMesh.prototype.update=function(e){for(var t=0,n=this.animationsList.length;n>t;t++){var i=this.animationsList[t];if(i.active){var r=i.duration/i.length;i.time+=i.direction*e,i.mirroredLoop?(i.time>i.duration||0>i.time)&&(i.direction*=-1,i.time>i.duration&&(i.time=i.duration,i.directionBackwards=!0),0>i.time&&(i.time=0,i.directionBackwards=!1)):(i.time%=i.duration,0>i.time&&(i.time+=i.duration));var o=i.startFrame+THREE.Math.clamp(Math.floor(i.time/r),0,i.length-1),a=i.weight;o!==i.currentFrame&&(this.morphTargetInfluences[i.lastFrame]=0,this.morphTargetInfluences[i.currentFrame]=1*a,this.morphTargetInfluences[o]=0,i.lastFrame=i.currentFrame,i.currentFrame=o),r=i.time%r/r,i.directionBackwards&&(r=1-r),this.morphTargetInfluences[i.currentFrame]=r*a,this.morphTargetInfluences[i.lastFrame]=(1-r)*a}}},THREE.SpriteCanvasMaterial=function(e){THREE.Material.call(this),this.type="SpriteCanvasMaterial",this.color=new THREE.Color(16777215),this.program=function(e,t){},this.setValues(e)},THREE.SpriteCanvasMaterial.prototype=Object.create(THREE.Material.prototype),THREE.SpriteCanvasMaterial.prototype.constructor=THREE.SpriteCanvasMaterial,THREE.SpriteCanvasMaterial.prototype.clone=function(){var e=new THREE.SpriteCanvasMaterial;return THREE.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.program=this.program,e},THREE.CanvasRenderer=function(e){function t(e,t,n){c(n.opacity),h(n.blending);var i=t.scale.x*W,r=t.scale.y*G,o=.5*Math.sqrt(i*i+r*r);if(me.min.set(e.x-o,e.y-o),me.max.set(e.x+o,e.y+o),n instanceof THREE.SpriteMaterial){var l=n.map;if(null!==l&&void 0!==l.image){!1===l.hasEventListener("update",a)&&(l.image.width>0&&s(l),l.addEventListener("update",a));var u=de[l.id];g(void 0!==u?u:"rgba( 0, 0, 0, 1 )");var d=l.image,f=d.width*l.offset.x,p=d.height*l.offset.y,v=d.width*l.repeat.x,E=d.height*l.repeat.y,y=i/v,_=r/E;K.save(),K.translate(e.x,e.y),0!==n.rotation&&K.rotate(n.rotation),K.translate(-i/2,-r/2),K.scale(y,_),K.translate(-f,-p),K.fillRect(f,p,v,E),K.restore()}else g(n.color.getStyle()),K.save(),K.translate(e.x,e.y),0!==n.rotation&&K.rotate(n.rotation),K.scale(i,-r),K.fillRect(-.5,-.5,1,1),K.restore()}else n instanceof THREE.SpriteCanvasMaterial&&(m(n.color.getStyle()),g(n.color.getStyle()),K.save(),K.translate(e.x,e.y),0!==n.rotation&&K.rotate(n.rotation),K.scale(i,r),n.program(K),K.restore())}function n(e,t,n,i){if(c(i.opacity),h(i.blending),K.beginPath(),K.moveTo(e.positionScreen.x,e.positionScreen.y),K.lineTo(t.positionScreen.x,t.positionScreen.y),i instanceof THREE.LineBasicMaterial){if(d(i.linewidth),f(i.linecap),p(i.linejoin),i.vertexColors!==THREE.VertexColors)m(i.color.getStyle());else{var r=n.vertexColors[0].getStyle(),o=n.vertexColors[1].getStyle();if(r===o)m(r);else{try{var a=K.createLinearGradient(e.positionScreen.x,e.positionScreen.y,t.positionScreen.x,t.positionScreen.y);a.addColorStop(0,r),a.addColorStop(1,o)}catch(e){a=r}m(a)}}K.stroke(),me.expandByScalar(2*i.linewidth)}else i instanceof THREE.LineDashedMaterial&&(d(i.linewidth),f(i.linecap),p(i.linejoin),m(i.color.getStyle()),v([i.dashSize,i.gapSize]),K.stroke(),me.expandByScalar(2*i.linewidth),v([]))}function i(e,t,n,i,a,s,u,d){if(B.info.render.vertices+=3,B.info.render.faces++,c(d.opacity),h(d.blending),H=e.positionScreen.x,S=e.positionScreen.y,M=t.positionScreen.x,C=t.positionScreen.y,A=n.positionScreen.x,k=n.positionScreen.y,function(e,t,n,i,r,o){K.beginPath(),K.moveTo(e,t),K.lineTo(n,i),K.lineTo(r,o),K.closePath()}(H,S,M,C,A,k),(d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial)&&null===d.map)ue.copy(d.color),ce.copy(d.emissive),d.vertexColors===THREE.FaceColors&&ue.multiply(u.color),le.copy(ge),_e.copy(e.positionWorld).add(t.positionWorld).add(n.positionWorld).divideScalar(3),function(e,t,n){for(var i=0,r=T.length;r>i;i++){var o=T[i];if(he.copy(o.color),o instanceof THREE.DirectionalLight){var a=ye.setFromMatrixPosition(o.matrixWorld).normalize();if(0>=(s=t.dot(a)))continue;s*=o.intensity,n.add(he.multiplyScalar(s))}else if(o instanceof THREE.PointLight){var s;if(a=ye.setFromMatrixPosition(o.matrixWorld),0>=(s=t.dot(ye.subVectors(a,e).normalize())))continue;if(0==(s*=0==o.distance?1:1-Math.min(e.distanceTo(a)/o.distance,1)))continue;s*=o.intensity,n.add(he.multiplyScalar(s))}}}(_e,u.normalModel,le),le.multiply(ue).add(ce),!0===d.wireframe?r(le,d.wireframeLinewidth,d.wireframeLinecap,d.wireframeLinejoin):o(le);else if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial)if(null!==d.map){d.map.mapping===THREE.UVMapping&&(P=u.uvs,l(H,S,M,C,A,k,P[i].x,P[i].y,P[a].x,P[a].y,P[s].x,P[s].y,d.map))}else null!==d.envMap?d.envMap.mapping===THREE.SphericalReflectionMapping&&(Te.copy(u.vertexNormalsModel[i]).applyMatrix3(be),D=.5*Te.x+.5,L=.5*Te.y+.5,Te.copy(u.vertexNormalsModel[a]).applyMatrix3(be),O=.5*Te.x+.5,F=.5*Te.y+.5,Te.copy(u.vertexNormalsModel[s]).applyMatrix3(be),N=.5*Te.x+.5,I=.5*Te.y+.5,l(H,S,M,C,A,k,D,L,O,F,N,I,d.envMap)):(le.copy(d.color),d.vertexColors===THREE.FaceColors&&le.multiply(u.color),!0===d.wireframe?r(le,d.wireframeLinewidth,d.wireframeLinecap,d.wireframeLinejoin):o(le));else d instanceof THREE.MeshDepthMaterial?(le.r=le.g=le.b=1-E(e.positionScreen.z*e.positionScreen.w,b.near,b.far),!0===d.wireframe?r(le,d.wireframeLinewidth,d.wireframeLinecap,d.wireframeLinejoin):o(le)):d instanceof THREE.MeshNormalMaterial?(Te.copy(u.normalModel).applyMatrix3(be),le.setRGB(Te.x,Te.y,Te.z).multiplyScalar(.5).addScalar(.5),!0===d.wireframe?r(le,d.wireframeLinewidth,d.wireframeLinecap,d.wireframeLinejoin):o(le)):(le.setRGB(1,1,1),!0===d.wireframe?r(le,d.wireframeLinewidth,d.wireframeLinecap,d.wireframeLinejoin):o(le))}function r(e,t,n,i){d(t),f(n),p(i),m(e.getStyle()),K.stroke(),me.expandByScalar(2*t)}function o(e){g(e.getStyle()),K.fill()}function a(e){s(e.target)}function s(e){if(!(e instanceof THREE.CompressedTexture)){var t=e.wrapS===THREE.RepeatWrapping,n=e.wrapT===THREE.RepeatWrapping,i=e.image,r=document.createElement("canvas");r.width=i.width,r.height=i.height;var o=r.getContext("2d");o.setTransform(1,0,0,-1,0,i.height),o.drawImage(i,0,0),de[e.id]=K.createPattern(r,!0===t&&!0===n?"repeat":!0===t&&!1===n?"repeat-x":!1===t&&!0===n?"repeat-y":"no-repeat")}}function l(e,t,n,i,r,o,l,u,c,h,d,f,p){if(!(p instanceof THREE.DataTexture)){!1===p.hasEventListener("update",a)&&(void 0!==p.image&&p.image.width>0&&s(p),p.addEventListener("update",a));var m=de[p.id];if(void 0===m)return g("rgba(0,0,0,1)"),void K.fill();g(m);var v,E,y,_,T,b,w,x,R=p.offset.x/p.repeat.x,H=p.offset.y/p.repeat.y,S=p.image.width*p.repeat.x,M=p.image.height*p.repeat.y;c=(c+R)*S,h=(h+H)*M,d=(d+R)*S,f=(f+H)*M,n-=e,i-=t,r-=e,o-=t,0!==(w=(c-=l=(l+R)*S)*(f-=u=(u+H)*M)-(d-=l)*(h-=u))&&(T=e-(v=(f*n-h*r)*(x=1/w))*l-(y=(c*r-d*n)*x)*u,b=t-(E=(f*i-h*o)*x)*l-(_=(c*o-d*i)*x)*u,K.save(),K.transform(v,E,y,_,T,b),K.fill(),K.restore())}}function u(e,t,n){var i,r=t.x-e.x,o=t.y-e.y,a=r*r+o*o;0!==a&&(r*=i=n/Math.sqrt(a),o*=i,t.x+=r,t.y+=o,e.x-=r,e.y-=o)}function c(e){ee!==e&&(K.globalAlpha=e,ee=e)}function h(e){te!==e&&(e===THREE.NormalBlending?K.globalCompositeOperation="source-over":e===THREE.AdditiveBlending?K.globalCompositeOperation="lighter":e===THREE.SubtractiveBlending&&(K.globalCompositeOperation="darker"),te=e)}function d(e){re!==e&&(K.lineWidth=e,re=e)}function f(e){oe!==e&&(K.lineCap=e,oe=e)}function p(e){ae!==e&&(K.lineJoin=e,ae=e)}function m(e){ne!==e&&(K.strokeStyle=e,ne=e)}function g(e){ie!==e&&(K.fillStyle=e,ie=e)}function v(e){se.length!==e.length&&(K.setLineDash(e),se=e)}console.log("THREE.CanvasRenderer",THREE.REVISION);var E=THREE.Math.smoothstep;e=e||{};var y,_,T,b,w,x,R,H,S,M,C,A,k,P,D,L,O,F,N,I,B=this,z=new THREE.Projector,V=void 0!==e.canvas?e.canvas:document.createElement("canvas"),U=V.width,j=V.height,W=Math.floor(U/2),G=Math.floor(j/2),Y=0,q=0,X=U,$=j,Z=1,K=V.getContext("2d",{alpha:!0===e.alpha}),Q=new THREE.Color(0),J=!0===e.alpha?0:1,ee=1,te=0,ne=null,ie=null,re=null,oe=null,ae=null,se=[],le=(new THREE.RenderableVertex,new THREE.RenderableVertex,new THREE.Color),ue=(new THREE.Color,new THREE.Color,new THREE.Color,new THREE.Color,new THREE.Color),ce=new THREE.Color,he=new THREE.Color,de={},fe=new THREE.Box2,pe=new THREE.Box2,me=new THREE.Box2,ge=new THREE.Color,ve=new THREE.Color,Ee=new THREE.Color,ye=new THREE.Vector3,_e=new THREE.Vector3,Te=new THREE.Vector3,be=new THREE.Matrix3;void 0===K.setLineDash&&(K.setLineDash=function(){}),this.domElement=V,this.autoClear=!0,this.sortObjects=!0,this.sortElements=!0,this.info={render:{vertices:0,faces:0}},this.supportsVertexTextures=function(){},this.setFaceCulling=function(){},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(e){Z=e},this.setSize=function(e,t,n){U=e*Z,j=t*Z,V.width=U,V.height=j,W=Math.floor(U/2),G=Math.floor(j/2),!1!==n&&(V.style.width=e+"px",V.style.height=t+"px"),fe.min.set(-W,-G),fe.max.set(W,G),pe.min.set(-W,-G),pe.max.set(W,G),ee=1,te=0,ne=null,ie=null,re=null,oe=null,ae=null,this.setViewport(0,0,e,t)},this.setViewport=function(e,t,n,i){Y=e*Z,q=t*Z,X=n*Z,$=i*Z},this.setScissor=function(){},this.enableScissorTest=function(){},this.setClearColor=function(e,t){Q.set(e),J=void 0!==t?t:1,pe.min.set(-W,-G),pe.max.set(W,G)},this.setClearColorHex=function(e,t){console.warn("THREE.CanvasRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead."),this.setClearColor(e,t)},this.getClearColor=function(){return Q},this.getClearAlpha=function(){return J},this.getMaxAnisotropy=function(){return 0},this.clear=function(){!1===pe.empty()&&(pe.intersect(fe),pe.expandByScalar(2),pe.min.x=pe.min.x+W,pe.min.y=-pe.min.y+G,pe.max.x=pe.max.x+W,pe.max.y=-pe.max.y+G,1>J&&K.clearRect(0|pe.min.x,0|pe.max.y,pe.max.x-pe.min.x|0,pe.min.y-pe.max.y|0),J>0&&(h(THREE.NormalBlending),c(1),g("rgba("+Math.floor(255*Q.r)+","+Math.floor(255*Q.g)+","+Math.floor(255*Q.b)+","+J+")"),K.fillRect(0|pe.min.x,0|pe.max.y,pe.max.x-pe.min.x|0,pe.min.y-pe.max.y|0)),pe.makeEmpty())},this.clearColor=function(){},this.clearDepth=function(){},this.clearStencil=function(){},this.render=function(e,r){if(r instanceof THREE.Camera!=0){!0===this.autoClear&&this.clear(),B.info.render.vertices=0,B.info.render.faces=0,K.setTransform(X/U,0,0,-$/j,Y,j-q),K.translate(W,G),y=z.projectScene(e,r,this.sortObjects,this.sortElements),_=y.elements,T=y.lights,b=r,be.getNormalMatrix(r.matrixWorldInverse),function(){ge.setRGB(0,0,0),ve.setRGB(0,0,0),Ee.setRGB(0,0,0);for(var e=0,t=T.length;t>e;e++){var n=T[e],i=n.color;n instanceof THREE.AmbientLight?ge.add(i):n instanceof THREE.DirectionalLight?ve.add(i):n instanceof THREE.PointLight&&Ee.add(i)}}();for(var o=0,a=_.length;a>o;o++){var s=_[o],l=s.material;if(void 0!==l&&0!==l.opacity){if(me.makeEmpty(),s instanceof THREE.RenderableSprite)(w=s).x*=W,w.y*=G,t(w,s,l);else if(s instanceof THREE.RenderableLine)w=s.v1,x=s.v2,w.positionScreen.x*=W,w.positionScreen.y*=G,x.positionScreen.x*=W,x.positionScreen.y*=G,me.setFromPoints([w.positionScreen,x.positionScreen]),!0===fe.isIntersectionBox(me)&&n(w,x,s,l);else if(s instanceof THREE.RenderableFace){if(w=s.v1,x=s.v2,R=s.v3,w.positionScreen.z<-1||w.positionScreen.z>1)continue;if(x.positionScreen.z<-1||x.positionScreen.z>1)continue;if(R.positionScreen.z<-1||R.positionScreen.z>1)continue;w.positionScreen.x*=W,w.positionScreen.y*=G,x.positionScreen.x*=W,x.positionScreen.y*=G,R.positionScreen.x*=W,R.positionScreen.y*=G,l.overdraw>0&&(u(w.positionScreen,x.positionScreen,l.overdraw),u(x.positionScreen,R.positionScreen,l.overdraw),u(R.positionScreen,w.positionScreen,l.overdraw)),me.setFromPoints([w.positionScreen,x.positionScreen,R.positionScreen]),!0===fe.isIntersectionBox(me)&&i(w,x,R,0,1,2,s,l)}pe.union(me)}}K.setTransform(1,0,0,1,0,0)}else console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.")}},THREE.RenderableObject=function(){this.id=0,this.object=null,this.z=0},THREE.RenderableFace=function(){this.id=0,this.v1=new THREE.RenderableVertex,this.v2=new THREE.RenderableVertex,this.v3=new THREE.RenderableVertex,this.normalModel=new THREE.Vector3,this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3],this.vertexNormalsLength=0,this.color=new THREE.Color,this.material=null,this.uvs=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2],this.z=0},THREE.RenderableVertex=function(){this.position=new THREE.Vector3,this.positionWorld=new THREE.Vector3,this.positionScreen=new THREE.Vector4,this.visible=!0},THREE.RenderableVertex.prototype.copy=function(e){this.positionWorld.copy(e.positionWorld),this.positionScreen.copy(e.positionScreen)},THREE.RenderableLine=function(){this.id=0,this.v1=new THREE.RenderableVertex,this.v2=new THREE.RenderableVertex,this.vertexColors=[new THREE.Color,new THREE.Color],this.material=null,this.z=0},THREE.RenderableSprite=function(){this.id=0,this.object=null,this.x=0,this.y=0,this.z=0,this.rotation=0,this.scale=new THREE.Vector2,this.material=null},THREE.Projector=function(){function e(){if(l===y){var e=new THREE.RenderableObject;return E.push(e),y++,l++,e}return E[l++]}function t(){if(c===T){var e=new THREE.RenderableVertex;return _.push(e),T++,c++,e}return _[c++]}function n(){if(d===w){var e=new THREE.RenderableFace;return b.push(e),w++,d++,e}return b[d++]}function i(){if(p===R){var e=new THREE.RenderableLine;return x.push(e),R++,p++,e}return x[p++]}function r(){if(g===S){var e=new THREE.RenderableSprite;return H.push(e),S++,g++,e}return H[g++]}function o(e,t){return e.z!==t.z?t.z-e.z:e.id!==t.id?e.id-t.id:0}function a(e,t){var n=0,i=1,r=e.z+e.w,o=t.z+t.w,a=-e.z+e.w,s=-t.z+t.w;return r>=0&&o>=0&&a>=0&&s>=0||!(0>r&&0>o||0>a&&0>s)&&(0>r?n=Math.max(n,r/(r-o)):0>o&&(i=Math.min(i,r/(r-o))),0>a?n=Math.max(n,a/(a-s)):0>s&&(i=Math.min(i,a/(a-s))),!(n>i)&&(e.lerp(t,n),t.lerp(e,1-i),!0))}var s,l,u,c,h,d,f,p,m,g,v,E=[],y=0,_=[],T=0,b=[],w=0,x=[],R=0,H=[],S=0,M={objects:[],lights:[],elements:[]},C=new THREE.Vector3,A=new THREE.Vector4,k=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),P=new THREE.Box3,D=new Array(3),L=(new Array(4),new THREE.Matrix4),O=new THREE.Matrix4,F=new THREE.Matrix4,N=new THREE.Matrix3,I=new THREE.Frustum,B=new THREE.Vector4,z=new THREE.Vector4;this.projectVector=function(e,t){console.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(e,t){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")};var V=new function(){var e=[],r=[],o=null,a=null,s=new THREE.Matrix3,l=function(e){var t=e.position,n=e.positionWorld,i=e.positionScreen;n.copy(t).applyMatrix4(v),i.copy(n).applyMatrix4(O);var r=1/i.w;i.x*=r,i.y*=r,i.z*=r,e.visible=i.x>=-1&&i.x<=1&&i.y>=-1&&i.y<=1&&i.z>=-1&&i.z<=1},c=function(e,t,n){return!0===e.visible||!0===t.visible||!0===n.visible||(D[0]=e.positionScreen,D[1]=t.positionScreen,D[2]=n.positionScreen,k.isIntersectionBox(P.setFromPoints(D)))},d=function(e,t,n){return(n.positionScreen.x-e.positionScreen.x)*(t.positionScreen.y-e.positionScreen.y)-(n.positionScreen.y-e.positionScreen.y)*(t.positionScreen.x-e.positionScreen.x)<0};return{setObject:function(t){a=(o=t).material,s.getNormalMatrix(o.matrixWorld),e.length=0,r.length=0},projectVertex:l,checkTriangleVisibility:c,checkBackfaceCulling:d,pushVertex:function(e,n,i){(u=t()).position.set(e,n,i),l(u)},pushNormal:function(t,n,i){e.push(t,n,i)},pushUv:function(e,t){r.push(e,t)},pushLine:function(e,t){var n=_[e],r=_[t];(f=i()).id=o.id,f.v1.copy(n),f.v2.copy(r),f.z=(n.positionScreen.z+r.positionScreen.z)/2,f.material=o.material,M.elements.push(f)},pushTriangle:function(t,i,l){var u=_[t],f=_[i],p=_[l];if(!1!==c(u,f,p)&&(a.side===THREE.DoubleSide||!0===d(u,f,p))){(h=n()).id=o.id,h.v1.copy(u),h.v2.copy(f),h.v3.copy(p),h.z=(u.positionScreen.z+f.positionScreen.z+p.positionScreen.z)/3;for(var m=0;3>m;m++){var g=3*arguments[m],v=h.vertexNormalsModel[m];v.set(e[g],e[g+1],e[g+2]),v.applyMatrix3(s).normalize();var E=2*arguments[m];h.uvs[m].set(r[E],r[E+1])}h.vertexNormalsLength=3,h.material=o.material,M.elements.push(h)}}}};this.projectScene=function(u,E,y,T){d=0,p=0,g=0,M.elements.length=0,!0===u.autoUpdate&&u.updateMatrixWorld(),void 0===E.parent&&E.updateMatrixWorld(),L.copy(E.matrixWorldInverse.getInverse(E.matrixWorld)),O.multiplyMatrices(E.projectionMatrix,L),I.setFromMatrix(O),l=0,M.objects.length=0,M.lights.length=0,u.traverseVisible(function(t){if(t instanceof THREE.Light)M.lights.push(t);else if(t instanceof THREE.Mesh||t instanceof THREE.Line||t instanceof THREE.Sprite){if(!1===t.material.visible)return;(!1===t.frustumCulled||!0===I.intersectsObject(t))&&((s=e()).id=t.id,s.object=t,C.setFromMatrixPosition(t.matrixWorld),C.applyProjection(O),s.z=C.z,M.objects.push(s))}}),!0===y&&M.objects.sort(o);for(var b=0,w=M.objects.length;w>b;b++){var x=M.objects[b].object,R=x.geometry;if(V.setObject(x),v=x.matrixWorld,c=0,x instanceof THREE.Mesh){if(R instanceof THREE.BufferGeometry){var H=R.attributes,S=R.offsets;if(void 0===H.position)continue;for(var k=0,P=(Te=H.position.array).length;P>k;k+=3)V.pushVertex(Te[k],Te[k+1],Te[k+2]);if(void 0!==H.normal){var D=H.normal.array;for(k=0,P=D.length;P>k;k+=3)V.pushNormal(D[k],D[k+1],D[k+2])}if(void 0!==H.uv){var U=H.uv.array;for(k=0,P=U.length;P>k;k+=2)V.pushUv(U[k],U[k+1])}if(void 0!==H.index){var j=H.index.array;if(S.length>0)for(b=0;b<S.length;b++){var W=S[b],G=W.index;for(k=W.start,P=W.start+W.count;P>k;k+=3)V.pushTriangle(j[k]+G,j[k+1]+G,j[k+2]+G)}else for(k=0,P=j.length;P>k;k+=3)V.pushTriangle(j[k],j[k+1],j[k+2])}else for(k=0,P=Te.length/3;P>k;k+=3)V.pushTriangle(k,k+1,k+2)}else if(R instanceof THREE.Geometry){var Y=R.vertices,q=R.faces,X=R.faceVertexUvs[0];N.getNormalMatrix(v);for(var $=(le=x.material)instanceof THREE.MeshFaceMaterial,Z=!0===$?x.material:null,K=0,Q=Y.length;Q>K;K++){var J=Y[K];if(C.copy(J),!0===le.morphTargets)for(var ee=R.morphTargets,te=x.morphTargetInfluences,ne=0,ie=ee.length;ie>ne;ne++){var re=te[ne];if(0!==re){var oe=ee[ne].vertices[K];C.x+=(oe.x-J.x)*re,C.y+=(oe.y-J.y)*re,C.z+=(oe.z-J.z)*re}}V.pushVertex(C.x,C.y,C.z)}for(var ae=0,se=q.length;se>ae;ae++){var le,ue=q[ae];if(void 0!==(le=!0===$?Z.materials[ue.materialIndex]:x.material)){var ce=le.side,he=_[ue.a],de=_[ue.b],fe=_[ue.c];if(!1!==V.checkTriangleVisibility(he,de,fe)){var pe=V.checkBackfaceCulling(he,de,fe);if(ce!==THREE.DoubleSide){if(ce===THREE.FrontSide&&!1===pe)continue;if(ce===THREE.BackSide&&!0===pe)continue}(h=n()).id=x.id,h.v1.copy(he),h.v2.copy(de),h.v3.copy(fe),h.normalModel.copy(ue.normal),!1!==pe||ce!==THREE.BackSide&&ce!==THREE.DoubleSide||h.normalModel.negate(),h.normalModel.applyMatrix3(N).normalize();for(var me=ue.vertexNormals,ge=0,ve=Math.min(me.length,3);ve>ge;ge++){var Ee=h.vertexNormalsModel[ge];Ee.copy(me[ge]),!1!==pe||ce!==THREE.BackSide&&ce!==THREE.DoubleSide||Ee.negate(),Ee.applyMatrix3(N).normalize()}h.vertexNormalsLength=me.length;var ye=X[ae];if(void 0!==ye)for(var _e=0;3>_e;_e++)h.uvs[_e].copy(ye[_e]);h.color=ue.color,h.material=le,h.z=(he.positionScreen.z+de.positionScreen.z+fe.positionScreen.z)/3,M.elements.push(h)}}}}}else if(x instanceof THREE.Line){if(R instanceof THREE.BufferGeometry){if(void 0!==(H=R.attributes).position){var Te;for(k=0,P=(Te=H.position.array).length;P>k;k+=3)V.pushVertex(Te[k],Te[k+1],Te[k+2]);if(void 0!==H.index)for(k=0,P=(j=H.index.array).length;P>k;k+=2)V.pushLine(j[k],j[k+1]);else{var be=x.mode===THREE.LinePieces?2:1;for(k=0,P=Te.length/3-1;P>k;k+=be)V.pushLine(k,k+1)}}}else if(R instanceof THREE.Geometry){if(F.multiplyMatrices(O,v),0===(Y=x.geometry.vertices).length)continue;(he=t()).positionScreen.copy(Y[0]).applyMatrix4(F);for(be=x.mode===THREE.LinePieces?2:1,K=1,Q=Y.length;Q>K;K++)(he=t()).positionScreen.copy(Y[K]).applyMatrix4(F),(K+1)%be>0||(de=_[c-2],B.copy(he.positionScreen),z.copy(de.positionScreen),!0===a(B,z)&&(B.multiplyScalar(1/B.w),z.multiplyScalar(1/z.w),(f=i()).id=x.id,f.v1.positionScreen.copy(B),f.v2.positionScreen.copy(z),f.z=Math.max(B.z,z.z),f.material=x.material,x.material.vertexColors===THREE.VertexColors&&(f.vertexColors[0].copy(x.geometry.colors[K]),f.vertexColors[1].copy(x.geometry.colors[K-1])),M.elements.push(f)))}}else if(x instanceof THREE.Sprite){A.set(v.elements[12],v.elements[13],v.elements[14],1),A.applyMatrix4(O);var we=1/A.w;A.z*=we,A.z>=-1&&A.z<=1&&((m=r()).id=x.id,m.x=A.x*we,m.y=A.y*we,m.z=A.z,m.object=x,m.rotation=x.rotation,m.scale.x=x.scale.x*Math.abs(m.x-(A.x+E.projectionMatrix.elements[0])/(A.w+E.projectionMatrix.elements[12])),m.scale.y=x.scale.y*Math.abs(m.y-(A.y+E.projectionMatrix.elements[5])/(A.w+E.projectionMatrix.elements[13])),m.material=x.material,M.elements.push(m))}}return!0===T&&M.elements.sort(o),M}},THREE.StereoEffect=function(e){var t=this;this.eyeSeparation=3,this.focalLength=15,Object.defineProperties(this,{separation:{get:function(){return t.eyeSeparation},set:function(e){console.warn("THREE.StereoEffect: .separation is now .eyeSeparation."),t.eyeSeparation=e}},targetDistance:{get:function(){return t.focalLength},set:function(e){console.warn("THREE.StereoEffect: .targetDistance is now .focalLength."),t.focalLength=e}}});var n,i,r,o,a,s,l,u,c,h,d,f=new THREE.Vector3,p=new THREE.Quaternion,m=new THREE.Vector3,g=new THREE.PerspectiveCamera,v=new THREE.PerspectiveCamera;e.autoClear=!1,this.setSize=function(t,r){n=t/2,i=r,e.setSize(t,r)},this.render=function(t,E){t.updateMatrixWorld(),void 0===E.parent&&E.updateMatrixWorld(),E.matrixWorld.decompose(f,p,m),r=THREE.Math.radToDeg(2*Math.atan(Math.tan(.5*THREE.Math.degToRad(E.fov))/E.zoom)),u=E.near/this.focalLength,h=Math.tan(.5*THREE.Math.degToRad(r))*this.focalLength,c=.5*h*E.aspect,l=-(s=h*u),d=(c+this.eyeSeparation/2)/(2*c),o=2*c*u*(1-d),a=2*c*u*d,g.projectionMatrix.makeFrustum(-o,a,l,s,E.near,E.far),g.position.copy(f),g.quaternion.copy(p),g.translateX(-this.eyeSeparation/2),v.projectionMatrix.makeFrustum(-a,o,l,s,E.near,E.far),v.position.copy(f),v.quaternion.copy(p),v.translateX(this.eyeSeparation/2),e.clear(),e.enableScissorTest(!0),e.setScissor(0,0,n,i),e.setViewport(0,0,n,i),e.render(t,g),e.setScissor(n,0,n,i),e.setViewport(n,0,n,i),e.render(t,v),e.enableScissorTest(!1)}};var PhotoSphereViewer=function(e){var t=function(){var e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl"))},n=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},i=function(e,t,n){return Math.max(t,Math.min(n,e))},r=function(e,t,n,i){var r=n-e,o=i-t;return r*r+o*o},o=function(e,t){return(t=void 0!==t&&!!t)&&e==2*Math.PI?2*Math.PI:e-2*Math.floor(e/(2*Math.PI))*Math.PI};this.load=function(){if(we.innerHTML="",Ze&&1===Ze.nodeType)we.appendChild(Ze);else if(Ze&&"string"==typeof Ze)we.innerHTML=Ze;else if($e){var e=document.createElement("img");e.setAttribute("src",$e),e.setAttribute("alt",Xe),we.appendChild(e)}else we.textContent=Xe;var t;((He=document.createElement("div")).style.width="100%",He.style.height="100%",He.style.position="relative",He.style.overflow="hidden",(t=document.createElement("canvas")).getContext&&t.getContext("2d"))?void 0!==window.THREE?(ye={width:0,height:0,ratio:0},Ue&&!Me.match(/^data:image\/[a-z]+;base64/)?s():l()):console.log("PhotoSphereViewer: Three.js is not loaded."):we.textContent="Canvas is not supported, update your browser!"};var a=function(e,t){var n=e.indexOf("GPano:"+t)+t.length+8,i=e.indexOf('"',n);return-1==i&&(n=e.indexOf("GPano:"+t)+t.length+7,i=e.indexOf("<",n)),e.substring(n,i)},s=function(){var e=null;if(window.XMLHttpRequest)e=new XMLHttpRequest;else{if(!window.ActiveXObject)return void(we.textContent="XHR is not supported, update your browser!");try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){e=new ActiveXObject("Microsoft.XMLHTTP")}}e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){var t=function(e){for(var t=0,n=0,i="";-1!=(t=e.indexOf("<x:xmpmeta",n))&&-1!=(n=e.indexOf("</x:xmpmeta>",t));)if(-1!=(i=e.substring(t,n)).indexOf("GPano:"))return i;return""}(e.responseText);if(!t.length)return void l();We={full_width:parseInt(a(t,"FullPanoWidthPixels")),full_height:parseInt(a(t,"FullPanoHeightPixels")),cropped_width:parseInt(a(t,"CroppedAreaImageWidthPixels")),cropped_height:parseInt(a(t,"CroppedAreaImageHeightPixels")),cropped_x:parseInt(a(t,"CroppedAreaLeftPixels")),cropped_y:parseInt(a(t,"CroppedAreaTopPixels"))},qe=!0,l()}},e.open("GET",Me,!0),e.send(null)},l=function(){var e=new Image;e.onload=function(){var n={full_width:e.width,full_height:e.height,cropped_width:e.width,cropped_height:e.height,cropped_x:null,cropped_y:null};if(360!=Ye.horizontal_fov||180!=Ye.vertical_fov){if(We.cropped_width=n.cropped_width,We.cropped_height=n.cropped_height,We.full_width=n.full_width,We.full_height=n.full_height,360!=Ye.horizontal_fov){var i=Ye.horizontal_fov/360;We.full_width=We.cropped_width/i}if(180!=Ye.vertical_fov){var r=Ye.vertical_fov/180;We.full_height=We.cropped_height/r}}else{for(var o in We)null===We[o]&&void 0!==n[o]&&(We[o]=n[o]);if(qe){if(We.cropped_width!=n.cropped_width){var a=n.cropped_width/We.cropped_width;We.cropped_width=n.cropped_width,We.full_width*=a,We.cropped_x*=a}if(We.cropped_height!=n.cropped_height){var s=n.cropped_height/We.cropped_height;We.cropped_height=n.cropped_height,We.full_height*=s,We.cropped_y*=s}}}null===We.cropped_x&&(We.cropped_x=(We.full_width-We.cropped_width)/2),null===We.cropped_y&&(We.cropped_y=(We.full_height-We.cropped_height)/2);var l=2048;if(t()){var c=document.createElement("canvas").getContext("webgl");l=c.getParameter(c.MAX_TEXTURE_SIZE)}var h=Math.min(We.full_width,l),d=h/We.full_width;We.full_width=h,We.cropped_width*=d,We.cropped_x*=d,e.width=We.cropped_width,We.full_height*=d,We.cropped_height*=d,We.cropped_y*=d,e.height=We.cropped_height;var f=document.createElement("canvas");f.width=We.full_width,f.height=We.full_height,f.getContext("2d").drawImage(e,We.cropped_x,We.cropped_y,We.cropped_width,We.cropped_height),u(f.toDataURL("image/jpeg"))},je&&!Me.match(/^data:image\/[a-z]+;base64/)&&e.setAttribute("crossOrigin","anonymous"),e.src=Me},u=function(e){var t=new THREE.Texture;(new THREE.ImageLoader).load(e,function(e){t.needsUpdate=!0,t.image=e,c(t)})},c=function(e){void 0!==xe.width&&(we.style.width=xe.width.css),void 0!==xe.height&&(we.style.height=xe.height.css),g(),(Ce=t()?new THREE.WebGLRenderer:new THREE.CanvasRenderer).setSize(ye.width,ye.height),Ae=new THREE.Scene,(ke=new THREE.PerspectiveCamera($,ye.ratio,1,300)).position.set(0,0,0),Ae.add(ke);var i=new THREE.SphereGeometry(200,oe,re),r=new THREE.MeshBasicMaterial({map:e,overdraw:!0}),o=new THREE.Mesh(i,r);if(o.scale.x=-1,Ae.add(o),(Se=document.createElement("div")).style.position="absolute",Se.style.zIndex=0,He.appendChild(Se),ge&&(me.setStyle(ve),me.create(),He.appendChild(me.getBar())),null!==Ke){var a=document.createElement("img");a.onload=function(){a.style.display="block",a.style.position="absolute",a.style[Ke.position.x]="5px",a.style[Ke.position.y]="5px","bottom"==Ke.position.y&&ge&&(a.style.bottom=me.getBar().offsetHeight+5+"px"),void 0!==Ke.size&&(a.style.width=Ke.size.width,a.style.height=Ke.size.height),He.appendChild(a)},a.src=Ke.image}n(window,"resize",g),Ee&&(n(Se,"mousedown",b),n(document,"mousemove",S),n(Se,"mousemove",N),n(document,"mouseup",H),n(Se,"touchstart",w),n(document,"touchend",H),n(document,"touchmove",M),_e&&(n(Se,"mousewheel",P),n(Se,"DOMMouseScroll",P)),Qe.addAction("fullscreen-mode",_)),n(document,"fullscreenchange",O),n(document,"mozfullscreenchange",O),n(document,"webkitfullscreenchange",O),n(document,"MSFullscreenChange",O),ze.addListener(k),we.innerHTML="",we.appendChild(He);var s=Ce.domElement;s.style.display="block",Se.appendChild(s),h(),ae>0&&D(ae),d(),z("ready")},h=function(){var e=new THREE.Vector3;e.setX(Math.cos(te)*Math.sin(ne)),e.setY(Math.sin(te)),e.setZ(Math.cos(te)*Math.cos(ne)),ke.lookAt(e),null!==Pe?Pe.render(Ae,ke):Ce.render(Ae,ke)};this.toggleStereo=function(){null!==Pe?(Pe=null,Ce.setSize(ye.width,ye.height),me.mustBeHidden(!1),h(),z("stereo-effect",!1)):((Pe=new THREE.StereoEffect(Ce)).eyeSeparation=be,Pe.setSize(ye.width,ye.height),A(),F(),me.mustBeHidden(),h(),z("stereo-effect",!0))};var d=function(){!1!==ue&&(Be=setTimeout(p,ue))},f=function(){te-=(te-fe)*de,ne+=ce;var e=!0;ee||(ne=i(ne,V,U))!=V&&ne!=U||(he?ce*=-1:(m(),e=!1)),ne=o(ne,!0),z("position-updated",{longitude:ne,latitude:te}),h(),e&&(Ie=setTimeout(f,le))},p=function(){f(),z("autorotate",!0)},m=function(){clearTimeout(Be),Be=null,clearTimeout(Ie),Ie=null,z("autorotate",!1)};this.toggleAutorotate=function(){clearTimeout(Be),Ie?m():p()};var g=function(){we.clientWidth==ye.width&&we.clientHeight==ye.height||v({width:we.clientWidth,height:we.clientHeight})};this.fitToContainer=function(){g()};var v=function(e){ye.width=void 0!==e.width?parseInt(e.width):ye.width,ye.height=void 0!==e.height?parseInt(e.height):ye.height,ye.ratio=ye.width/ye.height,ke&&(ke.aspect=ye.ratio,ke.updateProjectionMatrix()),Ce&&(Ce.setSize(ye.width,ye.height),h()),Pe&&(Pe.setSize(ye.width,ye.height),h())};this.getPosition=function(){return{longitude:ne,latitude:te}},this.getPositionInDegrees=function(){return{longitude:180*ne/Math.PI,latitude:180*te/Math.PI}};var E=function(e,t){var n=B(e);ee||(n=i(n,V,U));var r=B(t);r>Math.PI&&(r-=2*Math.PI),r=i(r,K,Z),z("position-updated",{longitude:ne=n,latitude:te=r}),h()};this.moveTo=function(e,t){E(e,t)};var y=function(e,t){e=B(e),t=B(t),E(ne+e,te+t)};this.rotate=function(e,t){y(e,t)};var _=function(e){(e?window.addEventListener:window.removeEventListener)("keydown",T)},T=function(e){var t=0,n=0;switch(function(e){if(e.key)return/^Arrow/.test(e.key)?e.key:"Arrow"+e.key;if(e.keyCode||e.which){var t=e.keyCode?e.keyCode:e.which,n={38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",37:"ArrowLeft"};if(void 0!==n[t])return n[t]}return""}(e)){case"ArrowUp":n=q;break;case"ArrowRight":t=-Y;break;case"ArrowDown":n=-q;break;case"ArrowLeft":t=Y}y(t,n)},b=function(e){x(parseInt(e.clientX),parseInt(e.clientY))},w=function(e){if(1==e.touches.length){var t=e.touches[0];t.target.parentNode==Se&&x(parseInt(t.clientX),parseInt(t.clientY))}else 2==e.touches.length&&(H(),e.touches[0].target.parentNode==Se&&e.touches[1].target.parentNode==Se&&R(r(e.touches[0].clientX,e.touches[0].clientY,e.touches[1].clientX,e.touches[1].clientY)));N()},x=function(e,t){Le=e,Oe=t,m(),De=!0},R=function(e){Ne=e,Fe=!0},H=function(e){De=!1,Fe=!1},S=function(e){e.preventDefault(),C(parseInt(e.clientX),parseInt(e.clientY))},M=function(e){if(1==e.touches.length&&De){var t=e.touches[0];t.target.parentNode==Se&&(e.preventDefault(),C(parseInt(t.clientX),parseInt(t.clientY)))}else if(2==e.touches.length&&e.touches[0].target.parentNode==Se&&e.touches[1].target.parentNode==Se&&Fe){e.preventDefault();var n=r(e.touches[0].clientX,e.touches[0].clientY,e.touches[1].clientX,e.touches[1].clientY),i=n-Ne;if(0!==i){var o=i/Math.abs(i);D(ae+o*Te),Ne=n}}},C=function(e,t){De&&(j?(ne+=(e-Le)/ye.height*se*Math.PI/180,te+=(t-Oe)/ye.height*se*Math.PI/180):(ne+=(e-Le)*W,te+=(t-Oe)*G),Le=e,Oe=t,ee||(ne=i(ne,V,U)),ne=o(ne,!0),te=i(te,K,Z),z("position-updated",{longitude:ne,latitude:te}),h())},A=function(){ze.start(),m(),z("device-orientation",!0)};this.toggleDeviceOrientation=function(){ze.isEventAttached()?(ze.stop(),z("device-orientation",!1)):A()};var k=function(e){ne=i(e.longitude,V,U),te=i(e.latitude,K,Z),z("position-updated",{longitude:ne,latitude:te}),h()},P=function(e){e.preventDefault(),e.stopPropagation();var t=e.detail?-e.detail:e.wheelDelta;if(0!==t){var n=parseInt(t/Math.abs(t));D(ae+n*Te)}};this.mouseWheel=function(e){P(e)};var D=function(e){ae=i(e,0,100),se=$+ae/100*(X-$),ke.fov=se,ke.updateProjectionMatrix(),h(),z("zoom-updated",ae)};this.getZoomLevel=function(){return ae},this.zoom=function(e){D(e)},this.zoomIn=function(){ae<100&&D(ae+Te)},this.zoomOut=function(){ae>0&&D(ae-Te)};var L=function(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)},O=function(){document.webkitFullscreenElement||document.msFullscreenElement?(Re.width=we.style.width,Re.height=we.style.height,we.style.width="100%",we.style.height="100%",g()):(we.webkitRequestFullscreen||we.msRequestFullscreen)&&(we.style.width=Re.width,we.style.height=Re.height,g()),z("fullscreen-mode",L())},F=function(){we.requestFullscreen?we.requestFullscreen():we.mozRequestFullScreen?we.mozRequestFullScreen():we.webkitRequestFullscreen?we.webkitRequestFullscreen():we.msRequestFullscreen&&we.msRequestFullscreen()};this.toggleFullscreen=function(){L()?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():F()};var N=function(){ge&&me.show()},I=function(e){e=e.toString().trim();var t=parseFloat(e.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1")),n=e.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();n.match(/(pm|per minute)$/)&&(t/=60);var i=0;switch(n){case"rpm":case"rev per minute":case"revolutions per minute":case"rps":case"rev per second":case"revolutions per second":i=2*t*Math.PI;break;case"dpm":case"deg per minute":case"degrees per minute":case"dps":case"deg per second":case"degrees per second":i=t*Math.PI/180;break;case"rad per minute":case"radians per minute":case"rad per second":case"radians per second":i=t;break;default:m_anim=!1}return i*le/1e3},B=function(e){e=e.toString().trim();var t=parseFloat(e.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1"));return"deg"==e.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim()&&(t*=Math.PI/180),o(t)};this.addAction=function(e,t){e in Ve||(Ve[e]=[]),Ve[e].push(t)};var z=function(e,t){if(e in Ve&&Ve[e].length)for(var n=0,i=Ve[e].length;n<i;++n)void 0!==t?Ve[e][n](t):Ve[e][n]()};if(void 0!==e&&void 0!==e.panorama&&void 0!==e.container){var V,U,j=void 0===e.smooth_user_moves||!!e.smooth_user_moves,W=void 0!==e.long_offset?B(e.long_offset):Math.PI/360,G=void 0!==e.lat_offset?B(e.lat_offset):Math.PI/180,Y=void 0!==e.keyboard_long_offset?B(e.keyboard_long_offset):Math.PI/60,q=void 0!==e.keyboard_lat_offset?B(e.keyboard_lat_offset):Math.PI/120,X=void 0!==e.min_fov?i(parseFloat(e.min_fov),1,179):30,$=void 0!==e.max_fov?i(parseFloat(e.max_fov),1,179):90,Z=void 0!==e.tilt_up_max?i(B(e.tilt_up_max),0,Math.PI/2):Math.PI/2,K=void 0!==e.tilt_down_max?-i(B(e.tilt_down_max),0,Math.PI/2):-Math.PI/2,Q=void 0!==e.min_longitude?B(e.min_longitude):0,J=void 0!==e.max_longitude?B(e.max_longitude):0,ee=Q==J;ee?(Q=0,J=2*Math.PI):0===J&&(J=2*Math.PI),Q<J?(V=Q,U=J):(V=J,U=Q);var te=0,ne=V;if(void 0!==e.default_position){if(void 0!==e.default_position.lat){var ie=B(e.default_position.lat);ie>Math.PI&&(ie-=2*Math.PI),te=i(ie,K,Z)}void 0!==e.default_position.long&&(ne=i(B(e.default_position.long),V,U))}var re=void 0!==e.segments?parseInt(e.segments):100,oe=void 0!==e.rings?parseInt(e.rings):100,ae=0;void 0!==e.zoom_level&&(ae=i(parseInt(Math.round(e.zoom_level)),0,100));var se=$+ae/100*(X-$),le=1e3/60,ue=2e3;void 0!==e.time_anim&&(ue="number"==typeof e.time_anim&&e.time_anim>=0&&e.time_anim);var ce=void 0!==e.anim_speed?I(e.anim_speed):I("2rpm"),he=!0;void 0!==e.reverse_anim&&(he=!!e.reverse_anim);var de=void 0!==e.vertical_anim_speed?I(e.vertical_anim_speed):I("2rpm"),fe=0;if(void 0!==e.vertical_anim_target){var pe=B(e.vertical_anim_target);pe>Math.PI&&(pe-=2*Math.PI),fe=i(pe,K,Z)}var me=new PSVNavBar(this),ge=void 0!==e.navbar&&!!e.navbar,ve=void 0!==e.navbar_style?e.navbar_style:{},Ee=void 0===e.allow_user_interactions||!!e.allow_user_interactions;Ee||(ge=!1);var ye,_e=void 0===e.allow_scroll_to_zoom||!!e.allow_scroll_to_zoom,Te=void 0!==e.zoom_speed?parseFloat(e.zoom_speed):1,be=void 0!==e.eyes_offset?parseFloat(e.eyes_offset):5,we="string"==typeof e.container?document.getElementById(e.container):e.container,xe={},Re={};void 0!==e.size&&function(e){for(var t in e)if("width"==t||"height"==t){var n=e[t].toString().trim(),i=parseFloat(n.replace(/^([0-9]+(?:\.[0-9]*)?).*$/,"$1")),r=n.replace(/^[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();"%"!=r&&(r="px"),xe[t]={css:i+r,unit:r}}}(e.size);var He,Se,Me=e.panorama,Ce=null,Ae=null,ke=null,Pe=null,De=!1,Le=0,Oe=0,Fe=!1,Ne=0,Ie=null,Be=null,ze=new Sphoords,Ve={},Ue=void 0===e.usexmpdata||!!e.usexmpdata,je=void 0===e.cors_anonymous||!!e.cors_anonymous,We={full_width:null,full_height:null,cropped_width:null,cropped_height:null,cropped_x:null,cropped_y:null};if(void 0!==e.pano_size){for(var Ge in We)void 0!==e.pano_size[Ge]&&(We[Ge]=parseInt(e.pano_size[Ge]));Ue=!1}var Ye={horizontal_fov:360,vertical_fov:180};if(void 0!==e.captured_view){for(var Ge in Ye)void 0!==e.captured_view[Ge]&&(Ye[Ge]=parseFloat(e.captured_view[Ge]));Ue=!1}var qe=!1,Xe=void 0!==e.loading_msg?e.loading_msg.toString():"Loading…",$e=void 0!==e.loading_img?e.loading_img.toString():null,Ze=void 0!==e.loading_html?e.loading_html:null,Ke=null;void 0!==e.overlay&&void 0!==e.overlay.image&&(Ke={image:e.overlay.image,position:{x:"left",y:"bottom"}},void 0!==e.overlay.position&&(void 0===e.overlay.position.x||"left"!=e.overlay.position.x&&"right"!=e.overlay.position.x||(Ke.position.x=e.overlay.position.x),void 0===e.overlay.position.y||"top"!=e.overlay.position.y&&"bottom"!=e.overlay.position.y||(Ke.position.y=e.overlay.position.y)),void 0!==e.overlay.size&&(Ke.size={width:void 0!==e.overlay.size.width?e.overlay.size.width:"auto",height:void 0!==e.overlay.size.height?e.overlay.size.height:"auto"}));var Qe=this;void 0!==e.onready&&this.addAction("ready",e.onready),(void 0===e.autoload||!!e.autoload)&&this.load()}else console.log("PhotoSphereViewer: no value given for panorama or container")},PSVNavBar=function(e){var t=function(e,t){for(var n=0,i=t.length;n<i;++n)if(t[n]==e)return!0;return!1},n=function(e,n){return t(e,d)&&"string"==typeof n&&("transparent"==n||!!n.match(/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/)||!!n.match(/^rgb\((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])(,\s*(1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}\)$/)||!!n.match(/^rgba\(((1?[0-9]{1,2}|2[0-4][0-9]|25[0-5]),\s*){3}(0(\.[0-9]*)?|1)\)$/))||t(e,f)&&!isNaN(parseFloat(n))&&isFinite(n)&&n>=0};this.setStyle=function(e){for(var t in e)t in h&&n(t,e[t])&&(h[t]=e[t])},this.create=function(){(o=document.createElement("div")).style.backgroundColor=h.backgroundColor,o.style.position="absolute",o.style.zIndex=10,o.style.bottom=0,o.style.width="100%",o.style.boxSizing="content-box",o.style.transition="bottom 0.4s ease-out",a=new PSVNavBarButton(e,"autorotate",h),o.appendChild(a.getButton()),s=new PSVNavBarButton(e,"zoom",h),o.appendChild(s.getButton()),l=new PSVNavBarButton(e,"fullscreen",h),o.appendChild(l.getButton()),Sphoords.isDeviceOrientationSupported&&(u=new PSVNavBarButton(e,"orientation",h),o.appendChild(u.getButton()),c=new PSVNavBarButton(e,"virtual-reality",h),o.appendChild(c.getButton()))},this.getBar=function(){return o};var i=function(){p&&(clearTimeout(p),!m&&g&&(p=setTimeout(r,5e3))),m&&(o.style.bottom=0,m=!1,g&&(p=setTimeout(r,5e3)))};this.show=function(){i()};var r=function(){m||(o.style.bottom=1-o.offsetHeight+"px",m=!0)};this.hide=function(){r()},this.isHidden=function(){return m},this.mustBeHidden=function(e){(g=void 0===e||!!e)?r():i()};var o,a,s,l,u,c,h={backgroundColor:"rgba(61, 61, 61, 0.5)",buttonsColor:"rgba(255, 255, 255, 0.7)",buttonsBackgroundColor:"transparent",activeButtonsBackgroundColor:"rgba(255, 255, 255, 0.1)",buttonsHeight:20,autorotateThickness:1,zoomRangeWidth:50,zoomRangeThickness:1,zoomRangeDisk:7,fullscreenRatio:4/3,fullscreenThickness:2,gyroscopeThickness:1,virtualRealityRatio:4/3,virtualRealityBorderRadius:2},d=["backgroundColor","buttonsColor","buttonsBackgroundColor","activeButtonsBackgroundColor"],f=["buttonsHeight","autorotateThickness","zoomRangeWidth","zoomRangeThickness","zoomRangeDisk","fullscreenRatio","fullscreenThickness"],p=null,m=!1,g=!1},PSVNavBarButton=function(e,t,n){var i=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)};this.getButton=function(){return s};var r,o,a,s,l=function(e){s.style.backgroundColor=e?n.activeButtonsBackgroundColor:n.buttonsBackgroundColor},u=function(e){a.style.left=e/100*n.zoomRangeWidth-n.zoomRangeDisk/2+"px"},c=function(e){d(parseInt(e.clientX))},h=function(e){var t=e.touches[0];t.target!=r&&t.target!=o&&t.target!=a||d(parseInt(t.clientX))},d=function(e){E=!0,g(e)},f=function(e){E=!1},p=function(e){e.preventDefault(),g(parseInt(e.clientX))},m=function(e){var t=e.touches[0];t.target!=r&&t.target!=o&&t.target!=a||(e.preventDefault(),g(parseInt(t.clientX)))},g=function(t){if(E){var i=(t-o.getBoundingClientRect().left)/n.zoomRangeWidth*100;e.zoom(i)}},v=function(t){e.mouseWheel(t)},E=!1;!function(){switch(t){case"autorotate":var d=n.buttonsHeight-2*n.autorotateThickness,g=d/10;(s=document.createElement("div")).style.cssFloat="left",s.style.boxSizing="inherit",s.style.padding="10px",s.style.width=n.buttonsHeight+"px",s.style.height=n.buttonsHeight+"px",s.style.backgroundColor=n.buttonsBackgroundColor,s.style.position="relative",s.style.cursor="pointer",i(s,"click",function(){e.toggleAutorotate()});var E=document.createElement("div");E.style.boxSizing="inherit",E.style.width=d+"px",E.style.height=d+"px",E.style.borderRadius="50%",E.style.border=n.autorotateThickness+"px solid "+n.buttonsColor,s.appendChild(E);var y=document.createElement("div");y.style.boxSizing="inherit",y.style.width=d+"px",y.style.height=g+"px",y.style.borderRadius="50%",y.style.border=n.autorotateThickness+"px solid "+n.buttonsColor,y.style.position="absolute",y.style.top="50%",y.style.marginTop=-(g/2+n.autorotateThickness)+"px",s.appendChild(y),e.addAction("autorotate",l);break;case"zoom":(s=document.createElement("div")).style.cssFloat="left",s.style.boxSizing="inherit";var _=document.createElement("div");_.style.cssFloat="left",_.style.boxSizing="inherit",_.style.padding="10px",_.style.height=n.buttonsHeight+"px",_.style.backgroundColor=n.buttonsBackgroundColor,_.style.lineHeight=n.buttonsHeight+"px",_.style.color=n.buttonsColor,_.style.cursor="pointer",_.textContent="-",i(_,"click",function(){e.zoomOut()}),s.appendChild(_),(r=document.createElement("div")).style.cssFloat="left",r.style.boxSizing="inherit",r.style.padding=10+(n.buttonsHeight-n.zoomRangeThickness)/2+"px 5px",r.style.backgroundColor=n.buttonsBackgroundColor,r.style.cursor="pointer",s.appendChild(r),(o=document.createElement("div")).style.boxSizing="inherit",o.style.width=n.zoomRangeWidth+"px",o.style.height=n.zoomRangeThickness+"px",o.style.backgroundColor=n.buttonsColor,o.style.position="relative",r.appendChild(o),(a=document.createElement("div")).style.position="absolute",a.style.top=(n.zoomRangeThickness-n.zoomRangeDisk)/2+"px",a.style.left=-n.zoomRangeDisk/2+"px",a.style.boxSizing="inherit",a.style.width=n.zoomRangeDisk+"px",a.style.height=n.zoomRangeDisk+"px",a.style.borderRadius="50%",a.style.backgroundColor=n.buttonsColor,e.addAction("zoom-updated",u),i(r,"mousedown",c),i(r,"touchstart",h),i(document,"mousemove",p),i(document,"touchmove",m),i(document,"mouseup",f),i(document,"touchend",f),i(r,"mousewheel",v),i(r,"DOMMouseScroll",v),o.appendChild(a);var T=document.createElement("div");T.style.cssFloat="left",T.style.boxSizing="inherit",T.style.padding="10px",T.style.height=n.buttonsHeight+"px",T.style.backgroundColor=n.buttonsBackgroundColor,T.style.lineHeight=n.buttonsHeight+"px",T.style.color=n.buttonsColor,T.style.cursor="pointer",T.textContent="+",i(T,"click",function(){e.zoomIn()}),s.appendChild(T);break;case"fullscreen":var b=n.buttonsHeight*n.fullscreenRatio,w=.3*n.buttonsHeight,x=(n.buttonsHeight-w)/2,R=.3*b,H=(b-R)/2-n.fullscreenThickness,S=n.buttonsHeight-2*n.fullscreenThickness;(s=document.createElement("div")).style.cssFloat="right",s.style.boxSizing="inherit",s.style.padding="10px",s.style.width=b+"px",s.style.height=n.buttonsHeight+"px",s.style.backgroundColor=n.buttonsBackgroundColor,s.style.cursor="pointer",i(s,"click",function(){e.toggleFullscreen()});var M=document.createElement("div");M.style.cssFloat="left",M.style.boxSizing="inherit",M.style.width=n.fullscreenThickness+"px",M.style.height=w+"px",M.style.borderStyle="solid",M.style.borderColor=n.buttonsColor+" transparent",M.style.borderWidth=x+"px 0",s.appendChild(M);var C=document.createElement("div");C.style.cssFloat="left",C.style.boxSizing="inherit",C.style.width=H+"px",C.style.height=S+"px",C.style.borderStyle="solid",C.style.borderColor=n.buttonsColor+" transparent",C.style.borderWidth=n.fullscreenThickness+"px 0",s.appendChild(C);var A=document.createElement("div");A.style.cssFloat="left",A.style.boxSizing="inherit",A.style.marginLeft=R+"px",A.style.width=H+"px",A.style.height=S+"px",A.style.borderStyle="solid",A.style.borderColor=n.buttonsColor+" transparent",A.style.borderWidth=n.fullscreenThickness+"px 0",s.appendChild(A);var k=document.createElement("div");k.style.cssFloat="left",k.style.boxSizing="inherit",k.style.width=n.fullscreenThickness+"px",k.style.height=w+"px",k.style.borderStyle="solid",k.style.borderColor=n.buttonsColor+" transparent",k.style.borderWidth=x+"px 0",s.appendChild(k);var P=document.createElement("div");P.style.clear="left",s.appendChild(P),e.addAction("fullscreen-mode",l);break;case"orientation":var D=n.buttonsHeight-2*n.gyroscopeThickness,L=D-4*n.gyroscopeThickness,O=D/10;(s=document.createElement("div")).style.cssFloat="right",s.style.boxSizing="inherit",s.style.padding="10px",s.style.width=n.buttonsHeight+"px",s.style.height=n.buttonsHeight+"px",s.style.backgroundColor=n.buttonsBackgroundColor,s.style.position="relative",s.style.cursor="pointer",i(s,"click",function(){e.toggleDeviceOrientation()});var F=document.createElement("div");F.style.boxSizing="inherit",F.style.width=D+"px",F.style.height=D+"px",F.style.borderRadius="50%",F.style.border=n.gyroscopeThickness+"px solid "+n.buttonsColor,s.appendChild(F);var N=document.createElement("div");N.style.boxSizing="inherit",N.style.width=L+"px",N.style.height=O+"px",N.style.borderRadius="50%",N.style.border=n.gyroscopeThickness+"px solid "+n.buttonsColor,N.style.position="absolute",N.style.top="50%",N.style.left="50%",N.style.marginTop=-(O/2+n.gyroscopeThickness)+"px",N.style.marginLeft=-(L/2+n.gyroscopeThickness)+"px",s.appendChild(N);var I=document.createElement("div");I.style.boxSizing="inherit",I.style.width=O+"px",I.style.height=L+"px",I.style.borderRadius="50%",I.style.border=n.gyroscopeThickness+"px solid "+n.buttonsColor,I.style.position="absolute",I.style.top="50%",I.style.left="50%",I.style.marginTop=-(L/2+n.gyroscopeThickness)+"px",I.style.marginLeft=-(O/2+n.gyroscopeThickness)+"px",s.appendChild(I),e.addAction("device-orientation",l);break;case"virtual-reality":var B=n.buttonsHeight*n.virtualRealityRatio,z=B/4,V=z/2;(s=document.createElement("div")).style.cssFloat="right",s.style.position="relative",s.style.boxSizing="inherit",s.style.padding="10px",s.style.width=B+"px",s.style.height=n.buttonsHeight+"px",s.style.backgroundColor=n.buttonsBackgroundColor,s.style.cursor="pointer",i(s,"click",function(){e.toggleStereo()});var U=document.createElement("div");U.style.boxSizing="inherit",U.style.width=B+"px",U.style.height=n.buttonsHeight+"px",U.style.borderRadius=n.virtualRealityBorderRadius+"px",U.style.backgroundColor=n.buttonsColor,s.appendChild(U);var j=document.createElement("div");j.style.boxSizing="inherit",j.style.width=z+"px",j.style.height=z+"px",j.style.position="absolute",j.style.top=V+10+"px",j.style.left=V+10+"px",j.style.borderRadius="50%",j.style.backgroundColor=n.backgroundColor,s.appendChild(j);var W=document.createElement("div");W.style.boxSizing="inherit",W.style.width=z+"px",W.style.height=z+"px",W.style.position="absolute",W.style.top=V+10+"px",W.style.right=V+10+"px",W.style.borderRadius="50%",W.style.backgroundColor=n.backgroundColor,s.appendChild(W);var G=document.createElement("div");G.style.boxSizing="inherit",G.style.width=z+"px",G.style.height=n.buttonsHeight/2+"px",G.style.position="absolute",G.style.left="50%",G.style.bottom="10px",G.style.marginLeft=-z/2+"px",G.style.borderTopLeftRadius="50% 60%",G.style.borderTopRightRadius="50% 60%",G.style.backgroundColor=n.backgroundColor,s.appendChild(G),e.addAction("stereo-effect",l)}}()},Sphoords=function(){var e=function(e){return e-360*Math.floor(e/360)};this.start=function(){return Sphoords.isDeviceOrientationSupported?(window.addEventListener("deviceorientation",t,!1),r=!0,!0):(console.log("Device Orientation API not supported"),!1)},this.stop=function(){r&&(window.removeEventListener("deviceorientation",t,!1),r=!1)},this.toggle=function(){r?this.stop():this.start()},this.isEventAttached=function(){return r};var t=function(t){var n=0,r=0;switch(c=Sphoords.getScreenOrientation()){case"portrait-primary":n=t.alpha+t.gamma,r=t.beta-90;break;case"landscape-primary":if(n=t.alpha+t.beta-90,r=-t.gamma-90,Math.abs(t.beta)>90)switch(h){case"Blink":r+=180;break;case"Gecko":default:r=-r}"WebKit"===h&&window.orientation&&(r<0&&(r=-1*(r+180)),n>=180?n-=180:n+=180);break;case"landscape-secondary":if(n=t.alpha-t.beta+90,r=t.gamma-90,Math.abs(t.beta)>90)switch(h){case"Blink":r+=180;break;case"Gecko":default:r=-r}"WebKit"===h&&window.orientation&&(r<0&&(r=-1*(r+180)),n>=180?n-=180:n+=180);break;case"portrait-secondary":n=t.alpha-t.gamma,r=180-(t.beta-90),r=270-t.beta}(r=e(r))>=180&&(r-=360),o=e(n),a=Math.max(-90,Math.min(90,r)),s=o*u,l=a*u,i()};this.getCoordinates=function(){return{longitude:s,latitude:l}},this.getCoordinatesInDegrees=function(){return{longitude:o,latitude:a}},this.getScreenOrientation=function(){return c},this.addListener=function(e){d.push(e)};var n,i=function(){if(d.length)for(var e=0,t=d.length;e<t;++e)d[e]({longitude:s,latitude:l})},r=!1,o=0,a=0,s=0,l=0,u=Math.PI/180,c=Sphoords.getScreenOrientation(),h=(n=navigator.userAgent,/Gecko\/[0-9.]+/.test(n)?"Gecko":/Chrome\/[0-9.]+/.test(n)?"Blink":/AppleWebKit\/[0-9.]+/.test(n)?"WebKit":/Trident\/[0-9.]+/.test(n)?"Trident":/Opera\/[0-9.]+/.test(n)?"Presto":"Gecko"),d=[]};function stickIt(){$('[data-stick="navbar"]').stick_in_parent({offset_top:0,bottoming:!0}),$(window).width()>=768&&$('[data-stick="list-group"]').stick_in_parent({offset_top:56,bottoming:!0})}function smoothScroll(e){e.click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var e=$(this.hash);if(e.length>0)return e=e.length?e:$("[name="+this.hash.slice(1)+"]"),$("html, body").animate({scrollTop:e.offset().top-40},500),!1}})}Sphoords.getScreenOrientation=function(){var e=null;if(screen.orientation)e=screen.orientation;else if(screen.mozOrientation)e=screen.mozOrientation;else if(screen.msOrientation)e=screen.msOrientation;else if(window.orientation||0===window.orientation)switch(window.orientation){case 0:e="portrait-primary";break;case 180:e="portrait-secondary";break;case-90:e="landscape-primary";break;case 90:e="landscape-secondary"}return null!==e&&"object"==typeof e?e.type:e},Sphoords.isDeviceOrientationSupported=!1,function(){if(window.DeviceOrientationEvent&&null!==Sphoords.getScreenOrientation()){window.addEventListener("deviceorientation",function e(t){null!==t&&null!==t.alpha&&(Sphoords.isDeviceOrientationSupported=!0,window.removeEventListener("deviceorientation",e))})}}(),function(e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():e()}(function(){var e="undefined"!=typeof window?window:this,t=e.Glider=function(t,n){var i=this;if(t._glider)return t._glider;if(i.ele=t,i.ele.classList.add("glider"),i.ele._glider=i,i.opt=Object.assign({},{slidesToScroll:1,slidesToShow:1,resizeLock:!0,duration:.5,easing:function(e,t,n,i,r){return i*(t/=r)*t+n}},n),i.animate_id=i.page=i.slide=0,i.arrows={},i._opt=i.opt,i.opt.skipTrack)i.track=i.ele.children[0];else for(i.track=document.createElement("div"),i.ele.appendChild(i.track);1!==i.ele.children.length;)i.track.appendChild(i.ele.children[0]);i.track.classList.add("glider-track"),i.init(),i.resize=i.init.bind(i,!0),i.event(i.ele,"add",{scroll:i.updateControls.bind(i)}),i.event(e,"add",{resize:i.resize})},n=t.prototype;return n.init=function(e,t){var n=this,i=0,r=0;n.slides=n.track.children,[].forEach.call(n.slides,function(e){e.classList.add("glider-slide")}),n.containerWidth=n.ele.clientWidth;var o=n.settingsBreakpoint();if(t||(t=o),"auto"===n.opt.slidesToShow||void 0!==n.opt._autoSlide){var a=n.containerWidth/n.opt.itemWidth;n.opt._autoSlide=n.opt.slidesToShow=n.opt.exactWidth?a:Math.floor(a)}"auto"===n.opt.slidesToScroll&&(n.opt.slidesToScroll=Math.floor(n.opt.slidesToShow)),n.itemWidth=n.opt.exactWidth?n.opt.itemWidth:n.containerWidth/n.opt.slidesToShow,[].forEach.call(n.slides,function(e){e.style.height="auto",e.style.width=n.itemWidth+"px",i+=n.itemWidth,r=Math.max(e.offsetHeight,r)}),n.track.style.width=i+"px",n.trackWidth=i,n.isDrag=!1,n.preventClick=!1,n.opt.resizeLock&&n.scrollTo(n.slide*n.itemWidth,0),(o||t)&&(n.bindArrows(),n.buildDots(),n.bindDrag()),n.updateControls(),n.emit(e?"refresh":"loaded")},n.bindDrag=function(){var e=this;e.mouse=e.mouse||e.handleMouse.bind(e);var t=function(){e.mouseDown=void 0,e.ele.classList.remove("drag"),e.isDrag&&(e.preventClick=!0),e.isDrag=!1},n={mouseup:t,mouseleave:t,mousedown:function(t){t.preventDefault(),t.stopPropagation(),e.mouseDown=t.clientX,e.ele.classList.add("drag")},mousemove:e.mouse,click:function(t){e.preventClick&&(t.preventDefault(),t.stopPropagation()),e.preventClick=!1}};e.ele.classList.toggle("draggable",!0===e.opt.draggable),e.event(e.ele,"remove",n),e.opt.draggable&&e.event(e.ele,"add",n)},n.buildDots=function(){var e=this;if(e.opt.dots){if("string"==typeof e.opt.dots?e.dots=document.querySelector(e.opt.dots):e.dots=e.opt.dots,e.dots){e.dots.innerHTML="",e.dots.classList.add("glider-dots");for(var t=0;t<Math.ceil(e.slides.length/e.opt.slidesToShow);++t){var n=document.createElement("button");n.dataset.index=t,n.setAttribute("aria-label","Page "+(t+1)),n.className="glider-dot "+(t?"":"active"),e.event(n,"add",{click:e.scrollItem.bind(e,t,!0)}),e.dots.appendChild(n)}}}else e.dots&&(e.dots.innerHTML="")},n.bindArrows=function(){var e=this;e.opt.arrows?["prev","next"].forEach(function(t){var n=e.opt.arrows[t];n&&("string"==typeof n&&(n=document.querySelector(n)),n._func=n._func||e.scrollItem.bind(e,t),e.event(n,"remove",{click:n._func}),e.event(n,"add",{click:n._func}),e.arrows[t]=n)}):Object.keys(e.arrows).forEach(function(t){var n=e.arrows[t];e.event(n,"remove",{click:n._func})})},n.updateControls=function(e){var t=this;e&&!t.opt.scrollPropagate&&e.stopPropagation();var n=t.containerWidth>=t.trackWidth;t.opt.rewind||(t.arrows.prev&&t.arrows.prev.classList.toggle("disabled",t.ele.scrollLeft<=0||n),t.arrows.next&&t.arrows.next.classList.toggle("disabled",Math.ceil(t.ele.scrollLeft+t.containerWidth)>=Math.floor(t.trackWidth)||n)),t.slide=Math.round(t.ele.scrollLeft/t.itemWidth),t.page=Math.round(t.ele.scrollLeft/t.containerWidth);var i=t.slide+Math.floor(Math.floor(t.opt.slidesToShow)/2),r=Math.floor(t.opt.slidesToShow)%2?0:i+1;1===Math.floor(t.opt.slidesToShow)&&(r=0),t.ele.scrollLeft+t.containerWidth>=Math.floor(t.trackWidth)&&(t.page=t.dots?t.dots.children.length-1:0),[].forEach.call(t.slides,function(e,n){var o=e.classList,a=o.contains("visible"),s=t.ele.scrollLeft,l=t.ele.scrollLeft+t.containerWidth,u=t.itemWidth*n,c=u+t.itemWidth;[].forEach.call(o,function(e){/^left|right/.test(e)&&o.remove(e)}),o.toggle("active",t.slide===n),i===n||r&&r===n?o.add("center"):(o.remove("center"),o.add([n<i?"left":"right",Math.abs(n-(n<i?i:r||i))].join("-")));var h=Math.ceil(u)>=s&&Math.floor(c)<=l;o.toggle("visible",h),h!==a&&t.emit("slide-"+(h?"visible":"hidden"),{slide:n})}),t.dots&&[].forEach.call(t.dots.children,function(e,n){e.classList.toggle("active",t.page===n)}),e&&t.opt.scrollLock&&(clearTimeout(t.scrollLock),t.scrollLock=setTimeout(function(){clearTimeout(t.scrollLock),Math.abs(t.ele.scrollLeft/t.itemWidth-t.slide)>.02&&(t.mouseDown||t.trackWidth>t.containerWidth+t.ele.scrollLeft&&t.scrollItem(t.getCurrentSlide()))},t.opt.scrollLockDelay||250))},n.getCurrentSlide=function(){var e=this;return e.round(e.ele.scrollLeft/e.itemWidth)},n.scrollItem=function(e,t,n){n&&n.preventDefault();var i=this,r=e;if(++i.animate_id,!0===t)e*=i.containerWidth,e=Math.round(e/i.itemWidth)*i.itemWidth;else{if("string"==typeof e){var o="prev"===e;if(e=i.opt.slidesToScroll%1||i.opt.slidesToShow%1?i.getCurrentSlide():i.slide,o?e-=i.opt.slidesToScroll:e+=i.opt.slidesToScroll,i.opt.rewind){var a=i.ele.scrollLeft;e=o&&!a?i.slides.length:!o&&a+i.containerWidth>=Math.floor(i.trackWidth)?0:e}}e=Math.max(Math.min(e,i.slides.length),0),i.slide=e,e=i.itemWidth*e}return i.scrollTo(e,i.opt.duration*Math.abs(i.ele.scrollLeft-e),function(){i.updateControls(),i.emit("animated",{value:r,type:"string"==typeof r?"arrow":t?"dot":"slide"})}),!1},n.settingsBreakpoint=function(){var t=this,n=t._opt.responsive;if(n){n.sort(function(e,t){return t.breakpoint-e.breakpoint});for(var i=0;i<n.length;++i){var r=n[i];if(e.innerWidth>=r.breakpoint)return t.breakpoint!==r.breakpoint&&(t.opt=Object.assign({},t._opt,r.settings),t.breakpoint=r.breakpoint,!0)}}var o=0!==t.breakpoint;return t.opt=Object.assign({},t._opt),t.breakpoint=0,o},n.scrollTo=function(t,n,i){var r=this,o=(new Date).getTime(),a=r.animate_id,s=function(){var l=(new Date).getTime()-o;r.ele.scrollLeft=r.ele.scrollLeft+(t-r.ele.scrollLeft)*r.opt.easing(0,l,0,1,n),l<n&&a===r.animate_id?e.requestAnimationFrame(s):(r.ele.scrollLeft=t,i&&i.call(r))};e.requestAnimationFrame(s)},n.removeItem=function(e){var t=this;t.slides.length&&(t.track.removeChild(t.slides[e]),t.refresh(!0),t.emit("remove"))},n.addItem=function(e){var t=this;t.track.appendChild(e),t.refresh(!0),t.emit("add")},n.handleMouse=function(e){var t=this;t.mouseDown&&(t.isDrag=!0,t.ele.scrollLeft+=(t.mouseDown-e.clientX)*(t.opt.dragVelocity||3.3),t.mouseDown=e.clientX)},n.round=function(e){var t=1/(this.opt.slidesToScroll%1||1);return Math.round(e*t)/t},n.refresh=function(e){this.init(!0,e)},n.setOption=function(e,t){var n=this;n.breakpoint&&!t?n._opt.responsive.forEach(function(t){t.breakpoint===n.breakpoint&&(t.settings=Object.assign({},t.settings,e))}):n._opt=Object.assign({},n._opt,e),n.breakpoint=0,n.settingsBreakpoint()},n.destroy=function(){var t=this,n=t.ele.cloneNode(!0),i=function(e){e.removeAttribute("style"),[].forEach.call(e.classList,function(t){/^glider/.test(t)&&e.classList.remove(t)})};n.children[0].outerHTML=n.children[0].innerHTML,i(n),[].forEach.call(n.getElementsByTagName("*"),i),t.ele.parentNode.replaceChild(n,t.ele),t.event(e,"remove",{resize:t.resize}),t.emit("destroy")},n.emit=function(t,n){var i=new e.CustomEvent("glider-"+t,{bubbles:!this.opt.eventPropagate,detail:n});this.ele.dispatchEvent(i)},n.event=function(e,t,n){var i=e[t+"EventListener"].bind(e);Object.keys(n).forEach(function(e){i(e,n[e])})},t}),Noty.overrideDefaults({theme:"default",layout:"bottomLeft",timeout:6e3});var isMobile={iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)}},x=0,numIfrm=$('[data-name="iframe-ios"]').length;function GalleryImgInit(){$("body").append('\n    <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">\n      <div class="pswp__bg"></div>\n      <div class="pswp__scroll-wrap">\n        <div class="pswp__container">\n          <div class="pswp__item"></div>\n          <div class="pswp__item"></div>\n          <div class="pswp__item"></div>\n        </div>\n        <div class="pswp__ui pswp__ui--hidden">\n          <div class="pswp__top-bar">\n            <div class="pswp__counter"></div>\n            <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>\n            <button class="pswp__button pswp__button--share" title="Share"></button>\n            <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>\n            <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>\n            <div class="pswp__preloader">\n              <div class="pswp__preloader__icn">\n                <div class="pswp__preloader__cut">\n                  <div class="pswp__preloader__donut"></div>\n                </div>\n              </div>\n            </div>\n          </div>\n          <div class="pswp__loading-indicator"><div class="pswp__loading-indicator__line"></div></div>\n          <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">\n            <div class="pswp__share-tooltip">\n              <a href="#" class="pswp__share--facebook"></a>\n              <a href="#" class="pswp__share--twitter"></a>\n              <a href="#" class="pswp__share--pinterest"></a>\n              <a href="#" download class="pswp__share--download"></a>\n            </div>\n          </div>\n          <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button>\n          <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button>\n          <div class="pswp__caption">\n            <div class="pswp__caption__center">\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  '),$("#justifiedGallery").justifiedGallery()}function galleryItem(e){var t,n,i=!1,r=!0;e.listen("afterChange",function(){var t=e.currItem.fitRatio||1,n=t<1?t*e.currItem.h+"px":e.currItem.h+"px";"NaNpx"!=n&&$(e.currItem.container).parents(".pswp__scroll-wrap").first().find(".pswp__button--arrow--right, .pswp__button--arrow--left").css("height",n)}),e.listen("resize",function(){var t=e.currItem.fitRatio||1,n=t<1?t*e.currItem.h+"px":e.currItem.h+"px";"NaNpx"!=n&&$(e.currItem.container).parents(".pswp__scroll-wrap").first().find(".pswp__button--arrow--right, .pswp__button--arrow--left").css("height",n)}),e.listen("beforeResize",function(){e.options.clickToCloseNonZoomable=!1,e.options.closeOnScroll=!1,e.options.closeOnVerticalDrag=!1;var o=window.devicePixelRatio?window.devicePixelRatio:1;o=Math.min(o,2.5),(t=e.viewportSize.x*o)>=1200||!e.likelyTouchDevice&&t>800||screen.width>1200?i||(i=!0,n=!0):i&&(i=!1,n=!0),n&&!r&&e.invalidateCurrItems(),r&&(r=!1),n=!1})}function tkObjectFit(){$("img.section-alt-bg").each(function(){var e=$(this).attr("src"),t="cover";$(this).data("fit-type")&&(t=$(this).data("fit-type")),$(this).parent().css({background:'transparent url("'+e+'") no-repeat center center/'+t}),$(this).remove()})}$('[data-name="iframe-ios"]').on("load",function(){if(isMobile.iOS()&&++x>numIfrm){var e=$(this);e.parent().css({"-webkit-overflow-scrolling":"touch","overflow-y":"auto",height:"460px"}),e.css("height","100%"),e.parent().scrollTop(580),e.parent().css({"-webkit-overflow-scrolling":"auto","overflow-y":"none"})}}),$(document).ready(function(){$("#slider").removeClass("d-none").royalSlider({loop:!0,keyboardNavEnabled:!0,controlNavigation:"thumbnails",imageScaleMode:"fill",numImagesToPreload:3,globalCaption:!0,touch:!0,thumbs:{spacing:10,arrowsAutoHide:!0},fullscreen:{enabled:!0,nativeFS:!0},autoPlay:{enabled:!0,delay:1e4,stopAtAction:!1,pauseOnHover:!1}})}),$(window).on("load",function(){setTimeout(function(){GalleryImgInit()},500)}),$(document).ready(function(){stickIt(),smoothScroll($(".navbar .nav-item:not(.dropdown) .nav-link")),smoothScroll($(".navbar .nav-item .dropdown-item")),$("body").scrollspy({target:"#mainNavbar",offset:45}),$("#usemail").on("click",function(e){e.preventDefault(),$("#typeFacebook").addClass("d-none"),$("#typeEmail").removeClass("d-none")}),$("#usefacebook").on("click",function(e){e.preventDefault(),$("#typeFacebook").removeClass("d-none"),$("#typeEmail").addClass("d-none")}),$("#datetimepicker").datetimepicker({format:"DD MMM YYYY h:mm A",minDate:new Date})}),$(window).on("scroll",function(){stickIt()}),$(".review-text").each(function(e,t){$clamp(t,{clamp:2,useNativeClamp:!1})}),$('[data-name="requestShowing"]').click(function(){$("#scheduleShowing").toggleClass("d-none")}),$("#justifiedGallery").justifiedGallery(),function(e){for(var t=function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1;var t=function e(t,n){return t&&(n(t)?t:e(t.parentNode,n))}(e.target||e.srcElement,function(e){return"A"===e.tagName});if(t){for(var i,r=t.parentNode,o=t.parentNode.childNodes,a=o.length,s=0,l=0;l<a;l++)if(1===o[l].nodeType){if(o[l]===t){i=s;break}s++}return i>=0&&n(i,r),!1}},n=function(e,t,n,i){var r,o,a,s=document.querySelectorAll(".pswp")[0];if(a=function(e){for(var t,n,i=e.childNodes,r=i.length,o=[],a=0,s=1200,l=700,u=0;u<r;u++)if(1===(e=i[u]).nodeType){if(t=e.children,null!=e.getAttribute("data-size")?(a=e.getAttribute("data-size").split("x"),(isNaN(parseInt(a[0]))||isNaN(parseInt(a[1])))&&(a=0)):a=0,0!=a)s=parseInt(a[0],10),l=parseInt(a[1],10);else{var c=new Image;c.src=e.getAttribute("data-med"),s=c.width,l=c.height,0==s&&(s=4*t[0].naturalWidth,l=4*t[0].naturalHeight)}(n={src:e.getAttribute("href"),w:parseInt(s,10),h:parseInt(l,10),author:e.getAttribute("data-author")}).el=e,t.length>0&&(n.msrc=t[0].getAttribute("src"),t.length>1&&(n.title=t[1].innerHTML));var h=e.getAttribute("data-med");h&&(n.m={src:h,w:parseInt(s,10),h:parseInt(l,10)}),n.o={src:n.src,w:n.w,h:n.h},o.push(n)}return o}(t),o={bgOpacity:.8,galleryUID:t.getAttribute("data-pswp-uid"),getThumbBoundsFn:function(e){var t=a[e].el.children[0],n=window.pageYOffset||document.documentElement.scrollTop,i=t.getBoundingClientRect();return{x:i.left,y:i.top+n,w:i.width}},addCaptionHTMLFn:function(e,t,n){return e.title?(t.children[0].innerHTML=e.title+"<br/><small>Photo: "+e.author+"</small>",!0):(t.children[0].innerText="",!1)}},i)if(o.galleryPIDs){for(var l=0;l<a.length;l++)if(a[l].pid==e){o.index=l;break}}else o.index=parseInt(e,10)-1;else o.index=parseInt(e,10);if(!isNaN(o.index)){for(var u=document.getElementsByName("gallery-style"),c=0,h=u.length;c<h;c++)if(u[c].checked){"radio-all-controls"==u[c].id||"radio-minimal-black"==u[c].id&&(o.mainClass="pswp--minimal--dark",o.barsSize={top:0,bottom:0},o.captionEl=!1,o.fullscreenEl=!1,o.shareEl=!1,o.bgOpacity=.85,o.tapToClose=!1,o.tapToToggleControls=!0);break}n&&(o.showAnimationDuration=0),galleryItem(r=new PhotoSwipe(s,PhotoSwipeUI_Default,a,o)),r.listen("gettingData",function(e,t){useLargeImages?(t.src=t.o.src,t.w=t.o.w,t.h=t.o.h):(t.src=t.m.src,t.w=t.m.w,t.h=t.m.h)})}},i=document.querySelectorAll(e),r=0,o=i.length;r<o;r++)i[r].setAttribute("data-pswp-uid",r+1),i[r].onclick=t;var a=function(){var e=window.location.hash.substring(1),t={};if(e.length<5)return t;for(var n=e.split("&"),i=0;i<n.length;i++)if(n[i]){var r=n[i].split("=");r.length<2||(t[r[0]]=r[1])}return t.gid&&(t.gid=parseInt(t.gid,10)),t}();a.pid&&a.gid&&n(a.pid,i[a.gid-1],!0,!0)}("#justifiedGallery"),$("html.no-objectfit").length&&tkObjectFit();var resizeTimer,isNum=/([0-9]*\.)?[0-9]+/,nonDigits=/[^0-9\.]/g,nonInts=/[^0-9]/g,ints=/[0-9]/g,email_regx=/^[a-z0-9_\-\.]+@[a-z0-9_\-\.]+\.[a-z]+$/i,phone_regx=/^\(?[0-9]{3}\)?[\- \.]?[0-9]{3}[\- \.]?[0-9]{4}$/,blank_regx=/.+/i,date_regx=/^[0-1]?[0-9][\-\/\.][0-3]?[0-9][\-\/\.][1-2][0-9]{3}$/;function makeNumber(e,t,n){null==t&&(t=!1);var i=!0;if(null==n&&(n=1,i=!1),e=e.replace(nonDigits,""),!isNum.test(e)){var r=e.indexOf("."),o=e.indexOf(".",r+1);e=e.substring(0,o)}if(!t&&""==e)if(0==n)e="0";else for(e="0.",r=0;r<n;r++)e+="0";return i&&(e=(1*e).toFixed(n)),e}function numberFormat(e,t){for(x=(e+="").split("."),x1=x[0],x2=x.length>1?x[1].substring(0,t):"";x2.length<t;)x2+="0";""!=x2&&(x2="."+x2);for(var n=/(\d+)(\d{3})/;n.test(x1);)x1=x1.replace(n,"$1,$2");return x1+x2}function responsiveGreatSchools(e){if($(e)[0]){var t=$(e).attr("src"),n=t.match("width=(.*)&height");if(n=n[1],$(e).width()!=n){var i=t.replace(n,$(e).parent().width());$(e).attr("src",i)}}}function toggleRadio(e){var t='[name="'+$(e).attr("name")+'"]';$(t).each(function(){e=$(this).attr("data-toggle-radio"),$(this).prop("checked")?$('[data-toggle-radio-target="'+e+'"]').removeAttr("hidden"):$('[data-toggle-radio-target="'+e+'"]').attr("hidden","")})}function formatPrice(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return(e=e.toString()).length<=6&&1!==e.length?e=e.slice(0,-3)+",000":e.length<=9&&1!==e.length&&(e=e.slice(0,-6)+","+e.substr(e.length-6,e.length-4)+",000"),e}$('[data-steps="range"]').on("change mousemove touchmove",function(){var e=$(this).val();if($("html").hasClass("cssall")){var t=e/25e3,n=2.5*t;n=t>0&&t<=3?"calc("+n.toString()+"% + 3px)":t<=14?n.toString()+"%":t<=25?"calc("+n.toString()+"% - 5px)":"calc("+n.toString()+"% - 10px)",$(this).siblings(".custom-range-bg").css("width",n)}(e=e.toString()).length<=6&&1!==e.length?e=e.slice(0,-3)+",000":e.length>=7&&(e="1,000,000+"),$('[data-steps="price"]').text(e)}),responsiveGreatSchools("[data-name='greatschools']"),$(window).resize(function(){clearTimeout(resizeTimer),resizeTimer=setTimeout(responsiveGreatSchools("[data-name='greatschools']"),250)}),$("[data-toggle-radio]").change(function(){toggleRadio(this)}),window.onload=function(){setTimeout(function(){$('button.gm-control-active, .gm-iv-marker-icon, iframe[src*="https://www.facebook.com/v"]').attr("aria-label","gm-control-button"),$('img[src*="data:image"], img[alt=""]').attr("alt","Image")},600),setTimeout(function(){$('img[src*="data:image"], img[alt=""], img[src*="maps.gstatic"]').attr("alt","Image"),$('a[href*="www.google.com/maps"]').attr("aria-label","google")},2e3)};