<!doctype html><script>define=undefined</script><!-- @license Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --><script>// Copyright 2014 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. !function(a,b){var c={},d={},e={},f=null;!function(a,b){function c(a){if("number"==typeof a)return a;var b={};for(var c in a)b[c]=a[c];return b}function d(){this._delay=0,this._endDelay=0,this._fill="none",this._iterationStart=0,this._iterations=1,this._duration=0,this._playbackRate=1,this._direction="normal",this._easing="linear",this._easingFunction=w}function e(){return a.isDeprecated("Invalid timing inputs","2016-03-02","TypeError exceptions will be thrown instead.",!0)}function f(b,c,e){var f=new d;return c&&(f.fill="both",f.duration="auto"),"number"!=typeof b||isNaN(b)?void 0!==b&&Object.getOwnPropertyNames(b).forEach(function(c){if("auto"!=b[c]){if(("number"==typeof f[c]||"duration"==c)&&("number"!=typeof b[c]||isNaN(b[c])))return;if("fill"==c&&-1==u.indexOf(b[c]))return;if("direction"==c&&-1==v.indexOf(b[c]))return;if("playbackRate"==c&&1!==b[c]&&a.isDeprecated("AnimationEffectTiming.playbackRate","2014-11-28","Use Animation.playbackRate instead."))return;f[c]=b[c]}}):f.duration=b,f}function g(a){return"number"==typeof a&&(a=isNaN(a)?{duration:0}:{duration:a}),a}function h(b,c){return b=a.numericTimingToObject(b),f(b,c)}function i(a,b,c,d){return 0>a||a>1||0>c||c>1?w:function(e){function f(a,b,c){return 3*a*(1-c)*(1-c)*c+3*b*(1-c)*c*c+c*c*c}if(0==e||1==e)return e;for(var g=0,h=1;;){var i=(g+h)/2,j=f(a,c,i);if(Math.abs(e-j)<1e-4)return f(b,d,i);e>j?g=i:h=i}}}function j(a,b){return function(c){if(c>=1)return 1;var d=1/a;return c+=b*d,c-c%d}}function k(a){B||(B=document.createElement("div").style),B.animationTimingFunction="",B.animationTimingFunction=a;var b=B.animationTimingFunction;if(""==b&&e())throw new TypeError(a+" is not a valid value for easing");var c=D.exec(b);if(c)return i.apply(this,c.slice(1).map(Number));var d=E.exec(b);if(d)return j(Number(d[1]),{start:x,middle:y,end:z}[d[2]]);var f=A[b];return f?f:w}function l(a){return Math.abs(m(a)/a.playbackRate)}function m(a){return a.duration*a.iterations}function n(a,b,c){return null==b?F:b<c.delay?G:b>=c.delay+a?H:I}function o(a,b,c,d,e){switch(d){case G:return"backwards"==b||"both"==b?0:null;case I:return c-e;case H:return"forwards"==b||"both"==b?a:null;case F:return null}}function p(a,b,c,d){return(d.playbackRate<0?b-a:b)*d.playbackRate+c}function q(a,b,c,d,e){return c===1/0||c===-(1/0)||c-d==b&&e.iterations&&(e.iterations+e.iterationStart)%1==0?a:c%a}function r(a,b,c,d){return 0===c?0:b==a?d.iterationStart+d.iterations-1:Math.floor(c/a)}function s(a,b,c,d){var e=a%2>=1,f="normal"==d.direction||d.direction==(e?"alternate-reverse":"alternate"),g=f?c:b-c,h=g/b;return b*d._easingFunction(h)}function t(a,b,c){var d=n(a,b,c),e=o(a,c.fill,b,d,c.delay);if(null===e)return null;if(0===a)return d===G?0:1;var f=c.iterationStart*c.duration,g=p(a,e,f,c),h=q(c.duration,m(c),g,f,c),i=r(c.duration,h,g,c);return s(i,c.duration,h,c)/c.duration}var u="backwards|forwards|both|none".split("|"),v="reverse|alternate|alternate-reverse".split("|"),w=function(a){return a};d.prototype={_setMember:function(b,c){this["_"+b]=c,this._effect&&(this._effect._timingInput[b]=c,this._effect._timing=a.normalizeTimingInput(this._effect._timingInput),this._effect.activeDuration=a.calculateActiveDuration(this._effect._timing),this._effect._animation&&this._effect._animation._rebuildUnderlyingAnimation())},get playbackRate(){return this._playbackRate},set delay(a){this._setMember("delay",a)},get delay(){return this._delay},set endDelay(a){this._setMember("endDelay",a)},get endDelay(){return this._endDelay},set fill(a){this._setMember("fill",a)},get fill(){return this._fill},set iterationStart(a){if((isNaN(a)||0>a)&&e())throw new TypeError("iterationStart must be a non-negative number, received: "+timing.iterationStart);this._setMember("iterationStart",a)},get iterationStart(){return this._iterationStart},set duration(a){if("auto"!=a&&(isNaN(a)||0>a)&&e())throw new TypeError("duration must be non-negative or auto, received: "+a);this._setMember("duration",a)},get duration(){return this._duration},set direction(a){this._setMember("direction",a)},get direction(){return this._direction},set easing(a){this._easingFunction=k(a),this._setMember("easing",a)},get easing(){return this._easing},set iterations(a){if((isNaN(a)||0>a)&&e())throw new TypeError("iterations must be non-negative, received: "+a);this._setMember("iterations",a)},get iterations(){return this._iterations}};var x=1,y=.5,z=0,A={ease:i(.25,.1,.25,1),"ease-in":i(.42,0,1,1),"ease-out":i(0,0,.58,1),"ease-in-out":i(.42,0,.58,1),"step-start":j(1,x),"step-middle":j(1,y),"step-end":j(1,z)},B=null,C="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",D=new RegExp("cubic-bezier\\("+C+","+C+","+C+","+C+"\\)"),E=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/,F=0,G=1,H=2,I=3;a.cloneTimingInput=c,a.makeTiming=f,a.numericTimingToObject=g,a.normalizeTimingInput=h,a.calculateActiveDuration=l,a.calculateTimeFraction=t,a.calculatePhase=n,a.toTimingFunction=k}(c,f),function(a,b){function c(a,b){return a in j?j[a][b]||b:b}function d(a,b,d){var e=g[a];if(e){h.style[a]=b;for(var f in e){var i=e[f],j=h.style[i];d[i]=c(i,j)}}else d[a]=c(a,b)}function e(a){var b=[];for(var c in a)if(!(c in["easing","offset","composite"])){var d=a[c];Array.isArray(d)||(d=[d]);for(var e,f=d.length,g=0;f>g;g++)e={},"offset"in a?e.offset=a.offset:1==f?e.offset=1:e.offset=g/(f-1),"easing"in a&&(e.easing=a.easing),"composite"in a&&(e.composite=a.composite),e[c]=d[g],b.push(e)}return b.sort(function(a,b){return a.offset-b.offset}),b}function f(a){function b(){var a=c.length;null==c[a-1].offset&&(c[a-1].offset=1),a>1&&null==c[0].offset&&(c[0].offset=0);for(var b=0,d=c[0].offset,e=1;a>e;e++){var f=c[e].offset;if(null!=f){for(var g=1;e-b>g;g++)c[b+g].offset=d+(f-d)*g/(e-b);b=e,d=f}}}if(null==a)return[];window.Symbol&&Symbol.iterator&&Array.prototype.from&&a[Symbol.iterator]&&(a=Array.from(a)),Array.isArray(a)||(a=e(a));for(var c=a.map(function(a){var b={};for(var c in a){var e=a[c];if("offset"==c){if(null!=e&&(e=Number(e),!isFinite(e)))throw new TypeError("keyframe offsets must be numbers.")}else{if("composite"==c)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"add compositing is not supported"};e=""+e}d(c,e,b)}return void 0==b.offset&&(b.offset=null),b}),f=!0,g=-(1/0),h=0;h<c.length;h++){var i=c[h].offset;if(null!=i){if(g>i)throw{code:DOMException.INVALID_MODIFICATION_ERR,name:"InvalidModificationError",message:"Keyframes are not loosely sorted by offset. Sort or specify offsets."};g=i}else f=!1}return c=c.filter(function(a){return a.offset>=0&&a.offset<=1}),f||b(),c}var g={background:["backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat","backgroundAttachment","backgroundOrigin","backgroundClip","backgroundColor"],border:["borderTopColor","borderTopStyle","borderTopWidth","borderRightColor","borderRightStyle","borderRightWidth","borderBottomColor","borderBottomStyle","borderBottomWidth","borderLeftColor","borderLeftStyle","borderLeftWidth"],borderBottom:["borderBottomWidth","borderBottomStyle","borderBottomColor"],borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderLeft:["borderLeftWidth","borderLeftStyle","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderRight:["borderRightWidth","borderRightStyle","borderRightColor"],borderTop:["borderTopWidth","borderTopStyle","borderTopColor"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],flex:["flexGrow","flexShrink","flexBasis"],font:["fontFamily","fontSize","fontStyle","fontVariant","fontWeight","lineHeight"],margin:["marginTop","marginRight","marginBottom","marginLeft"],outline:["outlineColor","outlineStyle","outlineWidth"],padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},h=document.createElementNS("http://www.w3.org/1999/xhtml","div"),i={thin:"1px",medium:"3px",thick:"5px"},j={borderBottomWidth:i,borderLeftWidth:i,borderRightWidth:i,borderTopWidth:i,fontSize:{"xx-small":"60%","x-small":"75%",small:"89%",medium:"100%",large:"120%","x-large":"150%","xx-large":"200%"},fontWeight:{normal:"400",bold:"700"},outlineWidth:i,textShadow:{none:"0px 0px 0px transparent"},boxShadow:{none:"0px 0px 0px 0px transparent"}};a.convertToArrayForm=e,a.normalizeKeyframes=f}(c,f),function(a){var b={};a.isDeprecated=function(a,c,d,e){var f=e?"are":"is",g=new Date,h=new Date(c);return h.setMonth(h.getMonth()+3),h>g?(a in b||console.warn("Web Animations: "+a+" "+f+" deprecated and will stop working on "+h.toDateString()+". "+d),b[a]=!0,!1):!0},a.deprecated=function(b,c,d,e){var f=e?"are":"is";if(a.isDeprecated(b,c,d,e))throw new Error(b+" "+f+" no longer supported. "+d)}}(c),function(){if(document.documentElement.animate){var a=document.documentElement.animate([],0),b=!0;if(a&&(b=!1,"play|currentTime|pause|reverse|playbackRate|cancel|finish|startTime|playState".split("|").forEach(function(c){void 0===a[c]&&(b=!0)})),!b)return}!function(a,b,c){function d(a){for(var b={},c=0;c<a.length;c++)for(var d in a[c])if("offset"!=d&&"easing"!=d&&"composite"!=d){var e={offset:a[c].offset,easing:a[c].easing,value:a[c][d]};b[d]=b[d]||[],b[d].push(e)}for(var f in b){var g=b[f];if(0!=g[0].offset||1!=g[g.length-1].offset)throw{type:DOMException.NOT_SUPPORTED_ERR,name:"NotSupportedError",message:"Partial keyframes are not supported"}}return b}function e(c){var d=[];for(var e in c)for(var f=c[e],g=0;g<f.length-1;g++){var h=f[g].offset,i=f[g+1].offset,j=f[g].value,k=f[g+1].value,l=f[g].easing;h==i&&(1==i?j=k:k=j),d.push({startTime:h,endTime:i,easing:a.toTimingFunction(l?l:"linear"),property:e,interpolation:b.propertyInterpolation(e,j,k)})}return d.sort(function(a,b){return a.startTime-b.startTime}),d}b.convertEffectInput=function(c){var f=a.normalizeKeyframes(c),g=d(f),h=e(g);return function(a,c){if(null!=c)h.filter(function(a){return 0>=c&&0==a.startTime||c>=1&&1==a.endTime||c>=a.startTime&&c<=a.endTime}).forEach(function(d){var e=c-d.startTime,f=d.endTime-d.startTime,g=0==f?0:d.easing(e/f);b.apply(a,d.property,d.interpolation(g))});else for(var d in g)"offset"!=d&&"easing"!=d&&"composite"!=d&&b.clear(a,d)}}}(c,d,f),function(a,b,c){function d(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function e(a,b,c){h[c]=h[c]||[],h[c].push([a,b])}function f(a,b,c){for(var f=0;f<c.length;f++){var g=c[f];e(a,b,d(g))}}function g(c,e,f){var g=c;/-/.test(c)&&!a.isDeprecated("Hyphenated property names","2016-03-22","Use camelCase instead.",!0)&&(g=d(c)),"initial"!=e&&"initial"!=f||("initial"==e&&(e=i[g]),"initial"==f&&(f=i[g]));for(var j=e==f?[]:h[g],k=0;j&&k<j.length;k++){var l=j[k][0](e),m=j[k][0](f);if(void 0!==l&&void 0!==m){var n=j[k][1](l,m);if(n){var o=b.Interpolation.apply(null,n);return function(a){return 0==a?e:1==a?f:o(a)}}}}return b.Interpolation(!1,!0,function(a){return a?f:e})}var h={};b.addPropertiesHandler=f;var i={backgroundColor:"transparent",backgroundPosition:"0% 0%",borderBottomColor:"currentColor",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderBottomWidth:"3px",borderLeftColor:"currentColor",borderLeftWidth:"3px",borderRightColor:"currentColor",borderRightWidth:"3px",borderSpacing:"2px",borderTopColor:"currentColor",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderTopWidth:"3px",bottom:"auto",clip:"rect(0px, 0px, 0px, 0px)",color:"black",fontSize:"100%",fontWeight:"400",height:"auto",left:"auto",letterSpacing:"normal",lineHeight:"120%",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",marginTop:"0px",maxHeight:"none",maxWidth:"none",minHeight:"0px",minWidth:"0px",opacity:"1.0",outlineColor:"invert",outlineOffset:"0px",outlineWidth:"3px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",paddingTop:"0px",right:"auto",textIndent:"0px",textShadow:"0px 0px 0px transparent",top:"auto",transform:"",verticalAlign:"0px",visibility:"visible",width:"auto",wordSpacing:"normal",zIndex:"auto"};b.propertyInterpolation=g}(c,d,f),function(a,b,c){function d(b){var c=a.calculateActiveDuration(b),d=function(d){return a.calculateTimeFraction(c,d,b)};return d._totalDuration=b.delay+c+b.endDelay,d._isCurrent=function(d){var e=a.calculatePhase(c,d,b);return e===PhaseActive||e===PhaseBefore},d}b.KeyframeEffect=function(c,e,f,g){var h,i=d(a.normalizeTimingInput(f)),j=b.convertEffectInput(e),k=function(){j(c,h)};return k._update=function(a){return h=i(a),null!==h},k._clear=function(){j(c,null)},k._hasSameTarget=function(a){return c===a},k._isCurrent=i._isCurrent,k._totalDuration=i._totalDuration,k._id=g,k},b.NullEffect=function(a){var b=function(){a&&(a(),a=null)};return b._update=function(){return null},b._totalDuration=0,b._isCurrent=function(){return!1},b._hasSameTarget=function(){return!1},b}}(c,d,f),function(a,b){a.apply=function(b,c,d){b.style[a.propertyName(c)]=d},a.clear=function(b,c){b.style[a.propertyName(c)]=""}}(d,f),function(a){window.Element.prototype.animate=function(b,c){var d="";return c&&c.id&&(d=c.id),a.timeline._play(a.KeyframeEffect(this,b,c,d))}}(d),function(a,b){function c(a,b,d){if("number"==typeof a&&"number"==typeof b)return a*(1-d)+b*d;if("boolean"==typeof a&&"boolean"==typeof b)return.5>d?a:b;if(a.length==b.length){for(var e=[],f=0;f<a.length;f++)e.push(c(a[f],b[f],d));return e}throw"Mismatched interpolation arguments "+a+":"+b}a.Interpolation=function(a,b,d){return function(e){return d(c(a,b,e))}}}(d,f),function(a,b,c){a.sequenceNumber=0;var d=function(a,b,c){this.target=a,this.currentTime=b,this.timelineTime=c,this.type="finish",this.bubbles=!1,this.cancelable=!1,this.currentTarget=a,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()};b.Animation=function(b){this.id="",b&&b._id&&(this.id=b._id),this._sequenceNumber=a.sequenceNumber++,this._currentTime=0,this._startTime=null,this._paused=!1,this._playbackRate=1,this._inTimeline=!0,this._finishedFlag=!0,this.onfinish=null,this._finishHandlers=[],this._effect=b,this._inEffect=this._effect._update(0),this._idle=!0,this._currentTimePending=!1},b.Animation.prototype={_ensureAlive:function(){this.playbackRate<0&&0===this.currentTime?this._inEffect=this._effect._update(-1):this._inEffect=this._effect._update(this.currentTime),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,b.timeline._animations.push(this))},_tickCurrentTime:function(a,b){a!=this._currentTime&&(this._currentTime=a,this._isFinished&&!b&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this._ensureAlive())},get currentTime(){return this._idle||this._currentTimePending?null:this._currentTime},set currentTime(a){a=+a,isNaN(a)||(b.restart(),this._paused||null==this._startTime||(this._startTime=this._timeline.currentTime-a/this._playbackRate),this._currentTimePending=!1,this._currentTime!=a&&(this._tickCurrentTime(a,!0),b.invalidateEffects()))},get startTime(){return this._startTime},set startTime(a){a=+a,isNaN(a)||this._paused||this._idle||(this._startTime=a,this._tickCurrentTime((this._timeline.currentTime-this._startTime)*this.playbackRate),b.invalidateEffects())},get playbackRate(){return this._playbackRate},set playbackRate(a){if(a!=this._playbackRate){var b=this.currentTime;this._playbackRate=a,this._startTime=null,"paused"!=this.playState&&"idle"!=this.playState&&this.play(),null!=b&&(this.currentTime=b)}},get _isFinished(){return!this._idle&&(this._playbackRate>0&&this._currentTime>=this._totalDuration||this._playbackRate<0&&this._currentTime<=0)},get _totalDuration(){return this._effect._totalDuration},get playState(){return this._idle?"idle":null==this._startTime&&!this._paused&&0!=this.playbackRate||this._currentTimePending?"pending":this._paused?"paused":this._isFinished?"finished":"running"},play:function(){this._paused=!1,(this._isFinished||this._idle)&&(this._currentTime=this._playbackRate>0?0:this._totalDuration,this._startTime=null),this._finishedFlag=!1,this._idle=!1,this._ensureAlive(),b.invalidateEffects()},pause:function(){this._isFinished||this._paused||this._idle||(this._currentTimePending=!0),this._startTime=null,this._paused=!0},finish:function(){this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this._currentTimePending=!1,b.invalidateEffects())},cancel:function(){this._inEffect&&(this._inEffect=!1,this._idle=!0,this._finishedFlag=!0,this.currentTime=0,this._startTime=null,this._effect._update(null),b.invalidateEffects())},reverse:function(){this.playbackRate*=-1,this.play()},addEventListener:function(a,b){"function"==typeof b&&"finish"==a&&this._finishHandlers.push(b)},removeEventListener:function(a,b){if("finish"==a){var c=this._finishHandlers.indexOf(b);c>=0&&this._finishHandlers.splice(c,1)}},_fireEvents:function(a){if(this._isFinished){if(!this._finishedFlag){var b=new d(this,this._currentTime,a),c=this._finishHandlers.concat(this.onfinish?[this.onfinish]:[]);setTimeout(function(){c.forEach(function(a){a.call(b.target,b)})},0),this._finishedFlag=!0}}else this._finishedFlag=!1},_tick:function(a,b){this._idle||this._paused||(null==this._startTime?b&&(this.startTime=a-this._currentTime/this.playbackRate):this._isFinished||this._tickCurrentTime((a-this._startTime)*this.playbackRate)),b&&(this._currentTimePending=!1,this._fireEvents(a))},get _needsTick(){return this.playState in{pending:1,running:1}||!this._finishedFlag}}}(c,d,f),function(a,b,c){function d(a){var b=j;j=[],a<p.currentTime&&(a=p.currentTime),h(a,!0),b.forEach(function(b){b[1](a)}),g(),l=void 0}function e(a,b){return a._sequenceNumber-b._sequenceNumber}function f(){this._animations=[],this.currentTime=window.performance&&performance.now?performance.now():0}function g(){o.forEach(function(a){a()}),o.length=0}function h(a,c){n=!1;var d=b.timeline;d.currentTime=a,d._animations.sort(e),m=!1;var f=d._animations;d._animations=[];var g=[],h=[];f=f.filter(function(b){b._tick(a,c),b._inEffect?h.push(b._effect):g.push(b._effect),b._needsTick&&(m=!0);var d=b._inEffect||b._needsTick;return b._inTimeline=d,d}),o.push.apply(o,g),o.push.apply(o,h),d._animations.push.apply(d._animations,f),m&&requestAnimationFrame(function(){})}var i=window.requestAnimationFrame,j=[],k=0;window.requestAnimationFrame=function(a){var b=k++;return 0==j.length&&i(d),j.push([b,a]),b},window.cancelAnimationFrame=function(a){j.forEach(function(b){b[0]==a&&(b[1]=function(){})})},f.prototype={_play:function(c){c._timing=a.normalizeTimingInput(c.timing);var d=new b.Animation(c);return d._idle=!1,d._timeline=this,this._animations.push(d),b.restart(),b.invalidateEffects(),d}};var l=void 0,m=!1,n=!1;b.restart=function(){return m||(m=!0,requestAnimationFrame(function(){}),n=!0),n},b.invalidateEffects=function(){h(b.timeline.currentTime,!1),g()};var o=[],p=new f;b.timeline=p}(c,d,f),function(a){function b(a,b){var c=a.exec(b);return c?(c=a.ignoreCase?c[0].toLowerCase():c[0],[c,b.substr(c.length)]):void 0}function c(a,b){b=b.replace(/^\s*/,"");var c=a(b);return c?[c[0],c[1].replace(/^\s*/,"")]:void 0}function d(a,d,e){a=c.bind(null,a);for(var f=[];;){var g=a(e);if(!g)return[f,e];if(f.push(g[0]),e=g[1],g=b(d,e),!g||""==g[1])return[f,e];e=g[1]}}function e(a,b){for(var c=0,d=0;d<b.length&&(!/\s|,/.test(b[d])||0!=c);d++)if("("==b[d])c++;else if(")"==b[d]&&(c--,0==c&&d++,0>=c))break;var e=a(b.substr(0,d));return void 0==e?void 0:[e,b.substr(d)]}function f(a,b){for(var c=a,d=b;c&&d;)c>d?c%=d:d%=c;return c=a*b/(c+d)}function g(a){return function(b){var c=a(b);return c&&(c[0]=void 0),c}}function h(a,b){return function(c){var d=a(c);return d?d:[b,c]}}function i(b,c){for(var d=[],e=0;e<b.length;e++){var f=a.consumeTrimmed(b[e],c);if(!f||""==f[0])return;void 0!==f[0]&&d.push(f[0]),c=f[1]}return""==c?d:void 0}function j(a,b,c,d,e){for(var g=[],h=[],i=[],j=f(d.length,e.length),k=0;j>k;k++){var l=b(d[k%d.length],e[k%e.length]);if(!l)return;g.push(l[0]),h.push(l[1]),i.push(l[2])}return[g,h,function(b){var d=b.map(function(a,b){return i[b](a)}).join(c);return a?a(d):d}]}function k(a,b,c){for(var d=[],e=[],f=[],g=0,h=0;h<c.length;h++)if("function"==typeof c[h]){var i=c[h](a[g],b[g++]);d.push(i[0]),e.push(i[1]),f.push(i[2])}else!function(a){d.push(!1),e.push(!1),f.push(function(){return c[a]})}(h);return[d,e,function(a){for(var b="",c=0;c<a.length;c++)b+=f[c](a[c]);return b}]}a.consumeToken=b,a.consumeTrimmed=c,a.consumeRepeated=d,a.consumeParenthesised=e,a.ignore=g,a.optional=h,a.consumeList=i,a.mergeNestedRepeated=j.bind(null,null),a.mergeWrappedNestedRepeated=j,a.mergeList=k}(d),function(a){function b(b){function c(b){var c=a.consumeToken(/^inset/i,b);if(c)return d.inset=!0,c;var c=a.consumeLengthOrPercent(b);if(c)return d.lengths.push(c[0]),c;var c=a.consumeColor(b);return c?(d.color=c[0],c):void 0}var d={inset:!1,lengths:[],color:null},e=a.consumeRepeated(c,/^/,b);return e&&e[0].length?[d,e[1]]:void 0}function c(c){var d=a.consumeRepeated(b,/^,/,c);return d&&""==d[1]?d[0]:void 0}function d(b,c){for(;b.lengths.length<Math.max(b.lengths.length,c.lengths.length);)b.lengths.push({px:0});for(;c.lengths.length<Math.max(b.lengths.length,c.lengths.length);)c.lengths.push({px:0});if(b.inset==c.inset&&!!b.color==!!c.color){for(var d,e=[],f=[[],0],g=[[],0],h=0;h<b.lengths.length;h++){var i=a.mergeDimensions(b.lengths[h],c.lengths[h],2==h);f[0].push(i[0]),g[0].push(i[1]),e.push(i[2])}if(b.color&&c.color){var j=a.mergeColors(b.color,c.color);f[1]=j[0],g[1]=j[1],d=j[2]}return[f,g,function(a){for(var c=b.inset?"inset ":" ",f=0;f<e.length;f++)c+=e[f](a[0][f])+" ";return d&&(c+=d(a[1])),c}]}}function e(b,c,d,e){function f(a){return{inset:a,color:[0,0,0,0],lengths:[{px:0},{px:0},{px:0},{px:0}]}}for(var g=[],h=[],i=0;i<d.length||i<e.length;i++){var j=d[i]||f(e[i].inset),k=e[i]||f(d[i].inset);g.push(j),h.push(k)}return a.mergeNestedRepeated(b,c,g,h)}var f=e.bind(null,d,", ");a.addPropertiesHandler(c,f,["box-shadow","text-shadow"])}(d),function(a,b){function c(a){return a.toFixed(3).replace(".000","")}function d(a,b,c){return Math.min(b,Math.max(a,c))}function e(a){return/^\s*[-+]?(\d*\.)?\d+\s*$/.test(a)?Number(a):void 0}function f(a,b){return[a,b,c]}function g(a,b){return 0!=a?i(0,1/0)(a,b):void 0}function h(a,b){return[a,b,function(a){return Math.round(d(1,1/0,a))}]}function i(a,b){return function(e,f){return[e,f,function(e){return c(d(a,b,e))}]}}function j(a,b){return[a,b,Math.round]}a.clamp=d,a.addPropertiesHandler(e,i(0,1/0),["border-image-width","line-height"]),a.addPropertiesHandler(e,i(0,1),["opacity","shape-image-threshold"]),a.addPropertiesHandler(e,g,["flex-grow","flex-shrink"]),a.addPropertiesHandler(e,h,["orphans","widows"]),a.addPropertiesHandler(e,j,["z-index"]),a.parseNumber=e,a.mergeNumbers=f,a.numberToString=c}(d,f),function(a,b){function c(a,b){return"visible"==a||"visible"==b?[0,1,function(c){return 0>=c?a:c>=1?b:"visible"}]:void 0}a.addPropertiesHandler(String,c,["visibility"])}(d),function(a,b){function c(a){a=a.trim(),f.fillStyle="#000",f.fillStyle=a;var b=f.fillStyle;if(f.fillStyle="#fff",f.fillStyle=a,b==f.fillStyle){f.fillRect(0,0,1,1);var c=f.getImageData(0,0,1,1).data;f.clearRect(0,0,1,1);var d=c[3]/255;return[c[0]*d,c[1]*d,c[2]*d,d]}}function d(b,c){return[b,c,function(b){function c(a){return Math.max(0,Math.min(255,a))}if(b[3])for(var d=0;3>d;d++)b[d]=Math.round(c(b[d]/b[3]));return b[3]=a.numberToString(a.clamp(0,1,b[3])),"rgba("+b.join(",")+")"}]}var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");e.width=e.height=1;var f=e.getContext("2d");a.addPropertiesHandler(c,d,["background-color","border-bottom-color","border-left-color","border-right-color","border-top-color","color","outline-color","text-decoration-color"]),a.consumeColor=a.consumeParenthesised.bind(null,c),a.mergeColors=d}(d,f),function(a,b){function c(a,b){if(b=b.trim().toLowerCase(),"0"==b&&"px".search(a)>=0)return{px:0};if(/^[^(]*$|^calc/.test(b)){b=b.replace(/calc\(/g,"(");var c={};b=b.replace(a,function(a){return c[a]=null,"U"+a});for(var d="U("+a.source+")",e=b.replace(/[-+]?(\d*\.)?\d+/g,"N").replace(new RegExp("N"+d,"g"),"D").replace(/\s[+-]\s/g,"O").replace(/\s/g,""),f=[/N\*(D)/g,/(N|D)[*\/]N/g,/(N|D)O\1/g,/\((N|D)\)/g],g=0;g<f.length;)f[g].test(e)?(e=e.replace(f[g],"$1"),g=0):g++;if("D"==e){for(var h in c){var i=eval(b.replace(new RegExp("U"+h,"g"),"").replace(new RegExp(d,"g"),"*0"));if(!isFinite(i))return;c[h]=i}return c}}}function d(a,b){return e(a,b,!0)}function e(b,c,d){var e,f=[];for(e in b)f.push(e);for(e in c)f.indexOf(e)<0&&f.push(e);return b=f.map(function(a){return b[a]||0}),c=f.map(function(a){return c[a]||0}),[b,c,function(b){var c=b.map(function(c,e){return 1==b.length&&d&&(c=Math.max(c,0)),a.numberToString(c)+f[e]}).join(" + ");return b.length>1?"calc("+c+")":c}]}var f="px|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc",g=c.bind(null,new RegExp(f,"g")),h=c.bind(null,new RegExp(f+"|%","g")),i=c.bind(null,/deg|rad|grad|turn/g);a.parseLength=g,a.parseLengthOrPercent=h,a.consumeLengthOrPercent=a.consumeParenthesised.bind(null,h),a.parseAngle=i,a.mergeDimensions=e;var j=a.consumeParenthesised.bind(null,g),k=a.consumeRepeated.bind(void 0,j,/^/),l=a.consumeRepeated.bind(void 0,k,/^,/);a.consumeSizePairList=l;var m=function(a){var b=l(a);return b&&""==b[1]?b[0]:void 0},n=a.mergeNestedRepeated.bind(void 0,d," "),o=a.mergeNestedRepeated.bind(void 0,n,",");a.mergeNonNegativeSizePair=n,a.addPropertiesHandler(m,o,["background-size"]),a.addPropertiesHandler(h,d,["border-bottom-width","border-image-width","border-left-width","border-right-width","border-top-width","flex-basis","font-size","height","line-height","max-height","max-width","outline-width","width"]),a.addPropertiesHandler(h,e,["border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","bottom","left","letter-spacing","margin-bottom","margin-left","margin-right","margin-top","min-height","min-width","outline-offset","padding-bottom","padding-left","padding-right","padding-top","perspective","right","shape-margin","text-indent","top","vertical-align","word-spacing"])}(d,f),function(a,b){function c(b){return a.consumeLengthOrPercent(b)||a.consumeToken(/^auto/,b)}function d(b){var d=a.consumeList([a.ignore(a.consumeToken.bind(null,/^rect/)),a.ignore(a.consumeToken.bind(null,/^\(/)),a.consumeRepeated.bind(null,c,/^,/),a.ignore(a.consumeToken.bind(null,/^\)/))],b);return d&&4==d[0].length?d[0]:void 0}function e(b,c){return"auto"==b||"auto"==c?[!0,!1,function(d){var e=d?b:c;if("auto"==e)return"auto";var f=a.mergeDimensions(e,e);return f[2](f[0])}]:a.mergeDimensions(b,c)}function f(a){return"rect("+a+")"}var g=a.mergeWrappedNestedRepeated.bind(null,f,e,", ");a.parseBox=d,a.mergeBoxes=g,a.addPropertiesHandler(d,g,["clip"])}(d,f),function(a,b){function c(a){return function(b){var c=0;return a.map(function(a){return a===k?b[c++]:a})}}function d(a){return a}function e(b){if(b=b.toLowerCase().trim(),"none"==b)return[];for(var c,d=/\s*(\w+)\(([^)]*)\)/g,e=[],f=0;c=d.exec(b);){if(c.index!=f)return;f=c.index+c[0].length;var g=c[1],h=n[g];if(!h)return;var i=c[2].split(","),j=h[0];if(j.length<i.length)return;for(var k=[],o=0;o<j.length;o++){var p,q=i[o],r=j[o];if(p=q?{A:function(b){return"0"==b.trim()?m:a.parseAngle(b)},N:a.parseNumber,T:a.parseLengthOrPercent,L:a.parseLength}[r.toUpperCase()](q):{a:m,n:k[0],t:l}[r],void 0===p)return;k.push(p)}if(e.push({t:g,d:k}),d.lastIndex==b.length)return e}}function f(a){return a.toFixed(6).replace(".000000","")}function g(b,c){if(b.decompositionPair!==c){b.decompositionPair=c;var d=a.makeMatrixDecomposition(b)}if(c.decompositionPair!==b){c.decompositionPair=b;var e=a.makeMatrixDecomposition(c)}return null==d[0]||null==e[0]?[[!1],[!0],function(a){return a?c[0].d:b[0].d}]:(d[0].push(0),e[0].push(1),[d,e,function(b){var c=a.quat(d[0][3],e[0][3],b[5]),g=a.composeMatrix(b[0],b[1],b[2],c,b[4]),h=g.map(f).join(",");return h}])}function h(a){return a.replace(/[xy]/,"")}function i(a){return a.replace(/(x|y|z|3d)?$/,"3d")}function j(b,c){var d=a.makeMatrixDecomposition&&!0,e=!1;if(!b.length||!c.length){b.length||(e=!0,b=c,c=[]);for(var f=0;f<b.length;f++){var j=b[f].t,k=b[f].d,l="scale"==j.substr(0,5)?1:0;c.push({t:j,d:k.map(function(a){if("number"==typeof a)return l;var b={};for(var c in a)b[c]=l;return b})})}}var m=function(a,b){return"perspective"==a&&"perspective"==b||("matrix"==a||"matrix3d"==a)&&("matrix"==b||"matrix3d"==b)},o=[],p=[],q=[];if(b.length!=c.length){if(!d)return;var r=g(b,c);o=[r[0]],p=[r[1]],q=[["matrix",[r[2]]]]}else for(var f=0;f<b.length;f++){var j,s=b[f].t,t=c[f].t,u=b[f].d,v=c[f].d,w=n[s],x=n[t];if(m(s,t)){if(!d)return;var r=g([b[f]],[c[f]]);o.push(r[0]),p.push(r[1]),q.push(["matrix",[r[2]]])}else{if(s==t)j=s;else if(w[2]&&x[2]&&h(s)==h(t))j=h(s),u=w[2](u),v=x[2](v);else{if(!w[1]||!x[1]||i(s)!=i(t)){if(!d)return;var r=g(b,c);o=[r[0]],p=[r[1]],q=[["matrix",[r[2]]]];break}j=i(s),u=w[1](u),v=x[1](v)}for(var y=[],z=[],A=[],B=0;B<u.length;B++){var C="number"==typeof u[B]?a.mergeNumbers:a.mergeDimensions,r=C(u[B],v[B]);y[B]=r[0],z[B]=r[1],A.push(r[2])}o.push(y),p.push(z),q.push([j,A])}}if(e){var D=o;o=p,p=D}return[o,p,function(a){return a.map(function(a,b){var c=a.map(function(a,c){return q[b][1][c](a)}).join(",");return"matrix"==q[b][0]&&16==c.split(",").length&&(q[b][0]="matrix3d"),q[b][0]+"("+c+")"}).join(" ")}]}var k=null,l={px:0},m={deg:0},n={matrix:["NNNNNN",[k,k,0,0,k,k,0,0,0,0,1,0,k,k,0,1],d],matrix3d:["NNNNNNNNNNNNNNNN",d],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",c([k,k,1]),d],scalex:["N",c([k,1,1]),c([k,1])],scaley:["N",c([1,k,1]),c([1,k])],scalez:["N",c([1,1,k])],scale3d:["NNN",d],skew:["Aa",null,d],skewx:["A",null,c([k,m])],skewy:["A",null,c([m,k])],translate:["Tt",c([k,k,l]),d],translatex:["T",c([k,l,l]),c([k,l])],translatey:["T",c([l,k,l]),c([l,k])],translatez:["L",c([l,l,k])],translate3d:["TTL",d]};a.addPropertiesHandler(e,j,["transform"])}(d,f),function(a,b){function c(a,b){b.concat([a]).forEach(function(b){b in document.documentElement.style&&(d[a]=b)})}var d={};c("transform",["webkitTransform","msTransform"]),c("transformOrigin",["webkitTransformOrigin"]),c("perspective",["webkitPerspective"]),c("perspectiveOrigin",["webkitPerspectiveOrigin"]),a.propertyName=function(a){return d[a]||a}}(d,f)}(),!function(){if(void 0===document.createElement("div").animate([]).oncancel){var a;if(window.performance&&performance.now)var a=function(){return performance.now()};else var a=function(){return Date.now()};var b=function(a,b,c){this.target=a,this.currentTime=b,this.timelineTime=c,this.type="cancel",this.bubbles=!1,this.cancelable=!1,this.currentTarget=a,this.defaultPrevented=!1,this.eventPhase=Event.AT_TARGET,this.timeStamp=Date.now()},c=window.Element.prototype.animate;window.Element.prototype.animate=function(d,e){var f=c.call(this,d,e);f._cancelHandlers=[],f.oncancel=null;var g=f.cancel;f.cancel=function(){g.call(this);var c=new b(this,null,a()),d=this._cancelHandlers.concat(this.oncancel?[this.oncancel]:[]);setTimeout(function(){d.forEach(function(a){a.call(c.target,c)})},0)};var h=f.addEventListener;f.addEventListener=function(a,b){"function"==typeof b&&"cancel"==a?this._cancelHandlers.push(b):h.call(this,a,b)};var i=f.removeEventListener;return f.removeEventListener=function(a,b){if("cancel"==a){var c=this._cancelHandlers.indexOf(b);c>=0&&this._cancelHandlers.splice(c,1)}else i.call(this,a,b)},f}}}(),function(a){var b=document.documentElement,c=null,d=!1;try{var e=getComputedStyle(b).getPropertyValue("opacity"),f="0"==e?"1":"0";c=b.animate({opacity:[f,f]},{duration:1}),c.currentTime=0,d=getComputedStyle(b).getPropertyValue("opacity")==f}catch(g){}finally{c&&c.cancel()}if(!d){var h=window.Element.prototype.animate;window.Element.prototype.animate=function(b,c){return window.Symbol&&Symbol.iterator&&Array.prototype.from&&b[Symbol.iterator]&&(b=Array.from(b)),Array.isArray(b)||null===b||(b=a.convertToArrayForm(b)),h.call(this,b,c)}}}(c),!function(a,b,c){function d(a){var b=window.document.timeline;b.currentTime=a,b._discardAnimations(),0==b._animations.length?f=!1:requestAnimationFrame(d); }var e=window.requestAnimationFrame;window.requestAnimationFrame=function(a){return e(function(b){window.document.timeline._updateAnimationsPromises(),a(b),window.document.timeline._updateAnimationsPromises()})},b.AnimationTimeline=function(){this._animations=[],this.currentTime=void 0},b.AnimationTimeline.prototype={getAnimations:function(){return this._discardAnimations(),this._animations.slice()},_updateAnimationsPromises:function(){b.animationsWithPromises=b.animationsWithPromises.filter(function(a){return a._updatePromises()})},_discardAnimations:function(){this._updateAnimationsPromises(),this._animations=this._animations.filter(function(a){return"finished"!=a.playState&&"idle"!=a.playState})},_play:function(a){var c=new b.Animation(a,this);return this._animations.push(c),b.restartWebAnimationsNextTick(),c._updatePromises(),c._animation.play(),c._updatePromises(),c},play:function(a){return a&&a.remove(),this._play(a)}};var f=!1;b.restartWebAnimationsNextTick=function(){f||(f=!0,requestAnimationFrame(d))};var g=new b.AnimationTimeline;b.timeline=g;try{Object.defineProperty(window.document,"timeline",{configurable:!0,get:function(){return g}})}catch(h){}try{window.document.timeline=g}catch(h){}}(c,e,f),function(a,b,c){b.animationsWithPromises=[],b.Animation=function(b,c){if(this.id="",b&&b._id&&(this.id=b._id),this.effect=b,b&&(b._animation=this),!c)throw new Error("Animation with null timeline is not supported");this._timeline=c,this._sequenceNumber=a.sequenceNumber++,this._holdTime=0,this._paused=!1,this._isGroup=!1,this._animation=null,this._childAnimations=[],this._callback=null,this._oldPlayState="idle",this._rebuildUnderlyingAnimation(),this._animation.cancel(),this._updatePromises()},b.Animation.prototype={_updatePromises:function(){var a=this._oldPlayState,b=this.playState;return this._readyPromise&&b!==a&&("idle"==b?(this._rejectReadyPromise(),this._readyPromise=void 0):"pending"==a?this._resolveReadyPromise():"pending"==b&&(this._readyPromise=void 0)),this._finishedPromise&&b!==a&&("idle"==b?(this._rejectFinishedPromise(),this._finishedPromise=void 0):"finished"==b?this._resolveFinishedPromise():"finished"==a&&(this._finishedPromise=void 0)),this._oldPlayState=this.playState,this._readyPromise||this._finishedPromise},_rebuildUnderlyingAnimation:function(){this._updatePromises();var a,c,d,e,f=!!this._animation;f&&(a=this.playbackRate,c=this._paused,d=this.startTime,e=this.currentTime,this._animation.cancel(),this._animation._wrapper=null,this._animation=null),(!this.effect||this.effect instanceof window.KeyframeEffect)&&(this._animation=b.newUnderlyingAnimationForKeyframeEffect(this.effect),b.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceEffect||this.effect instanceof window.GroupEffect)&&(this._animation=b.newUnderlyingAnimationForGroup(this.effect),b.bindAnimationForGroup(this)),this.effect&&this.effect._onsample&&b.bindAnimationForCustomEffect(this),f&&(1!=a&&(this.playbackRate=a),null!==d?this.startTime=d:null!==e?this.currentTime=e:null!==this._holdTime&&(this.currentTime=this._holdTime),c&&this.pause()),this._updatePromises()},_updateChildren:function(){if(this.effect&&"idle"!=this.playState){var a=this.effect._timing.delay;this._childAnimations.forEach(function(c){this._arrangeChildren(c,a),this.effect instanceof window.SequenceEffect&&(a+=b.groupChildDuration(c.effect))}.bind(this))}},_setExternalAnimation:function(a){if(this.effect&&this._isGroup)for(var b=0;b<this.effect.children.length;b++)this.effect.children[b]._animation=a,this._childAnimations[b]._setExternalAnimation(a)},_constructChildAnimations:function(){if(this.effect&&this._isGroup){var a=this.effect._timing.delay;this._removeChildAnimations(),this.effect.children.forEach(function(c){var d=window.document.timeline._play(c);this._childAnimations.push(d),d.playbackRate=this.playbackRate,this._paused&&d.pause(),c._animation=this.effect._animation,this._arrangeChildren(d,a),this.effect instanceof window.SequenceEffect&&(a+=b.groupChildDuration(c))}.bind(this))}},_arrangeChildren:function(a,b){null===this.startTime?a.currentTime=this.currentTime-b/this.playbackRate:a.startTime!==this.startTime+b/this.playbackRate&&(a.startTime=this.startTime+b/this.playbackRate)},get timeline(){return this._timeline},get playState(){return this._animation?this._animation.playState:"idle"},get finished(){return window.Promise?(this._finishedPromise||(-1==b.animationsWithPromises.indexOf(this)&&b.animationsWithPromises.push(this),this._finishedPromise=new Promise(function(a,b){this._resolveFinishedPromise=function(){a(this)},this._rejectFinishedPromise=function(){b({type:DOMException.ABORT_ERR,name:"AbortError"})}}.bind(this)),"finished"==this.playState&&this._resolveFinishedPromise()),this._finishedPromise):(console.warn("Animation Promises require JavaScript Promise constructor"),null)},get ready(){return window.Promise?(this._readyPromise||(-1==b.animationsWithPromises.indexOf(this)&&b.animationsWithPromises.push(this),this._readyPromise=new Promise(function(a,b){this._resolveReadyPromise=function(){a(this)},this._rejectReadyPromise=function(){b({type:DOMException.ABORT_ERR,name:"AbortError"})}}.bind(this)),"pending"!==this.playState&&this._resolveReadyPromise()),this._readyPromise):(console.warn("Animation Promises require JavaScript Promise constructor"),null)},get onfinish(){return this._animation.onfinish},set onfinish(a){"function"==typeof a?this._animation.onfinish=function(b){b.target=this,a.call(this,b)}.bind(this):this._animation.onfinish=a},get oncancel(){return this._animation.oncancel},set oncancel(a){"function"==typeof a?this._animation.oncancel=function(b){b.target=this,a.call(this,b)}.bind(this):this._animation.oncancel=a},get currentTime(){this._updatePromises();var a=this._animation.currentTime;return this._updatePromises(),a},set currentTime(a){this._updatePromises(),this._animation.currentTime=isFinite(a)?a:Math.sign(a)*Number.MAX_VALUE,this._register(),this._forEachChild(function(b,c){b.currentTime=a-c}),this._updatePromises()},get startTime(){return this._animation.startTime},set startTime(a){this._updatePromises(),this._animation.startTime=isFinite(a)?a:Math.sign(a)*Number.MAX_VALUE,this._register(),this._forEachChild(function(b,c){b.startTime=a+c}),this._updatePromises()},get playbackRate(){return this._animation.playbackRate},set playbackRate(a){this._updatePromises();var b=this.currentTime;this._animation.playbackRate=a,this._forEachChild(function(b){b.playbackRate=a}),"paused"!=this.playState&&"idle"!=this.playState&&this.play(),null!==b&&(this.currentTime=b),this._updatePromises()},play:function(){this._updatePromises(),this._paused=!1,this._animation.play(),-1==this._timeline._animations.indexOf(this)&&this._timeline._animations.push(this),this._register(),b.awaitStartTime(this),this._forEachChild(function(a){var b=a.currentTime;a.play(),a.currentTime=b}),this._updatePromises()},pause:function(){this._updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._animation.pause(),this._register(),this._forEachChild(function(a){a.pause()}),this._paused=!0,this._updatePromises()},finish:function(){this._updatePromises(),this._animation.finish(),this._register(),this._updatePromises()},cancel:function(){this._updatePromises(),this._animation.cancel(),this._register(),this._removeChildAnimations(),this._updatePromises()},reverse:function(){this._updatePromises();var a=this.currentTime;this._animation.reverse(),this._forEachChild(function(a){a.reverse()}),null!==a&&(this.currentTime=a),this._updatePromises()},addEventListener:function(a,b){var c=b;"function"==typeof b&&(c=function(a){a.target=this,b.call(this,a)}.bind(this),b._wrapper=c),this._animation.addEventListener(a,c)},removeEventListener:function(a,b){this._animation.removeEventListener(a,b&&b._wrapper||b)},_removeChildAnimations:function(){for(;this._childAnimations.length;)this._childAnimations.pop().cancel()},_forEachChild:function(b){var c=0;if(this.effect.children&&this._childAnimations.length<this.effect.children.length&&this._constructChildAnimations(),this._childAnimations.forEach(function(a){b.call(this,a,c),this.effect instanceof window.SequenceEffect&&(c+=a.effect.activeDuration)}.bind(this)),"pending"!=this.playState){var d=this.effect._timing,e=this.currentTime;null!==e&&(e=a.calculateTimeFraction(a.calculateActiveDuration(d),e,d)),(null==e||isNaN(e))&&this._removeChildAnimations()}}},window.Animation=b.Animation}(c,e,f),function(a,b,c){function d(b){this._frames=a.normalizeKeyframes(b)}function e(){for(var a=!1;i.length;){var b=i.shift();b._updateChildren(),a=!0}return a}var f=function(a){if(a._animation=void 0,a instanceof window.SequenceEffect||a instanceof window.GroupEffect)for(var b=0;b<a.children.length;b++)f(a.children[b])};b.removeMulti=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];d._parent?(-1==b.indexOf(d._parent)&&b.push(d._parent),d._parent.children.splice(d._parent.children.indexOf(d),1),d._parent=null,f(d)):d._animation&&d._animation.effect==d&&(d._animation.cancel(),d._animation.effect=new KeyframeEffect(null,[]),d._animation._callback&&(d._animation._callback._animation=null),d._animation._rebuildUnderlyingAnimation(),f(d))}for(c=0;c<b.length;c++)b[c]._rebuild()},b.KeyframeEffect=function(b,c,e,f){return this.target=b,this._parent=null,e=a.numericTimingToObject(e),this._timingInput=a.cloneTimingInput(e),this._timing=a.normalizeTimingInput(e),this.timing=a.makeTiming(e,!1,this),this.timing._effect=this,"function"==typeof c?(a.deprecated("Custom KeyframeEffect","2015-06-22","Use KeyframeEffect.onsample instead."),this._normalizedKeyframes=c):this._normalizedKeyframes=new d(c),this._keyframes=c,this.activeDuration=a.calculateActiveDuration(this._timing),this._id=f,this},b.KeyframeEffect.prototype={getFrames:function(){return"function"==typeof this._normalizedKeyframes?this._normalizedKeyframes:this._normalizedKeyframes._frames},set onsample(a){if("function"==typeof this.getFrames())throw new Error("Setting onsample on custom effect KeyframeEffect is not supported.");this._onsample=a,this._animation&&this._animation._rebuildUnderlyingAnimation()},get parent(){return this._parent},clone:function(){if("function"==typeof this.getFrames())throw new Error("Cloning custom effects is not supported.");var b=new KeyframeEffect(this.target,[],a.cloneTimingInput(this._timingInput),this._id);return b._normalizedKeyframes=this._normalizedKeyframes,b._keyframes=this._keyframes,b},remove:function(){b.removeMulti([this])}};var g=Element.prototype.animate;Element.prototype.animate=function(a,c){var d="";return c&&c.id&&(d=c.id),b.timeline._play(new b.KeyframeEffect(this,a,c,d))};var h=document.createElementNS("http://www.w3.org/1999/xhtml","div");b.newUnderlyingAnimationForKeyframeEffect=function(a){if(a){var b=a.target||h,c=a._keyframes;"function"==typeof c&&(c=[]);var d=a._timingInput;d.id=a._id}else var b=h,c=[],d=0;return g.apply(b,[c,d])},b.bindAnimationForKeyframeEffect=function(a){a.effect&&"function"==typeof a.effect._normalizedKeyframes&&b.bindAnimationForCustomEffect(a)};var i=[];b.awaitStartTime=function(a){null===a.startTime&&a._isGroup&&(0==i.length&&requestAnimationFrame(e),i.push(a))};var j=window.getComputedStyle;Object.defineProperty(window,"getComputedStyle",{configurable:!0,enumerable:!0,value:function(){window.document.timeline._updateAnimationsPromises();var a=j.apply(this,arguments);return e()&&(a=j.apply(this,arguments)),window.document.timeline._updateAnimationsPromises(),a}}),window.KeyframeEffect=b.KeyframeEffect,window.Element.prototype.getAnimations=function(){return document.timeline.getAnimations().filter(function(a){return null!==a.effect&&a.effect.target==this}.bind(this))}}(c,e,f),function(a,b,c){function d(a){a._registered||(a._registered=!0,g.push(a),h||(h=!0,requestAnimationFrame(e)))}function e(a){var b=g;g=[],b.sort(function(a,b){return a._sequenceNumber-b._sequenceNumber}),b=b.filter(function(a){a();var b=a._animation?a._animation.playState:"idle";return"running"!=b&&"pending"!=b&&(a._registered=!1),a._registered}),g.push.apply(g,b),g.length?(h=!0,requestAnimationFrame(e)):h=!1}var f=(document.createElementNS("http://www.w3.org/1999/xhtml","div"),0);b.bindAnimationForCustomEffect=function(b){var c,e=b.effect.target,g="function"==typeof b.effect.getFrames();c=g?b.effect.getFrames():b.effect._onsample;var h=b.effect.timing,i=null;h=a.normalizeTimingInput(h);var j=function(){var d=j._animation?j._animation.currentTime:null;null!==d&&(d=a.calculateTimeFraction(a.calculateActiveDuration(h),d,h),isNaN(d)&&(d=null)),d!==i&&(g?c(d,e,b.effect):c(d,b.effect,b.effect._animation)),i=d};j._animation=b,j._registered=!1,j._sequenceNumber=f++,b._callback=j,d(j)};var g=[],h=!1;b.Animation.prototype._register=function(){this._callback&&d(this._callback)}}(c,e,f),function(a,b,c){function d(a){return a._timing.delay+a.activeDuration+a._timing.endDelay}function e(b,c,d){this._id=d,this._parent=null,this.children=b||[],this._reparent(this.children),c=a.numericTimingToObject(c),this._timingInput=a.cloneTimingInput(c),this._timing=a.normalizeTimingInput(c,!0),this.timing=a.makeTiming(c,!0,this),this.timing._effect=this,"auto"===this._timing.duration&&(this._timing.duration=this.activeDuration)}window.SequenceEffect=function(){e.apply(this,arguments)},window.GroupEffect=function(){e.apply(this,arguments)},e.prototype={_isAncestor:function(a){for(var b=this;null!==b;){if(b==a)return!0;b=b._parent}return!1},_rebuild:function(){for(var a=this;a;)"auto"===a.timing.duration&&(a._timing.duration=a.activeDuration),a=a._parent;this._animation&&this._animation._rebuildUnderlyingAnimation()},_reparent:function(a){b.removeMulti(a);for(var c=0;c<a.length;c++)a[c]._parent=this},_putChild:function(a,b){for(var c=b?"Cannot append an ancestor or self":"Cannot prepend an ancestor or self",d=0;d<a.length;d++)if(this._isAncestor(a[d]))throw{type:DOMException.HIERARCHY_REQUEST_ERR,name:"HierarchyRequestError",message:c};for(var d=0;d<a.length;d++)b?this.children.push(a[d]):this.children.unshift(a[d]);this._reparent(a),this._rebuild()},append:function(){this._putChild(arguments,!0)},prepend:function(){this._putChild(arguments,!1)},get parent(){return this._parent},get firstChild(){return this.children.length?this.children[0]:null},get lastChild(){return this.children.length?this.children[this.children.length-1]:null},clone:function(){for(var b=a.cloneTimingInput(this._timingInput),c=[],d=0;d<this.children.length;d++)c.push(this.children[d].clone());return this instanceof GroupEffect?new GroupEffect(c,b):new SequenceEffect(c,b)},remove:function(){b.removeMulti([this])}},window.SequenceEffect.prototype=Object.create(e.prototype),Object.defineProperty(window.SequenceEffect.prototype,"activeDuration",{get:function(){var a=0;return this.children.forEach(function(b){a+=d(b)}),Math.max(a,0)}}),window.GroupEffect.prototype=Object.create(e.prototype),Object.defineProperty(window.GroupEffect.prototype,"activeDuration",{get:function(){var a=0;return this.children.forEach(function(b){a=Math.max(a,d(b))}),a}}),b.newUnderlyingAnimationForGroup=function(c){var d,e=null,f=function(b){var c=d._wrapper;return c&&"pending"!=c.playState&&c.effect?null==b?void c._removeChildAnimations():0==b&&c.playbackRate<0&&(e||(e=a.normalizeTimingInput(c.effect.timing)),b=a.calculateTimeFraction(a.calculateActiveDuration(e),-1,e),isNaN(b)||null==b)?(c._forEachChild(function(a){a.currentTime=-1}),void c._removeChildAnimations()):void 0:void 0},g=new KeyframeEffect(null,[],c._timing,c._id);return g.onsample=f,d=b.timeline._play(g)},b.bindAnimationForGroup=function(a){a._animation._wrapper=a,a._isGroup=!0,b.awaitStartTime(a),a._constructChildAnimations(),a._setExternalAnimation(a)},b.groupChildDuration=d}(c,e,f),b["true"]=a}({},function(){return this}()); </script> <script>/** @license @nocompile Copyright (c) 2018 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ (function(){/* Copyright (c) 2016 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ 'use strict';var n,p="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};function ba(){ba=function(){};p.Symbol||(p.Symbol=ca)}var ca=function(){var a=0;return function(b){return"jscomp_symbol_"+(b||"")+a++}}(); function da(){ba();var a=p.Symbol.iterator;a||(a=p.Symbol.iterator=p.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ea(this)}});da=function(){}}function ea(a){var b=0;return fa(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function fa(a){da();a={next:a};a[p.Symbol.iterator]=function(){return this};return a}function ia(a){da();var b=a[Symbol.iterator];return b?b.call(a):ea(a)} function ja(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c} (function(){if(!function(){var a=document.createEvent("Event");a.initEvent("foo",!0,!0);a.preventDefault();return a.defaultPrevented}()){var a=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(a.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var b=/Trident/.test(navigator.userAgent);if(!window.CustomEvent||b&&"function"!==typeof window.CustomEvent)window.CustomEvent=function(a,b){b=b||{};var c=document.createEvent("CustomEvent"); c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c},window.CustomEvent.prototype=window.Event.prototype;if(!window.Event||b&&"function"!==typeof window.Event){var c=window.Event;window.Event=function(a,b){b=b||{};var c=document.createEvent("Event");c.initEvent(a,!!b.bubbles,!!b.cancelable);return c};if(c)for(var d in c)window.Event[d]=c[d];window.Event.prototype=c.prototype}if(!window.MouseEvent||b&&"function"!==typeof window.MouseEvent){b=window.MouseEvent;window.MouseEvent=function(a, b){b=b||{};var c=document.createEvent("MouseEvent");c.initMouseEvent(a,!!b.bubbles,!!b.cancelable,b.view||window,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget);return c};if(b)for(d in b)window.MouseEvent[d]=b[d];window.MouseEvent.prototype=b.prototype}Array.from||(Array.from=function(a){return[].slice.call(a)});Object.assign||(Object.assign=function(a,b){for(var c=[].slice.call(arguments,1),d=0,e;d<c.length;d++)if(e=c[d])for(var f= a,m=e,q=Object.getOwnPropertyNames(m),x=0;x<q.length;x++)e=q[x],f[e]=m[e];return a})})(window.WebComponents);(function(){function a(){}function b(a,b){if(!a.childNodes.length)return[];switch(a.nodeType){case Node.DOCUMENT_NODE:return ua.call(a,b);case Node.DOCUMENT_FRAGMENT_NODE:return lb.call(a,b);default:return U.call(a,b)}}var c="undefined"===typeof HTMLTemplateElement,d=!(document.createDocumentFragment().cloneNode()instanceof DocumentFragment),e=!1;/Trident/.test(navigator.userAgent)&&function(){function a(a,b){if(a instanceof DocumentFragment)for(var d;d=a.firstChild;)c.call(this,d,b);else c.call(this, a,b);return a}e=!0;var b=Node.prototype.cloneNode;Node.prototype.cloneNode=function(a){a=b.call(this,a);this instanceof DocumentFragment&&(a.__proto__=DocumentFragment.prototype);return a};DocumentFragment.prototype.querySelectorAll=HTMLElement.prototype.querySelectorAll;DocumentFragment.prototype.querySelector=HTMLElement.prototype.querySelector;Object.defineProperties(DocumentFragment.prototype,{nodeType:{get:function(){return Node.DOCUMENT_FRAGMENT_NODE},configurable:!0},localName:{get:function(){}, configurable:!0},nodeName:{get:function(){return"#document-fragment"},configurable:!0}});var c=Node.prototype.insertBefore;Node.prototype.insertBefore=a;var d=Node.prototype.appendChild;Node.prototype.appendChild=function(b){b instanceof DocumentFragment?a.call(this,b,null):d.call(this,b);return b};var f=Node.prototype.removeChild,g=Node.prototype.replaceChild;Node.prototype.replaceChild=function(b,c){b instanceof DocumentFragment?(a.call(this,b,c),f.call(this,c)):g.call(this,b,c);return c};Document.prototype.createDocumentFragment= function(){var a=this.createElement("df");a.__proto__=DocumentFragment.prototype;return a};var h=Document.prototype.importNode;Document.prototype.importNode=function(a,b){b=h.call(this,a,b||!1);a instanceof DocumentFragment&&(b.__proto__=DocumentFragment.prototype);return b}}();var f=Node.prototype.cloneNode,g=Document.prototype.createElement,h=Document.prototype.importNode,k=Node.prototype.removeChild,l=Node.prototype.appendChild,m=Node.prototype.replaceChild,q=DOMParser.prototype.parseFromString, x=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML")||{get:function(){return this.innerHTML},set:function(a){this.innerHTML=a}},M=Object.getOwnPropertyDescriptor(window.Node.prototype,"childNodes")||{get:function(){return this.childNodes}},U=Element.prototype.querySelectorAll,ua=Document.prototype.querySelectorAll,lb=DocumentFragment.prototype.querySelectorAll,mb=function(){if(!c){var a=document.createElement("template"),b=document.createElement("template");b.content.appendChild(document.createElement("div")); a.content.appendChild(b);a=a.cloneNode(!0);return 0===a.content.childNodes.length||0===a.content.firstChild.content.childNodes.length||d}}();if(c){var S=document.implementation.createHTMLDocument("template"),C=!0,V=document.createElement("style");V.textContent="template{display:none;}";var ha=document.head;ha.insertBefore(V,ha.firstElementChild);a.prototype=Object.create(HTMLElement.prototype);var va=!document.createElement("div").hasOwnProperty("innerHTML");a.G=function(b){if(!b.content&&b.namespaceURI=== document.documentElement.namespaceURI){b.content=S.createDocumentFragment();for(var c;c=b.firstChild;)l.call(b.content,c);if(va)b.__proto__=a.prototype;else if(b.cloneNode=function(b){return a.a(this,b)},C)try{P(b),W(b)}catch(Tg){C=!1}a.C(b.content)}};var X={option:["select"],thead:["table"],col:["colgroup","table"],tr:["tbody","table"],th:["tr","tbody","table"],td:["tr","tbody","table"]},P=function(b){Object.defineProperty(b,"innerHTML",{get:function(){return nb(this)},set:function(b){var c=X[(/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(b)|| ["",""])[1].toLowerCase()];if(c)for(var d=0;d<c.length;d++)b="<"+c[d]+">"+b+"</"+c[d]+">";S.body.innerHTML=b;for(a.C(S);this.content.firstChild;)k.call(this.content,this.content.firstChild);b=S.body;if(c)for(d=0;d<c.length;d++)b=b.lastChild;for(;b.firstChild;)l.call(this.content,b.firstChild)},configurable:!0})},W=function(a){Object.defineProperty(a,"outerHTML",{get:function(){return"<template>"+this.innerHTML+"</template>"},set:function(a){if(this.parentNode){S.body.innerHTML=a;for(a=this.ownerDocument.createDocumentFragment();S.body.firstChild;)l.call(a, S.body.firstChild);m.call(this.parentNode,a,this)}else throw Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");},configurable:!0})};P(a.prototype);W(a.prototype);a.C=function(c){c=b(c,"template");for(var d=0,e=c.length,f;d<e&&(f=c[d]);d++)a.G(f)};document.addEventListener("DOMContentLoaded",function(){a.C(document)});Document.prototype.createElement=function(){var b=g.apply(this,arguments);"template"===b.localName&&a.G(b);return b};DOMParser.prototype.parseFromString= function(){var b=q.apply(this,arguments);a.C(b);return b};Object.defineProperty(HTMLElement.prototype,"innerHTML",{get:function(){return nb(this)},set:function(b){x.set.call(this,b);a.C(this)},configurable:!0,enumerable:!0});var Ve=/[&\u00A0"]/g,yc=/[&\u00A0<>]/g,zc=function(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}};V=function(a){for(var b={},c=0;c<a.length;c++)b[a[c]]=!0;return b};var We=V("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")), Xe=V("style script xmp iframe noembed noframes plaintext noscript".split(" ")),nb=function(a,b){"template"===a.localName&&(a=a.content);for(var c="",d=b?b(a):M.get.call(a),e=0,f=d.length,g;e<f&&(g=d[e]);e++){a:{var h=g;var k=a;var l=b;switch(h.nodeType){case Node.ELEMENT_NODE:for(var P=h.localName,m="<"+P,W=h.attributes,q=0;k=W[q];q++)m+=" "+k.name+'="'+k.value.replace(Ve,zc)+'"';m+=">";h=We[P]?m:m+nb(h,l)+"</"+P+">";break a;case Node.TEXT_NODE:h=h.data;h=k&&Xe[k.localName]?h:h.replace(yc,zc);break a; case Node.COMMENT_NODE:h="\x3c!--"+h.data+"--\x3e";break a;default:throw window.console.error(h),Error("not implemented");}}c+=h}return c}}if(c||mb){a.a=function(a,b){var c=f.call(a,!1);this.G&&this.G(c);b&&(l.call(c.content,f.call(a.content,!0)),ob(c.content,a.content));return c};var ob=function(c,d){if(d.querySelectorAll&&(d=b(d,"template"),0!==d.length)){c=b(c,"template");for(var e=0,f=c.length,g,h;e<f;e++)h=d[e],g=c[e],a&&a.G&&a.G(h),m.call(g.parentNode,Ye.call(h,!0),g)}},Ye=Node.prototype.cloneNode= function(b){if(!e&&d&&this instanceof DocumentFragment)if(b)var c=Ze.call(this.ownerDocument,this,!0);else return this.ownerDocument.createDocumentFragment();else this.nodeType===Node.ELEMENT_NODE&&"template"===this.localName&&this.namespaceURI==document.documentElement.namespaceURI?c=a.a(this,b):c=f.call(this,b);b&&ob(c,this);return c},Ze=Document.prototype.importNode=function(c,d){d=d||!1;if("template"===c.localName)return a.a(c,d);var e=h.call(this,c,d);if(d){ob(e,c);c=b(e,'script:not([type]),script[type="application/javascript"],script[type="text/javascript"]'); for(var f,k=0;k<c.length;k++){f=c[k];d=g.call(document,"script");d.textContent=f.textContent;for(var l=f.attributes,P=0,W;P<l.length;P++)W=l[P],d.setAttribute(W.name,W.value);m.call(f.parentNode,d,f)}}return e}}c&&(window.HTMLTemplateElement=a)})();var ka=setTimeout;function la(){}function ma(a,b){return function(){a.apply(b,arguments)}}function r(a){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!==typeof a)throw new TypeError("not a function");this.u=0;this.ma=!1;this.h=void 0;this.I=[];na(a,this)} function oa(a,b){for(;3===a.u;)a=a.h;0===a.u?a.I.push(b):(a.ma=!0,pa(function(){var c=1===a.u?b.Na:b.Oa;if(null===c)(1===a.u?qa:ra)(b.ga,a.h);else{try{var d=c(a.h)}catch(e){ra(b.ga,e);return}qa(b.ga,d)}}))}function qa(a,b){try{if(b===a)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"===typeof b||"function"===typeof b)){var c=b.then;if(b instanceof r){a.u=3;a.h=b;sa(a);return}if("function"===typeof c){na(ma(c,b),a);return}}a.u=1;a.h=b;sa(a)}catch(d){ra(a,d)}} function ra(a,b){a.u=2;a.h=b;sa(a)}function sa(a){2===a.u&&0===a.I.length&&pa(function(){a.ma||"undefined"!==typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",a.h)});for(var b=0,c=a.I.length;b<c;b++)oa(a,a.I[b]);a.I=null}function ta(a,b,c){this.Na="function"===typeof a?a:null;this.Oa="function"===typeof b?b:null;this.ga=c}function na(a,b){var c=!1;try{a(function(a){c||(c=!0,qa(b,a))},function(a){c||(c=!0,ra(b,a))})}catch(d){c||(c=!0,ra(b,d))}} r.prototype["catch"]=function(a){return this.then(null,a)};r.prototype.then=function(a,b){var c=new this.constructor(la);oa(this,new ta(a,b,c));return c};r.prototype["finally"]=function(a){var b=this.constructor;return this.then(function(c){return b.resolve(a()).then(function(){return c})},function(c){return b.resolve(a()).then(function(){return b.reject(c)})})}; function wa(a){return new r(function(b,c){function d(a,g){try{if(g&&("object"===typeof g||"function"===typeof g)){var h=g.then;if("function"===typeof h){h.call(g,function(b){d(a,b)},c);return}}e[a]=g;0===--f&&b(e)}catch(m){c(m)}}if(!a||"undefined"===typeof a.length)throw new TypeError("Promise.all accepts an array");var e=Array.prototype.slice.call(a);if(0===e.length)return b([]);for(var f=e.length,g=0;g<e.length;g++)d(g,e[g])})} function xa(a){return a&&"object"===typeof a&&a.constructor===r?a:new r(function(b){b(a)})}function ya(a){return new r(function(b,c){c(a)})}function za(a){return new r(function(b,c){for(var d=0,e=a.length;d<e;d++)a[d].then(b,c)})}var pa="function"===typeof setImmediate&&function(a){setImmediate(a)}||function(a){ka(a,0)};/* Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ if(!window.Promise){window.Promise=r;r.prototype.then=r.prototype.then;r.all=wa;r.race=za;r.resolve=xa;r.reject=ya;var Aa=document.createTextNode(""),Ba=[];(new MutationObserver(function(){for(var a=Ba.length,b=0;b<a;b++)Ba[b]();Ba.splice(0,a)})).observe(Aa,{characterData:!0});pa=function(a){Ba.push(a);Aa.textContent=0<Aa.textContent.length?"":"a"}};(function(a){function b(a,b){if("function"===typeof window.CustomEvent)return new CustomEvent(a,b);var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c}function c(a){if(M)return a.ownerDocument!==document?a.ownerDocument:null;var b=a.__importDoc;if(!b&&a.parentNode){b=a.parentNode;if("function"===typeof b.closest)b=b.closest("link[rel=import]");else for(;!h(b)&&(b=b.parentNode););a.__importDoc=b}return b}function d(a){var b=m(document,"link[rel=import]:not([import-dependency])"), c=b.length;c?q(b,function(b){return g(b,function(){0===--c&&a()})}):a()}function e(a){function b(){"loading"!==document.readyState&&document.body&&(document.removeEventListener("readystatechange",b),a())}document.addEventListener("readystatechange",b);b()}function f(a){e(function(){return d(function(){return a&&a()})})}function g(a,b){if(a.__loaded)b&&b();else if("script"===a.localName&&!a.src||"style"===a.localName&&!a.firstChild)a.__loaded=!0,b&&b();else{var c=function(d){a.removeEventListener(d.type, c);a.__loaded=!0;b&&b()};a.addEventListener("load",c);ha&&"style"===a.localName||a.addEventListener("error",c)}}function h(a){return a.nodeType===Node.ELEMENT_NODE&&"link"===a.localName&&"import"===a.rel}function k(){var a=this;this.a={};this.b=0;this.c=new MutationObserver(function(b){return a.Ja(b)});this.c.observe(document.head,{childList:!0,subtree:!0});this.loadImports(document)}function l(a){q(m(a,"template"),function(a){q(m(a.content,'script:not([type]),script[type="application/javascript"],script[type="text/javascript"],script[type="module"]'), function(a){var b=document.createElement("script");q(a.attributes,function(a){return b.setAttribute(a.name,a.value)});b.textContent=a.textContent;a.parentNode.replaceChild(b,a)});l(a.content)})}function m(a,b){return a.childNodes.length?a.querySelectorAll(b):U}function q(a,b,c){var d=a?a.length:0,e=c?-1:1;for(c=c?d-1:0;c<d&&0<=c;c+=e)b(a[c],c)}var x=document.createElement("link"),M="import"in x,U=x.querySelectorAll("*"),ua=null;!1==="currentScript"in document&&Object.defineProperty(document,"currentScript", {get:function(){return ua||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null)},configurable:!0});var lb=/(url\()([^)]*)(\))/g,mb=/(@import[\s]+(?!url\())([^;]*)(;)/g,S=/(<link[^>]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,C={Ea:function(a,b){a.href&&a.setAttribute("href",C.X(a.getAttribute("href"),b));a.src&&a.setAttribute("src",C.X(a.getAttribute("src"),b));if("style"===a.localName){var c=C.qa(a.textContent,b,lb);a.textContent=C.qa(c,b,mb)}},qa:function(a,b,c){return a.replace(c, function(a,c,d,e){a=d.replace(/["']/g,"");b&&(a=C.X(a,b));return c+"'"+a+"'"+e})},X:function(a,b){if(void 0===C.aa){C.aa=!1;try{var c=new URL("b","http://a");c.pathname="c%20d";C.aa="http://a/c%20d"===c.href}catch(yc){}}if(C.aa)return(new URL(a,b)).href;c=C.xa;c||(c=document.implementation.createHTMLDocument("temp"),C.xa=c,c.ja=c.createElement("base"),c.head.appendChild(c.ja),c.ia=c.createElement("a"));c.ja.href=b;c.ia.href=a;return c.ia.href||a}},V={async:!0,load:function(a,b,c){if(a)if(a.match(/^data:/)){a= a.split(",");var d=a[1];d=-1<a[0].indexOf(";base64")?atob(d):decodeURIComponent(d);b(d)}else{var e=new XMLHttpRequest;e.open("GET",a,V.async);e.onload=function(){var a=e.responseURL||e.getResponseHeader("Location");a&&0===a.indexOf("/")&&(a=(location.origin||location.protocol+"//"+location.host)+a);var d=e.response||e.responseText;304===e.status||0===e.status||200<=e.status&&300>e.status?b(d,a):c(d)};e.send()}else c("error: href must be specified")}},ha=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent); k.prototype.loadImports=function(a){var b=this;a=m(a,"link[rel=import]");q(a,function(a){return b.g(a)})};k.prototype.g=function(a){var b=this,c=a.href;if(void 0!==this.a[c]){var d=this.a[c];d&&d.__loaded&&(a.__import=d,this.f(a))}else this.b++,this.a[c]="pending",V.load(c,function(a,d){a=b.Ka(a,d||c);b.a[c]=a;b.b--;b.loadImports(a);b.l()},function(){b.a[c]=null;b.b--;b.l()})};k.prototype.Ka=function(a,b){if(!a)return document.createDocumentFragment();ha&&(a=a.replace(S,function(a,b,c){return-1=== a.indexOf("type=")?b+" type=import-disable "+c:a}));var c=document.createElement("template");c.innerHTML=a;if(c.content)a=c.content,l(a);else for(a=document.createDocumentFragment();c.firstChild;)a.appendChild(c.firstChild);if(c=a.querySelector("base"))b=C.X(c.getAttribute("href"),b),c.removeAttribute("href");c=m(a,'link[rel=import],link[rel=stylesheet][href][type=import-disable],style:not([type]),link[rel=stylesheet][href]:not([type]),script:not([type]),script[type="application/javascript"],script[type="text/javascript"],script[type="module"]'); var d=0;q(c,function(a){g(a);C.Ea(a,b);a.setAttribute("import-dependency","");if("script"===a.localName&&!a.src&&a.textContent){if("module"===a.type)throw Error("Inline module scripts are not supported in HTML Imports.");a.setAttribute("src","data:text/javascript;charset=utf-8,"+encodeURIComponent(a.textContent+("\n//# sourceURL="+b+(d?"-"+d:"")+".js\n")));a.textContent="";d++}});return a};k.prototype.l=function(){var a=this;if(!this.b){this.c.disconnect();this.flatten(document);var b=!1,c=!1,d=function(){c&& b&&(a.loadImports(document),a.b||(a.c.observe(document.head,{childList:!0,subtree:!0}),a.da()))};this.Ma(function(){c=!0;d()});this.La(function(){b=!0;d()})}};k.prototype.flatten=function(a){var b=this;a=m(a,"link[rel=import]");q(a,function(a){var c=b.a[a.href];(a.__import=c)&&c.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(b.a[a.href]=a,a.readyState="loading",a.__import=a,b.flatten(c),a.appendChild(c))})};k.prototype.La=function(a){function b(e){if(e<d){var f=c[e],h=document.createElement("script");f.removeAttribute("import-dependency"); q(f.attributes,function(a){return h.setAttribute(a.name,a.value)});ua=h;f.parentNode.replaceChild(h,f);g(h,function(){ua=null;b(e+1)})}else a()}var c=m(document,"script[import-dependency]"),d=c.length;b(0)};k.prototype.Ma=function(a){var b=m(document,"style[import-dependency],link[rel=stylesheet][import-dependency]"),d=b.length;if(d){var e=ha&&!!document.querySelector("link[rel=stylesheet][href][type=import-disable]");q(b,function(b){g(b,function(){b.removeAttribute("import-dependency");0===--d&& a()});if(e&&b.parentNode!==document.head){var f=document.createElement(b.localName);f.__appliedElement=b;f.setAttribute("type","import-placeholder");b.parentNode.insertBefore(f,b.nextSibling);for(f=c(b);f&&c(f);)f=c(f);f.parentNode!==document.head&&(f=null);document.head.insertBefore(b,f);b.removeAttribute("type")}})}else a()};k.prototype.da=function(){var a=this,b=m(document,"link[rel=import]");q(b,function(b){return a.f(b)},!0)};k.prototype.f=function(a){a.__loaded||(a.__loaded=!0,a.import&&(a.import.readyState= "complete"),a.dispatchEvent(b(a.import?"load":"error",{bubbles:!1,cancelable:!1,detail:void 0})))};k.prototype.Ja=function(a){var b=this;q(a,function(a){return q(a.addedNodes,function(a){a&&a.nodeType===Node.ELEMENT_NODE&&(h(a)?b.g(a):b.loadImports(a))})})};var va=null;if(M)x=m(document,"link[rel=import]"),q(x,function(a){a.import&&"loading"===a.import.readyState||(a.__loaded=!0)}),x=function(a){a=a.target;h(a)&&(a.__loaded=!0)},document.addEventListener("load",x,!0),document.addEventListener("error", x,!0);else{var X=Object.getOwnPropertyDescriptor(Node.prototype,"baseURI");Object.defineProperty((!X||X.configurable?Node:Element).prototype,"baseURI",{get:function(){var a=h(this)?this:c(this);return a?a.href:X&&X.get?X.get.call(this):(document.querySelector("base")||window.location).href},configurable:!0,enumerable:!0});Object.defineProperty(HTMLLinkElement.prototype,"import",{get:function(){return this.__import||null},configurable:!0,enumerable:!0});e(function(){va=new k})}f(function(){return document.dispatchEvent(b("HTMLImportsLoaded", {cancelable:!0,bubbles:!0,detail:void 0}))});a.useNative=M;a.whenReady=f;a.importForElement=c;a.loadImports=function(a){va&&va.loadImports(a)}})(window.HTMLImports=window.HTMLImports||{});/* Copyright (c) 2014 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ window.WebComponents=window.WebComponents||{flags:{}};var Ca=document.querySelector('script[src*="webcomponents-lite.js"]'),Da=/wc-(.+)/,t={};if(!t.noOpts){location.search.slice(1).split("&").forEach(function(a){a=a.split("=");var b;a[0]&&(b=a[0].match(Da))&&(t[b[1]]=a[1]||!0)});if(Ca)for(var Ea=0,Fa=void 0;Fa=Ca.attributes[Ea];Ea++)"src"!==Fa.name&&(t[Fa.name]=Fa.value||!0);if(t.log&&t.log.split){var Ga=t.log.split(",");t.log={};Ga.forEach(function(a){t.log[a]=!0})}else t.log={}} window.WebComponents.flags=t;var Ha=t.shadydom;Ha&&(window.ShadyDOM=window.ShadyDOM||{},window.ShadyDOM.force=Ha);var Ia=t.register||t.ce;Ia&&window.customElements&&(window.customElements.forcePolyfill=Ia);/* Copyright (c) 2016 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ function Ja(){this.pa=this.root=null;this.T=!1;this.D=this.P=this.ca=this.assignedSlot=this.assignedNodes=this.H=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.K=void 0;this.ka=this.la=!1;this.O={}}Ja.prototype.toJSON=function(){return{}};function u(a){a.__shady||(a.__shady=new Ja);return a.__shady}function v(a){return a&&a.__shady};var w=window.ShadyDOM||{};w.Ga=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var Ka=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");w.m=!!(Ka&&Ka.configurable&&Ka.get);w.ea=w.force||!w.Ga;w.J=w.noPatch||!1;w.oa=w.preferPerformance;function y(a){return(a=v(a))&&void 0!==a.firstChild}function z(a){return"ShadyRoot"===a.za}function La(a){return(a=(a=v(a))&&a.root)&&Ma(a)} var Na=Element.prototype,Oa=Na.matches||Na.matchesSelector||Na.mozMatchesSelector||Na.msMatchesSelector||Na.oMatchesSelector||Na.webkitMatchesSelector,Pa=document.createTextNode(""),Qa=0,Ra=[];(new MutationObserver(function(){for(;Ra.length;)try{Ra.shift()()}catch(a){throw Pa.textContent=Qa++,a;}})).observe(Pa,{characterData:!0});function Sa(a){Ra.push(a);Pa.textContent=Qa++}var Ta=!!document.contains;function Ua(a,b){for(;b;){if(b==a)return!0;b=b.__shady_parentNode}return!1} function Va(a){for(var b=a.length-1;0<=b;b--){var c=a[b],d=c.getAttribute("id")||c.getAttribute("name");d&&"length"!==d&&isNaN(d)&&(a[d]=c)}a.item=function(b){return a[b]};a.namedItem=function(b){if("length"!==b&&isNaN(b)&&a[b])return a[b];for(var c=ia(a),d=c.next();!d.done;d=c.next())if(d=d.value,(d.getAttribute("id")||d.getAttribute("name"))==b)return d;return null};return a} function A(a,b,c,d){c=void 0===c?"":c;for(var e in b){var f=b[e];if(!(d&&0<=d.indexOf(e))){f.configurable=!0;var g=c+e;if(f.value)a[g]=f.value;else try{Object.defineProperty(a,g,f)}catch(h){}}}}function B(a){var b={};Object.getOwnPropertyNames(a).forEach(function(c){b[c]=Object.getOwnPropertyDescriptor(a,c)});return b};var Wa=[],Xa;function Ya(a){Xa||(Xa=!0,Sa(Za));Wa.push(a)}function Za(){Xa=!1;for(var a=!!Wa.length;Wa.length;)Wa.shift()();return a}Za.list=Wa;function $a(){this.a=!1;this.addedNodes=[];this.removedNodes=[];this.S=new Set}function ab(a){a.a||(a.a=!0,Sa(function(){a.flush()}))}$a.prototype.flush=function(){if(this.a){this.a=!1;var a=this.takeRecords();a.length&&this.S.forEach(function(b){b(a)})}};$a.prototype.takeRecords=function(){if(this.addedNodes.length||this.removedNodes.length){var a=[{addedNodes:this.addedNodes,removedNodes:this.removedNodes}];this.addedNodes=[];this.removedNodes=[];return a}return[]}; function bb(a,b){var c=u(a);c.H||(c.H=new $a);c.H.S.add(b);var d=c.H;return{ya:b,F:d,Aa:a,takeRecords:function(){return d.takeRecords()}}}function cb(a){var b=a&&a.F;b&&(b.S.delete(a.ya),b.S.size||(u(a.Aa).H=null))} function db(a,b){var c=b.getRootNode();return a.map(function(a){var b=c===a.target.getRootNode();if(b&&a.addedNodes){if(b=Array.from(a.addedNodes).filter(function(a){return c===a.getRootNode()}),b.length)return a=Object.create(a),Object.defineProperty(a,"addedNodes",{value:b,configurable:!0}),a}else if(b)return a}).filter(function(a){return a})};var eb=/[&\u00A0"]/g,fb=/[&\u00A0<>]/g;function gb(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}}function hb(a){for(var b={},c=0;c<a.length;c++)b[a[c]]=!0;return b}var ib=hb("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),jb=hb("style script xmp iframe noembed noframes plaintext noscript".split(" ")); function kb(a,b){"template"===a.localName&&(a=a.content);for(var c="",d=b?b(a):a.childNodes,e=0,f=d.length,g=void 0;e<f&&(g=d[e]);e++){a:{var h=g;var k=a,l=b;switch(h.nodeType){case Node.ELEMENT_NODE:k=h.localName;for(var m="<"+k,q=h.attributes,x=0,M;M=q[x];x++)m+=" "+M.name+'="'+M.value.replace(eb,gb)+'"';m+=">";h=ib[k]?m:m+kb(h,l)+"</"+k+">";break a;case Node.TEXT_NODE:h=h.data;h=k&&jb[k.localName]?h:h.replace(fb,gb);break a;case Node.COMMENT_NODE:h="\x3c!--"+h.data+"--\x3e";break a;default:throw window.console.error(h), Error("not implemented");}}c+=h}return c};var pb=w.m,qb={querySelector:function(a){return this.__shady_native_querySelector(a)},querySelectorAll:function(a){return this.__shady_native_querySelectorAll(a)}},rb={};function sb(a){rb[a]=function(b){return b["__shady_native_"+a]}}function tb(a,b){A(a,b,"__shady_native_");for(var c in b)sb(c)}function D(a,b){b=void 0===b?[]:b;for(var c=0;c<b.length;c++){var d=b[c],e=Object.getOwnPropertyDescriptor(a,d);e&&(Object.defineProperty(a,"__shady_native_"+d,e),e.value?qb[d]||(qb[d]=e.value):sb(d))}} var E=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),F=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1),ub=document.implementation.createHTMLDocument("inert");function vb(a){for(var b;b=a.__shady_native_firstChild;)a.__shady_native_removeChild(b)}var wb=["firstElementChild","lastElementChild","children","childElementCount"],xb=["querySelector","querySelectorAll"]; function yb(){var a=["dispatchEvent","addEventListener","removeEventListener"];window.EventTarget?D(window.EventTarget.prototype,a):(D(Node.prototype,a),D(Window.prototype,a));pb?D(Node.prototype,"parentNode firstChild lastChild previousSibling nextSibling childNodes parentElement textContent".split(" ")):tb(Node.prototype,{parentNode:{get:function(){E.currentNode=this;return E.parentNode()}},firstChild:{get:function(){E.currentNode=this;return E.firstChild()}},lastChild:{get:function(){E.currentNode= this;return E.lastChild()}},previousSibling:{get:function(){E.currentNode=this;return E.previousSibling()}},nextSibling:{get:function(){E.currentNode=this;return E.nextSibling()}},childNodes:{get:function(){var a=[];E.currentNode=this;for(var c=E.firstChild();c;)a.push(c),c=E.nextSibling();return a}},parentElement:{get:function(){F.currentNode=this;return F.parentNode()}},textContent:{get:function(){switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:for(var a=document.createTreeWalker(this, NodeFilter.SHOW_TEXT,null,!1),c="",d;d=a.nextNode();)c+=d.nodeValue;return c;default:return this.nodeValue}},set:function(a){if("undefined"===typeof a||null===a)a="";switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:vb(this);(0<a.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_native_insertBefore(document.createTextNode(a),void 0);break;default:this.nodeValue=a}}}});D(Node.prototype,"appendChild insertBefore removeChild replaceChild cloneNode contains".split(" ")); a={firstElementChild:{get:function(){F.currentNode=this;return F.firstChild()}},lastElementChild:{get:function(){F.currentNode=this;return F.lastChild()}},children:{get:function(){var a=[];F.currentNode=this;for(var c=F.firstChild();c;)a.push(c),c=F.nextSibling();return Va(a)}},childElementCount:{get:function(){return this.children?this.children.length:0}}};pb?(D(Element.prototype,wb),D(Element.prototype,["previousElementSibling","nextElementSibling","innerHTML"]),Object.getOwnPropertyDescriptor(HTMLElement.prototype, "children")&&D(HTMLElement.prototype,["children"]),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML")&&D(HTMLElement.prototype,["innerHTML"])):(tb(Element.prototype,a),tb(Element.prototype,{previousElementSibling:{get:function(){F.currentNode=this;return F.previousSibling()}},nextElementSibling:{get:function(){F.currentNode=this;return F.nextSibling()}},innerHTML:{get:function(){return kb(this,function(a){return a.__shady_native_childNodes})},set:function(a){var b="template"===this.localName? this.content:this;vb(b);var d=this.localName||"div";d=this.namespaceURI&&this.namespaceURI!==ub.namespaceURI?ub.createElementNS(this.namespaceURI,d):ub.createElement(d);d.innerHTML=a;for(a="template"===this.localName?d.content:d;d=a.__shady_native_firstChild;)b.__shady_native_insertBefore(d,void 0)}}}));D(Element.prototype,"setAttribute getAttribute hasAttribute removeAttribute focus blur".split(" "));D(Element.prototype,xb);D(HTMLElement.prototype,["focus","blur","contains"]);pb&&D(HTMLElement.prototype, ["parentElement","children","innerHTML"]);window.HTMLTemplateElement&&D(window.HTMLTemplateElement.prototype,["innerHTML"]);pb?D(DocumentFragment.prototype,wb):tb(DocumentFragment.prototype,a);D(DocumentFragment.prototype,xb);pb?(D(Document.prototype,wb),D(Document.prototype,["activeElement"])):tb(Document.prototype,a);D(Document.prototype,["importNode","getElementById"]);D(Document.prototype,xb)};var zb=B({get childNodes(){return this.__shady_childNodes},get firstChild(){return this.__shady_firstChild},get lastChild(){return this.__shady_lastChild},get textContent(){return this.__shady_textContent},set textContent(a){this.__shady_textContent=a},get childElementCount(){return this.__shady_childElementCount},get children(){return this.__shady_children},get firstElementChild(){return this.__shady_firstElementChild},get lastElementChild(){return this.__shady_lastElementChild},get innerHTML(){return this.__shady_innerHTML}, set innerHTML(a){return this.__shady_innerHTML=a},get shadowRoot(){return this.__shady_shadowRoot}}),Ab=B({get parentElement(){return this.__shady_parentElement},get parentNode(){return this.__shady_parentNode},get nextSibling(){return this.__shady_nextSibling},get previousSibling(){return this.__shady_previousSibling},get nextElementSibling(){return this.__shady_nextElementSibling},get previousElementSibling(){return this.__shady_previousElementSibling},get className(){return this.__shady_className}, set className(a){return this.__shady_className=a}}),Bb;for(Bb in zb)zb[Bb].enumerable=!1;for(var Cb in Ab)Ab[Cb].enumerable=!1;var Db=w.m||w.J,Eb=Db?function(){}:function(a){var b=u(a);b.la||(b.la=!0,A(a,Ab))},Fb=Db?function(){}:function(a){var b=u(a);b.ka||(b.ka=!0,A(a,zb))};var Gb="__eventWrappers"+Date.now(),Hb=function(){var a=Object.getOwnPropertyDescriptor(Event.prototype,"composed");return a?function(b){return a.get.call(b)}:null}(),Ib={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0, pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0},Jb={DOMAttrModified:!0,DOMAttributeNameChanged:!0,DOMCharacterDataModified:!0,DOMElementNameChanged:!0,DOMNodeInserted:!0,DOMNodeInsertedIntoDocument:!0,DOMNodeRemoved:!0,DOMNodeRemovedFromDocument:!0,DOMSubtreeModified:!0}; function Kb(a){return a instanceof Node?a.__shady_getRootNode():a}function Lb(a,b){var c=[],d=a;for(a=Kb(a);d;)c.push(d),d.__shady_assignedSlot?d=d.__shady_assignedSlot:d.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&d.host&&(b||d!==a)?d=d.host:d=d.__shady_parentNode;c[c.length-1]===document&&c.push(window);return c}function Mb(a){a.__composedPath||(a.__composedPath=Lb(a.target,!0));return a.__composedPath} function Nb(a,b){if(!z)return a;a=Lb(a,!0);for(var c=0,d,e=void 0,f,g=void 0;c<b.length;c++)if(d=b[c],f=Kb(d),f!==e&&(g=a.indexOf(f),e=f),!z(f)||-1<g)return d}function Ob(a){function b(b,d){b=new a(b,d);b.__composed=d&&!!d.composed;return b}b.__proto__=a;b.prototype=a.prototype;return b}var Pb={focus:!0,blur:!0};function Qb(a){return a.__target!==a.target||a.__relatedTarget!==a.relatedTarget} function Rb(a,b,c){if(c=b.__handlers&&b.__handlers[a.type]&&b.__handlers[a.type][c])for(var d=0,e;(e=c[d])&&(!Qb(a)||a.target!==a.relatedTarget)&&(e.call(b,a),!a.__immediatePropagationStopped);d++);} function Sb(a){var b=a.composedPath();Object.defineProperty(a,"currentTarget",{get:function(){return d},configurable:!0});for(var c=b.length-1;0<=c;c--){var d=b[c];Rb(a,d,"capture");if(a.Z)return}Object.defineProperty(a,"eventPhase",{get:function(){return Event.AT_TARGET}});var e;for(c=0;c<b.length;c++){d=b[c];var f=v(d);f=f&&f.root;if(0===c||f&&f===e)if(Rb(a,d,"bubble"),d!==window&&(e=d.__shady_getRootNode()),a.Z)break}} function Tb(a,b,c,d,e,f){for(var g=0;g<a.length;g++){var h=a[g],k=h.type,l=h.capture,m=h.once,q=h.passive;if(b===h.node&&c===k&&d===l&&e===m&&f===q)return g}return-1} function Ub(a,b,c){if(b){var d=typeof b;if("function"===d||"object"===d)if("object"!==d||b.handleEvent&&"function"===typeof b.handleEvent){if(Jb[a])return this.__shady_native_addEventListener(a,b,c);if(c&&"object"===typeof c){var e=!!c.capture;var f=!!c.once;var g=!!c.passive}else e=!!c,g=f=!1;var h=c&&c.$||this,k=b[Gb];if(k){if(-1<Tb(k,h,a,e,f,g))return}else b[Gb]=[];k=function(e){f&&this.__shady_removeEventListener(a,b,c);e.__target||Vb(e);if(h!==this){var g=Object.getOwnPropertyDescriptor(e,"currentTarget"); Object.defineProperty(e,"currentTarget",{get:function(){return h},configurable:!0})}e.__previousCurrentTarget=e.currentTarget;if(!z(h)||-1!=e.composedPath().indexOf(h))if(e.composed||-1<e.composedPath().indexOf(h))if(Qb(e)&&e.target===e.relatedTarget)e.eventPhase===Event.BUBBLING_PHASE&&e.stopImmediatePropagation();else if(e.eventPhase===Event.CAPTURING_PHASE||e.bubbles||e.target===h||h instanceof Window){var k="function"===d?b.call(h,e):b.handleEvent&&b.handleEvent(e);h!==this&&(g?(Object.defineProperty(e, "currentTarget",g),g=null):delete e.currentTarget);return k}};b[Gb].push({node:h,type:a,capture:e,once:f,passive:g,Ya:k});Pb[a]?(this.__handlers=this.__handlers||{},this.__handlers[a]=this.__handlers[a]||{capture:[],bubble:[]},this.__handlers[a][e?"capture":"bubble"].push(k)):this.__shady_native_addEventListener(a,k,c)}}} function Wb(a,b,c){if(b){if(Jb[a])return this.__shady_native_removeEventListener(a,b,c);if(c&&"object"===typeof c){var d=!!c.capture;var e=!!c.once;var f=!!c.passive}else d=!!c,f=e=!1;var g=c&&c.$||this,h=void 0;var k=null;try{k=b[Gb]}catch(l){}k&&(e=Tb(k,g,a,d,e,f),-1<e&&(h=k.splice(e,1)[0].Ya,k.length||(b[Gb]=void 0)));this.__shady_native_removeEventListener(a,h||b,c);h&&Pb[a]&&this.__handlers&&this.__handlers[a]&&(a=this.__handlers[a][d?"capture":"bubble"],h=a.indexOf(h),-1<h&&a.splice(h,1))}} function Xb(){for(var a in Pb)window.__shady_native_addEventListener(a,function(a){a.__target||(Vb(a),Sb(a))},!0)} var Yb=B({get composed(){void 0===this.__composed&&(Hb?this.__composed="focusin"===this.type||"focusout"===this.type||Hb(this):!1!==this.isTrusted&&(this.__composed=Ib[this.type]));return this.__composed||!1},composedPath:function(){this.__composedPath||(this.__composedPath=Lb(this.__target,this.composed));return this.__composedPath},get target(){return Nb(this.currentTarget||this.__previousCurrentTarget,this.composedPath())},get relatedTarget(){if(!this.__relatedTarget)return null;this.__relatedTargetComposedPath|| (this.__relatedTargetComposedPath=Lb(this.__relatedTarget,!0));return Nb(this.currentTarget||this.__previousCurrentTarget,this.__relatedTargetComposedPath)},stopPropagation:function(){Event.prototype.stopPropagation.call(this);this.Z=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this);this.Z=this.__immediatePropagationStopped=!0}}); function Vb(a){a.__target=a.target;a.__relatedTarget=a.relatedTarget;if(w.m){var b=Object.getPrototypeOf(a);if(!Object.hasOwnProperty(b,"__shady_patchedProto")){var c=Object.create(b);c.__shady_sourceProto=b;A(c,Yb);b.__shady_patchedProto=c}a.__proto__=b.__shady_patchedProto}else A(a,Yb)}var Zb=Ob(Event),$b=Ob(CustomEvent),ac=Ob(MouseEvent); function bc(){if(!Hb&&Object.getOwnPropertyDescriptor(Event.prototype,"isTrusted")){var a=function(){var a=new MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0});this.__shady_dispatchEvent(a)};Element.prototype.click?Element.prototype.click=a:HTMLElement.prototype.click&&(HTMLElement.prototype.click=a)}}var cc=Object.getOwnPropertyNames(Document.prototype).filter(function(a){return"on"===a.substring(0,2)});function dc(a,b){return{index:a,L:[],R:b}} function ec(a,b,c,d){var e=0,f=0,g=0,h=0,k=Math.min(b-e,d-f);if(0==e&&0==f)a:{for(g=0;g<k;g++)if(a[g]!==c[g])break a;g=k}if(b==a.length&&d==c.length){h=a.length;for(var l=c.length,m=0;m<k-g&&fc(a[--h],c[--l]);)m++;h=m}e+=g;f+=g;b-=h;d-=h;if(0==b-e&&0==d-f)return[];if(e==b){for(b=dc(e,0);f<d;)b.L.push(c[f++]);return[b]}if(f==d)return[dc(e,b-e)];k=e;g=f;d=d-g+1;h=b-k+1;b=Array(d);for(l=0;l<d;l++)b[l]=Array(h),b[l][0]=l;for(l=0;l<h;l++)b[0][l]=l;for(l=1;l<d;l++)for(m=1;m<h;m++)if(a[k+m-1]===c[g+l-1])b[l][m]= b[l-1][m-1];else{var q=b[l-1][m]+1,x=b[l][m-1]+1;b[l][m]=q<x?q:x}k=b.length-1;g=b[0].length-1;d=b[k][g];for(a=[];0<k||0<g;)0==k?(a.push(2),g--):0==g?(a.push(3),k--):(h=b[k-1][g-1],l=b[k-1][g],m=b[k][g-1],q=l<m?l<h?l:h:m<h?m:h,q==h?(h==d?a.push(0):(a.push(1),d=h),k--,g--):q==l?(a.push(3),k--,d=l):(a.push(2),g--,d=m));a.reverse();b=void 0;k=[];for(g=0;g<a.length;g++)switch(a[g]){case 0:b&&(k.push(b),b=void 0);e++;f++;break;case 1:b||(b=dc(e,0));b.R++;e++;b.L.push(c[f]);f++;break;case 2:b||(b=dc(e,0)); b.R++;e++;break;case 3:b||(b=dc(e,0)),b.L.push(c[f]),f++}b&&k.push(b);return k}function fc(a,b){return a===b};function gc(a,b,c){Eb(a);c=c||null;var d=u(a),e=u(b),f=c?u(c):null;d.previousSibling=c?f.previousSibling:b.__shady_lastChild;if(f=v(d.previousSibling))f.nextSibling=a;if(f=v(d.nextSibling=c))f.previousSibling=a;d.parentNode=b;c?c===e.firstChild&&(e.firstChild=a):(e.lastChild=a,e.firstChild||(e.firstChild=a));e.childNodes=null} function hc(a,b,c){Fb(b);var d=u(b);void 0!==d.firstChild&&(d.childNodes=null);if(a.nodeType===Node.DOCUMENT_FRAGMENT_NODE){d=a.__shady_childNodes;for(var e=0;e<d.length;e++)gc(d[e],b,c);a=u(a);b=void 0!==a.firstChild?null:void 0;a.firstChild=a.lastChild=b;a.childNodes=b}else gc(a,b,c)} function ic(a,b){var c=u(a);b=u(b);a===b.firstChild&&(b.firstChild=c.nextSibling);a===b.lastChild&&(b.lastChild=c.previousSibling);a=c.previousSibling;var d=c.nextSibling;a&&(u(a).nextSibling=d);d&&(u(d).previousSibling=a);c.parentNode=c.previousSibling=c.nextSibling=void 0;void 0!==b.childNodes&&(b.childNodes=null)} function jc(a){var b=u(a);if(void 0===b.firstChild){b.childNodes=null;var c=b.firstChild=a.__shady_native_firstChild||null;b.lastChild=a.__shady_native_lastChild||null;Fb(a);b=c;for(c=void 0;b;b=b.__shady_native_nextSibling){var d=u(b);d.parentNode=a;d.nextSibling=b.__shady_native_nextSibling||null;d.previousSibling=c||null;c=b;Eb(b)}}};var kc=null;function G(){kc||(kc=window.ShadyCSS&&window.ShadyCSS.ScopingShim);return kc||null}function lc(a,b){var c=G();c&&c.unscopeNode(a,b)}function mc(a,b){var c=G();if(!c)return!0;if(a.nodeType===Node.DOCUMENT_FRAGMENT_NODE){c=!0;a=a.__shady_childNodes;for(var d=0;c&&d<a.length;d++)c=c&&mc(a[d],b);return c}return a.nodeType!==Node.ELEMENT_NODE?!0:c.currentScopeForNode(a)===b}function nc(a){if(a.nodeType!==Node.ELEMENT_NODE)return"";var b=G();return b?b.currentScopeForNode(a):""} function oc(a,b){if(a){a.nodeType===Node.ELEMENT_NODE&&b(a);a=a.__shady_childNodes;for(var c=0,d;c<a.length;c++)d=a[c],d.nodeType===Node.ELEMENT_NODE&&oc(d,b)}};var pc=window.document,qc=w.oa,rc=Object.getOwnPropertyDescriptor(Node.prototype,"isConnected"),sc=rc&&rc.get;function tc(a){for(var b;b=a.__shady_firstChild;)a.__shady_removeChild(b)}function uc(a){var b=v(a);if(b&&void 0!==b.K){b=a.__shady_childNodes;for(var c=0,d=b.length,e=void 0;c<d&&(e=b[c]);c++)uc(e)}if(a=v(a))a.K=void 0}function vc(a){var b=a;a&&"slot"===a.localName&&(b=(b=(b=v(a))&&b.D)&&b.length?b[0]:vc(a.__shady_nextSibling));return b} function wc(a,b,c){if(a=(a=v(a))&&a.H)b&&a.addedNodes.push(b),c&&a.removedNodes.push(c),ab(a)} var Cc=B({get parentNode(){var a=v(this);a=a&&a.parentNode;return void 0!==a?a:this.__shady_native_parentNode},get firstChild(){var a=v(this);a=a&&a.firstChild;return void 0!==a?a:this.__shady_native_firstChild},get lastChild(){var a=v(this);a=a&&a.lastChild;return void 0!==a?a:this.__shady_native_lastChild},get nextSibling(){var a=v(this);a=a&&a.nextSibling;return void 0!==a?a:this.__shady_native_nextSibling},get previousSibling(){var a=v(this);a=a&&a.previousSibling;return void 0!==a?a:this.__shady_native_previousSibling}, get childNodes(){if(y(this)){var a=v(this);if(!a.childNodes){a.childNodes=[];for(var b=this.__shady_firstChild;b;b=b.__shady_nextSibling)a.childNodes.push(b)}var c=a.childNodes}else c=this.__shady_native_childNodes;c.item=function(a){return c[a]};return c},get parentElement(){var a=v(this);(a=a&&a.parentNode)&&a.nodeType!==Node.ELEMENT_NODE&&(a=null);return void 0!==a?a:this.__shady_native_parentElement},get isConnected(){if(sc&&sc.call(this))return!0;if(this.nodeType==Node.DOCUMENT_FRAGMENT_NODE)return!1; var a=this.ownerDocument;if(Ta){if(a.__shady_native_contains(this))return!0}else if(a.documentElement&&a.documentElement.__shady_native_contains(this))return!0;for(a=this;a&&!(a instanceof Document);)a=a.__shady_parentNode||(z(a)?a.host:void 0);return!!(a&&a instanceof Document)},get textContent(){if(y(this)){for(var a=[],b=0,c=this.__shady_childNodes,d;d=c[b];b++)d.nodeType!==Node.COMMENT_NODE&&a.push(d.__shady_textContent);return a.join("")}return this.__shady_native_textContent},set textContent(a){if("undefined"=== typeof a||null===a)a="";switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:if(!y(this)&&w.m){var b=this.__shady_firstChild;(b!=this.__shady_lastChild||b&&b.nodeType!=Node.TEXT_NODE)&&tc(this);this.__shady_native_textContent=a}else tc(this),(0<a.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_insertBefore(document.createTextNode(a));break;default:this.nodeValue=a}},insertBefore:function(a,b){if(this.ownerDocument!==pc&&a.ownerDocument!==pc)return this.__shady_native_insertBefore(a, b),a;if(a===this)throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if(b){var c=v(b);c=c&&c.parentNode;if(void 0!==c&&c!==this||void 0===c&&b.__shady_native_parentNode!==this)throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.");}if(b===a)return a;var d=[],e=(c=xc(this))?c.host.localName:nc(this),f=a.__shady_parentNode;if(f){var g=nc(a);f.__shady_removeChild(a,!!c|| !xc(a))}f=!0;var h=(!qc||void 0===a.__noInsertionPoint)&&!mc(a,e),k=c&&!a.__noInsertionPoint&&(!qc||a.nodeType===Node.DOCUMENT_FRAGMENT_NODE);if(k||h)h&&(g=g||nc(a)),oc(a,function(a){k&&"slot"===a.localName&&d.push(a);if(h){var b=g;G()&&(b&&lc(a,b),(b=G())&&b.scopeNode(a,e))}});if("slot"===this.localName||d.length)d.length&&(c.c=c.c||[],c.a=c.a||[],c.b=c.b||{},c.c.push.apply(c.c,d instanceof Array?d:ja(ia(d)))),c&&Ac(c);y(this)&&(hc(a,this,b),c=v(this),La(this)?(Ac(c.root),f=!1):c.root&&(f=!1));f? (c=z(this)?this.host:this,b?(b=vc(b),c.__shady_native_insertBefore(a,b)):c.__shady_native_appendChild(a)):a.ownerDocument!==this.ownerDocument&&this.ownerDocument.adoptNode(a);wc(this,a);return a},appendChild:function(a){return this.__shady_insertBefore(a)},removeChild:function(a,b){b=void 0===b?!1:b;if(this.ownerDocument!==pc)return this.__shady_native_removeChild(a);if(a.__shady_parentNode!==this)throw Error("The node to be removed is not a child of this node: "+a);var c=xc(a),d=c&&Bc(c,a),e=v(this); if(y(this)&&(ic(a,this),La(this))){Ac(e.root);var f=!0}if(G()&&!b&&c){var g=nc(a);oc(a,function(a){lc(a,g)})}uc(a);c&&((b=this&&"slot"===this.localName)&&(f=!0),(d||b)&&Ac(c));f||(f=z(this)?this.host:this,(!e.root&&"slot"!==a.localName||f===a.__shady_native_parentNode)&&f.__shady_native_removeChild(a));wc(this,null,a);return a},replaceChild:function(a,b){this.__shady_insertBefore(a,b);this.__shady_removeChild(b);return a},cloneNode:function(a){if("template"==this.localName)return this.__shady_native_cloneNode(a); var b=this.__shady_native_cloneNode(!1);if(a&&b.nodeType!==Node.ATTRIBUTE_NODE){a=this.__shady_childNodes;for(var c=0,d;c<a.length;c++)d=a[c].__shady_cloneNode(!0),b.__shady_appendChild(d)}return b},getRootNode:function(a){if(this&&this.nodeType){var b=u(this),c=b.K;void 0===c&&(z(this)?(c=this,b.K=c):(c=(c=this.__shady_parentNode)?c.__shady_getRootNode(a):this,document.documentElement.__shady_native_contains(this)&&(b.K=c)));return c}},contains:function(a){return Ua(this,a)}});function Dc(a,b,c){var d=[];Ec(a.__shady_childNodes,b,c,d);return d}function Ec(a,b,c,d){for(var e=0,f=a.length,g=void 0;e<f&&(g=a[e]);e++){var h;if(h=g.nodeType===Node.ELEMENT_NODE){h=g;var k=b,l=c,m=d,q=k(h);q&&m.push(h);l&&l(q)?h=q:(Ec(h.__shady_childNodes,k,l,m),h=void 0)}if(h)break}} var Fc=B({get firstElementChild(){var a=v(this);if(a&&void 0!==a.firstChild){for(a=this.__shady_firstChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.__shady_nextSibling;return a}return this.__shady_native_firstElementChild},get lastElementChild(){var a=v(this);if(a&&void 0!==a.lastChild){for(a=this.__shady_lastChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.__shady_previousSibling;return a}return this.__shady_native_lastElementChild},get children(){return y(this)?Va(Array.prototype.filter.call(this.__shady_childNodes, function(a){return a.nodeType===Node.ELEMENT_NODE})):this.__shady_native_children},get childElementCount(){var a=this.__shady_children;return a?a.length:0}}),Gc=B({querySelector:function(a){return Dc(this,function(b){return Oa.call(b,a)},function(a){return!!a})[0]||null},querySelectorAll:function(a,b){if(b){b=Array.prototype.slice.call(this.__shady_native_querySelectorAll(a));var c=this.__shady_getRootNode();return b.filter(function(a){return a.__shady_getRootNode()==c})}return Dc(this,function(b){return Oa.call(b, a)})}}),Hc=w.oa?Object.assign({},Fc):Fc;Object.assign(Fc,Gc);var Ic=B({getElementById:function(a){return""===a?null:Dc(this,function(b){return b.id==a},function(a){return!!a})[0]||null}});var Jc=B({get activeElement(){var a=w.m?document.__shady_native_activeElement:document.activeElement;if(!a||!a.nodeType)return null;var b=!!z(this);if(!(this===document||b&&this.host!==a&&this.host.__shady_native_contains(a)))return null;for(b=xc(a);b&&b!==this;)a=b.host,b=xc(a);return this===document?b?null:a:b===this?a:null}});var Kc=document.implementation.createHTMLDocument("inert"),Lc=B({get innerHTML(){return y(this)?kb("template"===this.localName?this.content:this,function(a){return a.__shady_childNodes}):this.__shady_native_innerHTML},set innerHTML(a){if("template"===this.localName)this.__shady_native_innerHTML=a;else{tc(this);var b=this.localName||"div";b=this.namespaceURI&&this.namespaceURI!==Kc.namespaceURI?Kc.createElementNS(this.namespaceURI,b):Kc.createElement(b);for(w.m?b.__shady_native_innerHTML=a:b.innerHTML= a;a=b.__shady_firstChild;)this.__shady_insertBefore(a)}}});var Mc=B({addEventListener:function(a,b,c){"object"!==typeof c&&(c={capture:!!c});c.$=this;this.host.__shady_addEventListener(a,b,c)},removeEventListener:function(a,b,c){"object"!==typeof c&&(c={capture:!!c});c.$=this;this.host.__shady_removeEventListener(a,b,c)}});function Nc(a,b){A(a,Mc,b);A(a,Jc,b);A(a,Lc,b);A(a,Fc,b);w.J&&!b?(A(a,Cc,b),A(a,Ic,b)):w.m||(A(a,Ab),A(a,zb))};var Oc={},Pc=w.deferConnectionCallbacks&&"loading"===document.readyState,Qc;function Rc(a){var b=[];do b.unshift(a);while(a=a.__shady_parentNode);return b} function Sc(a,b,c){if(a!==Oc)throw new TypeError("Illegal constructor");this.za="ShadyRoot";this.host=b;this.mode=c&&c.mode;jc(b);a=u(b);a.root=this;a.pa="closed"!==this.mode?this:null;a=u(this);a.firstChild=a.lastChild=a.parentNode=a.nextSibling=a.previousSibling=null;a.childNodes=[];this.ba=this.B=!1;this.c=this.b=this.a=null;if(w.preferPerformance)for(;a=b.__shady_native_firstChild;)b.__shady_native_removeChild(a);else Ac(this)}function Ac(a){a.B||(a.B=!0,Ya(function(){return Tc(a)}))} function Tc(a){var b;if(b=a.B){for(var c;a;)a:{a.B&&(c=a),b=a;a=b.host.__shady_getRootNode();if(z(a)&&(b=v(b.host))&&0<b.N)break a;a=void 0}b=c}(c=b)&&c._renderSelf()} Sc.prototype._renderSelf=function(){var a=Pc;Pc=!0;this.B=!1;if(this.a){Uc(this);for(var b=0,c;b<this.a.length;b++){c=this.a[b];var d=v(c),e=d.assignedNodes;d.assignedNodes=[];d.D=[];if(d.ca=e)for(d=0;d<e.length;d++){var f=v(e[d]);f.P=f.assignedSlot;f.assignedSlot===c&&(f.assignedSlot=null)}}for(b=this.host.__shady_firstChild;b;b=b.__shady_nextSibling)Vc(this,b);for(b=0;b<this.a.length;b++){c=this.a[b];e=v(c);if(!e.assignedNodes.length)for(d=c.__shady_firstChild;d;d=d.__shady_nextSibling)Vc(this, d,c);(d=(d=v(c.__shady_parentNode))&&d.root)&&(Ma(d)||d.B)&&d._renderSelf();Wc(this,e.D,e.assignedNodes);if(d=e.ca){for(f=0;f<d.length;f++)v(d[f]).P=null;e.ca=null;d.length>e.assignedNodes.length&&(e.T=!0)}e.T&&(e.T=!1,Xc(this,c))}c=this.a;b=[];for(e=0;e<c.length;e++)d=c[e].__shady_parentNode,(f=v(d))&&f.root||!(0>b.indexOf(d))||b.push(d);for(c=0;c<b.length;c++){f=b[c];e=f===this?this.host:f;d=[];f=f.__shady_childNodes;for(var g=0;g<f.length;g++){var h=f[g];if("slot"==h.localName){h=v(h).D;for(var k= 0;k<h.length;k++)d.push(h[k])}else d.push(h)}f=Array.prototype.slice.call(e.__shady_native_childNodes);g=ec(d,d.length,f,f.length);k=h=0;for(var l=void 0;h<g.length&&(l=g[h]);h++){for(var m=0,q=void 0;m<l.L.length&&(q=l.L[m]);m++)q.__shady_native_parentNode===e&&e.__shady_native_removeChild(q),f.splice(l.index+k,1);k-=l.R}k=0;for(l=void 0;k<g.length&&(l=g[k]);k++)for(h=f[l.index],m=l.index;m<l.index+l.R;m++)q=d[m],e.__shady_native_insertBefore(q,h),f.splice(m,0,q)}}if(!w.preferPerformance&&!this.ba)for(b= this.host.__shady_childNodes,c=0,e=b.length;c<e;c++)d=b[c],f=v(d),d.__shady_native_parentNode!==this.host||"slot"!==d.localName&&f.assignedSlot||this.host.__shady_native_removeChild(d);this.ba=!0;Pc=a;Qc&&Qc()};function Vc(a,b,c){var d=u(b),e=d.P;d.P=null;c||(c=(a=a.b[b.__shady_slot||"__catchall"])&&a[0]);c?(u(c).assignedNodes.push(b),d.assignedSlot=c):d.assignedSlot=void 0;e!==d.assignedSlot&&d.assignedSlot&&(u(d.assignedSlot).T=!0)} function Wc(a,b,c){for(var d=0,e=void 0;d<c.length&&(e=c[d]);d++)if("slot"==e.localName){var f=v(e).assignedNodes;f&&f.length&&Wc(a,b,f)}else b.push(c[d])}function Xc(a,b){b.__shady_native_dispatchEvent(new Event("slotchange"));b=v(b);b.assignedSlot&&Xc(a,b.assignedSlot)} function Uc(a){if(a.c&&a.c.length){for(var b=a.c,c,d=0;d<b.length;d++){var e=b[d];jc(e);var f=e.__shady_parentNode;jc(f);f=v(f);f.N=(f.N||0)+1;f=Yc(e);a.b[f]?(c=c||{},c[f]=!0,a.b[f].push(e)):a.b[f]=[e];a.a.push(e)}if(c)for(var g in c)a.b[g]=Zc(a.b[g]);a.c=[]}}function Yc(a){var b=a.name||a.getAttribute("name")||"__catchall";return a.wa=b} function Zc(a){return a.sort(function(a,c){a=Rc(a);for(var b=Rc(c),e=0;e<a.length;e++){c=a[e];var f=b[e];if(c!==f)return a=Array.from(c.__shady_parentNode.__shady_childNodes),a.indexOf(c)-a.indexOf(f)}})} function Bc(a,b){if(a.a){Uc(a);var c=a.b,d;for(d in c)for(var e=c[d],f=0;f<e.length;f++){var g=e[f];if(Ua(b,g)){e.splice(f,1);var h=a.a.indexOf(g);0<=h&&(a.a.splice(h,1),(h=v(g.__shady_parentNode))&&h.N&&h.N--);f--;g=v(g);if(h=g.D)for(var k=0;k<h.length;k++){var l=h[k],m=l.__shady_native_parentNode;m&&m.__shady_native_removeChild(l)}g.D=[];g.assignedNodes=[];h=!0}}return h}}function Ma(a){Uc(a);return!(!a.a||!a.a.length)} (function(a){a.__proto__=DocumentFragment.prototype;Nc(a,"__shady_");Nc(a);Object.defineProperties(a,{nodeType:{value:Node.DOCUMENT_FRAGMENT_NODE,configurable:!0},nodeName:{value:"#document-fragment",configurable:!0},nodeValue:{value:null,configurable:!0}});["localName","namespaceURI","prefix"].forEach(function(b){Object.defineProperty(a,b,{value:void 0,configurable:!0})});["ownerDocument","baseURI","isConnected"].forEach(function(b){Object.defineProperty(a,b,{get:function(){return this.host[b]}, configurable:!0})})})(Sc.prototype); if(window.customElements&&w.ea&&!w.preferPerformance){var $c=new Map;Qc=function(){var a=[];$c.forEach(function(b,c){a.push([c,b])});$c.clear();for(var b=0;b<a.length;b++){var c=a[b][0];a[b][1]?c.ua():c.va()}};Pc&&document.addEventListener("readystatechange",function(){Pc=!1;Qc()},{once:!0});var ad=function(a,b,c){var d=0,e="__isConnected"+d++;if(b||c)a.prototype.connectedCallback=a.prototype.ua=function(){Pc?$c.set(this,!0):this[e]||(this[e]=!0,b&&b.call(this))},a.prototype.disconnectedCallback= a.prototype.va=function(){Pc?this.isConnected||$c.set(this,!1):this[e]&&(this[e]=!1,c&&c.call(this))};return a},bd=window.customElements.define;Object.defineProperty(window.CustomElementRegistry.prototype,"define",{value:function(a,b){var c=b.prototype.connectedCallback,d=b.prototype.disconnectedCallback;bd.call(window.customElements,a,ad(b,c,d));b.prototype.connectedCallback=c;b.prototype.disconnectedCallback=d}})}function xc(a){a=a.__shady_getRootNode();if(z(a))return a};function cd(a){this.node=a}n=cd.prototype;n.addEventListener=function(a,b,c){return this.node.__shady_addEventListener(a,b,c)};n.removeEventListener=function(a,b,c){return this.node.__shady_removeEventListener(a,b,c)};n.appendChild=function(a){return this.node.__shady_appendChild(a)};n.insertBefore=function(a,b){return this.node.__shady_insertBefore(a,b)};n.removeChild=function(a){return this.node.__shady_removeChild(a)};n.replaceChild=function(a,b){return this.node.__shady_replaceChild(a,b)}; n.cloneNode=function(a){return this.node.__shady_cloneNode(a)};n.getRootNode=function(a){return this.node.__shady_getRootNode(a)};n.contains=function(a){return this.node.__shady_contains(a)};n.dispatchEvent=function(a){return this.node.__shady_dispatchEvent(a)};n.setAttribute=function(a,b){this.node.__shady_setAttribute(a,b)};n.getAttribute=function(a){return this.node.__shady_native_getAttribute(a)};n.hasAttribute=function(a){return this.node.__shady_native_hasAttribute(a)};n.removeAttribute=function(a){this.node.__shady_removeAttribute(a)}; n.attachShadow=function(a){return this.node.__shady_attachShadow(a)};n.focus=function(){this.node.__shady_native_focus()};n.blur=function(){this.node.__shady_blur()};n.importNode=function(a,b){if(this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_importNode(a,b)};n.getElementById=function(a){if(this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_getElementById(a)};n.querySelector=function(a){return this.node.__shady_querySelector(a)}; n.querySelectorAll=function(a,b){return this.node.__shady_querySelectorAll(a,b)};n.assignedNodes=function(a){if("slot"===this.node.localName)return this.node.__shady_assignedNodes(a)}; p.Object.defineProperties(cd.prototype,{activeElement:{configurable:!0,enumerable:!0,get:function(){if(z(this.node)||this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_activeElement}},_activeElement:{configurable:!0,enumerable:!0,get:function(){return this.activeElement}},host:{configurable:!0,enumerable:!0,get:function(){if(z(this.node))return this.node.host}},parentNode:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_parentNode}},firstChild:{configurable:!0, enumerable:!0,get:function(){return this.node.__shady_firstChild}},lastChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_lastChild}},nextSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_nextSibling}},previousSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_previousSibling}},childNodes:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_childNodes}},parentElement:{configurable:!0,enumerable:!0, get:function(){return this.node.__shady_parentElement}},firstElementChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_firstElementChild}},lastElementChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_lastElementChild}},nextElementSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_nextElementSibling}},previousElementSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_previousElementSibling}}, children:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_children}},childElementCount:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_childElementCount}},shadowRoot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_shadowRoot}},assignedSlot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_assignedSlot}},isConnected:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_isConnected}},innerHTML:{configurable:!0, enumerable:!0,get:function(){return this.node.__shady_innerHTML},set:function(a){this.node.__shady_innerHTML=a}},textContent:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_textContent},set:function(a){this.node.__shady_textContent=a}},slot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_slot},set:function(a){this.node.__shady_slot=a}}}); cc.forEach(function(a){Object.defineProperty(cd.prototype,a,{get:function(){return this.node["__shady_"+a]},set:function(b){this.node["__shady_"+a]=b},configurable:!0})});var dd=new WeakMap;function ed(a){if(z(a)||a instanceof cd)return a;var b=dd.get(a);b||(b=new cd(a),dd.set(a,b));return b};var fd=B({dispatchEvent:function(a){Za();return this.__shady_native_dispatchEvent(a)},addEventListener:Ub,removeEventListener:Wb});var gd=B({get assignedSlot(){var a=this.__shady_parentNode;(a=a&&a.__shady_shadowRoot)&&Tc(a);return(a=v(this))&&a.assignedSlot||null}});var hd=window.document;function id(a,b){if("slot"===b)a=a.__shady_parentNode,La(a)&&Ac(v(a).root);else if("slot"===a.localName&&"name"===b&&(b=xc(a))){if(b.a){Uc(b);var c=a.wa,d=Yc(a);if(d!==c){c=b.b[c];var e=c.indexOf(a);0<=e&&c.splice(e,1);c=b.b[d]||(b.b[d]=[]);c.push(a);1<c.length&&(b.b[d]=Zc(c))}}Ac(b)}} var jd=B({get previousElementSibling(){var a=v(this);if(a&&void 0!==a.previousSibling){for(a=this.__shady_previousSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.__shady_previousSibling;return a}return this.__shady_native_previousElementSibling},get nextElementSibling(){var a=v(this);if(a&&void 0!==a.nextSibling){for(a=this.__shady_nextSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.__shady_nextSibling;return a}return this.__shady_native_nextElementSibling},get slot(){return this.getAttribute("slot")}, set slot(a){this.__shady_setAttribute("slot",a)},get shadowRoot(){var a=v(this);return a&&a.pa||null},get className(){return this.getAttribute("class")||""},set className(a){this.__shady_setAttribute("class",a)},setAttribute:function(a,b){if(this.ownerDocument!==hd)this.__shady_native_setAttribute(a,b);else{var c;(c=G())&&"class"===a?(c.setElementClass(this,b),c=!0):c=!1;c||(this.__shady_native_setAttribute(a,b),id(this,a))}},removeAttribute:function(a){this.__shady_native_removeAttribute(a);id(this, a)},attachShadow:function(a){if(!this)throw Error("Must provide a host.");if(!a)throw Error("Not enough arguments.");return new Sc(Oc,this,a)}});var kd=B({blur:function(){var a=v(this);(a=(a=a&&a.root)&&a.activeElement)?a.__shady_blur():this.__shady_native_blur()}});cc.forEach(function(a){kd[a]={set:function(b){var c=u(this),d=a.substring(2);c.O[a]&&this.removeEventListener(d,c.O[a]);this.__shady_addEventListener(d,b);c.O[a]=b},get:function(){var b=v(this);return b&&b.O[a]},configurable:!0}});var ld=B({assignedNodes:function(a){if("slot"===this.localName){var b=this.__shady_getRootNode();b&&z(b)&&Tc(b);return(b=v(this))?(a&&a.flatten?b.D:b.assignedNodes)||[]:[]}}});var md=window.document,nd=B({importNode:function(a,b){if(a.ownerDocument!==md||"template"===a.localName)return this.__shady_native_importNode(a,b);var c=this.__shady_native_importNode(a,!1);if(b){a=a.__shady_childNodes;b=0;for(var d;b<a.length;b++)d=this.__shady_importNode(a[b],!0),c.__shady_appendChild(d)}return c}});var od=B({addEventListener:Ub.bind(window),removeEventListener:Wb.bind(window)});var pd={};Object.getOwnPropertyDescriptor(HTMLElement.prototype,"parentElement")&&(pd.parentElement=Cc.parentElement);Object.getOwnPropertyDescriptor(HTMLElement.prototype,"contains")&&(pd.contains=Cc.contains);Object.getOwnPropertyDescriptor(HTMLElement.prototype,"children")&&(pd.children=Fc.children);Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML")&&(pd.innerHTML=Lc.innerHTML);Object.getOwnPropertyDescriptor(HTMLElement.prototype,"className")&&(pd.className=jd.className); var qd={EventTarget:[fd],Node:[Cc,window.EventTarget?null:fd],Text:[gd],Element:[jd,Fc,gd,!w.m||"innerHTML"in Element.prototype?Lc:null,window.HTMLSlotElement?null:ld],HTMLElement:[kd,pd],HTMLSlotElement:[ld],DocumentFragment:[Hc,Ic],Document:[nd,Hc,Ic,Jc],Window:[od]},rd=w.m?null:["innerHTML","textContent"];function sd(a){var b=a?null:rd,c={},d;for(d in qd)c.W=window[d]&&window[d].prototype,qd[d].forEach(function(c){return function(d){return c.W&&d&&A(c.W,d,a,b)}}(c)),c={W:c.W}};if(w.ea){var ShadyDOM={inUse:w.ea,patch:function(a){Fb(a);Eb(a);return a},isShadyRoot:z,enqueue:Ya,flush:Za,flushInitial:function(a){!a.ba&&a.B&&Tc(a)},settings:w,filterMutations:db,observeChildren:bb,unobserveChildren:cb,deferConnectionCallbacks:w.deferConnectionCallbacks,preferPerformance:w.preferPerformance,handlesDynamicScoping:!0,wrap:w.J?ed:function(a){return a},Wrapper:cd,composedPath:Mb,noPatch:w.J,nativeMethods:qb,nativeTree:rb};window.ShadyDOM=ShadyDOM;yb();sd("__shady_");Object.defineProperty(document, "_activeElement",Jc.activeElement);A(Window.prototype,od,"__shady_");w.J||(sd(),bc());Xb();window.Event=Zb;window.CustomEvent=$b;window.MouseEvent=ac;window.ShadowRoot=Sc};var td=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function ud(a){var b=td.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return!b&&a}function H(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return!(!a||!(a.__CE_isImportDocument||a instanceof Document))} function vd(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null} function wd(a,b,c){c=void 0===c?new Set:c;for(var d=a;d;){if(d.nodeType===Node.ELEMENT_NODE){var e=d;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){d=e.import;if(d instanceof Node&&!c.has(d))for(c.add(d),d=d.firstChild;d;d=d.nextSibling)wd(d,b,c);d=vd(a,e);continue}else if("template"===f){d=vd(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)wd(e,b,c)}d=d.firstChild?d.firstChild:vd(a,d)}}function I(a,b,c){a[b]=c};function xd(){this.a=new Map;this.g=new Map;this.f=[];this.c=!1}function yd(a,b,c){a.a.set(b,c);a.g.set(c.constructorFunction,c)}function zd(a,b){a.c=!0;a.f.push(b)}function Ad(a,b){a.c&&wd(b,function(b){return a.b(b)})}xd.prototype.b=function(a){if(this.c&&!a.__CE_patched){a.__CE_patched=!0;for(var b=0;b<this.f.length;b++)this.f[b](a)}};function J(a,b){var c=[];wd(b,function(a){return c.push(a)});for(b=0;b<c.length;b++){var d=c[b];1===d.__CE_state?a.connectedCallback(d):Bd(a,d)}} function K(a,b){var c=[];wd(b,function(a){return c.push(a)});for(b=0;b<c.length;b++){var d=c[b];1===d.__CE_state&&a.disconnectedCallback(d)}} function L(a,b,c){c=void 0===c?{}:c;var d=c.Xa||new Set,e=c.Y||function(b){return Bd(a,b)},f=[];wd(b,function(b){if("link"===b.localName&&"import"===b.getAttribute("rel")){var c=b.import;c instanceof Node&&(c.__CE_isImportDocument=!0,c.__CE_hasRegistry=!0);c&&"complete"===c.readyState?c.__CE_documentLoadHandled=!0:b.addEventListener("load",function(){var c=b.import;if(!c.__CE_documentLoadHandled){c.__CE_documentLoadHandled=!0;var f=new Set(d);f.delete(c);L(a,c,{Xa:f,Y:e})}})}else f.push(b)},d);if(a.c)for(b= 0;b<f.length;b++)a.b(f[b]);for(b=0;b<f.length;b++)e(f[b])} function Bd(a,b){if(void 0===b.__CE_state){var c=b.ownerDocument;if(c.defaultView||c.__CE_isImportDocument&&c.__CE_hasRegistry)if(c=a.a.get(b.localName)){c.constructionStack.push(b);var d=c.constructorFunction;try{try{if(new d!==b)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{c.constructionStack.pop()}}catch(g){throw b.__CE_state=2,g;}b.__CE_state=1;b.__CE_definition=c;if(c.attributeChangedCallback)for(c=c.observedAttributes,d=0;d<c.length;d++){var e= c[d],f=b.getAttribute(e);null!==f&&a.attributeChangedCallback(b,e,null,f,null)}H(b)&&a.connectedCallback(b)}}}xd.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a)};xd.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a)}; xd.prototype.attributeChangedCallback=function(a,b,c,d,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&f.attributeChangedCallback.call(a,b,c,d,e)};function Cd(a){var b=document;this.b=a;this.a=b;this.F=void 0;L(this.b,this.a);"loading"===this.a.readyState&&(this.F=new MutationObserver(this.c.bind(this)),this.F.observe(this.a,{childList:!0,subtree:!0}))}function Dd(a){a.F&&a.F.disconnect()}Cd.prototype.c=function(a){var b=this.a.readyState;"interactive"!==b&&"complete"!==b||Dd(this);for(b=0;b<a.length;b++)for(var c=a[b].addedNodes,d=0;d<c.length;d++)L(this.b,c[d])};function Ed(){var a=this;this.a=this.h=void 0;this.b=new Promise(function(b){a.a=b;a.h&&b(a.h)})}Ed.prototype.resolve=function(a){if(this.h)throw Error("Already resolved.");this.h=a;this.a&&this.a(a)};function N(a){this.c=!1;this.a=a;this.l=new Map;this.f=function(a){return a()};this.b=!1;this.g=[];this.da=new Cd(a)}n=N.prototype; n.sa=function(a,b){var c=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!ud(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this.a.a.get(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var d=function(a){var b=e[a];if(void 0!==b&&!(b instanceof Function))throw Error("The '"+a+"' callback must be a function."); return b},e=b.prototype;if(!(e instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var f=d("connectedCallback");var g=d("disconnectedCallback");var h=d("adoptedCallback");var k=d("attributeChangedCallback");var l=b.observedAttributes||[]}catch(m){return}finally{this.c=!1}b={localName:a,constructorFunction:b,connectedCallback:f,disconnectedCallback:g,adoptedCallback:h,attributeChangedCallback:k,observedAttributes:l,constructionStack:[]};yd(this.a, a,b);this.g.push(b);this.b||(this.b=!0,this.f(function(){return Fd(c)}))};n.Y=function(a){L(this.a,a)}; function Fd(a){if(!1!==a.b){a.b=!1;for(var b=a.g,c=[],d=new Map,e=0;e<b.length;e++)d.set(b[e].localName,[]);L(a.a,document,{Y:function(b){if(void 0===b.__CE_state){var e=b.localName,f=d.get(e);f?f.push(b):a.a.a.get(e)&&c.push(b)}}});for(e=0;e<c.length;e++)Bd(a.a,c[e]);for(;0<b.length;){var f=b.shift();e=f.localName;f=d.get(f.localName);for(var g=0;g<f.length;g++)Bd(a.a,f[g]);(e=a.l.get(e))&&e.resolve(void 0)}}}n.get=function(a){if(a=this.a.a.get(a))return a.constructorFunction}; n.ta=function(a){if(!ud(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this.l.get(a);if(b)return b.b;b=new Ed;this.l.set(a,b);this.a.a.get(a)&&!this.g.some(function(b){return b.localName===a})&&b.resolve(void 0);return b.b};n.Pa=function(a){Dd(this.da);var b=this.f;this.f=function(c){return a(function(){return b(c)})}};window.CustomElementRegistry=N;N.prototype.define=N.prototype.sa;N.prototype.upgrade=N.prototype.Y;N.prototype.get=N.prototype.get; N.prototype.whenDefined=N.prototype.ta;N.prototype.polyfillWrapFlushCallback=N.prototype.Pa;var Gd=window.Document.prototype.createElement,Hd=window.Document.prototype.createElementNS,Id=window.Document.prototype.importNode,Jd=window.Document.prototype.prepend,Kd=window.Document.prototype.append,Ld=window.DocumentFragment.prototype.prepend,Md=window.DocumentFragment.prototype.append,Nd=window.Node.prototype.cloneNode,Od=window.Node.prototype.appendChild,Pd=window.Node.prototype.insertBefore,Qd=window.Node.prototype.removeChild,Rd=window.Node.prototype.replaceChild,Sd=Object.getOwnPropertyDescriptor(window.Node.prototype, "textContent"),Td=window.Element.prototype.attachShadow,Ud=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),Vd=window.Element.prototype.getAttribute,Wd=window.Element.prototype.setAttribute,Xd=window.Element.prototype.removeAttribute,Yd=window.Element.prototype.getAttributeNS,Zd=window.Element.prototype.setAttributeNS,$d=window.Element.prototype.removeAttributeNS,ae=window.Element.prototype.insertAdjacentElement,be=window.Element.prototype.insertAdjacentHTML,ce=window.Element.prototype.prepend, de=window.Element.prototype.append,ee=window.Element.prototype.before,fe=window.Element.prototype.after,ge=window.Element.prototype.replaceWith,he=window.Element.prototype.remove,ie=window.HTMLElement,je=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),ke=window.HTMLElement.prototype.insertAdjacentElement,le=window.HTMLElement.prototype.insertAdjacentHTML;var me=new function(){};function ne(){var a=oe;window.HTMLElement=function(){function b(){var b=this.constructor,d=a.g.get(b);if(!d)throw Error("The custom element being constructed was not registered with `customElements`.");var e=d.constructionStack;if(0===e.length)return e=Gd.call(document,d.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=1,e.__CE_definition=d,a.b(e),e;d=e.length-1;var f=e[d];if(f===me)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times."); e[d]=me;Object.setPrototypeOf(f,b.prototype);a.b(f);return f}b.prototype=ie.prototype;Object.defineProperty(b.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:b});return b}()};function pe(a,b,c){function d(b){return function(c){for(var d=[],e=0;e<arguments.length;++e)d[e]=arguments[e];e=[];for(var f=[],l=0;l<d.length;l++){var m=d[l];m instanceof Element&&H(m)&&f.push(m);if(m instanceof DocumentFragment)for(m=m.firstChild;m;m=m.nextSibling)e.push(m);else e.push(m)}b.apply(this,d);for(d=0;d<f.length;d++)K(a,f[d]);if(H(this))for(d=0;d<e.length;d++)f=e[d],f instanceof Element&&J(a,f)}}void 0!==c.V&&(b.prepend=d(c.V));void 0!==c.append&&(b.append=d(c.append))};function qe(){var a=oe;I(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var c=a.a.get(b);if(c)return new c.constructorFunction}b=Gd.call(this,b);a.b(b);return b});I(Document.prototype,"importNode",function(b,c){b=Id.call(this,b,!!c);this.__CE_hasRegistry?L(a,b):Ad(a,b);return b});I(Document.prototype,"createElementNS",function(b,c){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var d=a.a.get(c);if(d)return new d.constructorFunction}b=Hd.call(this, b,c);a.b(b);return b});pe(a,Document.prototype,{V:Jd,append:Kd})};function re(){function a(a,d){Object.defineProperty(a,"textContent",{enumerable:d.enumerable,configurable:!0,get:d.get,set:function(a){if(this.nodeType===Node.TEXT_NODE)d.set.call(this,a);else{var c=void 0;if(this.firstChild){var e=this.childNodes,h=e.length;if(0<h&&H(this)){c=Array(h);for(var k=0;k<h;k++)c[k]=e[k]}}d.set.call(this,a);if(c)for(a=0;a<c.length;a++)K(b,c[a])}}})}var b=oe;I(Node.prototype,"insertBefore",function(a,d){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes); a=Pd.call(this,a,d);if(H(this))for(d=0;d<c.length;d++)J(b,c[d]);return a}c=H(a);d=Pd.call(this,a,d);c&&K(b,a);H(this)&&J(b,a);return d});I(Node.prototype,"appendChild",function(a){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);a=Od.call(this,a);if(H(this))for(var e=0;e<c.length;e++)J(b,c[e]);return a}c=H(a);e=Od.call(this,a);c&&K(b,a);H(this)&&J(b,a);return e});I(Node.prototype,"cloneNode",function(a){a=Nd.call(this,!!a);this.ownerDocument.__CE_hasRegistry?L(b,a): Ad(b,a);return a});I(Node.prototype,"removeChild",function(a){var c=H(a),e=Qd.call(this,a);c&&K(b,a);return e});I(Node.prototype,"replaceChild",function(a,d){if(a instanceof DocumentFragment){var c=Array.prototype.slice.apply(a.childNodes);a=Rd.call(this,a,d);if(H(this))for(K(b,d),d=0;d<c.length;d++)J(b,c[d]);return a}c=H(a);var f=Rd.call(this,a,d),g=H(this);g&&K(b,d);c&&K(b,a);g&&J(b,a);return f});Sd&&Sd.get?a(Node.prototype,Sd):zd(b,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){for(var a= [],b=0;b<this.childNodes.length;b++)a.push(this.childNodes[b].textContent);return a.join("")},set:function(a){for(;this.firstChild;)Qd.call(this,this.firstChild);Od.call(this,document.createTextNode(a))}})})};function se(a){function b(b){return function(c){for(var d=[],e=0;e<arguments.length;++e)d[e]=arguments[e];e=[];for(var h=[],k=0;k<d.length;k++){var l=d[k];l instanceof Element&&H(l)&&h.push(l);if(l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)e.push(l);else e.push(l)}b.apply(this,d);for(d=0;d<h.length;d++)K(a,h[d]);if(H(this))for(d=0;d<e.length;d++)h=e[d],h instanceof Element&&J(a,h)}}var c=Element.prototype;void 0!==ee&&(c.before=b(ee));void 0!==ee&&(c.after=b(fe));void 0!==ge&& I(c,"replaceWith",function(b){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];d=[];for(var g=[],h=0;h<c.length;h++){var k=c[h];k instanceof Element&&H(k)&&g.push(k);if(k instanceof DocumentFragment)for(k=k.firstChild;k;k=k.nextSibling)d.push(k);else d.push(k)}h=H(this);ge.apply(this,c);for(c=0;c<g.length;c++)K(a,g[c]);if(h)for(K(a,this),c=0;c<d.length;c++)g=d[c],g instanceof Element&&J(a,g)});void 0!==he&&I(c,"remove",function(){var b=H(this);he.call(this);b&&K(a,this)})};function te(){function a(a,b){Object.defineProperty(a,"innerHTML",{enumerable:b.enumerable,configurable:!0,get:b.get,set:function(a){var c=this,e=void 0;H(this)&&(e=[],wd(this,function(a){a!==c&&e.push(a)}));b.set.call(this,a);if(e)for(var f=0;f<e.length;f++){var g=e[f];1===g.__CE_state&&d.disconnectedCallback(g)}this.ownerDocument.__CE_hasRegistry?L(d,this):Ad(d,this);return a}})}function b(a,b){I(a,"insertAdjacentElement",function(a,c){var e=H(c);a=b.call(this,a,c);e&&K(d,c);H(a)&&J(d,c);return a})} function c(a,b){function c(a,b){for(var c=[];a!==b;a=a.nextSibling)c.push(a);for(b=0;b<c.length;b++)L(d,c[b])}I(a,"insertAdjacentHTML",function(a,d){a=a.toLowerCase();if("beforebegin"===a){var e=this.previousSibling;b.call(this,a,d);c(e||this.parentNode.firstChild,this)}else if("afterbegin"===a)e=this.firstChild,b.call(this,a,d),c(this.firstChild,e);else if("beforeend"===a)e=this.lastChild,b.call(this,a,d),c(e||this.firstChild,null);else if("afterend"===a)e=this.nextSibling,b.call(this,a,d),c(this.nextSibling, e);else throw new SyntaxError("The value provided ("+String(a)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");})}var d=oe;Td&&I(Element.prototype,"attachShadow",function(a){return this.__CE_shadowRoot=a=Td.call(this,a)});Ud&&Ud.get?a(Element.prototype,Ud):je&&je.get?a(HTMLElement.prototype,je):zd(d,function(b){a(b,{enumerable:!0,configurable:!0,get:function(){return Nd.call(this,!0).innerHTML},set:function(a){var b="template"===this.localName,c=b?this.content:this,d=Hd.call(document, this.namespaceURI,this.localName);for(d.innerHTML=a;0<c.childNodes.length;)Qd.call(c,c.childNodes[0]);for(a=b?d.content:d;0<a.childNodes.length;)Od.call(c,a.childNodes[0])}})});I(Element.prototype,"setAttribute",function(a,b){if(1!==this.__CE_state)return Wd.call(this,a,b);var c=Vd.call(this,a);Wd.call(this,a,b);b=Vd.call(this,a);d.attributeChangedCallback(this,a,c,b,null)});I(Element.prototype,"setAttributeNS",function(a,b,c){if(1!==this.__CE_state)return Zd.call(this,a,b,c);var e=Yd.call(this,a, b);Zd.call(this,a,b,c);c=Yd.call(this,a,b);d.attributeChangedCallback(this,b,e,c,a)});I(Element.prototype,"removeAttribute",function(a){if(1!==this.__CE_state)return Xd.call(this,a);var b=Vd.call(this,a);Xd.call(this,a);null!==b&&d.attributeChangedCallback(this,a,b,null,null)});I(Element.prototype,"removeAttributeNS",function(a,b){if(1!==this.__CE_state)return $d.call(this,a,b);var c=Yd.call(this,a,b);$d.call(this,a,b);var e=Yd.call(this,a,b);c!==e&&d.attributeChangedCallback(this,b,c,e,a)});ke?b(HTMLElement.prototype, ke):ae?b(Element.prototype,ae):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");le?c(HTMLElement.prototype,le):be?c(Element.prototype,be):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched.");pe(d,Element.prototype,{V:ce,append:de});se(d)};var ue=window.customElements;if(!ue||ue.forcePolyfill||"function"!=typeof ue.define||"function"!=typeof ue.get){var oe=new xd;ne();qe();pe(oe,DocumentFragment.prototype,{V:Ld,append:Md});re();te();document.__CE_hasRegistry=!0;var customElements=new N(oe);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:customElements})};function ve(){this.end=this.start=0;this.rules=this.parent=this.previous=null;this.cssText=this.parsedCssText="";this.atRule=!1;this.type=0;this.parsedSelector=this.selector=this.keyframesName=""} function we(a){a=a.replace(xe,"").replace(ye,"");var b=ze,c=a,d=new ve;d.start=0;d.end=c.length;for(var e=d,f=0,g=c.length;f<g;f++)if("{"===c[f]){e.rules||(e.rules=[]);var h=e,k=h.rules[h.rules.length-1]||null;e=new ve;e.start=f+1;e.parent=h;e.previous=k;h.rules.push(e)}else"}"===c[f]&&(e.end=f+1,e=e.parent||d);return b(d,a)} function ze(a,b){var c=b.substring(a.start,a.end-1);a.parsedCssText=a.cssText=c.trim();a.parent&&(c=b.substring(a.previous?a.previous.end:a.parent.start,a.start-1),c=Ae(c),c=c.replace(Be," "),c=c.substring(c.lastIndexOf(";")+1),c=a.parsedSelector=a.selector=c.trim(),a.atRule=0===c.indexOf("@"),a.atRule?0===c.indexOf("@media")?a.type=Ce:c.match(De)&&(a.type=Ee,a.keyframesName=a.selector.split(Be).pop()):a.type=0===c.indexOf("--")?Fe:Ge);if(c=a.rules)for(var d=0,e=c.length,f=void 0;d<e&&(f=c[d]);d++)ze(f, b);return a}function Ae(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,c){a=c;for(c=6-a.length;c--;)a="0"+a;return"\\"+a})} function He(a,b,c){c=void 0===c?"":c;var d="";if(a.cssText||a.rules){var e=a.rules,f;if(f=e)f=e[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var g=e.length,h=void 0;f<g&&(h=e[f]);f++)d=He(h,b,d)}else b?b=a.cssText:(b=a.cssText,b=b.replace(Ie,"").replace(Je,""),b=b.replace(Ke,"").replace(Le,"")),(d=b.trim())&&(d=" "+d+"\n")}d&&(a.selector&&(c+=a.selector+" {\n"),c+=d,a.selector&&(c+="}\n\n"));return c} var Ge=1,Ee=7,Ce=4,Fe=1E3,xe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ye=/@import[^;]*;/gim,Ie=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,Je=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,Ke=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,Le=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,De=/^@[^\s]*keyframes/,Be=/\s+/g;var O=!(window.ShadyDOM&&window.ShadyDOM.inUse),Me;function Ne(a){Me=a&&a.shimcssproperties?!1:O||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}var Oe;window.ShadyCSS&&void 0!==window.ShadyCSS.cssBuild&&(Oe=window.ShadyCSS.cssBuild);var Pe=!(!window.ShadyCSS||!window.ShadyCSS.disableRuntime); window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?Me=window.ShadyCSS.nativeCss:window.ShadyCSS?(Ne(window.ShadyCSS),window.ShadyCSS=void 0):Ne(window.WebComponents&&window.WebComponents.flags);var Q=Me,Qe=Oe;var Re=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,Se=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,Te=/(--[\w-]+)\s*([:,;)]|$)/gi,Ue=/(animation\s*:)|(animation-name\s*:)/,$e=/@media\s(.*)/,af=/\{[^}]*\}/g;var bf=new Set;function cf(a,b){if(!a)return"";"string"===typeof a&&(a=we(a));b&&df(a,b);return He(a,Q)}function ef(a){!a.__cssRules&&a.textContent&&(a.__cssRules=we(a.textContent));return a.__cssRules||null}function ff(a){return!!a.parent&&a.parent.type===Ee}function df(a,b,c,d){if(a){var e=!1,f=a.type;if(d&&f===Ce){var g=a.selector.match($e);g&&(window.matchMedia(g[1]).matches||(e=!0))}f===Ge?b(a):c&&f===Ee?c(a):f===Fe&&(e=!0);if((a=a.rules)&&!e)for(e=0,f=a.length,g=void 0;e<f&&(g=a[e]);e++)df(g,b,c,d)}} function gf(a,b,c,d){var e=document.createElement("style");b&&e.setAttribute("scope",b);e.textContent=a;hf(e,c,d);return e}var jf=null;function kf(a){a=document.createComment(" Shady DOM styles for "+a+" ");var b=document.head;b.insertBefore(a,(jf?jf.nextSibling:null)||b.firstChild);return jf=a}function hf(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);jf?a.compareDocumentPosition(jf)===Node.DOCUMENT_POSITION_PRECEDING&&(jf=a):jf=a} function lf(a,b){for(var c=0,d=a.length;b<d;b++)if("("===a[b])c++;else if(")"===a[b]&&0===--c)return b;return-1}function mf(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");var d=lf(a,c+3),e=a.substring(c+4,d);c=a.substring(0,c);a=mf(a.substring(d+1),b);d=e.indexOf(",");return-1===d?b(c,e.trim(),"",a):b(c,e.substring(0,d).trim(),e.substring(d+1).trim(),a)}function nf(a,b){O?a.setAttribute("class",b):window.ShadyDOM.nativeMethods.setAttribute.call(a,"class",b)} var of=window.ShadyDOM&&window.ShadyDOM.wrap||function(a){return a};function pf(a){var b=a.localName,c="";b?-1<b.indexOf("-")||(c=b,b=a.getAttribute&&a.getAttribute("is")||""):(b=a.is,c=a.extends);return{is:b,M:c}}function qf(a){for(var b=[],c="",d=0;0<=d&&d<a.length;d++)if("("===a[d]){var e=lf(a,d);c+=a.slice(d,e+1);d=e}else","===a[d]?(b.push(c),c=""):c+=a[d];c&&b.push(c);return b} function rf(a){if(void 0!==Qe)return Qe;if(void 0===a.__cssBuild){var b=a.getAttribute("css-build");if(b)a.__cssBuild=b;else{a:{b="template"===a.localName?a.content.firstChild:a.firstChild;if(b instanceof Comment&&(b=b.textContent.trim().split(":"),"css-build"===b[0])){b=b[1];break a}b=""}if(""!==b){var c="template"===a.localName?a.content.firstChild:a.firstChild;c.parentNode.removeChild(c)}a.__cssBuild=b}}return a.__cssBuild||""} function sf(a){a=void 0===a?"":a;return""!==a&&Q?O?"shadow"===a:"shady"===a:!1};function tf(){}function uf(a,b){vf(R,a,function(a){wf(a,b||"")})}function vf(a,b,c){b.nodeType===Node.ELEMENT_NODE&&c(b);var d;"template"===b.localName?d=(b.content||b._content||b).childNodes:d=b.children||b.childNodes;if(d)for(b=0;b<d.length;b++)vf(a,d[b],c)} function wf(a,b,c){if(b)if(a.classList)c?(a.classList.remove("style-scope"),a.classList.remove(b)):(a.classList.add("style-scope"),a.classList.add(b));else if(a.getAttribute){var d=a.getAttribute("class");c?d&&(b=d.replace("style-scope","").replace(b,""),nf(a,b)):nf(a,(d?d+" ":"")+"style-scope "+b)}}function xf(a,b,c){vf(R,a,function(a){wf(a,b,!0);wf(a,c)})}function yf(a,b){vf(R,a,function(a){wf(a,b||"",!0)})} function zf(a,b,c,d,e){var f=R;e=void 0===e?"":e;""===e&&(O||"shady"===(void 0===d?"":d)?e=cf(b,c):(a=pf(a),e=Af(f,b,a.is,a.M,c)+"\n\n"));return e.trim()}function Af(a,b,c,d,e){var f=Bf(c,d);c=c?"."+c:"";return cf(b,function(b){b.c||(b.selector=b.j=Cf(a,b,a.b,c,f),b.c=!0);e&&e(b,c,f)})}function Bf(a,b){return b?"[is="+a+"]":a} function Cf(a,b,c,d,e){var f=qf(b.selector);if(!ff(b)){b=0;for(var g=f.length,h=void 0;b<g&&(h=f[b]);b++)f[b]=c.call(a,h,d,e)}return f.filter(function(a){return!!a}).join(",")}function Df(a){return a.replace(Ef,function(a,c,d){-1<d.indexOf("+")?d=d.replace(/\+/g,"___"):-1<d.indexOf("___")&&(d=d.replace(/___/g,"+"));return":"+c+"("+d+")"})} function Ff(a){for(var b=[],c;c=a.match(Gf);){var d=c.index,e=lf(a,d);if(-1===e)throw Error(c.input+" selector missing ')'");c=a.slice(d,e+1);a=a.replace(c,"\ue000");b.push(c)}return{ha:a,matches:b}}function Hf(a,b){var c=a.split("\ue000");return b.reduce(function(a,b,f){return a+b+c[f+1]},c[0])} tf.prototype.b=function(a,b,c){var d=!1;a=a.trim();var e=Ef.test(a);e&&(a=a.replace(Ef,function(a,b,c){return":"+b+"("+c.replace(/\s/g,"")+")"}),a=Df(a));var f=Gf.test(a);if(f){var g=Ff(a);a=g.ha;g=g.matches}a=a.replace(If,":host $1");a=a.replace(Jf,function(a,e,f){d||(a=Kf(f,e,b,c),d=d||a.stop,e=a.Ca,f=a.value);return e+f});f&&(a=Hf(a,g));e&&(a=Df(a));return a}; function Kf(a,b,c,d){var e=a.indexOf("::slotted");0<=a.indexOf(":host")?a=Lf(a,d):0!==e&&(a=c?Mf(a,c):a);c=!1;0<=e&&(b="",c=!0);if(c){var f=!0;c&&(a=a.replace(Nf,function(a,b){return" > "+b}))}a=a.replace(Of,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,Ca:b,stop:f}} function Mf(a,b){a=a.split(/(\[.+?\])/);for(var c=[],d=0;d<a.length;d++)if(1===d%2)c.push(a[d]);else{var e=a[d];if(""!==e||d!==a.length-1)e=e.split(":"),e[0]+=b,c.push(e.join(":"))}return c.join("")}function Lf(a,b){var c=a.match(Pf);return(c=c&&c[2].trim()||"")?c[0].match(Qf)?a.replace(Pf,function(a,c,f){return b+f}):c.split(Qf)[0]===b?c:"should_not_match":a.replace(":host",b)}function Rf(a){":root"===a.selector&&(a.selector="html")} tf.prototype.c=function(a){return a.match(":host")?"":a.match("::slotted")?this.b(a,":not(.style-scope)"):Mf(a.trim(),":not(.style-scope)")};p.Object.defineProperties(tf.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}}); var Ef=/:(nth[-\w]+)\(([^)]+)\)/,Jf=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Qf=/[[.:#*]/,If=/^(::slotted)/,Pf=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Nf=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Of=/(.*):dir\((?:(ltr|rtl))\)/,Gf=/:(?:matches|any|-(?:webkit|moz)-any)/,R=new tf;function Sf(a,b,c,d,e){this.A=a||null;this.b=b||null;this.fa=c||[];this.o=null;this.cssBuild=e||"";this.M=d||"";this.a=this.s=this.w=null}function T(a){return a?a.__styleInfo:null}function Tf(a,b){return a.__styleInfo=b}Sf.prototype.c=function(){return this.A};Sf.prototype._getStyleRules=Sf.prototype.c;function Uf(a){var b=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return b&&b.call(this,a)}var Vf=navigator.userAgent.match("Trident");function Wf(){}function Xf(a){var b={},c=[],d=0;df(a,function(a){Yf(a);a.index=d++;a=a.i.cssText;for(var c;c=Te.exec(a);){var e=c[1];":"!==c[2]&&(b[e]=!0)}},function(a){c.push(a)});a.b=c;a=[];for(var e in b)a.push(e);return a} function Yf(a){if(!a.i){var b={},c={};Zf(a,c)&&(b.v=c,a.rules=null);b.cssText=a.parsedCssText.replace(af,"").replace(Re,"");a.i=b}}function Zf(a,b){var c=a.i;if(c){if(c.v)return Object.assign(b,c.v),!0}else{c=a.parsedCssText;for(var d;a=Re.exec(c);){d=(a[2]||a[3]).trim();if("inherit"!==d||"unset"!==d)b[a[1].trim()]=d;d=!0}return d}} function $f(a,b,c){b&&(b=0<=b.indexOf(";")?ag(a,b,c):mf(b,function(b,e,f,g){if(!e)return b+g;(e=$f(a,c[e],c))&&"initial"!==e?"apply-shim-inherit"===e&&(e="inherit"):e=$f(a,c[f]||f,c)||f;return b+(e||"")+g}));return b&&b.trim()||""} function ag(a,b,c){b=b.split(";");for(var d=0,e,f;d<b.length;d++)if(e=b[d]){Se.lastIndex=0;if(f=Se.exec(e))e=$f(a,c[f[1]],c);else if(f=e.indexOf(":"),-1!==f){var g=e.substring(f);g=g.trim();g=$f(a,g,c)||g;e=e.substring(0,f)+g}b[d]=e&&e.lastIndexOf(";")===e.length-1?e.slice(0,-1):e||""}return b.join(";")} function bg(a,b){var c={},d=[];df(a,function(a){a.i||Yf(a);var e=a.j||a.parsedSelector;b&&a.i.v&&e&&Uf.call(b,e)&&(Zf(a,c),a=a.index,e=parseInt(a/32,10),d[e]=(d[e]||0)|1<<a%32)},null,!0);return{v:c,key:d}} function cg(a,b,c,d){b.i||Yf(b);if(b.i.v){var e=pf(a);a=e.is;e=e.M;e=a?Bf(a,e):"html";var f=b.parsedSelector,g=":host > *"===f||"html"===f,h=0===f.indexOf(":host")&&!g;"shady"===c&&(g=f===e+" > *."+e||-1!==f.indexOf("html"),h=!g&&0===f.indexOf(e));if(g||h)c=e,h&&(b.j||(b.j=Cf(R,b,R.b,a?"."+a:"",e)),c=b.j||e),d({ha:c,Ia:h,Za:g})}}function dg(a,b,c){var d={},e={};df(b,function(b){cg(a,b,c,function(c){Uf.call(a._element||a,c.ha)&&(c.Ia?Zf(b,d):Zf(b,e))})},null,!0);return{Ra:e,Ha:d}} function eg(a,b,c,d){var e=pf(b),f=Bf(e.is,e.M),g=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])"),h=T(b);e=h.A;h=h.cssBuild;var k=fg(e,d);return zf(b,e,function(b){var e="";b.i||Yf(b);b.i.cssText&&(e=ag(a,b.i.cssText,c));b.cssText=e;if(!O&&!ff(b)&&b.cssText){var h=e=b.cssText;null==b.na&&(b.na=Ue.test(e));if(b.na)if(null==b.U){b.U=[];for(var l in k)h=k[l],h=h(e),e!==h&&(e=h,b.U.push(l))}else{for(l=0;l<b.U.length;++l)h=k[b.U[l]],e=h(e);h=e}b.cssText=h;b.j=b.j|| b.selector;e="."+d;l=qf(b.j);h=0;for(var M=l.length,U=void 0;h<M&&(U=l[h]);h++)l[h]=U.match(g)?U.replace(f,e):e+" "+U;b.selector=l.join(",")}},h)}function fg(a,b){a=a.b;var c={};if(!O&&a)for(var d=0,e=a[d];d<a.length;e=a[++d]){var f=e,g=b;f.f=new RegExp("\\b"+f.keyframesName+"(?!\\B|-)","g");f.a=f.keyframesName+"-"+g;f.j=f.j||f.selector;f.selector=f.j.replace(f.keyframesName,f.a);c[e.keyframesName]=gg(e)}return c}function gg(a){return function(b){return b.replace(a.f,a.a)}} function hg(a,b){var c=ig,d=ef(a);a.textContent=cf(d,function(a){var d=a.cssText=a.parsedCssText;a.i&&a.i.cssText&&(d=d.replace(Ie,"").replace(Je,""),a.cssText=ag(c,d,b))})}p.Object.defineProperties(Wf.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var ig=new Wf;var jg={},kg=window.customElements;if(kg&&!O&&!Pe){var lg=kg.define;kg.define=function(a,b,c){jg[a]||(jg[a]=kf(a));lg.call(kg,a,b,c)}};function mg(){this.cache={}}mg.prototype.store=function(a,b,c,d){var e=this.cache[a]||[];e.push({v:b,styleElement:c,s:d});100<e.length&&e.shift();this.cache[a]=e};function ng(){}var og=new RegExp(R.a+"\\s*([^\\s]*)");function pg(a){return(a=(a.classList&&a.classList.value?a.classList.value:a.getAttribute("class")||"").match(og))?a[1]:""}function qg(a){var b=of(a).getRootNode();return b===a||b===a.ownerDocument?"":(a=b.host)?pf(a).is:""} function rg(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.target!==document.documentElement&&c.target!==document.head)for(var d=0;d<c.addedNodes.length;d++){var e=c.addedNodes[d];if(e.nodeType===Node.ELEMENT_NODE){var f=e.getRootNode(),g=pg(e);if(g&&f===e.ownerDocument&&("style"!==e.localName&&"template"!==e.localName||""===rf(e)))yf(e,g);else if(f instanceof ShadowRoot)for(f=qg(e),f!==g&&xf(e,g,f),e=window.ShadyDOM.nativeMethods.querySelectorAll.call(e,":not(."+R.a+")"),g=0;g<e.length;g++){f=e[g]; var h=qg(f);h&&wf(f,h)}}}}} if(!(O||window.ShadyDOM&&window.ShadyDOM.handlesDynamicScoping)){var sg=new MutationObserver(rg),tg=function(a){sg.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)tg(document);else{var ug=function(){tg(document.body)};window.HTMLImports?window.HTMLImports.whenReady(ug):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){ug();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange", a)}else ug()})}ng=function(){rg(sg.takeRecords())}}var vg=ng;var wg={};var xg=Promise.resolve();function yg(a){if(a=wg[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function zg(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function Ag(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a._validating||(a._validating=!0,xg.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a._validating=!1}))};var Bg={},Cg=new mg;function Y(){this.l={};this.c=document.documentElement;var a=new ve;a.rules=[];this.f=Tf(this.c,new Sf(a));this.g=!1;this.b=this.a=null}n=Y.prototype;n.flush=function(){vg()};n.Fa=function(a){return ef(a)};n.Va=function(a){return cf(a)};n.prepareTemplate=function(a,b,c){this.prepareTemplateDom(a,b);this.prepareTemplateStyles(a,b,c)}; n.prepareTemplateStyles=function(a,b,c){if(!a._prepared&&!Pe){O||jg[b]||(jg[b]=kf(b));a._prepared=!0;a.name=b;a.extends=c;wg[b]=a;var d=rf(a),e=sf(d);c={is:b,extends:c};for(var f=[],g=a.content.querySelectorAll("style"),h=0;h<g.length;h++){var k=g[h];if(k.hasAttribute("shady-unscoped")){if(!O){var l=k.textContent;bf.has(l)||(bf.add(l),l=k.cloneNode(!0),document.head.appendChild(l));k.parentNode.removeChild(k)}}else f.push(k.textContent),k.parentNode.removeChild(k)}f=f.join("").trim()+(Bg[b]||""); Dg(this);if(!e){if(g=!d)g=Se.test(f)||Re.test(f),Se.lastIndex=0,Re.lastIndex=0;h=we(f);g&&Q&&this.a&&this.a.transformRules(h,b);a._styleAst=h}g=[];Q||(g=Xf(a._styleAst));if(!g.length||Q)h=O?a.content:null,b=jg[b]||null,d=zf(c,a._styleAst,null,d,e?f:""),d=d.length?gf(d,c.is,h,b):null,a._style=d;a.a=g}};n.Qa=function(a,b){Bg[b]=a.join(" ")};n.prepareTemplateDom=function(a,b){if(!Pe){var c=rf(a);O||"shady"===c||a._domPrepared||(a._domPrepared=!0,uf(a.content,b))}}; function Eg(a){var b=pf(a),c=b.is;b=b.M;var d=jg[c]||null,e=wg[c];if(e){c=e._styleAst;var f=e.a;e=rf(e);b=new Sf(c,d,f,b,e);Tf(a,b);return b}}function Fg(a){!a.b&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(a.b=window.ShadyCSS.CustomStyleInterface,a.b.transformCallback=function(b){a.ra(b)},a.b.validateCallback=function(){requestAnimationFrame(function(){(a.b.enqueued||a.g)&&a.flushCustomStyles()})})} function Dg(a){!a.a&&window.ShadyCSS&&window.ShadyCSS.ApplyShim&&(a.a=window.ShadyCSS.ApplyShim,a.a.invalidCallback=yg);Fg(a)} n.flushCustomStyles=function(){if(!Pe&&(Dg(this),this.b)){var a=this.b.processStyles();if(this.b.enqueued&&!sf(this.f.cssBuild)){if(Q){if(!this.f.cssBuild)for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);if(c&&Q&&this.a){var d=ef(c);Dg(this);this.a.transformRules(d);c.textContent=cf(d)}}}else{Gg(this,this.c,this.f);for(b=0;b<a.length;b++)(c=this.b.getStyleForCustomStyle(a[b]))&&hg(c,this.f.w);this.g&&this.styleDocument()}this.b.enqueued=!1}}}; n.styleElement=function(a,b){if(Pe){if(b){T(a)||Tf(a,new Sf(null));var c=T(a);c.o=c.o||{};Object.assign(c.o,b);Hg(this,a,c)}}else if(c=T(a)||Eg(a))if(a!==this.c&&(this.g=!0),b&&(c.o=c.o||{},Object.assign(c.o,b)),Q)Hg(this,a,c);else if(this.flush(),Gg(this,a,c),c.fa&&c.fa.length){b=pf(a).is;var d;a:{if(d=Cg.cache[b])for(var e=d.length-1;0<=e;e--){var f=d[e];b:{var g=c.fa;for(var h=0;h<g.length;h++){var k=g[h];if(f.v[k]!==c.w[k]){g=!1;break b}}g=!0}if(g){d=f;break a}}d=void 0}g=d?d.styleElement:null; e=c.s;(f=d&&d.s)||(f=this.l[b]=(this.l[b]||0)+1,f=b+"-"+f);c.s=f;f=c.s;h=ig;h=g?g.textContent||"":eg(h,a,c.w,f);k=T(a);var l=k.a;l&&!O&&l!==g&&(l._useCount--,0>=l._useCount&&l.parentNode&&l.parentNode.removeChild(l));O?k.a?(k.a.textContent=h,g=k.a):h&&(g=gf(h,f,a.shadowRoot,k.b)):g?g.parentNode||(Vf&&-1<h.indexOf("@media")&&(g.textContent=h),hf(g,null,k.b)):h&&(g=gf(h,f,null,k.b));g&&(g._useCount=g._useCount||0,k.a!=g&&g._useCount++,k.a=g);f=g;O||(g=c.s,k=h=a.getAttribute("class")||"",e&&(k=h.replace(new RegExp("\\s*x-scope\\s*"+ e+"\\s*","g")," ")),k+=(k?" ":"")+"x-scope "+g,h!==k&&nf(a,k));d||Cg.store(b,c.w,f,c.s)}}; function Hg(a,b,c){var d=pf(b).is;if(c.o){var e=c.o,f;for(f in e)null===f?b.style.removeProperty(f):b.style.setProperty(f,e[f])}e=wg[d];if(!(!e&&b!==a.c||e&&""!==rf(e))&&e&&e._style&&!zg(e)){if(zg(e)||e._applyShimValidatingVersion!==e._applyShimNextVersion)Dg(a),a.a&&a.a.transformRules(e._styleAst,d),e._style.textContent=zf(b,c.A),Ag(e);O&&(a=b.shadowRoot)&&(a=a.querySelector("style"))&&(a.textContent=zf(b,c.A));c.A=e._styleAst}} function Ig(a,b){return(b=of(b).getRootNode().host)?T(b)||Eg(b)?b:Ig(a,b):a.c}function Gg(a,b,c){var d=Ig(a,b),e=T(d),f=e.w;d===a.c||f||(Gg(a,d,e),f=e.w);a=Object.create(f||null);d=dg(b,c.A,c.cssBuild);b=bg(e.A,b).v;Object.assign(a,d.Ha,b,d.Ra);b=c.o;for(var g in b)if((e=b[g])||0===e)a[g]=e;g=ig;b=Object.getOwnPropertyNames(a);for(e=0;e<b.length;e++)d=b[e],a[d]=$f(g,a[d],a);c.w=a}n.styleDocument=function(a){this.styleSubtree(this.c,a)}; n.styleSubtree=function(a,b){var c=of(a),d=c.shadowRoot;(d||a===this.c)&&this.styleElement(a,b);if(a=d&&(d.children||d.childNodes))for(c=0;c<a.length;c++)this.styleSubtree(a[c]);else if(c=c.children||c.childNodes)for(a=0;a<c.length;a++)this.styleSubtree(c[a])}; n.ra=function(a){var b=this,c=rf(a);c!==this.f.cssBuild&&(this.f.cssBuild=c);if(!sf(c)){var d=ef(a);df(d,function(a){if(O)Rf(a);else{var d=R;a.selector=a.parsedSelector;Rf(a);a.selector=a.j=Cf(d,a,d.c,void 0,void 0)}Q&&""===c&&(Dg(b),b.a&&b.a.transformRule(a))});Q?a.textContent=cf(d):this.f.A.rules.push(d)}};n.getComputedStyleValue=function(a,b){var c;Q||(c=(T(a)||T(Ig(this,a))).w[b]);return(c=c||window.getComputedStyle(a).getPropertyValue(b))?c.trim():""}; n.Ua=function(a,b){var c=of(a).getRootNode();b=b?b.split(/\s/):[];c=c.host&&c.host.localName;if(!c){var d=a.getAttribute("class");if(d){d=d.split(/\s/);for(var e=0;e<d.length;e++)if(d[e]===R.a){c=d[e+1];break}}}c&&b.push(R.a,c);Q||(c=T(a))&&c.s&&b.push(ig.a,c.s);nf(a,b.join(" "))};n.Ba=function(a){return T(a)};n.Ta=function(a,b){wf(a,b)};n.Wa=function(a,b){wf(a,b,!0)};n.Sa=function(a){return qg(a)};n.Da=function(a){return pg(a)};Y.prototype.flush=Y.prototype.flush;Y.prototype.prepareTemplate=Y.prototype.prepareTemplate; Y.prototype.styleElement=Y.prototype.styleElement;Y.prototype.styleDocument=Y.prototype.styleDocument;Y.prototype.styleSubtree=Y.prototype.styleSubtree;Y.prototype.getComputedStyleValue=Y.prototype.getComputedStyleValue;Y.prototype.setElementClass=Y.prototype.Ua;Y.prototype._styleInfoForNode=Y.prototype.Ba;Y.prototype.transformCustomStyleForDocument=Y.prototype.ra;Y.prototype.getStyleAst=Y.prototype.Fa;Y.prototype.styleAstToString=Y.prototype.Va;Y.prototype.flushCustomStyles=Y.prototype.flushCustomStyles; Y.prototype.scopeNode=Y.prototype.Ta;Y.prototype.unscopeNode=Y.prototype.Wa;Y.prototype.scopeForNode=Y.prototype.Sa;Y.prototype.currentScopeForNode=Y.prototype.Da;Y.prototype.prepareAdoptedCssText=Y.prototype.Qa;Object.defineProperties(Y.prototype,{nativeShadow:{get:function(){return O}},nativeCss:{get:function(){return Q}}});var Z=new Y,Jg,Kg;window.ShadyCSS&&(Jg=window.ShadyCSS.ApplyShim,Kg=window.ShadyCSS.CustomStyleInterface); window.ShadyCSS={ScopingShim:Z,prepareTemplate:function(a,b,c){Z.flushCustomStyles();Z.prepareTemplate(a,b,c)},prepareTemplateDom:function(a,b){Z.prepareTemplateDom(a,b)},prepareTemplateStyles:function(a,b,c){Z.flushCustomStyles();Z.prepareTemplateStyles(a,b,c)},styleSubtree:function(a,b){Z.flushCustomStyles();Z.styleSubtree(a,b)},styleElement:function(a){Z.flushCustomStyles();Z.styleElement(a)},styleDocument:function(a){Z.flushCustomStyles();Z.styleDocument(a)},flushCustomStyles:function(){Z.flushCustomStyles()}, getComputedStyleValue:function(a,b){return Z.getComputedStyleValue(a,b)},nativeCss:Q,nativeShadow:O,cssBuild:Qe,disableRuntime:Pe};Jg&&(window.ShadyCSS.ApplyShim=Jg);Kg&&(window.ShadyCSS.CustomStyleInterface=Kg);var Lg=window.customElements,Mg=window.HTMLImports,Ng=window.HTMLTemplateElement;window.WebComponents=window.WebComponents||{};if(Lg&&Lg.polyfillWrapFlushCallback){var Og,Pg=function(){if(Og){Ng.C&&Ng.C(window.document);var a=Og;Og=null;a();return!0}},Qg=Mg.whenReady;Lg.polyfillWrapFlushCallback(function(a){Og=a;Qg(Pg)});Mg.whenReady=function(a){Qg(function(){Pg()?Mg.whenReady(a):a()})}} Mg.whenReady(function(){requestAnimationFrame(function(){window.WebComponents.ready=!0;document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})});var Rg=document.createElement("style");Rg.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var Sg=document.querySelector("head");Sg.insertBefore(Rg,Sg.firstChild);}).call(this); </script> <script>(function(){/* Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ 'use strict';var l=!(window.ShadyDOM&&window.ShadyDOM.inUse),p;function r(a){p=a&&a.shimcssproperties?!1:l||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}var t;window.ShadyCSS&&void 0!==window.ShadyCSS.cssBuild&&(t=window.ShadyCSS.cssBuild);var aa=!(!window.ShadyCSS||!window.ShadyCSS.disableRuntime); window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?p=window.ShadyCSS.nativeCss:window.ShadyCSS?(r(window.ShadyCSS),window.ShadyCSS=void 0):r(window.WebComponents&&window.WebComponents.flags);var u=p,v=t;function w(){this.end=this.start=0;this.rules=this.parent=this.previous=null;this.cssText=this.parsedCssText="";this.atRule=!1;this.type=0;this.parsedSelector=this.selector=this.keyframesName=""} function x(a){a=a.replace(ba,"").replace(ca,"");var b=y,c=a,e=new w;e.start=0;e.end=c.length;for(var d=e,f=0,g=c.length;f<g;f++)if("{"===c[f]){d.rules||(d.rules=[]);var h=d,k=h.rules[h.rules.length-1]||null;d=new w;d.start=f+1;d.parent=h;d.previous=k;h.rules.push(d)}else"}"===c[f]&&(d.end=f+1,d=d.parent||e);return b(e,a)} function y(a,b){var c=b.substring(a.start,a.end-1);a.parsedCssText=a.cssText=c.trim();a.parent&&(c=b.substring(a.previous?a.previous.end:a.parent.start,a.start-1),c=da(c),c=c.replace(z," "),c=c.substring(c.lastIndexOf(";")+1),c=a.parsedSelector=a.selector=c.trim(),a.atRule=0===c.indexOf("@"),a.atRule?0===c.indexOf("@media")?a.type=A:c.match(ea)&&(a.type=B,a.keyframesName=a.selector.split(z).pop()):a.type=0===c.indexOf("--")?C:D);if(c=a.rules)for(var e=0,d=c.length,f=void 0;e<d&&(f=c[e]);e++)y(f,b); return a}function da(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,c){a=c;for(c=6-a.length;c--;)a="0"+a;return"\\"+a})} function E(a,b,c){c=void 0===c?"":c;var e="";if(a.cssText||a.rules){var d=a.rules,f;if(f=d)f=d[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var g=d.length,h=void 0;f<g&&(h=d[f]);f++)e=E(h,b,e)}else b?b=a.cssText:(b=a.cssText,b=b.replace(fa,"").replace(ha,""),b=b.replace(ia,"").replace(ja,"")),(e=b.trim())&&(e=" "+e+"\n")}e&&(a.selector&&(c+=a.selector+" {\n"),c+=e,a.selector&&(c+="}\n\n"));return c} var D=1,B=7,A=4,C=1E3,ba=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ca=/@import[^;]*;/gim,fa=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,ha=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,ia=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,ja=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,ea=/^@[^\s]*keyframes/,z=/\s+/g;var G=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,H=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,ka=/@media\s(.*)/;var I=new Set;function J(a){if(!a)return"";"string"===typeof a&&(a=x(a));return E(a,u)}function K(a){!a.__cssRules&&a.textContent&&(a.__cssRules=x(a.textContent));return a.__cssRules||null}function L(a,b,c,e){if(a){var d=!1,f=a.type;if(e&&f===A){var g=a.selector.match(ka);g&&(window.matchMedia(g[1]).matches||(d=!0))}f===D?b(a):c&&f===B?c(a):f===C&&(d=!0);if((a=a.rules)&&!d)for(d=0,f=a.length,g=void 0;d<f&&(g=a[d]);d++)L(g,b,c,e)}} function M(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");a:{var e=0;var d=c+3;for(var f=a.length;d<f;d++)if("("===a[d])e++;else if(")"===a[d]&&0===--e)break a;d=-1}e=a.substring(c+4,d);c=a.substring(0,c);a=M(a.substring(d+1),b);d=e.indexOf(",");return-1===d?b(c,e.trim(),"",a):b(c,e.substring(0,d).trim(),e.substring(d+1).trim(),a)} function N(a){if(void 0!==v)return v;if(void 0===a.__cssBuild){var b=a.getAttribute("css-build");if(b)a.__cssBuild=b;else{a:{b="template"===a.localName?a.content.firstChild:a.firstChild;if(b instanceof Comment&&(b=b.textContent.trim().split(":"),"css-build"===b[0])){b=b[1];break a}b=""}if(""!==b){var c="template"===a.localName?a.content.firstChild:a.firstChild;c.parentNode.removeChild(c)}a.__cssBuild=b}}return a.__cssBuild||""};var la=/;\s*/m,ma=/^\s*(initial)|(inherit)\s*$/,O=/\s*!important/;function P(){this.a={}}P.prototype.set=function(a,b){a=a.trim();this.a[a]={h:b,i:{}}};P.prototype.get=function(a){a=a.trim();return this.a[a]||null};var Q=null;function R(){this.b=this.c=null;this.a=new P}R.prototype.o=function(a){a=H.test(a)||G.test(a);H.lastIndex=0;G.lastIndex=0;return a}; R.prototype.m=function(a,b){if(void 0===a._gatheredStyle){var c=[];for(var e=a.content.querySelectorAll("style"),d=0;d<e.length;d++){var f=e[d];if(f.hasAttribute("shady-unscoped")){if(!l){var g=f.textContent;I.has(g)||(I.add(g),g=f.cloneNode(!0),document.head.appendChild(g));f.parentNode.removeChild(f)}}else c.push(f.textContent),f.parentNode.removeChild(f)}(c=c.join("").trim())?(e=document.createElement("style"),e.textContent=c,a.content.insertBefore(e,a.content.firstChild),c=e):c=null;a._gatheredStyle= c}return(a=a._gatheredStyle)?this.j(a,b):null};R.prototype.j=function(a,b){b=void 0===b?"":b;var c=K(a);this.l(c,b);a.textContent=J(c);return c};R.prototype.f=function(a){var b=this,c=K(a);L(c,function(a){":root"===a.selector&&(a.selector="html");b.g(a)});a.textContent=J(c);return c};R.prototype.l=function(a,b){var c=this;this.c=b;L(a,function(a){c.g(a)});this.c=null};R.prototype.g=function(a){a.cssText=na(this,a.parsedCssText,a);":root"===a.selector&&(a.selector=":host > *")}; function na(a,b,c){b=b.replace(G,function(b,d,f,g){return oa(a,b,d,f,g,c)});return S(a,b,c)}function pa(a,b){for(var c=b;c.parent;)c=c.parent;var e={},d=!1;L(c,function(c){(d=d||c===b)||c.selector===b.selector&&Object.assign(e,T(a,c.parsedCssText))});return e} function S(a,b,c){for(var e;e=H.exec(b);){var d=e[0],f=e[1];e=e.index;var g=b.slice(0,e+d.indexOf("@apply"));b=b.slice(e+d.length);var h=c?pa(a,c):{};Object.assign(h,T(a,g));d=void 0;var k=a;f=f.replace(la,"");var n=[];var m=k.a.get(f);m||(k.a.set(f,{}),m=k.a.get(f));if(m){k.c&&(m.i[k.c]=!0);var q=m.h;for(d in q)k=h&&h[d],m=[d,": var(",f,"_-_",d],k&&m.push(",",k.replace(O,"")),m.push(")"),O.test(q[d])&&m.push(" !important"),n.push(m.join(""))}d=n.join("; ");b=g+d+b;H.lastIndex=e+d.length}return b} function T(a,b,c){c=void 0===c?!1:c;b=b.split(";");for(var e,d,f={},g=0,h;g<b.length;g++)if(e=b[g])if(h=e.split(":"),1<h.length){e=h[0].trim();d=h.slice(1).join(":");if(c){var k=a;h=e;var n=ma.exec(d);n&&(n[1]?(k.b||(k.b=document.createElement("meta"),k.b.setAttribute("apply-shim-measure",""),k.b.style.all="initial",document.head.appendChild(k.b)),h=window.getComputedStyle(k.b).getPropertyValue(h)):h="apply-shim-inherit",d=h)}f[e]=d}return f}function qa(a,b){if(Q)for(var c in b.i)c!==a.c&&Q(c)} function oa(a,b,c,e,d,f){e&&M(e,function(b,c){c&&a.a.get(c)&&(d="@apply "+c+";")});if(!d)return b;var g=S(a,""+d,f);f=b.slice(0,b.indexOf("--"));var h=g=T(a,g,!0),k=a.a.get(c),n=k&&k.h;n?h=Object.assign(Object.create(n),g):a.a.set(c,h);var m=[],q,Z=!1;for(q in h){var F=g[q];void 0===F&&(F="initial");!n||q in n||(Z=!0);m.push(c+"_-_"+q+": "+F)}Z&&qa(a,k);k&&(k.h=h);e&&(f=b+";"+f);return f+m.join("; ")+";"}R.prototype.detectMixin=R.prototype.o;R.prototype.transformStyle=R.prototype.j; R.prototype.transformCustomStyle=R.prototype.f;R.prototype.transformRules=R.prototype.l;R.prototype.transformRule=R.prototype.g;R.prototype.transformTemplate=R.prototype.m;R.prototype._separator="_-_";Object.defineProperty(R.prototype,"invalidCallback",{get:function(){return Q},set:function(a){Q=a}});var U={};var ra=Promise.resolve();function sa(a){if(a=U[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function ta(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function ua(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a._validating||(a._validating=!0,ra.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a._validating=!1}))};var V=new R;function W(){this.a=null;V.invalidCallback=sa}function X(a){!a.a&&window.ShadyCSS.CustomStyleInterface&&(a.a=window.ShadyCSS.CustomStyleInterface,a.a.transformCallback=function(a){V.f(a)},a.a.validateCallback=function(){requestAnimationFrame(function(){a.a.enqueued&&a.flushCustomStyles()})})}W.prototype.prepareTemplate=function(a,b){X(this);""===N(a)&&(U[b]=a,b=V.m(a,b),a._styleAst=b)}; W.prototype.flushCustomStyles=function(){X(this);if(this.a){var a=this.a.processStyles();if(this.a.enqueued){for(var b=0;b<a.length;b++){var c=this.a.getStyleForCustomStyle(a[b]);c&&V.f(c)}this.a.enqueued=!1}}}; W.prototype.styleSubtree=function(a,b){X(this);if(b)for(var c in b)null===c?a.style.removeProperty(c):a.style.setProperty(c,b[c]);if(a.shadowRoot)for(this.styleElement(a),a=a.shadowRoot.children||a.shadowRoot.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b]);else for(a=a.children||a.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b])}; W.prototype.styleElement=function(a){X(this);var b=a.localName,c;b?-1<b.indexOf("-")?c=b:c=a.getAttribute&&a.getAttribute("is")||"":c=a.is;b=U[c];if(!(b&&""!==N(b)||!b||ta(b))){if(ta(b)||b._applyShimValidatingVersion!==b._applyShimNextVersion)this.prepareTemplate(b,c),ua(b);if(a=a.shadowRoot)if(a=a.querySelector("style"))a.__cssRules=b._styleAst,a.textContent=J(b._styleAst)}};W.prototype.styleDocument=function(a){X(this);this.styleSubtree(document.body,a)}; if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){var Y=new W,va=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate:function(a,b){Y.flushCustomStyles();Y.prepareTemplate(a,b)},prepareTemplateStyles:function(a,b,c){window.ShadyCSS.prepareTemplate(a,b,c)},prepareTemplateDom:function(){},styleSubtree:function(a,b){Y.flushCustomStyles();Y.styleSubtree(a,b)},styleElement:function(a){Y.flushCustomStyles();Y.styleElement(a)},styleDocument:function(a){Y.flushCustomStyles(); Y.styleDocument(a)},getComputedStyleValue:function(a,b){return(a=window.getComputedStyle(a).getPropertyValue(b))?a.trim():""},flushCustomStyles:function(){Y.flushCustomStyles()},nativeCss:u,nativeShadow:l,cssBuild:v,disableRuntime:aa};va&&(window.ShadyCSS.CustomStyleInterface=va)}window.ShadyCSS.ApplyShim=V;}).call(this); </script> <script> (function() { 'use strict'; const userPolymer = window.Polymer; /** * @namespace Polymer * @summary Polymer is a lightweight library built on top of the web * standards-based Web Components API's, and makes it easy to build your * own custom HTML elements. * @param {!PolymerInit} info Prototype for the custom element. It must contain * an `is` property to specify the element name. Other properties populate * the element prototype. The `properties`, `observers`, `hostAttributes`, * and `listeners` properties are processed to create element features. * @return {!Object} Returns a custom element class for the given provided * prototype `info` object. The name of the element if given by `info.is`. */ window.Polymer = function(info) { return window.Polymer._polymerFn(info); }; // support user settings on the Polymer object if (userPolymer) { Object.assign(Polymer, userPolymer); } // To be plugged by legacy implementation if loaded /* eslint-disable valid-jsdoc */ /** * @param {!PolymerInit} info Prototype for the custom element. It must contain * an `is` property to specify the element name. Other properties populate * the element prototype. The `properties`, `observers`, `hostAttributes`, * and `listeners` properties are processed to create element features. * @return {!Object} Returns a custom element class for the given provided * prototype `info` object. The name of the element if given by `info.is`. */ window.Polymer._polymerFn = function(info) { // eslint-disable-line no-unused-vars throw new Error('Load polymer.html to use the Polymer() function.'); }; /* eslint-enable */ window.Polymer.version = '2.7.0'; /* eslint-disable no-unused-vars */ /* When using Closure Compiler, JSCompiler_renameProperty(property, object) is replaced by the munged name for object[property] We cannot alias this function, so we have to use a small shim that has the same behavior when not compiling. */ window.JSCompiler_renameProperty = function(prop, obj) { return prop; }; /* eslint-enable */ })(); </script> <script> (function() { 'use strict'; let CSS_URL_RX = /(url\()([^)]*)(\))/g; let ABS_URL = /(^\/)|(^#)|(^[\w-\d]*:)/; let workingURL; let resolveDoc; /** * Resolves the given URL against the provided `baseUri'. * * Note that this function performs no resolution for URLs that start * with `/` (absolute URLs) or `#` (hash identifiers). For general purpose * URL resolution, use `window.URL`. * * @memberof Polymer.ResolveUrl * @param {string} url Input URL to resolve * @param {?string=} baseURI Base URI to resolve the URL against * @return {string} resolved URL */ function resolveUrl(url, baseURI) { if (url && ABS_URL.test(url)) { return url; } // Lazy feature detection. if (workingURL === undefined) { workingURL = false; try { const u = new URL('b', 'http://a'); u.pathname = 'c%20d'; workingURL = (u.href === 'http://a/c%20d'); } catch (e) { // silently fail } } if (!baseURI) { baseURI = document.baseURI || window.location.href; } if (workingURL) { return (new URL(url, baseURI)).href; } // Fallback to creating an anchor into a disconnected document. if (!resolveDoc) { resolveDoc = document.implementation.createHTMLDocument('temp'); resolveDoc.base = resolveDoc.createElement('base'); resolveDoc.head.appendChild(resolveDoc.base); resolveDoc.anchor = resolveDoc.createElement('a'); resolveDoc.body.appendChild(resolveDoc.anchor); } resolveDoc.base.href = baseURI; resolveDoc.anchor.href = url; return resolveDoc.anchor.href || url; } /** * Resolves any relative URL's in the given CSS text against the provided * `ownerDocument`'s `baseURI`. * * @memberof Polymer.ResolveUrl * @param {string} cssText CSS text to process * @param {string} baseURI Base URI to resolve the URL against * @return {string} Processed CSS text with resolved URL's */ function resolveCss(cssText, baseURI) { return cssText.replace(CSS_URL_RX, function(m, pre, url, post) { return pre + '\'' + resolveUrl(url.replace(/["']/g, ''), baseURI) + '\'' + post; }); } /** * Returns a path from a given `url`. The path includes the trailing * `/` from the url. * * @memberof Polymer.ResolveUrl * @param {string} url Input URL to transform * @return {string} resolved path */ function pathFromUrl(url) { return url.substring(0, url.lastIndexOf('/') + 1); } /** * Module with utilities for resolving relative URL's. * * @namespace * @memberof Polymer * @summary Module with utilities for resolving relative URL's. */ Polymer.ResolveUrl = { resolveCss: resolveCss, resolveUrl: resolveUrl, pathFromUrl: pathFromUrl }; })(); </script> <script> /** @suppress {deprecated} */ (function() { 'use strict'; /** * Sets the global, legacy settings. * * @deprecated * @namespace * @memberof Polymer */ Polymer.Settings = Polymer.Settings || {}; Polymer.Settings.useShadow = !(window.ShadyDOM); Polymer.Settings.useNativeCSSProperties = Boolean(!window.ShadyCSS || window.ShadyCSS.nativeCss); Polymer.Settings.useNativeCustomElements = !(window.customElements.polyfillWrapFlushCallback); /** * Globally settable property that is automatically assigned to * `Polymer.ElementMixin` instances, useful for binding in templates to * make URL's relative to an application's root. Defaults to the main * document URL, but can be overridden by users. It may be useful to set * `Polymer.rootPath` to provide a stable application mount path when * using client side routing. * * @memberof Polymer */ Polymer.rootPath = Polymer.rootPath || Polymer.ResolveUrl.pathFromUrl(document.baseURI || window.location.href); /** * Sets the global rootPath property used by `Polymer.ElementMixin` and * available via `Polymer.rootPath`. * * @memberof Polymer * @param {string} path The new root path * @return {void} */ Polymer.setRootPath = function(path) { Polymer.rootPath = path; }; /** * A global callback used to sanitize any value before inserting it into the DOM. The callback signature is: * * Polymer = { * sanitizeDOMValue: function(value, name, type, node) { ... } * } * * Where: * * `value` is the value to sanitize. * `name` is the name of an attribute or property (for example, href). * `type` indicates where the value is being inserted: one of property, attribute, or text. * `node` is the node where the value is being inserted. * * @type {(function(*,string,string,Node):*)|undefined} * @memberof Polymer */ Polymer.sanitizeDOMValue = Polymer.sanitizeDOMValue || null; /** * Sets the global sanitizeDOMValue available via `Polymer.sanitizeDOMValue`. * * @memberof Polymer * @param {(function(*,string,string,Node):*)|undefined} newSanitizeDOMValue the global sanitizeDOMValue callback * @return {void} */ Polymer.setSanitizeDOMValue = function(newSanitizeDOMValue) { Polymer.sanitizeDOMValue = newSanitizeDOMValue; }; /** * Globally settable property to make Polymer Gestures use passive TouchEvent listeners when recognizing gestures. * When set to `true`, gestures made from touch will not be able to prevent scrolling, allowing for smoother * scrolling performance. * Defaults to `false` for backwards compatibility. * * @memberof Polymer */ Polymer.passiveTouchGestures = Polymer.passiveTouchGestures || false; /** * Sets `passiveTouchGestures` globally for all elements using Polymer Gestures. * * @memberof Polymer * @param {boolean} usePassive enable or disable passive touch gestures globally * @return {void} */ Polymer.setPassiveTouchGestures = function(usePassive) { Polymer.passiveTouchGestures = usePassive; }; Polymer.legacyOptimizations = Polymer.legacyOptimizations || window.PolymerSettings && window.PolymerSettings.legacyOptimizations || false; /** * Sets `legacyOptimizations` globally for all elements. Enables * optimizations when only legacy Polymer() style elements are used. * * @memberof Polymer * @param {boolean} useLegacyOptimizations enable or disable legacy optimizations globally. * @return {void} */ Polymer.setLegacyOptimizations = function(useLegacyOptimizations) { Polymer.legacyOptimizations = useLegacyOptimizations; }; })(); </script> <script> (function() { 'use strict'; // unique global id for deduping mixins. let dedupeId = 0; /** * @constructor * @extends {Function} * @private */ function MixinFunction(){} /** @type {(WeakMap | undefined)} */ MixinFunction.prototype.__mixinApplications; /** @type {(Object | undefined)} */ MixinFunction.prototype.__mixinSet; /* eslint-disable valid-jsdoc */ /** * Wraps an ES6 class expression mixin such that the mixin is only applied * if it has not already been applied its base argument. Also memoizes mixin * applications. * * @memberof Polymer * @template T * @param {T} mixin ES6 class expression mixin to wrap * @return {T} * @suppress {invalidCasts} */ Polymer.dedupingMixin = function(mixin) { let mixinApplications = /** @type {!MixinFunction} */(mixin).__mixinApplications; if (!mixinApplications) { mixinApplications = new WeakMap(); /** @type {!MixinFunction} */(mixin).__mixinApplications = mixinApplications; } // maintain a unique id for each mixin let mixinDedupeId = dedupeId++; function dedupingMixin(base) { let baseSet = /** @type {!MixinFunction} */(base).__mixinSet; if (baseSet && baseSet[mixinDedupeId]) { return base; } let map = mixinApplications; let extended = map.get(base); if (!extended) { extended = /** @type {!Function} */(mixin)(base); map.set(base, extended); } // copy inherited mixin set from the extended class, or the base class // NOTE: we avoid use of Set here because some browser (IE11) // cannot extend a base Set via the constructor. let mixinSet = Object.create(/** @type {!MixinFunction} */(extended).__mixinSet || baseSet || null); mixinSet[mixinDedupeId] = true; /** @type {!MixinFunction} */(extended).__mixinSet = mixinSet; return extended; } return /** @type {T} */ (dedupingMixin); }; /* eslint-enable valid-jsdoc */ })(); </script> <script> (function() { 'use strict'; const MODULE_STYLE_LINK_SELECTOR = 'link[rel=import][type~=css]'; const INCLUDE_ATTR = 'include'; const SHADY_UNSCOPED_ATTR = 'shady-unscoped'; function importModule(moduleId) { const /** Polymer.DomModule */ PolymerDomModule = customElements.get('dom-module'); if (!PolymerDomModule) { return null; } return PolymerDomModule.import(moduleId); } function styleForImport(importDoc) { // NOTE: polyfill affordance. // under the HTMLImports polyfill, there will be no 'body', // but the import pseudo-doc can be used directly. let container = importDoc.body ? importDoc.body : importDoc; const importCss = Polymer.ResolveUrl.resolveCss(container.textContent, importDoc.baseURI); const style = document.createElement('style'); style.textContent = importCss; return style; } /** @typedef {{assetpath: string}} */ let templateWithAssetPath; // eslint-disable-line no-unused-vars /** * Module with utilities for collection CSS text from `<templates>`, external * stylesheets, and `dom-module`s. * * @namespace * @memberof Polymer * @summary Module with utilities for collection CSS text from various sources. */ const StyleGather = { /** * Returns a list of <style> elements in a space-separated list of `dom-module`s. * * @memberof Polymer.StyleGather * @param {string} moduleIds List of dom-module id's within which to * search for css. * @return {!Array<!HTMLStyleElement>} Array of contained <style> elements * @this {StyleGather} */ stylesFromModules(moduleIds) { const modules = moduleIds.trim().split(/\s+/); const styles = []; for (let i=0; i < modules.length; i++) { styles.push(...this.stylesFromModule(modules[i])); } return styles; }, /** * Returns a list of <style> elements in a given `dom-module`. * Styles in a `dom-module` can come either from `<style>`s within the * first `<template>`, or else from one or more * `<link rel="import" type="css">` links outside the template. * * @memberof Polymer.StyleGather * @param {string} moduleId dom-module id to gather styles from * @return {!Array<!HTMLStyleElement>} Array of contained styles. * @this {StyleGather} */ stylesFromModule(moduleId) { const m = importModule(moduleId); if (!m) { console.warn('Could not find style data in module named', moduleId); return []; } if (m._styles === undefined) { const styles = []; // module imports: <link rel="import" type="css"> styles.push(...this._stylesFromModuleImports(m)); // include css from the first template in the module const template = m.querySelector('template'); if (template) { styles.push(...this.stylesFromTemplate(template, /** @type {templateWithAssetPath} */(m).assetpath)); } m._styles = styles; } return m._styles; }, /** * Returns the `<style>` elements within a given template. * * @memberof Polymer.StyleGather * @param {!HTMLTemplateElement} template Template to gather styles from * @param {string} baseURI baseURI for style content * @return {!Array<!HTMLStyleElement>} Array of styles * @this {StyleGather} */ stylesFromTemplate(template, baseURI) { if (!template._styles) { const styles = []; // if element is a template, get content from its .content const e$ = template.content.querySelectorAll('style'); for (let i=0; i < e$.length; i++) { let e = e$[i]; // support style sharing by allowing styles to "include" // other dom-modules that contain styling let include = e.getAttribute(INCLUDE_ATTR); if (include) { styles.push(...this.stylesFromModules(include).filter(function(item, index, self) { return self.indexOf(item) === index; })); } if (baseURI) { e.textContent = Polymer.ResolveUrl.resolveCss(e.textContent, baseURI); } styles.push(e); } template._styles = styles; } return template._styles; }, /** * Returns a list of <style> elements from stylesheets loaded via `<link rel="import" type="css">` links within the specified `dom-module`. * * @memberof Polymer.StyleGather * @param {string} moduleId Id of `dom-module` to gather CSS from * @return {!Array<!HTMLStyleElement>} Array of contained styles. * @this {StyleGather} */ stylesFromModuleImports(moduleId) { let m = importModule(moduleId); return m ? this._stylesFromModuleImports(m) : []; }, /** * @memberof Polymer.StyleGather * @this {StyleGather} * @param {!HTMLElement} module dom-module element that could contain `<link rel="import" type="css">` styles * @return {!Array<!HTMLStyleElement>} Array of contained styles */ _stylesFromModuleImports(module) { const styles = []; const p$ = module.querySelectorAll(MODULE_STYLE_LINK_SELECTOR); for (let i=0; i < p$.length; i++) { let p = p$[i]; if (p.import) { const importDoc = p.import; const unscoped = p.hasAttribute(SHADY_UNSCOPED_ATTR); if (unscoped && !importDoc._unscopedStyle) { const style = styleForImport(importDoc); style.setAttribute(SHADY_UNSCOPED_ATTR, ''); importDoc._unscopedStyle = style; } else if (!importDoc._style) { importDoc._style = styleForImport(importDoc); } styles.push(unscoped ? importDoc._unscopedStyle : importDoc._style); } } return styles; }, /** * * Returns CSS text of styles in a space-separated list of `dom-module`s. * Note: This method is deprecated, use `stylesFromModules` instead. * * @deprecated * @memberof Polymer.StyleGather * @param {string} moduleIds List of dom-module id's within which to * search for css. * @return {string} Concatenated CSS content from specified `dom-module`s * @this {StyleGather} */ cssFromModules(moduleIds) { let modules = moduleIds.trim().split(/\s+/); let cssText = ''; for (let i=0; i < modules.length; i++) { cssText += this.cssFromModule(modules[i]); } return cssText; }, /** * Returns CSS text of styles in a given `dom-module`. CSS in a `dom-module` * can come either from `<style>`s within the first `<template>`, or else * from one or more `<link rel="import" type="css">` links outside the * template. * * Any `<styles>` processed are removed from their original location. * Note: This method is deprecated, use `styleFromModule` instead. * * @deprecated * @memberof Polymer.StyleGather * @param {string} moduleId dom-module id to gather styles from * @return {string} Concatenated CSS content from specified `dom-module` * @this {StyleGather} */ cssFromModule(moduleId) { let m = importModule(moduleId); if (m && m._cssText === undefined) { // module imports: <link rel="import" type="css"> let cssText = this._cssFromModuleImports(m); // include css from the first template in the module let t = m.querySelector('template'); if (t) { cssText += this.cssFromTemplate(t, /** @type {templateWithAssetPath} */(m).assetpath); } m._cssText = cssText || null; } if (!m) { console.warn('Could not find style data in module named', moduleId); } return m && m._cssText || ''; }, /** * Returns CSS text of `<styles>` within a given template. * * Any `<styles>` processed are removed from their original location. * Note: This method is deprecated, use `styleFromTemplate` instead. * * @deprecated * @memberof Polymer.StyleGather * @param {!HTMLTemplateElement} template Template to gather styles from * @param {string} baseURI Base URI to resolve the URL against * @return {string} Concatenated CSS content from specified template * @this {StyleGather} */ cssFromTemplate(template, baseURI) { let cssText = ''; const e$ = this.stylesFromTemplate(template, baseURI); // if element is a template, get content from its .content for (let i=0; i < e$.length; i++) { let e = e$[i]; if (e.parentNode) { e.parentNode.removeChild(e); } cssText += e.textContent; } return cssText; }, /** * Returns CSS text from stylesheets loaded via `<link rel="import" type="css">` * links within the specified `dom-module`. * * Note: This method is deprecated, use `stylesFromModuleImports` instead. * * @deprecated * * @memberof Polymer.StyleGather * @param {string} moduleId Id of `dom-module` to gather CSS from * @return {string} Concatenated CSS content from links in specified `dom-module` * @this {StyleGather} */ cssFromModuleImports(moduleId) { let m = importModule(moduleId); return m ? this._cssFromModuleImports(m) : ''; }, /** * @deprecated * @memberof Polymer.StyleGather * @this {StyleGather} * @param {!HTMLElement} module dom-module element that could contain `<link rel="import" type="css">` styles * @return {string} Concatenated CSS content from links in the dom-module */ _cssFromModuleImports(module) { let cssText = ''; let styles = this._stylesFromModuleImports(module); for (let i=0; i < styles.length; i++) { cssText += styles[i].textContent; } return cssText; } }; Polymer.StyleGather = StyleGather; })(); </script> <script> (function() { 'use strict'; let modules = {}; let lcModules = {}; function setModule(id, module) { // store id separate from lowercased id so that // in all cases mixedCase id will stored distinctly // and lowercase version is a fallback modules[id] = lcModules[id.toLowerCase()] = module; } function findModule(id) { return modules[id] || lcModules[id.toLowerCase()]; } function styleOutsideTemplateCheck(inst) { if (inst.querySelector('style')) { console.warn('dom-module %s has style outside template', inst.id); } } /** * The `dom-module` element registers the dom it contains to the name given * by the module's id attribute. It provides a unified database of dom * accessible via its static `import` API. * * A key use case of `dom-module` is for providing custom element `<template>`s * via HTML imports that are parsed by the native HTML parser, that can be * relocated during a bundling pass and still looked up by `id`. * * Example: * * <dom-module id="foo"> * <img src="stuff.png"> * </dom-module> * * Then in code in some other location that cannot access the dom-module above * * let img = customElements.get('dom-module').import('foo', 'img'); * * @customElement * @extends HTMLElement * @memberof Polymer * @summary Custom element that provides a registry of relocatable DOM content * by `id` that is agnostic to bundling. * @unrestricted */ class DomModule extends HTMLElement { static get observedAttributes() { return ['id']; } /** * Retrieves the element specified by the css `selector` in the module * registered by `id`. For example, this.import('foo', 'img'); * @param {string} id The id of the dom-module in which to search. * @param {string=} selector The css selector by which to find the element. * @return {Element} Returns the element which matches `selector` in the * module registered at the specified `id`. */ static import(id, selector) { if (id) { let m = findModule(id); if (m && selector) { return m.querySelector(selector); } return m; } return null; } /* eslint-disable no-unused-vars */ /** * @param {string} name Name of attribute. * @param {?string} old Old value of attribute. * @param {?string} value Current value of attribute. * @param {?string} namespace Attribute namespace. * @return {void} */ attributeChangedCallback(name, old, value, namespace) { if (old !== value) { this.register(); } } /* eslint-enable no-unused-args */ /** * The absolute URL of the original location of this `dom-module`. * * This value will differ from this element's `ownerDocument` in the * following ways: * - Takes into account any `assetpath` attribute added during bundling * to indicate the original location relative to the bundled location * - Uses the HTMLImports polyfill's `importForElement` API to ensure * the path is relative to the import document's location since * `ownerDocument` is not currently polyfilled */ get assetpath() { // Don't override existing assetpath. if (!this.__assetpath) { // note: assetpath set via an attribute must be relative to this // element's location; accomodate polyfilled HTMLImports const owner = window.HTMLImports && HTMLImports.importForElement ? HTMLImports.importForElement(this) || document : this.ownerDocument; const url = Polymer.ResolveUrl.resolveUrl( this.getAttribute('assetpath') || '', owner.baseURI); this.__assetpath = Polymer.ResolveUrl.pathFromUrl(url); } return this.__assetpath; } /** * Registers the dom-module at a given id. This method should only be called * when a dom-module is imperatively created. For * example, `document.createElement('dom-module').register('foo')`. * @param {string=} id The id at which to register the dom-module. * @return {void} */ register(id) { id = id || this.id; if (id) { // Under strictTemplatePolicy, reject and null out any re-registered // dom-module since it is ambiguous whether first-in or last-in is trusted if (Polymer.strictTemplatePolicy && findModule(id) !== undefined) { setModule(id, null); throw new Error(`strictTemplatePolicy: dom-module ${id} re-registered`); } this.id = id; setModule(id, this); styleOutsideTemplateCheck(this); } } } DomModule.prototype['modules'] = modules; customElements.define('dom-module', DomModule); /** @const */ Polymer.DomModule = DomModule; })(); </script> <script> (function() { 'use strict'; /** * Module with utilities for manipulating structured data path strings. * * @namespace * @memberof Polymer * @summary Module with utilities for manipulating structured data path strings. */ const Path = { /** * Returns true if the given string is a structured data path (has dots). * * Example: * * ``` * Polymer.Path.isPath('foo.bar.baz') // true * Polymer.Path.isPath('foo') // false * ``` * * @memberof Polymer.Path * @param {string} path Path string * @return {boolean} True if the string contained one or more dots */ isPath: function(path) { return path.indexOf('.') >= 0; }, /** * Returns the root property name for the given path. * * Example: * * ``` * Polymer.Path.root('foo.bar.baz') // 'foo' * Polymer.Path.root('foo') // 'foo' * ``` * * @memberof Polymer.Path * @param {string} path Path string * @return {string} Root property name */ root: function(path) { let dotIndex = path.indexOf('.'); if (dotIndex === -1) { return path; } return path.slice(0, dotIndex); }, /** * Given `base` is `foo.bar`, `foo` is an ancestor, `foo.bar` is not * Returns true if the given path is an ancestor of the base path. * * Example: * * ``` * Polymer.Path.isAncestor('foo.bar', 'foo') // true * Polymer.Path.isAncestor('foo.bar', 'foo.bar') // false * Polymer.Path.isAncestor('foo.bar', 'foo.bar.baz') // false * ``` * * @memberof Polymer.Path * @param {string} base Path string to test against. * @param {string} path Path string to test. * @return {boolean} True if `path` is an ancestor of `base`. */ isAncestor: function(base, path) { // base.startsWith(path + '.'); return base.indexOf(path + '.') === 0; }, /** * Given `base` is `foo.bar`, `foo.bar.baz` is an descendant * * Example: * * ``` * Polymer.Path.isDescendant('foo.bar', 'foo.bar.baz') // true * Polymer.Path.isDescendant('foo.bar', 'foo.bar') // false * Polymer.Path.isDescendant('foo.bar', 'foo') // false * ``` * * @memberof Polymer.Path * @param {string} base Path string to test against. * @param {string} path Path string to test. * @return {boolean} True if `path` is a descendant of `base`. */ isDescendant: function(base, path) { // path.startsWith(base + '.'); return path.indexOf(base + '.') === 0; }, /** * Replaces a previous base path with a new base path, preserving the * remainder of the path. * * User must ensure `path` has a prefix of `base`. * * Example: * * ``` * Polymer.Path.translate('foo.bar', 'zot', 'foo.bar.baz') // 'zot.baz' * ``` * * @memberof Polymer.Path * @param {string} base Current base string to remove * @param {string} newBase New base string to replace with * @param {string} path Path to translate * @return {string} Translated string */ translate: function(base, newBase, path) { return newBase + path.slice(base.length); }, /** * @param {string} base Path string to test against * @param {string} path Path string to test * @return {boolean} True if `path` is equal to `base` * @this {Path} */ matches: function(base, path) { return (base === path) || this.isAncestor(base, path) || this.isDescendant(base, path); }, /** * Converts array-based paths to flattened path. String-based paths * are returned as-is. * * Example: * * ``` * Polymer.Path.normalize(['foo.bar', 0, 'baz']) // 'foo.bar.0.baz' * Polymer.Path.normalize('foo.bar.0.baz') // 'foo.bar.0.baz' * ``` * * @memberof Polymer.Path * @param {string | !Array<string|number>} path Input path * @return {string} Flattened path */ normalize: function(path) { if (Array.isArray(path)) { let parts = []; for (let i=0; i<path.length; i++) { let args = path[i].toString().split('.'); for (let j=0; j<args.length; j++) { parts.push(args[j]); } } return parts.join('.'); } else { return path; } }, /** * Splits a path into an array of property names. Accepts either arrays * of path parts or strings. * * Example: * * ``` * Polymer.Path.split(['foo.bar', 0, 'baz']) // ['foo', 'bar', '0', 'baz'] * Polymer.Path.split('foo.bar.0.baz') // ['foo', 'bar', '0', 'baz'] * ``` * * @memberof Polymer.Path * @param {string | !Array<string|number>} path Input path * @return {!Array<string>} Array of path parts * @this {Path} * @suppress {checkTypes} */ split: function(path) { if (Array.isArray(path)) { return this.normalize(path).split('.'); } return path.toString().split('.'); }, /** * Reads a value from a path. If any sub-property in the path is `undefined`, * this method returns `undefined` (will never throw. * * @memberof Polymer.Path * @param {Object} root Object from which to dereference path from * @param {string | !Array<string|number>} path Path to read * @param {Object=} info If an object is provided to `info`, the normalized * (flattened) path will be set to `info.path`. * @return {*} Value at path, or `undefined` if the path could not be * fully dereferenced. * @this {Path} */ get: function(root, path, info) { let prop = root; let parts = this.split(path); // Loop over path parts[0..n-1] and dereference for (let i=0; i<parts.length; i++) { if (!prop) { return; } let part = parts[i]; prop = prop[part]; } if (info) { info.path = parts.join('.'); } return prop; }, /** * Sets a value to a path. If any sub-property in the path is `undefined`, * this method will no-op. * * @memberof Polymer.Path * @param {Object} root Object from which to dereference path from * @param {string | !Array<string|number>} path Path to set * @param {*} value Value to set to path * @return {string | undefined} The normalized version of the input path * @this {Path} */ set: function(root, path, value) { let prop = root; let parts = this.split(path); let last = parts[parts.length-1]; if (parts.length > 1) { // Loop over path parts[0..n-2] and dereference for (let i=0; i<parts.length-1; i++) { let part = parts[i]; prop = prop[part]; if (!prop) { return; } } // Set value to object at end of path prop[last] = value; } else { // Simple property set prop[path] = value; } return parts.join('.'); } }; /** * Returns true if the given string is a structured data path (has dots). * * This function is deprecated. Use `Polymer.Path.isPath` instead. * * Example: * * ``` * Polymer.Path.isDeep('foo.bar.baz') // true * Polymer.Path.isDeep('foo') // false * ``` * * @deprecated * @memberof Polymer.Path * @param {string} path Path string * @return {boolean} True if the string contained one or more dots */ Path.isDeep = Path.isPath; Polymer.Path = Path; })(); </script> <script> (function() { 'use strict'; const caseMap = {}; const DASH_TO_CAMEL = /-[a-z]/g; const CAMEL_TO_DASH = /([A-Z])/g; /** * Module with utilities for converting between "dash-case" and "camelCase" * identifiers. * * @namespace * @memberof Polymer * @summary Module that provides utilities for converting between "dash-case" * and "camelCase". */ const CaseMap = { /** * Converts "dash-case" identifier (e.g. `foo-bar-baz`) to "camelCase" * (e.g. `fooBarBaz`). * * @memberof Polymer.CaseMap * @param {string} dash Dash-case identifier * @return {string} Camel-case representation of the identifier */ dashToCamelCase(dash) { return caseMap[dash] || ( caseMap[dash] = dash.indexOf('-') < 0 ? dash : dash.replace(DASH_TO_CAMEL, (m) => m[1].toUpperCase() ) ); }, /** * Converts "camelCase" identifier (e.g. `fooBarBaz`) to "dash-case" * (e.g. `foo-bar-baz`). * * @memberof Polymer.CaseMap * @param {string} camel Camel-case identifier * @return {string} Dash-case representation of the identifier */ camelToDashCase(camel) { return caseMap[camel] || ( caseMap[camel] = camel.replace(CAMEL_TO_DASH, '-$1').toLowerCase() ); } }; Polymer.CaseMap = CaseMap; })(); </script> <script> (function() { 'use strict'; // Microtask implemented using Mutation Observer let microtaskCurrHandle = 0; let microtaskLastHandle = 0; let microtaskCallbacks = []; let microtaskNodeContent = 0; let microtaskNode = document.createTextNode(''); new window.MutationObserver(microtaskFlush).observe(microtaskNode, {characterData: true}); function microtaskFlush() { const len = microtaskCallbacks.length; for (let i = 0; i < len; i++) { let cb = microtaskCallbacks[i]; if (cb) { try { cb(); } catch (e) { setTimeout(() => { throw e; }); } } } microtaskCallbacks.splice(0, len); microtaskLastHandle += len; } /** * Module that provides a number of strategies for enqueuing asynchronous * tasks. Each sub-module provides a standard `run(fn)` interface that returns a * handle, and a `cancel(handle)` interface for canceling async tasks before * they run. * * @namespace * @memberof Polymer * @summary Module that provides a number of strategies for enqueuing asynchronous * tasks. */ Polymer.Async = { /** * Async interface wrapper around `setTimeout`. * * @namespace * @memberof Polymer.Async * @summary Async interface wrapper around `setTimeout`. */ timeOut: { /** * Returns a sub-module with the async interface providing the provided * delay. * * @memberof Polymer.Async.timeOut * @param {number=} delay Time to wait before calling callbacks in ms * @return {!AsyncInterface} An async timeout interface */ after(delay) { return { run(fn) { return window.setTimeout(fn, delay); }, cancel(handle) { window.clearTimeout(handle); } }; }, /** * Enqueues a function called in the next task. * * @memberof Polymer.Async.timeOut * @param {!Function} fn Callback to run * @param {number=} delay Delay in milliseconds * @return {number} Handle used for canceling task */ run(fn, delay) { return window.setTimeout(fn, delay); }, /** * Cancels a previously enqueued `timeOut` callback. * * @memberof Polymer.Async.timeOut * @param {number} handle Handle returned from `run` of callback to cancel * @return {void} */ cancel(handle) { window.clearTimeout(handle); } }, /** * Async interface wrapper around `requestAnimationFrame`. * * @namespace * @memberof Polymer.Async * @summary Async interface wrapper around `requestAnimationFrame`. */ animationFrame: { /** * Enqueues a function called at `requestAnimationFrame` timing. * * @memberof Polymer.Async.animationFrame * @param {function(number):void} fn Callback to run * @return {number} Handle used for canceling task */ run(fn) { return window.requestAnimationFrame(fn); }, /** * Cancels a previously enqueued `animationFrame` callback. * * @memberof Polymer.Async.animationFrame * @param {number} handle Handle returned from `run` of callback to cancel * @return {void} */ cancel(handle) { window.cancelAnimationFrame(handle); } }, /** * Async interface wrapper around `requestIdleCallback`. Falls back to * `setTimeout` on browsers that do not support `requestIdleCallback`. * * @namespace * @memberof Polymer.Async * @summary Async interface wrapper around `requestIdleCallback`. */ idlePeriod: { /** * Enqueues a function called at `requestIdleCallback` timing. * * @memberof Polymer.Async.idlePeriod * @param {function(!IdleDeadline):void} fn Callback to run * @return {number} Handle used for canceling task */ run(fn) { return window.requestIdleCallback ? window.requestIdleCallback(fn) : window.setTimeout(fn, 16); }, /** * Cancels a previously enqueued `idlePeriod` callback. * * @memberof Polymer.Async.idlePeriod * @param {number} handle Handle returned from `run` of callback to cancel * @return {void} */ cancel(handle) { window.cancelIdleCallback ? window.cancelIdleCallback(handle) : window.clearTimeout(handle); } }, /** * Async interface for enqueuing callbacks that run at microtask timing. * * Note that microtask timing is achieved via a single `MutationObserver`, * and thus callbacks enqueued with this API will all run in a single * batch, and not interleaved with other microtasks such as promises. * Promises are avoided as an implementation choice for the time being * due to Safari bugs that cause Promises to lack microtask guarantees. * * @namespace * @memberof Polymer.Async * @summary Async interface for enqueuing callbacks that run at microtask * timing. */ microTask: { /** * Enqueues a function called at microtask timing. * * @memberof Polymer.Async.microTask * @param {!Function=} callback Callback to run * @return {number} Handle used for canceling task */ run(callback) { microtaskNode.textContent = microtaskNodeContent++; microtaskCallbacks.push(callback); return microtaskCurrHandle++; }, /** * Cancels a previously enqueued `microTask` callback. * * @memberof Polymer.Async.microTask * @param {number} handle Handle returned from `run` of callback to cancel * @return {void} */ cancel(handle) { const idx = handle - microtaskLastHandle; if (idx >= 0) { if (!microtaskCallbacks[idx]) { throw new Error('invalid async handle: ' + handle); } microtaskCallbacks[idx] = null; } } } }; })(); </script> <script> (function () { 'use strict'; /** @const {!AsyncInterface} */ const microtask = Polymer.Async.microTask; /** * Element class mixin that provides basic meta-programming for creating one * or more property accessors (getter/setter pair) that enqueue an async * (batched) `_propertiesChanged` callback. * * For basic usage of this mixin, call `MyClass.createProperties(props)` * once at class definition time to create property accessors for properties * named in props, implement `_propertiesChanged` to react as desired to * property changes, and implement `static get observedAttributes()` and * include lowercase versions of any property names that should be set from * attributes. Last, call `this._enableProperties()` in the element's * `connectedCallback` to enable the accessors. * * @mixinFunction * @polymer * @memberof Polymer * @summary Element class mixin for reacting to property changes from * generated property accessors. */ Polymer.PropertiesChanged = Polymer.dedupingMixin(superClass => { /** * @polymer * @mixinClass * @extends {superClass} * @implements {Polymer_PropertiesChanged} * @unrestricted */ class PropertiesChanged extends superClass { /** * Creates property accessors for the given property names. * @param {!Object} props Object whose keys are names of accessors. * @return {void} * @protected */ static createProperties(props) { const proto = this.prototype; for (let prop in props) { // don't stomp an existing accessor if (!(prop in proto)) { proto._createPropertyAccessor(prop); } } } /** * Returns an attribute name that corresponds to the given property. * The attribute name is the lowercased property name. Override to * customize this mapping. * @param {string} property Property to convert * @return {string} Attribute name corresponding to the given property. * * @protected */ static attributeNameForProperty(property) { return property.toLowerCase(); } /** * Override point to provide a type to which to deserialize a value to * a given property. * @param {string} name Name of property * * @protected */ static typeForProperty(name) { } //eslint-disable-line no-unused-vars /** * Creates a setter/getter pair for the named property with its own * local storage. The getter returns the value in the local storage, * and the setter calls `_setProperty`, which updates the local storage * for the property and enqueues a `_propertiesChanged` callback. * * This method may be called on a prototype or an instance. Calling * this method may overwrite a property value that already exists on * the prototype/instance by creating the accessor. * * @param {string} property Name of the property * @param {boolean=} readOnly When true, no setter is created; the * protected `_setProperty` function must be used to set the property * @return {void} * @protected */ _createPropertyAccessor(property, readOnly) { this._addPropertyToAttributeMap(property); if (!this.hasOwnProperty('__dataHasAccessor')) { this.__dataHasAccessor = Object.assign({}, this.__dataHasAccessor); } if (!this.__dataHasAccessor[property]) { this.__dataHasAccessor[property] = true; this._definePropertyAccessor(property, readOnly); } } /** * Adds the given `property` to a map matching attribute names * to property names, using `attributeNameForProperty`. This map is * used when deserializing attribute values to properties. * * @param {string} property Name of the property */ _addPropertyToAttributeMap(property) { if (!this.hasOwnProperty('__dataAttributes')) { this.__dataAttributes = Object.assign({}, this.__dataAttributes); } if (!this.__dataAttributes[property]) { const attr = this.constructor.attributeNameForProperty(property); this.__dataAttributes[attr] = property; } } /** * Defines a property accessor for the given property. * @param {string} property Name of the property * @param {boolean=} readOnly When true, no setter is created * @return {void} */ _definePropertyAccessor(property, readOnly) { Object.defineProperty(this, property, { /* eslint-disable valid-jsdoc */ /** @this {PropertiesChanged} */ get() { return this._getProperty(property); }, /** @this {PropertiesChanged} */ set: readOnly ? function () {} : function (value) { this._setProperty(property, value); } /* eslint-enable */ }); } constructor() { super(); this.__dataEnabled = false; this.__dataReady = false; this.__dataInvalid = false; this.__data = {}; this.__dataPending = null; this.__dataOld = null; this.__dataInstanceProps = null; this.__serializing = false; this._initializeProperties(); } /** * Lifecycle callback called when properties are enabled via * `_enableProperties`. * * Users may override this function to implement behavior that is * dependent on the element having its property data initialized, e.g. * from defaults (initialized from `constructor`, `_initializeProperties`), * `attributeChangedCallback`, or values propagated from host e.g. via * bindings. `super.ready()` must be called to ensure the data system * becomes enabled. * * @return {void} * @public */ ready() { this.__dataReady = true; this._flushProperties(); } /** * Initializes the local storage for property accessors. * * Provided as an override point for performing any setup work prior * to initializing the property accessor system. * * @return {void} * @protected */ _initializeProperties() { // Capture instance properties; these will be set into accessors // during first flush. Don't set them here, since we want // these to overwrite defaults/constructor assignments for (let p in this.__dataHasAccessor) { if (this.hasOwnProperty(p)) { this.__dataInstanceProps = this.__dataInstanceProps || {}; this.__dataInstanceProps[p] = this[p]; delete this[p]; } } } /** * Called at ready time with bag of instance properties that overwrote * accessors when the element upgraded. * * The default implementation sets these properties back into the * setter at ready time. This method is provided as an override * point for customizing or providing more efficient initialization. * * @param {Object} props Bag of property values that were overwritten * when creating property accessors. * @return {void} * @protected */ _initializeInstanceProperties(props) { Object.assign(this, props); } /** * Updates the local storage for a property (via `_setPendingProperty`) * and enqueues a `_proeprtiesChanged` callback. * * @param {string} property Name of the property * @param {*} value Value to set * @return {void} * @protected */ _setProperty(property, value) { if (this._setPendingProperty(property, value)) { this._invalidateProperties(); } } /** * Returns the value for the given property. * @param {string} property Name of property * @return {*} Value for the given property * @protected */ _getProperty(property) { return this.__data[property]; } /* eslint-disable no-unused-vars */ /** * Updates the local storage for a property, records the previous value, * and adds it to the set of "pending changes" that will be passed to the * `_propertiesChanged` callback. This method does not enqueue the * `_propertiesChanged` callback. * * @param {string} property Name of the property * @param {*} value Value to set * @param {boolean=} ext Not used here; affordance for closure * @return {boolean} Returns true if the property changed * @protected */ _setPendingProperty(property, value, ext) { let old = this.__data[property]; let changed = this._shouldPropertyChange(property, value, old); if (changed) { if (!this.__dataPending) { this.__dataPending = {}; this.__dataOld = {}; } // Ensure old is captured from the last turn if (this.__dataOld && !(property in this.__dataOld)) { this.__dataOld[property] = old; } this.__data[property] = value; this.__dataPending[property] = value; } return changed; } /* eslint-enable */ /** * Marks the properties as invalid, and enqueues an async * `_propertiesChanged` callback. * * @return {void} * @protected */ _invalidateProperties() { if (!this.__dataInvalid && this.__dataReady) { this.__dataInvalid = true; microtask.run(() => { if (this.__dataInvalid) { this.__dataInvalid = false; this._flushProperties(); } }); } } /** * Call to enable property accessor processing. Before this method is * called accessor values will be set but side effects are * queued. When called, any pending side effects occur immediately. * For elements, generally `connectedCallback` is a normal spot to do so. * It is safe to call this method multiple times as it only turns on * property accessors once. * * @return {void} * @protected */ _enableProperties() { if (!this.__dataEnabled) { this.__dataEnabled = true; if (this.__dataInstanceProps) { this._initializeInstanceProperties(this.__dataInstanceProps); this.__dataInstanceProps = null; } this.ready(); } } /** * Calls the `_propertiesChanged` callback with the current set of * pending changes (and old values recorded when pending changes were * set), and resets the pending set of changes. Generally, this method * should not be called in user code. * * @return {void} * @protected */ _flushProperties() { const props = this.__data; const changedProps = this.__dataPending; const old = this.__dataOld; if (this._shouldPropertiesChange(props, changedProps, old)) { this.__dataPending = null; this.__dataOld = null; this._propertiesChanged(props, changedProps, old); } } /** * Called in `_flushProperties` to determine if `_propertiesChanged` * should be called. The default implementation returns true if * properties are pending. Override to customize when * `_propertiesChanged` is called. * @param {!Object} currentProps Bag of all current accessor values * @param {!Object} changedProps Bag of properties changed since the last * call to `_propertiesChanged` * @param {!Object} oldProps Bag of previous values for each property * in `changedProps` * @return {boolean} true if changedProps is truthy */ _shouldPropertiesChange(currentProps, changedProps, oldProps) { // eslint-disable-line no-unused-vars return Boolean(changedProps); } /** * Callback called when any properties with accessors created via * `_createPropertyAccessor` have been set. * * @param {!Object} currentProps Bag of all current accessor values * @param {!Object} changedProps Bag of properties changed since the last * call to `_propertiesChanged` * @param {!Object} oldProps Bag of previous values for each property * in `changedProps` * @return {void} * @protected */ _propertiesChanged(currentProps, changedProps, oldProps) { // eslint-disable-line no-unused-vars } /** * Method called to determine whether a property value should be * considered as a change and cause the `_propertiesChanged` callback * to be enqueued. * * The default implementation returns `true` if a strict equality * check fails. The method always returns false for `NaN`. * * Override this method to e.g. provide stricter checking for * Objects/Arrays when using immutable patterns. * * @param {string} property Property name * @param {*} value New property value * @param {*} old Previous property value * @return {boolean} Whether the property should be considered a change * and enqueue a `_proeprtiesChanged` callback * @protected */ _shouldPropertyChange(property, value, old) { return ( // Strict equality check (old !== value && // This ensures (old==NaN, value==NaN) always returns false (old === old || value === value)) ); } /** * Implements native Custom Elements `attributeChangedCallback` to * set an attribute value to a property via `_attributeToProperty`. * * @param {string} name Name of attribute that changed * @param {?string} old Old attribute value * @param {?string} value New attribute value * @param {?string} namespace Attribute namespace. * @return {void} * @suppress {missingProperties} Super may or may not implement the callback */ attributeChangedCallback(name, old, value, namespace) { if (old !== value) { this._attributeToProperty(name, value); } if (super.attributeChangedCallback) { super.attributeChangedCallback(name, old, value, namespace); } } /** * Deserializes an attribute to its associated property. * * This method calls the `_deserializeValue` method to convert the string to * a typed value. * * @param {string} attribute Name of attribute to deserialize. * @param {?string} value of the attribute. * @param {*=} type type to deserialize to, defaults to the value * returned from `typeForProperty` * @return {void} */ _attributeToProperty(attribute, value, type) { if (!this.__serializing) { const map = this.__dataAttributes; const property = map && map[attribute] || attribute; this[property] = this._deserializeValue(value, type || this.constructor.typeForProperty(property)); } } /** * Serializes a property to its associated attribute. * * @suppress {invalidCasts} Closure can't figure out `this` is an element. * * @param {string} property Property name to reflect. * @param {string=} attribute Attribute name to reflect to. * @param {*=} value Property value to refect. * @return {void} */ _propertyToAttribute(property, attribute, value) { this.__serializing = true; value = (arguments.length < 3) ? this[property] : value; this._valueToNodeAttribute(/** @type {!HTMLElement} */(this), value, attribute || this.constructor.attributeNameForProperty(property)); this.__serializing = false; } /** * Sets a typed value to an HTML attribute on a node. * * This method calls the `_serializeValue` method to convert the typed * value to a string. If the `_serializeValue` method returns `undefined`, * the attribute will be removed (this is the default for boolean * type `false`). * * @param {Element} node Element to set attribute to. * @param {*} value Value to serialize. * @param {string} attribute Attribute name to serialize to. * @return {void} */ _valueToNodeAttribute(node, value, attribute) { const str = this._serializeValue(value); if (str === undefined) { node.removeAttribute(attribute); } else { node.setAttribute(attribute, str); } } /** * Converts a typed JavaScript value to a string. * * This method is called when setting JS property values to * HTML attributes. Users may override this method to provide * serialization for custom types. * * @param {*} value Property value to serialize. * @return {string | undefined} String serialized from the provided * property value. */ _serializeValue(value) { switch (typeof value) { case 'boolean': return value ? '' : undefined; default: return value != null ? value.toString() : undefined; } } /** * Converts a string to a typed JavaScript value. * * This method is called when reading HTML attribute values to * JS properties. Users may override this method to provide * deserialization for custom `type`s. Types for `Boolean`, `String`, * and `Number` convert attributes to the expected types. * * @param {?string} value Value to deserialize. * @param {*=} type Type to deserialize the string to. * @return {*} Typed value deserialized from the provided string. */ _deserializeValue(value, type) { switch (type) { case Boolean: return (value !== null); case Number: return Number(value); default: return value; } } } return PropertiesChanged; }); })(); </script> <script> (function() { 'use strict'; let caseMap = Polymer.CaseMap; // Save map of native properties; this forms a blacklist or properties // that won't have their values "saved" by `saveAccessorValue`, since // reading from an HTMLElement accessor from the context of a prototype throws const nativeProperties = {}; let proto = HTMLElement.prototype; while (proto) { let props = Object.getOwnPropertyNames(proto); for (let i=0; i<props.length; i++) { nativeProperties[props[i]] = true; } proto = Object.getPrototypeOf(proto); } /** * Used to save the value of a property that will be overridden with * an accessor. If the `model` is a prototype, the values will be saved * in `__dataProto`, and it's up to the user (or downstream mixin) to * decide how/when to set these values back into the accessors. * If `model` is already an instance (it has a `__data` property), then * the value will be set as a pending property, meaning the user should * call `_invalidateProperties` or `_flushProperties` to take effect * * @param {Object} model Prototype or instance * @param {string} property Name of property * @return {void} * @private */ function saveAccessorValue(model, property) { // Don't read/store value for any native properties since they could throw if (!nativeProperties[property]) { let value = model[property]; if (value !== undefined) { if (model.__data) { // Adding accessor to instance; update the property // It is the user's responsibility to call _flushProperties model._setPendingProperty(property, value); } else { // Adding accessor to proto; save proto's value for instance-time use if (!model.__dataProto) { model.__dataProto = {}; } else if (!model.hasOwnProperty(JSCompiler_renameProperty('__dataProto', model))) { model.__dataProto = Object.create(model.__dataProto); } model.__dataProto[property] = value; } } } } /** * Element class mixin that provides basic meta-programming for creating one * or more property accessors (getter/setter pair) that enqueue an async * (batched) `_propertiesChanged` callback. * * For basic usage of this mixin: * * - Declare attributes to observe via the standard `static get observedAttributes()`. Use * `dash-case` attribute names to represent `camelCase` property names. * - Implement the `_propertiesChanged` callback on the class. * - Call `MyClass.createPropertiesForAttributes()` **once** on the class to generate * property accessors for each observed attribute. This must be called before the first * instance is created, for example, by calling it before calling `customElements.define`. * It can also be called lazily from the element's `constructor`, as long as it's guarded so * that the call is only made once, when the first instance is created. * - Call `this._enableProperties()` in the element's `connectedCallback` to enable * the accessors. * * Any `observedAttributes` will automatically be * deserialized via `attributeChangedCallback` and set to the associated * property using `dash-case`-to-`camelCase` convention. * * @mixinFunction * @polymer * @appliesMixin Polymer.PropertiesChanged * @memberof Polymer * @summary Element class mixin for reacting to property changes from * generated property accessors. */ Polymer.PropertyAccessors = Polymer.dedupingMixin(superClass => { /** * @constructor * @extends {superClass} * @implements {Polymer_PropertiesChanged} * @unrestricted * @private */ const base = Polymer.PropertiesChanged(superClass); /** * @polymer * @mixinClass * @implements {Polymer_PropertyAccessors} * @extends {base} * @unrestricted */ class PropertyAccessors extends base { /** * Generates property accessors for all attributes in the standard * static `observedAttributes` array. * * Attribute names are mapped to property names using the `dash-case` to * `camelCase` convention * * @return {void} */ static createPropertiesForAttributes() { let a$ = this.observedAttributes; for (let i=0; i < a$.length; i++) { this.prototype._createPropertyAccessor(caseMap.dashToCamelCase(a$[i])); } } /** * Returns an attribute name that corresponds to the given property. * By default, converts camel to dash case, e.g. `fooBar` to `foo-bar`. * @param {string} property Property to convert * @return {string} Attribute name corresponding to the given property. * * @protected */ static attributeNameForProperty(property) { return caseMap.camelToDashCase(property); } /** * Overrides PropertiesChanged implementation to initialize values for * accessors created for values that already existed on the element * prototype. * * @return {void} * @protected */ _initializeProperties() { if (this.__dataProto) { this._initializeProtoProperties(this.__dataProto); this.__dataProto = null; } super._initializeProperties(); } /** * Called at instance time with bag of properties that were overwritten * by accessors on the prototype when accessors were created. * * The default implementation sets these properties back into the * setter at instance time. This method is provided as an override * point for customizing or providing more efficient initialization. * * @param {Object} props Bag of property values that were overwritten * when creating property accessors. * @return {void} * @protected */ _initializeProtoProperties(props) { for (let p in props) { this._setProperty(p, props[p]); } } /** * Ensures the element has the given attribute. If it does not, * assigns the given value to the attribute. * * @suppress {invalidCasts} Closure can't figure out `this` is infact an element * * @param {string} attribute Name of attribute to ensure is set. * @param {string} value of the attribute. * @return {void} */ _ensureAttribute(attribute, value) { const el = /** @type {!HTMLElement} */(this); if (!el.hasAttribute(attribute)) { this._valueToNodeAttribute(el, value, attribute); } } /** * Overrides PropertiesChanged implemention to serialize objects as JSON. * * @param {*} value Property value to serialize. * @return {string | undefined} String serialized from the provided property value. */ _serializeValue(value) { /* eslint-disable no-fallthrough */ switch (typeof value) { case 'object': if (value instanceof Date) { return value.toString(); } else if (value) { try { return JSON.stringify(value); } catch(x) { return ''; } } default: return super._serializeValue(value); } } /** * Converts a string to a typed JavaScript value. * * This method is called by Polymer when reading HTML attribute values to * JS properties. Users may override this method on Polymer element * prototypes to provide deserialization for custom `type`s. Note, * the `type` argument is the value of the `type` field provided in the * `properties` configuration object for a given property, and is * by convention the constructor for the type to deserialize. * * * @param {?string} value Attribute value to deserialize. * @param {*=} type Type to deserialize the string to. * @return {*} Typed value deserialized from the provided string. */ _deserializeValue(value, type) { /** * @type {*} */ let outValue; switch (type) { case Object: try { outValue = JSON.parse(/** @type {string} */(value)); } catch(x) { // allow non-JSON literals like Strings and Numbers outValue = value; } break; case Array: try { outValue = JSON.parse(/** @type {string} */(value)); } catch(x) { outValue = null; console.warn(`Polymer::Attributes: couldn't decode Array as JSON: ${value}`); } break; case Date: outValue = isNaN(value) ? String(value) : Number(value); outValue = new Date(outValue); break; default: outValue = super._deserializeValue(value, type); break; } return outValue; } /* eslint-enable no-fallthrough */ /** * Overrides PropertiesChanged implementation to save existing prototype * property value so that it can be reset. * @param {string} property Name of the property * @param {boolean=} readOnly When true, no setter is created * * When calling on a prototype, any overwritten values are saved in * `__dataProto`, and it is up to the subclasser to decide how/when * to set those properties back into the accessor. When calling on an * instance, the overwritten value is set via `_setPendingProperty`, * and the user should call `_invalidateProperties` or `_flushProperties` * for the values to take effect. * @protected * @return {void} */ _definePropertyAccessor(property, readOnly) { saveAccessorValue(this, property); super._definePropertyAccessor(property, readOnly); } /** * Returns true if this library created an accessor for the given property. * * @param {string} property Property name * @return {boolean} True if an accessor was created */ _hasAccessor(property) { return this.__dataHasAccessor && this.__dataHasAccessor[property]; } /** * Returns true if the specified property has a pending change. * * @param {string} prop Property name * @return {boolean} True if property has a pending change * @protected */ _isPropertyPending(prop) { return Boolean(this.__dataPending && (prop in this.__dataPending)); } } return PropertyAccessors; }); })(); </script> <script> (function() { 'use strict'; const walker = document.createTreeWalker(document, NodeFilter.SHOW_ALL, null, false); // 1.x backwards-compatible auto-wrapper for template type extensions // This is a clear layering violation and gives favored-nation status to // dom-if and dom-repeat templates. This is a conceit we're choosing to keep // a.) to ease 1.x backwards-compatibility due to loss of `is`, and // b.) to maintain if/repeat capability in parser-constrained elements // (e.g. table, select) in lieu of native CE type extensions without // massive new invention in this space (e.g. directive system) const templateExtensions = { 'dom-if': true, 'dom-repeat': true }; function wrapTemplateExtension(node) { let is = node.getAttribute('is'); if (is && templateExtensions[is]) { let t = node; t.removeAttribute('is'); node = t.ownerDocument.createElement(is); t.parentNode.replaceChild(node, t); node.appendChild(t); while(t.attributes.length) { node.setAttribute(t.attributes[0].name, t.attributes[0].value); t.removeAttribute(t.attributes[0].name); } } return node; } function findTemplateNode(root, nodeInfo) { // recursively ascend tree until we hit root let parent = nodeInfo.parentInfo && findTemplateNode(root, nodeInfo.parentInfo); // unwind the stack, returning the indexed node at each level if (parent) { // note: marginally faster than indexing via childNodes // (http://jsperf.com/childnodes-lookup) walker.currentNode = parent; for (let n=walker.firstChild(), i=0; n; n=walker.nextSibling()) { if (nodeInfo.parentIndex === i++) { return n; } } } else { return root; } } // construct `$` map (from id annotations) function applyIdToMap(inst, map, node, nodeInfo) { if (nodeInfo.id) { map[nodeInfo.id] = node; } } // install event listeners (from event annotations) function applyEventListener(inst, node, nodeInfo) { if (nodeInfo.events && nodeInfo.events.length) { for (let j=0, e$=nodeInfo.events, e; (j<e$.length) && (e=e$[j]); j++) { inst._addMethodEventListenerToNode(node, e.name, e.value, inst); } } } // push configuration references at configure time function applyTemplateContent(inst, node, nodeInfo) { if (nodeInfo.templateInfo) { node._templateInfo = nodeInfo.templateInfo; } } function createNodeEventHandler(context, eventName, methodName) { // Instances can optionally have a _methodHost which allows redirecting where // to find methods. Currently used by `templatize`. context = context._methodHost || context; let handler = function(e) { if (context[methodName]) { context[methodName](e, e.detail); } else { console.warn('listener method `' + methodName + '` not defined'); } }; return handler; } /** * Element mixin that provides basic template parsing and stamping, including * the following template-related features for stamped templates: * * - Declarative event listeners (`on-eventname="listener"`) * - Map of node id's to stamped node instances (`this.$.id`) * - Nested template content caching/removal and re-installation (performance * optimization) * * @mixinFunction * @polymer * @memberof Polymer * @summary Element class mixin that provides basic template parsing and stamping */ Polymer.TemplateStamp = Polymer.dedupingMixin(superClass => { /** * @polymer * @mixinClass * @implements {Polymer_TemplateStamp} */ class TemplateStamp extends superClass { /** * Scans a template to produce template metadata. * * Template-specific metadata are stored in the object returned, and node- * specific metadata are stored in objects in its flattened `nodeInfoList` * array. Only nodes in the template that were parsed as nodes of * interest contain an object in `nodeInfoList`. Each `nodeInfo` object * contains an `index` (`childNodes` index in parent) and optionally * `parent`, which points to node info of its parent (including its index). * * The template metadata object returned from this method has the following * structure (many fields optional): * * ```js * { * // Flattened list of node metadata (for nodes that generated metadata) * nodeInfoList: [ * { * // `id` attribute for any nodes with id's for generating `$` map * id: {string}, * // `on-event="handler"` metadata * events: [ * { * name: {string}, // event name * value: {string}, // handler method name * }, ... * ], * // Notes when the template contained a `<slot>` for shady DOM * // optimization purposes * hasInsertionPoint: {boolean}, * // For nested `<template>`` nodes, nested template metadata * templateInfo: {object}, // nested template metadata * // Metadata to allow efficient retrieval of instanced node * // corresponding to this metadata * parentInfo: {number}, // reference to parent nodeInfo> * parentIndex: {number}, // index in parent's `childNodes` collection * infoIndex: {number}, // index of this `nodeInfo` in `templateInfo.nodeInfoList` * }, * ... * ], * // When true, the template had the `strip-whitespace` attribute * // or was nested in a template with that setting * stripWhitespace: {boolean}, * // For nested templates, nested template content is moved into * // a document fragment stored here; this is an optimization to * // avoid the cost of nested template cloning * content: {DocumentFragment} * } * ``` * * This method kicks off a recursive treewalk as follows: * * ``` * _parseTemplate <---------------------+ * _parseTemplateContent | * _parseTemplateNode <------------|--+ * _parseTemplateNestedTemplate --+ | * _parseTemplateChildNodes ---------+ * _parseTemplateNodeAttributes * _parseTemplateNodeAttribute * * ``` * * These methods may be overridden to add custom metadata about templates * to either `templateInfo` or `nodeInfo`. * * Note that this method may be destructive to the template, in that * e.g. event annotations may be removed after being noted in the * template metadata. * * @param {!HTMLTemplateElement} template Template to parse * @param {TemplateInfo=} outerTemplateInfo Template metadata from the outer * template, for parsing nested templates * @return {!TemplateInfo} Parsed template metadata */ static _parseTemplate(template, outerTemplateInfo) { // since a template may be re-used, memo-ize metadata if (!template._templateInfo) { let templateInfo = template._templateInfo = {}; templateInfo.nodeInfoList = []; templateInfo.stripWhiteSpace = Polymer.legacyOptimizations || (outerTemplateInfo && outerTemplateInfo.stripWhiteSpace) || template.hasAttribute('strip-whitespace'); this._parseTemplateContent(template, templateInfo, {parent: null}); } return template._templateInfo; } static _parseTemplateContent(template, templateInfo, nodeInfo) { return this._parseTemplateNode(template.content, templateInfo, nodeInfo); } /** * Parses template node and adds template and node metadata based on * the current node, and its `childNodes` and `attributes`. * * This method may be overridden to add custom node or template specific * metadata based on this node. * * @param {Node} node Node to parse * @param {!TemplateInfo} templateInfo Template metadata for current template * @param {!NodeInfo} nodeInfo Node metadata for current template. * @return {boolean} `true` if the visited node added node-specific * metadata to `nodeInfo` */ static _parseTemplateNode(node, templateInfo, nodeInfo) { let noted; let element = /** @type {Element} */(node); if (element.localName == 'template' && !element.hasAttribute('preserve-content')) { noted = this._parseTemplateNestedTemplate(element, templateInfo, nodeInfo) || noted; } else if (element.localName === 'slot') { // For ShadyDom optimization, indicating there is an insertion point templateInfo.hasInsertionPoint = true; } walker.currentNode = element; if (walker.firstChild()) { noted = this._parseTemplateChildNodes(element, templateInfo, nodeInfo) || noted; } if (element.hasAttributes && element.hasAttributes()) { noted = this._parseTemplateNodeAttributes(element, templateInfo, nodeInfo) || noted; } return noted; } /** * Parses template child nodes for the given root node. * * This method also wraps whitelisted legacy template extensions * (`is="dom-if"` and `is="dom-repeat"`) with their equivalent element * wrappers, collapses text nodes, and strips whitespace from the template * if the `templateInfo.stripWhitespace` setting was provided. * * @param {Node} root Root node whose `childNodes` will be parsed * @param {!TemplateInfo} templateInfo Template metadata for current template * @param {!NodeInfo} nodeInfo Node metadata for current template. * @return {void} */ static _parseTemplateChildNodes(root, templateInfo, nodeInfo) { if (root.localName === 'script' || root.localName === 'style') { return; } walker.currentNode = root; for (let node=walker.firstChild(), parentIndex=0, next; node; node=next) { // Wrap templates if (node.localName == 'template') { node = wrapTemplateExtension(node); } // collapse adjacent textNodes: fixes an IE issue that can cause // text nodes to be inexplicably split =( // note that root.normalize() should work but does not so we do this // manually. walker.currentNode = node; next = walker.nextSibling(); if (node.nodeType === Node.TEXT_NODE) { let /** Node */ n = next; while (n && (n.nodeType === Node.TEXT_NODE)) { node.textContent += n.textContent; next = walker.nextSibling(); root.removeChild(n); n = next; } // optionally strip whitespace if (templateInfo.stripWhiteSpace && !node.textContent.trim()) { root.removeChild(node); continue; } } let childInfo = { parentIndex, parentInfo: nodeInfo }; if (this._parseTemplateNode(node, templateInfo, childInfo)) { childInfo.infoIndex = templateInfo.nodeInfoList.push(/** @type {!NodeInfo} */(childInfo)) - 1; } // Increment if not removed walker.currentNode = node; if (walker.parentNode()) { parentIndex++; } } } /** * Parses template content for the given nested `<template>`. * * Nested template info is stored as `templateInfo` in the current node's * `nodeInfo`. `template.content` is removed and stored in `templateInfo`. * It will then be the responsibility of the host to set it back to the * template and for users stamping nested templates to use the * `_contentForTemplate` method to retrieve the content for this template * (an optimization to avoid the cost of cloning nested template content). * * @param {HTMLTemplateElement} node Node to parse (a <template>) * @param {TemplateInfo} outerTemplateInfo Template metadata for current template * that includes the template `node` * @param {!NodeInfo} nodeInfo Node metadata for current template. * @return {boolean} `true` if the visited node added node-specific * metadata to `nodeInfo` */ static _parseTemplateNestedTemplate(node, outerTemplateInfo, nodeInfo) { let templateInfo = this._parseTemplate(node, outerTemplateInfo); let content = templateInfo.content = node.content.ownerDocument.createDocumentFragment(); content.appendChild(node.content); nodeInfo.templateInfo = templateInfo; return true; } /** * Parses template node attributes and adds node metadata to `nodeInfo` * for nodes of interest. * * @param {Element} node Node to parse * @param {TemplateInfo} templateInfo Template metadata for current template * @param {NodeInfo} nodeInfo Node metadata for current template. * @return {boolean} `true` if the visited node added node-specific * metadata to `nodeInfo` */ static _parseTemplateNodeAttributes(node, templateInfo, nodeInfo) { // Make copy of original attribute list, since the order may change // as attributes are added and removed let noted = false; let attrs = Array.from(node.attributes); for (let i=attrs.length-1, a; (a=attrs[i]); i--) { noted = this._parseTemplateNodeAttribute(node, templateInfo, nodeInfo, a.name, a.value) || noted; } return noted; } /** * Parses a single template node attribute and adds node metadata to * `nodeInfo` for attributes of interest. * * This implementation adds metadata for `on-event="handler"` attributes * and `id` attributes. * * @param {Element} node Node to parse * @param {!TemplateInfo} templateInfo Template metadata for current template * @param {!NodeInfo} nodeInfo Node metadata for current template. * @param {string} name Attribute name * @param {string} value Attribute value * @return {boolean} `true` if the visited node added node-specific * metadata to `nodeInfo` */ static _parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value) { // events (on-*) if (name.slice(0, 3) === 'on-') { node.removeAttribute(name); nodeInfo.events = nodeInfo.events || []; nodeInfo.events.push({ name: name.slice(3), value }); return true; } // static id else if (name === 'id') { nodeInfo.id = value; return true; } return false; } /** * Returns the `content` document fragment for a given template. * * For nested templates, Polymer performs an optimization to cache nested * template content to avoid the cost of cloning deeply nested templates. * This method retrieves the cached content for a given template. * * @param {HTMLTemplateElement} template Template to retrieve `content` for * @return {DocumentFragment} Content fragment */ static _contentForTemplate(template) { let templateInfo = /** @type {HTMLTemplateElementWithInfo} */ (template)._templateInfo; return (templateInfo && templateInfo.content) || template.content; } /** * Clones the provided template content and returns a document fragment * containing the cloned dom. * * The template is parsed (once and memoized) using this library's * template parsing features, and provides the following value-added * features: * * Adds declarative event listeners for `on-event="handler"` attributes * * Generates an "id map" for all nodes with id's under `$` on returned * document fragment * * Passes template info including `content` back to templates as * `_templateInfo` (a performance optimization to avoid deep template * cloning) * * Note that the memoized template parsing process is destructive to the * template: attributes for bindings and declarative event listeners are * removed after being noted in notes, and any nested `<template>.content` * is removed and stored in notes as well. * * @param {!HTMLTemplateElement} template Template to stamp * @return {!StampedTemplate} Cloned template content */ _stampTemplate(template) { // Polyfill support: bootstrap the template if it has not already been if (template && !template.content && window.HTMLTemplateElement && HTMLTemplateElement.decorate) { HTMLTemplateElement.decorate(template); } let templateInfo = this.constructor._parseTemplate(template); let nodeInfo = templateInfo.nodeInfoList; let content = templateInfo.content || template.content; let dom = /** @type {DocumentFragment} */ (document.importNode(content, true)); // NOTE: ShadyDom optimization indicating there is an insertion point dom.__noInsertionPoint = !templateInfo.hasInsertionPoint; let nodes = dom.nodeList = new Array(nodeInfo.length); dom.$ = {}; for (let i=0, l=nodeInfo.length, info; (i<l) && (info=nodeInfo[i]); i++) { let node = nodes[i] = findTemplateNode(dom, info); applyIdToMap(this, dom.$, node, info); applyTemplateContent(this, node, info); applyEventListener(this, node, info); } dom = /** @type {!StampedTemplate} */(dom); // eslint-disable-line no-self-assign return dom; } /** * Adds an event listener by method name for the event provided. * * This method generates a handler function that looks up the method * name at handling time. * * @param {!Node} node Node to add listener on * @param {string} eventName Name of event * @param {string} methodName Name of method * @param {*=} context Context the method will be called on (defaults * to `node`) * @return {Function} Generated handler function */ _addMethodEventListenerToNode(node, eventName, methodName, context) { context = context || node; let handler = createNodeEventHandler(context, eventName, methodName); this._addEventListenerToNode(node, eventName, handler); return handler; } /** * Override point for adding custom or simulated event handling. * * @param {!Node} node Node to add event listener to * @param {string} eventName Name of event * @param {function(!Event):void} handler Listener function to add * @return {void} */ _addEventListenerToNode(node, eventName, handler) { node.addEventListener(eventName, handler); } /** * Override point for adding custom or simulated event handling. * * @param {!Node} node Node to remove event listener from * @param {string} eventName Name of event * @param {function(!Event):void} handler Listener function to remove * @return {void} */ _removeEventListenerFromNode(node, eventName, handler) { node.removeEventListener(eventName, handler); } } return TemplateStamp; }); })(); </script> <script> (function() { 'use strict'; /** @const {Object} */ const CaseMap = Polymer.CaseMap; // Monotonically increasing unique ID used for de-duping effects triggered // from multiple properties in the same turn let dedupeId = 0; /** * Property effect types; effects are stored on the prototype using these keys * @enum {string} */ const TYPES = { COMPUTE: '__computeEffects', REFLECT: '__reflectEffects', NOTIFY: '__notifyEffects', PROPAGATE: '__propagateEffects', OBSERVE: '__observeEffects', READ_ONLY: '__readOnly' }; /** @const {RegExp} */ const capitalAttributeRegex = /[A-Z]/; /** * @typedef {{ * name: (string | undefined), * structured: (boolean | undefined), * wildcard: (boolean | undefined) * }} */ let DataTrigger; //eslint-disable-line no-unused-vars /** * @typedef {{ * info: ?, * trigger: (!DataTrigger | undefined), * fn: (!Function | undefined) * }} */ let DataEffect; //eslint-disable-line no-unused-vars let PropertyEffectsType; //eslint-disable-line no-unused-vars /** * Ensures that the model has an own-property map of effects for the given type. * The model may be a prototype or an instance. * * Property effects are stored as arrays of effects by property in a map, * by named type on the model. e.g. * * __computeEffects: { * foo: [ ... ], * bar: [ ... ] * } * * If the model does not yet have an effect map for the type, one is created * and returned. If it does, but it is not an own property (i.e. the * prototype had effects), the the map is deeply cloned and the copy is * set on the model and returned, ready for new effects to be added. * * @param {Object} model Prototype or instance * @param {string} type Property effect type * @return {Object} The own-property map of effects for the given type * @private */ function ensureOwnEffectMap(model, type) { let effects = model[type]; if (!effects) { effects = model[type] = {}; } else if (!model.hasOwnProperty(type)) { effects = model[type] = Object.create(model[type]); for (let p in effects) { let protoFx = effects[p]; let instFx = effects[p] = Array(protoFx.length); for (let i=0; i<protoFx.length; i++) { instFx[i] = protoFx[i]; } } } return effects; } // -- effects ---------------------------------------------- /** * Runs all effects of a given type for the given set of property changes * on an instance. * * @param {!PropertyEffectsType} inst The instance with effects to run * @param {Object} effects Object map of property-to-Array of effects * @param {Object} props Bag of current property changes * @param {Object=} oldProps Bag of previous values for changed properties * @param {boolean=} hasPaths True with `props` contains one or more paths * @param {*=} extraArgs Additional metadata to pass to effect function * @return {boolean} True if an effect ran for this property * @private */ function runEffects(inst, effects, props, oldProps, hasPaths, extraArgs) { if (effects) { let ran = false; let id = dedupeId++; for (let prop in props) { if (runEffectsForProperty(inst, effects, id, prop, props, oldProps, hasPaths, extraArgs)) { ran = true; } } return ran; } return false; } /** * Runs a list of effects for a given property. * * @param {!PropertyEffectsType} inst The instance with effects to run * @param {Object} effects Object map of property-to-Array of effects * @param {number} dedupeId Counter used for de-duping effects * @param {string} prop Name of changed property * @param {*} props Changed properties * @param {*} oldProps Old properties * @param {boolean=} hasPaths True with `props` contains one or more paths * @param {*=} extraArgs Additional metadata to pass to effect function * @return {boolean} True if an effect ran for this property * @private */ function runEffectsForProperty(inst, effects, dedupeId, prop, props, oldProps, hasPaths, extraArgs) { let ran = false; let rootProperty = hasPaths ? Polymer.Path.root(prop) : prop; let fxs = effects[rootProperty]; if (fxs) { for (let i=0, l=fxs.length, fx; (i<l) && (fx=fxs[i]); i++) { if ((!fx.info || fx.info.lastRun !== dedupeId) && (!hasPaths || pathMatchesTrigger(prop, fx.trigger))) { if (fx.info) { fx.info.lastRun = dedupeId; } fx.fn(inst, prop, props, oldProps, fx.info, hasPaths, extraArgs); ran = true; } } } return ran; } /** * Determines whether a property/path that has changed matches the trigger * criteria for an effect. A trigger is a descriptor with the following * structure, which matches the descriptors returned from `parseArg`. * e.g. for `foo.bar.*`: * ``` * trigger: { * name: 'a.b', * structured: true, * wildcard: true * } * ``` * If no trigger is given, the path is deemed to match. * * @param {string} path Path or property that changed * @param {DataTrigger} trigger Descriptor * @return {boolean} Whether the path matched the trigger */ function pathMatchesTrigger(path, trigger) { if (trigger) { let triggerPath = trigger.name; return (triggerPath == path) || (trigger.structured && Polymer.Path.isAncestor(triggerPath, path)) || (trigger.wildcard && Polymer.Path.isDescendant(triggerPath, path)); } else { return true; } } /** * Implements the "observer" effect. * * Calls the method with `info.methodName` on the instance, passing the * new and old values. * * @param {!PropertyEffectsType} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties * @param {?} info Effect metadata * @return {void} * @private */ function runObserverEffect(inst, property, props, oldProps, info) { let fn = typeof info.method === "string" ? inst[info.method] : info.method; let changedProp = info.property; if (fn) { fn.call(inst, inst.__data[changedProp], oldProps[changedProp]); } else if (!info.dynamicFn) { console.warn('observer method `' + info.method + '` not defined'); } } /** * Runs "notify" effects for a set of changed properties. * * This method differs from the generic `runEffects` method in that it * will dispatch path notification events in the case that the property * changed was a path and the root property for that path didn't have a * "notify" effect. This is to maintain 1.0 behavior that did not require * `notify: true` to ensure object sub-property notifications were * sent. * * @param {!PropertyEffectsType} inst The instance with effects to run * @param {Object} notifyProps Bag of properties to notify * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties * @param {boolean} hasPaths True with `props` contains one or more paths * @return {void} * @private */ function runNotifyEffects(inst, notifyProps, props, oldProps, hasPaths) { // Notify let fxs = inst[TYPES.NOTIFY]; let notified; let id = dedupeId++; // Try normal notify effects; if none, fall back to try path notification for (let prop in notifyProps) { if (notifyProps[prop]) { if (fxs && runEffectsForProperty(inst, fxs, id, prop, props, oldProps, hasPaths)) { notified = true; } else if (hasPaths && notifyPath(inst, prop, props)) { notified = true; } } } // Flush host if we actually notified and host was batching // And the host has already initialized clients; this prevents // an issue with a host observing data changes before clients are ready. let host; if (notified && (host = inst.__dataHost) && host._invalidateProperties) { host._invalidateProperties(); } } /** * Dispatches {property}-changed events with path information in the detail * object to indicate a sub-path of the property was changed. * * @param {!PropertyEffectsType} inst The element from which to fire the event * @param {string} path The path that was changed * @param {Object} props Bag of current property changes * @return {boolean} Returns true if the path was notified * @private */ function notifyPath(inst, path, props) { let rootProperty = Polymer.Path.root(path); if (rootProperty !== path) { let eventName = Polymer.CaseMap.camelToDashCase(rootProperty) + '-changed'; dispatchNotifyEvent(inst, eventName, props[path], path); return true; } return false; } /** * Dispatches {property}-changed events to indicate a property (or path) * changed. * * @param {!PropertyEffectsType} inst The element from which to fire the event * @param {string} eventName The name of the event to send ('{property}-changed') * @param {*} value The value of the changed property * @param {string | null | undefined} path If a sub-path of this property changed, the path * that changed (optional). * @return {void} * @private * @suppress {invalidCasts} */ function dispatchNotifyEvent(inst, eventName, value, path) { let detail = { value: value, queueProperty: true }; if (path) { detail.path = path; } /** @type {!HTMLElement} */(inst).dispatchEvent(new CustomEvent(eventName, { detail })); } /** * Implements the "notify" effect. * * Dispatches a non-bubbling event named `info.eventName` on the instance * with a detail object containing the new `value`. * * @param {!PropertyEffectsType} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties * @param {?} info Effect metadata * @param {boolean} hasPaths True with `props` contains one or more paths * @return {void} * @private */ function runNotifyEffect(inst, property, props, oldProps, info, hasPaths) { let rootProperty = hasPaths ? Polymer.Path.root(property) : property; let path = rootProperty != property ? property : null; let value = path ? Polymer.Path.get(inst, path) : inst.__data[property]; if (path && value === undefined) { value = props[property]; // specifically for .splices } dispatchNotifyEvent(inst, info.eventName, value, path); } /** * Handler function for 2-way notification events. Receives context * information captured in the `addNotifyListener` closure from the * `__notifyListeners` metadata. * * Sets the value of the notified property to the host property or path. If * the event contained path information, translate that path to the host * scope's name for that path first. * * @param {CustomEvent} event Notification event (e.g. '<property>-changed') * @param {!PropertyEffectsType} inst Host element instance handling the notification event * @param {string} fromProp Child element property that was bound * @param {string} toPath Host property/path that was bound * @param {boolean} negate Whether the binding was negated * @return {void} * @private */ function handleNotification(event, inst, fromProp, toPath, negate) { let value; let detail = /** @type {Object} */(event.detail); let fromPath = detail && detail.path; if (fromPath) { toPath = Polymer.Path.translate(fromProp, toPath, fromPath); value = detail && detail.value; } else { value = event.currentTarget[fromProp]; } value = negate ? !value : value; if (!inst[TYPES.READ_ONLY] || !inst[TYPES.READ_ONLY][toPath]) { if (inst._setPendingPropertyOrPath(toPath, value, true, Boolean(fromPath)) && (!detail || !detail.queueProperty)) { inst._invalidateProperties(); } } } /** * Implements the "reflect" effect. * * Sets the attribute named `info.attrName` to the given property value. * * @param {!PropertyEffectsType} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties * @param {?} info Effect metadata * @return {void} * @private */ function runReflectEffect(inst, property, props, oldProps, info) { let value = inst.__data[property]; if (Polymer.sanitizeDOMValue) { value = Polymer.sanitizeDOMValue(value, info.attrName, 'attribute', /** @type {Node} */(inst)); } inst._propertyToAttribute(property, info.attrName, value); } /** * Runs "computed" effects for a set of changed properties. * * This method differs from the generic `runEffects` method in that it * continues to run computed effects based on the output of each pass until * there are no more newly computed properties. This ensures that all * properties that will be computed by the initial set of changes are * computed before other effects (binding propagation, observers, and notify) * run. * * @param {!PropertyEffectsType} inst The instance the effect will be run on * @param {!Object} changedProps Bag of changed properties * @param {!Object} oldProps Bag of previous values for changed properties * @param {boolean} hasPaths True with `props` contains one or more paths * @return {void} * @private */ function runComputedEffects(inst, changedProps, oldProps, hasPaths) { let computeEffects = inst[TYPES.COMPUTE]; if (computeEffects) { let inputProps = changedProps; while (runEffects(inst, computeEffects, inputProps, oldProps, hasPaths)) { Object.assign(oldProps, inst.__dataOld); Object.assign(changedProps, inst.__dataPending); inputProps = inst.__dataPending; inst.__dataPending = null; } } } /** * Implements the "computed property" effect by running the method with the * values of the arguments specified in the `info` object and setting the * return value to the computed property specified. * * @param {!PropertyEffectsType} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties * @param {?} info Effect metadata * @return {void} * @private */ function runComputedEffect(inst, property, props, oldProps, info) { let result = runMethodEffect(inst, property, props, oldProps, info); let computedProp = info.methodInfo; if (inst.__dataHasAccessor && inst.__dataHasAccessor[computedProp]) { inst._setPendingProperty(computedProp, result, true); } else { inst[computedProp] = result; } } /** * Computes path changes based on path links set up using the `linkPaths` * API. * * @param {!PropertyEffectsType} inst The instance whose props are changing * @param {string | !Array<(string|number)>} path Path that has changed * @param {*} value Value of changed path * @return {void} * @private */ function computeLinkedPaths(inst, path, value) { let links = inst.__dataLinkedPaths; if (links) { let link; for (let a in links) { let b = links[a]; if (Polymer.Path.isDescendant(a, path)) { link = Polymer.Path.translate(a, b, path); inst._setPendingPropertyOrPath(link, value, true, true); } else if (Polymer.Path.isDescendant(b, path)) { link = Polymer.Path.translate(b, a, path); inst._setPendingPropertyOrPath(link, value, true, true); } } } } // -- bindings ---------------------------------------------- /** * Adds binding metadata to the current `nodeInfo`, and binding effects * for all part dependencies to `templateInfo`. * * @param {Function} constructor Class that `_parseTemplate` is currently * running on * @param {TemplateInfo} templateInfo Template metadata for current template * @param {NodeInfo} nodeInfo Node metadata for current template node * @param {string} kind Binding kind, either 'property', 'attribute', or 'text' * @param {string} target Target property name * @param {!Array<!BindingPart>} parts Array of binding part metadata * @param {string=} literal Literal text surrounding binding parts (specified * only for 'property' bindings, since these must be initialized as part * of boot-up) * @return {void} * @private */ function addBinding(constructor, templateInfo, nodeInfo, kind, target, parts, literal) { // Create binding metadata and add to nodeInfo nodeInfo.bindings = nodeInfo.bindings || []; let /** Binding */ binding = { kind, target, parts, literal, isCompound: (parts.length !== 1) }; nodeInfo.bindings.push(binding); // Add listener info to binding metadata if (shouldAddListener(binding)) { let {event, negate} = binding.parts[0]; binding.listenerEvent = event || (CaseMap.camelToDashCase(target) + '-changed'); binding.listenerNegate = negate; } // Add "propagate" property effects to templateInfo let index = templateInfo.nodeInfoList.length; for (let i=0; i<binding.parts.length; i++) { let part = binding.parts[i]; part.compoundIndex = i; addEffectForBindingPart(constructor, templateInfo, binding, part, index); } } /** * Adds property effects to the given `templateInfo` for the given binding * part. * * @param {Function} constructor Class that `_parseTemplate` is currently * running on * @param {TemplateInfo} templateInfo Template metadata for current template * @param {!Binding} binding Binding metadata * @param {!BindingPart} part Binding part metadata * @param {number} index Index into `nodeInfoList` for this node * @return {void} */ function addEffectForBindingPart(constructor, templateInfo, binding, part, index) { if (!part.literal) { if (binding.kind === 'attribute' && binding.target[0] === '-') { console.warn('Cannot set attribute ' + binding.target + ' because "-" is not a valid attribute starting character'); } else { let dependencies = part.dependencies; let info = { index, binding, part, evaluator: constructor }; for (let j=0; j<dependencies.length; j++) { let trigger = dependencies[j]; if (typeof trigger == 'string') { trigger = parseArg(trigger); trigger.wildcard = true; } constructor._addTemplatePropertyEffect(templateInfo, trigger.rootProperty, { fn: runBindingEffect, info, trigger }); } } } } /** * Implements the "binding" (property/path binding) effect. * * Note that binding syntax is overridable via `_parseBindings` and * `_evaluateBinding`. This method will call `_evaluateBinding` for any * non-literal parts returned from `_parseBindings`. However, * there is no support for _path_ bindings via custom binding parts, * as this is specific to Polymer's path binding syntax. * * @param {!PropertyEffectsType} inst The instance the effect will be run on * @param {string} path Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties * @param {?} info Effect metadata * @param {boolean} hasPaths True with `props` contains one or more paths * @param {Array} nodeList List of nodes associated with `nodeInfoList` template * metadata * @return {void} * @private */ function runBindingEffect(inst, path, props, oldProps, info, hasPaths, nodeList) { let node = nodeList[info.index]; let binding = info.binding; let part = info.part; // Subpath notification: transform path and set to client // e.g.: foo="{{obj.sub}}", path: 'obj.sub.prop', set 'foo.prop'=obj.sub.prop if (hasPaths && part.source && (path.length > part.source.length) && (binding.kind == 'property') && !binding.isCompound && node.__isPropertyEffectsClient && node.__dataHasAccessor && node.__dataHasAccessor[binding.target]) { let value = props[path]; path = Polymer.Path.translate(part.source, binding.target, path); if (node._setPendingPropertyOrPath(path, value, false, true)) { inst._enqueueClient(node); } } else { let value = info.evaluator._evaluateBinding(inst, part, path, props, oldProps, hasPaths); // Propagate value to child applyBindingValue(inst, node, binding, part, value); } } /** * Sets the value for an "binding" (binding) effect to a node, * either as a property or attribute. * * @param {!PropertyEffectsType} inst The instance owning the binding effect * @param {Node} node Target node for binding * @param {!Binding} binding Binding metadata * @param {!BindingPart} part Binding part metadata * @param {*} value Value to set * @return {void} * @private */ function applyBindingValue(inst, node, binding, part, value) { value = computeBindingValue(node, value, binding, part); if (Polymer.sanitizeDOMValue) { value = Polymer.sanitizeDOMValue(value, binding.target, binding.kind, node); } if (binding.kind == 'attribute') { // Attribute binding inst._valueToNodeAttribute(/** @type {Element} */(node), value, binding.target); } else { // Property binding let prop = binding.target; if (node.__isPropertyEffectsClient && node.__dataHasAccessor && node.__dataHasAccessor[prop]) { if (!node[TYPES.READ_ONLY] || !node[TYPES.READ_ONLY][prop]) { if (node._setPendingProperty(prop, value)) { inst._enqueueClient(node); } } } else { inst._setUnmanagedPropertyToNode(node, prop, value); } } } /** * Transforms an "binding" effect value based on compound & negation * effect metadata, as well as handling for special-case properties * * @param {Node} node Node the value will be set to * @param {*} value Value to set * @param {!Binding} binding Binding metadata * @param {!BindingPart} part Binding part metadata * @return {*} Transformed value to set * @private */ function computeBindingValue(node, value, binding, part) { if (binding.isCompound) { let storage = node.__dataCompoundStorage[binding.target]; storage[part.compoundIndex] = value; value = storage.join(''); } if (binding.kind !== 'attribute') { // Some browsers serialize `undefined` to `"undefined"` if (binding.target === 'textContent' || (binding.target === 'value' && (node.localName === 'input' || node.localName === 'textarea'))) { value = value == undefined ? '' : value; } } return value; } /** * Returns true if a binding's metadata meets all the requirements to allow * 2-way binding, and therefore a `<property>-changed` event listener should be * added: * - used curly braces * - is a property (not attribute) binding * - is not a textContent binding * - is not compound * * @param {!Binding} binding Binding metadata * @return {boolean} True if 2-way listener should be added * @private */ function shouldAddListener(binding) { return Boolean(binding.target) && binding.kind != 'attribute' && binding.kind != 'text' && !binding.isCompound && binding.parts[0].mode === '{'; } /** * Setup compound binding storage structures, notify listeners, and dataHost * references onto the bound nodeList. * * @param {!PropertyEffectsType} inst Instance that bas been previously bound * @param {TemplateInfo} templateInfo Template metadata * @return {void} * @private */ function setupBindings(inst, templateInfo) { // Setup compound storage, dataHost, and notify listeners let {nodeList, nodeInfoList} = templateInfo; if (nodeInfoList.length) { for (let i=0; i < nodeInfoList.length; i++) { let info = nodeInfoList[i]; let node = nodeList[i]; let bindings = info.bindings; if (bindings) { for (let i=0; i<bindings.length; i++) { let binding = bindings[i]; setupCompoundStorage(node, binding); addNotifyListener(node, inst, binding); } } node.__dataHost = inst; } } } /** * Initializes `__dataCompoundStorage` local storage on a bound node with * initial literal data for compound bindings, and sets the joined * literal parts to the bound property. * * When changes to compound parts occur, they are first set into the compound * storage array for that property, and then the array is joined to result in * the final value set to the property/attribute. * * @param {Node} node Bound node to initialize * @param {Binding} binding Binding metadata * @return {void} * @private */ function setupCompoundStorage(node, binding) { if (binding.isCompound) { // Create compound storage map let storage = node.__dataCompoundStorage || (node.__dataCompoundStorage = {}); let parts = binding.parts; // Copy literals from parts into storage for this binding let literals = new Array(parts.length); for (let j=0; j<parts.length; j++) { literals[j] = parts[j].literal; } let target = binding.target; storage[target] = literals; // Configure properties with their literal parts if (binding.literal && binding.kind == 'property') { node[target] = binding.literal; } } } /** * Adds a 2-way binding notification event listener to the node specified * * @param {Object} node Child element to add listener to * @param {!PropertyEffectsType} inst Host element instance to handle notification event * @param {Binding} binding Binding metadata * @return {void} * @private */ function addNotifyListener(node, inst, binding) { if (binding.listenerEvent) { let part = binding.parts[0]; node.addEventListener(binding.listenerEvent, function(e) { handleNotification(e, inst, binding.target, part.source, part.negate); }); } } // -- for method-based effects (complexObserver & computed) -------------- /** * Adds property effects for each argument in the method signature (and * optionally, for the method name if `dynamic` is true) that calls the * provided effect function. * * @param {Element | Object} model Prototype or instance * @param {!MethodSignature} sig Method signature metadata * @param {string} type Type of property effect to add * @param {Function} effectFn Function to run when arguments change * @param {*=} methodInfo Effect-specific information to be included in * method effect metadata * @param {boolean|Object=} dynamicFn Boolean or object map indicating whether * method names should be included as a dependency to the effect. Note, * defaults to true if the signature is static (sig.static is true). * @return {void} * @private */ function createMethodEffect(model, sig, type, effectFn, methodInfo, dynamicFn) { dynamicFn = sig.static || (dynamicFn && (typeof dynamicFn !== 'object' || dynamicFn[sig.methodName])); let info = { methodName: sig.methodName, args: sig.args, methodInfo, dynamicFn }; for (let i=0, arg; (i<sig.args.length) && (arg=sig.args[i]); i++) { if (!arg.literal) { model._addPropertyEffect(arg.rootProperty, type, { fn: effectFn, info: info, trigger: arg }); } } if (dynamicFn) { model._addPropertyEffect(sig.methodName, type, { fn: effectFn, info: info }); } } /** * Calls a method with arguments marshaled from properties on the instance * based on the method signature contained in the effect metadata. * * Multi-property observers, computed properties, and inline computing * functions call this function to invoke the method, then use the return * value accordingly. * * @param {!PropertyEffectsType} inst The instance the effect will be run on * @param {string} property Name of property * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties * @param {?} info Effect metadata * @return {*} Returns the return value from the method invocation * @private */ function runMethodEffect(inst, property, props, oldProps, info) { // Instances can optionally have a _methodHost which allows redirecting where // to find methods. Currently used by `templatize`. let context = inst._methodHost || inst; let fn = context[info.methodName]; if (fn) { let args = inst._marshalArgs(info.args, property, props); return fn.apply(context, args); } else if (!info.dynamicFn) { console.warn('method `' + info.methodName + '` not defined'); } } const emptyArray = []; // Regular expressions used for binding const IDENT = '(?:' + '[a-zA-Z_$][\\w.:$\\-*]*' + ')'; const NUMBER = '(?:' + '[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?' + ')'; const SQUOTE_STRING = '(?:' + '\'(?:[^\'\\\\]|\\\\.)*\'' + ')'; const DQUOTE_STRING = '(?:' + '"(?:[^"\\\\]|\\\\.)*"' + ')'; const STRING = '(?:' + SQUOTE_STRING + '|' + DQUOTE_STRING + ')'; const ARGUMENT = '(?:(' + IDENT + '|' + NUMBER + '|' + STRING + ')\\s*' + ')'; const ARGUMENTS = '(?:' + ARGUMENT + '(?:,\\s*' + ARGUMENT + ')*' + ')'; const ARGUMENT_LIST = '(?:' + '\\(\\s*' + '(?:' + ARGUMENTS + '?' + ')' + '\\)\\s*' + ')'; const BINDING = '(' + IDENT + '\\s*' + ARGUMENT_LIST + '?' + ')'; // Group 3 const OPEN_BRACKET = '(\\[\\[|{{)' + '\\s*'; const CLOSE_BRACKET = '(?:]]|}})'; const NEGATE = '(?:(!)\\s*)?'; // Group 2 const EXPRESSION = OPEN_BRACKET + NEGATE + BINDING + CLOSE_BRACKET; const bindingRegex = new RegExp(EXPRESSION, "g"); /** * Create a string from binding parts of all the literal parts * * @param {!Array<BindingPart>} parts All parts to stringify * @return {string} String made from the literal parts */ function literalFromParts(parts) { let s = ''; for (let i=0; i<parts.length; i++) { let literal = parts[i].literal; s += literal || ''; } return s; } /** * Parses an expression string for a method signature, and returns a metadata * describing the method in terms of `methodName`, `static` (whether all the * arguments are literals), and an array of `args` * * @param {string} expression The expression to parse * @return {?MethodSignature} The method metadata object if a method expression was * found, otherwise `undefined` * @private */ function parseMethod(expression) { // tries to match valid javascript property names let m = expression.match(/([^\s]+?)\(([\s\S]*)\)/); if (m) { let methodName = m[1]; let sig = { methodName, static: true, args: emptyArray }; if (m[2].trim()) { // replace escaped commas with comma entity, split on un-escaped commas let args = m[2].replace(/\\,/g, ',').split(','); return parseArgs(args, sig); } else { return sig; } } return null; } /** * Parses an array of arguments and sets the `args` property of the supplied * signature metadata object. Sets the `static` property to false if any * argument is a non-literal. * * @param {!Array<string>} argList Array of argument names * @param {!MethodSignature} sig Method signature metadata object * @return {!MethodSignature} The updated signature metadata object * @private */ function parseArgs(argList, sig) { sig.args = argList.map(function(rawArg) { let arg = parseArg(rawArg); if (!arg.literal) { sig.static = false; } return arg; }, this); return sig; } /** * Parses an individual argument, and returns an argument metadata object * with the following fields: * * { * value: 'prop', // property/path or literal value * literal: false, // whether argument is a literal * structured: false, // whether the property is a path * rootProperty: 'prop', // the root property of the path * wildcard: false // whether the argument was a wildcard '.*' path * } * * @param {string} rawArg The string value of the argument * @return {!MethodArg} Argument metadata object * @private */ function parseArg(rawArg) { // clean up whitespace let arg = rawArg.trim() // replace comma entity with comma .replace(/,/g, ',') // repair extra escape sequences; note only commas strictly need // escaping, but we allow any other char to be escaped since its // likely users will do this .replace(/\\(.)/g, '\$1') ; // basic argument descriptor let a = { name: arg, value: '', literal: false }; // detect literal value (must be String or Number) let fc = arg[0]; if (fc === '-') { fc = arg[1]; } if (fc >= '0' && fc <= '9') { fc = '#'; } switch(fc) { case "'": case '"': a.value = arg.slice(1, -1); a.literal = true; break; case '#': a.value = Number(arg); a.literal = true; break; } // if not literal, look for structured path if (!a.literal) { a.rootProperty = Polymer.Path.root(arg); // detect structured path (has dots) a.structured = Polymer.Path.isPath(arg); if (a.structured) { a.wildcard = (arg.slice(-2) == '.*'); if (a.wildcard) { a.name = arg.slice(0, -2); } } } return a; } // data api /** * Sends array splice notifications (`.splices` and `.length`) * * Note: this implementation only accepts normalized paths * * @param {!PropertyEffectsType} inst Instance to send notifications to * @param {Array} array The array the mutations occurred on * @param {string} path The path to the array that was mutated * @param {Array} splices Array of splice records * @return {void} * @private */ function notifySplices(inst, array, path, splices) { let splicesPath = path + '.splices'; inst.notifyPath(splicesPath, { indexSplices: splices }); inst.notifyPath(path + '.length', array.length); // Null here to allow potentially large splice records to be GC'ed. inst.__data[splicesPath] = {indexSplices: null}; } /** * Creates a splice record and sends an array splice notification for * the described mutation * * Note: this implementation only accepts normalized paths * * @param {!PropertyEffectsType} inst Instance to send notifications to * @param {Array} array The array the mutations occurred on * @param {string} path The path to the array that was mutated * @param {number} index Index at which the array mutation occurred * @param {number} addedCount Number of added items * @param {Array} removed Array of removed items * @return {void} * @private */ function notifySplice(inst, array, path, index, addedCount, removed) { notifySplices(inst, array, path, [{ index: index, addedCount: addedCount, removed: removed, object: array, type: 'splice' }]); } /** * Returns an upper-cased version of the string. * * @param {string} name String to uppercase * @return {string} Uppercased string * @private */ function upper(name) { return name[0].toUpperCase() + name.substring(1); } /** * Element class mixin that provides meta-programming for Polymer's template * binding and data observation (collectively, "property effects") system. * * This mixin uses provides the following key static methods for adding * property effects to an element class: * - `addPropertyEffect` * - `createPropertyObserver` * - `createMethodObserver` * - `createNotifyingProperty` * - `createReadOnlyProperty` * - `createReflectedProperty` * - `createComputedProperty` * - `bindTemplate` * * Each method creates one or more property accessors, along with metadata * used by this mixin's implementation of `_propertiesChanged` to perform * the property effects. * * Underscored versions of the above methods also exist on the element * prototype for adding property effects on instances at runtime. * * Note that this mixin overrides several `PropertyAccessors` methods, in * many cases to maintain guarantees provided by the Polymer 1.x features; * notably it changes property accessors to be synchronous by default * whereas the default when using `PropertyAccessors` standalone is to be * async by default. * * @mixinFunction * @polymer * @appliesMixin Polymer.TemplateStamp * @appliesMixin Polymer.PropertyAccessors * @memberof Polymer * @summary Element class mixin that provides meta-programming for Polymer's * template binding and data observation system. */ Polymer.PropertyEffects = Polymer.dedupingMixin(superClass => { /** * @constructor * @extends {superClass} * @implements {Polymer_PropertyAccessors} * @implements {Polymer_TemplateStamp} * @unrestricted * @private */ const propertyEffectsBase = Polymer.TemplateStamp(Polymer.PropertyAccessors(superClass)); /** * @polymer * @mixinClass * @implements {Polymer_PropertyEffects} * @extends {propertyEffectsBase} * @unrestricted */ class PropertyEffects extends propertyEffectsBase { constructor() { super(); /** @type {boolean} */ // Used to identify users of this mixin, ala instanceof this.__isPropertyEffectsClient = true; /** @type {number} */ // NOTE: used to track re-entrant calls to `_flushProperties` // path changes dirty check against `__dataTemp` only during one "turn" // and are cleared when `__dataCounter` returns to 0. this.__dataCounter = 0; /** @type {boolean} */ this.__dataClientsReady; /** @type {Array} */ this.__dataPendingClients; /** @type {Object} */ this.__dataToNotify; /** @type {Object} */ this.__dataLinkedPaths; /** @type {boolean} */ this.__dataHasPaths; /** @type {Object} */ this.__dataCompoundStorage; /** @type {Polymer_PropertyEffects} */ this.__dataHost; /** @type {!Object} */ this.__dataTemp; /** @type {boolean} */ this.__dataClientsInitialized; /** @type {!Object} */ this.__data; /** @type {!Object} */ this.__dataPending; /** @type {!Object} */ this.__dataOld; /** @type {Object} */ this.__computeEffects; /** @type {Object} */ this.__reflectEffects; /** @type {Object} */ this.__notifyEffects; /** @type {Object} */ this.__propagateEffects; /** @type {Object} */ this.__observeEffects; /** @type {Object} */ this.__readOnly; /** @type {!TemplateInfo} */ this.__templateInfo; } get PROPERTY_EFFECT_TYPES() { return TYPES; } /** * @return {void} */ _initializeProperties() { super._initializeProperties(); hostStack.registerHost(this); this.__dataClientsReady = false; this.__dataPendingClients = null; this.__dataToNotify = null; this.__dataLinkedPaths = null; this.__dataHasPaths = false; // May be set on instance prior to upgrade this.__dataCompoundStorage = this.__dataCompoundStorage || null; this.__dataHost = this.__dataHost || null; this.__dataTemp = {}; this.__dataClientsInitialized = false; } /** * Overrides `Polymer.PropertyAccessors` implementation to provide a * more efficient implementation of initializing properties from * the prototype on the instance. * * @override * @param {Object} props Properties to initialize on the prototype * @return {void} */ _initializeProtoProperties(props) { this.__data = Object.create(props); this.__dataPending = Object.create(props); this.__dataOld = {}; } /** * Overrides `Polymer.PropertyAccessors` implementation to avoid setting * `_setProperty`'s `shouldNotify: true`. * * @override * @param {Object} props Properties to initialize on the instance * @return {void} */ _initializeInstanceProperties(props) { let readOnly = this[TYPES.READ_ONLY]; for (let prop in props) { if (!readOnly || !readOnly[prop]) { this.__dataPending = this.__dataPending || {}; this.__dataOld = this.__dataOld || {}; this.__data[prop] = this.__dataPending[prop] = props[prop]; } } } // Prototype setup ---------------------------------------- /** * Equivalent to static `addPropertyEffect` API but can be called on * an instance to add effects at runtime. See that method for * full API docs. * * @param {string} property Property that should trigger the effect * @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES * @param {Object=} effect Effect metadata object * @return {void} * @protected */ _addPropertyEffect(property, type, effect) { this._createPropertyAccessor(property, type == TYPES.READ_ONLY); // effects are accumulated into arrays per property based on type let effects = ensureOwnEffectMap(this, type)[property]; if (!effects) { effects = this[type][property] = []; } effects.push(effect); } /** * Removes the given property effect. * * @param {string} property Property the effect was associated with * @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES * @param {Object=} effect Effect metadata object to remove * @return {void} */ _removePropertyEffect(property, type, effect) { let effects = ensureOwnEffectMap(this, type)[property]; let idx = effects.indexOf(effect); if (idx >= 0) { effects.splice(idx, 1); } } /** * Returns whether the current prototype/instance has a property effect * of a certain type. * * @param {string} property Property name * @param {string=} type Effect type, from this.PROPERTY_EFFECT_TYPES * @return {boolean} True if the prototype/instance has an effect of this type * @protected */ _hasPropertyEffect(property, type) { let effects = this[type]; return Boolean(effects && effects[property]); } /** * Returns whether the current prototype/instance has a "read only" * accessor for the given property. * * @param {string} property Property name * @return {boolean} True if the prototype/instance has an effect of this type * @protected */ _hasReadOnlyEffect(property) { return this._hasPropertyEffect(property, TYPES.READ_ONLY); } /** * Returns whether the current prototype/instance has a "notify" * property effect for the given property. * * @param {string} property Property name * @return {boolean} True if the prototype/instance has an effect of this type * @protected */ _hasNotifyEffect(property) { return this._hasPropertyEffect(property, TYPES.NOTIFY); } /** * Returns whether the current prototype/instance has a "reflect to attribute" * property effect for the given property. * * @param {string} property Property name * @return {boolean} True if the prototype/instance has an effect of this type * @protected */ _hasReflectEffect(property) { return this._hasPropertyEffect(property, TYPES.REFLECT); } /** * Returns whether the current prototype/instance has a "computed" * property effect for the given property. * * @param {string} property Property name * @return {boolean} True if the prototype/instance has an effect of this type * @protected */ _hasComputedEffect(property) { return this._hasPropertyEffect(property, TYPES.COMPUTE); } // Runtime ---------------------------------------- /** * Sets a pending property or path. If the root property of the path in * question had no accessor, the path is set, otherwise it is enqueued * via `_setPendingProperty`. * * This function isolates relatively expensive functionality necessary * for the public API (`set`, `setProperties`, `notifyPath`, and property * change listeners via {{...}} bindings), such that it is only done * when paths enter the system, and not at every propagation step. It * also sets a `__dataHasPaths` flag on the instance which is used to * fast-path slower path-matching code in the property effects host paths. * * `path` can be a path string or array of path parts as accepted by the * public API. * * @param {string | !Array<number|string>} path Path to set * @param {*} value Value to set * @param {boolean=} shouldNotify Set to true if this change should * cause a property notification event dispatch * @param {boolean=} isPathNotification If the path being set is a path * notification of an already changed value, as opposed to a request * to set and notify the change. In the latter `false` case, a dirty * check is performed and then the value is set to the path before * enqueuing the pending property change. * @return {boolean} Returns true if the property/path was enqueued in * the pending changes bag. * @protected */ _setPendingPropertyOrPath(path, value, shouldNotify, isPathNotification) { if (isPathNotification || Polymer.Path.root(Array.isArray(path) ? path[0] : path) !== path) { // Dirty check changes being set to a path against the actual object, // since this is the entry point for paths into the system; from here // the only dirty checks are against the `__dataTemp` cache to prevent // duplicate work in the same turn only. Note, if this was a notification // of a change already set to a path (isPathNotification: true), // we always let the change through and skip the `set` since it was // already dirty checked at the point of entry and the underlying // object has already been updated if (!isPathNotification) { let old = Polymer.Path.get(this, path); path = /** @type {string} */ (Polymer.Path.set(this, path, value)); // Use property-accessor's simpler dirty check if (!path || !super._shouldPropertyChange(path, value, old)) { return false; } } this.__dataHasPaths = true; if (this._setPendingProperty(/**@type{string}*/(path), value, shouldNotify)) { computeLinkedPaths(this, path, value); return true; } } else { if (this.__dataHasAccessor && this.__dataHasAccessor[path]) { return this._setPendingProperty(/**@type{string}*/(path), value, shouldNotify); } else { this[path] = value; } } return false; } /** * Applies a value to a non-Polymer element/node's property. * * The implementation makes a best-effort at binding interop: * Some native element properties have side-effects when * re-setting the same value (e.g. setting `<input>.value` resets the * cursor position), so we do a dirty-check before setting the value. * However, for better interop with non-Polymer custom elements that * accept objects, we explicitly re-set object changes coming from the * Polymer world (which may include deep object changes without the * top reference changing), erring on the side of providing more * information. * * Users may override this method to provide alternate approaches. * * @param {!Node} node The node to set a property on * @param {string} prop The property to set * @param {*} value The value to set * @return {void} * @protected */ _setUnmanagedPropertyToNode(node, prop, value) { // It is a judgment call that resetting primitives is // "bad" and resettings objects is also "good"; alternatively we could // implement a whitelist of tag & property values that should never // be reset (e.g. <input>.value && <select>.value) if (value !== node[prop] || typeof value == 'object') { node[prop] = value; } } /** * Overrides the `PropertiesChanged` implementation to introduce special * dirty check logic depending on the property & value being set: * * 1. Any value set to a path (e.g. 'obj.prop': 42 or 'obj.prop': {...}) * Stored in `__dataTemp`, dirty checked against `__dataTemp` * 2. Object set to simple property (e.g. 'prop': {...}) * Stored in `__dataTemp` and `__data`, dirty checked against * `__dataTemp` by default implementation of `_shouldPropertyChange` * 3. Primitive value set to simple property (e.g. 'prop': 42) * Stored in `__data`, dirty checked against `__data` * * The dirty-check is important to prevent cycles due to two-way * notification, but paths and objects are only dirty checked against any * previous value set during this turn via a "temporary cache" that is * cleared when the last `_propertiesChanged` exits. This is so: * a. any cached array paths (e.g. 'array.3.prop') may be invalidated * due to array mutations like shift/unshift/splice; this is fine * since path changes are dirty-checked at user entry points like `set` * b. dirty-checking for objects only lasts one turn to allow the user * to mutate the object in-place and re-set it with the same identity * and have all sub-properties re-propagated in a subsequent turn. * * The temp cache is not necessarily sufficient to prevent invalid array * paths, since a splice can happen during the same turn (with pathological * user code); we could introduce a "fixup" for temporarily cached array * paths if needed: https://github.com/Polymer/polymer/issues/4227 * * @override * @param {string} property Name of the property * @param {*} value Value to set * @param {boolean=} shouldNotify True if property should fire notification * event (applies only for `notify: true` properties) * @return {boolean} Returns true if the property changed */ _setPendingProperty(property, value, shouldNotify) { let isPath = this.__dataHasPaths && Polymer.Path.isPath(property); let prevProps = isPath ? this.__dataTemp : this.__data; if (this._shouldPropertyChange(property, value, prevProps[property])) { if (!this.__dataPending) { this.__dataPending = {}; this.__dataOld = {}; } // Ensure old is captured from the last turn if (!(property in this.__dataOld)) { this.__dataOld[property] = this.__data[property]; } // Paths are stored in temporary cache (cleared at end of turn), // which is used for dirty-checking, all others stored in __data if (isPath) { this.__dataTemp[property] = value; } else { this.__data[property] = value; } // All changes go into pending property bag, passed to _propertiesChanged this.__dataPending[property] = value; // Track properties that should notify separately if (isPath || (this[TYPES.NOTIFY] && this[TYPES.NOTIFY][property])) { this.__dataToNotify = this.__dataToNotify || {}; this.__dataToNotify[property] = shouldNotify; } return true; } return false; } /** * Overrides base implementation to ensure all accessors set `shouldNotify` * to true, for per-property notification tracking. * * @override * @param {string} property Name of the property * @param {*} value Value to set * @return {void} */ _setProperty(property, value) { if (this._setPendingProperty(property, value, true)) { this._invalidateProperties(); } } /** * Overrides `PropertyAccessor`'s default async queuing of * `_propertiesChanged`: if `__dataReady` is false (has not yet been * manually flushed), the function no-ops; otherwise flushes * `_propertiesChanged` synchronously. * * @override * @return {void} */ _invalidateProperties() { if (this.__dataReady) { this._flushProperties(); } } /** * Enqueues the given client on a list of pending clients, whose * pending property changes can later be flushed via a call to * `_flushClients`. * * @param {Object} client PropertyEffects client to enqueue * @return {void} * @protected */ _enqueueClient(client) { this.__dataPendingClients = this.__dataPendingClients || []; if (client !== this) { this.__dataPendingClients.push(client); } } /** * Overrides superclass implementation. * * @return {void} * @protected */ _flushProperties() { this.__dataCounter++; super._flushProperties(); this.__dataCounter--; } /** * Flushes any clients previously enqueued via `_enqueueClient`, causing * their `_flushProperties` method to run. * * @return {void} * @protected */ _flushClients() { if (!this.__dataClientsReady) { this.__dataClientsReady = true; this._readyClients(); // Override point where accessors are turned on; importantly, // this is after clients have fully readied, providing a guarantee // that any property effects occur only after all clients are ready. this.__dataReady = true; } else { this.__enableOrFlushClients(); } } // NOTE: We ensure clients either enable or flush as appropriate. This // handles two corner cases: // (1) clients flush properly when connected/enabled before the host // enables; e.g. // (a) Templatize stamps with no properties and does not flush and // (b) the instance is inserted into dom and // (c) then the instance flushes. // (2) clients enable properly when not connected/enabled when the host // flushes; e.g. // (a) a template is runtime stamped and not yet connected/enabled // (b) a host sets a property, causing stamped dom to flush // (c) the stamped dom enables. __enableOrFlushClients() { let clients = this.__dataPendingClients; if (clients) { this.__dataPendingClients = null; for (let i=0; i < clients.length; i++) { let client = clients[i]; if (!client.__dataEnabled) { client._enableProperties(); } else if (client.__dataPending) { client._flushProperties(); } } } } /** * Perform any initial setup on client dom. Called before the first * `_flushProperties` call on client dom and before any element * observers are called. * * @return {void} * @protected */ _readyClients() { this.__enableOrFlushClients(); } /** * Sets a bag of property changes to this instance, and * synchronously processes all effects of the properties as a batch. * * Property names must be simple properties, not paths. Batched * path propagation is not supported. * * @param {Object} props Bag of one or more key-value pairs whose key is * a property and value is the new value to set for that property. * @param {boolean=} setReadOnly When true, any private values set in * `props` will be set. By default, `setProperties` will not set * `readOnly: true` root properties. * @return {void} * @public */ setProperties(props, setReadOnly) { for (let path in props) { if (setReadOnly || !this[TYPES.READ_ONLY] || !this[TYPES.READ_ONLY][path]) { //TODO(kschaaf): explicitly disallow paths in setProperty? // wildcard observers currently only pass the first changed path // in the `info` object, and you could do some odd things batching // paths, e.g. {'foo.bar': {...}, 'foo': null} this._setPendingPropertyOrPath(path, props[path], true); } } this._invalidateProperties(); } /** * Overrides `PropertyAccessors` so that property accessor * side effects are not enabled until after client dom is fully ready. * Also calls `_flushClients` callback to ensure client dom is enabled * that was not enabled as a result of flushing properties. * * @override * @return {void} */ ready() { // It is important that `super.ready()` is not called here as it // immediately turns on accessors. Instead, we wait until `readyClients` // to enable accessors to provide a guarantee that clients are ready // before processing any accessors side effects. this._flushProperties(); // If no data was pending, `_flushProperties` will not `flushClients` // so ensure this is done. if (!this.__dataClientsReady) { this._flushClients(); } // Before ready, client notifications do not trigger _flushProperties. // Therefore a flush is necessary here if data has been set. if (this.__dataPending) { this._flushProperties(); } } /** * Implements `PropertyAccessors`'s properties changed callback. * * Runs each class of effects for the batch of changed properties in * a specific order (compute, propagate, reflect, observe, notify). * * @param {!Object} currentProps Bag of all current accessor values * @param {!Object} changedProps Bag of properties changed since the last * call to `_propertiesChanged` * @param {!Object} oldProps Bag of previous values for each property * in `changedProps` * @return {void} */ _propertiesChanged(currentProps, changedProps, oldProps) { // ---------------------------- // let c = Object.getOwnPropertyNames(changedProps || {}); // window.debug && console.group(this.localName + '#' + this.id + ': ' + c); // if (window.debug) { debugger; } // ---------------------------- let hasPaths = this.__dataHasPaths; this.__dataHasPaths = false; // Compute properties runComputedEffects(this, changedProps, oldProps, hasPaths); // Clear notify properties prior to possible reentry (propagate, observe), // but after computing effects have a chance to add to them let notifyProps = this.__dataToNotify; this.__dataToNotify = null; // Propagate properties to clients this._propagatePropertyChanges(changedProps, oldProps, hasPaths); // Flush clients this._flushClients(); // Reflect properties runEffects(this, this[TYPES.REFLECT], changedProps, oldProps, hasPaths); // Observe properties runEffects(this, this[TYPES.OBSERVE], changedProps, oldProps, hasPaths); // Notify properties to host if (notifyProps) { runNotifyEffects(this, notifyProps, changedProps, oldProps, hasPaths); } // Clear temporary cache at end of turn if (this.__dataCounter == 1) { this.__dataTemp = {}; } // ---------------------------- // window.debug && console.groupEnd(this.localName + '#' + this.id + ': ' + c); // ---------------------------- } /** * Called to propagate any property changes to stamped template nodes * managed by this element. * * @param {Object} changedProps Bag of changed properties * @param {Object} oldProps Bag of previous values for changed properties * @param {boolean} hasPaths True with `props` contains one or more paths * @return {void} * @protected */ _propagatePropertyChanges(changedProps, oldProps, hasPaths) { if (this[TYPES.PROPAGATE]) { runEffects(this, this[TYPES.PROPAGATE], changedProps, oldProps, hasPaths); } let templateInfo = this.__templateInfo; while (templateInfo) { runEffects(this, templateInfo.propertyEffects, changedProps, oldProps, hasPaths, templateInfo.nodeList); templateInfo = templateInfo.nextTemplateInfo; } } /** * Aliases one data path as another, such that path notifications from one * are routed to the other. * * @param {string | !Array<string|number>} to Target path to link. * @param {string | !Array<string|number>} from Source path to link. * @return {void} * @public */ linkPaths(to, from) { to = Polymer.Path.normalize(to); from = Polymer.Path.normalize(from); this.__dataLinkedPaths = this.__dataLinkedPaths || {}; this.__dataLinkedPaths[to] = from; } /** * Removes a data path alias previously established with `_linkPaths`. * * Note, the path to unlink should be the target (`to`) used when * linking the paths. * * @param {string | !Array<string|number>} path Target path to unlink. * @return {void} * @public */ unlinkPaths(path) { path = Polymer.Path.normalize(path); if (this.__dataLinkedPaths) { delete this.__dataLinkedPaths[path]; } } /** * Notify that an array has changed. * * Example: * * this.items = [ {name: 'Jim'}, {name: 'Todd'}, {name: 'Bill'} ]; * ... * this.items.splice(1, 1, {name: 'Sam'}); * this.items.push({name: 'Bob'}); * this.notifySplices('items', [ * { index: 1, removed: [{name: 'Todd'}], addedCount: 1, object: this.items, type: 'splice' }, * { index: 3, removed: [], addedCount: 1, object: this.items, type: 'splice'} * ]); * * @param {string} path Path that should be notified. * @param {Array} splices Array of splice records indicating ordered * changes that occurred to the array. Each record should have the * following fields: * * index: index at which the change occurred * * removed: array of items that were removed from this index * * addedCount: number of new items added at this index * * object: a reference to the array in question * * type: the string literal 'splice' * * Note that splice records _must_ be normalized such that they are * reported in index order (raw results from `Object.observe` are not * ordered and must be normalized/merged before notifying). * @return {void} * @public */ notifySplices(path, splices) { let info = {path: ''}; let array = /** @type {Array} */(Polymer.Path.get(this, path, info)); notifySplices(this, array, info.path, splices); } /** * Convenience method for reading a value from a path. * * Note, if any part in the path is undefined, this method returns * `undefined` (this method does not throw when dereferencing undefined * paths). * * @param {(string|!Array<(string|number)>)} path Path to the value * to read. The path may be specified as a string (e.g. `foo.bar.baz`) * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that * bracketed expressions are not supported; string-based path parts * *must* be separated by dots. Note that when dereferencing array * indices, the index may be used as a dotted part directly * (e.g. `users.12.name` or `['users', 12, 'name']`). * @param {Object=} root Root object from which the path is evaluated. * @return {*} Value at the path, or `undefined` if any part of the path * is undefined. * @public */ get(path, root) { return Polymer.Path.get(root || this, path); } /** * Convenience method for setting a value to a path and notifying any * elements bound to the same path. * * Note, if any part in the path except for the last is undefined, * this method does nothing (this method does not throw when * dereferencing undefined paths). * * @param {(string|!Array<(string|number)>)} path Path to the value * to write. The path may be specified as a string (e.g. `'foo.bar.baz'`) * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that * bracketed expressions are not supported; string-based path parts * *must* be separated by dots. Note that when dereferencing array * indices, the index may be used as a dotted part directly * (e.g. `'users.12.name'` or `['users', 12, 'name']`). * @param {*} value Value to set at the specified path. * @param {Object=} root Root object from which the path is evaluated. * When specified, no notification will occur. * @return {void} * @public */ set(path, value, root) { if (root) { Polymer.Path.set(root, path, value); } else { if (!this[TYPES.READ_ONLY] || !this[TYPES.READ_ONLY][/** @type {string} */(path)]) { if (this._setPendingPropertyOrPath(path, value, true)) { this._invalidateProperties(); } } } } /** * Adds items onto the end of the array at the path specified. * * The arguments after `path` and return value match that of * `Array.prototype.push`. * * This method notifies other paths to the same array that a * splice occurred to the array. * * @param {string | !Array<string|number>} path Path to array. * @param {...*} items Items to push onto array * @return {number} New length of the array. * @public */ push(path, ...items) { let info = {path: ''}; let array = /** @type {Array}*/(Polymer.Path.get(this, path, info)); let len = array.length; let ret = array.push(...items); if (items.length) { notifySplice(this, array, info.path, len, items.length, []); } return ret; } /** * Removes an item from the end of array at the path specified. * * The arguments after `path` and return value match that of * `Array.prototype.pop`. * * This method notifies other paths to the same array that a * splice occurred to the array. * * @param {string | !Array<string|number>} path Path to array. * @return {*} Item that was removed. * @public */ pop(path) { let info = {path: ''}; let array = /** @type {Array} */(Polymer.Path.get(this, path, info)); let hadLength = Boolean(array.length); let ret = array.pop(); if (hadLength) { notifySplice(this, array, info.path, array.length, 0, [ret]); } return ret; } /** * Starting from the start index specified, removes 0 or more items * from the array and inserts 0 or more new items in their place. * * The arguments after `path` and return value match that of * `Array.prototype.splice`. * * This method notifies other paths to the same array that a * splice occurred to the array. * * @param {string | !Array<string|number>} path Path to array. * @param {number} start Index from which to start removing/inserting. * @param {number} deleteCount Number of items to remove. * @param {...*} items Items to insert into array. * @return {Array} Array of removed items. * @public */ splice(path, start, deleteCount, ...items) { let info = {path : ''}; let array = /** @type {Array} */(Polymer.Path.get(this, path, info)); // Normalize fancy native splice handling of crazy start values if (start < 0) { start = array.length - Math.floor(-start); } else if (start) { start = Math.floor(start); } // array.splice does different things based on the number of arguments // you pass in. Therefore, array.splice(0) and array.splice(0, undefined) // do different things. In the former, the whole array is cleared. In the // latter, no items are removed. // This means that we need to detect whether 1. one of the arguments // is actually passed in and then 2. determine how many arguments // we should pass on to the native array.splice // let ret; // Omit any additional arguments if they were not passed in if (arguments.length === 2) { ret = array.splice(start); // Either start was undefined and the others were defined, but in this // case we can safely pass on all arguments // // Note: this includes the case where none of the arguments were passed in, // e.g. this.splice('array'). However, if both start and deleteCount // are undefined, array.splice will not modify the array (as expected) } else { ret = array.splice(start, deleteCount, ...items); } // At the end, check whether any items were passed in (e.g. insertions) // or if the return array contains items (e.g. deletions). // Only notify if items were added or deleted. if (items.length || ret.length) { notifySplice(this, array, info.path, start, items.length, ret); } return ret; } /** * Removes an item from the beginning of array at the path specified. * * The arguments after `path` and return value match that of * `Array.prototype.pop`. * * This method notifies other paths to the same array that a * splice occurred to the array. * * @param {string | !Array<string|number>} path Path to array. * @return {*} Item that was removed. * @public */ shift(path) { let info = {path: ''}; let array = /** @type {Array} */(Polymer.Path.get(this, path, info)); let hadLength = Boolean(array.length); let ret = array.shift(); if (hadLength) { notifySplice(this, array, info.path, 0, 0, [ret]); } return ret; } /** * Adds items onto the beginning of the array at the path specified. * * The arguments after `path` and return value match that of * `Array.prototype.push`. * * This method notifies other paths to the same array that a * splice occurred to the array. * * @param {string | !Array<string|number>} path Path to array. * @param {...*} items Items to insert info array * @return {number} New length of the array. * @public */ unshift(path, ...items) { let info = {path: ''}; let array = /** @type {Array} */(Polymer.Path.get(this, path, info)); let ret = array.unshift(...items); if (items.length) { notifySplice(this, array, info.path, 0, items.length, []); } return ret; } /** * Notify that a path has changed. * * Example: * * this.item.user.name = 'Bob'; * this.notifyPath('item.user.name'); * * @param {string} path Path that should be notified. * @param {*=} value Value at the path (optional). * @return {void} * @public */ notifyPath(path, value) { /** @type {string} */ let propPath; if (arguments.length == 1) { // Get value if not supplied let info = {path: ''}; value = Polymer.Path.get(this, path, info); propPath = info.path; } else if (Array.isArray(path)) { // Normalize path if needed propPath = Polymer.Path.normalize(path); } else { propPath = /** @type{string} */(path); } if (this._setPendingPropertyOrPath(propPath, value, true, true)) { this._invalidateProperties(); } } /** * Equivalent to static `createReadOnlyProperty` API but can be called on * an instance to add effects at runtime. See that method for * full API docs. * * @param {string} property Property name * @param {boolean=} protectedSetter Creates a custom protected setter * when `true`. * @return {void} * @protected */ _createReadOnlyProperty(property, protectedSetter) { this._addPropertyEffect(property, TYPES.READ_ONLY); if (protectedSetter) { this['_set' + upper(property)] = /** @this {PropertyEffects} */function(value) { this._setProperty(property, value); }; } } /** * Equivalent to static `createPropertyObserver` API but can be called on * an instance to add effects at runtime. See that method for * full API docs. * * @param {string} property Property name * @param {string|function(*,*)} method Function or name of observer method to call * @param {boolean=} dynamicFn Whether the method name should be included as * a dependency to the effect. * @return {void} * @protected */ _createPropertyObserver(property, method, dynamicFn) { let info = { property, method, dynamicFn: Boolean(dynamicFn) }; this._addPropertyEffect(property, TYPES.OBSERVE, { fn: runObserverEffect, info, trigger: {name: property} }); if (dynamicFn) { this._addPropertyEffect(/** @type {string} */(method), TYPES.OBSERVE, { fn: runObserverEffect, info, trigger: {name: method} }); } } /** * Equivalent to static `createMethodObserver` API but can be called on * an instance to add effects at runtime. See that method for * full API docs. * * @param {string} expression Method expression * @param {boolean|Object=} dynamicFn Boolean or object map indicating * whether method names should be included as a dependency to the effect. * @return {void} * @protected */ _createMethodObserver(expression, dynamicFn) { let sig = parseMethod(expression); if (!sig) { throw new Error("Malformed observer expression '" + expression + "'"); } createMethodEffect(this, sig, TYPES.OBSERVE, runMethodEffect, null, dynamicFn); } /** * Equivalent to static `createNotifyingProperty` API but can be called on * an instance to add effects at runtime. See that method for * full API docs. * * @param {string} property Property name * @return {void} * @protected */ _createNotifyingProperty(property) { this._addPropertyEffect(property, TYPES.NOTIFY, { fn: runNotifyEffect, info: { eventName: CaseMap.camelToDashCase(property) + '-changed', property: property } }); } /** * Equivalent to static `createReflectedProperty` API but can be called on * an instance to add effects at runtime. See that method for * full API docs. * * @param {string} property Property name * @return {void} * @protected */ _createReflectedProperty(property) { let attr = this.constructor.attributeNameForProperty(property); if (attr[0] === '-') { console.warn('Property ' + property + ' cannot be reflected to attribute ' + attr + ' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'); } else { this._addPropertyEffect(property, TYPES.REFLECT, { fn: runReflectEffect, info: { attrName: attr } }); } } /** * Equivalent to static `createComputedProperty` API but can be called on * an instance to add effects at runtime. See that method for * full API docs. * * @param {string} property Name of computed property to set * @param {string} expression Method expression * @param {boolean|Object=} dynamicFn Boolean or object map indicating * whether method names should be included as a dependency to the effect. * @return {void} * @protected */ _createComputedProperty(property, expression, dynamicFn) { let sig = parseMethod(expression); if (!sig) { throw new Error("Malformed computed expression '" + expression + "'"); } createMethodEffect(this, sig, TYPES.COMPUTE, runComputedEffect, property, dynamicFn); } /** * Gather the argument values for a method specified in the provided array * of argument metadata. * * The `path` and `value` arguments are used to fill in wildcard descriptor * when the method is being called as a result of a path notification. * * @param {!Array<!MethodArg>} args Array of argument metadata * @param {string} path Property/path name that triggered the method effect * @param {Object} props Bag of current property changes * @return {Array<*>} Array of argument values * @private */ _marshalArgs(args, path, props) { const data = this.__data; let values = []; for (let i=0, l=args.length; i<l; i++) { let arg = args[i]; let name = arg.name; let v; if (arg.literal) { v = arg.value; } else { if (arg.structured) { v = Polymer.Path.get(data, name); // when data is not stored e.g. `splices` if (v === undefined) { v = props[name]; } } else { v = data[name]; } } if (arg.wildcard) { // Only send the actual path changed info if the change that // caused the observer to run matched the wildcard let baseChanged = (name.indexOf(path + '.') === 0); let matches = (path.indexOf(name) === 0 && !baseChanged); values[i] = { path: matches ? path : name, value: matches ? props[path] : v, base: v }; } else { values[i] = v; } } return values; } // -- static class methods ------------ /** * Ensures an accessor exists for the specified property, and adds * to a list of "property effects" that will run when the accessor for * the specified property is set. Effects are grouped by "type", which * roughly corresponds to a phase in effect processing. The effect * metadata should be in the following form: * * { * fn: effectFunction, // Reference to function to call to perform effect * info: { ... } // Effect metadata passed to function * trigger: { // Optional triggering metadata; if not provided * name: string // the property is treated as a wildcard * structured: boolean * wildcard: boolean * } * } * * Effects are called from `_propertiesChanged` in the following order by * type: * * 1. COMPUTE * 2. PROPAGATE * 3. REFLECT * 4. OBSERVE * 5. NOTIFY * * Effect functions are called with the following signature: * * effectFunction(inst, path, props, oldProps, info, hasPaths) * * @param {string} property Property that should trigger the effect * @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES * @param {Object=} effect Effect metadata object * @return {void} * @protected */ static addPropertyEffect(property, type, effect) { this.prototype._addPropertyEffect(property, type, effect); } /** * Creates a single-property observer for the given property. * * @param {string} property Property name * @param {string|function(*,*)} method Function or name of observer method to call * @param {boolean=} dynamicFn Whether the method name should be included as * a dependency to the effect. * @return {void} * @protected */ static createPropertyObserver(property, method, dynamicFn) { this.prototype._createPropertyObserver(property, method, dynamicFn); } /** * Creates a multi-property "method observer" based on the provided * expression, which should be a string in the form of a normal JavaScript * function signature: `'methodName(arg1, [..., argn])'`. Each argument * should correspond to a property or path in the context of this * prototype (or instance), or may be a literal string or number. * * @param {string} expression Method expression * @param {boolean|Object=} dynamicFn Boolean or object map indicating * @return {void} * whether method names should be included as a dependency to the effect. * @protected */ static createMethodObserver(expression, dynamicFn) { this.prototype._createMethodObserver(expression, dynamicFn); } /** * Causes the setter for the given property to dispatch `<property>-changed` * events to notify of changes to the property. * * @param {string} property Property name * @return {void} * @protected */ static createNotifyingProperty(property) { this.prototype._createNotifyingProperty(property); } /** * Creates a read-only accessor for the given property. * * To set the property, use the protected `_setProperty` API. * To create a custom protected setter (e.g. `_setMyProp()` for * property `myProp`), pass `true` for `protectedSetter`. * * Note, if the property will have other property effects, this method * should be called first, before adding other effects. * * @param {string} property Property name * @param {boolean=} protectedSetter Creates a custom protected setter * when `true`. * @return {void} * @protected */ static createReadOnlyProperty(property, protectedSetter) { this.prototype._createReadOnlyProperty(property, protectedSetter); } /** * Causes the setter for the given property to reflect the property value * to a (dash-cased) attribute of the same name. * * @param {string} property Property name * @return {void} * @protected */ static createReflectedProperty(property) { this.prototype._createReflectedProperty(property); } /** * Creates a computed property whose value is set to the result of the * method described by the given `expression` each time one or more * arguments to the method changes. The expression should be a string * in the form of a normal JavaScript function signature: * `'methodName(arg1, [..., argn])'` * * @param {string} property Name of computed property to set * @param {string} expression Method expression * @param {boolean|Object=} dynamicFn Boolean or object map indicating whether * method names should be included as a dependency to the effect. * @return {void} * @protected */ static createComputedProperty(property, expression, dynamicFn) { this.prototype._createComputedProperty(property, expression, dynamicFn); } /** * Parses the provided template to ensure binding effects are created * for them, and then ensures property accessors are created for any * dependent properties in the template. Binding effects for bound * templates are stored in a linked list on the instance so that * templates can be efficiently stamped and unstamped. * * @param {!HTMLTemplateElement} template Template containing binding * bindings * @return {!TemplateInfo} Template metadata object * @protected */ static bindTemplate(template) { return this.prototype._bindTemplate(template); } // -- binding ---------------------------------------------- /** * Equivalent to static `bindTemplate` API but can be called on * an instance to add effects at runtime. See that method for * full API docs. * * This method may be called on the prototype (for prototypical template * binding, to avoid creating accessors every instance) once per prototype, * and will be called with `runtimeBinding: true` by `_stampTemplate` to * create and link an instance of the template metadata associated with a * particular stamping. * * @param {!HTMLTemplateElement} template Template containing binding * bindings * @param {boolean=} instanceBinding When false (default), performs * "prototypical" binding of the template and overwrites any previously * bound template for the class. When true (as passed from * `_stampTemplate`), the template info is instanced and linked into * the list of bound templates. * @return {!TemplateInfo} Template metadata object; for `runtimeBinding`, * this is an instance of the prototypical template info * @protected */ _bindTemplate(template, instanceBinding) { let templateInfo = this.constructor._parseTemplate(template); let wasPreBound = this.__templateInfo == templateInfo; // Optimization: since this is called twice for proto-bound templates, // don't attempt to recreate accessors if this template was pre-bound if (!wasPreBound) { for (let prop in templateInfo.propertyEffects) { this._createPropertyAccessor(prop); } } if (instanceBinding) { // For instance-time binding, create instance of template metadata // and link into list of templates if necessary templateInfo = /** @type {!TemplateInfo} */(Object.create(templateInfo)); templateInfo.wasPreBound = wasPreBound; if (!wasPreBound && this.__templateInfo) { let last = this.__templateInfoLast || this.__templateInfo; this.__templateInfoLast = last.nextTemplateInfo = templateInfo; templateInfo.previousTemplateInfo = last; return templateInfo; } } return this.__templateInfo = templateInfo; } /** * Adds a property effect to the given template metadata, which is run * at the "propagate" stage of `_propertiesChanged` when the template * has been bound to the element via `_bindTemplate`. * * The `effect` object should match the format in `_addPropertyEffect`. * * @param {Object} templateInfo Template metadata to add effect to * @param {string} prop Property that should trigger the effect * @param {Object=} effect Effect metadata object * @return {void} * @protected */ static _addTemplatePropertyEffect(templateInfo, prop, effect) { let hostProps = templateInfo.hostProps = templateInfo.hostProps || {}; hostProps[prop] = true; let effects = templateInfo.propertyEffects = templateInfo.propertyEffects || {}; let propEffects = effects[prop] = effects[prop] || []; propEffects.push(effect); } /** * Stamps the provided template and performs instance-time setup for * Polymer template features, including data bindings, declarative event * listeners, and the `this.$` map of `id`'s to nodes. A document fragment * is returned containing the stamped DOM, ready for insertion into the * DOM. * * This method may be called more than once; however note that due to * `shadycss` polyfill limitations, only styles from templates prepared * using `ShadyCSS.prepareTemplate` will be correctly polyfilled (scoped * to the shadow root and support CSS custom properties), and note that * `ShadyCSS.prepareTemplate` may only be called once per element. As such, * any styles required by in runtime-stamped templates must be included * in the main element template. * * @param {!HTMLTemplateElement} template Template to stamp * @return {!StampedTemplate} Cloned template content * @override * @protected */ _stampTemplate(template) { // Ensures that created dom is `_enqueueClient`'d to this element so // that it can be flushed on next call to `_flushProperties` hostStack.beginHosting(this); let dom = super._stampTemplate(template); hostStack.endHosting(this); let templateInfo = /** @type {!TemplateInfo} */(this._bindTemplate(template, true)); // Add template-instance-specific data to instanced templateInfo templateInfo.nodeList = dom.nodeList; // Capture child nodes to allow unstamping of non-prototypical templates if (!templateInfo.wasPreBound) { let nodes = templateInfo.childNodes = []; for (let n=dom.firstChild; n; n=n.nextSibling) { nodes.push(n); } } dom.templateInfo = templateInfo; // Setup compound storage, 2-way listeners, and dataHost for bindings setupBindings(this, templateInfo); // Flush properties into template nodes if already booted if (this.__dataReady) { runEffects(this, templateInfo.propertyEffects, this.__data, null, false, templateInfo.nodeList); } return dom; } /** * Removes and unbinds the nodes previously contained in the provided * DocumentFragment returned from `_stampTemplate`. * * @param {!StampedTemplate} dom DocumentFragment previously returned * from `_stampTemplate` associated with the nodes to be removed * @return {void} * @protected */ _removeBoundDom(dom) { // Unlink template info let templateInfo = dom.templateInfo; if (templateInfo.previousTemplateInfo) { templateInfo.previousTemplateInfo.nextTemplateInfo = templateInfo.nextTemplateInfo; } if (templateInfo.nextTemplateInfo) { templateInfo.nextTemplateInfo.previousTemplateInfo = templateInfo.previousTemplateInfo; } if (this.__templateInfoLast == templateInfo) { this.__templateInfoLast = templateInfo.previousTemplateInfo; } templateInfo.previousTemplateInfo = templateInfo.nextTemplateInfo = null; // Remove stamped nodes let nodes = templateInfo.childNodes; for (let i=0; i<nodes.length; i++) { let node = nodes[i]; node.parentNode.removeChild(node); } } /** * Overrides default `TemplateStamp` implementation to add support for * parsing bindings from `TextNode`'s' `textContent`. A `bindings` * array is added to `nodeInfo` and populated with binding metadata * with information capturing the binding target, and a `parts` array * with one or more metadata objects capturing the source(s) of the * binding. * * @override * @param {Node} node Node to parse * @param {TemplateInfo} templateInfo Template metadata for current template * @param {NodeInfo} nodeInfo Node metadata for current template node * @return {boolean} `true` if the visited node added node-specific * metadata to `nodeInfo` * @protected * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do */ static _parseTemplateNode(node, templateInfo, nodeInfo) { let noted = super._parseTemplateNode(node, templateInfo, nodeInfo); if (node.nodeType === Node.TEXT_NODE) { let parts = this._parseBindings(node.textContent, templateInfo); if (parts) { // Initialize the textContent with any literal parts // NOTE: default to a space here so the textNode remains; some browsers // (IE) omit an empty textNode following cloneNode/importNode. node.textContent = literalFromParts(parts) || ' '; addBinding(this, templateInfo, nodeInfo, 'text', 'textContent', parts); noted = true; } } return noted; } /** * Overrides default `TemplateStamp` implementation to add support for * parsing bindings from attributes. A `bindings` * array is added to `nodeInfo` and populated with binding metadata * with information capturing the binding target, and a `parts` array * with one or more metadata objects capturing the source(s) of the * binding. * * @override * @param {Element} node Node to parse * @param {TemplateInfo} templateInfo Template metadata for current template * @param {NodeInfo} nodeInfo Node metadata for current template node * @param {string} name Attribute name * @param {string} value Attribute value * @return {boolean} `true` if the visited node added node-specific * metadata to `nodeInfo` * @protected * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do */ static _parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value) { let parts = this._parseBindings(value, templateInfo); if (parts) { // Attribute or property let origName = name; let kind = 'property'; // The only way we see a capital letter here is if the attr has // a capital letter in it per spec. In this case, to make sure // this binding works, we go ahead and make the binding to the attribute. if (capitalAttributeRegex.test(name)) { kind = 'attribute'; } else if (name[name.length-1] == '$') { name = name.slice(0, -1); kind = 'attribute'; } // Initialize attribute bindings with any literal parts let literal = literalFromParts(parts); if (literal && kind == 'attribute') { // Ensure a ShadyCSS template scoped style is not removed // when a class$ binding's initial literal value is set. if (name == 'class' && node.hasAttribute('class')) { literal += ' ' + node.getAttribute(name); } node.setAttribute(name, literal); } // Clear attribute before removing, since IE won't allow removing // `value` attribute if it previously had a value (can't // unconditionally set '' before removing since attributes with `$` // can't be set using setAttribute) if (node.localName === 'input' && origName === 'value') { node.setAttribute(origName, ''); } // Remove annotation node.removeAttribute(origName); // Case hackery: attributes are lower-case, but bind targets // (properties) are case sensitive. Gambit is to map dash-case to // camel-case: `foo-bar` becomes `fooBar`. // Attribute bindings are excepted. if (kind === 'property') { name = Polymer.CaseMap.dashToCamelCase(name); } addBinding(this, templateInfo, nodeInfo, kind, name, parts, literal); return true; } else { return super._parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value); } } /** * Overrides default `TemplateStamp` implementation to add support for * binding the properties that a nested template depends on to the template * as `_host_<property>`. * * @override * @param {Node} node Node to parse * @param {TemplateInfo} templateInfo Template metadata for current template * @param {NodeInfo} nodeInfo Node metadata for current template node * @return {boolean} `true` if the visited node added node-specific * metadata to `nodeInfo` * @protected * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do */ static _parseTemplateNestedTemplate(node, templateInfo, nodeInfo) { let noted = super._parseTemplateNestedTemplate(node, templateInfo, nodeInfo); // Merge host props into outer template and add bindings let hostProps = nodeInfo.templateInfo.hostProps; let mode = '{'; for (let source in hostProps) { let parts = [{ mode, source, dependencies: [source] }]; addBinding(this, templateInfo, nodeInfo, 'property', '_host_' + source, parts); } return noted; } /** * Called to parse text in a template (either attribute values or * textContent) into binding metadata. * * Any overrides of this method should return an array of binding part * metadata representing one or more bindings found in the provided text * and any "literal" text in between. Any non-literal parts will be passed * to `_evaluateBinding` when any dependencies change. The only required * fields of each "part" in the returned array are as follows: * * - `dependencies` - Array containing trigger metadata for each property * that should trigger the binding to update * - `literal` - String containing text if the part represents a literal; * in this case no `dependencies` are needed * * Additional metadata for use by `_evaluateBinding` may be provided in * each part object as needed. * * The default implementation handles the following types of bindings * (one or more may be intermixed with literal strings): * - Property binding: `[[prop]]` * - Path binding: `[[object.prop]]` * - Negated property or path bindings: `[[!prop]]` or `[[!object.prop]]` * - Two-way property or path bindings (supports negation): * `{{prop}}`, `{{object.prop}}`, `{{!prop}}` or `{{!object.prop}}` * - Inline computed method (supports negation): * `[[compute(a, 'literal', b)]]`, `[[!compute(a, 'literal', b)]]` * * The default implementation uses a regular expression for best * performance. However, the regular expression uses a white-list of * allowed characters in a data-binding, which causes problems for * data-bindings that do use characters not in this white-list. * * Instead of updating the white-list with all allowed characters, * there is a StrictBindingParser (see lib/mixins/strict-binding-parser) * that uses a state machine instead. This state machine is able to handle * all characters. However, it is slightly less performant, therefore we * extracted it into a separate optional mixin. * * @param {string} text Text to parse from attribute or textContent * @param {Object} templateInfo Current template metadata * @return {Array<!BindingPart>} Array of binding part metadata * @protected */ static _parseBindings(text, templateInfo) { let parts = []; let lastIndex = 0; let m; // Example: "literal1{{prop}}literal2[[!compute(foo,bar)]]final" // Regex matches: // Iteration 1: Iteration 2: // m[1]: '{{' '[[' // m[2]: '' '!' // m[3]: 'prop' 'compute(foo,bar)' while ((m = bindingRegex.exec(text)) !== null) { // Add literal part if (m.index > lastIndex) { parts.push({literal: text.slice(lastIndex, m.index)}); } // Add binding part let mode = m[1][0]; let negate = Boolean(m[2]); let source = m[3].trim(); let customEvent = false, notifyEvent = '', colon = -1; if (mode == '{' && (colon = source.indexOf('::')) > 0) { notifyEvent = source.substring(colon + 2); source = source.substring(0, colon); customEvent = true; } let signature = parseMethod(source); let dependencies = []; if (signature) { // Inline computed function let {args, methodName} = signature; for (let i=0; i<args.length; i++) { let arg = args[i]; if (!arg.literal) { dependencies.push(arg); } } let dynamicFns = templateInfo.dynamicFns; if (dynamicFns && dynamicFns[methodName] || signature.static) { dependencies.push(methodName); signature.dynamicFn = true; } } else { // Property or path dependencies.push(source); } parts.push({ source, mode, negate, customEvent, signature, dependencies, event: notifyEvent }); lastIndex = bindingRegex.lastIndex; } // Add a final literal part if (lastIndex && lastIndex < text.length) { let literal = text.substring(lastIndex); if (literal) { parts.push({ literal: literal }); } } if (parts.length) { return parts; } else { return null; } } /** * Called to evaluate a previously parsed binding part based on a set of * one or more changed dependencies. * * @param {this} inst Element that should be used as scope for * binding dependencies * @param {BindingPart} part Binding part metadata * @param {string} path Property/path that triggered this effect * @param {Object} props Bag of current property changes * @param {Object} oldProps Bag of previous values for changed properties * @param {boolean} hasPaths True with `props` contains one or more paths * @return {*} Value the binding part evaluated to * @protected */ static _evaluateBinding(inst, part, path, props, oldProps, hasPaths) { let value; if (part.signature) { value = runMethodEffect(inst, path, props, oldProps, part.signature); } else if (path != part.source) { value = Polymer.Path.get(inst, part.source); } else { if (hasPaths && Polymer.Path.isPath(path)) { value = Polymer.Path.get(inst, path); } else { value = inst.__data[path]; } } if (part.negate) { value = !value; } return value; } } // make a typing for closure :P PropertyEffectsType = PropertyEffects; return PropertyEffects; }); /** * Helper api for enqueuing client dom created by a host element. * * By default elements are flushed via `_flushProperties` when * `connectedCallback` is called. Elements attach their client dom to * themselves at `ready` time which results from this first flush. * This provides an ordering guarantee that the client dom an element * creates is flushed before the element itself (i.e. client `ready` * fires before host `ready`). * * However, if `_flushProperties` is called *before* an element is connected, * as for example `Templatize` does, this ordering guarantee cannot be * satisfied because no elements are connected. (Note: Bound elements that * receive data do become enqueued clients and are properly ordered but * unbound elements are not.) * * To maintain the desired "client before host" ordering guarantee for this * case we rely on the "host stack. Client nodes registers themselves with * the creating host element when created. This ensures that all client dom * is readied in the proper order, maintaining the desired guarantee. * * @private */ let hostStack = { stack: [], /** * @param {*} inst Instance to add to hostStack * @return {void} * @this {hostStack} */ registerHost(inst) { if (this.stack.length) { let host = this.stack[this.stack.length-1]; host._enqueueClient(inst); } }, /** * @param {*} inst Instance to begin hosting * @return {void} * @this {hostStack} */ beginHosting(inst) { this.stack.push(inst); }, /** * @param {*} inst Instance to end hosting * @return {void} * @this {hostStack} */ endHosting(inst) { let stackLen = this.stack.length; if (stackLen && this.stack[stackLen-1] == inst) { this.stack.pop(); } } }; })(); </script> <script> (function() { 'use strict'; /** * Provides basic tracking of element definitions (registrations) and * instance counts. * * @namespace * @summary Provides basic tracking of element definitions (registrations) and * instance counts. */ Polymer.telemetry = { /** * Total number of Polymer element instances created. * @type {number} */ instanceCount: 0, /** * Array of Polymer element classes that have been finalized. * @type {Array<Polymer.Element>} */ registrations: [], /** * @param {!PolymerElementConstructor} prototype Element prototype to log * @this {this} * @private */ _regLog: function(prototype) { console.log('[' + prototype.is + ']: registered'); }, /** * Registers a class prototype for telemetry purposes. * @param {HTMLElement} prototype Element prototype to register * @this {this} * @protected */ register: function(prototype) { this.registrations.push(prototype); Polymer.log && this._regLog(prototype); }, /** * Logs all elements registered with an `is` to the console. * @public * @this {this} */ dumpRegistrations: function() { this.registrations.forEach(this._regLog); } }; })(); </script> <script> (function() { 'use strict'; /** * Creates a copy of `props` with each property normalized such that * upgraded it is an object with at least a type property { type: Type}. * * @param {Object} props Properties to normalize * @return {Object} Copy of input `props` with normalized properties that * are in the form {type: Type} * @private */ function normalizeProperties(props) { const output = {}; for (let p in props) { const o = props[p]; output[p] = (typeof o === 'function') ? {type: o} : o; } return output; } /** * Mixin that provides a minimal starting point to using the PropertiesChanged * mixin by providing a mechanism to declare properties in a static * getter (e.g. static get properties() { return { foo: String } }). Changes * are reported via the `_propertiesChanged` method. * * This mixin provides no specific support for rendering. Users are expected * to create a ShadowRoot and put content into it and update it in whatever * way makes sense. This can be done in reaction to properties changing by * implementing `_propertiesChanged`. * * @mixinFunction * @polymer * @appliesMixin Polymer.PropertiesChanged * @memberof Polymer * @summary Mixin that provides a minimal starting point for using * the PropertiesChanged mixin by providing a declarative `properties` object. */ Polymer.PropertiesMixin = Polymer.dedupingMixin(superClass => { /** * @constructor * @extends {superClass} * @implements {Polymer_PropertiesChanged} * @private */ const base = Polymer.PropertiesChanged(superClass); /** * Returns the super class constructor for the given class, if it is an * instance of the PropertiesMixin. * * @param {!PropertiesMixinConstructor} constructor PropertiesMixin constructor * @return {PropertiesMixinConstructor} Super class constructor */ function superPropertiesClass(constructor) { const superCtor = Object.getPrototypeOf(constructor); // Note, the `PropertiesMixin` class below only refers to the class // generated by this call to the mixin; the instanceof test only works // because the mixin is deduped and guaranteed only to apply once, hence // all constructors in a proto chain will see the same `PropertiesMixin` return (superCtor.prototype instanceof PropertiesMixin) ? /** @type {PropertiesMixinConstructor} */ (superCtor) : null; } /** * Returns a memoized version of the `properties` object for the * given class. Properties not in object format are converted to at * least {type}. * * @param {PropertiesMixinConstructor} constructor PropertiesMixin constructor * @return {Object} Memoized properties object */ function ownProperties(constructor) { if (!constructor.hasOwnProperty(JSCompiler_renameProperty('__ownProperties', constructor))) { let props = null; if (constructor.hasOwnProperty(JSCompiler_renameProperty('properties', constructor))) { const properties = constructor.properties; if (properties) { props = normalizeProperties(properties); } } constructor.__ownProperties = props; } return constructor.__ownProperties; } /** * @polymer * @mixinClass * @extends {base} * @implements {Polymer_PropertiesMixin} * @unrestricted */ class PropertiesMixin extends base { /** * Implements standard custom elements getter to observes the attributes * listed in `properties`. * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do */ static get observedAttributes() { if (!this.hasOwnProperty('__observedAttributes')) { Polymer.telemetry.register(this.prototype); const props = this._properties; this.__observedAttributes = props ? Object.keys(props).map(p => this.attributeNameForProperty(p)) : []; } return this.__observedAttributes; } /** * Finalizes an element definition, including ensuring any super classes * are also finalized. This includes ensuring property * accessors exist on the element prototype. This method calls * `_finalizeClass` to finalize each constructor in the prototype chain. * @return {void} */ static finalize() { if (!this.hasOwnProperty(JSCompiler_renameProperty('__finalized', this))) { const superCtor = superPropertiesClass(/** @type {PropertiesMixinConstructor} */(this)); if (superCtor) { superCtor.finalize(); } this.__finalized = true; this._finalizeClass(); } } /** * Finalize an element class. This includes ensuring property * accessors exist on the element prototype. This method is called by * `finalize` and finalizes the class constructor. * * @protected */ static _finalizeClass() { const props = ownProperties(/** @type {PropertiesMixinConstructor} */(this)); if (props) { this.createProperties(props); } } /** * Returns a memoized version of all properties, including those inherited * from super classes. Properties not in object format are converted to * at least {type}. * * @return {Object} Object containing properties for this class * @protected */ static get _properties() { if (!this.hasOwnProperty( JSCompiler_renameProperty('__properties', this))) { const superCtor = superPropertiesClass(/** @type {PropertiesMixinConstructor} */(this)); this.__properties = Object.assign({}, superCtor && superCtor._properties, ownProperties(/** @type {PropertiesMixinConstructor} */(this))); } return this.__properties; } /** * Overrides `PropertiesChanged` method to return type specified in the * static `properties` object for the given property. * @param {string} name Name of property * @return {*} Type to which to deserialize attribute * * @protected */ static typeForProperty(name) { const info = this._properties[name]; return info && info.type; } /** * Overrides `PropertiesChanged` method and adds a call to * `finalize` which lazily configures the element's property accessors. * @override * @return {void} */ _initializeProperties() { Polymer.telemetry.instanceCount++; this.constructor.finalize(); super._initializeProperties(); } /** * Called when the element is added to a document. * Calls `_enableProperties` to turn on property system from * `PropertiesChanged`. * @suppress {missingProperties} Super may or may not implement the callback * @return {void} */ connectedCallback() { if (super.connectedCallback) { super.connectedCallback(); } this._enableProperties(); } /** * Called when the element is removed from a document * @suppress {missingProperties} Super may or may not implement the callback * @return {void} */ disconnectedCallback() { if (super.disconnectedCallback) { super.disconnectedCallback(); } } } return PropertiesMixin; }); })(); </script> <script> (function() { 'use strict'; const builtCSS = window.ShadyCSS && window.ShadyCSS['cssBuild']; /** * Element class mixin that provides the core API for Polymer's meta-programming * features including template stamping, data-binding, attribute deserialization, * and property change observation. * * Subclassers may provide the following static getters to return metadata * used to configure Polymer's features for the class: * * - `static get is()`: When the template is provided via a `dom-module`, * users should return the `dom-module` id from a static `is` getter. If * no template is needed or the template is provided directly via the * `template` getter, there is no need to define `is` for the element. * * - `static get template()`: Users may provide the template directly (as * opposed to via `dom-module`) by implementing a static `template` getter. * The getter may return an `HTMLTemplateElement` or a string, which will * automatically be parsed into a template. * * - `static get properties()`: Should return an object describing * property-related metadata used by Polymer features (key: property name * value: object containing property metadata). Valid keys in per-property * metadata include: * - `type` (String|Number|Object|Array|...): Used by * `attributeChangedCallback` to determine how string-based attributes * are deserialized to JavaScript property values. * - `notify` (boolean): Causes a change in the property to fire a * non-bubbling event called `<property>-changed`. Elements that have * enabled two-way binding to the property use this event to observe changes. * - `readOnly` (boolean): Creates a getter for the property, but no setter. * To set a read-only property, use the private setter method * `_setProperty(property, value)`. * - `observer` (string): Observer method name that will be called when * the property changes. The arguments of the method are * `(value, previousValue)`. * - `computed` (string): String describing method and dependent properties * for computing the value of this property (e.g. `'computeFoo(bar, zot)'`). * Computed properties are read-only by default and can only be changed * via the return value of the computing method. * * - `static get observers()`: Array of strings describing multi-property * observer methods and their dependent properties (e.g. * `'observeABC(a, b, c)'`). * * The base class provides default implementations for the following standard * custom element lifecycle callbacks; users may override these, but should * call the super method to ensure * - `constructor`: Run when the element is created or upgraded * - `connectedCallback`: Run each time the element is connected to the * document * - `disconnectedCallback`: Run each time the element is disconnected from * the document * - `attributeChangedCallback`: Run each time an attribute in * `observedAttributes` is set or removed (note: this element's default * `observedAttributes` implementation will automatically return an array * of dash-cased attributes based on `properties`) * * @mixinFunction * @polymer * @appliesMixin Polymer.PropertyEffects * @appliesMixin Polymer.PropertiesMixin * @memberof Polymer * @property rootPath {string} Set to the value of `Polymer.rootPath`, * which defaults to the main document path * @property importPath {string} Set to the value of the class's static * `importPath` property, which defaults to the path of this element's * `dom-module` (when `is` is used), but can be overridden for other * import strategies. * @summary Element class mixin that provides the core API for Polymer's * meta-programming features. */ Polymer.ElementMixin = Polymer.dedupingMixin(base => { /** * @constructor * @extends {base} * @implements {Polymer_PropertyEffects} * @implements {Polymer_PropertiesMixin} * @private */ const polymerElementBase = Polymer.PropertiesMixin(Polymer.PropertyEffects(base)); /** * Returns a list of properties with default values. * This list is created as an optimization since it is a subset of * the list returned from `_properties`. * This list is used in `_initializeProperties` to set property defaults. * * @param {PolymerElementConstructor} constructor Element class * @return {PolymerElementProperties} Flattened properties for this class * that have default values * @private */ function propertyDefaults(constructor) { if (!constructor.hasOwnProperty( JSCompiler_renameProperty('__propertyDefaults', constructor))) { constructor.__propertyDefaults = null; let props = constructor._properties; for (let p in props) { let info = props[p]; if ('value' in info) { constructor.__propertyDefaults = constructor.__propertyDefaults || {}; constructor.__propertyDefaults[p] = info; } } } return constructor.__propertyDefaults; } /** * Returns a memoized version of the `observers` array. * @param {PolymerElementConstructor} constructor Element class * @return {Array} Array containing own observers for the given class * @protected */ function ownObservers(constructor) { if (!constructor.hasOwnProperty( JSCompiler_renameProperty('__ownObservers', constructor))) { constructor.__ownObservers = constructor.hasOwnProperty(JSCompiler_renameProperty('observers', constructor)) ? /** @type {PolymerElementConstructor} */ (constructor).observers : null; } return constructor.__ownObservers; } /** * Creates effects for a property. * * Note, once a property has been set to * `readOnly`, `computed`, `reflectToAttribute`, or `notify` * these values may not be changed. For example, a subclass cannot * alter these settings. However, additional `observers` may be added * by subclasses. * * The info object should contain property metadata as follows: * * * `type`: {function} type to which an attribute matching the property * is deserialized. Note the property is camel-cased from a dash-cased * attribute. For example, 'foo-bar' attribute is deserialized to a * property named 'fooBar'. * * * `readOnly`: {boolean} creates a readOnly property and * makes a private setter for the private of the form '_setFoo' for a * property 'foo', * * * `computed`: {string} creates a computed property. A computed property * is also automatically set to `readOnly: true`. The value is calculated * by running a method and arguments parsed from the given string. For * example 'compute(foo)' will compute a given property when the * 'foo' property changes by executing the 'compute' method. This method * must return the computed value. * * * `reflectToAttribute`: {boolean} If true, the property value is reflected * to an attribute of the same name. Note, the attribute is dash-cased * so a property named 'fooBar' is reflected as 'foo-bar'. * * * `notify`: {boolean} sends a non-bubbling notification event when * the property changes. For example, a property named 'foo' sends an * event named 'foo-changed' with `event.detail` set to the value of * the property. * * * observer: {string} name of a method that runs when the property * changes. The arguments of the method are (value, previousValue). * * Note: Users may want control over modifying property * effects via subclassing. For example, a user might want to make a * reflectToAttribute property not do so in a subclass. We've chosen to * disable this because it leads to additional complication. * For example, a readOnly effect generates a special setter. If a subclass * disables the effect, the setter would fail unexpectedly. * Based on feedback, we may want to try to make effects more malleable * and/or provide an advanced api for manipulating them. * Also consider adding warnings when an effect cannot be changed. * * @param {!PolymerElement} proto Element class prototype to add accessors * and effects to * @param {string} name Name of the property. * @param {Object} info Info object from which to create property effects. * Supported keys: * @param {Object} allProps Flattened map of all properties defined in this * element (including inherited properties) * @return {void} * @private */ function createPropertyFromConfig(proto, name, info, allProps) { // computed forces readOnly... if (info.computed) { info.readOnly = true; } // Note, since all computed properties are readOnly, this prevents // adding additional computed property effects (which leads to a confusing // setup where multiple triggers for setting a property) // While we do have `hasComputedEffect` this is set on the property's // dependencies rather than itself. if (info.computed && !proto._hasReadOnlyEffect(name)) { proto._createComputedProperty(name, info.computed, allProps); } if (info.readOnly && !proto._hasReadOnlyEffect(name)) { proto._createReadOnlyProperty(name, !info.computed); } if (info.reflectToAttribute && !proto._hasReflectEffect(name)) { proto._createReflectedProperty(name); } if (info.notify && !proto._hasNotifyEffect(name)) { proto._createNotifyingProperty(name); } // always add observer if (info.observer) { proto._createPropertyObserver(name, info.observer, allProps[info.observer]); } // always create the mapping from attribute back to property for deserialization. proto._addPropertyToAttributeMap(name); } /** * Process all style elements in the element template. Styles with the * `include` attribute are processed such that any styles in * the associated "style modules" are included in the element template. * @param {PolymerElementConstructor} klass Element class * @param {!HTMLTemplateElement} template Template to process * @param {string} is Name of element * @param {string} baseURI Base URI for element * @private */ function processElementStyles(klass, template, is, baseURI) { if (!builtCSS) { const templateStyles = template.content.querySelectorAll('style'); const stylesWithImports = Polymer.StyleGather.stylesFromTemplate(template); // insert styles from <link rel="import" type="css"> at the top of the template const linkedStyles = Polymer.StyleGather.stylesFromModuleImports(is); const firstTemplateChild = template.content.firstElementChild; for (let idx = 0; idx < linkedStyles.length; idx++) { let s = linkedStyles[idx]; s.textContent = klass._processStyleText(s.textContent, baseURI); template.content.insertBefore(s, firstTemplateChild); } // keep track of the last "concrete" style in the template we have encountered let templateStyleIndex = 0; // ensure all gathered styles are actually in this template. for (let i = 0; i < stylesWithImports.length; i++) { let s = stylesWithImports[i]; let templateStyle = templateStyles[templateStyleIndex]; // if the style is not in this template, it's been "included" and // we put a clone of it in the template before the style that included it if (templateStyle !== s) { s = s.cloneNode(true); templateStyle.parentNode.insertBefore(s, templateStyle); } else { templateStyleIndex++; } s.textContent = klass._processStyleText(s.textContent, baseURI); } } if (window.ShadyCSS) { window.ShadyCSS.prepareTemplate(template, is); } } /** * Look up template from dom-module for element * * @param {!string} is Element name to look up * @return {!HTMLTemplateElement} Template found in dom module, or * undefined if not found * @protected */ function getTemplateFromDomModule(is) { let template = null; if (is && Polymer.DomModule) { template = Polymer.DomModule.import(is, 'template'); // Under strictTemplatePolicy, require any element with an `is` // specified to have a dom-module if (Polymer.strictTemplatePolicy && !template) { throw new Error(`strictTemplatePolicy: expecting dom-module or null template for ${is}`); } } return template; } /** * @polymer * @mixinClass * @unrestricted * @implements {Polymer_ElementMixin} */ class PolymerElement extends polymerElementBase { /** * Override of PropertiesMixin _finalizeClass to create observers and * find the template. * @return {void} * @protected * @override * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do */ static _finalizeClass() { super._finalizeClass(); const observers = ownObservers(this); if (observers) { this.createObservers(observers, this._properties); } this._prepareTemplate(); } static _prepareTemplate() { // note: create "working" template that is finalized at instance time let template = /** @type {PolymerElementConstructor} */ (this).template; if (template) { if (typeof template === 'string') { let t = document.createElement('template'); t.innerHTML = template; template = t; } else if (!Polymer.legacyOptimizations) { template = template.cloneNode(true); } } this.prototype._template = template; } /** * Override of PropertiesChanged createProperties to create accessors * and property effects for all of the properties. * @return {void} * @protected * @override */ static createProperties(props) { for (let p in props) { createPropertyFromConfig(this.prototype, p, props[p], props); } } /** * Creates observers for the given `observers` array. * Leverages `PropertyEffects` to create observers. * @param {Object} observers Array of observer descriptors for * this class * @param {Object} dynamicFns Object containing keys for any properties * that are functions and should trigger the effect when the function * reference is changed * @return {void} * @protected */ static createObservers(observers, dynamicFns) { const proto = this.prototype; for (let i=0; i < observers.length; i++) { proto._createMethodObserver(observers[i], dynamicFns); } } /** * Returns the template that will be stamped into this element's shadow root. * * If a `static get is()` getter is defined, the default implementation * will return the first `<template>` in a `dom-module` whose `id` * matches this element's `is`. * * Users may override this getter to return an arbitrary template * (in which case the `is` getter is unnecessary). The template returned * may be either an `HTMLTemplateElement` or a string that will be * automatically parsed into a template. * * Note that when subclassing, if the super class overrode the default * implementation and the subclass would like to provide an alternate * template via a `dom-module`, it should override this getter and * return `Polymer.DomModule.import(this.is, 'template')`. * * If a subclass would like to modify the super class template, it should * clone it rather than modify it in place. If the getter does expensive * work such as cloning/modifying a template, it should memoize the * template for maximum performance: * * let memoizedTemplate; * class MySubClass extends MySuperClass { * static get template() { * if (!memoizedTemplate) { * memoizedTemplate = MySuperClass.template.cloneNode(true); * let subContent = document.createElement('div'); * subContent.textContent = 'This came from MySubClass'; * memoizedTemplate.content.appendChild(subContent); * } * return memoizedTemplate; * } * } * * @return {HTMLTemplateElement|string} Template to be stamped */ static get template() { // Explanation of template-related properties: // - constructor.template (this getter): the template for the class. // This can come from the prototype (for legacy elements), from a // dom-module, or from the super class's template (or can be overridden // altogether by the user) // - constructor._template: memoized version of constructor.template // - prototype._template: working template for the element, which will be // parsed and modified in place. It is a cloned version of // constructor.template, saved in _finalizeClass(). Note that before // this getter is called, for legacy elements this could be from a // _template field on the info object passed to Polymer(), a behavior, // or set in registered(); once the static getter runs, a clone of it // will overwrite it on the prototype as the working template. if (!this.hasOwnProperty(JSCompiler_renameProperty('_template', this))) { this._template = // If user has put template on prototype (e.g. in legacy via registered // callback or info object), prefer that first this.prototype.hasOwnProperty(JSCompiler_renameProperty('_template', this.prototype)) ? this.prototype._template : // Look in dom-module associated with this element's is (getTemplateFromDomModule(/** @type {PolymerElementConstructor}*/ (this).is) || // Next look for superclass template (call the super impl this // way so that `this` points to the superclass) Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.template); } return this._template; } /** * Set the template. * * @param {!HTMLTemplateElement|string} value Template to set. */ static set template(value) { this._template = value; } /** * Path matching the url from which the element was imported. * * This path is used to resolve url's in template style cssText. * The `importPath` property is also set on element instances and can be * used to create bindings relative to the import path. * * For elements defined in ES modules, users should implement * `static get importMeta() { return import.meta; }`, and the default * implementation of `importPath` will return `import.meta.url`'s path. * For elements defined in HTML imports, this getter will return the path * to the document containing a `dom-module` element matching this * element's static `is` property. * * Note, this path should contain a trailing `/`. * * @return {string} The import path for this element class * @suppress {missingProperties} */ static get importPath() { if (!this.hasOwnProperty(JSCompiler_renameProperty('_importPath', this))) { const meta = this.importMeta; if (meta) { this._importPath = Polymer.ResolveUrl.pathFromUrl(meta.url); } else { const module = Polymer.DomModule && Polymer.DomModule.import(/** @type {PolymerElementConstructor} */ (this).is); this._importPath = (module && module.assetpath) || Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.importPath; } } return this._importPath; } constructor() { super(); /** @type {HTMLTemplateElement} */ this._template; /** @type {string} */ this._importPath; /** @type {string} */ this.rootPath; /** @type {string} */ this.importPath; /** @type {StampedTemplate | HTMLElement | ShadowRoot} */ this.root; /** @type {!Object<string, !Element>} */ this.$; } /** * Overrides the default `Polymer.PropertyAccessors` to ensure class * metaprogramming related to property accessors and effects has * completed (calls `finalize`). * * It also initializes any property defaults provided via `value` in * `properties` metadata. * * @return {void} * @override * @suppress {invalidCasts} */ _initializeProperties() { this.constructor.finalize(); // note: finalize template when we have access to `localName` to // avoid dependence on `is` for polyfilling styling. this.constructor._finalizeTemplate(/** @type {!HTMLElement} */(this).localName); super._initializeProperties(); // set path defaults this.rootPath = Polymer.rootPath; this.importPath = this.constructor.importPath; // apply property defaults... let p$ = propertyDefaults(this.constructor); if (!p$) { return; } for (let p in p$) { let info = p$[p]; // Don't set default value if there is already an own property, which // happens when a `properties` property with default but no effects had // a property set (e.g. bound) by its host before upgrade if (!this.hasOwnProperty(p)) { let value = typeof info.value == 'function' ? info.value.call(this) : info.value; // Set via `_setProperty` if there is an accessor, to enable // initializing readOnly property defaults if (this._hasAccessor(p)) { this._setPendingProperty(p, value, true); } else { this[p] = value; } } } } /** * Gather style text for a style element in the template. * * @param {string} cssText Text containing styling to process * @param {string} baseURI Base URI to rebase CSS paths against * @return {string} The processed CSS text * @protected */ static _processStyleText(cssText, baseURI) { return Polymer.ResolveUrl.resolveCss(cssText, baseURI); } /** * Configures an element `proto` to function with a given `template`. * The element name `is` and extends `ext` must be specified for ShadyCSS * style scoping. * * @param {string} is Tag name (or type extension name) for this element * @return {void} * @protected */ static _finalizeTemplate(is) { /** @const {HTMLTemplateElement} */ const template = this.prototype._template; if (template && !template.__polymerFinalized) { template.__polymerFinalized = true; const importPath = this.importPath; const baseURI = importPath ? Polymer.ResolveUrl.resolveUrl(importPath) : ''; // e.g. support `include="module-name"`, and ShadyCSS processElementStyles(this, template, is, baseURI); this.prototype._bindTemplate(template); } } /** * Provides a default implementation of the standard Custom Elements * `connectedCallback`. * * The default implementation enables the property effects system and * flushes any pending properties, and updates shimmed CSS properties * when using the ShadyCSS scoping/custom properties polyfill. * * @suppress {missingProperties, invalidCasts} Super may or may not implement the callback * @return {void} */ connectedCallback() { if (window.ShadyCSS && this._template) { window.ShadyCSS.styleElement(/** @type {!HTMLElement} */(this)); } super.connectedCallback(); } /** * Stamps the element template. * * @return {void} * @override */ ready() { if (this._template) { this.root = this._stampTemplate(this._template); this.$ = this.root.$; } super.ready(); } /** * Implements `PropertyEffects`'s `_readyClients` call. Attaches * element dom by calling `_attachDom` with the dom stamped from the * element's template via `_stampTemplate`. Note that this allows * client dom to be attached to the element prior to any observers * running. * * @return {void} * @override */ _readyClients() { if (this._template) { this.root = this._attachDom(/** @type {StampedTemplate} */(this.root)); } // The super._readyClients here sets the clients initialized flag. // We must wait to do this until after client dom is created/attached // so that this flag can be checked to prevent notifications fired // during this process from being handled before clients are ready. super._readyClients(); } /** * Attaches an element's stamped dom to itself. By default, * this method creates a `shadowRoot` and adds the dom to it. * However, this method may be overridden to allow an element * to put its dom in another location. * * @throws {Error} * @suppress {missingReturn} * @param {StampedTemplate} dom to attach to the element. * @return {ShadowRoot} node to which the dom has been attached. */ _attachDom(dom) { if (this.attachShadow) { if (dom) { if (!this.shadowRoot) { this.attachShadow({mode: 'open'}); } this.shadowRoot.appendChild(dom); return this.shadowRoot; } return null; } else { throw new Error('ShadowDOM not available. ' + // TODO(sorvell): move to compile-time conditional when supported 'Polymer.Element can create dom as children instead of in ' + 'ShadowDOM by setting `this.root = this;\` before \`ready\`.'); } } /** * When using the ShadyCSS scoping and custom property shim, causes all * shimmed styles in this element (and its subtree) to be updated * based on current custom property values. * * The optional parameter overrides inline custom property styles with an * object of properties where the keys are CSS properties, and the values * are strings. * * Example: `this.updateStyles({'--color': 'blue'})` * * These properties are retained unless a value of `null` is set. * * Note: This function does not support updating CSS mixins. * You can not dynamically change the value of an `@apply`. * * @param {Object=} properties Bag of custom property key/values to * apply to this element. * @return {void} * @suppress {invalidCasts} */ updateStyles(properties) { if (window.ShadyCSS) { window.ShadyCSS.styleSubtree(/** @type {!HTMLElement} */(this), properties); } } /** * Rewrites a given URL relative to a base URL. The base URL defaults to * the original location of the document containing the `dom-module` for * this element. This method will return the same URL before and after * bundling. * * Note that this function performs no resolution for URLs that start * with `/` (absolute URLs) or `#` (hash identifiers). For general purpose * URL resolution, use `window.URL`. * * @param {string} url URL to resolve. * @param {string=} base Optional base URL to resolve against, defaults * to the element's `importPath` * @return {string} Rewritten URL relative to base */ resolveUrl(url, base) { if (!base && this.importPath) { base = Polymer.ResolveUrl.resolveUrl(this.importPath); } return Polymer.ResolveUrl.resolveUrl(url, base); } /** * Overrides `PropertyAccessors` to add map of dynamic functions on * template info, for consumption by `PropertyEffects` template binding * code. This map determines which method templates should have accessors * created for them. * * @override * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do */ static _parseTemplateContent(template, templateInfo, nodeInfo) { templateInfo.dynamicFns = templateInfo.dynamicFns || this._properties; return super._parseTemplateContent(template, templateInfo, nodeInfo); } } return PolymerElement; }); /** * When using the ShadyCSS scoping and custom property shim, causes all * shimmed `styles` (via `custom-style`) in the document (and its subtree) * to be updated based on current custom property values. * * The optional parameter overrides inline custom property styles with an * object of properties where the keys are CSS properties, and the values * are strings. * * Example: `Polymer.updateStyles({'--color': 'blue'})` * * These properties are retained unless a value of `null` is set. * * @param {Object=} props Bag of custom property key/values to * apply to the document. * @return {void} */ Polymer.updateStyles = function(props) { if (window.ShadyCSS) { window.ShadyCSS.styleDocument(props); } }; })(); </script> <script> (function() { 'use strict'; /** * @summary Collapse multiple callbacks into one invocation after a timer. * @memberof Polymer */ class Debouncer { constructor() { this._asyncModule = null; this._callback = null; this._timer = null; } /** * Sets the scheduler; that is, a module with the Async interface, * a callback and optional arguments to be passed to the run function * from the async module. * * @param {!AsyncInterface} asyncModule Object with Async interface. * @param {function()} callback Callback to run. * @return {void} */ setConfig(asyncModule, callback) { this._asyncModule = asyncModule; this._callback = callback; this._timer = this._asyncModule.run(() => { this._timer = null; this._callback(); }); } /** * Cancels an active debouncer and returns a reference to itself. * * @return {void} */ cancel() { if (this.isActive()) { this._asyncModule.cancel(this._timer); this._timer = null; } } /** * Flushes an active debouncer and returns a reference to itself. * * @return {void} */ flush() { if (this.isActive()) { this.cancel(); this._callback(); } } /** * Returns true if the debouncer is active. * * @return {boolean} True if active. */ isActive() { return this._timer != null; } /** * Creates a debouncer if no debouncer is passed as a parameter * or it cancels an active debouncer otherwise. The following * example shows how a debouncer can be called multiple times within a * microtask and "debounced" such that the provided callback function is * called once. Add this method to a custom element: * * _debounceWork() { * this._debounceJob = Polymer.Debouncer.debounce(this._debounceJob, * Polymer.Async.microTask, () => { * this._doWork(); * }); * } * * If the `_debounceWork` method is called multiple times within the same * microtask, the `_doWork` function will be called only once at the next * microtask checkpoint. * * Note: In testing it is often convenient to avoid asynchrony. To accomplish * this with a debouncer, you can use `Polymer.enqueueDebouncer` and * `Polymer.flush`. For example, extend the above example by adding * `Polymer.enqueueDebouncer(this._debounceJob)` at the end of the * `_debounceWork` method. Then in a test, call `Polymer.flush` to ensure * the debouncer has completed. * * @param {Debouncer?} debouncer Debouncer object. * @param {!AsyncInterface} asyncModule Object with Async interface * @param {function()} callback Callback to run. * @return {!Debouncer} Returns a debouncer object. */ static debounce(debouncer, asyncModule, callback) { if (debouncer instanceof Debouncer) { debouncer.cancel(); } else { debouncer = new Debouncer(); } debouncer.setConfig(asyncModule, callback); return debouncer; } } /** @const */ Polymer.Debouncer = Debouncer; })(); </script> <script> (function() { 'use strict'; // detect native touch action support let HAS_NATIVE_TA = typeof document.head.style.touchAction === 'string'; let GESTURE_KEY = '__polymerGestures'; let HANDLED_OBJ = '__polymerGesturesHandled'; let TOUCH_ACTION = '__polymerGesturesTouchAction'; // radius for tap and track let TAP_DISTANCE = 25; let TRACK_DISTANCE = 5; // number of last N track positions to keep let TRACK_LENGTH = 2; // Disabling "mouse" handlers for 2500ms is enough let MOUSE_TIMEOUT = 2500; let MOUSE_EVENTS = ['mousedown', 'mousemove', 'mouseup', 'click']; // an array of bitmask values for mapping MouseEvent.which to MouseEvent.buttons let MOUSE_WHICH_TO_BUTTONS = [0, 1, 4, 2]; let MOUSE_HAS_BUTTONS = (function() { try { return new MouseEvent('test', {buttons: 1}).buttons === 1; } catch (e) { return false; } })(); /** * @param {string} name Possible mouse event name * @return {boolean} true if mouse event, false if not */ function isMouseEvent(name) { return MOUSE_EVENTS.indexOf(name) > -1; } /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */ // check for passive event listeners let SUPPORTS_PASSIVE = false; (function() { try { let opts = Object.defineProperty({}, 'passive', {get() {SUPPORTS_PASSIVE = true;}}); window.addEventListener('test', null, opts); window.removeEventListener('test', null, opts); } catch(e) {} })(); /** * Generate settings for event listeners, dependant on `Polymer.passiveTouchGestures` * * @param {string} eventName Event name to determine if `{passive}` option is needed * @return {{passive: boolean} | undefined} Options to use for addEventListener and removeEventListener */ function PASSIVE_TOUCH(eventName) { if (isMouseEvent(eventName) || eventName === 'touchend') { return; } if (HAS_NATIVE_TA && SUPPORTS_PASSIVE && Polymer.passiveTouchGestures) { return {passive: true}; } else { return; } } // Check for touch-only devices let IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/); let GestureRecognizer = function(){}; // eslint-disable-line no-unused-vars /** @type {function(): void} */ GestureRecognizer.prototype.reset; /** @type {function(MouseEvent): void | undefined} */ GestureRecognizer.prototype.mousedown; /** @type {(function(MouseEvent): void | undefined)} */ GestureRecognizer.prototype.mousemove; /** @type {(function(MouseEvent): void | undefined)} */ GestureRecognizer.prototype.mouseup; /** @type {(function(TouchEvent): void | undefined)} */ GestureRecognizer.prototype.touchstart; /** @type {(function(TouchEvent): void | undefined)} */ GestureRecognizer.prototype.touchmove; /** @type {(function(TouchEvent): void | undefined)} */ GestureRecognizer.prototype.touchend; /** @type {(function(MouseEvent): void | undefined)} */ GestureRecognizer.prototype.click; // keep track of any labels hit by the mouseCanceller /** @type {!Array<!HTMLLabelElement>} */ const clickedLabels = []; /** @type {!Object<boolean>} */ const labellable = { 'button': true, 'input': true, 'keygen': true, 'meter': true, 'output': true, 'textarea': true, 'progress': true, 'select': true }; // Defined at https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute /** @type {!Object<boolean>} */ const canBeDisabled = { 'button': true, 'command': true, 'fieldset': true, 'input': true, 'keygen': true, 'optgroup': true, 'option': true, 'select': true, 'textarea': true }; /** * @param {HTMLElement} el Element to check labelling status * @return {boolean} element can have labels */ function canBeLabelled(el) { return labellable[el.localName] || false; } /** * @param {HTMLElement} el Element that may be labelled. * @return {!Array<!HTMLLabelElement>} Relevant label for `el` */ function matchingLabels(el) { let labels = Array.from(/** @type {HTMLInputElement} */(el).labels || []); // IE doesn't have `labels` and Safari doesn't populate `labels` // if element is in a shadowroot. // In this instance, finding the non-ancestor labels is enough, // as the mouseCancellor code will handle ancstor labels if (!labels.length) { labels = []; let root = el.getRootNode(); // if there is an id on `el`, check for all labels with a matching `for` attribute if (el.id) { let matching = root.querySelectorAll(`label[for = ${el.id}]`); for (let i = 0; i < matching.length; i++) { labels.push(/** @type {!HTMLLabelElement} */(matching[i])); } } } return labels; } // touch will make synthetic mouse events // `preventDefault` on touchend will cancel them, // but this breaks `<input>` focus and link clicks // disable mouse handlers for MOUSE_TIMEOUT ms after // a touchend to ignore synthetic mouse events let mouseCanceller = function(mouseEvent) { // Check for sourceCapabilities, used to distinguish synthetic events // if mouseEvent did not come from a device that fires touch events, // it was made by a real mouse and should be counted // http://wicg.github.io/InputDeviceCapabilities/#dom-inputdevicecapabilities-firestouchevents let sc = mouseEvent.sourceCapabilities; if (sc && !sc.firesTouchEvents) { return; } // skip synthetic mouse events mouseEvent[HANDLED_OBJ] = {skip: true}; // disable "ghost clicks" if (mouseEvent.type === 'click') { let clickFromLabel = false; let path = mouseEvent.composedPath && mouseEvent.composedPath(); if (path) { for (let i = 0; i < path.length; i++) { if (path[i].nodeType === Node.ELEMENT_NODE) { if (path[i].localName === 'label') { clickedLabels.push(path[i]); } else if (canBeLabelled(path[i])) { let ownerLabels = matchingLabels(path[i]); // check if one of the clicked labels is labelling this element for (let j = 0; j < ownerLabels.length; j++) { clickFromLabel = clickFromLabel || clickedLabels.indexOf(ownerLabels[j]) > -1; } } } if (path[i] === POINTERSTATE.mouse.target) { return; } } } // if one of the clicked labels was labelling the target element, // this is not a ghost click if (clickFromLabel) { return; } mouseEvent.preventDefault(); mouseEvent.stopPropagation(); } }; /** * @param {boolean=} setup True to add, false to remove. * @return {void} */ function setupTeardownMouseCanceller(setup) { let events = IS_TOUCH_ONLY ? ['click'] : MOUSE_EVENTS; for (let i = 0, en; i < events.length; i++) { en = events[i]; if (setup) { // reset clickLabels array clickedLabels.length = 0; document.addEventListener(en, mouseCanceller, true); } else { document.removeEventListener(en, mouseCanceller, true); } } } function ignoreMouse(e) { if (!POINTERSTATE.mouse.mouseIgnoreJob) { setupTeardownMouseCanceller(true); } let unset = function() { setupTeardownMouseCanceller(); POINTERSTATE.mouse.target = null; POINTERSTATE.mouse.mouseIgnoreJob = null; }; POINTERSTATE.mouse.target = e.composedPath()[0]; POINTERSTATE.mouse.mouseIgnoreJob = Polymer.Debouncer.debounce( POINTERSTATE.mouse.mouseIgnoreJob , Polymer.Async.timeOut.after(MOUSE_TIMEOUT) , unset); } /** * @param {MouseEvent} ev event to test for left mouse button down * @return {boolean} has left mouse button down */ function hasLeftMouseButton(ev) { let type = ev.type; // exit early if the event is not a mouse event if (!isMouseEvent(type)) { return false; } // ev.button is not reliable for mousemove (0 is overloaded as both left button and no buttons) // instead we use ev.buttons (bitmask of buttons) or fall back to ev.which (deprecated, 0 for no buttons, 1 for left button) if (type === 'mousemove') { // allow undefined for testing events let buttons = ev.buttons === undefined ? 1 : ev.buttons; if ((ev instanceof window.MouseEvent) && !MOUSE_HAS_BUTTONS) { buttons = MOUSE_WHICH_TO_BUTTONS[ev.which] || 0; } // buttons is a bitmask, check that the left button bit is set (1) return Boolean(buttons & 1); } else { // allow undefined for testing events let button = ev.button === undefined ? 0 : ev.button; // ev.button is 0 in mousedown/mouseup/click for left button activation return button === 0; } } function isSyntheticClick(ev) { if (ev.type === 'click') { // ev.detail is 0 for HTMLElement.click in most browsers if (ev.detail === 0) { return true; } // in the worst case, check that the x/y position of the click is within // the bounding box of the target of the event // Thanks IE 10 >:( let t = Gestures._findOriginalTarget(ev); // make sure the target of the event is an element so we can use getBoundingClientRect, // if not, just assume it is a synthetic click if (!t.nodeType || /** @type {Element} */(t).nodeType !== Node.ELEMENT_NODE) { return true; } let bcr = /** @type {Element} */(t).getBoundingClientRect(); // use page x/y to account for scrolling let x = ev.pageX, y = ev.pageY; // ev is a synthetic click if the position is outside the bounding box of the target return !((x >= bcr.left && x <= bcr.right) && (y >= bcr.top && y <= bcr.bottom)); } return false; } let POINTERSTATE = { mouse: { target: null, mouseIgnoreJob: null }, touch: { x: 0, y: 0, id: -1, scrollDecided: false } }; function firstTouchAction(ev) { let ta = 'auto'; let path = ev.composedPath && ev.composedPath(); if (path) { for (let i = 0, n; i < path.length; i++) { n = path[i]; if (n[TOUCH_ACTION]) { ta = n[TOUCH_ACTION]; break; } } } return ta; } function trackDocument(stateObj, movefn, upfn) { stateObj.movefn = movefn; stateObj.upfn = upfn; document.addEventListener('mousemove', movefn); document.addEventListener('mouseup', upfn); } function untrackDocument(stateObj) { document.removeEventListener('mousemove', stateObj.movefn); document.removeEventListener('mouseup', stateObj.upfn); stateObj.movefn = null; stateObj.upfn = null; } // use a document-wide touchend listener to start the ghost-click prevention mechanism // Use passive event listeners, if supported, to not affect scrolling performance document.addEventListener('touchend', ignoreMouse, SUPPORTS_PASSIVE ? {passive: true} : false); /** * Module for adding listeners to a node for the following normalized * cross-platform "gesture" events: * - `down` - mouse or touch went down * - `up` - mouse or touch went up * - `tap` - mouse click or finger tap * - `track` - mouse drag or touch move * * @namespace * @memberof Polymer * @summary Module for adding cross-platform gesture event listeners. */ const Gestures = { gestures: {}, recognizers: [], /** * Finds the element rendered on the screen at the provided coordinates. * * Similar to `document.elementFromPoint`, but pierces through * shadow roots. * * @memberof Polymer.Gestures * @param {number} x Horizontal pixel coordinate * @param {number} y Vertical pixel coordinate * @return {Element} Returns the deepest shadowRoot inclusive element * found at the screen position given. */ deepTargetFind: function(x, y) { let node = document.elementFromPoint(x, y); let next = node; // this code path is only taken when native ShadowDOM is used // if there is a shadowroot, it may have a node at x/y // if there is not a shadowroot, exit the loop while (next && next.shadowRoot && !window.ShadyDOM) { // if there is a node at x/y in the shadowroot, look deeper let oldNext = next; next = next.shadowRoot.elementFromPoint(x, y); // on Safari, elementFromPoint may return the shadowRoot host if (oldNext === next) { break; } if (next) { node = next; } } return node; }, /** * a cheaper check than ev.composedPath()[0]; * * @private * @param {Event} ev Event. * @return {EventTarget} Returns the event target. */ _findOriginalTarget: function(ev) { // shadowdom if (ev.composedPath) { const targets = /** @type {!Array<!EventTarget>} */(ev.composedPath()); // It shouldn't be, but sometimes targets is empty (window on Safari). return targets.length > 0 ? targets[0] : ev.target; } // shadydom return ev.target; }, /** * @private * @param {Event} ev Event. * @return {void} */ _handleNative: function(ev) { let handled; let type = ev.type; let node = ev.currentTarget; let gobj = node[GESTURE_KEY]; if (!gobj) { return; } let gs = gobj[type]; if (!gs) { return; } if (!ev[HANDLED_OBJ]) { ev[HANDLED_OBJ] = {}; if (type.slice(0, 5) === 'touch') { ev = /** @type {TouchEvent} */(ev); // eslint-disable-line no-self-assign let t = ev.changedTouches[0]; if (type === 'touchstart') { // only handle the first finger if (ev.touches.length === 1) { POINTERSTATE.touch.id = t.identifier; } } if (POINTERSTATE.touch.id !== t.identifier) { return; } if (!HAS_NATIVE_TA) { if (type === 'touchstart' || type === 'touchmove') { Gestures._handleTouchAction(ev); } } } } handled = ev[HANDLED_OBJ]; // used to ignore synthetic mouse events if (handled.skip) { return; } // reset recognizer state for (let i = 0, r; i < Gestures.recognizers.length; i++) { r = Gestures.recognizers[i]; if (gs[r.name] && !handled[r.name]) { if (r.flow && r.flow.start.indexOf(ev.type) > -1 && r.reset) { r.reset(); } } } // enforce gesture recognizer order for (let i = 0, r; i < Gestures.recognizers.length; i++) { r = Gestures.recognizers[i]; if (gs[r.name] && !handled[r.name]) { handled[r.name] = true; r[type](ev); } } }, /** * @private * @param {TouchEvent} ev Event. * @return {void} */ _handleTouchAction: function(ev) { let t = ev.changedTouches[0]; let type = ev.type; if (type === 'touchstart') { POINTERSTATE.touch.x = t.clientX; POINTERSTATE.touch.y = t.clientY; POINTERSTATE.touch.scrollDecided = false; } else if (type === 'touchmove') { if (POINTERSTATE.touch.scrollDecided) { return; } POINTERSTATE.touch.scrollDecided = true; let ta = firstTouchAction(ev); let prevent = false; let dx = Math.abs(POINTERSTATE.touch.x - t.clientX); let dy = Math.abs(POINTERSTATE.touch.y - t.clientY); if (!ev.cancelable) { // scrolling is happening } else if (ta === 'none') { prevent = true; } else if (ta === 'pan-x') { prevent = dy > dx; } else if (ta === 'pan-y') { prevent = dx > dy; } if (prevent) { ev.preventDefault(); } else { Gestures.prevent('track'); } } }, /** * Adds an event listener to a node for the given gesture type. * * @memberof Polymer.Gestures * @param {!Node} node Node to add listener on * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap` * @param {!function(!Event):void} handler Event listener function to call * @return {boolean} Returns true if a gesture event listener was added. * @this {Gestures} */ addListener: function(node, evType, handler) { if (this.gestures[evType]) { this._add(node, evType, handler); return true; } return false; }, /** * Removes an event listener from a node for the given gesture type. * * @memberof Polymer.Gestures * @param {!Node} node Node to remove listener from * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap` * @param {!function(!Event):void} handler Event listener function previously passed to * `addListener`. * @return {boolean} Returns true if a gesture event listener was removed. * @this {Gestures} */ removeListener: function(node, evType, handler) { if (this.gestures[evType]) { this._remove(node, evType, handler); return true; } return false; }, /** * automate the event listeners for the native events * * @private * @param {!HTMLElement} node Node on which to add the event. * @param {string} evType Event type to add. * @param {function(!Event)} handler Event handler function. * @return {void} * @this {Gestures} */ _add: function(node, evType, handler) { let recognizer = this.gestures[evType]; let deps = recognizer.deps; let name = recognizer.name; let gobj = node[GESTURE_KEY]; if (!gobj) { node[GESTURE_KEY] = gobj = {}; } for (let i = 0, dep, gd; i < deps.length; i++) { dep = deps[i]; // don't add mouse handlers on iOS because they cause gray selection overlays if (IS_TOUCH_ONLY && isMouseEvent(dep) && dep !== 'click') { continue; } gd = gobj[dep]; if (!gd) { gobj[dep] = gd = {_count: 0}; } if (gd._count === 0) { node.addEventListener(dep, this._handleNative, PASSIVE_TOUCH(dep)); } gd[name] = (gd[name] || 0) + 1; gd._count = (gd._count || 0) + 1; } node.addEventListener(evType, handler); if (recognizer.touchAction) { this.setTouchAction(node, recognizer.touchAction); } }, /** * automate event listener removal for native events * * @private * @param {!HTMLElement} node Node on which to remove the event. * @param {string} evType Event type to remove. * @param {function(Event?)} handler Event handler function. * @return {void} * @this {Gestures} */ _remove: function(node, evType, handler) { let recognizer = this.gestures[evType]; let deps = recognizer.deps; let name = recognizer.name; let gobj = node[GESTURE_KEY]; if (gobj) { for (let i = 0, dep, gd; i < deps.length; i++) { dep = deps[i]; gd = gobj[dep]; if (gd && gd[name]) { gd[name] = (gd[name] || 1) - 1; gd._count = (gd._count || 1) - 1; if (gd._count === 0) { node.removeEventListener(dep, this._handleNative, PASSIVE_TOUCH(dep)); } } } } node.removeEventListener(evType, handler); }, /** * Registers a new gesture event recognizer for adding new custom * gesture event types. * * @memberof Polymer.Gestures * @param {!GestureRecognizer} recog Gesture recognizer descriptor * @return {void} * @this {Gestures} */ register: function(recog) { this.recognizers.push(recog); for (let i = 0; i < recog.emits.length; i++) { this.gestures[recog.emits[i]] = recog; } }, /** * @private * @param {string} evName Event name. * @return {Object} Returns the gesture for the given event name. * @this {Gestures} */ _findRecognizerByEvent: function(evName) { for (let i = 0, r; i < this.recognizers.length; i++) { r = this.recognizers[i]; for (let j = 0, n; j < r.emits.length; j++) { n = r.emits[j]; if (n === evName) { return r; } } } return null; }, /** * Sets scrolling direction on node. * * This value is checked on first move, thus it should be called prior to * adding event listeners. * * @memberof Polymer.Gestures * @param {!Element} node Node to set touch action setting on * @param {string} value Touch action value * @return {void} */ setTouchAction: function(node, value) { if (HAS_NATIVE_TA) { // NOTE: add touchAction async so that events can be added in // custom element constructors. Otherwise we run afoul of custom // elements restriction against settings attributes (style) in the // constructor. Polymer.Async.microTask.run(() => { node.style.touchAction = value; }); } node[TOUCH_ACTION] = value; }, /** * Dispatches an event on the `target` element of `type` with the given * `detail`. * @private * @param {!EventTarget} target The element on which to fire an event. * @param {string} type The type of event to fire. * @param {!Object=} detail The detail object to populate on the event. * @return {void} */ _fire: function(target, type, detail) { let ev = new Event(type, { bubbles: true, cancelable: true, composed: true }); ev.detail = detail; target.dispatchEvent(ev); // forward `preventDefault` in a clean way if (ev.defaultPrevented) { let preventer = detail.preventer || detail.sourceEvent; if (preventer && preventer.preventDefault) { preventer.preventDefault(); } } }, /** * Prevents the dispatch and default action of the given event name. * * @memberof Polymer.Gestures * @param {string} evName Event name. * @return {void} * @this {Gestures} */ prevent: function(evName) { let recognizer = this._findRecognizerByEvent(evName); if (recognizer.info) { recognizer.info.prevent = true; } }, /** * Reset the 2500ms timeout on processing mouse input after detecting touch input. * * Touch inputs create synthesized mouse inputs anywhere from 0 to 2000ms after the touch. * This method should only be called during testing with simulated touch inputs. * Calling this method in production may cause duplicate taps or other Gestures. * * @memberof Polymer.Gestures * @return {void} */ resetMouseCanceller: function() { if (POINTERSTATE.mouse.mouseIgnoreJob) { POINTERSTATE.mouse.mouseIgnoreJob.flush(); } } }; /* eslint-disable valid-jsdoc */ Gestures.register({ name: 'downup', deps: ['mousedown', 'touchstart', 'touchend'], flow: { start: ['mousedown', 'touchstart'], end: ['mouseup', 'touchend'] }, emits: ['down', 'up'], info: { movefn: null, upfn: null }, /** * @this {GestureRecognizer} * @return {void} */ reset: function() { untrackDocument(this.info); }, /** * @this {GestureRecognizer} * @param {MouseEvent} e * @return {void} */ mousedown: function(e) { if (!hasLeftMouseButton(e)) { return; } let t = Gestures._findOriginalTarget(e); let self = this; let movefn = function movefn(e) { if (!hasLeftMouseButton(e)) { self._fire('up', t, e); untrackDocument(self.info); } }; let upfn = function upfn(e) { if (hasLeftMouseButton(e)) { self._fire('up', t, e); } untrackDocument(self.info); }; trackDocument(this.info, movefn, upfn); this._fire('down', t, e); }, /** * @this {GestureRecognizer} * @param {TouchEvent} e * @return {void} */ touchstart: function(e) { this._fire('down', Gestures._findOriginalTarget(e), e.changedTouches[0], e); }, /** * @this {GestureRecognizer} * @param {TouchEvent} e * @return {void} */ touchend: function(e) { this._fire('up', Gestures._findOriginalTarget(e), e.changedTouches[0], e); }, /** * @param {string} type * @param {!EventTarget} target * @param {Event} event * @param {Function} preventer * @return {void} */ _fire: function(type, target, event, preventer) { Gestures._fire(target, type, { x: event.clientX, y: event.clientY, sourceEvent: event, preventer: preventer, prevent: function(e) { return Gestures.prevent(e); } }); } }); Gestures.register({ name: 'track', touchAction: 'none', deps: ['mousedown', 'touchstart', 'touchmove', 'touchend'], flow: { start: ['mousedown', 'touchstart'], end: ['mouseup', 'touchend'] }, emits: ['track'], info: { x: 0, y: 0, state: 'start', started: false, moves: [], /** @this {GestureRecognizer} */ addMove: function(move) { if (this.moves.length > TRACK_LENGTH) { this.moves.shift(); } this.moves.push(move); }, movefn: null, upfn: null, prevent: false }, /** * @this {GestureRecognizer} * @return {void} */ reset: function() { this.info.state = 'start'; this.info.started = false; this.info.moves = []; this.info.x = 0; this.info.y = 0; this.info.prevent = false; untrackDocument(this.info); }, /** * @this {GestureRecognizer} * @param {number} x * @param {number} y * @return {boolean} */ hasMovedEnough: function(x, y) { if (this.info.prevent) { return false; } if (this.info.started) { return true; } let dx = Math.abs(this.info.x - x); let dy = Math.abs(this.info.y - y); return (dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE); }, /** * @this {GestureRecognizer} * @param {MouseEvent} e * @return {void} */ mousedown: function(e) { if (!hasLeftMouseButton(e)) { return; } let t = Gestures._findOriginalTarget(e); let self = this; let movefn = function movefn(e) { let x = e.clientX, y = e.clientY; if (self.hasMovedEnough(x, y)) { // first move is 'start', subsequent moves are 'move', mouseup is 'end' self.info.state = self.info.started ? (e.type === 'mouseup' ? 'end' : 'track') : 'start'; if (self.info.state === 'start') { // if and only if tracking, always prevent tap Gestures.prevent('tap'); } self.info.addMove({x: x, y: y}); if (!hasLeftMouseButton(e)) { // always _fire "end" self.info.state = 'end'; untrackDocument(self.info); } self._fire(t, e); self.info.started = true; } }; let upfn = function upfn(e) { if (self.info.started) { movefn(e); } // remove the temporary listeners untrackDocument(self.info); }; // add temporary document listeners as mouse retargets trackDocument(this.info, movefn, upfn); this.info.x = e.clientX; this.info.y = e.clientY; }, /** * @this {GestureRecognizer} * @param {TouchEvent} e * @return {void} */ touchstart: function(e) { let ct = e.changedTouches[0]; this.info.x = ct.clientX; this.info.y = ct.clientY; }, /** * @this {GestureRecognizer} * @param {TouchEvent} e * @return {void} */ touchmove: function(e) { let t = Gestures._findOriginalTarget(e); let ct = e.changedTouches[0]; let x = ct.clientX, y = ct.clientY; if (this.hasMovedEnough(x, y)) { if (this.info.state === 'start') { // if and only if tracking, always prevent tap Gestures.prevent('tap'); } this.info.addMove({x: x, y: y}); this._fire(t, ct); this.info.state = 'track'; this.info.started = true; } }, /** * @this {GestureRecognizer} * @param {TouchEvent} e * @return {void} */ touchend: function(e) { let t = Gestures._findOriginalTarget(e); let ct = e.changedTouches[0]; // only trackend if track was started and not aborted if (this.info.started) { // reset started state on up this.info.state = 'end'; this.info.addMove({x: ct.clientX, y: ct.clientY}); this._fire(t, ct, e); } }, /** * @this {GestureRecognizer} * @param {!EventTarget} target * @param {Touch} touch * @return {void} */ _fire: function(target, touch) { let secondlast = this.info.moves[this.info.moves.length - 2]; let lastmove = this.info.moves[this.info.moves.length - 1]; let dx = lastmove.x - this.info.x; let dy = lastmove.y - this.info.y; let ddx, ddy = 0; if (secondlast) { ddx = lastmove.x - secondlast.x; ddy = lastmove.y - secondlast.y; } Gestures._fire(target, 'track', { state: this.info.state, x: touch.clientX, y: touch.clientY, dx: dx, dy: dy, ddx: ddx, ddy: ddy, sourceEvent: touch, hover: function() { return Gestures.deepTargetFind(touch.clientX, touch.clientY); } }); } }); Gestures.register({ name: 'tap', deps: ['mousedown', 'click', 'touchstart', 'touchend'], flow: { start: ['mousedown', 'touchstart'], end: ['click', 'touchend'] }, emits: ['tap'], info: { x: NaN, y: NaN, prevent: false }, /** * @this {GestureRecognizer} * @return {void} */ reset: function() { this.info.x = NaN; this.info.y = NaN; this.info.prevent = false; }, /** * @this {GestureRecognizer} * @param {MouseEvent} e * @return {void} */ save: function(e) { this.info.x = e.clientX; this.info.y = e.clientY; }, /** * @this {GestureRecognizer} * @param {MouseEvent} e * @return {void} */ mousedown: function(e) { if (hasLeftMouseButton(e)) { this.save(e); } }, /** * @this {GestureRecognizer} * @param {MouseEvent} e * @return {void} */ click: function(e) { if (hasLeftMouseButton(e)) { this.forward(e); } }, /** * @this {GestureRecognizer} * @param {TouchEvent} e * @return {void} */ touchstart: function(e) { this.save(e.changedTouches[0], e); }, /** * @this {GestureRecognizer} * @param {TouchEvent} e * @return {void} */ touchend: function(e) { this.forward(e.changedTouches[0], e); }, /** * @this {GestureRecognizer} * @param {Event | Touch} e * @param {Event=} preventer * @return {void} */ forward: function(e, preventer) { let dx = Math.abs(e.clientX - this.info.x); let dy = Math.abs(e.clientY - this.info.y); // find original target from `preventer` for TouchEvents, or `e` for MouseEvents let t = Gestures._findOriginalTarget(/** @type {Event} */(preventer || e)); if (!t || (canBeDisabled[/** @type {!HTMLElement} */(t).localName] && t.hasAttribute('disabled'))) { return; } // dx,dy can be NaN if `click` has been simulated and there was no `down` for `start` if (isNaN(dx) || isNaN(dy) || (dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) || isSyntheticClick(e)) { // prevent taps from being generated if an event has canceled them if (!this.info.prevent) { Gestures._fire(t, 'tap', { x: e.clientX, y: e.clientY, sourceEvent: e, preventer: preventer }); } } } }); /* eslint-enable valid-jsdoc */ /** @deprecated */ Gestures.findOriginalTarget = Gestures._findOriginalTarget; /** @deprecated */ Gestures.add = Gestures.addListener; /** @deprecated */ Gestures.remove = Gestures.removeListener; Polymer.Gestures = Gestures; })(); </script> <script> (function() { 'use strict'; /** * @const {Polymer.Gestures} */ const gestures = Polymer.Gestures; /** * Element class mixin that provides API for adding Polymer's cross-platform * gesture events to nodes. * * The API is designed to be compatible with override points implemented * in `Polymer.TemplateStamp` such that declarative event listeners in * templates will support gesture events when this mixin is applied along with * `Polymer.TemplateStamp`. * * @mixinFunction * @polymer * @memberof Polymer * @summary Element class mixin that provides API for adding Polymer's cross-platform * gesture events to nodes */ Polymer.GestureEventListeners = Polymer.dedupingMixin(superClass => { /** * @polymer * @mixinClass * @implements {Polymer_GestureEventListeners} */ class GestureEventListeners extends superClass { /** * Add the event listener to the node if it is a gestures event. * * @param {!Node} node Node to add event listener to * @param {string} eventName Name of event * @param {function(!Event):void} handler Listener function to add * @return {void} */ _addEventListenerToNode(node, eventName, handler) { if (!gestures.addListener(node, eventName, handler)) { super._addEventListenerToNode(node, eventName, handler); } } /** * Remove the event listener to the node if it is a gestures event. * * @param {!Node} node Node to remove event listener from * @param {string} eventName Name of event * @param {function(!Event):void} handler Listener function to remove * @return {void} */ _removeEventListenerFromNode(node, eventName, handler) { if (!gestures.removeListener(node, eventName, handler)) { super._removeEventListenerFromNode(node, eventName, handler); } } } return GestureEventListeners; }); })(); </script> <script> (function() { 'use strict'; const HOST_DIR = /:host\(:dir\((ltr|rtl)\)\)/g; const HOST_DIR_REPLACMENT = ':host([dir="$1"])'; const EL_DIR = /([\s\w-#\.\[\]\*]*):dir\((ltr|rtl)\)/g; const EL_DIR_REPLACMENT = ':host([dir="$2"]) $1'; const DIR_CHECK = /:dir\((?:ltr|rtl)\)/; const SHIM_SHADOW = Boolean(window['ShadyDOM'] && window['ShadyDOM']['inUse']); /** * @type {!Array<!Polymer_DirMixin>} */ const DIR_INSTANCES = []; /** @type {MutationObserver} */ let observer = null; let DOCUMENT_DIR = ''; function getRTL() { DOCUMENT_DIR = document.documentElement.getAttribute('dir'); } /** * @param {!Polymer_DirMixin} instance Instance to set RTL status on */ function setRTL(instance) { if (!instance.__autoDirOptOut) { const el = /** @type {!HTMLElement} */(instance); el.setAttribute('dir', DOCUMENT_DIR); } } function updateDirection() { getRTL(); DOCUMENT_DIR = document.documentElement.getAttribute('dir'); for (let i = 0; i < DIR_INSTANCES.length; i++) { setRTL(DIR_INSTANCES[i]); } } function takeRecords() { if (observer && observer.takeRecords().length) { updateDirection(); } } /** * Element class mixin that allows elements to use the `:dir` CSS Selector to have * text direction specific styling. * * With this mixin, any stylesheet provided in the template will transform `:dir` into * `:host([dir])` and sync direction with the page via the element's `dir` attribute. * * Elements can opt out of the global page text direction by setting the `dir` attribute * directly in `ready()` or in HTML. * * Caveats: * - Applications must set `<html dir="ltr">` or `<html dir="rtl">` to sync direction * - Automatic left-to-right or right-to-left styling is sync'd with the `<html>` element only. * - Changing `dir` at runtime is supported. * - Opting out of the global direction styling is permanent * * @mixinFunction * @polymer * @appliesMixin Polymer.PropertyAccessors * @memberof Polymer */ Polymer.DirMixin = Polymer.dedupingMixin((base) => { if (!SHIM_SHADOW) { if (!observer) { getRTL(); observer = new MutationObserver(updateDirection); observer.observe(document.documentElement, {attributes: true, attributeFilter: ['dir']}); } } /** * @constructor * @extends {base} * @implements {Polymer_PropertyAccessors} * @private */ const elementBase = Polymer.PropertyAccessors(base); /** * @polymer * @mixinClass * @implements {Polymer_DirMixin} */ class Dir extends elementBase { /** * @override * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do */ static _processStyleText(cssText, baseURI) { cssText = super._processStyleText(cssText, baseURI); if (!SHIM_SHADOW && DIR_CHECK.test(cssText)) { cssText = this._replaceDirInCssText(cssText); this.__activateDir = true; } return cssText; } /** * Replace `:dir` in the given CSS text * * @param {string} text CSS text to replace DIR * @return {string} Modified CSS */ static _replaceDirInCssText(text) { let replacedText = text; replacedText = replacedText.replace(HOST_DIR, HOST_DIR_REPLACMENT); replacedText = replacedText.replace(EL_DIR, EL_DIR_REPLACMENT); return replacedText; } constructor() { super(); /** @type {boolean} */ this.__autoDirOptOut = false; } /** * @suppress {invalidCasts} Closure doesn't understand that `this` is an HTMLElement * @return {void} */ ready() { super.ready(); this.__autoDirOptOut = /** @type {!HTMLElement} */(this).hasAttribute('dir'); } /** * @suppress {missingProperties} If it exists on elementBase, it can be super'd * @return {void} */ connectedCallback() { if (elementBase.prototype.connectedCallback) { super.connectedCallback(); } if (this.constructor.__activateDir) { takeRecords(); DIR_INSTANCES.push(this); setRTL(this); } } /** * @suppress {missingProperties} If it exists on elementBase, it can be super'd * @return {void} */ disconnectedCallback() { if (elementBase.prototype.disconnectedCallback) { super.disconnectedCallback(); } if (this.constructor.__activateDir) { const idx = DIR_INSTANCES.indexOf(this); if (idx > -1) { DIR_INSTANCES.splice(idx, 1); } } } } Dir.__activateDir = false; return Dir; }); })(); </script> <script> (function() { 'use strict'; // run a callback when HTMLImports are ready or immediately if // this api is not available. function whenImportsReady(cb) { if (window.HTMLImports) { HTMLImports.whenReady(cb); } else { cb(); } } /** * Convenience method for importing an HTML document imperatively. * * This method creates a new `<link rel="import">` element with * the provided URL and appends it to the document to start loading. * In the `onload` callback, the `import` property of the `link` * element will contain the imported document contents. * * @memberof Polymer * @param {string} href URL to document to load. * @param {?function(!Event):void=} onload Callback to notify when an import successfully * loaded. * @param {?function(!ErrorEvent):void=} onerror Callback to notify when an import * unsuccessfully loaded. * @param {boolean=} optAsync True if the import should be loaded `async`. * Defaults to `false`. * @return {!HTMLLinkElement} The link element for the URL to be loaded. */ Polymer.importHref = function(href, onload, onerror, optAsync) { let link = /** @type {HTMLLinkElement} */ (document.head.querySelector('link[href="' + href + '"][import-href]')); if (!link) { link = /** @type {HTMLLinkElement} */ (document.createElement('link')); link.rel = 'import'; link.href = href; link.setAttribute('import-href', ''); } // always ensure link has `async` attribute if user specified one, // even if it was previously not async. This is considered less confusing. if (optAsync) { link.setAttribute('async', ''); } // NOTE: the link may now be in 3 states: (1) pending insertion, // (2) inflight, (3) already loaded. In each case, we need to add // event listeners to process callbacks. let cleanup = function() { link.removeEventListener('load', loadListener); link.removeEventListener('error', errorListener); }; let loadListener = function(event) { cleanup(); // In case of a successful load, cache the load event on the link so // that it can be used to short-circuit this method in the future when // it is called with the same href param. link.__dynamicImportLoaded = true; if (onload) { whenImportsReady(() => { onload(event); }); } }; let errorListener = function(event) { cleanup(); // In case of an error, remove the link from the document so that it // will be automatically created again the next time `importHref` is // called. if (link.parentNode) { link.parentNode.removeChild(link); } if (onerror) { whenImportsReady(() => { onerror(event); }); } }; link.addEventListener('load', loadListener); link.addEventListener('error', errorListener); if (link.parentNode == null) { document.head.appendChild(link); // if the link already loaded, dispatch a fake load event // so that listeners are called and get a proper event argument. } else if (link.__dynamicImportLoaded) { link.dispatchEvent(new Event('load')); } return link; }; })(); </script> <script> (function() { 'use strict'; let scheduled = false; let beforeRenderQueue = []; let afterRenderQueue = []; function schedule() { scheduled = true; // before next render requestAnimationFrame(function() { scheduled = false; flushQueue(beforeRenderQueue); // after the render setTimeout(function() { runQueue(afterRenderQueue); }); }); } function flushQueue(queue) { while (queue.length) { callMethod(queue.shift()); } } function runQueue(queue) { for (let i=0, l=queue.length; i < l; i++) { callMethod(queue.shift()); } } function callMethod(info) { const context = info[0]; const callback = info[1]; const args = info[2]; try { callback.apply(context, args); } catch(e) { setTimeout(() => { throw e; }); } } function flush() { while (beforeRenderQueue.length || afterRenderQueue.length) { flushQueue(beforeRenderQueue); flushQueue(afterRenderQueue); } scheduled = false; } /** * Module for scheduling flushable pre-render and post-render tasks. * * @namespace * @memberof Polymer * @summary Module for scheduling flushable pre-render and post-render tasks. */ Polymer.RenderStatus = { /** * Enqueues a callback which will be run before the next render, at * `requestAnimationFrame` timing. * * This method is useful for enqueuing work that requires DOM measurement, * since measurement may not be reliable in custom element callbacks before * the first render, as well as for batching measurement tasks in general. * * Tasks in this queue may be flushed by calling `Polymer.RenderStatus.flush()`. * * @memberof Polymer.RenderStatus * @param {*} context Context object the callback function will be bound to * @param {function(...*):void} callback Callback function * @param {!Array=} args An array of arguments to call the callback function with * @return {void} */ beforeNextRender: function(context, callback, args) { if (!scheduled) { schedule(); } beforeRenderQueue.push([context, callback, args]); }, /** * Enqueues a callback which will be run after the next render, equivalent * to one task (`setTimeout`) after the next `requestAnimationFrame`. * * This method is useful for tuning the first-render performance of an * element or application by deferring non-critical work until after the * first paint. Typical non-render-critical work may include adding UI * event listeners and aria attributes. * * @memberof Polymer.RenderStatus * @param {*} context Context object the callback function will be bound to * @param {function(...*):void} callback Callback function * @param {!Array=} args An array of arguments to call the callback function with * @return {void} */ afterNextRender: function(context, callback, args) { if (!scheduled) { schedule(); } afterRenderQueue.push([context, callback, args]); }, /** * Flushes all `beforeNextRender` tasks, followed by all `afterNextRender` * tasks. * * @memberof Polymer.RenderStatus * @return {void} */ flush: flush }; })(); </script> <script> (function() { 'use strict'; // unresolved function resolve() { document.body.removeAttribute('unresolved'); } if (window.WebComponents) { window.addEventListener('WebComponentsReady', resolve); } else { if (document.readyState === 'interactive' || document.readyState === 'complete') { resolve(); } else { window.addEventListener('DOMContentLoaded', resolve); } } })(); </script> <script> (function() { 'use strict'; function newSplice(index, removed, addedCount) { return { index: index, removed: removed, addedCount: addedCount }; } const EDIT_LEAVE = 0; const EDIT_UPDATE = 1; const EDIT_ADD = 2; const EDIT_DELETE = 3; // Note: This function is *based* on the computation of the Levenshtein // "edit" distance. The one change is that "updates" are treated as two // edits - not one. With Array splices, an update is really a delete // followed by an add. By retaining this, we optimize for "keeping" the // maximum array items in the original array. For example: // // 'xxxx123' -> '123yyyy' // // With 1-edit updates, the shortest path would be just to update all seven // characters. With 2-edit updates, we delete 4, leave 3, and add 4. This // leaves the substring '123' intact. function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) { // "Deletion" columns let rowCount = oldEnd - oldStart + 1; let columnCount = currentEnd - currentStart + 1; let distances = new Array(rowCount); // "Addition" rows. Initialize null column. for (let i = 0; i < rowCount; i++) { distances[i] = new Array(columnCount); distances[i][0] = i; } // Initialize null row for (let j = 0; j < columnCount; j++) distances[0][j] = j; for (let i = 1; i < rowCount; i++) { for (let j = 1; j < columnCount; j++) { if (equals(current[currentStart + j - 1], old[oldStart + i - 1])) distances[i][j] = distances[i - 1][j - 1]; else { let north = distances[i - 1][j] + 1; let west = distances[i][j - 1] + 1; distances[i][j] = north < west ? north : west; } } } return distances; } // This starts at the final weight, and walks "backward" by finding // the minimum previous weight recursively until the origin of the weight // matrix. function spliceOperationsFromEditDistances(distances) { let i = distances.length - 1; let j = distances[0].length - 1; let current = distances[i][j]; let edits = []; while (i > 0 || j > 0) { if (i == 0) { edits.push(EDIT_ADD); j--; continue; } if (j == 0) { edits.push(EDIT_DELETE); i--; continue; } let northWest = distances[i - 1][j - 1]; let west = distances[i - 1][j]; let north = distances[i][j - 1]; let min; if (west < north) min = west < northWest ? west : northWest; else min = north < northWest ? north : northWest; if (min == northWest) { if (northWest == current) { edits.push(EDIT_LEAVE); } else { edits.push(EDIT_UPDATE); current = northWest; } i--; j--; } else if (min == west) { edits.push(EDIT_DELETE); i--; current = west; } else { edits.push(EDIT_ADD); j--; current = north; } } edits.reverse(); return edits; } /** * Splice Projection functions: * * A splice map is a representation of how a previous array of items * was transformed into a new array of items. Conceptually it is a list of * tuples of * * <index, removed, addedCount> * * which are kept in ascending index order of. The tuple represents that at * the |index|, |removed| sequence of items were removed, and counting forward * from |index|, |addedCount| items were added. */ /** * Lacking individual splice mutation information, the minimal set of * splices can be synthesized given the previous state and final state of an * array. The basic approach is to calculate the edit distance matrix and * choose the shortest path through it. * * Complexity: O(l * p) * l: The length of the current array * p: The length of the old array * * @param {!Array} current The current "changed" array for which to * calculate splices. * @param {number} currentStart Starting index in the `current` array for * which splices are calculated. * @param {number} currentEnd Ending index in the `current` array for * which splices are calculated. * @param {!Array} old The original "unchanged" array to compare `current` * against to determine splices. * @param {number} oldStart Starting index in the `old` array for * which splices are calculated. * @param {number} oldEnd Ending index in the `old` array for * which splices are calculated. * @return {!Array} Returns an array of splice record objects. Each of these * contains: `index` the location where the splice occurred; `removed` * the array of removed items from this location; `addedCount` the number * of items added at this location. */ function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) { let prefixCount = 0; let suffixCount = 0; let splice; let minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart); if (currentStart == 0 && oldStart == 0) prefixCount = sharedPrefix(current, old, minLength); if (currentEnd == current.length && oldEnd == old.length) suffixCount = sharedSuffix(current, old, minLength - prefixCount); currentStart += prefixCount; oldStart += prefixCount; currentEnd -= suffixCount; oldEnd -= suffixCount; if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0) return []; if (currentStart == currentEnd) { splice = newSplice(currentStart, [], 0); while (oldStart < oldEnd) splice.removed.push(old[oldStart++]); return [ splice ]; } else if (oldStart == oldEnd) return [ newSplice(currentStart, [], currentEnd - currentStart) ]; let ops = spliceOperationsFromEditDistances( calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd)); splice = undefined; let splices = []; let index = currentStart; let oldIndex = oldStart; for (let i = 0; i < ops.length; i++) { switch(ops[i]) { case EDIT_LEAVE: if (splice) { splices.push(splice); splice = undefined; } index++; oldIndex++; break; case EDIT_UPDATE: if (!splice) splice = newSplice(index, [], 0); splice.addedCount++; index++; splice.removed.push(old[oldIndex]); oldIndex++; break; case EDIT_ADD: if (!splice) splice = newSplice(index, [], 0); splice.addedCount++; index++; break; case EDIT_DELETE: if (!splice) splice = newSplice(index, [], 0); splice.removed.push(old[oldIndex]); oldIndex++; break; } } if (splice) { splices.push(splice); } return splices; } function sharedPrefix(current, old, searchLength) { for (let i = 0; i < searchLength; i++) if (!equals(current[i], old[i])) return i; return searchLength; } function sharedSuffix(current, old, searchLength) { let index1 = current.length; let index2 = old.length; let count = 0; while (count < searchLength && equals(current[--index1], old[--index2])) count++; return count; } function calculateSplices(current, previous) { return calcSplices(current, 0, current.length, previous, 0, previous.length); } function equals(currentValue, previousValue) { return currentValue === previousValue; } /** * @namespace * @memberof Polymer * @summary Module that provides utilities for diffing arrays. */ Polymer.ArraySplice = { /** * Returns an array of splice records indicating the minimum edits required * to transform the `previous` array into the `current` array. * * Splice records are ordered by index and contain the following fields: * - `index`: index where edit started * - `removed`: array of removed items from this index * - `addedCount`: number of items added at this index * * This function is based on the Levenshtein "minimum edit distance" * algorithm. Note that updates are treated as removal followed by addition. * * The worst-case time complexity of this algorithm is `O(l * p)` * l: The length of the current array * p: The length of the previous array * * However, the worst-case complexity is reduced by an `O(n)` optimization * to detect any shared prefix & suffix between the two arrays and only * perform the more expensive minimum edit distance calculation over the * non-shared portions of the arrays. * * @function * @memberof Polymer.ArraySplice * @param {!Array} current The "changed" array for which splices will be * calculated. * @param {!Array} previous The "unchanged" original array to compare * `current` against to determine the splices. * @return {!Array} Returns an array of splice record objects. Each of these * contains: `index` the location where the splice occurred; `removed` * the array of removed items from this location; `addedCount` the number * of items added at this location. */ calculateSplices }; })(); </script> <script> (function() { 'use strict'; /** * Returns true if `node` is a slot element * @param {Node} node Node to test. * @return {boolean} Returns true if the given `node` is a slot * @private */ function isSlot(node) { return (node.localName === 'slot'); } /** * Class that listens for changes (additions or removals) to * "flattened nodes" on a given `node`. The list of flattened nodes consists * of a node's children and, for any children that are `<slot>` elements, * the expanded flattened list of `assignedNodes`. * For example, if the observed node has children `<a></a><slot></slot><b></b>` * and the `<slot>` has one `<div>` assigned to it, then the flattened * nodes list is `<a></a><div></div><b></b>`. If the `<slot>` has other * `<slot>` elements assigned to it, these are flattened as well. * * The provided `callback` is called whenever any change to this list * of flattened nodes occurs, where an addition or removal of a node is * considered a change. The `callback` is called with one argument, an object * containing an array of any `addedNodes` and `removedNodes`. * * Note: the callback is called asynchronous to any changes * at a microtask checkpoint. This is because observation is performed using * `MutationObserver` and the `<slot>` element's `slotchange` event which * are asynchronous. * * An example: * ```js * class TestSelfObserve extends Polymer.Element { * static get is() { return 'test-self-observe';} * connectedCallback() { * super.connectedCallback(); * this._observer = new Polymer.FlattenedNodesObserver(this, (info) => { * this.info = info; * }); * } * disconnectedCallback() { * super.disconnectedCallback(); * this._observer.disconnect(); * } * } * customElements.define(TestSelfObserve.is, TestSelfObserve); * ``` * * @memberof Polymer * @summary Class that listens for changes (additions or removals) to * "flattened nodes" on a given `node`. */ class FlattenedNodesObserver { /** * Returns the list of flattened nodes for the given `node`. * This list consists of a node's children and, for any children * that are `<slot>` elements, the expanded flattened list of `assignedNodes`. * For example, if the observed node has children `<a></a><slot></slot><b></b>` * and the `<slot>` has one `<div>` assigned to it, then the flattened * nodes list is `<a></a><div></div><b></b>`. If the `<slot>` has other * `<slot>` elements assigned to it, these are flattened as well. * * @param {HTMLElement|HTMLSlotElement} node The node for which to return the list of flattened nodes. * @return {Array} The list of flattened nodes for the given `node`. */ static getFlattenedNodes(node) { if (isSlot(node)) { node = /** @type {HTMLSlotElement} */(node); // eslint-disable-line no-self-assign return node.assignedNodes({flatten: true}); } else { return Array.from(node.childNodes).map((node) => { if (isSlot(node)) { node = /** @type {HTMLSlotElement} */(node); // eslint-disable-line no-self-assign return node.assignedNodes({flatten: true}); } else { return [node]; } }).reduce((a, b) => a.concat(b), []); } } /** * @param {Element} target Node on which to listen for changes. * @param {?function(!Element, { target: !Element, addedNodes: !Array<!Element>, removedNodes: !Array<!Element> }):void} callback Function called when there are additions * or removals from the target's list of flattened nodes. */ constructor(target, callback) { /** * @type {MutationObserver} * @private */ this._shadyChildrenObserver = null; /** * @type {MutationObserver} * @private */ this._nativeChildrenObserver = null; this._connected = false; /** * @type {Element} * @private */ this._target = target; this.callback = callback; this._effectiveNodes = []; this._observer = null; this._scheduled = false; /** * @type {function()} * @private */ this._boundSchedule = () => { this._schedule(); }; this.connect(); this._schedule(); } /** * Activates an observer. This method is automatically called when * a `FlattenedNodesObserver` is created. It should only be called to * re-activate an observer that has been deactivated via the `disconnect` method. * * @return {void} */ connect() { if (isSlot(this._target)) { this._listenSlots([this._target]); } else if (this._target.children) { this._listenSlots(this._target.children); if (window.ShadyDOM) { this._shadyChildrenObserver = ShadyDOM.observeChildren(this._target, (mutations) => { this._processMutations(mutations); }); } else { this._nativeChildrenObserver = new MutationObserver((mutations) => { this._processMutations(mutations); }); this._nativeChildrenObserver.observe(this._target, {childList: true}); } } this._connected = true; } /** * Deactivates the flattened nodes observer. After calling this method * the observer callback will not be called when changes to flattened nodes * occur. The `connect` method may be subsequently called to reactivate * the observer. * * @return {void} */ disconnect() { if (isSlot(this._target)) { this._unlistenSlots([this._target]); } else if (this._target.children) { this._unlistenSlots(this._target.children); if (window.ShadyDOM && this._shadyChildrenObserver) { ShadyDOM.unobserveChildren(this._shadyChildrenObserver); this._shadyChildrenObserver = null; } else if (this._nativeChildrenObserver) { this._nativeChildrenObserver.disconnect(); this._nativeChildrenObserver = null; } } this._connected = false; } /** * @return {void} * @private */ _schedule() { if (!this._scheduled) { this._scheduled = true; Polymer.Async.microTask.run(() => this.flush()); } } /** * @param {Array<MutationRecord>} mutations Mutations signaled by the mutation observer * @return {void} * @private */ _processMutations(mutations) { this._processSlotMutations(mutations); this.flush(); } /** * @param {Array<MutationRecord>} mutations Mutations signaled by the mutation observer * @return {void} * @private */ _processSlotMutations(mutations) { if (mutations) { for (let i=0; i < mutations.length; i++) { let mutation = mutations[i]; if (mutation.addedNodes) { this._listenSlots(mutation.addedNodes); } if (mutation.removedNodes) { this._unlistenSlots(mutation.removedNodes); } } } } /** * Flushes the observer causing any pending changes to be immediately * delivered the observer callback. By default these changes are delivered * asynchronously at the next microtask checkpoint. * * @return {boolean} Returns true if any pending changes caused the observer * callback to run. */ flush() { if (!this._connected) { return false; } if (window.ShadyDOM) { ShadyDOM.flush(); } if (this._nativeChildrenObserver) { this._processSlotMutations(this._nativeChildrenObserver.takeRecords()); } else if (this._shadyChildrenObserver) { this._processSlotMutations(this._shadyChildrenObserver.takeRecords()); } this._scheduled = false; let info = { target: this._target, addedNodes: [], removedNodes: [] }; let newNodes = this.constructor.getFlattenedNodes(this._target); let splices = Polymer.ArraySplice.calculateSplices(newNodes, this._effectiveNodes); // process removals for (let i=0, s; (i<splices.length) && (s=splices[i]); i++) { for (let j=0, n; (j < s.removed.length) && (n=s.removed[j]); j++) { info.removedNodes.push(n); } } // process adds for (let i=0, s; (i<splices.length) && (s=splices[i]); i++) { for (let j=s.index; j < s.index + s.addedCount; j++) { info.addedNodes.push(newNodes[j]); } } // update cache this._effectiveNodes = newNodes; let didFlush = false; if (info.addedNodes.length || info.removedNodes.length) { didFlush = true; this.callback.call(this._target, info); } return didFlush; } /** * @param {!Array<Element|Node>|!NodeList<Node>} nodeList Nodes that could change * @return {void} * @private */ _listenSlots(nodeList) { for (let i=0; i < nodeList.length; i++) { let n = nodeList[i]; if (isSlot(n)) { n.addEventListener('slotchange', this._boundSchedule); } } } /** * @param {!Array<Element|Node>|!NodeList<Node>} nodeList Nodes that could change * @return {void} * @private */ _unlistenSlots(nodeList) { for (let i=0; i < nodeList.length; i++) { let n = nodeList[i]; if (isSlot(n)) { n.removeEventListener('slotchange', this._boundSchedule); } } } } Polymer.FlattenedNodesObserver = FlattenedNodesObserver; })(); </script> <script> (function() { 'use strict'; let debouncerQueue = []; /** * Adds a `Polymer.Debouncer` to a list of globally flushable tasks. * * @memberof Polymer * @param {!Polymer.Debouncer} debouncer Debouncer to enqueue * @return {void} */ Polymer.enqueueDebouncer = function(debouncer) { debouncerQueue.push(debouncer); }; function flushDebouncers() { const didFlush = Boolean(debouncerQueue.length); while (debouncerQueue.length) { try { debouncerQueue.shift().flush(); } catch(e) { setTimeout(() => { throw e; }); } } return didFlush; } /** * Forces several classes of asynchronously queued tasks to flush: * - Debouncers added via `enqueueDebouncer` * - ShadyDOM distribution * * @memberof Polymer * @return {void} */ Polymer.flush = function() { let shadyDOM, debouncers; do { shadyDOM = window.ShadyDOM && ShadyDOM.flush(); if (window.ShadyCSS && window.ShadyCSS.ScopingShim) { window.ShadyCSS.ScopingShim.flush(); } debouncers = flushDebouncers(); } while (shadyDOM || debouncers); }; })(); </script> <script> (function() { 'use strict'; const p = Element.prototype; /** * @const {function(this:Node, string): boolean} */ const normalizedMatchesSelector = p.matches || p.matchesSelector || p.mozMatchesSelector || p.msMatchesSelector || p.oMatchesSelector || p.webkitMatchesSelector; /** * Cross-platform `element.matches` shim. * * @function matchesSelector * @memberof Polymer.dom * @param {!Node} node Node to check selector against * @param {string} selector Selector to match * @return {boolean} True if node matched selector */ const matchesSelector = function(node, selector) { return normalizedMatchesSelector.call(node, selector); }; /** * Node API wrapper class returned from `Polymer.dom.(target)` when * `target` is a `Node`. * * @memberof Polymer */ class DomApi { /** * @param {Node} node Node for which to create a Polymer.dom helper object. */ constructor(node) { this.node = node; } /** * Returns an instance of `Polymer.FlattenedNodesObserver` that * listens for node changes on this element. * * @param {function(!Element, { target: !Element, addedNodes: !Array<!Element>, removedNodes: !Array<!Element> }):void} callback Called when direct or distributed children * of this element changes * @return {!Polymer.FlattenedNodesObserver} Observer instance */ observeNodes(callback) { return new Polymer.FlattenedNodesObserver(this.node, callback); } /** * Disconnects an observer previously created via `observeNodes` * * @param {!Polymer.FlattenedNodesObserver} observerHandle Observer instance * to disconnect. * @return {void} */ unobserveNodes(observerHandle) { observerHandle.disconnect(); } /** * Provided as a backwards-compatible API only. This method does nothing. * @return {void} */ notifyObserver() {} /** * Returns true if the provided node is contained with this element's * light-DOM children or shadow root, including any nested shadow roots * of children therein. * * @param {Node} node Node to test * @return {boolean} Returns true if the given `node` is contained within * this element's light or shadow DOM. */ deepContains(node) { if (this.node.contains(node)) { return true; } let n = node; let doc = node.ownerDocument; // walk from node to `this` or `document` while (n && n !== doc && n !== this.node) { // use logical parentnode, or native ShadowRoot host n = n.parentNode || n.host; } return n === this.node; } /** * Returns the root node of this node. Equivalent to `getRoodNode()`. * * @return {Node} Top most element in the dom tree in which the node * exists. If the node is connected to a document this is either a * shadowRoot or the document; otherwise, it may be the node * itself or a node or document fragment containing it. */ getOwnerRoot() { return this.node.getRootNode(); } /** * For slot elements, returns the nodes assigned to the slot; otherwise * an empty array. It is equivalent to `<slot>.addignedNodes({flatten:true})`. * * @return {!Array<!Node>} Array of assigned nodes */ getDistributedNodes() { return (this.node.localName === 'slot') ? this.node.assignedNodes({flatten: true}) : []; } /** * Returns an array of all slots this element was distributed to. * * @return {!Array<!HTMLSlotElement>} Description */ getDestinationInsertionPoints() { let ip$ = []; let n = this.node.assignedSlot; while (n) { ip$.push(n); n = n.assignedSlot; } return ip$; } /** * Calls `importNode` on the `ownerDocument` for this node. * * @param {!Node} node Node to import * @param {boolean} deep True if the node should be cloned deeply during * import * @return {Node} Clone of given node imported to this owner document */ importNode(node, deep) { let doc = this.node instanceof Document ? this.node : this.node.ownerDocument; return doc.importNode(node, deep); } /** * @return {!Array<!Node>} Returns a flattened list of all child nodes and * nodes assigned to child slots. */ getEffectiveChildNodes() { return Polymer.FlattenedNodesObserver.getFlattenedNodes(this.node); } /** * Returns a filtered list of flattened child elements for this element based * on the given selector. * * @param {string} selector Selector to filter nodes against * @return {!Array<!HTMLElement>} List of flattened child elements */ queryDistributedElements(selector) { let c$ = this.getEffectiveChildNodes(); let list = []; for (let i=0, l=c$.length, c; (i<l) && (c=c$[i]); i++) { if ((c.nodeType === Node.ELEMENT_NODE) && matchesSelector(c, selector)) { list.push(c); } } return list; } /** * For shadow roots, returns the currently focused element within this * shadow root. * * @return {Node|undefined} Currently focused element */ get activeElement() { let node = this.node; return node._activeElement !== undefined ? node._activeElement : node.activeElement; } } function forwardMethods(proto, methods) { for (let i=0; i < methods.length; i++) { let method = methods[i]; /* eslint-disable valid-jsdoc */ proto[method] = /** @this {DomApi} */ function() { return this.node[method].apply(this.node, arguments); }; /* eslint-enable */ } } function forwardReadOnlyProperties(proto, properties) { for (let i=0; i < properties.length; i++) { let name = properties[i]; Object.defineProperty(proto, name, { get: function() { const domApi = /** @type {DomApi} */(this); return domApi.node[name]; }, configurable: true }); } } function forwardProperties(proto, properties) { for (let i=0; i < properties.length; i++) { let name = properties[i]; Object.defineProperty(proto, name, { get: function() { const domApi = /** @type {DomApi} */(this); return domApi.node[name]; }, set: function(value) { /** @type {DomApi} */ (this).node[name] = value; }, configurable: true }); } } forwardMethods(DomApi.prototype, [ 'cloneNode', 'appendChild', 'insertBefore', 'removeChild', 'replaceChild', 'setAttribute', 'removeAttribute', 'querySelector', 'querySelectorAll' ]); forwardReadOnlyProperties(DomApi.prototype, [ 'parentNode', 'firstChild', 'lastChild', 'nextSibling', 'previousSibling', 'firstElementChild', 'lastElementChild', 'nextElementSibling', 'previousElementSibling', 'childNodes', 'children', 'classList' ]); forwardProperties(DomApi.prototype, [ 'textContent', 'innerHTML' ]); /** * Event API wrapper class returned from `Polymer.dom.(target)` when * `target` is an `Event`. */ class EventApi { constructor(event) { this.event = event; } /** * Returns the first node on the `composedPath` of this event. * * @return {!EventTarget} The node this event was dispatched to */ get rootTarget() { return this.event.composedPath()[0]; } /** * Returns the local (re-targeted) target for this event. * * @return {!EventTarget} The local (re-targeted) target for this event. */ get localTarget() { return this.event.target; } /** * Returns the `composedPath` for this event. * @return {!Array<!EventTarget>} The nodes this event propagated through */ get path() { return this.event.composedPath(); } } Polymer.DomApi = DomApi; /** * @function * @param {boolean=} deep * @return {!Node} */ Polymer.DomApi.prototype.cloneNode; /** * @function * @param {!Node} node * @return {!Node} */ Polymer.DomApi.prototype.appendChild; /** * @function * @param {!Node} newChild * @param {Node} refChild * @return {!Node} */ Polymer.DomApi.prototype.insertBefore; /** * @function * @param {!Node} node * @return {!Node} */ Polymer.DomApi.prototype.removeChild; /** * @function * @param {!Node} oldChild * @param {!Node} newChild * @return {!Node} */ Polymer.DomApi.prototype.replaceChild; /** * @function * @param {string} name * @param {string} value * @return {void} */ Polymer.DomApi.prototype.setAttribute; /** * @function * @param {string} name * @return {void} */ Polymer.DomApi.prototype.removeAttribute; /** * @function * @param {string} selector * @return {?Element} */ Polymer.DomApi.prototype.querySelector; /** * @function * @param {string} selector * @return {!NodeList<!Element>} */ Polymer.DomApi.prototype.querySelectorAll; /** * Legacy DOM and Event manipulation API wrapper factory used to abstract * differences between native Shadow DOM and "Shady DOM" when polyfilling on * older browsers. * * Note that in Polymer 2.x use of `Polymer.dom` is no longer required and * in the majority of cases simply facades directly to the standard native * API. * * @namespace * @summary Legacy DOM and Event manipulation API wrapper factory used to * abstract differences between native Shadow DOM and "Shady DOM." * @memberof Polymer * @param {(Node|Event)=} obj Node or event to operate on * @return {!DomApi|!EventApi} Wrapper providing either node API or event API */ Polymer.dom = function(obj) { obj = obj || document; if (!obj.__domApi) { let helper; if (obj instanceof Event) { helper = new EventApi(obj); } else { helper = new DomApi(obj); } obj.__domApi = helper; } return obj.__domApi; }; Polymer.dom.matchesSelector = matchesSelector; /** * Forces several classes of asynchronously queued tasks to flush: * - Debouncers added via `Polymer.enqueueDebouncer` * - ShadyDOM distribution * * This method facades to `Polymer.flush`. * * @memberof Polymer.dom */ Polymer.dom.flush = Polymer.flush; /** * Adds a `Polymer.Debouncer` to a list of globally flushable tasks. * * This method facades to `Polymer.enqueueDebouncer`. * * @memberof Polymer.dom * @param {!Polymer.Debouncer} debouncer Debouncer to enqueue */ Polymer.dom.addDebouncer = Polymer.enqueueDebouncer; })(); </script> <script> (function() { 'use strict'; let styleInterface = window.ShadyCSS; /** * Element class mixin that provides Polymer's "legacy" API intended to be * backward-compatible to the greatest extent possible with the API * found on the Polymer 1.x `Polymer.Base` prototype applied to all elements * defined using the `Polymer({...})` function. * * @mixinFunction * @polymer * @appliesMixin Polymer.ElementMixin * @appliesMixin Polymer.GestureEventListeners * @property isAttached {boolean} Set to `true` in this element's * `connectedCallback` and `false` in `disconnectedCallback` * @memberof Polymer * @summary Element class mixin that provides Polymer's "legacy" API */ Polymer.LegacyElementMixin = Polymer.dedupingMixin((base) => { /** * @constructor * @extends {base} * @implements {Polymer_ElementMixin} * @implements {Polymer_GestureEventListeners} * @implements {Polymer_DirMixin} * @private */ const legacyElementBase = Polymer.DirMixin(Polymer.GestureEventListeners(Polymer.ElementMixin(base))); /** * Map of simple names to touch action names * @dict */ const DIRECTION_MAP = { 'x': 'pan-x', 'y': 'pan-y', 'none': 'none', 'all': 'auto' }; /** * @polymer * @mixinClass * @extends {legacyElementBase} * @implements {Polymer_LegacyElementMixin} * @unrestricted */ class LegacyElement extends legacyElementBase { constructor() { super(); /** @type {boolean} */ this.isAttached; /** @type {WeakMap<!Element, !Object<string, !Function>>} */ this.__boundListeners; /** @type {Object<string, Function>} */ this._debouncers; } /** * Forwards `importMeta` from the prototype (i.e. from the info object * passed to `Polymer({...})`) to the static API. * * @return {!Object} The `import.meta` object set on the prototype * @suppress {missingProperties} `this` is always in the instance in * closure for some reason even in a static method, rather than the class */ static get importMeta() { return this.prototype.importMeta; } /** * Legacy callback called during the `constructor`, for overriding * by the user. * @return {void} */ created() {} /** * Provides an implementation of `connectedCallback` * which adds Polymer legacy API's `attached` method. * @return {void} * @override */ connectedCallback() { super.connectedCallback(); this.isAttached = true; this.attached(); } /** * Legacy callback called during `connectedCallback`, for overriding * by the user. * @return {void} */ attached() {} /** * Provides an implementation of `disconnectedCallback` * which adds Polymer legacy API's `detached` method. * @return {void} * @override */ disconnectedCallback() { super.disconnectedCallback(); this.isAttached = false; this.detached(); } /** * Legacy callback called during `disconnectedCallback`, for overriding * by the user. * @return {void} */ detached() {} /** * Provides an override implementation of `attributeChangedCallback` * which adds the Polymer legacy API's `attributeChanged` method. * @param {string} name Name of attribute. * @param {?string} old Old value of attribute. * @param {?string} value Current value of attribute. * @param {?string} namespace Attribute namespace. * @return {void} * @override */ attributeChangedCallback(name, old, value, namespace) { if (old !== value) { super.attributeChangedCallback(name, old, value, namespace); this.attributeChanged(name, old, value); } } /** * Legacy callback called during `attributeChangedChallback`, for overriding * by the user. * @param {string} name Name of attribute. * @param {?string} old Old value of attribute. * @param {?string} value Current value of attribute. * @return {void} */ attributeChanged(name, old, value) {} // eslint-disable-line no-unused-vars /** * Overrides the default `Polymer.PropertyEffects` implementation to * add support for class initialization via the `_registered` callback. * This is called only when the first instance of the element is created. * * @return {void} * @override * @suppress {invalidCasts} */ _initializeProperties() { let proto = Object.getPrototypeOf(this); if (!proto.hasOwnProperty('__hasRegisterFinished')) { this._registered(); // backstop in case the `_registered` implementation does not set this proto.__hasRegisterFinished = true; } super._initializeProperties(); this.root = /** @type {HTMLElement} */(this); this.created(); // Ensure listeners are applied immediately so that they are // added before declarative event listeners. This allows an element to // decorate itself via an event prior to any declarative listeners // seeing the event. Note, this ensures compatibility with 1.x ordering. this._applyListeners(); } /** * Called automatically when an element is initializing. * Users may override this method to perform class registration time * work. The implementation should ensure the work is performed * only once for the class. * @protected * @return {void} */ _registered() {} /** * Overrides the default `Polymer.PropertyEffects` implementation to * add support for installing `hostAttributes` and `listeners`. * * @return {void} * @override */ ready() { this._ensureAttributes(); super.ready(); } /** * Ensures an element has required attributes. Called when the element * is being readied via `ready`. Users should override to set the * element's required attributes. The implementation should be sure * to check and not override existing attributes added by * the user of the element. Typically, setting attributes should be left * to the element user and not done here; reasonable exceptions include * setting aria roles and focusability. * @protected * @return {void} */ _ensureAttributes() {} /** * Adds element event listeners. Called when the element * is being readied via `ready`. Users should override to * add any required element event listeners. * In performance critical elements, the work done here should be kept * to a minimum since it is done before the element is rendered. In * these elements, consider adding listeners asynchronously so as not to * block render. * @protected * @return {void} */ _applyListeners() {} /** * Converts a typed JavaScript value to a string. * * Note this method is provided as backward-compatible legacy API * only. It is not directly called by any Polymer features. To customize * how properties are serialized to attributes for attribute bindings and * `reflectToAttribute: true` properties as well as this method, override * the `_serializeValue` method provided by `Polymer.PropertyAccessors`. * * @param {*} value Value to deserialize * @return {string | undefined} Serialized value */ serialize(value) { return this._serializeValue(value); } /** * Converts a string to a typed JavaScript value. * * Note this method is provided as backward-compatible legacy API * only. It is not directly called by any Polymer features. To customize * how attributes are deserialized to properties for in * `attributeChangedCallback`, override `_deserializeValue` method * provided by `Polymer.PropertyAccessors`. * * @param {string} value String to deserialize * @param {*} type Type to deserialize the string to * @return {*} Returns the deserialized value in the `type` given. */ deserialize(value, type) { return this._deserializeValue(value, type); } /** * Serializes a property to its associated attribute. * * Note this method is provided as backward-compatible legacy API * only. It is not directly called by any Polymer features. * * @param {string} property Property name to reflect. * @param {string=} attribute Attribute name to reflect. * @param {*=} value Property value to reflect. * @return {void} */ reflectPropertyToAttribute(property, attribute, value) { this._propertyToAttribute(property, attribute, value); } /** * Sets a typed value to an HTML attribute on a node. * * Note this method is provided as backward-compatible legacy API * only. It is not directly called by any Polymer features. * * @param {*} value Value to serialize. * @param {string} attribute Attribute name to serialize to. * @param {Element} node Element to set attribute to. * @return {void} */ serializeValueToAttribute(value, attribute, node) { this._valueToNodeAttribute(/** @type {Element} */ (node || this), value, attribute); } /** * Copies own properties (including accessor descriptors) from a source * object to a target object. * * @param {Object} prototype Target object to copy properties to. * @param {Object} api Source object to copy properties from. * @return {Object} prototype object that was passed as first argument. */ extend(prototype, api) { if (!(prototype && api)) { return prototype || api; } let n$ = Object.getOwnPropertyNames(api); for (let i=0, n; (i<n$.length) && (n=n$[i]); i++) { let pd = Object.getOwnPropertyDescriptor(api, n); if (pd) { Object.defineProperty(prototype, n, pd); } } return prototype; } /** * Copies props from a source object to a target object. * * Note, this method uses a simple `for...in` strategy for enumerating * properties. To ensure only `ownProperties` are copied from source * to target and that accessor implementations are copied, use `extend`. * * @param {!Object} target Target object to copy properties to. * @param {!Object} source Source object to copy properties from. * @return {!Object} Target object that was passed as first argument. */ mixin(target, source) { for (let i in source) { target[i] = source[i]; } return target; } /** * Sets the prototype of an object. * * Note this method is provided as backward-compatible legacy API * only. It is not directly called by any Polymer features. * @param {Object} object The object on which to set the prototype. * @param {Object} prototype The prototype that will be set on the given * `object`. * @return {Object} Returns the given `object` with its prototype set * to the given `prototype` object. */ chainObject(object, prototype) { if (object && prototype && object !== prototype) { object.__proto__ = prototype; } return object; } /* **** Begin Template **** */ /** * Calls `importNode` on the `content` of the `template` specified and * returns a document fragment containing the imported content. * * @param {HTMLTemplateElement} template HTML template element to instance. * @return {!DocumentFragment} Document fragment containing the imported * template content. */ instanceTemplate(template) { let content = this.constructor._contentForTemplate(template); let dom = /** @type {!DocumentFragment} */ (document.importNode(content, true)); return dom; } /* **** Begin Events **** */ /** * Dispatches a custom event with an optional detail value. * * @param {string} type Name of event type. * @param {*=} detail Detail value containing event-specific * payload. * @param {{ bubbles: (boolean|undefined), cancelable: (boolean|undefined), composed: (boolean|undefined) }=} * options Object specifying options. These may include: * `bubbles` (boolean, defaults to `true`), * `cancelable` (boolean, defaults to false), and * `node` on which to fire the event (HTMLElement, defaults to `this`). * @return {!Event} The new event that was fired. */ fire(type, detail, options) { options = options || {}; detail = (detail === null || detail === undefined) ? {} : detail; let event = new Event(type, { bubbles: options.bubbles === undefined ? true : options.bubbles, cancelable: Boolean(options.cancelable), composed: options.composed === undefined ? true: options.composed }); event.detail = detail; let node = options.node || this; node.dispatchEvent(event); return event; } /** * Convenience method to add an event listener on a given element, * late bound to a named method on this element. * * @param {Element} node Element to add event listener to. * @param {string} eventName Name of event to listen for. * @param {string} methodName Name of handler method on `this` to call. * @return {void} */ listen(node, eventName, methodName) { node = /** @type {!Element} */ (node || this); let hbl = this.__boundListeners || (this.__boundListeners = new WeakMap()); let bl = hbl.get(node); if (!bl) { bl = {}; hbl.set(node, bl); } let key = eventName + methodName; if (!bl[key]) { bl[key] = this._addMethodEventListenerToNode( node, eventName, methodName, this); } } /** * Convenience method to remove an event listener from a given element, * late bound to a named method on this element. * * @param {Element} node Element to remove event listener from. * @param {string} eventName Name of event to stop listening to. * @param {string} methodName Name of handler method on `this` to not call anymore. * @return {void} */ unlisten(node, eventName, methodName) { node = /** @type {!Element} */ (node || this); let bl = this.__boundListeners && this.__boundListeners.get(node); let key = eventName + methodName; let handler = bl && bl[key]; if (handler) { this._removeEventListenerFromNode(node, eventName, handler); bl[key] = null; } } /** * Override scrolling behavior to all direction, one direction, or none. * * Valid scroll directions: * - 'all': scroll in any direction * - 'x': scroll only in the 'x' direction * - 'y': scroll only in the 'y' direction * - 'none': disable scrolling for this node * * @param {string=} direction Direction to allow scrolling * Defaults to `all`. * @param {Element=} node Element to apply scroll direction setting. * Defaults to `this`. * @return {void} */ setScrollDirection(direction, node) { Polymer.Gestures.setTouchAction(/** @type {Element} */ (node || this), DIRECTION_MAP[direction] || 'auto'); } /* **** End Events **** */ /** * Convenience method to run `querySelector` on this local DOM scope. * * This function calls `Polymer.dom(this.root).querySelector(slctr)`. * * @param {string} slctr Selector to run on this local DOM scope * @return {Element} Element found by the selector, or null if not found. */ $$(slctr) { return this.root.querySelector(slctr); } /** * Return the element whose local dom within which this element * is contained. This is a shorthand for * `this.getRootNode().host`. * @this {Element} */ get domHost() { let root = this.getRootNode(); return (root instanceof DocumentFragment) ? /** @type {ShadowRoot} */ (root).host : root; } /** * Force this element to distribute its children to its local dom. * This should not be necessary as of Polymer 2.0.2 and is provided only * for backwards compatibility. * @return {void} */ distributeContent() { if (window.ShadyDOM && this.shadowRoot) { ShadyDOM.flush(); } } /** * Returns a list of nodes that are the effective childNodes. The effective * childNodes list is the same as the element's childNodes except that * any `<content>` elements are replaced with the list of nodes distributed * to the `<content>`, the result of its `getDistributedNodes` method. * @return {!Array<!Node>} List of effective child nodes. * @suppress {invalidCasts} LegacyElementMixin must be applied to an HTMLElement */ getEffectiveChildNodes() { const thisEl = /** @type {Element} */ (this); const domApi = /** @type {Polymer.DomApi} */(Polymer.dom(thisEl)); return domApi.getEffectiveChildNodes(); } /** * Returns a list of nodes distributed within this element that match * `selector`. These can be dom children or elements distributed to * children that are insertion points. * @param {string} selector Selector to run. * @return {!Array<!Node>} List of distributed elements that match selector. * @suppress {invalidCasts} LegacyElementMixin must be applied to an HTMLElement */ queryDistributedElements(selector) { const thisEl = /** @type {Element} */ (this); const domApi = /** @type {Polymer.DomApi} */(Polymer.dom(thisEl)); return domApi.queryDistributedElements(selector); } /** * Returns a list of elements that are the effective children. The effective * children list is the same as the element's children except that * any `<content>` elements are replaced with the list of elements * distributed to the `<content>`. * * @return {!Array<!Node>} List of effective children. */ getEffectiveChildren() { let list = this.getEffectiveChildNodes(); return list.filter(function(/** @type {!Node} */ n) { return (n.nodeType === Node.ELEMENT_NODE); }); } /** * Returns a string of text content that is the concatenation of the * text content's of the element's effective childNodes (the elements * returned by <a href="#getEffectiveChildNodes>getEffectiveChildNodes</a>. * * @return {string} List of effective children. */ getEffectiveTextContent() { let cn = this.getEffectiveChildNodes(); let tc = []; for (let i=0, c; (c = cn[i]); i++) { if (c.nodeType !== Node.COMMENT_NODE) { tc.push(c.textContent); } } return tc.join(''); } /** * Returns the first effective childNode within this element that * match `selector`. These can be dom child nodes or elements distributed * to children that are insertion points. * @param {string} selector Selector to run. * @return {Node} First effective child node that matches selector. */ queryEffectiveChildren(selector) { let e$ = this.queryDistributedElements(selector); return e$ && e$[0]; } /** * Returns a list of effective childNodes within this element that * match `selector`. These can be dom child nodes or elements distributed * to children that are insertion points. * @param {string} selector Selector to run. * @return {!Array<!Node>} List of effective child nodes that match selector. */ queryAllEffectiveChildren(selector) { return this.queryDistributedElements(selector); } /** * Returns a list of nodes distributed to this element's `<slot>`. * * If this element contains more than one `<slot>` in its local DOM, * an optional selector may be passed to choose the desired content. * * @param {string=} slctr CSS selector to choose the desired * `<slot>`. Defaults to `content`. * @return {!Array<!Node>} List of distributed nodes for the `<slot>`. */ getContentChildNodes(slctr) { let content = this.root.querySelector(slctr || 'slot'); return content ? /** @type {Polymer.DomApi} */(Polymer.dom(content)).getDistributedNodes() : []; } /** * Returns a list of element children distributed to this element's * `<slot>`. * * If this element contains more than one `<slot>` in its * local DOM, an optional selector may be passed to choose the desired * content. This method differs from `getContentChildNodes` in that only * elements are returned. * * @param {string=} slctr CSS selector to choose the desired * `<content>`. Defaults to `content`. * @return {!Array<!HTMLElement>} List of distributed nodes for the * `<slot>`. * @suppress {invalidCasts} */ getContentChildren(slctr) { let children = /** @type {!Array<!HTMLElement>} */(this.getContentChildNodes(slctr).filter(function(n) { return (n.nodeType === Node.ELEMENT_NODE); })); return children; } /** * Checks whether an element is in this element's light DOM tree. * * @param {?Node} node The element to be checked. * @return {boolean} true if node is in this element's light DOM tree. * @suppress {invalidCasts} LegacyElementMixin must be applied to an HTMLElement */ isLightDescendant(node) { const thisNode = /** @type {Node} */ (this); return thisNode !== node && thisNode.contains(node) && thisNode.getRootNode() === node.getRootNode(); } /** * Checks whether an element is in this element's local DOM tree. * * @param {!Element} node The element to be checked. * @return {boolean} true if node is in this element's local DOM tree. */ isLocalDescendant(node) { return this.root === node.getRootNode(); } /** * No-op for backwards compatibility. This should now be handled by * ShadyCss library. * @param {*} container Unused * @param {*} shouldObserve Unused * @return {void} */ scopeSubtree(container, shouldObserve) { // eslint-disable-line no-unused-vars } /** * Returns the computed style value for the given property. * @param {string} property The css property name. * @return {string} Returns the computed css property value for the given * `property`. * @suppress {invalidCasts} LegacyElementMixin must be applied to an HTMLElement */ getComputedStyleValue(property) { return styleInterface.getComputedStyleValue(/** @type {!Element} */(this), property); } // debounce /** * Call `debounce` to collapse multiple requests for a named task into * one invocation which is made after the wait time has elapsed with * no new request. If no wait time is given, the callback will be called * at microtask timing (guaranteed before paint). * * debouncedClickAction(e) { * // will not call `processClick` more than once per 100ms * this.debounce('click', function() { * this.processClick(); * } 100); * } * * @param {string} jobName String to identify the debounce job. * @param {function():void} callback Function that is called (with `this` * context) when the wait time elapses. * @param {number} wait Optional wait time in milliseconds (ms) after the * last signal that must elapse before invoking `callback` * @return {!Object} Returns a debouncer object on which exists the * following methods: `isActive()` returns true if the debouncer is * active; `cancel()` cancels the debouncer if it is active; * `flush()` immediately invokes the debounced callback if the debouncer * is active. */ debounce(jobName, callback, wait) { this._debouncers = this._debouncers || {}; return this._debouncers[jobName] = Polymer.Debouncer.debounce( this._debouncers[jobName] , wait > 0 ? Polymer.Async.timeOut.after(wait) : Polymer.Async.microTask , callback.bind(this)); } /** * Returns whether a named debouncer is active. * * @param {string} jobName The name of the debouncer started with `debounce` * @return {boolean} Whether the debouncer is active (has not yet fired). */ isDebouncerActive(jobName) { this._debouncers = this._debouncers || {}; let debouncer = this._debouncers[jobName]; return !!(debouncer && debouncer.isActive()); } /** * Immediately calls the debouncer `callback` and inactivates it. * * @param {string} jobName The name of the debouncer started with `debounce` * @return {void} */ flushDebouncer(jobName) { this._debouncers = this._debouncers || {}; let debouncer = this._debouncers[jobName]; if (debouncer) { debouncer.flush(); } } /** * Cancels an active debouncer. The `callback` will not be called. * * @param {string} jobName The name of the debouncer started with `debounce` * @return {void} */ cancelDebouncer(jobName) { this._debouncers = this._debouncers || {}; let debouncer = this._debouncers[jobName]; if (debouncer) { debouncer.cancel(); } } /** * Runs a callback function asynchronously. * * By default (if no waitTime is specified), async callbacks are run at * microtask timing, which will occur before paint. * * @param {!Function} callback The callback function to run, bound to `this`. * @param {number=} waitTime Time to wait before calling the * `callback`. If unspecified or 0, the callback will be run at microtask * timing (before paint). * @return {number} Handle that may be used to cancel the async job. */ async(callback, waitTime) { return waitTime > 0 ? Polymer.Async.timeOut.run(callback.bind(this), waitTime) : ~Polymer.Async.microTask.run(callback.bind(this)); } /** * Cancels an async operation started with `async`. * * @param {number} handle Handle returned from original `async` call to * cancel. * @return {void} */ cancelAsync(handle) { handle < 0 ? Polymer.Async.microTask.cancel(~handle) : Polymer.Async.timeOut.cancel(handle); } // other /** * Convenience method for creating an element and configuring it. * * @param {string} tag HTML element tag to create. * @param {Object=} props Object of properties to configure on the * instance. * @return {!Element} Newly created and configured element. */ create(tag, props) { let elt = document.createElement(tag); if (props) { if (elt.setProperties) { elt.setProperties(props); } else { for (let n in props) { elt[n] = props[n]; } } } return elt; } /** * Convenience method for importing an HTML document imperatively. * * This method creates a new `<link rel="import">` element with * the provided URL and appends it to the document to start loading. * In the `onload` callback, the `import` property of the `link` * element will contain the imported document contents. * * @param {string} href URL to document to load. * @param {?function(!Event):void=} onload Callback to notify when an import successfully * loaded. * @param {?function(!ErrorEvent):void=} onerror Callback to notify when an import * unsuccessfully loaded. * @param {boolean=} optAsync True if the import should be loaded `async`. * Defaults to `false`. * @return {!HTMLLinkElement} The link element for the URL to be loaded. */ importHref(href, onload, onerror, optAsync) { // eslint-disable-line no-unused-vars let loadFn = onload ? onload.bind(this) : null; let errorFn = onerror ? onerror.bind(this) : null; return Polymer.importHref(href, loadFn, errorFn, optAsync); } /** * Polyfill for Element.prototype.matches, which is sometimes still * prefixed. * * @param {string} selector Selector to test. * @param {!Element=} node Element to test the selector against. * @return {boolean} Whether the element matches the selector. */ elementMatches(selector, node) { return Polymer.dom.matchesSelector(/** @type {!Element} */ (node || this), selector); } /** * Toggles an HTML attribute on or off. * * @param {string} name HTML attribute name * @param {boolean=} bool Boolean to force the attribute on or off. * When unspecified, the state of the attribute will be reversed. * @param {Element=} node Node to target. Defaults to `this`. * @return {void} */ toggleAttribute(name, bool, node) { node = /** @type {Element} */ (node || this); if (arguments.length == 1) { bool = !node.hasAttribute(name); } if (bool) { node.setAttribute(name, ''); } else { node.removeAttribute(name); } } /** * Toggles a CSS class on or off. * * @param {string} name CSS class name * @param {boolean=} bool Boolean to force the class on or off. * When unspecified, the state of the class will be reversed. * @param {Element=} node Node to target. Defaults to `this`. * @return {void} */ toggleClass(name, bool, node) { node = /** @type {Element} */ (node || this); if (arguments.length == 1) { bool = !node.classList.contains(name); } if (bool) { node.classList.add(name); } else { node.classList.remove(name); } } /** * Cross-platform helper for setting an element's CSS `transform` property. * * @param {string} transformText Transform setting. * @param {Element=} node Element to apply the transform to. * Defaults to `this` * @return {void} */ transform(transformText, node) { node = /** @type {Element} */ (node || this); node.style.webkitTransform = transformText; node.style.transform = transformText; } /** * Cross-platform helper for setting an element's CSS `translate3d` * property. * * @param {number} x X offset. * @param {number} y Y offset. * @param {number} z Z offset. * @param {Element=} node Element to apply the transform to. * Defaults to `this`. * @return {void} */ translate3d(x, y, z, node) { node = /** @type {Element} */ (node || this); this.transform('translate3d(' + x + ',' + y + ',' + z + ')', node); } /** * Removes an item from an array, if it exists. * * If the array is specified by path, a change notification is * generated, so that observers, data bindings and computed * properties watching that path can update. * * If the array is passed directly, **no change * notification is generated**. * * @param {string | !Array<number|string>} arrayOrPath Path to array from which to remove the item * (or the array itself). * @param {*} item Item to remove. * @return {Array} Array containing item removed. */ arrayDelete(arrayOrPath, item) { let index; if (Array.isArray(arrayOrPath)) { index = arrayOrPath.indexOf(item); if (index >= 0) { return arrayOrPath.splice(index, 1); } } else { let arr = Polymer.Path.get(this, arrayOrPath); index = arr.indexOf(item); if (index >= 0) { return this.splice(arrayOrPath, index, 1); } } return null; } // logging /** * Facades `console.log`/`warn`/`error` as override point. * * @param {string} level One of 'log', 'warn', 'error' * @param {Array} args Array of strings or objects to log * @return {void} */ _logger(level, args) { // accept ['foo', 'bar'] and [['foo', 'bar']] if (Array.isArray(args) && args.length === 1 && Array.isArray(args[0])) { args = args[0]; } switch(level) { case 'log': case 'warn': case 'error': console[level](...args); } } /** * Facades `console.log` as an override point. * * @param {...*} args Array of strings or objects to log * @return {void} */ _log(...args) { this._logger('log', args); } /** * Facades `console.warn` as an override point. * * @param {...*} args Array of strings or objects to log * @return {void} */ _warn(...args) { this._logger('warn', args); } /** * Facades `console.error` as an override point. * * @param {...*} args Array of strings or objects to log * @return {void} */ _error(...args) { this._logger('error', args); } /** * Formats a message using the element type an a method name. * * @param {string} methodName Method name to associate with message * @param {...*} args Array of strings or objects to log * @return {Array} Array with formatting information for `console` * logging. */ _logf(methodName, ...args) { return ['[%s::%s]', this.is, methodName, ...args]; } } LegacyElement.prototype.is = ''; return LegacyElement; }); })(); </script> <script> (function() { 'use strict'; const lifecycleProps = { attached: true, detached: true, ready: true, created: true, beforeRegister: true, registered: true, attributeChanged: true, listeners: true, hostAttributes: true }; const excludeOnInfo = { attached: true, detached: true, ready: true, created: true, beforeRegister: true, registered: true, attributeChanged: true, behaviors: true, _noAccessors: true }; const excludeOnBehaviors = Object.assign({ listeners: true, hostAttributes: true, properties: true, observers: true, }, excludeOnInfo); function copyProperties(source, target, excludeProps) { const noAccessors = source._noAccessors; for (let p in source) { if (!(p in excludeProps)) { if (noAccessors) { target[p] = source[p]; } else { let pd = Object.getOwnPropertyDescriptor(source, p); if (pd) { // ensure property is configurable so that a later behavior can // re-configure it. pd.configurable = true; Object.defineProperty(target, p, pd); } } } } } /** * Applies a "legacy" behavior or array of behaviors to the provided class. * * Note: this method will automatically also apply the `Polymer.LegacyElementMixin` * to ensure that any legacy behaviors can rely on legacy Polymer API on * the underlying element. * * @template T * @param {!Object|!Array<!Object>} behaviors Behavior object or array of behaviors. * @param {function(new:T)} klass Element class. * @return {function(new:T)} Returns a new Element class extended by the * passed in `behaviors` and also by `Polymer.LegacyElementMixin`. * @memberof Polymer * @suppress {invalidCasts, checkTypes} */ function mixinBehaviors(behaviors, klass) { return GenerateClassFromInfo({}, Polymer.LegacyElementMixin(klass), behaviors); } // NOTE: // 1.x // Behaviors were mixed in *in reverse order* and de-duped on the fly. // The rule was that behavior properties were copied onto the element // prototype if and only if the property did not already exist. // Given: Polymer{ behaviors: [A, B, C, A, B]}, property copy order was: // (1), B, (2), A, (3) C. This means prototype properties win over // B properties win over A win over C. This mirrors what would happen // with inheritance if element extended B extended A extended C. // // Again given, Polymer{ behaviors: [A, B, C, A, B]}, the resulting // `behaviors` array was [C, A, B]. // Behavior lifecycle methods were called in behavior array order // followed by the element, e.g. (1) C.created, (2) A.created, // (3) B.created, (4) element.created. There was no support for // super, and "super-behavior" methods were callable only by name). // // 2.x // Behaviors are made into proper mixins which live in the // element's prototype chain. Behaviors are placed in the element prototype // eldest to youngest and de-duped youngest to oldest: // So, first [A, B, C, A, B] becomes [C, A, B] then, // the element prototype becomes (oldest) (1) Polymer.Element, (2) class(C), // (3) class(A), (4) class(B), (5) class(Polymer({...})). // Result: // This means element properties win over B properties win over A win // over C. (same as 1.x) // If lifecycle is called (super then me), order is // (1) C.created, (2) A.created, (3) B.created, (4) element.created // (again same as 1.x) function applyBehaviors(proto, behaviors, lifecycle) { for (let i=0; i<behaviors.length; i++) { applyInfo(proto, behaviors[i], lifecycle, excludeOnBehaviors); } } function applyInfo(proto, info, lifecycle, excludeProps) { copyProperties(info, proto, excludeProps); for (let p in lifecycleProps) { if (info[p]) { lifecycle[p] = lifecycle[p] || []; lifecycle[p].push(info[p]); } } } /** * @param {Array} behaviors List of behaviors to flatten. * @param {Array=} list Target list to flatten behaviors into. * @param {Array=} exclude List of behaviors to exclude from the list. * @return {!Array} Returns the list of flattened behaviors. */ function flattenBehaviors(behaviors, list, exclude) { list = list || []; for (let i=behaviors.length-1; i >= 0; i--) { let b = behaviors[i]; if (b) { if (Array.isArray(b)) { flattenBehaviors(b, list); } else { // dedup if (list.indexOf(b) < 0 && (!exclude || exclude.indexOf(b) < 0)) { list.unshift(b); } } } else { console.warn('behavior is null, check for missing or 404 import'); } } return list; } /* Note about construction and extension of legacy classes. [Changed in Q4 2018 to optimize performance.] When calling `Polymer` or `mixinBehaviors`, the generated class below is made. The list of behaviors was previously made into one generated class per behavior, but this is no longer the case as behaviors are now called manually. Note, there may *still* be multiple generated classes in the element's prototype chain if extension is used with `mixinBehaviors`. The generated class is directly tied to the info object and behaviors used to create it. That list of behaviors is filtered so it's only the behaviors not active on the superclass. In order to call through to the entire list of lifecycle methods, it's important to call `super`. The element's `properties` and `observers` are controlled via the finalization mechanism provided by `PropertiesMixin`. `Properties` and `observers` are collected by manually traversing the prototype chain and merging. To limit changes, the `_registered` method is called via `_initializeProperties` and not `_finalizeClass`. */ /** * @param {!PolymerInit} info Polymer info object * @param {function(new:HTMLElement)} Base base class to extend with info object * @param {Object} behaviors behaviors to copy into the element * @return {function(new:HTMLElement)} Generated class * @suppress {checkTypes} * @private */ function GenerateClassFromInfo(info, Base, behaviors) { // manages behavior and lifecycle processing (filled in after class definition) let behaviorList; const lifecycle = {}; /** @private */ class PolymerGenerated extends Base { // explicitly not calling super._finalizeClass static _finalizeClass() { // if calling via a subclass that hasn't been generated, pass through to super if (!this.hasOwnProperty(window.JSCompiler_renameProperty('generatedFrom', this))) { super._finalizeClass(); } else { // interleave properties and observers per behavior and `info` if (behaviorList) { for (let i=0, b; i < behaviorList.length; i++) { b = behaviorList[i]; if (b.properties) { this.createProperties(b.properties); } if (b.observers) { this.createObservers(b.observers, b.properties); } } } if (info.properties) { this.createProperties(info.properties); } if (info.observers) { this.createObservers(info.observers, info.properties); } // make sure to prepare the element template this._prepareTemplate(); } } static get properties() { const properties = {}; if (behaviorList) { for (let i=0; i < behaviorList.length; i++) { Object.assign(properties, behaviorList[i].properties); } } Object.assign(properties, info.properties); return properties; } static get observers() { let observers = []; if (behaviorList) { for (let i=0, b; i < behaviorList.length; i++) { b = behaviorList[i]; if (b.observers) { observers = observers.concat(b.observers); } } } if (info.observers) { observers = observers.concat(info.observers); } return observers; } /** * @return {void} */ created() { super.created(); const list = lifecycle.created; if (list) { for (let i=0; i < list.length; i++) { list[i].call(this); } } } /** * @return {void} */ _registered() { /* NOTE: `beforeRegister` is called here for bc, but the behavior is different than in 1.x. In 1.0, the method was called *after* mixing prototypes together but *before* processing of meta-objects. However, dynamic effects can still be set here and can be done either in `beforeRegister` or `registered`. It is no longer possible to set `is` in `beforeRegister` as you could in 1.x. */ // only proceed if the generated class' prototype has not been registered. const generatedProto = PolymerGenerated.prototype; if (!generatedProto.hasOwnProperty('__hasRegisterFinished')) { generatedProto.__hasRegisterFinished = true; // ensure superclass is registered first. super._registered(); // copy properties onto the generated class lazily if we're optimizing, if (Polymer.legacyOptimizations) { copyPropertiesToProto(generatedProto); } // make sure legacy lifecycle is called on the *element*'s prototype // and not the generated class prototype; if the element has been // extended, these are *not* the same. const proto = Object.getPrototypeOf(this); let list = lifecycle.beforeRegister; if (list) { for (let i=0; i < list.length; i++) { list[i].call(proto); } } list = lifecycle.registered; if (list) { for (let i=0; i < list.length; i++) { list[i].call(proto); } } } } /** * @return {void} */ _applyListeners() { super._applyListeners(); const list = lifecycle.listeners; if (list) { for (let i=0; i < list.length; i++) { const listeners = list[i]; if (listeners) { for (let l in listeners) { this._addMethodEventListenerToNode(this, l, listeners[l]); } } } } } // note: exception to "super then me" rule; // do work before calling super so that super attributes // only apply if not already set. /** * @return {void} */ _ensureAttributes() { const list = lifecycle.hostAttributes; if (list) { for (let i=list.length-1; i >= 0; i--) { const hostAttributes = list[i]; for (let a in hostAttributes) { this._ensureAttribute(a, hostAttributes[a]); } } } super._ensureAttributes(); } /** * @return {void} */ ready() { super.ready(); let list = lifecycle.ready; if (list) { for (let i=0; i < list.length; i++) { list[i].call(this); } } } /** * @return {void} */ attached() { super.attached(); let list = lifecycle.attached; if (list) { for (let i=0; i < list.length; i++) { list[i].call(this); } } } /** * @return {void} */ detached() { super.detached(); let list = lifecycle.detached; if (list) { for (let i=0; i < list.length; i++) { list[i].call(this); } } } /** * Implements native Custom Elements `attributeChangedCallback` to * set an attribute value to a property via `_attributeToProperty`. * * @param {string} name Name of attribute that changed * @param {?string} old Old attribute value * @param {?string} value New attribute value * @return {void} */ attributeChanged(name, old, value) { super.attributeChanged(); let list = lifecycle.attributeChanged; if (list) { for (let i=0; i < list.length; i++) { list[i].call(this, name, old, value); } } } } // apply behaviors, note actual copying is done lazily at first instance creation if (behaviors) { // NOTE: ensure the behavior is extending a class with // legacy element api. This is necessary since behaviors expect to be able // to access 1.x legacy api. if (!Array.isArray(behaviors)) { behaviors = [behaviors]; } let superBehaviors = Base.prototype.behaviors; // get flattened, deduped list of behaviors *not* already on super class behaviorList = flattenBehaviors(behaviors, null, superBehaviors); PolymerGenerated.prototype.behaviors = superBehaviors ? superBehaviors.concat(behaviors) : behaviorList; } const copyPropertiesToProto = (proto) => { if (behaviorList) { applyBehaviors(proto, behaviorList, lifecycle); } applyInfo(proto, info, lifecycle, excludeOnInfo); }; // copy properties if we're not optimizing if (!Polymer.legacyOptimizations) { copyPropertiesToProto(PolymerGenerated.prototype); } PolymerGenerated.generatedFrom = info; return PolymerGenerated; } /** * Generates a class that extends `Polymer.LegacyElement` based on the * provided info object. Metadata objects on the `info` object * (`properties`, `observers`, `listeners`, `behaviors`, `is`) are used * for Polymer's meta-programming systems, and any functions are copied * to the generated class. * * Valid "metadata" values are as follows: * * `is`: String providing the tag name to register the element under. In * addition, if a `dom-module` with the same id exists, the first template * in that `dom-module` will be stamped into the shadow root of this element, * with support for declarative event listeners (`on-...`), Polymer data * bindings (`[[...]]` and `{{...}}`), and id-based node finding into * `this.$`. * * `properties`: Object describing property-related metadata used by Polymer * features (key: property names, value: object containing property metadata). * Valid keys in per-property metadata include: * - `type` (String|Number|Object|Array|...): Used by * `attributeChangedCallback` to determine how string-based attributes * are deserialized to JavaScript property values. * - `notify` (boolean): Causes a change in the property to fire a * non-bubbling event called `<property>-changed`. Elements that have * enabled two-way binding to the property use this event to observe changes. * - `readOnly` (boolean): Creates a getter for the property, but no setter. * To set a read-only property, use the private setter method * `_setProperty(property, value)`. * - `observer` (string): Observer method name that will be called when * the property changes. The arguments of the method are * `(value, previousValue)`. * - `computed` (string): String describing method and dependent properties * for computing the value of this property (e.g. `'computeFoo(bar, zot)'`). * Computed properties are read-only by default and can only be changed * via the return value of the computing method. * * `observers`: Array of strings describing multi-property observer methods * and their dependent properties (e.g. `'observeABC(a, b, c)'`). * * `listeners`: Object describing event listeners to be added to each * instance of this element (key: event name, value: method name). * * `behaviors`: Array of additional `info` objects containing metadata * and callbacks in the same format as the `info` object here which are * merged into this element. * * `hostAttributes`: Object listing attributes to be applied to the host * once created (key: attribute name, value: attribute value). Values * are serialized based on the type of the value. Host attributes should * generally be limited to attributes such as `tabIndex` and `aria-...`. * Attributes in `hostAttributes` are only applied if a user-supplied * attribute is not already present (attributes in markup override * `hostAttributes`). * * In addition, the following Polymer-specific callbacks may be provided: * - `registered`: called after first instance of this element, * - `created`: called during `constructor` * - `attached`: called during `connectedCallback` * - `detached`: called during `disconnectedCallback` * - `ready`: called before first `attached`, after all properties of * this element have been propagated to its template and all observers * have run * * @param {!PolymerInit} info Object containing Polymer metadata and functions * to become class methods. * @template T * @param {function(T):T} mixin Optional mixin to apply to legacy base class * before extending with Polymer metaprogramming. * @return {function(new:HTMLElement)} Generated class * @memberof Polymer */ Polymer.Class = function(info, mixin) { if (!info) { console.warn('Polymer.Class requires `info` argument'); } let klass = mixin ? mixin(Polymer.LegacyElementMixin(HTMLElement)) : Polymer.LegacyElementMixin(HTMLElement); klass = GenerateClassFromInfo(info, klass, info.behaviors); if (info._enableDisableUpgrade) { klass = Polymer.DisableUpgradeMixin(klass); } // decorate klass with registration info klass.is = klass.prototype.is = info.is; return klass; }; Polymer.mixinBehaviors = mixinBehaviors; })(); </script> <script> (function() { 'use strict'; /** * Legacy class factory and registration helper for defining Polymer * elements. * * This method is equivalent to * `customElements.define(info.is, Polymer.Class(info));` * * See `Polymer.Class` for details on valid legacy metadata format for `info`. * * @global * @override * @function Polymer * @param {!PolymerInit} info Object containing Polymer metadata and functions * to become class methods. * @return {function(new: HTMLElement)} Generated class * @suppress {duplicate, invalidCasts, checkTypes} */ window.Polymer._polymerFn = function(info) { // if input is a `class` (aka a function with a prototype), use the prototype // remember that the `constructor` will never be called let klass; if (typeof info === 'function') { klass = info; } else { klass = Polymer.Class(info); } customElements.define(klass.is, /** @type {!HTMLElement} */(klass)); return klass; }; })(); </script> <script> (function() { 'use strict'; // Common implementation for mixin & behavior function mutablePropertyChange(inst, property, value, old, mutableData) { let isObject; if (mutableData) { isObject = (typeof value === 'object' && value !== null); // Pull `old` for Objects from temp cache, but treat `null` as a primitive if (isObject) { old = inst.__dataTemp[property]; } } // Strict equality check, but return false for NaN===NaN let shouldChange = (old !== value && (old === old || value === value)); // Objects are stored in temporary cache (cleared at end of // turn), which is used for dirty-checking if (isObject && shouldChange) { inst.__dataTemp[property] = value; } return shouldChange; } /** * Element class mixin to skip strict dirty-checking for objects and arrays * (always consider them to be "dirty"), for use on elements utilizing * `Polymer.PropertyEffects` * * By default, `Polymer.PropertyEffects` performs strict dirty checking on * objects, which means that any deep modifications to an object or array will * not be propagated unless "immutable" data patterns are used (i.e. all object * references from the root to the mutation were changed). * * Polymer also provides a proprietary data mutation and path notification API * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient * mutation and notification of deep changes in an object graph to all elements * bound to the same object graph. * * In cases where neither immutable patterns nor the data mutation API can be * used, applying this mixin will cause Polymer to skip dirty checking for * objects and arrays (always consider them to be "dirty"). This allows a * user to make a deep modification to a bound object graph, and then either * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath` * (e.g. `this.notifyPath('items')`) to update the tree. Note that all * elements that wish to be updated based on deep mutations must apply this * mixin or otherwise skip strict dirty checking for objects/arrays. * Specifically, any elements in the binding tree between the source of a * mutation and the consumption of it must apply this mixin or enable the * `Polymer.OptionalMutableData` mixin. * * In order to make the dirty check strategy configurable, see * `Polymer.OptionalMutableData`. * * Note, the performance characteristics of propagating large object graphs * will be worse as opposed to using strict dirty checking with immutable * patterns or Polymer's path notification API. * * @mixinFunction * @polymer * @memberof Polymer * @summary Element class mixin to skip strict dirty-checking for objects * and arrays */ Polymer.MutableData = Polymer.dedupingMixin(superClass => { /** * @polymer * @mixinClass * @implements {Polymer_MutableData} */ class MutableData extends superClass { /** * Overrides `Polymer.PropertyEffects` to provide option for skipping * strict equality checking for Objects and Arrays. * * This method pulls the value to dirty check against from the `__dataTemp` * cache (rather than the normal `__data` cache) for Objects. Since the temp * cache is cleared at the end of a turn, this implementation allows * side-effects of deep object changes to be processed by re-setting the * same object (using the temp cache as an in-turn backstop to prevent * cycles due to 2-way notification). * * @param {string} property Property name * @param {*} value New property value * @param {*} old Previous property value * @return {boolean} Whether the property should be considered a change * @protected */ _shouldPropertyChange(property, value, old) { return mutablePropertyChange(this, property, value, old, true); } } return MutableData; }); /** * Element class mixin to add the optional ability to skip strict * dirty-checking for objects and arrays (always consider them to be * "dirty") by setting a `mutable-data` attribute on an element instance. * * By default, `Polymer.PropertyEffects` performs strict dirty checking on * objects, which means that any deep modifications to an object or array will * not be propagated unless "immutable" data patterns are used (i.e. all object * references from the root to the mutation were changed). * * Polymer also provides a proprietary data mutation and path notification API * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient * mutation and notification of deep changes in an object graph to all elements * bound to the same object graph. * * In cases where neither immutable patterns nor the data mutation API can be * used, applying this mixin will allow Polymer to skip dirty checking for * objects and arrays (always consider them to be "dirty"). This allows a * user to make a deep modification to a bound object graph, and then either * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath` * (e.g. `this.notifyPath('items')`) to update the tree. Note that all * elements that wish to be updated based on deep mutations must apply this * mixin or otherwise skip strict dirty checking for objects/arrays. * Specifically, any elements in the binding tree between the source of a * mutation and the consumption of it must enable this mixin or apply the * `Polymer.MutableData` mixin. * * While this mixin adds the ability to forgo Object/Array dirty checking, * the `mutableData` flag defaults to false and must be set on the instance. * * Note, the performance characteristics of propagating large object graphs * will be worse by relying on `mutableData: true` as opposed to using * strict dirty checking with immutable patterns or Polymer's path notification * API. * * @mixinFunction * @polymer * @memberof Polymer * @summary Element class mixin to optionally skip strict dirty-checking * for objects and arrays */ Polymer.OptionalMutableData = Polymer.dedupingMixin(superClass => { /** * @mixinClass * @polymer * @implements {Polymer_OptionalMutableData} */ class OptionalMutableData extends superClass { static get properties() { return { /** * Instance-level flag for configuring the dirty-checking strategy * for this element. When true, Objects and Arrays will skip dirty * checking, otherwise strict equality checking will be used. */ mutableData: Boolean }; } /** * Overrides `Polymer.PropertyEffects` to provide option for skipping * strict equality checking for Objects and Arrays. * * When `this.mutableData` is true on this instance, this method * pulls the value to dirty check against from the `__dataTemp` cache * (rather than the normal `__data` cache) for Objects. Since the temp * cache is cleared at the end of a turn, this implementation allows * side-effects of deep object changes to be processed by re-setting the * same object (using the temp cache as an in-turn backstop to prevent * cycles due to 2-way notification). * * @param {string} property Property name * @param {*} value New property value * @param {*} old Previous property value * @return {boolean} Whether the property should be considered a change * @protected */ _shouldPropertyChange(property, value, old) { return mutablePropertyChange(this, property, value, old, this.mutableData); } } return OptionalMutableData; }); // Export for use by legacy behavior Polymer.MutableData._mutablePropertyChange = mutablePropertyChange; })(); </script> <script> (function() { 'use strict'; // Base class for HTMLTemplateElement extension that has property effects // machinery for propagating host properties to children. This is an ES5 // class only because Babel (incorrectly) requires super() in the class // constructor even though no `this` is used and it returns an instance. let newInstance = null; /** * @constructor * @extends {HTMLTemplateElement} * @private */ function HTMLTemplateElementExtension() { return newInstance; } HTMLTemplateElementExtension.prototype = Object.create(HTMLTemplateElement.prototype, { constructor: { value: HTMLTemplateElementExtension, writable: true } }); /** * @constructor * @implements {Polymer_PropertyEffects} * @extends {HTMLTemplateElementExtension} * @private */ const DataTemplate = Polymer.PropertyEffects(HTMLTemplateElementExtension); /** * @constructor * @implements {Polymer_MutableData} * @extends {DataTemplate} * @private */ const MutableDataTemplate = Polymer.MutableData(DataTemplate); // Applies a DataTemplate subclass to a <template> instance function upgradeTemplate(template, constructor) { newInstance = template; Object.setPrototypeOf(template, constructor.prototype); new constructor(); newInstance = null; } /** * Base class for TemplateInstance. * @constructor * @implements {Polymer_PropertyEffects} * @private */ const base = Polymer.PropertyEffects(class {}); /** * @polymer * @customElement * @appliesMixin Polymer.PropertyEffects * @unrestricted */ class TemplateInstanceBase extends base { constructor(props) { super(); this._configureProperties(props); this.root = this._stampTemplate(this.__dataHost); // Save list of stamped children let children = this.children = []; for (let n = this.root.firstChild; n; n=n.nextSibling) { children.push(n); n.__templatizeInstance = this; } if (this.__templatizeOwner && this.__templatizeOwner.__hideTemplateChildren__) { this._showHideChildren(true); } // Flush props only when props are passed if instance props exist // or when there isn't instance props. let options = this.__templatizeOptions; if ((props && options.instanceProps) || !options.instanceProps) { this._enableProperties(); } } /** * Configure the given `props` by calling `_setPendingProperty`. Also * sets any properties stored in `__hostProps`. * @private * @param {Object} props Object of property name-value pairs to set. * @return {void} */ _configureProperties(props) { let options = this.__templatizeOptions; if (options.forwardHostProp) { for (let hprop in this.__hostProps) { this._setPendingProperty(hprop, this.__dataHost['_host_' + hprop]); } } // Any instance props passed in the constructor will overwrite host props; // normally this would be a user error but we don't specifically filter them for (let iprop in props) { this._setPendingProperty(iprop, props[iprop]); } } /** * Forwards a host property to this instance. This method should be * called on instances from the `options.forwardHostProp` callback * to propagate changes of host properties to each instance. * * Note this method enqueues the change, which are flushed as a batch. * * @param {string} prop Property or path name * @param {*} value Value of the property to forward * @return {void} */ forwardHostProp(prop, value) { if (this._setPendingPropertyOrPath(prop, value, false, true)) { this.__dataHost._enqueueClient(this); } } /** * Override point for adding custom or simulated event handling. * * @param {!Node} node Node to add event listener to * @param {string} eventName Name of event * @param {function(!Event):void} handler Listener function to add * @return {void} */ _addEventListenerToNode(node, eventName, handler) { if (this._methodHost && this.__templatizeOptions.parentModel) { // If this instance should be considered a parent model, decorate // events this template instance as `model` this._methodHost._addEventListenerToNode(node, eventName, (e) => { e.model = this; handler(e); }); } else { // Otherwise delegate to the template's host (which could be) // another template instance let templateHost = this.__dataHost.__dataHost; if (templateHost) { templateHost._addEventListenerToNode(node, eventName, handler); } } } /** * Shows or hides the template instance top level child elements. For * text nodes, `textContent` is removed while "hidden" and replaced when * "shown." * @param {boolean} hide Set to true to hide the children; * set to false to show them. * @return {void} * @protected */ _showHideChildren(hide) { let c = this.children; for (let i=0; i<c.length; i++) { let n = c[i]; // Ignore non-changes if (Boolean(hide) != Boolean(n.__hideTemplateChildren__)) { if (n.nodeType === Node.TEXT_NODE) { if (hide) { n.__polymerTextContent__ = n.textContent; n.textContent = ''; } else { n.textContent = n.__polymerTextContent__; } // remove and replace slot } else if (n.localName === 'slot') { if (hide) { n.__polymerReplaced__ = document.createComment('hidden-slot'); n.parentNode.replaceChild(n.__polymerReplaced__, n); } else { const replace = n.__polymerReplaced__; if (replace) { replace.parentNode.replaceChild(n, replace); } } } else if (n.style) { if (hide) { n.__polymerDisplay__ = n.style.display; n.style.display = 'none'; } else { n.style.display = n.__polymerDisplay__; } } } n.__hideTemplateChildren__ = hide; if (n._showHideChildren) { n._showHideChildren(hide); } } } /** * Overrides default property-effects implementation to intercept * textContent bindings while children are "hidden" and cache in * private storage for later retrieval. * * @param {!Node} node The node to set a property on * @param {string} prop The property to set * @param {*} value The value to set * @return {void} * @protected */ _setUnmanagedPropertyToNode(node, prop, value) { if (node.__hideTemplateChildren__ && node.nodeType == Node.TEXT_NODE && prop == 'textContent') { node.__polymerTextContent__ = value; } else { super._setUnmanagedPropertyToNode(node, prop, value); } } /** * Find the parent model of this template instance. The parent model * is either another templatize instance that had option `parentModel: true`, * or else the host element. * * @return {!Polymer_PropertyEffects} The parent model of this instance */ get parentModel() { let model = this.__parentModel; if (!model) { let options; model = this; do { // A template instance's `__dataHost` is a <template> // `model.__dataHost.__dataHost` is the template's host model = model.__dataHost.__dataHost; } while ((options = model.__templatizeOptions) && !options.parentModel); this.__parentModel = model; } return model; } /** * Stub of HTMLElement's `dispatchEvent`, so that effects that may * dispatch events safely no-op. * * @param {Event} event Event to dispatch * @return {boolean} Always true. */ dispatchEvent(event) { // eslint-disable-line no-unused-vars return true; } } /** @type {!DataTemplate} */ TemplateInstanceBase.prototype.__dataHost; /** @type {!TemplatizeOptions} */ TemplateInstanceBase.prototype.__templatizeOptions; /** @type {!Polymer_PropertyEffects} */ TemplateInstanceBase.prototype._methodHost; /** @type {!Object} */ TemplateInstanceBase.prototype.__templatizeOwner; /** @type {!Object} */ TemplateInstanceBase.prototype.__hostProps; /** * @constructor * @extends {TemplateInstanceBase} * @implements {Polymer_MutableData} * @private */ const MutableTemplateInstanceBase = Polymer.MutableData(TemplateInstanceBase); function findMethodHost(template) { // Technically this should be the owner of the outermost template. // In shadow dom, this is always getRootNode().host, but we can // approximate this via cooperation with our dataHost always setting // `_methodHost` as long as there were bindings (or id's) on this // instance causing it to get a dataHost. let templateHost = template.__dataHost; return templateHost && templateHost._methodHost || templateHost; } /* eslint-disable valid-jsdoc */ /** * @suppress {missingProperties} class.prototype is not defined for some reason */ function createTemplatizerClass(template, templateInfo, options) { // Anonymous class created by the templatize let base = options.mutableData ? MutableTemplateInstanceBase : TemplateInstanceBase; // Affordance for global mixins onto TemplatizeInstance if (Polymer.Templatize.mixin) { base = Polymer.Templatize.mixin(base); } /** * @constructor * @extends {base} * @private */ let klass = class extends base { }; klass.prototype.__templatizeOptions = options; klass.prototype._bindTemplate(template); addNotifyEffects(klass, template, templateInfo, options); return klass; } /** * @suppress {missingProperties} class.prototype is not defined for some reason */ function addPropagateEffects(template, templateInfo, options) { let userForwardHostProp = options.forwardHostProp; if (userForwardHostProp) { // Provide data API and property effects on memoized template class let klass = templateInfo.templatizeTemplateClass; if (!klass) { let base = options.mutableData ? MutableDataTemplate : DataTemplate; /** @private */ klass = templateInfo.templatizeTemplateClass = class TemplatizedTemplate extends base {}; // Add template - >instances effects // and host <- template effects let hostProps = templateInfo.hostProps; for (let prop in hostProps) { klass.prototype._addPropertyEffect('_host_' + prop, klass.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE, {fn: createForwardHostPropEffect(prop, userForwardHostProp)}); klass.prototype._createNotifyingProperty('_host_' + prop); } } upgradeTemplate(template, klass); // Mix any pre-bound data into __data; no need to flush this to // instances since they pull from the template at instance-time if (template.__dataProto) { // Note, generally `__dataProto` could be chained, but it's guaranteed // to not be since this is a vanilla template we just added effects to Object.assign(template.__data, template.__dataProto); } // Clear any pending data for performance template.__dataTemp = {}; template.__dataPending = null; template.__dataOld = null; template._enableProperties(); } } /* eslint-enable valid-jsdoc */ function createForwardHostPropEffect(hostProp, userForwardHostProp) { return function forwardHostProp(template, prop, props) { userForwardHostProp.call(template.__templatizeOwner, prop.substring('_host_'.length), props[prop]); }; } function addNotifyEffects(klass, template, templateInfo, options) { let hostProps = templateInfo.hostProps || {}; for (let iprop in options.instanceProps) { delete hostProps[iprop]; let userNotifyInstanceProp = options.notifyInstanceProp; if (userNotifyInstanceProp) { klass.prototype._addPropertyEffect(iprop, klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY, {fn: createNotifyInstancePropEffect(iprop, userNotifyInstanceProp)}); } } if (options.forwardHostProp && template.__dataHost) { for (let hprop in hostProps) { klass.prototype._addPropertyEffect(hprop, klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY, {fn: createNotifyHostPropEffect()}); } } } function createNotifyInstancePropEffect(instProp, userNotifyInstanceProp) { return function notifyInstanceProp(inst, prop, props) { userNotifyInstanceProp.call(inst.__templatizeOwner, inst, prop, props[prop]); }; } function createNotifyHostPropEffect() { return function notifyHostProp(inst, prop, props) { inst.__dataHost._setPendingPropertyOrPath('_host_' + prop, props[prop], true, true); }; } /** * Module for preparing and stamping instances of templates that utilize * Polymer's data-binding and declarative event listener features. * * Example: * * // Get a template from somewhere, e.g. light DOM * let template = this.querySelector('template'); * // Prepare the template * let TemplateClass = Polymer.Templatize.templatize(template); * // Instance the template with an initial data model * let instance = new TemplateClass({myProp: 'initial'}); * // Insert the instance's DOM somewhere, e.g. element's shadow DOM * this.shadowRoot.appendChild(instance.root); * // Changing a property on the instance will propagate to bindings * // in the template * instance.myProp = 'new value'; * * The `options` dictionary passed to `templatize` allows for customizing * features of the generated template class, including how outer-scope host * properties should be forwarded into template instances, how any instance * properties added into the template's scope should be notified out to * the host, and whether the instance should be decorated as a "parent model" * of any event handlers. * * // Customize property forwarding and event model decoration * let TemplateClass = Polymer.Templatize.templatize(template, this, { * parentModel: true, * forwardHostProp(property, value) {...}, * instanceProps: {...}, * notifyInstanceProp(instance, property, value) {...}, * }); * * @namespace * @memberof Polymer * @summary Module for preparing and stamping instances of templates * utilizing Polymer templating features. */ Polymer.Templatize = { /** * Returns an anonymous `Polymer.PropertyEffects` class bound to the * `<template>` provided. Instancing the class will result in the * template being stamped into a document fragment stored as the instance's * `root` property, after which it can be appended to the DOM. * * Templates may utilize all Polymer data-binding features as well as * declarative event listeners. Event listeners and inline computing * functions in the template will be called on the host of the template. * * The constructor returned takes a single argument dictionary of initial * property values to propagate into template bindings. Additionally * host properties can be forwarded in, and instance properties can be * notified out by providing optional callbacks in the `options` dictionary. * * Valid configuration in `options` are as follows: * * - `forwardHostProp(property, value)`: Called when a property referenced * in the template changed on the template's host. As this library does * not retain references to templates instanced by the user, it is the * templatize owner's responsibility to forward host property changes into * user-stamped instances. The `instance.forwardHostProp(property, value)` * method on the generated class should be called to forward host * properties into the template to prevent unnecessary property-changed * notifications. Any properties referenced in the template that are not * defined in `instanceProps` will be notified up to the template's host * automatically. * - `instanceProps`: Dictionary of property names that will be added * to the instance by the templatize owner. These properties shadow any * host properties, and changes within the template to these properties * will result in `notifyInstanceProp` being called. * - `mutableData`: When `true`, the generated class will skip strict * dirty-checking for objects and arrays (always consider them to be * "dirty"). * - `notifyInstanceProp(instance, property, value)`: Called when * an instance property changes. Users may choose to call `notifyPath` * on e.g. the owner to notify the change. * - `parentModel`: When `true`, events handled by declarative event listeners * (`on-event="handler"`) will be decorated with a `model` property pointing * to the template instance that stamped it. It will also be returned * from `instance.parentModel` in cases where template instance nesting * causes an inner model to shadow an outer model. * * All callbacks are called bound to the `owner`. Any context * needed for the callbacks (such as references to `instances` stamped) * should be stored on the `owner` such that they can be retrieved via * `this`. * * When `options.forwardHostProp` is declared as an option, any properties * referenced in the template will be automatically forwarded from the host of * the `<template>` to instances, with the exception of any properties listed in * the `options.instanceProps` object. `instanceProps` are assumed to be * managed by the owner of the instances, either passed into the constructor * or set after the fact. Note, any properties passed into the constructor will * always be set to the instance (regardless of whether they would normally * be forwarded from the host). * * Note that `templatize()` can be run only once for a given `<template>`. * Further calls will result in an error. Also, there is a special * behavior if the template was duplicated through a mechanism such as * `<dom-repeat>` or `<test-fixture>`. In this case, all calls to * `templatize()` return the same class for all duplicates of a template. * The class returned from `templatize()` is generated only once using * the `options` from the first call. This means that any `options` * provided to subsequent calls will be ignored. Therefore, it is very * important not to close over any variables inside the callbacks. Also, * arrow functions must be avoided because they bind the outer `this`. * Inside the callbacks, any contextual information can be accessed * through `this`, which points to the `owner`. * * @memberof Polymer.Templatize * @param {!HTMLTemplateElement} template Template to templatize * @param {Polymer_PropertyEffects=} owner Owner of the template instances; * any optional callbacks will be bound to this owner. * @param {Object=} options Options dictionary (see summary for details) * @return {function(new:TemplateInstanceBase)} Generated class bound to the template * provided * @suppress {invalidCasts} */ templatize(template, owner, options) { // Under strictTemplatePolicy, the templatized element must be owned // by a (trusted) Polymer element, indicated by existence of _methodHost; // e.g. for dom-if & dom-repeat in main document, _methodHost is null if (Polymer.strictTemplatePolicy && !findMethodHost(template)) { throw new Error('strictTemplatePolicy: template owner not trusted'); } options = /** @type {!TemplatizeOptions} */(options || {}); if (template.__templatizeOwner) { throw new Error('A <template> can only be templatized once'); } template.__templatizeOwner = owner; const ctor = owner ? owner.constructor : TemplateInstanceBase; let templateInfo = ctor._parseTemplate(template); // Get memoized base class for the prototypical template, which // includes property effects for binding template & forwarding let baseClass = templateInfo.templatizeInstanceClass; if (!baseClass) { baseClass = createTemplatizerClass(template, templateInfo, options); templateInfo.templatizeInstanceClass = baseClass; } // Host property forwarding must be installed onto template instance addPropagateEffects(template, templateInfo, options); // Subclass base class and add reference for this specific template /** @private */ let klass = class TemplateInstance extends baseClass {}; klass.prototype._methodHost = findMethodHost(template); klass.prototype.__dataHost = template; klass.prototype.__templatizeOwner = owner; klass.prototype.__hostProps = templateInfo.hostProps; klass = /** @type {function(new:TemplateInstanceBase)} */(klass); //eslint-disable-line no-self-assign return klass; }, /** * Returns the template "model" associated with a given element, which * serves as the binding scope for the template instance the element is * contained in. A template model is an instance of * `TemplateInstanceBase`, and should be used to manipulate data * associated with this template instance. * * Example: * * let model = modelForElement(el); * if (model.index < 10) { * model.set('item.checked', true); * } * * @memberof Polymer.Templatize * @param {HTMLTemplateElement} template The model will be returned for * elements stamped from this template * @param {Node=} node Node for which to return a template model. * @return {TemplateInstanceBase} Template instance representing the * binding scope for the element */ modelForElement(template, node) { let model; while (node) { // An element with a __templatizeInstance marks the top boundary // of a scope; walk up until we find one, and then ensure that // its __dataHost matches `this`, meaning this dom-repeat stamped it if ((model = node.__templatizeInstance)) { // Found an element stamped by another template; keep walking up // from its __dataHost if (model.__dataHost != template) { node = model.__dataHost; } else { return model; } } else { // Still in a template scope, keep going up until // a __templatizeInstance is found node = node.parentNode; } } return null; } }; Polymer.TemplateInstanceBase = TemplateInstanceBase; })(); </script> <script> (function() { 'use strict'; let TemplateInstanceBase = Polymer.TemplateInstanceBase; // eslint-disable-line /** * @typedef {{ * _templatizerTemplate: HTMLTemplateElement, * _parentModel: boolean, * _instanceProps: Object, * _forwardHostPropV2: Function, * _notifyInstancePropV2: Function, * ctor: TemplateInstanceBase * }} */ let TemplatizerUser; // eslint-disable-line /** * The `Polymer.Templatizer` behavior adds methods to generate instances of * templates that are each managed by an anonymous `Polymer.PropertyEffects` * instance where data-bindings in the stamped template content are bound to * accessors on itself. * * This behavior is provided in Polymer 2.x as a hybrid-element convenience * only. For non-hybrid usage, the `Polymer.Templatize` library * should be used instead. * * Example: * * // Get a template from somewhere, e.g. light DOM * let template = this.querySelector('template'); * // Prepare the template * this.templatize(template); * // Instance the template with an initial data model * let instance = this.stamp({myProp: 'initial'}); * // Insert the instance's DOM somewhere, e.g. light DOM * Polymer.dom(this).appendChild(instance.root); * // Changing a property on the instance will propagate to bindings * // in the template * instance.myProp = 'new value'; * * Users of `Templatizer` may need to implement the following abstract * API's to determine how properties and paths from the host should be * forwarded into to instances: * * _forwardHostPropV2: function(prop, value) * * Likewise, users may implement these additional abstract API's to determine * how instance-specific properties that change on the instance should be * forwarded out to the host, if necessary. * * _notifyInstancePropV2: function(inst, prop, value) * * In order to determine which properties are instance-specific and require * custom notification via `_notifyInstanceProp`, define an `_instanceProps` * object containing keys for each instance prop, for example: * * _instanceProps: { * item: true, * index: true * } * * Any properties used in the template that are not defined in _instanceProp * will be forwarded out to the Templatize `owner` automatically. * * Users may also implement the following abstract function to show or * hide any DOM generated using `stamp`: * * _showHideChildren: function(shouldHide) * * Note that some callbacks are suffixed with `V2` in the Polymer 2.x behavior * as the implementations will need to differ from the callbacks required * by the 1.x Templatizer API due to changes in the `TemplateInstance` API * between versions 1.x and 2.x. * * @polymerBehavior */ Polymer.Templatizer = { /** * Generates an anonymous `TemplateInstance` class (stored as `this.ctor`) * for the provided template. This method should be called once per * template to prepare an element for stamping the template, followed * by `stamp` to create new instances of the template. * * @param {!HTMLTemplateElement} template Template to prepare * @param {boolean=} mutableData When `true`, the generated class will skip * strict dirty-checking for objects and arrays (always consider them to * be "dirty"). Defaults to false. * @return {void} * @this {TemplatizerUser} */ templatize(template, mutableData) { this._templatizerTemplate = template; this.ctor = Polymer.Templatize.templatize(template, this, { mutableData: Boolean(mutableData), parentModel: this._parentModel, instanceProps: this._instanceProps, forwardHostProp: this._forwardHostPropV2, notifyInstanceProp: this._notifyInstancePropV2 }); }, /** * Creates an instance of the template prepared by `templatize`. The object * returned is an instance of the anonymous class generated by `templatize` * whose `root` property is a document fragment containing newly cloned * template content, and which has property accessors corresponding to * properties referenced in template bindings. * * @param {Object=} model Object containing initial property values to * populate into the template bindings. * @return {TemplateInstanceBase} Returns the created instance of * the template prepared by `templatize`. * @this {TemplatizerUser} */ stamp(model) { return new this.ctor(model); }, /** * Returns the template "model" (`TemplateInstance`) associated with * a given element, which serves as the binding scope for the template * instance the element is contained in. A template model should be used * to manipulate data associated with this template instance. * * @param {HTMLElement} el Element for which to return a template model. * @return {TemplateInstanceBase} Model representing the binding scope for * the element. * @this {TemplatizerUser} */ modelForElement(el) { return Polymer.Templatize.modelForElement(this._templatizerTemplate, el); } }; })(); </script> <script> (function() { 'use strict'; /** * @constructor * @extends {HTMLElement} * @implements {Polymer_PropertyEffects} * @implements {Polymer_OptionalMutableData} * @implements {Polymer_GestureEventListeners} * @private */ const domBindBase = Polymer.GestureEventListeners( Polymer.OptionalMutableData( Polymer.PropertyEffects(HTMLElement))); /** * Custom element to allow using Polymer's template features (data binding, * declarative event listeners, etc.) in the main document without defining * a new custom element. * * `<template>` tags utilizing bindings may be wrapped with the `<dom-bind>` * element, which will immediately stamp the wrapped template into the main * document and bind elements to the `dom-bind` element itself as the * binding scope. * * @polymer * @customElement * @appliesMixin Polymer.PropertyEffects * @appliesMixin Polymer.OptionalMutableData * @appliesMixin Polymer.GestureEventListeners * @extends {domBindBase} * @memberof Polymer * @summary Custom element to allow using Polymer's template features (data * binding, declarative event listeners, etc.) in the main document. */ class DomBind extends domBindBase { static get observedAttributes() { return ['mutable-data']; } constructor() { super(); if (Polymer.strictTemplatePolicy) { throw new Error(`strictTemplatePolicy: dom-bind not allowed`); } this.root = null; this.$ = null; this.__children = null; } /** @return {void} */ attributeChangedCallback() { // assumes only one observed attribute this.mutableData = true; } /** @return {void} */ connectedCallback() { this.style.display = 'none'; this.render(); } /** @return {void} */ disconnectedCallback() { this.__removeChildren(); } __insertChildren() { this.parentNode.insertBefore(this.root, this); } __removeChildren() { if (this.__children) { for (let i=0; i<this.__children.length; i++) { this.root.appendChild(this.__children[i]); } } } /** * Forces the element to render its content. This is typically only * necessary to call if HTMLImports with the async attribute are used. * @return {void} */ render() { let template; if (!this.__children) { template = /** @type {HTMLTemplateElement} */(template || this.querySelector('template')); if (!template) { // Wait until childList changes and template should be there by then let observer = new MutationObserver(() => { template = /** @type {HTMLTemplateElement} */(this.querySelector('template')); if (template) { observer.disconnect(); this.render(); } else { throw new Error('dom-bind requires a <template> child'); } }); observer.observe(this, {childList: true}); return; } this.root = this._stampTemplate(template); this.$ = this.root.$; this.__children = []; for (let n=this.root.firstChild; n; n=n.nextSibling) { this.__children[this.__children.length] = n; } this._enableProperties(); } this.__insertChildren(); this.dispatchEvent(new CustomEvent('dom-change', { bubbles: true, composed: true })); } } customElements.define('dom-bind', DomBind); /** @const */ Polymer.DomBind = DomBind; })(); </script> <script> (function() { 'use strict'; /** * Class representing a static string value which can be used to filter * strings by asseting that they have been created via this class. The * `value` property returns the string passed to the constructor. */ class LiteralString { constructor(string) { /** @type {string} */ this.value = string.toString(); } /** * @return {string} LiteralString string value */ toString() { return this.value; } } /** * @param {*} value Object to stringify into HTML * @return {string} HTML stringified form of `obj` */ function literalValue(value) { if (value instanceof LiteralString) { return /** @type {!LiteralString} */(value).value; } else { throw new Error(`non-literal value passed to Polymer.htmlLiteral: ${value}`); } } /** * @param {*} value Object to stringify into HTML * @return {string} HTML stringified form of `obj` */ function htmlValue(value) { if (value instanceof HTMLTemplateElement) { return /** @type {!HTMLTemplateElement } */(value).innerHTML; } else if (value instanceof LiteralString) { return literalValue(value); } else { throw new Error(`non-template value passed to Polymer.html: ${value}`); } } /** * A template literal tag that creates an HTML <template> element from the * contents of the string. * * This allows you to write a Polymer Template in JavaScript. * * Templates can be composed by interpolating `HTMLTemplateElement`s in * expressions in the JavaScript template literal. The nested template's * `innerHTML` is included in the containing template. The only other * values allowed in expressions are those returned from `Polymer.htmlLiteral` * which ensures only literal values from JS source ever reach the HTML, to * guard against XSS risks. * * All other values are disallowed in expressions to help prevent XSS * attacks; however, `Polymer.htmlLiteral` can be used to compose static * string values into templates. This is useful to compose strings into * places that do not accept html, like the css text of a `style` * element. * * Example: * * static get template() { * return Polymer.html` * <style>:host{ content:"..." }</style> * <div class="shadowed">${this.partialTemplate}</div> * ${super.template} * `; * } * static get partialTemplate() { return Polymer.html`<span>Partial!</span>`; } * * @memberof Polymer * @param {!ITemplateArray} strings Constant parts of tagged template literal * @param {...*} values Variable parts of tagged template literal * @return {!HTMLTemplateElement} Constructed HTMLTemplateElement */ Polymer.html = function html(strings, ...values) { const template = /** @type {!HTMLTemplateElement} */(document.createElement('template')); template.innerHTML = values.reduce((acc, v, idx) => acc + htmlValue(v) + strings[idx + 1], strings[0]); return template; }; /** * An html literal tag that can be used with `Polymer.html` to compose. * a literal string. * * Example: * * static get template() { * return Polymer.html` * <style> * :host { display: block; } * ${styleTemplate} * </style> * <div class="shadowed">${staticValue}</div> * ${super.template} * `; * } * static get styleTemplate() { return Polymer.htmlLiteral`.shadowed { background: gray; }`; } * * @memberof Polymer * @param {!ITemplateArray} strings Constant parts of tagged template literal * @param {...*} values Variable parts of tagged template literal * @return {!LiteralString} Constructed literal string */ Polymer.htmlLiteral = function(strings, ...values) { return new LiteralString(values.reduce((acc, v, idx) => acc + literalValue(v) + strings[idx + 1], strings[0])); }; })(); </script> <script> (function() { 'use strict'; /** * Base class that provides the core API for Polymer's meta-programming * features including template stamping, data-binding, attribute deserialization, * and property change observation. * * @customElement * @memberof Polymer * @constructor * @implements {Polymer_ElementMixin} * @extends {HTMLElement} * @appliesMixin Polymer.ElementMixin * @summary Custom element base class that provides the core API for Polymer's * key meta-programming features including template stamping, data-binding, * attribute deserialization, and property change observation */ Polymer.Element = Polymer.ElementMixin(HTMLElement); // NOTE: this is here for modulizer to export `html` for the module version of this file Polymer.html = Polymer.html; })(); </script> <script> (function() { 'use strict'; let TemplateInstanceBase = Polymer.TemplateInstanceBase; // eslint-disable-line /** * @constructor * @implements {Polymer_OptionalMutableData} * @extends {Polymer.Element} * @private */ const domRepeatBase = Polymer.OptionalMutableData(Polymer.Element); /** * The `<dom-repeat>` element will automatically stamp and binds one instance * of template content to each object in a user-provided array. * `dom-repeat` accepts an `items` property, and one instance of the template * is stamped for each item into the DOM at the location of the `dom-repeat` * element. The `item` property will be set on each instance's binding * scope, thus templates should bind to sub-properties of `item`. * * Example: * * ```html * <dom-module id="employee-list"> * * <template> * * <div> Employee list: </div> * <dom-repeat items="{{employees}}"> * <template> * <div>First name: <span>{{item.first}}</span></div> * <div>Last name: <span>{{item.last}}</span></div> * </template> * </dom-repeat> * * </template> * * </dom-module> * ``` * * With the following custom element definition: * * ```js * class EmployeeList extends Polymer.Element { * static get is() { return 'employee-list'; } * static get properties() { * return { * employees: { * value() { * return [ * {first: 'Bob', last: 'Smith'}, * {first: 'Sally', last: 'Johnson'}, * ... * ]; * } * } * }; * } * } * ``` * * Notifications for changes to items sub-properties will be forwarded to template * instances, which will update via the normal structured data notification system. * * Mutations to the `items` array itself should be made using the Array * mutation API's on `Polymer.Base` (`push`, `pop`, `splice`, `shift`, * `unshift`), and template instances will be kept in sync with the data in the * array. * * Events caught by event handlers within the `dom-repeat` template will be * decorated with a `model` property, which represents the binding scope for * each template instance. The model is an instance of Polymer.Base, and should * be used to manipulate data on the instance, for example * `event.model.set('item.checked', true);`. * * Alternatively, the model for a template instance for an element stamped by * a `dom-repeat` can be obtained using the `modelForElement` API on the * `dom-repeat` that stamped it, for example * `this.$.domRepeat.modelForElement(event.target).set('item.checked', true);`. * This may be useful for manipulating instance data of event targets obtained * by event handlers on parents of the `dom-repeat` (event delegation). * * A view-specific filter/sort may be applied to each `dom-repeat` by supplying a * `filter` and/or `sort` property. This may be a string that names a function on * the host, or a function may be assigned to the property directly. The functions * should implemented following the standard `Array` filter/sort API. * * In order to re-run the filter or sort functions based on changes to sub-fields * of `items`, the `observe` property may be set as a space-separated list of * `item` sub-fields that should cause a re-filter/sort when modified. If * the filter or sort function depends on properties not contained in `items`, * the user should observe changes to those properties and call `render` to update * the view based on the dependency change. * * For example, for an `dom-repeat` with a filter of the following: * * ```js * isEngineer(item) { * return item.type == 'engineer' || item.manager.type == 'engineer'; * } * ``` * * Then the `observe` property should be configured as follows: * * ```html * <dom-repeat items="{{employees}}" filter="isEngineer" observe="type manager.type"> * ``` * * @customElement * @polymer * @memberof Polymer * @extends {domRepeatBase} * @appliesMixin Polymer.OptionalMutableData * @summary Custom element for stamping instance of a template bound to * items in an array. */ class DomRepeat extends domRepeatBase { // Not needed to find template; can be removed once the analyzer // can find the tag name from customElements.define call static get is() { return 'dom-repeat'; } static get template() { return null; } static get properties() { /** * Fired whenever DOM is added or removed by this template (by * default, rendering occurs lazily). To force immediate rendering, call * `render`. * * @event dom-change */ return { /** * An array containing items determining how many instances of the template * to stamp and that that each template instance should bind to. */ items: { type: Array }, /** * The name of the variable to add to the binding scope for the array * element associated with a given template instance. */ as: { type: String, value: 'item' }, /** * The name of the variable to add to the binding scope with the index * of the instance in the sorted and filtered list of rendered items. * Note, for the index in the `this.items` array, use the value of the * `itemsIndexAs` property. */ indexAs: { type: String, value: 'index' }, /** * The name of the variable to add to the binding scope with the index * of the instance in the `this.items` array. Note, for the index of * this instance in the sorted and filtered list of rendered items, * use the value of the `indexAs` property. */ itemsIndexAs: { type: String, value: 'itemsIndex' }, /** * A function that should determine the sort order of the items. This * property should either be provided as a string, indicating a method * name on the element's host, or else be an actual function. The * function should match the sort function passed to `Array.sort`. * Using a sort function has no effect on the underlying `items` array. */ sort: { type: Function, observer: '__sortChanged' }, /** * A function that can be used to filter items out of the view. This * property should either be provided as a string, indicating a method * name on the element's host, or else be an actual function. The * function should match the sort function passed to `Array.filter`. * Using a filter function has no effect on the underlying `items` array. */ filter: { type: Function, observer: '__filterChanged' }, /** * When using a `filter` or `sort` function, the `observe` property * should be set to a space-separated list of the names of item * sub-fields that should trigger a re-sort or re-filter when changed. * These should generally be fields of `item` that the sort or filter * function depends on. */ observe: { type: String, observer: '__observeChanged' }, /** * When using a `filter` or `sort` function, the `delay` property * determines a debounce time in ms after a change to observed item * properties that must pass before the filter or sort is re-run. * This is useful in rate-limiting shuffling of the view when * item changes may be frequent. */ delay: Number, /** * Count of currently rendered items after `filter` (if any) has been applied. * If "chunking mode" is enabled, `renderedItemCount` is updated each time a * set of template instances is rendered. * */ renderedItemCount: { type: Number, notify: true, readOnly: true }, /** * Defines an initial count of template instances to render after setting * the `items` array, before the next paint, and puts the `dom-repeat` * into "chunking mode". The remaining items will be created and rendered * incrementally at each animation frame therof until all instances have * been rendered. */ initialCount: { type: Number, observer: '__initializeChunking' }, /** * When `initialCount` is used, this property defines a frame rate (in * fps) to target by throttling the number of instances rendered each * frame to not exceed the budget for the target frame rate. The * framerate is effectively the number of `requestAnimationFrame`s that * it tries to allow to actually fire in a given second. It does this * by measuring the time between `rAF`s and continuously adjusting the * number of items created each `rAF` to maintain the target framerate. * Setting this to a higher number allows lower latency and higher * throughput for event handlers and other tasks, but results in a * longer time for the remaining items to complete rendering. */ targetFramerate: { type: Number, value: 20 }, _targetFrameTime: { type: Number, computed: '__computeFrameTime(targetFramerate)' } }; } static get observers() { return [ '__itemsChanged(items.*)' ]; } constructor() { super(); this.__instances = []; this.__limit = Infinity; this.__pool = []; this.__renderDebouncer = null; this.__itemsIdxToInstIdx = {}; this.__chunkCount = null; this.__lastChunkTime = null; this.__sortFn = null; this.__filterFn = null; this.__observePaths = null; this.__ctor = null; this.__isDetached = true; this.template = null; } /** * @return {void} */ disconnectedCallback() { super.disconnectedCallback(); this.__isDetached = true; for (let i=0; i<this.__instances.length; i++) { this.__detachInstance(i); } } /** * @return {void} */ connectedCallback() { super.connectedCallback(); this.style.display = 'none'; // only perform attachment if the element was previously detached. if (this.__isDetached) { this.__isDetached = false; let parent = this.parentNode; for (let i=0; i<this.__instances.length; i++) { this.__attachInstance(i, parent); } } } __ensureTemplatized() { // Templatizing (generating the instance constructor) needs to wait // until ready, since won't have its template content handed back to // it until then if (!this.__ctor) { let template = this.template = /** @type {HTMLTemplateElement} */(this.querySelector('template')); if (!template) { // // Wait until childList changes and template should be there by then let observer = new MutationObserver(() => { if (this.querySelector('template')) { observer.disconnect(); this.__render(); } else { throw new Error('dom-repeat requires a <template> child'); } }); observer.observe(this, {childList: true}); return false; } // Template instance props that should be excluded from forwarding let instanceProps = {}; instanceProps[this.as] = true; instanceProps[this.indexAs] = true; instanceProps[this.itemsIndexAs] = true; this.__ctor = Polymer.Templatize.templatize(template, this, { mutableData: this.mutableData, parentModel: true, instanceProps: instanceProps, /** * @this {this} * @param {string} prop Property to set * @param {*} value Value to set property to */ forwardHostProp: function(prop, value) { let i$ = this.__instances; for (let i=0, inst; (i<i$.length) && (inst=i$[i]); i++) { inst.forwardHostProp(prop, value); } }, /** * @this {this} * @param {Object} inst Instance to notify * @param {string} prop Property to notify * @param {*} value Value to notify */ notifyInstanceProp: function(inst, prop, value) { if (Polymer.Path.matches(this.as, prop)) { let idx = inst[this.itemsIndexAs]; if (prop == this.as) { this.items[idx] = value; } let path = Polymer.Path.translate(this.as, 'items.' + idx, prop); this.notifyPath(path, value); } } }); } return true; } __getMethodHost() { // Technically this should be the owner of the outermost template. // In shadow dom, this is always getRootNode().host, but we can // approximate this via cooperation with our dataHost always setting // `_methodHost` as long as there were bindings (or id's) on this // instance causing it to get a dataHost. return this.__dataHost._methodHost || this.__dataHost; } __functionFromPropertyValue(functionOrMethodName) { if (typeof functionOrMethodName === 'string') { let methodName = functionOrMethodName; let obj = this.__getMethodHost(); return function() { return obj[methodName].apply(obj, arguments); }; } return functionOrMethodName; } __sortChanged(sort) { this.__sortFn = this.__functionFromPropertyValue(sort); if (this.items) { this.__debounceRender(this.__render); } } __filterChanged(filter) { this.__filterFn = this.__functionFromPropertyValue(filter); if (this.items) { this.__debounceRender(this.__render); } } __computeFrameTime(rate) { return Math.ceil(1000/rate); } __initializeChunking() { if (this.initialCount) { this.__limit = this.initialCount; this.__chunkCount = this.initialCount; this.__lastChunkTime = performance.now(); } } __tryRenderChunk() { // Debounced so that multiple calls through `_render` between animation // frames only queue one new rAF (e.g. array mutation & chunked render) if (this.items && this.__limit < this.items.length) { this.__debounceRender(this.__requestRenderChunk); } } __requestRenderChunk() { requestAnimationFrame(()=>this.__renderChunk()); } __renderChunk() { // Simple auto chunkSize throttling algorithm based on feedback loop: // measure actual time between frames and scale chunk count by ratio // of target/actual frame time let currChunkTime = performance.now(); let ratio = this._targetFrameTime / (currChunkTime - this.__lastChunkTime); this.__chunkCount = Math.round(this.__chunkCount * ratio) || 1; this.__limit += this.__chunkCount; this.__lastChunkTime = currChunkTime; this.__debounceRender(this.__render); } __observeChanged() { this.__observePaths = this.observe && this.observe.replace('.*', '.').split(' '); } __itemsChanged(change) { if (this.items && !Array.isArray(this.items)) { console.warn('dom-repeat expected array for `items`, found', this.items); } // If path was to an item (e.g. 'items.3' or 'items.3.foo'), forward the // path to that instance synchronously (returns false for non-item paths) if (!this.__handleItemPath(change.path, change.value)) { // Otherwise, the array was reset ('items') or spliced ('items.splices'), // so queue a full refresh this.__initializeChunking(); this.__debounceRender(this.__render); } } __handleObservedPaths(path) { // Handle cases where path changes should cause a re-sort/filter if (this.__sortFn || this.__filterFn) { if (!path) { // Always re-render if the item itself changed this.__debounceRender(this.__render, this.delay); } else if (this.__observePaths) { // Otherwise, re-render if the path changed matches an observed path let paths = this.__observePaths; for (let i=0; i<paths.length; i++) { if (path.indexOf(paths[i]) === 0) { this.__debounceRender(this.__render, this.delay); } } } } } /** * @param {function(this:DomRepeat)} fn Function to debounce. * @param {number=} delay Delay in ms to debounce by. */ __debounceRender(fn, delay = 0) { this.__renderDebouncer = Polymer.Debouncer.debounce( this.__renderDebouncer , delay > 0 ? Polymer.Async.timeOut.after(delay) : Polymer.Async.microTask , fn.bind(this)); Polymer.enqueueDebouncer(this.__renderDebouncer); } /** * Forces the element to render its content. Normally rendering is * asynchronous to a provoking change. This is done for efficiency so * that multiple changes trigger only a single render. The render method * should be called if, for example, template rendering is required to * validate application state. * @return {void} */ render() { // Queue this repeater, then flush all in order this.__debounceRender(this.__render); Polymer.flush(); } __render() { if (!this.__ensureTemplatized()) { // No template found yet return; } this.__applyFullRefresh(); // Reset the pool // TODO(kschaaf): Reuse pool across turns and nested templates // Now that objects/arrays are re-evaluated when set, we can safely // reuse pooled instances across turns, however we still need to decide // semantics regarding how long to hold, how many to hold, etc. this.__pool.length = 0; // Set rendered item count this._setRenderedItemCount(this.__instances.length); // Notify users this.dispatchEvent(new CustomEvent('dom-change', { bubbles: true, composed: true })); // Check to see if we need to render more items this.__tryRenderChunk(); } __applyFullRefresh() { let items = this.items || []; let isntIdxToItemsIdx = new Array(items.length); for (let i=0; i<items.length; i++) { isntIdxToItemsIdx[i] = i; } // Apply user filter if (this.__filterFn) { isntIdxToItemsIdx = isntIdxToItemsIdx.filter((i, idx, array) => this.__filterFn(items[i], idx, array)); } // Apply user sort if (this.__sortFn) { isntIdxToItemsIdx.sort((a, b) => this.__sortFn(items[a], items[b])); } // items->inst map kept for item path forwarding const itemsIdxToInstIdx = this.__itemsIdxToInstIdx = {}; let instIdx = 0; // Generate instances and assign items const limit = Math.min(isntIdxToItemsIdx.length, this.__limit); for (; instIdx<limit; instIdx++) { let inst = this.__instances[instIdx]; let itemIdx = isntIdxToItemsIdx[instIdx]; let item = items[itemIdx]; itemsIdxToInstIdx[itemIdx] = instIdx; if (inst) { inst._setPendingProperty(this.as, item); inst._setPendingProperty(this.indexAs, instIdx); inst._setPendingProperty(this.itemsIndexAs, itemIdx); inst._flushProperties(); } else { this.__insertInstance(item, instIdx, itemIdx); } } // Remove any extra instances from previous state for (let i=this.__instances.length-1; i>=instIdx; i--) { this.__detachAndRemoveInstance(i); } } __detachInstance(idx) { let inst = this.__instances[idx]; for (let i=0; i<inst.children.length; i++) { let el = inst.children[i]; inst.root.appendChild(el); } return inst; } __attachInstance(idx, parent) { let inst = this.__instances[idx]; parent.insertBefore(inst.root, this); } __detachAndRemoveInstance(idx) { let inst = this.__detachInstance(idx); if (inst) { this.__pool.push(inst); } this.__instances.splice(idx, 1); } __stampInstance(item, instIdx, itemIdx) { let model = {}; model[this.as] = item; model[this.indexAs] = instIdx; model[this.itemsIndexAs] = itemIdx; return new this.__ctor(model); } __insertInstance(item, instIdx, itemIdx) { let inst = this.__pool.pop(); if (inst) { // TODO(kschaaf): If the pool is shared across turns, hostProps // need to be re-set to reused instances in addition to item inst._setPendingProperty(this.as, item); inst._setPendingProperty(this.indexAs, instIdx); inst._setPendingProperty(this.itemsIndexAs, itemIdx); inst._flushProperties(); } else { inst = this.__stampInstance(item, instIdx, itemIdx); } let beforeRow = this.__instances[instIdx + 1]; let beforeNode = beforeRow ? beforeRow.children[0] : this; this.parentNode.insertBefore(inst.root, beforeNode); this.__instances[instIdx] = inst; return inst; } // Implements extension point from Templatize mixin /** * Shows or hides the template instance top level child elements. For * text nodes, `textContent` is removed while "hidden" and replaced when * "shown." * @param {boolean} hidden Set to true to hide the children; * set to false to show them. * @return {void} * @protected */ _showHideChildren(hidden) { for (let i=0; i<this.__instances.length; i++) { this.__instances[i]._showHideChildren(hidden); } } // Called as a side effect of a host items.<key>.<path> path change, // responsible for notifying item.<path> changes to inst for key __handleItemPath(path, value) { let itemsPath = path.slice(6); // 'items.'.length == 6 let dot = itemsPath.indexOf('.'); let itemsIdx = dot < 0 ? itemsPath : itemsPath.substring(0, dot); // If path was index into array... if (itemsIdx == parseInt(itemsIdx, 10)) { let itemSubPath = dot < 0 ? '' : itemsPath.substring(dot+1); // If the path is observed, it will trigger a full refresh this.__handleObservedPaths(itemSubPath); // Note, even if a rull refresh is triggered, always do the path // notification because unless mutableData is used for dom-repeat // and all elements in the instance subtree, a full refresh may // not trigger the proper update. let instIdx = this.__itemsIdxToInstIdx[itemsIdx]; let inst = this.__instances[instIdx]; if (inst) { let itemPath = this.as + (itemSubPath ? '.' + itemSubPath : ''); // This is effectively `notifyPath`, but avoids some of the overhead // of the public API inst._setPendingPropertyOrPath(itemPath, value, false, true); inst._flushProperties(); } return true; } } /** * Returns the item associated with a given element stamped by * this `dom-repeat`. * * Note, to modify sub-properties of the item, * `modelForElement(el).set('item.<sub-prop>', value)` * should be used. * * @param {!HTMLElement} el Element for which to return the item. * @return {*} Item associated with the element. */ itemForElement(el) { let instance = this.modelForElement(el); return instance && instance[this.as]; } /** * Returns the inst index for a given element stamped by this `dom-repeat`. * If `sort` is provided, the index will reflect the sorted order (rather * than the original array order). * * @param {!HTMLElement} el Element for which to return the index. * @return {?number} Row index associated with the element (note this may * not correspond to the array index if a user `sort` is applied). */ indexForElement(el) { let instance = this.modelForElement(el); return instance && instance[this.indexAs]; } /** * Returns the template "model" associated with a given element, which * serves as the binding scope for the template instance the element is * contained in. A template model is an instance of `Polymer.Base`, and * should be used to manipulate data associated with this template instance. * * Example: * * let model = modelForElement(el); * if (model.index < 10) { * model.set('item.checked', true); * } * * @param {!HTMLElement} el Element for which to return a template model. * @return {TemplateInstanceBase} Model representing the binding scope for * the element. */ modelForElement(el) { return Polymer.Templatize.modelForElement(this.template, el); } } customElements.define(DomRepeat.is, DomRepeat); /** @const */ Polymer.DomRepeat = DomRepeat; })(); </script> <script> (function() { 'use strict'; /** * The `<dom-if>` element will stamp a light-dom `<template>` child when * the `if` property becomes truthy, and the template can use Polymer * data-binding and declarative event features when used in the context of * a Polymer element's template. * * When `if` becomes falsy, the stamped content is hidden but not * removed from dom. When `if` subsequently becomes truthy again, the content * is simply re-shown. This approach is used due to its favorable performance * characteristics: the expense of creating template content is paid only * once and lazily. * * Set the `restamp` property to true to force the stamped content to be * created / destroyed when the `if` condition changes. * * @customElement * @polymer * @extends Polymer.Element * @memberof Polymer * @summary Custom element that conditionally stamps and hides or removes * template content based on a boolean flag. */ class DomIf extends Polymer.Element { // Not needed to find template; can be removed once the analyzer // can find the tag name from customElements.define call static get is() { return 'dom-if'; } static get template() { return null; } static get properties() { return { /** * Fired whenever DOM is added or removed/hidden by this template (by * default, rendering occurs lazily). To force immediate rendering, call * `render`. * * @event dom-change */ /** * A boolean indicating whether this template should stamp. */ if: { type: Boolean, observer: '__debounceRender' }, /** * When true, elements will be removed from DOM and discarded when `if` * becomes false and re-created and added back to the DOM when `if` * becomes true. By default, stamped elements will be hidden but left * in the DOM when `if` becomes false, which is generally results * in better performance. */ restamp: { type: Boolean, observer: '__debounceRender' } }; } constructor() { super(); this.__renderDebouncer = null; this.__invalidProps = null; this.__instance = null; this._lastIf = false; this.__ctor = null; } __debounceRender() { // Render is async for 2 reasons: // 1. To eliminate dom creation trashing if user code thrashes `if` in the // same turn. This was more common in 1.x where a compound computed // property could result in the result changing multiple times, but is // mitigated to a large extent by batched property processing in 2.x. // 2. To avoid double object propagation when a bag including values bound // to the `if` property as well as one or more hostProps could enqueue // the <dom-if> to flush before the <template>'s host property // forwarding. In that scenario creating an instance would result in // the host props being set once, and then the enqueued changes on the // template would set properties a second time, potentially causing an // object to be set to an instance more than once. Creating the // instance async from flushing data ensures this doesn't happen. If // we wanted a sync option in the future, simply having <dom-if> flush // (or clear) its template's pending host properties before creating // the instance would also avoid the problem. this.__renderDebouncer = Polymer.Debouncer.debounce( this.__renderDebouncer , Polymer.Async.microTask , () => this.__render()); Polymer.enqueueDebouncer(this.__renderDebouncer); } /** * @return {void} */ disconnectedCallback() { super.disconnectedCallback(); if (!this.parentNode || (this.parentNode.nodeType == Node.DOCUMENT_FRAGMENT_NODE && !this.parentNode.host)) { this.__teardownInstance(); } } /** * @return {void} */ connectedCallback() { super.connectedCallback(); this.style.display = 'none'; if (this.if) { this.__debounceRender(); } } /** * Forces the element to render its content. Normally rendering is * asynchronous to a provoking change. This is done for efficiency so * that multiple changes trigger only a single render. The render method * should be called if, for example, template rendering is required to * validate application state. * @return {void} */ render() { Polymer.flush(); } __render() { if (this.if) { if (!this.__ensureInstance()) { // No template found yet return; } this._showHideChildren(); } else if (this.restamp) { this.__teardownInstance(); } if (!this.restamp && this.__instance) { this._showHideChildren(); } if (this.if != this._lastIf) { this.dispatchEvent(new CustomEvent('dom-change', { bubbles: true, composed: true })); this._lastIf = this.if; } } __ensureInstance() { let parentNode = this.parentNode; // Guard against element being detached while render was queued if (parentNode) { if (!this.__ctor) { let template = /** @type {HTMLTemplateElement} */(this.querySelector('template')); if (!template) { // Wait until childList changes and template should be there by then let observer = new MutationObserver(() => { if (this.querySelector('template')) { observer.disconnect(); this.__render(); } else { throw new Error('dom-if requires a <template> child'); } }); observer.observe(this, {childList: true}); return false; } this.__ctor = Polymer.Templatize.templatize(template, this, { // dom-if templatizer instances require `mutable: true`, as // `__syncHostProperties` relies on that behavior to sync objects mutableData: true, /** * @param {string} prop Property to forward * @param {*} value Value of property * @this {this} */ forwardHostProp: function(prop, value) { if (this.__instance) { if (this.if) { this.__instance.forwardHostProp(prop, value); } else { // If we have an instance but are squelching host property // forwarding due to if being false, note the invalidated // properties so `__syncHostProperties` can sync them the next // time `if` becomes true this.__invalidProps = this.__invalidProps || Object.create(null); this.__invalidProps[Polymer.Path.root(prop)] = true; } } } }); } if (!this.__instance) { this.__instance = new this.__ctor(); parentNode.insertBefore(this.__instance.root, this); } else { this.__syncHostProperties(); let c$ = this.__instance.children; if (c$ && c$.length) { // Detect case where dom-if was re-attached in new position let lastChild = this.previousSibling; if (lastChild !== c$[c$.length-1]) { for (let i=0, n; (i<c$.length) && (n=c$[i]); i++) { parentNode.insertBefore(n, this); } } } } } return true; } __syncHostProperties() { let props = this.__invalidProps; if (props) { for (let prop in props) { this.__instance._setPendingProperty(prop, this.__dataHost[prop]); } this.__invalidProps = null; this.__instance._flushProperties(); } } __teardownInstance() { if (this.__instance) { let c$ = this.__instance.children; if (c$ && c$.length) { // use first child parent, for case when dom-if may have been detached let parent = c$[0].parentNode; // Instance children may be disconnected from parents when dom-if // detaches if a tree was innerHTML'ed if (parent) { for (let i=0, n; (i<c$.length) && (n=c$[i]); i++) { parent.removeChild(n); } } } this.__instance = null; this.__invalidProps = null; } } /** * Shows or hides the template instance top level child elements. For * text nodes, `textContent` is removed while "hidden" and replaced when * "shown." * @return {void} * @protected */ _showHideChildren() { let hidden = this.__hideTemplateChildren__ || !this.if; if (this.__instance) { this.__instance._showHideChildren(hidden); } } } customElements.define(DomIf.is, DomIf); /** @const */ Polymer.DomIf = DomIf; })(); </script> <script> (function() { 'use strict'; /** * Element mixin for recording dynamic associations between item paths in a * master `items` array and a `selected` array such that path changes to the * master array (at the host) element or elsewhere via data-binding) are * correctly propagated to items in the selected array and vice-versa. * * The `items` property accepts an array of user data, and via the * `select(item)` and `deselect(item)` API, updates the `selected` property * which may be bound to other parts of the application, and any changes to * sub-fields of `selected` item(s) will be kept in sync with items in the * `items` array. When `multi` is false, `selected` is a property * representing the last selected item. When `multi` is true, `selected` * is an array of multiply selected items. * * @polymer * @mixinFunction * @appliesMixin Polymer.ElementMixin * @memberof Polymer * @summary Element mixin for recording dynamic associations between item paths in a * master `items` array and a `selected` array */ let ArraySelectorMixin = Polymer.dedupingMixin(superClass => { /** * @constructor * @extends {superClass} * @implements {Polymer_ElementMixin} * @private */ let elementBase = Polymer.ElementMixin(superClass); /** * @polymer * @mixinClass * @implements {Polymer_ArraySelectorMixin} * @unrestricted */ class ArraySelectorMixin extends elementBase { static get properties() { return { /** * An array containing items from which selection will be made. */ items: { type: Array, }, /** * When `true`, multiple items may be selected at once (in this case, * `selected` is an array of currently selected items). When `false`, * only one item may be selected at a time. */ multi: { type: Boolean, value: false, }, /** * When `multi` is true, this is an array that contains any selected. * When `multi` is false, this is the currently selected item, or `null` * if no item is selected. * @type {?(Object|Array<!Object>)} */ selected: { type: Object, notify: true }, /** * When `multi` is false, this is the currently selected item, or `null` * if no item is selected. * @type {?Object} */ selectedItem: { type: Object, notify: true }, /** * When `true`, calling `select` on an item that is already selected * will deselect the item. */ toggle: { type: Boolean, value: false } }; } static get observers() { return ['__updateSelection(multi, items.*)']; } constructor() { super(); this.__lastItems = null; this.__lastMulti = null; this.__selectedMap = null; } __updateSelection(multi, itemsInfo) { let path = itemsInfo.path; if (path == 'items') { // Case 1 - items array changed, so diff against previous array and // deselect any removed items and adjust selected indices let newItems = itemsInfo.base || []; let lastItems = this.__lastItems; let lastMulti = this.__lastMulti; if (multi !== lastMulti) { this.clearSelection(); } if (lastItems) { let splices = Polymer.ArraySplice.calculateSplices(newItems, lastItems); this.__applySplices(splices); } this.__lastItems = newItems; this.__lastMulti = multi; } else if (itemsInfo.path == 'items.splices') { // Case 2 - got specific splice information describing the array mutation: // deselect any removed items and adjust selected indices this.__applySplices(itemsInfo.value.indexSplices); } else { // Case 3 - an array element was changed, so deselect the previous // item for that index if it was previously selected let part = path.slice('items.'.length); let idx = parseInt(part, 10); if ((part.indexOf('.') < 0) && part == idx) { this.__deselectChangedIdx(idx); } } } __applySplices(splices) { let selected = this.__selectedMap; // Adjust selected indices and mark removals for (let i=0; i<splices.length; i++) { let s = splices[i]; selected.forEach((idx, item) => { if (idx < s.index) { // no change } else if (idx >= s.index + s.removed.length) { // adjust index selected.set(item, idx + s.addedCount - s.removed.length); } else { // remove index selected.set(item, -1); } }); for (let j=0; j<s.addedCount; j++) { let idx = s.index + j; if (selected.has(this.items[idx])) { selected.set(this.items[idx], idx); } } } // Update linked paths this.__updateLinks(); // Remove selected items that were removed from the items array let sidx = 0; selected.forEach((idx, item) => { if (idx < 0) { if (this.multi) { this.splice('selected', sidx, 1); } else { this.selected = this.selectedItem = null; } selected.delete(item); } else { sidx++; } }); } __updateLinks() { this.__dataLinkedPaths = {}; if (this.multi) { let sidx = 0; this.__selectedMap.forEach(idx => { if (idx >= 0) { this.linkPaths('items.' + idx, 'selected.' + sidx++); } }); } else { this.__selectedMap.forEach(idx => { this.linkPaths('selected', 'items.' + idx); this.linkPaths('selectedItem', 'items.' + idx); }); } } /** * Clears the selection state. * @return {void} */ clearSelection() { // Unbind previous selection this.__dataLinkedPaths = {}; // The selected map stores 3 pieces of information: // key: items array object // value: items array index // order: selected array index this.__selectedMap = new Map(); // Initialize selection this.selected = this.multi ? [] : null; this.selectedItem = null; } /** * Returns whether the item is currently selected. * * @param {*} item Item from `items` array to test * @return {boolean} Whether the item is selected */ isSelected(item) { return this.__selectedMap.has(item); } /** * Returns whether the item is currently selected. * * @param {number} idx Index from `items` array to test * @return {boolean} Whether the item is selected */ isIndexSelected(idx) { return this.isSelected(this.items[idx]); } __deselectChangedIdx(idx) { let sidx = this.__selectedIndexForItemIndex(idx); if (sidx >= 0) { let i = 0; this.__selectedMap.forEach((idx, item) => { if (sidx == i++) { this.deselect(item); } }); } } __selectedIndexForItemIndex(idx) { let selected = this.__dataLinkedPaths['items.' + idx]; if (selected) { return parseInt(selected.slice('selected.'.length), 10); } } /** * Deselects the given item if it is already selected. * * @param {*} item Item from `items` array to deselect * @return {void} */ deselect(item) { let idx = this.__selectedMap.get(item); if (idx >= 0) { this.__selectedMap.delete(item); let sidx; if (this.multi) { sidx = this.__selectedIndexForItemIndex(idx); } this.__updateLinks(); if (this.multi) { this.splice('selected', sidx, 1); } else { this.selected = this.selectedItem = null; } } } /** * Deselects the given index if it is already selected. * * @param {number} idx Index from `items` array to deselect * @return {void} */ deselectIndex(idx) { this.deselect(this.items[idx]); } /** * Selects the given item. When `toggle` is true, this will automatically * deselect the item if already selected. * * @param {*} item Item from `items` array to select * @return {void} */ select(item) { this.selectIndex(this.items.indexOf(item)); } /** * Selects the given index. When `toggle` is true, this will automatically * deselect the item if already selected. * * @param {number} idx Index from `items` array to select * @return {void} */ selectIndex(idx) { let item = this.items[idx]; if (!this.isSelected(item)) { if (!this.multi) { this.__selectedMap.clear(); } this.__selectedMap.set(item, idx); this.__updateLinks(); if (this.multi) { this.push('selected', item); } else { this.selected = this.selectedItem = item; } } else if (this.toggle) { this.deselectIndex(idx); } } } return ArraySelectorMixin; }); // export mixin Polymer.ArraySelectorMixin = ArraySelectorMixin; /** * @constructor * @extends {Polymer.Element} * @implements {Polymer_ArraySelectorMixin} * @private */ let baseArraySelector = ArraySelectorMixin(Polymer.Element); /** * Element implementing the `Polymer.ArraySelector` mixin, which records * dynamic associations between item paths in a master `items` array and a * `selected` array such that path changes to the master array (at the host) * element or elsewhere via data-binding) are correctly propagated to items * in the selected array and vice-versa. * * The `items` property accepts an array of user data, and via the * `select(item)` and `deselect(item)` API, updates the `selected` property * which may be bound to other parts of the application, and any changes to * sub-fields of `selected` item(s) will be kept in sync with items in the * `items` array. When `multi` is false, `selected` is a property * representing the last selected item. When `multi` is true, `selected` * is an array of multiply selected items. * * Example: * * ```html * <dom-module id="employee-list"> * * <template> * * <div> Employee list: </div> * <dom-repeat id="employeeList" items="{{employees}}"> * <template> * <div>First name: <span>{{item.first}}</span></div> * <div>Last name: <span>{{item.last}}</span></div> * <button on-click="toggleSelection">Select</button> * </template> * </dom-repeat> * * <array-selector id="selector" items="{{employees}}" selected="{{selected}}" multi toggle></array-selector> * * <div> Selected employees: </div> * <dom-repeat items="{{selected}}"> * <template> * <div>First name: <span>{{item.first}}</span></div> * <div>Last name: <span>{{item.last}}</span></div> * </template> * </dom-repeat> * * </template> * * </dom-module> * ``` * * ```js *class EmployeeList extends Polymer.Element { * static get is() { return 'employee-list'; } * static get properties() { * return { * employees: { * value() { * return [ * {first: 'Bob', last: 'Smith'}, * {first: 'Sally', last: 'Johnson'}, * ... * ]; * } * } * }; * } * toggleSelection(e) { * let item = this.$.employeeList.itemForElement(e.target); * this.$.selector.select(item); * } *} * ``` * * @polymer * @customElement * @extends {baseArraySelector} * @appliesMixin Polymer.ArraySelectorMixin * @memberof Polymer * @summary Custom element that links paths between an input `items` array and * an output `selected` item or array based on calls to its selection API. */ class ArraySelector extends baseArraySelector { // Not needed to find template; can be removed once the analyzer // can find the tag name from customElements.define call static get is() { return 'array-selector'; } } customElements.define(ArraySelector.is, ArraySelector); /** @const */ Polymer.ArraySelector = ArraySelector; })(); </script> <script>(function(){/* Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ 'use strict';var c=null,f=window.HTMLImports&&window.HTMLImports.whenReady||null,g;function h(a){requestAnimationFrame(function(){f?f(a):(c||(c=new Promise(function(a){g=a}),"complete"===document.readyState?g():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&g()})),c.then(function(){a&&a()}))})};var k=null,l=null;function m(){this.customStyles=[];this.enqueued=!1;h(function(){window.ShadyCSS.flushCustomStyles&&window.ShadyCSS.flushCustomStyles()})}function n(a){!a.enqueued&&l&&(a.enqueued=!0,h(l))}m.prototype.c=function(a){a.__seenByShadyCSS||(a.__seenByShadyCSS=!0,this.customStyles.push(a),n(this))};m.prototype.b=function(a){if(a.__shadyCSSCachedStyle)return a.__shadyCSSCachedStyle;var b;a.getStyle?b=a.getStyle():b=a;return b}; m.prototype.a=function(){for(var a=this.customStyles,b=0;b<a.length;b++){var d=a[b];if(!d.__shadyCSSCachedStyle){var e=this.b(d);e&&(e=e.__appliedElement||e,k&&k(e),d.__shadyCSSCachedStyle=e)}}return a};m.prototype.addCustomStyle=m.prototype.c;m.prototype.getStyleForCustomStyle=m.prototype.b;m.prototype.processStyles=m.prototype.a; Object.defineProperties(m.prototype,{transformCallback:{get:function(){return k},set:function(a){k=a}},validateCallback:{get:function(){return l},set:function(a){var b=!1;l||(b=!0);l=a;b&&n(this)}}});function p(a,b){for(var d in b)null===d?a.style.removeProperty(d):a.style.setProperty(d,b[d])};var q=!(window.ShadyDOM&&window.ShadyDOM.inUse),r;function t(a){r=a&&a.shimcssproperties?!1:q||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}var u;window.ShadyCSS&&void 0!==window.ShadyCSS.cssBuild&&(u=window.ShadyCSS.cssBuild);var v=!(!window.ShadyCSS||!window.ShadyCSS.disableRuntime); window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?r=window.ShadyCSS.nativeCss:window.ShadyCSS?(t(window.ShadyCSS),window.ShadyCSS=void 0):t(window.WebComponents&&window.WebComponents.flags);var w=r,x=u;var y=new m;window.ShadyCSS||(window.ShadyCSS={prepareTemplate:function(){},prepareTemplateDom:function(){},prepareTemplateStyles:function(){},styleSubtree:function(a,b){y.a();p(a,b)},styleElement:function(){y.a()},styleDocument:function(a){y.a();p(document.body,a)},getComputedStyleValue:function(a,b){return(a=window.getComputedStyle(a).getPropertyValue(b))?a.trim():""},flushCustomStyles:function(){},nativeCss:w,nativeShadow:q,cssBuild:x,disableRuntime:v});window.ShadyCSS.CustomStyleInterface=y;}).call(this); </script> <script> (function() { 'use strict'; const attr = 'include'; const CustomStyleInterface = window.ShadyCSS.CustomStyleInterface; /** * Custom element for defining styles in the main document that can take * advantage of [shady DOM](https://github.com/webcomponents/shadycss) shims * for style encapsulation, custom properties, and custom mixins. * * - Document styles defined in a `<custom-style>` are shimmed to ensure they * do not leak into local DOM when running on browsers without native * Shadow DOM. * - Custom properties can be defined in a `<custom-style>`. Use the `html` selector * to define custom properties that apply to all custom elements. * - Custom mixins can be defined in a `<custom-style>`, if you import the optional * [apply shim](https://github.com/webcomponents/shadycss#about-applyshim) * (`shadycss/apply-shim.html`). * * To use: * * - Import `custom-style.html`. * - Place a `<custom-style>` element in the main document, wrapping an inline `<style>` tag that * contains the CSS rules you want to shim. * * For example: * * ```html * <!-- import apply shim--only required if using mixins --> * <link rel="import" href="bower_components/shadycss/apply-shim.html"> * <!-- import custom-style element --> * <link rel="import" href="bower_components/polymer/lib/elements/custom-style.html"> * * <custom-style> * <style> * html { * --custom-color: blue; * --custom-mixin: { * font-weight: bold; * color: red; * }; * } * </style> * </custom-style> * ``` * * @customElement * @extends HTMLElement * @memberof Polymer * @summary Custom element for defining styles in the main document that can * take advantage of Polymer's style scoping and custom properties shims. */ class CustomStyle extends HTMLElement { constructor() { super(); this._style = null; CustomStyleInterface.addCustomStyle(this); } /** * Returns the light-DOM `<style>` child this element wraps. Upon first * call any style modules referenced via the `include` attribute will be * concatenated to this element's `<style>`. * * @return {HTMLStyleElement} This element's light-DOM `<style>` */ getStyle() { if (this._style) { return this._style; } const style = /** @type {HTMLStyleElement} */(this.querySelector('style')); if (!style) { return null; } this._style = style; const include = style.getAttribute(attr); if (include) { style.removeAttribute(attr); style.textContent = Polymer.StyleGather.cssFromModules(include) + style.textContent; } /* HTML Imports styling the main document are deprecated in Chrome https://crbug.com/523952 If this element is not in the main document, then it must be in an HTML Import document. In that case, move the custom style to the main document. The ordering of `<custom-style>` should stay the same as when loaded by HTML Imports, but there may be odd cases of ordering w.r.t the main document styles. */ if (this.ownerDocument !== window.document) { window.document.head.appendChild(this); } return this._style; } } window.customElements.define('custom-style', CustomStyle); /** @const */ Polymer.CustomStyle = CustomStyle; })(); </script> <script> (function() { 'use strict'; let mutablePropertyChange; /** @suppress {missingProperties} */ (() => { mutablePropertyChange = Polymer.MutableData._mutablePropertyChange; })(); /** * Legacy element behavior to skip strict dirty-checking for objects and arrays, * (always consider them to be "dirty") for use on legacy API Polymer elements. * * By default, `Polymer.PropertyEffects` performs strict dirty checking on * objects, which means that any deep modifications to an object or array will * not be propagated unless "immutable" data patterns are used (i.e. all object * references from the root to the mutation were changed). * * Polymer also provides a proprietary data mutation and path notification API * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient * mutation and notification of deep changes in an object graph to all elements * bound to the same object graph. * * In cases where neither immutable patterns nor the data mutation API can be * used, applying this mixin will cause Polymer to skip dirty checking for * objects and arrays (always consider them to be "dirty"). This allows a * user to make a deep modification to a bound object graph, and then either * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath` * (e.g. `this.notifyPath('items')`) to update the tree. Note that all * elements that wish to be updated based on deep mutations must apply this * mixin or otherwise skip strict dirty checking for objects/arrays. * Specifically, any elements in the binding tree between the source of a * mutation and the consumption of it must apply this behavior or enable the * `Polymer.OptionalMutableDataBehavior`. * * In order to make the dirty check strategy configurable, see * `Polymer.OptionalMutableDataBehavior`. * * Note, the performance characteristics of propagating large object graphs * will be worse as opposed to using strict dirty checking with immutable * patterns or Polymer's path notification API. * * @polymerBehavior * @memberof Polymer * @summary Behavior to skip strict dirty-checking for objects and * arrays */ Polymer.MutableDataBehavior = { /** * Overrides `Polymer.PropertyEffects` to provide option for skipping * strict equality checking for Objects and Arrays. * * This method pulls the value to dirty check against from the `__dataTemp` * cache (rather than the normal `__data` cache) for Objects. Since the temp * cache is cleared at the end of a turn, this implementation allows * side-effects of deep object changes to be processed by re-setting the * same object (using the temp cache as an in-turn backstop to prevent * cycles due to 2-way notification). * * @param {string} property Property name * @param {*} value New property value * @param {*} old Previous property value * @return {boolean} Whether the property should be considered a change * @protected */ _shouldPropertyChange(property, value, old) { return mutablePropertyChange(this, property, value, old, true); } }; /** * Legacy element behavior to add the optional ability to skip strict * dirty-checking for objects and arrays (always consider them to be * "dirty") by setting a `mutable-data` attribute on an element instance. * * By default, `Polymer.PropertyEffects` performs strict dirty checking on * objects, which means that any deep modifications to an object or array will * not be propagated unless "immutable" data patterns are used (i.e. all object * references from the root to the mutation were changed). * * Polymer also provides a proprietary data mutation and path notification API * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient * mutation and notification of deep changes in an object graph to all elements * bound to the same object graph. * * In cases where neither immutable patterns nor the data mutation API can be * used, applying this mixin will allow Polymer to skip dirty checking for * objects and arrays (always consider them to be "dirty"). This allows a * user to make a deep modification to a bound object graph, and then either * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath` * (e.g. `this.notifyPath('items')`) to update the tree. Note that all * elements that wish to be updated based on deep mutations must apply this * mixin or otherwise skip strict dirty checking for objects/arrays. * Specifically, any elements in the binding tree between the source of a * mutation and the consumption of it must enable this behavior or apply the * `Polymer.OptionalMutableDataBehavior`. * * While this behavior adds the ability to forgo Object/Array dirty checking, * the `mutableData` flag defaults to false and must be set on the instance. * * Note, the performance characteristics of propagating large object graphs * will be worse by relying on `mutableData: true` as opposed to using * strict dirty checking with immutable patterns or Polymer's path notification * API. * * @polymerBehavior * @memberof Polymer * @summary Behavior to optionally skip strict dirty-checking for objects and * arrays */ Polymer.OptionalMutableDataBehavior = { properties: { /** * Instance-level flag for configuring the dirty-checking strategy * for this element. When true, Objects and Arrays will skip dirty * checking, otherwise strict equality checking will be used. */ mutableData: Boolean }, /** * Overrides `Polymer.PropertyEffects` to skip strict equality checking * for Objects and Arrays. * * Pulls the value to dirty check against from the `__dataTemp` cache * (rather than the normal `__data` cache) for Objects. Since the temp * cache is cleared at the end of a turn, this implementation allows * side-effects of deep object changes to be processed by re-setting the * same object (using the temp cache as an in-turn backstop to prevent * cycles due to 2-way notification). * * @param {string} property Property name * @param {*} value New property value * @param {*} old Previous property value * @return {boolean} Whether the property should be considered a change * @this {this} * @protected */ _shouldPropertyChange(property, value, old) { return mutablePropertyChange(this, property, value, old, this.mutableData); } }; })(); </script> <script> // bc Polymer.Base = Polymer.LegacyElementMixin(HTMLElement).prototype; // NOTE: this is here for modulizer to export `html` for the module version of this file Polymer.html = Polymer.html; </script> <custom-style> <style is="custom-style"> html { /* Material Design color palette for Google products */ --google-red-100: #f4c7c3; --google-red-300: #e67c73; --google-red-500: #db4437; --google-red-700: #c53929; --google-blue-100: #c6dafc; --google-blue-300: #7baaf7; --google-blue-500: #4285f4; --google-blue-700: #3367d6; --google-green-100: #b7e1cd; --google-green-300: #57bb8a; --google-green-500: #0f9d58; --google-green-700: #0b8043; --google-yellow-100: #fce8b2; --google-yellow-300: #f7cb4d; --google-yellow-500: #f4b400; --google-yellow-700: #f09300; --google-grey-100: #f5f5f5; --google-grey-300: #e0e0e0; --google-grey-500: #9e9e9e; --google-grey-700: #616161; /* Material Design color palette from online spec document */ --paper-red-50: #ffebee; --paper-red-100: #ffcdd2; --paper-red-200: #ef9a9a; --paper-red-300: #e57373; --paper-red-400: #ef5350; --paper-red-500: #f44336; --paper-red-600: #e53935; --paper-red-700: #d32f2f; --paper-red-800: #c62828; --paper-red-900: #b71c1c; --paper-red-a100: #ff8a80; --paper-red-a200: #ff5252; --paper-red-a400: #ff1744; --paper-red-a700: #d50000; --paper-pink-50: #fce4ec; --paper-pink-100: #f8bbd0; --paper-pink-200: #f48fb1; --paper-pink-300: #f06292; --paper-pink-400: #ec407a; --paper-pink-500: #e91e63; --paper-pink-600: #d81b60; --paper-pink-700: #c2185b; --paper-pink-800: #ad1457; --paper-pink-900: #880e4f; --paper-pink-a100: #ff80ab; --paper-pink-a200: #ff4081; --paper-pink-a400: #f50057; --paper-pink-a700: #c51162; --paper-purple-50: #f3e5f5; --paper-purple-100: #e1bee7; --paper-purple-200: #ce93d8; --paper-purple-300: #ba68c8; --paper-purple-400: #ab47bc; --paper-purple-500: #9c27b0; --paper-purple-600: #8e24aa; --paper-purple-700: #7b1fa2; --paper-purple-800: #6a1b9a; --paper-purple-900: #4a148c; --paper-purple-a100: #ea80fc; --paper-purple-a200: #e040fb; --paper-purple-a400: #d500f9; --paper-purple-a700: #aa00ff; --paper-deep-purple-50: #ede7f6; --paper-deep-purple-100: #d1c4e9; --paper-deep-purple-200: #b39ddb; --paper-deep-purple-300: #9575cd; --paper-deep-purple-400: #7e57c2; --paper-deep-purple-500: #673ab7; --paper-deep-purple-600: #5e35b1; --paper-deep-purple-700: #512da8; --paper-deep-purple-800: #4527a0; --paper-deep-purple-900: #311b92; --paper-deep-purple-a100: #b388ff; --paper-deep-purple-a200: #7c4dff; --paper-deep-purple-a400: #651fff; --paper-deep-purple-a700: #6200ea; --paper-indigo-50: #e8eaf6; --paper-indigo-100: #c5cae9; --paper-indigo-200: #9fa8da; --paper-indigo-300: #7986cb; --paper-indigo-400: #5c6bc0; --paper-indigo-500: #3f51b5; --paper-indigo-600: #3949ab; --paper-indigo-700: #303f9f; --paper-indigo-800: #283593; --paper-indigo-900: #1a237e; --paper-indigo-a100: #8c9eff; --paper-indigo-a200: #536dfe; --paper-indigo-a400: #3d5afe; --paper-indigo-a700: #304ffe; --paper-blue-50: #e3f2fd; --paper-blue-100: #bbdefb; --paper-blue-200: #90caf9; --paper-blue-300: #64b5f6; --paper-blue-400: #42a5f5; --paper-blue-500: #2196f3; --paper-blue-600: #1e88e5; --paper-blue-700: #1976d2; --paper-blue-800: #1565c0; --paper-blue-900: #0d47a1; --paper-blue-a100: #82b1ff; --paper-blue-a200: #448aff; --paper-blue-a400: #2979ff; --paper-blue-a700: #2962ff; --paper-light-blue-50: #e1f5fe; --paper-light-blue-100: #b3e5fc; --paper-light-blue-200: #81d4fa; --paper-light-blue-300: #4fc3f7; --paper-light-blue-400: #29b6f6; --paper-light-blue-500: #03a9f4; --paper-light-blue-600: #039be5; --paper-light-blue-700: #0288d1; --paper-light-blue-800: #0277bd; --paper-light-blue-900: #01579b; --paper-light-blue-a100: #80d8ff; --paper-light-blue-a200: #40c4ff; --paper-light-blue-a400: #00b0ff; --paper-light-blue-a700: #0091ea; --paper-cyan-50: #e0f7fa; --paper-cyan-100: #b2ebf2; --paper-cyan-200: #80deea; --paper-cyan-300: #4dd0e1; --paper-cyan-400: #26c6da; --paper-cyan-500: #00bcd4; --paper-cyan-600: #00acc1; --paper-cyan-700: #0097a7; --paper-cyan-800: #00838f; --paper-cyan-900: #006064; --paper-cyan-a100: #84ffff; --paper-cyan-a200: #18ffff; --paper-cyan-a400: #00e5ff; --paper-cyan-a700: #00b8d4; --paper-teal-50: #e0f2f1; --paper-teal-100: #b2dfdb; --paper-teal-200: #80cbc4; --paper-teal-300: #4db6ac; --paper-teal-400: #26a69a; --paper-teal-500: #009688; --paper-teal-600: #00897b; --paper-teal-700: #00796b; --paper-teal-800: #00695c; --paper-teal-900: #004d40; --paper-teal-a100: #a7ffeb; --paper-teal-a200: #64ffda; --paper-teal-a400: #1de9b6; --paper-teal-a700: #00bfa5; --paper-green-50: #e8f5e9; --paper-green-100: #c8e6c9; --paper-green-200: #a5d6a7; --paper-green-300: #81c784; --paper-green-400: #66bb6a; --paper-green-500: #4caf50; --paper-green-600: #43a047; --paper-green-700: #388e3c; --paper-green-800: #2e7d32; --paper-green-900: #1b5e20; --paper-green-a100: #b9f6ca; --paper-green-a200: #69f0ae; --paper-green-a400: #00e676; --paper-green-a700: #00c853; --paper-light-green-50: #f1f8e9; --paper-light-green-100: #dcedc8; --paper-light-green-200: #c5e1a5; --paper-light-green-300: #aed581; --paper-light-green-400: #9ccc65; --paper-light-green-500: #8bc34a; --paper-light-green-600: #7cb342; --paper-light-green-700: #689f38; --paper-light-green-800: #558b2f; --paper-light-green-900: #33691e; --paper-light-green-a100: #ccff90; --paper-light-green-a200: #b2ff59; --paper-light-green-a400: #76ff03; --paper-light-green-a700: #64dd17; --paper-lime-50: #f9fbe7; --paper-lime-100: #f0f4c3; --paper-lime-200: #e6ee9c; --paper-lime-300: #dce775; --paper-lime-400: #d4e157; --paper-lime-500: #cddc39; --paper-lime-600: #c0ca33; --paper-lime-700: #afb42b; --paper-lime-800: #9e9d24; --paper-lime-900: #827717; --paper-lime-a100: #f4ff81; --paper-lime-a200: #eeff41; --paper-lime-a400: #c6ff00; --paper-lime-a700: #aeea00; --paper-yellow-50: #fffde7; --paper-yellow-100: #fff9c4; --paper-yellow-200: #fff59d; --paper-yellow-300: #fff176; --paper-yellow-400: #ffee58; --paper-yellow-500: #ffeb3b; --paper-yellow-600: #fdd835; --paper-yellow-700: #fbc02d; --paper-yellow-800: #f9a825; --paper-yellow-900: #f57f17; --paper-yellow-a100: #ffff8d; --paper-yellow-a200: #ffff00; --paper-yellow-a400: #ffea00; --paper-yellow-a700: #ffd600; --paper-amber-50: #fff8e1; --paper-amber-100: #ffecb3; --paper-amber-200: #ffe082; --paper-amber-300: #ffd54f; --paper-amber-400: #ffca28; --paper-amber-500: #ffc107; --paper-amber-600: #ffb300; --paper-amber-700: #ffa000; --paper-amber-800: #ff8f00; --paper-amber-900: #ff6f00; --paper-amber-a100: #ffe57f; --paper-amber-a200: #ffd740; --paper-amber-a400: #ffc400; --paper-amber-a700: #ffab00; --paper-orange-50: #fff3e0; --paper-orange-100: #ffe0b2; --paper-orange-200: #ffcc80; --paper-orange-300: #ffb74d; --paper-orange-400: #ffa726; --paper-orange-500: #ff9800; --paper-orange-600: #fb8c00; --paper-orange-700: #f57c00; --paper-orange-800: #ef6c00; --paper-orange-900: #e65100; --paper-orange-a100: #ffd180; --paper-orange-a200: #ffab40; --paper-orange-a400: #ff9100; --paper-orange-a700: #ff6500; --paper-deep-orange-50: #fbe9e7; --paper-deep-orange-100: #ffccbc; --paper-deep-orange-200: #ffab91; --paper-deep-orange-300: #ff8a65; --paper-deep-orange-400: #ff7043; --paper-deep-orange-500: #ff5722; --paper-deep-orange-600: #f4511e; --paper-deep-orange-700: #e64a19; --paper-deep-orange-800: #d84315; --paper-deep-orange-900: #bf360c; --paper-deep-orange-a100: #ff9e80; --paper-deep-orange-a200: #ff6e40; --paper-deep-orange-a400: #ff3d00; --paper-deep-orange-a700: #dd2c00; --paper-brown-50: #efebe9; --paper-brown-100: #d7ccc8; --paper-brown-200: #bcaaa4; --paper-brown-300: #a1887f; --paper-brown-400: #8d6e63; --paper-brown-500: #795548; --paper-brown-600: #6d4c41; --paper-brown-700: #5d4037; --paper-brown-800: #4e342e; --paper-brown-900: #3e2723; --paper-grey-50: #fafafa; --paper-grey-100: #f5f5f5; --paper-grey-200: #eeeeee; --paper-grey-300: #e0e0e0; --paper-grey-400: #bdbdbd; --paper-grey-500: #9e9e9e; --paper-grey-600: #757575; --paper-grey-700: #616161; --paper-grey-800: #424242; --paper-grey-900: #212121; --paper-blue-grey-50: #eceff1; --paper-blue-grey-100: #cfd8dc; --paper-blue-grey-200: #b0bec5; --paper-blue-grey-300: #90a4ae; --paper-blue-grey-400: #78909c; --paper-blue-grey-500: #607d8b; --paper-blue-grey-600: #546e7a; --paper-blue-grey-700: #455a64; --paper-blue-grey-800: #37474f; --paper-blue-grey-900: #263238; /* opacity for dark text on a light background */ --dark-divider-opacity: 0.12; --dark-disabled-opacity: 0.38; /* or hint text or icon */ --dark-secondary-opacity: 0.54; --dark-primary-opacity: 0.87; /* opacity for light text on a dark background */ --light-divider-opacity: 0.12; --light-disabled-opacity: 0.3; /* or hint text or icon */ --light-secondary-opacity: 0.7; --light-primary-opacity: 1.0; } </style> </custom-style> <custom-style> <style is="custom-style"> html { /* * You can use these generic variables in your elements for easy theming. * For example, if all your elements use `--primary-text-color` as its main * color, then switching from a light to a dark theme is just a matter of * changing the value of `--primary-text-color` in your application. */ --primary-text-color: var(--light-theme-text-color); --primary-background-color: var(--light-theme-background-color); --secondary-text-color: var(--light-theme-secondary-color); --disabled-text-color: var(--light-theme-disabled-color); --divider-color: var(--light-theme-divider-color); --error-color: var(--paper-deep-orange-a700); /* * Primary and accent colors. Also see color.html for more colors. */ --primary-color: var(--paper-indigo-500); --light-primary-color: var(--paper-indigo-100); --dark-primary-color: var(--paper-indigo-700); --accent-color: var(--paper-pink-a200); --light-accent-color: var(--paper-pink-a100); --dark-accent-color: var(--paper-pink-a400); /* * Material Design Light background theme */ --light-theme-background-color: #ffffff; --light-theme-base-color: #000000; --light-theme-text-color: var(--paper-grey-900); --light-theme-secondary-color: #737373; /* for secondary text and icons */ --light-theme-disabled-color: #9b9b9b; /* disabled/hint text */ --light-theme-divider-color: #dbdbdb; /* * Material Design Dark background theme */ --dark-theme-background-color: var(--paper-grey-900); --dark-theme-base-color: #ffffff; --dark-theme-text-color: #ffffff; --dark-theme-secondary-color: #bcbcbc; /* for secondary text and icons */ --dark-theme-disabled-color: #646464; /* disabled/hint text */ --dark-theme-divider-color: #3c3c3c; /* * Deprecated values because of their confusing names. */ --text-primary-color: var(--dark-theme-text-color); --default-primary-color: var(--primary-color); } </style> </custom-style> <script>// https://d3js.org v5.7.0 Copyright 2018 Mike Bostock !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(this,function(t){"use strict";function n(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function e(t){var e;return 1===t.length&&(e=t,t=function(t,r){return n(e(t),r)}),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}var r=e(n),i=r.right,o=r.left;function a(t,n){return[t,n]}function u(t){return null===t?NaN:+t}function f(t,n){var e,r,i=t.length,o=0,a=-1,f=0,c=0;if(null==n)for(;++a<i;)isNaN(e=u(t[a]))||(c+=(r=e-f)*(e-(f+=r/++o)));else for(;++a<i;)isNaN(e=u(n(t[a],a,t)))||(c+=(r=e-f)*(e-(f+=r/++o)));if(o>1)return c/(o-1)}function c(t,n){var e=f(t,n);return e?Math.sqrt(e):e}function s(t,n){var e,r,i,o=t.length,a=-1;if(null==n){for(;++a<o;)if(null!=(e=t[a])&&e>=e)for(r=i=e;++a<o;)null!=(e=t[a])&&(r>e&&(r=e),i<e&&(i=e))}else for(;++a<o;)if(null!=(e=n(t[a],a,t))&&e>=e)for(r=i=e;++a<o;)null!=(e=n(t[a],a,t))&&(r>e&&(r=e),i<e&&(i=e));return[r,i]}var l=Array.prototype,h=l.slice,d=l.map;function p(t){return function(){return t}}function v(t){return t}function g(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r<i;)o[r]=t+r*e;return o}var y=Math.sqrt(50),_=Math.sqrt(10),b=Math.sqrt(2);function m(t,n,e){var r,i,o,a,u=-1;if(e=+e,(t=+t)===(n=+n)&&e>0)return[t];if((r=n<t)&&(i=t,t=n,n=i),0===(a=x(t,n,e))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u<i;)o[u]=(t+u)*a;else for(t=Math.floor(t*a),n=Math.ceil(n*a),o=new Array(i=Math.ceil(t-n+1));++u<i;)o[u]=(t-u)/a;return r&&o.reverse(),o}function x(t,n,e){var r=(n-t)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=y?10:o>=_?5:o>=b?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=y?10:o>=_?5:o>=b?2:1)}function w(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=y?i*=10:o>=_?i*=5:o>=b&&(i*=2),n<t?-i:i}function M(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}function A(t,n,e){if(null==e&&(e=u),r=t.length){if((n=+n)<=0||r<2)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t);return a+(+e(t[o+1],o+1,t)-a)*(i-o)}}function T(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o<i;)if(null!=(e=t[o])&&e>=e)for(r=e;++o<i;)null!=(e=t[o])&&e>r&&(r=e)}else for(;++o<i;)if(null!=(e=n(t[o],o,t))&&e>=e)for(r=e;++o<i;)null!=(e=n(t[o],o,t))&&e>r&&(r=e);return r}function N(t){for(var n,e,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(e=new Array(a);--i>=0;)for(n=(r=t[i]).length;--n>=0;)e[--a]=r[n];return e}function S(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o<i;)if(null!=(e=t[o])&&e>=e)for(r=e;++o<i;)null!=(e=t[o])&&r>e&&(r=e)}else for(;++o<i;)if(null!=(e=n(t[o],o,t))&&e>=e)for(r=e;++o<i;)null!=(e=n(t[o],o,t))&&r>e&&(r=e);return r}function E(t){if(!(i=t.length))return[];for(var n=-1,e=S(t,k),r=new Array(e);++n<e;)for(var i,o=-1,a=r[n]=new Array(i);++o<i;)a[o]=t[o][n];return r}function k(t){return t.length}var C=Array.prototype.slice;function P(t){return t}var z=1,R=2,L=3,D=4,U=1e-6;function q(t){return"translate("+(t+.5)+",0)"}function O(t){return"translate(0,"+(t+.5)+")"}function Y(){return!this.__axis}function B(t,n){var e=[],r=null,i=null,o=6,a=6,u=3,f=t===z||t===D?-1:1,c=t===D||t===R?"x":"y",s=t===z||t===L?q:O;function l(l){var h=null==r?n.ticks?n.ticks.apply(n,e):n.domain():r,d=null==i?n.tickFormat?n.tickFormat.apply(n,e):P:i,p=Math.max(o,0)+u,v=n.range(),g=+v[0]+.5,y=+v[v.length-1]+.5,_=(n.bandwidth?function(t){var n=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(n=Math.round(n)),function(e){return+t(e)+n}}:function(t){return function(n){return+t(n)}})(n.copy()),b=l.selection?l.selection():l,m=b.selectAll(".domain").data([null]),x=b.selectAll(".tick").data(h,n).order(),w=x.exit(),M=x.enter().append("g").attr("class","tick"),A=x.select("line"),T=x.select("text");m=m.merge(m.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(M),A=A.merge(M.append("line").attr("stroke","currentColor").attr(c+"2",f*o)),T=T.merge(M.append("text").attr("fill","currentColor").attr(c,f*p).attr("dy",t===z?"0em":t===L?"0.71em":"0.32em")),l!==b&&(m=m.transition(l),x=x.transition(l),A=A.transition(l),T=T.transition(l),w=w.transition(l).attr("opacity",U).attr("transform",function(t){return isFinite(t=_(t))?s(t):this.getAttribute("transform")}),M.attr("opacity",U).attr("transform",function(t){var n=this.parentNode.__axis;return s(n&&isFinite(n=n(t))?n:_(t))})),w.remove(),m.attr("d",t===D||t==R?a?"M"+f*a+","+g+"H0.5V"+y+"H"+f*a:"M0.5,"+g+"V"+y:a?"M"+g+","+f*a+"V0.5H"+y+"V"+f*a:"M"+g+",0.5H"+y),x.attr("opacity",1).attr("transform",function(t){return s(_(t))}),A.attr(c+"2",f*o),T.attr(c,f*p).text(d),b.filter(Y).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===R?"start":t===D?"end":"middle"),b.each(function(){this.__axis=_})}return l.scale=function(t){return arguments.length?(n=t,l):n},l.ticks=function(){return e=C.call(arguments),l},l.tickArguments=function(t){return arguments.length?(e=null==t?[]:C.call(t),l):e.slice()},l.tickValues=function(t){return arguments.length?(r=null==t?null:C.call(t),l):r&&r.slice()},l.tickFormat=function(t){return arguments.length?(i=t,l):i},l.tickSize=function(t){return arguments.length?(o=a=+t,l):o},l.tickSizeInner=function(t){return arguments.length?(o=+t,l):o},l.tickSizeOuter=function(t){return arguments.length?(a=+t,l):a},l.tickPadding=function(t){return arguments.length?(u=+t,l):u},l}var F={value:function(){}};function I(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new H(r)}function H(t){this._=t}function j(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function X(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=F,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}H.prototype=I.prototype={constructor:H,on:function(t,n){var e,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a<u;)if(e=(t=o[a]).type)i[e]=X(i[e],t.name,n);else if(null==n)for(e in i)i[e]=X(i[e],t.name,null);return this}for(;++a<u;)if((e=(t=o[a]).type)&&(e=j(i[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new H(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var G="http://www.w3.org/1999/xhtml",V={svg:"http://www.w3.org/2000/svg",xhtml:G,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),V.hasOwnProperty(n)?{space:V[n],local:t}:t}function W(t){var n=$(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===G&&n.documentElement.namespaceURI===G?n.createElement(t):n.createElementNS(e,t)}})(n)}function Z(){}function Q(t){return null==t?Z:function(){return this.querySelector(t)}}function J(){return[]}function K(t){return null==t?J:function(){return this.querySelectorAll(t)}}var tt=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var nt=document.documentElement;if(!nt.matches){var et=nt.webkitMatchesSelector||nt.msMatchesSelector||nt.mozMatchesSelector||nt.oMatchesSelector;tt=function(t){return function(){return et.call(this,t)}}}}var rt=tt;function it(t){return new Array(t.length)}function ot(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}ot.prototype={constructor:ot,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var at="$";function ut(t,n,e,r,i,o){for(var a,u=0,f=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new ot(t,o[u]);for(;u<f;++u)(a=n[u])&&(i[u]=a)}function ft(t,n,e,r,i,o,a){var u,f,c,s={},l=n.length,h=o.length,d=new Array(l);for(u=0;u<l;++u)(f=n[u])&&(d[u]=c=at+a.call(f,f.__data__,u,n),c in s?i[u]=f:s[c]=f);for(u=0;u<h;++u)(f=s[c=at+a.call(t,o[u],u,o)])?(r[u]=f,f.__data__=o[u],s[c]=null):e[u]=new ot(t,o[u]);for(u=0;u<l;++u)(f=n[u])&&s[d[u]]===f&&(i[u]=f)}function ct(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function st(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function lt(t,n){return t.style.getPropertyValue(n)||st(t).getComputedStyle(t,null).getPropertyValue(n)}function ht(t){return t.trim().split(/^|\s+/)}function dt(t){return t.classList||new pt(t)}function pt(t){this._node=t,this._names=ht(t.getAttribute("class")||"")}function vt(t,n){for(var e=dt(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function gt(t,n){for(var e=dt(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function yt(){this.textContent=""}function _t(){this.innerHTML=""}function bt(){this.nextSibling&&this.parentNode.appendChild(this)}function mt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xt(){return null}function wt(){var t=this.parentNode;t&&t.removeChild(this)}function Mt(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function At(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}pt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Tt={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(Tt={mouseenter:"mouseover",mouseleave:"mouseout"}));function Nt(t,n,e){return t=St(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function St(n,e,r){return function(i){var o=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=o}}}function Et(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function kt(t,n,e){var r=Tt.hasOwnProperty(t.type)?Nt:St;return function(i,o,a){var u,f=this.__on,c=r(n,o,a);if(f)for(var s=0,l=f.length;s<l;++s)if((u=f[s]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=c,u.capture=e),void(u.value=n);this.addEventListener(t.type,c,e),u={type:t.type,name:t.name,value:n,listener:c,capture:e},f?f.push(u):this.__on=[u]}}function Ct(n,e,r,i){var o=t.event;n.sourceEvent=t.event,t.event=n;try{return e.apply(r,i)}finally{t.event=o}}function Pt(t,n,e){var r=st(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}var zt=[null];function Rt(t,n){this._groups=t,this._parents=n}function Lt(){return new Rt([[document.documentElement]],zt)}function Dt(t){return"string"==typeof t?new Rt([[document.querySelector(t)]],[document.documentElement]):new Rt([[t]],zt)}Rt.prototype=Lt.prototype={constructor:Rt,select:function(t){"function"!=typeof t&&(t=Q(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],f=u.length,c=r[i]=new Array(f),s=0;s<f;++s)(o=u[s])&&(a=t.call(o,o.__data__,s,u))&&("__data__"in o&&(a.__data__=o.__data__),c[s]=a);return new Rt(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=K(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],f=u.length,c=0;c<f;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new Rt(r,i)},filter:function(t){"function"!=typeof t&&(t=rt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,f=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&f.push(o);return new Rt(r,this._parents)},data:function(t,n){if(!t)return p=new Array(this.size()),s=-1,this.each(function(t){p[++s]=t}),p;var e,r=n?ft:ut,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var a=o.length,u=new Array(a),f=new Array(a),c=new Array(a),s=0;s<a;++s){var l=i[s],h=o[s],d=h.length,p=t.call(l,l&&l.__data__,s,i),v=p.length,g=f[s]=new Array(v),y=u[s]=new Array(v);r(l,h,g,y,c[s]=new Array(d),p,n);for(var _,b,m=0,x=0;m<v;++m)if(_=g[m]){for(m>=x&&(x=m+1);!(b=y[x])&&++x<v;);_._next=b||null}}return(u=new Rt(u,i))._enter=f,u._exit=c,u},enter:function(){return new Rt(this._enter||this._groups.map(it),this._parents)},exit:function(){return new Rt(this._exit||this._groups.map(it),this._parents)},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var f,c=n[u],s=e[u],l=c.length,h=a[u]=new Array(l),d=0;d<l;++d)(f=c[d]||s[d])&&(h[d]=f);for(;u<r;++u)a[u]=n[u];return new Rt(a,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=ct);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],f=u.length,c=i[o]=new Array(f),s=0;s<f;++s)(a=u[s])&&(c[s]=a);c.sort(n)}return new Rt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each(function(){++t}),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=$(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof n?e.local?function(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}:function(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}:e.local?function(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}:function(t,n){return function(){this.setAttribute(t,n)}})(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):lt(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=ht(t+"");if(arguments.length<2){for(var r=dt(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?function(t,n){return function(){(n.apply(this,arguments)?vt:gt)(this,t)}}:n?function(t){return function(){vt(this,t)}}:function(t){return function(){gt(this,t)}})(e,n))},text:function(t){return arguments.length?this.each(null==t?yt:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?_t:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(bt)},lower:function(){return this.each(mt)},append:function(t){var n="function"==typeof t?t:W(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:W(t),r=null==n?xt:"function"==typeof n?n:Q(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(wt)},clone:function(t){return this.select(t?At:Mt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?kt:Et,null==e&&(e=!1),r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var f,c=0,s=u.length;c<s;++c)for(r=0,f=u[c];r<a;++r)if((i=o[r]).type===f.type&&i.name===f.name)return f.value},dispatch:function(t,n){return this.each(("function"==typeof n?function(t,n){return function(){return Pt(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return Pt(this,t,n)}})(t,n))}};var Ut=0;function qt(){return new Ot}function Ot(){this._="@"+(++Ut).toString(36)}function Yt(){for(var n,e=t.event;n=e.sourceEvent;)e=n;return e}function Bt(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]}function Ft(t){var n=Yt();return n.changedTouches&&(n=n.changedTouches[0]),Bt(t,n)}function It(t,n,e){arguments.length<3&&(e=n,n=Yt().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return Bt(t,r);return null}function Ht(){t.event.stopImmediatePropagation()}function jt(){t.event.preventDefault(),t.event.stopImmediatePropagation()}function Xt(t){var n=t.document.documentElement,e=Dt(t).on("dragstart.drag",jt,!0);"onselectstart"in n?e.on("selectstart.drag",jt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Gt(t,n){var e=t.document.documentElement,r=Dt(t).on("dragstart.drag",null);n&&(r.on("click.drag",jt,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function Vt(t){return function(){return t}}function $t(t,n,e,r,i,o,a,u,f,c){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=u,this.dy=f,this._=c}function Wt(){return!t.event.button}function Zt(){return this.parentNode}function Qt(n){return null==n?{x:t.event.x,y:t.event.y}:n}function Jt(){return"ontouchstart"in this}function Kt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function tn(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function nn(){}Ot.prototype=qt.prototype={constructor:Ot,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}},$t.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var en="\\s*([+-]?\\d+)\\s*",rn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",on="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",an=/^#([0-9a-f]{3})$/,un=/^#([0-9a-f]{6})$/,fn=new RegExp("^rgb\\("+[en,en,en]+"\\)$"),cn=new RegExp("^rgb\\("+[on,on,on]+"\\)$"),sn=new RegExp("^rgba\\("+[en,en,en,rn]+"\\)$"),ln=new RegExp("^rgba\\("+[on,on,on,rn]+"\\)$"),hn=new RegExp("^hsl\\("+[rn,on,on]+"\\)$"),dn=new RegExp("^hsla\\("+[rn,on,on,rn]+"\\)$"),pn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function vn(t){var n;return t=(t+"").trim().toLowerCase(),(n=an.exec(t))?new mn((n=parseInt(n[1],16))>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=un.exec(t))?gn(parseInt(n[1],16)):(n=fn.exec(t))?new mn(n[1],n[2],n[3],1):(n=cn.exec(t))?new mn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=sn.exec(t))?yn(n[1],n[2],n[3],n[4]):(n=ln.exec(t))?yn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=hn.exec(t))?wn(n[1],n[2]/100,n[3]/100,1):(n=dn.exec(t))?wn(n[1],n[2]/100,n[3]/100,n[4]):pn.hasOwnProperty(t)?gn(pn[t]):"transparent"===t?new mn(NaN,NaN,NaN,0):null}function gn(t){return new mn(t>>16&255,t>>8&255,255&t,1)}function yn(t,n,e,r){return r<=0&&(t=n=e=NaN),new mn(t,n,e,r)}function _n(t){return t instanceof nn||(t=vn(t)),t?new mn((t=t.rgb()).r,t.g,t.b,t.opacity):new mn}function bn(t,n,e,r){return 1===arguments.length?_n(t):new mn(t,n,e,null==r?1:r)}function mn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function xn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function wn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new An(t,n,e,r)}function Mn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof An)return new An(t.h,t.s,t.l,t.opacity);if(t instanceof nn||(t=vn(t)),!t)return new An;if(t instanceof An)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,f=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e<r):e===o?(r-n)/u+2:(n-e)/u+4,u/=f<.5?o+i:2-o-i,a*=60):u=f>0&&f<1?0:a,new An(a,u,f,t.opacity)}(t):new An(t,n,e,null==r?1:r)}function An(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Tn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Kt(nn,vn,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),Kt(mn,bn,tn(nn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+xn(this.r)+xn(this.g)+xn(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Kt(An,Mn,tn(nn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new An(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new An(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new mn(Tn(t>=240?t-240:t+120,i,r),Tn(t,i,r),Tn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Nn=Math.PI/180,Sn=180/Math.PI,En=.96422,kn=1,Cn=.82521,Pn=4/29,zn=6/29,Rn=3*zn*zn,Ln=zn*zn*zn;function Dn(t){if(t instanceof qn)return new qn(t.l,t.a,t.b,t.opacity);if(t instanceof jn){if(isNaN(t.h))return new qn(t.l,0,0,t.opacity);var n=t.h*Nn;return new qn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof mn||(t=_n(t));var e,r,i=Fn(t.r),o=Fn(t.g),a=Fn(t.b),u=On((.2225045*i+.7168786*o+.0606169*a)/kn);return i===o&&o===a?e=r=u:(e=On((.4360747*i+.3850649*o+.1430804*a)/En),r=On((.0139322*i+.0971045*o+.7141733*a)/Cn)),new qn(116*u-16,500*(e-u),200*(u-r),t.opacity)}function Un(t,n,e,r){return 1===arguments.length?Dn(t):new qn(t,n,e,null==r?1:r)}function qn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function On(t){return t>Ln?Math.pow(t,1/3):t/Rn+Pn}function Yn(t){return t>zn?t*t*t:Rn*(t-Pn)}function Bn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Fn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function In(t){if(t instanceof jn)return new jn(t.h,t.c,t.l,t.opacity);if(t instanceof qn||(t=Dn(t)),0===t.a&&0===t.b)return new jn(NaN,0,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*Sn;return new jn(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Hn(t,n,e,r){return 1===arguments.length?In(t):new jn(t,n,e,null==r?1:r)}function jn(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}Kt(qn,Un,tn(nn,{brighter:function(t){return new qn(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new qn(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return new mn(Bn(3.1338561*(n=En*Yn(n))-1.6168667*(t=kn*Yn(t))-.4906146*(e=Cn*Yn(e))),Bn(-.9787684*n+1.9161415*t+.033454*e),Bn(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),Kt(jn,Hn,tn(nn,{brighter:function(t){return new jn(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new jn(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Dn(this).rgb()}}));var Xn=-.14861,Gn=1.78277,Vn=-.29227,$n=-.90649,Wn=1.97294,Zn=Wn*$n,Qn=Wn*Gn,Jn=Gn*Vn-$n*Xn;function Kn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof te)return new te(t.h,t.s,t.l,t.opacity);t instanceof mn||(t=_n(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Jn*r+Zn*n-Qn*e)/(Jn+Zn-Qn),o=r-i,a=(Wn*(e-i)-Vn*o)/$n,u=Math.sqrt(a*a+o*o)/(Wn*i*(1-i)),f=u?Math.atan2(a,o)*Sn-120:NaN;return new te(f<0?f+360:f,u,i,t.opacity)}(t):new te(t,n,e,null==r?1:r)}function te(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ne(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}function ee(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r<n-1?t[r+2]:2*o-i;return ne((e-r/n)*n,a,i,o,u)}}function re(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),i=t[(r+n-1)%n],o=t[r%n],a=t[(r+1)%n],u=t[(r+2)%n];return ne((e-r/n)*n,i,o,a,u)}}function ie(t){return function(){return t}}function oe(t,n){return function(e){return t+e*n}}function ae(t,n){var e=n-t;return e?oe(t,e>180||e<-180?e-360*Math.round(e/360):e):ie(isNaN(t)?n:t)}function ue(t){return 1==(t=+t)?fe:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):ie(isNaN(n)?e:n)}}function fe(t,n){var e=n-t;return e?oe(t,e):ie(isNaN(t)?n:t)}Kt(te,Kn,tn(nn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new te(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new te(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Nn,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new mn(255*(n+e*(Xn*r+Gn*i)),255*(n+e*(Vn*r+$n*i)),255*(n+e*(Wn*r)),this.opacity)}}));var ce=function t(n){var e=ue(n);function r(t,n){var r=e((t=bn(t)).r,(n=bn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=fe(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function se(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;e<i;++e)r=bn(n[e]),o[e]=r.r||0,a[e]=r.g||0,u[e]=r.b||0;return o=t(o),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=u(t),r+""}}}var le=se(ee),he=se(re);function de(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(e=0;e<i;++e)o[e]=me(t[e],n[e]);for(;e<r;++e)a[e]=n[e];return function(t){for(e=0;e<i;++e)a[e]=o[e](t);return a}}function pe(t,n){var e=new Date;return n-=t=+t,function(r){return e.setTime(t+n*r),e}}function ve(t,n){return n-=t=+t,function(e){return t+n*e}}function ge(t,n){var e,r={},i={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?r[e]=me(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}}var ye=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_e=new RegExp(ye.source,"g");function be(t,n){var e,r,i,o=ye.lastIndex=_e.lastIndex=0,a=-1,u=[],f=[];for(t+="",n+="";(e=ye.exec(t))&&(r=_e.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,f.push({i:a,x:ve(e,r)})),o=_e.lastIndex;return o<n.length&&(i=n.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?f[0]?function(t){return function(n){return t(n)+""}}(f[0].x):function(t){return function(){return t}}(n):(n=f.length,function(t){for(var e,r=0;r<n;++r)u[(e=f[r]).i]=e.x(t);return u.join("")})}function me(t,n){var e,r=typeof n;return null==n||"boolean"===r?ie(n):("number"===r?ve:"string"===r?(e=vn(n))?(n=e,ce):be:n instanceof vn?ce:n instanceof Date?pe:Array.isArray(n)?de:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?ge:ve)(t,n)}function xe(t,n){return n-=t=+t,function(e){return Math.round(t+n*e)}}var we,Me,Ae,Te,Ne=180/Math.PI,Se={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ee(t,n,e,r,i,o){var a,u,f;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(f=t*e+n*r)&&(e-=t*f,r-=n*f),(u=Math.sqrt(e*e+r*r))&&(e/=u,r/=u,f/=u),t*r<n*e&&(t=-t,n=-n,f=-f,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Ne,skewX:Math.atan(f)*Ne,scaleX:a,scaleY:u}}function ke(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u=[],f=[];return o=t(o),a=t(a),function(t,r,i,o,a,u){if(t!==i||r!==o){var f=a.push("translate(",null,n,null,e);u.push({i:f-4,x:ve(t,i)},{i:f-2,x:ve(r,o)})}else(i||o)&&a.push("translate("+i+n+o+e)}(o.translateX,o.translateY,a.translateX,a.translateY,u,f),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:ve(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,f),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:ve(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,f),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:ve(t,e)},{i:u-2,x:ve(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,f),o=a=null,function(t){for(var n,e=-1,r=f.length;++e<r;)u[(n=f[e]).i]=n.x(t);return u.join("")}}}var Ce=ke(function(t){return"none"===t?Se:(we||(we=document.createElement("DIV"),Me=document.documentElement,Ae=document.defaultView),we.style.transform=t,t=Ae.getComputedStyle(Me.appendChild(we),null).getPropertyValue("transform"),Me.removeChild(we),Ee(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},"px, ","px)","deg)"),Pe=ke(function(t){return null==t?Se:(Te||(Te=document.createElementNS("http://www.w3.org/2000/svg","g")),Te.setAttribute("transform",t),(t=Te.transform.baseVal.consolidate())?Ee((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Se)},", ",")",")"),ze=Math.SQRT2,Re=2,Le=4,De=1e-12;function Ue(t){return((t=Math.exp(t))+1/t)/2}function qe(t,n){var e,r,i=t[0],o=t[1],a=t[2],u=n[0],f=n[1],c=n[2],s=u-i,l=f-o,h=s*s+l*l;if(h<De)r=Math.log(c/a)/ze,e=function(t){return[i+t*s,o+t*l,a*Math.exp(ze*t*r)]};else{var d=Math.sqrt(h),p=(c*c-a*a+Le*h)/(2*a*Re*d),v=(c*c-a*a-Le*h)/(2*c*Re*d),g=Math.log(Math.sqrt(p*p+1)-p),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-g)/ze,e=function(t){var n,e=t*r,u=Ue(g),f=a/(Re*d)*(u*(n=ze*e+g,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+f*s,o+f*l,a*u/Ue(ze*e+g)]}}return e.duration=1e3*r,e}function Oe(t){return function(n,e){var r=t((n=Mn(n)).h,(e=Mn(e)).h),i=fe(n.s,e.s),o=fe(n.l,e.l),a=fe(n.opacity,e.opacity);return function(t){return n.h=r(t),n.s=i(t),n.l=o(t),n.opacity=a(t),n+""}}}var Ye=Oe(ae),Be=Oe(fe);function Fe(t){return function(n,e){var r=t((n=Hn(n)).h,(e=Hn(e)).h),i=fe(n.c,e.c),o=fe(n.l,e.l),a=fe(n.opacity,e.opacity);return function(t){return n.h=r(t),n.c=i(t),n.l=o(t),n.opacity=a(t),n+""}}}var Ie=Fe(ae),He=Fe(fe);function je(t){return function n(e){function r(n,r){var i=t((n=Kn(n)).h,(r=Kn(r)).h),o=fe(n.s,r.s),a=fe(n.l,r.l),u=fe(n.opacity,r.opacity);return function(t){return n.h=i(t),n.s=o(t),n.l=a(Math.pow(t,e)),n.opacity=u(t),n+""}}return e=+e,r.gamma=n,r}(1)}var Xe=je(ae),Ge=je(fe);var Ve,$e,We=0,Ze=0,Qe=0,Je=1e3,Ke=0,tr=0,nr=0,er="object"==typeof performance&&performance.now?performance:Date,rr="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ir(){return tr||(rr(or),tr=er.now()+nr)}function or(){tr=0}function ar(){this._call=this._time=this._next=null}function ur(t,n,e){var r=new ar;return r.restart(t,n,e),r}function fr(){ir(),++We;for(var t,n=Ve;n;)(t=tr-n._time)>=0&&n._call.call(null,t),n=n._next;--We}function cr(){tr=(Ke=er.now())+nr,We=Ze=0;try{fr()}finally{We=0,function(){var t,n,e=Ve,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ve=n);$e=t,lr(r)}(),tr=0}}function sr(){var t=er.now(),n=t-Ke;n>Je&&(nr-=n,Ke=t)}function lr(t){We||(Ze&&(Ze=clearTimeout(Ze)),t-tr>24?(t<1/0&&(Ze=setTimeout(cr,t-er.now()-nr)),Qe&&(Qe=clearInterval(Qe))):(Qe||(Ke=er.now(),Qe=setInterval(sr,Je)),We=1,rr(cr)))}function hr(t,n,e){var r=new ar;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r}ar.prototype=ur.prototype={constructor:ar,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?ir():+e)+(null==n?0:+n),this._next||$e===this||($e?$e._next=this:Ve=this,$e=this),this._call=t,this._time=e,lr()},stop:function(){this._call&&(this._call=null,this._time=1/0,lr())}};var dr=I("start","end","interrupt"),pr=[],vr=0,gr=1,yr=2,_r=3,br=4,mr=5,xr=6;function wr(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(f){var c,s,l,h;if(e.state!==gr)return u();for(c in i)if((h=i[c]).name===e.name){if(h.state===_r)return hr(o);h.state===br?(h.state=xr,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+c<n&&(h.state=xr,h.timer.stop(),delete i[c])}if(hr(function(){e.state===_r&&(e.state=br,e.timer.restart(a,e.delay,e.time),a(f))}),e.state=yr,e.on.call("start",t,t.__data__,e.index,e.group),e.state===yr){for(e.state=_r,r=new Array(l=e.tween.length),c=0,s=-1;c<l;++c)(h=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(r[++s]=h);r.length=s+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(u),e.state=mr,1),o=-1,a=r.length;++o<a;)r[o].call(null,i);e.state===mr&&(e.on.call("end",t,t.__data__,e.index,e.group),u())}function u(){for(var r in e.state=xr,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=ur(function(t){e.state=gr,e.timer.restart(o,e.delay,e.time),e.delay<=t&&o(t-e.delay)},0,e.time)}(t,e,{name:n,index:r,group:i,on:dr,tween:pr,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:vr})}function Mr(t,n){var e=Tr(t,n);if(e.state>vr)throw new Error("too late; already scheduled");return e}function Ar(t,n){var e=Tr(t,n);if(e.state>yr)throw new Error("too late; already started");return e}function Tr(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Nr(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>yr&&e.state<mr,e.state=xr,e.timer.stop(),r&&e.on.call("interrupt",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}function Sr(t,n,e){var r=t._id;return t.each(function(){var t=Ar(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Tr(t,r).value[n]}}function Er(t,n){var e;return("number"==typeof n?ve:n instanceof vn?ce:(e=vn(n))?(n=e,ce):be)(t,n)}var kr=Lt.prototype.constructor;var Cr=0;function Pr(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function zr(t){return Lt().transition(t)}function Rr(){return++Cr}var Lr=Lt.prototype;function Dr(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function Ur(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Pr.prototype=zr.prototype={constructor:Pr,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=Q(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var u,f,c=r[a],s=c.length,l=o[a]=new Array(s),h=0;h<s;++h)(u=c[h])&&(f=t.call(u,u.__data__,h,c))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,wr(l[h],n,e,h,l,Tr(u,e)));return new Pr(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=K(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var f,c=r[u],s=c.length,l=0;l<s;++l)if(f=c[l]){for(var h,d=t.call(f,f.__data__,l,c),p=Tr(f,e),v=0,g=d.length;v<g;++v)(h=d[v])&&wr(h,n,e,v,d,p);o.push(d),a.push(f)}return new Pr(o,a,n,e)},filter:function(t){"function"!=typeof t&&(t=rt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,f=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&f.push(o);return new Pr(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var f,c=n[u],s=e[u],l=c.length,h=a[u]=new Array(l),d=0;d<l;++d)(f=c[d]||s[d])&&(h[d]=f);for(;u<r;++u)a[u]=n[u];return new Pr(a,this._parents,this._name,this._id)},selection:function(){return new kr(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=Rr(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],f=u.length,c=0;c<f;++c)if(a=u[c]){var s=Tr(a,n);wr(a,t,e,c,u,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Pr(r,this._parents,t,e)},call:Lr.call,nodes:Lr.nodes,node:Lr.node,size:Lr.size,empty:Lr.empty,each:Lr.each,on:function(t,n){var e=this._id;return arguments.length<2?Tr(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?Mr:Ar;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=$(t),r="transform"===e?Pe:Er;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var a,u=e(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===u?null:a===r&&u===i?o:o=n(r=a,i=u);this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var a,u=e(this);if(null!=u)return(a=this.getAttribute(t))===u?null:a===r&&u===i?o:o=n(r=a,i=u);this.removeAttribute(t)}})(e,r,Sr(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}:function(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}})(e,r,n+""))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=$(t);return this.tween(e,(r.local?function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}:function(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Ce:Er;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=lt(this,t),a=(this.style.removeProperty(t),lt(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function(t,n,e){var r,i,o;return function(){var a=lt(this,t),u=e(this);return null==u&&(this.style.removeProperty(t),u=lt(this,t)),a===u?null:a===r&&u===i?o:o=n(r=a,i=u)}}(t,r,Sr(this,"style."+t,n)):function(t,n,e){var r,i;return function(){var o=lt(this,t);return o===e?null:o===r?i:i=n(r=o,e)}}(t,r,n+""),e)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Sr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Tr(this.node(),e).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?function(t,n){var e,r;return function(){var i=Ar(this,t),o=i.tween;if(o!==e)for(var a=0,u=(r=e=o).length;a<u;++a)if(r[a].name===n){(r=r.slice()).splice(a,1);break}i.tween=r}}:function(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Ar(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:n,value:e},f=0,c=i.length;f<c;++f)if(i[f].name===n){i[f]=u;break}f===c&&i.push(u)}o.tween=i}})(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?function(t,n){return function(){Mr(this,t).delay=+n.apply(this,arguments)}}:function(t,n){return n=+n,function(){Mr(this,t).delay=n}})(n,t)):Tr(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?function(t,n){return function(){Ar(this,t).duration=+n.apply(this,arguments)}}:function(t,n){return n=+n,function(){Ar(this,t).duration=n}})(n,t)):Tr(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){Ar(this,t).ease=n}}(n,t)):Tr(this.node(),n).ease}};var qr=function t(n){function e(t){return Math.pow(t,n)}return n=+n,e.exponent=t,e}(3),Or=function t(n){function e(t){return 1-Math.pow(1-t,n)}return n=+n,e.exponent=t,e}(3),Yr=function t(n){function e(t){return((t*=2)<=1?Math.pow(t,n):2-Math.pow(2-t,n))/2}return n=+n,e.exponent=t,e}(3),Br=Math.PI,Fr=Br/2;function Ir(t){return(1-Math.cos(Br*t))/2}function Hr(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function jr(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Xr=4/11,Gr=6/11,Vr=8/11,$r=.75,Wr=9/11,Zr=10/11,Qr=.9375,Jr=21/22,Kr=63/64,ti=1/Xr/Xr;function ni(t){return(t=+t)<Xr?ti*t*t:t<Vr?ti*(t-=Gr)*t+$r:t<Zr?ti*(t-=Wr)*t+Qr:ti*(t-=Jr)*t+Kr}var ei=function t(n){function e(t){return t*t*((n+1)*t-n)}return n=+n,e.overshoot=t,e}(1.70158),ri=function t(n){function e(t){return--t*t*((n+1)*t+n)+1}return n=+n,e.overshoot=t,e}(1.70158),ii=function t(n){function e(t){return((t*=2)<1?t*t*((n+1)*t-n):(t-=2)*t*((n+1)*t+n)+2)/2}return n=+n,e.overshoot=t,e}(1.70158),oi=2*Math.PI,ai=function t(n,e){var r=Math.asin(1/(n=Math.max(1,n)))*(e/=oi);function i(t){return n*Math.pow(2,10*--t)*Math.sin((r-t)/e)}return i.amplitude=function(n){return t(n,e*oi)},i.period=function(e){return t(n,e)},i}(1,.3),ui=function t(n,e){var r=Math.asin(1/(n=Math.max(1,n)))*(e/=oi);function i(t){return 1-n*Math.pow(2,-10*(t=+t))*Math.sin((t+r)/e)}return i.amplitude=function(n){return t(n,e*oi)},i.period=function(e){return t(n,e)},i}(1,.3),fi=function t(n,e){var r=Math.asin(1/(n=Math.max(1,n)))*(e/=oi);function i(t){return((t=2*t-1)<0?n*Math.pow(2,10*t)*Math.sin((r-t)/e):2-n*Math.pow(2,-10*t)*Math.sin((r+t)/e))/2}return i.amplitude=function(n){return t(n,e*oi)},i.period=function(e){return t(n,e)},i}(1,.3),ci={time:null,delay:0,duration:250,ease:Ur};function si(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return ci.time=ir(),ci;return e}Lt.prototype.interrupt=function(t){return this.each(function(){Nr(this,t)})},Lt.prototype.transition=function(t){var n,e;t instanceof Pr?(n=t._id,t=t._name):(n=Rr(),(e=ci).time=ir(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],f=u.length,c=0;c<f;++c)(a=u[c])&&wr(a,t,n,c,u,e||si(a,n));return new Pr(r,this._parents,t,n)};var li=[null];function hi(t){return function(){return t}}function di(t,n,e){this.target=t,this.type=n,this.selection=e}function pi(){t.event.stopImmediatePropagation()}function vi(){t.event.preventDefault(),t.event.stopImmediatePropagation()}var gi={name:"drag"},yi={name:"space"},_i={name:"handle"},bi={name:"center"},mi={name:"x",handles:["e","w"].map(Ei),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},xi={name:"y",handles:["n","s"].map(Ei),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},wi={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(Ei),input:function(t){return t},output:function(t){return t}},Mi={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ai={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Ti={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ni={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Si={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ei(t){return{type:t}}function ki(){return!t.event.button}function Ci(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Pi(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function zi(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Ri(n){var e,r=Ci,i=ki,o=I(u,"start","brush","end"),a=6;function u(t){var e=t.property("__brush",h).selectAll(".overlay").data([Ei("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Mi.overlay).merge(e).each(function(){var t=Pi(this).extent;Dt(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),t.selectAll(".selection").data([Ei("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Mi.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=t.selectAll(".handle").data(n.handles,function(t){return t.type});r.exit().remove(),r.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return Mi[t.type]}),t.each(f).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",l)}function f(){var t=Dt(this),n=Pi(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?n[1][0]-a/2:n[0][0]-a/2}).attr("y",function(t){return"s"===t.type[0]?n[1][1]-a/2:n[0][1]-a/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+a:a}).attr("height",function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+a:a})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(t,n){return t.__brush.emitter||new s(t,n)}function s(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function l(){if(t.event.touches){if(t.event.changedTouches.length<t.event.touches.length)return vi()}else if(e)return;if(i.apply(this,arguments)){var r,o,a,u,s,l,h,d,p,v,g,y,_,b=this,m=t.event.target.__data__.type,x="selection"===(t.event.metaKey?m="overlay":m)?gi:t.event.altKey?bi:_i,w=n===xi?null:Ni[m],M=n===mi?null:Si[m],A=Pi(b),T=A.extent,N=A.selection,S=T[0][0],E=T[0][1],k=T[1][0],C=T[1][1],P=w&&M&&t.event.shiftKey,z=Ft(b),R=z,L=c(b,arguments).beforestart();"overlay"===m?A.selection=N=[[r=n===xi?S:z[0],a=n===mi?E:z[1]],[s=n===xi?k:r,h=n===mi?C:a]]:(r=N[0][0],a=N[0][1],s=N[1][0],h=N[1][1]),o=r,u=a,l=s,d=h;var D=Dt(b).attr("pointer-events","none"),U=D.selectAll(".overlay").attr("cursor",Mi[m]);if(t.event.touches)D.on("touchmove.brush",O,!0).on("touchend.brush touchcancel.brush",B,!0);else{var q=Dt(t.event.view).on("keydown.brush",function(){switch(t.event.keyCode){case 16:P=w&&M;break;case 18:x===_i&&(w&&(s=l-p*w,r=o+p*w),M&&(h=d-v*M,a=u+v*M),x=bi,Y());break;case 32:x!==_i&&x!==bi||(w<0?s=l-p:w>0&&(r=o-p),M<0?h=d-v:M>0&&(a=u-v),x=yi,U.attr("cursor",Mi.selection),Y());break;default:return}vi()},!0).on("keyup.brush",function(){switch(t.event.keyCode){case 16:P&&(y=_=P=!1,Y());break;case 18:x===bi&&(w<0?s=l:w>0&&(r=o),M<0?h=d:M>0&&(a=u),x=_i,Y());break;case 32:x===yi&&(t.event.altKey?(w&&(s=l-p*w,r=o+p*w),M&&(h=d-v*M,a=u+v*M),x=bi):(w<0?s=l:w>0&&(r=o),M<0?h=d:M>0&&(a=u),x=_i),U.attr("cursor",Mi[m]),Y());break;default:return}vi()},!0).on("mousemove.brush",O,!0).on("mouseup.brush",B,!0);Xt(t.event.view)}pi(),Nr(b),f.call(b),L.start()}function O(){var t=Ft(b);!P||y||_||(Math.abs(t[0]-R[0])>Math.abs(t[1]-R[1])?_=!0:y=!0),R=t,g=!0,vi(),Y()}function Y(){var t;switch(p=R[0]-z[0],v=R[1]-z[1],x){case yi:case gi:w&&(p=Math.max(S-r,Math.min(k-s,p)),o=r+p,l=s+p),M&&(v=Math.max(E-a,Math.min(C-h,v)),u=a+v,d=h+v);break;case _i:w<0?(p=Math.max(S-r,Math.min(k-r,p)),o=r+p,l=s):w>0&&(p=Math.max(S-s,Math.min(k-s,p)),o=r,l=s+p),M<0?(v=Math.max(E-a,Math.min(C-a,v)),u=a+v,d=h):M>0&&(v=Math.max(E-h,Math.min(C-h,v)),u=a,d=h+v);break;case bi:w&&(o=Math.max(S,Math.min(k,r-p*w)),l=Math.max(S,Math.min(k,s+p*w))),M&&(u=Math.max(E,Math.min(C,a-v*M)),d=Math.max(E,Math.min(C,h+v*M)))}l<o&&(w*=-1,t=r,r=s,s=t,t=o,o=l,l=t,m in Ai&&U.attr("cursor",Mi[m=Ai[m]])),d<u&&(M*=-1,t=a,a=h,h=t,t=u,u=d,d=t,m in Ti&&U.attr("cursor",Mi[m=Ti[m]])),A.selection&&(N=A.selection),y&&(o=N[0][0],l=N[1][0]),_&&(u=N[0][1],d=N[1][1]),N[0][0]===o&&N[0][1]===u&&N[1][0]===l&&N[1][1]===d||(A.selection=[[o,u],[l,d]],f.call(b),L.brush())}function B(){if(pi(),t.event.touches){if(t.event.touches.length)return;e&&clearTimeout(e),e=setTimeout(function(){e=null},500),D.on("touchmove.brush touchend.brush touchcancel.brush",null)}else Gt(t.event.view,g),q.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);D.attr("pointer-events","all"),U.attr("cursor",Mi.overlay),A.selection&&(N=A.selection),zi(N)&&(A.selection=null,f.call(b)),L.end()}}function h(){var t=this.__brush||{selection:null};return t.extent=r.apply(this,arguments),t.dim=n,t}return u.move=function(t,e){t.selection?t.on("start.brush",function(){c(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){c(this,arguments).end()}).tween("brush",function(){var t=this,r=t.__brush,i=c(t,arguments),o=r.selection,a=n.input("function"==typeof e?e.apply(this,arguments):e,r.extent),u=me(o,a);function s(n){r.selection=1===n&&zi(a)?null:u(n),f.call(t),i.brush()}return o&&a?s:s(1)}):t.each(function(){var t=arguments,r=this.__brush,i=n.input("function"==typeof e?e.apply(this,t):e,r.extent),o=c(this,t).beforestart();Nr(this),r.selection=null==i||zi(i)?null:i,f.call(this),o.start().brush().end()})},s.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting&&(this.starting=!1,this.emit("start")),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(t){Ct(new di(u,t,n.output(this.state.selection)),o.apply,o,[t,this.that,this.args])}},u.extent=function(t){return arguments.length?(r="function"==typeof t?t:hi([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),u):r},u.filter=function(t){return arguments.length?(i="function"==typeof t?t:hi(!!t),u):i},u.handleSize=function(t){return arguments.length?(a=+t,u):a},u.on=function(){var t=o.on.apply(o,arguments);return t===o?u:t},u}var Li=Math.cos,Di=Math.sin,Ui=Math.PI,qi=Ui/2,Oi=2*Ui,Yi=Math.max;var Bi=Array.prototype.slice;function Fi(t){return function(){return t}}var Ii=Math.PI,Hi=2*Ii,ji=Hi-1e-6;function Xi(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Gi(){return new Xi}function Vi(t){return t.source}function $i(t){return t.target}function Wi(t){return t.radius}function Zi(t){return t.startAngle}function Qi(t){return t.endAngle}Xi.prototype=Gi.prototype={constructor:Xi,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,o){this._+="C"+ +t+","+ +n+","+ +e+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var o=this._x1,a=this._y1,u=e-t,f=r-n,c=o-t,s=a-n,l=c*c+s*s;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(l>1e-6)if(Math.abs(s*u-f*c)>1e-6&&i){var h=e-o,d=r-a,p=u*u+f*f,v=h*h+d*d,g=Math.sqrt(p),y=Math.sqrt(l),_=i*Math.tan((Ii-Math.acos((p+l-v)/(2*g*y)))/2),b=_/y,m=_/g;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*c)+","+(n+b*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>c*d)+","+(this._x1=t+m*u)+","+(this._y1=n+m*f)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),f=t+a,c=n+u,s=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+f+","+c:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+f+","+c),e&&(l<0&&(l=l%Hi+Hi),l>ji?this._+="A"+e+","+e+",0,1,"+s+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+s+","+(this._x1=f)+","+(this._y1=c):l>1e-6&&(this._+="A"+e+","+e+",0,"+ +(l>=Ii)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};function Ji(){}function Ki(t,n){var e=new Ji;if(t instanceof Ji)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var a in t)e.set(a,t[a]);return e}function to(){return{}}function no(t,n,e){t[n]=e}function eo(){return Ki()}function ro(t,n,e){t.set(n,e)}function io(){}Ji.prototype=Ki.prototype={constructor:Ji,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var oo=Ki.prototype;function ao(t,n){var e=new io;if(t instanceof io)t.each(function(t){e.add(t)});else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else for(;++r<i;)e.add(n(t[r],r,t))}return e}io.prototype=ao.prototype={constructor:io,has:oo.has,add:function(t){return this["$"+(t+="")]=t,this},remove:oo.remove,clear:oo.clear,values:oo.keys,size:oo.size,empty:oo.empty,each:oo.each};var uo=Array.prototype.slice;function fo(t,n){return t-n}function co(t){return function(){return t}}function so(t,n){for(var e,r=-1,i=n.length;++r<i;)if(e=lo(t,n[r]))return e;return 0}function lo(t,n){for(var e=n[0],r=n[1],i=-1,o=0,a=t.length,u=a-1;o<a;u=o++){var f=t[o],c=f[0],s=f[1],l=t[u],h=l[0],d=l[1];if(ho(f,l,n))return 0;s>r!=d>r&&e<(h-c)*(r-s)/(d-s)+c&&(i=-i)}return i}function ho(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function po(){}var vo=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function go(){var t=1,n=1,e=M,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(fo);else{var r=s(t),i=r[0],a=r[1];n=w(i,a,n),n=g(Math.floor(i/n)*n,Math.floor(a/n)*n,n)}return n.map(function(n){return o(t,n)})}function o(e,i){var o=[],u=[];return function(e,r,i){var o,u,f,c,s,l,h=new Array,d=new Array;o=u=-1,c=e[0]>=r,vo[c<<1].forEach(p);for(;++o<t-1;)f=c,c=e[o+1]>=r,vo[f|c<<1].forEach(p);vo[c<<0].forEach(p);for(;++u<n-1;){for(o=-1,c=e[u*t+t]>=r,s=e[u*t]>=r,vo[c<<1|s<<2].forEach(p);++o<t-1;)f=c,c=e[u*t+t+o+1]>=r,l=s,s=e[u*t+o+1]>=r,vo[f|c<<1|s<<2|l<<3].forEach(p);vo[c|s<<3].forEach(p)}o=-1,s=e[u*t]>=r,vo[s<<2].forEach(p);for(;++o<t-1;)l=s,s=e[u*t+o+1]>=r,vo[s<<2|l<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+o,t[0][1]+u],f=[t[1][0]+o,t[1][1]+u],c=a(r),s=a(f);(n=d[c])?(e=h[s])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(f),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(f),d[n.end=s]=n):(n=h[s])?(e=d[c])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(f),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=c]=n):h[c]=d[s]={start:c,end:s,ring:[r,f]}}vo[s<<3].forEach(p)}(e,i,function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n<e;)r+=t[n-1][1]*t[n][0]-t[n-1][0]*t[n][1];return r}(t)>0?o.push([t]):u.push(t)}),u.forEach(function(t){for(var n,e=0,r=o.length;e<r;++e)if(-1!==so((n=o[e])[0],t))return void n.push(t)}),{type:"MultiPolygon",value:i,coordinates:o}}function a(n){return 2*n[0]+n[1]*(t+1)*4}function u(e,r,i){e.forEach(function(e){var o,a=e[0],u=e[1],f=0|a,c=0|u,s=r[c*t+f];a>0&&a<t&&f===a&&(o=r[c*t+f-1],e[0]=a+(i-o)/(s-o)-.5),u>0&&u<n&&c===u&&(o=r[(c-1)*t+f],e[1]=u+(i-o)/(s-o)-.5)})}return i.contour=o,i.size=function(e){if(!arguments.length)return[t,n];var r=Math.ceil(e[0]),o=Math.ceil(e[1]);if(!(r>0&&o>0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?co(uo.call(t)):co(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:po,i):r===u},i}function yo(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a<i;++a)for(var u=0,f=0;u<r+e;++u)u<r&&(f+=t.data[u+a*r]),u>=e&&(u>=o&&(f-=t.data[u-o+a*r]),n.data[u-e+a*r]=f/Math.min(u+1,r-1+o-u,o))}function _o(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a<r;++a)for(var u=0,f=0;u<i+e;++u)u<i&&(f+=t.data[a+u*r]),u>=e&&(u>=o&&(f-=t.data[a+(u-o)*r]),n.data[a+(u-e)*r]=f/Math.min(u+1,i-1+o-u,o))}function bo(t){return t[0]}function mo(t){return t[1]}function xo(){return 1}var wo={},Mo={},Ao=34,To=10,No=13;function So(t){return new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}")}function Eo(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],o=t.length,a=0,u=0,f=o<=0,c=!1;function s(){if(f)return Mo;if(c)return c=!1,wo;var n,r,i=a;if(t.charCodeAt(i)===Ao){for(;a++<o&&t.charCodeAt(a)!==Ao||t.charCodeAt(++a)===Ao;);return(n=a)>=o?f=!0:(r=t.charCodeAt(a++))===To?c=!0:r===No&&(c=!0,t.charCodeAt(a)===To&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;a<o;){if((r=t.charCodeAt(n=a++))===To)c=!0;else if(r===No)c=!0,t.charCodeAt(a)===To&&++a;else if(r!==e)continue;return t.slice(i,n)}return f=!0,t.slice(i,o)}for(t.charCodeAt(o-1)===To&&--o,t.charCodeAt(o-1)===No&&--o;(r=s())!==Mo;){for(var l=[];r!==wo&&r!==Mo;)l.push(r),r=s();n&&null==(l=n(l,u++))||i.push(l)}return i}function i(n){return n.map(o).join(t)}function o(t){return null==t?"":n.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,n){var e,i,o=r(t,function(t,r){if(e)return e(t,r-1);i=t,e=n?function(t,n){var e=So(t);return function(r,i){return n(e(r),i,t)}}(t,n):So(t)});return o.columns=i||[],o},parseRows:r,format:function(n,e){return null==e&&(e=function(t){var n=Object.create(null),e=[];return t.forEach(function(t){for(var r in t)r in n||e.push(n[r]=r)}),e}(n)),[e.map(o).join(t)].concat(n.map(function(n){return e.map(function(t){return o(n[t])}).join(t)})).join("\n")},formatRows:function(t){return t.map(i).join("\n")}}}var ko=Eo(","),Co=ko.parse,Po=ko.parseRows,zo=ko.format,Ro=ko.formatRows,Lo=Eo("\t"),Do=Lo.parse,Uo=Lo.parseRows,qo=Lo.format,Oo=Lo.formatRows;function Yo(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function Bo(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function Fo(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Io(t,n){return fetch(t,n).then(Fo)}function Ho(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=void 0),Io(n,e).then(function(n){return t(n,r)})}}var jo=Ho(Co),Xo=Ho(Do);function Go(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}function Vo(t){return function(n,e){return Io(n,e).then(function(n){return(new DOMParser).parseFromString(n,t)})}}var $o=Vo("application/xml"),Wo=Vo("text/html"),Zo=Vo("image/svg+xml");function Qo(t){return function(){return t}}function Jo(){return 1e-6*(Math.random()-.5)}function Ko(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,u,f,c,s,l,h,d=t._root,p={data:r},v=t._x0,g=t._y0,y=t._x1,_=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=n>=(o=(v+y)/2))?v=o:y=o,(s=e>=(a=(g+_)/2))?g=a:_=a,i=d,!(d=d[l=s<<1|c]))return i[l]=p,t;if(u=+t._x.call(null,d.data),f=+t._y.call(null,d.data),n===u&&e===f)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=n>=(o=(v+y)/2))?v=o:y=o,(s=e>=(a=(g+_)/2))?g=a:_=a}while((l=s<<1|c)==(h=(f>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function ta(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function na(t){return t[0]}function ea(t){return t[1]}function ra(t,n,e){var r=new ia(null==n?na:n,null==e?ea:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ia(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function oa(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var aa=ra.prototype=ia.prototype;function ua(t){return t.x+t.vx}function fa(t){return t.y+t.vy}function ca(t){return t.index}function sa(t,n){var e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function la(t){return t.x}function ha(t){return t.y}aa.copy=function(){var t,n,e=new ia(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=oa(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=oa(n));return e},aa.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return Ko(this.cover(n,e),n,e,t)},aa.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),f=1/0,c=1/0,s=-1/0,l=-1/0;for(e=0;e<o;++e)isNaN(r=+this._x.call(null,n=t[e]))||isNaN(i=+this._y.call(null,n))||(a[e]=r,u[e]=i,r<f&&(f=r),r>s&&(s=r),i<c&&(c=i),i>l&&(l=i));for(s<f&&(f=this._x0,s=this._x1),l<c&&(c=this._y0,l=this._y1),this.cover(f,c).cover(s,l),e=0;e<o;++e)Ko(this,a[e],u[e],t[e]);return this},aa.cover=function(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{if(!(e>t||t>i||r>n||n>o))return this;var a,u,f=i-e,c=this._root;switch(u=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{(a=new Array(4))[u]=c,c=a}while(o=r+(f*=2),t>(i=e+f)||n>o);break;case 1:do{(a=new Array(4))[u]=c,c=a}while(o=r+(f*=2),(e=i-f)>t||n>o);break;case 2:do{(a=new Array(4))[u]=c,c=a}while(r=o-(f*=2),t>(i=e+f)||r>n);break;case 3:do{(a=new Array(4))[u]=c,c=a}while(r=o-(f*=2),(e=i-f)>t||r>n)}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},aa.data=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},aa.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},aa.find=function(t,n,e){var r,i,o,a,u,f,c,s=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],v=this._root;for(v&&p.push(new ta(v,s,l,h,d)),null==e?e=1/0:(s=t-e,l=n-e,h=t+e,d=n+e,e*=e);f=p.pop();)if(!(!(v=f.node)||(i=f.x0)>h||(o=f.y0)>d||(a=f.x1)<s||(u=f.y1)<l))if(v.length){var g=(i+a)/2,y=(o+u)/2;p.push(new ta(v[3],g,y,a,u),new ta(v[2],i,y,g,u),new ta(v[1],g,o,a,y),new ta(v[0],i,o,g,y)),(c=(n>=y)<<1|t>=g)&&(f=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=f)}else{var _=t-+this._x.call(null,v.data),b=n-+this._y.call(null,v.data),m=_*_+b*b;if(m<e){var x=Math.sqrt(e=m);s=t-x,l=n-x,h=t+x,d=n+x,r=v.data}}return r},aa.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var n,e,r,i,o,a,u,f,c,s,l,h,d=this._root,p=this._x0,v=this._y0,g=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((c=o>=(u=(p+g)/2))?p=u:g=u,(s=a>=(f=(v+y)/2))?v=f:y=f,n=d,!(d=d[l=s<<1|c]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},aa.removeAll=function(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this},aa.root=function(){return this._root},aa.size=function(){var t=0;return this.visit(function(n){if(!n.length)do{++t}while(n=n.next)}),t},aa.visit=function(t){var n,e,r,i,o,a,u=[],f=this._root;for(f&&u.push(new ta(f,this._x0,this._y0,this._x1,this._y1));n=u.pop();)if(!t(f=n.node,r=n.x0,i=n.y0,o=n.x1,a=n.y1)&&f.length){var c=(r+o)/2,s=(i+a)/2;(e=f[3])&&u.push(new ta(e,c,s,o,a)),(e=f[2])&&u.push(new ta(e,r,s,c,a)),(e=f[1])&&u.push(new ta(e,c,i,o,s)),(e=f[0])&&u.push(new ta(e,r,i,c,s))}return this},aa.visitAfter=function(t){var n,e=[],r=[];for(this._root&&e.push(new ta(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,a=n.x0,u=n.y0,f=n.x1,c=n.y1,s=(a+f)/2,l=(u+c)/2;(o=i[0])&&e.push(new ta(o,a,u,s,l)),(o=i[1])&&e.push(new ta(o,s,u,f,l)),(o=i[2])&&e.push(new ta(o,a,l,s,c)),(o=i[3])&&e.push(new ta(o,s,l,f,c))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},aa.x=function(t){return arguments.length?(this._x=t,this):this._x},aa.y=function(t){return arguments.length?(this._y=t,this):this._y};var da=10,pa=Math.PI*(3-Math.sqrt(5));function va(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function ga(t){return(t=va(Math.abs(t)))?t[1]:NaN}var ya,_a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ba(t){return new ma(t)}function ma(t){if(!(n=_a.exec(t)))throw new Error("invalid format: "+t);var n;this.fill=n[1]||" ",this.align=n[2]||">",this.sign=n[3]||"-",this.symbol=n[4]||"",this.zero=!!n[5],this.width=n[6]&&+n[6],this.comma=!!n[7],this.precision=n[8]&&+n[8].slice(1),this.trim=!!n[9],this.type=n[10]||""}function xa(t,n){var e=va(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}ba.prototype=ma.prototype,ma.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var wa={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return xa(100*t,n)},r:xa,s:function(t,n){var e=va(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(ya=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+va(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function Ma(t){return t}var Aa,Ta=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Na(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,o=[],a=0,u=n[0],f=0;i>0&&u>0&&(f+u+1>r&&(u=Math.max(1,r-f)),o.push(t.substring(i-=u,i+u)),!((f+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}):Ma,i=t.currency,o=t.decimal,a=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}}(t.numerals):Ma,u=t.percent||"%";function f(t){var n=(t=ba(t)).fill,e=t.align,f=t.sign,c=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.trim,v=t.type;"n"===v?(h=!0,v="g"):wa[v]||(null==d&&(d=12),p=!0,v="g"),(s||"0"===n&&"="===e)&&(s=!0,n="0",e="=");var g="$"===c?i[0]:"#"===c&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===c?i[1]:/[%p]/.test(v)?u:"",_=wa[v],b=/[defgprs%]/.test(v);function m(t){var i,u,c,m=g,x=y;if("c"===v)x=_(t)+x,t="";else{var w=(t=+t)<0;if(t=_(Math.abs(t),d),p&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case".":i=n=r;break;case"0":0===i&&(i=r),n=r;break;default:if(i>0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),w&&0==+t&&(w=!1),m=(w?"("===f?f:"-":"-"===f||"("===f?"":f)+m,x=("s"===v?Ta[8+ya/3]:"")+x+(w&&"("===f?")":""),b)for(i=-1,u=t.length;++i<u;)if(48>(c=t.charCodeAt(i))||c>57){x=(46===c?o+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var M=m.length+t.length+x.length,A=M<l?new Array(l-M+1).join(n):"";switch(h&&s&&(t=r(A+t,A.length?l-x.length:1/0),A=""),e){case"<":t=m+t+x+A;break;case"=":t=m+A+t+x;break;case"^":t=A.slice(0,M=A.length>>1)+m+t+x+A.slice(M);break;default:t=A+m+t+x}return a(t)}return d=null==d?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:f,formatPrefix:function(t,n){var e=f(((t=ba(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ga(n)/3))),i=Math.pow(10,-r),o=Ta[8+r/3];return function(t){return e(i*t)+o}}}}function Sa(n){return Aa=Na(n),t.format=Aa.format,t.formatPrefix=Aa.formatPrefix,Aa}function Ea(t){return Math.max(0,-ga(Math.abs(t)))}function ka(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ga(n)/3)))-ga(Math.abs(t)))}function Ca(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ga(n)-ga(t))+1}function Pa(){return new za}function za(){this.reset()}Sa({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),za.prototype={constructor:za,reset:function(){this.s=this.t=0},add:function(t){La(Ra,t,this.t),La(this,Ra.s,this.s),this.s?this.t+=Ra.t:this.s=Ra.t},valueOf:function(){return this.s}};var Ra=new za;function La(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}var Da=1e-6,Ua=1e-12,qa=Math.PI,Oa=qa/2,Ya=qa/4,Ba=2*qa,Fa=180/qa,Ia=qa/180,Ha=Math.abs,ja=Math.atan,Xa=Math.atan2,Ga=Math.cos,Va=Math.ceil,$a=Math.exp,Wa=Math.log,Za=Math.pow,Qa=Math.sin,Ja=Math.sign||function(t){return t>0?1:t<0?-1:0},Ka=Math.sqrt,tu=Math.tan;function nu(t){return t>1?0:t<-1?qa:Math.acos(t)}function eu(t){return t>1?Oa:t<-1?-Oa:Math.asin(t)}function ru(t){return(t=Qa(t/2))*t}function iu(){}function ou(t,n){t&&uu.hasOwnProperty(t.type)&&uu[t.type](t,n)}var au={Feature:function(t,n){ou(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)ou(e[r].geometry,n)}},uu={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){fu(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)fu(e[r],n,0)},Polygon:function(t,n){cu(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)cu(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)ou(e[r],n)}};function fu(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i<o;)r=t[i],n.point(r[0],r[1],r[2]);n.lineEnd()}function cu(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)fu(t[e],n,1);n.polygonEnd()}function su(t,n){t&&au.hasOwnProperty(t.type)?au[t.type](t,n):ou(t,n)}var lu,hu,du,pu,vu,gu=Pa(),yu=Pa(),_u={point:iu,lineStart:iu,lineEnd:iu,polygonStart:function(){gu.reset(),_u.lineStart=bu,_u.lineEnd=mu},polygonEnd:function(){var t=+gu;yu.add(t<0?Ba+t:t),this.lineStart=this.lineEnd=this.point=iu},sphere:function(){yu.add(Ba)}};function bu(){_u.point=xu}function mu(){wu(lu,hu)}function xu(t,n){_u.point=wu,lu=t,hu=n,du=t*=Ia,pu=Ga(n=(n*=Ia)/2+Ya),vu=Qa(n)}function wu(t,n){var e=(t*=Ia)-du,r=e>=0?1:-1,i=r*e,o=Ga(n=(n*=Ia)/2+Ya),a=Qa(n),u=vu*a,f=pu*o+u*Ga(i),c=u*r*Qa(i);gu.add(Xa(c,f)),du=t,pu=o,vu=a}function Mu(t){return[Xa(t[1],t[0]),eu(t[2])]}function Au(t){var n=t[0],e=t[1],r=Ga(e);return[r*Ga(n),r*Qa(n),Qa(e)]}function Tu(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Nu(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Su(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Eu(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function ku(t){var n=Ka(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var Cu,Pu,zu,Ru,Lu,Du,Uu,qu,Ou,Yu,Bu,Fu,Iu,Hu,ju,Xu,Gu,Vu,$u,Wu,Zu,Qu,Ju,Ku,tf,nf,ef=Pa(),rf={point:of,lineStart:uf,lineEnd:ff,polygonStart:function(){rf.point=cf,rf.lineStart=sf,rf.lineEnd=lf,ef.reset(),_u.polygonStart()},polygonEnd:function(){_u.polygonEnd(),rf.point=of,rf.lineStart=uf,rf.lineEnd=ff,gu<0?(Cu=-(zu=180),Pu=-(Ru=90)):ef>Da?Ru=90:ef<-Da&&(Pu=-90),Yu[0]=Cu,Yu[1]=zu}};function of(t,n){Ou.push(Yu=[Cu=t,zu=t]),n<Pu&&(Pu=n),n>Ru&&(Ru=n)}function af(t,n){var e=Au([t*Ia,n*Ia]);if(qu){var r=Nu(qu,e),i=Nu([r[1],-r[0],0],r);ku(i),i=Mu(i);var o,a=t-Lu,u=a>0?1:-1,f=i[0]*Fa*u,c=Ha(a)>180;c^(u*Lu<f&&f<u*t)?(o=i[1]*Fa)>Ru&&(Ru=o):c^(u*Lu<(f=(f+360)%360-180)&&f<u*t)?(o=-i[1]*Fa)<Pu&&(Pu=o):(n<Pu&&(Pu=n),n>Ru&&(Ru=n)),c?t<Lu?hf(Cu,t)>hf(Cu,zu)&&(zu=t):hf(t,zu)>hf(Cu,zu)&&(Cu=t):zu>=Cu?(t<Cu&&(Cu=t),t>zu&&(zu=t)):t>Lu?hf(Cu,t)>hf(Cu,zu)&&(zu=t):hf(t,zu)>hf(Cu,zu)&&(Cu=t)}else Ou.push(Yu=[Cu=t,zu=t]);n<Pu&&(Pu=n),n>Ru&&(Ru=n),qu=e,Lu=t}function uf(){rf.point=af}function ff(){Yu[0]=Cu,Yu[1]=zu,rf.point=of,qu=null}function cf(t,n){if(qu){var e=t-Lu;ef.add(Ha(e)>180?e+(e>0?360:-360):e)}else Du=t,Uu=n;_u.point(t,n),af(t,n)}function sf(){_u.lineStart()}function lf(){cf(Du,Uu),_u.lineEnd(),Ha(ef)>Da&&(Cu=-(zu=180)),Yu[0]=Cu,Yu[1]=zu,qu=null}function hf(t,n){return(n-=t)<0?n+360:n}function df(t,n){return t[0]-n[0]}function pf(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var vf={sphere:iu,point:gf,lineStart:_f,lineEnd:xf,polygonStart:function(){vf.lineStart=wf,vf.lineEnd=Mf},polygonEnd:function(){vf.lineStart=_f,vf.lineEnd=xf}};function gf(t,n){t*=Ia;var e=Ga(n*=Ia);yf(e*Ga(t),e*Qa(t),Qa(n))}function yf(t,n,e){Iu+=(t-Iu)/++Bu,Hu+=(n-Hu)/Bu,ju+=(e-ju)/Bu}function _f(){vf.point=bf}function bf(t,n){t*=Ia;var e=Ga(n*=Ia);Ku=e*Ga(t),tf=e*Qa(t),nf=Qa(n),vf.point=mf,yf(Ku,tf,nf)}function mf(t,n){t*=Ia;var e=Ga(n*=Ia),r=e*Ga(t),i=e*Qa(t),o=Qa(n),a=Xa(Ka((a=tf*o-nf*i)*a+(a=nf*r-Ku*o)*a+(a=Ku*i-tf*r)*a),Ku*r+tf*i+nf*o);Fu+=a,Xu+=a*(Ku+(Ku=r)),Gu+=a*(tf+(tf=i)),Vu+=a*(nf+(nf=o)),yf(Ku,tf,nf)}function xf(){vf.point=gf}function wf(){vf.point=Af}function Mf(){Tf(Qu,Ju),vf.point=gf}function Af(t,n){Qu=t,Ju=n,t*=Ia,n*=Ia,vf.point=Tf;var e=Ga(n);Ku=e*Ga(t),tf=e*Qa(t),nf=Qa(n),yf(Ku,tf,nf)}function Tf(t,n){t*=Ia;var e=Ga(n*=Ia),r=e*Ga(t),i=e*Qa(t),o=Qa(n),a=tf*o-nf*i,u=nf*r-Ku*o,f=Ku*i-tf*r,c=Ka(a*a+u*u+f*f),s=eu(c),l=c&&-s/c;$u+=l*a,Wu+=l*u,Zu+=l*f,Fu+=s,Xu+=s*(Ku+(Ku=r)),Gu+=s*(tf+(tf=i)),Vu+=s*(nf+(nf=o)),yf(Ku,tf,nf)}function Nf(t){return function(){return t}}function Sf(t,n){function e(e,r){return e=t(e,r),n(e[0],e[1])}return t.invert&&n.invert&&(e.invert=function(e,r){return(e=n.invert(e,r))&&t.invert(e[0],e[1])}),e}function Ef(t,n){return[t>qa?t-Ba:t<-qa?t+Ba:t,n]}function kf(t,n,e){return(t%=Ba)?n||e?Sf(Pf(t),zf(n,e)):Pf(t):n||e?zf(n,e):Ef}function Cf(t){return function(n,e){return[(n+=t)>qa?n-Ba:n<-qa?n+Ba:n,e]}}function Pf(t){var n=Cf(t);return n.invert=Cf(-t),n}function zf(t,n){var e=Ga(t),r=Qa(t),i=Ga(n),o=Qa(n);function a(t,n){var a=Ga(n),u=Ga(t)*a,f=Qa(t)*a,c=Qa(n),s=c*e+u*r;return[Xa(f*i-s*o,u*e-c*r),eu(s*i+f*o)]}return a.invert=function(t,n){var a=Ga(n),u=Ga(t)*a,f=Qa(t)*a,c=Qa(n),s=c*i-f*o;return[Xa(f*i+c*o,u*e+s*r),eu(s*e-u*r)]},a}function Rf(t){function n(n){return(n=t(n[0]*Ia,n[1]*Ia))[0]*=Fa,n[1]*=Fa,n}return t=kf(t[0]*Ia,t[1]*Ia,t.length>2?t[2]*Ia:0),n.invert=function(n){return(n=t.invert(n[0]*Ia,n[1]*Ia))[0]*=Fa,n[1]*=Fa,n},n}function Lf(t,n,e,r,i,o){if(e){var a=Ga(n),u=Qa(n),f=r*e;null==i?(i=n+r*Ba,o=n-f/2):(i=Df(a,i),o=Df(a,o),(r>0?i<o:i>o)&&(i+=r*Ba));for(var c,s=i;r>0?s>o:s<o;s-=f)c=Mu([a,-u*Ga(s),-u*Qa(s)]),t.point(c[0],c[1])}}function Df(t,n){(n=Au(n))[0]-=t,ku(n);var e=nu(-n[1]);return((-n[2]<0?-e:e)+Ba-Da)%Ba}function Uf(){var t,n=[];return{point:function(n,e){t.push([n,e])},lineStart:function(){n.push(t=[])},lineEnd:iu,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function qf(t,n){return Ha(t[0]-n[0])<Da&&Ha(t[1]-n[1])<Da}function Of(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Yf(t,n,e,r,i){var o,a,u=[],f=[];if(t.forEach(function(t){if(!((n=t.length-1)<=0)){var n,e,r=t[0],a=t[n];if(qf(r,a)){for(i.lineStart(),o=0;o<n;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else u.push(e=new Of(r,t,null,!0)),f.push(e.o=new Of(r,null,e,!1)),u.push(e=new Of(a,t,null,!1)),f.push(e.o=new Of(a,null,e,!0))}}),u.length){for(f.sort(n),Bf(u),Bf(f),o=0,a=f.length;o<a;++o)f[o].e=e=!e;for(var c,s,l=u[0];;){for(var h=l,d=!0;h.v;)if((h=h.n)===l)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(o=0,a=c.length;o<a;++o)i.point((s=c[o])[0],s[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(c=h.p.z,o=c.length-1;o>=0;--o)i.point((s=c[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function Bf(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r<n;)i.n=e=t[r],e.p=i,i=e;i.n=e=t[0],e.p=i}}Ef.invert=Ef;var Ff=Pa();function If(t,n){var e=n[0],r=n[1],i=Qa(r),o=[Qa(e),-Ga(e),0],a=0,u=0;Ff.reset(),1===i?r=Oa+Da:-1===i&&(r=-Oa-Da);for(var f=0,c=t.length;f<c;++f)if(l=(s=t[f]).length)for(var s,l,h=s[l-1],d=h[0],p=h[1]/2+Ya,v=Qa(p),g=Ga(p),y=0;y<l;++y,d=b,v=x,g=w,h=_){var _=s[y],b=_[0],m=_[1]/2+Ya,x=Qa(m),w=Ga(m),M=b-d,A=M>=0?1:-1,T=A*M,N=T>qa,S=v*x;if(Ff.add(Xa(S*A*Qa(T),g*w+S*Ga(T))),a+=N?M+A*Ba:M,N^d>=e^b>=e){var E=Nu(Au(h),Au(_));ku(E);var k=Nu(o,E);ku(k);var C=(N^M>=0?-1:1)*eu(k[2]);(r>C||r===C&&(E[0]||E[1]))&&(u+=N^M>=0?1:-1)}}return(a<-Da||a<Da&&Ff<-Da)^1&u}function Hf(t,n,e,r){return function(i){var o,a,u,f=n(i),c=Uf(),s=n(c),l=!1,h={point:d,lineStart:v,lineEnd:g,polygonStart:function(){h.point=y,h.lineStart=_,h.lineEnd=b,a=[],o=[]},polygonEnd:function(){h.point=d,h.lineStart=v,h.lineEnd=g,a=N(a);var t=If(o,r);a.length?(l||(i.polygonStart(),l=!0),Yf(a,Xf,t,e,i)):t&&(l||(i.polygonStart(),l=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(n,e){t(n,e)&&i.point(n,e)}function p(t,n){f.point(t,n)}function v(){h.point=p,f.lineStart()}function g(){h.point=d,f.lineEnd()}function y(t,n){u.push([t,n]),s.point(t,n)}function _(){s.lineStart(),u=[]}function b(){y(u[0][0],u[0][1]),s.lineEnd();var t,n,e,r,f=s.clean(),h=c.result(),d=h.length;if(u.pop(),o.push(u),u=null,d)if(1&f){if((n=(e=h[0]).length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t<n;++t)i.point((r=e[t])[0],r[1]);i.lineEnd()}}else d>1&&2&f&&h.push(h.pop().concat(h.shift())),a.push(h.filter(jf))}return h}}function jf(t){return t.length>1}function Xf(t,n){return((t=t.x)[0]<0?t[1]-Oa-Da:Oa-t[1])-((n=n.x)[0]<0?n[1]-Oa-Da:Oa-n[1])}var Gf=Hf(function(){return!0},function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?qa:-qa,f=Ha(o-e);Ha(f-qa)<Da?(t.point(e,r=(r+a)/2>0?Oa:-Oa),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&f>=qa&&(Ha(e-i)<Da&&(e-=i*Da),Ha(o-u)<Da&&(o-=u*Da),r=function(t,n,e,r){var i,o,a=Qa(t-e);return Ha(a)>Da?ja((Qa(n)*(o=Ga(r))*Qa(e)-Qa(r)*(i=Ga(n))*Qa(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}},function(t,n,e,r){var i;if(null==t)i=e*Oa,r.point(-qa,i),r.point(0,i),r.point(qa,i),r.point(qa,0),r.point(qa,-i),r.point(0,-i),r.point(-qa,-i),r.point(-qa,0),r.point(-qa,i);else if(Ha(t[0]-n[0])>Da){var o=t[0]<n[0]?qa:-qa;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(n[0],n[1])},[-qa,-Oa]);function Vf(t){var n=Ga(t),e=6*Ia,r=n>0,i=Ha(n)>Da;function o(t,e){return Ga(t)*Ga(e)>n}function a(t,e,r){var i=[1,0,0],o=Nu(Au(t),Au(e)),a=Tu(o,o),u=o[0],f=a-u*u;if(!f)return!r&&t;var c=n*a/f,s=-n*u/f,l=Nu(i,o),h=Eu(i,c);Su(h,Eu(o,s));var d=l,p=Tu(h,d),v=Tu(d,d),g=p*p-v*(Tu(h,h)-1);if(!(g<0)){var y=Ka(g),_=Eu(d,(-p-y)/v);if(Su(_,h),_=Mu(_),!r)return _;var b,m=t[0],x=e[0],w=t[1],M=e[1];x<m&&(b=m,m=x,x=b);var A=x-m,T=Ha(A-qa)<Da;if(!T&&M<w&&(b=w,w=M,M=b),T||A<Da?T?w+M>0^_[1]<(Ha(_[0]-m)<Da?w:M):w<=_[1]&&_[1]<=M:A>qa^(m<=_[0]&&_[0]<=x)){var N=Eu(d,(-p+y)/v);return Su(N,h),[_,Mu(N)]}}}function u(n,e){var i=r?t:qa-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return Hf(o,function(t){var n,e,f,c,s;return{lineStart:function(){c=f=!1,s=1},point:function(l,h){var d,p=[l,h],v=o(l,h),g=r?v?0:u(l,h):v?u(l+(l<0?qa:-qa),h):0;if(!n&&(c=f=v)&&t.lineStart(),v!==f&&(!(d=a(n,p))||qf(n,d)||qf(p,d))&&(p[0]+=Da,p[1]+=Da,v=o(p[0],p[1])),v!==f)s=0,v?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^v){var y;g&e||!(y=a(p,n,!0))||(s=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&qf(n,p)||t.point(p[0],p[1]),n=p,f=v,e=g},lineEnd:function(){f&&t.lineEnd(),n=null},clean:function(){return s|(c&&f)<<1}}},function(n,r,i,o){Lf(o,t,e,i,n,r)},r?[0,-t]:[-qa,t-qa])}var $f=1e9,Wf=-$f;function Zf(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,c){var s=0,l=0;if(null==i||(s=a(i,u))!==(l=a(o,u))||f(i,o)<0^u>0)do{c.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+u+4)%4)!==l);else c.point(o[0],o[1])}function a(r,i){return Ha(r[0]-t)<Da?i>0?0:3:Ha(r[0]-e)<Da?i>0?2:1:Ha(r[1]-n)<Da?i>0?1:0:i>0?3:2}function u(t,n){return f(t.x,n.x)}function f(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var f,c,s,l,h,d,p,v,g,y,_,b=a,m=Uf(),x={point:w,lineStart:function(){x.point=M,c&&c.push(s=[]);y=!0,g=!1,p=v=NaN},lineEnd:function(){f&&(M(l,h),d&&g&&m.rejoin(),f.push(m.result()));x.point=w,g&&b.lineEnd()},polygonStart:function(){b=m,f=[],c=[],_=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=c.length;e<i;++e)for(var o,a,u=c[e],f=1,s=u.length,l=u[0],h=l[0],d=l[1];f<s;++f)o=h,a=d,l=u[f],h=l[0],d=l[1],a<=r?d>r&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=_&&n,i=(f=N(f)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Yf(f,u,n,o,a),a.polygonEnd());b=a,f=c=s=null}};function w(t,n){i(t,n)&&b.point(t,n)}function M(o,a){var u=i(o,a);if(c&&s.push([o,a]),y)l=o,h=a,d=u,y=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&g)b.point(o,a);else{var f=[p=Math.max(Wf,Math.min($f,p)),v=Math.max(Wf,Math.min($f,v))],m=[o=Math.max(Wf,Math.min($f,o)),a=Math.max(Wf,Math.min($f,a))];!function(t,n,e,r,i,o){var a,u=t[0],f=t[1],c=0,s=1,l=n[0]-u,h=n[1]-f;if(a=e-u,l||!(a>0)){if(a/=l,l<0){if(a<c)return;a<s&&(s=a)}else if(l>0){if(a>s)return;a>c&&(c=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>s)return;a>c&&(c=a)}else if(l>0){if(a<c)return;a<s&&(s=a)}if(a=r-f,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<s&&(s=a)}else if(h>0){if(a>s)return;a>c&&(c=a)}if(a=o-f,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<s&&(s=a)}return c>0&&(t[0]=u+c*l,t[1]=f+c*h),s<1&&(n[0]=u+s*l,n[1]=f+s*h),!0}}}}}(f,m,t,n,e,r)?u&&(b.lineStart(),b.point(o,a),_=!1):(g||(b.lineStart(),b.point(f[0],f[1])),b.point(m[0],m[1]),u||b.lineEnd(),_=!1)}p=o,v=a,g=u}return x}}var Qf,Jf,Kf,tc=Pa(),nc={sphere:iu,point:iu,lineStart:function(){nc.point=rc,nc.lineEnd=ec},lineEnd:iu,polygonStart:iu,polygonEnd:iu};function ec(){nc.point=nc.lineEnd=iu}function rc(t,n){Qf=t*=Ia,Jf=Qa(n*=Ia),Kf=Ga(n),nc.point=ic}function ic(t,n){t*=Ia;var e=Qa(n*=Ia),r=Ga(n),i=Ha(t-Qf),o=Ga(i),a=r*Qa(i),u=Kf*e-Jf*r*o,f=Jf*e+Kf*r*o;tc.add(Xa(Ka(a*a+u*u),f)),Qf=t,Jf=e,Kf=r}function oc(t){return tc.reset(),su(t,nc),+tc}var ac=[null,null],uc={type:"LineString",coordinates:ac};function fc(t,n){return ac[0]=t,ac[1]=n,oc(uc)}var cc={Feature:function(t,n){return lc(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)if(lc(e[r].geometry,n))return!0;return!1}},sc={Sphere:function(){return!0},Point:function(t,n){return hc(t.coordinates,n)},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)if(hc(e[r],n))return!0;return!1},LineString:function(t,n){return dc(t.coordinates,n)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)if(dc(e[r],n))return!0;return!1},Polygon:function(t,n){return pc(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)if(pc(e[r],n))return!0;return!1},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)if(lc(e[r],n))return!0;return!1}};function lc(t,n){return!(!t||!sc.hasOwnProperty(t.type))&&sc[t.type](t,n)}function hc(t,n){return 0===fc(t,n)}function dc(t,n){var e=fc(t[0],t[1]);return fc(t[0],n)+fc(n,t[1])<=e+Da}function pc(t,n){return!!If(t.map(vc),gc(n))}function vc(t){return(t=t.map(gc)).pop(),t}function gc(t){return[t[0]*Ia,t[1]*Ia]}function yc(t,n,e){var r=g(t,n-Da,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function _c(t,n,e){var r=g(t,n-Da,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function bc(){var t,n,e,r,i,o,a,u,f,c,s,l,h=10,d=h,p=90,v=360,y=2.5;function _(){return{type:"MultiLineString",coordinates:b()}}function b(){return g(Va(r/p)*p,e,p).map(s).concat(g(Va(u/v)*v,a,v).map(l)).concat(g(Va(n/h)*h,t,h).filter(function(t){return Ha(t%p)>Da}).map(f)).concat(g(Va(o/d)*d,i,d).filter(function(t){return Ha(t%v)>Da}).map(c))}return _.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},_.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(a).slice(1),s(e).reverse().slice(1),l(u).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),_.precision(y)):[[r,u],[e,a]]},_.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),_.precision(y)):[[n,o],[t,i]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(p=+t[0],v=+t[1],_):[p,v]},_.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],_):[h,d]},_.precision=function(h){return arguments.length?(y=+h,f=yc(o,i,90),c=_c(n,t,y),s=yc(u,a,90),l=_c(r,e,y),_):y},_.extentMajor([[-180,-90+Da],[180,90-Da]]).extentMinor([[-180,-80-Da],[180,80+Da]])}function mc(t){return t}var xc,wc,Mc,Ac,Tc=Pa(),Nc=Pa(),Sc={point:iu,lineStart:iu,lineEnd:iu,polygonStart:function(){Sc.lineStart=Ec,Sc.lineEnd=Pc},polygonEnd:function(){Sc.lineStart=Sc.lineEnd=Sc.point=iu,Tc.add(Ha(Nc)),Nc.reset()},result:function(){var t=Tc/2;return Tc.reset(),t}};function Ec(){Sc.point=kc}function kc(t,n){Sc.point=Cc,xc=Mc=t,wc=Ac=n}function Cc(t,n){Nc.add(Ac*t-Mc*n),Mc=t,Ac=n}function Pc(){Cc(xc,wc)}var zc=1/0,Rc=zc,Lc=-zc,Dc=Lc,Uc={point:function(t,n){t<zc&&(zc=t);t>Lc&&(Lc=t);n<Rc&&(Rc=n);n>Dc&&(Dc=n)},lineStart:iu,lineEnd:iu,polygonStart:iu,polygonEnd:iu,result:function(){var t=[[zc,Rc],[Lc,Dc]];return Lc=Dc=-(Rc=zc=1/0),t}};var qc,Oc,Yc,Bc,Fc=0,Ic=0,Hc=0,jc=0,Xc=0,Gc=0,Vc=0,$c=0,Wc=0,Zc={point:Qc,lineStart:Jc,lineEnd:ns,polygonStart:function(){Zc.lineStart=es,Zc.lineEnd=rs},polygonEnd:function(){Zc.point=Qc,Zc.lineStart=Jc,Zc.lineEnd=ns},result:function(){var t=Wc?[Vc/Wc,$c/Wc]:Gc?[jc/Gc,Xc/Gc]:Hc?[Fc/Hc,Ic/Hc]:[NaN,NaN];return Fc=Ic=Hc=jc=Xc=Gc=Vc=$c=Wc=0,t}};function Qc(t,n){Fc+=t,Ic+=n,++Hc}function Jc(){Zc.point=Kc}function Kc(t,n){Zc.point=ts,Qc(Yc=t,Bc=n)}function ts(t,n){var e=t-Yc,r=n-Bc,i=Ka(e*e+r*r);jc+=i*(Yc+t)/2,Xc+=i*(Bc+n)/2,Gc+=i,Qc(Yc=t,Bc=n)}function ns(){Zc.point=Qc}function es(){Zc.point=is}function rs(){os(qc,Oc)}function is(t,n){Zc.point=os,Qc(qc=Yc=t,Oc=Bc=n)}function os(t,n){var e=t-Yc,r=n-Bc,i=Ka(e*e+r*r);jc+=i*(Yc+t)/2,Xc+=i*(Bc+n)/2,Gc+=i,Vc+=(i=Bc*t-Yc*n)*(Yc+t),$c+=i*(Bc+n),Wc+=3*i,Qc(Yc=t,Bc=n)}function as(t){this._context=t}as.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Ba)}},result:iu};var us,fs,cs,ss,ls,hs=Pa(),ds={point:iu,lineStart:function(){ds.point=ps},lineEnd:function(){us&&vs(fs,cs),ds.point=iu},polygonStart:function(){us=!0},polygonEnd:function(){us=null},result:function(){var t=+hs;return hs.reset(),t}};function ps(t,n){ds.point=vs,fs=ss=t,cs=ls=n}function vs(t,n){ss-=t,ls-=n,hs.add(Ka(ss*ss+ls*ls)),ss=t,ls=n}function gs(){this._string=[]}function ys(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function _s(t){return function(n){var e=new bs;for(var r in t)e[r]=t[r];return e.stream=n,e}}function bs(){}function ms(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),su(e,t.stream(Uc)),n(Uc.result()),null!=r&&t.clipExtent(r),t}function xs(t,n,e){return ms(t,function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),a=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,u=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([a,u])},e)}function ws(t,n,e){return xs(t,[[0,0],n],e)}function Ms(t,n,e){return ms(t,function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,a=-i*e[0][1];t.scale(150*i).translate([o,a])},e)}function As(t,n,e){return ms(t,function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],a=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,a])},e)}gs.prototype={_radius:4.5,_circle:ys(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=ys(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},bs.prototype={constructor:bs,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ts=16,Ns=Ga(30*Ia);function Ss(t,n){return+n?function(t,n){function e(r,i,o,a,u,f,c,s,l,h,d,p,v,g){var y=c-r,_=s-i,b=y*y+_*_;if(b>4*n&&v--){var m=a+h,x=u+d,w=f+p,M=Ka(m*m+x*x+w*w),A=eu(w/=M),T=Ha(Ha(w)-1)<Da||Ha(o-l)<Da?(o+l)/2:Xa(x,m),N=t(T,A),S=N[0],E=N[1],k=S-r,C=E-i,P=_*k-y*C;(P*P/b>n||Ha((y*k+_*C)/b-.5)>.3||a*h+u*d+f*p<Ns)&&(e(r,i,o,a,u,f,S,E,T,m/=M,x/=M,w,v,g),g.point(S,E),e(S,E,T,m,x,w,c,s,l,h,d,p,v,g))}}return function(n){var r,i,o,a,u,f,c,s,l,h,d,p,v={point:g,lineStart:y,lineEnd:b,polygonStart:function(){n.polygonStart(),v.lineStart=m},polygonEnd:function(){n.polygonEnd(),v.lineStart=y}};function g(e,r){e=t(e,r),n.point(e[0],e[1])}function y(){s=NaN,v.point=_,n.lineStart()}function _(r,i){var o=Au([r,i]),a=t(r,i);e(s,l,c,h,d,p,s=a[0],l=a[1],c=r,h=o[0],d=o[1],p=o[2],Ts,n),n.point(s,l)}function b(){v.point=g,n.lineEnd()}function m(){y(),v.point=x,v.lineEnd=w}function x(t,n){_(r=t,n),i=s,o=l,a=h,u=d,f=p,v.point=_}function w(){e(s,l,c,h,d,p,i,o,r,a,u,f,Ts,n),v.lineEnd=b,b()}return v}}(t,n):function(t){return _s({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}(t)}var Es=_s({point:function(t,n){this.stream.point(t*Ia,n*Ia)}});function ks(t,n,e,r){var i=Ga(r),o=Qa(r),a=i*t,u=o*t,f=i/t,c=o/t,s=(o*e-i*n)/t,l=(o*n+i*e)/t;function h(t,r){return[a*t-u*r+n,e-u*t-a*r]}return h.invert=function(t,n){return[f*t-c*n+s,l-c*t-f*n]},h}function Cs(t){return Ps(function(){return t})()}function Ps(t){var n,e,r,i,o,a,u,f,c,s,l=150,h=480,d=250,p=0,v=0,g=0,y=0,_=0,b=0,m=null,x=Gf,w=null,M=mc,A=.5;function T(t){return f(t[0]*Ia,t[1]*Ia)}function N(t){return(t=f.invert(t[0],t[1]))&&[t[0]*Fa,t[1]*Fa]}function S(){var t=ks(l,0,0,b).apply(null,n(p,v)),r=(b?ks:function(t,n,e){function r(r,i){return[n+t*r,e-t*i]}return r.invert=function(r,i){return[(r-n)/t,(e-i)/t]},r})(l,h-t[0],d-t[1],b);return e=kf(g,y,_),u=Sf(n,r),f=Sf(e,u),a=Ss(u,A),E()}function E(){return c=s=null,T}return T.stream=function(t){return c&&s===t?c:c=Es(function(t){return _s({point:function(n,e){var r=t(n,e);return this.stream.point(r[0],r[1])}})}(e)(x(a(M(s=t)))))},T.preclip=function(t){return arguments.length?(x=t,m=void 0,E()):x},T.postclip=function(t){return arguments.length?(M=t,w=r=i=o=null,E()):M},T.clipAngle=function(t){return arguments.length?(x=+t?Vf(m=t*Ia):(m=null,Gf),E()):m*Fa},T.clipExtent=function(t){return arguments.length?(M=null==t?(w=r=i=o=null,mc):Zf(w=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),E()):null==w?null:[[w,r],[i,o]]},T.scale=function(t){return arguments.length?(l=+t,S()):l},T.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],S()):[h,d]},T.center=function(t){return arguments.length?(p=t[0]%360*Ia,v=t[1]%360*Ia,S()):[p*Fa,v*Fa]},T.rotate=function(t){return arguments.length?(g=t[0]%360*Ia,y=t[1]%360*Ia,_=t.length>2?t[2]%360*Ia:0,S()):[g*Fa,y*Fa,_*Fa]},T.angle=function(t){return arguments.length?(b=t%360*Ia,S()):b*Fa},T.precision=function(t){return arguments.length?(a=Ss(u,A=t*t),E()):Ka(A)},T.fitExtent=function(t,n){return xs(T,t,n)},T.fitSize=function(t,n){return ws(T,t,n)},T.fitWidth=function(t,n){return Ms(T,t,n)},T.fitHeight=function(t,n){return As(T,t,n)},function(){return n=t.apply(this,arguments),T.invert=n.invert&&N,S()}}function zs(t){var n=0,e=qa/3,r=Ps(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*Ia,e=t[1]*Ia):[n*Fa,e*Fa]},i}function Rs(t,n){var e=Qa(t),r=(e+Qa(n))/2;if(Ha(r)<Da)return function(t){var n=Ga(t);function e(t,e){return[t*n,Qa(e)/n]}return e.invert=function(t,e){return[t/n,eu(e*n)]},e}(t);var i=1+e*(2*r-e),o=Ka(i)/r;function a(t,n){var e=Ka(i-2*r*Qa(n))/r;return[e*Qa(t*=r),o-e*Ga(t)]}return a.invert=function(t,n){var e=o-n;return[Xa(t,Ha(e))/r*Ja(e),eu((i-(t*t+e*e)*r*r)/(2*r))]},a}function Ls(){return zs(Rs).scale(155.424).center([0,33.6442])}function Ds(){return Ls().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Us(t){return function(n,e){var r=Ga(n),i=Ga(e),o=t(r*i);return[o*i*Qa(n),o*Qa(e)]}}function qs(t){return function(n,e){var r=Ka(n*n+e*e),i=t(r),o=Qa(i),a=Ga(i);return[Xa(n*o,r*a),eu(r&&e*o/r)]}}var Os=Us(function(t){return Ka(2/(1+t))});Os.invert=qs(function(t){return 2*eu(t/2)});var Ys=Us(function(t){return(t=nu(t))&&t/Qa(t)});function Bs(t,n){return[t,Wa(tu((Oa+n)/2))]}function Fs(t){var n,e,r,i=Cs(t),o=i.center,a=i.scale,u=i.translate,f=i.clipExtent,c=null;function s(){var o=qa*a(),u=i(Rf(i.rotate()).invert([0,0]));return f(null==c?[[u[0]-o,u[1]-o],[u[0]+o,u[1]+o]]:t===Bs?[[Math.max(u[0]-o,c),n],[Math.min(u[0]+o,e),r]]:[[c,Math.max(u[1]-o,n)],[e,Math.min(u[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),s()):a()},i.translate=function(t){return arguments.length?(u(t),s()):u()},i.center=function(t){return arguments.length?(o(t),s()):o()},i.clipExtent=function(t){return arguments.length?(null==t?c=n=e=r=null:(c=+t[0][0],n=+t[0][1],e=+t[1][0],r=+t[1][1]),s()):null==c?null:[[c,n],[e,r]]},s()}function Is(t){return tu((Oa+t)/2)}function Hs(t,n){var e=Ga(t),r=t===n?Qa(t):Wa(e/Ga(n))/Wa(Is(n)/Is(t)),i=e*Za(Is(t),r)/r;if(!r)return Bs;function o(t,n){i>0?n<-Oa+Da&&(n=-Oa+Da):n>Oa-Da&&(n=Oa-Da);var e=i/Za(Is(n),r);return[e*Qa(r*t),i-e*Ga(r*t)]}return o.invert=function(t,n){var e=i-n,o=Ja(r)*Ka(t*t+e*e);return[Xa(t,Ha(e))/r*Ja(e),2*ja(Za(i/o,1/r))-Oa]},o}function js(t,n){return[t,n]}function Xs(t,n){var e=Ga(t),r=t===n?Qa(t):(e-Ga(n))/(n-t),i=e/r+t;if(Ha(r)<Da)return js;function o(t,n){var e=i-n,o=r*t;return[e*Qa(o),i-e*Ga(o)]}return o.invert=function(t,n){var e=i-n;return[Xa(t,Ha(e))/r*Ja(e),i-Ja(r)*Ka(t*t+e*e)]},o}Ys.invert=qs(function(t){return t}),Bs.invert=function(t,n){return[t,2*ja($a(n))-Oa]},js.invert=js;var Gs=1.340264,Vs=-.081106,$s=893e-6,Ws=.003796,Zs=Ka(3)/2;function Qs(t,n){var e=eu(Zs*Qa(n)),r=e*e,i=r*r*r;return[t*Ga(e)/(Zs*(Gs+3*Vs*r+i*(7*$s+9*Ws*r))),e*(Gs+Vs*r+i*($s+Ws*r))]}function Js(t,n){var e=Ga(n),r=Ga(t)*e;return[e*Qa(t)/r,Qa(n)/r]}function Ks(t,n,e,r){return 1===t&&1===n&&0===e&&0===r?mc:_s({point:function(i,o){this.stream.point(i*t+e,o*n+r)}})}function tl(t,n){var e=n*n,r=e*e;return[t*(.8707-.131979*e+r*(r*(.003971*e-.001529*r)-.013791)),n*(1.007226+e*(.015085+r*(.028874*e-.044475-.005916*r)))]}function nl(t,n){return[Ga(n)*Qa(t),Qa(n)]}function el(t,n){var e=Ga(n),r=1+Ga(t)*e;return[e*Qa(t)/r,Qa(n)/r]}function rl(t,n){return[Wa(tu((Oa+n)/2)),-t]}function il(t,n){return t.parent===n.parent?1:2}function ol(t,n){return t+n.x}function al(t,n){return Math.max(t,n.y)}function ul(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function fl(t,n){var e,r,i,o,a,u=new hl(t),f=+t.value&&(u.value=t.value),c=[u];for(null==n&&(n=cl);e=c.pop();)if(f&&(e.value=+e.data.value),(i=n(e.data))&&(a=i.length))for(e.children=new Array(a),o=a-1;o>=0;--o)c.push(r=e.children[o]=new hl(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(ll)}function cl(t){return t.children}function sl(t){t.data=t.data.data}function ll(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function hl(t){this.data=t,this.depth=this.height=0,this.parent=null}Qs.invert=function(t,n){for(var e,r=n,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=e=(r*(Gs+Vs*i+o*($s+Ws*i))-n)/(Gs+3*Vs*i+o*(7*$s+9*Ws*i)))*r)*i*i,!(Ha(e)<Ua));++a);return[Zs*t*(Gs+3*Vs*i+o*(7*$s+9*Ws*i))/Ga(r),eu(Qa(r)/Zs)]},Js.invert=qs(ja),tl.invert=function(t,n){var e,r=n,i=25;do{var o=r*r,a=o*o;r-=e=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-n)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Ha(e)>Da&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},nl.invert=qs(eu),el.invert=qs(function(t){return 2*ja(t)}),rl.invert=function(t,n){return[-n,2*ja($a(t))-Oa]},hl.prototype=fl.prototype={constructor:hl,count:function(){return this.eachAfter(ul)},each:function(t){var n,e,r,i,o=this,a=[o];do{for(n=a.reverse(),a=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r<i;++r)a.push(e[r])}while(a.length);return this},eachAfter:function(t){for(var n,e,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),n=i.children)for(e=0,r=n.length;e<r;++e)o.push(n[e]);for(;i=a.pop();)t(i);return this},eachBefore:function(t){for(var n,e,r=this,i=[r];r=i.pop();)if(t(r),n=r.children)for(e=n.length-1;e>=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})},sort:function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each(function(n){t.push(n)}),t},leaves:function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},links:function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n},copy:function(){return fl(this).eachBefore(sl)}};var dl=Array.prototype.slice;function pl(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(dl.call(t))).length,o=[];r<i;)n=t[r],e&&yl(e,n)?++r:(e=bl(o=vl(o,n)),r=0);return e}function vl(t,n){var e,r;if(_l(n,t))return[n];for(e=0;e<t.length;++e)if(gl(n,t[e])&&_l(ml(t[e],n),t))return[t[e],n];for(e=0;e<t.length-1;++e)for(r=e+1;r<t.length;++r)if(gl(ml(t[e],t[r]),n)&&gl(ml(t[e],n),t[r])&&gl(ml(t[r],n),t[e])&&_l(xl(t[e],t[r],n),t))return[t[e],t[r],n];throw new Error}function gl(t,n){var e=t.r-n.r,r=n.x-t.x,i=n.y-t.y;return e<0||e*e<r*r+i*i}function yl(t,n){var e=t.r-n.r+1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function _l(t,n){for(var e=0;e<n.length;++e)if(!yl(t,n[e]))return!1;return!0}function bl(t){switch(t.length){case 1:return{x:(n=t[0]).x,y:n.y,r:n.r};case 2:return ml(t[0],t[1]);case 3:return xl(t[0],t[1],t[2])}var n}function ml(t,n){var e=t.x,r=t.y,i=t.r,o=n.x,a=n.y,u=n.r,f=o-e,c=a-r,s=u-i,l=Math.sqrt(f*f+c*c);return{x:(e+o+f/l*s)/2,y:(r+a+c/l*s)/2,r:(l+i+u)/2}}function xl(t,n,e){var r=t.x,i=t.y,o=t.r,a=n.x,u=n.y,f=n.r,c=e.x,s=e.y,l=e.r,h=r-a,d=r-c,p=i-u,v=i-s,g=f-o,y=l-o,_=r*r+i*i-o*o,b=_-a*a-u*u+f*f,m=_-c*c-s*s+l*l,x=d*p-h*v,w=(p*m-v*b)/(2*x)-r,M=(v*g-p*y)/x,A=(d*b-h*m)/(2*x)-i,T=(h*y-d*g)/x,N=M*M+T*T-1,S=2*(o+w*M+A*T),E=w*w+A*A-o*o,k=-(N?(S+Math.sqrt(S*S-4*N*E))/(2*N):E/S);return{x:r+w+M*k,y:i+A+T*k,r:k}}function wl(t,n,e){var r,i,o,a,u=t.x-n.x,f=t.y-n.y,c=u*u+f*f;c?(i=n.r+e.r,i*=i,a=t.r+e.r,i>(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),e.x=t.x-r*u-o*f,e.y=t.y-r*f+o*u):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),e.x=n.x+r*u-o*f,e.y=n.y+r*f+o*u)):(e.x=n.x+e.r,e.y=n.y)}function Ml(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function Al(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function Tl(t){this._=t,this.next=null,this.previous=null}function Nl(t){if(!(i=t.length))return 0;var n,e,r,i,o,a,u,f,c,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;wl(e,n,r=t[2]),n=new Tl(n),e=new Tl(e),r=new Tl(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;u<i;++u){wl(n._,e._,r=t[u]),r=new Tl(r),f=e.next,c=n.previous,s=e._.r,l=n._.r;do{if(s<=l){if(Ml(f._,r._)){e=f,n.next=e,e.previous=n,--u;continue t}s+=f._.r,f=f.next}else{if(Ml(c._,r._)){(n=c).next=e,e.previous=n,--u;continue t}l+=c._.r,c=c.previous}}while(f!==c.next);for(r.previous=n,r.next=e,n.next=e.previous=e=r,o=Al(n);(r=r.next)!==e;)(a=Al(r))<o&&(n=r,o=a);e=n.next}for(n=[e._],r=e;(r=r.next)!==e;)n.push(r._);for(r=pl(n),u=0;u<i;++u)(n=t[u]).x-=r.x,n.y-=r.y;return r.r}function Sl(t){if("function"!=typeof t)throw new Error;return t}function El(){return 0}function kl(t){return function(){return t}}function Cl(t){return Math.sqrt(t.value)}function Pl(t){return function(n){n.children||(n.r=Math.max(0,+t(n)||0))}}function zl(t,n){return function(e){if(r=e.children){var r,i,o,a=r.length,u=t(e)*n||0;if(u)for(i=0;i<a;++i)r[i].r+=u;if(o=Nl(r),u)for(i=0;i<a;++i)r[i].r-=u;e.r=o+u}}}function Rl(t){return function(n){var e=n.parent;n.r*=t,e&&(n.x=e.x+t*n.x,n.y=e.y+t*n.y)}}function Ll(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Dl(t,n,e,r,i){for(var o,a=t.children,u=-1,f=a.length,c=t.value&&(r-n)/t.value;++u<f;)(o=a[u]).y0=e,o.y1=i,o.x0=n,o.x1=n+=o.value*c}var Ul="$",ql={depth:-1},Ol={};function Yl(t){return t.id}function Bl(t){return t.parentId}function Fl(t,n){return t.parent===n.parent?1:2}function Il(t){var n=t.children;return n?n[0]:t.t}function Hl(t){var n=t.children;return n?n[n.length-1]:t.t}function jl(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Xl(t,n,e){return t.a.parent===n.parent?t.a:e}function Gl(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function Vl(t,n,e,r,i){for(var o,a=t.children,u=-1,f=a.length,c=t.value&&(i-e)/t.value;++u<f;)(o=a[u]).x0=n,o.x1=r,o.y0=e,o.y1=e+=o.value*c}Gl.prototype=Object.create(hl.prototype);var $l=(1+Math.sqrt(5))/2;function Wl(t,n,e,r,i,o){for(var a,u,f,c,s,l,h,d,p,v,g,y=[],_=n.children,b=0,m=0,x=_.length,w=n.value;b<x;){f=i-e,c=o-r;do{s=_[m++].value}while(!s&&m<x);for(l=h=s,g=s*s*(v=Math.max(c/f,f/c)/(w*t)),p=Math.max(h/g,g/l);m<x;++m){if(s+=u=_[m].value,u<l&&(l=u),u>h&&(h=u),g=s*s*v,(d=Math.max(h/g,g/l))>p){s-=u;break}p=d}y.push(a={value:s,dice:f<c,children:_.slice(b,m)}),a.dice?Dl(a,e,r,i,w?r+=c*s/w:o):Vl(a,e,r,w?e+=f*s/w:i,o),w-=s,b=m}return y}var Zl=function t(n){function e(t,e,r,i,o){Wl(n,t,e,r,i,o)}return e.ratio=function(n){return t((n=+n)>1?n:1)},e}($l);var Ql=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,f,c,s,l=-1,h=a.length,d=t.value;++l<h;){for(f=(u=a[l]).children,c=u.value=0,s=f.length;c<s;++c)u.value+=f[c].value;u.dice?Dl(u,e,r,i,r+=(o-r)*u.value/d):Vl(u,e,r,e+=(i-e)*u.value/d,o),d-=u.value}else t._squarify=a=Wl(n,t,e,r,i,o),a.ratio=n}return e.ratio=function(n){return t((n=+n)>1?n:1)},e}($l);function Jl(t,n){return t[0]-n[0]||t[1]-n[1]}function Kl(t){for(var n,e,r,i=t.length,o=[0,1],a=2,u=2;u<i;++u){for(;a>1&&(n=t[o[a-2]],e=t[o[a-1]],r=t[u],(e[0]-n[0])*(r[1]-n[1])-(e[1]-n[1])*(r[0]-n[0])<=0);)--a;o[a++]=u}return o.slice(0,a)}function th(){return Math.random()}var nh=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(th),eh=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(th),rh=function t(n){function e(){var t=eh.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(th),ih=function t(n){function e(t){return function(){for(var e=0,r=0;r<t;++r)e+=n();return e}}return e.source=t,e}(th),oh=function t(n){function e(t){var e=ih.source(n)(t);return function(){return e()/t}}return e.source=t,e}(th),ah=function t(n){function e(t){return function(){return-Math.log(1-n())/t}}return e.source=t,e}(th),uh=Array.prototype,fh=uh.map,ch=uh.slice,sh={name:"implicit"};function lh(t){var n=Ki(),e=[],r=sh;function i(i){var o=i+"",a=n.get(o);if(!a){if(r!==sh)return r;n.set(o,a=e.push(i))}return t[(a-1)%t.length]}return t=null==t?[]:ch.call(t),i.domain=function(t){if(!arguments.length)return e.slice();e=[],n=Ki();for(var r,o,a=-1,u=t.length;++a<u;)n.has(o=(r=t[a])+"")||n.set(o,e.push(r));return i},i.range=function(n){return arguments.length?(t=ch.call(n),i):t.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return lh().domain(e).range(t).unknown(r)},i}function hh(){var t,n,e=lh().unknown(void 0),r=e.domain,i=e.range,o=[0,1],a=!1,u=0,f=0,c=.5;function s(){var e=r().length,s=o[1]<o[0],l=o[s-0],h=o[1-s];t=(h-l)/Math.max(1,e-u+2*f),a&&(t=Math.floor(t)),l+=(h-l-t*(e-u))*c,n=t*(1-u),a&&(l=Math.round(l),n=Math.round(n));var d=g(e).map(function(n){return l+t*n});return i(s?d.reverse():d)}return delete e.unknown,e.domain=function(t){return arguments.length?(r(t),s()):r()},e.range=function(t){return arguments.length?(o=[+t[0],+t[1]],s()):o.slice()},e.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,s()},e.bandwidth=function(){return n},e.step=function(){return t},e.round=function(t){return arguments.length?(a=!!t,s()):a},e.padding=function(t){return arguments.length?(u=f=Math.max(0,Math.min(1,t)),s()):u},e.paddingInner=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),s()):u},e.paddingOuter=function(t){return arguments.length?(f=Math.max(0,Math.min(1,t)),s()):f},e.align=function(t){return arguments.length?(c=Math.max(0,Math.min(1,t)),s()):c},e.copy=function(){return hh().domain(r()).range(o).round(a).paddingInner(u).paddingOuter(f).align(c)},s()}function dh(t){return function(){return t}}function ph(t){return+t}var vh=[0,1];function gh(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:dh(n)}function yh(t,n,e,r){var i=t[0],o=t[1],a=n[0],u=n[1];return o<i?(i=e(o,i),a=r(u,a)):(i=e(i,o),a=r(a,u)),function(t){return a(i(t))}}function _h(t,n,e,r){var o=Math.min(t.length,n.length)-1,a=new Array(o),u=new Array(o),f=-1;for(t[o]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++f<o;)a[f]=e(t[f],t[f+1]),u[f]=r(n[f],n[f+1]);return function(n){var e=i(t,n,1,o)-1;return u[e](a[e](n))}}function bh(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}function mh(t,n){var e,r,i,o=vh,a=vh,u=me,f=!1;function c(){return e=Math.min(o.length,a.length)>2?_h:yh,r=i=null,s}function s(n){return(r||(r=e(o,a,f?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}(t):t,u)))(+n)}return s.invert=function(t){return(i||(i=e(a,o,gh,f?function(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}(n):n)))(+t)},s.domain=function(t){return arguments.length?(o=fh.call(t,ph),c()):o.slice()},s.range=function(t){return arguments.length?(a=ch.call(t),c()):a.slice()},s.rangeRound=function(t){return a=ch.call(t),u=xe,c()},s.clamp=function(t){return arguments.length?(f=!!t,c()):f},s.interpolate=function(t){return arguments.length?(u=t,c()):u},c()}function xh(n){var e=n.domain;return n.ticks=function(t){var n=e();return m(n[0],n[n.length-1],null==t?10:t)},n.tickFormat=function(n,r){return function(n,e,r){var i,o=n[0],a=n[n.length-1],u=w(o,a,null==e?10:e);switch((r=ba(null==r?",f":r)).type){case"s":var f=Math.max(Math.abs(o),Math.abs(a));return null!=r.precision||isNaN(i=ka(u,f))||(r.precision=i),t.formatPrefix(r,f);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Ca(u,Math.max(Math.abs(o),Math.abs(a))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Ea(u))||(r.precision=i-2*("%"===r.type))}return t.format(r)}(e(),n,r)},n.nice=function(t){null==t&&(t=10);var r,i=e(),o=0,a=i.length-1,u=i[o],f=i[a];return f<u&&(r=u,u=f,f=r,r=o,o=a,a=r),(r=x(u,f,t))>0?r=x(u=Math.floor(u/r)*r,f=Math.ceil(f/r)*r,t):r<0&&(r=x(u=Math.ceil(u*r)/r,f=Math.floor(f*r)/r,t)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(f/r)*r,e(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(f*r)/r,e(i)),n},n}function wh(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(e=r,r=i,i=e,e=o,o=a,a=e),t[r]=n.floor(o),t[i]=n.ceil(a),t}function Mh(t,n){return(n=Math.log(n/t))?function(e){return Math.log(e/t)/n}:dh(n)}function Ah(t,n){return t<0?function(e){return-Math.pow(-n,e)*Math.pow(-t,1-e)}:function(e){return Math.pow(n,e)*Math.pow(t,1-e)}}function Th(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Nh(t){return 10===t?Th:t===Math.E?Math.exp:function(n){return Math.pow(t,n)}}function Sh(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(n){return Math.log(n)/t})}function Eh(t){return function(n){return-t(-n)}}function kh(t,n){return t<0?-Math.pow(-t,n):Math.pow(t,n)}function Ch(){var t=1,n=mh(function(n,e){return(e=kh(e,t)-(n=kh(n,t)))?function(r){return(kh(r,t)-n)/e}:dh(e)},function(n,e){return e=kh(e,t)-(n=kh(n,t)),function(r){return kh(n+e*r,1/t)}}),e=n.domain;return n.exponent=function(n){return arguments.length?(t=+n,e(e())):t},n.copy=function(){return bh(n,Ch().exponent(t))},xh(n)}var Ph=new Date,zh=new Date;function Rh(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n<e-t?n:e},i.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},i.range=function(e,r,o){var a,u=[];if(e=i.ceil(e),o=null==o?1:Math.floor(o),!(e<r&&o>0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a<e&&e<r);return u},i.filter=function(e){return Rh(function(n){if(n>=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return Ph.setTime(+n),zh.setTime(+r),t(Ph),t(zh),Math.floor(e(Ph,zh))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var Lh=Rh(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});Lh.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Rh(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Lh:null};var Dh=Lh.range,Uh=6e4,qh=6048e5,Oh=Rh(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),Yh=Oh.range,Bh=Rh(function(t){t.setTime(Math.floor(t/Uh)*Uh)},function(t,n){t.setTime(+t+n*Uh)},function(t,n){return(n-t)/Uh},function(t){return t.getMinutes()}),Fh=Bh.range,Ih=Rh(function(t){var n=t.getTimezoneOffset()*Uh%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),Hh=Ih.range,jh=Rh(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Uh)/864e5},function(t){return t.getDate()-1}),Xh=jh.range;function Gh(t){return Rh(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Uh)/qh})}var Vh=Gh(0),$h=Gh(1),Wh=Gh(2),Zh=Gh(3),Qh=Gh(4),Jh=Gh(5),Kh=Gh(6),td=Vh.range,nd=$h.range,ed=Wh.range,rd=Zh.range,id=Qh.range,od=Jh.range,ad=Kh.range,ud=Rh(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),fd=ud.range,cd=Rh(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});cd.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Rh(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var sd=cd.range,ld=Rh(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*Uh)},function(t,n){return(n-t)/Uh},function(t){return t.getUTCMinutes()}),hd=ld.range,dd=Rh(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),pd=dd.range,vd=Rh(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1}),gd=vd.range;function yd(t){return Rh(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/qh})}var _d=yd(0),bd=yd(1),md=yd(2),xd=yd(3),wd=yd(4),Md=yd(5),Ad=yd(6),Td=_d.range,Nd=bd.range,Sd=md.range,Ed=xd.range,kd=wd.range,Cd=Md.range,Pd=Ad.range,zd=Rh(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),Rd=zd.range,Ld=Rh(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});Ld.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Rh(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Dd=Ld.range;function Ud(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function qd(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Od(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Yd(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,f=t.shortMonths,c=Vd(i),s=$d(i),l=Vd(o),h=$d(o),d=Vd(a),p=$d(a),v=Vd(u),g=$d(u),y=Vd(f),_=$d(f),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return f[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:pp,e:pp,f:bp,H:vp,I:gp,j:yp,L:_p,m:mp,M:xp,p:function(t){return i[+(t.getHours()>=12)]},Q:Wp,s:Zp,S:wp,u:Mp,U:Ap,V:Tp,w:Np,W:Sp,x:null,X:null,y:Ep,Y:kp,Z:Cp,"%":$p},m={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return f[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Pp,e:Pp,f:Up,H:zp,I:Rp,j:Lp,L:Dp,m:qp,M:Op,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:Wp,s:Zp,S:Yp,u:Bp,U:Fp,V:Ip,w:Hp,W:jp,x:null,X:null,y:Xp,Y:Gp,Z:Vp,"%":$p},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=g[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return A(t,n,e,r)},d:ip,e:ip,f:sp,H:ap,I:ap,j:op,L:cp,m:rp,M:up,p:function(t,n,e){var r=c.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:hp,s:dp,S:fp,u:Zd,U:Qd,V:Jd,w:Wd,W:Kd,x:function(t,n,r){return A(t,e,n,r)},X:function(t,n,e){return A(t,r,n,e)},y:np,Y:tp,Z:ep,"%":lp};function w(t,n){return function(e){var r,i,o,a=[],u=-1,f=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++u<c;)37===t.charCodeAt(u)&&(a.push(t.slice(f,u)),null!=(i=Fd[r=t.charAt(++u)])?r=t.charAt(++u):i="e"===r?" ":"0",(o=n[r])&&(r=o(e,i)),a.push(r),f=u+1);return a.push(t.slice(f,u)),a.join("")}}function M(t,n){return function(e){var r,i,o=Od(1900);if(A(o,t,e+="",0)!=e.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=qd(Od(o.y))).getUTCDay(),r=i>4||0===i?bd.ceil(r):bd(r),r=vd.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=n(Od(o.y))).getDay(),r=i>4||0===i?$h.ceil(r):$h(r),r=jh.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?qd(Od(o.y)).getUTCDay():n(Od(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,qd(o)):n(o)}}function A(t,n,e,r){for(var i,o,a=0,u=n.length,f=e.length;a<u;){if(r>=f)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=x[i in Fd?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),{format:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",Ud);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,qd);return n.toString=function(){return t},n}}}var Bd,Fd={"-":"",_:" ",0:"0"},Id=/^\s*\d+/,Hd=/^%/,jd=/[\\^$*+?|[\]().{}]/g;function Xd(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<e?new Array(e-o+1).join(n)+i:i)}function Gd(t){return t.replace(jd,"\\$&")}function Vd(t){return new RegExp("^(?:"+t.map(Gd).join("|")+")","i")}function $d(t){for(var n={},e=-1,r=t.length;++e<r;)n[t[e].toLowerCase()]=e;return n}function Wd(t,n,e){var r=Id.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function Zd(t,n,e){var r=Id.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function Qd(t,n,e){var r=Id.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function Jd(t,n,e){var r=Id.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function Kd(t,n,e){var r=Id.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function tp(t,n,e){var r=Id.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function np(t,n,e){var r=Id.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function ep(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function rp(t,n,e){var r=Id.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function ip(t,n,e){var r=Id.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function op(t,n,e){var r=Id.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function ap(t,n,e){var r=Id.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function up(t,n,e){var r=Id.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function fp(t,n,e){var r=Id.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function cp(t,n,e){var r=Id.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function sp(t,n,e){var r=Id.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function lp(t,n,e){var r=Hd.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function hp(t,n,e){var r=Id.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function dp(t,n,e){var r=Id.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function pp(t,n){return Xd(t.getDate(),n,2)}function vp(t,n){return Xd(t.getHours(),n,2)}function gp(t,n){return Xd(t.getHours()%12||12,n,2)}function yp(t,n){return Xd(1+jh.count(cd(t),t),n,3)}function _p(t,n){return Xd(t.getMilliseconds(),n,3)}function bp(t,n){return _p(t,n)+"000"}function mp(t,n){return Xd(t.getMonth()+1,n,2)}function xp(t,n){return Xd(t.getMinutes(),n,2)}function wp(t,n){return Xd(t.getSeconds(),n,2)}function Mp(t){var n=t.getDay();return 0===n?7:n}function Ap(t,n){return Xd(Vh.count(cd(t),t),n,2)}function Tp(t,n){var e=t.getDay();return t=e>=4||0===e?Qh(t):Qh.ceil(t),Xd(Qh.count(cd(t),t)+(4===cd(t).getDay()),n,2)}function Np(t){return t.getDay()}function Sp(t,n){return Xd($h.count(cd(t),t),n,2)}function Ep(t,n){return Xd(t.getFullYear()%100,n,2)}function kp(t,n){return Xd(t.getFullYear()%1e4,n,4)}function Cp(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Xd(n/60|0,"0",2)+Xd(n%60,"0",2)}function Pp(t,n){return Xd(t.getUTCDate(),n,2)}function zp(t,n){return Xd(t.getUTCHours(),n,2)}function Rp(t,n){return Xd(t.getUTCHours()%12||12,n,2)}function Lp(t,n){return Xd(1+vd.count(Ld(t),t),n,3)}function Dp(t,n){return Xd(t.getUTCMilliseconds(),n,3)}function Up(t,n){return Dp(t,n)+"000"}function qp(t,n){return Xd(t.getUTCMonth()+1,n,2)}function Op(t,n){return Xd(t.getUTCMinutes(),n,2)}function Yp(t,n){return Xd(t.getUTCSeconds(),n,2)}function Bp(t){var n=t.getUTCDay();return 0===n?7:n}function Fp(t,n){return Xd(_d.count(Ld(t),t),n,2)}function Ip(t,n){var e=t.getUTCDay();return t=e>=4||0===e?wd(t):wd.ceil(t),Xd(wd.count(Ld(t),t)+(4===Ld(t).getUTCDay()),n,2)}function Hp(t){return t.getUTCDay()}function jp(t,n){return Xd(bd.count(Ld(t),t),n,2)}function Xp(t,n){return Xd(t.getUTCFullYear()%100,n,2)}function Gp(t,n){return Xd(t.getUTCFullYear()%1e4,n,4)}function Vp(){return"+0000"}function $p(){return"%"}function Wp(t){return+t}function Zp(t){return Math.floor(+t/1e3)}function Qp(n){return Bd=Yd(n),t.timeFormat=Bd.format,t.timeParse=Bd.parse,t.utcFormat=Bd.utcFormat,t.utcParse=Bd.utcParse,Bd}Qp({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Jp=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var Kp=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ"),tv=1e3,nv=60*tv,ev=60*nv,rv=24*ev,iv=7*rv,ov=30*rv,av=365*rv;function uv(t){return new Date(t)}function fv(t){return t instanceof Date?+t:+new Date(+t)}function cv(t,n,r,i,o,a,u,f,c){var s=mh(gh,ve),l=s.invert,h=s.domain,d=c(".%L"),p=c(":%S"),v=c("%I:%M"),g=c("%I %p"),y=c("%a %d"),_=c("%b %d"),b=c("%B"),m=c("%Y"),x=[[u,1,tv],[u,5,5*tv],[u,15,15*tv],[u,30,30*tv],[a,1,nv],[a,5,5*nv],[a,15,15*nv],[a,30,30*nv],[o,1,ev],[o,3,3*ev],[o,6,6*ev],[o,12,12*ev],[i,1,rv],[i,2,2*rv],[r,1,iv],[n,1,ov],[n,3,3*ov],[t,1,av]];function M(e){return(u(e)<e?d:a(e)<e?p:o(e)<e?v:i(e)<e?g:n(e)<e?r(e)<e?y:_:t(e)<e?b:m)(e)}function A(n,r,i,o){if(null==n&&(n=10),"number"==typeof n){var a=Math.abs(i-r)/n,u=e(function(t){return t[2]}).right(x,a);u===x.length?(o=w(r/av,i/av,n),n=t):u?(o=(u=x[a/x[u-1][2]<x[u][2]/a?u-1:u])[1],n=u[0]):(o=Math.max(w(r,i,n),1),n=f)}return null==o?n:n.every(o)}return s.invert=function(t){return new Date(l(t))},s.domain=function(t){return arguments.length?h(fh.call(t,fv)):h().map(uv)},s.ticks=function(t,n){var e,r=h(),i=r[0],o=r[r.length-1],a=o<i;return a&&(e=i,i=o,o=e),e=(e=A(t,i,o,n))?e.range(i,o+1):[],a?e.reverse():e},s.tickFormat=function(t,n){return null==n?M:c(n)},s.nice=function(t,n){var e=h();return(t=A(t,e[0],e[e.length-1],n))?h(wh(e,t)):s},s.copy=function(){return bh(s,cv(t,n,r,i,o,a,u,f,c))},s}function sv(t){for(var n=t.length/6|0,e=new Array(n),r=0;r<n;)e[r]="#"+t.slice(6*r,6*++r);return e}var lv=sv("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),hv=sv("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),dv=sv("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),pv=sv("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),vv=sv("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),gv=sv("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),yv=sv("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),_v=sv("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),bv=sv("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function mv(t){return le(t[t.length-1])}var xv=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(sv),wv=mv(xv),Mv=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(sv),Av=mv(Mv),Tv=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(sv),Nv=mv(Tv),Sv=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(sv),Ev=mv(Sv),kv=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(sv),Cv=mv(kv),Pv=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(sv),zv=mv(Pv),Rv=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(sv),Lv=mv(Rv),Dv=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(sv),Uv=mv(Dv),qv=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(sv),Ov=mv(qv),Yv=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(sv),Bv=mv(Yv),Fv=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(sv),Iv=mv(Fv),Hv=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(sv),jv=mv(Hv),Xv=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(sv),Gv=mv(Xv),Vv=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(sv),$v=mv(Vv),Wv=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(sv),Zv=mv(Wv),Qv=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(sv),Jv=mv(Qv),Kv=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(sv),tg=mv(Kv),ng=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(sv),eg=mv(ng),rg=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(sv),ig=mv(rg),og=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(sv),ag=mv(og),ug=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(sv),fg=mv(ug),cg=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(sv),sg=mv(cg),lg=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(sv),hg=mv(lg),dg=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(sv),pg=mv(dg),vg=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(sv),gg=mv(vg),yg=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(sv),_g=mv(yg),bg=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(sv),mg=mv(bg),xg=Ge(Kn(300,.5,0),Kn(-240,.5,1)),wg=Ge(Kn(-100,.75,.35),Kn(80,1.5,.8)),Mg=Ge(Kn(260,.75,.35),Kn(80,1.5,.8)),Ag=Kn();var Tg=bn(),Ng=Math.PI/3,Sg=2*Math.PI/3;function Eg(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var kg=Eg(sv("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Cg=Eg(sv("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Pg=Eg(sv("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),zg=Eg(sv("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Rg(t){return function(){return t}}var Lg=Math.abs,Dg=Math.atan2,Ug=Math.cos,qg=Math.max,Og=Math.min,Yg=Math.sin,Bg=Math.sqrt,Fg=1e-12,Ig=Math.PI,Hg=Ig/2,jg=2*Ig;function Xg(t){return t>=1?Hg:t<=-1?-Hg:Math.asin(t)}function Gg(t){return t.innerRadius}function Vg(t){return t.outerRadius}function $g(t){return t.startAngle}function Wg(t){return t.endAngle}function Zg(t){return t&&t.padAngle}function Qg(t,n,e,r,i,o,a){var u=t-e,f=n-r,c=(a?o:-o)/Bg(u*u+f*f),s=c*f,l=-c*u,h=t+s,d=n+l,p=e+s,v=r+l,g=(h+p)/2,y=(d+v)/2,_=p-h,b=v-d,m=_*_+b*b,x=i-o,w=h*v-p*d,M=(b<0?-1:1)*Bg(qg(0,x*x*m-w*w)),A=(w*b-_*M)/m,T=(-w*_-b*M)/m,N=(w*b+_*M)/m,S=(-w*_+b*M)/m,E=A-g,k=T-y,C=N-g,P=S-y;return E*E+k*k>C*C+P*P&&(A=N,T=S),{cx:A,cy:T,x01:-s,y01:-l,x11:A*(i/x-1),y11:T*(i/x-1)}}function Jg(t){this._context=t}function Kg(t){return new Jg(t)}function ty(t){return t[0]}function ny(t){return t[1]}function ey(){var t=ty,n=ny,e=Rg(!0),r=null,i=Kg,o=null;function a(a){var u,f,c,s=a.length,l=!1;for(null==r&&(o=i(c=Gi())),u=0;u<=s;++u)!(u<s&&e(f=a[u],u,a))===l&&((l=!l)?o.lineStart():o.lineEnd()),l&&o.point(+t(f,u,a),+n(f,u,a));if(c)return o=null,c+""||null}return a.x=function(n){return arguments.length?(t="function"==typeof n?n:Rg(+n),a):t},a.y=function(t){return arguments.length?(n="function"==typeof t?t:Rg(+t),a):n},a.defined=function(t){return arguments.length?(e="function"==typeof t?t:Rg(!!t),a):e},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a}function ry(){var t=ty,n=null,e=Rg(0),r=ny,i=Rg(!0),o=null,a=Kg,u=null;function f(f){var c,s,l,h,d,p=f.length,v=!1,g=new Array(p),y=new Array(p);for(null==o&&(u=a(d=Gi())),c=0;c<=p;++c){if(!(c<p&&i(h=f[c],c,f))===v)if(v=!v)s=c,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),l=c-1;l>=s;--l)u.point(g[l],y[l]);u.lineEnd(),u.areaEnd()}v&&(g[c]=+t(h,c,f),y[c]=+e(h,c,f),u.point(n?+n(h,c,f):g[c],r?+r(h,c,f):y[c]))}if(d)return u=null,d+""||null}function c(){return ey().defined(i).curve(a).context(o)}return f.x=function(e){return arguments.length?(t="function"==typeof e?e:Rg(+e),n=null,f):t},f.x0=function(n){return arguments.length?(t="function"==typeof n?n:Rg(+n),f):t},f.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Rg(+t),f):n},f.y=function(t){return arguments.length?(e="function"==typeof t?t:Rg(+t),r=null,f):e},f.y0=function(t){return arguments.length?(e="function"==typeof t?t:Rg(+t),f):e},f.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Rg(+t),f):r},f.lineX0=f.lineY0=function(){return c().x(t).y(e)},f.lineY1=function(){return c().x(t).y(r)},f.lineX1=function(){return c().x(n).y(e)},f.defined=function(t){return arguments.length?(i="function"==typeof t?t:Rg(!!t),f):i},f.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),f):a},f.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),f):o},f}function iy(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function oy(t){return t}Jg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var ay=fy(Kg);function uy(t){this._curve=t}function fy(t){function n(n){return new uy(t(n))}return n._curve=t,n}function cy(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(fy(t)):n()._curve},t}function sy(){return cy(ey().curve(ay))}function ly(){var t=ry().curve(ay),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return cy(e())},delete t.lineX0,t.lineEndAngle=function(){return cy(r())},delete t.lineX1,t.lineInnerRadius=function(){return cy(i())},delete t.lineY0,t.lineOuterRadius=function(){return cy(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(fy(t)):n()._curve},t}function hy(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}uy.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var dy=Array.prototype.slice;function py(t){return t.source}function vy(t){return t.target}function gy(t){var n=py,e=vy,r=ty,i=ny,o=null;function a(){var a,u=dy.call(arguments),f=n.apply(this,u),c=e.apply(this,u);if(o||(o=a=Gi()),t(o,+r.apply(this,(u[0]=f,u)),+i.apply(this,u),+r.apply(this,(u[0]=c,u)),+i.apply(this,u)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(n=t,a):n},a.target=function(t){return arguments.length?(e=t,a):e},a.x=function(t){return arguments.length?(r="function"==typeof t?t:Rg(+t),a):r},a.y=function(t){return arguments.length?(i="function"==typeof t?t:Rg(+t),a):i},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function yy(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function _y(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function by(t,n,e,r,i){var o=hy(n,e),a=hy(n,e=(e+i)/2),u=hy(r,e),f=hy(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],f[0],f[1])}var my={draw:function(t,n){var e=Math.sqrt(n/Ig);t.moveTo(e,0),t.arc(0,0,e,0,jg)}},xy={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},wy=Math.sqrt(1/3),My=2*wy,Ay={draw:function(t,n){var e=Math.sqrt(n/My),r=e*wy;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Ty=Math.sin(Ig/10)/Math.sin(7*Ig/10),Ny=Math.sin(jg/10)*Ty,Sy=-Math.cos(jg/10)*Ty,Ey={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=Ny*e,i=Sy*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var a=jg*o/5,u=Math.cos(a),f=Math.sin(a);t.lineTo(f*e,-u*e),t.lineTo(u*r-f*i,f*r+u*i)}t.closePath()}},ky={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Cy=Math.sqrt(3),Py={draw:function(t,n){var e=-Math.sqrt(n/(3*Cy));t.moveTo(0,2*e),t.lineTo(-Cy*e,-e),t.lineTo(Cy*e,-e),t.closePath()}},zy=Math.sqrt(3)/2,Ry=1/Math.sqrt(12),Ly=3*(Ry/2+1),Dy={draw:function(t,n){var e=Math.sqrt(n/Ly),r=e/2,i=e*Ry,o=r,a=e*Ry+e,u=-o,f=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,f),t.lineTo(-.5*r-zy*i,zy*r+-.5*i),t.lineTo(-.5*o-zy*a,zy*o+-.5*a),t.lineTo(-.5*u-zy*f,zy*u+-.5*f),t.lineTo(-.5*r+zy*i,-.5*i-zy*r),t.lineTo(-.5*o+zy*a,-.5*a-zy*o),t.lineTo(-.5*u+zy*f,-.5*f-zy*u),t.closePath()}},Uy=[my,xy,Ay,ky,Ey,Py,Dy];function qy(){}function Oy(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function Yy(t){this._context=t}function By(t){this._context=t}function Fy(t){this._context=t}function Iy(t,n){this._basis=new Yy(t),this._beta=n}Yy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Oy(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Oy(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},By.prototype={areaStart:qy,areaEnd:qy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:Oy(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Fy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:Oy(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Iy.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,f=-1;++f<=e;)r=f/e,this._basis.point(this._beta*t[f]+(1-this._beta)*(i+r*a),this._beta*n[f]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Hy=function t(n){function e(t){return 1===n?new Yy(t):new Iy(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function jy(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function Xy(t,n){this._context=t,this._k=(1-n)/6}Xy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:jy(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:jy(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Gy=function t(n){function e(t){return new Xy(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Vy(t,n){this._context=t,this._k=(1-n)/6}Vy.prototype={areaStart:qy,areaEnd:qy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:jy(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var $y=function t(n){function e(t){return new Vy(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Wy(t,n){this._context=t,this._k=(1-n)/6}Wy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jy(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Zy=function t(n){function e(t){return new Wy(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Qy(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Fg){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,f=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/f,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/f}if(t._l23_a>Fg){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*c+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Jy(t,n){this._context=t,this._alpha=n}Jy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Qy(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Ky=function t(n){function e(t){return n?new Jy(t,n):new Xy(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function t_(t,n){this._context=t,this._alpha=n}t_.prototype={areaStart:qy,areaEnd:qy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Qy(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var n_=function t(n){function e(t){return n?new t_(t,n):new Vy(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function e_(t,n){this._context=t,this._alpha=n}e_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Qy(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var r_=function t(n){function e(t){return n?new e_(t,n):new Wy(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function i_(t){this._context=t}function o_(t){return t<0?-1:1}function a_(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(o_(o)+o_(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function u_(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function f_(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function c_(t){this._context=t}function s_(t){this._context=new l_(t)}function l_(t){this._context=t}function h_(t){this._context=t}function d_(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n<r-1;++n)i[n]=1,o[n]=4,a[n]=4*t[n]+2*t[n+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*t[r-1]+t[r],n=1;n<r;++n)e=i[n]/o[n-1],o[n]-=e,a[n]-=e*a[n-1];for(i[r-1]=a[r-1]/o[r-1],n=r-2;n>=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n<r-1;++n)o[n]=2*t[n+1]-i[n+1];return[i,o]}function p_(t,n){this._context=t,this._t=n}function v_(t,n){if((i=t.length)>1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o<i;++o)for(r=a,a=t[n[o]],e=0;e<u;++e)a[e][1]+=a[e][0]=isNaN(r[e][1])?r[e][0]:r[e][1]}function g_(t){for(var n=t.length,e=new Array(n);--n>=0;)e[n]=n;return e}function y_(t,n){return t[n]}function __(t){var n=t.map(b_);return g_(t).sort(function(t,e){return n[t]-n[e]})}function b_(t){for(var n,e=0,r=-1,i=t.length;++r<i;)(n=+t[r][1])&&(e+=n);return e}function m_(t){return function(){return t}}function x_(t){return t[0]}function w_(t){return t[1]}function M_(){this._=null}function A_(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function T_(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function N_(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function S_(t){for(;t.L;)t=t.L;return t}function E_(t,n,e,r){var i=[null,null],o=J_.push(i)-1;return i.left=t,i.right=n,e&&C_(i,t,n,e),r&&C_(i,n,t,r),Z_[t.index].halfedges.push(o),Z_[n.index].halfedges.push(o),i}function k_(t,n,e){var r=[n,e];return r.left=t,r}function C_(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function P_(t,n,e,r,i){var o,a=t[0],u=t[1],f=a[0],c=a[1],s=0,l=1,h=u[0]-f,d=u[1]-c;if(o=n-f,h||!(o>0)){if(o/=h,h<0){if(o<s)return;o<l&&(l=o)}else if(h>0){if(o>l)return;o>s&&(s=o)}if(o=r-f,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>s&&(s=o)}else if(h>0){if(o<s)return;o<l&&(l=o)}if(o=e-c,d||!(o>0)){if(o/=d,d<0){if(o<s)return;o<l&&(l=o)}else if(d>0){if(o>l)return;o>s&&(s=o)}if(o=i-c,d||!(o<0)){if(o/=d,d<0){if(o>l)return;o>s&&(s=o)}else if(d>0){if(o<s)return;o<l&&(l=o)}return!(s>0||l<1)||(s>0&&(t[0]=[f+s*h,c+s*d]),l<1&&(t[1]=[f+l*h,c+l*d]),!0)}}}}}function z_(t,n,e,r,i){var o=t[1];if(o)return!0;var a,u,f=t[0],c=t.left,s=t.right,l=c[0],h=c[1],d=s[0],p=s[1],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v<n||v>=r)return;if(l>d){if(f){if(f[1]>=i)return}else f=[v,e];o=[v,i]}else{if(f){if(f[1]<e)return}else f=[v,i];o=[v,e]}}else if(u=g-(a=(l-d)/(p-h))*v,a<-1||a>1)if(l>d){if(f){if(f[1]>=i)return}else f=[(e-u)/a,e];o=[(i-u)/a,i]}else{if(f){if(f[1]<e)return}else f=[(i-u)/a,i];o=[(e-u)/a,e]}else if(h<p){if(f){if(f[0]>=r)return}else f=[n,a*n+u];o=[r,a*r+u]}else{if(f){if(f[0]<n)return}else f=[r,a*r+u];o=[n,a*n+u]}return t[0]=f,t[1]=o,!0}function R_(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function L_(t,n){return n[+(n.left!==t.site)]}function D_(t,n){return n[+(n.left===t.site)]}i_.prototype={areaStart:qy,areaEnd:qy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}},c_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:f_(this,this._t0,u_(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(n=+n,(t=+t)!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,f_(this,u_(this,e=a_(this,t,n)),e);break;default:f_(this,this._t0,e=a_(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(s_.prototype=Object.create(c_.prototype)).point=function(t,n){c_.prototype.point.call(this,n,t)},l_.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,o){this._context.bezierCurveTo(n,t,r,e,o,i)}},h_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===e)this._context.lineTo(t[1],n[1]);else for(var r=d_(t),i=d_(n),o=0,a=1;a<e;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],n[a]);(this._line||0!==this._line&&1===e)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}},p_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}},M_.prototype={constructor:M_,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=S_(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(T_(this,e),e=(t=e).U),e.C=!1,r.C=!0,N_(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(N_(this,e),e=(t=e).U),e.C=!1,r.C=!0,T_(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,o=t.L,a=t.R;if(e=o?a?S_(a):o:a,i?i.L===t?i.L=e:i.R=e:this._=e,o&&a?(r=e.C,e.C=t.C,e.L=o,o.U=e,e!==a?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=a,a.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,T_(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,N_(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,T_(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,N_(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,T_(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,N_(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var U_,q_=[];function O_(){A_(this),this.x=this.y=this.arc=this.site=this.cy=null}function Y_(t){var n=t.P,e=t.N;if(n&&e){var r=n.site,i=t.site,o=e.site;if(r!==o){var a=i[0],u=i[1],f=r[0]-a,c=r[1]-u,s=o[0]-a,l=o[1]-u,h=2*(f*l-c*s);if(!(h>=-tb)){var d=f*f+c*c,p=s*s+l*l,v=(l*d-c*p)/h,g=(f*p-s*d)/h,y=q_.pop()||new O_;y.arc=t,y.site=i,y.x=v+a,y.y=(y.cy=g+u)+Math.sqrt(v*v+g*g),t.circle=y;for(var _=null,b=Q_._;b;)if(y.y<b.y||y.y===b.y&&y.x<=b.x){if(!b.L){_=b.P;break}b=b.L}else{if(!b.R){_=b;break}b=b.R}Q_.insert(_,y),_||(U_=y)}}}}function B_(t){var n=t.circle;n&&(n.P||(U_=n.N),Q_.remove(n),q_.push(n),A_(n),t.circle=null)}var F_=[];function I_(){A_(this),this.edge=this.site=this.circle=null}function H_(t){var n=F_.pop()||new I_;return n.site=t,n}function j_(t){B_(t),W_.remove(t),F_.push(t),A_(t)}function X_(t){var n=t.circle,e=n.x,r=n.cy,i=[e,r],o=t.P,a=t.N,u=[t];j_(t);for(var f=o;f.circle&&Math.abs(e-f.circle.x)<K_&&Math.abs(r-f.circle.cy)<K_;)o=f.P,u.unshift(f),j_(f),f=o;u.unshift(f),B_(f);for(var c=a;c.circle&&Math.abs(e-c.circle.x)<K_&&Math.abs(r-c.circle.cy)<K_;)a=c.N,u.push(c),j_(c),c=a;u.push(c),B_(c);var s,l=u.length;for(s=1;s<l;++s)c=u[s],f=u[s-1],C_(c.edge,f.site,c.site,i);f=u[0],(c=u[l-1]).edge=E_(f.site,c.site,null,i),Y_(f),Y_(c)}function G_(t){for(var n,e,r,i,o=t[0],a=t[1],u=W_._;u;)if((r=V_(u,a)-o)>K_)u=u.L;else{if(!((i=o-$_(u,a))>K_)){r>-K_?(n=u.P,e=u):i>-K_?(n=u,e=u.N):n=e=u;break}if(!u.R){n=u;break}u=u.R}!function(t){Z_[t.index]={site:t,halfedges:[]}}(t);var f=H_(t);if(W_.insert(n,f),n||e){if(n===e)return B_(n),e=H_(n.site),W_.insert(f,e),f.edge=e.edge=E_(n.site,f.site),Y_(n),void Y_(e);if(e){B_(n),B_(e);var c=n.site,s=c[0],l=c[1],h=t[0]-s,d=t[1]-l,p=e.site,v=p[0]-s,g=p[1]-l,y=2*(h*g-d*v),_=h*h+d*d,b=v*v+g*g,m=[(g*_-d*b)/y+s,(h*b-v*_)/y+l];C_(e.edge,c,p,m),f.edge=E_(c,t,null,m),e.edge=E_(t,p,null,m),Y_(n),Y_(e)}else f.edge=E_(n.site,f.site)}}function V_(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var a=t.P;if(!a)return-1/0;var u=(e=a.site)[0],f=e[1],c=f-n;if(!c)return u;var s=u-r,l=1/o-1/c,h=s/c;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*c)-f+c/2+i-o/2)))/l+r:(r+u)/2}function $_(t,n){var e=t.N;if(e)return V_(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var W_,Z_,Q_,J_,K_=1e-6,tb=1e-12;function nb(t,n){return n[1]-t[1]||n[0]-t[0]}function eb(t,n){var e,r,i,o=t.sort(nb).pop();for(J_=[],Z_=new Array(t.length),W_=new M_,Q_=new M_;;)if(i=U_,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===e&&o[1]===r||(G_(o),e=o[0],r=o[1]),o=t.pop();else{if(!i)break;X_(i.arc)}if(function(){for(var t,n,e,r,i=0,o=Z_.length;i<o;++i)if((t=Z_[i])&&(r=(n=t.halfedges).length)){var a=new Array(r),u=new Array(r);for(e=0;e<r;++e)a[e]=e,u[e]=R_(t,J_[n[e]]);for(a.sort(function(t,n){return u[n]-u[t]}),e=0;e<r;++e)u[e]=n[a[e]];for(e=0;e<r;++e)n[e]=u[e]}}(),n){var a=+n[0][0],u=+n[0][1],f=+n[1][0],c=+n[1][1];!function(t,n,e,r){for(var i,o=J_.length;o--;)z_(i=J_[o],t,n,e,r)&&P_(i,t,n,e,r)&&(Math.abs(i[0][0]-i[1][0])>K_||Math.abs(i[0][1]-i[1][1])>K_)||delete J_[o]}(a,u,f,c),function(t,n,e,r){var i,o,a,u,f,c,s,l,h,d,p,v,g=Z_.length,y=!0;for(i=0;i<g;++i)if(o=Z_[i]){for(a=o.site,u=(f=o.halfedges).length;u--;)J_[f[u]]||f.splice(u,1);for(u=0,c=f.length;u<c;)p=(d=D_(o,J_[f[u]]))[0],v=d[1],l=(s=L_(o,J_[f[++u%c]]))[0],h=s[1],(Math.abs(p-l)>K_||Math.abs(v-h)>K_)&&(f.splice(u,0,J_.push(k_(a,d,Math.abs(p-t)<K_&&r-v>K_?[t,Math.abs(l-t)<K_?h:r]:Math.abs(v-r)<K_&&e-p>K_?[Math.abs(h-r)<K_?l:e,r]:Math.abs(p-e)<K_&&v-n>K_?[e,Math.abs(l-e)<K_?h:n]:Math.abs(v-n)<K_&&p-t>K_?[Math.abs(h-n)<K_?l:t,n]:null))-1),++c);c&&(y=!1)}if(y){var _,b,m,x=1/0;for(i=0,y=null;i<g;++i)(o=Z_[i])&&(m=(_=(a=o.site)[0]-t)*_+(b=a[1]-n)*b)<x&&(x=m,y=o);if(y){var w=[t,n],M=[t,r],A=[e,r],T=[e,n];y.halfedges.push(J_.push(k_(a=y.site,w,M))-1,J_.push(k_(a,M,A))-1,J_.push(k_(a,A,T))-1,J_.push(k_(a,T,w))-1)}}for(i=0;i<g;++i)(o=Z_[i])&&(o.halfedges.length||delete Z_[i])}(a,u,f,c)}this.edges=J_,this.cells=Z_,W_=Q_=J_=Z_=null}function rb(t){return function(){return t}}function ib(t,n,e){this.target=t,this.type=n,this.transform=e}function ob(t,n,e){this.k=t,this.x=n,this.y=e}eb.prototype={constructor:eb,polygons:function(){var t=this.edges;return this.cells.map(function(n){var e=n.halfedges.map(function(e){return L_(n,t[e])});return e.data=n.site.data,e})},triangles:function(){var t=[],n=this.edges;return this.cells.forEach(function(e,r){if(o=(i=e.halfedges).length)for(var i,o,a,u,f,c,s=e.site,l=-1,h=n[i[o-1]],d=h.left===s?h.right:h.left;++l<o;)a=d,d=(h=n[i[l]]).left===s?h.right:h.left,a&&d&&r<a.index&&r<d.index&&(f=a,c=d,((u=s)[0]-c[0])*(f[1]-u[1])-(u[0]-f[0])*(c[1]-u[1])<0)&&t.push([s.data,a.data,d.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,n,e){for(var r,i,o=this,a=o._found||0,u=o.cells.length;!(i=o.cells[a]);)if(++a>=u)return null;var f=t-i.site[0],c=n-i.site[1],s=f*f+c*c;do{i=o.cells[r=a],a=null,i.halfedges.forEach(function(e){var r=o.edges[e],u=r.left;if(u!==i.site&&u||(u=r.right)){var f=t-u[0],c=n-u[1],l=f*f+c*c;l<s&&(s=l,a=u.index)}})}while(null!==a);return o._found=r,null==e||s<=e*e?i.site:null}},ob.prototype={constructor:ob,scale:function(t){return 1===t?this:new ob(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new ob(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ab=new ob(1,0,0);function ub(t){return t.__zoom||ab}function fb(){t.event.stopImmediatePropagation()}function cb(){t.event.preventDefault(),t.event.stopImmediatePropagation()}function sb(){return!t.event.button}function lb(){var t,n,e=this;return e instanceof SVGElement?(t=(e=e.ownerSVGElement||e).width.baseVal.value,n=e.height.baseVal.value):(t=e.clientWidth,n=e.clientHeight),[[0,0],[t,n]]}function hb(){return this.__zoom||ab}function db(){return-t.event.deltaY*(t.event.deltaMode?120:1)/500}function pb(){return"ontouchstart"in this}function vb(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}ub.prototype=ob.prototype,t.version="5.7.0",t.bisect=i,t.bisectRight=i,t.bisectLeft=o,t.ascending=n,t.bisector=e,t.cross=function(t,n,e){var r,i,o,u,f=t.length,c=n.length,s=new Array(f*c);for(null==e&&(e=a),r=o=0;r<f;++r)for(u=t[r],i=0;i<c;++i,++o)s[o]=e(u,n[i]);return s},t.descending=function(t,n){return n<t?-1:n>t?1:n>=t?0:NaN},t.deviation=c,t.extent=s,t.histogram=function(){var t=v,n=s,e=M;function r(r){var o,a,u=r.length,f=new Array(u);for(o=0;o<u;++o)f[o]=t(r[o],o,r);var c=n(f),s=c[0],l=c[1],h=e(f,s,l);Array.isArray(h)||(h=w(s,l,h),h=g(Math.ceil(s/h)*h,l,h));for(var d=h.length;h[0]<=s;)h.shift(),--d;for(;h[d-1]>l;)h.pop(),--d;var p,v=new Array(d+1);for(o=0;o<=d;++o)(p=v[o]=[]).x0=o>0?h[o-1]:s,p.x1=o<d?h[o]:l;for(o=0;o<u;++o)s<=(a=f[o])&&a<=l&&v[i(h,a,0,d)].push(r[o]);return v}return r.value=function(n){return arguments.length?(t="function"==typeof n?n:p(n),r):t},r.domain=function(t){return arguments.length?(n="function"==typeof t?t:p([t[0],t[1]]),r):n},r.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?p(h.call(t)):p(t),r):e},r},t.thresholdFreedmanDiaconis=function(t,e,r){return t=d.call(t,u).sort(n),Math.ceil((r-e)/(2*(A(t,.75)-A(t,.25))*Math.pow(t.length,-1/3)))},t.thresholdScott=function(t,n,e){return Math.ceil((e-n)/(3.5*c(t)*Math.pow(t.length,-1/3)))},t.thresholdSturges=M,t.max=T,t.mean=function(t,n){var e,r=t.length,i=r,o=-1,a=0;if(null==n)for(;++o<r;)isNaN(e=u(t[o]))?--i:a+=e;else for(;++o<r;)isNaN(e=u(n(t[o],o,t)))?--i:a+=e;if(i)return a/i},t.median=function(t,e){var r,i=t.length,o=-1,a=[];if(null==e)for(;++o<i;)isNaN(r=u(t[o]))||a.push(r);else for(;++o<i;)isNaN(r=u(e(t[o],o,t)))||a.push(r);return A(a.sort(n),.5)},t.merge=N,t.min=S,t.pairs=function(t,n){null==n&&(n=a);for(var e=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);e<r;)o[e]=n(i,i=t[++e]);return o},t.permute=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},t.quantile=A,t.range=g,t.scan=function(t,e){if(r=t.length){var r,i,o=0,a=0,u=t[a];for(null==e&&(e=n);++o<r;)(e(i=t[o],u)<0||0!==e(u,u))&&(u=i,a=o);return 0===e(u,u)?a:void 0}},t.shuffle=function(t,n,e){for(var r,i,o=(null==e?t.length:e)-(n=null==n?0:+n);o;)i=Math.random()*o--|0,r=t[o+n],t[o+n]=t[i+n],t[i+n]=r;return t},t.sum=function(t,n){var e,r=t.length,i=-1,o=0;if(null==n)for(;++i<r;)(e=+t[i])&&(o+=e);else for(;++i<r;)(e=+n(t[i],i,t))&&(o+=e);return o},t.ticks=m,t.tickIncrement=x,t.tickStep=w,t.transpose=E,t.variance=f,t.zip=function(){return E(arguments)},t.axisTop=function(t){return B(z,t)},t.axisRight=function(t){return B(R,t)},t.axisBottom=function(t){return B(L,t)},t.axisLeft=function(t){return B(D,t)},t.brush=function(){return Ri(wi)},t.brushX=function(){return Ri(mi)},t.brushY=function(){return Ri(xi)},t.brushSelection=function(t){var n=t.__brush;return n?n.dim.output(n.selection):null},t.chord=function(){var t=0,n=null,e=null,r=null;function i(i){var o,a,u,f,c,s,l=i.length,h=[],d=g(l),p=[],v=[],y=v.groups=new Array(l),_=new Array(l*l);for(o=0,c=-1;++c<l;){for(a=0,s=-1;++s<l;)a+=i[c][s];h.push(a),p.push(g(l)),o+=a}for(n&&d.sort(function(t,e){return n(h[t],h[e])}),e&&p.forEach(function(t,n){t.sort(function(t,r){return e(i[n][t],i[n][r])})}),f=(o=Yi(0,Oi-t*l)/o)?t:Oi/l,a=0,c=-1;++c<l;){for(u=a,s=-1;++s<l;){var b=d[c],m=p[b][s],x=i[b][m],w=a,M=a+=x*o;_[m*l+b]={index:b,subindex:m,startAngle:w,endAngle:M,value:x}}y[b]={index:b,startAngle:u,endAngle:a,value:h[b]},a+=f}for(c=-1;++c<l;)for(s=c-1;++s<l;){var A=_[s*l+c],T=_[c*l+s];(A.value||T.value)&&v.push(A.value<T.value?{source:T,target:A}:{source:A,target:T})}return r?v.sort(r):v}return i.padAngle=function(n){return arguments.length?(t=Yi(0,n),i):t},i.sortGroups=function(t){return arguments.length?(n=t,i):n},i.sortSubgroups=function(t){return arguments.length?(e=t,i):e},i.sortChords=function(t){return arguments.length?(null==t?r=null:(n=t,r=function(t,e){return n(t.source.value+t.target.value,e.source.value+e.target.value)})._=t,i):r&&r._;var n},i},t.ribbon=function(){var t=Vi,n=$i,e=Wi,r=Zi,i=Qi,o=null;function a(){var a,u=Bi.call(arguments),f=t.apply(this,u),c=n.apply(this,u),s=+e.apply(this,(u[0]=f,u)),l=r.apply(this,u)-qi,h=i.apply(this,u)-qi,d=s*Li(l),p=s*Di(l),v=+e.apply(this,(u[0]=c,u)),g=r.apply(this,u)-qi,y=i.apply(this,u)-qi;if(o||(o=a=Gi()),o.moveTo(d,p),o.arc(0,0,s,l,h),l===g&&h===y||(o.quadraticCurveTo(0,0,v*Li(g),v*Di(g)),o.arc(0,0,v,g,y)),o.quadraticCurveTo(0,0,d,p),o.closePath(),a)return o=null,a+""||null}return a.radius=function(t){return arguments.length?(e="function"==typeof t?t:Fi(+t),a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Fi(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Fi(+t),a):i},a.source=function(n){return arguments.length?(t=n,a):t},a.target=function(t){return arguments.length?(n=t,a):n},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a},t.nest=function(){var t,n,e,r=[],i=[];function o(e,i,a,u){if(i>=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var f,c,s,l=-1,h=e.length,d=r[i++],p=Ki(),v=a();++l<h;)(s=p.get(f=d(c=e[l])+""))?s.push(c):p.set(f,[c]);return p.each(function(t,n){u(v,n,o(t,i,a,u))}),v}return e={object:function(t){return o(t,0,to,no)},map:function(t){return o(t,0,eo,ro)},entries:function(t){return function t(e,o){if(++o>r.length)return e;var a,u=i[o-1];return null!=n&&o>=r.length?a=e.entries():(a=[],e.each(function(n,e){a.push({key:e,values:t(n,o)})})),null!=u?a.sort(function(t,n){return u(t.key,n.key)}):a}(o(t,0,eo,ro),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}},t.set=ao,t.map=Ki,t.keys=function(t){var n=[];for(var e in t)n.push(e);return n},t.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},t.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},t.color=vn,t.rgb=bn,t.hsl=Mn,t.lab=Un,t.hcl=Hn,t.lch=function(t,n,e,r){return 1===arguments.length?In(t):new jn(e,n,t,null==r?1:r)},t.gray=function(t,n){return new qn(t,0,0,null==n?1:n)},t.cubehelix=Kn,t.contours=go,t.contourDensity=function(){var t=bo,n=mo,e=xo,r=960,i=500,o=20,a=2,u=3*o,f=r+2*u>>a,c=i+2*u>>a,s=co(20);function l(r){var i=new Float32Array(f*c),l=new Float32Array(f*c);r.forEach(function(r,o,s){var l=+t(r,o,s)+u>>a,h=+n(r,o,s)+u>>a,d=+e(r,o,s);l>=0&&l<f&&h>=0&&h<c&&(i[l+h*f]+=d)}),yo({width:f,height:c,data:i},{width:f,height:c,data:l},o>>a),_o({width:f,height:c,data:l},{width:f,height:c,data:i},o>>a),yo({width:f,height:c,data:i},{width:f,height:c,data:l},o>>a),_o({width:f,height:c,data:l},{width:f,height:c,data:i},o>>a),yo({width:f,height:c,data:i},{width:f,height:c,data:l},o>>a),_o({width:f,height:c,data:l},{width:f,height:c,data:i},o>>a);var d=s(i);if(!Array.isArray(d)){var p=T(i);d=w(0,p,d),(d=g(0,Math.floor(p/d)*d,d)).shift()}return go().thresholds(d).size([f,c])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*a),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(v)}function v(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function y(){return f=r+2*(u=3*o)>>a,c=i+2*u>>a,l}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:co(+n),l):t},l.y=function(t){return arguments.length?(n="function"==typeof t?t:co(+t),l):n},l.weight=function(t){return arguments.length?(e="function"==typeof t?t:co(+t),l):e},l.size=function(t){if(!arguments.length)return[r,i];var n=Math.ceil(t[0]),e=Math.ceil(t[1]);if(!(n>=0||n>=0))throw new Error("invalid size");return r=n,i=e,y()},l.cellSize=function(t){if(!arguments.length)return 1<<a;if(!((t=+t)>=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),y()},l.thresholds=function(t){return arguments.length?(s="function"==typeof t?t:Array.isArray(t)?co(uo.call(t)):co(t),l):s},l.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=Math.round((Math.sqrt(4*t*t+1)-1)/2),y()},l},t.dispatch=I,t.drag=function(){var n,e,r,i,o=Wt,a=Zt,u=Qt,f=Jt,c={},s=I("start","drag","end"),l=0,h=0;function d(t){t.on("mousedown.drag",p).filter(f).on("touchstart.drag",y).on("touchmove.drag",_).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!i&&o.apply(this,arguments)){var u=m("mouse",a.apply(this,arguments),Ft,this,arguments);u&&(Dt(t.event.view).on("mousemove.drag",v,!0).on("mouseup.drag",g,!0),Xt(t.event.view),Ht(),r=!1,n=t.event.clientX,e=t.event.clientY,u("start"))}}function v(){if(jt(),!r){var i=t.event.clientX-n,o=t.event.clientY-e;r=i*i+o*o>h}c.mouse("drag")}function g(){Dt(t.event.view).on("mousemove.drag mouseup.drag",null),Gt(t.event.view,r),jt(),c.mouse("end")}function y(){if(o.apply(this,arguments)){var n,e,r=t.event.changedTouches,i=a.apply(this,arguments),u=r.length;for(n=0;n<u;++n)(e=m(r[n].identifier,i,It,this,arguments))&&(Ht(),e("start"))}}function _(){var n,e,r=t.event.changedTouches,i=r.length;for(n=0;n<i;++n)(e=c[r[n].identifier])&&(jt(),e("drag"))}function b(){var n,e,r=t.event.changedTouches,o=r.length;for(i&&clearTimeout(i),i=setTimeout(function(){i=null},500),n=0;n<o;++n)(e=c[r[n].identifier])&&(Ht(),e("end"))}function m(n,e,r,i,o){var a,f,h,p=r(e,n),v=s.copy();if(Ct(new $t(d,"beforestart",a,n,l,p[0],p[1],0,0,v),function(){return null!=(t.event.subject=a=u.apply(i,o))&&(f=a.x-p[0]||0,h=a.y-p[1]||0,!0)}))return function t(u){var s,g=p;switch(u){case"start":c[n]=t,s=l++;break;case"end":delete c[n],--l;case"drag":p=r(e,n),s=l}Ct(new $t(d,u,a,n,s,p[0]+f,p[1]+h,p[0]-g[0],p[1]-g[1],v),v.apply,v,[u,i,o])}}return d.filter=function(t){return arguments.length?(o="function"==typeof t?t:Vt(!!t),d):o},d.container=function(t){return arguments.length?(a="function"==typeof t?t:Vt(t),d):a},d.subject=function(t){return arguments.length?(u="function"==typeof t?t:Vt(t),d):u},d.touchable=function(t){return arguments.length?(f="function"==typeof t?t:Vt(!!t),d):f},d.on=function(){var t=s.on.apply(s,arguments);return t===s?d:t},d.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,d):Math.sqrt(h)},d},t.dragDisable=Xt,t.dragEnable=Gt,t.dsvFormat=Eo,t.csvParse=Co,t.csvParseRows=Po,t.csvFormat=zo,t.csvFormatRows=Ro,t.tsvParse=Do,t.tsvParseRows=Uo,t.tsvFormat=qo,t.tsvFormatRows=Oo,t.easeLinear=function(t){return+t},t.easeQuad=Dr,t.easeQuadIn=function(t){return t*t},t.easeQuadOut=function(t){return t*(2-t)},t.easeQuadInOut=Dr,t.easeCubic=Ur,t.easeCubicIn=function(t){return t*t*t},t.easeCubicOut=function(t){return--t*t*t+1},t.easeCubicInOut=Ur,t.easePoly=Yr,t.easePolyIn=qr,t.easePolyOut=Or,t.easePolyInOut=Yr,t.easeSin=Ir,t.easeSinIn=function(t){return 1-Math.cos(t*Fr)},t.easeSinOut=function(t){return Math.sin(t*Fr)},t.easeSinInOut=Ir,t.easeExp=Hr,t.easeExpIn=function(t){return Math.pow(2,10*t-10)},t.easeExpOut=function(t){return 1-Math.pow(2,-10*t)},t.easeExpInOut=Hr,t.easeCircle=jr,t.easeCircleIn=function(t){return 1-Math.sqrt(1-t*t)},t.easeCircleOut=function(t){return Math.sqrt(1- --t*t)},t.easeCircleInOut=jr,t.easeBounce=ni,t.easeBounceIn=function(t){return 1-ni(1-t)},t.easeBounceOut=ni,t.easeBounceInOut=function(t){return((t*=2)<=1?1-ni(1-t):ni(t-1)+1)/2},t.easeBack=ii,t.easeBackIn=ei,t.easeBackOut=ri,t.easeBackInOut=ii,t.easeElastic=ui,t.easeElasticIn=ai,t.easeElasticOut=ui,t.easeElasticInOut=fi,t.blob=function(t,n){return fetch(t,n).then(Yo)},t.buffer=function(t,n){return fetch(t,n).then(Bo)},t.dsv=function(t,n,e,r){3===arguments.length&&"function"==typeof e&&(r=e,e=void 0);var i=Eo(t);return Io(n,e).then(function(t){return i.parse(t,r)})},t.csv=jo,t.tsv=Xo,t.image=function(t,n){return new Promise(function(e,r){var i=new Image;for(var o in n)i[o]=n[o];i.onerror=r,i.onload=function(){e(i)},i.src=t})},t.json=function(t,n){return fetch(t,n).then(Go)},t.text=Io,t.xml=$o,t.html=Wo,t.svg=Zo,t.forceCenter=function(t,n){var e;function r(){var r,i,o=e.length,a=0,u=0;for(r=0;r<o;++r)a+=(i=e[r]).x,u+=i.y;for(a=a/o-t,u=u/o-n,r=0;r<o;++r)(i=e[r]).x-=a,i.y-=u}return null==t&&(t=0),null==n&&(n=0),r.initialize=function(t){e=t},r.x=function(n){return arguments.length?(t=+n,r):t},r.y=function(t){return arguments.length?(n=+t,r):n},r},t.forceCollide=function(t){var n,e,r=1,i=1;function o(){for(var t,o,u,f,c,s,l,h=n.length,d=0;d<i;++d)for(o=ra(n,ua,fa).visitAfter(a),t=0;t<h;++t)u=n[t],s=e[u.index],l=s*s,f=u.x+u.vx,c=u.y+u.vy,o.visit(p);function p(t,n,e,i,o){var a=t.data,h=t.r,d=s+h;if(!a)return n>f+d||i<f-d||e>c+d||o<c-d;if(a.index>u.index){var p=f-a.x-a.vx,v=c-a.y-a.vy,g=p*p+v*v;g<d*d&&(0===p&&(g+=(p=Jo())*p),0===v&&(g+=(v=Jo())*v),g=(d-(g=Math.sqrt(g)))/g*r,u.vx+=(p*=g)*(d=(h*=h)/(l+h)),u.vy+=(v*=g)*d,a.vx-=p*(d=1-d),a.vy-=v*d)}}}function a(t){if(t.data)return t.r=e[t.data.index];for(var n=t.r=0;n<4;++n)t[n]&&t[n].r>t.r&&(t.r=t[n].r)}function u(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r<o;++r)i=n[r],e[i.index]=+t(i,r,n)}}return"function"!=typeof t&&(t=Qo(null==t?1:+t)),o.initialize=function(t){n=t,u()},o.iterations=function(t){return arguments.length?(i=+t,o):i},o.strength=function(t){return arguments.length?(r=+t,o):r},o.radius=function(n){return arguments.length?(t="function"==typeof n?n:Qo(+n),u(),o):t},o},t.forceLink=function(t){var n,e,r,i,o,a=ca,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},f=Qo(30),c=1;function s(r){for(var i=0,a=t.length;i<c;++i)for(var u,f,s,l,h,d,p,v=0;v<a;++v)f=(u=t[v]).source,l=(s=u.target).x+s.vx-f.x-f.vx||Jo(),h=s.y+s.vy-f.y-f.vy||Jo(),l*=d=((d=Math.sqrt(l*l+h*h))-e[v])/d*r*n[v],h*=d,s.vx-=l*(p=o[v]),s.vy-=h*p,f.vx+=l*(p=1-p),f.vy+=h*p}function l(){if(r){var u,f,c=r.length,s=t.length,l=Ki(r,a);for(u=0,i=new Array(c);u<s;++u)(f=t[u]).index=u,"object"!=typeof f.source&&(f.source=sa(l,f.source)),"object"!=typeof f.target&&(f.target=sa(l,f.target)),i[f.source.index]=(i[f.source.index]||0)+1,i[f.target.index]=(i[f.target.index]||0)+1;for(u=0,o=new Array(s);u<s;++u)f=t[u],o[u]=i[f.source.index]/(i[f.source.index]+i[f.target.index]);n=new Array(s),h(),e=new Array(s),d()}}function h(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+u(t[e],e,t)}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+f(t[n],n,t)}return null==t&&(t=[]),s.initialize=function(t){r=t,l()},s.links=function(n){return arguments.length?(t=n,l(),s):t},s.id=function(t){return arguments.length?(a=t,s):a},s.iterations=function(t){return arguments.length?(c=+t,s):c},s.strength=function(t){return arguments.length?(u="function"==typeof t?t:Qo(+t),h(),s):u},s.distance=function(t){return arguments.length?(f="function"==typeof t?t:Qo(+t),d(),s):f},s},t.forceManyBody=function(){var t,n,e,r,i=Qo(-30),o=1,a=1/0,u=.81;function f(r){var i,o=t.length,a=ra(t,la,ha).visitAfter(s);for(e=r,i=0;i<o;++i)n=t[i],a.visit(l)}function c(){if(t){var n,e,o=t.length;for(r=new Array(o),n=0;n<o;++n)e=t[n],r[e.index]=+i(e,n,t)}}function s(t){var n,e,i,o,a,u=0,f=0;if(t.length){for(i=o=a=0;a<4;++a)(n=t[a])&&(e=Math.abs(n.value))&&(u+=n.value,f+=e,i+=e*n.x,o+=e*n.y);t.x=i/f,t.y=o/f}else{(n=t).x=n.data.x,n.y=n.data.y;do{u+=r[n.data.index]}while(n=n.next)}t.value=u}function l(t,i,f,c){if(!t.value)return!0;var s=t.x-n.x,l=t.y-n.y,h=c-i,d=s*s+l*l;if(h*h/u<d)return d<a&&(0===s&&(d+=(s=Jo())*s),0===l&&(d+=(l=Jo())*l),d<o&&(d=Math.sqrt(o*d)),n.vx+=s*t.value*e/d,n.vy+=l*t.value*e/d),!0;if(!(t.length||d>=a)){(t.data!==n||t.next)&&(0===s&&(d+=(s=Jo())*s),0===l&&(d+=(l=Jo())*l),d<o&&(d=Math.sqrt(o*d)));do{t.data!==n&&(h=r[t.data.index]*e/d,n.vx+=s*h,n.vy+=l*h)}while(t=t.next)}}return f.initialize=function(n){t=n,c()},f.strength=function(t){return arguments.length?(i="function"==typeof t?t:Qo(+t),c(),f):i},f.distanceMin=function(t){return arguments.length?(o=t*t,f):Math.sqrt(o)},f.distanceMax=function(t){return arguments.length?(a=t*t,f):Math.sqrt(a)},f.theta=function(t){return arguments.length?(u=t*t,f):Math.sqrt(u)},f},t.forceRadial=function(t,n,e){var r,i,o,a=Qo(.1);function u(t){for(var a=0,u=r.length;a<u;++a){var f=r[a],c=f.x-n||1e-6,s=f.y-e||1e-6,l=Math.sqrt(c*c+s*s),h=(o[a]-l)*i[a]*t/l;f.vx+=c*h,f.vy+=s*h}}function f(){if(r){var n,e=r.length;for(i=new Array(e),o=new Array(e),n=0;n<e;++n)o[n]=+t(r[n],n,r),i[n]=isNaN(o[n])?0:+a(r[n],n,r)}}return"function"!=typeof t&&(t=Qo(+t)),null==n&&(n=0),null==e&&(e=0),u.initialize=function(t){r=t,f()},u.strength=function(t){return arguments.length?(a="function"==typeof t?t:Qo(+t),f(),u):a},u.radius=function(n){return arguments.length?(t="function"==typeof n?n:Qo(+n),f(),u):t},u.x=function(t){return arguments.length?(n=+t,u):n},u.y=function(t){return arguments.length?(e=+t,u):e},u},t.forceSimulation=function(t){var n,e=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,u=Ki(),f=ur(s),c=I("tick","end");function s(){l(),c.call("tick",n),e<r&&(f.stop(),c.call("end",n))}function l(){var n,r,f=t.length;for(e+=(o-e)*i,u.each(function(t){t(e)}),n=0;n<f;++n)null==(r=t[n]).fx?r.x+=r.vx*=a:(r.x=r.fx,r.vx=0),null==r.fy?r.y+=r.vy*=a:(r.y=r.fy,r.vy=0)}function h(){for(var n,e=0,r=t.length;e<r;++e){if((n=t[e]).index=e,isNaN(n.x)||isNaN(n.y)){var i=da*Math.sqrt(e),o=e*pa;n.x=i*Math.cos(o),n.y=i*Math.sin(o)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function d(n){return n.initialize&&n.initialize(t),n}return null==t&&(t=[]),h(),n={tick:l,restart:function(){return f.restart(s),n},stop:function(){return f.stop(),n},nodes:function(e){return arguments.length?(t=e,h(),u.each(d),n):t},alpha:function(t){return arguments.length?(e=+t,n):e},alphaMin:function(t){return arguments.length?(r=+t,n):r},alphaDecay:function(t){return arguments.length?(i=+t,n):+i},alphaTarget:function(t){return arguments.length?(o=+t,n):o},velocityDecay:function(t){return arguments.length?(a=1-t,n):1-a},force:function(t,e){return arguments.length>1?(null==e?u.remove(t):u.set(t,d(e)),n):u.get(t)},find:function(n,e,r){var i,o,a,u,f,c=0,s=t.length;for(null==r?r=1/0:r*=r,c=0;c<s;++c)(a=(i=n-(u=t[c]).x)*i+(o=e-u.y)*o)<r&&(f=u,r=a);return f},on:function(t,e){return arguments.length>1?(c.on(t,e),n):c.on(t)}}},t.forceX=function(t){var n,e,r,i=Qo(.1);function o(t){for(var i,o=0,a=n.length;o<a;++o)(i=n[o]).vx+=(r[o]-i.x)*e[o]*t}function a(){if(n){var o,a=n.length;for(e=new Array(a),r=new Array(a),o=0;o<a;++o)e[o]=isNaN(r[o]=+t(n[o],o,n))?0:+i(n[o],o,n)}}return"function"!=typeof t&&(t=Qo(null==t?0:+t)),o.initialize=function(t){n=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Qo(+t),a(),o):i},o.x=function(n){return arguments.length?(t="function"==typeof n?n:Qo(+n),a(),o):t},o},t.forceY=function(t){var n,e,r,i=Qo(.1);function o(t){for(var i,o=0,a=n.length;o<a;++o)(i=n[o]).vy+=(r[o]-i.y)*e[o]*t}function a(){if(n){var o,a=n.length;for(e=new Array(a),r=new Array(a),o=0;o<a;++o)e[o]=isNaN(r[o]=+t(n[o],o,n))?0:+i(n[o],o,n)}}return"function"!=typeof t&&(t=Qo(null==t?0:+t)),o.initialize=function(t){n=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:Qo(+t),a(),o):i},o.y=function(n){return arguments.length?(t="function"==typeof n?n:Qo(+n),a(),o):t},o},t.formatDefaultLocale=Sa,t.formatLocale=Na,t.formatSpecifier=ba,t.precisionFixed=Ea,t.precisionPrefix=ka,t.precisionRound=Ca,t.geoArea=function(t){return yu.reset(),su(t,_u),2*yu},t.geoBounds=function(t){var n,e,r,i,o,a,u;if(Ru=zu=-(Cu=Pu=1/0),Ou=[],su(t,rf),e=Ou.length){for(Ou.sort(df),n=1,o=[r=Ou[0]];n<e;++n)pf(r,(i=Ou[n])[0])||pf(r,i[1])?(hf(r[0],i[1])>hf(r[0],r[1])&&(r[1]=i[1]),hf(i[0],r[1])>hf(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=hf(r[1],i[0]))>a&&(a=u,Cu=i[0],zu=r[1])}return Ou=Yu=null,Cu===1/0||Pu===1/0?[[NaN,NaN],[NaN,NaN]]:[[Cu,Pu],[zu,Ru]]},t.geoCentroid=function(t){Bu=Fu=Iu=Hu=ju=Xu=Gu=Vu=$u=Wu=Zu=0,su(t,vf);var n=$u,e=Wu,r=Zu,i=n*n+e*e+r*r;return i<Ua&&(n=Xu,e=Gu,r=Vu,Fu<Da&&(n=Iu,e=Hu,r=ju),(i=n*n+e*e+r*r)<Ua)?[NaN,NaN]:[Xa(e,n)*Fa,eu(r/Ka(i))*Fa]},t.geoCircle=function(){var t,n,e=Nf([0,0]),r=Nf(90),i=Nf(6),o={point:function(e,r){t.push(e=n(e,r)),e[0]*=Fa,e[1]*=Fa}};function a(){var a=e.apply(this,arguments),u=r.apply(this,arguments)*Ia,f=i.apply(this,arguments)*Ia;return t=[],n=kf(-a[0]*Ia,-a[1]*Ia,0).invert,Lf(o,u,f,1),a={type:"Polygon",coordinates:[t]},t=n=null,a}return a.center=function(t){return arguments.length?(e="function"==typeof t?t:Nf([+t[0],+t[1]]),a):e},a.radius=function(t){return arguments.length?(r="function"==typeof t?t:Nf(+t),a):r},a.precision=function(t){return arguments.length?(i="function"==typeof t?t:Nf(+t),a):i},a},t.geoClipAntimeridian=Gf,t.geoClipCircle=Vf,t.geoClipExtent=function(){var t,n,e,r=0,i=0,o=960,a=500;return e={stream:function(e){return t&&n===e?t:t=Zf(r,i,o,a)(n=e)},extent:function(u){return arguments.length?(r=+u[0][0],i=+u[0][1],o=+u[1][0],a=+u[1][1],t=n=null,e):[[r,i],[o,a]]}}},t.geoClipRectangle=Zf,t.geoContains=function(t,n){return(t&&cc.hasOwnProperty(t.type)?cc[t.type]:lc)(t,n)},t.geoDistance=fc,t.geoGraticule=bc,t.geoGraticule10=function(){return bc()()},t.geoInterpolate=function(t,n){var e=t[0]*Ia,r=t[1]*Ia,i=n[0]*Ia,o=n[1]*Ia,a=Ga(r),u=Qa(r),f=Ga(o),c=Qa(o),s=a*Ga(e),l=a*Qa(e),h=f*Ga(i),d=f*Qa(i),p=2*eu(Ka(ru(o-r)+a*f*ru(i-e))),v=Qa(p),g=p?function(t){var n=Qa(t*=p)/v,e=Qa(p-t)/v,r=e*s+n*h,i=e*l+n*d,o=e*u+n*c;return[Xa(i,r)*Fa,Xa(o,Ka(r*r+i*i))*Fa]}:function(){return[e*Fa,r*Fa]};return g.distance=p,g},t.geoLength=oc,t.geoPath=function(t,n){var e,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),su(t,e(r))),r.result()}return o.area=function(t){return su(t,e(Sc)),Sc.result()},o.measure=function(t){return su(t,e(ds)),ds.result()},o.bounds=function(t){return su(t,e(Uc)),Uc.result()},o.centroid=function(t){return su(t,e(Zc)),Zc.result()},o.projection=function(n){return arguments.length?(e=null==n?(t=null,mc):(t=n).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(n=null,new gs):new as(n=t),"function"!=typeof i&&r.pointRadius(i),o):n},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(n)},t.geoAlbers=Ds,t.geoAlbersUsa=function(){var t,n,e,r,i,o,a=Ds(),u=Ls().rotate([154,0]).center([-2,58.5]).parallels([55,65]),f=Ls().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(t,n){o=[t,n]}};function s(t){var n=t[0],a=t[1];return o=null,e.point(n,a),o||(r.point(n,a),o)||(i.point(n,a),o)}function l(){return t=n=null,s}return s.invert=function(t){var n=a.scale(),e=a.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?f:a).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[a.stream(n=e),u.stream(e),f.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e<i;)r[e].point(t,n)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},s.precision=function(t){return arguments.length?(a.precision(t),u.precision(t),f.precision(t),l()):a.precision()},s.scale=function(t){return arguments.length?(a.scale(t),u.scale(.35*t),f.scale(t),s.translate(a.translate())):a.scale()},s.translate=function(t){if(!arguments.length)return a.translate();var n=a.scale(),o=+t[0],s=+t[1];return e=a.translate(t).clipExtent([[o-.455*n,s-.238*n],[o+.455*n,s+.238*n]]).stream(c),r=u.translate([o-.307*n,s+.201*n]).clipExtent([[o-.425*n+Da,s+.12*n+Da],[o-.214*n-Da,s+.234*n-Da]]).stream(c),i=f.translate([o-.205*n,s+.212*n]).clipExtent([[o-.214*n+Da,s+.166*n+Da],[o-.115*n-Da,s+.234*n-Da]]).stream(c),l()},s.fitExtent=function(t,n){return xs(s,t,n)},s.fitSize=function(t,n){return ws(s,t,n)},s.fitWidth=function(t,n){return Ms(s,t,n)},s.fitHeight=function(t,n){return As(s,t,n)},s.scale(1070)},t.geoAzimuthalEqualArea=function(){return Cs(Os).scale(124.75).clipAngle(179.999)},t.geoAzimuthalEqualAreaRaw=Os,t.geoAzimuthalEquidistant=function(){return Cs(Ys).scale(79.4188).clipAngle(179.999)},t.geoAzimuthalEquidistantRaw=Ys,t.geoConicConformal=function(){return zs(Hs).scale(109.5).parallels([30,30])},t.geoConicConformalRaw=Hs,t.geoConicEqualArea=Ls,t.geoConicEqualAreaRaw=Rs,t.geoConicEquidistant=function(){return zs(Xs).scale(131.154).center([0,13.9389])},t.geoConicEquidistantRaw=Xs,t.geoEqualEarth=function(){return Cs(Qs).scale(177.158)},t.geoEqualEarthRaw=Qs,t.geoEquirectangular=function(){return Cs(js).scale(152.63)},t.geoEquirectangularRaw=js,t.geoGnomonic=function(){return Cs(Js).scale(144.049).clipAngle(60)},t.geoGnomonicRaw=Js,t.geoIdentity=function(){var t,n,e,r,i,o,a=1,u=0,f=0,c=1,s=1,l=mc,h=null,d=mc;function p(){return r=i=null,o}return o={stream:function(t){return r&&i===t?r:r=l(d(i=t))},postclip:function(r){return arguments.length?(d=r,h=t=n=e=null,p()):d},clipExtent:function(r){return arguments.length?(d=null==r?(h=t=n=e=null,mc):Zf(h=+r[0][0],t=+r[0][1],n=+r[1][0],e=+r[1][1]),p()):null==h?null:[[h,t],[n,e]]},scale:function(t){return arguments.length?(l=Ks((a=+t)*c,a*s,u,f),p()):a},translate:function(t){return arguments.length?(l=Ks(a*c,a*s,u=+t[0],f=+t[1]),p()):[u,f]},reflectX:function(t){return arguments.length?(l=Ks(a*(c=t?-1:1),a*s,u,f),p()):c<0},reflectY:function(t){return arguments.length?(l=Ks(a*c,a*(s=t?-1:1),u,f),p()):s<0},fitExtent:function(t,n){return xs(o,t,n)},fitSize:function(t,n){return ws(o,t,n)},fitWidth:function(t,n){return Ms(o,t,n)},fitHeight:function(t,n){return As(o,t,n)}}},t.geoProjection=Cs,t.geoProjectionMutator=Ps,t.geoMercator=function(){return Fs(Bs).scale(961/Ba)},t.geoMercatorRaw=Bs,t.geoNaturalEarth1=function(){return Cs(tl).scale(175.295)},t.geoNaturalEarth1Raw=tl,t.geoOrthographic=function(){return Cs(nl).scale(249.5).clipAngle(90+Da)},t.geoOrthographicRaw=nl,t.geoStereographic=function(){return Cs(el).scale(250).clipAngle(142)},t.geoStereographicRaw=el,t.geoTransverseMercator=function(){var t=Fs(rl),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=rl,t.geoRotation=Rf,t.geoStream=su,t.geoTransform=function(t){return{stream:_s(t)}},t.cluster=function(){var t=il,n=1,e=1,r=!1;function i(i){var o,a=0;i.eachAfter(function(n){var e=n.children;e?(n.x=function(t){return t.reduce(ol,0)/t.length}(e),n.y=function(t){return 1+t.reduce(al,0)}(e)):(n.x=o?a+=t(n,o):0,n.y=0,o=n)});var u=function(t){for(var n;n=t.children;)t=n[0];return t}(i),f=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),c=u.x-t(u,f)/2,s=f.x+t(f,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-c)/(s-c)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.hierarchy=fl,t.pack=function(){var t=null,n=1,e=1,r=El;function i(i){return i.x=n/2,i.y=e/2,t?i.eachBefore(Pl(t)).eachAfter(zl(r,.5)).eachBefore(Rl(1)):i.eachBefore(Pl(Cl)).eachAfter(zl(El,1)).eachAfter(zl(r,i.r/Math.min(n,e))).eachBefore(Rl(Math.min(n,e)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(t=null==(e=n)?null:Sl(e),i):t;var e},i.size=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:kl(+t),i):r},i},t.packSiblings=function(t){return Nl(t),t},t.packEnclose=pl,t.partition=function(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&Dl(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;a<i&&(i=a=(i+a)/2),u<o&&(o=u=(o+u)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=u}}(n,o)),r&&i.eachBefore(Ll),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(t){return arguments.length?(e=+t,i):e},i},t.stratify=function(){var t=Yl,n=Bl;function e(e){var r,i,o,a,u,f,c,s=e.length,l=new Array(s),h={};for(i=0;i<s;++i)r=e[i],u=l[i]=new hl(r),null!=(f=t(r,i,e))&&(f+="")&&(h[c=Ul+(u.id=f)]=c in h?Ol:u);for(i=0;i<s;++i)if(u=l[i],null!=(f=n(e[i],i,e))&&(f+="")){if(!(a=h[Ul+f]))throw new Error("missing: "+f);if(a===Ol)throw new Error("ambiguous: "+f);a.children?a.children.push(u):a.children=[u],u.parent=a}else{if(o)throw new Error("multiple roots");o=u}if(!o)throw new Error("no root");if(o.parent=ql,o.eachBefore(function(t){t.depth=t.parent.depth+1,--s}).eachBefore(ll),o.parent=null,s>0)throw new Error("cycle");return o}return e.id=function(n){return arguments.length?(t=Sl(n),e):t},e.parentId=function(t){return arguments.length?(n=Sl(t),e):n},e},t.tree=function(){var t=Fl,n=1,e=1,r=null;function i(i){var f=function(t){for(var n,e,r,i,o,a=new Gl(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new Gl(r[i],i)),e.parent=n;return(a.parent=new Gl(null,0)).children=[a],a}(i);if(f.eachAfter(o),f.parent.m=-f.z,f.eachBefore(a),r)i.eachBefore(u);else{var c=i,s=i,l=i;i.eachBefore(function(t){t.x<c.x&&(c=t),t.x>s.x&&(s=t),t.depth>l.depth&&(l=t)});var h=c===s?1:t(c,s)/2,d=h-c.x,p=n/(s.x+h+d),v=e/(l.depth||1);i.eachBefore(function(t){t.x=(t.x+d)*p,t.y=t.depth*v})}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,a=n,u=e,f=o.parent.children[0],c=o.m,s=a.m,l=u.m,h=f.m;u=Hl(u),o=Il(o),u&&o;)f=Il(f),(a=Hl(a)).a=n,(i=u.z+l-o.z-c+t(u._,o._))>0&&(jl(Xl(u,n,r),n,i),c+=i,s+=i),l+=u.m,c+=o.m,h+=f.m,s+=a.m;u&&!Hl(a)&&(a.t=u,a.m+=l-s),o&&!Il(f)&&(f.t=o,f.m+=c-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.treemap=function(){var t=Zl,n=!1,e=1,r=1,i=[0],o=El,a=El,u=El,f=El,c=El;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Ll),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l<r&&(r=l=(r+l)/2),h<s&&(s=h=(s+h)/2),n.x0=r,n.y0=s,n.x1=l,n.y1=h,n.children&&(e=i[n.depth+1]=o(n)/2,r+=c(n)-e,s+=a(n)-e,(l-=u(n)-e)<r&&(r=l=(r+l)/2),(h-=f(n)-e)<s&&(s=h=(s+h)/2),t(n,r,s,l,h))}return s.round=function(t){return arguments.length?(n=!!t,s):n},s.size=function(t){return arguments.length?(e=+t[0],r=+t[1],s):[e,r]},s.tile=function(n){return arguments.length?(t=Sl(n),s):t},s.padding=function(t){return arguments.length?s.paddingInner(t).paddingOuter(t):s.paddingInner()},s.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:kl(+t),s):o},s.paddingOuter=function(t){return arguments.length?s.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):s.paddingTop()},s.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:kl(+t),s):a},s.paddingRight=function(t){return arguments.length?(u="function"==typeof t?t:kl(+t),s):u},s.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:kl(+t),s):f},s.paddingLeft=function(t){return arguments.length?(c="function"==typeof t?t:kl(+t),s):c},s},t.treemapBinary=function(t,n,e,r,i){var o,a,u=t.children,f=u.length,c=new Array(f+1);for(c[0]=a=o=0;o<f;++o)c[o+1]=a+=u[o].value;!function t(n,e,r,i,o,a,f){if(n>=e-1){var s=u[n];return s.x0=i,s.y0=o,s.x1=a,void(s.y1=f)}for(var l=c[n],h=r/2+l,d=n+1,p=e-1;d<p;){var v=d+p>>>1;c[v]<h?d=v+1:p=v}h-c[d-1]<c[d]-h&&n+1<d&&--d;var g=c[d]-l,y=r-g;if(a-i>f-o){var _=(i*y+a*g)/r;t(n,d,g,i,o,_,f),t(d,e,y,_,o,a,f)}else{var b=(o*y+f*g)/r;t(n,d,g,i,o,a,b),t(d,e,y,i,b,a,f)}}(0,f,t.value,n,e,r,i)},t.treemapDice=Dl,t.treemapSlice=Vl,t.treemapSliceDice=function(t,n,e,r,i){(1&t.depth?Vl:Dl)(t,n,e,r,i)},t.treemapSquarify=Zl,t.treemapResquarify=Ql,t.interpolate=me,t.interpolateArray=de,t.interpolateBasis=ee,t.interpolateBasisClosed=re,t.interpolateDate=pe,t.interpolateDiscrete=function(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}},t.interpolateHue=function(t,n){var e=ae(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}},t.interpolateNumber=ve,t.interpolateObject=ge,t.interpolateRound=xe,t.interpolateString=be,t.interpolateTransformCss=Ce,t.interpolateTransformSvg=Pe,t.interpolateZoom=qe,t.interpolateRgb=ce,t.interpolateRgbBasis=le,t.interpolateRgbBasisClosed=he,t.interpolateHsl=Ye,t.interpolateHslLong=Be,t.interpolateLab=function(t,n){var e=fe((t=Un(t)).l,(n=Un(n)).l),r=fe(t.a,n.a),i=fe(t.b,n.b),o=fe(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}},t.interpolateHcl=Ie,t.interpolateHclLong=He,t.interpolateCubehelix=Xe,t.interpolateCubehelixLong=Ge,t.piecewise=function(t,n){for(var e=0,r=n.length-1,i=n[0],o=new Array(r<0?0:r);e<r;)o[e]=t(i,i=n[++e]);return function(t){var n=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[n](t-n)}},t.quantize=function(t,n){for(var e=new Array(n),r=0;r<n;++r)e[r]=t(r/(n-1));return e},t.path=Gi,t.polygonArea=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++e<r;)n=i,i=t[e],o+=n[1]*i[0]-n[0]*i[1];return o/2},t.polygonCentroid=function(t){for(var n,e,r=-1,i=t.length,o=0,a=0,u=t[i-1],f=0;++r<i;)n=u,u=t[r],f+=e=n[0]*u[1]-u[0]*n[1],o+=(n[0]+u[0])*e,a+=(n[1]+u[1])*e;return[o/(f*=3),a/f]},t.polygonHull=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n<e;++n)r[n]=[+t[n][0],+t[n][1],n];for(r.sort(Jl),n=0;n<e;++n)i[n]=[r[n][0],-r[n][1]];var o=Kl(r),a=Kl(i),u=a[0]===o[0],f=a[a.length-1]===o[o.length-1],c=[];for(n=o.length-1;n>=0;--n)c.push(t[r[o[n]][2]]);for(n=+u;n<a.length-f;++n)c.push(t[r[a[n]][2]]);return c},t.polygonContains=function(t,n){for(var e,r,i=t.length,o=t[i-1],a=n[0],u=n[1],f=o[0],c=o[1],s=!1,l=0;l<i;++l)e=(o=t[l])[0],(r=o[1])>u!=c>u&&a<(f-e)*(u-r)/(c-r)+e&&(s=!s),f=e,c=r;return s},t.polygonLength=function(t){for(var n,e,r=-1,i=t.length,o=t[i-1],a=o[0],u=o[1],f=0;++r<i;)n=a,e=u,n-=a=(o=t[r])[0],e-=u=o[1],f+=Math.sqrt(n*n+e*e);return f},t.quadtree=ra,t.randomUniform=nh,t.randomNormal=eh,t.randomLogNormal=rh,t.randomBates=oh,t.randomIrwinHall=ih,t.randomExponential=ah,t.scaleBand=hh,t.scalePoint=function(){return function t(n){var e=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,delete n.paddingOuter,n.copy=function(){return t(e())},n}(hh().paddingInner(1))},t.scaleIdentity=function t(){var n=[0,1];function e(t){return+t}return e.invert=e,e.domain=e.range=function(t){return arguments.length?(n=fh.call(t,ph),e):n.slice()},e.copy=function(){return t().domain(n)},xh(e)},t.scaleLinear=function t(){var n=mh(gh,ve);return n.copy=function(){return bh(n,t())},xh(n)},t.scaleLog=function n(){var e=mh(Mh,Ah).domain([1,10]),r=e.domain,i=10,o=Sh(10),a=Nh(10);function u(){return o=Sh(i),a=Nh(i),r()[0]<0&&(o=Eh(o),a=Eh(a)),e}return e.base=function(t){return arguments.length?(i=+t,u()):i},e.domain=function(t){return arguments.length?(r(t),u()):r()},e.ticks=function(t){var n,e=r(),u=e[0],f=e[e.length-1];(n=f<u)&&(h=u,u=f,f=h);var c,s,l,h=o(u),d=o(f),p=null==t?10:+t,v=[];if(!(i%1)&&d-h<p){if(h=Math.round(h)-1,d=Math.round(d)+1,u>0){for(;h<d;++h)for(s=1,c=a(h);s<i;++s)if(!((l=c*s)<u)){if(l>f)break;v.push(l)}}else for(;h<d;++h)for(s=i-1,c=a(h);s>=1;--s)if(!((l=c*s)<u)){if(l>f)break;v.push(l)}}else v=m(h,d,Math.min(d-h,p)).map(a);return n?v.reverse():v},e.tickFormat=function(n,r){if(null==r&&(r=10===i?".0e":","),"function"!=typeof r&&(r=t.format(r)),n===1/0)return r;null==n&&(n=10);var u=Math.max(1,i*n/e.ticks().length);return function(t){var n=t/a(Math.round(o(t)));return n*i<i-.5&&(n*=i),n<=u?r(t):""}},e.nice=function(){return r(wh(r(),{floor:function(t){return a(Math.floor(o(t)))},ceil:function(t){return a(Math.ceil(o(t)))}}))},e.copy=function(){return bh(e,n().base(i))},e},t.scaleOrdinal=lh,t.scaleImplicit=sh,t.scalePow=Ch,t.scaleSqrt=function(){return Ch().exponent(.5)},t.scaleQuantile=function t(){var e=[],r=[],o=[];function a(){var t=0,n=Math.max(1,r.length);for(o=new Array(n-1);++t<n;)o[t-1]=A(e,t/n);return u}function u(t){if(!isNaN(t=+t))return r[i(o,t)]}return u.invertExtent=function(t){var n=r.indexOf(t);return n<0?[NaN,NaN]:[n>0?o[n-1]:e[0],n<o.length?o[n]:e[e.length-1]]},u.domain=function(t){if(!arguments.length)return e.slice();e=[];for(var r,i=0,o=t.length;i<o;++i)null==(r=t[i])||isNaN(r=+r)||e.push(r);return e.sort(n),a()},u.range=function(t){return arguments.length?(r=ch.call(t),a()):r.slice()},u.quantiles=function(){return o.slice()},u.copy=function(){return t().domain(e).range(r)},u},t.scaleQuantize=function t(){var n=0,e=1,r=1,o=[.5],a=[0,1];function u(t){if(t<=t)return a[i(o,t,0,r)]}function f(){var t=-1;for(o=new Array(r);++t<r;)o[t]=((t+1)*e-(t-r)*n)/(r+1);return u}return u.domain=function(t){return arguments.length?(n=+t[0],e=+t[1],f()):[n,e]},u.range=function(t){return arguments.length?(r=(a=ch.call(t)).length-1,f()):a.slice()},u.invertExtent=function(t){var i=a.indexOf(t);return i<0?[NaN,NaN]:i<1?[n,o[0]]:i>=r?[o[r-1],e]:[o[i-1],o[i]]},u.copy=function(){return t().domain([n,e]).range(a)},xh(u)},t.scaleThreshold=function t(){var n=[.5],e=[0,1],r=1;function o(t){if(t<=t)return e[i(n,t,0,r)]}return o.domain=function(t){return arguments.length?(n=ch.call(t),r=Math.min(n.length,e.length-1),o):n.slice()},o.range=function(t){return arguments.length?(e=ch.call(t),r=Math.min(n.length,e.length-1),o):e.slice()},o.invertExtent=function(t){var r=e.indexOf(t);return[n[r-1],n[r]]},o.copy=function(){return t().domain(n).range(e)},o},t.scaleTime=function(){return cv(cd,ud,Vh,jh,Ih,Bh,Oh,Lh,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},t.scaleUtc=function(){return cv(Ld,zd,_d,vd,dd,ld,Oh,Lh,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},t.scaleSequential=function t(n){var e=0,r=1,i=1,o=!1;function a(t){var r=(t-e)*i;return n(o?Math.max(0,Math.min(1,r)):r)}return a.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],i=e===r?0:1/(r-e),a):[e,r]},a.clamp=function(t){return arguments.length?(o=!!t,a):o},a.interpolator=function(t){return arguments.length?(n=t,a):n},a.copy=function(){return t(n).domain([e,r]).clamp(o)},xh(a)},t.scaleDiverging=function t(n){var e=0,r=.5,i=1,o=1,a=1,u=!1;function f(t){var e=.5+((t=+t)-r)*(t<r?o:a);return n(u?Math.max(0,Math.min(1,e)):e)}return f.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],i=+t[2],o=e===r?0:.5/(r-e),a=r===i?0:.5/(i-r),f):[e,r,i]},f.clamp=function(t){return arguments.length?(u=!!t,f):u},f.interpolator=function(t){return arguments.length?(n=t,f):n},f.copy=function(){return t(n).domain([e,r,i]).clamp(u)},xh(f)},t.schemeCategory10=lv,t.schemeAccent=hv,t.schemeDark2=dv,t.schemePaired=pv,t.schemePastel1=vv,t.schemePastel2=gv,t.schemeSet1=yv,t.schemeSet2=_v,t.schemeSet3=bv,t.interpolateBrBG=wv,t.schemeBrBG=xv,t.interpolatePRGn=Av,t.schemePRGn=Mv,t.interpolatePiYG=Nv,t.schemePiYG=Tv,t.interpolatePuOr=Ev,t.schemePuOr=Sv,t.interpolateRdBu=Cv,t.schemeRdBu=kv,t.interpolateRdGy=zv,t.schemeRdGy=Pv,t.interpolateRdYlBu=Lv,t.schemeRdYlBu=Rv,t.interpolateRdYlGn=Uv,t.schemeRdYlGn=Dv,t.interpolateSpectral=Ov,t.schemeSpectral=qv,t.interpolateBuGn=Bv,t.schemeBuGn=Yv,t.interpolateBuPu=Iv,t.schemeBuPu=Fv,t.interpolateGnBu=jv,t.schemeGnBu=Hv,t.interpolateOrRd=Gv,t.schemeOrRd=Xv,t.interpolatePuBuGn=$v,t.schemePuBuGn=Vv,t.interpolatePuBu=Zv,t.schemePuBu=Wv,t.interpolatePuRd=Jv,t.schemePuRd=Qv,t.interpolateRdPu=tg,t.schemeRdPu=Kv,t.interpolateYlGnBu=eg,t.schemeYlGnBu=ng,t.interpolateYlGn=ig,t.schemeYlGn=rg,t.interpolateYlOrBr=ag,t.schemeYlOrBr=og,t.interpolateYlOrRd=fg,t.schemeYlOrRd=ug,t.interpolateBlues=sg,t.schemeBlues=cg,t.interpolateGreens=hg,t.schemeGreens=lg,t.interpolateGreys=pg,t.schemeGreys=dg,t.interpolatePurples=gg,t.schemePurples=vg,t.interpolateReds=_g,t.schemeReds=yg,t.interpolateOranges=mg,t.schemeOranges=bg,t.interpolateCubehelixDefault=xg,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return Ag.h=360*t-100,Ag.s=1.5-1.5*n,Ag.l=.8-.9*n,Ag+""},t.interpolateWarm=wg,t.interpolateCool=Mg,t.interpolateSinebow=function(t){var n;return t=(.5-t)*Math.PI,Tg.r=255*(n=Math.sin(t))*n,Tg.g=255*(n=Math.sin(t+Ng))*n,Tg.b=255*(n=Math.sin(t+Sg))*n,Tg+""},t.interpolateViridis=kg,t.interpolateMagma=Cg,t.interpolateInferno=Pg,t.interpolatePlasma=zg,t.create=function(t){return Dt(W(t).call(document.documentElement))},t.creator=W,t.local=qt,t.matcher=rt,t.mouse=Ft,t.namespace=$,t.namespaces=V,t.clientPoint=Bt,t.select=Dt,t.selectAll=function(t){return"string"==typeof t?new Rt([document.querySelectorAll(t)],[document.documentElement]):new Rt([null==t?[]:t],zt)},t.selection=Lt,t.selector=Q,t.selectorAll=K,t.style=lt,t.touch=It,t.touches=function(t,n){null==n&&(n=Yt().touches);for(var e=0,r=n?n.length:0,i=new Array(r);e<r;++e)i[e]=Bt(t,n[e]);return i},t.window=st,t.customEvent=Ct,t.arc=function(){var t=Gg,n=Vg,e=Rg(0),r=null,i=$g,o=Wg,a=Zg,u=null;function f(){var f,c,s,l=+t.apply(this,arguments),h=+n.apply(this,arguments),d=i.apply(this,arguments)-Hg,p=o.apply(this,arguments)-Hg,v=Lg(p-d),g=p>d;if(u||(u=f=Gi()),h<l&&(c=h,h=l,l=c),h>Fg)if(v>jg-Fg)u.moveTo(h*Ug(d),h*Yg(d)),u.arc(0,0,h,d,p,!g),l>Fg&&(u.moveTo(l*Ug(p),l*Yg(p)),u.arc(0,0,l,p,d,g));else{var y,_,b=d,m=p,x=d,w=p,M=v,A=v,T=a.apply(this,arguments)/2,N=T>Fg&&(r?+r.apply(this,arguments):Bg(l*l+h*h)),S=Og(Lg(h-l)/2,+e.apply(this,arguments)),E=S,k=S;if(N>Fg){var C=Xg(N/l*Yg(T)),P=Xg(N/h*Yg(T));(M-=2*C)>Fg?(x+=C*=g?1:-1,w-=C):(M=0,x=w=(d+p)/2),(A-=2*P)>Fg?(b+=P*=g?1:-1,m-=P):(A=0,b=m=(d+p)/2)}var z=h*Ug(b),R=h*Yg(b),L=l*Ug(w),D=l*Yg(w);if(S>Fg){var U=h*Ug(m),q=h*Yg(m),O=l*Ug(x),Y=l*Yg(x);if(v<Ig){var B=M>Fg?function(t,n,e,r,i,o,a,u){var f=e-t,c=r-n,s=a-i,l=u-o,h=(s*(n-o)-l*(t-i))/(l*f-s*c);return[t+h*f,n+h*c]}(z,R,O,Y,U,q,L,D):[L,D],F=z-B[0],I=R-B[1],H=U-B[0],j=q-B[1],X=1/Yg(((s=(F*H+I*j)/(Bg(F*F+I*I)*Bg(H*H+j*j)))>1?0:s<-1?Ig:Math.acos(s))/2),G=Bg(B[0]*B[0]+B[1]*B[1]);E=Og(S,(l-G)/(X-1)),k=Og(S,(h-G)/(X+1))}}A>Fg?k>Fg?(y=Qg(O,Y,z,R,h,k,g),_=Qg(U,q,L,D,h,k,g),u.moveTo(y.cx+y.x01,y.cy+y.y01),k<S?u.arc(y.cx,y.cy,k,Dg(y.y01,y.x01),Dg(_.y01,_.x01),!g):(u.arc(y.cx,y.cy,k,Dg(y.y01,y.x01),Dg(y.y11,y.x11),!g),u.arc(0,0,h,Dg(y.cy+y.y11,y.cx+y.x11),Dg(_.cy+_.y11,_.cx+_.x11),!g),u.arc(_.cx,_.cy,k,Dg(_.y11,_.x11),Dg(_.y01,_.x01),!g))):(u.moveTo(z,R),u.arc(0,0,h,b,m,!g)):u.moveTo(z,R),l>Fg&&M>Fg?E>Fg?(y=Qg(L,D,U,q,l,-E,g),_=Qg(z,R,O,Y,l,-E,g),u.lineTo(y.cx+y.x01,y.cy+y.y01),E<S?u.arc(y.cx,y.cy,E,Dg(y.y01,y.x01),Dg(_.y01,_.x01),!g):(u.arc(y.cx,y.cy,E,Dg(y.y01,y.x01),Dg(y.y11,y.x11),!g),u.arc(0,0,l,Dg(y.cy+y.y11,y.cx+y.x11),Dg(_.cy+_.y11,_.cx+_.x11),g),u.arc(_.cx,_.cy,E,Dg(_.y11,_.x11),Dg(_.y01,_.x01),!g))):u.arc(0,0,l,w,x,g):u.lineTo(L,D)}else u.moveTo(0,0);if(u.closePath(),f)return u=null,f+""||null}return f.centroid=function(){var e=(+t.apply(this,arguments)+ +n.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Ig/2;return[Ug(r)*e,Yg(r)*e]},f.innerRadius=function(n){return arguments.length?(t="function"==typeof n?n:Rg(+n),f):t},f.outerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Rg(+t),f):n},f.cornerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Rg(+t),f):e},f.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Rg(+t),f):r},f.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Rg(+t),f):i},f.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Rg(+t),f):o},f.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Rg(+t),f):a},f.context=function(t){return arguments.length?(u=null==t?null:t,f):u},f},t.area=ry,t.line=ey,t.pie=function(){var t=oy,n=iy,e=null,r=Rg(0),i=Rg(jg),o=Rg(0);function a(a){var u,f,c,s,l,h=a.length,d=0,p=new Array(h),v=new Array(h),g=+r.apply(this,arguments),y=Math.min(jg,Math.max(-jg,i.apply(this,arguments)-g)),_=Math.min(Math.abs(y)/h,o.apply(this,arguments)),b=_*(y<0?-1:1);for(u=0;u<h;++u)(l=v[p[u]=u]=+t(a[u],u,a))>0&&(d+=l);for(null!=n?p.sort(function(t,e){return n(v[t],v[e])}):null!=e&&p.sort(function(t,n){return e(a[t],a[n])}),u=0,c=d?(y-h*b)/d:0;u<h;++u,g=s)f=p[u],s=g+((l=v[f])>0?l*c:0)+b,v[f]={data:a[f],index:u,value:l,startAngle:g,endAngle:s,padAngle:_};return v}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:Rg(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Rg(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Rg(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Rg(+t),a):o},a},t.areaRadial=ly,t.radialArea=ly,t.lineRadial=sy,t.radialLine=sy,t.pointRadial=hy,t.linkHorizontal=function(){return gy(yy)},t.linkVertical=function(){return gy(_y)},t.linkRadial=function(){var t=gy(by);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=Rg(my),n=Rg(64),e=null;function r(){var r;if(e||(e=r=Gi()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return r.type=function(n){return arguments.length?(t="function"==typeof n?n:Rg(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:Rg(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},t.symbols=Uy,t.symbolCircle=my,t.symbolCross=xy,t.symbolDiamond=Ay,t.symbolSquare=ky,t.symbolStar=Ey,t.symbolTriangle=Py,t.symbolWye=Dy,t.curveBasisClosed=function(t){return new By(t)},t.curveBasisOpen=function(t){return new Fy(t)},t.curveBasis=function(t){return new Yy(t)},t.curveBundle=Hy,t.curveCardinalClosed=$y,t.curveCardinalOpen=Zy,t.curveCardinal=Gy,t.curveCatmullRomClosed=n_,t.curveCatmullRomOpen=r_,t.curveCatmullRom=Ky,t.curveLinearClosed=function(t){return new i_(t)},t.curveLinear=Kg,t.curveMonotoneX=function(t){return new c_(t)},t.curveMonotoneY=function(t){return new s_(t)},t.curveNatural=function(t){return new h_(t)},t.curveStep=function(t){return new p_(t,.5)},t.curveStepAfter=function(t){return new p_(t,1)},t.curveStepBefore=function(t){return new p_(t,0)},t.stack=function(){var t=Rg([]),n=g_,e=v_,r=y_;function i(i){var o,a,u=t.apply(this,arguments),f=i.length,c=u.length,s=new Array(c);for(o=0;o<c;++o){for(var l,h=u[o],d=s[o]=new Array(f),p=0;p<f;++p)d[p]=l=[0,+r(i[p],h,p,i)],l.data=i[p];d.key=h}for(o=0,a=n(s);o<c;++o)s[a[o]].index=o;return e(s,a),s}return i.keys=function(n){return arguments.length?(t="function"==typeof n?n:Rg(dy.call(n)),i):t},i.value=function(t){return arguments.length?(r="function"==typeof t?t:Rg(+t),i):r},i.order=function(t){return arguments.length?(n=null==t?g_:"function"==typeof t?t:Rg(dy.call(t)),i):n},i.offset=function(t){return arguments.length?(e=null==t?v_:t,i):e},i},t.stackOffsetExpand=function(t,n){if((r=t.length)>0){for(var e,r,i,o=0,a=t[0].length;o<a;++o){for(i=e=0;e<r;++e)i+=t[e][o][1]||0;if(i)for(e=0;e<r;++e)t[e][o][1]/=i}v_(t,n)}},t.stackOffsetDiverging=function(t,n){if((u=t.length)>1)for(var e,r,i,o,a,u,f=0,c=t[n[0]].length;f<c;++f)for(o=a=0,e=0;e<u;++e)(i=(r=t[n[e]][f])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},t.stackOffsetNone=v_,t.stackOffsetSilhouette=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],o=i.length;r<o;++r){for(var a=0,u=0;a<e;++a)u+=t[a][r][1]||0;i[r][1]+=i[r][0]=-u/2}v_(t,n)}},t.stackOffsetWiggle=function(t,n){if((i=t.length)>0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;a<r;++a){for(var u=0,f=0,c=0;u<i;++u){for(var s=t[n[u]],l=s[a][1]||0,h=(l-(s[a-1][1]||0))/2,d=0;d<u;++d){var p=t[n[d]];h+=(p[a][1]||0)-(p[a-1][1]||0)}f+=l,c+=h*l}e[a-1][1]+=e[a-1][0]=o,f&&(o-=c/f)}e[a-1][1]+=e[a-1][0]=o,v_(t,n)}},t.stackOrderAscending=__,t.stackOrderDescending=function(t){return __(t).reverse()},t.stackOrderInsideOut=function(t){var n,e,r=t.length,i=t.map(b_),o=g_(t).sort(function(t,n){return i[n]-i[t]}),a=0,u=0,f=[],c=[];for(n=0;n<r;++n)e=o[n],a<u?(a+=i[e],f.push(e)):(u+=i[e],c.push(e));return c.reverse().concat(f)},t.stackOrderNone=g_,t.stackOrderReverse=function(t){return g_(t).reverse()},t.timeInterval=Rh,t.timeMillisecond=Lh,t.timeMilliseconds=Dh,t.utcMillisecond=Lh,t.utcMilliseconds=Dh,t.timeSecond=Oh,t.timeSeconds=Yh,t.utcSecond=Oh,t.utcSeconds=Yh,t.timeMinute=Bh,t.timeMinutes=Fh,t.timeHour=Ih,t.timeHours=Hh,t.timeDay=jh,t.timeDays=Xh,t.timeWeek=Vh,t.timeWeeks=td,t.timeSunday=Vh,t.timeSundays=td,t.timeMonday=$h,t.timeMondays=nd,t.timeTuesday=Wh,t.timeTuesdays=ed,t.timeWednesday=Zh,t.timeWednesdays=rd,t.timeThursday=Qh,t.timeThursdays=id,t.timeFriday=Jh,t.timeFridays=od,t.timeSaturday=Kh,t.timeSaturdays=ad,t.timeMonth=ud,t.timeMonths=fd,t.timeYear=cd,t.timeYears=sd,t.utcMinute=ld,t.utcMinutes=hd,t.utcHour=dd,t.utcHours=pd,t.utcDay=vd,t.utcDays=gd,t.utcWeek=_d,t.utcWeeks=Td,t.utcSunday=_d,t.utcSundays=Td,t.utcMonday=bd,t.utcMondays=Nd,t.utcTuesday=md,t.utcTuesdays=Sd,t.utcWednesday=xd,t.utcWednesdays=Ed,t.utcThursday=wd,t.utcThursdays=kd,t.utcFriday=Md,t.utcFridays=Cd,t.utcSaturday=Ad,t.utcSaturdays=Pd,t.utcMonth=zd,t.utcMonths=Rd,t.utcYear=Ld,t.utcYears=Dd,t.timeFormatDefaultLocale=Qp,t.timeFormatLocale=Yd,t.isoFormat=Jp,t.isoParse=Kp,t.now=ir,t.timer=ur,t.timerFlush=fr,t.timeout=hr,t.interval=function(t,n,e){var r=new ar,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?ir():+e,r.restart(function o(a){a+=i,r.restart(o,i+=n,e),t(a)},n,e),r)},t.transition=zr,t.active=function(t,n){var e,r,i=t.__transition;if(i)for(r in n=null==n?null:n+"",i)if((e=i[r]).state>gr&&e.name===n)return new Pr([[t]],li,n,+r);return null},t.interrupt=Nr,t.voronoi=function(){var t=x_,n=w_,e=null;function r(r){return new eb(r.map(function(e,i){var o=[Math.round(t(e,i,r)/K_)*K_,Math.round(n(e,i,r)/K_)*K_];return o.index=i,o.data=e,o}),e)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(n){return arguments.length?(t="function"==typeof n?n:m_(+n),r):t},r.y=function(t){return arguments.length?(n="function"==typeof t?t:m_(+t),r):n},r.extent=function(t){return arguments.length?(e=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):e&&[[e[0][0],e[0][1]],[e[1][0],e[1][1]]]},r.size=function(t){return arguments.length?(e=null==t?null:[[0,0],[+t[0],+t[1]]],r):e&&[e[1][0]-e[0][0],e[1][1]-e[0][1]]},r},t.zoom=function(){var n,e,r=sb,i=lb,o=vb,a=db,u=pb,f=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],s=250,l=qe,h=[],d=I("start","zoom","end"),p=500,v=150,g=0;function y(t){t.property("__zoom",hb).on("wheel.zoom",A).on("mousedown.zoom",T).on("dblclick.zoom",N).filter(u).on("touchstart.zoom",S).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(t,n){return(n=Math.max(f[0],Math.min(f[1],n)))===t.k?t:new ob(n,t.x,t.y)}function b(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new ob(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e){t.on("start.zoom",function(){w(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).end()}).tween("zoom",function(){var t=arguments,r=w(this,t),o=i.apply(this,t),a=e||m(o),u=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),f=this.__zoom,c="function"==typeof n?n.apply(this,t):n,s=l(f.invert(a).concat(u/f.k),c.invert(a).concat(u/c.k));return function(t){if(1===t)t=c;else{var n=s(t),e=u/n[2];t=new ob(e,a[0]-n[0]*e,a[1]-n[1]*e)}r.zoom(null,t)}})}function w(t,n){for(var e,r=0,i=h.length;r<i;++r)if((e=h[r]).that===t)return e;return new M(t,n)}function M(t,n){this.that=t,this.args=n,this.index=-1,this.active=0,this.extent=i.apply(t,n)}function A(){if(r.apply(this,arguments)){var t=w(this,arguments),n=this.__zoom,e=Math.max(f[0],Math.min(f[1],n.k*Math.pow(2,a.apply(this,arguments)))),i=Ft(this);if(t.wheel)t.mouse[0][0]===i[0]&&t.mouse[0][1]===i[1]||(t.mouse[1]=n.invert(t.mouse[0]=i)),clearTimeout(t.wheel);else{if(n.k===e)return;t.mouse=[i,n.invert(i)],Nr(this),t.start()}cb(),t.wheel=setTimeout(function(){t.wheel=null,t.end()},v),t.zoom("mouse",o(b(_(n,e),t.mouse[0],t.mouse[1]),t.extent,c))}}function T(){if(!e&&r.apply(this,arguments)){var n=w(this,arguments),i=Dt(t.event.view).on("mousemove.zoom",function(){if(cb(),!n.moved){var e=t.event.clientX-u,r=t.event.clientY-f;n.moved=e*e+r*r>g}n.zoom("mouse",o(b(n.that.__zoom,n.mouse[0]=Ft(n.that),n.mouse[1]),n.extent,c))},!0).on("mouseup.zoom",function(){i.on("mousemove.zoom mouseup.zoom",null),Gt(t.event.view,n.moved),cb(),n.end()},!0),a=Ft(this),u=t.event.clientX,f=t.event.clientY;Xt(t.event.view),fb(),n.mouse=[a,this.__zoom.invert(a)],Nr(this),n.start()}}function N(){if(r.apply(this,arguments)){var n=this.__zoom,e=Ft(this),a=n.invert(e),u=n.k*(t.event.shiftKey?.5:2),f=o(b(_(n,u),e,a),i.apply(this,arguments),c);cb(),s>0?Dt(this).transition().duration(s).call(x,f,e):Dt(this).call(y.transform,f)}}function S(){if(r.apply(this,arguments)){var e,i,o,a,u=w(this,arguments),f=t.event.changedTouches,c=f.length;for(fb(),i=0;i<c;++i)a=[a=It(this,f,(o=f[i]).identifier),this.__zoom.invert(a),o.identifier],u.touch0?u.touch1||(u.touch1=a):(u.touch0=a,e=!0);if(n&&(n=clearTimeout(n),!u.touch1))return u.end(),void((a=Dt(this).on("dblclick.zoom"))&&a.apply(this,arguments));e&&(n=setTimeout(function(){n=null},p),Nr(this),u.start())}}function E(){var e,r,i,a,u=w(this,arguments),f=t.event.changedTouches,s=f.length;for(cb(),n&&(n=clearTimeout(n)),e=0;e<s;++e)i=It(this,f,(r=f[e]).identifier),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=i:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=i);if(r=u.that.__zoom,u.touch1){var l=u.touch0[0],h=u.touch0[1],d=u.touch1[0],p=u.touch1[1],v=(v=d[0]-l[0])*v+(v=d[1]-l[1])*v,g=(g=p[0]-h[0])*g+(g=p[1]-h[1])*g;r=_(r,Math.sqrt(v/g)),i=[(l[0]+d[0])/2,(l[1]+d[1])/2],a=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!u.touch0)return;i=u.touch0[0],a=u.touch0[1]}u.zoom("touch",o(b(r,i,a),u.extent,c))}function k(){var n,r,i=w(this,arguments),o=t.event.changedTouches,a=o.length;for(fb(),e&&clearTimeout(e),e=setTimeout(function(){e=null},p),n=0;n<a;++n)r=o[n],i.touch0&&i.touch0[2]===r.identifier?delete i.touch0:i.touch1&&i.touch1[2]===r.identifier&&delete i.touch1;i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0?i.touch0[1]=this.__zoom.invert(i.touch0[0]):i.end()}return y.transform=function(t,n){var e=t.selection?t.selection():t;e.property("__zoom",hb),t!==e?x(t,n):e.interrupt().each(function(){w(this,arguments).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()})},y.scaleBy=function(t,n){y.scaleTo(t,function(){return this.__zoom.k*("function"==typeof n?n.apply(this,arguments):n)})},y.scaleTo=function(t,n){y.transform(t,function(){var t=i.apply(this,arguments),e=this.__zoom,r=m(t),a=e.invert(r),u="function"==typeof n?n.apply(this,arguments):n;return o(b(_(e,u),r,a),t,c)})},y.translateBy=function(t,n,e){y.transform(t,function(){return o(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),i.apply(this,arguments),c)})},y.translateTo=function(t,n,e){y.transform(t,function(){var t=i.apply(this,arguments),r=this.__zoom,a=m(t);return o(ab.translate(a[0],a[1]).scale(r.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof e?-e.apply(this,arguments):-e),t,c)})},M.prototype={start:function(){return 1==++this.active&&(this.index=h.push(this)-1,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(h.splice(this.index,1),this.index=-1,this.emit("end")),this},emit:function(t){Ct(new ib(y,t,this.that.__zoom),d.apply,d,[t,this.that,this.args])}},y.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:rb(+t),y):a},y.filter=function(t){return arguments.length?(r="function"==typeof t?t:rb(!!t),y):r},y.touchable=function(t){return arguments.length?(u="function"==typeof t?t:rb(!!t),y):u},y.extent=function(t){return arguments.length?(i="function"==typeof t?t:rb([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),y):i},y.scaleExtent=function(t){return arguments.length?(f[0]=+t[0],f[1]=+t[1],y):[f[0],f[1]]},y.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],y):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},y.constrain=function(t){return arguments.length?(o=t,y):o},y.duration=function(t){return arguments.length?(s=+t,y):s},y.interpolate=function(t){return arguments.length?(l=t,y):l},y.on=function(){var t=d.on.apply(d,arguments);return t===d?y:t},y.clickDistance=function(t){return arguments.length?(g=(t=+t)*t,y):Math.sqrt(g)},y},t.zoomTransform=ub,t.zoomIdentity=ab,Object.defineProperty(t,"__esModule",{value:!0})}); </script><script>//~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/base.js 'use strict';var Q; function pa(b){var d=typeof b;if("object"==d)if(b){if(b instanceof Array)return"array";if(b instanceof Object)return d;var f=Object.prototype.toString.call(b);if("[object Window]"==f)return"object";if("[object Array]"==f||"number"==typeof b.length&&"undefined"!=typeof b.splice&&"undefined"!=typeof b.propertyIsEnumerable&&!b.propertyIsEnumerable("splice"))return"array";if("[object Function]"==f||"undefined"!=typeof b.call&&"undefined"!=typeof b.propertyIsEnumerable&&!b.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"== d&&"undefined"==typeof b.call)return"object";return d}function $a(b,d){function f(){}f.prototype=d.prototype;b.superClass_=d.prototype;b.prototype=new f;b.prototype.constructor=b;b.base=function(h,m,w){for(var l=Array(arguments.length-2),p=2;p<arguments.length;p++)l[p-2]=arguments[p];return d.prototype[m].apply(h,l)}}; //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/transitionalforwarddeclarations.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/debug/error.js function cb(b){if(Error.captureStackTrace)Error.captureStackTrace(this,cb);else{var d=Error().stack;d&&(this.stack=d)}b&&(this.message=String(b));this.reportErrorToServer=!0}$a(cb,Error);cb.prototype.name="CustomError"; //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/dom/nodetype.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/asserts/asserts.js function fb(b,d){cb.call(this,pb(b,d));this.messagePattern=b}$a(fb,cb);fb.prototype.name="AssertionError";function pb(b,d){b=b.split("%s");for(var f="",h=b.length-1,m=0;m<h;m++)f+=b[m]+(m<d.length?d[m]:"%s");return f+b[h]}function qb(b,d){throw new fb("Failure"+(b?": "+b:""),Array.prototype.slice.call(arguments,1));}; //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/array/array.js var rb=Array.prototype.map?function(b,d){return Array.prototype.map.call(b,d,void 0)}:function(b,d){for(var f=b.length,h=Array(f),m="string"==typeof b?b.split(""):b,w=0;w<f;w++)w in m&&(h[w]=d.call(void 0,m[w],w,b));return h};function sb(b,d,f){return 2>=arguments.length?Array.prototype.slice.call(b,d):Array.prototype.slice.call(b,d,f)}; //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/crypt/crypt.js function vb(b){if(8192>=b.length)return String.fromCharCode.apply(null,b);for(var d="",f=0;f<b.length;f+=8192)d+=String.fromCharCode.apply(null,sb(b,f,f+8192));return d}; //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/string/internal.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/string/string.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/labs/useragent/util.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/object/object.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/labs/useragent/browser.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/labs/useragent/engine.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/labs/useragent/platform.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/reflect/reflect.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/useragent/useragent.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/useragent/product.js //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/crypt/base64.js var xb=null,yb=null,zb=null;function Db(b){var d=b.length,f=0;"\x3d"===b[d-2]?f=2:"\x3d"===b[d-1]&&(f=1);var h=new Uint8Array(Math.ceil(3*d/4)-f),m=0;Eb(b,function(w){h[m++]=w});return h.subarray(0,m)} function Eb(b,d){function f(n){for(;h<b.length;){var q=b.charAt(h++),t=yb[q];if(null!=t)return t;if(!/^[\s\xa0]*$/.test(q))throw Error("Unknown base64 encoding at char: "+q);}return n}Fb();for(var h=0;;){var m=f(-1),w=f(0),l=f(64),p=f(64);if(64===p&&-1===m)break;d(m<<2|w>>4);64!=l&&(d(w<<4&240|l>>2),64!=p&&d(l<<6&192|p))}} function Fb(){if(!xb){xb={};yb={};zb={};for(var b=0;65>b;b++)xb[b]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".charAt(b),yb[xb[b]]=b,zb[b]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(b),62<=b&&(yb["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(b)]=b)}}; //~~WEBPATH~~external/com_google_protobuf_js/binary/arith.js function Gb(b,d){this.lo=b;this.hi=d}Q=Gb.prototype;Q.cmp=function(b){return this.hi<b.hi||this.hi==b.hi&&this.lo<b.lo?-1:this.hi==b.hi&&this.lo==b.lo?0:1};function Hb(b){return new Gb((b.lo>>>1|(b.hi&1)<<31)>>>0,b.hi>>>1>>>0)}function Mb(b){return new Gb(b.lo<<1>>>0,(b.hi<<1|b.lo>>>31)>>>0)}Q.lsb=function(){return!!(this.lo&1)};Q.zero=function(){return 0==this.lo&&0==this.hi}; Q.add=function(b){return new Gb((this.lo+b.lo&4294967295)>>>0>>>0,((this.hi+b.hi&4294967295)>>>0)+(4294967296<=this.lo+b.lo?1:0)>>>0)};Q.sub=function(b){return new Gb((this.lo-b.lo&4294967295)>>>0>>>0,((this.hi-b.hi&4294967295)>>>0)-(0>this.lo-b.lo?1:0)>>>0)};function Nb(b){var d=b&65535,f=b>>>16;b=10*d+65536*(0*d&65535)+65536*(10*f&65535);for(d=0*f+(0*d>>>16)+(10*f>>>16);4294967296<=b;)b-=4294967296,d+=1;return new Gb(b>>>0,d>>>0)} Q.toString=function(){for(var b="",d=this;!d.zero();){var f=new Gb(0,0);d=new Gb(d.lo,d.hi);for(var h=new Gb(10,0),m=new Gb(1,0);!(h.hi&2147483648);)h=Mb(h),m=Mb(m);for(;!m.zero();)0>=h.cmp(d)&&(f=f.add(m),d=d.sub(h)),h=Hb(h),m=Hb(m);f=[f,d];d=f[0];b=f[1].lo+b}""==b&&(b="0");return b};function Ob(b){for(var d=new Gb(0,0),f=new Gb(0,0),h=0;h<b.length;h++){if("0">b[h]||"9"<b[h])return null;f.lo=parseInt(b[h],10);var m=Nb(d.lo);d=Nb(d.hi);d.hi=d.lo;d.lo=0;d=m.add(d).add(f)}return d} Q.clone=function(){return new Gb(this.lo,this.hi)};function Qb(b,d){this.lo=b;this.hi=d}Qb.prototype.add=function(b){return new Qb((this.lo+b.lo&4294967295)>>>0>>>0,((this.hi+b.hi&4294967295)>>>0)+(4294967296<=this.lo+b.lo?1:0)>>>0)};Qb.prototype.sub=function(b){return new Qb((this.lo-b.lo&4294967295)>>>0>>>0,((this.hi-b.hi&4294967295)>>>0)-(0>this.lo-b.lo?1:0)>>>0)};Qb.prototype.clone=function(){return new Qb(this.lo,this.hi)}; Qb.prototype.toString=function(){var b=0!=(this.hi&2147483648),d=new Gb(this.lo,this.hi);b&&(d=(new Gb(0,0)).sub(d));return(b?"-":"")+d.toString()};function Rb(b){var d=0<b.length&&"-"==b[0];d&&(b=b.substring(1));b=Ob(b);if(null===b)return null;d&&(b=(new Gb(0,0)).sub(b));return new Qb(b.lo,b.hi)}; //~~WEBPATH~~external/com_google_protobuf_js/binary/constants.js function Sb(b){switch(b){case 5:case 3:case 13:case 4:case 17:case 18:case 8:case 14:case 31:return 0;case 1:case 6:case 16:case 30:return 1;case 9:case 11:case 12:return 2;case 2:case 7:case 15:return 5;default:return-1}}; //~~WEBPATH~~external/com_google_protobuf_js/binary/utils.js var Tb=0,Ub=0;function Vb(b){var d=b>>>0;b=Math.floor((b-d)/4294967296)>>>0;Tb=d;Ub=b}function Wb(b){var d=0>b;b=Math.abs(b);var f=b>>>0;b=Math.floor((b-f)/4294967296);b>>>=0;d&&(b=~b>>>0,f=(~f>>>0)+1,4294967295<f&&(f=0,b++,4294967295<b&&(b=0)));Tb=f;Ub=b}function Xb(b){var d=b.charCodeAt(4),f=b.charCodeAt(5),h=b.charCodeAt(6),m=b.charCodeAt(7);Tb=b.charCodeAt(0)+(b.charCodeAt(1)<<8)+(b.charCodeAt(2)<<16)+(b.charCodeAt(3)<<24)>>>0;Ub=d+(f<<8)+(h<<16)+(m<<24)>>>0} function Zb(b,d){var f=d&2147483648;f&&(b=~b+1>>>0,d=~d>>>0,0==b&&(d=d+1>>>0));b=4294967296*d+b;return f?-b:b}var $b="0123456789abcdef".split(""); function ac(b,d){function f(p){for(var n=1E7,q=0;7>q;q++){n/=10;var t=p/n%10>>>0;if(0!=t||w)w=!0,l+=m[t]}}if(2097151>=d)return""+(4294967296*d+b);var h=(b>>>24|d<<8)>>>0&16777215;d=d>>16&65535;b=(b&16777215)+6777216*h+6710656*d;h+=8147497*d;d*=2;1E7<=b&&(h+=Math.floor(b/1E7),b%=1E7);1E7<=h&&(d+=Math.floor(h/1E7),h%=1E7);var m=$b,w=!1,l="";(d||w)&&f(d);(h||w)&&f(h);(b||w)&&f(b);return l}function bc(b,d){var f=d&2147483648;f&&(b=~b+1>>>0,d=~d+(0==b?1:0)>>>0);b=ac(b,d);return f?"-"+b:b} function hc(b){function d(l,p){for(var n=0;8>n&&(1!==l||0<p);n++)p=l*m[n]+p,m[n]=p&255,p>>>=8}function f(){for(var l=0;8>l;l++)m[l]=~m[l]&255}var h=!1;"-"===b[0]&&(h=!0,b=b.slice(1));for(var m=[0,0,0,0,0,0,0,0],w=0;w<b.length;w++)d(10,$b.indexOf(b[w]));h&&(f(),d(1,1));return vb(m)} function ic(b){if(b.constructor===Uint8Array)return b;if(b.constructor===ArrayBuffer)return new Uint8Array(b);if(b.constructor===Buffer)return new Uint8Array(b);if(b.constructor===Array)return new Uint8Array(b);if(b.constructor===String)return Db(b);qb("Type not convertible to Uint8Array.");return new Uint8Array(0)}; //~~WEBPATH~~external/com_google_protobuf_js/binary/decoder.js function nc(b,d,f){this.bytes_=null;this.tempHigh_=this.tempLow_=this.cursor_=this.end_=this.start_=0;this.error_=!1;b&&this.setBlock(b,d,f)}var rc=[];function sc(b,d,f){if(rc.length){var h=rc.pop();b&&h.setBlock(b,d,f);return h}return new nc(b,d,f)}Q=nc.prototype;Q.free=function(){this.clear();100>rc.length&&rc.push(this)};Q.clone=function(){return sc(this.bytes_,this.start_,this.end_-this.start_)};Q.clear=function(){this.bytes_=null;this.cursor_=this.end_=this.start_=0;this.error_=!1}; Q.getBuffer=function(){return this.bytes_};Q.setBlock=function(b,d,f){this.bytes_=ic(b);this.start_=void 0!==d?d:0;this.end_=void 0!==f?this.start_+f:this.bytes_.length;this.cursor_=this.start_};Q.setEnd=function(b){this.end_=b};Q.reset=function(){this.cursor_=this.start_};Q.getCursor=function(){return this.cursor_};Q.advance=function(b){this.cursor_+=b};function yc(b){return b.cursor_==b.end_}Q.pastEnd=function(){return this.cursor_>this.end_}; Q.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_};function Cc(b){for(var d,f=0,h,m=0;4>m;m++)if(d=b.bytes_[b.cursor_++],f|=(d&127)<<7*m,128>d){b.tempLow_=f>>>0;b.tempHigh_=0;return}d=b.bytes_[b.cursor_++];f|=(d&127)<<28;h=0|(d&127)>>4;if(128>d)b.tempLow_=f>>>0,b.tempHigh_=h>>>0;else{for(m=0;5>m;m++)if(d=b.bytes_[b.cursor_++],h|=(d&127)<<7*m+3,128>d){b.tempLow_=f>>>0;b.tempHigh_=h>>>0;return}qb("Failed to read varint, encoding is invalid.");b.error_=!0}} function Dc(b,d){for(;128<d;)b.cursor_--,d>>>=7;b.cursor_--} Q.readUnsignedVarint32=function(){var b=this.bytes_;var d=b[this.cursor_+0];var f=d&127;if(128>d)return this.cursor_+=1,f;d=b[this.cursor_+1];f|=(d&127)<<7;if(128>d)return this.cursor_+=2,f;d=b[this.cursor_+2];f|=(d&127)<<14;if(128>d)return this.cursor_+=3,f;d=b[this.cursor_+3];f|=(d&127)<<21;if(128>d)return this.cursor_+=4,f;d=b[this.cursor_+4];f|=(d&15)<<28;if(128>d)return this.cursor_+=5,f>>>0;this.cursor_+=5;128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&&128<=b[this.cursor_++]&& this.cursor_++;return f};Q.readSignedVarint32=nc.prototype.readUnsignedVarint32;Q.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()};Q.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};Q.readZigzagVarint32=function(){var b=this.readUnsignedVarint32();return b>>>1^-(b&1)};Q.readUnsignedVarint64=function(){Cc(this);return 4294967296*this.tempHigh_+this.tempLow_}; Q.readUnsignedVarint64String=function(){Cc(this);return ac(this.tempLow_,this.tempHigh_)};Q.readSignedVarint64=function(){Cc(this);return Zb(this.tempLow_,this.tempHigh_)};Q.readSignedVarint64String=function(){Cc(this);return bc(this.tempLow_,this.tempHigh_)};Q.readZigzagVarint64=function(){Cc(this);var b=this.tempLow_,d=this.tempHigh_,f=b&1;b=(b>>>1|d<<31)>>>0;d>>>=1;f&&(b=b+1>>>0,0==b&&(d=d+1>>>0));b=4294967296*d+b;return f?-b:b};Q.readZigzagVarint64String=function(){return this.readZigzagVarint64().toString()}; Q.readUint8=function(){var b=this.bytes_[this.cursor_+0];this.cursor_+=1;return b};Q.readUint16=function(){var b=this.bytes_[this.cursor_+0],d=this.bytes_[this.cursor_+1];this.cursor_+=2;return b<<0|d<<8};Q.readUint32=function(){var b=this.bytes_[this.cursor_+0],d=this.bytes_[this.cursor_+1],f=this.bytes_[this.cursor_+2],h=this.bytes_[this.cursor_+3];this.cursor_+=4;return(b<<0|d<<8|f<<16|h<<24)>>>0};Q.readUint64=function(){var b=this.readUint32();return 4294967296*this.readUint32()+b}; Q.readUint64String=function(){var b=this.readUint32(),d=this.readUint32();return ac(b,d)};Q.readInt8=function(){var b=this.bytes_[this.cursor_+0];this.cursor_+=1;return b<<24>>24};Q.readInt16=function(){var b=this.bytes_[this.cursor_+0],d=this.bytes_[this.cursor_+1];this.cursor_+=2;return(b<<0|d<<8)<<16>>16};Q.readInt32=function(){var b=this.bytes_[this.cursor_+0],d=this.bytes_[this.cursor_+1],f=this.bytes_[this.cursor_+2],h=this.bytes_[this.cursor_+3];this.cursor_+=4;return b<<0|d<<8|f<<16|h<<24}; Q.readInt64=function(){var b=this.readUint32(),d=this.readUint32();return Zb(b,d)};Q.readInt64String=function(){var b=this.readUint32(),d=this.readUint32();return bc(b,d)};Q.readFloat=function(){var b=this.readUint32(),d=2*(b>>31)+1,f=b>>>23&255;b&=8388607;return 255==f?b?NaN:Infinity*d:0==f?d*Math.pow(2,-149)*b:d*Math.pow(2,f-150)*(b+Math.pow(2,23))}; Q.readDouble=function(){var b=this.readUint32(),d=this.readUint32(),f=2*(d>>31)+1,h=d>>>20&2047;b=4294967296*(d&1048575)+b;return 2047==h?b?NaN:Infinity*f:0==h?f*Math.pow(2,-1074)*b:f*Math.pow(2,h-1075)*(b+4503599627370496)};Q.readBool=function(){return!!this.bytes_[this.cursor_++]};Q.readEnum=function(){return this.readSignedVarint32()}; Q.readString=function(b){var d=this.bytes_,f=this.cursor_;b=f+b;for(var h=[],m="";f<b;){var w=d[f++];if(128>w)h.push(w);else if(192>w)continue;else if(224>w){var l=d[f++];h.push((w&31)<<6|l&63)}else if(240>w){l=d[f++];var p=d[f++];h.push((w&15)<<12|(l&63)<<6|p&63)}else if(248>w){l=d[f++];p=d[f++];var n=d[f++];w=(w&7)<<18|(l&63)<<12|(p&63)<<6|n&63;w-=65536;h.push((w>>10&1023)+55296,(w&1023)+56320)}8192<=h.length&&(m+=String.fromCharCode.apply(null,h),h.length=0)}m+=vb(h);this.cursor_=f;return m}; Q.readStringWithLength=function(){var b=this.readUnsignedVarint32();return this.readString(b)};Q.readBytes=function(b){if(0>b||this.cursor_+b>this.bytes_.length)return this.error_=!0,qb("Invalid byte length!"),new Uint8Array(0);var d=this.bytes_.subarray(this.cursor_,this.cursor_+b);this.cursor_+=b;return d};Q.readVarintHash64=function(){Cc(this);var b=this.tempLow_,d=this.tempHigh_;return String.fromCharCode(b>>>0&255,b>>>8&255,b>>>16&255,b>>>24&255,d>>>0&255,d>>>8&255,d>>>16&255,d>>>24&255)}; Q.readFixedHash64=function(){var b=this.bytes_,d=this.cursor_,f=b[d+0],h=b[d+1],m=b[d+2],w=b[d+3],l=b[d+4],p=b[d+5],n=b[d+6];b=b[d+7];this.cursor_+=8;return String.fromCharCode(f,h,m,w,l,p,n,b)}; //~~WEBPATH~~external/com_google_protobuf_js/binary/encoder.js function Ec(){this.buffer_=[]}Q=Ec.prototype;Q.length=function(){return this.buffer_.length};Q.end=function(){var b=this.buffer_;this.buffer_=[];return b};function Fc(b,d,f){for(;0<f||127<d;)b.buffer_.push(d&127|128),d=(d>>>7|f<<25)>>>0,f>>>=7;b.buffer_.push(d)}function Ic(b,d){for(;127<d;)b.buffer_.push(d&127|128),d>>>=7;b.buffer_.push(d)}function Jc(b,d){if(0<=d)Ic(b,d);else{for(var f=0;9>f;f++)b.buffer_.push(d&127|128),d>>=7;b.buffer_.push(1)}}function Kc(b,d){Ic(b,(d<<1^d>>31)>>>0)} function Lc(b,d){var f=d;d=0>f;f=2*Math.abs(f);Vb(f);f=Tb;var h=Ub;d&&(0==f?0==h?h=f=4294967295:(h--,f=4294967295):f--);Tb=f;Ub=h;Fc(b,Tb,Ub)}Q.writeUint8=function(b){this.buffer_.push(b>>>0&255)};Q.writeUint16=function(b){this.buffer_.push(b>>>0&255);this.buffer_.push(b>>>8&255)};Q.writeUint32=function(b){this.buffer_.push(b>>>0&255);this.buffer_.push(b>>>8&255);this.buffer_.push(b>>>16&255);this.buffer_.push(b>>>24&255)};Q.writeUint64=function(b){Vb(b);this.writeUint32(Tb);this.writeUint32(Ub)}; Q.writeInt8=function(b){this.buffer_.push(b>>>0&255)};Q.writeInt16=function(b){this.buffer_.push(b>>>0&255);this.buffer_.push(b>>>8&255)};Q.writeInt32=function(b){this.buffer_.push(b>>>0&255);this.buffer_.push(b>>>8&255);this.buffer_.push(b>>>16&255);this.buffer_.push(b>>>24&255)};Q.writeInt64=function(b){Wb(b);b=Ub;this.writeUint32(Tb);this.writeUint32(b)};Q.writeInt64String=function(b){Xb(hc(b));b=Ub;this.writeUint32(Tb);this.writeUint32(b)}; Q.writeFloat=function(b){var d=b;d=(b=0>d?1:0)?-d:d;if(0===d)0<1/d?Tb=Ub=0:(Ub=0,Tb=2147483648);else if(isNaN(d))Ub=0,Tb=2147483647;else if(3.4028234663852886E38<d)Ub=0,Tb=(b<<31|2139095040)>>>0;else if(1.1754943508222875E-38>d)d=Math.round(d/Math.pow(2,-149)),Ub=0,Tb=(b<<31|d)>>>0;else{var f=Math.floor(Math.log(d)/Math.LN2);d*=Math.pow(2,-f);d=Math.round(8388608*d)&8388607;Ub=0;Tb=(b<<31|f+127<<23|d)>>>0}this.writeUint32(Tb)}; Q.writeDouble=function(b){var d=b;d=(b=0>d?1:0)?-d:d;if(0===d)Ub=0<1/d?0:2147483648,Tb=0;else if(isNaN(d))Ub=2147483647,Tb=4294967295;else if(1.7976931348623157E308<d)Ub=(b<<31|2146435072)>>>0,Tb=0;else if(2.2250738585072014E-308>d)d/=Math.pow(2,-1074),Ub=(b<<31|d/4294967296)>>>0,Tb=d>>>0;else{var f=Math.floor(Math.log(d)/Math.LN2);1024==f&&(f=1023);d*=Math.pow(2,-f);Ub=(b<<31|f+1023<<20|1048576*d&1048575)>>>0;Tb=4503599627370496*d>>>0}this.writeUint32(Tb);this.writeUint32(Ub)}; Q.writeBool=function(b){this.buffer_.push(b?1:0)};Q.writeEnum=function(b){Jc(this,b)};Q.writeBytes=function(b){this.buffer_.push.apply(this.buffer_,b)};Q.writeVarintHash64=function(b){Xb(b);Fc(this,Tb,Ub)};Q.writeFixedHash64=function(b){Xb(b);this.writeUint32(Tb);this.writeUint32(Ub)}; Q.writeString=function(b){for(var d=0;d<b.length;d++){var f=b.charCodeAt(d);if(128>f)this.buffer_.push(f);else if(2048>f)this.buffer_.push(f>>6|192),this.buffer_.push(f&63|128);else if(65536>f)if(55296<=f&&56319>=f&&d+1<b.length){var h=b.charCodeAt(d+1);56320<=h&&57343>=h&&(f=1024*(f-55296)+h-56320+65536,this.buffer_.push(f>>18|240),this.buffer_.push(f>>12&63|128),this.buffer_.push(f>>6&63|128),this.buffer_.push(f&63|128),d++)}else this.buffer_.push(f>>12|224),this.buffer_.push(f>>6&63|128),this.buffer_.push(f& 63|128)}}; //~~WEBPATH~~external/com_google_protobuf_js/binary/reader.js function ed(b,d,f){this.decoder_=sc(b,d,f);this.fieldCursor_=this.decoder_.getCursor();this.nextWireType_=this.nextField_=-1;this.error_=!1;this.readCallbacks_=null}var fd=[];Q=ed.prototype;Q.alloc=function(b,d,f){if(fd.length){var h=fd.pop();b&&h.decoder_.setBlock(b,d,f);return h}return new ed(b,d,f)};Q.free=function(){this.decoder_.clear();this.nextWireType_=this.nextField_=-1;this.error_=!1;this.readCallbacks_=null;100>fd.length&&fd.push(this)};Q.getFieldCursor=function(){return this.fieldCursor_}; Q.getCursor=function(){return this.decoder_.getCursor()};Q.getBuffer=function(){return this.decoder_.getBuffer()};Q.getWireType=function(){return this.nextWireType_};function gd(b){return 4==b.nextWireType_}Q.getError=function(){return this.error_||this.decoder_.getError()};Q.setBlock=function(b,d,f){this.decoder_.setBlock(b,d,f);this.nextWireType_=this.nextField_=-1};Q.reset=function(){this.decoder_.reset();this.nextWireType_=this.nextField_=-1};Q.advance=function(b){this.decoder_.advance(b)}; function hd(b){if(yc(b.decoder_))return!1;if(b.getError())return qb("Decoder hit an error"),!1;b.fieldCursor_=b.decoder_.getCursor();var d=b.decoder_.readUnsignedVarint32(),f=d>>>3;d&=7;if(0!=d&&5!=d&&1!=d&&2!=d&&3!=d&&4!=d)return qb("Invalid wire type"),b.error_=!0,!1;b.nextField_=f;b.nextWireType_=d;return!0} Q.skipMatchingFields=function(){var b=this.nextField_;for(Dc(this.decoder_,this.nextField_<<3|this.nextWireType_);hd(this)&&this.nextField_==b;)id(this);yc(this.decoder_)||Dc(this.decoder_,this.nextField_<<3|this.nextWireType_)}; function id(b){switch(b.nextWireType_){case 0:if(0!=b.nextWireType_)qb("Invalid wire type for skipVarintField"),id(b);else{for(b=b.decoder_;b.bytes_[b.cursor_]&128;)b.cursor_++;b.cursor_++}break;case 1:1!=b.nextWireType_?(qb("Invalid wire type for skipFixed64Field"),id(b)):b.decoder_.advance(8);break;case 2:if(2!=b.nextWireType_)qb("Invalid wire type for skipDelimitedField"),id(b);else{var d=b.decoder_.readUnsignedVarint32();b.decoder_.advance(d)}break;case 5:5!=b.nextWireType_?(qb("Invalid wire type for skipFixed32Field"), id(b)):b.decoder_.advance(4);break;case 3:d=[b.nextField_];do{if(!hd(b)){qb("Unmatched start-group tag: stream EOF");b.error_=!0;break}if(3==b.nextWireType_)d.push(b.nextField_);else if(4==b.nextWireType_&&b.nextField_!=d.pop()){qb("Unmatched end-group tag");b.error_=!0;break}}while(0<d.length);break;default:qb("Invalid wire encoding for field.")}}Q.registerReadCallback=function(b,d){null===this.readCallbacks_&&(this.readCallbacks_={});this.readCallbacks_[b]=d};Q.runReadCallback=function(b){return(0,this.readCallbacks_[b])(this)}; Q.readAny=function(b){this.nextWireType_=Sb(b);switch(b){case 1:return this.readDouble();case 2:return this.readFloat();case 3:return this.readInt64();case 4:return this.readUint64();case 5:return this.readInt32();case 6:return this.decoder_.readUint64();case 7:return this.decoder_.readUint32();case 8:return this.readBool();case 9:return this.readString();case 10:qb("Group field type not supported in readAny()");case 11:qb("Message field type not supported in readAny()");case 12:return this.readBytes(); case 13:return this.readUint32();case 14:return this.readEnum();case 15:return this.decoder_.readInt32();case 16:return this.decoder_.readInt64();case 17:return this.decoder_.readZigzagVarint32();case 18:return this.decoder_.readZigzagVarint64();case 30:return this.readFixedHash64();case 31:return this.readVarintHash64();default:qb("Invalid field type in readAny()")}return 0}; function jd(b,d,f){var h=b.decoder_.end_,m=b.decoder_.readUnsignedVarint32();m=b.decoder_.getCursor()+m;b.decoder_.setEnd(m);f(d,b);b.decoder_.cursor_=m;b.decoder_.setEnd(h)}Q.readGroup=function(b,d,f){f(d,this);this.error_||4==this.nextWireType_||(qb("Group submessage did not end with an END_GROUP tag"),this.error_=!0)};Q.getFieldDecoder=function(){var b=this.decoder_.readUnsignedVarint32(),d=this.decoder_.getCursor(),f=d+b;b=sc(this.decoder_.getBuffer(),d,b);this.decoder_.cursor_=f;return b}; Q.readInt32=function(){return this.decoder_.readSignedVarint32()};Q.readInt32String=function(){return this.decoder_.readSignedVarint32String()};Q.readInt64=function(){return this.decoder_.readSignedVarint64()};Q.readInt64String=function(){return this.decoder_.readSignedVarint64String()};Q.readUint32=function(){return this.decoder_.readUnsignedVarint32()};Q.readUint32String=function(){return this.decoder_.readUnsignedVarint32String()};Q.readUint64=function(){return this.decoder_.readUnsignedVarint64()}; Q.readUint64String=function(){return this.decoder_.readUnsignedVarint64String()};Q.readSint64String=function(){return this.decoder_.readZigzagVarint64String()};Q.readFixed64String=function(){return this.decoder_.readUint64String()};Q.readSfixed32String=function(){return this.decoder_.readInt32().toString()};Q.readSfixed64String=function(){return this.decoder_.readInt64String()};Q.readFloat=function(){return this.decoder_.readFloat()};Q.readDouble=function(){return this.decoder_.readDouble()}; Q.readBool=function(){return!!this.decoder_.readUnsignedVarint32()};Q.readEnum=function(){return this.decoder_.readSignedVarint64()};Q.readString=function(){var b=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(b)};Q.readBytes=function(){var b=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(b)};Q.readVarintHash64=function(){return this.decoder_.readVarintHash64()};Q.readFixedHash64=function(){return this.decoder_.readFixedHash64()}; function kd(b,d){var f=b.decoder_.readUnsignedVarint32();f=b.decoder_.getCursor()+f;for(var h=[];b.decoder_.getCursor()<f;)h.push(d.call(b.decoder_));return h}Q.readPackedInt32=function(){return kd(this,this.decoder_.readSignedVarint32)};Q.readPackedInt32String=function(){return kd(this,this.decoder_.readSignedVarint32String)};Q.readPackedInt64=function(){return kd(this,this.decoder_.readSignedVarint64)};Q.readPackedInt64String=function(){return kd(this,this.decoder_.readSignedVarint64String)}; Q.readPackedUint32=function(){return kd(this,this.decoder_.readUnsignedVarint32)};Q.readPackedUint32String=function(){return kd(this,this.decoder_.readUnsignedVarint32String)};Q.readPackedUint64=function(){return kd(this,this.decoder_.readUnsignedVarint64)};Q.readPackedUint64String=function(){return kd(this,this.decoder_.readUnsignedVarint64String)};Q.readPackedSint32=function(){return kd(this,this.decoder_.readZigzagVarint32)};Q.readPackedSint64=function(){return kd(this,this.decoder_.readZigzagVarint64)}; Q.readPackedSint64String=function(){return kd(this,this.decoder_.readZigzagVarint64String)};Q.readPackedFixed32=function(){return kd(this,this.decoder_.readUint32)};Q.readPackedFixed64=function(){return kd(this,this.decoder_.readUint64)};Q.readPackedFixed64String=function(){return kd(this,this.decoder_.readUint64String)};Q.readPackedSfixed32=function(){return kd(this,this.decoder_.readInt32)};Q.readPackedSfixed64=function(){return kd(this,this.decoder_.readInt64)}; Q.readPackedSfixed64String=function(){return kd(this,this.decoder_.readInt64String)};Q.readPackedFloat=function(){return kd(this,this.decoder_.readFloat)};Q.readPackedDouble=function(){return kd(this,this.decoder_.readDouble)};Q.readPackedBool=function(){return kd(this,this.decoder_.readBool)};Q.readPackedEnum=function(){return kd(this,this.decoder_.readEnum)};Q.readPackedVarintHash64=function(){return kd(this,this.decoder_.readVarintHash64)};Q.readPackedFixedHash64=function(){return kd(this,this.decoder_.readFixedHash64)}; //~~WEBPATH~~external/com_google_protobuf_js/binary/writer.js function ld(){this.blocks_=[];this.totalLength_=0;this.encoder_=new Ec;this.bookmarks_=[]}function md(b,d){var f=b.encoder_.end();b.blocks_.push(f);b.blocks_.push(d);b.totalLength_+=f.length+d.length}function nd(b,d){od(b,d,2);d=b.encoder_.end();b.blocks_.push(d);b.totalLength_+=d.length;d.push(b.totalLength_);return d}function pd(b,d){var f=d.pop();for(f=b.totalLength_+b.encoder_.length()-f;127<f;)d.push(f&127|128),f>>>=7,b.totalLength_++;d.push(f);b.totalLength_++}Q=ld.prototype; Q.maybeWriteSerializedMessage=function(b,d,f){null!=b&&null!=d&&null!=f&&md(this,b.subarray(d,f))};Q.reset=function(){this.blocks_=[];this.encoder_.end();this.totalLength_=0;this.bookmarks_=[]};function qd(b){for(var d=new Uint8Array(b.totalLength_+b.encoder_.length()),f=b.blocks_,h=f.length,m=0,w=0;w<h;w++){var l=f[w];d.set(l,m);m+=l.length}f=b.encoder_.end();d.set(f,m);b.blocks_=[d];return d} Q.getResultBase64String=function(b){var d=qd(this);Fb();b=b?zb:xb;for(var f=[],h=0;h<d.length;h+=3){var m=d[h],w=h+1<d.length,l=w?d[h+1]:0,p=h+2<d.length,n=p?d[h+2]:0,q=m>>2;m=(m&3)<<4|l>>4;l=(l&15)<<2|n>>6;n&=63;p||(n=64,w||(l=64));f.push(b[q],b[m],b[l],b[n])}return f.join("")};Q.beginSubMessage=function(b){this.bookmarks_.push(nd(this,b))};Q.endSubMessage=function(){pd(this,this.bookmarks_.pop())};function od(b,d,f){Ic(b.encoder_,8*d+f)} Q.writeAny=function(b,d,f){switch(b){case 1:this.writeDouble(d,f);break;case 2:this.writeFloat(d,f);break;case 3:this.writeInt64(d,f);break;case 4:this.writeUint64(d,f);break;case 5:this.writeInt32(d,f);break;case 6:null!=f&&(od(this,d,1),this.encoder_.writeUint64(f));break;case 7:null!=f&&(od(this,d,5),this.encoder_.writeUint32(f));break;case 8:this.writeBool(d,f);break;case 9:this.writeString(d,f);break;case 10:qb("Group field type not supported in writeAny()");break;case 11:qb("Message field type not supported in writeAny()"); break;case 12:this.writeBytes(d,f);break;case 13:this.writeUint32(d,f);break;case 14:this.writeEnum(d,f);break;case 15:null!=f&&(od(this,d,5),this.encoder_.writeInt32(f));break;case 16:null!=f&&(od(this,d,1),this.encoder_.writeInt64(f));break;case 17:null!=f&&null!=f&&(od(this,d,0),Kc(this.encoder_,f));break;case 18:null!=f&&null!=f&&(od(this,d,0),Lc(this.encoder_,f));break;case 30:this.writeFixedHash64(d,f);break;case 31:this.writeVarintHash64(d,f);break;default:qb("Invalid field type in writeAny()")}}; function rd(b,d,f){null!=f&&(od(b,d,0),Ic(b.encoder_,f))}function Ad(b,d,f){null!=f&&(od(b,d,0),Jc(b.encoder_,f))}Q.writeInt32=function(b,d){null!=d&&Ad(this,b,d)};Q.writeInt64=function(b,d){null!=d&&null!=d&&(od(this,b,0),b=this.encoder_,Wb(d),Fc(b,Tb,Ub))};Q.writeInt64String=function(b,d){null!=d&&(d=Rb(d),od(this,b,0),Fc(this.encoder_,d.lo,d.hi))};Q.writeUint32=function(b,d){null!=d&&rd(this,b,d)};Q.writeUint64=function(b,d){null!=d&&null!=d&&(od(this,b,0),b=this.encoder_,Wb(d),Fc(b,Tb,Ub))}; Q.writeSint64String=function(b,d){null!=d&&null!=d&&(od(this,b,0),Lc(this.encoder_,parseInt(d,10)))};Q.writeFloat=function(b,d){null!=d&&(od(this,b,5),this.encoder_.writeFloat(d))};Q.writeDouble=function(b,d){null!=d&&(od(this,b,1),this.encoder_.writeDouble(d))};Q.writeBool=function(b,d){null!=d&&(od(this,b,0),this.encoder_.writeBool(d))};Q.writeEnum=function(b,d){null!=d&&(od(this,b,0),Jc(this.encoder_,d))};Q.writeString=function(b,d){null!=d&&(b=nd(this,b),this.encoder_.writeString(d),pd(this,b))}; Q.writeBytes=function(b,d){null!=d&&(d=ic(d),od(this,b,2),Ic(this.encoder_,d.length),md(this,d))};function Bd(b,d,f,h){null!=f&&(d=nd(b,d),h(f,b),pd(b,d))}Q.writeGroup=function(b,d,f){null!=d&&(od(this,b,3),f(d,this),od(this,b,4))};Q.writeFixedHash64=function(b,d){null!=d&&(od(this,b,1),this.encoder_.writeFixedHash64(d))};Q.writeVarintHash64=function(b,d){null!=d&&(od(this,b,0),this.encoder_.writeVarintHash64(d))}; Q.writeRepeatedInt32=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)Ad(this,b,d[f])};Q.writeRepeatedInt32String=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];null!=h&&Ad(this,b,parseInt(h,10))}};Q.writeRepeatedInt64=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];if(null!=h){od(this,b,0);var m=this.encoder_;Wb(h);Fc(m,Tb,Ub)}}};Q.writeRepeatedInt64String=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)this.writeInt64String(b,d[f])}; Q.writeRepeatedUint32=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)rd(this,b,d[f])};Q.writeRepeatedUint32String=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];null!=h&&rd(this,b,parseInt(h,10))}};Q.writeRepeatedUint64=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];if(null!=h){od(this,b,0);var m=this.encoder_;Wb(h);Fc(m,Tb,Ub)}}}; Q.writeRepeatedUint64String=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=b,m=d[f];null!=m&&(m=Ob(m),od(this,h,0),Fc(this.encoder_,m.lo,m.hi))}};Q.writeRepeatedSint32=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];null!=h&&(od(this,b,0),Kc(this.encoder_,h))}};Q.writeRepeatedSint64=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];null!=h&&(od(this,b,0),Lc(this.encoder_,h))}}; Q.writeRepeatedSint64String=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];null!=h&&(od(this,b,0),Lc(this.encoder_,parseInt(h,10)))}};Q.writeRepeatedFixed32=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];null!=h&&(od(this,b,5),this.encoder_.writeUint32(h))}};Q.writeRepeatedFixed64=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];null!=h&&(od(this,b,1),this.encoder_.writeUint64(h))}}; Q.writeRepeatedFixed64String=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=b,m=d[f];if(null!=m){m=Ob(m);od(this,h,1);h=this.encoder_;var w=m.hi;h.writeUint32(m.lo);h.writeUint32(w)}}};Q.writeRepeatedSfixed32=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];null!=h&&(od(this,b,5),this.encoder_.writeInt32(h))}};Q.writeRepeatedSfixed64=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=d[f];null!=h&&(od(this,b,1),this.encoder_.writeInt64(h))}}; Q.writeRepeatedSfixed64String=function(b,d){if(null!=d)for(var f=0;f<d.length;f++){var h=b,m=d[f];if(null!=m){m=Rb(m);od(this,h,1);h=this.encoder_;var w=m.hi;h.writeUint32(m.lo);h.writeUint32(w)}}};Q.writeRepeatedFloat=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)this.writeFloat(b,d[f])};Q.writeRepeatedDouble=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)this.writeDouble(b,d[f])};Q.writeRepeatedBool=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)this.writeBool(b,d[f])}; Q.writeRepeatedEnum=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)this.writeEnum(b,d[f])};Q.writeRepeatedBytes=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)this.writeBytes(b,d[f])};function Cd(b,d,f,h){if(null!=f)for(var m=0;m<f.length;m++){var w=nd(b,d);h(f[m],b);pd(b,w)}}Q.writeRepeatedGroup=function(b,d,f){if(null!=d)for(var h=0;h<d.length;h++)od(this,b,3),f(d[h],this),od(this,b,4)}; Q.writeRepeatedFixedHash64=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)this.writeFixedHash64(b,d[f])};Q.writeRepeatedVarintHash64=function(b,d){if(null!=d)for(var f=0;f<d.length;f++)this.writeVarintHash64(b,d[f])};Q.writePackedInt32=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++)Jc(this.encoder_,d[f]);pd(this,b)}};Q.writePackedInt32String=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++)Jc(this.encoder_,parseInt(d[f],10));pd(this,b)}}; Q.writePackedInt64=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++){var h=this.encoder_;Wb(d[f]);Fc(h,Tb,Ub)}pd(this,b)}};Q.writePackedInt64String=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++){var h=Rb(d[f]);Fc(this.encoder_,h.lo,h.hi)}pd(this,b)}};Q.writePackedUint32=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++)Ic(this.encoder_,d[f]);pd(this,b)}}; Q.writePackedUint32String=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++)Ic(this.encoder_,parseInt(d[f],10));pd(this,b)}};Q.writePackedUint64=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++){var h=this.encoder_;Wb(d[f]);Fc(h,Tb,Ub)}pd(this,b)}};Q.writePackedUint64String=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++){var h=Ob(d[f]);Fc(this.encoder_,h.lo,h.hi)}pd(this,b)}}; Q.writePackedSint32=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++)Kc(this.encoder_,d[f]);pd(this,b)}};Q.writePackedSint64=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++)Lc(this.encoder_,d[f]);pd(this,b)}};Q.writePackedSint64String=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++)Lc(this.encoder_,parseInt(d[f],10));pd(this,b)}}; Q.writePackedFixed32=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,4*d.length),b=0;b<d.length;b++)this.encoder_.writeUint32(d[b])};Q.writePackedFixed64=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,8*d.length),b=0;b<d.length;b++)this.encoder_.writeUint64(d[b])};Q.writePackedFixed64String=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,8*d.length),b=0;b<d.length;b++){var f=Ob(d[b]),h=this.encoder_,m=f.hi;h.writeUint32(f.lo);h.writeUint32(m)}}; Q.writePackedSfixed32=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,4*d.length),b=0;b<d.length;b++)this.encoder_.writeInt32(d[b])};Q.writePackedSfixed64=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,8*d.length),b=0;b<d.length;b++)this.encoder_.writeInt64(d[b])};Q.writePackedSfixed64String=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,8*d.length),b=0;b<d.length;b++)this.encoder_.writeInt64String(d[b])}; Q.writePackedFloat=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,4*d.length),b=0;b<d.length;b++)this.encoder_.writeFloat(d[b])};Q.writePackedDouble=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,8*d.length),b=0;b<d.length;b++)this.encoder_.writeDouble(d[b])};Q.writePackedBool=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,d.length),b=0;b<d.length;b++)this.encoder_.writeBool(d[b])}; Q.writePackedEnum=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++)this.encoder_.writeEnum(d[f]);pd(this,b)}};Q.writePackedFixedHash64=function(b,d){if(null!=d&&d.length)for(od(this,b,2),Ic(this.encoder_,8*d.length),b=0;b<d.length;b++)this.encoder_.writeFixedHash64(d[b])};Q.writePackedVarintHash64=function(b,d){if(null!=d&&d.length){b=nd(this,b);for(var f=0;f<d.length;f++)this.encoder_.writeVarintHash64(d[f]);pd(this,b)}}; //~~WEBPATH~~external/com_google_protobuf_js/map.js //~~WEBPATH~~external/com_google_protobuf_js/message.js function Dd(){}var Ed="function"==typeof Uint8Array;Dd.prototype.getJsPbMessageId=function(){return this.messageId_}; function Fd(b,d,f,h){b.wrappers_=null;d||(d=[]);b.messageId_=void 0;b.arrayIndexOffset_=-1;b.array=d;a:{if(b.array.length){d=b.array.length-1;var m=b.array[d];if(m&&"object"==typeof m&&"array"!=pa(m)&&!(Ed&&m instanceof Uint8Array)){b.pivot_=d-b.arrayIndexOffset_;b.extensionObject_=m;break a}}b.pivot_=Number.MAX_VALUE}b.convertedFloatingPointFields_={};if(f)for(d=0;d<f.length;d++)m=f[d],m<b.pivot_?(m+=b.arrayIndexOffset_,b.array[m]=b.array[m]||Gd):(Hd(b),b.extensionObject_[m]=b.extensionObject_[m]|| Gd);if(h&&h.length)for(d=0;d<h.length;d++)Id(b,h[d])}var Gd=Object.freeze?Object.freeze([]):[];function Hd(b){var d=b.pivot_+b.arrayIndexOffset_;b.array[d]||(b.extensionObject_=b.array[d]={})}function Rd(b,d,f){for(var h=[],m=0;m<b.length;m++)h[m]=d.call(b[m],f,b[m]);return h}function Sd(b,d){if(d<b.pivot_){d+=b.arrayIndexOffset_;var f=b.array[d];return f===Gd?b.array[d]=[]:f}if(b.extensionObject_)return f=b.extensionObject_[d],f===Gd?b.extensionObject_[d]=[]:f} function Td(b,d){if(d<b.pivot_){d+=b.arrayIndexOffset_;var f=b.array[d];return f===Gd?b.array[d]=[]:f}f=b.extensionObject_[d];return f===Gd?b.extensionObject_[d]=[]:f}function Ud(b,d,f){b=Sd(b,d);return null==b?f:b}function Vd(b,d,f){d<b.pivot_?b.array[d+b.arrayIndexOffset_]=f:(Hd(b),b.extensionObject_[d]=f)}function Wd(b,d,f){Xd(b,d,f,0)}function Yd(b,d,f){Xd(b,d,f,0)}function Xd(b,d,f,h){f!=h?Vd(b,d,f):b.array[d+b.arrayIndexOffset_]=null} function te(b,d,f,h){(f=Id(b,f))&&f!==d&&void 0!==h&&(b.wrappers_&&f in b.wrappers_&&(b.wrappers_[f]=void 0),Vd(b,f,void 0));Vd(b,d,h)}function Id(b,d){for(var f,h,m=0;m<d.length;m++){var w=d[m],l=Sd(b,w);null!=l&&(f=w,h=l,Vd(b,w,void 0))}return f?(Vd(b,f,h),f):0}function ue(b,d,f){b.wrappers_||(b.wrappers_={});if(!b.wrappers_[f]){var h=Sd(b,f);h&&(b.wrappers_[f]=new d(h))}return b.wrappers_[f]}function ve(b,d,f){we(b,d,f);d=b.wrappers_[f];d==Gd&&(d=b.wrappers_[f]=[]);return d} function we(b,d,f){b.wrappers_||(b.wrappers_={});if(!b.wrappers_[f]){for(var h=Td(b,f),m=[],w=0;w<h.length;w++)m[w]=new d(h[w]);b.wrappers_[f]=m}}function xe(b,d,f){b.wrappers_||(b.wrappers_={});var h=f?f.toArray():f;b.wrappers_[d]=f;Vd(b,d,h)}function ye(b,d,f,h){b.wrappers_||(b.wrappers_={});var m=h?h.toArray():h;b.wrappers_[d]=h;te(b,d,f,m)}function ze(b,d,f){b.wrappers_||(b.wrappers_={});f=f||[];for(var h=[],m=0;m<f.length;m++)h[m]=f[m].toArray();b.wrappers_[d]=f;Vd(b,d,h)} function Ae(b,d,f,h){we(b,h,d);var m=b.wrappers_[d];m||(m=b.wrappers_[d]=[]);f=f?f:new h;b=Td(b,d);m.push(f);b.push(f.toArray());return f}function Be(b){if(b.wrappers_)for(var d in b.wrappers_){var f=b.wrappers_[d];if("array"==pa(f))for(var h=0;h<f.length;h++)f[h]&&f[h].toArray();else f&&f.toArray()}}Q=Dd.prototype;Q.toArray=function(){Be(this);return this.array};Q.toString=function(){Be(this);return this.array.toString()}; Q.getExtension=function(b){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var d=b.fieldIndex;if(b.isRepeated){if(b.isMessageType())return this.wrappers_[d]||(this.wrappers_[d]=rb(this.extensionObject_[d]||[],function(f){return new b.ctor(f)})),this.wrappers_[d]}else if(b.isMessageType())return!this.wrappers_[d]&&this.extensionObject_[d]&&(this.wrappers_[d]=new b.ctor(this.extensionObject_[d])),this.wrappers_[d];return this.extensionObject_[d]}}; Q.setExtension=function(b,d){this.wrappers_||(this.wrappers_={});Hd(this);var f=b.fieldIndex;b.isRepeated?(d=d||[],b.isMessageType()?(this.wrappers_[f]=d,this.extensionObject_[f]=rb(d,function(h){return h.toArray()})):this.extensionObject_[f]=d):b.isMessageType()?(this.wrappers_[f]=d,this.extensionObject_[f]=d?d.toArray():d):this.extensionObject_[f]=d;return this};Q.clone=function(){return new this.constructor(Ce(this.toArray()))}; function Ce(b){if("array"==pa(b)){for(var d=Array(b.length),f=0;f<b.length;f++){var h=b[f];null!=h&&(d[f]="object"==typeof h?Ce(h):h)}return d}if(Ed&&b instanceof Uint8Array)return new Uint8Array(b);d={};for(f in b)h=b[f],null!=h&&(d[f]="object"==typeof h?Ce(h):h);return d}; //~~WEBPATH~~external/com_google_protobuf_js/debug.js //~~WEBPATH~~bazel-out/k8-fastbuild/bin/facets_overview/proto/feature_statistics_proto.js function De(b){Fd(this,b,Ee,null)}$a(De,Dd);function Fe(b){Fd(this,b,Ge,null)}$a(Fe,Dd);function He(b){Fd(this,b,sf,null)}$a(He,Dd);function uf(b){Fd(this,b,vf,wf)}$a(uf,Dd);function xf(b){Fd(this,b,null,null)}$a(xf,Dd);function yf(b){Fd(this,b,null,zf)}$a(yf,Dd);function Af(b){Fd(this,b,Bf,null)}$a(Af,Dd);function Cf(b){Fd(this,b,Df,null)}$a(Cf,Dd);function Ef(b){Fd(this,b,null,null)}$a(Ef,Dd);function Ff(b){Fd(this,b,Gf,null)}$a(Ff,Dd);function Hf(b){Fd(this,b,If,null)}$a(Hf,Dd); function Jf(b){Fd(this,b,null,null)}$a(Jf,Dd);function Kf(b){Fd(this,b,null,null)}$a(Kf,Dd);function Lf(b){Fd(this,b,null,null)}$a(Lf,Dd);function Mf(b){Fd(this,b,Nf,null)}$a(Mf,Dd);function Of(b){Fd(this,b,null,null)}$a(Of,Dd);function Fg(b){Fd(this,b,Gg,null)}$a(Fg,Dd);function Hg(b){Fd(this,b,null,null)}$a(Hg,Dd);var Ee=[1];De.prototype.toObject=function(b){var d={datasetsList:Rd(Ig(this),Jg,b)};b&&(d.$jspbMessageInstance=this);return d}; function Kg(b){b=new ed(b);for(var d=new De;hd(b)&&!gd(b);)switch(b.nextField_){case 1:var f=new He;jd(b,f,Lg);Ae(d,1,f,He);break;default:id(b)}return d}De.prototype.serializeBinary=function(){var b=new ld;var d=Ig(this);0<d.length&&Cd(b,1,d,Mg);return qd(b)};function Ig(b){return ve(b,He,1)}De.prototype.clearDatasetsList=function(){ze(this,1,[])};var Ge=[1];Fe.prototype.toObject=function(b){return Ng(b,this)};function Ng(b,d){var f={stepList:Td(d,1)};b&&(f.$jspbMessageInstance=d);return f} function Og(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readString();Td(b,1).push(f);break;default:id(d)}return b}Fe.prototype.serializeBinary=function(){var b=new ld;Pg(this,b);return qd(b)};function Pg(b,d){b=Td(b,1);if(0<b.length&&null!=b)for(var f=0;f<b.length;f++)d.writeString(1,b[f])}Fe.prototype.clearStepList=function(){Vd(this,1,[])};var sf=[3];Q=He.prototype;Q.toObject=function(b){return Jg(b,this)}; function Jg(b,d){var f={name:Ud(d,1,""),numExamples:Ud(d,2,0),weightedNumExamples:+Ud(d,4,0),featuresList:Rd(Qg(d),Rg,b)};b&&(f.$jspbMessageInstance=d);return f}function Lg(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readString();b.setName(f);break;case 2:f=d.readUint64();Wd(b,2,f);break;case 4:f=d.readDouble();Yd(b,4,f);break;case 3:f=new uf;jd(d,f,Sg);Ae(b,3,f,uf);break;default:id(d)}return b}Q.serializeBinary=function(){var b=new ld;Mg(this,b);return qd(b)}; function Mg(b,d){var f=b.getName();0<f.length&&d.writeString(1,f);f=Ud(b,2,0);0!==f&&d.writeUint64(2,f);f=+Ud(b,4,0);0!==f&&d.writeDouble(4,f);f=Qg(b);0<f.length&&Cd(d,3,f,Tg)}Q.getName=function(){return Ud(this,1,"")};Q.setName=function(b){Xd(this,1,b,"")};function Qg(b){return ve(b,uf,3)}Q.clearFeaturesList=function(){ze(this,3,[])};var vf=[6],wf=[[1,8],[3,4,5,7]];Q=uf.prototype;Q.getFieldIdCase=function(){return Id(this,wf[0])};Q.getStatsCase=function(){return Id(this,wf[1])}; Q.toObject=function(b){return Rg(b,this)};function Rg(b,d){var f,h={name:Ud(d,1,""),path:(f=ue(d,Fe,8))&&Ng(b,f),type:Ud(d,2,0),numStats:(f=Ug(d))&&Ah(b,f),stringStats:(f=Bh(d))&&Ch(b,f),bytesStats:(f=Dh(d))&&Eh(b,f),structStats:(f=ue(d,Kf,7))&&Fh(b,f),customStatsList:Rd(Gh(d),Hh,b)};b&&(h.$jspbMessageInstance=d);return h} function Sg(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readString();b.setName(f);break;case 8:f=new Fe;jd(d,f,Og);b.setPath(f);break;case 2:f=d.readEnum();b.setType(f);break;case 3:f=new Af;jd(d,f,Ih);ye(b,3,wf[1],f);break;case 4:f=new Cf;jd(d,f,Jh);ye(b,4,wf[1],f);break;case 5:f=new Jf;jd(d,f,Kh);ye(b,5,wf[1],f);break;case 7:f=new Kf;jd(d,f,Lh);ye(b,7,wf[1],f);break;case 6:f=new yf;jd(d,f,Mh);Ae(b,6,f,yf);break;default:id(d)}return b} Q.serializeBinary=function(){var b=new ld;Tg(this,b);return qd(b)};function Tg(b,d){var f=Sd(b,1);null!=f&&d.writeString(1,f);f=ue(b,Fe,8);null!=f&&Bd(d,8,f,Pg);f=b.getType();0!==f&&d.writeEnum(2,f);f=Ug(b);null!=f&&Bd(d,3,f,Nh);f=Bh(b);null!=f&&Bd(d,4,f,Oh);f=Dh(b);null!=f&&Bd(d,5,f,Ph);f=ue(b,Kf,7);null!=f&&Bd(d,7,f,Qh);f=Gh(b);0<f.length&&Cd(d,6,f,Rh)}Q.getName=function(){return Ud(this,1,"")};Q.setName=function(b){te(this,1,wf[0],b)};Q.clearName=function(){te(this,1,wf[0],void 0)}; Q.hasName=function(){return null!=Sd(this,1)};Q.setPath=function(b){ye(this,8,wf[0],b)};Q.clearPath=function(){this.setPath(void 0)};Q.hasPath=function(){return null!=Sd(this,8)};Q.getType=function(){return Ud(this,2,0)};Q.setType=function(b){Xd(this,2,b,0)};function Ug(b){return ue(b,Af,3)}Q.clearNumStats=function(){ye(this,3,wf[1],void 0)};Q.hasNumStats=function(){return null!=Sd(this,3)};function Bh(b){return ue(b,Cf,4)}Q.clearStringStats=function(){ye(this,4,wf[1],void 0)}; Q.hasStringStats=function(){return null!=Sd(this,4)};function Dh(b){return ue(b,Jf,5)}Q.clearBytesStats=function(){ye(this,5,wf[1],void 0)};Q.hasBytesStats=function(){return null!=Sd(this,5)};Q.clearStructStats=function(){ye(this,7,wf[1],void 0)};Q.hasStructStats=function(){return null!=Sd(this,7)};function Gh(b){return ve(b,yf,6)}Q.clearCustomStatsList=function(){ze(this,6,[])};Q=xf.prototype;Q.toObject=function(b){return Sh(b,this)}; function Sh(b,d){var f={numNonMissing:+Ud(d,1,0),numMissing:+Ud(d,2,0),avgNumValues:+Ud(d,3,0),totNumValues:+Ud(d,4,0)};b&&(f.$jspbMessageInstance=d);return f}function Th(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readDouble();b.setNumNonMissing(f);break;case 2:f=d.readDouble();b.setNumMissing(f);break;case 3:f=d.readDouble();b.setAvgNumValues(f);break;case 4:f=d.readDouble();b.setTotNumValues(f);break;default:id(d)}return b}Q.serializeBinary=function(){var b=new ld;Uh(this,b);return qd(b)}; function Uh(b,d){var f=b.getNumNonMissing();0!==f&&d.writeDouble(1,f);f=b.getNumMissing();0!==f&&d.writeDouble(2,f);f=b.getAvgNumValues();0!==f&&d.writeDouble(3,f);f=b.getTotNumValues();0!==f&&d.writeDouble(4,f)}Q.getNumNonMissing=function(){return+Ud(this,1,0)};Q.setNumNonMissing=function(b){Yd(this,1,b)};Q.getNumMissing=function(){return+Ud(this,2,0)};Q.setNumMissing=function(b){Yd(this,2,b)};Q.getAvgNumValues=function(){return+Ud(this,3,0)};Q.setAvgNumValues=function(b){Yd(this,3,b)}; Q.getTotNumValues=function(){return+Ud(this,4,0)};Q.setTotNumValues=function(b){Yd(this,4,b)};var zf=[[2,3,4,5]];Q=yf.prototype;Q.getValCase=function(){return Id(this,zf[0])};Q.toObject=function(b){return Hh(b,this)};function Hh(b,d){var f,h={name:Ud(d,1,""),num:+Ud(d,2,0),str:Ud(d,3,""),histogram:(f=ue(d,Mf,4))&&Vh(b,f),rankHistogram:(f=d.getRankHistogram())&&Wh(b,f)};b&&(h.$jspbMessageInstance=d);return h} function Mh(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readString();b.setName(f);break;case 2:f=d.readDouble();te(b,2,zf[0],f);break;case 3:f=d.readString();te(b,3,zf[0],f);break;case 4:f=new Mf;jd(d,f,Xh);ye(b,4,zf[0],f);break;case 5:f=new Fg;jd(d,f,Yh);b.setRankHistogram(f);break;default:id(d)}return b}Q.serializeBinary=function(){var b=new ld;Rh(this,b);return qd(b)}; function Rh(b,d){var f=b.getName();0<f.length&&d.writeString(1,f);f=Sd(b,2);null!=f&&d.writeDouble(2,f);f=Sd(b,3);null!=f&&d.writeString(3,f);f=ue(b,Mf,4);null!=f&&Bd(d,4,f,Zh);f=b.getRankHistogram();null!=f&&Bd(d,5,f,$h)}Q.getName=function(){return Ud(this,1,"")};Q.setName=function(b){Xd(this,1,b,"")};Q.clearNum=function(){te(this,2,zf[0],void 0)};Q.hasNum=function(){return null!=Sd(this,2)};Q.clearStr=function(){te(this,3,zf[0],void 0)};Q.hasStr=function(){return null!=Sd(this,3)}; Q.clearHistogram=function(){ye(this,4,zf[0],void 0)};Q.hasHistogram=function(){return null!=Sd(this,4)};Q.getRankHistogram=function(){return ue(this,Fg,5)};Q.setRankHistogram=function(b){ye(this,5,zf[0],b)};Q.clearRankHistogram=function(){this.setRankHistogram(void 0)};Q.hasRankHistogram=function(){return null!=Sd(this,5)};var Bf=[8];Q=Af.prototype;Q.toObject=function(b){return Ah(b,this)}; function Ah(b,d){var f,h={commonStats:(f=ai(d))&&bi(b,f),mean:+Ud(d,2,0),stdDev:+Ud(d,3,0),numZeros:Ud(d,4,0),min:+Ud(d,5,0),median:+Ud(d,6,0),max:+Ud(d,7,0),histogramsList:Rd(d.getHistogramsList(),Vh,b),weightedNumericStats:(f=ue(d,Ff,9))&&ci(b,f)};b&&(h.$jspbMessageInstance=d);return h} function Ih(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=new Lf;jd(d,f,Ti);b.setCommonStats(f);break;case 2:f=d.readDouble();b.setMean(f);break;case 3:f=d.readDouble();b.setStdDev(f);break;case 4:f=d.readUint64();Wd(b,4,f);break;case 5:f=d.readDouble();Yd(b,5,f);break;case 6:f=d.readDouble();b.setMedian(f);break;case 7:f=d.readDouble();Yd(b,7,f);break;case 8:f=new Mf;jd(d,f,Xh);b.addHistograms(f);break;case 9:f=new Ff;jd(d,f,Ui);xe(b,9,f);break;default:id(d)}return b} Q.serializeBinary=function(){var b=new ld;Nh(this,b);return qd(b)};function Nh(b,d){var f=ai(b);null!=f&&Bd(d,1,f,Vi);f=b.getMean();0!==f&&d.writeDouble(2,f);f=b.getStdDev();0!==f&&d.writeDouble(3,f);f=Ud(b,4,0);0!==f&&d.writeUint64(4,f);f=+Ud(b,5,0);0!==f&&d.writeDouble(5,f);f=b.getMedian();0!==f&&d.writeDouble(6,f);f=+Ud(b,7,0);0!==f&&d.writeDouble(7,f);f=b.getHistogramsList();0<f.length&&Cd(d,8,f,Zh);f=ue(b,Ff,9);null!=f&&Bd(d,9,f,Wi)}function ai(b){return ue(b,Lf,1)} Q.setCommonStats=function(b){xe(this,1,b)};Q.clearCommonStats=function(){this.setCommonStats(void 0)};Q.hasCommonStats=function(){return null!=Sd(this,1)};Q.getMean=function(){return+Ud(this,2,0)};Q.setMean=function(b){Yd(this,2,b)};Q.getStdDev=function(){return+Ud(this,3,0)};Q.setStdDev=function(b){Yd(this,3,b)};Q.getMedian=function(){return+Ud(this,6,0)};Q.setMedian=function(b){Yd(this,6,b)};Q.getHistogramsList=function(){return ve(this,Mf,8)};Q.setHistogramsList=function(b){ze(this,8,b)}; Q.addHistograms=function(b){return Ae(this,8,b,Mf)};Q.clearHistogramsList=function(){this.setHistogramsList([])};Q.clearWeightedNumericStats=function(){xe(this,9,void 0)};Q.hasWeightedNumericStats=function(){return null!=Sd(this,9)};var Df=[3];Cf.prototype.toObject=function(b){return Ch(b,this)}; function Ch(b,d){var f,h={commonStats:(f=ai(d))&&bi(b,f),unique:Ud(d,2,0),topValuesList:Rd(d.getTopValuesList(),Xi,b),avgLength:+Ud(d,4,0),rankHistogram:(f=d.getRankHistogram())&&Wh(b,f),weightedStringStats:(f=ue(d,Hf,6))&&Yi(b,f)};b&&(h.$jspbMessageInstance=d);return h} function Jh(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=new Lf;jd(d,f,Ti);b.setCommonStats(f);break;case 2:f=d.readUint64();b.setUnique(f);break;case 3:f=new Ef;jd(d,f,Zi);b.addTopValues(f);break;case 4:f=d.readFloat();Yd(b,4,f);break;case 5:f=new Fg;jd(d,f,Yh);b.setRankHistogram(f);break;case 6:f=new Hf;jd(d,f,$i);xe(b,6,f);break;default:id(d)}return b}Cf.prototype.serializeBinary=function(){var b=new ld;Oh(this,b);return qd(b)}; function Oh(b,d){var f=ai(b);null!=f&&Bd(d,1,f,Vi);f=Ud(b,2,0);0!==f&&d.writeUint64(2,f);f=b.getTopValuesList();0<f.length&&Cd(d,3,f,aj);f=+Ud(b,4,0);0!==f&&d.writeFloat(4,f);f=b.getRankHistogram();null!=f&&Bd(d,5,f,$h);f=ue(b,Hf,6);null!=f&&Bd(d,6,f,bj)}Ef.prototype.toObject=function(b){return Xi(b,this)};function Xi(b,d){var f={deprecatedFreq:Ud(d,1,0),value:Ud(d,2,""),frequency:+Ud(d,3,0)};b&&(f.$jspbMessageInstance=d);return f} function Zi(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readUint64();Wd(b,1,f);break;case 2:f=d.readString();b.setValue(f);break;case 3:f=d.readDouble();Yd(b,3,f);break;default:id(d)}return b}Ef.prototype.serializeBinary=function(){var b=new ld;aj(this,b);return qd(b)};function aj(b,d){var f=Ud(b,1,0);0!==f&&d.writeUint64(1,f);f=b.getValue();0<f.length&&d.writeString(2,f);f=+Ud(b,3,0);0!==f&&d.writeDouble(3,f)}Ef.prototype.getValue=function(){return Ud(this,2,"")}; Ef.prototype.setValue=function(b){Xd(this,2,b,"")};Q=Cf.prototype;Q.getCommonStats=function(){return ue(this,Lf,1)};Q.setCommonStats=function(b){xe(this,1,b)};Q.clearCommonStats=function(){this.setCommonStats(void 0)};Q.hasCommonStats=function(){return null!=Sd(this,1)};Q.setUnique=function(b){Wd(this,2,b)};Q.getTopValuesList=function(){return ve(this,Ef,3)};Q.setTopValuesList=function(b){ze(this,3,b)};Q.addTopValues=function(b){return Ae(this,3,b,Ef)};Q.clearTopValuesList=function(){this.setTopValuesList([])}; Q.getRankHistogram=function(){return ue(this,Fg,5)};Q.setRankHistogram=function(b){xe(this,5,b)};Q.clearRankHistogram=function(){this.setRankHistogram(void 0)};Q.hasRankHistogram=function(){return null!=Sd(this,5)};Q.clearWeightedStringStats=function(){xe(this,6,void 0)};Q.hasWeightedStringStats=function(){return null!=Sd(this,6)};var Gf=[4];Q=Ff.prototype;Q.toObject=function(b){return ci(b,this)}; function ci(b,d){var f={mean:+Ud(d,1,0),stdDev:+Ud(d,2,0),median:+Ud(d,3,0),histogramsList:Rd(d.getHistogramsList(),Vh,b)};b&&(f.$jspbMessageInstance=d);return f}function Ui(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readDouble();b.setMean(f);break;case 2:f=d.readDouble();b.setStdDev(f);break;case 3:f=d.readDouble();b.setMedian(f);break;case 4:f=new Mf;jd(d,f,Xh);b.addHistograms(f);break;default:id(d)}return b}Q.serializeBinary=function(){var b=new ld;Wi(this,b);return qd(b)}; function Wi(b,d){var f=b.getMean();0!==f&&d.writeDouble(1,f);f=b.getStdDev();0!==f&&d.writeDouble(2,f);f=b.getMedian();0!==f&&d.writeDouble(3,f);f=b.getHistogramsList();0<f.length&&Cd(d,4,f,Zh)}Q.getMean=function(){return+Ud(this,1,0)};Q.setMean=function(b){Yd(this,1,b)};Q.getStdDev=function(){return+Ud(this,2,0)};Q.setStdDev=function(b){Yd(this,2,b)};Q.getMedian=function(){return+Ud(this,3,0)};Q.setMedian=function(b){Yd(this,3,b)};Q.getHistogramsList=function(){return ve(this,Mf,4)}; Q.setHistogramsList=function(b){ze(this,4,b)};Q.addHistograms=function(b){return Ae(this,4,b,Mf)};Q.clearHistogramsList=function(){this.setHistogramsList([])};var If=[1];Q=Hf.prototype;Q.toObject=function(b){return Yi(b,this)};function Yi(b,d){var f,h={topValuesList:Rd(d.getTopValuesList(),Xi,b),rankHistogram:(f=d.getRankHistogram())&&Wh(b,f)};b&&(h.$jspbMessageInstance=d);return h} function $i(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=new Ef;jd(d,f,Zi);b.addTopValues(f);break;case 2:f=new Fg;jd(d,f,Yh);b.setRankHistogram(f);break;default:id(d)}return b}Q.serializeBinary=function(){var b=new ld;bj(this,b);return qd(b)};function bj(b,d){var f=b.getTopValuesList();0<f.length&&Cd(d,1,f,aj);f=b.getRankHistogram();null!=f&&Bd(d,2,f,$h)}Q.getTopValuesList=function(){return ve(this,Ef,1)};Q.setTopValuesList=function(b){ze(this,1,b)}; Q.addTopValues=function(b){return Ae(this,1,b,Ef)};Q.clearTopValuesList=function(){this.setTopValuesList([])};Q.getRankHistogram=function(){return ue(this,Fg,2)};Q.setRankHistogram=function(b){xe(this,2,b)};Q.clearRankHistogram=function(){this.setRankHistogram(void 0)};Q.hasRankHistogram=function(){return null!=Sd(this,2)};Q=Jf.prototype;Q.toObject=function(b){return Eh(b,this)}; function Eh(b,d){var f,h={commonStats:(f=ai(d))&&bi(b,f),unique:Ud(d,2,0),avgNumBytes:+Ud(d,3,0),minNumBytes:+Ud(d,4,0),maxNumBytes:+Ud(d,5,0)};b&&(h.$jspbMessageInstance=d);return h}function Kh(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=new Lf;jd(d,f,Ti);b.setCommonStats(f);break;case 2:f=d.readUint64();b.setUnique(f);break;case 3:f=d.readFloat();Yd(b,3,f);break;case 4:f=d.readFloat();Yd(b,4,f);break;case 5:f=d.readFloat();Yd(b,5,f);break;default:id(d)}return b} Q.serializeBinary=function(){var b=new ld;Ph(this,b);return qd(b)};function Ph(b,d){var f=ai(b);null!=f&&Bd(d,1,f,Vi);f=Ud(b,2,0);0!==f&&d.writeUint64(2,f);f=+Ud(b,3,0);0!==f&&d.writeFloat(3,f);f=+Ud(b,4,0);0!==f&&d.writeFloat(4,f);f=+Ud(b,5,0);0!==f&&d.writeFloat(5,f)}Q.getCommonStats=function(){return ue(this,Lf,1)};Q.setCommonStats=function(b){xe(this,1,b)};Q.clearCommonStats=function(){this.setCommonStats(void 0)};Q.hasCommonStats=function(){return null!=Sd(this,1)}; Q.getUnique=function(){return Ud(this,2,0)};Q.setUnique=function(b){Wd(this,2,b)};Q=Kf.prototype;Q.toObject=function(b){return Fh(b,this)};function Fh(b,d){var f,h={commonStats:(f=ai(d))&&bi(b,f)};b&&(h.$jspbMessageInstance=d);return h}function Lh(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=new Lf;jd(d,f,Ti);b.setCommonStats(f);break;default:id(d)}return b}Q.serializeBinary=function(){var b=new ld;Qh(this,b);return qd(b)};function Qh(b,d){b=ai(b);null!=b&&Bd(d,1,b,Vi)} Q.getCommonStats=function(){return ue(this,Lf,1)};Q.setCommonStats=function(b){xe(this,1,b)};Q.clearCommonStats=function(){this.setCommonStats(void 0)};Q.hasCommonStats=function(){return null!=Sd(this,1)};Q=Lf.prototype;Q.toObject=function(b){return bi(b,this)}; function bi(b,d){var f,h={numNonMissing:Ud(d,1,0),numMissing:Ud(d,2,0),minNumValues:Ud(d,3,0),maxNumValues:Ud(d,4,0),avgNumValues:+Ud(d,5,0),totNumValues:Ud(d,8,0),numValuesHistogram:(f=ue(d,Mf,6))&&Vh(b,f),weightedCommonStats:(f=ue(d,xf,7))&&Sh(b,f),featureListLengthHistogram:(f=ue(d,Mf,9))&&Vh(b,f)};b&&(h.$jspbMessageInstance=d);return h} function Ti(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readUint64();b.setNumNonMissing(f);break;case 2:f=d.readUint64();b.setNumMissing(f);break;case 3:f=d.readUint64();Wd(b,3,f);break;case 4:f=d.readUint64();Wd(b,4,f);break;case 5:f=d.readFloat();b.setAvgNumValues(f);break;case 8:f=d.readUint64();b.setTotNumValues(f);break;case 6:f=new Mf;jd(d,f,Xh);xe(b,6,f);break;case 7:f=new xf;jd(d,f,Th);xe(b,7,f);break;case 9:f=new Mf;jd(d,f,Xh);xe(b,9,f);break;default:id(d)}return b} Q.serializeBinary=function(){var b=new ld;Vi(this,b);return qd(b)};function Vi(b,d){var f=b.getNumNonMissing();0!==f&&d.writeUint64(1,f);f=b.getNumMissing();0!==f&&d.writeUint64(2,f);f=Ud(b,3,0);0!==f&&d.writeUint64(3,f);f=Ud(b,4,0);0!==f&&d.writeUint64(4,f);f=b.getAvgNumValues();0!==f&&d.writeFloat(5,f);f=b.getTotNumValues();0!==f&&d.writeUint64(8,f);f=ue(b,Mf,6);null!=f&&Bd(d,6,f,Zh);f=ue(b,xf,7);null!=f&&Bd(d,7,f,Uh);f=ue(b,Mf,9);null!=f&&Bd(d,9,f,Zh)} Q.getNumNonMissing=function(){return Ud(this,1,0)};Q.setNumNonMissing=function(b){Wd(this,1,b)};Q.getNumMissing=function(){return Ud(this,2,0)};Q.setNumMissing=function(b){Wd(this,2,b)};Q.getAvgNumValues=function(){return+Ud(this,5,0)};Q.setAvgNumValues=function(b){Yd(this,5,b)};Q.getTotNumValues=function(){return Ud(this,8,0)};Q.setTotNumValues=function(b){Wd(this,8,b)};Q.clearNumValuesHistogram=function(){xe(this,6,void 0)};Q.hasNumValuesHistogram=function(){return null!=Sd(this,6)}; Q.clearWeightedCommonStats=function(){xe(this,7,void 0)};Q.hasWeightedCommonStats=function(){return null!=Sd(this,7)};Q.clearFeatureListLengthHistogram=function(){xe(this,9,void 0)};Q.hasFeatureListLengthHistogram=function(){return null!=Sd(this,9)};var Nf=[3];Mf.prototype.toObject=function(b){return Vh(b,this)};function Vh(b,d){var f={numNan:Ud(d,1,0),numUndefined:Ud(d,2,0),bucketsList:Rd(d.getBucketsList(),cj,b),type:Ud(d,4,0),name:Ud(d,5,"")};b&&(f.$jspbMessageInstance=d);return f} function Xh(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readUint64();Wd(b,1,f);break;case 2:f=d.readUint64();Wd(b,2,f);break;case 3:f=new Of;jd(d,f,dj);b.addBuckets(f);break;case 4:f=d.readEnum();b.setType(f);break;case 5:f=d.readString();b.setName(f);break;default:id(d)}return b}Mf.prototype.serializeBinary=function(){var b=new ld;Zh(this,b);return qd(b)}; function Zh(b,d){var f=Ud(b,1,0);0!==f&&d.writeUint64(1,f);f=Ud(b,2,0);0!==f&&d.writeUint64(2,f);f=b.getBucketsList();0<f.length&&Cd(d,3,f,ej);f=b.getType();0!==f&&d.writeEnum(4,f);f=b.getName();0<f.length&&d.writeString(5,f)}Q=Of.prototype;Q.toObject=function(b){return cj(b,this)};function cj(b,d){var f={lowValue:+Ud(d,1,0),highValue:+Ud(d,2,0),deprecatedCount:Ud(d,3,0),sampleCount:+Ud(d,4,0)};b&&(f.$jspbMessageInstance=d);return f} function dj(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readDouble();fj(b,f);break;case 2:f=d.readDouble();gj(b,f);break;case 3:f=d.readUint64();b.setDeprecatedCount(f);break;case 4:f=d.readDouble();b.setSampleCount(f);break;default:id(d)}return b}Q.serializeBinary=function(){var b=new ld;ej(this,b);return qd(b)}; function ej(b,d){var f=b.getLowValue();0!==f&&d.writeDouble(1,f);f=hj(b);0!==f&&d.writeDouble(2,f);f=Ud(b,3,0);0!==f&&d.writeUint64(3,f);f=b.getSampleCount();0!==f&&d.writeDouble(4,f)}Q.getLowValue=function(){return+Ud(this,1,0)};function fj(b,d){Yd(b,1,d)}function hj(b){return+Ud(b,2,0)}function gj(b,d){Yd(b,2,d)}Q.setDeprecatedCount=function(b){Wd(this,3,b)};Q.getSampleCount=function(){return+Ud(this,4,0)};Q.setSampleCount=function(b){Yd(this,4,b)};Q=Mf.prototype; Q.getBucketsList=function(){return ve(this,Of,3)};Q.setBucketsList=function(b){ze(this,3,b)};Q.addBuckets=function(b){return Ae(this,3,b,Of)};Q.clearBucketsList=function(){this.setBucketsList([])};Q.getType=function(){return Ud(this,4,0)};Q.setType=function(b){Xd(this,4,b,0)};Q.getName=function(){return Ud(this,5,"")};Q.setName=function(b){Xd(this,5,b,"")};var Gg=[1];Fg.prototype.toObject=function(b){return Wh(b,this)}; function Wh(b,d){var f={bucketsList:Rd(d.getBucketsList(),ij,b),name:Ud(d,2,"")};b&&(f.$jspbMessageInstance=d);return f}function Yh(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=new Hg;jd(d,f,jj);b.addBuckets(f);break;case 2:f=d.readString();b.setName(f);break;default:id(d)}return b}Fg.prototype.serializeBinary=function(){var b=new ld;$h(this,b);return qd(b)};function $h(b,d){var f=b.getBucketsList();0<f.length&&Cd(d,1,f,kj);f=b.getName();0<f.length&&d.writeString(2,f)}Q=Hg.prototype; Q.toObject=function(b){return ij(b,this)};function ij(b,d){var f={lowRank:Ud(d,1,0),highRank:Ud(d,2,0),deprecatedCount:Ud(d,3,0),label:Ud(d,4,""),sampleCount:+Ud(d,5,0)};b&&(f.$jspbMessageInstance=d);return f} function jj(b,d){for(;hd(d)&&!gd(d);)switch(d.nextField_){case 1:var f=d.readUint64();Wd(b,1,f);break;case 2:f=d.readUint64();Wd(b,2,f);break;case 3:f=d.readUint64();b.setDeprecatedCount(f);break;case 4:f=d.readString();Xd(b,4,f,"");break;case 5:f=d.readDouble();b.setSampleCount(f);break;default:id(d)}return b}Q.serializeBinary=function(){var b=new ld;kj(this,b);return qd(b)}; function kj(b,d){var f=Ud(b,1,0);0!==f&&d.writeUint64(1,f);f=Ud(b,2,0);0!==f&&d.writeUint64(2,f);f=Ud(b,3,0);0!==f&&d.writeUint64(3,f);f=lj(b);0<f.length&&d.writeString(4,f);f=b.getSampleCount();0!==f&&d.writeDouble(5,f)}Q.getDeprecatedCount=function(){return Ud(this,3,0)};Q.setDeprecatedCount=function(b){Wd(this,3,b)};function lj(b){return Ud(b,4,"")}Q.getSampleCount=function(){return+Ud(this,5,0)};Q.setSampleCount=function(b){Yd(this,5,b)};Q=Fg.prototype; Q.getBucketsList=function(){return ve(this,Hg,1)};Q.setBucketsList=function(b){ze(this,1,b)};Q.addBuckets=function(b){return Ae(this,1,b,Hg)};Q.clearBucketsList=function(){this.setBucketsList([])};Q.getName=function(){return Ud(this,2,"")};Q.setName=function(b){Xd(this,2,b,"")}; //~~WEBPATH~~external/com_google_javascript_closure_library/closure/goog/deps.js //~~WEBPATH~~/iron-meta/iron-meta.html.js (function(){Polymer.IronMeta=function(d){Polymer.IronMeta[" "](d);this.type=d&&d.type||"default";this.key=d&&d.key;d&&"value"in d&&(this.value=d.value)};Polymer.IronMeta[" "]=function(){};Polymer.IronMeta.types={};Polymer.IronMeta.prototype={get value(){var d=this.type,f=this.key;if(d&&f)return Polymer.IronMeta.types[d]&&Polymer.IronMeta.types[d][f]},set value(d){var f=this.type,h=this.key;f&&h&&(f=Polymer.IronMeta.types[f]=Polymer.IronMeta.types[f]||{},null==d?delete f[h]:f[h]=d)},get list(){if(this.type){var d= Polymer.IronMeta.types[this.type];return d?Object.keys(d).map(function(f){return b[this.type][f]},this):[]}},byKey:function(d){this.key=d;return this.value}};var b=Polymer.IronMeta.types;Polymer({is:"iron-meta",properties:{type:{type:String,value:"default"},key:{type:String},value:{type:String,notify:!0},self:{type:Boolean,observer:"_selfChanged"},__meta:{type:Boolean,computed:"__computeMeta(type, key, value)"}},hostAttributes:{hidden:!0},__computeMeta:function(d,f,h){d=new Polymer.IronMeta({type:d, key:f});void 0!==h&&h!==d.value?d.value=h:this.value!==d.value&&(this.value=d.value);return d},get list(){return this.__meta&&this.__meta.list},_selfChanged:function(d){d&&(this.value=this)},byKey:function(d){return(new Polymer.IronMeta({type:this.type,key:d})).value}})})(); </script> <script>//~~WEBPATH~~/iron-validatable-behavior/iron-validatable-behavior.html.js Polymer.IronValidatableBehaviorMeta=null; Polymer.IronValidatableBehavior={properties:{validator:{type:String},invalid:{notify:!0,reflectToAttribute:!0,type:Boolean,value:!1,observer:"_invalidChanged"}},registered:function(){Polymer.IronValidatableBehaviorMeta=new Polymer.IronMeta({type:"validator"})},_invalidChanged:function(){this.invalid?this.setAttribute("aria-invalid","true"):this.removeAttribute("aria-invalid")},get _validator(){return Polymer.IronValidatableBehaviorMeta&&Polymer.IronValidatableBehaviorMeta.byKey(this.validator)},hasValidator:function(){return null!= this._validator},validate:function(b){this.invalid=void 0===b&&void 0!==this.value?!this._getValidity(this.value):!this._getValidity(b);return!this.invalid},_getValidity:function(b){return this.hasValidator()?this._validator.validate(b):!0}}; </script> <script>//~~WEBPATH~~/iron-form-element-behavior/iron-form-element-behavior.html.js Polymer.IronFormElementBehavior={properties:{name:{type:String},value:{notify:!0,type:String},required:{type:Boolean,value:!1},_parentForm:{type:Object}},attached:function(){Polymer.Element||this.fire("iron-form-element-register")},detached:function(){!Polymer.Element&&this._parentForm&&this._parentForm.fire("iron-form-element-unregister",{target:this})}}; </script> <script>//~~WEBPATH~~/iron-checked-element-behavior/iron-checked-element-behavior.html.js Polymer.IronCheckedElementBehaviorImpl={properties:{checked:{type:Boolean,value:!1,reflectToAttribute:!0,notify:!0,observer:"_checkedChanged"},toggles:{type:Boolean,value:!0,reflectToAttribute:!0},value:{type:String,value:"on",observer:"_valueChanged"}},observers:["_requiredChanged(required)"],created:function(){this._hasIronCheckedElementBehavior=!0},_getValidity:function(){return this.disabled||!this.required||this.checked},_requiredChanged:function(){this.required?this.setAttribute("aria-required", "true"):this.removeAttribute("aria-required")},_checkedChanged:function(){this.active=this.checked;this.fire("iron-change")},_valueChanged:function(){if(void 0===this.value||null===this.value)this.value="on"}};Polymer.IronCheckedElementBehavior=[Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior,Polymer.IronCheckedElementBehaviorImpl]; </script> <script>//~~WEBPATH~~/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html.js (function(){function b(z,y){var x="";if(z)if(z=z.toLowerCase()," "===z||t.test(z))x="space";else if(v.test(z))x="esc";else if(1==z.length){if(!y||p.test(z))x=z}else x=q.test(z)?z.replace("arrow",""):"multiply"==z?"*":z;return x}function d(z,y){var x=z.hasModifiers;if(y.key)x=b(y.key,x);else if(y.detail&&y.detail.key)x=b(y.detail.key,x);else{x=y.keyIdentifier;var D="";x&&(x in m?D=m[x]:n.test(x)?(x=parseInt(x.replace("U+","0x"),16),D=String.fromCharCode(x).toLowerCase()):D=x.toLowerCase());(x=D)|| (x=y.keyCode,D="",Number(x)&&(D=65<=x&&90>=x?String.fromCharCode(32+x):112<=x&&123>=x?"f"+(x-112+1):48<=x&&57>=x?String(x-48):96<=x&&105>=x?String(x-96):w[x]),x=D);x=x||""}return x===z.key&&(!z.hasModifiers||!!y.shiftKey===!!z.shiftKey&&!!y.ctrlKey===!!z.ctrlKey&&!!y.altKey===!!z.altKey&&!!y.metaKey===!!z.metaKey)}function f(z){return 1===z.length?{combo:z,key:z,event:"keydown"}:z.split("+").reduce(function(y,x){var D=x.split(":");x=D[0];D=D[1];x in l?(y[l[x]]=!0,y.hasModifiers=!0):(y.key=x,y.event= D||"keydown");return y},{combo:z.split(":").shift()})}function h(z){return z.trim().split(" ").map(function(y){return f(y)})}var m={"U+0008":"backspace","U+0009":"tab","U+001B":"esc","U+0020":"space","U+007F":"del"},w={8:"backspace",9:"tab",13:"enter",27:"esc",33:"pageup",34:"pagedown",35:"end",36:"home",32:"space",37:"left",38:"up",39:"right",40:"down",46:"del",106:"*"},l={shift:"shiftKey",ctrl:"ctrlKey",alt:"altKey",meta:"metaKey"},p=/[a-z0-9*]/,n=/U\+/,q=/^arrow/,t=/^space(bar)?/,v=/^escape$/; Polymer.IronA11yKeysBehavior={properties:{keyEventTarget:{type:Object,value:function(){return this}},stopKeyboardEventPropagation:{type:Boolean,value:!1},_boundKeyHandlers:{type:Array,value:function(){return[]}},_imperativeKeyBindings:{type:Object,value:function(){return{}}}},observers:["_resetKeyEventListeners(keyEventTarget, _boundKeyHandlers)"],keyBindings:{},registered:function(){this._prepKeyBindings()},attached:function(){this._listenKeyEventListeners()},detached:function(){this._unlistenKeyEventListeners()}, addOwnKeyBinding:function(z,y){this._imperativeKeyBindings[z]=y;this._prepKeyBindings();this._resetKeyEventListeners()},removeOwnKeyBindings:function(){this._imperativeKeyBindings={};this._prepKeyBindings();this._resetKeyEventListeners()},keyboardEventMatchesKeys:function(z,y){y=h(y);for(var x=0;x<y.length;++x)if(d(y[x],z))return!0;return!1},_collectKeyBindings:function(){var z=this.behaviors.map(function(y){return y.keyBindings});-1===z.indexOf(this.keyBindings)&&z.push(this.keyBindings);return z}, _prepKeyBindings:function(){this._keyBindings={};this._collectKeyBindings().forEach(function(x){for(var D in x)this._addKeyBinding(D,x[D])},this);for(var z in this._imperativeKeyBindings)this._addKeyBinding(z,this._imperativeKeyBindings[z]);for(var y in this._keyBindings)this._keyBindings[y].sort(function(x,D){x=x[0].hasModifiers;return x===D[0].hasModifiers?0:x?-1:1})},_addKeyBinding:function(z,y){h(z).forEach(function(x){this._keyBindings[x.event]=this._keyBindings[x.event]||[];this._keyBindings[x.event].push([x, y])},this)},_resetKeyEventListeners:function(){this._unlistenKeyEventListeners();this.isAttached&&this._listenKeyEventListeners()},_listenKeyEventListeners:function(){this.keyEventTarget&&Object.keys(this._keyBindings).forEach(function(z){var y=this._onKeyBindingEvent.bind(this,this._keyBindings[z]);this._boundKeyHandlers.push([this.keyEventTarget,z,y]);this.keyEventTarget.addEventListener(z,y)},this)},_unlistenKeyEventListeners:function(){for(var z,y,x;this._boundKeyHandlers.length;)z=this._boundKeyHandlers.pop(), y=z[0],x=z[1],z=z[2],y.removeEventListener(x,z)},_onKeyBindingEvent:function(z,y){this.stopKeyboardEventPropagation&&y.stopPropagation();if(!y.defaultPrevented)for(var x=0;x<z.length;x++){var D=z[x][0],G=z[x][1];if(d(D,y)&&(this._triggerKeyHandler(D,G,y),y.defaultPrevented))break}},_triggerKeyHandler:function(z,y,x){var D=Object.create(z);D.keyboardEvent=x;z=new CustomEvent(z.event,{detail:D,cancelable:!0});this[y].call(this,z);z.defaultPrevented&&x.preventDefault()}}})(); </script> <script>//~~WEBPATH~~/iron-behaviors/iron-control-state.html.js Polymer.IronControlState={properties:{focused:{type:Boolean,value:!1,notify:!0,readOnly:!0,reflectToAttribute:!0},disabled:{type:Boolean,value:!1,notify:!0,observer:"_disabledChanged",reflectToAttribute:!0},_oldTabIndex:{type:String},_boundFocusBlurHandler:{type:Function,value:function(){return this._focusBlurHandler.bind(this)}},__handleEventRetargeting:{type:Boolean,value:function(){return!this.shadowRoot&&!Polymer.Element}}},observers:["_changedControlState(focused, disabled)"],ready:function(){this.addEventListener("focus", this._boundFocusBlurHandler,!0);this.addEventListener("blur",this._boundFocusBlurHandler,!0)},_focusBlurHandler:function(b){if(Polymer.Element)this._setFocused("focus"===b.type);else if(b.target===this)this._setFocused("focus"===b.type);else if(this.__handleEventRetargeting){var d=Polymer.dom(b).localTarget;this.isLightDescendant(d)||this.fire(b.type,{sourceEvent:b},{node:this,bubbles:b.bubbles,cancelable:b.cancelable})}},_disabledChanged:function(b){this.setAttribute("aria-disabled",b?"true":"false"); this.style.pointerEvents=b?"none":"";b?(this._oldTabIndex=this.getAttribute("tabindex"),this._setFocused(!1),this.tabIndex=-1,this.blur()):void 0!==this._oldTabIndex&&(null===this._oldTabIndex?this.removeAttribute("tabindex"):this.setAttribute("tabindex",this._oldTabIndex))},_changedControlState:function(){this._controlStateChanged&&this._controlStateChanged()}}; </script> <script>//~~WEBPATH~~/iron-behaviors/iron-button-state.html.js Polymer.IronButtonStateImpl={properties:{pressed:{type:Boolean,readOnly:!0,value:!1,reflectToAttribute:!0,observer:"_pressedChanged"},toggles:{type:Boolean,value:!1,reflectToAttribute:!0},active:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0},pointerDown:{type:Boolean,readOnly:!0,value:!1},receivedFocusFromKeyboard:{type:Boolean,readOnly:!0},ariaActiveAttribute:{type:String,value:"aria-pressed",observer:"_ariaActiveAttributeChanged"}},listeners:{down:"_downHandler",up:"_upHandler",tap:"_tapHandler"}, observers:["_focusChanged(focused)","_activeChanged(active, ariaActiveAttribute)"],keyBindings:{"enter:keydown":"_asyncClick","space:keydown":"_spaceKeyDownHandler","space:keyup":"_spaceKeyUpHandler"},_mouseEventRe:/^mouse/,_tapHandler:function(){this.toggles?this._userActivate(!this.active):this.active=!1},_focusChanged:function(b){this._detectKeyboardFocus(b);b||this._setPressed(!1)},_detectKeyboardFocus:function(b){this._setReceivedFocusFromKeyboard(!this.pointerDown&&b)},_userActivate:function(b){this.active!== b&&(this.active=b,this.fire("change"))},_downHandler:function(){this._setPointerDown(!0);this._setPressed(!0);this._setReceivedFocusFromKeyboard(!1)},_upHandler:function(){this._setPointerDown(!1);this._setPressed(!1)},_spaceKeyDownHandler:function(b){b=b.detail.keyboardEvent;var d=Polymer.dom(b).localTarget;this.isLightDescendant(d)||(b.preventDefault(),b.stopImmediatePropagation(),this._setPressed(!0))},_spaceKeyUpHandler:function(b){b=Polymer.dom(b.detail.keyboardEvent).localTarget;this.isLightDescendant(b)|| (this.pressed&&this._asyncClick(),this._setPressed(!1))},_asyncClick:function(){this.async(function(){this.click()},1)},_pressedChanged:function(){this._changedButtonState()},_ariaActiveAttributeChanged:function(b,d){d&&d!=b&&this.hasAttribute(d)&&this.removeAttribute(d)},_activeChanged:function(b){this.toggles?this.setAttribute(this.ariaActiveAttribute,b?"true":"false"):this.removeAttribute(this.ariaActiveAttribute);this._changedButtonState()},_controlStateChanged:function(){this.disabled?this._setPressed(!1): this._changedButtonState()},_changedButtonState:function(){this._buttonStateChanged&&this._buttonStateChanged()}};Polymer.IronButtonState=[Polymer.IronA11yKeysBehavior,Polymer.IronButtonStateImpl]; </script> <dom-module id="paper-ripple"> <template> <style> :host { display: block; position: absolute; border-radius: inherit; overflow: hidden; top: 0; left: 0; right: 0; bottom: 0; /* See PolymerElements/paper-behaviors/issues/34. On non-Chrome browsers, * creating a node (with a position:absolute) in the middle of an event * handler "interrupts" that event handler (which happens when the * ripple is created on demand) */ pointer-events: none; } :host([animating]) { /* This resolves a rendering issue in Chrome (as of 40) where the ripple is not properly clipped by its parent (which may have rounded corners). See: http://jsbin.com/temexa/4 Note: We only apply this style conditionally. Otherwise, the browser will create a new compositing layer for every ripple element on the page, and that would be bad. */ -webkit-transform: translate(0, 0); transform: translate3d(0, 0, 0); } #background, #waves, .wave-container, .wave { pointer-events: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; } #background, .wave { opacity: 0; } #waves, .wave { overflow: hidden; } .wave-container, .wave { border-radius: 50%; } :host(.circle) #background, :host(.circle) #waves { border-radius: 50%; } :host(.circle) .wave-container { overflow: hidden; } </style> <div id="background"></div> <div id="waves"></div> </template> </dom-module> <script>//~~WEBPATH~~/paper-ripple/paper-ripple.html.js (function(){function b(h){this.element=h;this.width=this.boundingRect.width;this.height=this.boundingRect.height;this.size=Math.max(this.width,this.height)}function d(h){this.element=h;this.color=window.getComputedStyle(h).color;this.wave=document.createElement("div");this.waveContainer=document.createElement("div");this.wave.style.backgroundColor=this.color;this.wave.classList.add("wave");this.waveContainer.classList.add("wave-container");Polymer.dom(this.waveContainer).appendChild(this.wave);this.resetInteractionState()} var f={distance:function(h,m,w,l){h-=w;m-=l;return Math.sqrt(h*h+m*m)},now:window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now};b.prototype={get boundingRect(){return this.element.getBoundingClientRect()},furthestCornerDistanceFrom:function(h,m){var w=f.distance(h,m,0,0),l=f.distance(h,m,this.width,0),p=f.distance(h,m,0,this.height);h=f.distance(h,m,this.width,this.height);return Math.max(w,l,p,h)}};d.MAX_RADIUS=300;d.prototype={get recenters(){return this.element.recenters}, get center(){return this.element.center},get mouseDownElapsed(){if(!this.mouseDownStart)return 0;var h=f.now()-this.mouseDownStart;this.mouseUpStart&&(h-=this.mouseUpElapsed);return h},get mouseUpElapsed(){return this.mouseUpStart?f.now()-this.mouseUpStart:0},get mouseDownElapsedSeconds(){return this.mouseDownElapsed/1E3},get mouseUpElapsedSeconds(){return this.mouseUpElapsed/1E3},get mouseInteractionSeconds(){return this.mouseDownElapsedSeconds+this.mouseUpElapsedSeconds},get initialOpacity(){return this.element.initialOpacity}, get opacityDecayVelocity(){return this.element.opacityDecayVelocity},get radius(){var h=1.1*Math.min(Math.sqrt(this.containerMetrics.width*this.containerMetrics.width+this.containerMetrics.height*this.containerMetrics.height),d.MAX_RADIUS)+5;return Math.abs(h*(1-Math.pow(80,-(this.mouseInteractionSeconds/(1.1-h/d.MAX_RADIUS*.2)))))},get opacity(){return this.mouseUpStart?Math.max(0,this.initialOpacity-this.mouseUpElapsedSeconds*this.opacityDecayVelocity):this.initialOpacity},get outerOpacity(){return Math.max(0, Math.min(.3*this.mouseUpElapsedSeconds,this.opacity))},get isOpacityFullyDecayed(){return.01>this.opacity&&this.radius>=Math.min(this.maxRadius,d.MAX_RADIUS)},get isRestingAtMaxRadius(){return this.opacity>=this.initialOpacity&&this.radius>=Math.min(this.maxRadius,d.MAX_RADIUS)},get isAnimationComplete(){return this.mouseUpStart?this.isOpacityFullyDecayed:this.isRestingAtMaxRadius},get translationFraction(){return Math.min(1,this.radius/this.containerMetrics.size*2/Math.sqrt(2))},get xNow(){return this.xEnd? this.xStart+this.translationFraction*(this.xEnd-this.xStart):this.xStart},get yNow(){return this.yEnd?this.yStart+this.translationFraction*(this.yEnd-this.yStart):this.yStart},get isMouseDown(){return this.mouseDownStart&&!this.mouseUpStart},resetInteractionState:function(){this.slideDistance=this.yEnd=this.xEnd=this.yStart=this.xStart=this.mouseUpStart=this.mouseDownStart=this.maxRadius=0;this.containerMetrics=new b(this.element)},draw:function(){this.wave.style.opacity=this.opacity;var h=this.radius/ (this.containerMetrics.size/2);var m=this.xNow-this.containerMetrics.width/2;var w=this.yNow-this.containerMetrics.height/2;this.waveContainer.style.webkitTransform="translate("+m+"px, "+w+"px)";this.waveContainer.style.transform="translate3d("+m+"px, "+w+"px, 0)";this.wave.style.webkitTransform="scale("+h+","+h+")";this.wave.style.transform="scale3d("+h+","+h+",1)"},downAction:function(h){var m=this.containerMetrics.width/2,w=this.containerMetrics.height/2;this.resetInteractionState();this.mouseDownStart= f.now();this.center?(this.xStart=m,this.yStart=w,this.slideDistance=f.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)):(this.xStart=h?h.detail.x-this.containerMetrics.boundingRect.left:this.containerMetrics.width/2,this.yStart=h?h.detail.y-this.containerMetrics.boundingRect.top:this.containerMetrics.height/2);this.recenters&&(this.xEnd=m,this.yEnd=w,this.slideDistance=f.distance(this.xStart,this.yStart,this.xEnd,this.yEnd));this.maxRadius=this.containerMetrics.furthestCornerDistanceFrom(this.xStart, this.yStart);this.waveContainer.style.top=(this.containerMetrics.height-this.containerMetrics.size)/2+"px";this.waveContainer.style.left=(this.containerMetrics.width-this.containerMetrics.size)/2+"px";this.waveContainer.style.width=this.containerMetrics.size+"px";this.waveContainer.style.height=this.containerMetrics.size+"px"},upAction:function(){this.isMouseDown&&(this.mouseUpStart=f.now())},remove:function(){Polymer.dom(this.waveContainer.parentNode).removeChild(this.waveContainer)}};Polymer({is:"paper-ripple", behaviors:[Polymer.IronA11yKeysBehavior],properties:{initialOpacity:{type:Number,value:.25},opacityDecayVelocity:{type:Number,value:.8},recenters:{type:Boolean,value:!1},center:{type:Boolean,value:!1},ripples:{type:Array,value:function(){return[]}},animating:{type:Boolean,readOnly:!0,reflectToAttribute:!0,value:!1},holdDown:{type:Boolean,value:!1,observer:"_holdDownChanged"},noink:{type:Boolean,value:!1},_animating:{type:Boolean},_boundAnimate:{type:Function,value:function(){return this.animate.bind(this)}}}, get target(){return this.keyEventTarget},keyBindings:{"enter:keydown":"_onEnterKeydown","space:keydown":"_onSpaceKeydown","space:keyup":"_onSpaceKeyup"},attached:function(){var h=this.keyEventTarget=11==this.parentNode.nodeType?Polymer.dom(this).getOwnerRoot().host:this.parentNode;this.listen(h,"up","uiUpAction");this.listen(h,"down","uiDownAction")},detached:function(){this.unlisten(this.keyEventTarget,"up","uiUpAction");this.unlisten(this.keyEventTarget,"down","uiDownAction");this.keyEventTarget= null},get shouldKeepAnimating(){for(var h=0;h<this.ripples.length;++h)if(!this.ripples[h].isAnimationComplete)return!0;return!1},simulatedRipple:function(){this.downAction(null);this.async(function(){this.upAction()},1)},uiDownAction:function(h){this.noink||this.downAction(h)},downAction:function(h){this.holdDown&&0<this.ripples.length||(this.addRipple().downAction(h),this._animating||(this._animating=!0,this.animate()))},uiUpAction:function(h){this.noink||this.upAction(h)},upAction:function(h){this.holdDown|| (this.ripples.forEach(function(m){m.upAction(h)}),this._animating=!0,this.animate())},onAnimationComplete:function(){this._animating=!1;this.$.background.style.backgroundColor=null;this.fire("transitionend")},addRipple:function(){var h=new d(this);Polymer.dom(this.$.waves).appendChild(h.waveContainer);this.$.background.style.backgroundColor=h.color;this.ripples.push(h);this._setAnimating(!0);return h},removeRipple:function(h){var m=this.ripples.indexOf(h);0>m||(this.ripples.splice(m,1),h.remove(), this.ripples.length||this._setAnimating(!1))},animate:function(){if(this._animating){var h;for(h=0;h<this.ripples.length;++h){var m=this.ripples[h];m.draw();this.$.background.style.opacity=m.outerOpacity;m.isOpacityFullyDecayed&&!m.isRestingAtMaxRadius&&this.removeRipple(m)}if(this.shouldKeepAnimating||0!==this.ripples.length)window.requestAnimationFrame(this._boundAnimate);else this.onAnimationComplete()}},_onEnterKeydown:function(){this.uiDownAction();this.async(this.uiUpAction,1)},_onSpaceKeydown:function(){this.uiDownAction()}, _onSpaceKeyup:function(){this.uiUpAction()},_holdDownChanged:function(h,m){void 0!==m&&(h?this.downAction():this.upAction())}})})(); </script> <script>//~~WEBPATH~~/paper-behaviors/paper-ripple-behavior.html.js Polymer.PaperRippleBehavior={properties:{noink:{type:Boolean,observer:"_noinkChanged"},_rippleContainer:{type:Object}},_buttonStateChanged:function(){this.focused&&this.ensureRipple()},_downHandler:function(b){Polymer.IronButtonStateImpl._downHandler.call(this,b);this.pressed&&this.ensureRipple(b)},ensureRipple:function(b){if(!this.hasRipple()){this._ripple=this._createRipple();this._ripple.noink=this.noink;var d=this._rippleContainer||this.root;d&&Polymer.dom(d).appendChild(this._ripple);if(b){d= Polymer.dom(this._rippleContainer||this);var f=Polymer.dom(b).rootTarget;d.deepContains(f)&&this._ripple.uiDownAction(b)}}},getRipple:function(){this.ensureRipple();return this._ripple},hasRipple:function(){return!!this._ripple},_createRipple:function(){return document.createElement("paper-ripple")},_noinkChanged:function(b){this.hasRipple()&&(this._ripple.noink=b)}}; </script> <script>//~~WEBPATH~~/paper-behaviors/paper-inky-focus-behavior.html.js Polymer.PaperInkyFocusBehaviorImpl={observers:["_focusedChanged(receivedFocusFromKeyboard)"],_focusedChanged:function(b){b&&this.ensureRipple();this.hasRipple()&&(this._ripple.holdDown=b)},_createRipple:function(){var b=Polymer.PaperRippleBehavior._createRipple();b.id="ink";b.setAttribute("center","");b.classList.add("circle");return b}};Polymer.PaperInkyFocusBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRippleBehavior,Polymer.PaperInkyFocusBehaviorImpl]; </script> <script>//~~WEBPATH~~/paper-behaviors/paper-checked-element-behavior.html.js Polymer.PaperCheckedElementBehaviorImpl={_checkedChanged:function(){Polymer.IronCheckedElementBehaviorImpl._checkedChanged.call(this);this.hasRipple()&&(this.checked?this._ripple.setAttribute("checked",""):this._ripple.removeAttribute("checked"))},_buttonStateChanged:function(){Polymer.PaperRippleBehavior._buttonStateChanged.call(this);!this.disabled&&this.isAttached&&(this.checked=this.active)}}; Polymer.PaperCheckedElementBehavior=[Polymer.PaperInkyFocusBehavior,Polymer.IronCheckedElementBehavior,Polymer.PaperCheckedElementBehaviorImpl]; </script> <dom-module id="paper-checkbox"> <template strip-whitespace> <style> :host { display: inline-block; white-space: nowrap; cursor: pointer; --calculated-paper-checkbox-size: var(--paper-checkbox-size, 18px); /* -1px is a sentinel for the default and is replaced in `attached`. */ --calculated-paper-checkbox-ink-size: var(--paper-checkbox-ink-size, -1px); @apply --paper-font-common-base; line-height: 0; -webkit-tap-highlight-color: transparent; } :host([hidden]) { display: none !important; } :host(:focus) { outline: none; } .hidden { display: none; } #checkboxContainer { display: inline-block; position: relative; width: var(--calculated-paper-checkbox-size); height: var(--calculated-paper-checkbox-size); min-width: var(--calculated-paper-checkbox-size); margin: var(--paper-checkbox-margin, initial); vertical-align: var(--paper-checkbox-vertical-align, middle); background-color: var(--paper-checkbox-unchecked-background-color, transparent); } #ink { position: absolute; /* Center the ripple in the checkbox by negative offsetting it by * (inkWidth - rippleWidth) / 2 */ top: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2); left: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2); width: var(--calculated-paper-checkbox-ink-size); height: var(--calculated-paper-checkbox-ink-size); color: var(--paper-checkbox-unchecked-ink-color, var(--primary-text-color)); opacity: 0.6; pointer-events: none; } #ink:dir(rtl) { right: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2); left: auto; } #ink[checked] { color: var(--paper-checkbox-checked-ink-color, var(--primary-color)); } #checkbox { position: relative; box-sizing: border-box; height: 100%; border: solid 2px; border-color: var(--paper-checkbox-unchecked-color, var(--primary-text-color)); border-radius: 2px; pointer-events: none; -webkit-transition: background-color 140ms, border-color 140ms; transition: background-color 140ms, border-color 140ms; } /* checkbox checked animations */ #checkbox.checked #checkmark { -webkit-animation: checkmark-expand 140ms ease-out forwards; animation: checkmark-expand 140ms ease-out forwards; } @-webkit-keyframes checkmark-expand { 0% { -webkit-transform: scale(0, 0) rotate(45deg); } 100% { -webkit-transform: scale(1, 1) rotate(45deg); } } @keyframes checkmark-expand { 0% { transform: scale(0, 0) rotate(45deg); } 100% { transform: scale(1, 1) rotate(45deg); } } #checkbox.checked { background-color: var(--paper-checkbox-checked-color, var(--primary-color)); border-color: var(--paper-checkbox-checked-color, var(--primary-color)); } #checkmark { position: absolute; width: 36%; height: 70%; border-style: solid; border-top: none; border-left: none; border-right-width: calc(2/15 * var(--calculated-paper-checkbox-size)); border-bottom-width: calc(2/15 * var(--calculated-paper-checkbox-size)); border-color: var(--paper-checkbox-checkmark-color, white); -webkit-transform-origin: 97% 86%; transform-origin: 97% 86%; box-sizing: content-box; /* protect against page-level box-sizing */ } #checkmark:dir(rtl) { -webkit-transform-origin: 50% 14%; transform-origin: 50% 14%; } /* label */ #checkboxLabel { position: relative; display: inline-block; vertical-align: middle; padding-left: var(--paper-checkbox-label-spacing, 8px); white-space: normal; line-height: normal; color: var(--paper-checkbox-label-color, var(--primary-text-color)); @apply --paper-checkbox-label; } :host([checked]) #checkboxLabel { color: var(--paper-checkbox-label-checked-color, var(--paper-checkbox-label-color, var(--primary-text-color))); @apply --paper-checkbox-label-checked; } #checkboxLabel:dir(rtl) { padding-right: var(--paper-checkbox-label-spacing, 8px); padding-left: 0; } #checkboxLabel[hidden] { display: none; } /* disabled state */ :host([disabled]) #checkbox { opacity: 0.5; border-color: var(--paper-checkbox-unchecked-color, var(--primary-text-color)); } :host([disabled][checked]) #checkbox { background-color: var(--paper-checkbox-unchecked-color, var(--primary-text-color)); opacity: 0.5; } :host([disabled]) #checkboxLabel { opacity: 0.65; } /* invalid state */ #checkbox.invalid:not(.checked) { border-color: var(--paper-checkbox-error-color, var(--error-color)); } </style> <div id="checkboxContainer"> <div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]"> <div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div> </div> </div> <div id="checkboxLabel"><slot></slot></div> </template> <script>//~~WEBPATH~~/paper-checkbox/paper-checkbox.html.js Polymer({is:"paper-checkbox",behaviors:[Polymer.PaperCheckedElementBehavior],hostAttributes:{role:"checkbox","aria-checked":!1,tabindex:0},properties:{ariaActiveAttribute:{type:String,value:"aria-checked"}},attached:function(){Polymer.RenderStatus.afterNextRender(this,function(){if("-1px"===this.getComputedStyleValue("--calculated-paper-checkbox-ink-size").trim()){var b=this.getComputedStyleValue("--calculated-paper-checkbox-size").trim(),d="px",f=b.match(/[A-Za-z]+$/);null!==f&&(d=f[0]);b=parseFloat(b); f=8/3*b;"px"===d&&(f=Math.floor(f),f%2!==b%2&&f++);this.updateStyles({"--paper-checkbox-ink-size":f+d})}})},_computeCheckboxClass:function(b,d){var f="";b&&(f+="checked ");d&&(f+="invalid");return f},_computeCheckmarkClass:function(b){return b?"":"hidden"},_createRipple:function(){this._rippleContainer=this.$.checkboxContainer;return Polymer.PaperInkyFocusBehaviorImpl._createRipple.call(this)}}); </script> </dom-module> <script>//~~WEBPATH~~/iron-flex-layout/iron-flex-layout.html.js var mj=document.createElement("style");mj.textContent="[hidden] { display: none !important; }";document.head.appendChild(mj); </script> <custom-style> <style is="custom-style"> [hidden] { display: none !important; } </style> </custom-style> <custom-style> <style is="custom-style"> html { --layout: { display: -ms-flexbox; display: -webkit-flex; display: flex; }; --layout-inline: { display: -ms-inline-flexbox; display: -webkit-inline-flex; display: inline-flex; }; --layout-horizontal: { @apply --layout; -ms-flex-direction: row; -webkit-flex-direction: row; flex-direction: row; }; --layout-horizontal-reverse: { @apply --layout; -ms-flex-direction: row-reverse; -webkit-flex-direction: row-reverse; flex-direction: row-reverse; }; --layout-vertical: { @apply --layout; -ms-flex-direction: column; -webkit-flex-direction: column; flex-direction: column; }; --layout-vertical-reverse: { @apply --layout; -ms-flex-direction: column-reverse; -webkit-flex-direction: column-reverse; flex-direction: column-reverse; }; --layout-wrap: { -ms-flex-wrap: wrap; -webkit-flex-wrap: wrap; flex-wrap: wrap; }; --layout-wrap-reverse: { -ms-flex-wrap: wrap-reverse; -webkit-flex-wrap: wrap-reverse; flex-wrap: wrap-reverse; }; --layout-flex-auto: { -ms-flex: 1 1 auto; -webkit-flex: 1 1 auto; flex: 1 1 auto; }; --layout-flex-none: { -ms-flex: none; -webkit-flex: none; flex: none; }; --layout-flex: { -ms-flex: 1 1 0.000000001px; -webkit-flex: 1; flex: 1; -webkit-flex-basis: 0.000000001px; flex-basis: 0.000000001px; }; --layout-flex-2: { -ms-flex: 2; -webkit-flex: 2; flex: 2; }; --layout-flex-3: { -ms-flex: 3; -webkit-flex: 3; flex: 3; }; --layout-flex-4: { -ms-flex: 4; -webkit-flex: 4; flex: 4; }; --layout-flex-5: { -ms-flex: 5; -webkit-flex: 5; flex: 5; }; --layout-flex-6: { -ms-flex: 6; -webkit-flex: 6; flex: 6; }; --layout-flex-7: { -ms-flex: 7; -webkit-flex: 7; flex: 7; }; --layout-flex-8: { -ms-flex: 8; -webkit-flex: 8; flex: 8; }; --layout-flex-9: { -ms-flex: 9; -webkit-flex: 9; flex: 9; }; --layout-flex-10: { -ms-flex: 10; -webkit-flex: 10; flex: 10; }; --layout-flex-11: { -ms-flex: 11; -webkit-flex: 11; flex: 11; }; --layout-flex-12: { -ms-flex: 12; -webkit-flex: 12; flex: 12; }; /* alignment in cross axis */ --layout-start: { -ms-flex-align: start; -webkit-align-items: flex-start; align-items: flex-start; }; --layout-center: { -ms-flex-align: center; -webkit-align-items: center; align-items: center; }; --layout-end: { -ms-flex-align: end; -webkit-align-items: flex-end; align-items: flex-end; }; --layout-baseline: { -ms-flex-align: baseline; -webkit-align-items: baseline; align-items: baseline; }; /* alignment in main axis */ --layout-start-justified: { -ms-flex-pack: start; -webkit-justify-content: flex-start; justify-content: flex-start; }; --layout-center-justified: { -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; }; --layout-end-justified: { -ms-flex-pack: end; -webkit-justify-content: flex-end; justify-content: flex-end; }; --layout-around-justified: { -ms-flex-pack: distribute; -webkit-justify-content: space-around; justify-content: space-around; }; --layout-justified: { -ms-flex-pack: justify; -webkit-justify-content: space-between; justify-content: space-between; }; --layout-center-center: { @apply --layout-center; @apply --layout-center-justified; }; /* self alignment */ --layout-self-start: { -ms-align-self: flex-start; -webkit-align-self: flex-start; align-self: flex-start; }; --layout-self-center: { -ms-align-self: center; -webkit-align-self: center; align-self: center; }; --layout-self-end: { -ms-align-self: flex-end; -webkit-align-self: flex-end; align-self: flex-end; }; --layout-self-stretch: { -ms-align-self: stretch; -webkit-align-self: stretch; align-self: stretch; }; --layout-self-baseline: { -ms-align-self: baseline; -webkit-align-self: baseline; align-self: baseline; }; /* multi-line alignment in main axis */ --layout-start-aligned: { -ms-flex-line-pack: start; /* IE10 */ -ms-align-content: flex-start; -webkit-align-content: flex-start; align-content: flex-start; }; --layout-end-aligned: { -ms-flex-line-pack: end; /* IE10 */ -ms-align-content: flex-end; -webkit-align-content: flex-end; align-content: flex-end; }; --layout-center-aligned: { -ms-flex-line-pack: center; /* IE10 */ -ms-align-content: center; -webkit-align-content: center; align-content: center; }; --layout-between-aligned: { -ms-flex-line-pack: justify; /* IE10 */ -ms-align-content: space-between; -webkit-align-content: space-between; align-content: space-between; }; --layout-around-aligned: { -ms-flex-line-pack: distribute; /* IE10 */ -ms-align-content: space-around; -webkit-align-content: space-around; align-content: space-around; }; /******************************* Other Layout *******************************/ --layout-block: { display: block; }; --layout-invisible: { visibility: hidden !important; }; --layout-relative: { position: relative; }; --layout-fit: { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }; --layout-scroll: { -webkit-overflow-scrolling: touch; overflow: auto; }; --layout-fullbleed: { margin: 0; height: 100vh; }; /* fixed position */ --layout-fixed-top: { position: fixed; top: 0; left: 0; right: 0; }; --layout-fixed-right: { position: fixed; top: 0; right: 0; bottom: 0; }; --layout-fixed-bottom: { position: fixed; right: 0; bottom: 0; left: 0; }; --layout-fixed-left: { position: fixed; top: 0; bottom: 0; left: 0; }; } </style> </custom-style> <dom-module id="iron-icon"> <template> <style> :host { @apply --layout-inline; @apply --layout-center-center; position: relative; vertical-align: middle; fill: var(--iron-icon-fill-color, currentcolor); stroke: var(--iron-icon-stroke-color, none); width: var(--iron-icon-width, 24px); height: var(--iron-icon-height, 24px); @apply --iron-icon; } :host([hidden]) { display: none; } </style> </template> <script>//~~WEBPATH~~/iron-icon/iron-icon.html.js Polymer({is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:Polymer.Base.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(b){b=(b||"").split(":");this._iconName=b.pop();this._iconsetName=b.pop()||this._DEFAULT_ICONSET;this._updateIcon()},_srcChanged:function(){this._updateIcon()}, _usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){this._usesIconset()?(this._img&&this._img.parentNode&&Polymer.dom(this.root).removeChild(this._img),""===this._iconName?this._iconset&&this._iconset.removeIcon(this):this._iconsetName&&this._meta&&((this._iconset=this._meta.byKey(this._iconsetName))?(this._iconset.applyIcon(this,this._iconName,this.theme),this.unlisten(window,"iron-iconset-added","_updateIcon")):this.listen(window,"iron-iconset-added","_updateIcon"))):(this._iconset&& this._iconset.removeIcon(this),this._img||(this._img=document.createElement("img"),this._img.style.width="100%",this._img.style.height="100%",this._img.draggable=!1),this._img.src=this.src,Polymer.dom(this.root).appendChild(this._img))}}); </script> </dom-module> <dom-module id="iron-a11y-announcer"> <template> <style> :host { display: inline-block; position: fixed; clip: rect(0px,0px,0px,0px); } </style> <div aria-live$="[[mode]]">[[_text]]</div> </template> <script>//~~WEBPATH~~/iron-a11y-announcer/iron-a11y-announcer.html.js Polymer.IronA11yAnnouncer=function(){};Polymer.IronA11yAnnouncer=Polymer({is:"iron-a11y-announcer",properties:{mode:{type:String,value:"polite"},_text:{type:String,value:""}},created:function(){Polymer.IronA11yAnnouncer.instance||(Polymer.IronA11yAnnouncer.instance=this);document.body.addEventListener("iron-announce",this._onIronAnnounce.bind(this))},announce:function(b){this._text="";this.async(function(){this._text=b},100)},_onIronAnnounce:function(b){b.detail&&b.detail.text&&this.announce(b.detail.text)}}); Polymer.IronA11yAnnouncer.instance=null;Polymer.IronA11yAnnouncer.requestAvailability=function(){Polymer.IronA11yAnnouncer.instance||(Polymer.IronA11yAnnouncer.instance=document.createElement("iron-a11y-announcer"));document.body.appendChild(Polymer.IronA11yAnnouncer.instance)}; </script> </dom-module> <dom-module id="iron-input"> <template> <style> :host { display: inline-block; } </style> <slot id="content"></slot> </template> <script>//~~WEBPATH~~/iron-input/iron-input.html.js Polymer({is:"iron-input",behaviors:[Polymer.IronValidatableBehavior],properties:{bindValue:{type:String,value:""},value:{type:String,computed:"_computeValue(bindValue)"},allowedPattern:{type:String},autoValidate:{type:Boolean,value:!1},_inputElement:Object},observers:["_bindValueChanged(bindValue, _inputElement)"],listeners:{input:"_onInput",keypress:"_onKeypress"},created:function(){Polymer.IronA11yAnnouncer.requestAvailability();this._previousValidInput="";this._patternAlreadyChecked=!1},attached:function(){this._observer= Polymer.dom(this).observeNodes(function(){this._initSlottedInput()}.bind(this))},detached:function(){this._observer&&(Polymer.dom(this).unobserveNodes(this._observer),this._observer=null)},get inputElement(){return this._inputElement},_initSlottedInput:function(){this._inputElement=this.getEffectiveChildren()[0];this.inputElement&&this.inputElement.value&&(this.bindValue=this.inputElement.value);this.fire("iron-input-ready")},get _patternRegExp(){if(this.allowedPattern)var b=new RegExp(this.allowedPattern); else switch(this.inputElement.type){case "number":b=/[0-9.,e-]/}return b},_bindValueChanged:function(b,d){d&&(void 0===b?d.value=null:b!==d.value&&(this.inputElement.value=b),this.autoValidate&&this.validate(),this.fire("bind-value-changed",{value:b}))},_onInput:function(){!this.allowedPattern||this._patternAlreadyChecked||this._checkPatternValidity()||(this._announceInvalidCharacter("Invalid string of characters not entered."),this.inputElement.value=this._previousValidInput);this.bindValue=this._previousValidInput= this.inputElement.value;this._patternAlreadyChecked=!1},_isPrintable:function(b){var d=19==b.keyCode||20==b.keyCode||45==b.keyCode||46==b.keyCode||144==b.keyCode||145==b.keyCode||32<b.keyCode&&41>b.keyCode||111<b.keyCode&&124>b.keyCode;return!(8==b.keyCode||9==b.keyCode||13==b.keyCode||27==b.keyCode)&&!(0==b.charCode&&d)},_onKeypress:function(b){if(this.allowedPattern||"number"===this.inputElement.type){var d=this._patternRegExp;if(d&&!(b.metaKey||b.ctrlKey||b.altKey)){this._patternAlreadyChecked= !0;var f=String.fromCharCode(b.charCode);this._isPrintable(b)&&!d.test(f)&&(b.preventDefault(),this._announceInvalidCharacter("Invalid character "+f+" not entered."))}}},_checkPatternValidity:function(){var b=this._patternRegExp;if(!b)return!0;for(var d=0;d<this.inputElement.value.length;d++)if(!b.test(this.inputElement.value[d]))return!1;return!0},validate:function(){if(!this.inputElement)return this.invalid=!1,!0;var b=this.inputElement.checkValidity();b&&(this.required&&""===this.bindValue?b=!1: this.hasValidator()&&(b=Polymer.IronValidatableBehavior.validate.call(this,this.bindValue)));this.invalid=!b;this.fire("iron-input-validate");return b},_announceInvalidCharacter:function(b){this.fire("iron-announce",{text:b})},_computeValue:function(b){return b}}); </script> </dom-module> <script>//~~WEBPATH~~/paper-input/paper-input-behavior.html.js Polymer.PaperInputHelper={};Polymer.PaperInputHelper.NextLabelID=1;Polymer.PaperInputHelper.NextAddonID=1;Polymer.PaperInputHelper.NextInputID=1; Polymer.PaperInputBehaviorImpl={properties:{label:{type:String},value:{notify:!0,type:String},disabled:{type:Boolean,value:!1},invalid:{type:Boolean,value:!1,notify:!0},allowedPattern:{type:String},type:{type:String},list:{type:String},pattern:{type:String},required:{type:Boolean,value:!1},errorMessage:{type:String},charCounter:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1},alwaysFloatLabel:{type:Boolean,value:!1},autoValidate:{type:Boolean,value:!1},validator:{type:String},autocomplete:{type:String, value:"off"},autofocus:{type:Boolean,observer:"_autofocusChanged"},inputmode:{type:String},minlength:{type:Number},maxlength:{type:Number},min:{type:String},max:{type:String},step:{type:String},name:{type:String},placeholder:{type:String,value:""},readonly:{type:Boolean,value:!1},size:{type:Number},autocapitalize:{type:String,value:"none"},autocorrect:{type:String,value:"off"},autosave:{type:String},results:{type:Number},accept:{type:String},multiple:{type:Boolean},_ariaDescribedBy:{type:String,value:""}, _ariaLabelledBy:{type:String,value:""},_inputId:{type:String,value:""}},listeners:{"addon-attached":"_onAddonAttached"},keyBindings:{"shift+tab:keydown":"_onShiftTabDown"},hostAttributes:{tabindex:0},get inputElement(){this.$||(this.$={});this.$.input||(this._generateInputId(),this.$.input=this.$$("#"+this._inputId));return this.$.input},get _focusableElement(){return this.inputElement},created:function(){this._typesThatHaveText="date datetime datetime-local month time week file".split(" ")},attached:function(){this._updateAriaLabelledBy(); !Polymer.Element&&this.inputElement&&-1!==this._typesThatHaveText.indexOf(this.inputElement.type)&&(this.alwaysFloatLabel=!0)},_appendStringWithSpace:function(b,d){return b?b+" "+d:d},_onAddonAttached:function(b){b=Polymer.dom(b).rootTarget;if(b.id)this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribedBy,b.id);else{var d="paper-input-add-on-"+Polymer.PaperInputHelper.NextAddonID++;b.id=d;this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribedBy,d)}},validate:function(){return this.inputElement.validate()}, _focusBlurHandler:function(b){Polymer.IronControlState._focusBlurHandler.call(this,b);this.focused&&!this._shiftTabPressed&&this._focusableElement&&this._focusableElement.focus()},_onShiftTabDown:function(){var b=this.getAttribute("tabindex");this._shiftTabPressed=!0;this.setAttribute("tabindex","-1");this.async(function(){this.setAttribute("tabindex",b);this._shiftTabPressed=!1},1)},_handleAutoValidate:function(){this.autoValidate&&this.validate()},updateValueAndPreserveCaret:function(b){try{var d= this.inputElement.selectionStart;this.value=b;this.inputElement.selectionStart=d;this.inputElement.selectionEnd=d}catch(f){this.value=b}},_computeAlwaysFloatLabel:function(b,d){return d||b},_updateAriaLabelledBy:function(){var b=Polymer.dom(this.root).querySelector("label");if(b){if(b.id)var d=b.id;else d="paper-input-label-"+Polymer.PaperInputHelper.NextLabelID++,b.id=d;this._ariaLabelledBy=d}else this._ariaLabelledBy=""},_generateInputId:function(){this._inputId&&""!==this._inputId||(this._inputId= "input-"+Polymer.PaperInputHelper.NextInputID++)},_onChange:function(b){this.shadowRoot&&this.fire(b.type,{sourceEvent:b},{node:this,bubbles:b.bubbles,cancelable:b.cancelable})},_autofocusChanged:function(){if(this.autofocus&&this._focusableElement){var b=document.activeElement;b instanceof HTMLElement&&b!==document.body&&b!==document.documentElement||this._focusableElement.focus()}}};Polymer.PaperInputBehavior=[Polymer.IronControlState,Polymer.IronA11yKeysBehavior,Polymer.PaperInputBehaviorImpl]; </script> <style> @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(/font-roboto/uYECMKoHcO9x1wdmbyHIm3-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(/font-roboto/sTdaA6j0Psb920Vjv-mrzH-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(/font-roboto/_VYFx-s824kXq_Ul2BHqYH-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(/font-roboto/tnj4SB6DNbdaQnsM8CFqBX-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(/font-roboto/oMMgfZMQthOryQo9n22dcuvvDin1pK8aKteLpeZ5c0A.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(/font-roboto/Ks_cVxiCiwUWVsFWFA3Bjn-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(/font-roboto/NJ4vxlgWwWbEsv18dAhqnn-_kf6ByYO6CLYdB4HQE-Y.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'), url(/font-roboto/isZ-wbCXNKAbnjo6_TwHToX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'), url(/font-roboto/77FXFjRbGzN4aCrSFhlh3oX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'), url(/font-roboto/jSN2CGVDbcVyCnfJfjSdfIX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'), url(/font-roboto/UX6i4JxQDm3fVTc1CPuwqoX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'), url(/font-roboto/d-6IYplOFocCacKzxwXSOJBw1xU1rKptJj_0jans920.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'), url(/font-roboto/97uahxiqZRoncBaCEI3aW4X0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; src: local('Roboto Bold'), local('Roboto-Bold'), url(/font-roboto/PwZc-YbIL414wB9rB1IAPYX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 700; src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), url(/font-roboto/t6Nd4cfPRhZP44Q5QAjcC14sYYdJg5dU2qzJEVSuta0.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 700; src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), url(/font-roboto/t6Nd4cfPRhZP44Q5QAjcC_ZraR2Tg8w2lzm7kLNL0-w.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 700; src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), url(/font-roboto/t6Nd4cfPRhZP44Q5QAjcCwt_Rm691LTebKfY2ZkKSmI.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 700; src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), url(/font-roboto/t6Nd4cfPRhZP44Q5QAjcC1BW26QxpSj-_ZKm_xT4hWw.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 700; src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), url(/font-roboto/t6Nd4cfPRhZP44Q5QAjcC4gp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 700; src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), url(/font-roboto/t6Nd4cfPRhZP44Q5QAjcC6E8kM4xWR1_1bYURRojRGc.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 700; src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), url(/font-roboto/t6Nd4cfPRhZP44Q5QAjcC9DiNsR5a-9Oe_Ivpu8XWlY.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; src: local('Roboto Italic'), local('Roboto-Italic'), url(/font-roboto/OpXUqTo0UgQQhGj_SFdLWBkAz4rYn47Zy2rvigWQf6w.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; src: local('Roboto Italic'), local('Roboto-Italic'), url(/font-roboto/WxrXJa0C3KdtC7lMafG4dRkAz4rYn47Zy2rvigWQf6w.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; src: local('Roboto Italic'), local('Roboto-Italic'), url(/font-roboto/cDKhRaXnQTOVbaoxwdOr9xkAz4rYn47Zy2rvigWQf6w.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; src: local('Roboto Italic'), local('Roboto-Italic'), url(/font-roboto/1hZf02POANh32k2VkgEoUBkAz4rYn47Zy2rvigWQf6w.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; src: local('Roboto Italic'), local('Roboto-Italic'), url(/font-roboto/vPcynSL0qHq_6dX7lKVByXYhjbSpvc47ee6xR_80Hnw.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; src: local('Roboto Italic'), local('Roboto-Italic'), url(/font-roboto/vSzulfKSK0LLjjfeaxcREhkAz4rYn47Zy2rvigWQf6w.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; src: local('Roboto Italic'), local('Roboto-Italic'), url(/font-roboto/K23cxWVTrIFD6DJsEVi07RkAz4rYn47Zy2rvigWQf6w.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 300; src: local('Roboto Light'), local('Roboto-Light'), url(/font-roboto/Fl4y0QdOxyyTHEGMXX8kcYX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 300; src: local('Roboto Light'), local('Roboto-Light'), url(/font-roboto/0eC6fl06luXEYWpBSJvXCIX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 300; src: local('Roboto Light'), local('Roboto-Light'), url(/font-roboto/I3S1wsgSg9YCurV6PUkTOYX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 300; src: local('Roboto Light'), local('Roboto-Light'), url(/font-roboto/-L14Jk06m6pUHB-5mXQQnYX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 300; src: local('Roboto Light'), local('Roboto-Light'), url(/font-roboto/Hgo13k-tfSpn0qi1SFdUfZBw1xU1rKptJj_0jans920.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 300; src: local('Roboto Light'), local('Roboto-Light'), url(/font-roboto/Pru33qjShpZSmG3z6VYwnYX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 300; src: local('Roboto Light'), local('Roboto-Light'), url(/font-roboto/NYDWBdD4gIq26G5XYbHsFIX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 300; src: local('Roboto Light Italic'), local('Roboto-LightItalic'), url(/font-roboto/7m8l7TlFO-S3VkhHuR0at14sYYdJg5dU2qzJEVSuta0.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 300; src: local('Roboto Light Italic'), local('Roboto-LightItalic'), url(/font-roboto/7m8l7TlFO-S3VkhHuR0at_ZraR2Tg8w2lzm7kLNL0-w.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 300; src: local('Roboto Light Italic'), local('Roboto-LightItalic'), url(/font-roboto/7m8l7TlFO-S3VkhHuR0atwt_Rm691LTebKfY2ZkKSmI.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 300; src: local('Roboto Light Italic'), local('Roboto-LightItalic'), url(/font-roboto/7m8l7TlFO-S3VkhHuR0at1BW26QxpSj-_ZKm_xT4hWw.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 300; src: local('Roboto Light Italic'), local('Roboto-LightItalic'), url(/font-roboto/7m8l7TlFO-S3VkhHuR0at4gp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 300; src: local('Roboto Light Italic'), local('Roboto-LightItalic'), url(/font-roboto/7m8l7TlFO-S3VkhHuR0at6E8kM4xWR1_1bYURRojRGc.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 300; src: local('Roboto Light Italic'), local('Roboto-LightItalic'), url(/font-roboto/7m8l7TlFO-S3VkhHuR0at9DiNsR5a-9Oe_Ivpu8XWlY.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; src: local('Roboto Medium'), local('Roboto-Medium'), url(/font-roboto/oHi30kwQWvpCWqAhzHcCSIX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; src: local('Roboto Medium'), local('Roboto-Medium'), url(/font-roboto/ZLqKeelYbATG60EpZBSDy4X0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; src: local('Roboto Medium'), local('Roboto-Medium'), url(/font-roboto/mx9Uck6uB63VIKFYnEMXrYX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; src: local('Roboto Medium'), local('Roboto-Medium'), url(/font-roboto/rGvHdJnr2l75qb0YND9NyIX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; src: local('Roboto Medium'), local('Roboto-Medium'), url(/font-roboto/RxZJdnzeo3R5zSexge8UUZBw1xU1rKptJj_0jans920.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; src: local('Roboto Medium'), local('Roboto-Medium'), url(/font-roboto/oOeFwZNlrTefzLYmlVV1UIX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; src: local('Roboto Medium'), local('Roboto-Medium'), url(/font-roboto/mbmhprMH69Zi6eEPBYVFhYX0hVgzZQUfRDuZrPvH3D8.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 500; src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), url(/font-roboto/OLffGBTaF0XFOW1gnuHF0V4sYYdJg5dU2qzJEVSuta0.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 500; src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), url(/font-roboto/OLffGBTaF0XFOW1gnuHF0fZraR2Tg8w2lzm7kLNL0-w.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 500; src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), url(/font-roboto/OLffGBTaF0XFOW1gnuHF0Qt_Rm691LTebKfY2ZkKSmI.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 500; src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), url(/font-roboto/OLffGBTaF0XFOW1gnuHF0VBW26QxpSj-_ZKm_xT4hWw.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 500; src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), url(/font-roboto/OLffGBTaF0XFOW1gnuHF0Ygp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 500; src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), url(/font-roboto/OLffGBTaF0XFOW1gnuHF0aE8kM4xWR1_1bYURRojRGc.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto'; font-style: italic; font-weight: 500; src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), url(/font-roboto/OLffGBTaF0XFOW1gnuHF0dDiNsR5a-9Oe_Ivpu8XWlY.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; src: local('Roboto Mono'), local('RobotoMono-Regular'), url(/font-roboto/hMqPNLsu_dywMa4C_DEpY14sYYdJg5dU2qzJEVSuta0.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; src: local('Roboto Mono'), local('RobotoMono-Regular'), url(/font-roboto/hMqPNLsu_dywMa4C_DEpY_ZraR2Tg8w2lzm7kLNL0-w.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; src: local('Roboto Mono'), local('RobotoMono-Regular'), url(/font-roboto/hMqPNLsu_dywMa4C_DEpYwt_Rm691LTebKfY2ZkKSmI.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; src: local('Roboto Mono'), local('RobotoMono-Regular'), url(/font-roboto/hMqPNLsu_dywMa4C_DEpY1BW26QxpSj-_ZKm_xT4hWw.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; src: local('Roboto Mono'), local('RobotoMono-Regular'), url(/font-roboto/hMqPNLsu_dywMa4C_DEpY4gp9Q8gbYrhqGlRav_IXfk.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; src: local('Roboto Mono'), local('RobotoMono-Regular'), url(/font-roboto/hMqPNLsu_dywMa4C_DEpY6E8kM4xWR1_1bYURRojRGc.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 400; src: local('Roboto Mono'), local('RobotoMono-Regular'), url(/font-roboto/hMqPNLsu_dywMa4C_DEpY9DiNsR5a-9Oe_Ivpu8XWlY.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 700; src: local('Roboto Mono Bold'), local('RobotoMono-Bold'), url(/font-roboto/N4duVc9C58uwPiY8_59Fz1x-M1I1w5OMiqnVF8xBLhU.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 700; src: local('Roboto Mono Bold'), local('RobotoMono-Bold'), url(/font-roboto/N4duVc9C58uwPiY8_59FzwXaAXup5mZlfK6xRLrhsco.woff2) format('woff2'); unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 700; src: local('Roboto Mono Bold'), local('RobotoMono-Bold'), url(/font-roboto/N4duVc9C58uwPiY8_59Fzwn6Wqxo-xwxilDXPU8chVU.woff2) format('woff2'); unicode-range: U+0370-03FF; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 700; src: local('Roboto Mono Bold'), local('RobotoMono-Bold'), url(/font-roboto/N4duVc9C58uwPiY8_59Fz1T7aJLK6nKpn36IMwTcMMc.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 700; src: local('Roboto Mono Bold'), local('RobotoMono-Bold'), url(/font-roboto/N4duVc9C58uwPiY8_59Fz_79_ZuUxCigM2DespTnFaw.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 700; src: local('Roboto Mono Bold'), local('RobotoMono-Bold'), url(/font-roboto/N4duVc9C58uwPiY8_59Fz4gd9OEPUCN3AdYW0e8tat4.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 700; src: local('Roboto Mono Bold'), local('RobotoMono-Bold'), url(/font-roboto/N4duVc9C58uwPiY8_59Fz8bIQSYZnWLaWC9QNCpTK_U.woff2) format('woff2'); unicode-range: U+0102-0103, U+1EA0-1EF9, U+20AB; } </style> <custom-style> <style is="custom-style"> html { /* Shared Styles */ --paper-font-common-base: { font-family: 'Roboto', 'Noto', sans-serif; -webkit-font-smoothing: antialiased; }; --paper-font-common-code: { font-family: 'Roboto Mono', 'Consolas', 'Menlo', monospace; -webkit-font-smoothing: antialiased; }; --paper-font-common-expensive-kerning: { text-rendering: optimizeLegibility; }; --paper-font-common-nowrap: { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }; /* Material Font Styles */ --paper-font-display4: { @apply --paper-font-common-base; @apply --paper-font-common-nowrap; font-size: 112px; font-weight: 300; letter-spacing: -.044em; line-height: 120px; }; --paper-font-display3: { @apply --paper-font-common-base; @apply --paper-font-common-nowrap; font-size: 56px; font-weight: 400; letter-spacing: -.026em; line-height: 60px; }; --paper-font-display2: { @apply --paper-font-common-base; font-size: 45px; font-weight: 400; letter-spacing: -.018em; line-height: 48px; }; --paper-font-display1: { @apply --paper-font-common-base; font-size: 34px; font-weight: 400; letter-spacing: -.01em; line-height: 40px; }; --paper-font-headline: { @apply --paper-font-common-base; font-size: 24px; font-weight: 400; letter-spacing: -.012em; line-height: 32px; }; --paper-font-title: { @apply --paper-font-common-base; @apply --paper-font-common-nowrap; font-size: 20px; font-weight: 500; line-height: 28px; }; --paper-font-subhead: { @apply --paper-font-common-base; font-size: 16px; font-weight: 400; line-height: 24px; }; --paper-font-body2: { @apply --paper-font-common-base; font-size: 14px; font-weight: 500; line-height: 24px; }; --paper-font-body1: { @apply --paper-font-common-base; font-size: 14px; font-weight: 400; line-height: 20px; }; --paper-font-caption: { @apply --paper-font-common-base; @apply --paper-font-common-nowrap; font-size: 12px; font-weight: 400; letter-spacing: 0.011em; line-height: 20px; }; --paper-font-menu: { @apply --paper-font-common-base; @apply --paper-font-common-nowrap; font-size: 13px; font-weight: 500; line-height: 24px; }; --paper-font-button: { @apply --paper-font-common-base; @apply --paper-font-common-nowrap; font-size: 14px; font-weight: 500; letter-spacing: 0.018em; line-height: 24px; text-transform: uppercase; }; --paper-font-code2: { @apply --paper-font-common-code; font-size: 14px; font-weight: 700; line-height: 20px; }; --paper-font-code1: { @apply --paper-font-common-code; font-size: 14px; font-weight: 500; line-height: 20px; }; } </style> </custom-style> <script>//~~WEBPATH~~/paper-input/paper-input-addon-behavior.html.js Polymer.PaperInputAddonBehavior={attached:function(){this.fire("addon-attached")},update:function(){}}; </script> <dom-module id="paper-input-char-counter"> <template> <style> :host { display: inline-block; float: right; @apply --paper-font-caption; @apply --paper-input-char-counter; } :host([hidden]) { display: none !important; } :host(:dir(rtl)) { float: left; } </style> <span>[[_charCounterStr]]</span> </template> </dom-module> <script>//~~WEBPATH~~/paper-input/paper-input-char-counter.html.js Polymer({is:"paper-input-char-counter",behaviors:[Polymer.PaperInputAddonBehavior],properties:{_charCounterStr:{type:String,value:"0"}},update:function(b){if(b.inputElement){b.value=b.value||"";var d=b.value.toString().length.toString();b.inputElement.hasAttribute("maxlength")&&(d+="/"+b.inputElement.getAttribute("maxlength"));this._charCounterStr=d}}}); </script> <custom-style> <style is="custom-style"> html { --paper-input-container-shared-input-style: { position: relative; /* to make a stacking context */ outline: none; box-shadow: none; padding: 0; margin: 0; width: 100%; max-width: 100%; background: transparent; border: none; color: var(--paper-input-container-input-color, var(--primary-text-color)); -webkit-appearance: none; text-align: inherit; vertical-align: bottom; @apply --paper-font-subhead; }; } </style> </custom-style> <dom-module id="paper-input-container"> <template> <style> :host { display: block; padding: 8px 0; @apply --paper-input-container; } :host([inline]) { display: inline-block; } :host([disabled]) { pointer-events: none; opacity: 0.33; @apply --paper-input-container-disabled; } :host([hidden]) { display: none !important; } [hidden] { display: none !important; } .floated-label-placeholder { @apply --paper-font-caption; } .underline { height: 2px; position: relative; } .focused-line { @apply --layout-fit; border-bottom: 2px solid var(--paper-input-container-focus-color, var(--primary-color)); -webkit-transform-origin: center center; transform-origin: center center; -webkit-transform: scale3d(0,1,1); transform: scale3d(0,1,1); @apply --paper-input-container-underline-focus; } .underline.is-highlighted .focused-line { -webkit-transform: none; transform: none; -webkit-transition: -webkit-transform 0.25s; transition: transform 0.25s; @apply --paper-transition-easing; } .underline.is-invalid .focused-line { border-color: var(--paper-input-container-invalid-color, var(--error-color)); -webkit-transform: none; transform: none; -webkit-transition: -webkit-transform 0.25s; transition: transform 0.25s; @apply --paper-transition-easing; } .unfocused-line { @apply --layout-fit; border-bottom: 1px solid var(--paper-input-container-color, var(--secondary-text-color)); @apply --paper-input-container-underline; } :host([disabled]) .unfocused-line { border-bottom: 1px dashed; border-color: var(--paper-input-container-color, var(--secondary-text-color)); @apply --paper-input-container-underline-disabled; } .input-wrapper { @apply --layout-horizontal; @apply --layout-center; position: relative; } .input-content { @apply --layout-flex-auto; @apply --layout-relative; max-width: 100%; } .input-content ::slotted(label), .input-content ::slotted(.paper-input-label) { position: absolute; top: 0; left: 0; width: 100%; font: inherit; color: var(--paper-input-container-color, var(--secondary-text-color)); -webkit-transition: -webkit-transform 0.25s, width 0.25s; transition: transform 0.25s, width 0.25s; -webkit-transform-origin: left top; transform-origin: left top; /* Fix for safari not focusing 0-height date/time inputs with -webkit-apperance: none; */ min-height: 1px; @apply --paper-font-common-nowrap; @apply --paper-font-subhead; @apply --paper-input-container-label; @apply --paper-transition-easing; } .input-content.label-is-floating ::slotted(label), .input-content.label-is-floating ::slotted(.paper-input-label) { -webkit-transform: translateY(-75%) scale(0.75); transform: translateY(-75%) scale(0.75); /* Since we scale to 75/100 of the size, we actually have 100/75 of the original space now available */ width: 133%; @apply --paper-input-container-label-floating; } :host(:dir(rtl)) .input-content.label-is-floating ::slotted(label), :host(:dir(rtl)) .input-content.label-is-floating ::slotted(.paper-input-label) { right: 0; left: auto; -webkit-transform-origin: right top; transform-origin: right top; } .input-content.label-is-highlighted ::slotted(label), .input-content.label-is-highlighted ::slotted(.paper-input-label) { color: var(--paper-input-container-focus-color, var(--primary-color)); @apply --paper-input-container-label-focus; } .input-content.is-invalid ::slotted(label), .input-content.is-invalid ::slotted(.paper-input-label) { color: var(--paper-input-container-invalid-color, var(--error-color)); } .input-content.label-is-hidden ::slotted(label), .input-content.label-is-hidden ::slotted(.paper-input-label) { visibility: hidden; } .input-content ::slotted(input), .input-content ::slotted(iron-input), .input-content ::slotted(textarea), .input-content ::slotted(iron-autogrow-textarea), .input-content ::slotted(.paper-input-input) { @apply --paper-input-container-shared-input-style; /* The apply shim doesn't apply the nested color custom property, so we have to re-apply it here. */ color: var(--paper-input-container-input-color, var(--primary-text-color)); @apply --paper-input-container-input; } .input-content ::slotted(input)::-webkit-outer-spin-button, .input-content ::slotted(input)::-webkit-inner-spin-button { @apply --paper-input-container-input-webkit-spinner; } .input-content.focused ::slotted(input), .input-content.focused ::slotted(iron-input), .input-content.focused ::slotted(textarea), .input-content.focused ::slotted(iron-autogrow-textarea), .input-content.focused ::slotted(.paper-input-input) { @apply --paper-input-container-input-focus; } .input-content.is-invalid ::slotted(input), .input-content.is-invalid ::slotted(iron-input), .input-content.is-invalid ::slotted(textarea), .input-content.is-invalid ::slotted(iron-autogrow-textarea), .input-content.is-invalid ::slotted(.paper-input-input) { @apply --paper-input-container-input-invalid; } .prefix ::slotted(*) { display: inline-block; @apply --paper-font-subhead; @apply --layout-flex-none; @apply --paper-input-prefix; } .suffix ::slotted(*) { display: inline-block; @apply --paper-font-subhead; @apply --layout-flex-none; @apply --paper-input-suffix; } /* Firefox sets a min-width on the input, which can cause layout issues */ .input-content ::slotted(input) { min-width: 0; } .input-content ::slotted(textarea) { resize: none; } .add-on-content { position: relative; } .add-on-content.is-invalid ::slotted(*) { color: var(--paper-input-container-invalid-color, var(--error-color)); } .add-on-content.is-highlighted ::slotted(*) { color: var(--paper-input-container-focus-color, var(--primary-color)); } </style> <div class="floated-label-placeholder" aria-hidden="true" hidden="[[noLabelFloat]]"> </div> <div class="input-wrapper"> <span class="prefix"><slot name="prefix"></slot></span> <div class$="[[_computeInputContentClass(noLabelFloat,alwaysFloatLabel,focused,invalid,_inputHasContent)]]" id="labelAndInputContainer"> <slot name="label"></slot> <slot name="input"></slot> </div> <span class="suffix"><slot name="suffix"></slot></span> </div> <div class$="[[_computeUnderlineClass(focused,invalid)]]"> <div class="unfocused-line"></div> <div class="focused-line"></div> </div> <div class$="[[_computeAddOnContentClass(focused,invalid)]]"> <slot name="add-on"></slot> </div> </template> </dom-module> <script>//~~WEBPATH~~/paper-input/paper-input-container.html.js Polymer({is:"paper-input-container",properties:{noLabelFloat:{type:Boolean,value:!1},alwaysFloatLabel:{type:Boolean,value:!1},attrForValue:{type:String,value:"bind-value"},autoValidate:{type:Boolean,value:!1},invalid:{observer:"_invalidChanged",type:Boolean,value:!1},focused:{readOnly:!0,type:Boolean,value:!1,notify:!0},_addons:{type:Array},_inputHasContent:{type:Boolean,value:!1},_inputSelector:{type:String,value:"input,iron-input,textarea,.paper-input-input"},_boundOnFocus:{type:Function,value:function(){return this._onFocus.bind(this)}}, _boundOnBlur:{type:Function,value:function(){return this._onBlur.bind(this)}},_boundOnInput:{type:Function,value:function(){return this._onInput.bind(this)}},_boundValueChanged:{type:Function,value:function(){return this._onValueChanged.bind(this)}}},listeners:{"addon-attached":"_onAddonAttached","iron-input-validate":"_onIronInputValidate"},get _valueChangedEvent(){return this.attrForValue+"-changed"},get _propertyForValue(){return Polymer.CaseMap.dashToCamelCase(this.attrForValue)},get _inputElement(){return Polymer.dom(this).querySelector(this._inputSelector)}, get _inputElementValue(){return this._inputElement[this._propertyForValue]||this._inputElement.value},ready:function(){this.__isFirstValueUpdate=!0;this._addons||(this._addons=[]);this.addEventListener("focus",this._boundOnFocus,!0);this.addEventListener("blur",this._boundOnBlur,!0)},attached:function(){this.attrForValue?this._inputElement.addEventListener(this._valueChangedEvent,this._boundValueChanged):this.addEventListener("input",this._onInput);this._inputElementValue&&""!=this._inputElementValue? this._handleValueAndAutoValidate(this._inputElement):this._handleValue(this._inputElement)},_onAddonAttached:function(b){this._addons||(this._addons=[]);b=b.target;-1===this._addons.indexOf(b)&&(this._addons.push(b),this.isAttached&&this._handleValue(this._inputElement))},_onFocus:function(){this._setFocused(!0)},_onBlur:function(){this._setFocused(!1);this._handleValueAndAutoValidate(this._inputElement)},_onInput:function(b){this._handleValueAndAutoValidate(b.target)},_onValueChanged:function(b){var d= b.target;if(this.__isFirstValueUpdate&&(this.__isFirstValueUpdate=!1,void 0===d.value||""===d.value))return;this._handleValueAndAutoValidate(b.target)},_handleValue:function(b){var d=this._inputElementValue;d||0===d||"number"===b.type&&!b.checkValidity()?this._inputHasContent=!0:this._inputHasContent=!1;this.updateAddons({inputElement:b,value:d,invalid:this.invalid})},_handleValueAndAutoValidate:function(b){this.autoValidate&&b&&(this.invalid=!(b.validate?b.validate(this._inputElementValue):b.checkValidity())); this._handleValue(b)},_onIronInputValidate:function(){this.invalid=this._inputElement.invalid},_invalidChanged:function(){this._addons&&this.updateAddons({invalid:this.invalid})},updateAddons:function(b){for(var d,f=0;d=this._addons[f];f++)d.update(b)},_computeInputContentClass:function(b,d,f,h,m){var w="input-content";b?(m&&(w+=" label-is-hidden"),h&&(w+=" is-invalid")):(b=this.querySelector("label"),d||m?(w+=" label-is-floating",this.$.labelAndInputContainer.style.position="static",h?w+=" is-invalid": f&&(w+=" label-is-highlighted")):(b&&(this.$.labelAndInputContainer.style.position="relative"),h&&(w+=" is-invalid")));f&&(w+=" focused");return w},_computeUnderlineClass:function(b,d){var f="underline";d?f+=" is-invalid":b&&(f+=" is-highlighted");return f},_computeAddOnContentClass:function(b,d){var f="add-on-content";d?f+=" is-invalid":b&&(f+=" is-highlighted");return f}}); </script> <dom-module id="paper-input-error"> <template> <style> :host { display: inline-block; visibility: hidden; color: var(--paper-input-container-invalid-color, var(--error-color)); @apply --paper-font-caption; @apply --paper-input-error; position: absolute; left:0; right:0; } :host([invalid]) { visibility: visible; }; </style> <slot></slot> </template> </dom-module> <script>//~~WEBPATH~~/paper-input/paper-input-error.html.js Polymer({is:"paper-input-error",behaviors:[Polymer.PaperInputAddonBehavior],properties:{invalid:{readOnly:!0,reflectToAttribute:!0,type:Boolean}},update:function(b){this._setInvalid(b.invalid)}}); </script> <dom-module id="paper-input"> <template> <style> :host { display: block; } :host([focused]) { outline: none; } :host([hidden]) { display: none !important; } input { /* Firefox sets a min-width on the input, which can cause layout issues */ min-width: 0; } /* In 1.x, the <input> is distributed to paper-input-container, which styles it. In 2.x the <iron-input> is distributed to paper-input-container, which styles it, but in order for this to work correctly, we need to reset some of the native input's properties to inherit (from the iron-input) */ iron-input > input { @apply --paper-input-container-shared-input-style; font-family: inherit; font-weight: inherit; font-size: inherit; letter-spacing: inherit; word-spacing: inherit; line-height: inherit; text-shadow: inherit; color: inherit; cursor: inherit; } input:disabled { @apply --paper-input-container-input-disabled; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { @apply --paper-input-container-input-webkit-spinner; } input::-webkit-clear-button { @apply --paper-input-container-input-webkit-clear; } input::-webkit-calendar-picker-indicator { @apply --paper-input-container-input-webkit-calendar-picker-indicator; } input::-webkit-input-placeholder { color: var(--paper-input-container-color, var(--secondary-text-color)); } input:-moz-placeholder { color: var(--paper-input-container-color, var(--secondary-text-color)); } input::-moz-placeholder { color: var(--paper-input-container-color, var(--secondary-text-color)); } input::-ms-clear { @apply --paper-input-container-ms-clear; } input::-ms-reveal { @apply --paper-input-container-ms-reveal; } input:-ms-input-placeholder { color: var(--paper-input-container-color, var(--secondary-text-color)); } label { pointer-events: none; } </style> <paper-input-container id="container" no-label-float="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]"> <slot name="prefix" slot="prefix"></slot> <label hidden$="[[!label]]" aria-hidden="true" for$="[[_inputId]]" slot="label">[[label]]</label> <span id="template-placeholder"></span> <slot name="suffix" slot="suffix"></slot> <template is="dom-if" if="[[errorMessage]]"> <paper-input-error aria-live="assertive" slot="add-on">[[errorMessage]]</paper-input-error> </template> <template is="dom-if" if="[[charCounter]]"> <paper-input-char-counter slot="add-on"></paper-input-char-counter> </template> </paper-input-container> </template> <template id="v0"> <input is="iron-input" slot="input" class="input-element" id$="[[_inputId]]" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" title$="[[title]]" bind-value="{{value}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" allowed-pattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" autocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onChange" tabindex$="[[tabIndex]]" autosave$="[[autosave]]" results$="[[results]]" accept$="[[accept]]" multiple$="[[multiple]]"> </template> <template id="v1"> <iron-input bind-value="{{value}}" slot="input" class="input-element" id$="[[_inputId]]" maxlength$="[[maxlength]]" allowed-pattern="[[allowedPattern]]" invalid="{{invalid}}" validator="[[validator]]"> <input aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" title$="[[title]]" type$="[[type]]" pattern$="[[pattern]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength]]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" autocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onChange" tabindex$="[[tabIndex]]" autosave$="[[autosave]]" results$="[[results]]" accept$="[[accept]]" multiple$="[[multiple]]"> </iron-input> </template> </dom-module> <script>//~~WEBPATH~~/paper-input/paper-input.html.js Polymer({is:"paper-input",behaviors:[Polymer.PaperInputBehavior,Polymer.IronFormElementBehavior],properties:{value:{type:String}},beforeRegister:function(){var b="function"==typeof document.createElement("iron-input")._initSlottedInput?"v1":"v0",d=Polymer.DomModule.import("paper-input","template");b=Polymer.DomModule.import("paper-input","template#"+b);(d=d.content.querySelector("#template-placeholder"))&&d.parentNode.replaceChild(b.content,d)},get _focusableElement(){return Polymer.Element?this.inputElement._inputElement: this.inputElement},listeners:{"iron-input-ready":"_onIronInputReady"},_onIronInputReady:function(){this.$.nativeInput||(this.$.nativeInput=this.$$("input"));this.inputElement&&-1!==this._typesThatHaveText.indexOf(this.$.nativeInput.type)&&(this.alwaysFloatLabel=!0);this.inputElement.bindValue&&this.$.container._handleValueAndAutoValidate(this.inputElement)}}); </script> <script>//~~WEBPATH~~/iron-fit-behavior/iron-fit-behavior.html.js Polymer.IronFitBehavior={properties:{sizingTarget:{type:Object,value:function(){return this}},fitInto:{type:Object,value:window},noOverlap:{type:Boolean},positionTarget:{type:Element},horizontalAlign:{type:String},verticalAlign:{type:String},dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0,notify:!0},verticalOffset:{type:Number,value:0,notify:!0},autoFitOnAttach:{type:Boolean,value:!1},_fitInfo:{type:Object}},get _fitWidth(){return this.fitInto===window?this.fitInto.innerWidth:this.fitInto.getBoundingClientRect().width}, get _fitHeight(){return this.fitInto===window?this.fitInto.innerHeight:this.fitInto.getBoundingClientRect().height},get _fitLeft(){return this.fitInto===window?0:this.fitInto.getBoundingClientRect().left},get _fitTop(){return this.fitInto===window?0:this.fitInto.getBoundingClientRect().top},get _defaultPositionTarget(){var b=Polymer.dom(this).parentNode;b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(b=b.host);return b},get _localeHorizontalAlign(){if(this._isRTL){if("right"===this.horizontalAlign)return"left"; if("left"===this.horizontalAlign)return"right"}return this.horizontalAlign},get __shouldPosition(){return(this.horizontalAlign||this.verticalAlign)&&this.positionTarget},attached:function(){"undefined"===typeof this._isRTL&&(this._isRTL="rtl"==window.getComputedStyle(this).direction);this.positionTarget=this.positionTarget||this._defaultPositionTarget;this.autoFitOnAttach&&("none"===window.getComputedStyle(this).display?setTimeout(function(){this.fit()}.bind(this)):(window.ShadyDOM&&ShadyDOM.flush(), this.fit()))},detached:function(){this.__deferredFit&&(clearTimeout(this.__deferredFit),this.__deferredFit=null)},fit:function(){this.position();this.constrain();this.center()},_discoverInfo:function(){if(!this._fitInfo){var b=window.getComputedStyle(this),d=window.getComputedStyle(this.sizingTarget);this._fitInfo={inlineStyle:{top:this.style.top||"",left:this.style.left||"",position:this.style.position||""},sizerInlineStyle:{maxWidth:this.sizingTarget.style.maxWidth||"",maxHeight:this.sizingTarget.style.maxHeight|| "",boxSizing:this.sizingTarget.style.boxSizing||""},positionedBy:{vertically:"auto"!==b.top?"top":"auto"!==b.bottom?"bottom":null,horizontally:"auto"!==b.left?"left":"auto"!==b.right?"right":null},sizedBy:{height:"none"!==d.maxHeight,width:"none"!==d.maxWidth,minWidth:parseInt(d.minWidth,10)||0,minHeight:parseInt(d.minHeight,10)||0},margin:{top:parseInt(b.marginTop,10)||0,right:parseInt(b.marginRight,10)||0,bottom:parseInt(b.marginBottom,10)||0,left:parseInt(b.marginLeft,10)||0}}}},resetFit:function(){var b= this._fitInfo||{},d;for(d in b.sizerInlineStyle)this.sizingTarget.style[d]=b.sizerInlineStyle[d];for(d in b.inlineStyle)this.style[d]=b.inlineStyle[d];this._fitInfo=null},refit:function(){var b=this.sizingTarget.scrollLeft,d=this.sizingTarget.scrollTop;this.resetFit();this.fit();this.sizingTarget.scrollLeft=b;this.sizingTarget.scrollTop=d},position:function(){if(this.__shouldPosition){this._discoverInfo();this.style.position="fixed";this.sizingTarget.style.boxSizing="border-box";this.style.left="0px"; this.style.top="0px";var b=this.getBoundingClientRect(),d=this.__getNormalizedRect(this.positionTarget),f=this.__getNormalizedRect(this.fitInto),h=this._fitInfo.margin,m=this.__getPosition(this._localeHorizontalAlign,this.verticalAlign,{width:b.width+h.left+h.right,height:b.height+h.top+h.bottom},b,d,f);d=m.left+h.left;m=m.top+h.top;var w=Math.min(f.right-h.right,d+b.width),l=Math.min(f.bottom-h.bottom,m+b.height);d=Math.max(f.left+h.left,Math.min(d,w-this._fitInfo.sizedBy.minWidth));m=Math.max(f.top+ h.top,Math.min(m,l-this._fitInfo.sizedBy.minHeight));this.sizingTarget.style.maxWidth=Math.max(w-d,this._fitInfo.sizedBy.minWidth)+"px";this.sizingTarget.style.maxHeight=Math.max(l-m,this._fitInfo.sizedBy.minHeight)+"px";this.style.left=d-b.left+"px";this.style.top=m-b.top+"px"}},constrain:function(){if(!this.__shouldPosition){this._discoverInfo();var b=this._fitInfo;b.positionedBy.vertically||(this.style.position="fixed",this.style.top="0px");b.positionedBy.horizontally||(this.style.position="fixed", this.style.left="0px");this.sizingTarget.style.boxSizing="border-box";var d=this.getBoundingClientRect();b.sizedBy.height||this.__sizeDimension(d,b.positionedBy.vertically,"top","bottom","Height");b.sizedBy.width||this.__sizeDimension(d,b.positionedBy.horizontally,"left","right","Width")}},_sizeDimension:function(b,d,f,h,m){this.__sizeDimension(b,d,f,h,m)},__sizeDimension:function(b,d,f,h,m){var w=this._fitInfo,l=this.__getNormalizedRect(this.fitInto);l="Width"===m?l.width:l.height;d=d===h;var p= "offset"+m;this.sizingTarget.style["max"+m]=l-w.margin[d?f:h]-(d?l-b[h]:b[f])-(this[p]-this.sizingTarget[p])+"px"},center:function(){if(!this.__shouldPosition){this._discoverInfo();var b=this._fitInfo.positionedBy;if(!b.vertically||!b.horizontally){this.style.position="fixed";b.vertically||(this.style.top="0px");b.horizontally||(this.style.left="0px");var d=this.getBoundingClientRect(),f=this.__getNormalizedRect(this.fitInto);b.vertically||(this.style.top=f.top-d.top+(f.height-d.height)/2+"px");b.horizontally|| (this.style.left=f.left-d.left+(f.width-d.width)/2+"px")}}},__getNormalizedRect:function(b){return b===document.documentElement||b===window?{top:0,left:0,width:window.innerWidth,height:window.innerHeight,right:window.innerWidth,bottom:window.innerHeight}:b.getBoundingClientRect()},__getOffscreenArea:function(b,d,f){return Math.abs(Math.min(0,b.top)+Math.min(0,f.bottom-(b.top+d.height)))*d.width+Math.abs(Math.min(0,b.left)+Math.min(0,f.right-(b.left+d.width)))*d.height},__getPosition:function(b,d, f,h,m,w){var l=[{verticalAlign:"top",horizontalAlign:"left",top:m.top+this.verticalOffset,left:m.left+this.horizontalOffset},{verticalAlign:"top",horizontalAlign:"right",top:m.top+this.verticalOffset,left:m.right-f.width-this.horizontalOffset},{verticalAlign:"bottom",horizontalAlign:"left",top:m.bottom-f.height-this.verticalOffset,left:m.left+this.horizontalOffset},{verticalAlign:"bottom",horizontalAlign:"right",top:m.bottom-f.height-this.verticalOffset,left:m.right-f.width-this.horizontalOffset}]; if(this.noOverlap){for(var p=0,n=l.length;p<n;p++){var q={},t;for(t in l[p])q[t]=l[p][t];l.push(q)}l[0].top=l[1].top+=m.height;l[2].top=l[3].top-=m.height;l[4].left=l[6].left+=m.width;l[5].left=l[7].left-=m.width}d="auto"===d?null:d;b="auto"===b?null:b;b&&"center"!==b||(l.push({verticalAlign:"top",horizontalAlign:"center",top:m.top+this.verticalOffset+(this.noOverlap?m.height:0),left:m.left-h.width/2+m.width/2+this.horizontalOffset}),l.push({verticalAlign:"bottom",horizontalAlign:"center",top:m.bottom- f.height-this.verticalOffset-(this.noOverlap?m.height:0),left:m.left-h.width/2+m.width/2+this.horizontalOffset}));d&&"middle"!==d||(l.push({verticalAlign:"middle",horizontalAlign:"left",top:m.top-h.height/2+m.height/2+this.verticalOffset,left:m.left+this.horizontalOffset+(this.noOverlap?m.width:0)}),l.push({verticalAlign:"middle",horizontalAlign:"right",top:m.top-h.height/2+m.height/2+this.verticalOffset,left:m.right-f.width-this.horizontalOffset-(this.noOverlap?m.width:0)}));"middle"===d&&"center"=== b&&l.push({verticalAlign:"middle",horizontalAlign:"center",top:m.top-h.height/2+m.height/2+this.verticalOffset,left:m.left-h.width/2+m.width/2+this.horizontalOffset});for(p=0;p<l.length;p++){h=l[p];m=h.verticalAlign===d;n=h.horizontalAlign===b;if(!this.dynamicAlign&&!this.noOverlap&&m&&n){var v=h;break}q=(!d||m)&&(!b||n);if(this.dynamicAlign||q){h.offscreenArea=this.__getOffscreenArea(h,f,w);if(0===h.offscreenArea&&q){v=h;break}v=v||h;q=h.offscreenArea-v.offscreenArea;if(0>q||0===q&&(m||n))v=h}}return v}}; </script> <script>//~~WEBPATH~~/iron-resizable-behavior/iron-resizable-behavior.html.js Polymer.IronResizableBehavior={properties:{_parentResizable:{type:Object,observer:"_parentResizableChanged"},_notifyingDescendant:{type:Boolean,value:!1}},listeners:{"iron-request-resize-notifications":"_onIronRequestResizeNotifications"},created:function(){this._interestedResizables=[];this._boundNotifyResize=this.notifyResize.bind(this)},attached:function(){this._requestResizeNotifications()},detached:function(){this._parentResizable?this._parentResizable.stopResizeNotificationsFor(this):window.removeEventListener("resize", this._boundNotifyResize);this._parentResizable=null},notifyResize:function(){this.isAttached&&(this._interestedResizables.forEach(function(b){this.resizerShouldNotify(b)&&this._notifyDescendant(b)},this),this._fireResize())},assignParentResizable:function(b){this._parentResizable=b},stopResizeNotificationsFor:function(b){var d=this._interestedResizables.indexOf(b);-1<d&&(this._interestedResizables.splice(d,1),this.unlisten(b,"iron-resize","_onDescendantIronResize"))},resizerShouldNotify:function(){return!0}, _onDescendantIronResize:function(b){this._notifyingDescendant?b.stopPropagation():Polymer.Settings.useShadow||this._fireResize()},_fireResize:function(){this.fire("iron-resize",null,{node:this,bubbles:!1})},_onIronRequestResizeNotifications:function(b){var d=Polymer.dom(b).rootTarget;d!==this&&(-1===this._interestedResizables.indexOf(d)&&(this._interestedResizables.push(d),this.listen(d,"iron-resize","_onDescendantIronResize")),d.assignParentResizable(this),this._notifyDescendant(d),b.stopPropagation())}, _parentResizableChanged:function(b){b&&window.removeEventListener("resize",this._boundNotifyResize)},_notifyDescendant:function(b){this.isAttached&&(this._notifyingDescendant=!0,b.notifyResize(),this._notifyingDescendant=!1)},_requestResizeNotifications:function(){if(this.isAttached)if("loading"===document.readyState){var b=this._requestResizeNotifications.bind(this);document.addEventListener("readystatechange",function f(){document.removeEventListener("readystatechange",f);b()})}else this.fire("iron-request-resize-notifications", null,{node:this,bubbles:!0,cancelable:!0}),this._parentResizable||(window.addEventListener("resize",this._boundNotifyResize),this.notifyResize())}}; </script> <dom-module id="iron-overlay-backdrop"> <template> <style> :host { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--iron-overlay-backdrop-background-color, #000); opacity: 0; transition: opacity 0.2s; pointer-events: none; @apply --iron-overlay-backdrop; } :host(.opened) { opacity: var(--iron-overlay-backdrop-opacity, 0.6); pointer-events: auto; @apply --iron-overlay-backdrop-opened; } </style> <slot></slot> </template> </dom-module> <script>//~~WEBPATH~~/iron-overlay-behavior/iron-overlay-backdrop.html.js Polymer({is:"iron-overlay-backdrop",properties:{opened:{reflectToAttribute:!0,type:Boolean,value:!1,observer:"_openedChanged"}},listeners:{transitionend:"_onTransitionend"},created:function(){this.__openedRaf=null},attached:function(){this.opened&&this._openedChanged(this.opened)},prepare:function(){this.opened&&!this.parentNode&&Polymer.dom(document.body).appendChild(this)},open:function(){this.opened=!0},close:function(){this.opened=!1},complete:function(){this.opened||this.parentNode!==document.body|| Polymer.dom(this.parentNode).removeChild(this)},_onTransitionend:function(b){b&&b.target===this&&this.complete()},_openedChanged:function(b){b?this.prepare():(b=window.getComputedStyle(this),"0s"!==b.transitionDuration&&0!=b.opacity||this.complete());this.isAttached&&(this.__openedRaf&&(window.cancelAnimationFrame(this.__openedRaf),this.__openedRaf=null),this.scrollTop=this.scrollTop,this.__openedRaf=window.requestAnimationFrame(function(){this.__openedRaf=null;this.toggleClass("opened",this.opened)}.bind(this)))}}); </script> <script>//~~WEBPATH~~/iron-overlay-behavior/iron-overlay-manager.html.js Polymer.IronOverlayManagerClass=function(){this._overlays=[];this._minimumZ=101;this._backdropElement=null;Polymer.Gestures.add(document.documentElement,"tap",function(){});document.addEventListener("tap",this._onCaptureClick.bind(this),!0);document.addEventListener("focus",this._onCaptureFocus.bind(this),!0);document.addEventListener("keydown",this._onCaptureKeyDown.bind(this),!0)}; function nj(b,d){b=b._minimumZ;d&&(d=Number(d.style.zIndex||window.getComputedStyle(d).zIndex),d===d&&(b=d));return b} function oj(b,d){var f=b._overlays.indexOf(d);if(0<=f){if(d=f,f=b._overlays[d]){var h=b._overlays.length-1,m=b._overlays[h];m&&!f.alwaysOnTop&&m.alwaysOnTop&&h--;if(!(d>=h)){m=Math.max(nj(b,pj(b)),b._minimumZ);nj(b,f)<=m&&(f.style.zIndex=m+2);for(;d<h;)b._overlays[d]=b._overlays[d+1],d++;b._overlays[h]=f}}}else{f=b._overlays.length;h=b._overlays[f-1];m=Math.max(nj(b,h),b._minimumZ);var w=nj(b,d);h&&!d.alwaysOnTop&&h.alwaysOnTop&&(h.style.zIndex=m+2,f--,m=Math.max(nj(b,b._overlays[f-1]),b._minimumZ)); w<=m&&(d.style.zIndex=m+2);b._overlays.splice(f,0,d)}qj(b)}function rj(b,d){d=b._overlays.indexOf(d);-1!==d&&(b._overlays.splice(d,1),qj(b))}function qj(b){var d=sj(b);if(d||b._backdropElement)b.backdropElement.style.zIndex=nj(b,d)-1,b.backdropElement.opened=!!d,b.backdropElement.prepare()}function pj(b){return b._overlays[b._overlays.length-1]}function sj(b){for(var d=b._overlays.length-1;0<=d;d--)if(b._overlays[d].withBackdrop)return b._overlays[d]} function tj(b,d){d=d||[];for(var f=0;f<d.length;f++)if(d[f]._manager===b)return d[f]} Polymer.IronOverlayManagerClass.prototype={constructor:Polymer.IronOverlayManagerClass,get backdropElement(){this._backdropElement||(this._backdropElement=document.createElement("iron-overlay-backdrop"));return this._backdropElement},get deepActiveElement(){var b=document.activeElement;b&&!1!==b instanceof Element||(b=document.body);for(;b.root&&Polymer.dom(b.root).activeElement;)b=Polymer.dom(b.root).activeElement;return b},addOrRemoveOverlay:function(b){b.opened?oj(this,b):rj(this,b)},ensureMinimumZ:function(b){this._minimumZ= Math.max(this._minimumZ,b)},focusOverlay:function(){var b=pj(this);b&&b._applyFocus()},getBackdrops:function(){for(var b=[],d=0;d<this._overlays.length;d++)this._overlays[d].withBackdrop&&b.push(this._overlays[d]);return b},backdropZ:function(){return nj(this,sj(this))-1},_onCaptureClick:function(b){var d=this._overlays.length-1;if(-1!==d)for(var f=Polymer.dom(b).path,h;(h=this._overlays[d])&&tj(this,f)!==h;)if(h._onCaptureClick(b),h.allowClickThrough)d--;else break},_onCaptureFocus:function(b){var d= pj(this);d&&d._onCaptureFocus(b)},_onCaptureKeyDown:function(b){var d=pj(this);d&&(Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(b,"esc")?d._onCaptureEsc(b):Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(b,"tab")&&d._onCaptureTab(b))}};Polymer.IronOverlayManager=new Polymer.IronOverlayManagerClass; </script> <script>//~~WEBPATH~~/iron-overlay-behavior/iron-scroll-manager.html.js (function(){var b=0,d=0,f=null,h=[],m=["wheel","mousewheel","DOMMouseScroll","touchstart","touchmove"];Polymer.IronScrollManager={get currentLockingElement(){return this._lockingElements[this._lockingElements.length-1]},elementIsScrollLocked:function(w){var l=this.currentLockingElement;if(void 0===l)return!1;if(this._hasCachedLockedElement(w))return!0;if(this._hasCachedUnlockedElement(w))return!1;(l=!!l&&l!==w&&!this._composedTreeContains(l,w))?this._lockedElementCache.push(w):this._unlockedElementCache.push(w); return l},pushScrollLock:function(w){0<=this._lockingElements.indexOf(w)||(0===this._lockingElements.length&&this._lockScrollInteractions(),this._lockingElements.push(w),this._lockedElementCache=[],this._unlockedElementCache=[])},removeScrollLock:function(w){w=this._lockingElements.indexOf(w);-1!==w&&(this._lockingElements.splice(w,1),this._lockedElementCache=[],this._unlockedElementCache=[],0===this._lockingElements.length&&this._unlockScrollInteractions())},_lockingElements:[],_lockedElementCache:null, _unlockedElementCache:null,_hasCachedLockedElement:function(w){return-1<this._lockedElementCache.indexOf(w)},_hasCachedUnlockedElement:function(w){return-1<this._unlockedElementCache.indexOf(w)},_composedTreeContains:function(w,l){var p,n;if(w.contains(l))return!0;w=Polymer.dom(w).querySelectorAll("content,slot");for(p=0;p<w.length;++p){var q=Polymer.dom(w[p]).getDistributedNodes();for(n=0;n<q.length;++n)if(q[n].nodeType===Node.ELEMENT_NODE&&this._composedTreeContains(q[n],l))return!0}return!1},_scrollInteractionHandler:function(w){w.cancelable&& this._shouldPreventScrolling(w)&&w.preventDefault();w.targetTouches&&(w=w.targetTouches[0],b=w.pageX,d=w.pageY)},_lockScrollInteractions:function(){this._boundScrollHandler=this._boundScrollHandler||this._scrollInteractionHandler.bind(this);for(var w=0,l=m.length;w<l;w++)document.addEventListener(m[w],this._boundScrollHandler,{capture:!0,passive:!1})},_unlockScrollInteractions:function(){for(var w=0,l=m.length;w<l;w++)document.removeEventListener(m[w],this._boundScrollHandler,{capture:!0,passive:!1})}, _shouldPreventScrolling:function(w){var l=Polymer.dom(w).rootTarget;"touchmove"!==w.type&&f!==l&&(f=l,h=this._getScrollableNodes(Polymer.dom(w).path));if(!h.length)return!0;if("touchstart"===w.type)return!1;w=this._getScrollInfo(w);return!this._getScrollingNode(h,w.deltaX,w.deltaY)},_getScrollableNodes:function(w){for(var l=[],p=w.indexOf(this.currentLockingElement),n=0;n<=p;n++)if(w[n].nodeType===Node.ELEMENT_NODE){var q=w[n],t=q.style;"scroll"!==t.overflow&&"auto"!==t.overflow&&(t=window.getComputedStyle(q)); "scroll"!==t.overflow&&"auto"!==t.overflow||l.push(q)}return l},_getScrollingNode:function(w,l,p){if(l||p)for(var n=Math.abs(p)>=Math.abs(l),q=0;q<w.length;q++){var t=w[q];if(n?0>p?0<t.scrollTop:t.scrollTop<t.scrollHeight-t.clientHeight:0>l?0<t.scrollLeft:t.scrollLeft<t.scrollWidth-t.clientWidth)return t}},_getScrollInfo:function(w){var l={deltaX:w.deltaX,deltaY:w.deltaY};"deltaX"in w||("wheelDeltaX"in w&&"wheelDeltaY"in w?(l.deltaX=-w.wheelDeltaX,l.deltaY=-w.wheelDeltaY):"wheelDelta"in w?(l.deltaX= 0,l.deltaY=-w.wheelDelta):"axis"in w?(l.deltaX=1===w.axis?w.detail:0,l.deltaY=2===w.axis?w.detail:0):w.targetTouches&&(w=w.targetTouches[0],l.deltaX=b-w.pageX,l.deltaY=d-w.pageY));return l}}})(); </script> <script>//~~WEBPATH~~/iron-overlay-behavior/iron-focusables-helper.html.js (function(){var b=Element.prototype,d=b.matches||b.matchesSelector||b.mozMatchesSelector||b.msMatchesSelector||b.oMatchesSelector||b.webkitMatchesSelector;Polymer.IronFocusablesHelper={getTabbableNodes:function(f){var h=[];return this._collectTabbableNodes(f,h)?this._sortByTabIndex(h):h},isFocusable:function(f){return d.call(f,"input, select, textarea, button, object")?d.call(f,":not([disabled])"):d.call(f,"a[href], area[href], iframe, [tabindex], [contentEditable]")},isTabbable:function(f){return this.isFocusable(f)&& d.call(f,':not([tabindex\x3d"-1"])')&&this._isVisible(f)},_normalizedTabIndex:function(f){return this.isFocusable(f)?(f=f.getAttribute("tabindex")||0,Number(f)):-1},_collectTabbableNodes:function(f,h){if(f.nodeType!==Node.ELEMENT_NODE||!this._isVisible(f))return!1;var m=this._normalizedTabIndex(f),w=0<m;0<=m&&h.push(f);f="content"===f.localName||"slot"===f.localName?Polymer.dom(f).getDistributedNodes():Polymer.dom(f.root||f).children;for(m=0;m<f.length;m++)w=this._collectTabbableNodes(f[m],h)||w; return w},_isVisible:function(f){var h=f.style;return"hidden"!==h.visibility&&"none"!==h.display?(h=window.getComputedStyle(f),"hidden"!==h.visibility&&"none"!==h.display):!1},_sortByTabIndex:function(f){var h=f.length;if(2>h)return f;var m=Math.ceil(h/2);h=this._sortByTabIndex(f.slice(0,m));f=this._sortByTabIndex(f.slice(m));return this._mergeSortByTabIndex(h,f)},_mergeSortByTabIndex:function(f,h){for(var m=[];0<f.length&&0<h.length;)this._hasLowerTabOrder(f[0],h[0])?m.push(h.shift()):m.push(f.shift()); return m.concat(f,h)},_hasLowerTabOrder:function(f,h){f=Math.max(f.tabIndex,0);h=Math.max(h.tabIndex,0);return 0===f||0===h?h>f:f>h}}})(); </script> <script>//~~WEBPATH~~/iron-overlay-behavior/iron-overlay-behavior.html.js Polymer.IronOverlayBehaviorImpl={properties:{opened:{observer:"_openedChanged",type:Boolean,value:!1,notify:!0},canceled:{observer:"_canceledChanged",readOnly:!0,type:Boolean,value:!1},withBackdrop:{observer:"_withBackdropChanged",type:Boolean},noAutoFocus:{type:Boolean,value:!1},noCancelOnEscKey:{type:Boolean,value:!1},noCancelOnOutsideClick:{type:Boolean,value:!1},closingReason:{type:Object},restoreFocusOnClose:{type:Boolean,value:!1},allowClickThrough:{type:Boolean},alwaysOnTop:{type:Boolean}, scrollAction:{type:String},_manager:{type:Object,value:Polymer.IronOverlayManager},_focusedChild:{type:Object}},listeners:{"iron-resize":"_onIronResize"},observers:["__updateScrollObservers(isAttached, opened, scrollAction)"],get backdropElement(){return this._manager.backdropElement},get _focusNode(){return this._focusedChild||Polymer.dom(this).querySelector("[autofocus]")||this},get _focusableNodes(){return Polymer.IronFocusablesHelper.getTabbableNodes(this)},ready:function(){this.__shouldRemoveTabIndex= this.__isAnimating=!1;this.__firstFocusableNode=this.__lastFocusableNode=null;this.__rafs={};this.__scrollTop=this.__scrollLeft=this.__restoreFocusNode=null;this.__onCaptureScroll=this.__onCaptureScroll.bind(this);this.__rootNodes=null;this._ensureSetup()},attached:function(){this.opened&&this._openedChanged(this.opened);this._observer=Polymer.dom(this).observeNodes(this._onNodesChange)},detached:function(){Polymer.dom(this).unobserveNodes(this._observer);this._observer=null;for(var b in this.__rafs)null!== this.__rafs[b]&&cancelAnimationFrame(this.__rafs[b]);this.__rafs={};rj(this._manager,this);this.__isAnimating&&(this.opened?this._finishRenderOpened():(this._applyFocus(),this._finishRenderClosed()))},toggle:function(){this._setCanceled(!1);this.opened=!this.opened},open:function(){this._setCanceled(!1);this.opened=!0},close:function(){this._setCanceled(!1);this.opened=!1},cancel:function(b){this.fire("iron-overlay-canceled",b,{cancelable:!0}).defaultPrevented||(this._setCanceled(!0),this.opened= !1)},invalidateTabbables:function(){this.__firstFocusableNode=this.__lastFocusableNode=null},_ensureSetup:function(){this._overlaySetup||(this._overlaySetup=!0,this.style.outline="none",this.style.display="none")},_openedChanged:function(b){b?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true");this.isAttached&&(this.__isAnimating=!0,this.__deraf("__openedChanged",this.__openedChanged))},_canceledChanged:function(){this.closingReason=this.closingReason||{};this.closingReason.canceled= this.canceled},_withBackdropChanged:function(){this.withBackdrop&&!this.hasAttribute("tabindex")?(this.setAttribute("tabindex","-1"),this.__shouldRemoveTabIndex=!0):this.__shouldRemoveTabIndex&&(this.removeAttribute("tabindex"),this.__shouldRemoveTabIndex=!1);this.opened&&this.isAttached&&qj(this._manager)},_prepareRenderOpened:function(){this.__restoreFocusNode=this._manager.deepActiveElement;this._preparePositioning();this.refit();this._finishPositioning();this.noAutoFocus&&document.activeElement=== this._focusNode&&(this._focusNode.blur(),this.__restoreFocusNode.focus())},_renderOpened:function(){this._finishRenderOpened()},_renderClosed:function(){this._finishRenderClosed()},_finishRenderOpened:function(){this.notifyResize();this.__isAnimating=!1;this.fire("iron-overlay-opened")},_finishRenderClosed:function(){this.style.display="none";this.style.zIndex="";this.notifyResize();this.__isAnimating=!1;this.fire("iron-overlay-closed",this.closingReason)},_preparePositioning:function(){this.style.transition= this.style.webkitTransition="none";this.style.transform=this.style.webkitTransform="none";this.style.display=""},_finishPositioning:function(){this.style.display="none";this.scrollTop=this.scrollTop;this.style.transition=this.style.webkitTransition="";this.style.transform=this.style.webkitTransform="";this.style.display="";this.scrollTop=this.scrollTop},_applyFocus:function(){if(this.opened)this.noAutoFocus||this._focusNode.focus();else{this._focusNode.blur();this._focusedChild=null;if(this.restoreFocusOnClose&& this.__restoreFocusNode){var b=this._manager.deepActiveElement;(b===document.body||Polymer.dom(this).deepContains(b))&&this.__restoreFocusNode.focus()}this.__restoreFocusNode=null;(b=pj(this._manager))&&this!==b&&b._applyFocus()}},_onCaptureClick:function(b){this.noCancelOnOutsideClick||this.cancel(b)},_onCaptureFocus:function(b){if(this.withBackdrop){var d=Polymer.dom(b).path;-1===d.indexOf(this)?(b.stopPropagation(),this._applyFocus()):this._focusedChild=d[0]}},_onCaptureEsc:function(b){this.noCancelOnEscKey|| this.cancel(b)},_onCaptureTab:function(b){if(this.withBackdrop){this.__ensureFirstLastFocusables();var d=b.shiftKey,f=d?this.__firstFocusableNode:this.__lastFocusableNode;d=d?this.__lastFocusableNode:this.__firstFocusableNode;if(f===d)f=!0;else{var h=this._manager.deepActiveElement;f=h===f||h===this}f&&(b.preventDefault(),this._focusedChild=d,this._applyFocus())}},_onIronResize:function(){this.opened&&!this.__isAnimating&&this.__deraf("refit",this.refit)},_onNodesChange:function(){this.opened&&!this.__isAnimating&& (this.invalidateTabbables(),this.notifyResize())},__ensureFirstLastFocusables:function(){if(!this.__firstFocusableNode||!this.__lastFocusableNode){var b=this._focusableNodes;this.__firstFocusableNode=b[0];this.__lastFocusableNode=b[b.length-1]}},__openedChanged:function(){this.opened?(this._prepareRenderOpened(),oj(this._manager,this),this._applyFocus(),this._renderOpened()):(rj(this._manager,this),this._applyFocus(),this._renderClosed())},__deraf:function(b,d){var f=this.__rafs;null!==f[b]&&cancelAnimationFrame(f[b]); f[b]=requestAnimationFrame(function(){f[b]=null;d.call(this)}.bind(this))},__updateScrollObservers:function(b,d,f){b&&d&&this.__isValidScrollAction(f)?("lock"===f&&(this.__saveScrollPosition(),Polymer.IronScrollManager.pushScrollLock(this)),this.__addScrollListeners()):(Polymer.IronScrollManager.removeScrollLock(this),this.__removeScrollListeners())},__addScrollListeners:function(){if(!this.__rootNodes){this.__rootNodes=[];if(Polymer.Settings.useShadow)for(var b=this;b;)b.nodeType===Node.DOCUMENT_FRAGMENT_NODE&& b.host&&this.__rootNodes.push(b),b=b.host||b.assignedSlot||b.parentNode;this.__rootNodes.push(document)}this.__rootNodes.forEach(function(d){d.addEventListener("scroll",this.__onCaptureScroll,{capture:!0,passive:!0})},this)},__removeScrollListeners:function(){this.__rootNodes&&this.__rootNodes.forEach(function(b){b.removeEventListener("scroll",this.__onCaptureScroll,{capture:!0,passive:!0})},this);this.isAttached||(this.__rootNodes=null)},__isValidScrollAction:function(b){return"lock"===b||"refit"=== b||"cancel"===b},__onCaptureScroll:function(b){if(!(this.__isAnimating||0<=Polymer.dom(b).path.indexOf(this)))switch(this.scrollAction){case "lock":this.__restoreScrollPosition();break;case "refit":this.__deraf("refit",this.refit);break;case "cancel":this.cancel(b)}},__saveScrollPosition:function(){document.scrollingElement?(this.__scrollTop=document.scrollingElement.scrollTop,this.__scrollLeft=document.scrollingElement.scrollLeft):(this.__scrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop), this.__scrollLeft=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft))},__restoreScrollPosition:function(){document.scrollingElement?(document.scrollingElement.scrollTop=this.__scrollTop,document.scrollingElement.scrollLeft=this.__scrollLeft):(document.documentElement.scrollTop=document.body.scrollTop=this.__scrollTop,document.documentElement.scrollLeft=document.body.scrollLeft=this.__scrollLeft)}}; Polymer.IronOverlayBehavior=[Polymer.IronFitBehavior,Polymer.IronResizableBehavior,Polymer.IronOverlayBehaviorImpl]; </script> <script>//~~WEBPATH~~/neon-animation/neon-animatable-behavior.html.js Polymer.NeonAnimatableBehavior={properties:{animationConfig:{type:Object},entryAnimation:{observer:"_entryAnimationChanged",type:String},exitAnimation:{observer:"_exitAnimationChanged",type:String}},_entryAnimationChanged:function(){this.animationConfig=this.animationConfig||{};this.animationConfig.entry=[{name:this.entryAnimation,node:this}]},_exitAnimationChanged:function(){this.animationConfig=this.animationConfig||{};this.animationConfig.exit=[{name:this.exitAnimation,node:this}]},_copyProperties:function(b, d){for(var f in d)b[f]=d[f]},_cloneConfig:function(b){var d={isClone:!0};this._copyProperties(d,b);return d},_getAnimationConfigRecursive:function(b,d,f){if(this.animationConfig)if(this.animationConfig.value&&"function"===typeof this.animationConfig.value)this._warn(this._logf("playAnimation","Please put 'animationConfig' inside of your components 'properties' object instead of outside of it."));else{var h=b?this.animationConfig[b]:this.animationConfig;Array.isArray(h)||(h=[h]);if(h)for(var m,w=0;m= h[w];w++)if(m.animatable)m.animatable._getAnimationConfigRecursive(m.type||b,d,f);else if(m.id){var l=d[m.id];l?(l.isClone||(d[m.id]=this._cloneConfig(l),l=d[m.id]),this._copyProperties(l,m)):d[m.id]=m}else f.push(m)}},getAnimationConfig:function(b){var d={},f=[];this._getAnimationConfigRecursive(b,d,f);for(var h in d)f.push(d[h]);return f}}; </script> <script>//~~WEBPATH~~/neon-animation/neon-animation-runner-behavior.html.js Polymer.NeonAnimationRunnerBehaviorImpl={_configureAnimations:function(b){var d=[],f=[];if(0<b.length)for(var h,m=0;h=b[m];m++){var w=document.createElement(h.name);if(w.isNeonAnimation){var l=null;w.configure||(w.configure=function(){return null});l=w.configure(h);f.push({result:l,config:h})}else console.warn(this.is+":",h.name,"not found!")}for(b=0;b<f.length;b++){l=f[b].result;h=f[b].config;try{"function"!=typeof l.cancel&&(l=document.timeline.play(l))}catch(p){l=null,console.warn("Couldnt play", "(",h.name,").",p)}l&&d.push({neonAnimation:w,config:h,animation:l})}return d},_shouldComplete:function(b){for(var d=!0,f=0;f<b.length;f++)if("finished"!=b[f].animation.playState){d=!1;break}return d},_complete:function(b){for(var d=0;d<b.length;d++)b[d].neonAnimation.complete(b[d].config);for(d=0;d<b.length;d++)b[d].animation.cancel()},playAnimation:function(b,d){var f=this.getAnimationConfig(b);if(f){this._active=this._active||{};this._active[b]&&(this._complete(this._active[b]),delete this._active[b]); var h=this._configureAnimations(f);if(0==h.length)this.fire("neon-animation-finish",d,{bubbles:!1});else for(this._active[b]=h,f=0;f<h.length;f++)h[f].animation.onfinish=function(){this._shouldComplete(h)&&(this._complete(h),delete this._active[b],this.fire("neon-animation-finish",d,{bubbles:!1}))}.bind(this)}},cancelAnimation:function(){for(var b in this._active){var d=this._active[b],f;for(f in d)d[f].animation.cancel()}this._active={}}}; Polymer.NeonAnimationRunnerBehavior=[Polymer.NeonAnimatableBehavior,Polymer.NeonAnimationRunnerBehaviorImpl]; </script> <script>//~~WEBPATH~~/iron-dropdown/iron-dropdown-scroll-manager.html.js Polymer.IronDropdownScrollManager=Polymer.IronScrollManager; </script> <dom-module id="iron-dropdown"> <template> <style> :host { position: fixed; } #contentWrapper ::slotted(*) { overflow: auto; } #contentWrapper.animating ::slotted(*) { overflow: hidden; pointer-events: none; } </style> <div id="contentWrapper"> <slot id="content" name="dropdown-content"></slot> </div> </template> <script>//~~WEBPATH~~/iron-dropdown/iron-dropdown.html.js Polymer({is:"iron-dropdown",behaviors:[Polymer.IronControlState,Polymer.IronA11yKeysBehavior,Polymer.IronOverlayBehavior,Polymer.NeonAnimationRunnerBehavior],properties:{horizontalAlign:{type:String,value:"left",reflectToAttribute:!0},verticalAlign:{type:String,value:"top",reflectToAttribute:!0},openAnimationConfig:{type:Object},closeAnimationConfig:{type:Object},focusTarget:{type:Object},noAnimations:{type:Boolean,value:!1},allowOutsideScroll:{type:Boolean,value:!1,observer:"_allowOutsideScrollChanged"}}, listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},observers:["_updateOverlayPosition(positionTarget, verticalAlign, horizontalAlign, verticalOffset, horizontalOffset)"],get containedElement(){for(var b=Polymer.dom(this.$.content).getDistributedNodes(),d=0,f=b.length;d<f;d++)if(b[d].nodeType===Node.ELEMENT_NODE)return b[d]},ready:function(){this.scrollAction||(this.scrollAction=this.allowOutsideScroll?"refit":"lock");this._readied=!0},attached:function(){this.sizingTarget&&this.sizingTarget!== this||(this.sizingTarget=this.containedElement||this)},detached:function(){this.cancelAnimation()},_openedChanged:function(){this.opened&&this.disabled?this.cancel():(this.cancelAnimation(),this._updateAnimationConfig(),Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this,arguments))},_renderOpened:function(){!this.noAnimations&&this.animationConfig.open?(this.$.contentWrapper.classList.add("animating"),this.playAnimation("open")):Polymer.IronOverlayBehaviorImpl._renderOpened.apply(this,arguments)}, _renderClosed:function(){!this.noAnimations&&this.animationConfig.close?(this.$.contentWrapper.classList.add("animating"),this.playAnimation("close")):Polymer.IronOverlayBehaviorImpl._renderClosed.apply(this,arguments)},_onNeonAnimationFinish:function(){this.$.contentWrapper.classList.remove("animating");this.opened?this._finishRenderOpened():this._finishRenderClosed()},_updateAnimationConfig:function(){for(var b=this.containedElement,d=[].concat(this.openAnimationConfig||[]).concat(this.closeAnimationConfig|| []),f=0;f<d.length;f++)d[f].node=b;this.animationConfig={open:this.openAnimationConfig,close:this.closeAnimationConfig}},_updateOverlayPosition:function(){this.isAttached&&this.notifyResize()},_allowOutsideScrollChanged:function(b){this._readied&&(b?this.scrollAction&&"lock"!==this.scrollAction||(this.scrollAction="refit"):this.scrollAction="lock")},_applyFocus:function(){var b=this.focusTarget||this.containedElement;b&&this.opened&&!this.noAutoFocus?b.focus():Polymer.IronOverlayBehaviorImpl._applyFocus.apply(this, arguments)}}); </script> </dom-module> <script>//~~WEBPATH~~/neon-animation/neon-animation-behavior.html.js Polymer.NeonAnimationBehavior={properties:{animationTiming:{type:Object,value:function(){return{duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"both"}}}},isNeonAnimation:!0,created:function(){document.body.animate||console.warn("No web animations detected. This element will not function without a web animations polyfill.")},timingFromConfig:function(b){if(b.timing)for(var d in b.timing)this.animationTiming[d]=b.timing[d];return this.animationTiming},setPrefixedProperty:function(b,d,f){for(var h= {transform:["webkitTransform"],transformOrigin:["mozTransformOrigin","webkitTransformOrigin"]}[d],m,w=0;m=h[w];w++)b.style[m]=f;b.style[d]=f},complete:function(){}}; </script> <script>//~~WEBPATH~~/neon-animation/animations/fade-in-animation.html.js Polymer({is:"fade-in-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(b){return this._effect=new KeyframeEffect(b.node,[{opacity:"0"},{opacity:"1"}],this.timingFromConfig(b))}}); </script> <script>//~~WEBPATH~~/neon-animation/animations/fade-out-animation.html.js Polymer({is:"fade-out-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(b){return this._effect=new KeyframeEffect(b.node,[{opacity:"1"},{opacity:"0"}],this.timingFromConfig(b))}}); </script> <custom-style> <style is="custom-style"> html { --shadow-transition: { transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); }; --shadow-none: { box-shadow: none; }; /* from http://codepen.io/shyndman/pen/c5394ddf2e8b2a5c9185904b57421cdb */ --shadow-elevation-2dp: { box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); }; --shadow-elevation-3dp: { box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 1px 8px 0 rgba(0, 0, 0, 0.12), 0 3px 3px -2px rgba(0, 0, 0, 0.4); }; --shadow-elevation-4dp: { box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.4); }; --shadow-elevation-6dp: { box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.4); }; --shadow-elevation-8dp: { box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.4); }; --shadow-elevation-12dp: { box-shadow: 0 12px 16px 1px rgba(0, 0, 0, 0.14), 0 4px 22px 3px rgba(0, 0, 0, 0.12), 0 6px 7px -4px rgba(0, 0, 0, 0.4); }; --shadow-elevation-16dp: { box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.4); }; --shadow-elevation-24dp: { box-shadow: 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12), 0 11px 15px -7px rgba(0, 0, 0, 0.4); }; } </style> </custom-style> <script>//~~WEBPATH~~/paper-menu-button/paper-menu-button-animations.html.js Polymer({is:"paper-menu-grow-height-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(b){var d=b.node,f=d.getBoundingClientRect().height;return this._effect=new KeyframeEffect(d,[{height:f/2+"px"},{height:f+"px"}],this.timingFromConfig(b))}});Polymer({is:"paper-menu-grow-width-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(b){var d=b.node,f=d.getBoundingClientRect().width;return this._effect=new KeyframeEffect(d,[{width:f/2+"px"},{width:f+"px"}],this.timingFromConfig(b))}}); Polymer({is:"paper-menu-shrink-width-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(b){var d=b.node,f=d.getBoundingClientRect().width;return this._effect=new KeyframeEffect(d,[{width:f+"px"},{width:f-f/20+"px"}],this.timingFromConfig(b))}}); Polymer({is:"paper-menu-shrink-height-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(b){var d=b.node,f=d.getBoundingClientRect().height;this.setPrefixedProperty(d,"transformOrigin","0 0");return this._effect=new KeyframeEffect(d,[{height:f+"px",transform:"translateY(0)"},{height:f/2+"px",transform:"translateY(-20px)"}],this.timingFromConfig(b))}}); </script> <dom-module id="paper-menu-button"> <template> <style> :host { display: inline-block; position: relative; padding: 8px; outline: none; @apply --paper-menu-button; } :host([disabled]) { cursor: auto; color: var(--disabled-text-color); @apply --paper-menu-button-disabled; } iron-dropdown { @apply --paper-menu-button-dropdown; } .dropdown-content { @apply --shadow-elevation-2dp; position: relative; border-radius: 2px; background-color: var(--paper-menu-button-dropdown-background, var(--primary-background-color)); @apply --paper-menu-button-content; } :host([vertical-align="top"]) .dropdown-content { margin-bottom: 20px; margin-top: -10px; top: 10px; } :host([vertical-align="bottom"]) .dropdown-content { bottom: 10px; margin-bottom: -10px; margin-top: 20px; } #trigger { cursor: pointer; } </style> <div id="trigger" on-tap="toggle"> <slot name="dropdown-trigger"></slot> </div> <iron-dropdown id="dropdown" opened="{{opened}}" horizontal-align="[[horizontalAlign]]" vertical-align="[[verticalAlign]]" dynamic-align="[[dynamicAlign]]" horizontal-offset="[[horizontalOffset]]" vertical-offset="[[verticalOffset]]" no-overlap="[[noOverlap]]" open-animation-config="[[openAnimationConfig]]" close-animation-config="[[closeAnimationConfig]]" no-animations="[[noAnimations]]" focus-target="[[_dropdownContent]]" allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]" on-iron-overlay-canceled="__onIronOverlayCanceled"> <div slot="dropdown-content" class="dropdown-content"> <slot id="content" name="dropdown-content"></slot> </div> </iron-dropdown> </template> <script>//~~WEBPATH~~/paper-menu-button/paper-menu-button.html.js (function(){var b={ANIMATION_CUBIC_BEZIER:"cubic-bezier(.3,.95,.5,1)",MAX_ANIMATION_TIME_MS:400};Polymer.PaperMenuButton=function(){};Polymer.PaperMenuButton.prototype.registered=function(){};Polymer.PaperMenuButton.prototype.addOwnKeyBinding=function(){};Polymer.PaperMenuButton.prototype.removeOwnKeyBindings=function(){};Polymer.PaperMenuButton.prototype.keyboardEventMatchesKeys=function(){};Polymer.PaperMenuButton.prototype._collectKeyBindings=function(){};Polymer.PaperMenuButton.prototype._prepKeyBindings= function(){};Polymer.PaperMenuButton.prototype._addKeyBinding=function(){};Polymer.PaperMenuButton.prototype._resetKeyEventListeners=function(){};Polymer.PaperMenuButton.prototype._listenKeyEventListeners=function(){};Polymer.PaperMenuButton.prototype._unlistenKeyEventListeners=function(){};Polymer.PaperMenuButton.prototype._onKeyBindingEvent=function(){};Polymer.PaperMenuButton.prototype._triggerKeyHandler=function(){};Polymer.PaperMenuButton.prototype._focusBlurHandler=function(d){if(Polymer.Element)this._setFocused("focus"=== d.type);else if(d.target===this)this._setFocused("focus"===d.type);else if(this.__handleEventRetargeting){var f=Polymer.dom(d).localTarget;this.isLightDescendant(f)||this.fire(d.type,{sourceEvent:d},{node:this,bubbles:d.bubbles,cancelable:d.cancelable})}};Polymer.PaperMenuButton.prototype._changedControlState=function(){this._controlStateChanged&&this._controlStateChanged()};Polymer.PaperMenuButton.prototype._setFocused=function(){};Polymer.PaperMenuButton=Polymer({is:"paper-menu-button",behaviors:[Polymer.IronA11yKeysBehavior, Polymer.IronControlState],properties:{opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},horizontalAlign:{type:String,value:"left",reflectToAttribute:!0},verticalAlign:{type:String,value:"top",reflectToAttribute:!0},dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0,notify:!0},verticalOffset:{type:Number,value:0,notify:!0},noOverlap:{type:Boolean},noAnimations:{type:Boolean,value:!1},ignoreSelect:{type:Boolean,value:!1},closeOnActivate:{type:Boolean,value:!1},openAnimationConfig:{type:Object, value:function(){return[{name:"fade-in-animation",timing:{delay:100,duration:200}},{name:"paper-menu-grow-width-animation",timing:{delay:100,duration:150,easing:b.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-grow-height-animation",timing:{delay:100,duration:275,easing:b.ANIMATION_CUBIC_BEZIER}}]}},closeAnimationConfig:{type:Object,value:function(){return[{name:"fade-out-animation",timing:{duration:150}},{name:"paper-menu-shrink-width-animation",timing:{delay:100,duration:50,easing:b.ANIMATION_CUBIC_BEZIER}}, {name:"paper-menu-shrink-height-animation",timing:{duration:200,easing:"ease-in"}}]}},allowOutsideScroll:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!0},_dropdownContent:{type:Object}},hostAttributes:{role:"group","aria-haspopup":"true"},listeners:{"iron-activate":"_onIronActivate","iron-select":"_onIronSelect"},get contentElement(){for(var d=Polymer.dom(this.$.content).getDistributedNodes(),f=0,h=d.length;f<h;f++)if(d[f].nodeType===Node.ELEMENT_NODE)return d[f]},toggle:function(){this.opened? this.close():this.open()},open:function(){this.disabled||this.$.dropdown.open()},close:function(){this.$.dropdown.close()},_onIronSelect:function(){this.ignoreSelect||this.close()},_onIronActivate:function(){this.closeOnActivate&&this.close()},_openedChanged:function(d,f){d?(this._dropdownContent=this.contentElement,this.fire("paper-dropdown-open")):null!=f&&this.fire("paper-dropdown-close")},_disabledChanged:function(d){Polymer.IronControlState._disabledChanged.apply(this,arguments);d&&this.opened&& this.close()},__onIronOverlayCanceled:function(d){var f=this.$.trigger;-1<Polymer.dom(d.detail).path.indexOf(f)&&d.preventDefault()}});Object.keys(b).forEach(function(d){Polymer.PaperMenuButton[d]=b[d]})})(); </script> </dom-module> <script>//~~WEBPATH~~/iron-iconset-svg/iron-iconset-svg.html.js Polymer({is:"iron-iconset-svg",properties:{name:{type:String,observer:"_nameChanged"},size:{type:Number,value:24},rtlMirroring:{type:Boolean,value:!1},useGlobalRtlAttribute:{type:Boolean,value:!1}},created:function(){this._meta=new Polymer.IronMeta({type:"iconset",key:null,value:null})},attached:function(){this.style.display="none"},getIconNames:function(){this._icons=this._createIconMap();return Object.keys(this._icons).map(function(b){return this.name+":"+b},this)},applyIcon:function(b,d){this.removeIcon(b); if(d=this._cloneIcon(d,this.rtlMirroring&&this._targetIsRTL(b))){var f=Polymer.dom(b.root||b);f.insertBefore(d,f.childNodes[0]);return b._svgIcon=d}return null},removeIcon:function(b){b._svgIcon&&(Polymer.dom(b.root||b).removeChild(b._svgIcon),b._svgIcon=null)},_targetIsRTL:function(b){null==this.__targetIsRTL&&(this.useGlobalRtlAttribute?this.__targetIsRTL="rtl"===(document.body&&document.body.hasAttribute("dir")?document.body:document.documentElement).getAttribute("dir"):(b&&b.nodeType!==Node.ELEMENT_NODE&& (b=b.host),this.__targetIsRTL=b&&"rtl"===window.getComputedStyle(b).direction));return this.__targetIsRTL},_nameChanged:function(){this._meta.value=null;this._meta.key=this.name;this._meta.value=this;this.async(function(){this.fire("iron-iconset-added",this,{node:window})})},_createIconMap:function(){var b=Object.create(null);Polymer.dom(this).querySelectorAll("[id]").forEach(function(d){b[d.id]=d});return b},_cloneIcon:function(b,d){this._icons=this._icons||this._createIconMap();return this._prepareSvgClone(this._icons[b], this.size,d)},_prepareSvgClone:function(b,d,f){if(b){b=b.cloneNode(!0);var h=document.createElementNS("http://www.w3.org/2000/svg","svg");d=b.getAttribute("viewBox")||"0 0 "+d+" "+d;var m="pointer-events: none; display: block; width: 100%; height: 100%;";f&&b.hasAttribute("mirror-in-rtl")&&(m+="-webkit-transform:scale(-1,1);transform:scale(-1,1);transform-origin:center;");h.setAttribute("viewBox",d);h.setAttribute("preserveAspectRatio","xMidYMid meet");h.setAttribute("focusable","false");h.style.cssText= m;h.appendChild(b).removeAttribute("id");return h}return null}}); </script> <iron-iconset-svg name="paper-dropdown-menu" size="24"> <svg><defs> <g id="arrow-drop-down"><path d="M7 10l5 5 5-5z"></path></g> </defs></svg> </iron-iconset-svg> <dom-module id="paper-dropdown-menu-shared-styles"> <template> <style> :host { display: inline-block; position: relative; text-align: left; /* NOTE(cdata): Both values are needed, since some phones require the * value to be `transparent`. */ -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-tap-highlight-color: transparent; --paper-input-container-input: { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; box-sizing: border-box; cursor: pointer; }; @apply --paper-dropdown-menu; } :host([disabled]) { @apply --paper-dropdown-menu-disabled; } :host([noink]) paper-ripple { display: none; } :host([no-label-float]) paper-ripple { top: 8px; } paper-ripple { top: 12px; left: 0px; bottom: 8px; right: 0px; @apply --paper-dropdown-menu-ripple; } paper-menu-button { display: block; padding: 0; @apply --paper-dropdown-menu-button; } paper-input { @apply --paper-dropdown-menu-input; } iron-icon { color: var(--disabled-text-color); @apply --paper-dropdown-menu-icon; } </style> </template> </dom-module> <dom-module id="paper-dropdown-menu"> <template> <style include="paper-dropdown-menu-shared-styles"></style> <span role="button"></span> <paper-menu-button id="menuButton" vertical-align="[[verticalAlign]]" horizontal-align="[[horizontalAlign]]" dynamic-align="[[dynamicAlign]]" vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat, verticalOffset)]]" disabled="[[disabled]]" no-animations="[[noAnimations]]" on-iron-select="_onIronSelect" on-iron-deselect="_onIronDeselect" opened="{{opened}}" close-on-activate allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]"> <div class="dropdown-trigger" slot="dropdown-trigger"> <paper-ripple></paper-ripple> <paper-input type="text" invalid="[[invalid]]" readonly disabled="[[disabled]]" value="[[value]]" placeholder="[[placeholder]]" error-message="[[errorMessage]]" always-float-label="[[alwaysFloatLabel]]" no-label-float="[[noLabelFloat]]" label="[[label]]"> <iron-icon icon="paper-dropdown-menu:arrow-drop-down" suffix slot="suffix"></iron-icon> </paper-input> </div> <slot id="content" name="dropdown-content" slot="dropdown-content"></slot> </paper-menu-button> </template> <script>//~~WEBPATH~~/paper-dropdown-menu/paper-dropdown-menu.html.js Polymer({is:"paper-dropdown-menu",behaviors:[Polymer.IronButtonState,Polymer.IronControlState,Polymer.IronFormElementBehavior,Polymer.IronValidatableBehavior],properties:{selectedItemLabel:{type:String,notify:!0,readOnly:!0},selectedItem:{type:Object,notify:!0,readOnly:!0},value:{type:String,notify:!0},label:{type:String},placeholder:{type:String},errorMessage:{type:String},opened:{type:Boolean,notify:!0,value:!1,observer:"_openedChanged"},allowOutsideScroll:{type:Boolean,value:!1},noLabelFloat:{type:Boolean, value:!1,reflectToAttribute:!0},alwaysFloatLabel:{type:Boolean,value:!1},noAnimations:{type:Boolean,value:!1},horizontalAlign:{type:String,value:"right"},verticalAlign:{type:String,value:"top"},verticalOffset:Number,dynamicAlign:{type:Boolean},restoreFocusOnClose:{type:Boolean,value:!0}},listeners:{tap:"_onTap"},keyBindings:{"up down":"open",esc:"close"},hostAttributes:{role:"combobox","aria-autocomplete":"none","aria-haspopup":"true"},observers:["_selectedItemChanged(selectedItem)"],attached:function(){var b= this.contentElement;b&&b.selectedItem&&this._setSelectedItem(b.selectedItem)},get contentElement(){for(var b=Polymer.dom(this.$.content).getDistributedNodes(),d=0,f=b.length;d<f;d++)if(b[d].nodeType===Node.ELEMENT_NODE)return b[d]},open:function(){this.$.menuButton.open()},close:function(){this.$.menuButton.close()},_onIronSelect:function(b){this._setSelectedItem(b.detail.item)},_onIronDeselect:function(){this._setSelectedItem(null)},_onTap:function(b){Polymer.Gestures.findOriginalTarget(b)===this&& this.open()},_selectedItemChanged:function(b){this.value=b=b?b.label||b.getAttribute("label")||b.textContent.trim():"";this._setSelectedItemLabel(b)},_computeMenuVerticalOffset:function(b,d){return d?d:b?-4:8},_getValidity:function(){return this.disabled||!this.required||this.required&&!!this.value},_openedChanged:function(){var b=this.opened?"true":"false",d=this.contentElement;d&&d.setAttribute("aria-expanded",b)}}); </script> </dom-module> <script>//~~WEBPATH~~/iron-selector/iron-selection.html.js Polymer.IronSelection=function(b){this.selection=[];this.selectCallback=b};function uj(b,d,f){if(null!=d&&f!==b.isSelected(d)){if(f)b.selection.push(d);else{var h=b.selection.indexOf(d);0<=h&&b.selection.splice(h,1)}b.selectCallback&&b.selectCallback(d,f)}} Polymer.IronSelection.prototype={get:function(){return this.multi?this.selection.slice():this.selection[0]},clear:function(b){this.selection.slice().forEach(function(d){(!b||0>b.indexOf(d))&&uj(this,d,!1)},this)},isSelected:function(b){return 0<=this.selection.indexOf(b)},select:function(b){this.multi?this.toggle(b):this.get()!==b&&(uj(this,this.get(),!1),uj(this,b,!0))},toggle:function(b){uj(this,b,!this.isSelected(b))}}; </script> <script>//~~WEBPATH~~/iron-selector/iron-selectable.html.js Polymer.IronSelectableBehavior={properties:{attrForSelected:{type:String,value:null},selected:{type:String,notify:!0},selectedItem:{type:Object,readOnly:!0,notify:!0},activateEvent:{type:String,value:"tap",observer:"_activateEventChanged"},selectable:String,selectedClass:{type:String,value:"iron-selected"},selectedAttribute:{type:String,value:null},fallbackSelection:{type:String,value:null},items:{type:Array,readOnly:!0,notify:!0,value:function(){return[]}},_excludedLocalNames:{type:Object,value:function(){return{template:1, "dom-bind":1,"dom-if":1,"dom-repeat":1}}}},observers:["_updateAttrForSelected(attrForSelected)","_updateSelected(selected)","_checkFallback(fallbackSelection)"],created:function(){this._bindFilterItem=this._filterItem.bind(this);this._selection=new Polymer.IronSelection(this._applySelection.bind(this))},attached:function(){this._observer=this._observeItems(this);this._addListener(this.activateEvent)},detached:function(){this._observer&&Polymer.dom(this).unobserveNodes(this._observer);this._removeListener(this.activateEvent)}, indexOf:function(b){return this.items?this.items.indexOf(b):-1},select:function(b){this.selected=b},selectPrevious:function(){var b=this.items.length;b=(Number(this._valueToIndex(this.selected))-1+b)%b;this.selected=this._indexToValue(b)},selectNext:function(){var b=(Number(this._valueToIndex(this.selected))+1)%this.items.length;this.selected=this._indexToValue(b)},selectIndex:function(b){this.select(this._indexToValue(b))},forceSynchronousItemUpdate:function(){this._observer&&"function"===typeof this._observer.flush? this._observer.flush():this._updateItems()},get _shouldUpdateSelection(){return null!=this.selected},_checkFallback:function(){this._updateSelected()},_addListener:function(b){this.listen(this,b,"_activateHandler")},_removeListener:function(b){this.unlisten(this,b,"_activateHandler")},_activateEventChanged:function(b,d){this._removeListener(d);this._addListener(b)},_updateItems:function(){var b=Polymer.dom(this).queryDistributedElements(this.selectable||"*");b=Array.prototype.filter.call(b,this._bindFilterItem); this._setItems(b)},_updateAttrForSelected:function(){this.selectedItem&&(this.selected=this._valueForItem(this.selectedItem))},_updateSelected:function(){this._selectSelected(this.selected)},_selectSelected:function(){if(this.items){var b=this._valueToItem(this.selected);b?this._selection.select(b):this._selection.clear();this.fallbackSelection&&this.items.length&&void 0===this._selection.get()&&(this.selected=this.fallbackSelection)}},_filterItem:function(b){return!this._excludedLocalNames[b.localName]}, _valueToItem:function(b){return null==b?null:this.items[this._valueToIndex(b)]},_valueToIndex:function(b){if(this.attrForSelected)for(var d=0,f;f=this.items[d];d++){if(this._valueForItem(f)==b)return d}else return Number(b)},_indexToValue:function(b){if(this.attrForSelected){if(b=this.items[b])return this._valueForItem(b)}else return b},_valueForItem:function(b){if(!b)return null;if(!this.attrForSelected)return b=this.indexOf(b),-1===b?null:b;var d=b[Polymer.CaseMap.dashToCamelCase(this.attrForSelected)]; return void 0!=d?d:b.getAttribute(this.attrForSelected)},_applySelection:function(b,d){this.selectedClass&&this.toggleClass(this.selectedClass,d,b);this.selectedAttribute&&this.toggleAttribute(this.selectedAttribute,d,b);this._selectionChange();this.fire("iron-"+(d?"select":"deselect"),{item:b})},_selectionChange:function(){this._setSelectedItem(this._selection.get())},_observeItems:function(b){return Polymer.dom(b).observeNodes(function(d){this._updateItems();this._updateSelected();this.fire("iron-items-changed", d,{bubbles:!1,cancelable:!1})})},_activateHandler:function(b){b=b.target;for(var d=this.items;b&&b!=this;){var f=d.indexOf(b);if(0<=f){d=this._indexToValue(f);this._itemActivate(d,b);break}b=b.parentNode}},_itemActivate:function(b,d){this.fire("iron-activate",{selected:b,item:d},{cancelable:!0}).defaultPrevented||this.select(b)}}; </script> <script>//~~WEBPATH~~/iron-selector/iron-multi-selectable.html.js Polymer.IronMultiSelectableBehaviorImpl={properties:{multi:{type:Boolean,value:!1,observer:"multiChanged"},selectedValues:{type:Array,notify:!0,value:function(){return[]}},selectedItems:{type:Array,readOnly:!0,notify:!0,value:function(){return[]}}},observers:["_updateSelected(selectedValues.splices)"],select:function(b){this.multi?this._toggleSelected(b):this.selected=b},multiChanged:function(b){this._selection.multi=b;this._updateSelected()},get _shouldUpdateSelection(){return null!=this.selected|| null!=this.selectedValues&&this.selectedValues.length},_updateAttrForSelected:function(){this.multi?this.selectedItems&&0<this.selectedItems.length&&(this.selectedValues=this.selectedItems.map(function(b){return this._indexToValue(this.indexOf(b))},this).filter(function(b){return null!=b},this)):Polymer.IronSelectableBehavior._updateAttrForSelected.apply(this)},_updateSelected:function(){this.multi?this._selectMulti(this.selectedValues):this._selectSelected(this.selected)},_selectMulti:function(b){b= b||[];b=(this._valuesToItems(b)||[]).filter(function(f){return null!==f&&void 0!==f});this._selection.clear(b);for(var d=0;d<b.length;d++)uj(this._selection,b[d],!0);this.fallbackSelection&&!this._selection.get().length&&this._valueToItem(this.fallbackSelection)&&this.select(this.fallbackSelection)},_selectionChange:function(){var b=this._selection.get();this.multi?(this._setSelectedItems(b),this._setSelectedItem(b.length?b[0]:null)):null!==b&&void 0!==b?(this._setSelectedItems([b]),this._setSelectedItem(b)): (this._setSelectedItems([]),this._setSelectedItem(null))},_toggleSelected:function(b){var d=this.selectedValues.indexOf(b);0>d?this.push("selectedValues",b):this.splice("selectedValues",d,1)},_valuesToItems:function(b){return null==b?null:b.map(function(d){return this._valueToItem(d)},this)}};Polymer.IronMultiSelectableBehavior=[Polymer.IronSelectableBehavior,Polymer.IronMultiSelectableBehaviorImpl]; </script> <script>//~~WEBPATH~~/iron-menu-behavior/iron-menu-behavior.html.js Polymer.IronMenuBehaviorImpl={properties:{focusedItem:{observer:"_focusedItemChanged",readOnly:!0,type:Object},attrForItemTitle:{type:String},disabled:{type:Boolean,value:!1,observer:"_disabledChanged"}},_MODIFIER_KEYS:"Alt AltGraph CapsLock Control Fn FnLock Hyper Meta NumLock OS ScrollLock Shift Super Symbol SymbolLock".split(" "),_SEARCH_RESET_TIMEOUT_MS:1E3,_previousTabIndex:0,hostAttributes:{role:"menu"},observers:["_updateMultiselectable(multi)"],listeners:{focus:"_onFocus",keydown:"_onKeydown", "iron-items-changed":"_onIronItemsChanged"},keyBindings:{up:"_onUpKey",down:"_onDownKey",esc:"_onEscKey","shift+tab:keydown":"_onShiftTabDown"},attached:function(){this._resetTabindices()},select:function(b){this._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAsync),this._defaultFocusAsync=null);var d=this._valueToItem(b);d&&d.hasAttribute("disabled")||(this._setFocusedItem(d),Polymer.IronMultiSelectableBehaviorImpl.select.apply(this,arguments))},_resetTabindices:function(){var b=this.multi? this.selectedItems&&this.selectedItems[0]:this.selectedItem;this.items.forEach(function(d){d.setAttribute("tabindex",d===b?"0":"-1")},this)},_updateMultiselectable:function(b){b?this.setAttribute("aria-multiselectable","true"):this.removeAttribute("aria-multiselectable")},_focusWithKeyboardEvent:function(b){if(-1===this._MODIFIER_KEYS.indexOf(b.key)){this.cancelDebouncer("_clearSearchText");var d=this._searchText||"";d+=(b.key&&1==b.key.length?b.key:String.fromCharCode(b.keyCode)).toLocaleLowerCase(); b=d.length;for(var f=0,h;h=this.items[f];f++)if(!h.hasAttribute("disabled")){var m=this.attrForItemTitle||"textContent";m=(h[m]||h.getAttribute(m)||"").trim();if(!(m.length<b)&&m.slice(0,b).toLocaleLowerCase()==d){this._setFocusedItem(h);break}}this._searchText=d;this.debounce("_clearSearchText",this._clearSearchText,this._SEARCH_RESET_TIMEOUT_MS)}},_clearSearchText:function(){this._searchText=""},_focusPrevious:function(){for(var b=this.items.length,d=Number(this.indexOf(this.focusedItem)),f=1;f< b+1;f++){var h=this.items[(d-f+b)%b];if(!h.hasAttribute("disabled")){var m=Polymer.dom(h).getOwnerRoot()||document;this._setFocusedItem(h);if(Polymer.dom(m).activeElement==h)break}}},_focusNext:function(){for(var b=this.items.length,d=Number(this.indexOf(this.focusedItem)),f=1;f<b+1;f++){var h=this.items[(d+f)%b];if(!h.hasAttribute("disabled")){var m=Polymer.dom(h).getOwnerRoot()||document;this._setFocusedItem(h);if(Polymer.dom(m).activeElement==h)break}}},_applySelection:function(b,d){d?b.setAttribute("aria-selected", "true"):b.removeAttribute("aria-selected");Polymer.IronSelectableBehavior._applySelection.apply(this,arguments)},_focusedItemChanged:function(b,d){d&&d.setAttribute("tabindex","-1");!b||b.hasAttribute("disabled")||this.disabled||(b.setAttribute("tabindex","0"),b.focus())},_onIronItemsChanged:function(b){b.detail.addedNodes.length&&this._resetTabindices()},_onShiftTabDown:function(){var b=this.getAttribute("tabindex");Polymer.IronMenuBehaviorImpl._shiftTabPressed=!0;this._setFocusedItem(null);this.setAttribute("tabindex", "-1");this.async(function(){this.setAttribute("tabindex",b);Polymer.IronMenuBehaviorImpl._shiftTabPressed=!1},1)},_onFocus:function(b){!Polymer.IronMenuBehaviorImpl._shiftTabPressed&&(b=Polymer.dom(b).rootTarget,b===this||"undefined"===typeof b.tabIndex||this.isLightDescendant(b))&&(this._defaultFocusAsync=this.async(function(){var d=this.multi?this.selectedItems&&this.selectedItems[0]:this.selectedItem;this._setFocusedItem(null);d?this._setFocusedItem(d):this.items[0]&&this._focusNext()}))},_onUpKey:function(b){this._focusPrevious(); b.detail.keyboardEvent.preventDefault()},_onDownKey:function(b){this._focusNext();b.detail.keyboardEvent.preventDefault()},_onEscKey:function(){var b=this.focusedItem;b&&b.blur()},_onKeydown:function(b){this.keyboardEventMatchesKeys(b,"up down esc")||this._focusWithKeyboardEvent(b);b.stopPropagation()},_activateHandler:function(b){Polymer.IronSelectableBehavior._activateHandler.call(this,b);b.stopPropagation()},_disabledChanged:function(b){b?(this._previousTabIndex=this.hasAttribute("tabindex")?this.tabIndex: 0,this.removeAttribute("tabindex")):this.hasAttribute("tabindex")||this.setAttribute("tabindex",this._previousTabIndex)}};Polymer.IronMenuBehaviorImpl._shiftTabPressed=!1;Polymer.IronMenuBehavior=[Polymer.IronMultiSelectableBehavior,Polymer.IronA11yKeysBehavior,Polymer.IronMenuBehaviorImpl]; </script> <dom-module id="paper-listbox"> <template> <style> :host { display: block; padding: 8px 0; background: var(--paper-listbox-background-color, var(--primary-background-color)); color: var(--paper-listbox-color, var(--primary-text-color)); @apply --paper-listbox; } </style> <slot></slot> </template> <script>//~~WEBPATH~~/paper-listbox/paper-listbox.html.js Polymer({is:"paper-listbox",behaviors:[Polymer.IronMenuBehavior],hostAttributes:{role:"listbox"}}); </script> </dom-module> <script>//~~WEBPATH~~/paper-item/paper-item-behavior.html.js Polymer.PaperItemBehaviorImpl={hostAttributes:{role:"option",tabindex:"0"}};Polymer.PaperItemBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperItemBehaviorImpl]; </script> <dom-module id="paper-item-shared-styles"> <template> <style> :host, .paper-item { display: block; position: relative; min-height: var(--paper-item-min-height, 48px); padding: 0px 16px; } .paper-item { @apply --paper-font-subhead; border:none; outline: none; background: white; width: 100%; text-align: left; } :host([hidden]), .paper-item[hidden] { display: none !important; } :host(.iron-selected), .paper-item.iron-selected { font-weight: var(--paper-item-selected-weight, bold); @apply --paper-item-selected; } :host([disabled]), .paper-item[disabled] { color: var(--paper-item-disabled-color, var(--disabled-text-color)); @apply --paper-item-disabled; } :host(:focus), .paper-item:focus { position: relative; outline: 0; @apply --paper-item-focused; } :host(:focus):before, .paper-item:focus:before { @apply --layout-fit; background: currentColor; content: ''; opacity: var(--dark-divider-opacity); pointer-events: none; @apply --paper-item-focused-before; } </style> </template> </dom-module> <dom-module id="paper-item"> <template> <style include="paper-item-shared-styles"> :host { @apply --layout-horizontal; @apply --layout-center; @apply --paper-font-subhead; @apply --paper-item; } </style> <slot></slot> </template> <script>//~~WEBPATH~~/paper-item/paper-item.html.js Polymer({is:"paper-item",behaviors:[Polymer.PaperItemBehavior]}); </script> </dom-module> <script>//~~WEBPATH~~/tf-imports/plottable.js /* MIT MIT @fileoverview Implements the Signature API to help in comparing when two Plottable objects have "changed". Memoization in Plottable is complicated by mutable scales and datasets. We cannot simply reference compare two e.g. scales since it may have internally mutated. To resolve this, we write a recursive Signature interface that holds an immutable snapshot of whatever state the scale/data was in at the time. Then on memoized function invocation we sign the new inputs and compare the signatures to decide if we should recompute. We must hand-write a signature for each custom class we wish to support. MIT @fileoverview manually add d3-selection-multi to d3 default bundle. Most of this code is copied from d3-selection-multi@1.0.0. See https://github.com/d3/d3-selection-multi/issues/11 for why we have to do this MIT @fileoverview Implements a convenient thunk function to handle the common case of creating a memoized function that takes its inputs from mutable class properties. MIT @fileoverview Implements a function memoizer using the Signature API. Plottable 3.7.0 (https://github.com/palantir/plottable) Copyright 2014-2017 Palantir Technologies Licensed under MIT (https://github.com/palantir/plottable/blob/master/LICENSE) is-plain-object <https://github.com/jonschlinkert/is-plain-object> Copyright (c) 2014-2017, Jon Schlinkert. Released under the MIT License. isobject <https://github.com/jonschlinkert/isobject> Copyright (c) 2014-2017, Jon Schlinkert. Released under the MIT License. */ function vj(b){return function(d){function f(m){if(h[m])return h[m].exports;var w=h[m]={i:m,l:!1,exports:{}};d[m].call(w.exports,w,w.exports,f);w.l=!0;return w.exports}var h={};f.m=d;f.c=h;f.i=function(m){return m};f.d=function(m,w,l){f.o(m,w)||Object.defineProperty(m,w,{configurable:!1,enumerable:!0,get:l})};f.n=function(m){var w=m&&m.__esModule?function(){return m["default"]}:function(){return m};f.d(w,"a",w);return w};f.o=function(m,w){return Object.prototype.hasOwnProperty.call(m,w)};f.p="";return f(f.s= 140)}([function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}d=h(107);f.Array=d;d=h(110);f.Color=d;d=h(55);f.DOM=d;d=h(56);f.Math=d;d=h(113);f.Object=d;d=h(57);f.RTree=d;d=h(115);f.Stacking=d;d=h(35);f.Window=d;m(h(108));m(h(109));m(h(12));m(h(111));m(h(112));m(h(58));m(h(116))},function(d){d.exports=b},function(d,f,h){function m(J,F,E){var L=F.accessor;F=F.scale;if(null==F)return[];var N=J.data();null!=E&&(N=N.filter(function(M,R){return E(M,R,J)}));N=N.map(function(M,R){return L(M, R,J)});return F.extentOfValues(N)}var w=this&&this.__extends||function(J,F){function E(){this.constructor=J}for(var L in F)F.hasOwnProperty(L)&&(J[L]=F[L]);J.prototype=null===F?Object.create(F):(E.prototype=F.prototype,new E)},l=h(1),p=h(7);d=h(4);var n=h(18),q=h(6),t=h(9),v=h(20),z=h(0),y=h(12),x=h(10),D=h(51),G=h(52);f.Renderer=x.makeEnum(["svg","canvas"]);h=function(J){function F(){var E=J.call(this)||this;E._dataChanged=!1;E._attrExtents={};E._animate=!1;E._animators={};E._propertyExtents={}; E._resetEntityStore=function(){E._cachedEntityStore=void 0};E._overflowHidden=!0;E.addClass("plot");E._datasetToDrawer=new z.Map;E._attrBindings=l.map();E._includedValuesProvider=function(N,M){return E._includedValuesForScale(N,M)};E._renderCallback=function(){return E.render()};E._onDatasetUpdateCallback=function(){return E._onDatasetUpdate()};E._propertyBindings=l.map();var L=(new p.Easing).maxTotalDuration(F._ANIMATION_MAX_DURATION);E.animator(D.Animator.MAIN,L);E.animator(D.Animator.RESET,new p.Null); E._deferredResetEntityStore=z.Window.debounce(G.DeferredRenderer.DEFERRED_RENDERING_DELAY,E._resetEntityStore);return E}w(F,J);F.getTotalDrawTime=function(E,L){return L.reduce(function(N,M){return N+M.animator.totalTime(E.length)},0)};F.applyDrawSteps=function(E,L){return E.map(function(N){var M=N.attrToProjector,R={};Object.keys(M).forEach(function(Z){R[Z]=function(T,Y){return M[Z](T,Y,L)}});return{attrToAppliedProjector:R,animator:N.animator}})};F.prototype.anchor=function(E){E=y.coerceExternalD3(E); J.prototype.anchor.call(this,E);this._dataChanged=!0;this._resetEntityStore();this._updateExtents();return this};F.prototype._setup=function(){var E=this;this._isSetup||(J.prototype._setup.call(this),null!=this._canvas&&this._appendCanvasNode(),this._renderArea=this.content().append("g").classed("render-area",!0),this.datasets().forEach(function(L){return E._createNodesForDataset(L)}))};F.prototype._appendCanvasNode=function(){var E=this.element().select(".plot-canvas-container");E.empty()&&(E=this.element().append("div").classed("plot-canvas-container", !0),E.node().appendChild(this._canvas.node()))};F.prototype.setBounds=function(E,L,N,M){J.prototype.setBounds.call(this,E,L,N,M);this._resetEntityStore();null!=this._canvas&&(this._bufferCanvas&&!this._bufferCanvasValid&&(this._bufferCanvas.attr("width",this._canvas.attr("width")),this._bufferCanvas.attr("height",this._canvas.attr("height")),(N=this._bufferCanvas.node().getContext("2d"))&&N.drawImage(this._canvas.node(),0,0),this._bufferCanvasValid=!0),N=null!=window.devicePixelRatio?window.devicePixelRatio: 1,this._canvas.attr("width",E*N),this._canvas.attr("height",L*N),M=this._canvas.node().getContext("2d"))&&(M.setTransform(N,0,0,N,0,0),this._bufferCanvas&&M.drawImage(this._bufferCanvas.node(),0,0,E,L))};F.prototype.destroy=function(){var E=this;J.prototype.destroy.call(this);this._scales().forEach(function(L){return L.offUpdate(E._renderCallback)});this.datasets([])};F.prototype._createNodesForDataset=function(E){E=this._datasetToDrawer.get(E);"svg"===this.renderer()?E.useSVG(this._renderArea):E.useCanvas(this._canvas); return E};F.prototype._createDrawer=function(){return new q.ProxyDrawer(function(){return new t.SVGDrawer("path","")},function(E){return new n.CanvasDrawer(E,function(){})})};F.prototype._getAnimator=function(E){return this._animateOnNextRender()?this._animators[E]||new p.Null:new p.Null};F.prototype._onDatasetUpdate=function(){this._updateExtents();this._dataChanged=!0;this._resetEntityStore();this.renderLowPriority()};F.prototype.attr=function(E,L,N){if(null==L)return this._attrBindings.get(E); this._bindAttr(E,L,N);this.render();return this};F.prototype._bindProperty=function(E,L,N,M){var R=this._propertyBindings.get(E);R=null!=R?R.scale:null;this._propertyBindings.set(E,{accessor:"function"===typeof L?L:function(){return L},scale:N,postScale:M});null!=R&&this._uninstallScaleForKey(R,E);null!=N&&this._installScaleForKey(N,E);this._clearAttrToProjectorCache()};F.prototype._bindAttr=function(E,L,N){var M=this._attrBindings.get(E);M=null!=M?M.scale:null;this._attrBindings.set(E,{accessor:"function"=== typeof L?L:function(){return L},scale:N});null!=M&&this._uninstallScaleForKey(M,E);null!=N&&this._installScaleForKey(N,E);this._clearAttrToProjectorCache()};F.prototype._clearAttrToProjectorCache=function(){delete this._cachedAttrToProjector};F.prototype._getAttrToProjector=function(){null==this._cachedAttrToProjector&&(this._cachedAttrToProjector=this._generateAttrToProjector());return z.Object.assign({},this._cachedAttrToProjector)};F.prototype._generateAttrToProjector=function(){var E={};this._attrBindings.each(function(N, M){E[M]=F._scaledAccessor(N)});var L=this._propertyProjectors();Object.keys(L).forEach(function(N){null==E[N]&&(E[N]=L[N])});return E};F.prototype.renderImmediately=function(){J.prototype.renderImmediately.call(this);this._isAnchored&&(this._paint(),this._dataChanged=!1);return this};F.prototype.renderLowPriority=function(){this._renderCallback()};F.prototype.animated=function(E){if(null==E)return this._animate;this._animate=E;return this};F.prototype.detach=function(){J.prototype.detach.call(this); this._updateExtents();return this};F.prototype._scales=function(){var E=[];this._attrBindings.each(function(L){L=L.scale;null!=L&&-1===E.indexOf(L)&&E.push(L)});this._propertyBindings.each(function(L){L=L.scale;null!=L&&-1===E.indexOf(L)&&E.push(L)});return E};F.prototype._updateExtents=function(){var E=this;this._resetEntityStore();this._scales().forEach(function(L){return L.addIncludedValuesProvider(E._includedValuesProvider)})};F.prototype._filterForProperty=function(){return null};F.prototype.getExtentsForAttr= function(E){var L=this;null==this._attrExtents[E]&&(this._attrExtents[E]=v.memThunk(function(){return L.datasets()},function(){return L._attrBindings.get(E)},function(N,M){return null==M||null==M.accessor?null:N.map(function(R){return m(R,M,null)})}));return this._attrExtents[E]()};F.prototype.getExtentsForProperty=function(E){var L=this;null==this._propertyExtents[E]&&(this._propertyExtents[E]=v.memThunk(function(){return L.datasets()},function(){return L._propertyBindings.get(E)},function(){return L._filterForProperty(E)}, function(N,M,R){return null==M||null==M.accessor?null:N.map(function(Z){return m(Z,M,R)})}));return this._propertyExtents[E]()};F.prototype._includedValuesForScale=function(E,L){var N=this;if(!this._isAnchored&&!L)return[];var M=[];this._attrBindings.each(function(R,Z){R.scale===E&&(R=N.getExtentsForAttr(Z),null!=R&&(M=M.concat(l.merge(R))))});this._propertyBindings.each(function(R,Z){R.scale===E&&(R=N.getExtentsForProperty(Z),null!=R&&(M=M.concat(l.merge(R))))});return M};F.prototype.animator=function(E, L){if(void 0===L)return this._animators[E];this._animators[E]=L;return this};F.prototype.renderer=function(E){var L=this;if(void 0===E)return null==this._canvas?"svg":"canvas";null==this._canvas&&"canvas"===E?(this._canvas=l.select(document.createElement("canvas")).classed("plot-canvas",!0),this._bufferCanvas=l.select(document.createElement("canvas")),null!=this.element()&&this._appendCanvasNode(),this._datasetToDrawer.forEach(function(N){N.useCanvas(L._canvas)}),this.render()):null!=this._canvas&& "svg"==E&&(this._canvas.remove(),this._bufferCanvas=this._canvas=null,this._datasetToDrawer.forEach(function(N){N.useSVG(L._renderArea)}),this.render());return this};F.prototype.addDataset=function(E){this._addDataset(E);this._onDatasetUpdate();return this};F.prototype._addDataset=function(E){this._removeDataset(E);var L=this._createDrawer(E);this._datasetToDrawer.set(E,L);this._isSetup&&this._createNodesForDataset(E);E.onUpdate(this._onDatasetUpdateCallback);return this};F.prototype.removeDataset= function(E){this._removeDataset(E);this._onDatasetUpdate()};F.prototype._removeDataset=function(E){if(-1===this.datasets().indexOf(E))return this;this._removeDatasetNodes(E);E.offUpdate(this._onDatasetUpdateCallback);this._datasetToDrawer.delete(E);return this};F.prototype._removeDatasetNodes=function(E){this._datasetToDrawer.get(E).remove()};F.prototype.datasets=function(E){var L=this,N=[];this._datasetToDrawer.forEach(function(M,R){return N.push(R)});if(null==E)return N;N.forEach(function(M){return L._removeDataset(M)}); E.forEach(function(M){return L._addDataset(M)});this._onDatasetUpdate();return this};F.prototype._generateDrawSteps=function(){return[{attrToProjector:this._getAttrToProjector(),animator:new p.Null}]};F.prototype._additionalPaint=function(){};F.prototype._buildLightweightPlotEntities=function(E){var L=this,N=[];E.forEach(function(M,R){var Z=L._datasetToDrawer.get(M),T=0;M.data().forEach(function(Y,ma){var va=L._pixelPoint(Y,ma,M);z.Math.isNaN(va.x)||z.Math.isNaN(va.y)||(N.push({datum:Y,get position(){return L._pixelPoint.call(L, Y,ma,M)},index:ma,dataset:M,datasetIndex:R,component:L,drawer:Z,validDatumIndex:T}),T++)})});return N};F.prototype._getDataToDraw=function(){var E=new z.Map;this.datasets().forEach(function(L){return E.set(L,L.data())});return E};F.prototype._paint=function(){var E=this;delete this._cachedAttrToProjector;var L=this._generateDrawSteps(),N=this._getDataToDraw(),M=this.datasets().map(function(Z){return E._datasetToDrawer.get(Z)});if("canvas"===this.renderer()){var R=this._canvas.node();R.getContext("2d").clearRect(0, 0,R.clientWidth,R.clientHeight);this._bufferCanvasValid=!1}this.datasets().forEach(function(Z,T){var Y=F.applyDrawSteps(L,Z);M[T].draw(N.get(Z),Y)});R=this.datasets().map(function(Z){return F.getTotalDrawTime(N.get(Z),L)});R=z.Math.max(R,0);this._additionalPaint(R)};F.prototype.selections=function(E){var L=this;void 0===E&&(E=this.datasets());if("canvas"===this.renderer())return l.selectAll();var N=[];E.forEach(function(M){M=L._datasetToDrawer.get(M);null!=M&&(M=M.getVisualPrimitives(),N.push.apply(N, M))});return l.selectAll(N)};F.prototype.entities=function(E){var L=this;return this._getEntityStore(E).entities().map(function(N){return L._lightweightPlotEntityToPlotEntity(N)})};F.prototype._getEntityStore=function(E){function L(R){return N._entityBounds(R)}var N=this;if(void 0!==E){var M=new z.EntityStore;M.addAll(this._buildLightweightPlotEntities(E),L,this._localOriginBounds());return M}void 0===this._cachedEntityStore&&(M=new z.EntityStore,M.addAll(this._buildLightweightPlotEntities(this.datasets()), L,this._localOriginBounds()),this._cachedEntityStore=M);return this._cachedEntityStore};F.prototype._localOriginBounds=function(){return{topLeft:{x:0,y:0},bottomRight:{x:this.width(),y:this.height()}}};F.prototype._entityBounds=function(E){E=this._pixelPoint(E.datum,E.index,E.dataset);return{x:E.x,y:E.y,width:0,height:0}};F.prototype._lightweightPlotEntityToPlotEntity=function(E){return{bounds:this._entityBounds(E),component:E.component,dataset:E.dataset,datasetIndex:E.datasetIndex,datum:E.datum, index:E.index,position:E.position,selection:l.select(E.drawer.getVisualPrimitives()[E.validDatumIndex])}};F.prototype.entitiesAt=function(){throw Error("plots must implement entitiesAt");};F.prototype.entityNearest=function(E){E=this._getEntityStore().entityNearest(E);return void 0===E?void 0:this._lightweightPlotEntityToPlotEntity(E)};F.prototype.entitiesIn=function(E,L){return this.entitiesInBounds(null==L?{x:E.topLeft.x,y:E.topLeft.y,width:E.bottomRight.x-E.topLeft.x,height:E.bottomRight.y-E.topLeft.y}: {x:E.min,y:L.min,width:E.max-E.min,height:L.max-L.min})};F.prototype.entitiesInBounds=function(E){var L=this;if(E=this._getEntityStore().entitiesInBounds(E))return E.map(function(N){return L._lightweightPlotEntityToPlotEntity(N)})};F.prototype.entitiesInXBounds=function(E){var L=this;if(E=this._getEntityStore().entitiesInXBounds(E))return E.map(function(N){return L._lightweightPlotEntityToPlotEntity(N)})};F.prototype.entitiesInYBounds=function(E){var L=this;if(E=this._getEntityStore().entitiesInYBounds(E))return E.map(function(N){return L._lightweightPlotEntityToPlotEntity(N)})}; F.prototype._uninstallScaleForKey=function(E){E.offUpdate(this._renderCallback);E.offUpdate(this._deferredResetEntityStore);E.removeIncludedValuesProvider(this._includedValuesProvider)};F.prototype._installScaleForKey=function(E){E.onUpdate(this._renderCallback);E.onUpdate(this._deferredResetEntityStore);E.addIncludedValuesProvider(this._includedValuesProvider)};F.prototype._propertyProjectors=function(){return{}};F._scaledAccessor=function(E){var L=E.scale,N=E.accessor,M=E.postScale,R=null==L?N: function(Z,T,Y){return L.scale(N(Z,T,Y))};return null==M?R:function(Z,T,Y){return M(R(Z,T,Y),Z,T,Y)}};F.prototype._pixelPoint=function(){return{x:0,y:0}};F.prototype._animateOnNextRender=function(){return this._animate&&this._dataChanged};return F}(d.Component);h._ANIMATION_MAX_DURATION=600;f.Plot=h},function(d,f,h){function m(p){for(var n in p)f.hasOwnProperty(n)||(f[n]=p[n])}d=h(105);f.TickGenerators=d;m(h(54));m(h(101));m(h(102));m(h(103));m(h(104));m(h(106));var w=h(54),l=h(11);f.isTransformable= function(p){return p instanceof l.QuantitativeScale||p instanceof w.Category}},function(d,f,h){var m=h(1),w=h(30),l=h(0),p=h(12);d=h(10);f.XAlignment=d.makeEnum(["left","center","right"]);f.YAlignment=d.makeEnum(["top","center","bottom"]);d=function(){function n(){this._overflowHidden=!1;this._origin={x:0,y:0};this._xAlignment="left";this._yAlignment="top";this._isAnchored=this._isSetup=!1;this._cssClasses=new l.Set;this._destroyed=!1;this._onAnchorCallbacks=new l.CallbackSet;this._onDetachCallbacks= new l.CallbackSet;this._cssClasses.add("component")}n.prototype.anchor=function(q){q=p.coerceExternalD3(q);if(this._destroyed)throw Error("Can't reuse destroy()-ed Components!");this.isRoot()&&(this._rootElement=q,this._rootElement.classed("plottable",!0));null!=this._element?q.node().appendChild(this._element.node()):(this._element=q.append("div"),this._setup());this._isAnchored=!0;this._onAnchorCallbacks.callCallbacks(this);return this};n.prototype.onAnchor=function(q){this._isAnchored&&q(this); this._onAnchorCallbacks.add(q)};n.prototype.offAnchor=function(q){this._onAnchorCallbacks.delete(q)};n.prototype._setup=function(){var q=this;this._isSetup||(this._cssClasses.forEach(function(t){q._element.classed(t,!0)}),this._cssClasses=new l.Set,this._backgroundContainer=this._element.append("svg").classed("background-container",!0),this._content=this._element.append("svg").classed("content",!0),this._foregroundContainer=this._element.append("svg").classed("foreground-container",!0),this._overflowHidden? this._content.classed("component-overflow-hidden",!0):this._content.classed("component-overflow-visible",!0),this._isSetup=!0)};n.prototype.requestedSpace=function(){return{minWidth:0,minHeight:0}};n.prototype.computeLayout=function(q,t,v){if(null==q||null==t||null==v){if(null==this._element)throw Error("anchor() must be called before computeLayout()");if(null!=this._rootElement)q={x:0,y:0},v=this._rootElement.node(),t=l.DOM.elementWidth(v),v=l.DOM.elementHeight(v);else throw Error("null arguments cannot be passed to computeLayout() on a non-root, unanchored node"); }var z=this._sizeFromOffer(t,v),y=z.height;z=z.width;this.setBounds(z,y,q.x+(t-z)*n._xAlignToProportion[this._xAlignment],q.y+(v-y)*n._yAlignToProportion[this._yAlignment]);return this};n.prototype.setBounds=function(q,t,v,z){void 0===v&&(v=0);void 0===z&&(z=0);this._width=q;this._height=t;this._origin={x:v,y:z};null!=this._element&&this._element.styles({left:v+"px",height:t+"px",top:z+"px",width:q+"px"});null!=this._resizeHandler&&this._resizeHandler({width:q,height:t})};n.prototype._sizeFromOffer= function(q,t){var v=this.requestedSpace(q,t);return{width:this.fixedWidth()?Math.min(q,v.minWidth):q,height:this.fixedHeight()?Math.min(t,v.minHeight):t}};n.prototype.render=function(){this._isAnchored&&this._isSetup&&0<=this.width()&&0<=this.height()&&w.registerToRender(this);return this};n.prototype.renderLowPriority=function(){this.render()};n.prototype._scheduleComputeLayout=function(){this._isAnchored&&this._isSetup&&w.registerToComputeLayoutAndRender(this)};n.prototype.onResize=function(q){this._resizeHandler= q;return this};n.prototype.renderImmediately=function(){return this};n.prototype.redraw=function(){this._isAnchored&&this._isSetup&&(this.isRoot()?this._scheduleComputeLayout():this.parent().redraw());return this};n.prototype.invalidateCache=function(){};n.prototype.renderTo=function(q){this.detach();if(null!=q){q="string"===typeof q?m.select(q):q instanceof Element?m.select(q):p.coerceExternalD3(q);if(!q.node()||null==q.node().nodeName)throw Error("Plottable requires a valid Element to renderTo"); if("svg"===q.node().nodeName)throw Error("Plottable 3.x and later can only renderTo an HTML component; pass a div instead!");this.anchor(q)}if(null==this._element)throw Error("If a Component has never been rendered before, then renderTo must be given a node to render to, or a d3.Selection, or a selector string");w.registerToComputeLayoutAndRender(this);w.flush()};n.prototype.xAlignment=function(q){if(null==q)return this._xAlignment;q=q.toLowerCase();if(null==n._xAlignToProportion[q])throw Error("Unsupported alignment: "+ q);this._xAlignment=q;this.redraw();return this};n.prototype.yAlignment=function(q){if(null==q)return this._yAlignment;q=q.toLowerCase();if(null==n._yAlignToProportion[q])throw Error("Unsupported alignment: "+q);this._yAlignment=q;this.redraw();return this};n.prototype.hasClass=function(q){return null==q?!1:null==this._element?this._cssClasses.has(q):this._element.classed(q)};n.prototype.addClass=function(q){null!=q&&(null==this._element?this._cssClasses.add(q):this._element.classed(q,!0))};n.prototype.removeClass= function(q){null!=q&&(null==this._element?this._cssClasses.delete(q):this._element.classed(q,!1))};n.prototype.fixedWidth=function(){return!1};n.prototype.fixedHeight=function(){return!1};n.prototype.detach=function(){this.parent(null);this._isAnchored&&this._element.remove();this._isAnchored=!1;this._onDetachCallbacks.callCallbacks(this);return this};n.prototype.onDetach=function(q){this._onDetachCallbacks.add(q)};n.prototype.offDetach=function(q){this._onDetachCallbacks.delete(q)};n.prototype.parent= function(q){if(void 0===q)return this._parent;if(null!==q&&!q.has(this))throw Error("Passed invalid parent");this._parent=q;return this};n.prototype.bounds=function(){var q=this.origin();return{topLeft:q,bottomRight:{x:q.x+this.width(),y:q.y+this.height()}}};n.prototype.destroy=function(){this._destroyed=!0;this.detach()};n.prototype.width=function(){return this._width};n.prototype.height=function(){return this._height};n.prototype.origin=function(){return{x:this._origin.x,y:this._origin.y}};n.prototype.originToRoot= function(){for(var q=this.origin(),t=this.parent();null!=t;){var v=t.origin();q.x+=v.x;q.y+=v.y;t=t.parent()}return q};n.prototype.root=function(){for(var q=this;!q.isRoot();)q=q.parent();return q};n.prototype.isRoot=function(){return null==this.parent()};n.prototype.foreground=function(){return this._foregroundContainer};n.prototype.content=function(){return this._content};n.prototype.element=function(){return this._element};n.prototype.rootElement=function(){return this.root()._rootElement};n.prototype.background= function(){return this._backgroundContainer};return n}();d._xAlignToProportion={left:0,center:.5,right:1};d._yAlignToProportion={top:0,center:.5,bottom:1};f.Component=d},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(59));m(h(62));m(h(133));m(h(21));m(h(64));m(h(66))},function(d,f){d=function(){function h(m,w){this._svgDrawerFactory=m;this._canvasDrawerFactory=w}h.prototype.useSVG=function(m){null!=this._currentDrawer&&this._currentDrawer.remove();var w=this._svgDrawerFactory(); w.attachTo(m);this._currentDrawer=w};h.prototype.useCanvas=function(m){null!=this._currentDrawer&&this._currentDrawer.remove();this._currentDrawer=this._canvasDrawerFactory(m.node().getContext("2d"))};h.prototype.getDrawer=function(){return this._currentDrawer};h.prototype.remove=function(){null!=this._currentDrawer&&this._currentDrawer.remove()};h.prototype.draw=function(m,w){this._currentDrawer.draw(m,w)};h.prototype.getVisualPrimitives=function(){return this._currentDrawer.getVisualPrimitives()}; h.prototype.getVisualPrimitiveAtIndex=function(m){return this._currentDrawer.getVisualPrimitiveAtIndex(m)};return h}();f.ProxyDrawer=d},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(70));m(h(71))},function(d,f,h){function m(p){void 0===p&&(p=3);w(p);return function(n){return n.toFixed(p)}}function w(p){if(0>p||20<p)throw new RangeError("Formatter precision must be between 0 and 20");if(p!==Math.floor(p))throw new RangeError("Formatter precision must be an integer"); }var l=h(1);f.currency=function(p,n,q){void 0===p&&(p=2);void 0===n&&(n="$");void 0===q&&(q=!0);var t=m(p);return function(v){var z=t(Math.abs(v));""!==z&&(z=q?n+z:z+n,0>v&&(z="-"+z));return z}};f.fixed=m;f.general=function(){var p;void 0===p&&(p=3);w(p);return function(n){if("number"===typeof n){var q=Math.pow(10,p);return String(Math.round(n*q)/q)}return String(n)}};f.identity=function(){return function(p){return String(p)}};f.percentage=function(p){void 0===p&&(p=0);var n=m(p);return function(q){var t= q.toString();t=Math.pow(10,t.length-(t.indexOf(".")+1));return n(parseInt((100*q*t).toString(),10)/t)+"%"}};f.siSuffix=function(p){void 0===p&&(p=3);w(p);return function(n){return l.format("."+p+"s")(n)}};f.shortScale=function(){var p=0;void 0===p&&(p=3);w(p);var n=l.format("."+p+"e"),q=l.format("."+p+"f"),t=Math.pow(10,18),v=Math.pow(10,-p);return function(z){var y=Math.abs(z);if((y<v||y>=t)&&0!==y)return n(z);for(var x=-1;y>=Math.pow(1E3,x+2)&&4>x;)x++;y=-1===x?q(z):q(z/Math.pow(1E3,x+1))+"KMBTQ"[x]; if(0<z&&"1000"===y.substr(0,4)||0>z&&"-1000"===y.substr(0,5))4>x?(x++,y=q(z/Math.pow(1E3,x+1))+"KMBTQ"[x]):y=n(z);return y}};f.multiTime=function(){var p=[{specifier:".%L",predicate:function(n){return 0!==n.getMilliseconds()}},{specifier:":%S",predicate:function(n){return 0!==n.getSeconds()}},{specifier:"%I:%M",predicate:function(n){return 0!==n.getMinutes()}},{specifier:"%I %p",predicate:function(n){return 0!==n.getHours()}},{specifier:"%a %d",predicate:function(n){return 0!==n.getDay()&&1!==n.getDate()}}, {specifier:"%b %d",predicate:function(n){return 1!==n.getDate()}},{specifier:"%b",predicate:function(n){return 0!==n.getMonth()}}];return function(n){var q=p.filter(function(t){return t.predicate(n)});return l.timeFormat(0<q.length?q[0].specifier:"%Y")(n)}};f.time=function(p){return l.timeFormat(p)}},function(d,f,h){var m=h(1),w=h(0);d=function(){function l(p,n){this._root=m.select(document.createElementNS("http://www.w3.org/2000/svg","g"));this._className=n;this._svgElementName=p}l.prototype.draw= function(p,n){var q=this;this._createAndDestroyDOMElements(p);var t=0;n.forEach(function(v){w.Window.setTimeout(function(){return q._drawStep(v)},t);t+=v.animator.totalTime(p.length)})};l.prototype.getVisualPrimitives=function(){null==this._cachedVisualPrimitivesNodes&&(this._cachedVisualPrimitivesNodes=this._selection.nodes());return this._cachedVisualPrimitivesNodes};l.prototype.getVisualPrimitiveAtIndex=function(p){return this.getVisualPrimitives()[p]};l.prototype.remove=function(){this._root.remove()}; l.prototype.attachTo=function(p){p.node().appendChild(this._root.node())};l.prototype.getRoot=function(){return this._root};l.prototype.selector=function(){return this._svgElementName};l.prototype._applyDefaultAttributes=function(){};l.prototype._createAndDestroyDOMElements=function(p){p=p.filter(function(n){return null!=n});p=this._root.selectAll(this.selector()).data(p);this._selection=p.enter().append(this._svgElementName).merge(p);p.exit().remove();this._cachedVisualPrimitivesNodes=null;null!= this._className&&this._selection.classed(this._className,!0);this._applyDefaultAttributes(this._selection)};l.prototype._drawStep=function(p){var n=this;["fill","stroke"].forEach(function(q){null!=p.attrToAppliedProjector[q]&&n._selection.attr(q,p.attrToAppliedProjector[q])});p.animator.animate(this._selection,p.attrToAppliedProjector);null!=this._className&&this._selection.classed(this._className,!0)};return l}();f.SVGDrawer=d},function(d,f){f.makeEnum=function(h){return h.reduce(function(m,w){m[w]= w;return m},{})}},function(d,f,h){var m=this&&this.__extends||function(n,q){function t(){this.constructor=n}for(var v in q)q.hasOwnProperty(v)&&(n[v]=q[v]);n.prototype=null===q?Object.create(q):(t.prototype=q.prototype,new t)},w=h(1),l=h(26),p=h(0);d=function(n){function q(){var t=n.call(this)||this;t._tickGenerator=function(v){return v.defaultTicks()};t._padProportion=.05;t._snappingDomainEnabled=!0;t._paddingExceptionsProviders=new p.Set;return t}m(q,n);q.prototype.autoDomain=function(){this._domainMax= this._domainMin=null;n.prototype.autoDomain.call(this)};q.prototype._autoDomainIfAutomaticMode=function(){if(null!=this._domainMin&&null!=this._domainMax)this._setDomain([this._domainMin,this._domainMax]);else{var t=this._getExtent();null!=this._domainMin?(t=t[1],this._domainMin>=t&&(t=this._expandSingleValueDomain([this._domainMin,this._domainMin])[1]),this._setDomain([this._domainMin,t])):null!=this._domainMax?(t=t[0],this._domainMax<=t&&(t=this._expandSingleValueDomain([this._domainMax,this._domainMax])[0]), this._setDomain([t,this._domainMax])):n.prototype._autoDomainIfAutomaticMode.call(this)}};q.prototype._getUnboundedExtent=function(t){void 0===t&&(t=!1);t=this._getAllIncludedValues(t);var v=this._defaultExtent();0!==t.length&&(t=[p.Math.min(t,v[0]),p.Math.max(t,v[1])],v=this._padDomain(t));return v};q.prototype._getExtent=function(){var t=this._getUnboundedExtent();null!=this._domainMin&&(t[0]=this._domainMin);null!=this._domainMax&&(t[1]=this._domainMax);return t};q.prototype.addPaddingExceptionsProvider= function(t){this._paddingExceptionsProviders.add(t);this._autoDomainIfAutomaticMode()};q.prototype.removePaddingExceptionsProvider=function(t){this._paddingExceptionsProviders.delete(t);this._autoDomainIfAutomaticMode()};q.prototype.padProportion=function(t){if(null==t)return this._padProportion;if(0>t)throw Error("padProportion must be non-negative");this._padProportion=t;this._autoDomainIfAutomaticMode();return this};q.prototype._padDomain=function(t){var v=this;if(t[0].valueOf()===t[1].valueOf())return this._expandSingleValueDomain(t); if(0===this._padProportion)return t;var z=this._padProportion/2,y=t[0],x=t[1],D=!1,G=!1;this._paddingExceptionsProviders.forEach(function(F){F(v).forEach(function(E){E.valueOf()===y.valueOf()&&(D=!0);E.valueOf()===x.valueOf()&&(G=!0)})});var J=this._backingScaleDomain();this._backingScaleDomain(t);t=D?y:this.invert(this.scale(y)-(this.scale(x)-this.scale(y))*z);z=G?x:this.invert(this.scale(x)+(this.scale(x)-this.scale(y))*z);this._backingScaleDomain(J);return this._snappingDomainEnabled?this._niceDomain([t, z]):[t,z]};q.prototype.snappingDomainEnabled=function(t){null!=t&&(this._snappingDomainEnabled=t,this._autoDomainIfAutomaticMode())};q.prototype._expandSingleValueDomain=function(t){return t};q.prototype.invert=function(){throw Error("Subclasses should override invert");};q.prototype.domain=function(t){null!=t&&(this._domainMin=t[0],this._domainMax=t[1]);return n.prototype.domain.call(this,t)};q.prototype.domainMin=function(t){if(null==t)return this.domain()[0];this._domainMin=t;this._autoDomainIfAutomaticMode(); return this};q.prototype.domainMax=function(t){if(null==t)return this.domain()[1];this._domainMax=t;this._autoDomainIfAutomaticMode();return this};q.prototype.extentOfValues=function(t){t=w.extent(t.filter(function(v){return p.Math.isValidNumber(+v)}));return null==t[0]||null==t[1]?[]:t};q.prototype.zoom=function(t,v){var z=this;this.domain(this.range().map(function(y){return z.invert(l.zoomOut(y,t,v))}))};q.prototype.pan=function(t){var v=this;this.domain(this.range().map(function(z){return v.invert(z+ t)}))};q.prototype.scaleTransformation=function(){throw Error("Subclasses should override scaleTransformation");};q.prototype.invertedTransformation=function(){throw Error("Subclasses should override invertedTransformation");};q.prototype.getTransformationExtent=function(){throw Error("Subclasses should override getTransformationExtent");};q.prototype.getTransformationDomain=function(){throw Error("Subclasses should override getTransformationDomain");};q.prototype.setTransformationDomain=function(){throw Error("Subclasses should override setTransformationDomain"); };q.prototype._setDomain=function(t){function v(z){return p.Math.isNaN(z)||Infinity===z||-Infinity===z}v(t[0])||v(t[1])?p.Window.warn("Warning: QuantitativeScales cannot take NaN or Infinity as a domain value. Ignoring."):n.prototype._setDomain.call(this,t)};q.prototype.defaultTicks=function(){throw Error("Subclasses should override _getDefaultTicks");};q.prototype.ticks=function(){return this._tickGenerator(this)};q.prototype._niceDomain=function(){throw Error("Subclasses should override _niceDomain"); };q.prototype._defaultExtent=function(){throw Error("Subclasses should override _defaultExtent");};q.prototype.tickGenerator=function(t){if(null==t)return this._tickGenerator;this._tickGenerator=t;return this};return q}(h(17).Scale);d._DEFAULT_NUM_TICKS=10;f.QuantitativeScale=d},function(d,f,h){var m=h(1);f.coerceExternalD3=function(w){if(null==w.attrs){if(null==w.nodes){var l=[];w.each(function(){l.push(this)});return m.selectAll(l)}return m.selectAll(w.nodes())}return w}},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)|| (f[l]=w[l])}m(h(83));m(h(84));m(h(85))},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(44));m(h(45));m(h(46));m(h(18));m(h(6));m(h(33));m(h(34));m(h(47));m(h(9));m(h(48))},function(d,f){d=function(){function h(){var m=this;this._anchorCallback=function(w){return m._anchor(w)};this._enabled=!0}h.prototype.attachTo=function(m){this._disconnect();this._componentAttachedTo=m;this._connect();return this};h.prototype.detachFrom=function(){this.detach()};h.prototype.detach= function(){this._disconnect();this._componentAttachedTo=null;return this};h.prototype.enabled=function(m){if(null==m)return this._enabled;(this._enabled=m)?this._connect():this._disconnect();return this};h.prototype._anchor=function(){this._isAnchored=!0};h.prototype._unanchor=function(){this._isAnchored=!1};h.prototype._translateToComponentSpace=function(m){var w=this._componentAttachedTo.originToRoot();return{x:m.x-w.x,y:m.y-w.y}};h.prototype._isInsideComponent=function(m){return 0<=m.x&&0<=m.y&& m.x<=this._componentAttachedTo.width()&&m.y<=this._componentAttachedTo.height()};h.prototype._connect=function(){if(this.enabled()&&null!=this._componentAttachedTo&&!this._isAnchored)this._componentAttachedTo.onAnchor(this._anchorCallback)};h.prototype._disconnect=function(){this._isAnchored&&this._unanchor();null!=this._componentAttachedTo&&this._componentAttachedTo.offAnchor(this._anchorCallback)};return h}();f.Interaction=d},function(d,f,h){var m=this&&this.__extends||function(q,t){function v(){this.constructor= q}for(var z in t)t.hasOwnProperty(z)&&(q[z]=t[z]);q.prototype=null===t?Object.create(t):(v.prototype=t.prototype,new v)},w=h(3),l=h(0),p=h(52),n=h(2);d=function(q){function t(){var v=q.call(this)||this;v._autoAdjustXScaleDomain=!1;v._autoAdjustYScaleDomain=!1;v._deferredRendering=!1;v._applyDeferredRenderingTransform=function(z,y,x,D){v._isAnchored&&(null!=v._renderArea&&v._renderArea.attr("transform","translate("+z+", "+y+") scale("+x+", "+D+")"),null!=v._canvas&&v._canvas.style("transform","translate("+ z+"px, "+y+"px) scale("+x+", "+D+")"))};v.addClass("xy-plot");v._adjustYDomainOnChangeFromXCallback=function(){return v._adjustYDomainOnChangeFromX()};v._adjustXDomainOnChangeFromYCallback=function(){return v._adjustXDomainOnChangeFromY()};v._renderCallback=function(){if(v.deferredRendering()){var z=v.x()&&v.x().scale,y=v.y()&&v.y().scale;v._deferredRenderer.updateDomains(z,y)}else v.render()};v._deferredRenderer=new p.DeferredRenderer(function(){return v.render()},v._applyDeferredRenderingTransform); return v}m(t,q);t.prototype.render=function(){this.deferredRendering()&&this._deferredRenderer.resetTransforms();return q.prototype.render.call(this)};t.prototype.deferredRendering=function(){return this._deferredRendering};t.prototype.x=function(v,z,y){if(null==v)return this._propertyBindings.get(t._X_KEY);this._bindProperty(t._X_KEY,v,z,y);v=this.width();null!=z&&null!=v&&z.range([0,v]);this._autoAdjustYScaleDomain&&this._updateYExtentsAndAutodomain();this.render();return this};t.prototype.y=function(v, z,y){if(null==v)return this._propertyBindings.get(t._Y_KEY);this._bindProperty(t._Y_KEY,v,z,y);v=this.height();null!=z&&null!=v&&(z instanceof w.Category?z.range([0,v]):z.range([v,0]));this._autoAdjustXScaleDomain&&this._updateXExtentsAndAutodomain();this.render();return this};t.prototype._filterForProperty=function(v){return"x"===v&&this._autoAdjustXScaleDomain?this._makeFilterByProperty("y"):"y"===v&&this._autoAdjustYScaleDomain?this._makeFilterByProperty("x"):null};t.prototype._makeFilterByProperty= function(v){v=this._propertyBindings.get(v);if(null!=v){var z=v.accessor,y=v.scale;if(null!=y)return function(x,D,G){var J=y.range();return l.Math.inRange(y.scale(z(x,D,G)),J[0],J[1])}}return null};t.prototype._uninstallScaleForKey=function(v,z){q.prototype._uninstallScaleForKey.call(this,v,z);v.offUpdate(z===t._X_KEY?this._adjustYDomainOnChangeFromXCallback:this._adjustXDomainOnChangeFromYCallback)};t.prototype._installScaleForKey=function(v,z){q.prototype._installScaleForKey.call(this,v,z);v.onUpdate(z=== t._X_KEY?this._adjustYDomainOnChangeFromXCallback:this._adjustXDomainOnChangeFromYCallback)};t.prototype.destroy=function(){q.prototype.destroy.call(this);this.x().scale&&this.x().scale.offUpdate(this._adjustYDomainOnChangeFromXCallback);this.y().scale&&this.y().scale.offUpdate(this._adjustXDomainOnChangeFromYCallback);return this};t.prototype.autorangeMode=function(v){if(null==v)return this._autoAdjustXScaleDomain?"x":this._autoAdjustYScaleDomain?"y":"none";switch(v){case "x":this._autoAdjustXScaleDomain= !0;this._autoAdjustYScaleDomain=!1;this._adjustXDomainOnChangeFromY();break;case "y":this._autoAdjustXScaleDomain=!1;this._autoAdjustYScaleDomain=!0;this._adjustYDomainOnChangeFromX();break;case "none":this._autoAdjustYScaleDomain=this._autoAdjustXScaleDomain=!1;break;default:throw Error("Invalid scale name '"+v+"', must be 'x', 'y' or 'none'");}return this};t.prototype.computeLayout=function(v,z,y){q.prototype.computeLayout.call(this,v,z,y);v=(v=this.x())&&v.scale;null!=v&&v.range([0,this.width()]); v=(v=this.y())&&v.scale;null!=v&&(v instanceof w.Category?v.range([0,this.height()]):v.range([this.height(),0]));return this};t.prototype._updateXExtentsAndAutodomain=function(){var v=this.x().scale;null!=v&&v.autoDomain()};t.prototype._updateYExtentsAndAutodomain=function(){var v=this.y().scale;null!=v&&v.autoDomain()};t.prototype.showAllData=function(){this._updateXExtentsAndAutodomain();this._updateYExtentsAndAutodomain();return this};t.prototype._adjustYDomainOnChangeFromX=function(){this._projectorsReady()&& this._autoAdjustYScaleDomain&&this._updateYExtentsAndAutodomain()};t.prototype._adjustXDomainOnChangeFromY=function(){this._projectorsReady()&&this._autoAdjustXScaleDomain&&this._updateXExtentsAndAutodomain()};t.prototype._projectorsReady=function(){var v=this.x(),z=this.y();return null!=v&&null!=v.accessor&&null!=z&&null!=z.accessor};t.prototype._pixelPoint=function(v,z,y){var x=n.Plot._scaledAccessor(this.x()),D=n.Plot._scaledAccessor(this.y());return{x:x(v,z,y),y:D(v,z,y)}};t.prototype._getDataToDraw= function(){var v=this,z=q.prototype._getDataToDraw.call(this);this.datasets().forEach(function(y){z.set(y,z.get(y).filter(function(x,D){var G=n.Plot._scaledAccessor(v.x())(x,D,y);x=n.Plot._scaledAccessor(v.y())(x,D,y);return l.Math.isValidNumber(G)&&l.Math.isValidNumber(x)}))});return z};return t}(n.Plot);d._X_KEY="x";d._Y_KEY="y";f.XYPlot=d},function(d,f,h){var m=h(0);d=function(){function w(){this._autoDomainAutomatically=!0;this._domainModificationInProgress=!1;this._updateId=0;this._callbacks= new m.CallbackSet;this._includedValuesProviders=new m.Set}w.prototype.extentOfValues=function(){return[]};w.prototype._getAllIncludedValues=function(l){var p=this;void 0===l&&(l=!1);var n=[];this._includedValuesProviders.forEach(function(q){q=q(p,l);n=n.concat(q)});return n};w.prototype._getExtent=function(){return[]};w.prototype.onUpdate=function(l){this._callbacks.add(l);return this};w.prototype.offUpdate=function(l){this._callbacks.delete(l);return this};w.prototype._dispatchUpdate=function(){this._updateId++; this._callbacks.callCallbacks(this)};w.prototype.autoDomain=function(){this._autoDomainAutomatically=!0;this._setDomain(this._getExtent())};w.prototype._autoDomainIfAutomaticMode=function(){this._autoDomainAutomatically&&this.autoDomain()};w.prototype.scale=function(){throw Error("Subclasses should override scale");};w.prototype.ticks=function(){return this.domain()};w.prototype.domain=function(l){if(null==l)return this._getDomain();this._autoDomainAutomatically=!1;this._setDomain(l);return this}; w.prototype._getDomain=function(){throw Error("Subclasses should override _getDomain");};w.prototype._setDomain=function(l){this._domainModificationInProgress||(this._domainModificationInProgress=!0,this._backingScaleDomain(l),this._dispatchUpdate(),this._domainModificationInProgress=!1)};w.prototype._backingScaleDomain=function(){throw Error("Subclasses should override _backingDomain");};w.prototype.range=function(l){if(null==l)return this._getRange();this._setRange(l);return this};w.prototype._getRange= function(){throw Error("Subclasses should override _getRange");};w.prototype._setRange=function(){throw Error("Subclasses should override _setRange");};w.prototype.addIncludedValuesProvider=function(l){this._includedValuesProviders.add(l);this._autoDomainIfAutomaticMode();return this};w.prototype.removeIncludedValuesProvider=function(l){this._includedValuesProviders.delete(l);this._autoDomainIfAutomaticMode()};w.prototype.updateId=function(){return this._updateId};return w}();f.Scale=d},function(d, f,h){function m(n,q,t,v){for(var z={},y=0;y<q.length;y++){var x=q[y];n.hasOwnProperty(x)&&(z[x]=n[x](t,v))}return z}function w(n){return null!=n["stroke-width"]?parseFloat(n["stroke-width"]):1}function l(n,q){if(q.stroke){n.lineWidth=w(q);var t=p.color(q.stroke);t.opacity=t.opacity*(null!=q["stroke-opacity"]?parseFloat(q["stroke-opacity"]):1)*(null!=q.opacity?parseFloat(q.opacity):1);n.strokeStyle=t.toString();n.stroke()}q.fill&&(t=p.color(q.fill),t.opacity=t.opacity*(null!=q["fill-opacity"]?parseFloat(q["fill-opacity"]): 1)*(null!=q.opacity?parseFloat(q.opacity):1),n.fillStyle=t.toString(),n.fill())}var p=h(1);d=function(){function n(q,t){this._context=q;this._drawStep=t}n.prototype.getDrawStep=function(){return this._drawStep};n.prototype.draw=function(q,t){t=t[t.length-1].attrToAppliedProjector;this._context.save();this._drawStep(this._context,q,t);this._context.restore()};n.prototype.getVisualPrimitives=function(){return[]};n.prototype.getVisualPrimitiveAtIndex=function(){return null};n.prototype.remove=function(){}; return n}();f.CanvasDrawer=d;f.ContextStyleAttrs="fill-opacity fill opacity stroke-opacity stroke-width stroke".split(" ");f.resolveAttributesSubsetWithStyles=function(n,q,t,v){return m(n,f.ContextStyleAttrs.concat(q),t,v)};f.resolveAttributes=m;f.getStrokeWidth=w;f.renderArea=function(n,q,t,v){n.save();n.beginPath();q.context(n);q(t);n.lineJoin="round";l(n,v);n.restore()};f.renderLine=function(n,q,t,v){n.save();n.beginPath();q.context(n);q(t);n.lineJoin="round";l(n,v);n.restore()};f.renderPathWithStyle= l},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(50));m(h(27));m(h(51));m(h(93));m(h(53));m(h(94));m(h(95));m(h(96));m(h(97));m(h(98));m(h(99));m(h(100))},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(92));m(h(91));d=h(49);f.sign=d.sign},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(134));m(h(135));m(h(136));m(h(137))},function(d,f,h){var m=this&&this.__extends||function(q,t){function v(){this.constructor= q}for(var z in t)t.hasOwnProperty(z)&&(q[z]=t[z]);q.prototype=null===t?Object.create(t):(v.prototype=t.prototype,new v)},w=h(1),l=h(5);d=h(4);var p=h(8),n=h(0);h=h(10);f.AxisOrientation=h.makeEnum(["bottom","left","right","top"]);h=function(q){function t(v,z){var y=q.call(this)||this;y._endTickLength=5;y._innerTickLength=5;y._tickLabelPadding=10;y._margin=15;y._showEndTickLabels=!1;y._annotationsEnabled=!1;y._annotationTierCount=1;if(null==v||null==z)throw Error("Axis requires a scale and orientation"); y._scale=v;y.orientation(z);y._setDefaultAlignment();y.addClass("axis");y.isHorizontal()?y.addClass("x-axis"):y.addClass("y-axis");y.formatter(p.identity());y._rescaleCallback=function(){return y._rescale()};y._scale.onUpdate(y._rescaleCallback);y._annotatedTicks=[];y._annotationFormatter=p.identity();return y}m(t,q);t.prototype.destroy=function(){q.prototype.destroy.call(this);this._scale.offUpdate(this._rescaleCallback)};t.prototype.tickLabelDataOnElement=function(v){if(null!=v){for(var z;null!= v&&v.classList&&void 0===z;)v.classList.contains(t.TICK_LABEL_CLASS)?z=v:v=v.parentNode;return void 0===v?void 0:w.select(v).datum()}};t.prototype._computeWidth=function(){return this._maxLabelTickLength()};t.prototype._computeHeight=function(){return this._maxLabelTickLength()};t.prototype.requestedSpace=function(){var v=0,z=0;if(this.isHorizontal()){if(z=this._computeHeight()+this._margin,this.annotationsEnabled()){var y=this._annotationMeasurer.measure().height+2*t._ANNOTATION_LABEL_PADDING;z+= y*this.annotationTierCount()}}else v=this._computeWidth()+this._margin,this.annotationsEnabled()&&(y=this._annotationMeasurer.measure().height+2*t._ANNOTATION_LABEL_PADDING,v+=y*this.annotationTierCount());return{minWidth:v,minHeight:z}};t.prototype.fixedHeight=function(){return this.isHorizontal()};t.prototype.fixedWidth=function(){return!this.isHorizontal()};t.prototype._rescale=function(){this.render()};t.prototype.computeLayout=function(v,z,y){q.prototype.computeLayout.call(this,v,z,y);this.isHorizontal()? this._scale.range([0,this.width()]):this._scale.range([this.height(),0]);return this};t.prototype._sizeFromOffer=function(v,z){var y=this.requestedSpace(v,z);return this.isHorizontal()?{width:v,height:y.minHeight}:{height:z,width:y.minWidth}};t.prototype._setup=function(){q.prototype._setup.call(this);this._tickMarkContainer=this.content().append("g").classed(t.TICK_MARK_CLASS+"-container",!0);this._tickLabelContainer=this.content().append("g").classed(t.TICK_LABEL_CLASS+"-container",!0);this._baseline= this.content().append("line").classed("baseline",!0);this._annotationContainer=this.content().append("g").classed("annotation-container",!0);this._annotationContainer.append("g").classed("annotation-line-container",!0);this._annotationContainer.append("g").classed("annotation-circle-container",!0);this._annotationContainer.append("g").classed("annotation-rect-container",!0);var v=this._annotationContainer.append("g").classed("annotation-label-container",!0);v=new l.SvgContext(v.node());this._annotationMeasurer= new l.CacheMeasurer(v);this._annotationWriter=new l.Writer(this._annotationMeasurer,v)};t.prototype._getTickValues=function(){return[]};t.prototype.renderImmediately=function(){var v=this._getTickValues(),z=this._tickMarkContainer.selectAll("."+t.TICK_MARK_CLASS).data(v),y=z.enter().append("line").classed(t.TICK_MARK_CLASS,!0).merge(z);y.attrs(this._generateTickMarkAttrHash());w.select(y.nodes()[0]).classed(t.END_TICK_MARK_CLASS,!0).attrs(this._generateTickMarkAttrHash(!0));w.select(y.nodes()[v.length- 1]).classed(t.END_TICK_MARK_CLASS,!0).attrs(this._generateTickMarkAttrHash(!0));z.exit().remove();this._baseline.attrs(this._generateBaselineAttrHash());this.annotationsEnabled()?this._drawAnnotations():this._removeAnnotations();return this};t.prototype.annotatedTicks=function(){return this._annotatedTicks};t.prototype.annotationFormatter=function(v){if(null==v)return this._annotationFormatter;this._annotationFormatter=v;this.render();return this};t.prototype.annotationsEnabled=function(){return this._annotationsEnabled}; t.prototype.annotationTierCount=function(){return this._annotationTierCount};t.prototype._drawAnnotations=function(){function v(oa){switch(G.orientation()){case "bottom":case "right":return x(oa);case "top":case "left":return x(oa)-F.get(oa).height}}function z(oa){return M.has(oa)?"hidden":"visible"}function y(oa){return G._scale.scale(oa)}function x(oa){switch(G.orientation()){case "bottom":case "right":return N.get(oa)*L+Z;case "top":case "left":return R-Z-N.get(oa)*L}}function D(oa,xa,Pa){oa=oa.selectAll("."+ Pa).data(E);xa=oa.enter().append(xa).classed(Pa,!0).merge(oa);oa.exit().remove();return xa}var G=this,J=t._ANNOTATION_LABEL_PADDING,F=new n.Map,E=this._annotatedTicksToRender();E.forEach(function(oa){var xa=G._annotationMeasurer.measure(G.annotationFormatter()(oa));F.set(oa,{width:xa.width+2*J,height:xa.height+2*J})});var L=this._annotationMeasurer.measure().height+2*J,N=this._annotationToTier(F),M=new n.Set,R=this.isHorizontal()?this.height():this.width(),Z=this._coreSize(),T=Math.min(this.annotationTierCount(), Math.floor((R-Z)/L));N.forEach(function(oa,xa){(-1===oa||oa>=T)&&M.add(xa)});switch(this.orientation()){case "bottom":case "right":var Y=0;break;case "top":Y=this.height();break;case "left":Y=this.width()}var ma=this.isHorizontal();D(this._annotationContainer.select(".annotation-line-container"),"line",t.ANNOTATION_LINE_CLASS).attrs({x1:ma?y:Y,x2:ma?y:x,y1:ma?Y:y,y2:ma?x:y,visibility:z});D(this._annotationContainer.select(".annotation-circle-container"),"circle",t.ANNOTATION_CIRCLE_CLASS).attrs({cx:ma? y:Y,cy:ma?Y:y,r:3});D(this._annotationContainer.select(".annotation-rect-container"),"rect",t.ANNOTATION_RECT_CLASS).attrs({x:ma?y:v,y:ma?v:y,width:ma?function(oa){return F.get(oa).width}:function(oa){return F.get(oa).height},height:ma?function(oa){return F.get(oa).height}:function(oa){return F.get(oa).width},visibility:z});var va=this._annotationWriter,Ba=this.annotationFormatter();Y=D(this._annotationContainer.select(".annotation-label-container"),"g",t.ANNOTATION_LABEL_CLASS);Y.selectAll(".text-container").remove(); Y.attrs({transform:function(oa){var xa=ma?y(oa):v(oa);oa=ma?v(oa):y(oa);return"translate("+xa+","+oa+")"},visibility:z}).each(function(oa){va.write(Ba(oa),ma?F.get(oa).width:F.get(oa).height,ma?F.get(oa).height:F.get(oa).width,{xAlign:"center",yAlign:"center",textRotation:ma?0:90},w.select(this).node())})};t.prototype._annotatedTicksToRender=function(){var v=this,z=this._scale.range();return n.Array.uniq(this.annotatedTicks().filter(function(y){return null==y?!1:n.Math.inRange(v._scale.scale(y),z[0], z[1])}))};t.prototype._coreSize=function(){var v=this.isHorizontal()?this.height():this.width(),z=this.isHorizontal()?this._computeHeight():this._computeWidth();return Math.min(z,v)};t.prototype._annotationTierHeight=function(){return this._annotationMeasurer.measure().height+2*t._ANNOTATION_LABEL_PADDING};t.prototype._annotationToTier=function(v){var z=this,y=[[]],x=new n.Map,D=this.isHorizontal()?this.width():this.height();this._annotatedTicksToRender().forEach(function(G){var J=z._scale.scale(G), F=v.get(G).width;if(0>J||J+F>D)x.set(G,-1);else{for(var E=function(N){return y[N].some(function(M){var R=z._scale.scale(M);M=v.get(M).width;return J+F>=R&&J<=R+M})},L=0;E(L);)L++,y.length===L&&y.push([]);y[L].push(G);x.set(G,L)}});return x};t.prototype._removeAnnotations=function(){this._annotationContainer.selectAll(".annotation-line").remove();this._annotationContainer.selectAll(".annotation-circle").remove();this._annotationContainer.selectAll(".annotation-rect").remove();this._annotationContainer.selectAll(".annotation-label").remove()}; t.prototype._generateBaselineAttrHash=function(){var v={x1:0,y1:0,x2:0,y2:0};switch(this._orientation){case "bottom":v.x2=this.width();break;case "top":v.x2=this.width();v.y1=this.height();v.y2=this.height();break;case "left":v.x1=this.width();v.x2=this.width();v.y2=this.height();break;case "right":v.y2=this.height()}return v};t.prototype._generateTickMarkAttrHash=function(v){function z(D){return y._scale.scale(D)}var y=this;void 0===v&&(v=!1);var x={x1:0,y1:0,x2:0,y2:0};this.isHorizontal()?(x.x1= z,x.x2=z):(x.y1=z,x.y2=z);v=v?this._endTickLength:this._innerTickLength;switch(this._orientation){case "bottom":x.y2=v;break;case "top":x.y1=this.height();x.y2=this.height()-v;break;case "left":x.x1=this.width();x.x2=this.width()-v;break;case "right":x.x2=v}return x};t.prototype._setDefaultAlignment=function(){switch(this._orientation){case "bottom":this.yAlignment("top");break;case "top":this.yAlignment("bottom");break;case "left":this.xAlignment("right");break;case "right":this.xAlignment("left")}}; t.prototype.isHorizontal=function(){return"top"===this._orientation||"bottom"===this._orientation};t.prototype.getScale=function(){return this._scale};t.prototype.formatter=function(v){if(null==v)return this._formatter;this._formatter=v;this.redraw();return this};t.prototype.innerTickLength=function(){return this._innerTickLength};t.prototype.endTickLength=function(){return this._endTickLength};t.prototype._maxLabelTickLength=function(){return this.showEndTickLabels()?Math.max(this.innerTickLength(), this.endTickLength()):this.innerTickLength()};t.prototype.tickLabelPadding=function(v){if(null==v)return this._tickLabelPadding;if(0>v)throw Error("tick label padding must be positive");this._tickLabelPadding=v;this.redraw();return this};t.prototype.margin=function(v){if(null==v)return this._margin;if(0>v)throw Error("margin size must be positive");this._margin=v;this.redraw();return this};t.prototype.orientation=function(v){if(null==v)return this._orientation;v=v.toLowerCase();if("top"!==v&&"bottom"!== v&&"left"!==v&&"right"!==v)throw Error("unsupported orientation");this._orientation=v;this.redraw();return this};t.prototype.showEndTickLabels=function(){return this._showEndTickLabels};t.prototype._showAllTickMarks=function(){this._tickMarkContainer.selectAll("."+t.TICK_MARK_CLASS).each(function(){w.select(this).style("visibility","inherit")})};t.prototype._showAllTickLabels=function(){this._tickLabelContainer.selectAll("."+t.TICK_LABEL_CLASS).each(function(){w.select(this).style("visibility","inherit")})}; t.prototype._hideOverflowingTickLabels=function(){var v=this.element().node().getBoundingClientRect(),z=this._tickLabelContainer.selectAll("."+t.TICK_LABEL_CLASS);z.empty()||z.each(function(){n.DOM.clientRectInside(this.getBoundingClientRect(),v)||w.select(this).style("visibility","hidden")})};t.prototype._hideTickMarksWithoutLabel=function(){var v=this._tickMarkContainer.selectAll("."+t.TICK_MARK_CLASS),z=this._tickLabelContainer.selectAll("."+t.TICK_LABEL_CLASS).filter(function(){var y=w.select(this).style("visibility"); return"inherit"===y||"visible"===y}).data();v.each(function(y){-1===z.indexOf(y)&&w.select(this).style("visibility","hidden")})};t.prototype.invalidateCache=function(){q.prototype.invalidateCache.call(this);this._annotationMeasurer.reset()};return t}(d.Component);h.END_TICK_MARK_CLASS="end-tick-mark";h.TICK_MARK_CLASS="tick-mark";h.TICK_LABEL_CLASS="tick-label";h.ANNOTATION_LINE_CLASS="annotation-line";h.ANNOTATION_RECT_CLASS="annotation-rect";h.ANNOTATION_CIRCLE_CLASS="annotation-circle";h.ANNOTATION_LABEL_CLASS= "annotation-label";h._ANNOTATION_LABEL_PADDING=4;f.Axis=h},function(d,f){f.SHOW_WARNINGS=!0;f.ADD_TITLE_ELEMENTS=!0},function(d,f,h){var m=h(0);d=function(){function w(){this._eventToProcessingFunction={};this._eventTarget=document;this._eventNameToCallbackSet={};this._connected=!1}w.prototype._hasNoCallbacks=function(){for(var l=Object.keys(this._eventNameToCallbackSet),p=0;p<l.length;p++)if(0!==this._eventNameToCallbackSet[l[p]].size)return!1;return!0};w.prototype._connect=function(){var l=this; this._connected||(Object.keys(this._eventToProcessingFunction).forEach(function(p){l._eventTarget.addEventListener(p,l._eventToProcessingFunction[p])}),this._connected=!0)};w.prototype._disconnect=function(){var l=this;this._connected&&this._hasNoCallbacks()&&(Object.keys(this._eventToProcessingFunction).forEach(function(p){l._eventTarget.removeEventListener(p,l._eventToProcessingFunction[p])}),this._connected=!1)};w.prototype._addCallbackForEvent=function(l,p){null==this._eventNameToCallbackSet[l]&& (this._eventNameToCallbackSet[l]=new m.CallbackSet);this._eventNameToCallbackSet[l].add(p);this._connect()};w.prototype._removeCallbackForEvent=function(l,p){null!=this._eventNameToCallbackSet[l]&&this._eventNameToCallbackSet[l].delete(p);this._disconnect()};w.prototype._callCallbacksForEvent=function(l){for(var p=[],n=1;n<arguments.length;n++)p[n-1]=arguments[n];n=this._eventNameToCallbackSet[l];null!=n&&n.callCallbacks.apply(n,p)};return w}();f.Dispatcher=d},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)|| (f[l]=w[l])}m(h(87));m(h(88));m(h(40));m(h(89));m(h(90));d=h(26);f.zoomOut=d.zoomOut},function(d,f){function h(p,n,q){return q-(q-p)*n}function m(p,n,q,t){var v=1<n;q=v?t:q;if(null==q)return n;p=p.getTransformationDomain();return(v?Math.min:Math.max)(n,q/Math.abs(p[1]-p[0]))}function w(p,n,q,t,v){if(1>=n)return{centerPoint:q,zoomAmount:n};if(null==t&&null==v)return{centerPoint:q,zoomAmount:n};var z=l(p),y,x=p.getTransformationDomain();x=(y=x[1]<x[0])?Infinity:-Infinity;y=y?-Infinity:Infinity;t=null== t?x:t;v=null==v?y:v;y=p.getTransformationDomain();x=y[0];y=y[1];v=p.scaleTransformation(v);y=p.scaleTransformation(y);var D=h(y,n,q);t=p.scaleTransformation(t);p=p.scaleTransformation(x);x=h(p,n,q);return Math.abs(D-x)>Math.abs(v-t)?(n=(v-t)/(y-p),1!==n?{centerPoint:(y*n-v)/(n-1),zoomAmount:n}:{centerPoint:q,zoomAmount:n}):D>v!=z?{centerPoint:(y*n-v)/(n-1),zoomAmount:n}:x<t!=z?{centerPoint:(p*n-t)/(n-1),zoomAmount:n}:{centerPoint:q,zoomAmount:n}}function l(p){p=p.range();return p[1]<p[0]}f.zoomOut= h;f.constrainedZoom=function(p,n,q,t,v,z,y){n=m(p,n,t,v);return w(p,n,q,z,y)};f.constrainZoomExtents=m;f.constrainZoomValues=w;f.constrainedTranslation=function(p,n,q,t){var v=p.getTransformationDomain(),z=v[0],y=v[1];v=l(p);0<n!==v?(q=t,null!=q&&(z=p.scaleTransformation(y),p=p.scaleTransformation(q),n=(v?Math.max:Math.min)(z+n,p)-z)):null!=q&&(z=p.scaleTransformation(z),p=p.scaleTransformation(q),n=(v?Math.min:Math.max)(z+n,p)-z);return n}},function(d,f,h){function m(L,N,M){var R=L.scale;if(R instanceof x.Category)M=R.rangeBand();else{var Z=L.accessor;L=l.set(G.Array.flatten(N.map(function(T){return T.data().map(function(Y,ma){return Z(Y,ma,T)}).filter(function(Y){return null!=Y}).map(function(Y){return Y.valueOf()})}))).values().map(function(T){return+T});L.sort(function(T,Y){return T-Y});L=L.map(function(T){return R.scale(T)});L=l.pairs(L);M=G.Math.min(L,function(T){return Math.abs(T[1]-T[0])},M*E._SINGLE_BAR_DIMENSION_RATIO);M*=E._BAR_THICKNESS_RATIO}return M}var w=this&&this.__extends||function(L, N){function M(){this.constructor=L}for(var R in N)N.hasOwnProperty(R)&&(L[R]=N[R]);L.prototype=null===N?Object.create(N):(M.prototype=N.prototype,new M)},l=h(1),p=h(5),n=h(7),q=h(8),t=h(14),v=h(6),z=h(34),y=h(20),x=h(3),D=h(11),G=h(0);d=h(10);var J=h(19),F=h(2);h=h(16);f.BarOrientation=d.makeEnum(["vertical","horizontal"]);f.LabelsPosition=d.makeEnum(["start","middle","end","outside"]);f.BarAlignment=d.makeEnum(["start","middle","end"]);var E=function(L){function N(M){void 0===M&&(M="vertical");var R= L.call(this)||this;R._labelFormatter=q.identity();R._labelsEnabled=!1;R._labelsPosition=f.LabelsPosition.end;R._hideBarsIfAnyAreTooWide=!0;R._barAlignment="middle";R._computeBarPixelThickness=y.memoize(m);R._fixedBarPixelThickness=!0;R.addClass("bar-plot");if("vertical"!==M&&"horizontal"!==M)throw Error(M+" is not a valid orientation for Plots.Bar");R._isVertical="vertical"===M;R.animator("baseline",new n.Null);R.attr("fill",(new x.Color).range()[0]);R.attr(N._BAR_THICKNESS_KEY,function(){return R._barPixelThickness()}); R._labelConfig=new G.Map;R._baselineValueProvider=function(){return[R.baselineValue()]};return R}w(N,L);N.prototype.computeLayout=function(M,R,Z){L.prototype.computeLayout.call(this,M,R,Z);this._updateExtents();return this};N.prototype.x=function(M,R){if(null==M)return L.prototype.x.call(this);null==R?L.prototype.x.call(this,M):L.prototype.x.call(this,M,R);this._updateThicknessAttr();this._updateLengthScale();return this};N.prototype.y=function(M,R){if(null==M)return L.prototype.y.call(this);null== R?L.prototype.y.call(this,M):L.prototype.y.call(this,M,R);this._updateLengthScale();return this};N.prototype.length=function(){return this._isVertical?this.y():this.x()};N.prototype.position=function(){return this._isVertical?this.x():this.y()};N.prototype.barEnd=function(){return this._propertyBindings.get(N._BAR_END_KEY)};N.prototype.barAlignment=function(M){if(null==M)return this._barAlignment;this._barAlignment=M;this._clearAttrToProjectorCache();this.render();return this};N.prototype.orientation= function(){return this._isVertical?"vertical":"horizontal"};N.prototype._createDrawer=function(){return new v.ProxyDrawer(function(){return new z.RectangleSVGDrawer(N._BAR_AREA_CLASS)},function(M){return new t.RectangleCanvasDrawer(M)})};N.prototype._setup=function(){L.prototype._setup.call(this);this._baseline=this._renderArea.append("line").classed("baseline",!0)};N.prototype.baselineValue=function(){if(null!=this._baselineValue)return this._baselineValue;if(!this._projectorsReady())return 0;var M= this.length().scale;return M?M instanceof x.Time?new Date(0):0:0};N.prototype.addDataset=function(M){L.prototype.addDataset.call(this,M);return this};N.prototype._addDataset=function(M){L.prototype._addDataset.call(this,M);return this};N.prototype.removeDataset=function(M){L.prototype.removeDataset.call(this,M)};N.prototype._removeDataset=function(M){L.prototype._removeDataset.call(this,M);return this};N.prototype.datasets=function(M){if(null==M)return L.prototype.datasets.call(this);L.prototype.datasets.call(this, M);return this};N.prototype.labelsEnabled=function(M,R){if(null==M)return this._labelsEnabled;this._labelsEnabled=M;null!=R&&(this._labelsPosition=R);this._clearAttrToProjectorCache();this.render();return this};N.prototype.labelFormatter=function(M){if(null==M)return this._labelFormatter;this._labelFormatter=M;this._clearAttrToProjectorCache();this.render();return this};N.prototype._createNodesForDataset=function(M){var R=L.prototype._createNodesForDataset.call(this,M),Z=this._renderArea.append("g").classed(N._LABEL_AREA_CLASS, !0),T=new p.SvgContext(Z.node()),Y=new p.CacheMeasurer(T);T=new p.Writer(Y,T);this._labelConfig.set(M,{labelArea:Z,measurer:Y,writer:T});return R};N.prototype._removeDatasetNodes=function(M){L.prototype._removeDatasetNodes.call(this,M);var R=this._labelConfig.get(M);null!=R&&(R.labelArea.remove(),this._labelConfig.delete(M))};N.prototype.entityNearest=function(M){var R=this;return this._computeBarPixelThickness.doLocked(function(){var Z=R._isVertical?M.x:M.y,T=R._isVertical?M.y:M.x,Y=R.bounds(),ma= {min:0,max:Y.bottomRight.x-Y.topLeft.x},va={min:0,max:Y.bottomRight.y-Y.topLeft.y},Ba=F.Plot._scaledAccessor(R.length()),oa=R.length().scale.scale(R.baselineValue()),xa=Infinity,Pa=Infinity,Ha;R._getEntityStore().entities().forEach(function(La){var qa=R._entityBounds(La);if(G.DOM.intersectsBBox(ma,va,qa)){var Cb=0,tb=0;if(!G.DOM.intersectsBBox(M.x,M.y,qa,.5)){tb=R._pixelPointBar(Ba(La.datum,La.index,La.dataset),oa,qa);Cb=Math.abs(Z-(R._isVertical?tb.x:tb.y));var ta=R._isVertical?qa.y:qa.x;qa=ta+(R._isVertical? qa.height:qa.width);tb=T>=ta-.5&&T<=qa+.5?0:Math.abs(T-(R._isVertical?tb.y:tb.x))}if(Cb<xa||Cb===xa&&tb<Pa)Ha=La,xa=Cb,Pa=tb}});if(void 0!==Ha)return R._lightweightPlotEntityToPlotEntity(Ha)})};N.prototype.entitiesAt=function(M){return this._entitiesIntersecting(M.x,M.y)};N.prototype._entitiesIntersecting=function(M,R){var Z=this,T=[];this._getEntityStore().entities().forEach(function(Y){G.DOM.intersectsBBox(M,R,Z._entityBounds(Y))&&T.push(Z._lightweightPlotEntityToPlotEntity(Y))});return T};N.prototype._updateLengthScale= function(){if(this._projectorsReady()){var M=this.length().scale;M instanceof D.QuantitativeScale&&(M.addPaddingExceptionsProvider(this._baselineValueProvider),M.addIncludedValuesProvider(this._baselineValueProvider))}};N.prototype.renderImmediately=function(){var M=this;this._barPixelThickness();return this._computeBarPixelThickness.doLocked(function(){return L.prototype.renderImmediately.call(M)})};N.prototype._additionalPaint=function(M){var R=this,Z=this.length().scale.scale(this.baselineValue()); Z={x1:this._isVertical?0:Z,y1:this._isVertical?Z:0,x2:this._isVertical?this.width():Z,y2:this._isVertical?Z:this.height()};this._getAnimator("baseline").animate(this._baseline,Z);this.datasets().forEach(function(T){return R._labelConfig.get(T).labelArea.selectAll("g").remove()});this._labelsEnabled&&G.Window.setTimeout(function(){return R._drawLabels()},M)};N.prototype.getExtentsForProperty=function(M){var R=this,Z=L.prototype.getExtentsForProperty.call(this,M);if("x"===M&&this._isVertical)M=this.x(); else{if("y"!==M||this._isVertical)return Z;M=this.y()}if(!(M&&M.scale&&M.scale instanceof D.QuantitativeScale))return Z;var T=M.scale,Y=this._barPixelThickness();return Z=Z.map(function(ma){return l.extent([T.invert(R._getPositionAttr(T.scale(ma[0]),Y)),T.invert(R._getPositionAttr(T.scale(ma[0]),Y)+Y),T.invert(R._getPositionAttr(T.scale(ma[1]),Y)),T.invert(R._getPositionAttr(T.scale(ma[1]),Y)+Y)])})};N.prototype._getPositionAttr=function(M,R){this._isVertical||(M-=R,R*=-1);switch(this._barAlignment){case "start":return M; case "end":return M-R;default:return M-R/2}};N.prototype._drawLabels=function(){var M=this,R=this._getDataToDraw(),Z=this._getAttrToProjector(),T=this.datasets().some(function(Y){return R.get(Y).some(function(ma,va){return null==ma?!1:M._drawLabel(ma,va,Y,Z)})});this._hideBarsIfAnyAreTooWide&&T&&this.datasets().forEach(function(Y){return M._labelConfig.get(Y).labelArea.selectAll("g").remove()})};N.prototype._drawLabel=function(M,R,Z,T){var Y=this._labelConfig.get(Z),ma=Y.labelArea,va=Y.measurer;Y= Y.writer;var Ba=this.length().accessor,oa=Ba(M,R,Z);Ba=this.length().scale;var xa=null!=Ba?Ba.scale(oa):oa,Pa=null!=Ba?Ba.scale(this.baselineValue()):this.baselineValue(),Ha={x:T.x(M,R,Z),y:T.y(M,R,Z)};Ba={width:T.width(M,R,Z),height:T.height(M,R,Z)};oa=this._labelFormatter(oa,M,R,Z);va=va.measure(oa);var La=this._shouldShowLabelOnBar(Ha,Ba,va);Ha=this._calculateLabelProperties(Ha,Ba,va,La,this._isVertical?xa<=Pa:xa<Pa);xa=Ha.containerDimensions;Pa=Ha.labelContainerOrigin;Ha=Ha.alignment;M=T.fill(M, R,Z);ma=this._createLabelContainer(ma,Pa,La,M);Y.write(oa,xa.width,xa.height,{xAlign:Ha.x,yAlign:Ha.y},ma.node());return this._isVertical?Ba.width<va.width:Ba.height<va.height};N.prototype._shouldShowLabelOnBar=function(M,R,Z){if(this._labelsPosition===f.LabelsPosition.outside)return!1;M=this._isVertical?M.y:M.x;var T=this._isVertical?R.height:R.width;R=this._isVertical?this.height():this.width();Z=this._isVertical?Z.height:Z.width;var Y=M+T;Y>R?T=R-M:0>M&&(T=Y);return Z+N._LABEL_MARGIN_INSIDE_BAR<= T};N.prototype._calculateLabelProperties=function(M,R,Z,T,Y){function ma(Cb){switch(Cb){case "topLeft":Pa=va._isVertical?"top":"left";La+=N._LABEL_MARGIN_INSIDE_BAR;qa+=N._LABEL_MARGIN_INSIDE_BAR;break;case "center":qa+=(oa+xa)/2;break;case "bottomRight":Pa=va._isVertical?"bottom":"right",La-=N._LABEL_MARGIN_INSIDE_BAR,qa+=Ha-N._LABEL_MARGIN_INSIDE_BAR-xa}}var va=this,Ba=this._isVertical?M.y:M.x,oa=this._isVertical?R.height:R.width,xa=this._isVertical?Z.height:Z.width,Pa="center",Ha=oa,La=Ba,qa=Ba; if(T)switch(this._labelsPosition){case f.LabelsPosition.start:Y?ma("bottomRight"):ma("topLeft");break;case f.LabelsPosition.middle:ma("center");break;case f.LabelsPosition.end:Y?ma("topLeft"):ma("bottomRight")}else Y?(Pa=this._isVertical?"top":"left",Ha=oa+N._LABEL_MARGIN_INSIDE_BAR+xa,La-=N._LABEL_MARGIN_INSIDE_BAR+xa,qa-=N._LABEL_MARGIN_INSIDE_BAR+xa):(Pa=this._isVertical?"bottom":"right",Ha=oa+N._LABEL_MARGIN_INSIDE_BAR+xa,qa+=oa+N._LABEL_MARGIN_INSIDE_BAR);return{containerDimensions:{width:this._isVertical? R.width:Ha,height:this._isVertical?Ha:R.height},labelContainerOrigin:{x:this._isVertical?M.x:La,y:this._isVertical?La:M.y},labelOrigin:{x:this._isVertical?M.x+R.width/2-Z.width/2:qa,y:this._isVertical?qa:M.y+R.height/2-Z.height/2},alignment:{x:this._isVertical?"center":Pa,y:this._isVertical?Pa:"center"}}};N.prototype._createLabelContainer=function(M,R,Z,T){M=M.append("g").attr("transform","translate("+R.x+", "+R.y+")");Z?(M.classed("on-bar-label",!0),Z=1.6*G.Color.contrast("white",T)<G.Color.contrast("black", T),M.classed(Z?"dark-label":"light-label",!0)):M.classed("off-bar-label",!0);return M};N.prototype._generateDrawSteps=function(){var M=[];if(this._animateOnNextRender()){var R=this._getAttrToProjector(),Z=this.length().scale.scale(this.baselineValue()),T=this._isVertical?"height":"width";R[this._isVertical?"y":"x"]=function(){return Z};R[T]=function(){return 0};M.push({attrToProjector:R,animator:this._getAnimator(J.Animator.RESET)})}M.push({attrToProjector:this._getAttrToProjector(),animator:this._getAnimator(J.Animator.MAIN)}); return M};N.prototype._generateAttrToProjector=function(){function M(Ha,La,qa){return Math.abs(T-Ba(Ha,La,qa))}var R=this,Z=L.prototype._generateAttrToProjector.call(this),T=this.length().scale.scale(this.baselineValue()),Y=this._isVertical?"y":"x",ma=this._isVertical?"x":"y",va=F.Plot._scaledAccessor(this.position()),Ba=F.Plot._scaledAccessor(this.length()),oa=Z[N._BAR_THICKNESS_KEY],xa=Z.gap,Pa=null==xa?oa:function(Ha,La,qa){return oa(Ha,La,qa)-xa(Ha,La,qa)};Z.width=this._isVertical?Pa:M;Z.height= this._isVertical?M:Pa;Z[Y]=function(Ha,La,qa){Ha=Ba(Ha,La,qa);return Ha>T?T:Ha};Z[ma]=function(Ha,La,qa){return R._getPositionAttr(va(Ha,La,qa),oa(Ha,La,qa))};return Z};N.prototype._updateThicknessAttr=function(){var M=this,R=this.position(),Z=this.barEnd();null!=R&&null!=Z?(this._fixedBarPixelThickness=!1,this.attr(N._BAR_THICKNESS_KEY,function(T,Y,ma){var va=R.accessor(T,Y,ma);T=Z.accessor(T,Y,ma);va=R.scale?R.scale.scale(va):va;T=Z.scale?Z.scale.scale(T):T;return Math.abs(T-va)})):(this._fixedBarPixelThickness= !0,this.attr(N._BAR_THICKNESS_KEY,function(){return M._barPixelThickness()}))};N.prototype._barPixelThickness=function(){return this._fixedBarPixelThickness?this._projectorsReady()?this._computeBarPixelThickness(this.position(),this.datasets(),this._isVertical?this.width():this.height()):0:0};N.prototype.entities=function(M){void 0===M&&(M=this.datasets());return this._projectorsReady()?L.prototype.entities.call(this,M):[]};N.prototype._entityBounds=function(M){return this._pixelBounds(M.datum,M.index, M.dataset)};N.prototype._pixelBounds=function(M,R,Z){var T=this._getAttrToProjector();return{x:T.x(M,R,Z),y:T.y(M,R,Z),width:T.width(M,R,Z),height:T.height(M,R,Z)}};N.prototype._pixelPoint=function(M,R,Z){var T=this._pixelBounds(M,R,Z);M=(this._isVertical?F.Plot._scaledAccessor(this.y()):F.Plot._scaledAccessor(this.x()))(M,R,Z);R=(this._isVertical?this.y().scale:this.x().scale).scale(this.baselineValue());return this._pixelPointBar(M,R,T)};N.prototype._pixelPointBar=function(M,R,Z){if(this._isVertical){var T= Z.x+Z.width/2;M=M<=R?Z.y:Z.y+Z.height}else T=M>=R?Z.x+Z.width:Z.x,M=Z.y+Z.height/2;return{x:T,y:M}};N.prototype._uninstallScaleForKey=function(M,R){L.prototype._uninstallScaleForKey.call(this,M,R)};N.prototype._getDataToDraw=function(){var M=this,R=new G.Map,Z=this._getAttrToProjector(),T=this.width(),Y=this.height();this.datasets().forEach(function(ma){var va=ma.data().map(function(Ba,oa){return M._isDatumOnScreen(Z,T,Y,Ba,oa,ma)?Ba:null});R.set(ma,va)});return R};N.prototype._isDatumOnScreen=function(M, R,Z,T,Y,ma){var va=M.x(T,Y,ma),Ba=M.y(T,Y,ma),oa=M.width(T,Y,ma);M=M.height(T,Y,ma);return G.Math.isValidNumber(va)&&G.Math.isValidNumber(Ba)&&G.Math.isValidNumber(oa)&&G.Math.isValidNumber(M)?G.Math.boundsIntersects(va,Ba,oa,M,R,Z):!1};return N}(h.XYPlot);E._BAR_THICKNESS_RATIO=.95;E._SINGLE_BAR_DIMENSION_RATIO=.4;E._BAR_AREA_CLASS="bar-area";E._BAR_END_KEY="barEnd";E._BAR_THICKNESS_KEY="width";E._LABEL_AREA_CLASS="bar-label-text-area";E._LABEL_MARGIN_INSIDE_BAR=10;f.Bar=E},function(d,f,h){var m= this&&this.__extends||function(z,y){function x(){this.constructor=z}for(var D in y)y.hasOwnProperty(D)&&(z[D]=y[D]);z.prototype=null===y?Object.create(y):(x.prototype=y.prototype,new x)},w=h(1),l=h(5),p=h(8),n=h(3),q=h(0);d=h(10);var t=h(22);f.TimeInterval=d.makeEnum("second minute hour day week month year".split(" "));f.TimeAxisOrientation=d.makeEnum(["top","bottom"]);f.TierLabelPosition=d.makeEnum(["between","center"]);h=function(z){function y(x,D){x=z.call(this,x,D)||this;x._maxTimeIntervalPrecision= null;x._tierLabelPositions=[];x.addClass("time-axis");x.tickLabelPadding(5);x.axisConfigurations(y._DEFAULT_TIME_AXIS_CONFIGURATIONS);x.annotationFormatter(p.time("%a %b %d, %Y"));return x}m(y,z);y.prototype.tierLabelPositions=function(x){if(null==x)return this._tierLabelPositions;if(!x.every(function(D){return"between"===D.toLowerCase()||"center"===D.toLowerCase()}))throw Error("Unsupported position for tier labels");this._tierLabelPositions=x;this.redraw();return this};y.prototype.maxTimeIntervalPrecision= function(x){if(null==x)return this._maxTimeIntervalPrecision;this._maxTimeIntervalPrecision=x;this.redraw();return this};y.prototype.currentAxisConfiguration=function(){return this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex]};y.prototype.axisConfigurations=function(x){if(null!=x){this._possibleTimeAxisConfigurations=x;this._numTiers=q.Math.max(this._possibleTimeAxisConfigurations.map(function(J){return J.length}),0);this._isAnchored&&this._setupDomElements();x=this.tierLabelPositions(); for(var D=[],G=0;G<this._numTiers;G++)D.push(x[G]||"between");this.tierLabelPositions(D);this.redraw()}};y.prototype._getMostPreciseConfigurationIndex=function(){var x=this,D=this._possibleTimeAxisConfigurations.length;this._possibleTimeAxisConfigurations.forEach(function(G,J){J<D&&G.every(function(F){return x._checkTimeAxisTierConfiguration(F)})&&(D=J)});D===this._possibleTimeAxisConfigurations.length&&(q.Window.warn("zoomed out too far: could not find suitable interval to display labels"),--D); return D};y.prototype.orientation=function(x){if(x&&("right"===x.toLowerCase()||"left"===x.toLowerCase()))throw Error(x+" is not a supported orientation for TimeAxis - only horizontal orientations are supported");return z.prototype.orientation.call(this,x)};y.prototype._computeHeight=function(){var x=this._measurer.measure().height;this._tierHeights=[];for(var D=0;D<this._numTiers;D++)this._tierHeights.push(x+this.tickLabelPadding()+("between"===this._tierLabelPositions[D]?0:this._maxLabelTickLength())); return w.sum(this._tierHeights)};y.prototype._getIntervalLength=function(x){var D=this._scale.domain()[0];x=n.Time.timeIntervalToD3Time(x.interval).offset(D,x.step);return x>this._scale.domain()[1]?this.width():Math.abs(this._scale.scale(x)-this._scale.scale(D))};y.prototype._maxWidthForInterval=function(x){return this._measurer.measure(x.formatter(y._LONG_DATE)).width};y.prototype._checkTimeAxisTierConfiguration=function(x){if(null!=this._maxTimeIntervalPrecision){var D=y._SORTED_TIME_INTERVAL_INDEX[this._maxTimeIntervalPrecision], G=y._SORTED_TIME_INTERVAL_INDEX[x.interval];if(null!=D&&null!=G&&G<D)return!1}D=this._maxWidthForInterval(x)+2*this.tickLabelPadding();return Math.min(this._getIntervalLength(x),this.width())>=D};y.prototype._sizeFromOffer=function(x,D){var G=z.prototype._sizeFromOffer.call(this,x,D);x=this._tierHeights.reduce(function(J,F){return J+F>G.height?J:J+F});D=this.margin()+(this.annotationsEnabled()?this.annotationTierCount()*this._annotationTierHeight():0);G.height=Math.min(G.height,x+D);return G};y.prototype._setup= function(){z.prototype._setup.call(this);this._setupDomElements()};y.prototype._setupDomElements=function(){this.content().selectAll("."+y.TIME_AXIS_TIER_CLASS).remove();this._tierLabelContainers=[];this._tierMarkContainers=[];this._tierBaselines=[];this._tickLabelContainer.remove();this._baseline.remove();for(var x=0;x<this._numTiers;++x){var D=this.content().append("g").classed(y.TIME_AXIS_TIER_CLASS,!0);this._tierLabelContainers.push(D.append("g").classed(t.Axis.TICK_LABEL_CLASS+"-container",!0)); this._tierMarkContainers.push(D.append("g").classed(t.Axis.TICK_MARK_CLASS+"-container",!0));this._tierBaselines.push(D.append("line").classed("baseline",!0))}x=new l.SvgContext(this._tierLabelContainers[0].node());this._measurer=new l.CacheMeasurer(x)};y.prototype._getTickIntervalValues=function(x){return this._scale.tickInterval(x.interval,x.step)};y.prototype._getTickValues=function(){var x=this;return this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex].reduce(function(D,G){return D.concat(x._getTickIntervalValues(G))}, [])};y.prototype._cleanTiers=function(){for(var x=0;x<this._tierLabelContainers.length;x++)this._tierLabelContainers[x].selectAll("."+t.Axis.TICK_LABEL_CLASS).remove(),this._tierMarkContainers[x].selectAll("."+t.Axis.TICK_MARK_CLASS).remove(),this._tierBaselines[x].style("visibility","hidden")};y.prototype._getTickValuesForConfiguration=function(x){x=this._scale.tickInterval(x.interval,x.step);var D=this._scale.domain(),G=x.map(function(J){return J.valueOf()});-1===G.indexOf(D[0].valueOf())&&x.unshift(D[0]); -1===G.indexOf(D[1].valueOf())&&x.push(D[1]);return x};y.prototype._renderTierLabels=function(x,D,G){var J=this,F=this._getTickValuesForConfiguration(D),E=[];"between"===this._tierLabelPositions[G]&&1===D.step?F.map(function(Z,T){T+1>=F.length||E.push(new Date((F[T+1].valueOf()-F[T].valueOf())/2+F[T].valueOf()))}):E=F;x=x.selectAll("."+t.Axis.TICK_LABEL_CLASS).data(E,function(Z){return String(Z.valueOf())});var L=x.enter().append("g").classed(t.Axis.TICK_LABEL_CLASS,!0);L.append("text");var N="center"=== this._tierLabelPositions[G]||1===D.step?0:this.tickLabelPadding();var M="bottom"===this.orientation()?w.sum(this._tierHeights.slice(0,G+1))-this.tickLabelPadding():"center"===this._tierLabelPositions[G]?this.height()-w.sum(this._tierHeights.slice(0,G))-this.tickLabelPadding()-this._maxLabelTickLength():this.height()-w.sum(this._tierHeights.slice(0,G))-this.tickLabelPadding();L=x.merge(L);var R=L.selectAll("text");0<R.size()&&R.attr("transform","translate("+N+","+M+")");x.exit().remove();L.attr("transform", function(Z){return"translate("+J._scale.scale(Z)+",0)"});G="center"===this._tierLabelPositions[G]||1===D.step?"middle":"start";L.selectAll("text").text(D.formatter).style("text-anchor",G)};y.prototype._renderTickMarks=function(x,D){x=this._tierMarkContainers[D].selectAll("."+t.Axis.TICK_MARK_CLASS).data(x);var G=x.enter().append("line").classed(t.Axis.TICK_MARK_CLASS,!0).merge(x),J=this._generateTickMarkAttrHash(),F=this._tierHeights.slice(0,D).reduce(function(E,L){return E+L},0);"bottom"===this.orientation()? (J.y1=F,J.y2=F+("center"===this._tierLabelPositions[D]?this.innerTickLength():this._tierHeights[D])):(J.y1=this.height()-F,J.y2=this.height()-(F+("center"===this._tierLabelPositions[D]?this.innerTickLength():this._tierHeights[D])));G.attrs(J);"bottom"===this.orientation()?(J.y1=F,J.y2=F+("center"===this._tierLabelPositions[D]?this.endTickLength():this._tierHeights[D])):(J.y1=this.height()-F,J.y2=this.height()-(F+("center"===this._tierLabelPositions[D]?this.endTickLength():this._tierHeights[D]))); w.select(G.nodes()[0]).attrs(J);w.select(G.nodes()[G.size()-1]).attrs(J);w.select(G.nodes()[0]).classed(t.Axis.END_TICK_MARK_CLASS,!0);w.select(G.nodes()[G.size()-1]).classed(t.Axis.END_TICK_MARK_CLASS,!0);x.exit().remove()};y.prototype._renderLabellessTickMarks=function(x){x=this._tickMarkContainer.selectAll("."+t.Axis.TICK_MARK_CLASS).data(x);var D=x.enter().append("line").classed(t.Axis.TICK_MARK_CLASS,!0).merge(x),G=this._generateTickMarkAttrHash();G.y2="bottom"===this.orientation()?this.tickLabelPadding(): this.height()-this.tickLabelPadding();D.attrs(G);x.exit().remove()};y.prototype._generateLabellessTicks=function(){return 1>this._mostPreciseConfigIndex?[]:this._getTickIntervalValues(this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex-1][0])};y.prototype.renderImmediately=function(){var x=this;this._mostPreciseConfigIndex=this._getMostPreciseConfigurationIndex();var D=this._possibleTimeAxisConfigurations[this._mostPreciseConfigIndex];this._cleanTiers();D.forEach(function(L,N){return x._renderTierLabels(x._tierLabelContainers[N], L,N)});for(var G=D.map(function(L){return x._getTickValuesForConfiguration(L)}),J=0,F=0;F<Math.max(D.length,1);++F){var E=this._generateBaselineAttrHash();E.y1+="bottom"===this.orientation()?J:-J;E.y2=E.y1;this._tierBaselines[F].attrs(E).style("visibility","inherit");J+=this._tierHeights[F]}J=[];F=this._scale.domain();F=this._scale.scale(F[1])-this._scale.scale(F[0]);1.5*this._getIntervalLength(D[0])>=F&&(J=this._generateLabellessTicks());this._renderLabellessTickMarks(J);this._hideOverflowingTiers(); for(F=0;F<D.length;++F)this._renderTickMarks(G[F],F),this._hideOverlappingAndCutOffLabels(F);this.annotationsEnabled()?this._drawAnnotations():this._removeAnnotations();return this};y.prototype._hideOverflowingTiers=function(){var x=this,D=this.height(),G=0;this.content().selectAll("."+y.TIME_AXIS_TIER_CLASS).attr("visibility",function(J,F){G+=x._tierHeights[F];return G<=D?"inherit":"hidden"})};y.prototype._hideOverlappingAndCutOffLabels=function(x){var D=this,G=this.element().node().getBoundingClientRect(), J=this._tierMarkContainers[x].selectAll("."+t.Axis.TICK_MARK_CLASS).filter(function(){var E=w.select(this).style("visibility");return"visible"===E||"inherit"===E}).nodes().map(function(E){return E.getBoundingClientRect()}),F;this._tierLabelContainers[x].selectAll("."+t.Axis.TICK_LABEL_CLASS).filter(function(){var E=w.select(this).style("visibility");return"visible"===E||"inherit"===E}).each(function(E,L){E=this.getBoundingClientRect();var N=w.select(this),M=J[L],R=J[L+1];L=null!=F&&q.DOM.clientRectsOverlap(E, F);M=null!=M&&q.DOM.clientRectsOverlap(E,M);R=null!=R&&q.DOM.clientRectsOverlap(E,R);!(Math.floor(G.left)<=Math.ceil(E.left)&&Math.floor(G.top)<=Math.ceil(E.top)&&Math.floor(E.right)<=Math.ceil(G.left+D.width())&&Math.floor(E.bottom)<=Math.ceil(G.top+D.height()))||L||M||R?N.style("visibility","hidden"):(F=E,N.style("visibility","inherit"))})};y.prototype.invalidateCache=function(){z.prototype.invalidateCache.call(this);this._measurer.reset()};return y}(t.Axis);h.TIME_AXIS_TIER_CLASS="time-axis-tier"; h._SORTED_TIME_INTERVAL_INDEX=(v={},v[f.TimeInterval.second]=0,v[f.TimeInterval.minute]=1,v[f.TimeInterval.hour]=2,v[f.TimeInterval.day]=3,v[f.TimeInterval.week]=4,v[f.TimeInterval.month]=5,v[f.TimeInterval.year]=6,v);h._DEFAULT_TIME_AXIS_CONFIGURATIONS=[[{interval:f.TimeInterval.second,step:1,formatter:p.time("%I:%M:%S %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.second,step:5,formatter:p.time("%I:%M:%S %p")},{interval:f.TimeInterval.day,step:1, formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.second,step:10,formatter:p.time("%I:%M:%S %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.second,step:15,formatter:p.time("%I:%M:%S %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.second,step:30,formatter:p.time("%I:%M:%S %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.minute,step:1,formatter:p.time("%I:%M %p")}, {interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.minute,step:5,formatter:p.time("%I:%M %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.minute,step:10,formatter:p.time("%I:%M %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.minute,step:15,formatter:p.time("%I:%M %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.minute, step:30,formatter:p.time("%I:%M %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.hour,step:1,formatter:p.time("%I %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.hour,step:3,formatter:p.time("%I %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.hour,step:6,formatter:p.time("%I %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}], [{interval:f.TimeInterval.hour,step:12,formatter:p.time("%I %p")},{interval:f.TimeInterval.day,step:1,formatter:p.time("%B %e, %Y")}],[{interval:f.TimeInterval.day,step:1,formatter:p.time("%a %e")},{interval:f.TimeInterval.month,step:1,formatter:p.time("%B %Y")}],[{interval:f.TimeInterval.day,step:1,formatter:p.time("%e")},{interval:f.TimeInterval.month,step:1,formatter:p.time("%B %Y")}],[{interval:f.TimeInterval.month,step:1,formatter:p.time("%B")},{interval:f.TimeInterval.year,step:1,formatter:p.time("%Y")}], [{interval:f.TimeInterval.month,step:1,formatter:p.time("%b")},{interval:f.TimeInterval.year,step:1,formatter:p.time("%Y")}],[{interval:f.TimeInterval.month,step:3,formatter:p.time("%b")},{interval:f.TimeInterval.year,step:1,formatter:p.time("%Y")}],[{interval:f.TimeInterval.month,step:6,formatter:p.time("%b")},{interval:f.TimeInterval.year,step:1,formatter:p.time("%Y")}],[{interval:f.TimeInterval.year,step:1,formatter:p.time("%Y")}],[{interval:f.TimeInterval.year,step:1,formatter:p.time("%y")}], [{interval:f.TimeInterval.year,step:5,formatter:p.time("%Y")}],[{interval:f.TimeInterval.year,step:25,formatter:p.time("%Y")}],[{interval:f.TimeInterval.year,step:50,formatter:p.time("%Y")}],[{interval:f.TimeInterval.year,step:100,formatter:p.time("%Y")}],[{interval:f.TimeInterval.year,step:200,formatter:p.time("%Y")}],[{interval:f.TimeInterval.year,step:500,formatter:p.time("%Y")}],[{interval:f.TimeInterval.year,step:1E3,formatter:p.time("%Y")}]];h._LONG_DATE=new Date(9999,8,29,12,59,9999);f.Time= h;var v},function(d,f,h){var m=this&&this.__extends||function(l,p){function n(){this.constructor=l}for(var q in p)p.hasOwnProperty(q)&&(l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype=p.prototype,new n)},w=h(12);d=function(l){function p(){var n=l.call(this)||this;n._detachCallback=function(q){return n.remove(q)};return n}m(p,l);p.prototype.anchor=function(n){var q=this;n=w.coerceExternalD3(n);l.prototype.anchor.call(this,n);this._forEach(function(t){return t.anchor(q.element())});return this}; p.prototype.render=function(){this._forEach(function(n){return n.render()});return this};p.prototype.has=function(){throw Error("has() is not implemented on ComponentContainer");};p.prototype._adoptAndAnchor=function(n){n.parent(this);n.onDetach(this._detachCallback);this._isAnchored&&n.anchor(this.element())};p.prototype.remove=function(n){this.has(n)&&(n.offDetach(this._detachCallback),this._remove(n),n.detach(),this.redraw());return this};p.prototype._remove=function(){};p.prototype._forEach=function(){throw Error("_forEach() is not implemented on ComponentContainer"); };p.prototype.destroy=function(){l.prototype.destroy.call(this);this._forEach(function(n){return n.destroy()})};p.prototype.invalidateCache=function(){this._forEach(function(n){return n.invalidateCache()})};return p}(h(4).Component);f.ComponentContainer=d},function(d,f,h){function m(z){n.add(z);p.add(z);q||(q=!0,v.render())}var w=h(0);d=h(10);var l=h(39),p=new w.Set,n=new w.Set,q=!1,t=!1;f.Policy=d.makeEnum(["immediate","animationFrame","timeout"]);var v=new l.AnimationFrame;f.renderPolicy=function(){var z= Plottable.RenderController.Policy.immediate;if(null!=z)switch(z){case f.Policy.immediate:v=new l.Immediate;break;case f.Policy.animationFrame:v=new l.AnimationFrame;break;case f.Policy.timeout:v=new l.Timeout;break;default:w.Window.warn("Unrecognized renderPolicy: "+z)}};f.registerToRender=function(z){t&&w.Window.warn("Registered to render while other components are flushing: request may be ignored");p.add(z);q||(q=!0,v.render())};f.registerToComputeLayoutAndRender=m;f.registerToComputeLayout=function(z){m(z)}; f.flush=function(){if(q){n.forEach(function(y){return y.computeLayout()});p.forEach(function(y){return y.render()});t=!0;var z=new w.Set;p.forEach(function(y){try{y.renderImmediately()}catch(x){window.setTimeout(function(){throw x;},0),z.add(y)}});n=new w.Set;p=z;t=q=!1}}},function(d,f,h){var m=h(1);f.circle=function(){return function(l){return m.symbol().type(m.symbolCircle).size(Math.PI*Math.pow(l/2,2))}};f.square=function(){return function(l){return m.symbol().type(m.symbolSquare).size(Math.pow(l, 2))}};f.cross=function(){return function(l){return m.symbol().type(m.symbolCross).size(5/9*Math.pow(l,2))}};f.diamond=function(){return function(l){return m.symbol().type(m.symbolDiamond).size(Math.tan(Math.PI/6)*Math.pow(l,2)/2)}};f.triangle=function(){return function(l){return m.symbol().type(m.symbolTriangle).size(Math.sqrt(3)*Math.pow(l/2,2))}};f.star=function(){return function(l){return m.symbol().type(m.symbolStar).size(.8908130915292852*Math.pow(l/2,2))}};var w=3*(1/Math.sqrt(12)/2+1);f.wye= function(){return function(l){return m.symbol().type(m.symbolWye).size(w*Math.pow(l/2.4,2))}}},function(d,f,h){var m=this&&this.__extends||function(q,t){function v(){this.constructor=q}for(var z in t)t.hasOwnProperty(z)&&(q[z]=t[z]);q.prototype=null===t?Object.create(t):(v.prototype=t.prototype,new v)},w=h(25),l=h(0),p=h(12),n=h(37);d=function(q){function t(){var v=q.call(this)||this;v._detectionRadius=3;v._resizable=!1;v._movable=!1;v._hasCorners=!0;v.addClass("drag-box-layer");v._dragInteraction= new w.Drag;v._setUpCallbacks();v._dragInteraction.attachTo(v);v._dragStartCallbacks=new l.CallbackSet;v._dragCallbacks=new l.CallbackSet;v._dragEndCallbacks=new l.CallbackSet;return v}m(t,q);t.prototype._setUpCallbacks=function(){function v(L,N){0===E&&L.x===N.x&&L.y===N.y&&x.boxVisible(!1);x._dragEndCallbacks.callCallbacks(x.bounds())}function z(L,N){switch(E){case 0:J.x=N.x;J.y=N.y;break;case 1:D.bottom?J.y=N.y:D.top&&(G.y=N.y);D.right?J.x=N.x:D.left&&(G.x=N.x);break;case 2:L=N.x-F.x;var M=N.y- F.y;G.x+=L;G.y+=M;J.x+=L;J.y+=M;F=N}x._setBounds({topLeft:G,bottomRight:J});x._xBoundsMode===n.PropertyMode.VALUE&&null!=x.xScale()&&x._setXExtent([x.xScale().invert(G.x),x.xScale().invert(J.x)]);x._yBoundsMode===n.PropertyMode.VALUE&&null!=x.yScale()&&x._setYExtent([x.yScale().invert(G.y),x.yScale().invert(J.y)]);x.render();x._dragCallbacks.callCallbacks(x.bounds())}function y(L){D=x._getResizingEdges(L);var N=x.bounds();N=N.topLeft.x<=L.x&&L.x<=N.bottomRight.x&&N.topLeft.y<=L.y&&L.y<=N.bottomRight.y; x.boxVisible()&&(D.top||D.bottom||D.left||D.right)?E=1:x.boxVisible()&&x.movable()&&N?E=2:(E=0,x._setBounds({topLeft:L,bottomRight:L}),x._xBoundsMode===n.PropertyMode.VALUE&&null!=x.xScale()&&x._setXExtent([x.xScale().invert(L.x),x.xScale().invert(L.x)]),x._yBoundsMode===n.PropertyMode.VALUE&&null!=x.yScale()&&x._setYExtent([x.yScale().invert(L.y),x.yScale().invert(L.y)]),x.render());x.boxVisible(!0);N=x.bounds();G={x:N.topLeft.x,y:N.topLeft.y};J={x:N.bottomRight.x,y:N.bottomRight.y};F=L;x._dragStartCallbacks.callCallbacks(N)} var x=this,D,G,J,F,E=0;this._dragInteraction.onDragStart(y);this._dragInteraction.onDrag(z);this._dragInteraction.onDragEnd(v);this._disconnectInteraction=function(){x._dragInteraction.offDragStart(y);x._dragInteraction.offDrag(z);x._dragInteraction.offDragEnd(v);x._dragInteraction.detach()}};t.prototype._setup=function(){function v(){return z._box.append("line").styles({opacity:0,stroke:"pink","pointer-events":"visibleStroke"})}var z=this;q.prototype._setup.call(this);this._detectionEdgeT=v().classed("drag-edge-tb", !0);this._detectionEdgeB=v().classed("drag-edge-tb",!0);this._detectionEdgeL=v().classed("drag-edge-lr",!0);this._detectionEdgeR=v().classed("drag-edge-lr",!0);if(this._hasCorners){var y=function(){return z._box.append("circle").styles({opacity:0,fill:"pink","pointer-events":"visibleFill"})};this._detectionCornerTL=y().classed("drag-corner-tl",!0);this._detectionCornerTR=y().classed("drag-corner-tr",!0);this._detectionCornerBL=y().classed("drag-corner-bl",!0);this._detectionCornerBR=y().classed("drag-corner-br", !0)}};t.prototype._getResizingEdges=function(v){var z={top:!1,bottom:!1,left:!1,right:!1};if(!this.resizable())return z;var y=this.bounds(),x=y.topLeft.y,D=y.bottomRight.y,G=y.topLeft.x;y=y.bottomRight.x;var J=this._detectionRadius;G-J<=v.x&&v.x<=y+J&&(z.top=x-J<=v.y&&v.y<=x+J,z.bottom=D-J<=v.y&&v.y<=D+J);x-J<=v.y&&v.y<=D+J&&(z.left=G-J<=v.x&&v.x<=G+J,z.right=y-J<=v.x&&v.x<=y+J);return z};t.prototype.renderImmediately=function(){q.prototype.renderImmediately.call(this);if(this.boxVisible()){var v= this.bounds(),z=v.topLeft.y,y=v.bottomRight.y,x=v.topLeft.x;v=v.bottomRight.x;this._detectionEdgeT.attrs({x1:x,y1:z,x2:v,y2:z,"stroke-width":2*this._detectionRadius});this._detectionEdgeB.attrs({x1:x,y1:y,x2:v,y2:y,"stroke-width":2*this._detectionRadius});this._detectionEdgeL.attrs({x1:x,y1:z,x2:x,y2:y,"stroke-width":2*this._detectionRadius});this._detectionEdgeR.attrs({x1:v,y1:z,x2:v,y2:y,"stroke-width":2*this._detectionRadius});this._hasCorners&&(this._detectionCornerTL.attrs({cx:x,cy:z,r:this._detectionRadius}), this._detectionCornerTR.attrs({cx:v,cy:z,r:this._detectionRadius}),this._detectionCornerBL.attrs({cx:x,cy:y,r:this._detectionRadius}),this._detectionCornerBR.attrs({cx:v,cy:y,r:this._detectionRadius}))}return this};t.prototype.detectionRadius=function(){return this._detectionRadius};t.prototype.resizable=function(){return this._resizable};t.prototype._setResizableClasses=function(v){v&&this.enabled()?(this.addClass("x-resizable"),this.addClass("y-resizable")):(this.removeClass("x-resizable"),this.removeClass("y-resizable"))}; t.prototype.movable=function(){return this._movable};t.prototype._setMovableClass=function(){this.movable()&&this.enabled()?this.addClass("movable"):this.removeClass("movable")};t.prototype.onDragStart=function(v){this._dragStartCallbacks.add(v)};t.prototype.offDragStart=function(v){this._dragStartCallbacks.delete(v)};t.prototype.onDrag=function(v){this._dragCallbacks.add(v)};t.prototype.offDrag=function(v){this._dragCallbacks.delete(v)};t.prototype.onDragEnd=function(v){this._dragEndCallbacks.add(v)}; t.prototype.offDragEnd=function(v){this._dragEndCallbacks.delete(v)};t.prototype.dragInteraction=function(){return this._dragInteraction};t.prototype.enabled=function(v){if(null==v)return this._dragInteraction.enabled();this._dragInteraction.enabled(v);this._setResizableClasses(this.resizable());this._setMovableClass();return this};t.prototype.destroy=function(){var v=this;q.prototype.destroy.call(this);this._dragStartCallbacks.forEach(function(z){return v._dragCallbacks.delete(z)});this._dragCallbacks.forEach(function(z){return v._dragCallbacks.delete(z)}); this._dragEndCallbacks.forEach(function(z){return v._dragEndCallbacks.delete(z)});this._disconnectInteraction()};t.prototype.detach=function(){this._resetState();this._dragInteraction.detach();q.prototype.detach.call(this);return this};t.prototype.anchor=function(v){v=p.coerceExternalD3(v);this._dragInteraction.attachTo(this);q.prototype.anchor.call(this,v);return this};t.prototype._resetState=function(){this.bounds({topLeft:{x:0,y:0},bottomRight:{x:0,y:0}})};return t}(h(43).SelectionBoxLayer);f.DragBoxLayer= d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(18);d=function(p){function n(){return p.call(this,"path","line")||this}m(n,p);n.prototype._applyDefaultAttributes=function(q){q.style("fill","none")};n.prototype.getVisualPrimitiveAtIndex=function(){return p.prototype.getVisualPrimitiveAtIndex.call(this,0)};return n}(h(9).SVGDrawer);f.LineSVGDrawer= d;var l=["opacity","stroke-opacity","stroke-width","stroke"];f.makeLineCanvasDrawStep=function(p){return function(n,q,t){t=w.resolveAttributes(t,l,q[0],0);w.renderLine(n,p(),q[0],t)}}},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(18);d=function(p){function n(q){void 0===q&&(q="");var t=p.call(this,"rect","")||this;t._rootClassName= q;t._root.classed(t._rootClassName,!0);return t}m(n,p);return n}(h(9).SVGDrawer);f.RectangleSVGDrawer=d;var l=["x","y","width","height"];f.RectangleCanvasDrawStep=function(p,n,q){p.save();n.forEach(function(t,v){null!=t&&(t=w.resolveAttributesSubsetWithStyles(q,l,t,v),p.beginPath(),p.rect(t.x,t.y,t.width,t.height),w.renderPathWithStyle(p,t))});p.restore()};d=function(p){function n(q){return p.call(this,q,f.RectangleCanvasDrawStep)||this}m(n,p);return n}(w.CanvasDrawer);f.RectangleCanvasDrawer=d}, function(d,f,h){function m(p){l.SHOW_WARNINGS&&console.warn(p)}function w(p,n){for(var q=[],t=2;t<arguments.length;t++)q[t-2]=arguments[t];return 0===n?(p(q),-1):window.setTimeout(p,n,q)}var l=h(23);f.warn=m;f.setTimeout=w;f.debounce=function(p,n,q){function t(){n.apply(q,z)}var v=null,z=[];return function(){z=Array.prototype.slice.call(arguments);clearTimeout(v);v=w(t,p)}};f.deprecated=function(p,n,q){void 0===q&&(q="");m("Method "+p+" has been deprecated in version "+n+". Please refer to the release notes. "+ q)}},function(d,f){d=function(){function h(m){this.ruler=null!=m.createRuler?m.createRuler():m}h.prototype.measure=function(m){void 0===m&&(m=h.HEIGHT_TEXT);return this.ruler(m)};return h}();d.HEIGHT_TEXT="bdpql";f.AbstractMeasurer=d},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(32));m(h(74));m(h(75));m(h(41));m(h(42));m(h(76));m(h(77));m(h(78));m(h(79));m(h(43));m(h(80));m(h(81));m(h(82))},function(d,f,h){var m=h(0);d=function(){function w(l,p){void 0===l&&(l= []);void 0===p&&(p={});this._updateId=0;this._data=l;this._metadata=p;this._callbacks=new m.CallbackSet}w.prototype.onUpdate=function(l){this._callbacks.add(l);return this};w.prototype.offUpdate=function(l){this._callbacks.delete(l);return this};w.prototype.data=function(l){if(null==l)return this._data;this._data=l;this._dispatchUpdate();return this};w.prototype.metadata=function(l){if(null==l)return this._metadata;this._metadata=l;this._dispatchUpdate();return this};w.prototype.updateId=function(){return this._updateId}; w.prototype._dispatchUpdate=function(){this._updateId++;this._callbacks.callCallbacks(this)};return w}();f.Dataset=d},function(d,f,h){var m=h(0),w=h(30);d=function(){function l(){}l.prototype.render=function(){w.flush()};return l}();f.Immediate=d;d=function(){function l(){}l.prototype.render=function(){m.DOM.requestAnimationFramePolyfill(w.flush)};return l}();f.AnimationFrame=d;d=function(){function l(){this._timeoutMsec=m.DOM.SCREEN_REFRESH_RATE_MILLISECONDS}l.prototype.render=function(){setTimeout(w.flush, this._timeoutMsec)};return l}();f.Timeout=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(13),l=h(0);d=function(p){function n(){var q=null!==p&&p.apply(this,arguments)||this;q._keyPressCallbacks={};q._keyReleaseCallbacks={};q._mouseMoveCallback=function(){return!1};q._downedKeys=new l.Set;q._keyDownCallback=function(t,v){return q._handleKeyDownEvent(t, v)};q._keyUpCallback=function(t){return q._handleKeyUpEvent(t)};return q}m(n,p);n.prototype._anchor=function(q){p.prototype._anchor.call(this,q);this._positionDispatcher=w.Mouse.getDispatcher(this._componentAttachedTo);this._positionDispatcher.onMouseMove(this._mouseMoveCallback);this._keyDispatcher=w.Key.getDispatcher();this._keyDispatcher.onKeyDown(this._keyDownCallback);this._keyDispatcher.onKeyUp(this._keyUpCallback)};n.prototype._unanchor=function(){p.prototype._unanchor.call(this);this._positionDispatcher.offMouseMove(this._mouseMoveCallback); this._positionDispatcher=null;this._keyDispatcher.offKeyDown(this._keyDownCallback);this._keyDispatcher.offKeyUp(this._keyUpCallback);this._keyDispatcher=null};n.prototype._handleKeyDownEvent=function(q,t){var v=this._translateToComponentSpace(this._positionDispatcher.lastMousePosition());this._isInsideComponent(v)&&!t.repeat&&(this._keyPressCallbacks[q]&&this._keyPressCallbacks[q].callCallbacks(q),this._downedKeys.add(q))};n.prototype._handleKeyUpEvent=function(q){this._downedKeys.has(q)&&this._keyReleaseCallbacks[q]&& this._keyReleaseCallbacks[q].callCallbacks(q);this._downedKeys.delete(q)};n.prototype.onKeyPress=function(q,t){this._keyPressCallbacks[q]||(this._keyPressCallbacks[q]=new l.CallbackSet);this._keyPressCallbacks[q].add(t);return this};n.prototype.offKeyPress=function(q,t){this._keyPressCallbacks[q].delete(t);0===this._keyPressCallbacks[q].size&&delete this._keyPressCallbacks[q];return this};n.prototype.onKeyRelease=function(q,t){this._keyReleaseCallbacks[q]||(this._keyReleaseCallbacks[q]=new l.CallbackSet); this._keyReleaseCallbacks[q].add(t);return this};n.prototype.offKeyRelease=function(q,t){this._keyReleaseCallbacks[q].delete(t);0===this._keyReleaseCallbacks[q].size&&delete this._keyReleaseCallbacks[q];return this};return n}(h(15).Interaction);f.Key=d},function(d,f,h){var m=this&&this.__extends||function(l,p){function n(){this.constructor=l}for(var q in p)p.hasOwnProperty(q)&&(l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype=p.prototype,new n)},w=h(0);d=function(l){function p(n){void 0=== n&&(n=[]);var q=l.call(this)||this;q._components=[];q.addClass("component-group");n.forEach(function(t){return q.append(t)});return q}m(p,l);p.prototype._forEach=function(n){this.components().forEach(n)};p.prototype.has=function(n){return 0<=this._components.indexOf(n)};p.prototype.requestedSpace=function(n,q){var t=this._components.map(function(v){return v.requestedSpace(n,q)});return{minWidth:w.Math.max(t,function(v){return v.minWidth},0),minHeight:w.Math.max(t,function(v){return v.minHeight},0)}}; p.prototype.computeLayout=function(n,q,t){var v=this;l.prototype.computeLayout.call(this,n,q,t);this._forEach(function(z){z.computeLayout({x:0,y:0},v.width(),v.height())});return this};p.prototype._sizeFromOffer=function(n,q){return{width:n,height:q}};p.prototype.fixedWidth=function(){return this._components.every(function(n){return n.fixedWidth()})};p.prototype.fixedHeight=function(){return this._components.every(function(n){return n.fixedHeight()})};p.prototype.components=function(){return this._components.slice()}; p.prototype.append=function(n){null==n||this.has(n)||(n.detach(),this._components.push(n),this._adoptAndAnchor(n),this.redraw());return this};p.prototype._remove=function(n){n=this._components.indexOf(n);0<=n&&this._components.splice(n,1)};return p}(h(29).ComponentContainer);f.Group=d},function(d,f,h){var m=this&&this.__extends||function(l,p){function n(){this.constructor=l}for(var q in p)p.hasOwnProperty(q)&&(l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype=p.prototype,new n)};h(0); d=h(4);var w;(function(l){l[l.VALUE=0]="VALUE";l[l.PIXEL=1]="PIXEL"})(w||(w={}));d=function(l){function p(n){var q=l.call(this)||this;q._mode=w.VALUE;if(n!==p.ORIENTATION_VERTICAL&&n!==p.ORIENTATION_HORIZONTAL)throw Error(n+" is not a valid orientation for GuideLineLayer");q._orientation=n;q._overflowHidden=!0;q.addClass("guide-line-layer");q._isVertical()?q.addClass("vertical"):q.addClass("horizontal");q._scaleUpdateCallback=function(){q._syncPixelPositionAndValue();q.render()};return q}m(p,l);p.prototype._setup= function(){l.prototype._setup.call(this);this._guideLine=this.content().append("line").classed("guide-line",!0)};p.prototype._sizeFromOffer=function(n,q){return{width:n,height:q}};p.prototype._isVertical=function(){return this._orientation===p.ORIENTATION_VERTICAL};p.prototype.fixedWidth=function(){return!0};p.prototype.fixedHeight=function(){return!0};p.prototype.computeLayout=function(n,q,t){l.prototype.computeLayout.call(this,n,q,t);null!=this.scale()&&(this._isVertical()?this.scale().range([0, this.width()]):this.scale().range([this.height(),0]));return this};p.prototype.renderImmediately=function(){l.prototype.renderImmediately.call(this);this._syncPixelPositionAndValue();this._guideLine.attrs({x1:this._isVertical()?this.pixelPosition():0,y1:this._isVertical()?0:this.pixelPosition(),x2:this._isVertical()?this.pixelPosition():this.width(),y2:this._isVertical()?this.height():this.pixelPosition()});return this};p.prototype._syncPixelPositionAndValue=function(){null!=this.scale()&&(this._mode=== w.VALUE&&null!=this.value()?this._pixelPosition=this.scale().scale(this.value()):this._mode===w.PIXEL&&null!=this.pixelPosition()&&(this._value=this.scale().invert(this.pixelPosition())))};p.prototype._setPixelPositionWithoutChangingMode=function(n){this._pixelPosition=n;null!=this.scale()&&(this._value=this.scale().invert(this.pixelPosition()));this.render()};p.prototype.scale=function(n){if(null==n)return this._scale;var q=this._scale;null!=q&&q.offUpdate(this._scaleUpdateCallback);this._scale= n;this._scale.onUpdate(this._scaleUpdateCallback);this._syncPixelPositionAndValue();this.redraw();return this};p.prototype.value=function(n){if(null==n)return this._value;this._value=n;this._mode=w.VALUE;this._syncPixelPositionAndValue();this.render();return this};p.prototype.pixelPosition=function(){return this._pixelPosition};p.prototype.destroy=function(){l.prototype.destroy.call(this);null!=this.scale()&&this.scale().offUpdate(this._scaleUpdateCallback)};return p}(d.Component);d.ORIENTATION_VERTICAL= "vertical";d.ORIENTATION_HORIZONTAL="horizontal";f.GuideLineLayer=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(0);d=h(4);var l;(function(p){p[p.VALUE=0]="VALUE";p[p.PIXEL=1]="PIXEL"})(l=f.PropertyMode||(f.PropertyMode={}));d=function(p){function n(){var q=p.call(this)||this;q._boxVisible=!1;q._boxBounds={topLeft:{x:0,y:0},bottomRight:{x:0, y:0}};q._xBoundsMode=l.PIXEL;q._yBoundsMode=l.PIXEL;q.addClass("selection-box-layer");q._adjustBoundsCallback=function(){q.render()};q._overflowHidden=!0;q._xExtent=[void 0,void 0];q._yExtent=[void 0,void 0];return q}m(n,p);n.prototype._setup=function(){p.prototype._setup.call(this);this._box=this.content().append("g").classed("selection-box",!0).remove();this._boxArea=this._box.append("rect").classed("selection-area",!0)};n.prototype._sizeFromOffer=function(q,t){return{width:q,height:t}};n.prototype.bounds= function(q){if(null==q)return this._getBounds();this._setBounds(q);this._yBoundsMode=this._xBoundsMode=l.PIXEL;this.render();return this};n.prototype._setBounds=function(q){this._boxBounds={topLeft:{x:Math.min(q.topLeft.x,q.bottomRight.x),y:Math.min(q.topLeft.y,q.bottomRight.y)},bottomRight:{x:Math.max(q.topLeft.x,q.bottomRight.x),y:Math.max(q.topLeft.y,q.bottomRight.y)}}};n.prototype._getBounds=function(){return{topLeft:{x:this._xBoundsMode===l.PIXEL?this._boxBounds.topLeft.x:null==this._xScale? 0:Math.min(this.xScale().scale(this.xExtent()[0]),this.xScale().scale(this.xExtent()[1])),y:this._yBoundsMode===l.PIXEL?this._boxBounds.topLeft.y:null==this._yScale?0:Math.min(this.yScale().scale(this.yExtent()[0]),this.yScale().scale(this.yExtent()[1]))},bottomRight:{x:this._xBoundsMode===l.PIXEL?this._boxBounds.bottomRight.x:null==this._xScale?0:Math.max(this.xScale().scale(this.xExtent()[0]),this.xScale().scale(this.xExtent()[1])),y:this._yBoundsMode===l.PIXEL?this._boxBounds.bottomRight.y:null== this._yScale?0:Math.max(this.yScale().scale(this.yExtent()[0]),this.yScale().scale(this.yExtent()[1]))}}};n.prototype.renderImmediately=function(){p.prototype.renderImmediately.call(this);if(this._boxVisible){var q=this.bounds(),t=q.topLeft.y,v=q.bottomRight.y,z=q.topLeft.x;q=q.bottomRight.x;if(!(w.Math.isValidNumber(t)&&w.Math.isValidNumber(v)&&w.Math.isValidNumber(z)&&w.Math.isValidNumber(q)))throw Error("bounds have not been properly set");this._boxArea.attrs({x:z,y:t,width:q-z,height:v-t});this.content().node().appendChild(this._box.node())}else this._box.remove(); return this};n.prototype.boxVisible=function(q){if(null==q)return this._boxVisible;this._boxVisible=q;this.render();return this};n.prototype.fixedWidth=function(){return!0};n.prototype.fixedHeight=function(){return!0};n.prototype.xScale=function(){return this._xScale};n.prototype.yScale=function(){return this._yScale};n.prototype.xExtent=function(){return this._getXExtent()};n.prototype._getXExtent=function(){return this._xBoundsMode===l.VALUE?this._xExtent:null==this._xScale?[void 0,void 0]:[this._xScale.invert(this._boxBounds.topLeft.x), this._xScale.invert(this._boxBounds.bottomRight.x)]};n.prototype._setXExtent=function(q){this._xExtent=q};n.prototype.yExtent=function(){return this._getYExtent()};n.prototype._getYExtent=function(){return this._yBoundsMode===l.VALUE?this._yExtent:null==this._yScale?[void 0,void 0]:[this._yScale.invert(this._boxBounds.topLeft.y),this._yScale.invert(this._boxBounds.bottomRight.y)]};n.prototype._setYExtent=function(q){this._yExtent=q};n.prototype.destroy=function(){p.prototype.destroy.call(this);null!= this._xScale&&this.xScale().offUpdate(this._adjustBoundsCallback);null!=this._yScale&&this.yScale().offUpdate(this._adjustBoundsCallback)};return n}(d.Component);f.SelectionBoxLayer=d},function(d,f,h){var m=this&&this.__extends||function(w,l){function p(){this.constructor=w}for(var n in l)l.hasOwnProperty(n)&&(w[n]=l[n]);w.prototype=null===l?Object.create(l):(p.prototype=l.prototype,new p)};d=function(w){function l(){return w.call(this,"path","arc fill")||this}m(l,w);l.prototype._applyDefaultAttributes= function(p){p.style("stroke","none")};return l}(h(9).SVGDrawer);f.ArcSVGDrawer=d},function(d,f,h){var m=this&&this.__extends||function(w,l){function p(){this.constructor=w}for(var n in l)l.hasOwnProperty(n)&&(w[n]=l[n]);w.prototype=null===l?Object.create(l):(p.prototype=l.prototype,new p)};d=function(w){function l(){return w.call(this,"path","arc outline")||this}m(l,w);l.prototype._applyDefaultAttributes=function(p){p.style("fill","none")};return l}(h(9).SVGDrawer);f.ArcOutlineSVGDrawer=d},function(d, f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(18);d=function(p){function n(){return p.call(this,"path","area")||this}m(n,p);n.prototype._applyDefaultAttributes=function(q){q.style("stroke","none")};n.prototype.getVisualPrimitiveAtIndex=function(){return p.prototype.getVisualPrimitiveAtIndex.call(this,0)};return n}(h(9).SVGDrawer);f.AreaSVGDrawer= d;var l=["fill","opacity","fill-opacity"];f.makeAreaCanvasDrawStep=function(p){return function(n,q,t){t=w.resolveAttributes(t,l,q[0],0);w.renderArea(n,p(),q[0],t)}}},function(d,f,h){var m=this&&this.__extends||function(w,l){function p(){this.constructor=w}for(var n in l)l.hasOwnProperty(n)&&(w[n]=l[n]);w.prototype=null===l?Object.create(l):(p.prototype=l.prototype,new p)};d=function(w){function l(){return w.call(this,"line","")||this}m(l,w);return l}(h(9).SVGDrawer);f.SegmentSVGDrawer=d},function(d, f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(86),l=h(18);d=function(p){function n(){return p.call(this,"path","symbol")||this}m(n,p);return n}(h(9).SVGDrawer);f.SymbolSVGDrawer=d;f.makeSymbolCanvasDrawStep=function(p,n,q){var t=this;return function(v,z,y){var x=v.canvas,D=x.clientWidth;x=x.clientHeight;for(var G=new w.CanvasBuffer(0,0),J=n(), F=q(),E=null,L=null,N=null,M=0;M<z.length;M++){var R=z[M];if(null!=R){var Z=l.resolveAttributesSubsetWithStyles(y,["x","y"],R,M),T=F(R,M,p),Y=Z.x,ma=Z.y;if(0<=Y+T&&Y-T<=D&&0<=ma+T&&ma-T<=x){a:if(Y=l.ContextStyleAttrs,null==E)Y=!1;else{for(ma=0;ma<Y.length;ma++){var va=Y[ma];if(E[va]!=Z[va]){Y=!1;break a}}Y=!0}R=J(R,M,t._dataset);Y&&N==T&&L==R||(E=l.getStrokeWidth(Z),E=T+E+1,(E>G.screenWidth||E>G.screenHeight)&&G.resize(E,E,!0),G.clear(),E=G.ctx,E.beginPath(),R(T).context(E)(null),E.closePath(),l.renderPathWithStyle(E, Z),L=R,N=T,E=Z);G.blitCenter(v,Z.x,Z.y)}}}}}},function(d,f,h){function m(F){return F instanceof x?F:F instanceof Date?p(F.valueOf()):F instanceof y.Scale?w(F):F instanceof z.Dataset?l(F):v(F)?q(F):Array.isArray(F)?n(F):p(F)}function w(F){F={domain:F.domain(),range:F.range(),updateId:F.updateId(),ref:p(F)};return q(F)}function l(F){F={ref:p(F),updateId:F.updateId()};return q(F)}function p(F){return new G(F)}function n(F){return new D(F.map(function(E){return m(E)}))}function q(F){var E={},L;for(L in F)F.hasOwnProperty(L)&& (E[L]=m(F[L]));return new J(E)}var t=this&&this.__extends||function(F,E){function L(){this.constructor=F}for(var N in E)E.hasOwnProperty(N)&&(F[N]=E[N]);F.prototype=null===E?Object.create(E):(L.prototype=E.prototype,new L)},v=h(128),z=h(38),y=h(17);f.sign=m;f.signScale=w;f.signDataset=l;f.signRef=p;f.signArray=n;f.signObj=q;var x=function(){function F(){}F.prototype.isDifferent=function(E){return E instanceof this.constructor?this.isSignatureDifferent(E):!0};return F}();f.Signature=x;var D=function(F){function E(L){var N= F.call(this)||this;N.array=L;return N}t(E,F);E.prototype.isSignatureDifferent=function(L){if(L.array.length!==this.array.length)return!0;for(var N=0;N<this.array.length;N++)if(this.array[N].isDifferent(L.array[N]))return!0;return!1};return E}(x);f.ArraySignature=D;var G=function(F){function E(L){var N=F.call(this)||this;N.ref=L;return N}t(E,F);E.prototype.isSignatureDifferent=function(L){return this.ref!==L.ref};return E}(x);f.ReferenceSignature=G;var J=function(F){function E(L){var N=F.call(this)|| this;N.obj=L;return N}t(E,F);E.prototype.isSignatureDifferent=function(L){var N=Object.keys(this.obj),M=Object.keys(L.obj);if(N.length!==M.length)return!0;for(M=0;M<N.length;M++){var R=N[M];if(!L.obj.hasOwnProperty(R)||this.obj[R].isDifferent(L.obj[R]))return!0}return!1};return E}(x);f.ObjectSignature=J},function(d,f,h){var m=this&&this.__extends||function(x,D){function G(){this.constructor=x}for(var J in D)D.hasOwnProperty(J)&&(x[J]=D[J]);x.prototype=null===D?Object.create(D):(G.prototype=D.prototype, new G)},w=h(1),l=h(3),p=h(0),n=h(14),q=h(46),t=h(6),v=h(33),z=h(19);d=h(53);var y=h(2);h=function(x){function D(){var G=x.call(this)||this;G.addClass("area-plot");G.y0(0);G.attr("fill-opacity",.25);G.attr("fill",(new l.Color).range()[0]);G._lineDrawers=new p.Map;return G}m(D,x);D.prototype.y=function(G,J){if(null==G)return x.prototype.y.call(this);null==J?x.prototype.y.call(this,G):x.prototype.y.call(this,G,J);null!=J&&(G=this.y0().accessor,null!=G&&this._bindProperty(D._Y0_KEY,G,J),this._updateYScale()); return this};D.prototype.y0=function(G){if(null==G)return this._propertyBindings.get(D._Y0_KEY);var J=this.y();this._bindProperty(D._Y0_KEY,G,J&&J.scale);this._updateYScale();this.render();return this};D.prototype._onDatasetUpdate=function(){x.prototype._onDatasetUpdate.call(this);this._updateYScale()};D.prototype._addDataset=function(G){var J=this;this._lineDrawers.set(G,new n.ProxyDrawer(function(){return new v.LineSVGDrawer},function(F){return new n.CanvasDrawer(F,v.makeLineCanvasDrawStep(function(){var E= y.Plot._scaledAccessor(J.x()),L=y.Plot._scaledAccessor(J.y());return J._d3LineFactory(G,E,L)}))}));x.prototype._addDataset.call(this,G);return this};D.prototype._createNodesForDataset=function(G){x.prototype._createNodesForDataset.call(this,G);G=this._lineDrawers.get(G);"svg"===this.renderer()?G.useSVG(this._renderArea):G.useCanvas(this._canvas);return G};D.prototype._removeDatasetNodes=function(G){x.prototype._removeDatasetNodes.call(this,G);this._lineDrawers.get(G).remove()};D.prototype._additionalPaint= function(){var G=this,J=this._generateLineDrawSteps(),F=this._getDataToDraw();this.datasets().forEach(function(E){var L=y.Plot.applyDrawSteps(J,E);G._lineDrawers.get(E).draw(F.get(E),L)})};D.prototype._generateLineDrawSteps=function(){var G=[];if(this._animateOnNextRender()){var J=this._generateLineAttrToProjector();J.d=this._constructLineProjector(y.Plot._scaledAccessor(this.x()),this._getResetYFunction());G.push({attrToProjector:J,animator:this._getAnimator(z.Animator.RESET)})}G.push({attrToProjector:this._generateLineAttrToProjector(), animator:this._getAnimator(z.Animator.MAIN)});return G};D.prototype._generateLineAttrToProjector=function(){var G=this._getAttrToProjector();G.d=this._constructLineProjector(y.Plot._scaledAccessor(this.x()),y.Plot._scaledAccessor(this.y()));return G};D.prototype._createDrawer=function(G){var J=this;return new t.ProxyDrawer(function(){return new q.AreaSVGDrawer},function(F){return new n.CanvasDrawer(F,q.makeAreaCanvasDrawStep(function(){var E=y.Plot._scaledAccessor(J.x()),L=y.Plot._scaledAccessor(J.y()), N=y.Plot._scaledAccessor(J.y0());return J._createAreaGenerator(E,L,N,J._createDefinedProjector(E,L),G)}))})};D.prototype._generateDrawSteps=function(){var G=[];if(this._animateOnNextRender()){var J=this._getAttrToProjector();J.d=this._constructAreaProjector(y.Plot._scaledAccessor(this.x()),this._getResetYFunction(),y.Plot._scaledAccessor(this.y0()));G.push({attrToProjector:J,animator:this._getAnimator(z.Animator.RESET)})}G.push({attrToProjector:this._getAttrToProjector(),animator:this._getAnimator(z.Animator.MAIN)}); return G};D.prototype._updateYScale=function(){var G=this.getExtentsForProperty("y0");G=p.Array.uniq(p.Array.flatten(G));var J=1===G.length?G[0]:null;G=(G=this.y())&&G.scale;null!=G&&(null!=this._constantBaselineValueProvider&&(G.removePaddingExceptionsProvider(this._constantBaselineValueProvider),this._constantBaselineValueProvider=null),null!=J&&(this._constantBaselineValueProvider=function(){return[J]},G.addPaddingExceptionsProvider(this._constantBaselineValueProvider)))};D.prototype._getResetYFunction= function(){return y.Plot._scaledAccessor(this.y0())};D.prototype._propertyProjectors=function(){var G=x.prototype._propertyProjectors.call(this);G.d=this._constructAreaProjector(y.Plot._scaledAccessor(this.x()),y.Plot._scaledAccessor(this.y()),y.Plot._scaledAccessor(this.y0()));return G};D.prototype.selections=function(G){var J=this;void 0===G&&(G=this.datasets());if("canvas"===this.renderer())return w.selectAll();var F=x.prototype.selections.call(this,G).nodes();G.map(function(E){return J._lineDrawers.get(E)}).filter(function(E){return null!= E}).forEach(function(E){return F.push.apply(F,E.getVisualPrimitives())});return w.selectAll(F)};D.prototype._constructAreaProjector=function(G,J,F){var E=this,L=this._createDefinedProjector(y.Plot._scaledAccessor(this.x()),y.Plot._scaledAccessor(this.y()));return function(N,M,R){return E._createAreaGenerator(G,J,F,L,R)(N)}};D.prototype._createDefinedProjector=function(G,J){return function(F,E,L){var N=G(F,E,L);F=J(F,E,L);return p.Math.isValidNumber(N)&&p.Math.isValidNumber(F)}};D.prototype._createAreaGenerator= function(G,J,F,E,L){var N=this._getCurveFactory();return w.area().x(function(M,R){return G(M,R,L)}).y1(function(M,R){return J(M,R,L)}).y0(function(M,R){return F(M,R,L)}).curve(N).defined(function(M,R){return E(M,R,L)})};return D}(d.Line);h._Y0_KEY="y0";f.Area=h},function(d,f){d=f.Animator||(f.Animator={});d.MAIN="main";d.RESET="reset"},function(d,f){var h=function(){function m(){var w=this;this.translate=this.scale=0;this.cachedDomain=[null,null];this.lastSeenDomain=[null,null];this.updateDomain= function(l){w.lastSeenDomain=l.getTransformationDomain();var p=l.scaleTransformation(w.cachedDomain[1])-l.scaleTransformation(w.cachedDomain[0]),n=l.scaleTransformation(w.lastSeenDomain[1])-l.scaleTransformation(w.lastSeenDomain[0]);w.scale=p/n||1;w.translate=l.scaleTransformation(w.cachedDomain[0])-l.scaleTransformation(w.lastSeenDomain[0])*w.scale||0}}m.prototype.reset=function(){this.scale=1;this.translate=0;this.cachedDomain=this.lastSeenDomain};m.prototype.setDomain=function(w){this.cachedDomain= w.getTransformationDomain()};return m}();d=function(){function m(w,l){var p=this;this.renderCallback=w;this.applyTransformCallback=l;this.domainTransformX=new h;this.domainTransformY=new h;this.renderDeferred=function(){p.applyTransform();clearTimeout(p.timeoutToken);p.timeoutToken=setTimeout(function(){p.renderCallback()},m.DEFERRED_RENDERING_DELAY)}}m.prototype.setDomains=function(w,l){w&&this.domainTransformX.setDomain(w);l&&this.domainTransformY.setDomain(l);this.renderDeferred()};m.prototype.updateDomains= function(w,l){w&&this.domainTransformX.updateDomain(w);l&&this.domainTransformY.updateDomain(l);this.renderDeferred()};m.prototype.resetTransforms=function(){this.domainTransformX.reset();this.domainTransformY.reset();this.applyTransform()};m.prototype.applyTransform=function(){this.applyTransformCallback(this.domainTransformX.translate,this.domainTransformY.translate,this.domainTransformX.scale,this.domainTransformY.scale)};return m}();d.DEFERRED_RENDERING_DELAY=200;f.DeferredRenderer=d},function(d, f,h){var m=this&&this.__extends||function(G,J){function F(){this.constructor=G}for(var E in J)J.hasOwnProperty(E)&&(G[E]=J[E]);G.prototype=null===J?Object.create(J):(F.prototype=J.prototype,new F)},w=h(1),l=h(7),p=h(14),n=h(6),q=h(33),t=h(3),v=h(11),z=h(0);d=h(10);var y=h(19),x=h(2);h=h(16);var D={linear:w.curveLinear,linearClosed:w.curveLinearClosed,step:w.curveStep,stepBefore:w.curveStepBefore,stepAfter:w.curveStepAfter,basis:w.curveBasis,basisOpen:w.curveBasisOpen,basisClosed:w.curveBasisClosed, bundle:w.curveBundle,cardinal:w.curveCardinal,cardinalOpen:w.curveCardinalOpen,cardinalClosed:w.curveCardinalClosed,monotone:w.curveMonotoneX};f.CurveName=d.makeEnum("linear linearClosed step stepBefore stepAfter basis basisOpen basisClosed bundle cardinal cardinalOpen cardinalClosed monotone".split(" "));h=function(G){function J(){var F=G.call(this)||this;F._curve="linear";F._autorangeSmooth=!1;F._croppedRenderingEnabled=!0;F._collapseDenseVerticalLinesEnabled=!1;F._downsamplingEnabled=!1;F.addClass("line-plot"); var E=new l.Easing;E.stepDuration(x.Plot._ANIMATION_MAX_DURATION);E.easingMode("expInOut");E.maxTotalDuration(x.Plot._ANIMATION_MAX_DURATION);F.animator(y.Animator.MAIN,E);F.attr("stroke",(new t.Color).range()[0]);F.attr("stroke-width","2px");return F}m(J,G);J.prototype.x=function(F,E,L){if(null==F)return G.prototype.x.call(this);G.prototype.x.call(this,F,E,L);this._setScaleSnapping();return this};J.prototype.y=function(F,E,L){if(null==F)return G.prototype.y.call(this);G.prototype.y.call(this,F,E, L);this._setScaleSnapping();return this};J.prototype.autorangeMode=function(F){if(null==F)return G.prototype.autorangeMode.call(this);G.prototype.autorangeMode.call(this,F);this._setScaleSnapping();return this};J.prototype.autorangeSmooth=function(){return this._autorangeSmooth};J.prototype._setScaleSnapping=function(){"x"===this.autorangeMode()&&this.x()&&this.x().scale&&this.x().scale instanceof v.QuantitativeScale&&this.x().scale.snappingDomainEnabled(!this.autorangeSmooth());"y"===this.autorangeMode()&& this.y()&&this.y().scale&&this.y().scale instanceof v.QuantitativeScale&&this.y().scale.snappingDomainEnabled(!this.autorangeSmooth())};J.prototype.curve=function(F){if(null==F)return this._curve;this._curve=F;this.render();return this};J.prototype.downsamplingEnabled=function(){return this._downsamplingEnabled};J.prototype.croppedRenderingEnabled=function(F){if(null==F)return this._croppedRenderingEnabled;this._croppedRenderingEnabled=F;this.render();return this};J.prototype.collapseDenseLinesEnabled= function(F){if(null==F)return this._collapseDenseVerticalLinesEnabled;this._collapseDenseVerticalLinesEnabled=F;this.render();return this};J.prototype._createDrawer=function(F){var E=this;return new n.ProxyDrawer(function(){return new q.LineSVGDrawer},function(L){return new p.CanvasDrawer(L,q.makeLineCanvasDrawStep(function(){return E._d3LineFactory(F)}))})};J.prototype.getExtentsForProperty=function(F){var E=G.prototype.getExtentsForProperty.call(this,F);if(!this._autorangeSmooth||this.autorangeMode()!== F||"x"!==this.autorangeMode()&&"y"!==this.autorangeMode())return E;F=this._getEdgeIntersectionPoints();var L="y"===this.autorangeMode()?F.left.concat(F.right).map(function(N){return N.y}):F.top.concat(F.bottom).map(function(N){return N.x});return E.map(function(N){return w.extent(w.merge([N,L]))})};J.prototype._getEdgeIntersectionPoints=function(){var F=this;if(!(this.y().scale instanceof v.QuantitativeScale&&this.x().scale instanceof v.QuantitativeScale))return{left:[],right:[],top:[],bottom:[]}; var E=this.y().scale,L=this.x().scale,N={left:[],right:[],top:[],bottom:[]},M=L.scale(L.domain()[0]),R=L.scale(L.domain()[1]),Z=E.scale(E.domain()[0]),T=E.scale(E.domain()[1]);this.datasets().forEach(function(Y){for(var ma=Y.data(),va,Ba,oa,xa,Pa,Ha,La,qa=1;qa<ma.length;qa++)xa=Ha||L.scale(F.x().accessor(ma[qa-1],qa-1,Y)),Pa=La||E.scale(F.y().accessor(ma[qa-1],qa-1,Y)),Ha=L.scale(F.x().accessor(ma[qa],qa,Y)),La=E.scale(F.y().accessor(ma[qa],qa,Y)),xa<M===M<=Ha&&(va=M-xa,Ba=Ha-xa,oa=La-Pa,va=va*oa/ Ba,N.left.push({x:M,y:E.invert(Pa+va)})),xa<R===R<=Ha&&(va=R-xa,Ba=Ha-xa,oa=La-Pa,va=va*oa/Ba,N.right.push({x:R,y:E.invert(Pa+va)})),Pa<T===T<=La&&(Ba=Ha-xa,va=T-Pa,oa=La-Pa,va=va*Ba/oa,N.top.push({x:L.invert(xa+va),y:T})),Pa<Z===Z<=La&&(Ba=Ha-xa,va=Z-Pa,oa=La-Pa,va=va*Ba/oa,N.bottom.push({x:L.invert(xa+va),y:Z}))});return N};J.prototype._getResetYFunction=function(){var F=this.y().scale.domain(),E=Math.max(F[0],F[1]);F=Math.min(F[0],F[1]);E=0>E&&E||0<F&&F||0;var L=this.y().scale.scale(E);return function(){return L}}; J.prototype._generateDrawSteps=function(){var F=[];if(this._animateOnNextRender()){var E=this._getAttrToProjector();E.d=this._constructLineProjector(x.Plot._scaledAccessor(this.x()),this._getResetYFunction());F.push({attrToProjector:E,animator:this._getAnimator(y.Animator.RESET)})}F.push({attrToProjector:this._getAttrToProjector(),animator:this._getAnimator(y.Animator.MAIN)});return F};J.prototype._generateAttrToProjector=function(){var F=G.prototype._generateAttrToProjector.call(this);Object.keys(F).forEach(function(E){if("d"!== E){var L=F[E];F[E]=function(N,M,R){return 0<N.length?L(N[0],M,R):null}}});return F};J.prototype.entitiesAt=function(F){F=this.entityNearestByXThenY(F);return null!=F?[F]:[]};J.prototype.entityNearestByXThenY=function(F){var E=Infinity,L=Infinity,N,M=this.bounds();this.entities().forEach(function(R){if(z.Math.within(R.position,M)){var Z=Math.abs(F.x-R.position.x),T=Math.abs(F.y-R.position.y);if(Z<E||Z===E&&T<L)N=R,E=Z,L=T}});return N};J.prototype._propertyProjectors=function(){var F=G.prototype._propertyProjectors.call(this); F.d=this._constructLineProjector(x.Plot._scaledAccessor(this.x()),x.Plot._scaledAccessor(this.y()));return F};J.prototype._constructLineProjector=function(F,E){var L=this;return function(N,M,R){return L._d3LineFactory(R,F,E)(N)}};J.prototype._d3LineFactory=function(F,E,L){void 0===E&&(E=x.Plot._scaledAccessor(this.x()));void 0===L&&(L=x.Plot._scaledAccessor(this.y()));return w.line().x(function(N,M){return E(N,M,F)}).y(function(N,M){return L(N,M,F)}).curve(this._getCurveFactory()).defined(function(N, M){var R=E(N,M,F);N=L(N,M,F);return z.Math.isValidNumber(R)&&z.Math.isValidNumber(N)})};J.prototype._getCurveFactory=function(){var F=this.curve();return"string"===typeof F?(F=D[F],null==F?D.linear:F):F};J.prototype._getDataToDraw=function(){var F=this,E=new z.Map;this.datasets().forEach(function(L){var N=L.data();if(F._croppedRenderingEnabled||F._downsamplingEnabled){var M=N.map(function(R,Z){return Z});F._croppedRenderingEnabled&&(M=F._filterCroppedRendering(L,M));F._downsamplingEnabled&&(M=F._filterDownsampling(L, M));F._collapseDenseVerticalLinesEnabled&&(M=F._filterDenseLines(L,M));E.set(L,[M.map(function(R){return N[R]})])}else E.set(L,[N])});return E};J.prototype._filterCroppedRendering=function(F,E){function L(oa,xa){return z.Math.inRange(oa,0,N.width())&&z.Math.inRange(xa,0,N.height())}for(var N=this,M=x.Plot._scaledAccessor(this.x()),R=x.Plot._scaledAccessor(this.y()),Z=F.data(),T=[],Y=0;Y<E.length;Y++){var ma=M(Z[E[Y]],E[Y],F),va=R(Z[E[Y]],E[Y],F);ma=L(ma,va);if(!ma&&null!=E[Y-1]&&null!=Z[E[Y-1]]){va= M(Z[E[Y-1]],E[Y-1],F);var Ba=R(Z[E[Y-1]],E[Y-1],F);ma=ma||L(va,Ba)}ma||null==E[Y+1]||null==Z[E[Y+1]]||(va=M(Z[E[Y+1]],E[Y+1],F),Ba=R(Z[E[Y+1]],E[Y+1],F),ma=ma||L(va,Ba));ma&&T.push(E[Y])}return T};J.prototype._filterDownsampling=function(F,E){function L(La,qa){var Cb=M(N[E[La]],E[La],F),tb=R(N[E[La]],E[La],F),ta=M(N[E[La+1]],E[La+1],F);La=R(N[E[La+1]],E[La+1],F);return Infinity===qa?Math.floor(Cb)===Math.floor(ta):Math.floor(La)===Math.floor(tb+(ta-Cb)*qa)}if(0===E.length)return[];for(var N=F.data(), M=x.Plot._scaledAccessor(this.x()),R=x.Plot._scaledAccessor(this.y()),Z=[E[0]],T=0;T<E.length-1;){var Y=E[T],ma=M(N[E[T]],E[T],F),va=R(N[E[T]],E[T],F),Ba=M(N[E[T+1]],E[T+1],F),oa=R(N[E[T+1]],E[T+1],F);oa=Math.floor(ma)===Math.floor(Ba)?Infinity:(oa-va)/(Ba-ma);Ba=E[T];va=Infinity===oa?va:ma;ma=Ba;for(var xa=va,Pa=!0;T<E.length-1&&(Pa||L(T,oa));){T++;Pa=!1;var Ha=Infinity===oa?R(N[E[T]],E[T],F):M(N[E[T]],E[T],F);Ha>xa&&(xa=Ha,ma=E[T]);Ha<va&&(va=Ha,Ba=E[T])}oa=E[T];Ba!==Y&&Z.push(Ba);ma!==Ba&&ma!== Y&&Z.push(ma);oa!==Y&&oa!==Ba&&oa!==ma&&Z.push(oa)}return Z};J.prototype._filterDenseLines=function(F,E){if(0===E.length)return[];var L=F.data(),N=x.Plot._scaledAccessor(this.x()),M=x.Plot._scaledAccessor(this.y());return this._bucketByX(F,E,function(R){return N(L[R],R,F)},function(R){return M(L[R],R,F)})};J.prototype._bucketByX=function(F,E,L,N){var M=[];F=F.data();for(var R=null,Z=0;Z<=E.length;++Z){var T=E[Z];if(null!=F[T]){var Y=Math.floor(L(T)),ma=N(T);null==R?R=new z.Bucket(T,Y,ma):R.isInBucket(Y)? R.addToBucket(ma,T):(M.push.apply(M,R.getUniqueIndices()),R=new z.Bucket(T,Y,ma))}}null!=R&&M.push.apply(M,R.getUniqueIndices());return M};return J}(h.XYPlot);f.Line=h},function(d,f,h){var m=this&&this.__extends||function(q,t){function v(){this.constructor=q}for(var z in t)t.hasOwnProperty(z)&&(q[z]=t[z]);q.prototype=null===t?Object.create(t):(v.prototype=t.prototype,new v)},w=h(1),l=h(26),p=h(0),n=[0,1];d=function(q){function t(){var v=q.call(this)||this;v._range=[0,1];v._d3Scale=w.scaleBand();v._d3Scale.range(n); v._d3TransformationScale=w.scaleLinear();v._d3TransformationScale.domain(n);v._innerPadding=t._convertToPlottableInnerPadding();v._outerPadding=t._convertToPlottableOuterPadding();return v}m(t,q);t.prototype.cloneWithoutProviders=function(){var v=(new t).domain(this.domain()).range(this.range()).innerPadding(this.innerPadding()).outerPadding(this.outerPadding());v._d3TransformationScale.domain(this._d3TransformationScale.domain());return v};t.prototype.extentOfValues=function(v){return p.Array.uniq(v)}; t.prototype._getExtent=function(){return p.Array.uniq(this._getAllIncludedValues())};t.prototype.domain=function(v){return q.prototype.domain.call(this,v)};t.prototype.invertRange=function(){var v,z=this;void 0===v&&(v=this.range());var y=this._d3Scale.bandwidth(),x=this.invertedTransformation(v[0]),D=this.invertedTransformation(v[1]);v=this._d3Scale.domain();var G=v.map(function(J){return z._d3Scale(J)+y/2});x=w.bisect(G,x);D=w.bisect(G,D);return v.slice(x,D)};t.prototype.range=function(v){return q.prototype.range.call(this, v)};t._convertToPlottableInnerPadding=function(){return 1/.7-1};t._convertToPlottableOuterPadding=function(){return.5/.7};t.prototype._setBands=function(){var v=1-1/(1+this.innerPadding()),z=this.outerPadding()/(1+this.innerPadding());this._d3Scale.paddingInner(v);this._d3Scale.paddingOuter(z)};t.prototype.rangeBand=function(){return this._rescaleBand(this._d3Scale.bandwidth())};t.prototype.stepWidth=function(){return this._rescaleBand(this._d3Scale.bandwidth()*(1+this.innerPadding()))};t.prototype.ticks= function(){return this.domain()};t.prototype.innerPadding=function(v){if(null==v)return this._innerPadding;this._innerPadding=v;this.range(this.range());this._dispatchUpdate();return this};t.prototype.outerPadding=function(v){if(null==v)return this._outerPadding;this._outerPadding=v;this.range(this.range());this._dispatchUpdate();return this};t.prototype.scale=function(v){v=this._d3Scale(v)+this._d3Scale.bandwidth()/2;return this._d3TransformationScale(v)};t.prototype.zoom=function(v,z){var y=this; this._d3TransformationScale.domain(this._d3TransformationScale.range().map(function(x){return y._d3TransformationScale.invert(l.zoomOut(x,v,z))}));this._dispatchUpdate()};t.prototype.pan=function(v){var z=this;this._d3TransformationScale.domain(this._d3TransformationScale.range().map(function(y){return z._d3TransformationScale.invert(y+v)}));this._dispatchUpdate()};t.prototype.scaleTransformation=function(v){return this._d3TransformationScale(v)};t.prototype.invertedTransformation=function(v){return this._d3TransformationScale.invert(v)}; t.prototype.getTransformationExtent=function(){return n};t.prototype.getTransformationDomain=function(){return this._d3TransformationScale.domain()};t.prototype.setTransformationDomain=function(v){this._d3TransformationScale.domain(v);this._dispatchUpdate()};t.prototype._getDomain=function(){return this._backingScaleDomain()};t.prototype._backingScaleDomain=function(v){if(null==v)return this._d3Scale.domain();this._d3Scale.domain(v);this._setBands();return this};t.prototype._getRange=function(){return this._range}; t.prototype._setRange=function(v){this._range=v;this._d3TransformationScale.range(v);this._setBands()};t.prototype._rescaleBand=function(v){return Math.abs(this._d3TransformationScale(v)-this._d3TransformationScale(0))};return t}(h(17).Scale);f.Category=d},function(d,f,h){function m(D){try{var G=D.node().getBBox()}catch(J){G={x:0,y:0,width:0,height:0}}return G}function w(D){if("number"===typeof D)return{min:D,max:D};if(D instanceof Object&&"min"in D&&"max"in D)return D;throw Error("input '"+D+"' can't be parsed as an Range"); }function l(D,G){D=D.getPropertyValue(G);return parseFloat(D)||0}function p(D){if(null==D||"none"===D)return null;D=D.match(y);if(null==D||2>D.length)return null;D=D[1].split(x).map(function(G){return parseFloat(G)});return 6!=D.length?null:D}var n=h(1),q=Math;f.contains=function(D,G){for(;null!=G&&G!==D;)G=G.parentNode;return G===D};f.elementBBox=m;f.entityBounds=function(D){return D instanceof SVGElement?m(n.select(D)):D instanceof HTMLElement?(D=D.getBoundingClientRect(),{x:D.left,y:D.top,width:D.width, height:D.height}):{x:0,y:0,width:0,height:0}};f.SCREEN_REFRESH_RATE_MILLISECONDS=1E3/60;f.requestAnimationFramePolyfill=function(D){null!=window.requestAnimationFrame?window.requestAnimationFrame(D):setTimeout(D,f.SCREEN_REFRESH_RATE_MILLISECONDS)};f.elementWidth=function(D){D=D instanceof n.selection?D.node():D;D=window.getComputedStyle(D);return l(D,"width")+l(D,"padding-left")+l(D,"padding-right")+l(D,"border-left-width")+l(D,"border-right-width")};f.elementHeight=function(D){D=D instanceof n.selection? D.node():D;D=window.getComputedStyle(D);return l(D,"height")+l(D,"padding-top")+l(D,"padding-bottom")+l(D,"border-top-width")+l(D,"border-bottom-width")};var t=/translate\s*\(\s*((?:[-+]?[0-9]*\.?[0-9]+))(?:(?:(?:\s+,?\s*)|(?:,\s*))((?:[-+]?[0-9]*\.?[0-9]+)))?\s*\)/,v=/rotate\s*\(\s*((?:[-+]?[0-9]*\.?[0-9]+))\s*\)/,z=/scale\s*\(\s*((?:[-+]?[0-9]*\.?[0-9]+))(?:(?:(?:\s+,?\s*)|(?:,\s*))((?:[-+]?[0-9]*\.?[0-9]+)))?\s*\)/;f.getTranslateValues=function(D){D=t.exec(D.attr("transform"));if(null!=D){var G= D[2];return[+D[1],+(void 0===G?0:G)]}return[0,0]};f.getRotate=function(D){D=v.exec(D.attr("transform"));return null!=D?+D[1]:0};f.getScaleValues=function(D){var G=z.exec(D.attr("transform"));return null!=G?(D=G[1],G=G[2],[+D,null==G?+D:+G]):[0,0]};f.clientRectsOverlap=function(D,G){return q.floor(D.right)<=q.ceil(G.left)||q.ceil(D.left)>=q.floor(G.right)||q.floor(D.bottom)<=q.ceil(G.top)||q.ceil(D.top)>=q.floor(G.bottom)?!1:!0};f.expandRect=function(D,G){return{left:D.left-G,top:D.top-G,right:D.right+ G,bottom:D.bottom+G,width:D.width+2*G,height:D.height+2*G}};f.clientRectInside=function(D,G){return q.floor(G.left)<=q.ceil(D.left)&&q.floor(G.top)<=q.ceil(D.top)&&q.floor(D.right)<=q.ceil(G.right)&&q.floor(D.bottom)<=q.ceil(G.bottom)};f.intersectsBBox=function(D,G,J,F){void 0===F&&(F=.5);D=w(D);G=w(G);return J.x+J.width>=D.min-F&&J.x<=D.max+F&&J.y+J.height>=G.min-F&&J.y<=G.max+F};f.getHtmlElementAncestors=function(D){for(var G=[];D&&D instanceof HTMLElement;)G.push(D),D=D.parentElement;return G}; f.getElementTransform=function(D){D=window.getComputedStyle(D,null);D=D.getPropertyValue("-webkit-transform")||D.getPropertyValue("-moz-transform")||D.getPropertyValue("-ms-transform")||D.getPropertyValue("-o-transform")||D.getPropertyValue("transform");return p(D)};var y=/^matrix\(([^)]+)\)$/,x=/[, ]+/},function(d,f,h){function m(v,z){return[v[0]*z[0]+v[2]*z[1],v[1]*z[0]+v[3]*z[1],v[0]*z[2]+v[2]*z[3],v[1]*z[2]+v[3]*z[3],v[0]*z[4]+v[2]*z[5]+v[4],v[1]*z[4]+v[3]*z[5]+v[5]]}function w(v,z){return[v[0], v[1],v[2],v[3],v[0]*z[0]+v[2]*z[1]+v[4],v[1]*z[0]+v[3]*z[1]+v[5]]}function l(v){var z=v[0]*v[3]-v[1]*v[2];if(0===z)throw Error("singular matrix");z=1/z;return[z*v[3],z*-v[1],z*-v[2],z*v[0],z*(-v[3]*v[4]+v[2]*v[5]),z*(v[1]*v[4]+-v[0]*v[5])]}var p=h(1),n=h(55),q=Math,t=[1,0,0,1,0,0];f.inRange=function(v,z,y){return q.min(z,y)<=v&&v<=q.max(z,y)};f.clamp=function(v,z,y){return q.min(q.max(z,v),y)};f.max=function(v,z,y){var x="function"===typeof z?z:null;z=null==x?z:y;v=null==x?p.max(v):p.max(v,x);return void 0!== v?v:z};f.min=function(v,z,y){var x="function"===typeof z?z:null;z=null==x?z:y;v=null==x?p.min(v):p.min(v,x);return void 0!==v?v:z};f.isNaN=function(v){return v!==v};f.isValidNumber=function(v){return"number"===typeof v&&1>v-v};f.range=function(v,z,y){void 0===y&&(y=1);if(0===y)throw Error("step cannot be 0");z=q.max(q.ceil((z-v)/y),0);for(var x=[],D=0;D<z;++D)x[D]=v+y*D;return x};f.distanceSquared=function(v,z){return q.pow(z.y-v.y,2)+q.pow(z.x-v.x,2)};f.degreesToRadians=function(v){return v/360* q.PI*2};f.within=function(v,z){return z.topLeft.x<=v.x&&z.bottomRight.x>=v.x&&z.topLeft.y<=v.y&&z.bottomRight.y>=v.y};f.boundsIntersects=function(v,z,y,x,D,G){return v<=0+D&&0<=v+y&&z<=0+G&&0<=z+x};f.getCumulativeTransform=function(v){v=n.getHtmlElementAncestors(v);for(var z=t,y=null,x=0;x<v.length;x++){var D=v[x],G=n.getElementTransform(D);if(null!=G){var J=D.clientWidth/2,F=D.clientHeight/2;z=w(z,[J,F]);z=m(z,l(G));z=w(z,[-J,-F])}G=D.scrollLeft;J=D.scrollTop;if(null===y||D===y)G-=D.offsetLeft+D.clientLeft, J-=D.offsetTop+D.clientTop,y=D.offsetParent;z=w(z,[G,J])}return z};f.multiplyMatrix=m;f.premultiplyTranslate=function(v,z){return[z[0],z[1],z[2],z[3],z[4]+v[0],z[5]+v[1]]};f.multiplyTranslate=w;f.invertMatrix=l;f.applyTransform=function(v,z){return{x:v[0]*z.x+v[2]*z.y+v[4],y:v[1]*z.x+v[3]*z.y+v[5]}}},function(d,f,h){var m=new (h(114).SplitStrategyLinear);d=function(){function p(n,q){void 0===n&&(n=5);void 0===q&&(q=m);this.maxNodeChildren=n;this.splitStrategy=q;this.root=new w(!0);this.size=0}p.prototype.getRoot= function(){return this.root};p.prototype.clear=function(){this.root=new w(!0);this.size=0};p.prototype.insert=function(n,q){for(var t=this.root;!t.leaf;)t=t.subtree(n);n=w.valueNode(n,q);t.insert(n);for(this.size+=1;t.overflow(this.maxNodeChildren);)t=t.split(this.splitStrategy),null==t.parent&&(this.root=t)};p.prototype.locate=function(n){return this.query(function(q){return q.contains(n)})};p.prototype.intersect=function(n){return this.query(function(q){return l.isBoundsOverlapBounds(q,n)})};p.prototype.intersectX= function(n){return this.query(function(q){return l.isBoundsOverlapX(q,n)})};p.prototype.intersectY=function(n){return this.query(function(q){return l.isBoundsOverlapY(q,n)})};p.prototype.query=function(n){var q=[];if(null!=this.root.bounds&&!n(this.root.bounds))return q;for(var t=[this.root];0<t.length;)for(var v=t.shift(),z=0;z<v.entries.length;z++){var y=v.entries[z];n(y.bounds)&&(v.leaf?q.push(y.value):t.push(y))}return q};return p}();f.RTree=d;var w=function(){function p(n){this.leaf=n;this.bounds= null;this.entries=[];this.value=this.parent=null}p.valueNode=function(n,q){var t=new p(!0);t.bounds=n;t.value=q;return t};p.prototype.overflow=function(n){return this.entries.length>n};p.prototype.insert=function(n){this.entries.push(n);n.parent=this;for(var q=this;null!=q;)q.bounds=l.unionAll([q.bounds,n.bounds]),q=q.parent};p.prototype.remove=function(n){n=this.entries.indexOf(n);if(0<=n)for(this.entries.splice(n,1),n=this;null!=n;)n.bounds=l.unionAll(n.entries.map(function(q){return q.bounds})), n=n.parent;return this};p.prototype.subtree=function(n){for(var q=null,t=0;t<this.entries.length;t++){var v=this.entries[t],z=v.unionAreaDifference(n);if(Infinity>z||Infinity===z&&null!=q&&v.entries.length<q.entries.length)q=v}return q};p.prototype.split=function(n){null!=this.parent&&this.parent.remove(this);var q=[new p(this.leaf),new p(this.leaf)];n.split(this.entries,q);n=null!=this.parent?this.parent:new p(!1);n.insert(q[0]);n.insert(q[1]);return n};p.prototype.unionAreaDifference=function(n){return Math.abs(l.union(this.bounds, n).area()-this.bounds.area())};p.prototype.maxDepth=function(){return this.leaf?1:1+this.entries.map(function(n){return n.maxDepth()}).reduce(function(n,q){return Math.max(n,q)})};return p}();f.RTreeNode=w;var l=function(){function p(n,q,t,v){this.xl=n;this.yl=q;this.xh=t;this.yh=v;this.width=this.xh-this.xl;this.height=this.yh-this.yl}p.xywh=function(n,q,t,v){return new p(n,q,n+t,q+v)};p.entityBounds=function(n){return new p(n.x,n.y,n.x+n.width,n.y+n.height)};p.bounds=function(n){return p.pointPair(n.topLeft, n.bottomRight)};p.pointPair=function(n,q){return new p(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.max(n.x,q.x),Math.max(n.y,q.y))};p.points=function(n){if(2>n.length)throw Error("need at least 2 points to create bounds");var q=n.map(function(t){return t.x});n=n.map(function(t){return t.y});return new p(q.reduce(function(t,v){return Math.min(t,v)}),n.reduce(function(t,v){return Math.min(t,v)}),q.reduce(function(t,v){return Math.max(t,v)}),n.reduce(function(t,v){return Math.max(t,v)}))};p.union=function(n, q){return new p(Math.min(n.xl,q.xl),Math.min(n.yl,q.yl),Math.max(n.xh,q.xh),Math.max(n.yh,q.yh))};p.unionAll=function(n){n=n.filter(function(q){return null!=q});return 0===n.length?null:n.reduce(function(q,t){return p.union(q,t)})};p.isBoundsOverlapBounds=function(n,q){return p.isBoundsOverlapX(n,q)&&p.isBoundsOverlapY(n,q)};p.isBoundsOverlapX=function(n,q){return!(n.xh<q.xl)&&!(n.xl>q.xh)};p.isBoundsOverlapY=function(n,q){return!(n.yh<q.yl)&&!(n.yl>q.yh)};p.prototype.area=function(){null==this.areaCached&& (this.areaCached=(this.xh-this.xl)*(this.yh-this.yl));return this.areaCached};p.prototype.contains=function(n){return this.xl<=n.x&&this.xh>=n.x&&this.yl<=n.y&&this.yh>=n.y};return p}();f.RTreeBounds=l},function(d,f){d=function(){function h(){"function"===typeof window.Set?this._es6Set=new window.Set:this._values=[];this.size=0}h.prototype.add=function(m){if(null!=this._es6Set)return this._es6Set.add(m),this.size=this._es6Set.size,this;this.has(m)||(this._values.push(m),this.size=this._values.length); return this};h.prototype.delete=function(m){if(null!=this._es6Set)return m=this._es6Set.delete(m),this.size=this._es6Set.size,m;m=this._values.indexOf(m);return-1!==m?(this._values.splice(m,1),this.size=this._values.length,!0):!1};h.prototype.has=function(m){return null!=this._es6Set?this._es6Set.has(m):-1!==this._values.indexOf(m)};h.prototype.forEach=function(m,w){var l=this;null!=this._es6Set?this._es6Set.forEach(function(p,n){return m.call(w,p,n,l)},w):this._values.forEach(function(p){m.call(w, p,p,l)})};return h}();f.Set=d},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(131));m(h(130))},function(d,f,h){var m=this&&this.__extends||function(l,p){function n(){this.constructor=l}for(var q in p)p.hasOwnProperty(q)&&(l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype=p.prototype,new n)},w=h(21);d=function(l){function p(n,q){var t=l.call(this,n,q)||this;t.cache=new w.Cache(function(v){return t._measureCharacterNotFromCache(v)});return t}m(p,l);p.prototype._measureCharacterNotFromCache= function(n){return l.prototype._measureCharacter.call(this,n)};p.prototype._measureCharacter=function(n){return this.cache.get(n)};p.prototype.reset=function(){this.cache.clear()};return p}(h(61).CharacterMeasurer);f.CacheCharacterMeasurer=d},function(d,f,h){var m=this&&this.__extends||function(w,l){function p(){this.constructor=w}for(var n in l)l.hasOwnProperty(n)&&(w[n]=l[n]);w.prototype=null===l?Object.create(l):(p.prototype=l.prototype,new p)};d=function(w){function l(){return w.apply(this,arguments)|| this}m(l,w);l.prototype._measureCharacter=function(p){return w.prototype._measureLine.call(this,p)};l.prototype._measureLine=function(p){var n=this;p=p.split("").map(function(q){return n._measureCharacter(q)});return{height:p.reduce(function(q,t){return Math.max(q,t.height)},0),width:p.reduce(function(q,t){return q+t.width},0)}};return l}(h(63).Measurer);f.CharacterMeasurer=d},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(36));m(h(60));m(h(132));m(h(61));m(h(63))}, function(d,f,h){var m=this&&this.__extends||function(l,p){function n(){this.constructor=l}for(var q in p)p.hasOwnProperty(q)&&(l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype=p.prototype,new n)},w=h(36);d=function(l){function p(n,q){void 0===q&&(q=!1);n=l.call(this,n)||this;n.useGuards=q;return n}m(p,l);p.prototype._addGuards=function(n){return w.AbstractMeasurer.HEIGHT_TEXT+n+w.AbstractMeasurer.HEIGHT_TEXT};p.prototype._measureLine=function(n){var q;void 0===q&&(q=!1);q=this.useGuards|| q||/^[\t ]$/.test(n);n=l.prototype.measure.call(this,q?this._addGuards(n):n);n.width-=q?2*this.getGuardWidth():0;return n};p.prototype.measure=function(n){var q=this;void 0===n&&(n=w.AbstractMeasurer.HEIGHT_TEXT);if(""===n.trim())return{width:0,height:0};n=n.trim().split("\n").map(function(t){return q._measureLine(t)});return{height:n.reduce(function(t,v){return t+v.height},0),width:n.reduce(function(t,v){return Math.max(t,v.width)},0)}};p.prototype.getGuardWidth=function(){null==this.guardWidth&& (this.guardWidth=l.prototype.measure.call(this).width);return this.guardWidth};return p}(w.AbstractMeasurer);f.Measurer=d},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(138));m(h(65))},function(d,f,h){var m=h(21);d=function(){function w(){this.maxLines(Infinity);this.textTrimming();this.allowBreakingWords();this._tokenizer=new m.Tokenizer;this._breakingCharacter="-"}w.prototype.maxLines=function(l){if(null==l)return this._maxLines;this._maxLines=l;return this}; w.prototype.textTrimming=function(){this._textTrimming="ellipsis"};w.prototype.allowBreakingWords=function(){this._allowBreakingWords=!0};w.prototype.wrap=function(l,p,n,q){var t=this;void 0===q&&(q=Infinity);var v={noBrokeWords:0,noLines:0,originalText:l,truncatedText:"",wrappedText:""};n={availableLines:Math.min(Math.floor(q/p.measure().height),this._maxLines),availableWidth:n,canFitText:!0,currentLine:"",wrapping:v};var z=l.split("\n");return z.reduce(function(y,x,D){return t.breakLineToFitWidth(y, x,D!==z.length-1,p)},n).wrapping};w.prototype.breakLineToFitWidth=function(l,p,n,q){var t=this;l.canFitText||""===l.wrapping.truncatedText||(l.wrapping.truncatedText+="\n");l=this._tokenizer.tokenize(p).reduce(function(v,z){return t.wrapNextToken(z,v,q)},l);p=m.StringMethods.trimEnd(l.currentLine);l.wrapping.noLines+=+(""!==p);l.wrapping.noLines===l.availableLines&&"none"!==this._textTrimming&&n?l.canFitText=!1:l.wrapping.wrappedText+=p;l.currentLine="\n";return l};w.prototype.canFitToken=function(l, p,n){var q=this,t=this._allowBreakingWords?l.split("").map(function(v,z){return z!==l.length-1?v+q._breakingCharacter:v}):[l];return n.measure(l).width<=p||t.every(function(v){return n.measure(v).width<=p})};w.prototype.addEllipsis=function(l,p,n){if("none"===this._textTrimming)return{remainingToken:"",wrappedToken:l};var q=l.substring(0).trim(),t=n.measure(q).width,v=n.measure("...").width,z=0<l.length&&"\n"===l[0]?"\n":"";if(p<=v)return{remainingToken:l,wrappedToken:z+"...".substr(0,Math.floor(p/ (v/3)))};for(;t+v>p;)q=m.StringMethods.trimEnd(q.substr(0,q.length-1)),t=n.measure(q).width;return{remainingToken:m.StringMethods.trimEnd(l.substring(q.length),"-").trim(),wrappedToken:z+q+"..."}};w.prototype.wrapNextToken=function(l,p,n){if(!p.canFitText||p.availableLines===p.wrapping.noLines||!this.canFitToken(l,p.availableWidth,n))return this.finishWrapping(l,p,n);for(;l;){var q=this.breakTokenToFitInWidth(l,p.currentLine,p.availableWidth,n);p.currentLine=q.line;l=q.remainingToken;if(null!=l)if(p.wrapping.noBrokeWords+= +q.breakWord,++p.wrapping.noLines,p.availableLines===p.wrapping.noLines){n=this.addEllipsis(p.currentLine,p.availableWidth,n);p.wrapping.wrappedText+=n.wrappedToken;p.wrapping.truncatedText+=n.remainingToken+l;p.currentLine="\n";break}else p.wrapping.wrappedText+=m.StringMethods.trimEnd(p.currentLine),p.currentLine="\n"}return p};w.prototype.finishWrapping=function(l,p,n){p.canFitText&&p.availableLines!==p.wrapping.noLines&&this._allowBreakingWords&&"none"!==this._textTrimming?(n=this.addEllipsis(p.currentLine+ l,p.availableWidth,n),p.wrapping.wrappedText+=n.wrappedToken,p.wrapping.truncatedText+=n.remainingToken,p.wrapping.noBrokeWords+=+(n.remainingToken.length<l.length),p.wrapping.noLines+=+(0<n.wrappedToken.length),p.currentLine=""):p.wrapping.truncatedText+=l;p.canFitText=!1;return p};w.prototype.breakTokenToFitInWidth=function(l,p,n,q){if(void 0===t)var t=this._breakingCharacter;if(q.measure(p+l).width<=n)return{breakWord:!1,line:p+l,remainingToken:null};if(""===l.trim())return{breakWord:!1,line:p, remainingToken:""};if(!this._allowBreakingWords)return{breakWord:!1,line:p,remainingToken:l};for(var v=0;v<l.length;)if(q.measure(p+l.substring(0,v+1)+t).width<=n)++v;else break;n="";0<v&&(n=t);return{breakWord:0<v,line:p+l.substring(0,v)+n,remainingToken:l.substring(v)}};return w}();f.Wrapper=d},function(d,f,h){d=h(139);for(var m in d)f.hasOwnProperty(m)||(f[m]=d[m])},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}m(h(72));m(h(73));m(h(28))},function(d,f){f.version= "3.7.0"},function(d,f,h){function m(D,G){return D.each(function(){var J=G.apply(this,arguments),F=x.select(this),E;for(E in J)F.attr(E,J[E])})}function w(D,G){for(var J in G)D.attr(J,G[J]);return D}function l(D,G,J){return D.each(function(){var F=G.apply(this,arguments),E=x.select(this),L;for(L in F)E.style(L,F[L],J)})}function p(D,G,J){for(var F in G)D.style(F,G[F],J);return D}function n(D,G){return D.each(function(){var J=G.apply(this,arguments),F=x.select(this),E;for(E in J)F.property(E,J[E])})} function q(D,G){for(var J in G)D.property(J,G[J]);return D}function t(D,G){return D.each(function(){var J=G.apply(this,arguments),F=x.select(this).transition(D),E;for(E in J)F.attr(E,J[E])})}function v(D,G){for(var J in G)D.attr(J,G[J]);return D}function z(D,G,J){return D.each(function(){var F=G.apply(this,arguments),E=x.select(this).transition(D),L;for(L in F)E.style(L,F[L],J)})}function y(D,G,J){for(var F in G)D.style(F,G[F],J);return D}var x=d=h(1);x.selection.prototype.attrs=function(D){return("function"=== typeof D?m:w)(this,D)};x.selection.prototype.styles=function(D){return("function"===typeof D?l:p)(this,D,"")};x.selection.prototype.properties=function(D){return("function"===typeof D?n:q)(this,D)};d.transition.prototype.attrs=function(D){return("function"===typeof D?t:v)(this,D)};d.transition.prototype.styles=function(D){return("function"===typeof D?z:y)(this,D,"")}},function(d,f,h){d=h(117);var m=h(12);h=h(10);var w={linear:d.easeLinear,quad:d.easeQuad,quadIn:d.easeQuadIn,quadOut:d.easeQuadOut, quadInOut:d.easeQuadInOut,cubic:d.easeCubic,cubicIn:d.easeCubicIn,cubicOut:d.easeCubicOut,cubicInOut:d.easeCubicInOut,poly:d.easePoly,polyIn:d.easePolyIn,polyOut:d.easePolyOut,polyInOut:d.easePolyInOut,sin:d.easeSin,sinIn:d.easeSinIn,sinOut:d.easeSinOut,sinInOut:d.easeSinInOut,exp:d.easeExp,expIn:d.easeExpIn,expOut:d.easeExpOut,expInOut:d.easeExpInOut,circle:d.easeCircle,circleIn:d.easeCircleIn,circleOut:d.easeCircleOut,circleInOut:d.easeCircleInOut,bounce:d.easeBounce,bounceIn:d.easeBounceIn,bounceOut:d.easeBounceOut, bounceInOut:d.easeBounceInOut,back:d.easeBack,backIn:d.easeBackIn,backOut:d.easeBackOut,backInOut:d.easeBackInOut,elastic:d.easeElastic,elasticIn:d.easeElasticIn,elasticOut:d.easeElasticOut,elasticInOut:d.easeElasticInOut};f.EaseName=h.makeEnum("linear quad quadIn quadOut quadInOut cubic cubicIn cubicOut cubicInOut poly polyIn polyOut polyInOut sin sinIn sinOut sinInOut exp expIn expOut expInOut circle circleIn circleOut circleInOut bounce bounceIn bounceOut bounceInOut back backIn backOut backInOut elastic elasticIn elasticOut elasticInOut".split(" ")); h=function(){function l(){this._startDelay=l._DEFAULT_START_DELAY_MILLISECONDS;this._stepDuration=l._DEFAULT_STEP_DURATION_MILLISECONDS;this._stepDelay=l._DEFAULT_ITERATIVE_DELAY_MILLISECONDS;this._maxTotalDuration=l._DEFAULT_MAX_TOTAL_DURATION_MILLISECONDS;this._easingMode=l._DEFAULT_EASING_MODE}l.prototype.totalTime=function(p){var n=this._getAdjustedIterativeDelay(p);return this.startDelay()+n*Math.max(p-1,0)+this.stepDuration()};l.prototype.animate=function(p,n){var q=this;p=m.coerceExternalD3(p); var t=p.size(),v=this._getAdjustedIterativeDelay(t);return p.transition().ease(this._getEaseFactory()).duration(this.stepDuration()).delay(function(z,y){return q.startDelay()+v*y}).attrs(n)};l.prototype.startDelay=function(p){if(null==p)return this._startDelay;this._startDelay=p;return this};l.prototype.stepDuration=function(p){if(null==p)return Math.min(this._stepDuration,this._maxTotalDuration);this._stepDuration=p;return this};l.prototype.stepDelay=function(){return this._stepDelay};l.prototype.maxTotalDuration= function(p){if(null==p)return this._maxTotalDuration;this._maxTotalDuration=p;return this};l.prototype.easingMode=function(p){if(null==p)return this._easingMode;this._easingMode=p;return this};l.prototype._getEaseFactory=function(){var p=this.easingMode();return"string"===typeof p?(p=w[p],null==p?w.linear:p):p};l.prototype._getAdjustedIterativeDelay=function(p){var n=this.maxTotalDuration()-this.stepDuration();n=Math.max(n,0);p=n/Math.max(p-1,1);return Math.min(this.stepDelay(),p)};return l}();h._DEFAULT_START_DELAY_MILLISECONDS= 0;h._DEFAULT_STEP_DURATION_MILLISECONDS=300;h._DEFAULT_ITERATIVE_DELAY_MILLISECONDS=15;h._DEFAULT_MAX_TOTAL_DURATION_MILLISECONDS=Infinity;h._DEFAULT_EASING_MODE="expOut";f.Easing=h},function(d,f,h){var m=h(12);d=function(){function w(){}w.prototype.totalTime=function(){return 0};w.prototype.animate=function(l,p){l=m.coerceExternalD3(l);return l.attrs(p)};return w}();f.Null=d},function(d,f,h){var m=this&&this.__extends||function(t,v){function z(){this.constructor=t}for(var y in v)v.hasOwnProperty(y)&& (t[y]=v[y]);t.prototype=null===v?Object.create(v):(z.prototype=v.prototype,new z)},w=h(1),l=h(5),p=h(4),n=h(0),q=h(22);d=function(t){function v(z,y){void 0===y&&(y="bottom");z=t.call(this,z,y)||this;z._tickLabelAngle=0;z._tickLabelShearAngle=0;z.addClass("category-axis");return z}m(v,t);Object.defineProperty(v.prototype,"_wrapper",{get:function(){var z=new l.Wrapper;null!=this._tickLabelMaxLines&&z.maxLines(this._tickLabelMaxLines);return z},enumerable:!0,configurable:!0});Object.defineProperty(v.prototype, "_writer",{get:function(){return new l.Writer(this._measurer,this._typesetterContext,this._wrapper)},enumerable:!0,configurable:!0});v.prototype._setup=function(){t.prototype._setup.call(this);this._typesetterContext=new l.SvgContext(this._tickLabelContainer.node());this._measurer=new l.CacheMeasurer(this._typesetterContext)};v.prototype._rescale=function(){return this.redraw()};v.prototype.requestedSpace=function(z,y){var x=this.isHorizontal()?0:this._tickSpaceRequired()+this.margin(),D=this.isHorizontal()? this._tickSpaceRequired()+this.margin():0;if(0===this._scale.domain().length)return{minWidth:0,minHeight:0};if(this.annotationsEnabled()){var G=this._annotationTierHeight()*this.annotationTierCount();this.isHorizontal()?D+=G:x+=G}z=this._measureTickLabels(z,y);return{minWidth:z.usedWidth+x,minHeight:z.usedHeight+D}};v.prototype._coreSize=function(){var z=this.isHorizontal()?this.height():this.width(),y=this.isHorizontal()?this.requestedSpace(this.width(),this.height()).minHeight:this.requestedSpace(this.width(), this.height()).minWidth,x=this.margin()+this._annotationTierHeight();return Math.min(y-x,z)};v.prototype._getTickValues=function(){return this.getDownsampleInfo().domain};v.prototype._sizeFromOffer=function(z,y){return p.Component.prototype._sizeFromOffer.call(this,z,y)};v.prototype.getDownsampleInfo=function(z){var y;void 0===z&&(z=this._scale);void 0===y&&(y=z.invertRange());var x=Math.ceil(v._MINIMUM_WIDTH_PER_LABEL_PX*(0===this._tickLabelAngle?1:1/Math.cos(this._tickLabelShearAngle/180*Math.PI))/ z.stepWidth());return{domain:y.filter(function(D,G){return 0===G%x}),stepWidth:x*z.stepWidth()}};v.prototype.tickLabelAngle=function(){return this._tickLabelAngle;throw Error("Angle undefined not supported; only 0, 90, and -90 are valid values");};v.prototype.tickLabelShearAngle=function(){return this._tickLabelShearAngle};v.prototype.tickLabelMaxWidth=function(z){if(0===arguments.length)return this._tickLabelMaxWidth;this._tickLabelMaxWidth=z;this.redraw();return this};v.prototype.tickLabelMaxLines= function(z){if(0===arguments.length)return this._tickLabelMaxLines;this._tickLabelMaxLines=z;this.redraw();return this};v.prototype._tickSpaceRequired=function(){return this._maxLabelTickLength()+this.tickLabelPadding()};v.prototype._drawTicks=function(z,y){var x=this;switch(this.tickLabelAngle()){case 0:var D={left:"right",right:"left",top:"center",bottom:"center"};var G={left:"center",right:"center",top:"bottom",bottom:"top"};break;case 90:D={left:"center",right:"center",top:"right",bottom:"left"}; G={left:"top",right:"bottom",top:"center",bottom:"center"};break;case -90:D={left:"center",right:"center",top:"left",bottom:"right"},G={left:"bottom",right:"top",top:"center",bottom:"center"}}y.each(function(J){var F=w.select(this),E=x.isHorizontal()?z:x.width()-x._tickSpaceRequired(),L=x.isHorizontal()?x.height()-x._tickSpaceRequired():z,N={xAlign:D[x.orientation()],yAlign:G[x.orientation()],textRotation:x.tickLabelAngle(),textShear:x.tickLabelShearAngle()};if(null!=x._tickLabelMaxWidth){if("left"=== x.orientation()&&E>x._tickLabelMaxWidth){var M=E-x._tickLabelMaxWidth;M=F.attr("transform")+" translate("+M+", 0)";F.attr("transform",M)}E=Math.min(E,x._tickLabelMaxWidth)}x._writer.write(x.formatter()(J),E,L,N,F.node())})};v.prototype._measureTickLabels=function(z,y){var x=this,D=this._scale.cloneWithoutProviders().range([0,this.isHorizontal()?z:y]),G=this.getDownsampleInfo(D);D=G.domain;G=G.stepWidth;var J=z-this._tickSpaceRequired();this.isHorizontal()&&(J=G,0!==this._tickLabelAngle&&(J=y-this._tickSpaceRequired()), J=Math.max(J,0));var F=G;this.isHorizontal()&&(F=y-this._tickSpaceRequired(),0!==this._tickLabelAngle&&(F=z-this._tickSpaceRequired()),F=Math.max(F,0));null!=this._tickLabelMaxWidth&&(J=Math.min(J,this._tickLabelMaxWidth));y=D.map(function(E){return x._wrapper.wrap(x.formatter()(E),x._measurer,J,F)});D=this.isHorizontal()&&0===this._tickLabelAngle?n.Math.max:w.sum;z=(this.isHorizontal()&&0===this._tickLabelAngle?w.sum:n.Math.max)(y,function(E){return x._measurer.measure(E.wrappedText).width},0);y= D(y,function(E){return x._measurer.measure(E.wrappedText).height},0);0!==this._tickLabelAngle&&(y=[y,z],z=y[0],y=y[1]);return{usedWidth:z,usedHeight:y}};v.prototype.renderImmediately=function(){var z=this;t.prototype.renderImmediately.call(this);var y=this._scale,x=this.getDownsampleInfo(y),D=x.domain,G=x=x.stepWidth;this.isHorizontal()&&null!=this._tickLabelMaxWidth&&(G=Math.min(G,this._tickLabelMaxWidth));D=this._tickLabelContainer.selectAll("."+q.Axis.TICK_LABEL_CLASS).data(D);var J=D.enter().append("g").classed(q.Axis.TICK_LABEL_CLASS, !0).merge(D);D.exit().remove();J.attr("transform",function(F){F=y.scale(F)-G/2;return"translate("+(z.isHorizontal()?F:0)+","+(z.isHorizontal()?0:F)+")"});J.text("");this._drawTicks(x,J);x="right"===this.orientation()?this._tickSpaceRequired():0;D="bottom"===this.orientation()?this._tickSpaceRequired():0;this._tickLabelContainer.attr("transform","translate("+x+","+D+")");this._showAllTickMarks();this._showAllTickLabels();this._hideTickMarksWithoutLabel();return this};v.prototype.computeLayout=function(z, y,x){t.prototype.computeLayout.call(this,z,y,x);this.isHorizontal()||this._scale.range([0,this.height()]);return this};v.prototype.invalidateCache=function(){t.prototype.invalidateCache.call(this);this._measurer.reset()};return v}(q.Axis);d._MINIMUM_WIDTH_PER_LABEL_PX=15;f.Category=d},function(d,f,h){var m=this&&this.__extends||function(t,v){function z(){this.constructor=t}for(var y in v)v.hasOwnProperty(y)&&(t[y]=v[y]);t.prototype=null===v?Object.create(v):(z.prototype=v.prototype,new z)},w=h(1), l=h(5),p=h(8),n=h(0),q=h(22);d=function(t){function v(z,y){z=t.call(this,z,y)||this;z._tickLabelPositioning="center";z._usesTextWidthApproximation=!1;z.formatter(p.general());return z}m(v,t);v.prototype._setup=function(){t.prototype._setup.call(this);var z=new l.SvgContext(this._tickLabelContainer.node(),q.Axis.TICK_LABEL_CLASS);this._measurer=new l.CacheMeasurer(z);this._wrapper=(new l.Wrapper).maxLines(1)};v.prototype._computeWidth=function(){var z=this._usesTextWidthApproximation?this._computeApproximateTextWidth(): this._computeExactTextWidth();return"center"===this._tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+z:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+z)};v.prototype._computeExactTextWidth=function(){var z=this,y=this._getTickValues().map(function(x){x=z.formatter()(x);return z._measurer.measure(x).width});return n.Math.max(y,0)};v.prototype._computeApproximateTextWidth=function(){var z=this,y=this._getTickValues(),x=this._measurer.measure("M").width;y=y.map(function(D){return z.formatter()(D).length* x});return n.Math.max(y,0)};v.prototype._computeHeight=function(){var z=this._measurer.measure().height;return"center"===this._tickLabelPositioning?this._maxLabelTickLength()+this.tickLabelPadding()+z:Math.max(this._maxLabelTickLength(),this.tickLabelPadding()+z)};v.prototype._getTickValues=function(){var z=this._scale,y=z.domain(),x=y[0]<=y[1]?y[0]:y[1],D=y[0]>=y[1]?y[0]:y[1];return z.ticks().filter(function(G){return G>=x&&G<=D})};v.prototype._rescale=function(){if(this._isSetup){if(!this.isHorizontal()){var z= this._computeWidth();if(z>this.width()||z<this.width()-this.margin()){this.redraw();return}}this.render()}};v.prototype.renderImmediately=function(){var z=this;t.prototype.renderImmediately.call(this);var y={x:0,y:0,dx:"0em",dy:"0.3em"},x=this._maxLabelTickLength(),D=this.tickLabelPadding(),G="middle",J=0,F=0,E=0,L=0;if(this.isHorizontal())switch(this._tickLabelPositioning){case "left":G="end";J=-D;L=D;break;case "center":L=x+D;break;case "right":G="start",L=J=D}else switch(this._tickLabelPositioning){case "top":y.dy= "-0.3em";E=D;F=-D;break;case "center":E=x+D;break;case "bottom":y.dy="1em",F=E=D}x=this._generateTickMarkAttrHash();switch(this.orientation()){case "bottom":y.x=x.x1;y.dy="0.95em";F=x.y1+L;break;case "top":y.x=x.x1;y.dy="-.25em";F=x.y1-L;break;case "left":G="end";J=x.x1-E;y.y=x.y1;break;case "right":G="start",J=x.x1+E,y.y=x.y1}E=this._getTickValues();E=this._tickLabelContainer.selectAll("."+q.Axis.TICK_LABEL_CLASS).data(E);E.exit().remove();E.enter().append("text").classed(q.Axis.TICK_LABEL_CLASS, !0).merge(E).style("text-anchor",G).style("visibility","inherit").attrs(y).text(function(N){return z.formatter()(N)});this._tickLabelContainer.attr("transform","translate("+J+", "+F+")");this._showAllTickMarks();this.showEndTickLabels()||this._hideEndTickLabels();this._hideOverflowingTickLabels();this._hideOverlappingTickLabels();"center"!==this._tickLabelPositioning&&this._hideTickMarksWithoutLabel();return this};v.prototype.tickLabelPosition=function(z){if(null==z)return this._tickLabelPositioning; z=z.toLowerCase();if(this.isHorizontal()){if("left"!==z&&"center"!==z&&"right"!==z)throw Error(z+" is not a valid tick label position for a horizontal NumericAxis");}else if("top"!==z&&"center"!==z&&"bottom"!==z)throw Error(z+" is not a valid tick label position for a vertical NumericAxis");this._tickLabelPositioning=z;this.redraw();return this};v.prototype.usesTextWidthApproximation=function(z){if(null==z)return this._usesTextWidthApproximation;this._usesTextWidthApproximation=z;return this};v.prototype._hideEndTickLabels= function(){var z=this.element().node().getBoundingClientRect(),y=this._tickLabelContainer.selectAll("."+q.Axis.TICK_LABEL_CLASS);if(0!==y.size()){var x=y.nodes()[0];n.DOM.clientRectInside(x.getBoundingClientRect(),z)||w.select(x).style("visibility","hidden");y=y.nodes()[y.size()-1];n.DOM.clientRectInside(y.getBoundingClientRect(),z)||w.select(y).style("visibility","hidden")}};v.prototype._hideOverlappingTickLabels=function(){for(var z=this._tickLabelContainer.selectAll("."+q.Axis.TICK_LABEL_CLASS).filter(function(){var D= w.select(this).style("visibility");return"inherit"===D||"visible"===D}),y=z.nodes().map(function(D){return D.getBoundingClientRect()}),x=1;!this._hasOverlapWithInterval(x,y)&&x<y.length;)x+=1;z.each(function(D,G){D=w.select(this);0!==G%x&&D.style("visibility","hidden")})};v.prototype._hasOverlapWithInterval=function(z,y){var x="center"===this._tickLabelPositioning?this.tickLabelPadding():3*this.tickLabelPadding();y=y.map(function(G){return n.DOM.expandRect(G,x)});for(var D=0;D<y.length-z;D+=z)if(n.DOM.clientRectsOverlap(y[D], y[D+z]))return!1;return!0};v.prototype.invalidateCache=function(){t.prototype.invalidateCache.call(this);this._measurer.reset()};return v}(q.Axis);f.Numeric=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)};d=h(42);var w=h(25),l=h(0);h=function(p){function n(q){function t(){x&&(x=!1,y._dragEndCallbacks.callCallbacks(y))}function v(D,G){x&& (y._setPixelPositionWithoutChangingMode(y._isVertical()?G.x:G.y),y._dragCallbacks.callCallbacks(y))}function z(D){if(y._isVertical()&&y.pixelPosition()-y.detectionRadius()<=D.x&&D.x<=y.pixelPosition()+y.detectionRadius()||!y._isVertical()&&y.pixelPosition()-y.detectionRadius()<=D.y&&D.y<=y.pixelPosition()+y.detectionRadius())x=!0,y._dragStartCallbacks.callCallbacks(y)}var y=p.call(this,q)||this;y._detectionRadius=3;y._enabled=!0;y.addClass("drag-line-layer");y.addClass("enabled");y._dragInteraction= new w.Drag;y._dragInteraction.attachTo(y);var x=!1;y._dragInteraction.onDragStart(z);y._dragInteraction.onDrag(v);y._dragInteraction.onDragEnd(t);y._disconnectInteraction=function(){y._dragInteraction.offDragStart(z);y._dragInteraction.offDrag(v);y._dragInteraction.offDragEnd(t);y._dragInteraction.detach()};y._dragStartCallbacks=new l.CallbackSet;y._dragCallbacks=new l.CallbackSet;y._dragEndCallbacks=new l.CallbackSet;return y}m(n,p);n.prototype._setup=function(){p.prototype._setup.call(this);this._detectionEdge= this.content().append("line").styles({opacity:0,stroke:"pink","pointer-events":"visibleStroke"}).classed("drag-edge",!0)};n.prototype.renderImmediately=function(){p.prototype.renderImmediately.call(this);this._detectionEdge.attrs({x1:this._isVertical()?this.pixelPosition():0,y1:this._isVertical()?0:this.pixelPosition(),x2:this._isVertical()?this.pixelPosition():this.width(),y2:this._isVertical()?this.height():this.pixelPosition(),"stroke-width":2*this._detectionRadius});return this};n.prototype.detectionRadius= function(){return this._detectionRadius};n.prototype.enabled=function(q){if(null==q)return this._enabled;(this._enabled=q)?this.addClass("enabled"):this.removeClass("enabled");this._dragInteraction.enabled(q);return this};n.prototype.onDragStart=function(q){this._dragStartCallbacks.add(q)};n.prototype.offDragStart=function(q){this._dragStartCallbacks.delete(q)};n.prototype.onDrag=function(q){this._dragCallbacks.add(q)};n.prototype.offDrag=function(q){this._dragCallbacks.delete(q)};n.prototype.onDragEnd= function(q){this._dragEndCallbacks.add(q)};n.prototype.offDragEnd=function(q){this._dragEndCallbacks.delete(q)};n.prototype.destroy=function(){var q=this;p.prototype.destroy.call(this);this._dragStartCallbacks.forEach(function(t){return q._dragStartCallbacks.delete(t)});this._dragCallbacks.forEach(function(t){return q._dragCallbacks.delete(t)});this._dragEndCallbacks.forEach(function(t){return q._dragEndCallbacks.delete(t)});this._disconnectInteraction()};return n}(d.GuideLineLayer);f.DragLineLayer= h},function(d,f,h){function m(l,p,n){var q={};if(void 0!==n)for(var t=0;t<n.length;t++)q[n[t]]=n[t-1];return function(v){var z=l.scale(v);if(!p)return z;var y;v=void 0===q[v]?void 0:l.scale(q[v]);void 0!==v&&(y=v+(z-v)/2);return y}}var w=this&&this.__extends||function(l,p){function n(){this.constructor=l}for(var q in p)p.hasOwnProperty(q)&&(l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype=p.prototype,new n)};d=function(l){function p(n,q){var t=l.call(this)||this;t.addClass("gridlines"); t._xScale=n;t._yScale=q;t._renderCallback=function(){return t.render()};if(t._xScale)t._xScale.onUpdate(t._renderCallback);if(t._yScale)t._yScale.onUpdate(t._renderCallback);return t}w(p,l);p.prototype.betweenX=function(){return this._betweenX};p.prototype.betweenY=function(){return this._betweenY};p.prototype.destroy=function(){l.prototype.destroy.call(this);this._xScale&&this._xScale.offUpdate(this._renderCallback);this._yScale&&this._yScale.offUpdate(this._renderCallback);return this};p.prototype._setup= function(){l.prototype._setup.call(this);this._xLinesContainer=this.content().append("g").classed("x-gridlines",!0);this._yLinesContainer=this.content().append("g").classed("y-gridlines",!0)};p.prototype.renderImmediately=function(){l.prototype.renderImmediately.call(this);this._redrawXLines();this._redrawYLines();return this};p.prototype.computeLayout=function(n,q,t){l.prototype.computeLayout.call(this,n,q,t);null!=this._xScale&&this._xScale.range([0,this.width()]);null!=this._yScale&&this._yScale.range([this.height(), 0]);return this};p.prototype._redrawXLines=function(){if(this._xScale){var n=this.betweenX(),q=this._xScale.ticks().slice(n?1:0);q=this._xLinesContainer.selectAll("line").data(q);q.enter().append("line").merge(q).attr("x1",m(this._xScale,n,this._xScale.ticks())).attr("y1",0).attr("x2",m(this._xScale,n,this._xScale.ticks())).attr("y2",this.height()).classed("betweenline",n).classed("zeroline",function(t){return 0===t});q.exit().remove()}};p.prototype._redrawYLines=function(){if(this._yScale){var n= this.betweenY(),q=this._yScale.ticks().slice(n?1:0);q=this._yLinesContainer.selectAll("line").data(q);q.enter().append("line").merge(q).attr("x1",0).attr("y1",m(this._yScale,n,this._yScale.ticks())).attr("x2",this.width()).attr("y2",m(this._yScale,n,this._yScale.ticks())).classed("betweenline",n).classed("zeroline",function(t){return 0===t});q.exit().remove()}};return p}(h(4).Component);f.Gridlines=d},function(d,f,h){var m=this&&this.__extends||function(q,t){function v(){this.constructor=q}for(var z in t)t.hasOwnProperty(z)&& (q[z]=t[z]);q.prototype=null===t?Object.create(t):(v.prototype=t.prototype,new v)},w=h(5),l=h(23),p=h(8),n=h(0);d=function(q){function t(v){var z=q.call(this)||this;z._textPadding=5;if(null==v)throw Error("InterpolatedColorLegend requires a interpolatedColorScale");z._scale=v;z._redrawCallback=function(){return z.redraw()};z._scale.onUpdate(z._redrawCallback);z._formatter=p.general();z._orientation="horizontal";z._expands=!1;z.addClass("legend");z.addClass("interpolated-color-legend");return z}m(t, q);t.prototype.destroy=function(){q.prototype.destroy.call(this);this._scale.offUpdate(this._redrawCallback)};t.prototype.formatter=function(v){if(void 0===v)return this._formatter;this._formatter=v;this.redraw();return this};t.prototype.expands=function(){return this._expands};t._ensureOrientation=function(v){v=v.toLowerCase();if("horizontal"===v||"left"===v||"right"===v)return v;throw Error('"'+v+'" is not a valid orientation for InterpolatedColorLegend');};t.prototype.orientation=function(v){if(null== v)return this._orientation;this._orientation=t._ensureOrientation(v);this.redraw();return this};t.prototype.fixedWidth=function(){return!this.expands()||this._isVertical()};t.prototype.fixedHeight=function(){return!this.expands()||!this._isVertical()};t.prototype._generateTicks=function(v){void 0===v&&(v=t._DEFAULT_NUM_SWATCHES);var z=this._scale.domain();if(1===v)return[z[0]];for(var y=(z[1]-z[0])/(v-1),x=[],D=0;D<v;D++)x.push(z[0]+y*D);return x};t.prototype._setup=function(){q.prototype._setup.call(this); this._swatchContainer=this.content().append("g").classed("swatch-container",!0);this._swatchBoundingBox=this.content().append("rect").classed("swatch-bounding-box",!0);this._lowerLabel=this.content().append("g").classed(t.LEGEND_LABEL_CLASS,!0);this._upperLabel=this.content().append("g").classed(t.LEGEND_LABEL_CLASS,!0);var v=new w.SvgContext(this.content().node());this._measurer=new w.Measurer(v);this._wrapper=new w.Wrapper;this._writer=new w.Writer(this._measurer,v,this._wrapper)};t.prototype.requestedSpace= function(){var v=this,z=this._measurer.measure().height,y=this._scale.domain().map(function(G){return v._measurer.measure(v._formatter(G)).width}),x=t._DEFAULT_NUM_SWATCHES;if(this._isVertical()){var D=n.Math.max(y,0);y=z+z+this._textPadding+D+this._textPadding;D=x*z}else D=z+z+z,y=this._textPadding+y[0]+x*z+y[1]+this._textPadding;return{minWidth:y,minHeight:D}};t.prototype._isVertical=function(){return"horizontal"!==this._orientation};t.prototype.renderImmediately=function(){var v=this;q.prototype.renderImmediately.call(this); var z=this._scale.domain(),y=this._formatter(z[0]),x=this._measurer.measure(y).width,D=this._formatter(z[1]);z=this._measurer.measure(D).width;var G=this._measurer.measure().height,J=this._textPadding,F=0,E=0,L=0,N=0,M={xAlign:"center",yAlign:"center",textRotation:0},R={xAlign:"center",yAlign:"center",textRotation:0},Z={x:0,y:0,width:0,height:0};if(this._isVertical()){var T=Math.floor(this.height());var Y=Math.max(x,z);var ma=(this.width()-Y-2*this._textPadding)/2;z=Math.max(this.width()-ma-2*J-Y, 0);G=1;var va=function(oa,xa){return v.height()-(xa+1)};R.yAlign="top";E=0;M.yAlign="bottom";N=0;if("left"===this._orientation){var Ba=function(){return J+Y+J};R.xAlign="right";F=-(ma+z+J);M.xAlign="right";L=-(ma+z+J)}else Ba=function(){return ma},R.xAlign="left",F=ma+z+J,M.xAlign="left",L=ma+z+J;Z.width=z;Z.height=T*G}else ma=Math.max(J,(this.height()-G)/2),T=Math.max(Math.floor(this.width()-4*J-x-z),0),z=1,G=Math.max(this.height()-2*ma,0),Ba=function(oa,xa){return Math.floor(x+2*J)+xa},va=function(){return ma}, R.xAlign="right",F=-J,M.xAlign="left",L=J,Z.y=ma,Z.width=T*z,Z.height=G;Z.x=Ba(null,0);this._upperLabel.text("");this._writer.write(D,this.width(),this.height(),R,this._upperLabel.node());this._upperLabel.attr("transform","translate("+F+", "+E+")");this._lowerLabel.text("");this._writer.write(y,this.width(),this.height(),M,this._lowerLabel.node());this._lowerLabel.attr("transform","translate("+L+", "+N+")");this._swatchBoundingBox.attrs(Z);y=this._generateTicks(T);y=this._swatchContainer.selectAll("rect.swatch").data(y); D=y.enter().append("rect").classed("swatch",!0);F=y.merge(D);y.exit().remove();F.attrs({fill:function(oa){return v._scale.scale(oa)},width:z,height:G,x:Ba,y:va,"shape-rendering":"crispEdges"});l.ADD_TITLE_ELEMENTS&&D.append("title").text(function(oa){return v._formatter(oa)});return this};return t}(h(4).Component);d._DEFAULT_NUM_SWATCHES=11;d.LEGEND_LABEL_CLASS="legend-label";f.InterpolatedColorLegend=d},function(d,f,h){var m=this&&this.__extends||function(l,p){function n(){this.constructor=l}for(var q in p)p.hasOwnProperty(q)&& (l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype=p.prototype,new n)},w=h(5);d=function(l){function p(n,q){void 0===n&&(n="");void 0===q&&(q=0);var t=l.call(this)||this;t.addClass("label");t.text(n);t.angle(q);t.xAlignment("center").yAlignment("center");t._padding=0;return t}m(p,l);p.prototype.requestedSpace=function(){var n=this._measurer.measure(this._text),q=(0===this.angle()?n.width:n.height)+2*this.padding();n=(0===this.angle()?n.height:n.width)+2*this.padding();return{minWidth:q, minHeight:n}};p.prototype._setup=function(){l.prototype._setup.call(this);this._textContainer=this.content().append("g");var n=new w.SvgContext(this._textContainer.node());this._measurer=new w.CacheMeasurer(n);this._wrapper=new w.Wrapper;this._writer=new w.Writer(this._measurer,n,this._wrapper);this.text(this._text)};p.prototype.text=function(n){if(null==n)return this._text;if("string"!==typeof n)throw Error("Label.text() only takes strings as input");this._text=n;this.redraw();return this};p.prototype.angle= function(n){if(null==n)return this._angle;n%=360;180<n?n-=360:-180>n&&(n+=360);if(-90===n||0===n||90===n)this._angle=n;else throw Error(n+" is not a valid angle for Label");this.redraw();return this};p.prototype.padding=function(n){if(null==n)return this._padding;n=+n;if(0>n)throw Error(n+" is not a valid padding value. Cannot be less than 0.");this._padding=n;this.redraw();return this};p.prototype.fixedWidth=function(){return!0};p.prototype.fixedHeight=function(){return!0};p.prototype.renderImmediately= function(){l.prototype.renderImmediately.call(this);this._textContainer.selectAll("g").remove();var n=this._measurer.measure(this._text),q=Math.max(Math.min((this.height()-n.height)/2,this.padding()),0);n=Math.max(Math.min((this.width()-n.width)/2,this.padding()),0);this._textContainer.attr("transform","translate("+n+","+q+")");n=this.width()-2*n;q=this.height()-2*q;var t={xAlign:this.xAlignment(),yAlign:this.yAlignment(),textRotation:this.angle()};this._writer.write(this._text,n,q,t);return this}; p.prototype.invalidateCache=function(){l.prototype.invalidateCache.call(this);this._measurer.reset()};return p}(h(4).Component);f.Label=d;h=function(l){function p(n,q){n=l.call(this,n,q)||this;n.addClass(p.TITLE_LABEL_CLASS);return n}m(p,l);return p}(d);h.TITLE_LABEL_CLASS="title-label";f.TitleLabel=h;d=function(l){function p(n,q){n=l.call(this,n,q)||this;n.addClass(p.AXIS_LABEL_CLASS);return n}m(p,l);return p}(d);d.AXIS_LABEL_CLASS="axis-label";f.AxisLabel=d},function(d,f,h){var m=this&&this.__extends|| function(y,x){function D(){this.constructor=y}for(var G in x)x.hasOwnProperty(G)&&(y[G]=x[G]);y.prototype=null===x?Object.create(x):(D.prototype=x.prototype,new D)},w=h(1),l=h(5),p=h(23),n=h(8),q=h(31),t=h(0);d=h(4);var v=function(){function y(x,D,G){void 0===x&&(x=[]);void 0===D&&(D=0);void 0===G&&(G=Infinity);this.columns=x;this.bottomPadding=D;this.maxWidth=G}y.prototype.addColumn=function(x){var D=x.width,G=this.getWidthAvailable();x.width=Math.min(G,D);this.columns.push(x)};y.prototype.getBounds= function(x){for(var D=this.columns[x],G=0,J=0;J<x;J++)G+=this.columns[J].width;return{topLeft:{x:G,y:0},bottomRight:{x:G+D.width,y:D.height}}};y.prototype.getHeight=function(){return t.Math.max(this.columns.map(function(x){return x.height}),0)+this.bottomPadding};y.prototype.getWidth=function(){return Math.min(this.columns.reduce(function(x,D){return x+D.width},0),this.maxWidth)};y.prototype.getWidthAvailable=function(){var x=this.getWidth();return Math.max(this.maxWidth-x,0)};return y}(),z=function(){function y(x, D,G,J){void 0===x&&(x=Infinity);void 0===D&&(D=Infinity);void 0===G&&(G=0);void 0===J&&(J=[]);this.maxWidth=x;this.maxHeight=D;this.padding=G;this.rows=J}y.prototype.addRow=function(x){x.maxWidth=this.maxWidth-2*this.padding;this.rows.push(x)};y.prototype.getColumnBounds=function(x,D){var G=this.getRowBounds(x);x=this.rows[x].getBounds(D);x.topLeft.x+=G.topLeft.x;x.bottomRight.x+=G.topLeft.x;x.topLeft.y+=G.topLeft.y;x.bottomRight.y+=G.topLeft.y;return x};y.prototype.getRowBounds=function(x){for(var D= this.padding,G=this.padding,J=0;J<x;J++)G+=this.rows[J].getHeight();return{topLeft:{x:D,y:G},bottomRight:{x:D+this.rows[x].getWidth(),y:G+this.rows[x].getHeight()}}};y.prototype.getHeight=function(){return Math.min(this.rows.reduce(function(x,D){return x+D.getHeight()},0)+2*this.padding,this.maxHeight)};y.prototype.getWidth=function(){return Math.min(t.Math.max(this.rows.map(function(x){return x.getWidth()}),0)+2*this.padding,this.maxWidth)};return y}();d=function(y){function x(D){var G=y.call(this)|| this;G._padding=5;G._rowBottomPadding=3;G.addClass("legend");G.maxEntriesPerRow(1);if(null==D)throw Error("Legend requires a colorScale");G._colorScale=D;G._redrawCallback=function(){return G.redraw()};G._colorScale.onUpdate(G._redrawCallback);G._formatter=n.identity();G.maxLinesPerEntry(1);G.xAlignment("right").yAlignment("top");G.comparator(function(J,F){var E=G._colorScale.domain().slice().map(function(L){return G._formatter(L)});return E.indexOf(J)-E.indexOf(F)});G._symbolFactoryAccessor=function(){return q.circle()}; G._symbolOpacityAccessor=function(){return 1};return G}m(x,y);x.prototype._setup=function(){y.prototype._setup.call(this);var D=this.content().append("g").classed(x.LEGEND_ROW_CLASS,!0);D.append("g").classed(x.LEGEND_ENTRY_CLASS,!0).append("text");D=new l.SvgContext(D.node(),null,p.ADD_TITLE_ELEMENTS);this._measurer=new l.CacheMeasurer(D);this._wrapper=(new l.Wrapper).maxLines(this.maxLinesPerEntry());this._writer=new l.Writer(this._measurer,D,this._wrapper)};x.prototype.formatter=function(D){if(null== D)return this._formatter;this._formatter=D;this.redraw();return this};x.prototype.maxEntriesPerRow=function(D){if(null==D)return this._maxEntriesPerRow;this._maxEntriesPerRow=D;this.redraw();return this};x.prototype.maxLinesPerEntry=function(D){if(null==D)return this._maxLinesPerEntry;this._maxLinesPerEntry=D;this.redraw();return this};x.prototype.maxWidth=function(D){if(null==D)return this._maxWidth;this._maxWidth=D;this.redraw();return this};x.prototype.comparator=function(D){null!=D&&(this._comparator= D,this.redraw())};x.prototype.colorScale=function(D){return null!=D?(this._colorScale.offUpdate(this._redrawCallback),this._colorScale=D,this._colorScale.onUpdate(this._redrawCallback),this.redraw(),this):this._colorScale};x.prototype.destroy=function(){y.prototype.destroy.call(this);this._colorScale.offUpdate(this._redrawCallback)};x.prototype._buildLegendTable=function(D,G){var J=this,F=this._measurer.measure().height,E=new z(D,G,this._padding);D=this._colorScale.domain().slice().sort(function(N, M){return J._comparator(J._formatter(N),J._formatter(M))});var L=new v;E.addRow(L);L.bottomPadding=this._rowBottomPadding;D.forEach(function(N){L.columns.length/2===J.maxEntriesPerRow()&&(L=new v,L.bottomPadding=J._rowBottomPadding,E.addRow(L));var M=L.getWidthAvailable(),R=J._formatter(N),Z=J._measurer.measure(R).width;0>M-F-Z&&1<L.columns.length&&(L=new v,L.bottomPadding=J._rowBottomPadding,E.addRow(L));L.addColumn({width:F,height:F,data:{name:N,type:"symbol"}});M=L.getWidthAvailable();M=Math.min(M, Z);J._wrapper.maxLines(J.maxLinesPerEntry());R=J._wrapper.wrap(R,J._measurer,M).noLines*F;L.addColumn({width:M,height:R,data:{name:N,type:"text"}})});return E};x.prototype.requestedSpace=function(D,G){D=this._buildLegendTable(t.Math.min([this.maxWidth(),D],D),G);return{minHeight:D.getHeight(),minWidth:D.getWidth()}};x.prototype.entitiesAt=function(D){var G=this;if(!this._isSetup)return[];var J=this._buildLegendTable(this.width(),this.height());return J.rows.reduce(function(F,E,L){if(0!==F.length)return F; var N=J.getRowBounds(L);return t.Math.within(D,N)?E.columns.reduce(function(M,R,Z){var T=J.getColumnBounds(L,Z);if(t.Math.within(D,T)){M=G.content().selectAll("."+x.LEGEND_ROW_CLASS).nodes()[L];Z=w.select(M).selectAll("."+x.LEGEND_ENTRY_CLASS).nodes()[Math.floor(Z/2)];var Y=w.select(Z).select("."+x.LEGEND_SYMBOL_CLASS);T=t.DOM.getTranslateValues(w.select(M));Y=t.DOM.getTranslateValues(Y);return[{bounds:t.DOM.elementBBox(w.select(M)),datum:R.data.name,position:{x:T[0]+Y[0],y:T[1]+Y[1]},selection:w.select(Z), component:G}]}return M},F):F},[])};x.prototype.renderImmediately=function(){y.prototype.renderImmediately.call(this);var D=this._buildLegendTable(this.width(),this.height());this.content().selectAll("*").remove();var G=this.content().selectAll("g."+x.LEGEND_ROW_CLASS).data(D.rows),J=G.enter().append("g").classed(x.LEGEND_ROW_CLASS,!0).merge(G);G.exit().remove();J.attr("transform",function(E,L){E=D.getRowBounds(L);return"translate("+E.topLeft.x+", "+E.topLeft.y+")"});var F=this;J.each(function(E,L){for(var N= [],M=0;M<E.columns.length;M+=2)N.push([E.columns[M],E.columns[M+1]]);E=w.select(this).selectAll("g."+x.LEGEND_ENTRY_CLASS).data(N);N=E.enter().append("g").classed(x.LEGEND_ENTRY_CLASS,!0).merge(E);N.append("path").attr("d",function(R){R=R[0];return F.symbol()(R.data.name,L)(.6*R.height)(null)}).attr("transform",function(R){R=R[0];return"translate("+(D.getColumnBounds(L,D.rows[L].columns.indexOf(R)).topLeft.x+R.width/2)+", "+R.height/2+")"}).attr("fill",function(R){return F._colorScale.scale(R[0].data.name)}).attr("opacity", function(R){return F.symbolOpacity()(R[0].data.name,L)}).classed(x.LEGEND_SYMBOL_CLASS,!0);N.append("g").classed("text-container",!0).attr("transform",function(R){return"translate("+D.getColumnBounds(L,D.rows[L].columns.indexOf(R[1])).topLeft.x+", 0)"}).each(function(R){var Z=w.select(this);R=R[1];F._writer.write(F._formatter(R.data.name),R.width,F.height(),{xAlign:"left",yAlign:"top",textRotation:0},Z.node())});E.exit().remove()});return this};x.prototype.symbol=function(D){if(null==D)return this._symbolFactoryAccessor; this._symbolFactoryAccessor=D;this.render();return this};x.prototype.symbolOpacity=function(){return this._symbolOpacityAccessor};x.prototype.fixedWidth=function(){return!0};x.prototype.fixedHeight=function(){return!0};x.prototype.invalidateCache=function(){this._measurer.reset()};return x}(d.Component);d.LEGEND_ROW_CLASS="legend-row";d.LEGEND_ENTRY_CLASS="legend-entry";d.LEGEND_SYMBOL_CLASS="legend-symbol";f.Legend=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor= p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(2),l=h(0);d=function(p){function n(){return null!==p&&p.apply(this,arguments)||this}m(n,p);n.prototype.entityNearest=function(q){var t,v=Infinity;this.components().forEach(function(z){z=z.entityNearest(q);if(null!=z){var y=l.Math.distanceSquared(z.position,q);y<=v&&(v=y,t=z)}});return t};n.prototype.append=function(q){if(null!=q&&!(q instanceof w.Plot))throw Error("Plot Group only accepts plots"); p.prototype.append.call(this,q);return this};return n}(h(41).Group);f.PlotGroup=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(1),l=h(0);d=function(p){function n(q){void 0===q&&(q=[]);var t=p.call(this)||this;t._rowPadding=0;t._columnPadding=0;t._rows=[];t._rowWeights=[];t._columnWeights=[];t._nRows=0;t._nCols=0;t._calculatedLayout= null;t.addClass("table");q.forEach(function(v,z){v.forEach(function(y,x){null!=y&&t.add(y,z,x)})});return t}m(n,p);n.prototype._forEach=function(q){for(var t=0;t<this._nRows;t++)for(var v=0;v<this._nCols;v++)null!=this._rows[t][v]&&q(this._rows[t][v])};n.prototype.has=function(q){for(var t=0;t<this._nRows;t++)for(var v=0;v<this._nCols;v++)if(this._rows[t][v]===q)return!0;return!1};n.prototype.componentAt=function(q){return 0>=this._nRows||0>q||q>=this._nCols?null:this._rows[0][q]};n.prototype.add= function(q,t,v){if(null==q)throw Error("Cannot add null to a table cell");if(!this.has(q)){if(null!=(this._rows[t]&&this._rows[t][v]))throw Error("cell is occupied");q.detach();this._nRows=Math.max(t+1,this._nRows);this._nCols=Math.max(v+1,this._nCols);this._padTableToSize(this._nRows,this._nCols);this._rows[t][v]=q;this._adoptAndAnchor(q);this.redraw()}return this};n.prototype._remove=function(q){for(var t=0;t<this._nRows;t++)for(var v=0;v<this._nCols;v++)if(this._rows[t][v]===q){this._rows[t][v]= null;return}};n.prototype._iterateLayout=function(q,t,v){void 0===v&&(v=!1);var z=this._rows,y=w.transpose(this._rows);q-=this._columnPadding*(this._nCols-1);t-=this._rowPadding*(this._nRows-1);z=n._calcComponentWeights(this._rowWeights,z,function(Y){return null==Y||Y.fixedHeight()});y=n._calcComponentWeights(this._columnWeights,y,function(Y){return null==Y||Y.fixedWidth()});var x=y.map(function(Y){return 0===Y?.5:Y}),D=z.map(function(Y){return 0===Y?.5:Y});x=n._calcProportionalSpace(x,q);var G=n._calcProportionalSpace(D, t),J=l.Array.createFilledArray(0,this._nCols),F=l.Array.createFilledArray(0,this._nRows);D=0;for(var E,L,N;;){F=l.Array.add(F,G);x=l.Array.add(J,x);E=this._determineGuarantees(x,F,v);J=E.guaranteedWidths;F=E.guaranteedHeights;L=E.wantsWidthArr.some(function(Y){return Y});N=E.wantsHeightArr.some(function(Y){return Y});var M=Z,R=T;var Z=q-w.sum(E.guaranteedWidths);var T=t-w.sum(E.guaranteedHeights);x=void 0;L?(x=E.wantsWidthArr.map(function(Y){return Y?.1:0}),x=l.Array.add(x,y)):x=y;G=void 0;N?(G=E.wantsHeightArr.map(function(Y){return Y? .1:0}),G=l.Array.add(G,z)):G=z;x=n._calcProportionalSpace(x,Z);G=n._calcProportionalSpace(G,T);D++;R=0<T&&T!==R;if(!(0<Z&&Z!==M||R))break;if(5<D)break}Z=q-w.sum(E.guaranteedWidths);T=t-w.sum(E.guaranteedHeights);x=n._calcProportionalSpace(y,Z);G=n._calcProportionalSpace(z,T);return{colProportionalSpace:x,rowProportionalSpace:G,guaranteedWidths:E.guaranteedWidths,guaranteedHeights:E.guaranteedHeights,wantsWidth:L,wantsHeight:N}};n.prototype._determineGuarantees=function(q,t,v){void 0===v&&(v=!1);var z= l.Array.createFilledArray(0,this._nCols),y=l.Array.createFilledArray(0,this._nRows),x=l.Array.createFilledArray(!1,this._nCols),D=l.Array.createFilledArray(!1,this._nRows);this._rows.forEach(function(G,J){G.forEach(function(F,E){F=null!=F?F.requestedSpace(q[E],t[J]):{minWidth:0,minHeight:0};z[E]=Math.max(z[E],v?Math.min(F.minWidth,q[E]):F.minWidth);y[J]=Math.max(y[J],v?Math.min(F.minHeight,t[J]):F.minHeight);var L=F.minWidth>q[E];x[E]=x[E]||L;E=F.minHeight>t[J];D[J]=D[J]||E})});return{guaranteedWidths:z, guaranteedHeights:y,wantsWidthArr:x,wantsHeightArr:D}};n.prototype.requestedSpace=function(q,t){this._calculatedLayout=this._iterateLayout(q,t);return{minWidth:w.sum(this._calculatedLayout.guaranteedWidths),minHeight:w.sum(this._calculatedLayout.guaranteedHeights)}};n.prototype.computeLayout=function(q,t,v){var z=this;p.prototype.computeLayout.call(this,q,t,v);q=w.sum(this._calculatedLayout.guaranteedWidths);t=w.sum(this._calculatedLayout.guaranteedHeights);v=this._calculatedLayout;if(q>this.width()|| t>this.height())v=this._iterateLayout(this.width(),this.height(),!0);var y=0,x=l.Array.add(v.rowProportionalSpace,v.guaranteedHeights),D=l.Array.add(v.colProportionalSpace,v.guaranteedWidths);this._rows.forEach(function(G,J){var F=0;G.forEach(function(E,L){null!=E&&E.computeLayout({x:F,y},D[L],x[J]);F+=D[L]+z._columnPadding});y+=x[J]+z._rowPadding});return this};n.prototype.rowPadding=function(q){if(null==q)return this._rowPadding;if(!l.Math.isValidNumber(q)||0>q)throw Error("rowPadding must be a non-negative finite value"); this._rowPadding=q;this.redraw();return this};n.prototype.columnPadding=function(q){if(null!=q){if(!l.Math.isValidNumber(q)||0>q)throw Error("columnPadding must be a non-negative finite value");this._columnPadding=q;this.redraw()}};n.prototype.rowWeight=function(q,t){if(null==t)return this._rowWeights[q];if(!l.Math.isValidNumber(t)||0>t)throw Error("rowWeight must be a non-negative finite value");this._rowWeights[q]=t;this.redraw();return this};n.prototype.columnWeight=function(q,t){if(null==t)return this._columnWeights[q]; if(!l.Math.isValidNumber(t)||0>t)throw Error("columnWeight must be a non-negative finite value");this._columnWeights[q]=t;this.redraw();return this};n.prototype.fixedWidth=function(){var q=w.transpose(this._rows);return n._fixedSpace(q,function(t){return null==t||t.fixedWidth()})};n.prototype.fixedHeight=function(){return n._fixedSpace(this._rows,function(q){return null==q||q.fixedHeight()})};n.prototype._padTableToSize=function(q,t){for(var v=0;v<q;v++){void 0===this._rows[v]&&(this._rows[v]=[], this._rowWeights[v]=null);for(var z=0;z<t;z++)void 0===this._rows[v][z]&&(this._rows[v][z]=null)}for(z=0;z<t;z++)void 0===this._columnWeights[z]&&(this._columnWeights[z]=null)};n._calcComponentWeights=function(q,t,v){return q.map(function(z,y){return null!=z?z:t[y].map(v).reduce(function(x,D){return x&&D},!0)?0:1})};n._calcProportionalSpace=function(q,t){var v=w.sum(q);return 0===v?l.Array.createFilledArray(0,q.length):q.map(function(z){return t*z/v})};n._fixedSpace=function(q,t){function v(z){return z.reduce(function(y, x){return y&&x},!0)}return v(q.map(function(z){return v(z.map(t))}))};return n}(h(29).ComponentContainer);f.Table=d},function(d,f,h){var m=this&&this.__extends||function(w,l){function p(){this.constructor=w}for(var n in l)l.hasOwnProperty(n)&&(w[n]=l[n]);w.prototype=null===l?Object.create(l):(p.prototype=l.prototype,new p)};d=function(w){function l(){var p=w.call(this)||this;p.addClass("x-drag-box-layer");p._hasCorners=!1;return p}m(l,w);l.prototype.computeLayout=function(p,n,q){w.prototype.computeLayout.call(this, p,n,q);this._setBounds(this.bounds());return this};l.prototype._setBounds=function(p){w.prototype._setBounds.call(this,{topLeft:{x:p.topLeft.x,y:0},bottomRight:{x:p.bottomRight.x,y:this.height()}})};l.prototype._setResizableClasses=function(p){p&&this.enabled()?this.addClass("x-resizable"):this.removeClass("x-resizable")};l.prototype.yScale=function(){return w.prototype.yScale.call(this);throw Error("yScales cannot be set on an XDragBoxLayer");};l.prototype.yExtent=function(){return w.prototype.yExtent.call(this); throw Error("XDragBoxLayer has no yExtent");};return l}(h(32).DragBoxLayer);f.XDragBoxLayer=d},function(d,f,h){var m=this&&this.__extends||function(w,l){function p(){this.constructor=w}for(var n in l)l.hasOwnProperty(n)&&(w[n]=l[n]);w.prototype=null===l?Object.create(l):(p.prototype=l.prototype,new p)};d=function(w){function l(){var p=w.call(this)||this;p.addClass("y-drag-box-layer");p._hasCorners=!1;return p}m(l,w);l.prototype.computeLayout=function(p,n,q){w.prototype.computeLayout.call(this,p,n, q);this._setBounds(this.bounds());return this};l.prototype._setBounds=function(p){w.prototype._setBounds.call(this,{topLeft:{x:0,y:p.topLeft.y},bottomRight:{x:this.width(),y:p.bottomRight.y}})};l.prototype._setResizableClasses=function(p){p&&this.enabled()?this.addClass("y-resizable"):this.removeClass("y-resizable")};l.prototype.xScale=function(){return w.prototype.xScale.call(this);throw Error("xScales cannot be set on an YDragBoxLayer");};l.prototype.xExtent=function(){return w.prototype.xExtent.call(this); throw Error("YDragBoxLayer has no xExtent");};return l}(h(32).DragBoxLayer);f.YDragBoxLayer=d},function(d,f,h){var m=this&&this.__extends||function(w,l){function p(){this.constructor=w}for(var n in l)l.hasOwnProperty(n)&&(w[n]=l[n]);w.prototype=null===l?Object.create(l):(p.prototype=l.prototype,new p)};d=function(w){function l(){var p=w.call(this)||this;p._eventToProcessingFunction[l._KEYDOWN_EVENT_NAME]=function(n){return p._processKeydown(n)};p._eventToProcessingFunction[l._KEYUP_EVENT_NAME]=function(n){return p._processKeyup(n)}; return p}m(l,w);l.getDispatcher=function(){var p=document[l._DISPATCHER_KEY];null==p&&(p=new l,document[l._DISPATCHER_KEY]=p);return p};l.prototype._processKeydown=function(p){this._callCallbacksForEvent(l._KEYDOWN_EVENT_NAME,p.keyCode,p)};l.prototype._processKeyup=function(p){this._callCallbacksForEvent(l._KEYUP_EVENT_NAME,p.keyCode,p)};l.prototype.onKeyDown=function(p){this._addCallbackForEvent(l._KEYDOWN_EVENT_NAME,p)};l.prototype.offKeyDown=function(p){this._removeCallbackForEvent(l._KEYDOWN_EVENT_NAME, p)};l.prototype.onKeyUp=function(p){this._addCallbackForEvent(l._KEYUP_EVENT_NAME,p)};l.prototype.offKeyUp=function(p){this._removeCallbackForEvent(l._KEYUP_EVENT_NAME,p)};return l}(h(24).Dispatcher);d._DISPATCHER_KEY="__Plottable_Dispatcher_Key";d._KEYDOWN_EVENT_NAME="keydown";d._KEYUP_EVENT_NAME="keyup";f.Key=d},function(d,f,h){var m=this&&this.__extends||function(l,p){function n(){this.constructor=l}for(var q in p)p.hasOwnProperty(q)&&(l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype= p.prototype,new n)},w=h(0);d=function(l){function p(n){function q(v){return t._measureAndDispatch(n,v,p._MOUSEMOVE_EVENT_NAME,"page")}var t=l.call(this)||this;t._lastMousePosition={x:-1,y:-1};t._translator=w.getTranslator(n);t._eventToProcessingFunction[p._MOUSEOVER_EVENT_NAME]=q;t._eventToProcessingFunction[p._MOUSEMOVE_EVENT_NAME]=q;t._eventToProcessingFunction[p._MOUSEOUT_EVENT_NAME]=q;t._eventToProcessingFunction[p._MOUSEDOWN_EVENT_NAME]=function(v){return t._measureAndDispatch(n,v,p._MOUSEDOWN_EVENT_NAME)}; t._eventToProcessingFunction[p._MOUSEUP_EVENT_NAME]=function(v){return t._measureAndDispatch(n,v,p._MOUSEUP_EVENT_NAME,"page")};t._eventToProcessingFunction[p._WHEEL_EVENT_NAME]=function(v){return t._measureAndDispatch(n,v,p._WHEEL_EVENT_NAME)};t._eventToProcessingFunction[p._DBLCLICK_EVENT_NAME]=function(v){return t._measureAndDispatch(n,v,p._DBLCLICK_EVENT_NAME)};return t}m(p,l);p.getDispatcher=function(n){var q=n.root().rootElement(),t=q[p._DISPATCHER_KEY];null==t&&(t=new p(n),q[p._DISPATCHER_KEY]= t);return t};p.prototype.onMouseMove=function(n){this._addCallbackForEvent(p._MOUSEMOVE_EVENT_NAME,n)};p.prototype.offMouseMove=function(n){this._removeCallbackForEvent(p._MOUSEMOVE_EVENT_NAME,n)};p.prototype.onMouseDown=function(n){this._addCallbackForEvent(p._MOUSEDOWN_EVENT_NAME,n)};p.prototype.offMouseDown=function(n){this._removeCallbackForEvent(p._MOUSEDOWN_EVENT_NAME,n)};p.prototype.onMouseUp=function(n){this._addCallbackForEvent(p._MOUSEUP_EVENT_NAME,n)};p.prototype.offMouseUp=function(n){this._removeCallbackForEvent(p._MOUSEUP_EVENT_NAME, n)};p.prototype.onWheel=function(n){this._addCallbackForEvent(p._WHEEL_EVENT_NAME,n)};p.prototype.offWheel=function(n){this._removeCallbackForEvent(p._WHEEL_EVENT_NAME,n)};p.prototype.onDblClick=function(n){this._addCallbackForEvent(p._DBLCLICK_EVENT_NAME,n)};p.prototype.offDblClick=function(n){this._removeCallbackForEvent(p._DBLCLICK_EVENT_NAME,n)};p.prototype._measureAndDispatch=function(n,q,t,v){void 0===v&&(v="element");if("page"!==v&&"element"!==v)throw Error("Invalid scope '"+v+"', must be 'element' or 'page'"); if("page"===v||this.eventInside(n,q))this._lastMousePosition=this._translator.computePosition(q.clientX,q.clientY),this._callCallbacksForEvent(t,this.lastMousePosition(),q)};p.prototype.eventInside=function(n,q){return w.Translator.isEventInside(n,q)};p.prototype.lastMousePosition=function(){return this._lastMousePosition};return p}(h(24).Dispatcher);d._DISPATCHER_KEY="__Plottable_Dispatcher_Mouse";d._MOUSEOVER_EVENT_NAME="mouseover";d._MOUSEMOVE_EVENT_NAME="mousemove";d._MOUSEOUT_EVENT_NAME="mouseout"; d._MOUSEDOWN_EVENT_NAME="mousedown";d._MOUSEUP_EVENT_NAME="mouseup";d._WHEEL_EVENT_NAME="wheel";d._DBLCLICK_EVENT_NAME="dblclick";f.Mouse=d},function(d,f,h){var m=this&&this.__extends||function(l,p){function n(){this.constructor=l}for(var q in p)p.hasOwnProperty(q)&&(l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype=p.prototype,new n)},w=h(0);d=function(l){function p(n){var q=l.call(this)||this;q._translator=w.getTranslator(n);q._eventToProcessingFunction[p._TOUCHSTART_EVENT_NAME]=function(t){return q._measureAndDispatch(n, t,p._TOUCHSTART_EVENT_NAME,"page")};q._eventToProcessingFunction[p._TOUCHMOVE_EVENT_NAME]=function(t){return q._measureAndDispatch(n,t,p._TOUCHMOVE_EVENT_NAME,"page")};q._eventToProcessingFunction[p._TOUCHEND_EVENT_NAME]=function(t){return q._measureAndDispatch(n,t,p._TOUCHEND_EVENT_NAME,"page")};q._eventToProcessingFunction[p._TOUCHCANCEL_EVENT_NAME]=function(t){return q._measureAndDispatch(n,t,p._TOUCHCANCEL_EVENT_NAME,"page")};return q}m(p,l);p.getDispatcher=function(n){var q=n.root().rootElement(), t=q[p._DISPATCHER_KEY];null==t&&(t=new p(n),q[p._DISPATCHER_KEY]=t);return t};p.prototype.onTouchStart=function(n){this._addCallbackForEvent(p._TOUCHSTART_EVENT_NAME,n)};p.prototype.offTouchStart=function(n){this._removeCallbackForEvent(p._TOUCHSTART_EVENT_NAME,n)};p.prototype.onTouchMove=function(n){this._addCallbackForEvent(p._TOUCHMOVE_EVENT_NAME,n)};p.prototype.offTouchMove=function(n){this._removeCallbackForEvent(p._TOUCHMOVE_EVENT_NAME,n)};p.prototype.onTouchEnd=function(n){this._addCallbackForEvent(p._TOUCHEND_EVENT_NAME, n)};p.prototype.offTouchEnd=function(n){this._removeCallbackForEvent(p._TOUCHEND_EVENT_NAME,n)};p.prototype.onTouchCancel=function(n){this._addCallbackForEvent(p._TOUCHCANCEL_EVENT_NAME,n)};p.prototype.offTouchCancel=function(n){this._removeCallbackForEvent(p._TOUCHCANCEL_EVENT_NAME,n)};p.prototype._measureAndDispatch=function(n,q,t,v){void 0===v&&(v="element");if("page"!==v&&"element"!==v)throw Error("Invalid scope '"+v+"', must be 'element' or 'page'");if("element"!==v||this.eventInside(n,q)){n= q.changedTouches;v={};for(var z=[],y=0;y<n.length;y++){var x=n[y],D=x.identifier;x=this._translator.computePosition(x.clientX,x.clientY);null!=x&&(v[D]=x,z.push(D))}0<z.length&&this._callCallbacksForEvent(t,z,v,q)}};p.prototype.eventInside=function(n,q){return w.Translator.isEventInside(n,q)};return p}(h(24).Dispatcher);d._DISPATCHER_KEY="__Plottable_Dispatcher_Touch";d._TOUCHSTART_EVENT_NAME="touchstart";d._TOUCHMOVE_EVENT_NAME="touchmove";d._TOUCHEND_EVENT_NAME="touchend";d._TOUCHCANCEL_EVENT_NAME= "touchcancel";f.Touch=d},function(d,f){d=function(){function h(m,w,l){void 0===l&&(l=window.devicePixelRatio);this.screenWidth=m;this.screenHeight=w;this.devicePixelRatio=l;this.pixelWidth=m*l;this.pixelHeight=w*l;this.canvas=document.createElement("canvas");this.ctx=this.canvas.getContext("2d");h.sizePixels(this.ctx,m,w,l)}h.sizePixels=function(m,w,l,p){var n=m.canvas;n.width=w*p;n.height=l*p;n.style.width=w+"px";n.style.height=l+"px";m.setTransform(1,0,0,1,0,0);m.scale(p,p)};h.prototype.blit=function(m, w,l){void 0===w&&(w=0);void 0===l&&(l=0);m.drawImage(this.canvas,w,l,this.screenWidth,this.screenHeight)};h.prototype.blitCenter=function(m,w,l){void 0===w&&(w=0);void 0===l&&(l=0);this.blit(m,Math.floor(w-this.screenWidth/2),Math.floor(l-this.screenHeight/2))};h.prototype.resize=function(m,w,l){void 0===l&&(l=!1);var p=this.devicePixelRatio;this.screenWidth=m;this.screenHeight=w;this.pixelWidth=m*p;this.pixelHeight=w*p;h.sizePixels(this.ctx,m,w,p);l&&this.ctx.translate(m/2,m/2);return this};h.prototype.clear= function(m){var w=this.pixelWidth,l=this.pixelHeight,p=this.ctx;p.save();p.setTransform(1,0,0,1,0,0);null==m?p.clearRect(0,0,w,l):(p.fillStyle=m,p.fillRect(0,0,w,l));p.restore();return this};h.prototype.getImageData=function(){return this.ctx.getImageData(0,0,this.pixelWidth,this.pixelHeight)};return h}();f.CanvasBuffer=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n): (q.prototype=n.prototype,new q)},w=h(13),l=h(0);d=function(p){function n(){var q=null!==p&&p.apply(this,arguments)||this;q._clickedDown=!1;q._doubleClicking=!1;q._onClickCallbacks=new l.CallbackSet;q._onDoubleClickCallbacks=new l.CallbackSet;q._mouseDownCallback=function(t){return q._handleClickDown(t)};q._mouseUpCallback=function(t,v){return q._handleClickUp(t,v)};q._dblClickCallback=function(t,v){return q._handleDblClick(t,v)};q._touchStartCallback=function(t,v){return q._handleClickDown(v[t[0]])}; q._touchEndCallback=function(t,v,z){return q._handleClickUp(v[t[0]],z)};q._touchCancelCallback=function(){return q._clickedDown=!1};return q}m(n,p);n.prototype._anchor=function(q){p.prototype._anchor.call(this,q);this._mouseDispatcher=w.Mouse.getDispatcher(q);this._mouseDispatcher.onMouseDown(this._mouseDownCallback);this._mouseDispatcher.onMouseUp(this._mouseUpCallback);this._mouseDispatcher.onDblClick(this._dblClickCallback);this._touchDispatcher=w.Touch.getDispatcher(q);this._touchDispatcher.onTouchStart(this._touchStartCallback); this._touchDispatcher.onTouchEnd(this._touchEndCallback);this._touchDispatcher.onTouchCancel(this._touchCancelCallback)};n.prototype._unanchor=function(){p.prototype._unanchor.call(this);this._mouseDispatcher.offMouseDown(this._mouseDownCallback);this._mouseDispatcher.offMouseUp(this._mouseUpCallback);this._mouseDispatcher.offDblClick(this._dblClickCallback);this._mouseDispatcher=null;this._touchDispatcher.offTouchStart(this._touchStartCallback);this._touchDispatcher.offTouchEnd(this._touchEndCallback); this._touchDispatcher.offTouchCancel(this._touchCancelCallback);this._touchDispatcher=null};n.prototype._handleClickDown=function(q){q=this._translateToComponentSpace(q);this._isInsideComponent(q)&&(this._clickedDown=!0,this._clickedPoint=q)};n.prototype._handleClickUp=function(q,t){var v=this,z=this._translateToComponentSpace(q);this._clickedDown&&n._pointsEqual(z,this._clickedPoint)&&setTimeout(function(){v._doubleClicking||v._onClickCallbacks.callCallbacks(z,t)},0);this._clickedDown=!1};n.prototype._handleDblClick= function(q,t){var v=this;q=this._translateToComponentSpace(q);this._doubleClicking=!0;this._onDoubleClickCallbacks.callCallbacks(q,t);setTimeout(function(){return v._doubleClicking=!1},0)};n._pointsEqual=function(q,t){return q.x===t.x&&q.y===t.y};n.prototype.onClick=function(q){this._onClickCallbacks.add(q)};n.prototype.offClick=function(q){this._onClickCallbacks.delete(q)};n.prototype.onDoubleClick=function(q){this._onDoubleClickCallbacks.add(q);return this};n.prototype.offDoubleClick=function(q){this._onDoubleClickCallbacks.delete(q); return this};return n}(h(15).Interaction);f.Click=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(13),l=h(0);d=function(p){function n(){var q=null!==p&&p.apply(this,arguments)||this;q._dragging=!1;q._constrainedToComponent=!0;q._mouseFilter=n._DEFAULT_MOUSE_FILTER;q._dragStartCallbacks=new l.CallbackSet;q._dragCallbacks=new l.CallbackSet; q._dragEndCallbacks=new l.CallbackSet;q._mouseDownCallback=function(t,v){return q._startDrag(t,v)};q._mouseMoveCallback=function(t){return q._doDrag(t)};q._mouseUpCallback=function(t,v){return q._endDrag(t,v)};q._touchStartCallback=function(t,v,z){return q._startDrag(v[t[0]],z)};q._touchMoveCallback=function(t,v){return q._doDrag(v[t[0]])};q._touchEndCallback=function(t,v,z){return q._endDrag(v[t[0]],z)};return q}m(n,p);n.prototype._anchor=function(q){p.prototype._anchor.call(this,q);this._mouseDispatcher= w.Mouse.getDispatcher(this._componentAttachedTo);this._mouseDispatcher.onMouseDown(this._mouseDownCallback);this._mouseDispatcher.onMouseMove(this._mouseMoveCallback);this._mouseDispatcher.onMouseUp(this._mouseUpCallback);this._touchDispatcher=w.Touch.getDispatcher(this._componentAttachedTo);this._touchDispatcher.onTouchStart(this._touchStartCallback);this._touchDispatcher.onTouchMove(this._touchMoveCallback);this._touchDispatcher.onTouchEnd(this._touchEndCallback)};n.prototype._unanchor=function(){p.prototype._unanchor.call(this); this._mouseDispatcher.offMouseDown(this._mouseDownCallback);this._mouseDispatcher.offMouseMove(this._mouseMoveCallback);this._mouseDispatcher.offMouseUp(this._mouseUpCallback);this._mouseDispatcher=null;this._touchDispatcher.offTouchStart(this._touchStartCallback);this._touchDispatcher.offTouchMove(this._touchMoveCallback);this._touchDispatcher.offTouchEnd(this._touchEndCallback);this._touchDispatcher=null};n.prototype._translateAndConstrain=function(q){q=this._translateToComponentSpace(q);return this._constrainedToComponent? {x:l.Math.clamp(q.x,0,this._componentAttachedTo.width()),y:l.Math.clamp(q.y,0,this._componentAttachedTo.height())}:q};n.prototype._startDrag=function(q,t){t instanceof MouseEvent&&!this._mouseFilter(t)||(q=this._translateToComponentSpace(q),this._isInsideComponent(q)&&(t.preventDefault(),this._dragging=!0,this._dragOrigin=q,this._dragStartCallbacks.callCallbacks(this._dragOrigin)))};n.prototype._doDrag=function(q){this._dragging&&this._dragCallbacks.callCallbacks(this._dragOrigin,this._translateAndConstrain(q))}; n.prototype._endDrag=function(q,t){t instanceof MouseEvent&&0!==t.button||!this._dragging||(this._dragging=!1,this._dragEndCallbacks.callCallbacks(this._dragOrigin,this._translateAndConstrain(q)))};n.prototype.constrainedToComponent=function(){this._constrainedToComponent=!1};n.prototype.mouseFilter=function(q){if(0===arguments.length)return this._mouseFilter;this._mouseFilter=q;return this};n.prototype.onDragStart=function(q){this._dragStartCallbacks.add(q)};n.prototype.offDragStart=function(q){this._dragStartCallbacks.delete(q)}; n.prototype.onDrag=function(q){this._dragCallbacks.add(q)};n.prototype.offDrag=function(q){this._dragCallbacks.delete(q)};n.prototype.onDragEnd=function(q){this._dragEndCallbacks.add(q)};n.prototype.offDragEnd=function(q){this._dragEndCallbacks.delete(q)};return n}(h(15).Interaction);d._DEFAULT_MOUSE_FILTER=function(p){return 0===p.button};f.Drag=d},function(d,f,h){var m=this&&this.__extends||function(v,z){function y(){this.constructor=v}for(var x in z)z.hasOwnProperty(x)&&(v[x]=z[x]);v.prototype= null===z?Object.create(z):(y.prototype=z.prototype,new y)},w=h(1),l=h(13),p=h(3),n=h(0),q=h(25);d=h(15);var t=h(26);h=function(v){function z(y,x){var D=v.call(this)||this;D._wheelFilter=function(){return!0};D._wheelCallback=function(G,J){return D._handleWheelEvent(G,J)};D._touchStartCallback=function(G,J){return D._handleTouchStart(G,J)};D._touchMoveCallback=function(G,J){return D._handlePinch(G,J)};D._touchEndCallback=function(G){return D._handleTouchEnd(G)};D._touchCancelCallback=function(G){return D._handleTouchEnd(G)}; D._panEndCallbacks=new n.CallbackSet;D._zoomEndCallbacks=new n.CallbackSet;D._panZoomUpdateCallbacks=new n.CallbackSet;D._xScales=new n.Set;D._yScales=new n.Set;D._dragInteraction=new q.Drag;D._setupDragInteraction();D._touchIds=w.map();D._minDomainExtents=new n.Map;D._maxDomainExtents=new n.Map;D._minDomainValues=new n.Map;D._maxDomainValues=new n.Map;null!=y&&D.addXScale(y);null!=x&&D.addYScale(x);return D}m(z,v);z.prototype.dragInteraction=function(){return this._dragInteraction};z.prototype.wheelFilter= function(y){if(0===arguments.length)return this._wheelFilter;this._wheelFilter=y;return this};z.prototype.pan=function(y){var x=this;this.xScales().forEach(function(D){D.pan(x._constrainedTranslation(D,y.x))});this.yScales().forEach(function(D){D.pan(x._constrainedTranslation(D,y.y))});this._panZoomUpdateCallbacks.callCallbacks()};z.prototype.zoom=function(y,x,D){var G=this;void 0===D&&(D=!0);if(null!=x){var J=x.x;var F=x.y;D&&(this.xScales().forEach(function(E){E=G._constrainedZoom(E,y,J);J=E.centerPoint; y=E.zoomAmount}),this.yScales().forEach(function(E){E=G._constrainedZoom(E,y,F);F=E.centerPoint;y=E.zoomAmount}))}this.xScales().forEach(function(E){var L=E.range();E.zoom(y,null==J?(L[1]+L[0])/2:J)});this.yScales().forEach(function(E){var L=E.range();E.zoom(y,null==F?(L[1]+L[0])/2:F)});this._panZoomUpdateCallbacks.callCallbacks();return{zoomAmount:y,centerValue:{centerX:J,centerY:F}}};z.prototype._anchor=function(y){v.prototype._anchor.call(this,y);this._dragInteraction.attachTo(y);this._mouseDispatcher= l.Mouse.getDispatcher(this._componentAttachedTo);this._mouseDispatcher.onWheel(this._wheelCallback);this._touchDispatcher=l.Touch.getDispatcher(this._componentAttachedTo);this._touchDispatcher.onTouchStart(this._touchStartCallback);this._touchDispatcher.onTouchMove(this._touchMoveCallback);this._touchDispatcher.onTouchEnd(this._touchEndCallback);this._touchDispatcher.onTouchCancel(this._touchCancelCallback)};z.prototype._unanchor=function(){v.prototype._unanchor.call(this);this._mouseDispatcher.offWheel(this._wheelCallback); this._mouseDispatcher=null;this._touchDispatcher.offTouchStart(this._touchStartCallback);this._touchDispatcher.offTouchMove(this._touchMoveCallback);this._touchDispatcher.offTouchEnd(this._touchEndCallback);this._touchDispatcher.offTouchCancel(this._touchCancelCallback);this._touchDispatcher=null;this._dragInteraction.detach()};z.prototype._handleTouchStart=function(y,x){for(var D=0;D<y.length&&2>this._touchIds.size();D++){var G=y[D];this._touchIds.set(G.toString(),this._translateToComponentSpace(x[G]))}}; z.prototype._handlePinch=function(y,x){var D=this;if(!(2>this._touchIds.size())){var G=this._touchIds.values();if(this._isInsideComponent(this._translateToComponentSpace(G[0]))&&this._isInsideComponent(this._translateToComponentSpace(G[1]))){var J=z._pointDistance(G[0],G[1]);if(0!==J){y.forEach(function(M){D._touchIds.has(M.toString())&&D._touchIds.set(M.toString(),D._translateToComponentSpace(x[M]))});y=this._touchIds.values();var F=z._pointDistance(y[0],y[1]);if(0!==F){var E=J/F,L=y.map(function(M, R){return{x:(M.x-G[R].x)/E,y:(M.y-G[R].y)/E}});J=z.centerPoint(G[0],G[1]);J=this.zoom(E,J);y=J.centerValue;var N=J.zoomAmount;J=y.centerX;y=y.centerY;F=G.map(function(M,R){return{x:L[R].x*N+M.x,y:L[R].y*N+M.y}});this.pan({x:J-(F[0].x+F[1].x)/2,y:y-(F[0].y+F[1].y)/2})}}}}};z.centerPoint=function(y,x){return{x:(Math.min(y.x,x.x)+Math.max(y.x,x.x))/2,y:(Math.max(y.y,x.y)+Math.min(y.y,x.y))/2}};z._pointDistance=function(y,x){return Math.sqrt(Math.pow(Math.max(y.x,x.x)-Math.min(y.x,x.x),2)+Math.pow(Math.max(y.y, x.y)-Math.min(y.y,x.y),2))};z.prototype._handleTouchEnd=function(y){var x=this;y.forEach(function(D){x._touchIds.remove(D.toString())});0<this._touchIds.size()&&this._zoomEndCallbacks.callCallbacks()};z.prototype._handleWheelEvent=function(y,x){this._wheelFilter(x)&&(y=this._translateToComponentSpace(y),this._isInsideComponent(y)&&(x.preventDefault(),this.zoom(Math.pow(2,(0!==x.deltaY?x.deltaY:x.deltaX)*(x.deltaMode?z._PIXELS_PER_LINE:1)*.002),y),this._zoomEndCallbacks.callCallbacks()))};z.prototype._constrainedZoom= function(y,x,D){return t.constrainedZoom(y,x,D,this.minDomainExtent(y),this.maxDomainExtent(y),this.minDomainValue(y),this.maxDomainValue(y))};z.prototype._constrainedTranslation=function(y,x){return t.constrainedTranslation(y,x,this.minDomainValue(y),this.maxDomainValue(y))};z.prototype._setupDragInteraction=function(){var y=this;this._dragInteraction.constrainedToComponent();var x;this._dragInteraction.onDragStart(function(){return x=null});this._dragInteraction.onDrag(function(D,G){2<=y._touchIds.size()|| (y.pan({x:(null==x?D.x:x.x)-G.x,y:(null==x?D.y:x.y)-G.y}),x=G)});this._dragInteraction.onDragEnd(function(){return y._panEndCallbacks.callCallbacks()})};z.prototype._nonLinearScaleWithExtents=function(y){return null!=this.minDomainExtent(y)&&null!=this.maxDomainExtent(y)&&!(y instanceof p.Linear)&&!(y instanceof p.Time)};z.prototype.xScales=function(){var y=[];this._xScales.forEach(function(x){y.push(x)});return y};z.prototype.yScales=function(){var y=[];this._yScales.forEach(function(x){y.push(x)}); return y};z.prototype.addXScale=function(y){this._xScales.add(y)};z.prototype.removeXScale=function(y){this._xScales.delete(y);this._minDomainExtents.delete(y);this._maxDomainExtents.delete(y);this._minDomainValues.delete(y);this._maxDomainValues.delete(y);return this};z.prototype.addYScale=function(y){this._yScales.add(y)};z.prototype.removeYScale=function(y){this._yScales.delete(y);this._minDomainExtents.delete(y);this._maxDomainExtents.delete(y);this._minDomainValues.delete(y);this._maxDomainValues.delete(y); return this};z.prototype.minDomainExtent=function(y){return this._minDomainExtents.get(y)};z.prototype.maxDomainExtent=function(y){return this._maxDomainExtents.get(y)};z.prototype.minDomainValue=function(y,x){if(null==x)return this._minDomainValues.get(y);this._minDomainValues.set(y,x);return this};z.prototype.maxDomainValue=function(y,x){if(null==x)return this._maxDomainValues.get(y);this._maxDomainValues.set(y,x);return this};z.prototype.setMinMaxDomainValuesTo=function(y){this._minDomainValues.delete(y); this._maxDomainValues.delete(y);var x=y.getTransformationDomain(),D=x[1];this.minDomainValue(y,x[0]);this.maxDomainValue(y,D);return this};z.prototype.onPanEnd=function(y){this._panEndCallbacks.add(y);return this};z.prototype.offPanEnd=function(y){this._panEndCallbacks.delete(y);return this};z.prototype.onZoomEnd=function(y){this._zoomEndCallbacks.add(y);return this};z.prototype.offZoomEnd=function(y){this._zoomEndCallbacks.delete(y);return this};z.prototype.onPanZoomUpdate=function(y){this._panZoomUpdateCallbacks.add(y); return this};z.prototype.offPanZoomUpdate=function(y){this._panZoomUpdateCallbacks.delete(y);return this};return z}(d.Interaction);h._PIXELS_PER_LINE=120;f.PanZoom=h},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(13),l=h(0);d=function(p){function n(){var q=null!==p&&p.apply(this,arguments)||this;q._overComponent=!1;q._pointerEnterCallbacks= new l.CallbackSet;q._pointerMoveCallbacks=new l.CallbackSet;q._pointerExitCallbacks=new l.CallbackSet;q._mouseMoveCallback=function(t,v){return q._handleMouseEvent(t,v)};q._touchStartCallback=function(t,v,z){return q._handleTouchEvent(v[t[0]],z)};return q}m(n,p);n.prototype._anchor=function(q){p.prototype._anchor.call(this,q);this._mouseDispatcher=w.Mouse.getDispatcher(this._componentAttachedTo);this._mouseDispatcher.onMouseMove(this._mouseMoveCallback);this._touchDispatcher=w.Touch.getDispatcher(this._componentAttachedTo); this._touchDispatcher.onTouchStart(this._touchStartCallback)};n.prototype._unanchor=function(){p.prototype._unanchor.call(this);this._mouseDispatcher.offMouseMove(this._mouseMoveCallback);this._mouseDispatcher=null;this._touchDispatcher.offTouchStart(this._touchStartCallback);this._touchDispatcher=null};n.prototype._handleMouseEvent=function(q,t){t=this._mouseDispatcher.eventInside(this._componentAttachedTo,t);this._handlePointerEvent(q,t)};n.prototype._handleTouchEvent=function(q,t){t=this._touchDispatcher.eventInside(this._componentAttachedTo, t);this._handlePointerEvent(q,t)};n.prototype._handlePointerEvent=function(q,t){q=this._translateToComponentSpace(q);var v=this._isInsideComponent(q);v&&t?(this._overComponent||this._pointerEnterCallbacks.callCallbacks(q),this._pointerMoveCallbacks.callCallbacks(q)):this._overComponent&&this._pointerExitCallbacks.callCallbacks(q);this._overComponent=v&&t};n.prototype.onPointerEnter=function(q){this._pointerEnterCallbacks.add(q);return this};n.prototype.offPointerEnter=function(q){this._pointerEnterCallbacks.delete(q); return this};n.prototype.onPointerMove=function(q){this._pointerMoveCallbacks.add(q)};n.prototype.offPointerMove=function(q){this._pointerMoveCallbacks.delete(q)};n.prototype.onPointerExit=function(q){this._pointerExitCallbacks.add(q)};n.prototype.offPointerExit=function(q){this._pointerExitCallbacks.delete(q);return this};return n}(h(15).Interaction);f.Pointer=d},function(d,f,h){var m=h(20);f.memThunk=function(){for(var w=[],l=0;l<arguments.length;l++)w[l]=arguments[l];var p=w.slice(0,-1),n=m.memoize(w[w.length- 1]);return function(){var q=this,t=p.map(function(v){return v.apply(q)});return n.apply(void 0,t)}}},function(d,f,h){var m=h(49);f.memoize=function(w){function l(){for(var v=[],z=0;z<arguments.length;z++)v[z]=arguments[z];if(q)return n;z=m.signArray(v);void 0===p||p.isDifferent(z)?(t&&console.log("cache miss! computing"),p=z,n=w.apply(this,v)):t&&console.log("cache hit!");return n}var p=void 0,n,q=!1,t=!1;l.doLocked=function(v){if(q)throw Error("Locking an already locked memoize function!");q=!0; v=v.apply(this);q=!1;return v};l.logPerformance=function(v){void 0===v&&(v=!0);t=v;return this};return l}},function(d,f,h){var m=this&&this.__extends||function(q,t){function v(){this.constructor=q}for(var z in t)t.hasOwnProperty(z)&&(q[z]=t[z]);q.prototype=null===t?Object.create(t):(v.prototype=t.prototype,new v)},w=h(3),l=h(0),p=h(27),n=h(2);d=function(q){function t(v){void 0===v&&(v="vertical");v=q.call(this,v)||this;v._clusterOffsets=new l.Map;return v}m(t,q);t.prototype._generateAttrToProjector= function(){function v(){return x.rangeBand()}var z=this,y=q.prototype._generateAttrToProjector.call(this),x=this._makeInnerScale();y.width=this._isVertical?v:y.width;y.height=this._isVertical?y.height:v;var D=y.x,G=y.y;y.x=this._isVertical?function(J,F,E){return D(J,F,E)+z._clusterOffsets.get(E)}:function(J,F,E){return D(J,F,E)};y.y=this._isVertical?function(J,F,E){return G(J,F,E)}:function(J,F,E){return G(J,F,E)+z._clusterOffsets.get(E)};return y};t.prototype._updateClusterPosition=function(){var v= this,z=this._makeInnerScale();this.datasets().forEach(function(y,x){return v._clusterOffsets.set(y,z.scale(String(x))-z.rangeBand()/2)})};t.prototype._makeInnerScale=function(){var v=new w.Category;v.domain(this.datasets().map(function(y,x){return String(x)}));var z=n.Plot._scaledAccessor(this.attr(p.Bar._BAR_THICKNESS_KEY));v.range([0,z(null,0,null)]);return v};t.prototype._getDataToDraw=function(){this._updateClusterPosition();return q.prototype._getDataToDraw.call(this)};return t}(p.Bar);f.ClusteredBar= d},function(d,f,h){var m=this&&this.__extends||function(G,J){function F(){this.constructor=G}for(var E in J)J.hasOwnProperty(E)&&(G[E]=J[E]);G.prototype=null===J?Object.create(J):(F.prototype=J.prototype,new F)},w=h(1),l=h(5),p=h(7),n=h(8),q=h(3),t=h(0),v=h(44),z=h(45),y=h(6),x=h(35),D=h(2);d=function(G){function J(){var F=G.call(this)||this;F._startAngle=0;F._endAngle=2*Math.PI;F._labelFormatter=n.identity();F._labelsEnabled=!1;F.innerRadius(0);F.outerRadius(function(){var E=F._pieCenter();return Math.min(Math.max(F.width()- E.x,E.x),Math.max(F.height()-E.y,E.y))});F.addClass("pie-plot");F.attr("fill",function(E,L){return String(L)},new q.Color);F._strokeDrawers=new t.Map;return F}m(J,G);J.prototype._setup=function(){var F=this;G.prototype._setup.call(this);this._strokeDrawers.forEach(function(E){return E.attachTo(F._renderArea)})};J.prototype.computeLayout=function(F,E,L){G.prototype.computeLayout.call(this,F,E,L);F=this._pieCenter();this._renderArea.attr("transform","translate("+F.x+","+F.y+")");F=Math.min(Math.max(this.width()- F.x,F.x),Math.max(this.height()-F.y,F.y));null!=this.innerRadius().scale&&this.innerRadius().scale.range([0,F]);null!=this.outerRadius().scale&&this.outerRadius().scale.range([0,F]);return this};J.prototype.addDataset=function(F){G.prototype.addDataset.call(this,F);return this};J.prototype._addDataset=function(F){if(1===this.datasets().length)return t.Window.warn("Only one dataset is supported in Pie plots"),this;this._updatePieAngles();var E=new z.ArcOutlineSVGDrawer;this._isSetup&&E.attachTo(this._renderArea); this._strokeDrawers.set(F,E);G.prototype._addDataset.call(this,F);return this};J.prototype.removeDataset=function(F){G.prototype.removeDataset.call(this,F)};J.prototype._removeDatasetNodes=function(F){G.prototype._removeDatasetNodes.call(this,F);this._strokeDrawers.get(F).remove()};J.prototype._removeDataset=function(F){G.prototype._removeDataset.call(this,F);this._startAngles=[];this._endAngles=[];return this};J.prototype.selections=function(F){var E=this;void 0===F&&(F=this.datasets());var L=G.prototype.selections.call(this, F).nodes();F.forEach(function(N){N=E._strokeDrawers.get(N);null!=N&&L.push.apply(L,N.getVisualPrimitives())});return w.selectAll(L)};J.prototype._onDatasetUpdate=function(){G.prototype._onDatasetUpdate.call(this);this._updatePieAngles();this.render()};J.prototype._createDrawer=function(){return new y.ProxyDrawer(function(){return new v.ArcSVGDrawer},function(){x.warn("canvas renderer is not supported on Pie Plot!");return null})};J.prototype.entities=function(F){var E=this;void 0===F&&(F=this.datasets()); return G.prototype.entities.call(this,F).map(function(L){L.position.x+=E.width()/2;L.position.y+=E.height()/2;var N=w.select(E._strokeDrawers.get(L.dataset).getVisualPrimitiveAtIndex(L.index));L.strokeSelection=N;return L})};J.prototype.sectorValue=function(){return this._propertyBindings.get(J._SECTOR_VALUE_KEY)};J.prototype.innerRadius=function(F,E){if(null==F)return this._propertyBindings.get(J._INNER_RADIUS_KEY);this._bindProperty(J._INNER_RADIUS_KEY,F,E);this.render();return this};J.prototype.outerRadius= function(F,E){if(null==F)return this._propertyBindings.get(J._OUTER_RADIUS_KEY);this._bindProperty(J._OUTER_RADIUS_KEY,F,E);this.render();return this};J.prototype.startAngle=function(F){if(null==F)return this._startAngle;this._startAngle=F;this._updatePieAngles();this.render();return this};J.prototype.endAngle=function(F){if(null==F)return this._endAngle;this._endAngle=F;this._updatePieAngles();this.render();return this};J.prototype.labelsEnabled=function(F){if(null==F)return this._labelsEnabled; this._labelsEnabled=F;this.render();return this};J.prototype.labelFormatter=function(F){if(null==F)return this._labelFormatter;this._labelFormatter=F;this.render();return this};J.prototype.entitiesAt=function(F){var E=this.width()/2,L=this.height()/2;F=this._sliceIndexForPoint({x:F.x-E,y:F.y-L});return null==F?[]:[this.entities()[F]]};J.prototype._propertyProjectors=function(){var F=this,E=G.prototype._propertyProjectors.call(this),L=D.Plot._scaledAccessor(this.innerRadius()),N=D.Plot._scaledAccessor(this.outerRadius()); E.d=function(M,R,Z){return w.arc().innerRadius(L(M,R,Z)).outerRadius(N(M,R,Z)).startAngle(F._startAngles[R]).endAngle(F._endAngles[R])(M,R)};return E};J.prototype._updatePieAngles=function(){if(null!=this.sectorValue()&&0!==this.datasets().length){var F=D.Plot._scaledAccessor(this.sectorValue()),E=this.datasets()[0],L=this._getDataToDraw().get(E);L=w.pie().sort(null).startAngle(this._startAngle).endAngle(this._endAngle).value(function(N,M){return F(N,M,E)})(L);this._startAngles=L.map(function(N){return N.startAngle}); this._endAngles=L.map(function(N){return N.endAngle})}};J.prototype._pieCenter=function(){var F=this._startAngle<this._endAngle?this._startAngle:this._endAngle,E=this._startAngle<this._endAngle?this._endAngle:this._startAngle,L=Math.sin(F);F=Math.cos(F);var N=Math.sin(E);E=Math.cos(E);var M;if(0<=L&&0<=N)if(0<=F&&0<=E){var R=F;var Z=M=0;var T=N}else 0>F&&0>E?(R=0,M=-E,Z=0,T=L):0<=F&&0>E?(R=F,M=-E,Z=0,T=L):0>F&&0<=E&&(Z=M=R=1,T=Math.max(L,N));else 0<=L&&0>N?0<=F&&0<=E?(R=Math.max(F,E),T=Z=M=1):0>F&& 0>E?(R=0,M=1,Z=-N,T=L):0<=F&&0>E?(R=F,M=1,Z=-N,T=1):0>F&&0<=E&&(R=E,Z=M=1,T=L):0>L&&0<=N?0<=F&&0<=E?(R=1,M=0,Z=-L,T=N):0>F&&0>E?(R=1,M=Math.max(-F,-E),T=Z=1):0<=F&&0>E?(R=1,M=-E,Z=-L,T=1):0>F&&0<=E&&(R=1,M=-F,Z=1,T=N):0>L&&0>N&&(0<=F&&0<=E?(R=E,M=0,Z=-L,T=0):0>F&&0>E?(R=0,M=-F,Z=-N,T=0):0<=F&&0>E?(M=R=1,Z=Math.max(F,-E),T=1):0>F&&0<=E&&(R=E,M=-F,Z=1,T=0));return{x:0==Z+T?0:Z/(Z+T)*this.width(),y:0==R+M?0:R/(R+M)*this.height()}};J.prototype._getDataToDraw=function(){var F=G.prototype._getDataToDraw.call(this); if(0===this.datasets().length)return F;var E=D.Plot._scaledAccessor(this.sectorValue()),L=this.datasets()[0],N=F.get(L).filter(function(M,R){return J._isValidData(E(M,R,L))});F.set(L,N);return F};J._isValidData=function(F){return t.Math.isValidNumber(F)&&0<=F};J.prototype._pixelPoint=function(F,E,L){var N=D.Plot._scaledAccessor(this.sectorValue());if(!J._isValidData(N(F,E,L)))return{x:NaN,y:NaN};var M=D.Plot._scaledAccessor(this.innerRadius())(F,E,L);F=D.Plot._scaledAccessor(this.outerRadius())(F, E,L);M=(M+F)/2;F=w.pie().sort(null).value(function(R,Z){R=N(R,Z,L);return J._isValidData(R)?R:0}).startAngle(this._startAngle).endAngle(this._endAngle)(L.data());E=(F[E].startAngle+F[E].endAngle)/2;return{x:M*Math.sin(E),y:-M*Math.cos(E)}};J.prototype._additionalPaint=function(F){var E=this;this._renderArea.select(".label-area").remove();this._labelsEnabled&&t.Window.setTimeout(function(){return E._drawLabels()},F);var L=this._generateStrokeDrawSteps(),N=this._getDataToDraw();this.datasets().forEach(function(M){var R= D.Plot.applyDrawSteps(L,M);E._strokeDrawers.get(M).draw(N.get(M),R)})};J.prototype._generateStrokeDrawSteps=function(){return[{attrToProjector:this._getAttrToProjector(),animator:new p.Null}]};J.prototype._sliceIndexForPoint=function(F){var E=Math.sqrt(Math.pow(F.x,2)+Math.pow(F.y,2)),L=Math.acos(-F.y/E);0>F.x&&(L=2*Math.PI-L);for(F=0;F<this._startAngles.length;F++)if(this._startAngles[F]<L&&this._endAngles[F]>L){var N=F;break}if(void 0!==N){F=this.datasets()[0];var M=F.data()[N];L=this.innerRadius().accessor(M, N,F);F=this.outerRadius().accessor(M,N,F);if(E>L&&E<F)return N}return null};J.prototype._drawLabels=function(){var F=this,E=this._getAttrToProjector(),L=this._renderArea.append("g").classed("label-area",!0),N=new l.SvgContext(L.node()),M=new l.CacheMeasurer(N),R=new l.Writer(M,N),Z=this.datasets()[0];this._getDataToDraw().get(Z).forEach(function(T,Y){var ma=F.sectorValue().accessor(T,Y,Z);if(t.Math.isValidNumber(ma)){ma=F._labelFormatter(ma,T,Y,Z);var va=M.measure(ma),Ba=(F._endAngles[Y]+F._startAngles[Y])/ 2,oa=F.outerRadius().accessor(T,Y,Z);F.outerRadius().scale&&(oa=F.outerRadius().scale.scale(oa));var xa=F.innerRadius().accessor(T,Y,Z);F.innerRadius().scale&&(xa=F.innerRadius().scale.scale(xa));xa=(oa+xa)/2;oa=Math.sin(Ba)*xa-va.width/2;xa=-Math.cos(Ba)*xa-va.height/2;var Pa=[{x:oa,y:xa},{x:oa,y:xa+va.height},{x:oa+va.width,y:xa},{x:oa+va.width,y:xa+va.height}];(Ba=Pa.every(function(Ha){return Math.abs(Ha.x)<=F.width()/2&&Math.abs(Ha.y)<=F.height()/2}))&&(Ba=Pa.map(function(Ha){return F._sliceIndexForPoint(Ha)}).every(function(Ha){return Ha=== Y}));T=E.fill(T,Y,Z);T=1.6*t.Color.contrast("white",T)<t.Color.contrast("black",T);oa=L.append("g").attr("transform","translate("+oa+","+xa+")");oa.classed(T?"dark-label":"light-label",!0);oa.style("visibility",Ba?"inherit":"hidden");R.write(ma,va.width,va.height,{xAlign:"center",yAlign:"center"},oa.node())}})};return J}(D.Plot);d._INNER_RADIUS_KEY="inner-radius";d._OUTER_RADIUS_KEY="outer-radius";d._SECTOR_VALUE_KEY="sector-value";f.Pie=d},function(d,f,h){var m=this&&this.__extends||function(x,D){function G(){this.constructor= x}for(var J in D)D.hasOwnProperty(J)&&(x[J]=D[J]);x.prototype=null===D?Object.create(D):(G.prototype=D.prototype,new G)},w=h(1),l=h(5),p=h(7),n=h(14),q=h(6),t=h(34),v=h(3),z=h(0),y=h(2);d=function(x){function D(){var G=x.call(this)||this;G._labelsEnabled=!1;G._label=null;G.animator("rectangles",new p.Null);G.addClass("rectangle-plot");G.attr("fill",(new v.Color).range()[0]);return G}m(D,x);D.prototype._createDrawer=function(){return new q.ProxyDrawer(function(){return new t.RectangleSVGDrawer},function(G){return new n.RectangleCanvasDrawer(G)})}; D.prototype._generateAttrToProjector=function(){var G=this,J=x.prototype._generateAttrToProjector.call(this),F=y.Plot._scaledAccessor(this.x()),E=J[D._X2_KEY],L=y.Plot._scaledAccessor(this.y()),N=J[D._Y2_KEY],M=this.x().scale,R=this.y().scale;null!=E?(J.width=function(Z,T,Y){return Math.abs(E(Z,T,Y)-F(Z,T,Y))},J.x=function(Z,T,Y){return Math.min(E(Z,T,Y),F(Z,T,Y))}):(J.width=function(){return G._rectangleWidth(M)},J.x=function(Z,T,Y){return F(Z,T,Y)-.5*J.width(Z,T,Y)});null!=N?(J.height=function(Z, T,Y){return Math.abs(N(Z,T,Y)-L(Z,T,Y))},J.y=function(Z,T,Y){return Math.max(N(Z,T,Y),L(Z,T,Y))-J.height(Z,T,Y)}):(J.height=function(){return G._rectangleWidth(R)},J.y=function(Z,T,Y){return L(Z,T,Y)-.5*J.height(Z,T,Y)});delete J[D._X2_KEY];delete J[D._Y2_KEY];return J};D.prototype._generateDrawSteps=function(){return[{attrToProjector:this._getAttrToProjector(),animator:this._getAnimator("rectangles")}]};D.prototype._filterForProperty=function(G){return"x2"===G?x.prototype._filterForProperty.call(this, "x"):"y2"===G?x.prototype._filterForProperty.call(this,"y"):x.prototype._filterForProperty.call(this,G)};D.prototype.x=function(G,J,F){if(null==G)return x.prototype.x.call(this);null==J?x.prototype.x.call(this,G):x.prototype.x.call(this,G,J,F);null!=J&&(F=(G=this.x2())&&G.accessor,null!=F&&this._bindProperty(D._X2_KEY,F,J,G.postScale));J instanceof v.Category&&J.innerPadding(0).outerPadding(0);return this};D.prototype.x2=function(G){if(null==G)return this._propertyBindings.get(D._X2_KEY);var J=this.x(); this._bindProperty(D._X2_KEY,G,J&&J.scale,void 0);this.render();return this};D.prototype.y=function(G,J,F){if(null==G)return x.prototype.y.call(this);null==J?x.prototype.y.call(this,G):x.prototype.y.call(this,G,J,F);null!=J&&(F=(G=this.y2())&&G.accessor,null!=F&&this._bindProperty(D._Y2_KEY,F,J,G.postScale));J instanceof v.Category&&J.innerPadding(0).outerPadding(0);return this};D.prototype.y2=function(G){if(null==G)return this._propertyBindings.get(D._Y2_KEY);var J=this.y();this._bindProperty(D._Y2_KEY, G,J&&J.scale,void 0);this.render();return this};D.prototype.entitiesAt=function(G){var J=this._getAttrToProjector();return this.entities().filter(function(F){var E=F.datum,L=F.index,N=F.dataset;F=J.x(E,L,N);var M=J.y(E,L,N),R=J.width(E,L,N);E=J.height(E,L,N);return F<=G.x&&G.x<=F+R&&M<=G.y&&G.y<=M+E})};D.prototype._entityBounds=function(G){return this._entityBBox(G.datum,G.index,G.dataset,this._getAttrToProjector())};D.prototype._entityBBox=function(G,J,F,E){return{x:E.x(G,J,F),y:E.y(G,J,F),width:E.width(G, J,F),height:E.height(G,J,F)}};D.prototype.label=function(G){if(null==G)return this._label;this._label=G;this.render();return this};D.prototype.labelsEnabled=function(G){if(null==G)return this._labelsEnabled;this._labelsEnabled=G;this.render();return this};D.prototype._propertyProjectors=function(){var G=x.prototype._propertyProjectors.call(this);null!=this.x2()&&(G.x2=y.Plot._scaledAccessor(this.x2()));null!=this.y2()&&(G.y2=y.Plot._scaledAccessor(this.y2()));return G};D.prototype._pixelPoint=function(G, J,F){var E=this._getAttrToProjector(),L=E.x(G,J,F),N=E.y(G,J,F),M=E.width(G,J,F);G=E.height(G,J,F);return{x:L+M/2,y:N+G/2}};D.prototype._rectangleWidth=function(G){if(G instanceof v.Category)return G.rangeBand();var J=G===this.x().scale?this.x().accessor:this.y().accessor,F=w.set(z.Array.flatten(this.datasets().map(function(N){return N.data().map(function(M,R){return J(M,R,N).valueOf()})}))).values().map(function(N){return+N}),E=z.Math.min(F,0);F=z.Math.max(F,0);var L=G.scale(E);return(G.scale(F)- L)/Math.abs(F-E)};D.prototype._getDataToDraw=function(){var G=new z.Map,J=this._getAttrToProjector();this.datasets().forEach(function(F){var E=F.data().map(function(L,N){return z.Math.isValidNumber(J.x(L,N,F))&&z.Math.isValidNumber(J.y(L,N,F))&&z.Math.isValidNumber(J.width(L,N,F))&&z.Math.isValidNumber(J.height(L,N,F))?L:null});G.set(F,E)});return G};D.prototype._additionalPaint=function(G){var J=this;this._renderArea.selectAll(".label-area").remove();this._labelsEnabled&&null!=this.label()&&z.Window.setTimeout(function(){return J._drawLabels()}, G)};D.prototype._drawLabels=function(){var G=this,J=this._getDataToDraw();this.datasets().forEach(function(F,E){return G._drawLabel(J,F,E)})};D.prototype._drawLabel=function(G,J,F){var E=this,L=this._getAttrToProjector(),N=this._renderArea.append("g").classed("label-area",!0),M=new l.SvgContext(N.node()),R=new l.CacheMeasurer(M),Z=new l.Writer(R,M);M=this.x().scale.range();var T=this.y().scale.range(),Y=Math.min.apply(null,M),ma=Math.max.apply(null,M),va=Math.min.apply(null,T),Ba=Math.max.apply(null, T);G.get(J).forEach(function(oa,xa){if(null!=oa){var Pa=""+E.label()(oa,xa,J),Ha=R.measure(Pa),La=L.x(oa,xa,J),qa=L.y(oa,xa,J),Cb=L.width(oa,xa,J),tb=L.height(oa,xa,J);Ha.height<=tb&&Ha.width<=Cb&&(tb=(tb-Ha.height)/2,La+=(Cb-Ha.width)/2,qa+=tb,Cb={min:La,max:La+Ha.width},tb={min:qa,max:qa+Ha.height},Cb.min<Y||Cb.max>ma||tb.min<va||tb.max>Ba||E._overlayLabel(Cb,tb,xa,F,G)||(oa=L.fill(oa,xa,J),oa=1.6*z.Color.contrast("white",oa)<z.Color.contrast("black",oa),La=N.append("g").attr("transform","translate("+ La+","+qa+")"),La.classed(oa?"dark-label":"light-label",!0),Z.write(Pa,Ha.width,Ha.height,{xAlign:"center",yAlign:"center"},La.node())))}})};D.prototype._overlayLabel=function(G,J,F,E,L){for(var N=this._getAttrToProjector(),M=this.datasets(),R=E;R<M.length;R++)for(var Z=M[R],T=L.get(Z),Y=R===E?F+1:0;Y<T.length;Y++)if(z.DOM.intersectsBBox(G,J,this._entityBBox(T[Y],Y,Z,N)))return!0;return!1};return D}(h(16).XYPlot);d._X2_KEY="x2";d._Y2_KEY="y2";f.Rectangle=d},function(d,f,h){var m=this&&this.__extends|| function(x,D){function G(){this.constructor=x}for(var J in D)D.hasOwnProperty(J)&&(x[J]=D[J]);x.prototype=null===D?Object.create(D):(G.prototype=D.prototype,new G)},w=h(31),l=h(6),p=h(48),n=h(7),q=h(14),t=h(3),v=h(0),z=h(19),y=h(2);d=function(x){function D(){var G=x.call(this)||this;G.addClass("scatter-plot");var J=new n.Easing;J.startDelay(5);J.stepDuration(250);J.maxTotalDuration(y.Plot._ANIMATION_MAX_DURATION);G.animator(z.Animator.MAIN,J);G.attr("opacity",.6);G.attr("fill",(new t.Color).range()[0]); G.size(6);var F=w.circle();G.symbol(function(){return F});return G}m(D,x);D.prototype._buildLightweightPlotEntities=function(G){var J=this;return x.prototype._buildLightweightPlotEntities.call(this,G).map(function(F){var E=y.Plot._scaledAccessor(J.size())(F.datum,F.index,F.dataset);F.diameter=E;return F})};D.prototype._createDrawer=function(G){var J=this;return new l.ProxyDrawer(function(){return new p.SymbolSVGDrawer},function(F){return new q.CanvasDrawer(F,p.makeSymbolCanvasDrawStep(G,function(){return y.Plot._scaledAccessor(J.symbol())}, function(){return y.Plot._scaledAccessor(J.size())}))})};D.prototype.size=function(G,J){if(null==G)return this._propertyBindings.get(D._SIZE_KEY);this._bindProperty(D._SIZE_KEY,G,J);this.render();return this};D.prototype.symbol=function(G){if(null==G)return this._propertyBindings.get(D._SYMBOL_KEY);this._propertyBindings.set(D._SYMBOL_KEY,{accessor:G});this.render();return this};D.prototype._generateDrawSteps=function(){var G=[];if(this._animateOnNextRender()){var J=this._getAttrToProjector(),F=y.Plot._scaledAccessor(this.symbol()); J.d=function(E,L,N){return F(E,L,N)(0)(null)};G.push({attrToProjector:J,animator:this._getAnimator(z.Animator.RESET)})}G.push({attrToProjector:this._getAttrToProjector(),animator:this._getAnimator(z.Animator.MAIN)});return G};D.prototype._propertyProjectors=function(){var G=x.prototype._propertyProjectors.call(this),J=y.Plot._scaledAccessor(this.x()),F=y.Plot._scaledAccessor(this.y());G.x=J;G.y=F;G.transform=function(E,L,N){return"translate("+J(E,L,N)+","+F(E,L,N)+")"};G.d=this._constructSymbolGenerator(); return G};D.prototype._constructSymbolGenerator=function(){var G=y.Plot._scaledAccessor(this.symbol()),J=y.Plot._scaledAccessor(this.size());return function(F,E,L){return G(F,E,L)(J(F,E,L))(null)}};D.prototype._entityBounds=function(G){return{x:G.position.x-G.diameter/2,y:G.position.y-G.diameter/2,width:G.diameter,height:G.diameter}};D.prototype._entityVisibleOnPlot=function(G,J){var F={min:J.topLeft.x,max:J.bottomRight.x};J={min:J.topLeft.y,max:J.bottomRight.y};G=this._entityBounds(G);return v.DOM.intersectsBBox(F, J,G)};D.prototype.entitiesAt=function(G){var J=y.Plot._scaledAccessor(this.x()),F=y.Plot._scaledAccessor(this.y()),E=y.Plot._scaledAccessor(this.size());return this.entities().filter(function(L){var N=L.datum,M=L.index,R=L.dataset;L=J(N,M,R);var Z=F(N,M,R);N=E(N,M,R);return L-N/2<=G.x&&G.x<=L+N/2&&Z-N/2<=G.y&&G.y<=Z+N/2})};return D}(h(16).XYPlot);d._SIZE_KEY="size";d._SYMBOL_KEY="symbol";f.Scatter=d},function(d,f,h){var m=this&&this.__extends||function(v,z){function y(){this.constructor=v}for(var x in z)z.hasOwnProperty(x)&& (v[x]=z[x]);v.prototype=null===z?Object.create(z):(y.prototype=z.prototype,new y)},w=h(7),l=h(6),p=h(47),n=h(3),q=h(35),t=h(2);d=function(v){function z(){var y=v.call(this)||this;y.addClass("segment-plot");y.attr("stroke",(new n.Color).range()[0]);y.attr("stroke-width","2px");return y}m(z,v);z.prototype._createDrawer=function(){return new l.ProxyDrawer(function(){return new p.SegmentSVGDrawer},function(){q.warn("canvas renderer is not supported on Segment Plot!");return null})};z.prototype._generateDrawSteps= function(){return[{attrToProjector:this._getAttrToProjector(),animator:new w.Null}]};z.prototype._filterForProperty=function(y){return"x2"===y?v.prototype._filterForProperty.call(this,"x"):"y2"===y?v.prototype._filterForProperty.call(this,"y"):v.prototype._filterForProperty.call(this,y)};z.prototype.x=function(y,x){if(null==y)return v.prototype.x.call(this);null==x?v.prototype.x.call(this,y):(v.prototype.x.call(this,y,x),y=(y=this.x2())&&y.accessor,null!=y&&this._bindProperty(z._X2_KEY,y,x));return this}; z.prototype.x2=function(y){if(null==y)return this._propertyBindings.get(z._X2_KEY);var x=this.x();this._bindProperty(z._X2_KEY,y,x&&x.scale);this.render();return this};z.prototype.y=function(y,x){if(null==y)return v.prototype.y.call(this);null==x?v.prototype.y.call(this,y):(v.prototype.y.call(this,y,x),y=(y=this.y2())&&y.accessor,null!=y&&this._bindProperty(z._Y2_KEY,y,x));return this};z.prototype.y2=function(y){if(null==y)return this._propertyBindings.get(z._Y2_KEY);var x=this.y();this._bindProperty(z._Y2_KEY, y,x&&x.scale);this.render();return this};z.prototype._propertyProjectors=function(){var y=v.prototype._propertyProjectors.call(this);y.x1=t.Plot._scaledAccessor(this.x());y.x2=null==this.x2()?t.Plot._scaledAccessor(this.x()):t.Plot._scaledAccessor(this.x2());y.y1=t.Plot._scaledAccessor(this.y());y.y2=null==this.y2()?t.Plot._scaledAccessor(this.y()):t.Plot._scaledAccessor(this.y2());return y};z.prototype.entitiesAt=function(y){y=this.entityNearest(y);return null!=y?[y]:[]};z.prototype.entitiesIn=function(y, x){if(null==x){var D={min:y.topLeft.x,max:y.bottomRight.x};y={min:y.topLeft.y,max:y.bottomRight.y}}else D=y,y=x;return this._entitiesIntersecting(D,y)};z.prototype._entitiesIntersecting=function(y,x){var D=this,G=[],J=this._getAttrToProjector();this.entities().forEach(function(F){D._lineIntersectsBox(F,y,x,J)&&G.push(F)});return G};z.prototype._lineIntersectsBox=function(y,x,D,G){var J=this,F=G.x1(y.datum,y.index,y.dataset),E=G.x2(y.datum,y.index,y.dataset),L=G.y1(y.datum,y.index,y.dataset);y=G.y2(y.datum, y.index,y.dataset);if(x.min<=F&&F<=x.max&&D.min<=L&&L<=D.max||x.min<=E&&E<=x.max&&D.min<=y&&y<=D.max)return!0;var N={x:F,y:L},M={x:E,y},R=[{x:x.min,y:D.min},{x:x.min,y:D.max},{x:x.max,y:D.max},{x:x.max,y:D.min}];return 0<R.filter(function(Z,T){return 0!==T?J._lineIntersectsSegment(N,M,Z,R[T-1])&&J._lineIntersectsSegment(Z,R[T-1],N,M):!1}).length};z.prototype._lineIntersectsSegment=function(y,x,D,G){return 0>((x.x-y.x)*(D.y-x.y)-(x.y-y.y)*(D.x-x.x))*((x.x-y.x)*(G.y-x.y)-(x.y-y.y)*(G.x-x.x))};return z}(h(16).XYPlot); d._X2_KEY="x2";d._Y2_KEY="y2";f.Segment=d},function(d,f,h){var m=this&&this.__extends||function(t,v){function z(){this.constructor=t}for(var y in v)v.hasOwnProperty(y)&&(t[y]=v[y]);t.prototype=null===v?Object.create(v):(z.prototype=v.prototype,new z)},w=h(1),l=h(7),p=h(20),n=h(0);d=h(50);var q=h(2);h=function(t){function v(){var z=t.call(this)||this;z._stackingResult=p.memThunk(function(){return z.datasets()},function(){return z.x().accessor},function(){return z.y().accessor},function(){return z._stackingOrder}, function(y,x,D,G){return n.Stacking.stack(y,x,D,G)});z._stackedExtent=p.memThunk(z._stackingResult,function(){return z.x().accessor},function(){return z._filterForProperty("y")},function(y,x,D){return n.Stacking.stackedExtent(y,x,D)});z._baselineValue=0;z._stackingOrder="bottomup";z.addClass("stacked-area-plot");z.attr("fill-opacity",1);z._baselineValueProvider=function(){return[z._baselineValue]};z.croppedRenderingEnabled(!1);return z}m(v,t);v.prototype.croppedRenderingEnabled=function(z){return null== z?t.prototype.croppedRenderingEnabled.call(this):z?(n.Window.warn("Warning: Stacked Area Plot does not support cropped rendering."),this):t.prototype.croppedRenderingEnabled.call(this,z)};v.prototype._getAnimator=function(){return new l.Null};v.prototype._setup=function(){t.prototype._setup.call(this);this._baseline=this._renderArea.append("line").classed("baseline",!0)};v.prototype.x=function(z,y){if(null==z)return t.prototype.x.call(this);null==y?t.prototype.x.call(this,z):t.prototype.x.call(this, z,y);this._checkSameDomain();return this};v.prototype.y=function(z,y){if(null==z)return t.prototype.y.call(this);null==y?t.prototype.y.call(this,z):t.prototype.y.call(this,z,y);this._checkSameDomain();return this};v.prototype.stackingOrder=function(z){if(null==z)return this._stackingOrder;this._stackingOrder=z;this._onDatasetUpdate();return this};v.prototype.downsamplingEnabled=function(){return t.prototype.downsamplingEnabled.call(this)};v.prototype._additionalPaint=function(){var z=this.y().scale.scale(this._baselineValue); z={x1:0,y1:z,x2:this.width(),y2:z};this._getAnimator("baseline").animate(this._baseline,z)};v.prototype._updateYScale=function(){var z=this.y();z=z&&z.scale;null!=z&&(z.addPaddingExceptionsProvider(this._baselineValueProvider),z.addIncludedValuesProvider(this._baselineValueProvider))};v.prototype._onDatasetUpdate=function(){this._checkSameDomain();t.prototype._onDatasetUpdate.call(this);return this};v.prototype.getExtentsForProperty=function(z){return"y"===z?[this._stackedExtent()]:t.prototype.getExtentsForProperty.call(this, z)};v.prototype._checkSameDomain=function(){if(this._projectorsReady()){var z=this.datasets(),y=this.x().accessor,x=z.map(function(G){return w.set(G.data().map(function(J,F){return y(J,F,G).toString()})).values()}),D=v._domainKeys(z,y);x.some(function(G){return G.length!==D.length})&&n.Window.warn("the domains across the datasets are not the same. Plot may produce unintended behavior.")}};v._domainKeys=function(z,y){var x=w.set();z.forEach(function(D){D.data().forEach(function(G,J){x.add(y(G,J,D))})}); return x.values()};v.prototype._propertyProjectors=function(){var z=this,y=t.prototype._propertyProjectors.call(this),x=this.y().accessor,D=this.x().accessor,G=this._stackingResult();y.d=this._constructAreaProjector(q.Plot._scaledAccessor(this.x()),function(J,F,E){return z.y().scale.scale(+x(J,F,E)+G.get(E).get(n.Stacking.normalizeKey(D(J,F,E))).offset)},function(J,F,E){return z.y().scale.scale(G.get(E).get(n.Stacking.normalizeKey(D(J,F,E))).offset)});return y};v.prototype._pixelPoint=function(z, y,x){var D=t.prototype._pixelPoint.call(this,z,y,x),G=this.x().accessor(z,y,x);z=this.y().accessor(z,y,x);x=this.y().scale.scale(+z+this._stackingResult().get(x).get(n.Stacking.normalizeKey(G)).offset);return{x:D.x,y:x}};return v}(d.Area);f.StackedArea=h},function(d,f,h){var m=this&&this.__extends||function(v,z){function y(){this.constructor=v}for(var x in z)z.hasOwnProperty(x)&&(v[x]=z[x]);v.prototype=null===z?Object.create(z):(y.prototype=z.prototype,new y)},w=h(5),l=h(8),p=h(20),n=h(0),q=h(27), t=h(2);d=function(v){function z(y){void 0===y&&(y="vertical");var x=v.call(this,y)||this;x._extremaFormatter=l.identity();x._stackingResult=p.memThunk(function(){return x.datasets()},function(){return x.position().accessor},function(){return x.length().accessor},function(){return x._stackingOrder},function(D,G,J,F){return n.Stacking.stack(D,G,J,F)});x._stackedExtent=p.memThunk(x._stackingResult,function(){return x.position().accessor},function(){return x._filterForProperty(x._isVertical?"y":"x")}, function(D,G,J){return n.Stacking.stackedExtent(D,G,J)});x.addClass("stacked-bar-plot");x._stackingOrder="bottomup";return x}m(z,v);z.prototype.stackingOrder=function(y){if(null==y)return this._stackingOrder;this._stackingOrder=y;this._onDatasetUpdate();return this};z.prototype.extremaFormatter=function(y){if(0===arguments.length)return this._extremaFormatter;this._extremaFormatter=y;this.render();return this};z.prototype._setup=function(){v.prototype._setup.call(this);this._labelArea=this._renderArea.append("g").classed(q.Bar._LABEL_AREA_CLASS, !0);var y=new w.SvgContext(this._labelArea.node());this._measurer=new w.CacheMeasurer(y);this._writer=new w.Writer(this._measurer,y)};z.prototype._drawLabels=function(){function y(N,M){var R=x._generateAttrToProjector(),Z=x.width(),T=x.height();N.forEach(function(Y){if(Y.extent!==D){var ma=x.extremaFormatter()(Y.extent),va=x._measurer.measure(ma),Ba=Y.stackedDatum,oa=Ba.originalDatum,xa=Ba.originalIndex;Ba=Ba.originalDataset;if(x._isDatumOnScreen(R,Z,T,oa,xa,Ba)){oa=t.Plot._scaledAccessor(x.attr(q.Bar._BAR_THICKNESS_KEY))(oa, xa,Ba);xa=J.scale(Y.extent);Y=x._getPositionAttr(G.scale(Y.axisValue),oa)+oa/2;var Pa=M(x._isVertical?{x:Y,y:xa}:{x:xa,y:Y},va,oa);xa=Pa.x;Ba=Pa.y;Y=Pa.x+va.width-Pa.x;va=Pa.y+va.height-Pa.y;oa=x._isVertical?Y>oa:va>oa;oa||(xa=x._labelArea.append("g").attr("transform","translate("+xa+", "+Ba+")"),xa.classed("stacked-bar-label",!0),x._writer.write(ma,Y,va,{xAlign:"center",yAlign:"center"},xa.node()));L.push(oa)}}})}var x=this;v.prototype._drawLabels.call(this);this._labelArea.selectAll("g").remove(); var D=+this.baselineValue(),G=this.position().scale,J=this.length().scale,F=n.Stacking.stackedExtents(this._stackingResult()),E=F.minimumExtents,L=[];y(F.maximumExtents,function(N,M){var R=x._isVertical?M.width:M.height;M=x._isVertical?M.height:M.width;return{x:x._isVertical?N.x-R/2:N.x+z._EXTREMA_LABEL_MARGIN_FROM_BAR,y:x._isVertical?N.y-M:N.y-R/2}});y(E,function(N,M){var R=x._isVertical?M.width:M.height;M=x._isVertical?M.height:M.width;return{x:x._isVertical?N.x-R/2:N.x-M,y:x._isVertical?N.y+z._EXTREMA_LABEL_MARGIN_FROM_BAR: N.y-R/2}});L.some(function(N){return N})&&this._labelArea.selectAll("g").remove()};z.prototype._generateAttrToProjector=function(){function y(Z,T,Y){return 0>+N(Z,T,Y)?G(Z,T,Y):D(Z,T,Y)}function x(Z,T,Y){return Math.abs(D(Z,T,Y)-G(Z,T,Y))}function D(Z,T,Y){return L.scale(+N(Z,T,Y)+R.get(Y).get(n.Stacking.normalizeKey(M(Z,T,Y))).offset)}function G(Z,T,Y){return L.scale(R.get(Y).get(n.Stacking.normalizeKey(M(Z,T,Y))).offset)}var J=this,F=v.prototype._generateAttrToProjector.call(this),E=this._isVertical? "y":"x",L=this.length().scale,N=this.length().accessor,M=this.position().accessor,R=this._stackingResult();F[this._isVertical?"height":"width"]=x;F[E]=function(Z,T,Y){return J._isVertical?y(Z,T,Y):y(Z,T,Y)-x(Z,T,Y)};return F};z.prototype.getExtentsForProperty=function(y){return y===(this._isVertical?"y":"x")?[this._stackedExtent()]:v.prototype.getExtentsForProperty.call(this,y)};z.prototype.invalidateCache=function(){v.prototype.invalidateCache.call(this);this._measurer.reset()};return z}(q.Bar); d._EXTREMA_LABEL_MARGIN_FROM_BAR=5;f.StackedBar=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(0);d=h(27);var l=h(2);h=function(p){function n(){var q=p.call(this)||this;q._connectorsEnabled=!1;q.addClass("waterfall-plot");return q}m(n,p);n.prototype.connectorsEnabled=function(q){if(null==q)return this._connectorsEnabled;this._connectorsEnabled= q;return this};n.prototype.total=function(q){if(null==q)return this._propertyBindings.get(n._TOTAL_KEY);this._bindProperty(n._TOTAL_KEY,q,null);return this};n.prototype._additionalPaint=function(q){var t=this;this._connectorArea.selectAll("line").remove();this._connectorsEnabled&&w.Window.setTimeout(function(){return t._drawConnectors()},q)};n.prototype._createNodesForDataset=function(q){q=p.prototype._createNodesForDataset.call(this,q);this._connectorArea=this._renderArea.append("g").classed(n._CONNECTOR_AREA_CLASS, !0);return q};n.prototype.getExtentsForProperty=function(q){return"y"===q?[this._extent]:p.prototype.getExtentsForProperty.call(this,q)};n.prototype._generateAttrToProjector=function(){var q=this,t=p.prototype._generateAttrToProjector.call(this),v=this.y().scale,z=l.Plot._scaledAccessor(this.total());null==this.attr("y")&&(t.y=function(y,x,D){var G=q.y().accessor(y,x,D);if(z(y,x,D))return Math.min(v.scale(G),v.scale(0));y=q._subtotals[x];if(0===x)return 0>G?v.scale(y-G):v.scale(y);x=q._subtotals[x- 1];return y>x?v.scale(y):v.scale(x)});null==this.attr("height")&&(t.height=function(y,x,D){var G=z(y,x,D);y=q.y().accessor(y,x,D);if(G)return Math.abs(v.scale(y)-v.scale(0));G=q._subtotals[x];if(0===x)return Math.abs(v.scale(G)-v.scale(G-y));x=q._subtotals[x-1];return Math.abs(v.scale(G)-v.scale(x))});t["class"]=function(y,x,D){var G="";null!=q.attr("class")&&(G=q.attr("class").accessor(y,x,D)+" ");if(z(y,x,D))return G+n._BAR_TOTAL_CLASS;y=q.y().accessor(y,x,D);return G+(0<y?n._BAR_GROWTH_CLASS:n._BAR_DECLINE_CLASS)}; return t};n.prototype._onDatasetUpdate=function(){this._updateSubtotals();p.prototype._onDatasetUpdate.call(this);return this};n.prototype._calculateSubtotalsAndExtent=function(q){var t=this,v=Number.MAX_VALUE,z=Number.MIN_VALUE,y=0,x=!1;q.data().forEach(function(D,G){var J=t.y().accessor(D,G,q);(D=t.total().accessor(D,G,q))&&0!==G||(y+=J);t._subtotals.push(y);y<v&&(v=y);y>z&&(z=y);D&&(J<v&&(v=J),J>z&&(z=J));if(!x&&D){G=J-y;for(J=0;J<t._subtotals.length;J++)t._subtotals[J]+=G;x=!0;y+=G;v+=G;z+=G}}); this._extent=[v,z]};n.prototype._drawConnectors=function(){for(var q=this._getAttrToProjector(),t=this.datasets()[0],v=1;v<t.data().length;v++){var z=v-1,y=t.data()[v],x=t.data()[z];x=q.x(x,z,t);var D=q.x(y,v,t)+q.width(y,v,t),G=q.y(y,v,t);if(0<this._subtotals[v]&&this._subtotals[v]>this._subtotals[z]||0>this._subtotals[v]&&this._subtotals[v]>=this._subtotals[z])G=q.y(y,v,t)+q.height(y,v,t);this._connectorArea.append("line").classed(n._CONNECTOR_CLASS,!0).attr("x1",x).attr("x2",D).attr("y1",G).attr("y2", G)}};n.prototype._updateSubtotals=function(){var q=this.datasets();0<q.length&&(q=q[q.length-1],this._subtotals=[],this._calculateSubtotalsAndExtent(q))};return n}(d.Bar);h._BAR_DECLINE_CLASS="waterfall-decline";h._BAR_GROWTH_CLASS="waterfall-growth";h._BAR_TOTAL_CLASS="waterfall-total";h._CONNECTOR_CLASS="connector";h._CONNECTOR_AREA_CLASS="connector-area";h._TOTAL_KEY="total";f.Waterfall=h},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&& (p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(1),l=h(0);d=function(p){function n(q){var t=p.call(this)||this;switch(q){case null:case void 0:null==n._plottableColorCache&&(n._plottableColorCache=n._getPlottableColors());q=w.scaleOrdinal().range(n._plottableColorCache);break;case "Category10":case "category10":case "10":q=w.scaleOrdinal(w.schemeCategory10);break;case "Category20":case "category20":case "20":q=w.scaleOrdinal(w.schemeCategory20);break;case "Category20b":case "category20b":case "20b":q= w.scaleOrdinal(w.schemeCategory20b);break;case "Category20c":case "category20c":case "20c":q=w.scaleOrdinal(w.schemeCategory20c);break;default:throw Error("Unsupported ColorScale type");}t._d3Scale=q;return t}m(n,p);n.prototype.extentOfValues=function(q){return l.Array.uniq(q)};n.prototype._getExtent=function(){return l.Array.uniq(this._getAllIncludedValues())};n.invalidateColorCache=function(){n._plottableColorCache=null};n._getPlottableColors=function(){for(var q=[],t=w.select("body").append("plottable-color-tester"), v=l.Color.colorTest(t,""),z=0,y=l.Color.colorTest(t,"plottable-colors-0");null!=y&&z<this._MAXIMUM_COLORS_FROM_CSS&&(y!==v||y!==q[q.length-1]);)q.push(y),z++,y=l.Color.colorTest(t,"plottable-colors-"+z);t.remove();return q};n.prototype.scale=function(q){var t=this._d3Scale(q);q=this.domain().indexOf(q);q=Math.floor(q/this.range().length);return l.Color.lightenColor(t,Math.log(q*n._LOOP_LIGHTEN_FACTOR+1))};n.prototype._getDomain=function(){return this._backingScaleDomain()};n.prototype._backingScaleDomain= function(q){if(null==q)return this._d3Scale.domain();this._d3Scale.domain(q);return this};n.prototype._getRange=function(){return this._d3Scale.range()};n.prototype._setRange=function(q){this._d3Scale.range(q)};return n}(h(17).Scale);d._LOOP_LIGHTEN_FACTOR=1.6;d._MAXIMUM_COLORS_FROM_CSS=256;f.Color=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype, new q)},w=h(1),l=h(0);d=function(p){function n(q){void 0===q&&(q="linear");var t=p.call(this)||this;switch(q){case "linear":t._colorScale=w.scaleLinear();break;case "log":t._colorScale=w.scaleLog();break;case "sqrt":t._colorScale=w.scaleSqrt();break;case "pow":t._colorScale=w.scalePow()}if(null==t._colorScale)throw Error("unknown QuantitativeScale scale type "+q);t.range(n.REDS);return t}m(n,p);n.prototype.extentOfValues=function(q){q=w.extent(q);return null==q[0]||null==q[1]?[]:q};n.prototype._d3InterpolatedScale= function(){return this._colorScale.range([0,1]).interpolate(this._interpolateColors())};n.prototype._interpolateColors=function(){var q=this._colorRange;if(2>q.length)throw Error("Color scale arrays must have at least two elements.");return function(){return function(t){t=Math.max(0,Math.min(1,t));t*=q.length-1;var v=Math.floor(t),z=t-v;return w.interpolateLab(q[v],q[Math.ceil(t)])(z)}}};n.prototype._resetScale=function(){this._d3Scale=this._d3InterpolatedScale();this._autoDomainIfAutomaticMode(); this._dispatchUpdate()};n.prototype.autoDomain=function(){var q=this._getAllIncludedValues();0<q.length&&this._setDomain([l.Math.min(q,0),l.Math.max(q,0)])};n.prototype.scale=function(q){return this._d3Scale(q)};n.prototype._getDomain=function(){return this._backingScaleDomain()};n.prototype._backingScaleDomain=function(q){if(null==q)return this._d3Scale.domain();this._d3Scale.domain(q);return this};n.prototype._getRange=function(){return this._colorRange};n.prototype._setRange=function(q){this._colorRange= q;this._resetScale()};return n}(h(17).Scale);d.REDS="#FFFFFF #FFF6E1 #FEF4C0 #FED976 #FEB24C #FD8D3C #FC4E2A #E31A1C #B10026".split(" ");d.BLUES="#FFFFFF #CCFFFF #A5FFFD #85F7FB #6ED3EF #55A7E0 #417FD0 #2545D3 #0B02E1".split(" ");d.POSNEG="#0B02E1 #2545D3 #417FD0 #55A7E0 #6ED3EF #85F7FB #A5FFFD #CCFFFF #FFFFFF #FFF6E1 #FEF4C0 #FED976 #FEB24C #FD8D3C #FC4E2A #E31A1C #B10026".split(" ");f.InterpolatedColor=d},function(d,f,h){var m=this&&this.__extends||function(l,p){function n(){this.constructor=l} for(var q in p)p.hasOwnProperty(q)&&(l[q]=p[q]);l.prototype=null===p?Object.create(p):(n.prototype=p.prototype,new n)},w=h(1);d=function(l){function p(){var n=l.call(this)||this;n._d3Scale=w.scaleLinear();return n}m(p,l);p.prototype._defaultExtent=function(){return[0,1]};p.prototype._expandSingleValueDomain=function(n){return n[0]===n[1]?[n[0]-1,n[1]+1]:n};p.prototype.scale=function(n){return this._d3Scale(n)};p.prototype.scaleTransformation=function(n){return this.scale(n)};p.prototype.invertedTransformation= function(n){return this.invert(n)};p.prototype.getTransformationExtent=function(){return this._getUnboundedExtent(!0)};p.prototype.getTransformationDomain=function(){return this.domain()};p.prototype.setTransformationDomain=function(n){this.domain(n)};p.prototype._getDomain=function(){return this._backingScaleDomain()};p.prototype._backingScaleDomain=function(n){if(null==n)return this._d3Scale.domain();this._d3Scale.domain(n);return this};p.prototype._getRange=function(){return this._d3Scale.range()}; p.prototype._setRange=function(n){this._d3Scale.range(n)};p.prototype.invert=function(n){return this._d3Scale.invert(n)};p.prototype.defaultTicks=function(){return this._d3Scale.ticks()};p.prototype._niceDomain=function(n){return this._d3Scale.copy().domain(n).nice(void 0).domain()};return p}(h(11).QuantitativeScale);f.Linear=d},function(d,f,h){var m=this&&this.__extends||function(n,q){function t(){this.constructor=n}for(var v in q)q.hasOwnProperty(v)&&(n[v]=q[v]);n.prototype=null===q?Object.create(q): (t.prototype=q.prototype,new t)},w=h(1),l=h(0),p=h(3);d=function(n){function q(t){void 0===t&&(t=10);var v=n.call(this)||this;v._d3Scale=w.scaleLinear();v._base=t;v._pivot=v._base;v._setDomain(v._defaultExtent());if(1>=t)throw Error("ModifiedLogScale: The base must be \x3e 1");return v}m(q,n);q.prototype._adjustedLog=function(t){var v=0>t?-1:1;t*=v;t<this._pivot&&(t+=(this._pivot-t)/this._pivot);t=Math.log(t)/Math.log(this._base);return t*v};q.prototype._invertedAdjustedLog=function(t){var v=0>t? -1:1;t=Math.pow(this._base,t*v);t<this._pivot&&(t=this._pivot*(t-1)/(this._pivot-1));return t*v};q.prototype.scale=function(t){return this._d3Scale(this._adjustedLog(t))};q.prototype.invert=function(t){return this._invertedAdjustedLog(this._d3Scale.invert(t))};q.prototype.scaleTransformation=function(t){return this.scale(t)};q.prototype.invertedTransformation=function(t){return this.invert(t)};q.prototype.getTransformationExtent=function(){return this._getUnboundedExtent(!0)};q.prototype.getTransformationDomain= function(){return this.domain()};q.prototype.setTransformationDomain=function(t){this.domain(t)};q.prototype._getDomain=function(){return this._untransformedDomain};q.prototype._setDomain=function(t){this._untransformedDomain=t;n.prototype._setDomain.call(this,[this._adjustedLog(t[0]),this._adjustedLog(t[1])])};q.prototype._backingScaleDomain=function(t){if(null==t)return this._d3Scale.domain();this._d3Scale.domain(t);return this};q.prototype.ticks=function(){function t(J,F,E){return[J,F,E].sort(function(L, N){return L-N})[1]}var v=l.Math.min(this._untransformedDomain,0),z=l.Math.max(this._untransformedDomain,0),y=t(v,z,-this._pivot),x=t(v,z,this._pivot);y=this._logTicks(-y,-v).map(function(J){return-J}).reverse();x=this._logTicks(x,z);var D=Math.max(v,-this._pivot),G=Math.min(z,this._pivot);D=w.scaleLinear().domain([D,G]).ticks(this._howManyTicks(D,G));y=y.concat(D).concat(x);1>=y.length&&(y=w.scaleLinear().domain([v,z]).ticks());return y};q.prototype._logTicks=function(t,v){var z=this,y=this._howManyTicks(t, v);if(0===y)return[];var x=Math.floor(Math.log(t)/Math.log(this._base)),D=Math.ceil(Math.log(v)/Math.log(this._base));y=w.range(D,x,-Math.ceil((D-x)/y));x=w.range(this._base,1,-(this._base-1)).map(Math.floor);var G=l.Array.uniq(x);y=y.map(function(J){return G.map(function(F){return Math.pow(z._base,J-1)*F})});return l.Array.flatten(y).filter(function(J){return t<=J&&J<=v}).sort(function(J,F){return J-F})};q.prototype._howManyTicks=function(t,v){var z=this._adjustedLog(l.Math.min(this._untransformedDomain, 0)),y=this._adjustedLog(l.Math.max(this._untransformedDomain,0));return Math.ceil((this._adjustedLog(v)-this._adjustedLog(t))/(y-z)*p.ModifiedLog._DEFAULT_NUM_TICKS)};q.prototype._niceDomain=function(t){return t};q.prototype._defaultExtent=function(){return[0,this._base]};q.prototype._expandSingleValueDomain=function(t){return t[0]===t[1]?(t=t[0],0<t?[t/this._base,t*this._base]:0===t?[-this._base,this._base]:[t*this._base,t/this._base]):t};q.prototype._getRange=function(){return this._d3Scale.range()}; q.prototype._setRange=function(t){this._d3Scale.range(t)};q.prototype.defaultTicks=function(){return this._d3Scale.ticks()};return q}(h(11).QuantitativeScale);f.ModifiedLog=d},function(d,f,h){var m=h(0);f.intervalTickGenerator=function(w){if(0>=w)throw Error("interval must be positive number");return function(l){l=l.domain();var p=Math.min(l[0],l[1]);l=Math.max(l[0],l[1]);var n=Math.ceil(p/w)*w;p=0===p%w?[]:[p];var q=m.Math.range(0,Math.floor((l-n)/w)+1).map(function(t){return n+t*w});return p.concat(q).concat(0=== l%w?[]:[l])}};f.integerTickGenerator=function(){return function(w){var l=w.defaultTicks();return l.filter(function(p,n){return 0===p%1||0===n||n===l.length-1})}}},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&&(p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(1),l=h(28);d=function(p){function n(){var q=p.call(this)||this;q._d3Scale=w.scaleTime();q.autoDomain();return q}m(n,p);n.prototype.tickInterval= function(q,t){void 0===t&&(t=1);var v=w.scaleTime();n.timeIntervalToD3Time(q).every(t);v.domain(this.domain());v.range(this.range());return v.ticks()};n.prototype._setDomain=function(q){if(q[1]<q[0])throw Error("Scale.Time domain values must be in chronological order");return p.prototype._setDomain.call(this,q)};n.prototype._defaultExtent=function(){return[new Date("1970-01-01"),new Date("1970-01-02")]};n.prototype._expandSingleValueDomain=function(q){var t=q[0].getTime(),v=q[1].getTime();return t=== v?(q=new Date(t),q.setDate(q.getDate()-1),v=new Date(v),v.setDate(v.getDate()+1),[q,v]):q};n.prototype.scale=function(q){return this._d3Scale(q)};n.prototype.scaleTransformation=function(q){return this.scale(new Date(q))};n.prototype.invertedTransformation=function(q){return this.invert(q).getTime()};n.prototype.getTransformationExtent=function(){var q=this._getUnboundedExtent(!0);return[q[0].valueOf(),q[1].valueOf()]};n.prototype.getTransformationDomain=function(){var q=this.domain();return[q[0].valueOf(), q[1].valueOf()]};n.prototype.setTransformationDomain=function(q){this.domain([new Date(q[0]),new Date(q[1])])};n.prototype._getDomain=function(){return this._backingScaleDomain()};n.prototype._backingScaleDomain=function(q){if(null==q)return this._d3Scale.domain();this._d3Scale.domain(q);return this};n.prototype._getRange=function(){return this._d3Scale.range()};n.prototype._setRange=function(q){this._d3Scale.range(q)};n.prototype.invert=function(q){return this._d3Scale.invert(q)};n.prototype.defaultTicks= function(){return this._d3Scale.ticks()};n.prototype._niceDomain=function(q){return this._d3Scale.copy().domain(q).nice().domain()};n.timeIntervalToD3Time=function(q){switch(q){case l.TimeInterval.second:return w.timeSecond;case l.TimeInterval.minute:return w.timeMinute;case l.TimeInterval.hour:return w.timeHour;case l.TimeInterval.day:return w.timeDay;case l.TimeInterval.week:return w.timeWeek;case l.TimeInterval.month:return w.timeMonth;case l.TimeInterval.year:return w.timeYear;default:throw Error("TimeInterval specified does not exist: "+ q);}};return n}(h(11).QuantitativeScale);f.Time=d},function(d,f,h){var m=h(1),w=Array;f.add=function(l,p){if(l.length!==p.length)throw Error("attempted to add arrays of unequal length");return l.map(function(n,q){return l[q]+p[q]})};f.uniq=function(l){var p=m.set(),n=[];l.forEach(function(q){p.has(String(q))||(p.add(String(q)),n.push(q))});return n};f.flatten=function(l){return w.prototype.concat.apply([],l)};f.createFilledArray=function(l,p){for(var n=[],q=0;q<p;q++)n[q]="function"===typeof l?l(q): l;return n}},function(d,f){d=function(){function h(m,w,l){this.maxIndex=this.minIndex=this.exitIndex=this.entryIndex=m;this.bucketValue=w;this.maxValue=this.minValue=l}h.prototype.isInBucket=function(m){return m==this.bucketValue};h.prototype.addToBucket=function(m,w){m<this.minValue&&(this.minValue=m,this.minIndex=w);m>this.maxValue&&(this.maxValue=m,this.maxIndex=w);this.exitIndex=w};h.prototype.getUniqueIndices=function(){var m=[this.entryIndex,this.maxIndex,this.minIndex,this.exitIndex];return m.filter(function(w, l){return 0==l||w!=m[l-1]})};return h}();f.Bucket=d},function(d,f,h){var m=this&&this.__extends||function(w,l){function p(){this.constructor=w}for(var n in l)l.hasOwnProperty(n)&&(w[n]=l[n]);w.prototype=null===l?Object.create(l):(p.prototype=l.prototype,new p)};d=function(w){function l(){return null!==w&&w.apply(this,arguments)||this}m(l,w);l.prototype.callCallbacks=function(){for(var p=this,n=[],q=0;q<arguments.length;q++)n[q]=arguments[q];this.forEach(function(t){t.apply(p,n)});return this};return l}(h(58).Set); f.CallbackSet=d},function(d,f,h){function m(p){function n(v){v/=255;return.03928>=v?v/12.92:l.pow((v+.055)/1.055,2.4)}var q=w.rgb(p);p=n(q.r);var t=n(q.g);q=n(q.b);return.2126*p+.7152*t+.0722*q}var w=h(1),l=Math;f.contrast=function(p,n){p=m(p)+.05;n=m(n)+.05;return p>n?p/n:n/p};f.lightenColor=function(p,n){return w.color(p).brighter(n).rgb().toString()};f.colorTest=function(p,n){p.classed(n,!0);var q=p.style("background-color");if("transparent"===q)return null;q=/\((.+)\)/.exec(q);if(!q)return null; q=q[1].split(",").map(function(t){t=+t;var v=t.toString(16);return 16>t?"0"+v:v});if(4===q.length&&"00"===q[3])return null;q="#"+q.join("");p.classed(n,!1);return q}},function(d,f,h){var m=h(1),w=h(57);d=function(){function l(){this._entities=[];this._rtree=new w.RTree;this._tree=m.quadtree().x(function(p){return Math.floor(p.position.x)}).y(function(p){return Math.floor(p.position.y)})}l.prototype.addAll=function(p,n,q){(z=this._entities).push.apply(z,p);if(void 0!==q)for(q=w.RTreeBounds.bounds(q), z=0;z<p.length;z++){var t=p[z],v=w.RTreeBounds.entityBounds(n(t));w.RTreeBounds.isBoundsOverlapBounds(q,v)&&(this._tree.add(t),this._rtree.insert(v,t))}else for(this._tree.addAll(p),z=0;z<p.length;z++)t=p[z],v=w.RTreeBounds.entityBounds(n(t)),this._rtree.insert(v,t);var z};l.prototype.entityNearest=function(p){return this._tree.find(p.x,p.y)};l.prototype.entitiesInBounds=function(p){return this._rtree.intersect(w.RTreeBounds.entityBounds(p))};l.prototype.entitiesInXBounds=function(p){return this._rtree.intersectX(w.RTreeBounds.entityBounds(p))}; l.prototype.entitiesInYBounds=function(p){return this._rtree.intersectY(w.RTreeBounds.entityBounds(p))};l.prototype.entities=function(){return this._entities};return l}();f.EntityStore=d},function(d,f,h){var m=h(56);d=function(){function w(){"function"===typeof window.Map?this._es6Map=new window.Map:this._keyValuePairs=[]}w.prototype.set=function(l,p){if(m.isNaN(l))throw Error("NaN may not be used as a key to the Map");if(null!=this._es6Map)return this._es6Map.set(l,p),this;for(var n=0;n<this._keyValuePairs.length;n++)if(this._keyValuePairs[n].key=== l)return this._keyValuePairs[n].value=p,this;this._keyValuePairs.push({key:l,value:p});return this};w.prototype.get=function(l){if(null!=this._es6Map)return this._es6Map.get(l);for(var p=0;p<this._keyValuePairs.length;p++)if(this._keyValuePairs[p].key===l)return this._keyValuePairs[p].value};w.prototype.has=function(l){if(null!=this._es6Map)return this._es6Map.has(l);for(var p=0;p<this._keyValuePairs.length;p++)if(this._keyValuePairs[p].key===l)return!0;return!1};w.prototype.forEach=function(l,p){var n= this;null!=this._es6Map?this._es6Map.forEach(function(q,t){return l.call(p,q,t,n)},p):this._keyValuePairs.forEach(function(q){l.call(p,q.value,q.key,n)})};w.prototype.delete=function(l){if(null!=this._es6Map)return this._es6Map.delete(l);for(var p=0;p<this._keyValuePairs.length;p++)if(this._keyValuePairs[p].key===l)return this._keyValuePairs.splice(p,1),!0;return!1};return w}();f.Map=d},function(d,f){f.assign=function(){for(var h=[],m=0;m<arguments.length;m++)h[m]=arguments[m];m={};for(var w=0;w< h.length;w++)for(var l=h[w],p=0,n=Object.keys(l);p<n.length;p++){var q=n[p];m[q]=l[q]}return m}},function(d,f){d=function(){function h(){}h.prototype.split=function(m,w){for(var l=Math.ceil(m.length/2),p=0;p<l;p++)w[0].insert(m[p]);for(p=l;p<m.length;p++)w[1].insert(m[p])};return h}();f.SplitStrategyTrivial=d;d=function(){function h(){}h.prototype.split=function(m,w){m=m.slice();for(this.chooseFirstSplit(m,w);0<m.length;)this.addNext(m,w)};h.prototype.chooseFirstSplit=function(m,w){for(var l=0,p= 0,n=m.length-1,q=m.length-1,t=1;t<m.length-1;t++){var v=m[t];v.bounds.xl>m[n].bounds.xl?n=t:v.bounds.xh<m[l].bounds.xh&&(l=t);v.bounds.yl>m[q].bounds.yl?q=t:v.bounds.yh<m[p].bounds.yh&&(p=t)}p=Math.abs(m[l].bounds.xh-m[n].bounds.xl)>Math.abs(m[p].bounds.yh-m[q].bounds.yl)?[l,n]:[p,q];l=p[0];p=p[1];l===p&&(l=0,p=m.length-1);w[0].insert(m.splice(Math.max(l,p),1)[0]);w[1].insert(m.splice(Math.min(l,p),1)[0])};h.prototype.addNext=function(m,w){for(var l=null,p=null,n=null,q=0;q<m.length;q++){var t=m[q], v=w[0].unionAreaDifference(t.bounds);t=w[1].unionAreaDifference(t.bounds);if(v<p||null==l)l=q,p=v,n=w[0];t<p&&(l=q,p=t,n=w[1])}n.insert(m.splice(l,1)[0])};return h}();f.SplitStrategyLinear=d},function(d,f,h){var m=h(1),w=h(0);d=h(10);f.IStackingOrder=d.makeEnum(["topdown","bottomup"]);var l=Math;f.stack=function(p,n,q,t){void 0===t&&(t="bottomup");var v=m.map(),z=m.map(),y=new w.Map;"topdown"===t&&(p=p.slice(),p.reverse());p.forEach(function(x){var D=new w.Map;x.data().forEach(function(G,J){var F= String(n(G,J,x)),E=+q(G,J,x),L=0<=E?v:z;if(L.has(F)){var N=L.get(F);L.set(F,N+E)}else N=0,L.set(F,E);D.set(F,{offset:N,value:E,axisValue:n(G,J,x),originalDatum:G,originalDataset:x,originalIndex:J})});y.set(x,D)});return y};f.stackedExtents=function(p){var n=new w.Map,q=new w.Map;p.forEach(function(t){t.forEach(function(v,z){var y=w.Math.max([v.offset+v.value,v.offset],v.offset),x=w.Math.min([v.offset+v.value,v.offset],v.offset),D=v.axisValue;n.has(z)?n.get(z).extent<y&&n.set(z,{extent:y,axisValue:D, stackedDatum:v}):n.set(z,{extent:y,axisValue:D,stackedDatum:v});q.has(z)?q.get(z).extent>x&&q.set(z,{extent:x,axisValue:D,stackedDatum:v}):q.set(z,{extent:x,axisValue:D,stackedDatum:v})})});return{maximumExtents:n,minimumExtents:q}};f.stackedExtent=function(p,n,q){var t=[];p.forEach(function(z,y){y.data().forEach(function(x,D){if(null==q||q(x,D,y))x=z.get(String(n(x,D,y))),t.push(x.value+x.offset)})});p=w.Math.max(t,0);var v=w.Math.min(t,0);return[l.min(v,0),l.max(0,p)]};f.normalizeKey=function(p){return String(p)}}, function(d,f,h){var m=h(0);f.getTranslator=function(l){l=l.root().rootElement().node();var p=l.__Plottable_ClientTranslator;null==p&&(p=new w(l),l.__Plottable_ClientTranslator=p);return p};var w=function(){function l(p){this._rootElement=p}l.prototype.computePosition=function(p,n){p={x:p,y:n};n=m.Math.getCumulativeTransform(this._rootElement);return null==n?p:m.Math.applyTransform(n,p)};l.isEventInside=function(p,n){return m.DOM.contains(p.root().rootElement().node(),n.target)};return l}();f.Translator= w},function(d,f,h){Object.defineProperty(f,"__esModule",{value:!0});var m=h(124);h.d(f,"easeLinear",function(){return m.a});var w=h(126);h.d(f,"easeQuad",function(){return w.a});h.d(f,"easeQuadIn",function(){return w.b});h.d(f,"easeQuadOut",function(){return w.c});h.d(f,"easeQuadInOut",function(){return w.a});var l=h(121);h.d(f,"easeCubic",function(){return l.a});h.d(f,"easeCubicIn",function(){return l.b});h.d(f,"easeCubicOut",function(){return l.c});h.d(f,"easeCubicInOut",function(){return l.a}); var p=h(125);h.d(f,"easePoly",function(){return p.a});h.d(f,"easePolyIn",function(){return p.b});h.d(f,"easePolyOut",function(){return p.c});h.d(f,"easePolyInOut",function(){return p.a});var n=h(127);h.d(f,"easeSin",function(){return n.a});h.d(f,"easeSinIn",function(){return n.b});h.d(f,"easeSinOut",function(){return n.c});h.d(f,"easeSinInOut",function(){return n.a});var q=h(123);h.d(f,"easeExp",function(){return q.a});h.d(f,"easeExpIn",function(){return q.b});h.d(f,"easeExpOut",function(){return q.c}); h.d(f,"easeExpInOut",function(){return q.a});var t=h(120);h.d(f,"easeCircle",function(){return t.a});h.d(f,"easeCircleIn",function(){return t.b});h.d(f,"easeCircleOut",function(){return t.c});h.d(f,"easeCircleInOut",function(){return t.a});var v=h(119);h.d(f,"easeBounce",function(){return v.a});h.d(f,"easeBounceIn",function(){return v.b});h.d(f,"easeBounceOut",function(){return v.a});h.d(f,"easeBounceInOut",function(){return v.c});var z=h(118);h.d(f,"easeBack",function(){return z.a});h.d(f,"easeBackIn", function(){return z.b});h.d(f,"easeBackOut",function(){return z.c});h.d(f,"easeBackInOut",function(){return z.a});var y=h(122);h.d(f,"easeElastic",function(){return y.a});h.d(f,"easeElasticIn",function(){return y.b});h.d(f,"easeElasticOut",function(){return y.a});h.d(f,"easeElasticInOut",function(){return y.c})},function(d,f,h){h.d(f,"b",function(){return m});h.d(f,"c",function(){return w});h.d(f,"a",function(){return l});var m=function q(n){function t(v){return v*v*((n+1)*v-n)}n=+n;t.overshoot=q; return t}(1.70158),w=function t(q){function v(z){return--z*z*((q+1)*z+q)+1}q=+q;v.overshoot=t;return v}(1.70158),l=function v(t){function z(y){return(1>(y*=2)?y*y*((t+1)*y-t):(y-=2)*y*((t+1)*y+t)+2)/2}t=+t;z.overshoot=v;return z}(1.70158)},function(d,f){function h(x){return(x=+x)<m?y*x*x:x<l?y*(x-=w)*x+p:x<q?y*(x-=n)*x+t:y*(x-=v)*x+z}f.b=function(x){return 1-h(1-x)};f.a=h;f.c=function(x){return(1>=(x*=2)?1-h(1-x):h(x-1)+1)/2};var m=4/11,w=6/11,l=8/11,p=.75,n=9/11,q=10/11,t=.9375,v=21/22,z=.984375, y=1/m/m},function(d,f){f.b=function(h){return 1-Math.sqrt(1-h*h)};f.c=function(h){return Math.sqrt(1- --h*h)};f.a=function(h){return(1>=(h*=2)?1-Math.sqrt(1-h*h):Math.sqrt(1-(h-=2)*h)+1)/2}},function(d,f){f.b=function(h){return h*h*h};f.c=function(h){return--h*h*h+1};f.a=function(h){return(1>=(h*=2)?h*h*h:(h-=2)*h*h+2)/2}},function(d,f,h){h.d(f,"b",function(){return w});h.d(f,"a",function(){return l});h.d(f,"c",function(){return p});var m=2*Math.PI,w=function v(q,t){function z(x){return q*Math.pow(2, 10*--x)*Math.sin((y-x)/t)}var y=Math.asin(1/(q=Math.max(1,q)))*(t/=m);z.amplitude=function(x){return v(x,t*m)};z.period=function(x){return v(q,x)};return z}(1,.3),l=function z(t,v){function y(D){return 1-t*Math.pow(2,-10*(D=+D))*Math.sin((D+x)/v)}var x=Math.asin(1/(t=Math.max(1,t)))*(v/=m);y.amplitude=function(D){return z(D,v*m)};y.period=function(D){return z(t,D)};return y}(1,.3),p=function y(v,z){function x(G){return(0>(G=2*G-1)?v*Math.pow(2,10*G)*Math.sin((D-G)/z):2-v*Math.pow(2,-10*G)*Math.sin((D+ G)/z))/2}var D=Math.asin(1/(v=Math.max(1,v)))*(z/=m);x.amplitude=function(G){return y(G,z*m)};x.period=function(G){return y(v,G)};return x}(1,.3)},function(d,f){f.b=function(h){return Math.pow(2,10*h-10)};f.c=function(h){return 1-Math.pow(2,-10*h)};f.a=function(h){return(1>=(h*=2)?Math.pow(2,10*h-10):2-Math.pow(2,10-10*h))/2}},function(d,f){f.a=function(h){return+h}},function(d,f,h){h.d(f,"b",function(){return m});h.d(f,"c",function(){return w});h.d(f,"a",function(){return l});var m=function q(n){function t(v){return Math.pow(v, n)}n=+n;t.exponent=q;return t}(3),w=function t(q){function v(z){return 1-Math.pow(1-z,q)}q=+q;v.exponent=t;return v}(3),l=function v(t){function z(y){return(1>=(y*=2)?Math.pow(y,t):2-Math.pow(2-y,t))/2}t=+t;z.exponent=v;return z}(3)},function(d,f){f.b=function(h){return h*h};f.c=function(h){return h*(2-h)};f.a=function(h){return(1>=(h*=2)?h*h:--h*(2-h)+1)/2}},function(d,f){f.b=function(w){return 1-Math.cos(w*m)};f.c=function(w){return Math.sin(w*m)};f.a=function(w){return(1-Math.cos(h*w))/2};var h= Math.PI,m=h/2},function(d,f,h){function m(l){return!0===w(l)&&"[object Object]"===Object.prototype.toString.call(l)}var w=h(129);d.exports=function(l){if(!1===m(l))return!1;l=l.constructor;if("function"!==typeof l)return!1;l=l.prototype;return!1===m(l)||!1===l.hasOwnProperty("isPrototypeOf")?!1:!0}},function(d){d.exports=function(f){return null!=f&&"object"===typeof f&&!1===Array.isArray(f)}},function(d,f){d=function(){function h(m,w,l){void 0===w&&(w=10);void 0===l&&(l={});var p=this;this.ctx=m; this.lineHeight=w;this.style=l;this.createRuler=function(){return function(n){p.ctx.font=p.style.font;return{width:p.ctx.measureText(n).width,height:p.lineHeight}}};this.createPen=function(n,q,t){null==t&&(t=p.ctx);t.save();t.translate(q.translate[0],q.translate[1]);t.rotate(q.rotate*Math.PI/180);return p.createCanvasPen(t)};void 0===this.style.fill&&(this.style.fill="#444")}h.prototype.createCanvasPen=function(m){var w=this;return{destroy:function(){m.restore()},write:function(l,p,n,q){m.textAlign= p;null!=w.style.font&&(m.font=w.style.font);null!=w.style.fill&&(m.fillStyle=w.style.fill,m.fillText(l,n,q));null!=w.style.stroke&&(m.strokeStyle=w.style.fill,m.strokeText(l,n,q))}}};return h}();f.CanvasContext=d},function(d,f){var h=function(){function m(){}m.append=function(w,l){for(var p=[],n=2;n<arguments.length;n++)p[n-2]=arguments[n];p=m.create.apply(m,[l].concat(p));w.appendChild(p);return p};m.create=function(w){for(var l=[],p=1;p<arguments.length;p++)l[p-1]=arguments[p];p=document.createElementNS(m.SVG_NS, w);m.addClasses.apply(m,[p].concat(l));return p};m.addClasses=function(w){for(var l=[],p=1;p<arguments.length;p++)l[p-1]=arguments[p];l=l.filter(function(n){return null!=n});null!=w.classList?l.forEach(function(n){w.classList.add(n)}):w.setAttribute("class",l.join(" "))};m.getDimensions=function(w){if(w.getBBox)try{var l=w.getBBox();return{width:l.width,height:l.height}}catch(p){}return{height:0,width:0}};return m}();h.SVG_NS="http://www.w3.org/2000/svg";f.SvgUtils=h;d=function(){function m(w,l,p){void 0=== p&&(p=!1);var n=this;this.element=w;this.className=l;this.addTitleElement=p;this.createRuler=function(){var q=n.getTextElements(n.element),t=q.parentElement,v=q.containerElement,z=q.textElement;return function(y){t.appendChild(v);z.textContent=y;y=h.getDimensions(z);t.removeChild(v);return y}};this.createPen=function(q,t,v){null==v&&(v=n.element);v=h.append(v,"g","text-container",n.className);n.addTitleElement&&(h.append(v,"title").textContent=q,v.setAttribute("title",q));q=h.append(v,"g","text-area"); q.setAttribute("transform","translate("+t.translate[0]+","+t.translate[1]+")"+("rotate("+t.rotate+")"));return n.createSvgLinePen(q)}}m.prototype.setAddTitleElement=function(w){this.addTitleElement=w};m.prototype.createSvgLinePen=function(w){return{write:function(l,p,n,q){var t=h.append(w,"text","text-line");t.textContent=l;t.setAttribute("text-anchor",p);t.setAttribute("transform","translate("+n+","+q+")");t.setAttribute("y","-0.25em")}}};m.prototype.getTextElements=function(w){if("text"===w.tagName){var l= w.parentElement;null==l&&(l=w.parentNode);l.removeChild(w);return{containerElement:w,parentElement:l,textElement:w}}var p=w.querySelector("text");if(null!=p)return l=w.parentElement,null==l&&(l=w.parentNode),l.removeChild(w),{containerElement:w,parentElement:l,textElement:p};l=h.create("text",this.className);return{containerElement:l,parentElement:w,textElement:l}};return m}();f.SvgContext=d},function(d,f,h){var m=this&&this.__extends||function(p,n){function q(){this.constructor=p}for(var t in n)n.hasOwnProperty(t)&& (p[t]=n[t]);p.prototype=null===n?Object.create(n):(q.prototype=n.prototype,new q)},w=h(21),l=h(36);d=function(p){function n(q){var t=p.call(this,q)||this;t.dimCache=new w.Cache(function(v){return t._measureNotFromCache(v)});return t}m(n,p);n.prototype._measureNotFromCache=function(q){return p.prototype.measure.call(this,q)};n.prototype.measure=function(q){void 0===q&&(q=l.AbstractMeasurer.HEIGHT_TEXT);return this.dimCache.get(q)};n.prototype.reset=function(){this.dimCache.clear();p.prototype.reset.call(this)}; return n}(h(60).CacheCharacterMeasurer);f.CacheMeasurer=d},function(d,f,h){var m=h(59),w=h(62),l=h(64),p=h(66);d=function(){function n(q){this.context=q;this.measurer=new w.CacheMeasurer(this.context);this.wrapper=new l.Wrapper;this.writer=new p.Writer(this.measurer,this.context,this.wrapper)}n.svg=function(q,t,v){return new n(new m.SvgContext(q,t,v))};n.canvas=function(q,t,v){return new n(new m.CanvasContext(q,t,v))};n.prototype.write=function(q,t,v,z,y){this.writer.write(q,t,v,z,y)};n.prototype.clearMeasurerCache= function(){this.measurer.reset()};return n}();f.Typesetter=d},function(d,f){d=function(){function h(m){this.cache={};this.compute=m}h.prototype.get=function(m){this.cache.hasOwnProperty(m)||(this.cache[m]=this.compute(m));return this.cache[m]};h.prototype.clear=function(){this.cache={};return this};return h}();f.Cache=d},function(d,f){f.Methods=function(){function h(){}h.arrayEq=function(m,w){if(null==m||null==w)return m===w;if(m.length!==w.length)return!1;for(var l=0;l<m.length;l++)if(m[l]!==w[l])return!1; return!0};h.objEq=function(m,w){if(null==m||null==w)return m===w;var l=Object.keys(m).sort(),p=Object.keys(w).sort(),n=l.map(function(t){return m[t]}),q=p.map(function(t){return w[t]});return h.arrayEq(l,p)&&h.arrayEq(n,q)};h.strictEq=function(m,w){return m===w};h.defaults=function(m){for(var w=[],l=1;l<arguments.length;l++)w[l-1]=arguments[l];if(null==m)throw new TypeError("Cannot convert undefined or null to object");var p=Object(m);w.forEach(function(n){if(null!=n)for(var q in n)Object.prototype.hasOwnProperty.call(n, q)&&(p[q]=n[q])});return p};return h}()},function(d,f){f.StringMethods=function(){function h(){}h.combineWhitespace=function(m){return m.replace(/[ \t]+/g," ")};h.isNotEmptyString=function(m){return m&&""!==m.trim()};h.trimStart=function(m,w){if(!m)return m;m=m.split("");var l=w?function(p){return p.split(w).some(h.isNotEmptyString)}:h.isNotEmptyString;return m.reduce(function(p,n){return l(p+n)?p+n:p},"")};h.trimEnd=function(m,w){if(!m)return m;m=m.split("");m.reverse();m=h.trimStart(m.join(""), w).split("");m.reverse();return m.join("")};return h}()},function(d,f){d=function(){function h(){this.WordDividerRegExp=/\W/;this.WhitespaceRegExp=/\s/}h.prototype.tokenize=function(m){var w=this;return m.split("").reduce(function(l,p){return l.slice(0,-1).concat(w.shouldCreateNewToken(l[l.length-1],p))},[""])};h.prototype.shouldCreateNewToken=function(m,w){if(!m)return[w];var l=m[m.length-1];return this.WhitespaceRegExp.test(l)&&this.WhitespaceRegExp.test(w)?[m+w]:this.WhitespaceRegExp.test(l)|| this.WhitespaceRegExp.test(w)?[m,w]:this.WordDividerRegExp.test(l)||this.WordDividerRegExp.test(w)?l===w?[m+w]:[m,w]:[m+w]};return h}();f.Tokenizer=d},function(d,f,h){var m=this&&this.__extends||function(w,l){function p(){this.constructor=w}for(var n in l)l.hasOwnProperty(n)&&(w[n]=l[n]);w.prototype=null===l?Object.create(l):(p.prototype=l.prototype,new p)};d=function(w){function l(){return w.apply(this,arguments)||this}m(l,w);l.prototype.wrap=function(p,n,q,t){void 0===t&&(t=Infinity);if(1<p.split("\n").length)throw Error("SingleLineWrapper is designed to work only on single line"); var v=w.prototype.wrap.call(this,p,n,q,t);if(2>v.noLines)return v;for(var z=0,y=0;y<l.NO_WRAP_ITERATIONS&&q>z;++y){var x=(q+z)/2,D=w.prototype.wrap.call(this,p,n,x,t);this.areSameResults(v,D)?(q=x,v=D):z=x}return v};l.prototype.areSameResults=function(p,n){return p.noLines===n.noLines&&p.truncatedText===n.truncatedText};return l}(h(65).Wrapper);d.NO_WRAP_ITERATIONS=5;f.SingleLineWrapper=d},function(d,f,h){var m=h(21),w={textRotation:0,textShear:0,xAlign:"left",yAlign:"top"};d=function(){function l(p, n,q){this._measurer=p;this._penFactory=n;this._wrapper=q}l.prototype.measurer=function(p){this._measurer=p;return this};l.prototype.wrapper=function(p){this._wrapper=p;return this};l.prototype.penFactory=function(p){this._penFactory=p;return this};l.prototype.write=function(p,n,q,t,v){void 0===t&&(t={});t=m.Methods.defaults({},w,t);if(-1===l.SupportedRotation.indexOf(t.textRotation))throw Error("unsupported rotation - "+t.textRotation+". Supported rotations are "+l.SupportedRotation.join(", "));if(null!= t.textShear&&-80>t.textShear||80<t.textShear)throw Error("unsupported shear angle - "+t.textShear+". Must be between -80 and 80");var z=45<Math.abs(Math.abs(t.textRotation)-90),y=z?n:q,x=z?q:n,D=t.textShear,G=D*Math.PI/180;z=this._measurer.measure().height;var J=z*Math.tan(G);y=y/Math.cos(G)-Math.abs(J);var F=x*Math.cos(G);x=m.StringMethods.combineWhitespace(p);x=(this._wrapper?this._wrapper.wrap(x,this._measurer,y,F).wrappedText:x).split("\n");G=l.XOffsetFactor[t.xAlign]*y*Math.sin(G)-l.YOffsetFactor[t.yAlign]* (F-x.length*z);D=t.textRotation+D;switch(t.textRotation){case 90:n=[n+G,0];break;case -90:n=[-G,q];break;case 180:n=[n,q+G];break;default:n=[0,-G]}p=this._penFactory.createPen(p,{translate:n,rotate:D},v);this.writeLines(x,p,y,z,J,t.xAlign);null!=p.destroy&&p.destroy()};l.prototype.writeLines=function(p,n,q,t,v,z){p.forEach(function(y,x){n.write(y,l.AnchorConverter[z],(0<v?(x+1)*v:x*v)+q*l.XOffsetFactor[z],(x+1)*t)})};return l}();d.SupportedRotation=[-90,0,180,90];d.AnchorConverter={center:"middle", left:"start",right:"end"};d.XOffsetFactor={center:.5,left:0,right:1};d.YOffsetFactor={bottom:1,center:.5,top:0};f.Writer=d},function(d,f,h){function m(w){for(var l in w)f.hasOwnProperty(l)||(f[l]=w[l])}h(69);d=h(7);f.Animators=d;d=h(67);f.Axes=d;d=h(37);f.Components=d;d=h(23);f.Configs=d;d=h(8);f.Formatters=d;d=h(30);f.RenderController=d;d=h(39);f.RenderPolicies=d;d=h(31);f.SymbolFactories=d;d=h(13);f.Dispatchers=d;d=h(14);f.Drawers=d;d=h(25);f.Interactions=d;d=h(19);f.Plots=d;d=h(3);f.Scales=d;d= h(0);f.Utils=d;m(h(22));d=h(28);f.TimeInterval=d.TimeInterval;m(h(4));m(h(29));m(h(38));d=h(68);f.version=d.version;m(h(24));m(h(6));m(h(15));m(h(40));m(h(16));m(h(2));m(h(11));m(h(17))}])}"object"===typeof exports&&"object"===typeof module?module.exports=vj(require("d3")):"function"===typeof define&&define.amd?define(["d3"],vj):"object"===typeof exports?exports.Plottable=vj(require("d3")):this.Plottable=vj(this.d3); </script> <style> .plottable-colors-0 { background-color: #5279c7; /* INDIGO */ } .plottable-colors-1 { background-color: #fd373e; /* CORAL_RED */ } .plottable-colors-2 { background-color: #63c261; /* FERN */ } .plottable-colors-3 { background-color: #fad419; /* BRIGHT_SUN */ } .plottable-colors-4 { background-color: #2c2b6f; /* JACARTA */ } .plottable-colors-5 { background-color: #ff7939; /* BURNING_ORANGE */ } .plottable-colors-6 { background-color: #db2e65; /* CERISE_RED */ } .plottable-colors-7 { background-color: #99ce50; /* CONIFER */ } .plottable-colors-8 { background-color: #962565; /* ROYAL_HEATH */ } .plottable-colors-9 { background-color: #06cccc; /* ROBINS_EGG_BLUE */ } /** * User-supplied renderTo element. */ .plottable { display: block; /* must be block elements for width/height calculations to work in Firefox. */ pointer-events: visibleFill; position: relative; /** * Pre 3.0, users could set the dimension of the root element in two ways: either using CSS * (inline or through a stylesheet), or using the SVG width/height attributes. By default, we * set the SVG width/height attributes to 100%. * * Post 3.0 the root element is always a normal div and the only way to set the dimensions is * to use CSS. To replicate the "100%-by-default" behavior, we apply width/height 100%. */ width: 100%; height: 100%; } /** * The _element that roots each Component's DOM. */ .plottable .component { /* Allow components to be positioned with explicit left/top/width/height styles */ position: absolute; } .plottable .background-container, .plottable .content, .plottable .foreground-container { position: absolute; width: 100%; height: 100%; } /** * Don't allow svg elements above the content to steal events */ .plottable .foreground-container { pointer-events: none; } .plottable .component-overflow-hidden { overflow: hidden; } .plottable .component-overflow-visible { overflow: visible; } .plottable .plot-canvas-container { width: 100%; height: 100%; overflow: hidden; } .plottable .plot-canvas { width: 100%; height: 100%; /** * Play well with deferred rendering. */ transform-origin: 0px 0px 0px; } .plottable text { text-rendering: geometricPrecision; } .plottable .label text { font-family: "Helvetica Neue", sans-serif; fill: #32313F; } .plottable .bar-label-text-area text { font-family: "Helvetica Neue", sans-serif; font-size: 12px; } .plottable .label-area text { fill: #32313F; font-family: "Helvetica Neue", sans-serif; font-size: 14px; } .plottable .light-label text { fill: white; } .plottable .dark-label text { fill: #32313F; } .plottable .off-bar-label text { fill: #32313F; } .plottable .stacked-bar-label text { fill: #32313F; font-style: normal; } .plottable .stacked-bar-plot .off-bar-label { /* HACKHACK #2795: correct off-bar label logic to be implemented on StackedBar */ visibility: hidden !important; } .plottable .axis-label text { font-size: 10px; font-weight: bold; letter-spacing: 1px; line-height: normal; text-transform: uppercase; } .plottable .title-label text { font-size: 20px; font-weight: bold; } .plottable .axis line.baseline { stroke: #CCC; stroke-width: 1px; } .plottable .axis line.tick-mark { stroke: #CCC; stroke-width: 1px; } .plottable .axis text { fill: #32313F; font-family: "Helvetica Neue", sans-serif; font-size: 12px; font-weight: 200; line-height: normal; } .plottable .axis .annotation-circle { fill: white; stroke-width: 1px; stroke: #CCC; } .plottable .axis .annotation-line { stroke: #CCC; stroke-width: 1px; } .plottable .axis .annotation-rect { stroke: #CCC; stroke-width: 1px; fill: white; } .plottable .bar-plot .baseline { stroke: #999; } .plottable .gridlines line { stroke: #3C3C3C; /* hackhack: gridlines should be solid; see #820 */ opacity: 0.25; stroke-width: 1px; } .plottable .selection-box-layer .selection-area { fill: black; fill-opacity: 0.03; stroke: #CCC; } /* DragBoxLayer */ .plottable .drag-box-layer.x-resizable .drag-edge-lr { cursor: ew-resize; } .plottable .drag-box-layer.y-resizable .drag-edge-tb { cursor: ns-resize; } .plottable .drag-box-layer.x-resizable.y-resizable .drag-corner-tl { cursor: nwse-resize; } .plottable .drag-box-layer.x-resizable.y-resizable .drag-corner-tr { cursor: nesw-resize; } .plottable .drag-box-layer.x-resizable.y-resizable .drag-corner-bl { cursor: nesw-resize; } .plottable .drag-box-layer.x-resizable.y-resizable .drag-corner-br { cursor: nwse-resize; } .plottable .drag-box-layer.movable .selection-area { cursor: move; /* IE fallback */ cursor: -moz-grab; cursor: -webkit-grab; cursor: grab; } .plottable .drag-box-layer.movable .selection-area:active { cursor: -moz-grabbing; cursor: -webkit-grabbing; cursor: grabbing; } /* /DragBoxLayer */ .plottable .guide-line-layer line.guide-line { stroke: #CCC; stroke-width: 1px; } .plottable .drag-line-layer.enabled.vertical line.drag-edge { cursor: ew-resize; } .plottable .drag-line-layer.enabled.horizontal line.drag-edge { cursor: ns-resize; } .plottable .legend text { fill: #32313F; font-family: "Helvetica Neue", sans-serif; font-size: 12px; font-weight: bold; line-height: normal; } .plottable .interpolated-color-legend rect.swatch-bounding-box { fill: none; stroke: #CCC; stroke-width: 1px; pointer-events: none; } .plottable .waterfall-plot line.connector { stroke: #CCC; stroke-width: 1px; } .plottable .pie-plot .arc.outline { stroke-linejoin: round; } </style> <dom-module id="plottable-style"> <template> <style> .plottable-colors-0 { background-color: #5279c7; /* INDIGO */ } .plottable-colors-1 { background-color: #fd373e; /* CORAL_RED */ } .plottable-colors-2 { background-color: #63c261; /* FERN */ } .plottable-colors-3 { background-color: #fad419; /* BRIGHT_SUN */ } .plottable-colors-4 { background-color: #2c2b6f; /* JACARTA */ } .plottable-colors-5 { background-color: #ff7939; /* BURNING_ORANGE */ } .plottable-colors-6 { background-color: #db2e65; /* CERISE_RED */ } .plottable-colors-7 { background-color: #99ce50; /* CONIFER */ } .plottable-colors-8 { background-color: #962565; /* ROYAL_HEATH */ } .plottable-colors-9 { background-color: #06cccc; /* ROBINS_EGG_BLUE */ } /** * User-supplied renderTo element. */ .plottable { display: block; /* must be block elements for width/height calculations to work in Firefox. */ pointer-events: visibleFill; position: relative; /** * Pre 3.0, users could set the dimension of the root element in two ways: either using CSS * (inline or through a stylesheet), or using the SVG width/height attributes. By default, we * set the SVG width/height attributes to 100%. * * Post 3.0 the root element is always a normal div and the only way to set the dimensions is * to use CSS. To replicate the "100%-by-default" behavior, we apply width/height 100%. */ width: 100%; height: 100%; } /** * The _element that roots each Component's DOM. */ .plottable .component { /* Allow components to be positioned with explicit left/top/width/height styles */ position: absolute; } .plottable .background-container, .plottable .content, .plottable .foreground-container { position: absolute; width: 100%; height: 100%; } /** * Don't allow svg elements above the content to steal events */ .plottable .foreground-container { pointer-events: none; } .plottable .component-overflow-hidden { overflow: hidden; } .plottable .component-overflow-visible { overflow: visible; } .plottable .plot-canvas-container { width: 100%; height: 100%; overflow: hidden; } .plottable .plot-canvas { width: 100%; height: 100%; /** * Play well with deferred rendering. */ transform-origin: 0px 0px 0px; } .plottable text { text-rendering: geometricPrecision; } .plottable .label text { font-family: "Helvetica Neue", sans-serif; fill: #32313F; } .plottable .bar-label-text-area text { font-family: "Helvetica Neue", sans-serif; font-size: 12px; } .plottable .label-area text { fill: #32313F; font-family: "Helvetica Neue", sans-serif; font-size: 14px; } .plottable .light-label text { fill: white; } .plottable .dark-label text { fill: #32313F; } .plottable .off-bar-label text { fill: #32313F; } .plottable .stacked-bar-label text { fill: #32313F; font-style: normal; } .plottable .stacked-bar-plot .off-bar-label { /* HACKHACK #2795: correct off-bar label logic to be implemented on StackedBar */ visibility: hidden !important; } .plottable .axis-label text { font-size: 10px; font-weight: bold; letter-spacing: 1px; line-height: normal; text-transform: uppercase; } .plottable .title-label text { font-size: 20px; font-weight: bold; } .plottable .axis line.baseline { stroke: #CCC; stroke-width: 1px; } .plottable .axis line.tick-mark { stroke: #CCC; stroke-width: 1px; } .plottable .axis text { fill: #32313F; font-family: "Helvetica Neue", sans-serif; font-size: 12px; font-weight: 200; line-height: normal; } .plottable .axis .annotation-circle { fill: white; stroke-width: 1px; stroke: #CCC; } .plottable .axis .annotation-line { stroke: #CCC; stroke-width: 1px; } .plottable .axis .annotation-rect { stroke: #CCC; stroke-width: 1px; fill: white; } .plottable .bar-plot .baseline { stroke: #999; } .plottable .gridlines line { stroke: #3C3C3C; /* hackhack: gridlines should be solid; see #820 */ opacity: 0.25; stroke-width: 1px; } .plottable .selection-box-layer .selection-area { fill: black; fill-opacity: 0.03; stroke: #CCC; } /* DragBoxLayer */ .plottable .drag-box-layer.x-resizable .drag-edge-lr { cursor: ew-resize; } .plottable .drag-box-layer.y-resizable .drag-edge-tb { cursor: ns-resize; } .plottable .drag-box-layer.x-resizable.y-resizable .drag-corner-tl { cursor: nwse-resize; } .plottable .drag-box-layer.x-resizable.y-resizable .drag-corner-tr { cursor: nesw-resize; } .plottable .drag-box-layer.x-resizable.y-resizable .drag-corner-bl { cursor: nesw-resize; } .plottable .drag-box-layer.x-resizable.y-resizable .drag-corner-br { cursor: nwse-resize; } .plottable .drag-box-layer.movable .selection-area { cursor: move; /* IE fallback */ cursor: -moz-grab; cursor: -webkit-grab; cursor: grab; } .plottable .drag-box-layer.movable .selection-area:active { cursor: -moz-grabbing; cursor: -webkit-grabbing; cursor: grabbing; } /* /DragBoxLayer */ .plottable .guide-line-layer line.guide-line { stroke: #CCC; stroke-width: 1px; } .plottable .drag-line-layer.enabled.vertical line.drag-edge { cursor: ew-resize; } .plottable .drag-line-layer.enabled.horizontal line.drag-edge { cursor: ns-resize; } .plottable .legend text { fill: #32313F; font-family: "Helvetica Neue", sans-serif; font-size: 12px; font-weight: bold; line-height: normal; } .plottable .interpolated-color-legend rect.swatch-bounding-box { fill: none; stroke: #CCC; stroke-width: 1px; pointer-events: none; } .plottable .waterfall-plot line.connector { stroke: #CCC; stroke-width: 1px; } .plottable .pie-plot .arc.outline { stroke-linejoin: round; } </style> </template> </dom-module> <script>//~~WEBPATH~~/facets-overview/common/feature_statistics_generator.js /* Copyright 2017 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ class wj{constructor(){this.vals=[];this.counts=[]}}function xj(b){const d=new De;b.forEach(f=>{const h=yj(f.data);h.setName(f.name);Ig(d).push(h)});return d} function yj(b){const d={};if(null==b)return new He;b.forEach((f,h)=>{if(null!=f){var m=Object.keys(f),w={};for(let l=0;l<m.length;l++){const p=m[l],n=f[p];w[p]=!0;p in d||(d[p]=new wj,d[p].missing=h,d[p].counts=[]);"number"===typeof n||"string"===typeof n?(d[p].vals.push(n),d[p].counts.push(1)):n instanceof Array&&(d[p].counts.push(n.length),d[p].vals.push(...n))}Object.keys(d).forEach(l=>{l in w||(d[l].missing+=1)})}});Object.keys(d).forEach(f=>{let h=0,m=0,w=!1;d[f].vals.forEach(l=>{"string"=== typeof l?h+=1:(m+=1,w=w||!(l===+l&&l===(l|0)))});d[f].type=m>h?w?1:0:2});return zj(d,b.length)}function zj(b,d){const f=new He;Wd(f,2,d);for(const m in b){if(!b.hasOwnProperty(m))continue;const w=new uf;Qg(f).push(w);var h=b[m];w.setName(m);w.setType(h.type);1===h.type||0===h.type?(h=Aj(h.vals,h.counts,d,h.missing),ye(w,3,wf[1],h)):2===h.type&&(h=Bj(h.vals,h.counts,d,h.missing),ye(w,4,wf[1],h))}return f} function Aj(b,d,f,h){const m=new Af;m.setCommonStats(Cj(d,f,h));let w=0,l=0,p=0;d=b.filter(v=>"number"===typeof v&&!isNaN(v)).map(v=>+v).sort((v,z)=>v-z);0<d.length&&(Yd(m,5,d[0]),Yd(m,7,d[d.length-1]),f=Math.floor(d.length/2),m.setMedian(0!==d.length%2?d[f]:(d[f]+d[f-1])/2));d.forEach(v=>{0===v&&(p+=1);w+=v;l+=v*v});1<d.length&&m.setStdDev(Math.sqrt((l-w*w/d.length)/(d.length-1)));m.setMean(w/b.length);Wd(m,4,p);b=d.filter(v=>Infinity!==v&&-Infinity!==v);f=d.filter(v=>Infinity===v).length;h=d.filter(v=> -Infinity===v).length;var n=b[0];const q=b[b.length-1];n=d3.range(n,q,(q-n)/10);n=d3.histogram().thresholds(n)(b);let t=m.addHistograms();t.setType(0);n.forEach(v=>{const z=t.addBuckets();z.setSampleCount(v.length);fj(z,v.x0);gj(z,v.x1)});n=t.getBucketsList();d.length&&-Infinity===d[0]&&(fj(n[0],-Infinity),n[0].setSampleCount(n[0].getSampleCount()+h));d.length&&Infinity===d[d.length-1]&&(gj(n[n.length-1],Infinity),n[n.length-1].setSampleCount(n[n.length-1].getSampleCount()+f));t=m.addHistograms(); Dj(t,b);return m}function Dj(b,d){var f=[0,10,20,30,40,50,60,70,80,90,100];const h=f.length-1;f=f.map(w=>{if(0===d.length)w=NaN;else{w=w/100*(d.length-1);var l=Math.floor(w);w=l===w?d[w]:d[l]+(d[l+1]-d[l])*(w-l)}return w});b.setType(1);const m=d.length/h;for(let w=0;w<h;w++){const l=b.addBuckets();l.setSampleCount(m);fj(l,f[w]);gj(l,f[w+1])}} function Bj(b,d,f,h){const m=new Cf;m.setCommonStats(Cj(d,f,h));let w=0;const l={};b.forEach(q=>{q=String(q);l[q]=(l[q]||0)+1;w+=q.length});0<b.length&&Yd(m,4,w/b.length);b=[];for(var p in l)l.hasOwnProperty(p)&&b.push({str:p,count:l[p]});m.setUnique(b.length);b=b.sort((q,t)=>t.count-q.count);const n=new Fg;m.setRankHistogram(n);b.length&&(p=m.addTopValues(),p.setValue(b[0].str),Yd(p,3,b[0].count));b.forEach((q,t)=>{const v=n.addBuckets();v.setSampleCount(q.count);Wd(v,1,t);Wd(v,2,t);Xd(v,4,q.str, "")});return m}function Cj(b,d,f){const h=new Lf;let m=Infinity,w=0,l=0;b.forEach(p=>{p<m&&(m=p);p>w&&(w=p);l+=p});h.setNumNonMissing(d-f);h.setNumMissing(f);Wd(h,3,m);Wd(h,4,w);0<b.length&&h.setAvgNumValues(l/b.length);d=new Mf;xe(h,6,d);Dj(d,b);return h}; </script> <script>//~~WEBPATH~~/facets-overview/common/utils.js class Ej{}class Fj{constructor(b,d,f,h,m,w,l,p){this.histMap={};this.name=b;d&&(this.histMap[Gj(!1,"Standard")]=d);f&&(this.histMap[Gj(!0,"Standard")]=f);h&&(this.histMap[Gj(!1,"Quantiles")]=h);m&&(this.histMap[Gj(!0,"Quantiles")]=m);w&&(this.histMap[Gj(!1,"Value list length")]=w);l&&(this.histMap[Gj(!1,"Feature list length")]=l);p&&Object.keys(p).forEach(n=>this.histMap[n]=p[n])}} class Hj{constructor(b,d,f,h){this.name=b;this.stringValue=d;this.lowNumValue=f;this.highNumValue=h}clear(){this.highNumValue=this.lowNumValue=this.stringValue=this.name=void 0}equals(b){return b?this.name===b.name&&this.stringValue===b.stringValue&&this.lowNumValue===b.lowNumValue&&this.highNumValue===b.highNumValue:!1}} function Ij(b){const d=Jj(b);if(0===d)return 0;const f=b.reduce((h,m)=>{m=+m.getSampleCount()||0;if(0===m)return h;m/=d;return h-m*Math.log(m)},0);return 0===f?0:f/Math.log(b.length)}function Kj(b,d){return isFinite(b)&&-1===b.toString().indexOf("e")?+(Math.round(Number(b+"e+"+d))+"e-"+d):b}function Lj(b,d,f){return(b=b.histMap[Gj(d,f)])?b.getBucketsList():[]}function Gj(b,d){d=null==d?"Standard":d;b&&(d="weighted"+d);return d} function Jj(b){return b.map(d=>d.getSampleCount()).reduce((d,f)=>(+f||0)+d,0)}function Mj(b){return b.map(d=>Jj(Lj(d,!1)))}function Nj(b){const d=[];b.forEach(f=>{f.forEach(h=>{h=Oj(lj(h));-1===d.indexOf(h)&&d.push(h)})});return d}function Oj(b){return null==b||""===b?"\u00a0":b}function Pj(b){return null==b?0:"inf"===b?Infinity:"-inf"===b?-Infinity:+b} function Qj(b){const d=b.map(y=>Lj(y,!1));var f=null;for(var h=0;h<d.length;h++)if(0<d[h].length){f=d[h][0];break}if(!f)return 0;h=Mj(b);for(var m=0;m<h.length;m++)if(0===h[m])return Infinity;m=0;if(f instanceof Hg){f=Nj(d);for(var w=1;w<b.length;w++){var l=d[0],p=d[w],n=0;for(var q=0;q<f.length;q++){var t=f[q],v=0;let y=0;for(var z=0;z<l.length;z++)if(lj(l[z])===t){v=l[z].getSampleCount()?l[z].getSampleCount():0;break}for(z=0;z<p.length;z++)if(lj(p[z])===t){y=p[z].getSampleCount()?p[z].getSampleCount(): 0;break}n=Rj(n,v,h[0],y,h[w])}m=Math.max(m,n)}}else for(f=1;f<b.length;f++){w=d[0];l=d[f];p=0;n=Math.max(w.length,l.length);for(q=0;q<n;q++)t=q<w.length&&w[q].getSampleCount()?w[q].getSampleCount():0,v=q<l.length&&l[q].getSampleCount()?l[q].getSampleCount():0,p=Rj(p,t,h[0],v,h[f]);m=Math.max(m,p)}return m}function Rj(b,d,f,h,m){const w=d/f-h/m;d=d/(f*f)+h/(m*m);return b+(d?w*w/d:0)} function Sj(b){Ig(b).forEach(d=>{Qg(d).forEach(f=>{var h=ue(f,Fe,8);null!=h&&(h=Td(h,1),null!=h&&f.setName(h.join("/")));h=[];if(Bh(f)){const m=Bh(f).getRankHistogram();m&&h.push(m);(f=Bh(f).getTopValuesList())&&f.forEach(w=>{const l=Ud(w,1,0);l&&!+Ud(w,3,0)&&Yd(w,3,l)})}else Ug(f)&&(f=Ug(f).getHistogramsList())&&(h=h.concat(f));h.forEach(m=>{(m=m.getBucketsList())&&m.forEach(w=>{const l=Ud(w,3,0);l&&!w.getSampleCount()&&w.setSampleCount(l)})})})});return b} function Tj(b){let d=!0;Ig(b).forEach(f=>{Qg(f).forEach(h=>{let m=[];if(Bh(h)){const w=Bh(h).getRankHistogram();w&&m.push(w);(h=Bh(h).getTopValuesList())&&h.forEach(l=>{Ud(l,1,0)&&!+Ud(l,3,0)&&(d=!1)})}else Ug(h)&&(h=Ug(h).getHistogramsList())&&(m=m.concat(h));m.forEach(w=>{(w=w.getBucketsList())&&w.forEach(l=>{Ud(l,3,0)&&!l.getSampleCount()&&(d=!1)})})})});return d}function Uj(b){if(!b)return!1;for(let d=0;d<b.length;d++)if(b[d].histMap[Gj(!0,"Standard")])return!0;return!1} function Vj(b){return b?b.getNumNonMissing()*b.getAvgNumValues():0} function Wj(b){switch(b){case 0:return"int";case 1:return"fixed-length ints";case 2:return"variable-length ints";case 3:return"float";case 4:return"fixed-length floats";case 5:return"variable-length floats";case 6:return"string";case 7:return"fixed-length strings";case 8:return"variable-length strings";case 9:return"bytes";case 10:return"fixed-length bytes";case 11:return"variable-length bytes";case 12:return"struct";case 13:return"fixed-length struct";case 14:return"variable-length struct";default:return"unknown"}} class Xj{}class Yj{}class Zj{}function ak(b){let d=0,f=0;for(var h=0;h<b.length;h++)b[h].rawBuckets.length>d&&(d=b[h].rawBuckets.length,f=h);h=[];for(let m=0;m<d;m++){const w=new Zj;w.value=lj(b[f].rawBuckets[m]);w.counts=[];for(let l=0;l<b.length;l++)b[l].rawBuckets.length<=m?w.counts.push(0):w.counts.push(b[l].rawBuckets[m].getSampleCount());h.push(w)}return h} function bk(b,d){const f=[];for(let h=0;h<d.length;h++){const m=new Zj,w=d[h];m.value=w;m.counts=[];for(let l=0;l<b.length;l++){const p=b[l].rawBuckets;let n=-1;for(let q=0;q<p.length;q++)if(lj(p[q])===w){n=q;break}-1===n?m.counts.push(0):m.counts.push(p[n].getSampleCount())}f.push(m)}return f}var ck,dk=ck||(ck={});dk[dk.HISTOGRAM=0]="HISTOGRAM";dk[dk.BAR_CHART=1]="BAR_CHART";dk[dk.CUMDIST_CHART=2]="CUMDIST_CHART"; function ek(b,d,f){let h=!0,m=0;b.forEach(w=>{w.histMap[d]&&(w=w.histMap[d].getBucketsList(),m=Math.max(m,w.length),w.forEach(l=>{l.getLowValue||(h=!1)}))});return h?ck.HISTOGRAM:m>f?ck.CUMDIST_CHART:ck.BAR_CHART}class fk{constructor(b,d,f){this.str=b;this.cssClass=d;this.fullStr=f;this.fullStr||(this.fullStr=b)}append(b,d){d&&(this.str+=d,this.fullStr+=d);this.str+=b.str;this.fullStr+=b.fullStr;this.cssClass+=b.cssClass}} function gk(b){const d=Math.abs(b);return(.01>d&&0<d||1E4<d)&&isFinite(b)?d3.format(".3s")(b).replace(/G$/,"B"):b.toLocaleString()}function hk(b,d){const f=gk(Kj(Pj(b),1E6<Math.abs(b)?0:2));d=ik(b,d,void 0);return new fk(f,d,b.toLocaleString([],{maximumFractionDigits:9}))}function jk(b,d,f){b=Pj(b);b=null!=b&&d?b/d:0;d=.999999<b&&1>b?"~100%":1E-6>b&&0<b?"~0%":Kj(100*b,2)+"%";f=ik(b,!1,f);return new fk(d,f,100*b+"%")} function kk(b,d,f){const h=gk(b);d=ik(b,d,f);return new fk(h,d,b.toLocaleString())}function lk(b,d){b=Oj(b);b=0===b.length||isNaN(+b)?b:'"'+b+'"';d=ik(b,d,void 0);return new fk(b,d)}function ik(b,d,f){d=d?"data-weighted ":"";if(f&&f(b)||"number"===typeof b&&!isFinite(b))d+="data-error ";return d}function mk(b){return b?Ug(b)?ai(Ug(b)):Bh(b)?ai(Bh(b)):Dh(b)?ai(Dh(b)):ue(b,Kf,7)?ai(ue(b,Kf,7)):null:null} function nk(b){const d=[];b?(d.push(kk(b.getNumNonMissing(),!1,f=>0>=f)),d.push(jk(b.getNumMissing(),Pj(b.getNumNonMissing())+Pj(b.getNumMissing()),f=>.02<f))):(d.push(kk(0,!1,f=>0>=f)),d.push(jk(1,1,f=>.02<f)));return d} function ok(b,d,f){const h=[];if(b)(f=f?ue(b,Ff,9):null)?(h.push(hk(f.getMean(),!0)),h.push(hk(f.getStdDev(),!0))):(h.push(hk(b.getMean())),h.push(hk(b.getStdDev()))),h.push(jk(Ud(b,4,0),Vj(d),m=>.1<m)),d=pk(b),h.push(hk(d?NaN:+Ud(b,5,0))),f?h.push(hk(f.getMedian(),!0)):h.push(hk(b.getMedian())),h.push(hk(d?NaN:+Ud(b,7,0)));else for(b=0;6>b;b++)h.push(lk("-"));return h}function pk(b){if(!b)return!1;b=b.getHistogramsList();for(let d=0;d<b.length;d++)if(0<Ud(b[d],1,0))return!0;return!1} function qk(b,d){const f=[];if(b){d=d?ue(b,Hf,6):null;f.push(kk(Ud(b,2,0)));const h=d?d.getTopValuesList():b.getTopValuesList();h&&0<h.length?(f.push(lk(h[0].getValue(),!!d)),f.push(hk(+Ud(h[0],3,0),!!d))):(f.push(lk("-")),f.push(lk("-")));f.push(hk(+Ud(b,4,0)))}else for(b=0;4>b;b++)f.push(lk("-"));return f}function rk(b){const d=[];if(b)d.push(kk(Ud(b,2,0))),d.push(lk("-")),d.push(lk("-")),d.push(hk(+Ud(b,3,0)));else for(b=0;4>b;b++)d.push(lk("-"));return d} function sk(b){const d=[];if(b&&0<b.length){const f=new fk("","data-custom ");b.forEach(h=>{if(!ue(h,Mf,4)&&!h.getRankHistogram()){var m=h.getName();""!==f.str&&(m="\n"+m);f.append(lk(m));Ud(h,3,"")?f.append(lk(Ud(h,3,"")),": "):f.append(hk(+Ud(h,2,0)),": ")}});d.push(f)}else d.push(new fk("-","data-custom "));return d} function tk(b){const d=b.map(()=>0);b.forEach((f,h)=>{f.forEach(m=>{d[h]+=Pj(m.getSampleCount())})});return b.map((f,h)=>f.map(m=>{if(m instanceof Of){var w=new Of;w.setSampleCount(m.getSampleCount()/d[h]);fj(w,m.getLowValue());gj(w,hj(m));return w}w=new Hg;w.setSampleCount(m.getSampleCount()/d[h]);var l=Ud(m,1,0);Wd(w,1,l);l=Ud(m,2,0);Wd(w,2,l);m=lj(m);Xd(w,4,m,"");return w}))}; </script> <script>//~~WEBPATH~~/facets-overview/common/overview_data_model.js function uk(b){const d=[];for(let f=0;16>f;f++)d[f]=[];vk(b).forEach(f=>{const h=wk(b,f.getName());d[h].push(f.getName())});return d}function vk(b){if(!b.data)return[];const d={};for(const f of Ig(b.data))for(const h of Qg(f))d[h.getName()]=h;return Object.keys(d).map(f=>d[f])} function wk(b,d){const f=Cl(b);let h=15;for(let p=0;p<f.length;p++){var m=b.getFeature(d,f[p]);if(null==m)m=15;else{m=m.getType();var w=Dl(b,d,f[p]),l=15;if(null!=w&&0!==w.getNumNonMissing()){let n=l=!1;Ud(w,3,0)===Ud(w,4,0)&&(1===Ud(w,3,0)?l=!0:n=!0);l=1===m?l?3:n?4:5:0===m?l?0:n?1:2:2===m?l?6:n?7:8:3===m?l?9:n?10:11:l?12:n?13:14}m=l}h=15===h?m:16<=h||15===m?h:3<=h&&5>=h&&3<=m&&5>=m||0<=h&&2>=h&&0<=m&&2>=m||6<=h&&8>=h&&6<=m&&8>=m||9<=h&&11>=h&&9<=m&&11>=m||12<=h&&14>=h&&12<=m&&14>=m?Math.max(h,m): 16}16===h&&(h=15);return h}function Cl(b){return b.data?Ig(b.data).map(d=>d.getName()):[]}function Dl(b,d,f){b=b.getFeature(d,f);return null==b?null:mk(b)}function El(b,d){if(!b.data)return null;for(const f of Ig(b.data))if(f.getName()===d)return f;return null} function Fl(b,d){if(!b.data)return[];d=d.map(h=>h.getName());const f={};for(const h of Ig(b.data))for(const m of Qg(h))if(-1!==d.indexOf(m.getName())&&(Gh(m)&&Gh(m).forEach(w=>{if(ue(w,Mf,4)||w.getRankHistogram())f[w.getName()]=!0}),Ug(m)&&(b=Ug(m).getHistogramsList())))for(let w=0;w<b.length;w++){const l=b[w];l.getName()&&(f[l.getName()]=!0)}return Object.keys(f)} function Gl(b,d,f){if(!b.data)return null;b=El(b,d);if(!b)return null;d=0;for(const h of Qg(b)){if(h.getName()===f)return d;++d}return null}function Hl(b,d){return vk(b).filter(f=>null!=Ug(f)===d).length}function Il(b){if(!b)return!1;if(Bh(b)){var d=Ud(Bh(b),2,0);return 1===Pj(d)}return Dh(b)?(d=Ud(Dh(b),2,0),1===Pj(d)):Ug(b)?(d=+Ud(Ug(b),5,0),b=+Ud(Ug(b),7,0),null==d&&null==b?!1:Pj(d)===Pj(b)):!1} function Jl(b,d){const f=[];if(b.data)for(const l of Ig(b.data)){const p=l.getName();let n=null,q=null,t=null,v=null,z=null,y=null;const x={};for(const D of Qg(l))if(D.getName()===d){var h=Dl(b,d,p);h&&(z=ue(h,Mf,6),y=ue(h,Mf,9));Gh(D)&&Gh(D).forEach(G=>{ue(G,Mf,4)?x[G.getName()]=ue(G,Mf,4):G.getRankHistogram()&&(x[G.getName()]=G.getRankHistogram())});if(Ug(D)){if(h=Ug(D).getHistogramsList())for(var m=0;m<h.length;m++){var w=h[m];w.getName()?x[w.getName()]=w:0===w.getType()?n=w:t=w}if(ue(Ug(D),Ff, 9)&&(h=ue(Ug(D),Ff,9).getHistogramsList()))for(m=0;m<h.length;m++)w=h[m],0===w.getType()?q=w:v=w}else Bh(D)&&(n=Bh(D).getRankHistogram(),ue(Bh(D),Hf,6)&&(q=ue(Bh(D),Hf,6).getRankHistogram()));break}f.push(new Fj(p,n,q,t,v,z,y,x))}return f}function Kl(b,d){d=b.colorScale.scale(Cl(b)[d]);b=2<=Cl(b).length?.4:1;return d.replace("rgb","rgba").replace(")",", "+b+")")} class Ll{constructor(b){this.data=b;this.colorScale=new Plottable.Scales.Color;this.colorScale.domain(Ig(b).map(d=>d.getName()));this.colorScale.range("#4285F4 #F09300 #0F9D58 #9C27B0 #607D8B #0B8043 #757575".split(" "));if(!Tj(b))throw Error("input proto has not been cleaned");this.featuresBySpec=uk(this)}getFeature(b,d){if(!b||!this.data)return null;d=El(this,d);if(!d)return null;for(const f of Qg(d))if(f.getName()===b)return f;return null}getFeatureNames(b){return b&&this.data?(b=El(this,b))?Qg(b).map(d=> d.getName()):[]:null}featureAcrossAllDatasetsHasSingleValue(b){if(!b||!this.data)return!1;for(const d of Ig(this.data))for(const f of Qg(d))if(b===f.getName()&&!Il(f))return!1;return!0}getFeatureSingleValue(b){if(null==b)return"\x3cnull\x3e";if(Bh(b))return b=Bh(b).getTopValuesList(),null==b||0===b.length?"\x3cnull\x3e":b[0].getValue();if(Dh(b))return 0===Ud(Dh(b),2,0)?"\x3cnull\x3e":"\x3cbinary data\x3e";if(Ug(b)){const d=+Ud(Ug(b),5,0);if(d)return Pj(d).toString();if(b=+Ud(Ug(b),7,0))return Pj(b).toString()}return"\x3cunknown type\x3e"}doesContainWeightedStats(){if(null== this.containsWeightedStats){a:{var b=this.data;for(let d=0;d<Ig(b).length;d++){const f=Ig(b)[d];for(let h=0;h<Qg(f).length;h++){const m=Qg(f)[h];if(Bh(m)){if(ue(Bh(m),Hf,6)){b=!0;break a}}else if(Ug(m)&&ue(Ug(m),Ff,9)){b=!0;break a}}}b=!1}this.containsWeightedStats=b}return this.containsWeightedStats}}; </script> <script>//~~WEBPATH~~/facets-overview/common/plottable_helpers.js (function(b){const d=[1,0,0,1,0,0];class f extends Plottable.Utils.Translator{computePosition(l,p){l={x:l,y:p};p=this._rootElement;for(var n=[];p&&p instanceof HTMLElement;)if(n.push(p),p.assignedSlot)p=p.assignedSlot;else if(p.parentElement)p=p.parentElement;else{var q=p.parentNode;p=q instanceof DocumentFragment?q.host:q!==p?q:null}q=n;p=d;n=null;for(v of q){q=Plottable.Utils.DOM.getElementTransform(v);if(null!=q){var t=v.clientWidth/2;const z=v.clientHeight/2;p=Plottable.Utils.Math.multiplyTranslate(p, [t,z]);p=Plottable.Utils.Math.multiplyMatrix(p,Plottable.Utils.Math.invertMatrix(q));p=Plottable.Utils.Math.multiplyTranslate(p,[-t,-z])}q=v.scrollLeft;t=v.scrollTop;if(null===n||v===n)q-=v.offsetLeft+v.clientLeft,t-=v.offsetTop+v.clientTop,n=v.offsetParent;p=Plottable.Utils.Math.multiplyTranslate(p,[q,t])}var v=p;return null==v?l:Plottable.Utils.Math.applyTransform(v,l)}}class h extends Plottable.Dispatchers.Mouse{constructor(l){super(l);this._eventTarget=l.root().rootElement().node();this._translator= new f(l.root().rootElement().node())}static getDispatcher(l){const p=l.root().rootElement();let n=p[h._DISPATCHER_KEY];n||(n=new h(l),p[h._DISPATCHER_KEY]=n);return n}}class m extends Plottable.Dispatchers.Touch{constructor(l){super(l);this._eventTarget=l.root().rootElement().node();this._translator=new f(l.root().rootElement().node())}static getDispatcher(l){const p=l.root().rootElement();let n=p[m._DISPATCHER_KEY];n||(n=new m(l),p[m._DISPATCHER_KEY]=n);return n}}class w extends Plottable.Interactions.Pointer{_anchor(){this._isAnchored= !0;this._mouseDispatcher=h.getDispatcher(this._componentAttachedTo);this._mouseDispatcher.onMouseMove(this._mouseMoveCallback);this._touchDispatcher=m.getDispatcher(this._componentAttachedTo);this._touchDispatcher.onTouchStart(this._touchStartCallback)}}b.PointerInteraction=w})(window.plottable_helpers||(window.plottable_helpers={})); </script> <script>//~~WEBPATH~~/iron-scroll-target-behavior/iron-scroll-target-behavior.html.js Polymer.IronScrollTargetBehavior={properties:{scrollTarget:{type:HTMLElement,value:function(){return this._defaultScrollTarget}}},observers:["_scrollTargetChanged(scrollTarget, isAttached)"],_shouldHaveListener:!0,_scrollTargetChanged:function(b,d){this._oldScrollTarget&&(this._toggleScrollListener(!1,this._oldScrollTarget),this._oldScrollTarget=null);d&&("document"===b?this.scrollTarget=this._doc:"string"===typeof b?this.scrollTarget=(d=this.domHost)&&d.$?d.$[b]:Polymer.dom(this.ownerDocument).querySelector("#"+ b):this._isValidScrollTarget()&&(this._oldScrollTarget=b,this._toggleScrollListener(this._shouldHaveListener,b)))},_scrollHandler:function(){},get _defaultScrollTarget(){return this._doc},get _doc(){return this.ownerDocument.documentElement},get _scrollTop(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageYOffset:this.scrollTarget.scrollTop:0},get _scrollLeft(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageXOffset:this.scrollTarget.scrollLeft: 0},set _scrollTop(b){this.scrollTarget===this._doc?window.scrollTo(window.pageXOffset,b):this._isValidScrollTarget()&&(this.scrollTarget.scrollTop=b)},set _scrollLeft(b){this.scrollTarget===this._doc?window.scrollTo(b,window.pageYOffset):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=b)},scroll:function(b,d){this.scrollTarget===this._doc?window.scrollTo(b,d):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=b,this.scrollTarget.scrollTop=d)},get _scrollTargetWidth(){return this._isValidScrollTarget()? this.scrollTarget===this._doc?window.innerWidth:this.scrollTarget.offsetWidth:0},get _scrollTargetHeight(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.innerHeight:this.scrollTarget.offsetHeight:0},_isValidScrollTarget:function(){return this.scrollTarget instanceof HTMLElement},_toggleScrollListener:function(b,d){d=d===this._doc?window:d;b?this._boundScrollHandler||(this._boundScrollHandler=this._scrollHandler.bind(this),d.addEventListener("scroll",this._boundScrollHandler)): this._boundScrollHandler&&(d.removeEventListener("scroll",this._boundScrollHandler),this._boundScrollHandler=null)},toggleScrollListener:function(b){this._shouldHaveListener=b;this._toggleScrollListener(b,this.scrollTarget)}}; </script> <dom-module id="iron-list"> <template> <style> :host { display: block; } @media only screen and (-webkit-max-device-pixel-ratio: 1) { :host { will-change: transform; } } #items { @apply --iron-list-items-container; position: relative; } :host(:not([grid])) #items > ::slotted(*) { width: 100%; } #items > ::slotted(*) { box-sizing: border-box; margin: 0; position: absolute; top: 0; will-change: transform; } </style> <array-selector id="selector" items="{{items}}" selected="{{selectedItems}}" selected-item="{{selectedItem}}"></array-selector> <div id="items"> <slot></slot> </div> </template> </dom-module> <script>//~~WEBPATH~~/iron-list/iron-list.html.js (function(){var b=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/),d=b&&8<=b[1],f=null!=Polymer.flush,h=f?Polymer.Async.animationFrame:0,m=f?Polymer.Async.idlePeriod:1,w=f?Polymer.Async.microTask:2;Polymer.OptionalMutableDataBehavior||(Polymer.OptionalMutableDataBehavior={});Polymer({is:"iron-list",properties:{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},selectedAs:{type:String,value:"selected"},grid:{type:Boolean,value:!1,reflectToAttribute:!0, observer:"_gridChanged"},selectionEnabled:{type:Boolean,value:!1},selectedItem:{type:Object,notify:!0},selectedItems:{type:Object,notify:!0},multiSelection:{type:Boolean,value:!1},scrollOffset:{type:Number,value:0}},observers:["_itemsChanged(items.*)","_selectionEnabledChanged(selectionEnabled)","_multiSelectionChanged(multiSelection)","_setOverflow(scrollTarget, scrollOffset)"],behaviors:[Polymer.Templatizer,Polymer.IronResizableBehavior,Polymer.IronScrollTargetBehavior,Polymer.OptionalMutableDataBehavior], _ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_collection:null,_lastVisibleIndexVal:null,_maxPages:2,_focusedItem:null,_focusedVirtualIndex:-1,_focusedPhysicalIndex:-1,_offscreenFocusedItem:null,_focusBackfillItem:null,_itemsPerRow:1,_itemWidth:0,_rowHeight:0,_templateCost:0, _parentModel:!0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){return(this.grid?this._physicalRows*this._rowHeight:this._physicalSize)-this._viewportHeight},get _itemsParent(){return Polymer.dom(Polymer.dom(this._userTemplate).parentNode)},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset}, get _maxVirtualStart(){var l=this._convertIndexToCompleteRow(this._virtualCount);return Math.max(0,l-this._physicalCount)},set _virtualStart(l){l=this._clamp(l,0,this._maxVirtualStart);this.grid&&(l-=l%this._itemsPerRow);this._virtualStartVal=l},get _virtualStart(){return this._virtualStartVal||0},set _physicalStart(l){l%=this._physicalCount;0>l&&(l=this._physicalCount+l);this.grid&&(l-=l%this._itemsPerRow);this._physicalStartVal=l},get _physicalStart(){return this._physicalStartVal||0},get _physicalEnd(){return(this._physicalStart+ this._physicalCount-1)%this._physicalCount},set _physicalCount(l){this._physicalCountVal=l},get _physicalCount(){return this._physicalCountVal||0},get _optPhysicalSize(){return 0===this._viewportHeight?Infinity:this._viewportHeight*this._maxPages},get _isVisible(){return!(!this.offsetWidth&&!this.offsetHeight)},get firstVisibleIndex(){var l=this._firstVisibleIndexVal;if(null==l){var p=this._physicalTop+this._scrollOffset;this._firstVisibleIndexVal=l=this._iterateItems(function(n,q){p+=this._getPhysicalSizeIncrement(n); if(p>this._scrollPosition)return this.grid?q-q%this._itemsPerRow:q;if(this.grid&&this._virtualCount-1===q)return q-q%this._itemsPerRow})||0}return l},get lastVisibleIndex(){var l=this._lastVisibleIndexVal;if(null==l){if(this.grid)l=Math.min(this._virtualCount,this.firstVisibleIndex+this._estRowsInView*this._itemsPerRow-1);else{var p=this._physicalTop+this._scrollOffset;this._iterateItems(function(n,q){p<this._scrollBottom&&(l=q);p+=this._getPhysicalSizeIncrement(n)})}this._lastVisibleIndexVal=l}return l}, get _defaultScrollTarget(){return this},get _virtualRowCount(){return Math.ceil(this._virtualCount/this._itemsPerRow)},get _estRowsInView(){return Math.ceil(this._viewportHeight/this._rowHeight)},get _physicalRows(){return Math.ceil(this._physicalCount/this._itemsPerRow)},get _scrollOffset(){return this._scrollerPaddingTop+this.scrollOffset},ready:function(){this.addEventListener("focus",this._didFocus.bind(this),!0)},attached:function(){this._debounce("_render",this._render,h);this.listen(this,"iron-resize", "_resizeHandler");this.listen(this,"keydown","_keydownHandler")},detached:function(){this.unlisten(this,"iron-resize","_resizeHandler");this.unlisten(this,"keydown","_keydownHandler")},_setOverflow:function(l){this.style.webkitOverflowScrolling=l===this?"touch":"";this.style.overflowY=l===this?"auto":"";this._firstVisibleIndexVal=this._lastVisibleIndexVal=null;this._debounce("_render",this._render,h)},updateViewportBoundaries:function(){var l=window.getComputedStyle(this);this._scrollerPaddingTop= this.scrollTarget===this?0:parseInt(l["padding-top"],10);this._isRTL="rtl"===l.direction;this._viewportWidth=this.$.items.offsetWidth;this._viewportHeight=this._scrollTargetHeight;this.grid&&this._updateGridMetrics()},_scrollHandler:function(){var l=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop)),p=l-this._scrollPosition,n=0<=p;this._scrollPosition=l;this._lastVisibleIndexVal=this._firstVisibleIndexVal=null;Math.abs(p)>this._physicalSize&&0<this._physicalSize?(p-=this._scrollOffset,n=Math.round(p/ this._physicalAverage)*this._itemsPerRow,this._virtualStart+=n,this._physicalStart+=n,this._physicalTop=Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage,this._update()):0<this._physicalCount&&(l=this._getReusables(n),n?(this._physicalTop=l.physicalTop,this._virtualStart+=l.indexes.length,this._physicalStart+=l.indexes.length):(this._virtualStart-=l.indexes.length,this._physicalStart-=l.indexes.length),this._update(l.indexes,n?null:l.indexes),this._debounce("_increasePoolIfNeeded", this._increasePoolIfNeeded.bind(this,0),w))},_getReusables:function(l){var p=[],n=this._hiddenContentSize*this._ratio,q=this._virtualStart,t=this._virtualEnd,v=this._physicalCount,z=this._physicalTop+this._scrollOffset;var y=this._physicalBottom+this._scrollOffset;var x=this._scrollTop,D=this._scrollBottom;if(l){var G=this._physicalStart;y=x-z}else G=this._physicalEnd,y-=D;for(;;){var J=this._getPhysicalSizeIncrement(G);y-=J;if(p.length>=v||y<=n)break;if(l){if(t+p.length+1>=this._virtualCount)break; if(z+J>=x-this._scrollOffset)break;p.push(G);z+=J;G=(G+1)%v}else{if(0>=q-p.length)break;if(z+this._physicalSize-J<=D)break;p.push(G);z-=J;G=0===G?v-1:G-1}}return{indexes:p,physicalTop:z-this._scrollOffset}},_update:function(l,p){if(!(l&&0===l.length||0===this._physicalCount)){this._manageFocus();this._assignModels(l);this._updateMetrics(l);if(p)for(;p.length;)l=p.pop(),this._physicalTop-=this._getPhysicalSizeIncrement(l);this._positionItems();this._updateScrollerSize()}},_createPool:function(l){this._ensureTemplatized(); var p,n=Array(l);for(p=0;p<l;p++){var q=this.stamp(null);n[p]=q.root.querySelector("*");this._itemsParent.appendChild(q.root)}return n},_isClientFull:function(){return 0!=this._scrollBottom&&this._physicalBottom-1>=this._scrollBottom&&this._physicalTop<=this._scrollPosition},_increasePoolIfNeeded:function(l){l=this._clamp(this._physicalCount+l,3,this._virtualCount-this._virtualStart);l=this._convertIndexToCompleteRow(l);if(this.grid){var p=l%this._itemsPerRow;p&&l-p<=this._physicalCount&&(l+=this._itemsPerRow); l-=p}l-=this._physicalCount;p=Math.round(.5*this._physicalCount);if(!(0>l)){if(0<l){p=window.performance.now();[].push.apply(this._physicalItems,this._createPool(l));for(var n=0;n<l;n++)this._physicalSizes.push(0);this._physicalCount+=l;this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedVirtualIndex)&&this._getPhysicalIndex(this._focusedVirtualIndex)<this._physicalEnd&&(this._physicalStart+=l);this._update();this._templateCost=(window.performance.now()-p)/l;p=Math.round(.5* this._physicalCount)}this._virtualEnd>=this._virtualCount-1||0===p||(this._isClientFull()?this._physicalSize<this._optPhysicalSize&&this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,this._clamp(Math.round(50/this._templateCost),1,p)),m):this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,p),w))}},_render:function(){if(this.isAttached&&this._isVisible)if(0!==this._physicalCount){var l=this._getReusables(!0);this._physicalTop=l.physicalTop;this._virtualStart+= l.indexes.length;this._physicalStart+=l.indexes.length;this._update(l.indexes);this._update();this._increasePoolIfNeeded(0)}else 0<this._virtualCount&&(this.updateViewportBoundaries(),this._increasePoolIfNeeded(3))},_ensureTemplatized:function(){if(!this.ctor){(this._userTemplate=this.queryEffectiveChildren("template"))||console.warn("iron-list requires a template to be provided in light-dom");var l={__key__:!0};l[this.as]=!0;l[this.indexAs]=!0;l[this.selectedAs]=!0;l.tabIndex=!0;this._instanceProps= l;this.templatize(this._userTemplate,this.mutableData)}},_gridChanged:function(l,p){"undefined"!==typeof p&&(this.notifyResize(),Polymer.flush?Polymer.flush():Polymer.dom.flush(),l&&this._updateGridMetrics())},_itemsChanged:function(l){if("items"===l.path)this._physicalTop=this._virtualStart=0,this._virtualCount=this.items?this.items.length:0,this._collection=this.items&&Polymer.Collection?Polymer.Collection.get(this.items):null,this._physicalIndexForKey={},this._lastVisibleIndexVal=this._firstVisibleIndexVal= null,this._physicalCount=this._physicalCount||0,this._physicalItems=this._physicalItems||[],this._physicalSizes=this._physicalSizes||[],this._physicalStart=0,this._scrollTop>this._scrollOffset&&this._resetScrollPosition(0),this._removeFocusedItem(),this._debounce("_render",this._render,h);else if("items.splices"===l.path){this._adjustVirtualIndex(l.value.indexSplices);this._virtualCount=this.items?this.items.length:0;if(l.value.indexSplices.some(function(n){return 0<n.addedCount||0<n.removed.length})){var p= this._getActiveElement();this.contains(p)&&p.blur()}l=l.value.indexSplices.some(function(n){return n.index+n.addedCount>=this._virtualStart&&n.index<=this._virtualEnd},this);this._isClientFull()&&!l||this._debounce("_render",this._render,h)}else"items.length"!==l.path&&this._forwardItemPath(l.path,l.value)},_forwardItemPath:function(l,p){l=l.slice(6);var n=l.indexOf(".");-1===n&&(n=l.length);var q,t=this.modelForElement(this._offscreenFocusedItem);if(f){var v=parseInt(l.substring(0,n),10);if(q=this._isIndexRendered(v)){var z= this._getPhysicalIndex(v);var y=this.modelForElement(this._physicalItems[z])}else t&&(y=t);if(!y||y[this.indexAs]!==v)return}else if(v=l.substring(0,n),t&&t.__key__===v)y=t;else if(z=this._physicalIndexForKey[v],y=this.modelForElement(this._physicalItems[z]),!y||y.__key__!==v)return;l=l.substring(n+1);l=this.as+(l?"."+l:"");f?y._setPendingPropertyOrPath(l,p,!1,!0):y.notifyPath(l,p,!0);y._flushProperties&&y._flushProperties(!0);q&&(this._updateMetrics([z]),this._positionItems(),this._updateScrollerSize())}, _adjustVirtualIndex:function(l){l.forEach(function(p){p.removed.forEach(this._removeItem,this);p.index<this._virtualStart&&(p=Math.max(p.addedCount-p.removed.length,p.index-this._virtualStart),this._virtualStart+=p,0<=this._focusedVirtualIndex&&(this._focusedVirtualIndex+=p))},this)},_removeItem:function(l){this.$.selector.deselect(l);this._focusedItem&&this.modelForElement(this._focusedItem)[this.as]===l&&this._removeFocusedItem()},_iterateItems:function(l,p){var n,q;if(2===arguments.length&&p)for(q= 0;q<p.length;q++){var t=p[q];var v=this._computeVidx(t);if(null!=(n=l.call(this,t,v)))return n}else{t=this._physicalStart;for(v=this._virtualStart;t<this._physicalCount;t++,v++)if(null!=(n=l.call(this,t,v)))return n;for(t=0;t<this._physicalStart;t++,v++)if(null!=(n=l.call(this,t,v)))return n}},_computeVidx:function(l){return l>=this._physicalStart?this._virtualStart+(l-this._physicalStart):this._virtualStart+(this._physicalCount-this._physicalStart)+l},_assignModels:function(l){this._iterateItems(function(p, n){var q=this._physicalItems[p],t=this.items&&this.items[n];if(null!=t){var v=this.modelForElement(q);v.__key__=this._collection?this._collection.getKey(t):null;this._forwardProperty(v,this.as,t);this._forwardProperty(v,this.selectedAs,this.$.selector.isSelected(t));this._forwardProperty(v,this.indexAs,n);this._forwardProperty(v,"tabIndex",this._focusedVirtualIndex===n?0:-1);this._physicalIndexForKey[v.__key__]=p;v._flushProperties&&v._flushProperties(!0);q.removeAttribute("hidden")}else q.setAttribute("hidden", "")},l)},_updateMetrics:function(l){Polymer.flush?Polymer.flush():Polymer.dom.flush();var p=0,n=0,q=this._physicalAverageCount,t=this._physicalAverage;this._iterateItems(function(v){n+=this._physicalSizes[v];this._physicalSizes[v]=this._physicalItems[v].offsetHeight;p+=this._physicalSizes[v];this._physicalAverageCount+=this._physicalSizes[v]?1:0},l);this.grid?(this._updateGridMetrics(),this._physicalSize=Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight):(n=1===this._itemsPerRow?n: Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight,this._physicalSize=this._physicalSize+p-n,this._itemsPerRow=1);this._physicalAverageCount!==q&&(this._physicalAverage=Math.round((t*q+p)/this._physicalAverageCount))},_updateGridMetrics:function(){this._itemWidth=0<this._physicalCount?this._physicalItems[0].getBoundingClientRect().width:200;this._rowHeight=0<this._physicalCount?this._physicalItems[0].offsetHeight:200;this._itemsPerRow=this._itemWidth?Math.floor(this._viewportWidth/this._itemWidth): this._itemsPerRow},_positionItems:function(){this._adjustScrollPosition();var l=this._physicalTop;if(this.grid){var p=(this._viewportWidth-this._itemsPerRow*this._itemWidth)/2;this._iterateItems(function(n,q){var t=Math.floor(q%this._itemsPerRow*this._itemWidth+p);this._isRTL&&(t*=-1);this.translate3d(t+"px",l+"px",0,this._physicalItems[n]);this._shouldRenderNextRow(q)&&(l+=this._rowHeight)})}else this._iterateItems(function(n){this.translate3d(0,l+"px",0,this._physicalItems[n]);l+=this._physicalSizes[n]})}, _getPhysicalSizeIncrement:function(l){return this.grid?this._computeVidx(l)%this._itemsPerRow!==this._itemsPerRow-1?0:this._rowHeight:this._physicalSizes[l]},_shouldRenderNextRow:function(l){return l%this._itemsPerRow===this._itemsPerRow-1},_adjustScrollPosition:function(){var l=0===this._virtualStart?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(0!==l){this._physicalTop-=l;var p=this._scrollTop;!d&&0<p&&this._resetScrollPosition(p-l)}},_resetScrollPosition:function(l){this.scrollTarget&& 0<=l&&(this._scrollPosition=this._scrollTop=l)},_updateScrollerSize:function(l){this._estScrollHeight=this.grid?this._virtualRowCount*this._rowHeight:this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage;if((l=(l=(l=l||0===this._scrollHeight)||this._scrollPosition>=this._estScrollHeight-this._physicalSize)||this.grid&&this.$.items.style.height<this._estScrollHeight)||Math.abs(this._estScrollHeight-this._scrollHeight)>=this._viewportHeight)this.$.items.style.height= this._estScrollHeight+"px",this._scrollHeight=this._estScrollHeight},scrollToItem:function(l){return this.scrollToIndex(this.items.indexOf(l))},scrollToIndex:function(l){if(!("number"!==typeof l||0>l||l>this.items.length-1)&&(Polymer.flush?Polymer.flush():Polymer.dom.flush(),0!==this._physicalCount)){l=this._clamp(l,0,this._virtualCount-1);if(!this._isIndexRendered(l)||l>=this._maxVirtualStart)this._virtualStart=this.grid?l-2*this._itemsPerRow:l-1;this._manageFocus();this._assignModels();this._updateMetrics(); this._physicalTop=Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage;for(var p=this._physicalStart,n=this._virtualStart,q=0,t=this._hiddenContentSize;n<l&&q<=t;)q+=this._getPhysicalSizeIncrement(p),p=(p+1)%this._physicalCount,n++;this._updateScrollerSize(!0);this._positionItems();this._resetScrollPosition(this._physicalTop+this._scrollOffset+q);this._increasePoolIfNeeded(0);this._lastVisibleIndexVal=this._firstVisibleIndexVal=null}},_resetAverage:function(){this._physicalAverageCount= this._physicalAverage=0},_resizeHandler:function(){this._debounce("_render",function(){this._lastVisibleIndexVal=this._firstVisibleIndexVal=null;this.updateViewportBoundaries();this._isVisible?(this.toggleScrollListener(!0),this._resetAverage(),this._render()):this.toggleScrollListener(!1)},h)},selectItem:function(l){return this.selectIndex(this.items.indexOf(l))},selectIndex:function(l){if(!(0>l||l>=this._virtualCount)){!this.multiSelection&&this.selectedItem&&this.clearSelection();if(this._isIndexRendered(l)){var p= this.modelForElement(this._physicalItems[this._getPhysicalIndex(l)]);p&&(p[this.selectedAs]=!0);this.updateSizeForIndex(l)}this.$.selector.selectIndex?this.$.selector.selectIndex(l):this.$.selector.select(this.items[l])}},deselectItem:function(l){return this.deselectIndex(this.items.indexOf(l))},deselectIndex:function(l){0>l||l>=this._virtualCount||(this._isIndexRendered(l)&&(this.modelForElement(this._physicalItems[this._getPhysicalIndex(l)])[this.selectedAs]=!1,this.updateSizeForIndex(l)),this.$.selector.deselectIndex? this.$.selector.deselectIndex(l):this.$.selector.deselect(this.items[l]))},toggleSelectionForItem:function(l){return this.toggleSelectionForIndex(this.items.indexOf(l))},toggleSelectionForIndex:function(l){(this.$.selector.isIndexSelected?this.$.selector.isIndexSelected(l):this.$.selector.isSelected(this.items[l]))?this.deselectIndex(l):this.selectIndex(l)},clearSelection:function(){this._iterateItems(function(l){this.modelForElement(this._physicalItems[l])[this.selectedAs]=!1});this.$.selector.clearSelection()}, _selectionEnabledChanged:function(l){(l?this.listen:this.unlisten).call(this,this,"tap","_selectionHandler")},_selectionHandler:function(l){var p=this.modelForElement(l.target);if(p){var n=Polymer.dom(l).path[0];l=this._getActiveElement();var q=this._physicalItems[this._getPhysicalIndex(p[this.indexAs])];if("input"!==n.localName&&"button"!==n.localName&&"select"!==n.localName){n=p.tabIndex;p.tabIndex=-100;var t=l?l.tabIndex:-1;p.tabIndex=n;l&&q!==l&&q.contains(l)&&-100!==t||this.toggleSelectionForItem(p[this.as])}}}, _multiSelectionChanged:function(l){this.clearSelection();this.$.selector.multi=l},updateSizeForItem:function(l){return this.updateSizeForIndex(this.items.indexOf(l))},updateSizeForIndex:function(l){if(!this._isIndexRendered(l))return null;this._updateMetrics([this._getPhysicalIndex(l)]);this._positionItems();return null},_manageFocus:function(){var l=this._focusedVirtualIndex;0<=l&&l<this._virtualCount?this._isIndexRendered(l)?this._restoreFocusedItem():this._createFocusBackfillItem():0<this._virtualCount&& 0<this._physicalCount&&(this._focusedPhysicalIndex=this._physicalStart,this._focusedVirtualIndex=this._virtualStart,this._focusedItem=this._physicalItems[this._physicalStart])},_convertIndexToCompleteRow:function(l){this._itemsPerRow=this._itemsPerRow||1;return this.grid?Math.ceil(l/this._itemsPerRow)*this._itemsPerRow:l},_isIndexRendered:function(l){return l>=this._virtualStart&&l<=this._virtualEnd},_isIndexVisible:function(l){return l>=this.firstVisibleIndex&&l<=this.lastVisibleIndex},_getPhysicalIndex:function(l){return f? (this._physicalStart+(l-this._virtualStart))%this._physicalCount:this._physicalIndexForKey[this._collection.getKey(this.items[l])]},focusItem:function(l){this._focusPhysicalItem(l)},_focusPhysicalItem:function(l){if(!(0>l||l>=this._virtualCount)){this._restoreFocusedItem();this._isIndexRendered(l)||this.scrollToIndex(l);var p=this._physicalItems[this._getPhysicalIndex(l)],n=this.modelForElement(p),q;n.tabIndex=-100;-100===p.tabIndex&&(q=p);q||(q=Polymer.dom(p).querySelector('[tabindex\x3d"-100"]')); n.tabIndex=0;this._focusedVirtualIndex=l;q&&q.focus()}},_removeFocusedItem:function(){this._offscreenFocusedItem&&this._itemsParent.removeChild(this._offscreenFocusedItem);this._focusedItem=this._focusBackfillItem=this._offscreenFocusedItem=null;this._focusedPhysicalIndex=this._focusedVirtualIndex=-1},_createFocusBackfillItem:function(){var l=this._focusedPhysicalIndex;if(!(this._offscreenFocusedItem||0>this._focusedVirtualIndex)){if(!this._focusBackfillItem){var p=this.stamp(null);this._focusBackfillItem= p.root.querySelector("*");this._itemsParent.appendChild(p.root)}this._offscreenFocusedItem=this._physicalItems[l];this.modelForElement(this._offscreenFocusedItem).tabIndex=0;this._physicalItems[l]=this._focusBackfillItem;this._focusedPhysicalIndex=l;this.translate3d(0,"-10000px",0,this._offscreenFocusedItem)}},_restoreFocusedItem:function(){if(this._offscreenFocusedItem&&!(0>this._focusedVirtualIndex)){this._assignModels();var l=this._focusedPhysicalIndex=this._getPhysicalIndex(this._focusedVirtualIndex), p=this._physicalItems[l];if(p){var n=this.modelForElement(p),q=this.modelForElement(this._offscreenFocusedItem);n[this.as]===q[this.as]?(this._focusBackfillItem=p,n.tabIndex=-1,this._physicalItems[l]=this._offscreenFocusedItem,this.translate3d(0,"-10000px",0,this._focusBackfillItem)):(this._removeFocusedItem(),this._focusBackfillItem=null);this._offscreenFocusedItem=null}}},_didFocus:function(l){l=this.modelForElement(l.target);var p=this.modelForElement(this._focusedItem),n=null!==this._offscreenFocusedItem, q=this._focusedVirtualIndex;l&&(p===l?this._isIndexVisible(q)||this.scrollToIndex(q):(this._restoreFocusedItem(),p&&(p.tabIndex=-1),l.tabIndex=0,this._focusedVirtualIndex=q=l[this.indexAs],this._focusedPhysicalIndex=this._getPhysicalIndex(q),this._focusedItem=this._physicalItems[this._focusedPhysicalIndex],n&&!this._offscreenFocusedItem&&this._update()))},_keydownHandler:function(l){switch(l.keyCode){case 40:this._focusedVirtualIndex<this._virtualCount-1&&l.preventDefault();this._focusPhysicalItem(this._focusedVirtualIndex+ (this.grid?this._itemsPerRow:1));break;case 39:this.grid&&this._focusPhysicalItem(this._focusedVirtualIndex+(this._isRTL?-1:1));break;case 38:0<this._focusedVirtualIndex&&l.preventDefault();this._focusPhysicalItem(this._focusedVirtualIndex-(this.grid?this._itemsPerRow:1));break;case 37:this.grid&&this._focusPhysicalItem(this._focusedVirtualIndex+(this._isRTL?1:-1));break;case 13:this._focusPhysicalItem(this._focusedVirtualIndex),this.selectionEnabled&&this._selectionHandler(l)}},_clamp:function(l, p,n){return Math.min(n,Math.max(p,l))},_debounce:function(l,p,n){f?(this._debouncers=this._debouncers||{},this._debouncers[l]=Polymer.Debouncer.debounce(this._debouncers[l],n,p.bind(this)),Polymer.enqueueDebouncer(this._debouncers[l])):Polymer.dom.addDebouncer(this.debounce(l,p))},_forwardProperty:function(l,p,n){f?l._setPendingProperty(p,n):l[p]=n},_forwardHostPropV2:function(l,p){(this._physicalItems||[]).concat([this._offscreenFocusedItem,this._focusBackfillItem]).forEach(function(n){n&&this.modelForElement(n).forwardHostProp(l, p)},this)},_notifyInstancePropV2:function(l,p,n){Polymer.Path.matches(this.as,p)&&(l=l[this.indexAs],p==this.as&&(this.items[l]=n),this.notifyPath(Polymer.Path.translate(this.as,"items."+l,p),n))},_getStampedChildren:function(){return this._physicalItems},_forwardInstancePath:function(l,p,n){0===p.indexOf(this.as+".")&&this.notifyPath("items."+l.__key__+"."+p.slice(this.as.length+1),n)},_forwardParentPath:function(l,p){(this._physicalItems||[]).concat([this._offscreenFocusedItem,this._focusBackfillItem]).forEach(function(n){n&& this.modelForElement(n).notifyPath(l,p,!0)},this)},_forwardParentProp:function(l,p){(this._physicalItems||[]).concat([this._offscreenFocusedItem,this._focusBackfillItem]).forEach(function(n){n&&(this.modelForElement(n)[l]=p)},this)},_getActiveElement:function(){var l=this._itemsParent.node.domHost;return Polymer.dom(l?l.root:document).activeElement}})})(); </script> <dom-module id="facets-overview-row-stats"> <template> <style> * { text-align: right; white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis; } .data-error { color: red; font-weight: bold; } .data-weighted { font-style: italic; } .table-row { display: flex; margin-bottom: 4px; } .table-cell { min-width: 70px; max-width: 70px; padding-right: 4px; overflow: hidden; } .data-custom { min-width: 150px; max-width: 150px; white-space: pre;; } #legend-box { width: 6px; height: 16px; margin-left: 4px; } </style> <div class="table-row"> <div id="legend-box"></div> <template is="dom-repeat" items="[[_entries]]"> <div class$="[[item.cssClass]] table-cell" title="[[item.fullStr]]">[[item.str]]</div> </template> </div> </template> </dom-module> <script>//~~WEBPATH~~/facets-overview/components/facets-overview-row-stats/facets-overview-row-stats.js Polymer({is:"facets-overview-row-stats",properties:{stats:Object,showWeighted:Boolean,hasCustom:Boolean,dataModel:Object,datasetIndex:Number,compareMode:Boolean,_entries:{type:Array,computed:"_getEntries(stats, showWeighted, hasCustom)"}},observers:["_colorLegendBox(dataModel, datasetIndex, compareMode)"],_getEntries:function(b,d,f){if(b){var h=mk(b),m=nk(h);m=Ug(b)?m.concat(ok(Ug(b),h,d)):Bh(b)?m.concat(qk(Bh(b),d)):m.concat(rk(Dh(b)));f&&(m=m.concat(sk(Gh(b))));b=m}else b=[];return b},_colorLegendBox:function(b, d,f){const h=d3.select(this.shadowRoot.querySelector("#legend-box"));2>Cl(b).length&&!f?h.style("visibility","hidden"):(h.style("visibility",null),h.style("background-color",Kl(b,d)))}}); </script> <dom-module id="facets-overview-row-legend"> <template> <style> .table-row { display: flex; background: rgba(61,140,207,0.1); border-left: solid 0.5px rgba(0,0,0,0.1); border-bottom: solid 0.5px rgba(0,0,0,0.1); } .table-cell { padding: 20px 4px 8px 0; min-width: 69px; max-width: 69px; text-align: right; font-size: 14px; font-weight: 300; border-right: solid 0.5px rgba(0,0,0,0.1); } .data-weighted { font-style: italic; } .data-custom { min-width: 150px; max-width: 150px; } .legend-space { width: 6px; height: 8px; margin-left: 4px; } </style> <div class="table-row"> <div class="legend-space"></div> <template is="dom-repeat" items="[[_entries]]"> <div class$="[[item.cssClass]] table-cell">[[item.str]]</div> </template> </div> </template> </dom-module> <script>//~~WEBPATH~~/facets-overview/components/facets-overview-row-legend/facets-overview-row-legend.js Polymer({is:"facets-overview-row-legend",properties:{numeric:Boolean,showWeighted:Boolean,hasCustom:Boolean,dataModel:Object,_entries:{type:Array,computed:"_getEntries(numeric, showWeighted, hasCustom)"}},_getEntries:function(b,d,f){{const h=[];h.push(lk("count"));h.push(lk("missing"));b?(h.push(lk("mean",d)),h.push(lk("std dev",d)),h.push(lk("zeros")),h.push(lk("min")),h.push(lk("median",d)),h.push(lk("max"))):(h.push(lk("unique")),h.push(lk("top",d)),h.push(lk("freq top",d)),h.push(lk("avg str len"))); f&&h.push(new fk("custom","data-custom "));b=h}return b}}); </script> <script>//~~WEBPATH~~/paper-behaviors/paper-button-behavior.html.js Polymer.PaperButtonBehaviorImpl={properties:{elevation:{type:Number,reflectToAttribute:!0,readOnly:!0}},observers:["_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)","_computeKeyboardClass(receivedFocusFromKeyboard)"],hostAttributes:{role:"button",tabindex:"0",animated:!0},_calculateElevation:function(){var b=1;this.disabled?b=0:this.active||this.pressed?b=4:this.receivedFocusFromKeyboard&&(b=3);this._setElevation(b)},_computeKeyboardClass:function(b){this.toggleClass("keyboard-focus", b)},_spaceKeyDownHandler:function(b){Polymer.IronButtonStateImpl._spaceKeyDownHandler.call(this,b);this.hasRipple()&&1>this.getRipple().ripples.length&&this._ripple.uiDownAction()},_spaceKeyUpHandler:function(b){Polymer.IronButtonStateImpl._spaceKeyUpHandler.call(this,b);this.hasRipple()&&this._ripple.uiUpAction()}};Polymer.PaperButtonBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRippleBehavior,Polymer.PaperButtonBehaviorImpl]; </script> <dom-module id="paper-material-styles"> <template> <style> :host, html { --paper-material: { display: block; position: relative; }; --paper-material-elevation-1: { @apply --shadow-elevation-2dp; }; --paper-material-elevation-2: { @apply --shadow-elevation-4dp; }; --paper-material-elevation-3: { @apply --shadow-elevation-6dp; }; --paper-material-elevation-4: { @apply --shadow-elevation-8dp; }; --paper-material-elevation-5: { @apply --shadow-elevation-16dp; }; } :host(.paper-material), .paper-material { @apply --paper-material; } :host(.paper-material[elevation="1"]), .paper-material[elevation="1"] { @apply --paper-material-elevation-1; } :host(.paper-material[elevation="2"]), .paper-material[elevation="2"] { @apply --paper-material-elevation-2; } :host(.paper-material[elevation="3"]), .paper-material[elevation="3"] { @apply --paper-material-elevation-3; } :host(.paper-material[elevation="4"]), .paper-material[elevation="4"] { @apply --paper-material-elevation-4; } :host(.paper-material[elevation="5"]), .paper-material[elevation="5"] { @apply --paper-material-elevation-5; } </style> </template> </dom-module> <dom-module id="paper-button"> <template strip-whitespace> <style include="paper-material-styles"> /* Need to specify the same specificity as the styles imported from paper-material. */ :host { @apply --layout-inline; @apply --layout-center-center; position: relative; box-sizing: border-box; min-width: 5.14em; margin: 0 0.29em; background: transparent; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-tap-highlight-color: transparent; font: inherit; text-transform: uppercase; outline-width: 0; border-radius: 3px; -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; user-select: none; cursor: pointer; z-index: 0; padding: 0.7em 0.57em; @apply --paper-font-common-base; @apply --paper-button; } :host([elevation="1"]) { @apply --paper-material-elevation-1; } :host([elevation="2"]) { @apply --paper-material-elevation-2; } :host([elevation="3"]) { @apply --paper-material-elevation-3; } :host([elevation="4"]) { @apply --paper-material-elevation-4; } :host([elevation="5"]) { @apply --paper-material-elevation-5; } :host([hidden]) { display: none !important; } :host([raised].keyboard-focus) { font-weight: bold; @apply --paper-button-raised-keyboard-focus; } :host(:not([raised]).keyboard-focus) { font-weight: bold; @apply --paper-button-flat-keyboard-focus; } :host([disabled]) { background: #eaeaea; color: #a8a8a8; cursor: auto; pointer-events: none; @apply --paper-button-disabled; } :host([animated]) { @apply --shadow-transition; } paper-ripple { color: var(--paper-button-ink-color); } </style> <slot></slot> </template> <script>//~~WEBPATH~~/paper-button/paper-button.html.js Polymer({is:"paper-button",behaviors:[Polymer.PaperButtonBehavior],properties:{raised:{type:Boolean,reflectToAttribute:!0,value:!1,observer:"_calculateElevation"}},_calculateElevation:function(){this.raised?Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this):this._setElevation(0)}}); </script> </dom-module> <dom-module id="facets-overview-chart"> <template> <style include="plottable-style"></style> <style> .plottable.chart-small { height: 46px; width: 250px; } .plottable.xaxis-small{ height: 30px; width: 250px; } .plottable.chart-big { height: 200px; width: 550px; } .plottable.xaxis-big { height: 50px; width: 550px; } #show_table_button { margin: 0 0 0 5px; padding: 0 3px; font-size: 7pt; background-color: #d3d3d3; } .dialog-row-entry { padding: 0 10px 0 0; } .table-header { border-bottom: 1px solid black; } .dialog-row, .dialog-header-row { display: flex; } .dialog-row.selected { border: 1px solid black } .dialog-row:hover { background-color: #D0D0D0; cursor: pointer; } .dialog-table { clear: left; } .label-cell { width: 90px; max-width: 90px; min-width: 90px; overflow-wrap: break-word; } .non-overflow-label-cell { width: 90px; max-width: 90px; min-width: 90px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .count-cell { width: 100px; max-width: 100px; min-width: 100px; overflow-wrap: break-word; } .weighted-cell { font-style: italic; } .data-list-small { height: 60px; } .data-list-big { height: 180px; width: 550px; } .hidechart { display: none; } .showchart { display: inline; } #tooltip { background-color: var(--paper-tooltip-background, #616161); opacity: 0; color: white; pointer-events:none; transition: opacity 0.3s; position: absolute; text-align:center; padding: 6px; border-radius: 2px; font-size: 12px; line-height: 1; margin-left: 50px; white-space: pre; top: 0px; } .toplevel { position: relative; text-align: left; padding-top: 4px; } </style> <div class="toplevel"> <template is="dom-if" if="[[_isStringChart(_chartType, chartSelection)]]"> <paper-button id="show_table_button" on-click="_toggleShowTable">[[_getShowTableButtonText(_showTable)]]</paper-button> </template> <div class$="[[_chartClass]]"> <div id="chart" class$="[[_chartSvgClass]]"></div> <div id="xaxis" class$="[[_xAxisSvgClass]]"></div> </div> <template is="dom-if" if="[[_showTable]]"> <div class="dialog-table"> <div class="dialog-header-row"> <div class="dialog-row-entry table-header label-cell">Value</div> <template is="dom-repeat" items="[[data]]" as="data"> <div class="dialog-row-entry table-header"> <div class="non-overflow-label-cell">[[data.name]]</div> </div> </template> </div> <iron-list items="[[_tableData]]" as="entry" class$="[[_tableDataClass]]"> <template> <div class$="[[_getEntryRowClass(entry, selection)]]" on-tap="_rowClick" data-value="[[_getEntryRowValue(entry)]]"> <div class="dialog-row-entry label-cell">[[entry.value]]</div> <template is="dom-repeat" items="[[entry.counts]]" as="count"> <div class$="[[_getCountCellClass(showWeighted)]]">[[count]]</div> </template> </div> </template> <iron-list> </iron-list></iron-list></div> </template> <div id="tooltip"></div> </div> </template> </dom-module> <script>//~~WEBPATH~~/facets-overview/components/facets-overview-chart/facets-overview-chart.js function Ml(b,d,f,h){const m=new Plottable.Plots.Line,w=new Plottable.Plots.Scatter;let l=Infinity,p=-Infinity;d.forEach((t,v)=>{const z=[],y=t.length;t.forEach((x,D)=>{var G=Pj(x.getLowValue());const J=Pj(hj(x));G<l&&(l=G);J>p&&(p=J);G=new Ej;G.bucket=x;G.datasetIndex=v;G.quantile=100*D/y;z.push(G)});if(0<t.length){const x=new Of;fj(x,hj(t[t.length-1]));gj(x,hj(t[t.length-1]));x.setSampleCount(t[t.length-1].getSampleCount());t=new Ej;t.bucket=x;t.datasetIndex=v;t.quantile=100;z.push(t)}m.addDataset(new Plottable.Dataset(z, {name:f[v]}));w.addDataset(new Plottable.Dataset(z,{name:f[v]}))});const n=isFinite(l)&&isFinite(p)?p===l?1:(p-l)/10:0;var q=[];isFinite(l)&&(q.push(l-n),isFinite(p)&&q.push(p+n));h=Nl(h);0<q.length&&h.domain(q);q=Nl(!1).domain([-d.length+.5,1]);d=new Plottable.Axes.Numeric(h,"bottom");d.formatter(Ol());m.x(t=>Pj(t.bucket.getLowValue()),h).y(t=>-1*t.datasetIndex,q);w.x(t=>Pj(t.bucket.getLowValue()),h).y(t=>-t.datasetIndex,q).size(t=>50===t.quantile?15:8).symbol(()=>Plottable.SymbolFactories.cross()); m.attr("stroke","gray").attr("opacity",b._chartAlpha);w.attr("fill",(t,v,z)=>z.metadata().name,b.dataModel.colorScale).attr("opacity",b._chartAlpha);q=new Plottable.Components.Group([m,w]);Pl(b,q,d,null,t=>w.entitiesAt(t),t=>t.quantile+"%: "+Kj(Pj(t.bucket.getLowValue()),2).toLocaleString(),t=>new Hj(b.feature,void 0,Pj(t.bucket.getLowValue()),Pj(hj(t.bucket))),t=>t.append("circle").attr("r",3).attr("stroke","black").attr("fill","none").attr("stroke-width","1px"),(t,v)=>t.attr("cx",v.position.x).attr("cy", v.position.y))} function Ql(b,d,f,h,m){const w=[],l=new Plottable.Plots.Rectangle;let p=Infinity,n=-Infinity,q=0;m&&(d=tk(d));d.forEach((y,x)=>{y.forEach(D=>{const G=Pj(D.getLowValue()),J=Pj(hj(D));D=Pj(D.getSampleCount());G<p&&(p=G);J>n&&(n=J);D>q&&(q=D);isFinite(G)&&isFinite(J)&&w.push(J-G)});l.addDataset(new Plottable.Dataset(y,{name:f[x]}))});let t=0<w.length?w.reduce(function(y,x){return y+x})/w.length:0;0===t&&(t=1);m=[];isFinite(p)&&(m.push(p),isFinite(n)&&m.push(n));d=new Plottable.Scales.Linear;0<m.length&& d.domain(m);m=Nl(h).domain([0]);const v=new Plottable.Axes.Numeric(d,"bottom"),z=new Plottable.Axes.Numeric(m,"left");z.formatter(Ol());v.formatter(Ol());l.x(y=>{let x=Pj(y.getLowValue());if(-Infinity===x||x===hj(y))y=Pj(hj(y)),isFinite(y)?x=y-t:(x=0,-Infinity===y&&(x-=t));return x},d).x2(y=>{let x=Pj(hj(y));if(Infinity===x||x===y.getLowValue())y=Pj(y.getLowValue()),isFinite(y)?x=y+t:(x=0,Infinity===y&&(x+=t));return x}).y(()=>0,m).y2(y=>Rl(b,y,q,h));l.attr("fill",(y,x,D)=>D.metadata().name,b.dataModel.colorScale).attr("opacity", b._chartAlpha);Pl(b,l,v,z,y=>l.entitiesAt(y),y=>Kj(Pj(y.getLowValue()),2).toLocaleString()+"-"+Kj(Pj(hj(y)),2).toLocaleString()+": "+Pj(y.getSampleCount()).toLocaleString(),y=>new Hj(b.feature,void 0,Pj(y.getLowValue()),Pj(hj(y))),y=>y.append("rect").attr("stroke","black").attr("fill","none").attr("stroke-width","1px"),(y,x)=>y.attr("x",x.position.x-x.selection._groups[0][0].width.baseVal.value/2).attr("y",x.position.y-x.selection._groups[0][0].height.baseVal.value/2).attr("width",x.selection._groups[0][0].width.baseVal.value).attr("height", x.selection._groups[0][0].height.baseVal.value))} function Sl(b,d,f,h){const m=f.map(v=>{v=Dl(b.dataModel,b.feature,v);return null!=v?v.getNumNonMissing()*v.getAvgNumValues():0}),w=Nj(d),l={};w.forEach((v,z)=>{l[v]=z});const p=(new Plottable.Scales.Linear).domain([0]);h=Nl(h).domain([0]);const n=new Plottable.Axes.Numeric(p,"bottom"),q=new Plottable.Axes.Numeric(h,"left"),t=new Plottable.Plots.Line;d=d.map((v,z)=>{const y=[],x=[],D=[];let G=-1;v.forEach(J=>{J=new J.constructor(Ce(J.toArray()));D.push(J)});0<z&&D.sort((J,F)=>l[Oj(lj(J))]-l[Oj(lj(F))]); D.forEach((J,F)=>{const E=l[Oj(lj(J))];for(var L=G+1;L<E;L++){var N=new Hg;Xd(N,4,w[L],"");Wd(N,1,L);Wd(N,2,L);0===y.length?N.setSampleCount(0):N.setSampleCount(y[y.length-1].getSampleCount());y.push(N);N=new Hg;Xd(N,4,w[L],"");Wd(N,1,L);Wd(N,2,L);N.setSampleCount(0);x.push(N)}G=E;L=J.clone();x.push(L);0===F?J.setSampleCount(Pj(J.getSampleCount())/m[z]):(F=0<E?E-1:F-1,J.setSampleCount(Pj(J.getSampleCount())/m[z]+Pj(y[F].getSampleCount())));Wd(J,1,E);Wd(J,2,E);y.push(J)});v=new Yj;v.name=f[z];v.percBuckets= y;v.rawBuckets=x;return v});b._tableData=ak(d);for(const v of d)t.addDataset(new Plottable.Dataset(v.percBuckets,{name:v.name}));t.x(v=>Pj(Ud(v,1,0)),p).y(v=>Pj(v.getSampleCount()),h);t.attr("stroke",(v,z,y)=>y.metadata().name,b.dataModel.colorScale).attr("opacity",b._chartAlpha);Pl(b,t,n,q,v=>t.entitiesAt(v),v=>Oj(lj(v))+": "+Kj(Pj(v.getSampleCount()),4).toLocaleString(),v=>new Hj(b.feature,lj(v)),v=>v.append("circle").attr("r",3).attr("stroke","black").attr("fill","none").attr("stroke-width","1px"), (v,z)=>v.attr("cx",z.position.x).attr("cy",z.position.y))} function Tl(b,d,f,h,m){const w=Nj(d),l=new Plottable.Scales.Linear;var p=new Plottable.Scales.Category;const n=Nl(h);p.domain(w);p=new Plottable.Axes.Category(p,"bottom");const q=new Plottable.Axes.Numeric(n,"left");q.formatter(Ol());m&&(d=tk(d));let t=0;m=d.map((z,y)=>{z.forEach(D=>{D=Pj(D.getSampleCount());D>t&&(t=D)});const x=new Yj;x.name=f[y];x.rawBuckets=z;return x});b._tableData=bk(m,w);const v=new Plottable.Plots.Bar;d.forEach((z,y)=>v.addDataset(new Plottable.Dataset(z,{name:f[y]})));v.x(z=> w.indexOf(Oj(lj(z))),l).y(z=>Rl(b,z,t,h),n);v.attr("fill",(z,y,x)=>x.metadata().name,b.dataModel.colorScale).attr("opacity",b._chartAlpha);Pl(b,v,p,q,z=>v.entitiesAt(z),z=>Oj(lj(z))+": "+Pj(z.getSampleCount()).toLocaleString(),z=>new Hj(b.feature,lj(z)),z=>z.append("rect").attr("stroke","black").attr("fill","none").attr("stroke-width","1px"),(z,y)=>z.attr("x",y.position.x-y.selection._groups[0][0].width.baseVal.value/2).attr("y",y.position.y).attr("width",y.selection._groups[0][0].width.baseVal.value).attr("height", y.selection._groups[0][0].height.baseVal.value))}function Nl(b){return b?new Plottable.Scales.ModifiedLog:new Plottable.Scales.Linear}function Ol(){const b=Plottable.Formatters.shortScale();return d=>1E3>Math.abs(d)?String(d):b(d)}function Rl(b,d,f,h){d=Pj(d.getSampleCount());!h&&0<d&&d/f<b._minBarHeightRatio&&(d=f*b._minBarHeightRatio);return d} function Pl(b,d,f,h,m,w,l,p,n){if(!b._showTable){var q=new Plottable.Components.Table([[null,h,d],[null,null,null]]),t=new Plottable.Components.Table([[null,null],[null,f]]);Plottable.RenderController.renderPolicy();var v=d3.select(b.$.chart),z=d3.select(b.$.xaxis),y=d3.select(b.$.tooltip);b.async(()=>{v.selectAll(".component").remove();z.selectAll(".component").remove();q.renderTo(b.$.chart);b._selectionElem=p(d.foreground());b._updateSelectionVisibility(b.selection);v.on("mouseenter",()=>{b._onPointer= new plottable_helpers.PointerInteraction;b._onPointerEnterFunction=x=>{x=m(x);0<x.length&&(x=x.map(D=>null==D.dataset.metadata().name||1===Cl(b.dataModel).length?w(D.datum):D.dataset.metadata().name+": "+w(D.datum)).join("\n"),y.text(x),y.style("opacity","1"))};b._onPointer.onPointerMove(b._onPointerEnterFunction);b._onPointerExitFunction=function(){y.style("opacity","0")};b._onPointer.onPointerExit(b._onPointerExitFunction);b._onPointer.attachTo(d);"Value list length"!==b.chartSelection&&(b._onClick= new Plottable.Interactions.Click,b._onClickFunction=x=>{x=m(x);0<x.length&&(n(b._selectionElem,x[0]),x=l(x[0].datum),Ul(b,x))},b._onClick.onClick(b._onClickFunction),b._onClick.attachTo(d))}).on("mouseleave",()=>{b._onPointer.detachFrom();b._onClick.detachFrom()});null!=h&&t.columnPadding(q.componentAt(1).width()+(q.componentAt(0)?q.componentAt(0).width():0));t.renderTo(b.$.xaxis)})}}function Ul(b,d){d.equals(b.selection)&&d.clear();b.selection=d;b.fire("feature-select",{selection:d})} Polymer({is:"facets-overview-chart",properties:{data:{type:Object,observer:"_updateData"},dataModel:Object,feature:String,_maxBucketsForBarChart:{type:Number,value:10,readOnly:!0},_chartAlpha:{type:Number,value:1},logScale:Boolean,showWeighted:Boolean,showPercentage:Boolean,chartSelection:{type:Number,observer:"_updateChartSelection"},selection:{type:Object,observer:"_updateSelectionVisibility",notify:!0},expandChart:Boolean,_selectionElem:Object,_minBarHeightRatio:{type:Number,value:.01,readOnly:!0}, _onClick:Object,_onClickFunction:Object,_onPointer:Object,_onPointerEnterFunction:Object,_onPointerExitFunction:Object,_tableData:Array,_showTable:{type:Boolean,value:!1},_chartType:Object,_chartClass:{type:String,computed:"_getChartClass(_showTable)"},_chartSvgClass:{type:String,computed:"_getChartSvgClass(expandChart)"},_xAxisSvgClass:{type:String,computed:"_getXAxisSvgClass(expandChart)"},_tableDataClass:{type:String,computed:"_getTableDataClass(expandChart)"}},observers:["_render(data, logScale, showWeighted, chartSelection, _showTable, expandChart, showPercentage, dataModel)"], _updateData(){this._showTable=!1},_updateChartSelection(){this._showTable=!1},_hasWeightedHistogram(b){return Uj(b)},_hasQuantiles(b){a:{if(b)for(let d=0;d<b.length;d++)if(b[d].histMap.Quantiles){b=!0;break a}b=!1}return b},_isStringChart(b,d){return(b===ck.CUMDIST_CHART||b===ck.BAR_CHART)&&"Value list length"!==d&&"Feature list length"!==d},_disableLogCheckbox(b,d){return b||"Standard"!==d},_render(b,d,f,h,m,w,l,p){this._onPointer&&(this._onPointer.offPointerMove(this._onPointerEnterFunction),this._onPointer.offPointerMove(this._onPointerExitFunction)); this._onClick&&this._onClick.offClick(this._onClickFunction);b&&(this._chartAlpha=2<=Cl(p).length?.4:1,m=b.map(n=>Lj(n,f,h)),this._chartType=ek(b,h,this._maxBucketsForBarChart),b=b.map(n=>n.name),"Value list length"===h||"Feature list length"===h||"Quantiles"===h?Ml(this,m,b,d):this._chartType===ck.HISTOGRAM?Ql(this,m,b,d,l):this._chartType===ck.CUMDIST_CHART?Sl(this,m,b,d):Tl(this,m,b,d,l))},_updateSelectionVisibility:function(b){this._selectionElem&&this._selectionElem.style("display",null==b|| b.name!==this.feature?"none":"inline")},_toggleShowTable(){this._showTable=!this._showTable},_getChartClass(b){return b?"hidechart":"showchart"},_getShowTableButtonText(b){return b?"show chart":"show raw data"},_getChartSvgClass(b){return b?"chart-big":"chart-small"},_getXAxisSvgClass(b){return b?"xaxis-big":"xaxis-small"},_getTableDataClass(b){return b?"data-list-big":"data-list-small"},_rowClick(b){Ul(this,new Hj(this.feature,b.currentTarget.dataValue))},_getEntryRowValue(b){return b.value},_getEntryRowClass(b, d){let f="dialog-row";null!=d&&d.name===this.feature&&d.stringValue===b.value&&(f+=" selected");return f},_getCountCellClass(b){return"dailog-row-entry count-cell"+(b?" weighted-cell":"")}}); </script> <dom-module id="facets-overview-table"> <template> <style> [hidden] { display: none !important; } .feature-name { font-weight: 500; max-width: 480px; word-wrap: break-word; margin: 0 0 4px 4px; } .table-name { font-weight: 500; word-wrap:break-word; padding: 4px 0 4px 8px; background: rgba(61,140,207,0.3); border: solid 0.5px rgba(0,0,0,0.1); } .feature-iron-list { overflow-x: hidden !important; height: 800px; } .chart-column { width: 280px; min-width: 280px; text-align: center; } .chart-column.header-cell { background: rgba(61,140,207,0.1); border-top: solid 0.5px rgba(0,0,0,0.1); border-bottom: solid 0.5px rgba(0,0,0,0.1); border-right: solid 0.5px rgba(0,0,0,0.1); padding-left: 8px; } .numeric-row { min-height: 80px; display: table-row; } .categorical-row { min-height: 98px; display: table-row; } .table-cell { display: table-cell; vertical-align: top; font-size: 14px; line-height: 1.2em; } .chart-column.table-cell { display: table-cell; vertical-align: top; padding: 10px 0 0 20px margin-right: 10px; } .header-cell { position: relative; min-height: 60px; } paper-checkbox { --paper-checkbox-size: 12px; --paper-checkbox-label-spacing: 2px; } .control-holder { position: absolute; bottom: 0; width: 100%; } .checkbox-holder { display: flex; padding-bottom: 2px; } .chart-checkbox { padding-right: 8px; font-size: 12px; } #weightbox { font-style: italic; } paper-dropdown-menu { display: block; width: 150px; --paper-input-container-label --paper-input-container-input: { font-size: 14px; } } .hidden { display: none; } </style> <div class$="[[_getTableWrapperClass(features)]]"> <div class="header-row"> <div class="header-cell table-cell"> <div class="table-name">[[_getTitle(numeric)]] Features ([[_getFeatureCountText(dataModel, numeric, features)]]) </div> <facets-overview-row-legend numeric="[[numeric]]" show-weighted="[[_showWeighted]]" has-custom="[[_hasCustomStats(dataModel)]]" data-model="[[dataModel]]"> </facets-overview-row-legend> </div> <div class="table-cell chart-column header-cell"> <div class="control-holder"> <paper-dropdown-menu label="Chart to show"> <paper-listbox class="dropdown-content" selected="{{_chartSelection}}" attr-for-selected="value" slot="dropdown-content"> <template is="dom-repeat" items="[[_chartSelectionTypes]]"> <paper-item value="[[item]]">[[item]]</paper-item> </template> </paper-listbox> </paper-dropdown-menu> <div class="checkbox-holder"> <paper-checkbox class="chart-checkbox" id="logbox" checked="{{_logScale}}">log</paper-checkbox> <paper-checkbox class="chart-checkbox" id="expandbox" checked="{{_expandCharts}}">expand</paper-checkbox> <template is="dom-if" if="[[_hasWeightedHistogram(features)]]"> <paper-checkbox class="chart-checkbox" id="weightbox" checked="{{_showWeighted}}">weighted</paper-checkbox> </template> <template is="dom-if" if="[[_hasMultipleDatasets(dataModel)]]"> <paper-checkbox class="chart-checkbox" id="percentbox" checked="{{_showPercentage}}" disabled="[[_chartSelectionHasQuantiles(_chartSelection)]]">percentages</paper-checkbox> </template> </div> </div> </div> </div> <iron-list items="[[features]]" as="feature" class="feature-iron-list"> <template> <div class$="[[_getTableRowClass(numeric)]]"> <div class="table-cell"> <div class="feature-name">[[_getFeatureName(feature)]]</div> <template is="dom-repeat" items="[[_getDatasets(dataModel)]]" as="dataset" index-as="datasetIndex"> <div> <facets-overview-row-stats stats="[[_getStats(dataModel, dataset, feature)]]" custom-stats="[[_getAllCustomStats(dataModel, feature)]]" show-weighted="[[_showWeighted]]" has-custom="[[_hasCustomStats(dataModel)]]" data-model="[[dataModel]]" dataset-index="[[datasetIndex]]" compare-mode="[[compareMode]]"> </facets-overview-row-stats> </div> </template> </div> <div class$="[[_getChartClass(_expandCharts)]]"> <facets-overview-chart data="[[_getChartData(dataModel, feature)]]" data-model="[[dataModel]]" feature="[[_getFeatureName(feature)]]" selection="{{featureSliceSelection}}" log-scale="[[_logScale]]" show-weighted="[[_showWeighted]]" show-percentage="[[_showPercentage]]" chart-selection="[[_chartSelection]]" expand-chart="[[_expandCharts]]"> </facets-overview-chart> </div> </div> </template> </iron-list> </div> </template> </dom-module> <script>//~~WEBPATH~~/facets-overview/components/facets-overview-table/facets-overview-table.js Polymer({is:"facets-overview-table",properties:{dataModel:{type:Object,observer:"_handleResize"},features:{type:Array,observer:"_handleResize"},featureSliceSelection:{type:Object,notify:!0},numeric:{type:Boolean,value:!1},compareMode:{type:Boolean,value:!1},_logScale:{type:Boolean,value:!1},_expandCharts:{type:Boolean,value:!1,observer:"_handleResize"},_showWeighted:{type:Boolean,value:!1},_showPercentage:{type:Boolean,value:!1},_chartSelection:{type:String,value:"Standard"},_enableLogScale:{type:Boolean, value:!0},_chartSelectionTypes:{type:Array,computed:"_computeChartSelectionTypes(numeric, dataModel, features)"},_maxHeight:{type:Number,value:800,readOnly:!0},_expandedRowHeight:{type:Number,value:330,readOnly:!0},_rowHeight:{type:Number,value:100,readOnly:!0}},_handleResize:function(){const b=this.shadowRoot.querySelector("iron-list");b&&this._expandedRowHeight&&this._rowHeight&&this._maxHeight&&this.features&&(b.style.height=Math.min((this.features?this.features.length:0)*(this._expandCharts?this._expandedRowHeight: this._rowHeight),this._maxHeight)+"px",b.fire("iron-resize"))},_computeChartSelectionTypes(b,d,f){const h=["Standard"];b&&h.push("Quantiles");if(b=0!==f.length)a:{if(b=this._getChartData(d,f[0]))for(var m=0;m<b.length;m++)if(b[m].histMap["Value list length"]){b=!0;break a}b=!1}b&&h.push("Value list length");if(null==d.containsFeatureListLengthData){a:{b=d.data;for(m=0;m<Ig(b).length;m++){const l=Ig(b)[m];for(let p=0;p<Qg(l).length;p++){var w=Qg(l)[p];if((w=mk(w))&&ue(w,Mf,9)){b=!0;break a}}}b=!1}d.containsFeatureListLengthData= b}d.containsFeatureListLengthData&&h.push("Feature list length");return h.concat(Fl(d,f))},attached(){setTimeout(()=>{this._handleResize()},1E3)},_chartSelectionHasQuantiles(b){return"Quantiles"===b||"Value list length"===b||"Feature list length"===b},_getTitle(b){return b?"Numeric":"Categorical"},_getFeatureName(b){return b.getName()},_hasCustomStats(b){if(null==b)b=!1;else{if(null==b.containsCustomStats){a:{var d=b.data;for(let f=0;f<Ig(d).length;f++){const h=Ig(d)[f];for(let m=0;m<Qg(h).length;m++){const w= Gh(Qg(h)[m]);if(null!=w&&0<w.length){d=!0;break a}}}d=!1}b.containsCustomStats=d}b=b.containsCustomStats}return b},_hasMultipleDatasets(b){return null==b?!1:1<Cl(b).length},_getAllCustomStats(b,d){const f=[],h={};Ig(b.data).forEach(m=>{const w=Gl(b,m.getName(),d.getName());null!=w&&(m=Gh(Qg(m)[w]))&&m.forEach(l=>{h[l.getName()]||(h[l.getName()]=!0,f.push(l))})});return f},_getDatasets(b){return b?Ig(b.data):null},_getStats(b,d,f){return b&&d&&f?b.getFeature(f.getName(),d.getName()):null},_getChartData:function(b, d){return b&&d?Jl(b,d.getName()):[]},_getFeatureCountText(b,d,f){b=b?Hl(b,d):0;f=f.length;return b===f?b.toLocaleString():f.toLocaleString()+"/"+b.toLocaleString()},_hasWeightedHistogram(b){return 0===b.length?!1:Uj(this._getChartData(this.dataModel,b[0]))},_getChartClass(b){let d="chart-column ";b||(d+="table-cell ");return d},_getTableWrapperClass(b){return b&&0!==b.length?"":"hidden"},_getTableRowClass(b){return b?"numeric-row":"categorical-row"}}); </script> <script>//~~WEBPATH~~/iron-validator-behavior/iron-validator-behavior.html.js Polymer.IronValidatorBehavior={properties:{validatorType:{type:String,value:"validator"},validatorName:{type:String,value:function(){return this.is}}},ready:function(){new Polymer.IronMeta({type:this.validatorType,key:this.validatorName,value:this})},validate:function(){}}; </script> <script>//~~WEBPATH~~/facets-overview/components/facets-overview/facets-overview-filter-validator.html.js Polymer({is:"facets-overview-filter-validator",behaviors:[Polymer.IronValidatorBehavior],validate:function(b){try{return new RegExp(b),!0}catch(d){return!1}}}); </script> <dom-module id="facets-overview"> <template> <style> :host { @apply --paper-font-common-base font-size: 10pt; } .controls { background: rgba(234,234,234,0.2); border-bottom: solid 0.5px rgba(0,0,0,0.2); display: flex; height: 60px; padding-left: 20px; } .feature-checkboxes { background: rgba(234,234,234,0.2); border-bottom: solid 0.5px rgba(0,0,0,0.2); display: flex; flex-wrap: wrap; padding: 8px 0 8px 20px; } .feature-checkbox { display: flex; padding: 0 0 0 16px; } paper-checkbox { font-size: 14px; } .input-control { --paper-input-container-label --paper-input-container-input: { font-size: 14px; }; } .features-text { line-height: 1; padding: 1px 0 0 0; font-size: 14px; } .left-dropdown { padding: 0 10px 0 0; } .middle-checkbox { margin-top: 30px; padding: 0 10px; } .right-input { width: 300px; padding: 0 10px; } .feature-iron-list { max-height: 800px; overflow: auto; } .feature-column { width: 200px; max-width: 200px; overflow-wrap: break-word; text-align: left; } .legend-column { width: 120px; } .stats-column { width: 150px; max-width: 150px; overflow-wrap: break-word; text-align: right; } .chart-column { width: 580px; text-align: center; } .table-row { display: table-row; } .table-cell { display: table-cell; vertical-align: top; padding: 10px 5px 0 } .chart-column.table-cell { display: table-cell; vertical-align: top; padding: 10px 0 0 20px } .header-row { clear: both; } .header-row > .table-cell { font-size: 14pt; padding: 0 5px 0; border-bottom: 1px solid black; } .stats-header-text { text-align: right; } .chart-header-text { text-align: center; } .table-holder { display: flex; flex-wrap: wrap; overflow-x: auto; margin-left: 30px; } .table-left { margin: 20px 20px 0 0; } .table-right { margin: 20px 0 0 0; } .hidden { display: none; } .legend-holder { display: flex; margin: 8px 0 0 38px; } .legend-box { width: 8px; height: 8px; margin-top: 6px; } .legend-row { display: flex; } .legend-name { margin: 3px 10px 0 5px; font-size: 12px; } /* Give min height to placeholder in paper-input to get around colab embedding * alignment issue. */ :host paper-input-container > .floated-label-placeholder { min-height: 20px; } </style> <template is="dom-if" if="[[_dataModel]]"> <div class$="[[_getControlsWrapperClass(_dataModel)]]"> <div class="controls"> <paper-dropdown-menu class="left-dropdown input-control" label="Sort by"> <paper-listbox class="dropdown-content" selected="{{_sortOrder}}" slot="dropdown-content"> <template is="dom-repeat" items="[[_sortOptions]]" as="option"> <paper-item>[[option.name]]</paper-item> </template> </paper-listbox> </paper-dropdown-menu> <paper-checkbox noink class="middle-checkbox" checked="{{_reverseOrder}}"> Reverse order </paper-checkbox> <paper-input class="right-input input-control" label="Feature search (regex enabled)" value="{{searchString}}" auto-validate="true" validator="filter-validator"> <facets-overview-filter-validator validator-name="filter-validator"> </facets-overview-filter-validator> </paper-input> </div> <div class="feature-checkboxes"> <div class="features-text">Features: </div> <template is="dom-repeat" items="[[_featureSpecArray]]" as="specAndList"> <div> <paper-checkbox noink checked="true" class="feature-checkbox" id="[[_getSpecCheckboxId(specAndList)]]" on-change="_featureSpecCheck"> [[_getSpecCheckboxText(specAndList)]] </paper-checkbox> </div> </template> </div> </div> <template is="dom-if" if="[[_hasMultipleDatasets(_dataModel)]]"> <div class="legend-holder"> <template is="dom-repeat" items="[[_getDatasets(_dataModel)]]" as="dataset" index-as="datasetIndex"> <div class="legend-row"> <div class="legend-box" style="[[_getLegendBoxStyle(_dataModel, datasetIndex)]]"></div> <div class="legend-name">[[_getDatasetName(_dataModel, datasetIndex)]]</div> </div> </template> </div> </template> <div class="table-holder"> <facets-overview-table features="[[_getNumericFeatureListItems(_dataModel, searchString, _sortOrder, _reverseOrder, _featureSpecCheckboxes)]]" data-model="[[_dataModel]]" feature-slice-selection="{{featureSliceSelection}}" numeric="true" class="table-left" compare-mode="[[compareMode]]"> </facets-overview-table> <facets-overview-table features="[[_getNonNumericFeatureListItems(_dataModel, searchString, _sortOrder, _reverseOrder, _featureSpecCheckboxes)]]" data-model="[[_dataModel]]" feature-slice-selection="{{featureSliceSelection}}" class="table-right" compare-mode="[[compareMode]]"> </facets-overview-table> </div> </template> </template> </dom-module> <script>//~~WEBPATH~~/facets-overview/components/facets-overview/facets-overview.js function Vl(b){if(!b||b.constructor===Object&&0===Object.keys(b).length)return null;if(b instanceof Uint8Array)return Kg(b);if("string"===typeof b||b instanceof String){b=atob(b);const d=new Uint8Array(b.length);for(let f=0;f<b.length;f++)d[f]=b.charCodeAt(f);return Kg(d)}return b.constructor===Object&&"function"===typeof De.fromObject?De.fromObject(b):b} function Wl(b,d,f){const h=b._sortOptions[d].map,m=f?-1:1;return(w,l)=>{w=h[w.getName()];l=h[l.getName()];return"undefined"==typeof w||"undefined"==typeof l?0:m*(w<l?-1:1)}}function Xl(b){if(b)try{const d=new RegExp(b,"i");return f=>d.test(f.getName())}catch(d){return null}else return null} function Yl(b,d,f,h,m,w,l){if(!d)return[];const p=Xl(f);f=vk(d);f=p?f.filter(n=>p(n)&&w[wk(d,n.getName())]):f.filter(n=>w[wk(d,n.getName())]);f=f.filter(n=>l?null!=Ug(n):null==Ug(n));return f.slice().sort(Wl(b,h,m))} Polymer({is:"facets-overview",properties:{searchString:{type:String,notify:!0},_sortOptions:Array,_reverseOrder:Boolean,_sortOrder:{type:Number,value:0},protoInput:{type:Object,observer:"_update"},featureSliceSelection:{type:Object,notify:!0},compareMode:{type:Boolean,value:!1},_dataModel:{type:Object,value:null},_featureSpecArray:{type:Array,computed:"_getFeatureSpecArray(_dataModel)"},_featureSpecCheckboxes:Array},_getFeatureSpecArray(b){if(!b)return[];var d=[];for(var f=0;16>f;f++)d.push(!0);this._featureSpecCheckboxes= d;d=[];for(f=0;16>f;f++)if(0!==b.featuresBySpec[f].length){const h=new Xj;h.features=b.featuresBySpec[f];h.spec=f;d.push(h)}return b=d},_getSpecCheckboxText(b){return Wj(b.spec)+"("+b.features.length+")"},_getSpecCheckboxId(b){return String(b.spec)},_featureSpecCheck(b){if(b){const d=[],f=+b.target.id;for(let h=0;16>h;h++)f===h?d.push(b.target.checked):d.push(this._featureSpecCheckboxes[h]);this._featureSpecCheckboxes=d}},_update(){this.featureSliceSelection=null;let b;{const h=Vl(this.protoInput); if(!h){this._dataModel=null;return}b=new Ll(Sj(h))}this.set("_sortOptions",[{name:"Feature order",map:{}},{name:"Non-uniformity",map:{}},{name:"Alphabetical",map:{}},{name:"Amount missing/zero",map:{}}]);const d=Ig(b.data),f=1<d.length;f&&this.push("_sortOptions",{name:"Distribution distance",map:{}});vk(b).forEach((h,m)=>{this._sortOptions[0].map[h.getName()]=m;m=Jl(b,h.getName());this._sortOptions[1].map[h.getName()]=m.reduce((w,l)=>{l=l.histMap.Standard?Ij(l.histMap.Standard.getBucketsList()): 1;return Math.min(w,l)},1);this._sortOptions[2].map[h.getName()]=h.getName();this._sortOptions[3].map[h.getName()]=d.reduce((w,l)=>{{var p=this._getStats(b,l,h),n=l=0;const q=mk(p);p&&Ug(p)&&(p=Ug(p),l+=Pj(Ud(p,4,0)));q&&(n=Pj(q.getNumMissing()),l+=n,n=Pj(q.getNumNonMissing())+n);l=0===n?1:l/n}return Math.min(w,-1*l)},0);f&&(this._sortOptions[4].map[h.getName()]=-1*Qj(m))},this);this._dataModel=b},_getStats(b,d,f){return b&&d&&f?b.getFeature(f.getName(),d.getName()):null},_getNumericFeatureListItems(b, d,f,h,m){return Yl(this,b,d,f,h,m,!0)},_getNonNumericFeatureListItems(b,d,f,h,m){return Yl(this,b,d,f,h,m,!1)},_getControlsWrapperClass(b){return!b||1>=vk(b).length?"hidden":""},_getDatasetName(b,d){return Cl(b)[d]},_getLegendBoxStyle(b,d){return"background-color:"+Kl(b,d)},_getDatasets(b){return b?Ig(b.data):null},_hasMultipleDatasets(b){return null==b?!1:1<Cl(b).length},getStatsProto(b){return xj(b)}}); </script> <iron-iconset-svg name="icons" size="24"> <svg><defs> <g id="3d-rotation"><path d="M7.52 21.48C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81-1.33 1.32zm.89-6.52c-.19 0-.37-.03-.52-.08-.16-.06-.29-.13-.4-.24-.11-.1-.2-.22-.26-.37-.06-.14-.09-.3-.09-.47h-1.3c0 .36.07.68.21.95.14.27.33.5.56.69.24.18.51.32.82.41.3.1.62.15.96.15.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72c.13-.29.2-.61.2-.97 0-.19-.02-.38-.07-.56-.05-.18-.12-.35-.23-.51-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33.15-.13.27-.27.37-.42.1-.15.17-.3.22-.46.05-.16.07-.32.07-.48 0-.36-.06-.68-.18-.96-.12-.28-.29-.51-.51-.69-.2-.19-.47-.33-.77-.43C9.1 8.05 8.76 8 8.39 8c-.36 0-.69.05-1 .16-.3.11-.57.26-.79.45-.21.19-.38.41-.51.67-.12.26-.18.54-.18.85h1.3c0-.17.03-.32.09-.45s.14-.25.25-.34c.11-.09.23-.17.38-.22.15-.05.3-.08.48-.08.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49-.05.15-.14.27-.25.37-.11.1-.25.18-.41.24-.16.06-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4.07.16.1.35.1.57 0 .41-.12.72-.35.93-.23.23-.55.33-.95.33zm8.55-5.92c-.32-.33-.7-.59-1.14-.77-.43-.18-.92-.27-1.46-.27H12v8h2.3c.55 0 1.06-.09 1.51-.27.45-.18.84-.43 1.16-.76.32-.33.57-.73.74-1.19.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57-.18-.47-.43-.87-.75-1.2zm-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85-.19.23-.43.41-.71.53-.29.12-.62.18-.99.18h-.91V9.12h.97c.72 0 1.27.23 1.64.69.38.46.57 1.12.57 1.99v.4zM12 0l-.66.03 3.81 3.81 1.33-1.33c3.27 1.55 5.61 4.72 5.96 8.48h1.5C23.44 4.84 18.29 0 12 0z" /></g> <g id="accessibility"><path d="M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z" /></g> <g id="accessible"><circle cx="12" cy="4" r="2" /><path d="M19 13v-2c-1.54.02-3.09-.75-4.07-1.83l-1.29-1.43c-.17-.19-.38-.34-.61-.45-.01 0-.01-.01-.02-.01H13c-.35-.2-.75-.3-1.19-.26C10.76 7.11 10 8.04 10 9.09V15c0 1.1.9 2 2 2h5v5h2v-5.5c0-1.1-.9-2-2-2h-3v-3.45c1.29 1.07 3.25 1.94 5 1.95zm-6.17 5c-.41 1.16-1.52 2-2.83 2-1.66 0-3-1.34-3-3 0-1.31.84-2.41 2-2.83V12.1c-2.28.46-4 2.48-4 4.9 0 2.76 2.24 5 5 5 2.42 0 4.44-1.72 4.9-4h-2.07z" /></g> <g id="account-balance"><path d="M4 10v7h3v-7H4zm6 0v7h3v-7h-3zM2 22h19v-3H2v3zm14-12v7h3v-7h-3zm-4.5-9L2 6v2h19V6l-9.5-5z" /></g> <g id="account-balance-wallet"><path d="M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2h9zm-9-2h10V8H12v8zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z" /></g> <g id="account-box"><path d="M3 5v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2zm12 4c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3zm-9 8c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1H6v-1z" /></g> <g id="account-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z" /></g> <g id="add"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" /></g> <g id="add-alert"><path d="M10.01 21.01c0 1.1.89 1.99 1.99 1.99s1.99-.89 1.99-1.99h-3.98zm8.87-4.19V11c0-3.25-2.25-5.97-5.29-6.69v-.72C13.59 2.71 12.88 2 12 2s-1.59.71-1.59 1.59v.72C7.37 5.03 5.12 7.75 5.12 11v5.82L3 18.94V20h18v-1.06l-2.12-2.12zM16 13.01h-3v3h-2v-3H8V11h3V8h2v3h3v2.01z" /></g> <g id="add-box"><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4v2z" /></g> <g id="add-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z" /></g> <g id="add-circle-outline"><path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" /></g> <g id="add-shopping-cart"><path d="M11 9h2V6h3V4h-3V1h-2v3H8v2h3v3zm-4 9c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2zm-9.83-3.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.86-7.01L19.42 4h-.01l-1.1 2-2.76 5H8.53l-.13-.27L6.16 6l-.95-2-.94-2H1v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.13 0-.25-.11-.25-.25z" /></g> <g id="alarm"><path d="M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z" /></g> <g id="alarm-add"><path d="M7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7zm1-11h-2v3H8v2h3v3h2v-3h3v-2h-3V9z" /></g> <g id="alarm-off"><path d="M12 6c3.87 0 7 3.13 7 7 0 .84-.16 1.65-.43 2.4l1.52 1.52c.58-1.19.91-2.51.91-3.92 0-4.97-4.03-9-9-9-1.41 0-2.73.33-3.92.91L9.6 6.43C10.35 6.16 11.16 6 12 6zm10-.28l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM2.92 2.29L1.65 3.57 2.98 4.9l-1.11.93 1.42 1.42 1.11-.94.8.8C3.83 8.69 3 10.75 3 13c0 4.97 4.02 9 9 9 2.25 0 4.31-.83 5.89-2.2l2.2 2.2 1.27-1.27L3.89 3.27l-.97-.98zm13.55 16.1C15.26 19.39 13.7 20 12 20c-3.87 0-7-3.13-7-7 0-1.7.61-3.26 1.61-4.47l9.86 9.86zM8.02 3.28L6.6 1.86l-.86.71 1.42 1.42.86-.71z" /></g> <g id="alarm-on"><path d="M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7zm-1.46-5.47L8.41 12.4l-1.06 1.06 3.18 3.18 6-6-1.06-1.06-4.93 4.95z" /></g> <g id="all-out"><path d="M16.21 4.16l4 4v-4zm4 12l-4 4h4zm-12 4l-4-4v4zm-4-12l4-4h-4zm12.95-.95c-2.73-2.73-7.17-2.73-9.9 0s-2.73 7.17 0 9.9 7.17 2.73 9.9 0 2.73-7.16 0-9.9zm-1.1 8.8c-2.13 2.13-5.57 2.13-7.7 0s-2.13-5.57 0-7.7 5.57-2.13 7.7 0 2.13 5.57 0 7.7z" /></g> <g id="android"><path d="M6 18c0 .55.45 1 1 1h1v3.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V19h2v3.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V19h1c.55 0 1-.45 1-1V8H6v10zM3.5 8C2.67 8 2 8.67 2 9.5v7c0 .83.67 1.5 1.5 1.5S5 17.33 5 16.5v-7C5 8.67 4.33 8 3.5 8zm17 0c-.83 0-1.5.67-1.5 1.5v7c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5v-7c0-.83-.67-1.5-1.5-1.5zm-4.97-5.84l1.3-1.3c.2-.2.2-.51 0-.71-.2-.2-.51-.2-.71 0l-1.48 1.48C13.85 1.23 12.95 1 12 1c-.96 0-1.86.23-2.66.63L7.85.15c-.2-.2-.51-.2-.71 0-.2.2-.2.51 0 .71l1.31 1.31C6.97 3.26 6 5.01 6 7h12c0-1.99-.97-3.75-2.47-4.84zM10 5H9V4h1v1zm5 0h-1V4h1v1z" /></g> <g id="announcement"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z" /></g> <g id="apps"><path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z" /></g> <g id="archive"><path d="M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z" /></g> <g id="arrow-back"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /></g> <g id="arrow-downward"><path d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z" /></g> <g id="arrow-drop-down"><path d="M7 10l5 5 5-5z" /></g> <g id="arrow-drop-down-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 12l-4-4h8l-4 4z" /></g> <g id="arrow-drop-up"><path d="M7 14l5-5 5 5z" /></g> <g id="arrow-forward"><path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" /></g> <g id="arrow-upward"><path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" /></g> <g id="aspect-ratio"><path d="M19 12h-2v3h-3v2h5v-5zM7 9h3V7H5v5h2V9zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z" /></g> <g id="assessment"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z" /></g> <g id="assignment"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z" /></g> <g id="assignment-ind"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z" /></g> <g id="assignment-late"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-6 15h-2v-2h2v2zm0-4h-2V8h2v6zm-1-9c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z" /></g> <g id="assignment-return"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm4 12h-4v3l-5-5 5-5v3h4v4z" /></g> <g id="assignment-returned"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 15l-5-5h3V9h4v4h3l-5 5z" /></g> <g id="assignment-turned-in"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-2 14l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z" /></g> <g id="attachment"><path d="M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5C8.12 15 7 13.88 7 12.5S8.12 10 9.5 10H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5z" /></g> <g id="autorenew"><path d="M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z" /></g> <g id="backspace"><path d="M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 12.59L17.59 17 14 13.41 10.41 17 9 15.59 12.59 12 9 8.41 10.41 7 14 10.59 17.59 7 19 8.41 15.41 12 19 15.59z" /></g> <g id="backup"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z" /></g> <g id="block"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z" /></g> <g id="book"><path d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 4h5v8l-2.5-1.5L6 12V4z" /></g> <g id="bookmark"><path d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z" /></g> <g id="bookmark-border"><path d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2zm0 15l-5-2.18L7 18V5h10v13z" /></g> <g id="bug-report"><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z" /></g> <g id="build"><path d="M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z" /></g> <g id="cached"><path d="M19 8l-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z" /></g> <g id="camera-enhance"><path d="M9 3L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2h-3.17L15 3H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-1l1.25-2.75L16 13l-2.75-1.25L12 9l-1.25 2.75L8 13l2.75 1.25z" /></g> <g id="cancel"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" /></g> <g id="card-giftcard"><path d="M20 6h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3-1.05 0-1.96.54-2.5 1.35l-.5.67-.5-.68C10.96 2.54 10.05 2 9 2 7.34 2 6 3.34 6 5c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm11 15H4v-2h16v2zm0-5H4V8h5.08L7 10.83 8.62 12 11 8.76l1-1.36 1 1.36L15.38 12 17 10.83 14.92 8H20v6z" /></g> <g id="card-membership"><path d="M20 2H4c-1.11 0-2 .89-2 2v11c0 1.11.89 2 2 2h4v5l4-2 4 2v-5h4c1.11 0 2-.89 2-2V4c0-1.11-.89-2-2-2zm0 13H4v-2h16v2zm0-5H4V4h16v6z" /></g> <g id="card-travel"><path d="M20 6h-3V4c0-1.11-.89-2-2-2H9c-1.11 0-2 .89-2 2v2H4c-1.11 0-2 .89-2 2v11c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zM9 4h6v2H9V4zm11 15H4v-2h16v2zm0-5H4V8h3v2h2V8h6v2h2V8h3v6z" /></g> <g id="change-history"><path d="M12 7.77L18.39 18H5.61L12 7.77M12 4L2 20h20L12 4z" /></g> <g id="check"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" /></g> <g id="check-box"><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" /></g> <g id="check-box-outline-blank"><path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" /></g> <g id="check-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" /></g> <g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" /></g> <g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" /></g> <g id="chrome-reader-mode"><path d="M13 12h7v1.5h-7zm0-2.5h7V11h-7zm0 5h7V16h-7zM21 4H3c-1.1 0-2 .9-2 2v13c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 15h-9V6h9v13z" /></g> <g id="class"><path d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 4h5v8l-2.5-1.5L6 12V4z" /></g> <g id="clear"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" /></g> <g id="close"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" /></g> <g id="cloud"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z" /></g> <g id="cloud-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.5 14H8c-1.66 0-3-1.34-3-3s1.34-3 3-3l.14.01C8.58 8.28 10.13 7 12 7c2.21 0 4 1.79 4 4h.5c1.38 0 2.5 1.12 2.5 2.5S17.88 16 16.5 16z" /></g> <g id="cloud-done"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM10 17l-3.5-3.5 1.41-1.41L10 14.17 15.18 9l1.41 1.41L10 17z" /></g> <g id="cloud-download"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z" /></g> <g id="cloud-off"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4c-1.48 0-2.85.43-4.01 1.17l1.46 1.46C10.21 6.23 11.08 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 1.13-.64 2.11-1.56 2.62l1.45 1.45C23.16 18.16 24 16.68 24 15c0-2.64-2.05-4.78-4.65-4.96zM3 5.27l2.75 2.74C2.56 8.15 0 10.77 0 14c0 3.31 2.69 6 6 6h11.73l2 2L21 20.73 4.27 4 3 5.27zM7.73 10l8 8H6c-2.21 0-4-1.79-4-4s1.79-4 4-4h1.73z" /></g> <g id="cloud-queue"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4s1.79-4 4-4h.71C7.37 7.69 9.48 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3s-1.34 3-3 3z" /></g> <g id="cloud-upload"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z" /></g> <g id="code"><path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z" /></g> <g id="compare-arrows"><path d="M9.01 14H2v2h7.01v3L13 15l-3.99-4v3zm5.98-1v-3H22V8h-7.01V5L11 9l3.99 4z" /></g> <g id="content-copy"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" /></g> <g id="content-cut"><path d="M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1L9.64 7.64zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zM19 3l-6 6 2 2 7-7V3z" /></g> <g id="content-paste"><path d="M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z" /></g> <g id="copyright"><path d="M10.08 10.86c.05-.33.16-.62.3-.87s.34-.46.59-.62c.24-.15.54-.22.91-.23.23.01.44.05.63.13.2.09.38.21.52.36s.25.33.34.53.13.42.14.64h1.79c-.02-.47-.11-.9-.28-1.29s-.4-.73-.7-1.01-.66-.5-1.08-.66-.88-.23-1.39-.23c-.65 0-1.22.11-1.7.34s-.88.53-1.2.92-.56.84-.71 1.36S8 11.29 8 11.87v.27c0 .58.08 1.12.23 1.64s.39.97.71 1.35.72.69 1.2.91 1.05.34 1.7.34c.47 0 .91-.08 1.32-.23s.77-.36 1.08-.63.56-.58.74-.94.29-.74.3-1.15h-1.79c-.01.21-.06.4-.15.58s-.21.33-.36.46-.32.23-.52.3c-.19.07-.39.09-.6.1-.36-.01-.66-.08-.89-.23-.25-.16-.45-.37-.59-.62s-.25-.55-.3-.88-.08-.67-.08-1v-.27c0-.35.03-.68.08-1.01zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" /></g> <g id="create"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" /></g> <g id="create-new-folder"><path d="M20 6h-8l-2-2H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-1 8h-3v3h-2v-3h-3v-2h3V9h2v3h3v2z" /></g> <g id="credit-card"><path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z" /></g> <g id="dashboard"><path d="M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z" /></g> <g id="date-range"><path d="M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z" /></g> <g id="delete"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" /></g> <g id="delete-forever"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z" /></g> <g id="delete-sweep"><path d="M15 16h4v2h-4zm0-8h7v2h-7zm0 4h6v2h-6zM3 18c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V8H3v10zM14 5h-3l-1-1H6L5 5H2v2h12z" /></g> <g id="description"><path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z" /></g> <g id="dns"><path d="M20 13H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 19c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM20 3H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" /></g> <g id="done"><path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" /></g> <g id="done-all"><path d="M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z" /></g> <g id="donut-large"><path d="M11 5.08V2c-5 .5-9 4.81-9 10s4 9.5 9 10v-3.08c-3-.48-6-3.4-6-6.92s3-6.44 6-6.92zM18.97 11H22c-.47-5-4-8.53-9-9v3.08C16 5.51 18.54 8 18.97 11zM13 18.92V22c5-.47 8.53-4 9-9h-3.03c-.43 3-2.97 5.49-5.97 5.92z" /></g> <g id="donut-small"><path d="M11 9.16V2c-5 .5-9 4.79-9 10s4 9.5 9 10v-7.16c-1-.41-2-1.52-2-2.84s1-2.43 2-2.84zM14.86 11H22c-.48-4.75-4-8.53-9-9v7.16c1 .3 1.52.98 1.86 1.84zM13 14.84V22c5-.47 8.52-4.25 9-9h-7.14c-.34.86-.86 1.54-1.86 1.84z" /></g> <g id="drafts"><path d="M21.99 8c0-.72-.37-1.35-.94-1.7L12 1 2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2l-.01-10zM12 13L3.74 7.84 12 3l8.26 4.84L12 13z" /></g> <g id="eject"><path d="M5 17h14v2H5zm7-12L5.33 15h13.34z" /></g> <g id="error"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" /></g> <g id="error-outline"><path d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" /></g> <g id="euro-symbol"><path d="M15 18.5c-2.51 0-4.68-1.42-5.76-3.5H15v-2H8.58c-.05-.33-.08-.66-.08-1s.03-.67.08-1H15V9H9.24C10.32 6.92 12.5 5.5 15 5.5c1.61 0 3.09.59 4.23 1.57L21 5.3C19.41 3.87 17.3 3 15 3c-3.92 0-7.24 2.51-8.48 6H3v2h3.06c-.04.33-.06.66-.06 1 0 .34.02.67.06 1H3v2h3.52c1.24 3.49 4.56 6 8.48 6 2.31 0 4.41-.87 6-2.3l-1.78-1.77c-1.13.98-2.6 1.57-4.22 1.57z" /></g> <g id="event"><path d="M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z" /></g> <g id="event-seat"><path d="M4 18v3h3v-3h10v3h3v-6H4zm15-8h3v3h-3zM2 10h3v3H2zm15 3H7V5c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2v8z" /></g> <g id="exit-to-app"><path d="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" /></g> <g id="expand-less"><path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" /></g> <g id="expand-more"><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" /></g> <g id="explore"><path d="M12 10.9c-.61 0-1.1.49-1.1 1.1s.49 1.1 1.1 1.1c.61 0 1.1-.49 1.1-1.1s-.49-1.1-1.1-1.1zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm2.19 12.19L6 18l3.81-8.19L18 6l-3.81 8.19z" /></g> <g id="extension"><path d="M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z" /></g> <g id="face"><path d="M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8z" /></g> <g id="favorite"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" /></g> <g id="favorite-border"><path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z" /></g> <g id="feedback"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 12h-2v-2h2v2zm0-4h-2V6h2v4z" /></g> <g id="file-download"><path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" /></g> <g id="file-upload"><path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z" /></g> <g id="filter-list"><path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z" /></g> <g id="find-in-page"><path d="M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z" /></g> <g id="find-replace"><path d="M11 6c1.38 0 2.63.56 3.54 1.46L12 10h6V4l-2.05 2.05C14.68 4.78 12.93 4 11 4c-3.53 0-6.43 2.61-6.92 6H6.1c.46-2.28 2.48-4 4.9-4zm5.64 9.14c.66-.9 1.12-1.97 1.28-3.14H15.9c-.46 2.28-2.48 4-4.9 4-1.38 0-2.63-.56-3.54-1.46L10 12H4v6l2.05-2.05C7.32 17.22 9.07 18 11 18c1.55 0 2.98-.51 4.14-1.36L20 21.49 21.49 20l-4.85-4.86z" /></g> <g id="fingerprint"><path d="M17.81 4.47c-.08 0-.16-.02-.23-.06C15.66 3.42 14 3 12.01 3c-1.98 0-3.86.47-5.57 1.41-.24.13-.54.04-.68-.2-.13-.24-.04-.55.2-.68C7.82 2.52 9.86 2 12.01 2c2.13 0 3.99.47 6.03 1.52.25.13.34.43.21.67-.09.18-.26.28-.44.28zM3.5 9.72c-.1 0-.2-.03-.29-.09-.23-.16-.28-.47-.12-.7.99-1.4 2.25-2.5 3.75-3.27C9.98 4.04 14 4.03 17.15 5.65c1.5.77 2.76 1.86 3.75 3.25.16.22.11.54-.12.7-.23.16-.54.11-.7-.12-.9-1.26-2.04-2.25-3.39-2.94-2.87-1.47-6.54-1.47-9.4.01-1.36.7-2.5 1.7-3.4 2.96-.08.14-.23.21-.39.21zm6.25 12.07c-.13 0-.26-.05-.35-.15-.87-.87-1.34-1.43-2.01-2.64-.69-1.23-1.05-2.73-1.05-4.34 0-2.97 2.54-5.39 5.66-5.39s5.66 2.42 5.66 5.39c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-2.42-2.09-4.39-4.66-4.39-2.57 0-4.66 1.97-4.66 4.39 0 1.44.32 2.77.93 3.85.64 1.15 1.08 1.64 1.85 2.42.19.2.19.51 0 .71-.11.1-.24.15-.37.15zm7.17-1.85c-1.19 0-2.24-.3-3.1-.89-1.49-1.01-2.38-2.65-2.38-4.39 0-.28.22-.5.5-.5s.5.22.5.5c0 1.41.72 2.74 1.94 3.56.71.48 1.54.71 2.54.71.24 0 .64-.03 1.04-.1.27-.05.53.13.58.41.05.27-.13.53-.41.58-.57.11-1.07.12-1.21.12zM14.91 22c-.04 0-.09-.01-.13-.02-1.59-.44-2.63-1.03-3.72-2.1-1.4-1.39-2.17-3.24-2.17-5.22 0-1.62 1.38-2.94 3.08-2.94 1.7 0 3.08 1.32 3.08 2.94 0 1.07.93 1.94 2.08 1.94s2.08-.87 2.08-1.94c0-3.77-3.25-6.83-7.25-6.83-2.84 0-5.44 1.58-6.61 4.03-.39.81-.59 1.76-.59 2.8 0 .78.07 2.01.67 3.61.1.26-.03.55-.29.64-.26.1-.55-.04-.64-.29-.49-1.31-.73-2.61-.73-3.96 0-1.2.23-2.29.68-3.24 1.33-2.79 4.28-4.6 7.51-4.6 4.55 0 8.25 3.51 8.25 7.83 0 1.62-1.38 2.94-3.08 2.94s-3.08-1.32-3.08-2.94c0-1.07-.93-1.94-2.08-1.94s-2.08.87-2.08 1.94c0 1.71.66 3.31 1.87 4.51.95.94 1.86 1.46 3.27 1.85.27.07.42.35.35.61-.05.23-.26.38-.47.38z" /></g> <g id="first-page"><path d="M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z" /></g> <g id="flag"><path d="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z" /></g> <g id="flight-land"><path d="M2.5 19h19v2h-19zm7.18-5.73l4.35 1.16 5.31 1.42c.8.21 1.62-.26 1.84-1.06.21-.8-.26-1.62-1.06-1.84l-5.31-1.42-2.76-9.02L10.12 2v8.28L5.15 8.95l-.93-2.32-1.45-.39v5.17l1.6.43 5.31 1.43z" /></g> <g id="flight-takeoff"><path d="M2.5 19h19v2h-19zm19.57-9.36c-.21-.8-1.04-1.28-1.84-1.06L14.92 10l-6.9-6.43-1.93.51 4.14 7.17-4.97 1.33-1.97-1.54-1.45.39 1.82 3.16.77 1.33 1.6-.43 5.31-1.42 4.35-1.16L21 11.49c.81-.23 1.28-1.05 1.07-1.85z" /></g> <g id="flip-to-back"><path d="M9 7H7v2h2V7zm0 4H7v2h2v-2zm0-8c-1.11 0-2 .9-2 2h2V3zm4 12h-2v2h2v-2zm6-12v2h2c0-1.1-.9-2-2-2zm-6 0h-2v2h2V3zM9 17v-2H7c0 1.1.89 2 2 2zm10-4h2v-2h-2v2zm0-4h2V7h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zM5 7H3v12c0 1.1.89 2 2 2h12v-2H5V7zm10-2h2V3h-2v2zm0 12h2v-2h-2v2z" /></g> <g id="flip-to-front"><path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm2 4v-2H3c0 1.1.89 2 2 2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-18H9c-1.11 0-2 .9-2 2v10c0 1.1.89 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H9V5h10v10zm-8 6h2v-2h-2v2zm-4 0h2v-2H7v2z" /></g> <g id="folder"><path d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z" /></g> <g id="folder-open"><path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" /></g> <g id="folder-shared"><path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-5 3c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm4 8h-8v-1c0-1.33 2.67-2 4-2s4 .67 4 2v1z" /></g> <g id="font-download"><path d="M9.93 13.5h4.14L12 7.98zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-4.05 16.5l-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13h-2.09z" /></g> <g id="forward"><path d="M12 8V4l8 8-8 8v-4H4V8z" /></g> <g id="fullscreen"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z" /></g> <g id="fullscreen-exit"><path d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z" /></g> <g id="g-translate"><path d="M20 5h-9.12L10 2H4c-1.1 0-2 .9-2 2v13c0 1.1.9 2 2 2h7l1 3h8c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zM7.17 14.59c-2.25 0-4.09-1.83-4.09-4.09s1.83-4.09 4.09-4.09c1.04 0 1.99.37 2.74 1.07l.07.06-1.23 1.18-.06-.05c-.29-.27-.78-.59-1.52-.59-1.31 0-2.38 1.09-2.38 2.42s1.07 2.42 2.38 2.42c1.37 0 1.96-.87 2.12-1.46H7.08V9.91h3.95l.01.07c.04.21.05.4.05.61 0 2.35-1.61 4-3.92 4zm6.03-1.71c.33.6.74 1.18 1.19 1.7l-.54.53-.65-2.23zm.77-.76h-.99l-.31-1.04h3.99s-.34 1.31-1.56 2.74c-.52-.62-.89-1.23-1.13-1.7zM21 20c0 .55-.45 1-1 1h-7l2-2-.81-2.77.92-.92L17.79 18l.73-.73-2.71-2.68c.9-1.03 1.6-2.25 1.92-3.51H19v-1.04h-3.64V9h-1.04v1.04h-1.96L11.18 6H20c.55 0 1 .45 1 1v13z" /></g> <g id="gavel"><path d="M1 21h12v2H1zM5.245 8.07l2.83-2.827 14.14 14.142-2.828 2.828zM12.317 1l5.657 5.656-2.83 2.83-5.654-5.66zM3.825 9.485l5.657 5.657-2.828 2.828-5.657-5.657z" /></g> <g id="gesture"><path d="M4.59 6.89c.7-.71 1.4-1.35 1.71-1.22.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1H21v-2.5h-2.47c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3 5.12 3 3.97 4 3.72 4.25c-.36.36-.66.66-.88.93l1.75 1.71zm9.29 11.66c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z" /></g> <g id="get-app"><path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" /></g> <g id="gif"><path d="M11.5 9H13v6h-1.5zM9 9H6c-.6 0-1 .5-1 1v4c0 .5.4 1 1 1h3c.6 0 1-.5 1-1v-2H8.5v1.5h-2v-3H10V10c0-.5-.4-1-1-1zm10 1.5V9h-4.5v6H16v-2h2v-1.5h-2v-1z" /></g> <g id="grade"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z" /></g> <g id="group-work"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM8 17.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5zM9.5 8c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5S9.5 9.38 9.5 8zm6.5 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" /></g> <g id="help"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z" /></g> <g id="help-outline"><path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z" /></g> <g id="highlight-off"><path d="M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" /></g> <g id="history"><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z" /></g> <g id="home"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" /></g> <g id="hourglass-empty"><path d="M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5l-4-4V4h8v3.5l-4 4z" /></g> <g id="hourglass-full"><path d="M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6z" /></g> <g id="http"><path d="M4.5 11h-2V9H1v6h1.5v-2.5h2V15H6V9H4.5v2zm2.5-.5h1.5V15H10v-4.5h1.5V9H7v1.5zm5.5 0H14V15h1.5v-4.5H17V9h-4.5v1.5zm9-1.5H18v6h1.5v-2h2c.8 0 1.5-.7 1.5-1.5v-1c0-.8-.7-1.5-1.5-1.5zm0 2.5h-2v-1h2v1z" /></g> <g id="https"><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z" /></g> <g id="important-devices"><path d="M23 11.01L18 11c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5c.55 0 1-.45 1-1v-9c0-.55-.45-.99-1-.99zM23 20h-5v-7h5v7zM20 2H2C.89 2 0 2.89 0 4v12c0 1.1.89 2 2 2h7v2H7v2h8v-2h-2v-2h2v-2H2V4h18v5h2V4c0-1.11-.9-2-2-2zm-8.03 7L11 6l-.97 3H7l2.47 1.76-.94 2.91 2.47-1.8 2.47 1.8-.94-2.91L15 9h-3.03z" /></g> <g id="inbox"><path d="M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10z" /></g> <g id="indeterminate-check-box"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z" /></g> <g id="info"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" /></g> <g id="info-outline"><path d="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z" /></g> <g id="input"><path d="M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2zM11 16l4-4-4-4v3H1v2h10v3z" /></g> <g id="invert-colors"><path d="M17.66 7.93L12 2.27 6.34 7.93c-3.12 3.12-3.12 8.19 0 11.31C7.9 20.8 9.95 21.58 12 21.58c2.05 0 4.1-.78 5.66-2.34 3.12-3.12 3.12-8.19 0-11.31zM12 19.59c-1.6 0-3.11-.62-4.24-1.76C6.62 16.69 6 15.19 6 13.59s.62-3.11 1.76-4.24L12 5.1v14.49z" /></g> <g id="label"><path d="M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16z" /></g> <g id="label-outline"><path d="M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16zM16 17H5V7h11l3.55 5L16 17z" /></g> <g id="language"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z" /></g> <g id="last-page"><path d="M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z" /></g> <g id="launch"><path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z" /></g> <g id="lightbulb-outline"><path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z" /></g> <g id="line-style"><path d="M3 16h5v-2H3v2zm6.5 0h5v-2h-5v2zm6.5 0h5v-2h-5v2zM3 20h2v-2H3v2zm4 0h2v-2H7v2zm4 0h2v-2h-2v2zm4 0h2v-2h-2v2zm4 0h2v-2h-2v2zM3 12h8v-2H3v2zm10 0h8v-2h-8v2zM3 4v4h18V4H3z" /></g> <g id="line-weight"><path d="M3 17h18v-2H3v2zm0 3h18v-1H3v1zm0-7h18v-3H3v3zm0-9v4h18V4H3z" /></g> <g id="link"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z" /></g> <g id="list"><path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z" /></g> <g id="lock"><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z" /></g> <g id="lock-open"><path d="M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10z" /></g> <g id="lock-outline"><path d="M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6zM18 20H6V10h12v10z" /></g> <g id="low-priority"><path d="M14 5h8v2h-8zm0 5.5h8v2h-8zm0 5.5h8v2h-8zM2 11.5C2 15.08 4.92 18 8.5 18H9v2l3-3-3-3v2h-.5C6.02 16 4 13.98 4 11.5S6.02 7 8.5 7H12V5H8.5C4.92 5 2 7.92 2 11.5z" /></g> <g id="loyalty"><path d="M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7zm11.77 8.27L13 19.54l-4.27-4.27C8.28 14.81 8 14.19 8 13.5c0-1.38 1.12-2.5 2.5-2.5.69 0 1.32.28 1.77.74l.73.72.73-.73c.45-.45 1.08-.73 1.77-.73 1.38 0 2.5 1.12 2.5 2.5 0 .69-.28 1.32-.73 1.77z" /></g> <g id="mail"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z" /></g> <g id="markunread"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z" /></g> <g id="markunread-mailbox"><path d="M20 6H10v6H8V4h6V0H6v6H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2z" /></g> <g id="menu"><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" /></g> <g id="more-horiz"><path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" /></g> <g id="more-vert"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" /></g> <g id="motorcycle"><path d="M19.44 9.03L15.41 5H11v2h3.59l2 2H5c-2.8 0-5 2.2-5 5s2.2 5 5 5c2.46 0 4.45-1.69 4.9-4h1.65l2.77-2.77c-.21.54-.32 1.14-.32 1.77 0 2.8 2.2 5 5 5s5-2.2 5-5c0-2.65-1.97-4.77-4.56-4.97zM7.82 15C7.4 16.15 6.28 17 5 17c-1.63 0-3-1.37-3-3s1.37-3 3-3c1.28 0 2.4.85 2.82 2H5v2h2.82zM19 17c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z" /></g> <g id="move-to-inbox"><path d="M19 3H4.99c-1.11 0-1.98.9-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10zm-3-5h-2V7h-4v3H8l4 4 4-4z" /></g> <g id="next-week"><path d="M20 7h-4V5c0-.55-.22-1.05-.59-1.41C15.05 3.22 14.55 3 14 3h-4c-1.1 0-2 .9-2 2v2H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zM10 5h4v2h-4V5zm1 13.5l-1-1 3-3-3-3 1-1 4 4-4 4z" /></g> <g id="note-add"><path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3v2zm-3-7V3.5L18.5 9H13z" /></g> <g id="offline-pin"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm5 16H7v-2h10v2zm-6.7-4L7 10.7l1.4-1.4 1.9 1.9 5.3-5.3L17 7.3 10.3 14z" /></g> <g id="opacity"><path d="M17.66 8L12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8zM6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14H6z" /></g> <g id="open-in-browser"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z" /></g> <g id="open-in-new"><path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z" /></g> <g id="open-with"><path d="M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z" /></g> <g id="pageview"><path d="M11.5 9C10.12 9 9 10.12 9 11.5s1.12 2.5 2.5 2.5 2.5-1.12 2.5-2.5S12.88 9 11.5 9zM20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-3.21 14.21l-2.91-2.91c-.69.44-1.51.7-2.39.7C9.01 16 7 13.99 7 11.5S9.01 7 11.5 7 16 9.01 16 11.5c0 .88-.26 1.69-.7 2.39l2.91 2.9-1.42 1.42z" /></g> <g id="pan-tool"><path d="M23 5.5V20c0 2.2-1.8 4-4 4h-7.3c-1.08 0-2.1-.43-2.85-1.19L1 14.83s1.26-1.23 1.3-1.25c.22-.19.49-.29.79-.29.22 0 .42.06.6.16.04.01 4.31 2.46 4.31 2.46V4c0-.83.67-1.5 1.5-1.5S11 3.17 11 4v7h1V1.5c0-.83.67-1.5 1.5-1.5S15 .67 15 1.5V11h1V2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V11h1V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5z" /></g> <g id="payment"><path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z" /></g> <g id="perm-camera-mic"><path d="M20 5h-3.17L15 3H9L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v-2.09c-2.83-.48-5-2.94-5-5.91h2c0 2.21 1.79 4 4 4s4-1.79 4-4h2c0 2.97-2.17 5.43-5 5.91V21h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-6 8c0 1.1-.9 2-2 2s-2-.9-2-2V9c0-1.1.9-2 2-2s2 .9 2 2v4z" /></g> <g id="perm-contact-calendar"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1z" /></g> <g id="perm-data-setting"><path d="M18.99 11.5c.34 0 .67.03 1 .07L20 0 0 20h11.56c-.04-.33-.07-.66-.07-1 0-4.14 3.36-7.5 7.5-7.5zm3.71 7.99c.02-.16.04-.32.04-.49 0-.17-.01-.33-.04-.49l1.06-.83c.09-.08.12-.21.06-.32l-1-1.73c-.06-.11-.19-.15-.31-.11l-1.24.5c-.26-.2-.54-.37-.85-.49l-.19-1.32c-.01-.12-.12-.21-.24-.21h-2c-.12 0-.23.09-.25.21l-.19 1.32c-.3.13-.59.29-.85.49l-1.24-.5c-.11-.04-.24 0-.31.11l-1 1.73c-.06.11-.04.24.06.32l1.06.83c-.02.16-.03.32-.03.49 0 .17.01.33.03.49l-1.06.83c-.09.08-.12.21-.06.32l1 1.73c.06.11.19.15.31.11l1.24-.5c.26.2.54.37.85.49l.19 1.32c.02.12.12.21.25.21h2c.12 0 .23-.09.25-.21l.19-1.32c.3-.13.59-.29.84-.49l1.25.5c.11.04.24 0 .31-.11l1-1.73c.06-.11.03-.24-.06-.32l-1.07-.83zm-3.71 1.01c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z" /></g> <g id="perm-device-information"><path d="M13 7h-2v2h2V7zm0 4h-2v6h2v-6zm4-9.99L7 1c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14z" /></g> <g id="perm-identity"><path d="M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z" /></g> <g id="perm-media"><path d="M2 6H0v5h.01L0 20c0 1.1.9 2 2 2h18v-2H2V6zm20-2h-8l-2-2H6c-1.1 0-1.99.9-1.99 2L4 16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7 15l4.5-6 3.5 4.51 2.5-3.01L21 15H7z" /></g> <g id="perm-phone-msg"><path d="M20 15.5c-1.25 0-2.45-.2-3.57-.57-.35-.11-.74-.03-1.02.24l-2.2 2.2c-2.83-1.44-5.15-3.75-6.59-6.58l2.2-2.21c.28-.27.36-.66.25-1.01C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1zM12 3v10l3-3h6V3h-9z" /></g> <g id="perm-scan-wifi"><path d="M12 3C6.95 3 3.15 4.85 0 7.23L12 22 24 7.25C20.85 4.87 17.05 3 12 3zm1 13h-2v-6h2v6zm-2-8V6h2v2h-2z" /></g> <g id="pets"><circle cx="4.5" cy="9.5" r="2.5" /><circle cx="9" cy="5.5" r="2.5" /><circle cx="15" cy="5.5" r="2.5" /><circle cx="19.5" cy="9.5" r="2.5" /><path d="M17.34 14.86c-.87-1.02-1.6-1.89-2.48-2.91-.46-.54-1.05-1.08-1.75-1.32-.11-.04-.22-.07-.33-.09-.25-.04-.52-.04-.78-.04s-.53 0-.79.05c-.11.02-.22.05-.33.09-.7.24-1.28.78-1.75 1.32-.87 1.02-1.6 1.89-2.48 2.91-1.31 1.31-2.92 2.76-2.62 4.79.29 1.02 1.02 2.03 2.33 2.32.73.15 3.06-.44 5.54-.44h.18c2.48 0 4.81.58 5.54.44 1.31-.29 2.04-1.31 2.33-2.32.31-2.04-1.3-3.49-2.61-4.8z" /></g> <g id="picture-in-picture"><path d="M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98V5c0-1.1-.9-2-2-2zm0 16.01H3V4.98h18v14.03z" /></g> <g id="picture-in-picture-alt"><path d="M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z" /></g> <g id="play-for-work"><path d="M11 5v5.59H7.5l4.5 4.5 4.5-4.5H13V5h-2zm-5 9c0 3.31 2.69 6 6 6s6-2.69 6-6h-2c0 2.21-1.79 4-4 4s-4-1.79-4-4H6z" /></g> <g id="polymer"><path d="M19 4h-4L7.11 16.63 4.5 12 9 4H5L.5 12 5 20h4l7.89-12.63L19.5 12 15 20h4l4.5-8z" /></g> <g id="power-settings-new"><path d="M13 3h-2v10h2V3zm4.83 2.17l-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z" /></g> <g id="pregnant-woman"><path d="M9 4c0-1.11.89-2 2-2s2 .89 2 2-.89 2-2 2-2-.89-2-2zm7 9c-.01-1.34-.83-2.51-2-3 0-1.66-1.34-3-3-3s-3 1.34-3 3v7h2v5h3v-5h3v-4z" /></g> <g id="print"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z" /></g> <g id="query-builder"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z" /></g> <g id="question-answer"><path d="M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z" /></g> <g id="radio-button-checked"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" /></g> <g id="radio-button-unchecked"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" /></g> <g id="receipt"><path d="M18 17H6v-2h12v2zm0-4H6v-2h12v2zm0-4H6V7h12v2zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20z" /></g> <g id="record-voice-over"><circle cx="9" cy="9" r="4" /><path d="M9 15c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4zm7.76-9.64l-1.68 1.69c.84 1.18.84 2.71 0 3.89l1.68 1.69c2.02-2.02 2.02-5.07 0-7.27zM20.07 2l-1.63 1.63c2.77 3.02 2.77 7.56 0 10.74L20.07 16c3.9-3.89 3.91-9.95 0-14z" /></g> <g id="redeem"><path d="M20 6h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3-1.05 0-1.96.54-2.5 1.35l-.5.67-.5-.68C10.96 2.54 10.05 2 9 2 7.34 2 6 3.34 6 5c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm11 15H4v-2h16v2zm0-5H4V8h5.08L7 10.83 8.62 12 11 8.76l1-1.36 1 1.36L15.38 12 17 10.83 14.92 8H20v6z" /></g> <g id="redo"><path d="M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z" /></g> <g id="refresh"><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z" /></g> <g id="remove"><path d="M19 13H5v-2h14v2z" /></g> <g id="remove-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11H7v-2h10v2z" /></g> <g id="remove-circle-outline"><path d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" /></g> <g id="remove-shopping-cart"><path d="M22.73 22.73L2.77 2.77 2 2l-.73-.73L0 2.54l4.39 4.39 2.21 4.66-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h7.46l1.38 1.38c-.5.36-.83.95-.83 1.62 0 1.1.89 2 1.99 2 .67 0 1.26-.33 1.62-.84L21.46 24l1.27-1.27zM7.42 15c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h2.36l2 2H7.42zm8.13-2c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H6.54l9.01 9zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2z" /></g> <g id="reorder"><path d="M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z" /></g> <g id="reply"><path d="M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z" /></g> <g id="reply-all"><path d="M7 8V5l-7 7 7 7v-3l-4-4 4-4zm6 1V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z" /></g> <g id="report"><path d="M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM12 17.3c-.72 0-1.3-.58-1.3-1.3 0-.72.58-1.3 1.3-1.3.72 0 1.3.58 1.3 1.3 0 .72-.58 1.3-1.3 1.3zm1-4.3h-2V7h2v6z" /></g> <g id="report-problem"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" /></g> <g id="restore"><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z" /></g> <g id="restore-page"><path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm-2 16c-2.05 0-3.81-1.24-4.58-3h1.71c.63.9 1.68 1.5 2.87 1.5 1.93 0 3.5-1.57 3.5-3.5S13.93 9.5 12 9.5c-1.35 0-2.52.78-3.1 1.9l1.6 1.6h-4V9l1.3 1.3C8.69 8.92 10.23 8 12 8c2.76 0 5 2.24 5 5s-2.24 5-5 5z" /></g> <g id="room"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" /></g> <g id="rounded-corner"><path d="M19 19h2v2h-2v-2zm0-2h2v-2h-2v2zM3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm0-4h2V3H3v2zm4 0h2V3H7v2zm8 16h2v-2h-2v2zm-4 0h2v-2h-2v2zm4 0h2v-2h-2v2zm-8 0h2v-2H7v2zm-4 0h2v-2H3v2zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2V8z" /></g> <g id="rowing"><path d="M8.5 14.5L4 19l1.5 1.5L9 17h2l-2.5-2.5zM15 1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 20.01L18 24l-2.99-3.01V19.5l-7.1-7.09c-.31.05-.61.07-.91.07v-2.16c1.66.03 3.61-.87 4.67-2.04l1.4-1.55c.19-.21.43-.38.69-.5.29-.14.62-.23.96-.23h.03C15.99 6.01 17 7.02 17 8.26v5.75c0 .84-.35 1.61-.92 2.16l-3.58-3.58v-2.27c-.63.52-1.43 1.02-2.29 1.39L16.5 18H18l3 3.01z" /></g> <g id="save"><path d="M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z" /></g> <g id="schedule"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z" /></g> <g id="search"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" /></g> <g id="select-all"><path d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" /></g> <g id="send"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" /></g> <g id="settings"><path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z" /></g> <g id="settings-applications"><path d="M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm7-7H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-1.75 9c0 .23-.02.46-.05.68l1.48 1.16c.13.11.17.3.08.45l-1.4 2.42c-.09.15-.27.21-.43.15l-1.74-.7c-.36.28-.76.51-1.18.69l-.26 1.85c-.03.17-.18.3-.35.3h-2.8c-.17 0-.32-.13-.35-.29l-.26-1.85c-.43-.18-.82-.41-1.18-.69l-1.74.7c-.16.06-.34 0-.43-.15l-1.4-2.42c-.09-.15-.05-.34.08-.45l1.48-1.16c-.03-.23-.05-.46-.05-.69 0-.23.02-.46.05-.68l-1.48-1.16c-.13-.11-.17-.3-.08-.45l1.4-2.42c.09-.15.27-.21.43-.15l1.74.7c.36-.28.76-.51 1.18-.69l.26-1.85c.03-.17.18-.3.35-.3h2.8c.17 0 .32.13.35.29l.26 1.85c.43.18.82.41 1.18.69l1.74-.7c.16-.06.34 0 .43.15l1.4 2.42c.09.15.05.34-.08.45l-1.48 1.16c.03.23.05.46.05.69z" /></g> <g id="settings-backup-restore"><path d="M14 12c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm-2-9c-4.97 0-9 4.03-9 9H0l4 4 4-4H5c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.51 0-2.91-.49-4.06-1.3l-1.42 1.44C8.04 20.3 9.94 21 12 21c4.97 0 9-4.03 9-9s-4.03-9-9-9z" /></g> <g id="settings-bluetooth"><path d="M11 24h2v-2h-2v2zm-4 0h2v-2H7v2zm8 0h2v-2h-2v2zm2.71-18.29L12 0h-1v7.59L6.41 3 5 4.41 10.59 10 5 15.59 6.41 17 11 12.41V20h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 3.83l1.88 1.88L13 7.59V3.83zm1.88 10.46L13 16.17v-3.76l1.88 1.88z" /></g> <g id="settings-brightness"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02zM8 16h2.5l1.5 1.5 1.5-1.5H16v-2.5l1.5-1.5-1.5-1.5V8h-2.5L12 6.5 10.5 8H8v2.5L6.5 12 8 13.5V16zm4-7c1.66 0 3 1.34 3 3s-1.34 3-3 3V9z" /></g> <g id="settings-cell"><path d="M7 24h2v-2H7v2zm4 0h2v-2h-2v2zm4 0h2v-2h-2v2zM16 .01L8 0C6.9 0 6 .9 6 2v16c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V2c0-1.1-.9-1.99-2-1.99zM16 16H8V4h8v12z" /></g> <g id="settings-ethernet"><path d="M7.77 6.76L6.23 5.48.82 12l5.41 6.52 1.54-1.28L3.42 12l4.35-5.24zM7 13h2v-2H7v2zm10-2h-2v2h2v-2zm-6 2h2v-2h-2v2zm6.77-7.52l-1.54 1.28L20.58 12l-4.35 5.24 1.54 1.28L23.18 12l-5.41-6.52z" /></g> <g id="settings-input-antenna"><path d="M12 5c-3.87 0-7 3.13-7 7h2c0-2.76 2.24-5 5-5s5 2.24 5 5h2c0-3.87-3.13-7-7-7zm1 9.29c.88-.39 1.5-1.26 1.5-2.29 0-1.38-1.12-2.5-2.5-2.5S9.5 10.62 9.5 12c0 1.02.62 1.9 1.5 2.29v3.3L7.59 21 9 22.41l3-3 3 3L16.41 21 13 17.59v-3.3zM12 1C5.93 1 1 5.93 1 12h2c0-4.97 4.03-9 9-9s9 4.03 9 9h2c0-6.07-4.93-11-11-11z" /></g> <g id="settings-input-component"><path d="M5 2c0-.55-.45-1-1-1s-1 .45-1 1v4H1v6h6V6H5V2zm4 14c0 1.3.84 2.4 2 2.82V23h2v-4.18c1.16-.41 2-1.51 2-2.82v-2H9v2zm-8 0c0 1.3.84 2.4 2 2.82V23h2v-4.18C6.16 18.4 7 17.3 7 16v-2H1v2zM21 6V2c0-.55-.45-1-1-1s-1 .45-1 1v4h-2v6h6V6h-2zm-8-4c0-.55-.45-1-1-1s-1 .45-1 1v4H9v6h6V6h-2V2zm4 14c0 1.3.84 2.4 2 2.82V23h2v-4.18c1.16-.41 2-1.51 2-2.82v-2h-6v2z" /></g> <g id="settings-input-composite"><path d="M5 2c0-.55-.45-1-1-1s-1 .45-1 1v4H1v6h6V6H5V2zm4 14c0 1.3.84 2.4 2 2.82V23h2v-4.18c1.16-.41 2-1.51 2-2.82v-2H9v2zm-8 0c0 1.3.84 2.4 2 2.82V23h2v-4.18C6.16 18.4 7 17.3 7 16v-2H1v2zM21 6V2c0-.55-.45-1-1-1s-1 .45-1 1v4h-2v6h6V6h-2zm-8-4c0-.55-.45-1-1-1s-1 .45-1 1v4H9v6h6V6h-2V2zm4 14c0 1.3.84 2.4 2 2.82V23h2v-4.18c1.16-.41 2-1.51 2-2.82v-2h-6v2z" /></g> <g id="settings-input-hdmi"><path d="M18 7V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v3H5v6l3 6v3h8v-3l3-6V7h-1zM8 4h8v3h-2V5h-1v2h-2V5h-1v2H8V4z" /></g> <g id="settings-input-svideo"><path d="M8 11.5c0-.83-.67-1.5-1.5-1.5S5 10.67 5 11.5 5.67 13 6.5 13 8 12.33 8 11.5zm7-5c0-.83-.67-1.5-1.5-1.5h-3C9.67 5 9 5.67 9 6.5S9.67 8 10.5 8h3c.83 0 1.5-.67 1.5-1.5zM8.5 15c-.83 0-1.5.67-1.5 1.5S7.67 18 8.5 18s1.5-.67 1.5-1.5S9.33 15 8.5 15zM12 1C5.93 1 1 5.93 1 12s4.93 11 11 11 11-4.93 11-11S18.07 1 12 1zm0 20c-4.96 0-9-4.04-9-9s4.04-9 9-9 9 4.04 9 9-4.04 9-9 9zm5.5-11c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm-2 5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z" /></g> <g id="settings-overscan"><path d="M12.01 5.5L10 8h4l-1.99-2.5zM18 10v4l2.5-1.99L18 10zM6 10l-2.5 2.01L6 14v-4zm8 6h-4l2.01 2.5L14 16zm7-13H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z" /></g> <g id="settings-phone"><path d="M13 9h-2v2h2V9zm4 0h-2v2h2V9zm3 6.5c-1.25 0-2.45-.2-3.57-.57-.35-.11-.74-.03-1.02.24l-2.2 2.2c-2.83-1.44-5.15-3.75-6.59-6.58l2.2-2.21c.28-.27.36-.66.25-1.01C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1zM19 9v2h2V9h-2z" /></g> <g id="settings-power"><path d="M7 24h2v-2H7v2zm4 0h2v-2h-2v2zm2-22h-2v10h2V2zm3.56 2.44l-1.45 1.45C16.84 6.94 18 8.83 18 11c0 3.31-2.69 6-6 6s-6-2.69-6-6c0-2.17 1.16-4.06 2.88-5.12L7.44 4.44C5.36 5.88 4 8.28 4 11c0 4.42 3.58 8 8 8s8-3.58 8-8c0-2.72-1.36-5.12-3.44-6.56zM15 24h2v-2h-2v2z" /></g> <g id="settings-remote"><path d="M15 9H9c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V10c0-.55-.45-1-1-1zm-3 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM7.05 6.05l1.41 1.41C9.37 6.56 10.62 6 12 6s2.63.56 3.54 1.46l1.41-1.41C15.68 4.78 13.93 4 12 4s-3.68.78-4.95 2.05zM12 0C8.96 0 6.21 1.23 4.22 3.22l1.41 1.41C7.26 3.01 9.51 2 12 2s4.74 1.01 6.36 2.64l1.41-1.41C17.79 1.23 15.04 0 12 0z" /></g> <g id="settings-voice"><path d="M7 24h2v-2H7v2zm5-11c1.66 0 2.99-1.34 2.99-3L15 4c0-1.66-1.34-3-3-3S9 2.34 9 4v6c0 1.66 1.34 3 3 3zm-1 11h2v-2h-2v2zm4 0h2v-2h-2v2zm4-14h-1.7c0 3-2.54 5.1-5.3 5.1S6.7 13 6.7 10H5c0 3.41 2.72 6.23 6 6.72V20h2v-3.28c3.28-.49 6-3.31 6-6.72z" /></g> <g id="shop"><path d="M16 6V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H2v13c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6h-6zm-6-2h4v2h-4V4zM9 18V9l7.5 4L9 18z" /></g> <g id="shop-two"><path d="M3 9H1v11c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2H3V9zm15-4V3c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H5v11c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5h-5zm-6-2h4v2h-4V3zm0 12V8l5.5 3-5.5 4z" /></g> <g id="shopping-basket"><path d="M17.21 9l-4.38-6.56c-.19-.28-.51-.42-.83-.42-.32 0-.64.14-.83.43L6.79 9H2c-.55 0-1 .45-1 1 0 .09.01.18.04.27l2.54 9.27c.23.84 1 1.46 1.92 1.46h13c.92 0 1.69-.62 1.93-1.46l2.54-9.27L23 10c0-.55-.45-1-1-1h-4.79zM9 9l3-4.4L15 9H9zm3 8c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z" /></g> <g id="shopping-cart"><path d="M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z" /></g> <g id="sort"><path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z" /></g> <g id="speaker-notes"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 14H6v-2h2v2zm0-3H6V9h2v2zm0-3H6V6h2v2zm7 6h-5v-2h5v2zm3-3h-8V9h8v2zm0-3h-8V6h8v2z" /></g> <g id="speaker-notes-off"><path d="M10.54 11l-.54-.54L7.54 8 6 6.46 2.38 2.84 1.27 1.73 0 3l2.01 2.01L2 22l4-4h9l5.73 5.73L22 22.46 17.54 18l-7-7zM8 14H6v-2h2v2zm-2-3V9l2 2H6zm14-9H4.08L10 7.92V6h8v2h-7.92l1 1H18v2h-4.92l6.99 6.99C21.14 17.95 22 17.08 22 16V4c0-1.1-.9-2-2-2z" /></g> <g id="spellcheck"><path d="M12.45 16h2.09L9.43 3H7.57L2.46 16h2.09l1.12-3h5.64l1.14 3zm-6.02-5L8.5 5.48 10.57 11H6.43zm15.16.59l-8.09 8.09L9.83 16l-1.41 1.41 5.09 5.09L23 13l-1.41-1.41z" /></g> <g id="star"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z" /></g> <g id="star-border"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z" /></g> <g id="star-half"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4V6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z" /></g> <g id="stars"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23L16.23 18z" /></g> <g id="store"><path d="M20 4H4v2h16V4zm1 10v-2l-1-5H4l-1 5v2h1v6h10v-6h4v6h2v-6h1zm-9 4H6v-4h6v4z" /></g> <g id="subdirectory-arrow-left"><path d="M11 9l1.42 1.42L8.83 14H18V4h2v12H8.83l3.59 3.58L11 21l-6-6 6-6z" /></g> <g id="subdirectory-arrow-right"><path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" /></g> <g id="subject"><path d="M14 17H4v2h10v-2zm6-8H4v2h16V9zM4 15h16v-2H4v2zM4 5v2h16V5H4z" /></g> <g id="supervisor-account"><path d="M16.5 12c1.38 0 2.49-1.12 2.49-2.5S17.88 7 16.5 7C15.12 7 14 8.12 14 9.5s1.12 2.5 2.5 2.5zM9 11c1.66 0 2.99-1.34 2.99-3S10.66 5 9 5C7.34 5 6 6.34 6 8s1.34 3 3 3zm7.5 3c-1.83 0-5.5.92-5.5 2.75V19h11v-2.25c0-1.83-3.67-2.75-5.5-2.75zM9 13c-2.33 0-7 1.17-7 3.5V19h7v-2.25c0-.85.33-2.34 2.37-3.47C10.5 13.1 9.66 13 9 13z" /></g> <g id="swap-horiz"><path d="M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z" /></g> <g id="swap-vert"><path d="M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z" /></g> <g id="swap-vertical-circle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM6.5 9L10 5.5 13.5 9H11v4H9V9H6.5zm11 6L14 18.5 10.5 15H13v-4h2v4h2.5z" /></g> <g id="system-update-alt"><path d="M12 16.5l4-4h-3v-9h-2v9H8l4 4zm9-13h-6v1.99h6v14.03H3V5.49h6V3.5H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-14c0-1.1-.9-2-2-2z" /></g> <g id="tab"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h10v4h8v10z" /></g> <g id="tab-unselected"><path d="M1 9h2V7H1v2zm0 4h2v-2H1v2zm0-8h2V3c-1.1 0-2 .9-2 2zm8 16h2v-2H9v2zm-8-4h2v-2H1v2zm2 4v-2H1c0 1.1.9 2 2 2zM21 3h-8v6h10V5c0-1.1-.9-2-2-2zm0 14h2v-2h-2v2zM9 5h2V3H9v2zM5 21h2v-2H5v2zM5 5h2V3H5v2zm16 16c1.1 0 2-.9 2-2h-2v2zm0-8h2v-2h-2v2zm-8 8h2v-2h-2v2zm4 0h2v-2h-2v2z" /></g> <g id="text-format"><path d="M5 17v2h14v-2H5zm4.5-4.2h5l.9 2.2h2.1L12.75 4h-1.5L6.5 15h2.1l.9-2.2zM12 5.98L13.87 11h-3.74L12 5.98z" /></g> <g id="theaters"><path d="M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3h-2zM8 17H6v-2h2v2zm0-4H6v-2h2v2zm0-4H6V7h2v2zm10 8h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V7h2v2z" /></g> <g id="thumb-down"><path d="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v1.91l.01.01L1 14c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z" /></g> <g id="thumb-up"><path d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-1.91l-.01-.01L23 10z" /></g> <g id="thumbs-up-down"><path d="M12 6c0-.55-.45-1-1-1H5.82l.66-3.18.02-.23c0-.31-.13-.59-.33-.8L5.38 0 .44 4.94C.17 5.21 0 5.59 0 6v6.5c0 .83.67 1.5 1.5 1.5h6.75c.62 0 1.15-.38 1.38-.91l2.26-5.29c.07-.17.11-.36.11-.55V6zm10.5 4h-6.75c-.62 0-1.15.38-1.38.91l-2.26 5.29c-.07.17-.11.36-.11.55V18c0 .55.45 1 1 1h5.18l-.66 3.18-.02.24c0 .31.13.59.33.8l.79.78 4.94-4.94c.27-.27.44-.65.44-1.06v-6.5c0-.83-.67-1.5-1.5-1.5z" /></g> <g id="timeline"><path d="M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2z" /></g> <g id="toc"><path d="M3 9h14V7H3v2zm0 4h14v-2H3v2zm0 4h14v-2H3v2zm16 0h2v-2h-2v2zm0-10v2h2V7h-2zm0 6h2v-2h-2v2z" /></g> <g id="today"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z" /></g> <g id="toll"><path d="M15 4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6zM3 12c0-2.61 1.67-4.83 4-5.65V4.26C3.55 5.15 1 8.27 1 12s2.55 6.85 6 7.74v-2.09c-2.33-.82-4-3.04-4-5.65z" /></g> <g id="touch-app"><path d="M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16 5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56.79 2.93 2 3.74zm9.84 4.63l-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10 7.5v10.74l-3.43-.72c-.08-.01-.15-.03-.24-.03-.31 0-.59.13-.79.33l-.79.8 4.94 4.94c.27.27.65.44 1.06.44h6.79c.75 0 1.33-.55 1.44-1.28l.75-5.27c.01-.07.02-.14.02-.2 0-.62-.38-1.16-.91-1.38z" /></g> <g id="track-changes"><path d="M19.07 4.93l-1.41 1.41C19.1 7.79 20 9.79 20 12c0 4.42-3.58 8-8 8s-8-3.58-8-8c0-4.08 3.05-7.44 7-7.93v2.02C8.16 6.57 6 9.03 6 12c0 3.31 2.69 6 6 6s6-2.69 6-6c0-1.66-.67-3.16-1.76-4.24l-1.41 1.41C15.55 9.9 16 10.9 16 12c0 2.21-1.79 4-4 4s-4-1.79-4-4c0-1.86 1.28-3.41 3-3.86v2.14c-.6.35-1 .98-1 1.72 0 1.1.9 2 2 2s2-.9 2-2c0-.74-.4-1.38-1-1.72V2h-1C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-2.76-1.12-5.26-2.93-7.07z" /></g> <g id="translate"><path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z" /></g> <g id="trending-down"><path d="M16 18l2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z" /></g> <g id="trending-flat"><path d="M22 12l-4-4v3H3v2h15v3z" /></g> <g id="trending-up"><path d="M16 6l2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z" /></g> <g id="turned-in"><path d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z" /></g> <g id="turned-in-not"><path d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2zm0 15l-5-2.18L7 18V5h10v13z" /></g> <g id="unarchive"><path d="M20.55 5.22l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.15.55L3.46 5.22C3.17 5.57 3 6.01 3 6.5V19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.49-.17-.93-.45-1.28zM12 9.5l5.5 5.5H14v2h-4v-2H6.5L12 9.5zM5.12 5l.82-1h12l.93 1H5.12z" /></g> <g id="undo"><path d="M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z" /></g> <g id="unfold-less"><path d="M7.41 18.59L8.83 20 12 16.83 15.17 20l1.41-1.41L12 14l-4.59 4.59zm9.18-13.18L15.17 4 12 7.17 8.83 4 7.41 5.41 12 10l4.59-4.59z" /></g> <g id="unfold-more"><path d="M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z" /></g> <g id="update"><path d="M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79 2.73 2.71 7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58 3.51-3.47 9.14-3.47 12.65 0L21 3v7.12zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5z" /></g> <g id="verified-user"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z" /></g> <g id="view-agenda"><path d="M20 13H3c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h17c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zm0-10H3c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h17c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1z" /></g> <g id="view-array"><path d="M4 18h3V5H4v13zM18 5v13h3V5h-3zM8 18h9V5H8v13z" /></g> <g id="view-carousel"><path d="M7 19h10V4H7v15zm-5-2h4V6H2v11zM18 6v11h4V6h-4z" /></g> <g id="view-column"><path d="M10 18h5V5h-5v13zm-6 0h5V5H4v13zM16 5v13h5V5h-5z" /></g> <g id="view-day"><path d="M2 21h19v-3H2v3zM20 8H3c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h17c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1zM2 3v3h19V3H2z" /></g> <g id="view-headline"><path d="M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z" /></g> <g id="view-list"><path d="M4 14h4v-4H4v4zm0 5h4v-4H4v4zM4 9h4V5H4v4zm5 5h12v-4H9v4zm0 5h12v-4H9v4zM9 5v4h12V5H9z" /></g> <g id="view-module"><path d="M4 11h5V5H4v6zm0 7h5v-6H4v6zm6 0h5v-6h-5v6zm6 0h5v-6h-5v6zm-6-7h5V5h-5v6zm6-6v6h5V5h-5z" /></g> <g id="view-quilt"><path d="M10 18h5v-6h-5v6zm-6 0h5V5H4v13zm12 0h5v-6h-5v6zM10 5v6h11V5H10z" /></g> <g id="view-stream"><path d="M4 18h17v-6H4v6zM4 5v6h17V5H4z" /></g> <g id="view-week"><path d="M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z" /></g> <g id="visibility"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z" /></g> <g id="visibility-off"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z" /></g> <g id="warning"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" /></g> <g id="watch-later"><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm4.2 14.2L11 13V7h1.5v5.2l4.5 2.7-.8 1.3z" /></g> <g id="weekend"><path d="M21 10c-1.1 0-2 .9-2 2v3H5v-3c0-1.1-.9-2-2-2s-2 .9-2 2v5c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-5c0-1.1-.9-2-2-2zm-3-5H6c-1.1 0-2 .9-2 2v2.15c1.16.41 2 1.51 2 2.82V14h12v-2.03c0-1.3.84-2.4 2-2.82V7c0-1.1-.9-2-2-2z" /></g> <g id="work"><path d="M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-6 0h-4V4h4v2z" /></g> <g id="youtube-searched-for"><path d="M17.01 14h-.8l-.27-.27c.98-1.14 1.57-2.61 1.57-4.23 0-3.59-2.91-6.5-6.5-6.5s-6.5 3-6.5 6.5H2l3.84 4 4.16-4H6.51C6.51 7 8.53 5 11.01 5s4.5 2.01 4.5 4.5c0 2.48-2.02 4.5-4.5 4.5-.65 0-1.26-.14-1.82-.38L7.71 15.1c.97.57 2.09.9 3.3.9 1.61 0 3.08-.59 4.22-1.57l.27.27v.79l5.01 4.99L22 19l-4.99-5z" /></g> <g id="zoom-in"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z" /></g> <g id="zoom-out"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z" /></g> </defs></svg> </iron-iconset-svg> <script>//~~WEBPATH~~/paper-dialog-behavior/paper-dialog-behavior.html.js Polymer.PaperDialogBehaviorImpl={hostAttributes:{role:"dialog",tabindex:"-1"},properties:{modal:{type:Boolean,value:!1},__readied:{type:Boolean,value:!1}},observers:["_modalChanged(modal, __readied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick;this.__prevNoCancelOnEscKey=this.noCancelOnEscKey;this.__prevWithBackdrop=this.withBackdrop;this.__readied=!0},_modalChanged:function(b,d){d&&(b?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick, this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.withBackdrop=this.noCancelOnEscKey=this.noCancelOnOutsideClick=!0):(this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOutsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEscKey,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosingReasonConfirmed:function(b){this.closingReason=this.closingReason||{};this.closingReason.confirmed= b},_onDialogClick:function(b){for(var d=Polymer.dom(b).path,f=0,h=d.indexOf(this);f<h;f++){var m=d[f];if(m.hasAttribute&&(m.hasAttribute("dialog-dismiss")||m.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirmed(m.hasAttribute("dialog-confirm"));this.close();b.stopPropagation();break}}}};Polymer.PaperDialogBehavior=[Polymer.IronOverlayBehavior,Polymer.PaperDialogBehaviorImpl]; </script> <dom-module id="paper-dialog-shared-styles"> <template> <style> :host { display: block; margin: 24px 40px; background: var(--paper-dialog-background-color, var(--primary-background-color)); color: var(--paper-dialog-color, var(--primary-text-color)); @apply --paper-font-body1; @apply --shadow-elevation-16dp; @apply --paper-dialog; } :host > ::slotted(*) { margin-top: 20px; padding: 0 24px; } :host > ::slotted(.no-padding) { padding: 0; } :host > ::slotted(*:first-child) { margin-top: 24px; } :host > ::slotted(*:last-child) { margin-bottom: 24px; } /* In 1.x, this selector was `:host > ::content h2`. In 2.x <slot> allows to select direct children only, which increases the weight of this selector, so we have to re-define first-child/last-child margins below. */ :host > ::slotted(h2) { position: relative; margin: 0; @apply --paper-font-title; @apply --paper-dialog-title; } /* Apply mixin again, in case it sets margin-top. */ :host > ::slotted(h2:first-child) { margin-top: 24px; @apply --paper-dialog-title; } /* Apply mixin again, in case it sets margin-bottom. */ :host > ::slotted(h2:last-child) { margin-bottom: 24px; @apply --paper-dialog-title; } :host > ::slotted(.paper-dialog-buttons), :host > ::slotted(.buttons) { position: relative; padding: 8px 8px 8px 24px; margin: 0; color: var(--paper-dialog-button-color, var(--primary-color)); @apply --layout-horizontal; @apply --layout-end-justified; } </style> </template> </dom-module> <dom-module id="paper-dialog"> <template> <style include="paper-dialog-shared-styles"></style> <slot></slot> </template> </dom-module> <script>//~~WEBPATH~~/paper-dialog/paper-dialog.html.js Polymer({is:"paper-dialog",behaviors:[Polymer.PaperDialogBehavior,Polymer.NeonAnimationRunnerBehavior],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_renderOpened:function(){this.cancelAnimation();this.playAnimation("entry")},_renderClosed:function(){this.cancelAnimation();this.playAnimation("exit")},_onNeonAnimationFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderClosed()}}); </script> <dom-module id="paper-icon-button"> <template strip-whitespace> <style> :host { display: inline-block; position: relative; padding: 8px; outline: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; z-index: 0; line-height: 1; width: 40px; height: 40px; /* NOTE: Both values are needed, since some phones require the value to be `transparent`. */ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-tap-highlight-color: transparent; /* Because of polymer/2558, this style has lower specificity than * */ box-sizing: border-box !important; @apply --paper-icon-button; } :host #ink { color: var(--paper-icon-button-ink-color, var(--primary-text-color)); opacity: 0.6; } :host([disabled]) { color: var(--paper-icon-button-disabled-text, var(--disabled-text-color)); pointer-events: none; cursor: auto; @apply --paper-icon-button-disabled; } :host([hidden]) { display: none !important; } :host(:hover) { @apply --paper-icon-button-hover; } iron-icon { --iron-icon-width: 100%; --iron-icon-height: 100%; } </style> <iron-icon id="icon" src="[[src]]" icon="[[icon]]" alt$="[[alt]]"></iron-icon> </template> <script>//~~WEBPATH~~/paper-icon-button/paper-icon-button.html.js Polymer({is:"paper-icon-button",hostAttributes:{role:"button",tabindex:"0"},behaviors:[Polymer.PaperInkyFocusBehavior],properties:{src:{type:String},icon:{type:String},alt:{type:String,observer:"_altChanged"}},_altChanged:function(b,d){var f=this.getAttribute("aria-label");f&&d!=f||this.setAttribute("aria-label",b)}}); </script> </dom-module> <script>//~~WEBPATH~~/facets-dive/lib/bounded-object.js var Zl,$l=Zl||(Zl={});$l[$l.Bottom=0]="Bottom";$l[$l.Left=1]="Left";$l[$l.Right=2]="Right";$l[$l.Top=3]="Top";class am{}; </script> <script>//~~WEBPATH~~/facets-dive/lib/sorting.js function bm(b,d){return null!==b&&void 0!==b||null!==d&&void 0!==d?null===b||void 0===b?-1:null===d||void 0===d?1:"number"===typeof b&&"number"===typeof d?isNaN(b)&&isNaN(d)?0:isNaN(b)?-1:isNaN(d)?1:b-d:"string"!==typeof b?-1:"string"!==typeof d?1:b.localeCompare(d):b===d?0:void 0===b?-1:1} function cm(b,d){return null!==b&&void 0!==b||null!==d&&void 0!==d?null===b||void 0===b?-1:null===d||void 0===d?1:"number"===typeof b&&"number"===typeof d?isNaN(b)&&isNaN(d)?0:isNaN(b)?-1:isNaN(d)?1:d-b:"string"!==typeof b?-1:"string"!==typeof d?1:-b.localeCompare(d):b===d?0:void 0===b?-1:1} function dm(b,d){return null!==b&&void 0!==b||null!==d&&void 0!==d?null===b||void 0===b?-1:null===d||void 0===d?1:"string"===typeof b&&"string"===typeof d?b.localeCompare(d):"number"!==typeof b?-1:"number"!==typeof d?1:isNaN(b)&&isNaN(d)?0:isNaN(b)?-1:isNaN(d)?1:b-d:b===d?0:void 0===b?-1:1}; </script> <script>//~~WEBPATH~~/facets-dive/lib/grid.js const em=(b,d,f,h)=>{b=Math.floor(1E-6+f.minWidth/h.itemAspectRatio);return 1<b?d%b/(b-1):0},fm=(b,d,f,h)=>{b=Math.floor(1E-6+f.minWidth/h.itemAspectRatio);f=Math.ceil(f.items.length/b);return 1<f?Math.floor(d/b)/(f-1):0},gm=(b,d)=>{const f="right"===d?1:"middle"===d?.5:0,h="top"===b?1:"middle"===b?.5:0;return(m,w,l,p)=>{const n=l.innerWidth-p.itemAspectRatio,q=l.innerHeight-1;return{x:em(m,w,l,p)/n*(l.minWidth-p.itemAspectRatio)+f*(l.innerWidth-l.minWidth)/n,y:fm(m,w,l,p)/q*(l.minHeight-1)+h*(l.innerHeight- l.minHeight)/q}}},hm=gm("bottom","left");var im,jm=im||(im={});jm[jm.Tight=0]="Tight";jm[jm.Uniform=1]="Uniform"; function km(b){b.clear();lm(b,d=>{const f=mm(b,b.verticalFacet(d),b.horizontalFacet(d));f.items.push(d);b.longestCellLength=Math.max(b.longestCellLength,f.items.length)});for(const d in b.verticalKeysHash)b.verticalKeys.push(b.verticalKeysHash[d]);b.verticalKeys.sort(b.verticalKeyCompare);for(const d in b.horizontalKeysHash)b.horizontalKeys.push(b.horizontalKeysHash[d]);b.horizontalKeys.sort(b.horizontalKeyCompare)} function nm(b,d){var f=b.verticalKeys.length,h=b.horizontalKeys.length;if(!f||!h)return 1;let m=f/h,w=m,l=Infinity,p=0,n=Infinity;f=Math.min(20,Math.max(f,h,b.longestCellLength));for(h=0;h<f;){h++;{var q=b,t=m;var v=q.verticalKeys.length;var z=q.horizontalKeys.length;let y=-Infinity,x=-Infinity,D=-Infinity,G=-Infinity;const J=[];for(let F=0;F<v;F++){J[F]=[];for(let E=0;E<z;E++){const L=J[F][E]={width:E?J[F][E-1].width:0,height:F?J[F-1][E].height:0},N=om(q,q.verticalKeys[F],q.horizontalKeys[E]);if(!N|| !N.items||!N.items.length)continue;const [M,R]=pm(q,t,N.items.length);L.width+=M;L.height+=R;y=Math.max(y,L.width);x=Math.max(x,R);D=Math.max(D,M);G=Math.max(G,L.height)}}q.verticalGridAlignment===im.Uniform&&(G=x*v);q.horizontalGridAlignment===im.Uniform&&(y=D*z);q=q.cellMargin*q.itemAspectRatio;v=(y+q*(z-1))/(G+q*(v-1))}z=Math.abs(1-v/d);z<l&&(w=m,l=z);if(.001>z)break;v>d?(n=m,m-=(n-p)/2):(p=m,m=isFinite(n)?m+(n-p)/2:2*m)}return w} function mm(b,d,f){var h=om(b,d,f);if(h)return h;h=typeof d+"\u001f"+d;h in b.verticalKeysHash||(b.verticalKeysHash[h]=d);h=typeof f+"\u001f"+f;h in b.horizontalKeysHash||(b.horizontalKeysHash[h]=f);const m=typeof d+"\u001f"+d+"\u001e"+typeof f+"\u001f"+f;h={verticalKey:d,horizontalKey:f,compoundKey:m,items:[],siblings:{}};return b.cells[m]=h} function pm(b,d,f){const h=[b.itemAspectRatio*(b.cellPadding.left+b.cellPadding.right),b.itemAspectRatio*(b.cellPadding.top+b.cellPadding.bottom)];if(!f)return h;d=Math.min(f,Math.ceil(Math.sqrt(d*f)/b.itemAspectRatio));h[0]+=b.itemAspectRatio*d;h[1]+=Math.ceil(f/d);return h}function om(b,d,f){d=typeof d+"\u001f"+d+"\u001e"+typeof f+"\u001f"+f;return d in b.cells?b.cells[d]:null}function qm(b,d){for(const f in b.cells)d.call(b,b.cells[f])} function rm(b){qm(b,d=>{const f=Math.max(0,d.innerWidth-b.itemAspectRatio),h=Math.max(0,d.innerHeight-1),m=d.items.slice(0);b.cellItemComparator&&m.sort(b.cellItemComparator);for(let w=0;w<m.length;w++){const l=b.computeItemPosition(m[w],w,d,b);b.itemPositionSetter(m[w],d.contentX+(!l||isNaN(l.x)?0:Math.max(0,Math.min(1,l.x)))*f,d.contentY+(!l||isNaN(l.y)?0:Math.max(0,Math.min(1,l.y)))*h)}})} function sm(b){km(b);var d=nm(b,b.targetGridAspectRatio),f=Math.min(b.maxCellAspectRatio,Math.max(b.minCellAspectRatio,d));d=[];const h=[];for(var m=0;m<b.verticalKeys.length;m++)for(var w=0;w<b.horizontalKeys.length;w++){var l=mm(b,b.verticalKeys[m],b.horizontalKeys[w]);[l.minWidth,l.minHeight]=pm(b,f,l.items.length);d[m]=Math.max(d[m]||0,l.minHeight);h[w]=Math.max(h[w]||0,l.minWidth)}for(f=0;f<b.verticalKeys.length;f++)for(m=0;m<b.horizontalKeys.length;m++)w=om(b,b.verticalKeys[f],b.horizontalKeys[m]), f<b.verticalKeys.length-1&&(w.siblings.above=om(b,b.verticalKeys[f+1],b.horizontalKeys[m])),0<f&&(w.siblings.below=om(b,b.verticalKeys[f-1],b.horizontalKeys[m])),0<m&&(w.siblings.left=om(b,b.verticalKeys[f],b.horizontalKeys[m-1])),m<b.horizontalKeys.length-1&&(w.siblings.right=om(b,b.verticalKeys[f],b.horizontalKeys[m+1]));if(b.verticalGridAlignment===im.Uniform)for(f=Math.max(...d),m=0;m<d.length;m++)d[m]=f;if(b.horizontalGridAlignment===im.Uniform)for(f=Math.max(...h),m=0;m<h.length;m++)h[m]=f; for(f=0;f<b.verticalKeys.length;f++)for(m=0;m<b.horizontalKeys.length;m++)w=om(b,b.verticalKeys[f],b.horizontalKeys[m]),w.height=d[f],w.width=h[m],w.innerHeight=w.height-b.cellPadding.top-b.cellPadding.bottom,w.innerWidth=w.width-b.cellPadding.left-b.cellPadding.right;f=b.cellMargin*b.itemAspectRatio;for(m=0;m<b.verticalKeys.length;m++)for(w=0;w<b.horizontalKeys.length;w++)l=om(b,b.verticalKeys[m],b.horizontalKeys[w]),l.y=m?om(b,b.verticalKeys[m-1],b.horizontalKeys[w]).y+d[m-1]+f:0,l.contentY=l.y+ b.cellPadding.bottom,l.x=w?om(b,b.verticalKeys[m],b.horizontalKeys[w-1]).x+h[w-1]+f:0,l.contentX=l.x+b.cellPadding.left;qm(b,p=>{b.width=Math.max(b.width,p.x+p.width);b.height=Math.max(b.height,p.y+p.height)});rm(b)}function lm(b,d){if(b.items)for(let f=0;f<b.items.length;f++)d.call(b,b.items[f])}function tm(b){return Object.keys(b.cells).map(d=>b.cells[d])}function um(b,d){const f=[];for(let h=0;h<b.horizontalKeys.length;h++){const m=om(b,d,b.horizontalKeys[h]);m&&f.push(m)}return f} function vm(b,d){const f=[];for(let h=0;h<b.verticalKeys.length;h++){const m=om(b,b.verticalKeys[h],d);m&&f.push(m)}return f} class wm{constructor(b){this.items=b;this.cellMargin=this.itemAspectRatio=1;this.cellPadding={bottom:0,left:0,right:0,top:0};this.targetGridAspectRatio=1;this.minCellAspectRatio=0;this.maxCellAspectRatio=Infinity;this.verticalFacet=()=>null;this.horizontalFacet=()=>null;this.verticalKeyCompare=cm;this.horizontalKeyCompare=bm;this.verticalKeys=[];this.verticalKeysHash={};this.horizontalKeys=[];this.horizontalKeysHash={};this.cells={};this.height=this.width=this.longestCellLength=0;this.itemPositionSetter= (d,f,h)=>{d.x=f;d.y=h};this.computeItemPosition=hm;this.horizontalGridAlignment=this.verticalGridAlignment=im.Tight;this.cellItemComparator=null}clear(){this.verticalKeys=[];this.verticalKeysHash={};this.horizontalKeys=[];this.horizontalKeysHash={};this.cells={};this.height=this.width=this.longestCellLength=0}}; </script> <script>//~~WEBPATH~~/facets-dive/lib/axis.js class xm extends am{constructor(b,d){super();this.side=b;this.cell=d;switch(b){case Zl.Left:this.minScale=30/d.innerHeight;for(b=d.siblings.left;!(!b||b.items.length||b.siblings.above&&b.siblings.above.items.length);)b=b.siblings.left;b&&(this.minScale=Math.max(this.minScale,39.2/(d.contentX-(b.contentX+b.innerWidth))));break;case Zl.Bottom:this.minScale=30/d.innerWidth;for(b=d.siblings.below;!(!b||b.items.length||b.siblings.right&&b.siblings.right.items.length);)b=b.siblings.below;b&&(this.minScale= Math.max(this.minScale,39.2/(d.contentY-(b.contentY+b.innerHeight))));break;default:throw Error("Axes for specified side are not implemented.");}}path(b){const d=4/b,f=6/b;return this.side===Zl.Left?`M ${this.cell.contentX-d-f},${this.cell.contentY+.6/b} h ${f} v ${this.cell.innerHeight-1.2/b} h -${f}`:this.side===Zl.Bottom?`M ${this.cell.contentX+.6/b},${this.cell.contentY-d-f} v ${f} h ${this.cell.innerWidth-1.2/b} v -${f}`:""}key(){return`${this.cell.compoundKey}-${this.side}`}}; </script> <script>//~~WEBPATH~~/facets-dive/lib/data-example.js </script> <script>//~~WEBPATH~~/facets-dive/lib/label.js </script> <script>//~~WEBPATH~~/facets-dive/lib/layout.js function ym(b){const d=b.viewport.width-b.padding.left-b.padding.right,f=b.viewport.height-b.padding.top-b.padding.bottom;if(isNaN(d)||0>=d||isNaN(f)||0>=f)return NaN;const h=b.grid.right-b.grid.left;b=b.grid.top-b.grid.bottom;return isNaN(h)||0>=h||isNaN(b)||0>=b?NaN:d/f>h/b?f/b:d/h} function zm(b){const d=ym(b);if(isNaN(d)||0>=d)return{position:{x:NaN,y:NaN},frustum:{bottom:NaN,left:NaN,right:NaN,top:NaN}};const f=b.viewport.width/d,h=b.viewport.height/d;return{position:{x:b.grid.left-(f-(b.padding.left+b.padding.right)/d-(b.grid.right-b.grid.left))/2-b.padding.left/d,y:b.grid.top+(h-(b.padding.top+b.padding.bottom)/d-(b.grid.top-b.grid.bottom))/2+b.padding.top/d},frustum:{bottom:-h,left:0,right:f,top:0}}} function Am(b,d){if(200>d)b.padding.left=0,b.padding.right=0;else if(b.padding.left+b.padding.right+200>d){const f=b.padding.left+b.padding.right;d-=200;b.padding.left=b.padding.left/f*d||0;b.padding.right=b.padding.right/f*d||0}}function Bm(b,d){if(200>d)b.padding.top=0,b.padding.bottom=0;else if(b.padding.top+b.padding.bottom+200>d){const f=b.padding.top+b.padding.bottom;d-=200;b.padding.top=b.padding.top/f*d||0;b.padding.bottom=b.padding.bottom/f*d||0}} class Cm{constructor(){this.grid={bottom:0,left:0,right:0,top:0};this.viewport={height:0,width:0};this.padding={bottom:0,left:0,right:0,top:0}}}; </script> <script>//~~WEBPATH~~/facets-dive/lib/text.js var Dm,Em=Dm||(Dm={});Em[Em.Left=0]="Left";Em[Em.Right=1]="Right";Em[Em.Center=2]="Center";var Fm,Gm=Fm||(Fm={});Gm[Gm.Top=0]="Top";Gm[Gm.Bottom=1]="Bottom";Gm[Gm.Middle=2]="Middle";const Hm={x:0,y:0,glyphAspectRatio:.6,lineHeight:1.1,horizontalAlign:Dm.Center,verticalAlign:Fm.Middle}; class Im{constructor(b){this.settings=Object.assign({},Hm,b)}fit(b){b=b.trim();const {max:d,segments:f}=this.split(b);var h=this.settings.width/this.settings.height;var m=d;b=b.length;for(var w=m+(b-m)/2,l=w,p=null,n=Infinity,q=Math.min(20,(f.length+1)/2),t=0;t<q;){t++;var v;{var z=v=0,y=0;let J=1;for(let F=0;F<f.length;F++){const {text:E,whitespace:L}=f[F],N=E.length;if(!L||v)L?v+N<=w?v+=N:(z=v=0,J+=this.settings.lineHeight):v+N<=w?z=v+=N:(z?v=z=N:(y=Math.max(y,N),v=z=0),J+=this.settings.lineHeight), y=Math.max(y,z)}v={width:y,height:J}}z=v.width/v.height*this.settings.glyphAspectRatio;y=Math.abs(1-z/h);y<n&&(l=w,p=v,n=y);if(.01>y)break;z>h?b=w:m=w;w=m+(b-m)/2}h={cutoff:l,width:p.width,height:p.height};const {cutoff:x,width:D,height:G}=h;h=D*this.settings.glyphAspectRatio;h=h/G>this.settings.width/this.settings.height?this.settings.width/h:this.settings.height/G;m=this.settings.horizontalAlign===Dm.Left?0:this.settings.horizontalAlign===Dm.Right?1:.5;b=Math.max(0,this.settings.height-G*h)*(this.settings.verticalAlign=== Fm.Top?0:this.settings.verticalAlign===Fm.Bottom?1:.5);w=[];q=n=p=l=0;for(t=0;t<f.length;t++){const {text:J,whitespace:F}=f[t];v=J.length;F&&!n?l=p=t+1:F?n+v<=x?n+=v:(w.push({startPos:l,endPos:p,textLength:q}),n=q=0,l=p=t+1):n+v<=x?(q=n+=v,p=t+1):q?(w.push({startPos:l,endPos:p,textLength:q}),n=q=v,l=t,p=t+1):(w.push({startPos:t,endPos:t+1,textLength:v}),n=q=0,l=p=t+1)}p>l&&w.push({startPos:l,endPos:p,textLength:q});l=[];for(p=0;p<w.length;p++){const {startPos:J,endPos:F}=w[p];n="";for(q=J;q<F;q++)n+= f[q].text;l.push({text:n,x:this.settings.x+m*Math.max(0,this.settings.width-n.length*this.settings.glyphAspectRatio*h),y:this.settings.y+b+p*this.settings.lineHeight*h})}return{lines:l,fontSize:h}}split(b){const d=[];let f=1,h=/\s/.test(b.charAt(0)),m=0,w=0;for(;f<=b.length;){const l=b.charAt(f),p=/\s/.test(l);l.length&&h===p||(w=Math.max(w,f-m),d.push({text:b.substring(m,f),whitespace:h}),m=f);h=p;f++}return{max:w,segments:d}}}; </script> <script>//~~WEBPATH~~/tf-imports/three.js var Jm=this; function Km(b){function d(){}function f(a,c){this.x=a||0;this.y=c||0}function h(a,c,e,g){this._x=a||0;this._y=c||0;this._z=e||0;this._w=void 0!==g?g:1}function m(a,c,e){this.x=a||0;this.y=c||0;this.z=e||0}function w(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function l(a,c,e,g,k,r,u,A,B,C){Object.defineProperty(this,"id",{value:In++});this.uuid=ab.generateUUID();this.name="";this.image=void 0!== a?a:l.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==c?c:l.DEFAULT_MAPPING;this.wrapS=void 0!==e?e:1001;this.wrapT=void 0!==g?g:1001;this.magFilter=void 0!==k?k:1006;this.minFilter=void 0!==r?r:1008;this.anisotropy=void 0!==B?B:1;this.format=void 0!==u?u:1023;this.type=void 0!==A?A:1009;this.offset=new f(0,0);this.repeat=new f(1,1);this.center=new f(0,0);this.rotation=0;this.matrixAutoUpdate=!0;this.matrix=new w;this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment= 4;this.encoding=void 0!==C?C:3E3;this.version=0;this.onUpdate=null}function p(a,c,e,g){this.x=a||0;this.y=c||0;this.z=e||0;this.w=void 0!==g?g:1}function n(a,c,e){this.width=a;this.height=c;this.scissor=new p(0,0,a,c);this.scissorTest=!1;this.viewport=new p(0,0,a,c);e=e||{};this.texture=new l(void 0,void 0,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding);this.texture.generateMipmaps=void 0!==e.generateMipmaps?e.generateMipmaps:!1;this.texture.minFilter=void 0!==e.minFilter? e.minFilter:1006;this.depthBuffer=void 0!==e.depthBuffer?e.depthBuffer:!0;this.stencilBuffer=void 0!==e.stencilBuffer?e.stencilBuffer:!0;this.depthTexture=void 0!==e.depthTexture?e.depthTexture:null}function q(a,c,e){n.call(this,a,c,e);this.samples=4}function t(a,c,e){n.call(this,a,c,e)}function v(a,c,e,g,k,r,u,A,B,C,H,I){l.call(this,null,r,u,A,B,C,g,k,H,I);this.image={data:a,width:c,height:e};this.magFilter=void 0!==B?B:1003;this.minFilter=void 0!==C?C:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment= 1}function z(a,c){this.min=void 0!==a?a:new m(Infinity,Infinity,Infinity);this.max=void 0!==c?c:new m(-Infinity,-Infinity,-Infinity)}function y(a,c){this.center=void 0!==a?a:new m;this.radius=void 0!==c?c:0}function x(a,c){this.normal=void 0!==a?a:new m(1,0,0);this.constant=void 0!==c?c:0}function D(a,c,e,g,k,r){this.planes=[void 0!==a?a:new x,void 0!==c?c:new x,void 0!==e?e:new x,void 0!==g?g:new x,void 0!==k?k:new x,void 0!==r?r:new x]}function G(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]; 0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function J(a){var c={},e;for(e in a){c[e]={};for(var g in a[e]){var k=a[e][g];c[e][g]=k&&(k.isColor||k.isMatrix3||k.isMatrix4||k.isVector2||k.isVector3||k.isVector4||k.isTexture)?k.clone():Array.isArray(k)?k.slice():k}}return c}function F(a){for(var c={},e=0;e<a.length;e++){var g=J(a[e]),k;for(k in g)c[k]=g[k]}return c}function E(a,c,e){return void 0===c&&void 0===e?this.set(a):this.setRGB(a, c,e)}function L(){function a(k,r){!1!==e&&(g(k,r),c.requestAnimationFrame(a))}var c=null,e=!1,g=null;return{start:function(){!0!==e&&null!==g&&(c.requestAnimationFrame(a),e=!0)},stop:function(){e=!1},setAnimationLoop:function(k){g=k},setContext:function(k){c=k}}}function N(a){function c(g,k){var r=g.array,u=g.dynamic?35048:35044,A=a.createBuffer();a.bindBuffer(k,A);a.bufferData(k,r,u);g.onUploadCallback();k=5126;r instanceof Float32Array?k=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."): r instanceof Uint16Array?k=5123:r instanceof Int16Array?k=5122:r instanceof Uint32Array?k=5125:r instanceof Int32Array?k=5124:r instanceof Int8Array?k=5120:r instanceof Uint8Array&&(k=5121);return{buffer:A,type:k,bytesPerElement:r.BYTES_PER_ELEMENT,version:g.version}}var e=new WeakMap;return{get:function(g){g.isInterleavedBufferAttribute&&(g=g.data);return e.get(g)},remove:function(g){g.isInterleavedBufferAttribute&&(g=g.data);var k=e.get(g);k&&(a.deleteBuffer(k.buffer),e.delete(g))},update:function(g, k){g.isInterleavedBufferAttribute&&(g=g.data);var r=e.get(g);if(void 0===r)e.set(g,c(g,k));else if(r.version<g.version){var u=g,A=u.array,B=u.updateRange;a.bindBuffer(k,r.buffer);!1===u.dynamic?a.bufferData(k,A,35044):-1===B.count?a.bufferSubData(k,0,A):0===B.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(a.bufferSubData(k,B.offset*A.BYTES_PER_ELEMENT,A.subarray(B.offset, B.offset+B.count)),B.count=-1);r.version=g.version}}}}function M(a,c,e,g,k,r){this.a=a;this.b=c;this.c=e;this.normal=g&&g.isVector3?g:new m;this.vertexNormals=Array.isArray(g)?g:[];this.color=k&&k.isColor?k:new E;this.vertexColors=Array.isArray(k)?k:[];this.materialIndex=void 0!==r?r:0}function R(a,c,e,g){this._x=a||0;this._y=c||0;this._z=e||0;this._order=g||R.DefaultOrder}function Z(){this.mask=1}function T(){Object.defineProperty(this,"id",{value:Jn++});this.uuid=ab.generateUUID();this.name=""; this.type="Object3D";this.parent=null;this.children=[];this.up=T.DefaultUp.clone();var a=new m,c=new R,e=new h,g=new m(1,1,1);c.onChange(function(){e.setFromEuler(c,!1)});e.onChange(function(){c.setFromQuaternion(e,void 0,!1)});Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:a},rotation:{configurable:!0,enumerable:!0,value:c},quaternion:{configurable:!0,enumerable:!0,value:e},scale:{configurable:!0,enumerable:!0,value:g},modelViewMatrix:{value:new G},normalMatrix:{value:new w}}); this.matrix=new G;this.matrixWorld=new G;this.matrixAutoUpdate=T.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new Z;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}}function Y(){Object.defineProperty(this,"id",{value:Kn+=2});this.uuid=ab.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights= [];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function ma(a,c,e){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="";this.array=a;this.itemSize=c;this.count=void 0!==a?a.length/c:0;this.normalized=!0===e;this.dynamic=!1;this.updateRange= {offset:0,count:-1};this.version=0}function va(a,c,e){ma.call(this,new Int8Array(a),c,e)}function Ba(a,c,e){ma.call(this,new Uint8Array(a),c,e)}function oa(a,c,e){ma.call(this,new Uint8ClampedArray(a),c,e)}function xa(a,c,e){ma.call(this,new Int16Array(a),c,e)}function Pa(a,c,e){ma.call(this,new Uint16Array(a),c,e)}function Ha(a,c,e){ma.call(this,new Int32Array(a),c,e)}function La(a,c,e){ma.call(this,new Uint32Array(a),c,e)}function qa(a,c,e){ma.call(this,new Float32Array(a),c,e)}function Cb(a,c, e){ma.call(this,new Float64Array(a),c,e)}function tb(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function ta(a){if(0===a.length)return-Infinity;for(var c=a[0],e=1,g=a.length;e<g;++e)a[e]>c&&(c=a[e]);return c}function za(){Object.defineProperty(this, "id",{value:Ln+=2});this.uuid=ab.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function Ib(a,c,e,g,k,r){Y.call(this);this.type="BoxGeometry";this.parameters={width:a,height:c,depth:e,widthSegments:g,heightSegments:k,depthSegments:r};this.fromBufferGeometry(new oc(a,c,e,g,k,r));this.mergeVertices()}function oc(a,c,e,g, k,r){function u(O,S,V,ca,ha,ba,ka,da,ea,na,la){var ua=ba/ea,Da=ka/na,wa=ba/2,Ca=ka/2,Ea=da/2;ka=ea+1;var Qa=na+1,W=ba=0,aa,ja,ra=new m;for(ja=0;ja<Qa;ja++){var Aa=ja*Da-Ca;for(aa=0;aa<ka;aa++)ra[O]=(aa*ua-wa)*ca,ra[S]=Aa*ha,ra[V]=Ea,C.push(ra.x,ra.y,ra.z),ra[O]=0,ra[S]=0,ra[V]=0<da?1:-1,H.push(ra.x,ra.y,ra.z),I.push(aa/ea),I.push(1-ja/na),ba+=1}for(ja=0;ja<na;ja++)for(aa=0;aa<ea;aa++)O=K+aa+ka*(ja+1),S=K+(aa+1)+ka*(ja+1),V=K+(aa+1)+ka*ja,B.push(K+aa+ka*ja,O,V),B.push(O,S,V),W+=6;A.addGroup(P,W,la); P+=W;K+=ba}za.call(this);this.type="BoxBufferGeometry";this.parameters={width:a,height:c,depth:e,widthSegments:g,heightSegments:k,depthSegments:r};var A=this;a=a||1;c=c||1;e=e||1;g=Math.floor(g)||1;k=Math.floor(k)||1;r=Math.floor(r)||1;var B=[],C=[],H=[],I=[],K=0,P=0;u("z","y","x",-1,-1,e,c,a,r,k,0);u("z","y","x",1,-1,e,c,-a,r,k,1);u("x","z","y",1,1,a,e,c,g,r,2);u("x","z","y",1,-1,a,e,-c,g,r,3);u("x","y","z",1,-1,a,c,e,g,k,4);u("x","y","z",-1,-1,a,c,-e,g,k,5);this.setIndex(B);this.addAttribute("position", new qa(C,3));this.addAttribute("normal",new qa(H,3));this.addAttribute("uv",new qa(I,2))}function Gc(a,c,e,g){Y.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:c,widthSegments:e,heightSegments:g};this.fromBufferGeometry(new Wc(a,c,e,g));this.mergeVertices()}function Wc(a,c,e,g){za.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:c,widthSegments:e,heightSegments:g};a=a||1;c=c||1;var k=a/2,r=c/2;e=Math.floor(e)||1;g=Math.floor(g)||1;var u=e+1,A=g+1,B=a/ e,C=c/g,H=[],I=[],K=[],P=[];for(a=0;a<A;a++){var O=a*C-r;for(c=0;c<u;c++)I.push(c*B-k,-O,0),K.push(0,0,1),P.push(c/e),P.push(1-a/g)}for(a=0;a<g;a++)for(c=0;c<e;c++)k=c+u*(a+1),r=c+1+u*(a+1),A=c+1+u*a,H.push(c+u*a,k,A),H.push(k,r,A);this.setIndex(H);this.addAttribute("position",new qa(I,3));this.addAttribute("normal",new qa(K,3));this.addAttribute("uv",new qa(P,2))}function bb(){Object.defineProperty(this,"id",{value:Mn++});this.uuid=ab.generateUUID();this.name="";this.type="Material";this.lights= this.fog=!0;this.blending=1;this.side=0;this.vertexTangents=this.flatShading=!1;this.vertexColors=0;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=3;this.depthWrite=this.depthTest=!0;this.clippingPlanes=null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetUnits=this.polygonOffsetFactor= 0;this.dithering=!1;this.alphaTest=0;this.premultipliedAlpha=!1;this.visible=!0;this.userData={};this.needsUpdate=!0}function tc(a){bb.call(this);this.type="ShaderMaterial";this.defines={};this.uniforms={};this.vertexShader="void main() {\n\tgl_Position \x3d projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";this.fragmentShader="void main() {\n\tgl_FragColor \x3d vec4( 1.0, 0.0, 0.0, 1.0 );\n}";this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets= this.skinning=this.clipping=this.lights=this.fog=!1;this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.uniformsNeedUpdate=!1;void 0!==a&&(void 0!==a.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(a))}function Zd(a,c){this.origin=void 0!==a?a:new m;this.direction=void 0!==c?c:new m}function jc(a, c,e){this.a=void 0!==a?a:new m;this.b=void 0!==c?c:new m;this.c=void 0!==e?e:new m}function zc(a){bb.call(this);this.type="MeshBasicMaterial";this.color=new E(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.lights=this.morphTargets=this.skinning= !1;this.setValues(a)}function cc(a,c){T.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new za;this.material=void 0!==c?c:new zc({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function Nn(a,c,e,g){function k(I,K){c.buffers.color.setClear(I.r,I.g,I.b,K,g)}var r=new E(0),u=0,A,B,C=null,H=0;return{getClearColor:function(){return r},setClearColor:function(I,K){r.set(I);u=void 0!==K?K:1;k(r,u)},getClearAlpha:function(){return u},setClearAlpha:function(I){u=I;k(r,u)},render:function(I, K,P,O){K=K.background;P=a.vr;(P=P.getSession&&P.getSession())&&"additive"===P.environmentBlendMode&&(K=null);null===K?(k(r,u),C=null,H=0):K&&K.isColor&&(k(K,1),O=!0,C=null,H=0);(a.autoClear||O)&&a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil);if(K&&(K.isCubeTexture||K.isWebGLRenderTargetCube)){void 0===B&&(B=new cc(new oc(1,1,1),new tc({type:"BackgroundCubeMaterial",uniforms:J(Xc.cube.uniforms),vertexShader:Xc.cube.vertexShader,fragmentShader:Xc.cube.fragmentShader,side:1,depthTest:!1, depthWrite:!1,fog:!1})),B.geometry.removeAttribute("normal"),B.geometry.removeAttribute("uv"),B.onBeforeRender=function(S,V,ca){this.matrixWorld.copyPosition(ca.matrixWorld)},Object.defineProperty(B.material,"map",{get:function(){return this.uniforms.tCube.value}}),e.update(B));O=K.isWebGLRenderTargetCube?K.texture:K;B.material.uniforms.tCube.value=O;B.material.uniforms.tFlip.value=K.isWebGLRenderTargetCube?1:-1;if(C!==K||H!==O.version)B.material.needsUpdate=!0,C=K,H=O.version;I.unshift(B,B.geometry, B.material,0,0,null)}else if(K&&K.isTexture){void 0===A&&(A=new cc(new Wc(2,2),new tc({type:"BackgroundMaterial",uniforms:J(Xc.background.uniforms),vertexShader:Xc.background.vertexShader,fragmentShader:Xc.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.removeAttribute("normal"),Object.defineProperty(A.material,"map",{get:function(){return this.uniforms.t2D.value}}),e.update(A));A.material.uniforms.t2D.value=K;!0===K.matrixAutoUpdate&&K.updateMatrix();A.material.uniforms.uvTransform.value.copy(K.matrix); if(C!==K||H!==K.version)A.material.needsUpdate=!0,C=K,H=K.version;I.unshift(A,A.geometry,A.material,0,0,null)}}}}function On(a,c,e,g){var k;this.setMode=function(r){k=r};this.render=function(r,u){a.drawArrays(k,r,u);e.update(u,k)};this.renderInstances=function(r,u,A){if(g.isWebGL2)var B=a;else if(B=c.get("ANGLE_instanced_arrays"),null===B){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}B[g.isWebGL2? "drawArraysInstanced":"drawArraysInstancedANGLE"](k,u,A,r.maxInstancedCount);e.update(A,k,r.maxInstancedCount)}}function Pn(a,c,e){function g(ba){if("highp"===ba){if(0<a.getShaderPrecisionFormat(35633,36338).precision&&0<a.getShaderPrecisionFormat(35632,36338).precision)return"highp";ba="mediump"}return"mediump"===ba&&0<a.getShaderPrecisionFormat(35633,36337).precision&&0<a.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var k,r="undefined"!==typeof WebGL2RenderingContext&&a instanceof WebGL2RenderingContext,u=void 0!==e.precision?e.precision:"highp",A=g(u);A!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",A,"instead."),u=A);e=!0===e.logarithmicDepthBuffer;A=a.getParameter(34930);var B=a.getParameter(35660),C=a.getParameter(3379),H=a.getParameter(34076),I=a.getParameter(34921),K=a.getParameter(36347),P=a.getParameter(36348),O=a.getParameter(36349),S=0<B,V=r||!!c.get("OES_texture_float"),ca=S&&V,ha=r?a.getParameter(36183):0;return{isWebGL2:r,getMaxAnisotropy:function(){if(void 0!== k)return k;var ba=c.get("EXT_texture_filter_anisotropic");return k=null!==ba?a.getParameter(ba.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:g,precision:u,logarithmicDepthBuffer:e,maxTextures:A,maxVertexTextures:B,maxTextureSize:C,maxCubemapSize:H,maxAttributes:I,maxVertexUniforms:K,maxVaryings:P,maxFragmentUniforms:O,vertexTextures:S,floatFragmentTextures:V,floatVertexTextures:ca,maxSamples:ha}}function Qn(){function a(){C.value!==g&&(C.value=g,C.needsUpdate=0<k);e.numPlanes=k;e.numIntersection= 0}function c(H,I,K,P){var O=null!==H?H.length:0,S=null;if(0!==O){S=C.value;if(!0!==P||null===S){P=K+4*O;I=I.matrixWorldInverse;B.getNormalMatrix(I);if(null===S||S.length<P)S=new Float32Array(P);for(P=0;P!==O;++P,K+=4)A.copy(H[P]).applyMatrix4(I,B),A.normal.toArray(S,K),S[K+3]=A.constant}C.value=S;C.needsUpdate=!0}e.numPlanes=O;return S}var e=this,g=null,k=0,r=!1,u=!1,A=new x,B=new w,C={value:null,needsUpdate:!1};this.uniform=C;this.numIntersection=this.numPlanes=0;this.init=function(H,I,K){var P= 0!==H.length||I||0!==k||r;r=I;g=c(H,K,0);k=H.length;return P};this.beginShadows=function(){u=!0;c(null)};this.endShadows=function(){u=!1;a()};this.setState=function(H,I,K,P,O,S){if(!r||null===H||0===H.length||u&&!K)u?c(null):a();else{K=u?0:k;var V=4*K,ca=O.clippingState||null;C.value=ca;ca=c(H,P,V,S);for(H=0;H!==V;++H)ca[H]=g[H];O.clippingState=ca;this.numIntersection=I?this.numPlanes:0;this.numPlanes+=K}}}function Rn(a){var c={};return{get:function(e){if(void 0!==c[e])return c[e];switch(e){case "WEBGL_depth_texture":var g= a.getExtension("WEBGL_depth_texture")||a.getExtension("MOZ_WEBGL_depth_texture")||a.getExtension("WEBKIT_WEBGL_depth_texture");break;case "EXT_texture_filter_anisotropic":g=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":g=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); break;case "WEBGL_compressed_texture_pvrtc":g=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:g=a.getExtension(e)}null===g&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported.");return c[e]=g}}}function Sn(a,c,e){function g(u){var A=u.target;u=k[A.id];null!==u.index&&c.remove(u.index);for(var B in u.attributes)c.remove(u.attributes[B]);A.removeEventListener("dispose",g);delete k[A.id];if(B=r[u.id])c.remove(B),delete r[u.id]; e.memory.geometries--}var k={},r={};return{get:function(u,A){var B=k[A.id];if(B)return B;A.addEventListener("dispose",g);A.isBufferGeometry?B=A:A.isGeometry&&(void 0===A._bufferGeometry&&(A._bufferGeometry=(new za).setFromObject(u)),B=A._bufferGeometry);k[A.id]=B;e.memory.geometries++;return B},update:function(u){var A=u.index,B=u.attributes;null!==A&&c.update(A,34963);for(var C in B)c.update(B[C],34962);u=u.morphAttributes;for(C in u){A=u[C];B=0;for(var H=A.length;B<H;B++)c.update(A[B],34962)}}, getWireframeAttribute:function(u){var A=r[u.id];if(A)return A;A=[];var B=u.index,C=u.attributes;if(null!==B){B=B.array;C=0;for(var H=B.length;C<H;C+=3){var I=B[C+0],K=B[C+1],P=B[C+2];A.push(I,K,K,P,P,I)}}else for(B=C.position.array,C=0,H=B.length/3-1;C<H;C+=3)I=C+0,K=C+1,P=C+2,A.push(I,K,K,P,P,I);A=new (65535<ta(A)?La:Pa)(A,1);c.update(A,34963);return r[u.id]=A}}}function Tn(a,c,e,g){var k,r,u;this.setMode=function(A){k=A};this.setIndex=function(A){r=A.type;u=A.bytesPerElement};this.render=function(A, B){a.drawElements(k,B,r,A*u);e.update(B,k)};this.renderInstances=function(A,B,C){if(g.isWebGL2)var H=a;else if(H=c.get("ANGLE_instanced_arrays"),null===H){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}H[g.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](k,C,r,B*u,A.maxInstancedCount);e.update(C,k,A.maxInstancedCount)}}function Un(){var a={frame:0,calls:0,triangles:0,points:0, lines:0};return{memory:{geometries:0,textures:0},render:a,programs:null,autoReset:!0,reset:function(){a.frame++;a.calls=0;a.triangles=0;a.points=0;a.lines=0},update:function(c,e,g){g=g||1;a.calls++;switch(e){case 4:a.triangles+=c/3*g;break;case 5:case 6:a.triangles+=g*(c-2);break;case 1:a.lines+=c/2*g;break;case 3:a.lines+=g*(c-1);break;case 2:a.lines+=g*c;break;case 0:a.points+=g*c;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e)}}}}function Vn(a,c){return Math.abs(c[1])-Math.abs(a[1])} function Wn(a){var c={},e=new Float32Array(8);return{update:function(g,k,r,u){var A=g.morphTargetInfluences,B=A.length;g=c[k.id];if(void 0===g){g=[];for(var C=0;C<B;C++)g[C]=[C,0];c[k.id]=g}var H=r.morphTargets&&k.morphAttributes.position;r=r.morphNormals&&k.morphAttributes.normal;for(C=0;C<B;C++){var I=g[C];0!==I[1]&&(H&&k.removeAttribute("morphTarget"+C),r&&k.removeAttribute("morphNormal"+C))}for(C=0;C<B;C++)I=g[C],I[0]=C,I[1]=A[C];g.sort(Vn);for(C=0;8>C;C++){if(I=g[C])if(A=I[0],B=I[1]){H&&k.addAttribute("morphTarget"+ C,H[A]);r&&k.addAttribute("morphNormal"+C,r[A]);e[C]=B;continue}e[C]=0}u.getUniforms().setValue(a,"morphTargetInfluences",e)}}}function Xn(a,c){var e={};return{update:function(g){var k=c.render.frame,r=g.geometry,u=a.get(g,r);e[u.id]!==k&&(r.isGeometry&&u.updateFromObject(g),a.update(u),e[u.id]=k);return u},dispose:function(){e={}}}}function sd(a,c,e,g,k,r,u,A,B,C){a=void 0!==a?a:[];l.call(this,a,void 0!==c?c:301,e,g,k,r,void 0!==u?u:1022,A,B,C);this.flipY=!1}function Ie(a,c,e,g){l.call(this,null); this.image={data:a,width:c,height:e,depth:g};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Je(a,c,e,g){l.call(this,null);this.image={data:a,width:c,height:e,depth:g};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Ke(a,c,e){var g=a[0];if(0>=g||0<g)return a;var k=c*e,r=xk[k];void 0===r&&(r=new Float32Array(k),xk[k]=r);if(0!==c)for(g.toArray(r,0),g=1,k=0;g!==c;++g)k+=e,a[g].toArray(r,k);return r}function Jb(a, c){if(a.length!==c.length)return!1;for(var e=0,g=a.length;e<g;e++)if(a[e]!==c[e])return!1;return!0}function dc(a,c){for(var e=0,g=c.length;e<g;e++)a[e]=c[e]}function yk(a,c){var e=zk[c];void 0===e&&(e=new Int32Array(c),zk[c]=e);for(var g=0;g!==c;++g)e[g]=a.allocateTextureUnit();return e}function Yn(a,c){var e=this.cache;e[0]!==c&&(a.uniform1f(this.addr,c),e[0]=c)}function Zn(a,c){var e=this.cache;e[0]!==c&&(a.uniform1i(this.addr,c),e[0]=c)}function $n(a,c){var e=this.cache;if(void 0!==c.x){if(e[0]!== c.x||e[1]!==c.y)a.uniform2f(this.addr,c.x,c.y),e[0]=c.x,e[1]=c.y}else Jb(e,c)||(a.uniform2fv(this.addr,c),dc(e,c))}function ao(a,c){var e=this.cache;if(void 0!==c.x){if(e[0]!==c.x||e[1]!==c.y||e[2]!==c.z)a.uniform3f(this.addr,c.x,c.y,c.z),e[0]=c.x,e[1]=c.y,e[2]=c.z}else if(void 0!==c.r){if(e[0]!==c.r||e[1]!==c.g||e[2]!==c.b)a.uniform3f(this.addr,c.r,c.g,c.b),e[0]=c.r,e[1]=c.g,e[2]=c.b}else Jb(e,c)||(a.uniform3fv(this.addr,c),dc(e,c))}function bo(a,c){var e=this.cache;if(void 0!==c.x){if(e[0]!==c.x|| e[1]!==c.y||e[2]!==c.z||e[3]!==c.w)a.uniform4f(this.addr,c.x,c.y,c.z,c.w),e[0]=c.x,e[1]=c.y,e[2]=c.z,e[3]=c.w}else Jb(e,c)||(a.uniform4fv(this.addr,c),dc(e,c))}function co(a,c){var e=this.cache,g=c.elements;void 0===g?Jb(e,c)||(a.uniformMatrix2fv(this.addr,!1,c),dc(e,c)):Jb(e,g)||(Ak.set(g),a.uniformMatrix2fv(this.addr,!1,Ak),dc(e,g))}function eo(a,c){var e=this.cache,g=c.elements;void 0===g?Jb(e,c)||(a.uniformMatrix3fv(this.addr,!1,c),dc(e,c)):Jb(e,g)||(Bk.set(g),a.uniformMatrix3fv(this.addr,!1, Bk),dc(e,g))}function fo(a,c){var e=this.cache,g=c.elements;void 0===g?Jb(e,c)||(a.uniformMatrix4fv(this.addr,!1,c),dc(e,c)):Jb(e,g)||(Ck.set(g),a.uniformMatrix4fv(this.addr,!1,Ck),dc(e,g))}function go(a,c,e){var g=this.cache,k=e.allocateTextureUnit();g[0]!==k&&(a.uniform1i(this.addr,k),g[0]=k);e.safeSetTexture2D(c||Dk,k)}function ho(a,c,e){var g=this.cache,k=e.allocateTextureUnit();g[0]!==k&&(a.uniform1i(this.addr,k),g[0]=k);e.setTexture2DArray(c||io,k)}function jo(a,c,e){var g=this.cache,k=e.allocateTextureUnit(); g[0]!==k&&(a.uniform1i(this.addr,k),g[0]=k);e.setTexture3D(c||ko,k)}function lo(a,c,e){var g=this.cache,k=e.allocateTextureUnit();g[0]!==k&&(a.uniform1i(this.addr,k),g[0]=k);e.safeSetTextureCube(c||Ek,k)}function Fk(a,c){var e=this.cache;Jb(e,c)||(a.uniform2iv(this.addr,c),dc(e,c))}function Gk(a,c){var e=this.cache;Jb(e,c)||(a.uniform3iv(this.addr,c),dc(e,c))}function Hk(a,c){var e=this.cache;Jb(e,c)||(a.uniform4iv(this.addr,c),dc(e,c))}function mo(a){switch(a){case 5126:return Yn;case 35664:return $n; case 35665:return ao;case 35666:return bo;case 35674:return co;case 35675:return eo;case 35676:return fo;case 35678:case 36198:return go;case 35679:return jo;case 35680:return lo;case 36289:return ho;case 5124:case 35670:return Zn;case 35667:case 35671:return Fk;case 35668:case 35672:return Gk;case 35669:case 35673:return Hk}}function no(a,c){var e=this.cache;Jb(e,c)||(a.uniform1fv(this.addr,c),dc(e,c))}function oo(a,c){var e=this.cache;Jb(e,c)||(a.uniform1iv(this.addr,c),dc(e,c))}function po(a,c){var e= this.cache;c=Ke(c,this.size,2);Jb(e,c)||(a.uniform2fv(this.addr,c),this.updateCache(c))}function qo(a,c){var e=this.cache;c=Ke(c,this.size,3);Jb(e,c)||(a.uniform3fv(this.addr,c),this.updateCache(c))}function ro(a,c){var e=this.cache;c=Ke(c,this.size,4);Jb(e,c)||(a.uniform4fv(this.addr,c),this.updateCache(c))}function so(a,c){var e=this.cache;c=Ke(c,this.size,4);Jb(e,c)||(a.uniformMatrix2fv(this.addr,!1,c),this.updateCache(c))}function to(a,c){var e=this.cache;c=Ke(c,this.size,9);Jb(e,c)||(a.uniformMatrix3fv(this.addr, !1,c),this.updateCache(c))}function uo(a,c){var e=this.cache;c=Ke(c,this.size,16);Jb(e,c)||(a.uniformMatrix4fv(this.addr,!1,c),this.updateCache(c))}function vo(a,c,e){var g=this.cache,k=c.length,r=yk(e,k);!1===Jb(g,r)&&(a.uniform1iv(this.addr,r),dc(g,r));for(a=0;a!==k;++a)e.safeSetTexture2D(c[a]||Dk,r[a])}function wo(a,c,e){var g=this.cache,k=c.length,r=yk(e,k);!1===Jb(g,r)&&(a.uniform1iv(this.addr,r),dc(g,r));for(a=0;a!==k;++a)e.safeSetTextureCube(c[a]||Ek,r[a])}function xo(a){switch(a){case 5126:return no; case 35664:return po;case 35665:return qo;case 35666:return ro;case 35674:return so;case 35675:return to;case 35676:return uo;case 35678:return vo;case 35680:return wo;case 5124:case 35670:return oo;case 35667:case 35671:return Fk;case 35668:case 35672:return Gk;case 35669:case 35673:return Hk}}function yo(a,c,e){this.id=a;this.addr=e;this.cache=[];this.setValue=mo(c.type)}function Ik(a,c,e){this.id=a;this.addr=e;this.cache=[];this.size=c.size;this.setValue=xo(c.type)}function Jk(a){this.id=a;this.seq= [];this.map={}}function Jd(a,c){this.seq=[];this.map={};for(var e=a.getProgramParameter(c,35718),g=0;g<e;++g){var k=a.getActiveUniform(c,g),r=k;k=a.getUniformLocation(c,k.name);var u=this,A=r.name,B=A.length;for(di.lastIndex=0;;){var C=di.exec(A),H=di.lastIndex,I=C[1],K=C[3];"]"===C[2]&&(I|=0);if(void 0===K||"["===K&&H+2===B){A=u;r=void 0===K?new yo(I,r,k):new Ik(I,r,k);A.seq.push(r);A.map[r.id]=r;break}else K=u.map[I],void 0===K&&(K=new Jk(I),I=u,u=K,I.seq.push(u),I.map[u.id]=u),u=K}}}function zo(a){a= a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")}function Kk(a,c,e,g){var k=a.createShader(c);a.shaderSource(k,e);a.compileShader(k);!0===g&&(!1===a.getShaderParameter(k,35713)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==a.getShaderInfoLog(k)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",35633===c?"vertex":"fragment",a.getShaderInfoLog(k),zo(e)));return k}function Lk(a){switch(a){case 3E3:return["Linear","( value )"];case 3001:return["sRGB", "( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw Error("unsupported encoding: "+a);}}function Vg(a,c){c=Lk(c);return"vec4 "+a+"( vec4 value ) { return "+c[0]+"ToLinear"+c[1]+"; }"}function Ao(a,c){c=Lk(c);return"vec4 "+a+"( vec4 value ) { return LinearTo"+c[0]+c[1]+"; }"}function Bo(a,c){switch(c){case 1:c= "Linear";break;case 2:c="Reinhard";break;case 3:c="Uncharted2";break;case 4:c="OptimizedCineon";break;case 5:c="ACESFilmic";break;default:throw Error("unsupported toneMapping: "+c);}return"vec3 "+a+"( vec3 color ) { return "+c+"ToneMapping( color ); }"}function Co(a,c,e){a=a||{};return[a.derivatives||c.envMapCubeUV||c.bumpMap||c.normalMap&&!c.objectSpaceNormalMap||c.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(a.fragDepth||c.logarithmicDepthBuffer)&&e.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable": "",a.drawBuffers&&e.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(a.shaderTextureLOD||c.envMap)&&e.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Pf).join("\n")}function Do(a){var c=[],e;for(e in a){var g=a[e];!1!==g&&c.push("#define "+e+" "+g)}return c.join("\n")}function Pf(a){return""!==a}function Mk(a,c){return a.replace(/NUM_DIR_LIGHTS/g,c.numDirLights).replace(/NUM_SPOT_LIGHTS/g,c.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g, c.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,c.numPointLights).replace(/NUM_HEMI_LIGHTS/g,c.numHemiLights)}function Nk(a,c){return a.replace(/NUM_CLIPPING_PLANES/g,c.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,c.numClippingPlanes-c.numClipIntersection)}function ei(a){return a.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,function(c,e){c=mb[e];if(void 0===c)throw Error("Can not resolve #include \x3c"+e+"\x3e");return ei(c)})}function Ok(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(c,e,g,k){c="";for(e=parseInt(e);e<parseInt(g);e++)c+=k.replace(/\[ i \]/g,"[ "+e+" ]");return c})}function Eo(a,c,e,g,k,r,u,A){var B=a.context,C=g.defines,H=k.vertexShader,I=k.fragmentShader,K="SHADOWMAP_TYPE_BASIC";1===r.shadowMapType?K="SHADOWMAP_TYPE_PCF":2===r.shadowMapType&&(K="SHADOWMAP_TYPE_PCF_SOFT");var P="ENVMAP_TYPE_CUBE",O="ENVMAP_MODE_REFLECTION",S="ENVMAP_BLENDING_MULTIPLY";if(r.envMap){switch(g.envMap.mapping){case 301:case 302:P="ENVMAP_TYPE_CUBE";break;case 306:case 307:P= "ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:P="ENVMAP_TYPE_EQUIREC";break;case 305:P="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case 302:case 304:O="ENVMAP_MODE_REFRACTION"}switch(g.combine){case 0:S="ENVMAP_BLENDING_MULTIPLY";break;case 1:S="ENVMAP_BLENDING_MIX";break;case 2:S="ENVMAP_BLENDING_ADD"}}var V=0<a.gammaFactor?a.gammaFactor:1,ca=u.isWebGL2?"":Co(g.extensions,r,c),ha=Do(C),ba=B.createProgram();g.isRawShaderMaterial?(C=[ha].filter(Pf).join("\n"),0<C.length&&(C+="\n"),c=[ca,ha].filter(Pf).join("\n"), 0<c.length&&(c+="\n")):(C=["precision "+r.precision+" float;","precision "+r.precision+" int;","#define SHADER_NAME "+k.name,ha,r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+V,"#define MAX_BONES "+r.maxBones,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 "+O:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP": "",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexTangents?"#define USE_TANGENT":"",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&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+K:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&(u.isWebGL2||c.get("EXT_frag_depth"))? "#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Pf).join("\n"),c=[ca,"precision "+ r.precision+" float;","precision "+r.precision+" int;","#define SHADER_NAME "+k.name,ha,r.alphaTest?"#define ALPHATEST "+r.alphaTest+(r.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+V,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+P:"",r.envMap?"#define "+O:"",r.envMap?"#define "+S:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap? "#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED": "",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+K:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&(u.isWebGL2||c.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",r.envMap&&(u.isWebGL2||c.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT": "","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==r.toneMapping?"#define TONE_MAPPING":"",0!==r.toneMapping?mb.tonemapping_pars_fragment:"",0!==r.toneMapping?Bo("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.outputEncoding||r.mapEncoding||r.matcapEncoding||r.envMapEncoding||r.emissiveMapEncoding?mb.encodings_pars_fragment:"",r.mapEncoding?Vg("mapTexelToLinear",r.mapEncoding):"",r.matcapEncoding?Vg("matcapTexelToLinear",r.matcapEncoding):"",r.envMapEncoding?Vg("envMapTexelToLinear", r.envMapEncoding):"",r.emissiveMapEncoding?Vg("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.outputEncoding?Ao("linearToOutputTexel",r.outputEncoding):"",r.depthPacking?"#define DEPTH_PACKING "+g.depthPacking:"","\n"].filter(Pf).join("\n"));H=ei(H);H=Mk(H,r);H=Nk(H,r);I=ei(I);I=Mk(I,r);I=Nk(I,r);H=Ok(H);I=Ok(I);u.isWebGL2&&!g.isRawShaderMaterial&&(u=!1,K=/^\s*#version\s+300\s+es\s*\n/,g.isShaderMaterial&&null!==H.match(K)&&null!==I.match(K)&&(u=!0,H=H.replace(K,""),I=I.replace(K,"")),C="#version 300 es\n\n#define attribute in\n#define varying out\n#define texture2D texture\n"+ C,c=["#version 300 es\n\n#define varying in",u?"":"out highp vec4 pc_fragColor;",u?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+ "\n"+c);I=c+I;H=Kk(B,35633,C+H,a.debug.checkShaderErrors);I=Kk(B,35632,I,a.debug.checkShaderErrors);B.attachShader(ba,H);B.attachShader(ba,I);void 0!==g.index0AttributeName?B.bindAttribLocation(ba,0,g.index0AttributeName):!0===r.morphTargets&&B.bindAttribLocation(ba,0,"position");B.linkProgram(ba);if(a.debug.checkShaderErrors){a=B.getProgramInfoLog(ba).trim();r=B.getShaderInfoLog(H).trim();u=B.getShaderInfoLog(I).trim();P=K=!0;if(!1===B.getProgramParameter(ba,35714))K=!1,console.error("THREE.WebGLProgram: shader error: ", B.getError(),"35715",B.getProgramParameter(ba,35715),"gl.getProgramInfoLog",a,r,u);else if(""!==a)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",a);else if(""===r||""===u)P=!1;P&&(this.diagnostics={runnable:K,material:g,programLog:a,vertexShader:{log:r,prefix:C},fragmentShader:{log:u,prefix:c}})}B.deleteShader(H);B.deleteShader(I);var ka;this.getUniforms=function(){void 0===ka&&(ka=new Jd(B,ba,A));return ka};var da;this.getAttributes=function(){if(void 0===da){for(var ea={},na=B.getProgramParameter(ba, 35721),la=0;la<na;la++){var ua=B.getActiveAttrib(ba,la).name;ea[ua]=B.getAttribLocation(ba,ua)}da=ea}return da};this.destroy=function(){B.deleteProgram(ba);this.program=void 0};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.name=k.name;this.id=Fo++;this.code= e;this.usedTimes=1;this.program=ba;this.vertexShader=H;this.fragmentShader=I;return this}function Go(a,c,e,g){function k(B,C){if(B)B.isTexture?H=B.encoding:B.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),H=B.texture.encoding);else var H=3E3;3E3===H&&C&&(H=3007);return H}var r=[],u={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic", MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},A="precision supportsVertexTextures map mapEncoding matcap matcapEncoding envMap envMapMode envMapEncoding lightMap aoMap emissiveMap emissiveMapEncoding bumpMap normalMap objectSpaceNormalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors vertexTangents fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking dithering".split(" "); this.getParameters=function(B,C,H,I,K,P,O){var S=u[B.type];if(O.isSkinnedMesh){var V=O.skeleton.bones;if(e.floatVertexTextures)V=1024;else{var ca=Math.min(Math.floor((e.maxVertexUniforms-20)/4),V.length);ca<V.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+V.length+" bones. This GPU supports "+ca+"."),V=0):V=ca}}else V=0;ca=e.precision;null!==B.precision&&(ca=e.getMaxPrecision(B.precision),ca!==B.precision&&console.warn("THREE.WebGLProgram.getParameters:",B.precision,"not supported, using", ca,"instead."));var ha=a.getRenderTarget();return{shaderID:S,precision:ca,supportsVertexTextures:e.vertexTextures,outputEncoding:k(ha?ha.texture:null,a.gammaOutput),map:!!B.map,mapEncoding:k(B.map,a.gammaInput),matcap:!!B.matcap,matcapEncoding:k(B.matcap,a.gammaInput),envMap:!!B.envMap,envMapMode:B.envMap&&B.envMap.mapping,envMapEncoding:k(B.envMap,a.gammaInput),envMapCubeUV:!!B.envMap&&(306===B.envMap.mapping||307===B.envMap.mapping),lightMap:!!B.lightMap,aoMap:!!B.aoMap,emissiveMap:!!B.emissiveMap, emissiveMapEncoding:k(B.emissiveMap,a.gammaInput),bumpMap:!!B.bumpMap,normalMap:!!B.normalMap,objectSpaceNormalMap:1===B.normalMapType,displacementMap:!!B.displacementMap,roughnessMap:!!B.roughnessMap,metalnessMap:!!B.metalnessMap,specularMap:!!B.specularMap,alphaMap:!!B.alphaMap,gradientMap:!!B.gradientMap,combine:B.combine,vertexTangents:B.normalMap&&B.vertexTangents,vertexColors:B.vertexColors,fog:!!I,useFog:B.fog,fogExp:I&&I.isFogExp2,flatShading:B.flatShading,sizeAttenuation:B.sizeAttenuation, logarithmicDepthBuffer:e.logarithmicDepthBuffer,skinning:B.skinning&&0<V,maxBones:V,useVertexTexture:e.floatVertexTextures,morphTargets:B.morphTargets,morphNormals:B.morphNormals,maxMorphTargets:a.maxMorphTargets,maxMorphNormals:a.maxMorphNormals,numDirLights:C.directional.length,numPointLights:C.point.length,numSpotLights:C.spot.length,numRectAreaLights:C.rectArea.length,numHemiLights:C.hemi.length,numClippingPlanes:K,numClipIntersection:P,dithering:B.dithering,shadowMapEnabled:a.shadowMap.enabled&& O.receiveShadow&&0<H.length,shadowMapType:a.shadowMap.type,toneMapping:a.toneMapping,physicallyCorrectLights:a.physicallyCorrectLights,premultipliedAlpha:B.premultipliedAlpha,alphaTest:B.alphaTest,doubleSided:2===B.side,flipSided:1===B.side,depthPacking:void 0!==B.depthPacking?B.depthPacking:!1}};this.getProgramCode=function(B,C){var H=[];C.shaderID?H.push(C.shaderID):(H.push(B.fragmentShader),H.push(B.vertexShader));if(void 0!==B.defines)for(var I in B.defines)H.push(I),H.push(B.defines[I]);for(I= 0;I<A.length;I++)H.push(C[A[I]]);H.push(B.onBeforeCompile.toString());H.push(a.gammaOutput);H.push(a.gammaFactor);return H.join()};this.acquireProgram=function(B,C,H,I){for(var K,P=0,O=r.length;P<O;P++){var S=r[P];if(S.code===I){K=S;++K.usedTimes;break}}void 0===K&&(K=new Eo(a,c,I,B,C,H,e,g),r.push(K));return K};this.releaseProgram=function(B){0===--B.usedTimes&&(r[r.indexOf(B)]=r[r.length-1],r.pop(),B.destroy())};this.programs=r}function Ho(){var a=new WeakMap;return{get:function(c){var e=a.get(c); void 0===e&&(e={},a.set(c,e));return e},remove:function(c){a.delete(c)},update:function(c,e,g){a.get(c)[e]=g},dispose:function(){a=new WeakMap}}}function Io(a,c){return a.groupOrder!==c.groupOrder?a.groupOrder-c.groupOrder:a.renderOrder!==c.renderOrder?a.renderOrder-c.renderOrder:a.program!==c.program?a.program.id-c.program.id:a.material.id!==c.material.id?a.material.id-c.material.id:a.z!==c.z?a.z-c.z:a.id-c.id}function Jo(a,c){return a.groupOrder!==c.groupOrder?a.groupOrder-c.groupOrder:a.renderOrder!== c.renderOrder?a.renderOrder-c.renderOrder:a.z!==c.z?c.z-a.z:a.id-c.id}function Pk(){function a(u,A,B,C,H,I){var K=c[e];void 0===K?(K={id:u.id,object:u,geometry:A,material:B,program:B.program||r,groupOrder:C,renderOrder:u.renderOrder,z:H,group:I},c[e]=K):(K.id=u.id,K.object=u,K.geometry=A,K.material=B,K.program=B.program||r,K.groupOrder=C,K.renderOrder=u.renderOrder,K.z=H,K.group=I);e++;return K}var c=[],e=0,g=[],k=[],r={id:-1};return{opaque:g,transparent:k,init:function(){e=0;g.length=0;k.length= 0},push:function(u,A,B,C,H,I){u=a(u,A,B,C,H,I);(!0===B.transparent?k:g).push(u)},unshift:function(u,A,B,C,H,I){u=a(u,A,B,C,H,I);(!0===B.transparent?k:g).unshift(u)},sort:function(){1<g.length&&g.sort(Io);1<k.length&&k.sort(Jo)}}}function Ko(){function a(e){e=e.target;e.removeEventListener("dispose",a);delete c[e.id]}var c={};return{get:function(e,g){var k=c[e.id];if(void 0===k){var r=new Pk;c[e.id]={};c[e.id][g.id]=r;e.addEventListener("dispose",a)}else r=k[g.id],void 0===r&&(r=new Pk,k[g.id]=r); return r},dispose:function(){c={}}}}function Lo(){var a={};return{get:function(c){if(void 0!==a[c.id])return a[c.id];switch(c.type){case "DirectionalLight":var e={direction:new m,color:new E,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new f};break;case "SpotLight":e={position:new m,direction:new m,color:new E,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new f};break;case "PointLight":e={position:new m,color:new E,distance:0,decay:0,shadow:!1, shadowBias:0,shadowRadius:1,shadowMapSize:new f,shadowCameraNear:1,shadowCameraFar:1E3};break;case "HemisphereLight":e={direction:new m,skyColor:new E,groundColor:new E};break;case "RectAreaLight":e={color:new E,position:new m,halfWidth:new m,halfHeight:new m}}return a[c.id]=e}}}function Mo(){for(var a=new Lo,c={id:No++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[], directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},e=0;9>e;e++)c.probe.push(new m);var g=new m,k=new G,r=new G;return{setup:function(u,A,B){for(var C=0,H=0,I=0,K=0;9>K;K++)c.probe[K].set(0,0,0);var P=0,O=0,S=0,V=0,ca=0;B=B.matrixWorldInverse;K=0;for(var ha=u.length;K<ha;K++){var ba=u[K],ka=ba.color,da=ba.intensity,ea=ba.distance,na=ba.shadow&&ba.shadow.map?ba.shadow.map.texture:null;if(ba.isAmbientLight)C+=ka.r* da,H+=ka.g*da,I+=ka.b*da;else if(ba.isLightProbe)for(na=0;9>na;na++)c.probe[na].addScaledVector(ba.sh.coefficients[na],da);else if(ba.isDirectionalLight){var la=a.get(ba);la.color.copy(ba.color).multiplyScalar(ba.intensity);la.direction.setFromMatrixPosition(ba.matrixWorld);g.setFromMatrixPosition(ba.target.matrixWorld);la.direction.sub(g);la.direction.transformDirection(B);if(la.shadow=ba.castShadow)da=ba.shadow,la.shadowBias=da.bias,la.shadowRadius=da.radius,la.shadowMapSize=da.mapSize;c.directionalShadowMap[P]= na;c.directionalShadowMatrix[P]=ba.shadow.matrix;c.directional[P]=la;P++}else if(ba.isSpotLight){la=a.get(ba);la.position.setFromMatrixPosition(ba.matrixWorld);la.position.applyMatrix4(B);la.color.copy(ka).multiplyScalar(da);la.distance=ea;la.direction.setFromMatrixPosition(ba.matrixWorld);g.setFromMatrixPosition(ba.target.matrixWorld);la.direction.sub(g);la.direction.transformDirection(B);la.coneCos=Math.cos(ba.angle);la.penumbraCos=Math.cos(ba.angle*(1-ba.penumbra));la.decay=ba.decay;if(la.shadow= ba.castShadow)da=ba.shadow,la.shadowBias=da.bias,la.shadowRadius=da.radius,la.shadowMapSize=da.mapSize;c.spotShadowMap[S]=na;c.spotShadowMatrix[S]=ba.shadow.matrix;c.spot[S]=la;S++}else if(ba.isRectAreaLight)la=a.get(ba),la.color.copy(ka).multiplyScalar(da),la.position.setFromMatrixPosition(ba.matrixWorld),la.position.applyMatrix4(B),r.identity(),k.copy(ba.matrixWorld),k.premultiply(B),r.extractRotation(k),la.halfWidth.set(.5*ba.width,0,0),la.halfHeight.set(0,.5*ba.height,0),la.halfWidth.applyMatrix4(r), la.halfHeight.applyMatrix4(r),c.rectArea[V]=la,V++;else if(ba.isPointLight){la=a.get(ba);la.position.setFromMatrixPosition(ba.matrixWorld);la.position.applyMatrix4(B);la.color.copy(ba.color).multiplyScalar(ba.intensity);la.distance=ba.distance;la.decay=ba.decay;if(la.shadow=ba.castShadow)da=ba.shadow,la.shadowBias=da.bias,la.shadowRadius=da.radius,la.shadowMapSize=da.mapSize,la.shadowCameraNear=da.camera.near,la.shadowCameraFar=da.camera.far;c.pointShadowMap[O]=na;c.pointShadowMatrix[O]=ba.shadow.matrix; c.point[O]=la;O++}else ba.isHemisphereLight&&(la=a.get(ba),la.direction.setFromMatrixPosition(ba.matrixWorld),la.direction.transformDirection(B),la.direction.normalize(),la.skyColor.copy(ba.color).multiplyScalar(da),la.groundColor.copy(ba.groundColor).multiplyScalar(da),c.hemi[ca]=la,ca++)}c.ambient[0]=C;c.ambient[1]=H;c.ambient[2]=I;c.directional.length=P;c.spot.length=S;c.rectArea.length=V;c.point.length=O;c.hemi.length=ca;c.hash.stateID=c.id;c.hash.directionalLength=P;c.hash.pointLength=O;c.hash.spotLength= S;c.hash.rectAreaLength=V;c.hash.hemiLength=ca;c.hash.shadowsLength=A.length},state:c}}function Qk(){var a=new Mo,c=[],e=[];return{init:function(){c.length=0;e.length=0},state:{lightsArray:c,shadowsArray:e,lights:a},setupLights:function(g){a.setup(c,e,g)},pushLight:function(g){c.push(g)},pushShadow:function(g){e.push(g)}}}function Oo(){function a(e){e=e.target;e.removeEventListener("dispose",a);delete c[e.id]}var c={};return{get:function(e,g){if(void 0===c[e.id]){var k=new Qk;c[e.id]={};c[e.id][g.id]= k;e.addEventListener("dispose",a)}else void 0===c[e.id][g.id]?(k=new Qk,c[e.id][g.id]=k):k=c[e.id][g.id];return k},dispose:function(){c={}}}}function Kd(a){bb.call(this);this.type="MeshDepthMaterial";this.depthPacking=3200;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.setValues(a)}function Ld(a){bb.call(this);this.type="MeshDistanceMaterial"; this.referencePosition=new m;this.nearDistance=1;this.farDistance=1E3;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.lights=this.fog=!1;this.setValues(a)}function Rk(a,c,e){function g(ea,na,la,ua,Da,wa){var Ca=ea.geometry;var Ea=I;var Qa=ea.customDepthMaterial;la&&(Ea=K,Qa=ea.customDistanceMaterial);Qa?Ea=Qa:(Qa=!1,na.morphTargets&&(Ca&&Ca.isBufferGeometry?Qa=Ca.morphAttributes&&Ca.morphAttributes.position&& 0<Ca.morphAttributes.position.length:Ca&&Ca.isGeometry&&(Qa=Ca.morphTargets&&0<Ca.morphTargets.length)),ea.isSkinnedMesh&&!1===na.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",ea),ea=ea.isSkinnedMesh&&na.skinning,Ca=0,Qa&&(Ca|=1),ea&&(Ca|=2),Ea=Ea[Ca]);a.localClippingEnabled&&!0===na.clipShadows&&0!==na.clippingPlanes.length&&(Ca=Ea.uuid,Qa=na.uuid,ea=P[Ca],void 0===ea&&(ea={},P[Ca]=ea),Ca=ea[Qa],void 0===Ca&&(Ca=Ea.clone(),ea[Qa]=Ca),Ea=Ca); Ea.visible=na.visible;Ea.wireframe=na.wireframe;Ea.side=null!=na.shadowSide?na.shadowSide:O[na.side];Ea.clipShadows=na.clipShadows;Ea.clippingPlanes=na.clippingPlanes;Ea.clipIntersection=na.clipIntersection;Ea.wireframeLinewidth=na.wireframeLinewidth;Ea.linewidth=na.linewidth;la&&Ea.isMeshDistanceMaterial&&(Ea.referencePosition.copy(ua),Ea.nearDistance=Da,Ea.farDistance=wa);return Ea}function k(ea,na,la,ua){if(!1!==ea.visible){if(ea.layers.test(na.layers)&&(ea.isMesh||ea.isLine||ea.isPoints)&&ea.castShadow&& (!ea.frustumCulled||r.intersectsObject(ea))){ea.modelViewMatrix.multiplyMatrices(la.matrixWorldInverse,ea.matrixWorld);var Da=c.update(ea),wa=ea.material;if(Array.isArray(wa))for(var Ca=Da.groups,Ea=0,Qa=Ca.length;Ea<Qa;Ea++){var W=Ca[Ea],aa=wa[W.materialIndex];aa&&aa.visible&&(aa=g(ea,aa,ua,H,la.near,la.far),a.renderBufferDirect(la,null,Da,aa,ea,W))}else wa.visible&&(aa=g(ea,wa,ua,H,la.near,la.far),a.renderBufferDirect(la,null,Da,aa,ea,null))}ea=ea.children;Da=0;for(wa=ea.length;Da<wa;Da++)k(ea[Da], na,la,ua)}}var r=new D,u=new G,A=new f,B=new f(e,e),C=new m,H=new m,I=Array(4),K=Array(4),P={},O={0:1,1:0,2:2},S=[new m(1,0,0),new m(-1,0,0),new m(0,0,1),new m(0,0,-1),new m(0,1,0),new m(0,-1,0)],V=[new m(0,1,0),new m(0,1,0),new m(0,1,0),new m(0,1,0),new m(0,0,1),new m(0,0,-1)],ca=[new p,new p,new p,new p,new p,new p];for(e=0;4!==e;++e){var ha=0!==(e&1),ba=0!==(e&2),ka=new Kd({depthPacking:3201,morphTargets:ha,skinning:ba});I[e]=ka;ha=new Ld({morphTargets:ha,skinning:ba});K[e]=ha}var da=this;this.enabled= !1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(ea,na,la){if(!1!==da.enabled&&(!1!==da.autoUpdate||!1!==da.needsUpdate)&&0!==ea.length){var ua=a.getRenderTarget(),Da=a.state;Da.setBlending(0);Da.buffers.color.setClear(1,1,1,1);Da.buffers.depth.setTest(!0);Da.setScissorTest(!1);for(var wa,Ca=0,Ea=ea.length;Ca<Ea;Ca++){var Qa=ea[Ca];wa=Qa.shadow;var W=Qa&&Qa.isPointLight;if(void 0===wa)console.warn("THREE.WebGLShadowMap:",Qa,"has no shadow.");else{var aa=wa.camera;A.copy(wa.mapSize); A.min(B);if(W){var ja=A.x,ra=A.y;ca[0].set(2*ja,ra,ja,ra);ca[1].set(0,ra,ja,ra);ca[2].set(3*ja,ra,ja,ra);ca[3].set(ja,ra,ja,ra);ca[4].set(3*ja,0,ja,ra);ca[5].set(ja,0,ja,ra);A.x*=4;A.y*=2}null===wa.map&&(wa.map=new n(A.x,A.y,{minFilter:1003,magFilter:1003,format:1023}),wa.map.texture.name=Qa.name+".shadowMap",aa.updateProjectionMatrix());wa.isSpotLightShadow&&wa.update(Qa);ja=wa.map;ra=wa.matrix;H.setFromMatrixPosition(Qa.matrixWorld);aa.position.copy(H);W?(wa=6,ra.makeTranslation(-H.x,-H.y,-H.z)): (wa=1,C.setFromMatrixPosition(Qa.target.matrixWorld),aa.lookAt(C),aa.updateMatrixWorld(),ra.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),ra.multiply(aa.projectionMatrix),ra.multiply(aa.matrixWorldInverse));a.setRenderTarget(ja);a.clear();for(Qa=0;Qa<wa;Qa++)W&&(C.copy(aa.position),C.add(S[Qa]),aa.up.copy(V[Qa]),aa.lookAt(C),aa.updateMatrixWorld(),Da.viewport(ca[Qa])),u.multiplyMatrices(aa.projectionMatrix,aa.matrixWorldInverse),r.setFromMatrix(u),k(na,la,aa,W)}}da.needsUpdate=!1;a.setRenderTarget(ua)}}} function Po(a,c,e,g){function k(ia,Oa,eb){var jb=new Uint8Array(4),Xa=a.createTexture();a.bindTexture(ia,Xa);a.texParameteri(ia,10241,9728);a.texParameteri(ia,10240,9728);for(ia=0;ia<eb;ia++)a.texImage2D(Oa+ia,0,6408,1,1,0,6408,5121,jb);return Xa}function r(ia,Oa){ca[ia]=1;0===ha[ia]&&(a.enableVertexAttribArray(ia),ha[ia]=1);ba[ia]!==Oa&&((g.isWebGL2?a:c.get("ANGLE_instanced_arrays"))[g.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](ia,Oa),ba[ia]=Oa)}function u(ia){!0!==ka[ia]&&(a.enable(ia), ka[ia]=!0)}function A(ia){!1!==ka[ia]&&(a.disable(ia),ka[ia]=!1)}function B(ia,Oa,eb,jb,Xa,gb,Sa,Va){if(0===ia)na&&(A(3042),na=!1);else if(na||(u(3042),na=!0),5!==ia){if(ia!==la||Va!==W){if(100!==ua||100!==Ca)a.blendEquation(32774),Ca=ua=100;if(Va)switch(ia){case 1:a.blendFuncSeparate(1,771,1,771);break;case 2:a.blendFunc(1,1);break;case 3:a.blendFuncSeparate(0,0,769,771);break;case 4:a.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",ia)}else switch(ia){case 1:a.blendFuncSeparate(770, 771,1,771);break;case 2:a.blendFunc(770,1);break;case 3:a.blendFunc(0,769);break;case 4:a.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",ia)}Qa=Ea=wa=Da=null;la=ia;W=Va}}else{Xa=Xa||Oa;gb=gb||eb;Sa=Sa||jb;if(Oa!==ua||Xa!==Ca)a.blendEquationSeparate(e.convert(Oa),e.convert(Xa)),ua=Oa,Ca=Xa;if(eb!==Da||jb!==wa||gb!==Ea||Sa!==Qa)a.blendFuncSeparate(e.convert(eb),e.convert(jb),e.convert(gb),e.convert(Sa)),Da=eb,wa=jb,Ea=gb,Qa=Sa;la=ia;W=null}}function C(ia){aa!==ia&& (ia?a.frontFace(2304):a.frontFace(2305),aa=ia)}function H(ia){0!==ia?(u(2884),ia!==ja&&(1===ia?a.cullFace(1029):2===ia?a.cullFace(1028):a.cullFace(1032))):A(2884);ja=ia}function I(ia,Oa,eb){if(ia){if(u(32823),Aa!==Oa||Ia!==eb)a.polygonOffset(Oa,eb),Aa=Oa,Ia=eb}else A(32823)}function K(ia){void 0===ia&&(ia=33984+kb-1);Ya!==ia&&(a.activeTexture(ia),Ya=ia)}var P=new function(){var ia=!1,Oa=new p,eb=null,jb=new p(0,0,0,0);return{setMask:function(Xa){eb===Xa||ia||(a.colorMask(Xa,Xa,Xa,Xa),eb=Xa)},setLocked:function(Xa){ia= Xa},setClear:function(Xa,gb,Sa,Va,ya){!0===ya&&(Xa*=Va,gb*=Va,Sa*=Va);Oa.set(Xa,gb,Sa,Va);!1===jb.equals(Oa)&&(a.clearColor(Xa,gb,Sa,Va),jb.copy(Oa))},reset:function(){ia=!1;eb=null;jb.set(-1,0,0,0)}}},O=new function(){var ia=!1,Oa=null,eb=null,jb=null;return{setTest:function(Xa){Xa?u(2929):A(2929)},setMask:function(Xa){Oa===Xa||ia||(a.depthMask(Xa),Oa=Xa)},setFunc:function(Xa){if(eb!==Xa){if(Xa)switch(Xa){case 0:a.depthFunc(512);break;case 1:a.depthFunc(519);break;case 2:a.depthFunc(513);break;case 3:a.depthFunc(515); break;case 4:a.depthFunc(514);break;case 5:a.depthFunc(518);break;case 6:a.depthFunc(516);break;case 7:a.depthFunc(517);break;default:a.depthFunc(515)}else a.depthFunc(515);eb=Xa}},setLocked:function(Xa){ia=Xa},setClear:function(Xa){jb!==Xa&&(a.clearDepth(Xa),jb=Xa)},reset:function(){ia=!1;jb=eb=Oa=null}}},S=new function(){var ia=!1,Oa=null,eb=null,jb=null,Xa=null,gb=null,Sa=null,Va=null,ya=null;return{setTest:function(Ma){Ma?u(2960):A(2960)},setMask:function(Ma){Oa===Ma||ia||(a.stencilMask(Ma),Oa= Ma)},setFunc:function(Ma,Za,Ta){if(eb!==Ma||jb!==Za||Xa!==Ta)a.stencilFunc(Ma,Za,Ta),eb=Ma,jb=Za,Xa=Ta},setOp:function(Ma,Za,Ta){if(gb!==Ma||Sa!==Za||Va!==Ta)a.stencilOp(Ma,Za,Ta),gb=Ma,Sa=Za,Va=Ta},setLocked:function(Ma){ia=Ma},setClear:function(Ma){ya!==Ma&&(a.clearStencil(Ma),ya=Ma)},reset:function(){ia=!1;ya=Va=Sa=gb=Xa=jb=eb=Oa=null}}},V=a.getParameter(34921),ca=new Uint8Array(V),ha=new Uint8Array(V),ba=new Uint8Array(V),ka={},da=null,ea=null,na=null,la=null,ua=null,Da=null,wa=null,Ca=null,Ea= null,Qa=null,W=!1,aa=null,ja=null,ra=null,Aa=null,Ia=null,kb=a.getParameter(35661),lb=!1;V=0;V=a.getParameter(7938);-1!==V.indexOf("WebGL")?(V=parseFloat(/^WebGL ([0-9])/.exec(V)[1]),lb=1<=V):-1!==V.indexOf("OpenGL ES")&&(V=parseFloat(/^OpenGL ES ([0-9])/.exec(V)[1]),lb=2<=V);var Ya=null,db={},hb=new p,ob=new p,Ga={};Ga[3553]=k(3553,3553,1);Ga[34067]=k(34067,34069,6);P.setClear(0,0,0,1);O.setClear(1);S.setClear(0);u(2929);O.setFunc(3);C(!1);H(1);u(2884);B(0);return{buffers:{color:P,depth:O,stencil:S}, initAttributes:function(){for(var ia=0,Oa=ca.length;ia<Oa;ia++)ca[ia]=0},enableAttribute:function(ia){r(ia,0)},enableAttributeAndDivisor:r,disableUnusedAttributes:function(){for(var ia=0,Oa=ha.length;ia!==Oa;++ia)ha[ia]!==ca[ia]&&(a.disableVertexAttribArray(ia),ha[ia]=0)},enable:u,disable:A,getCompressedTextureFormats:function(){if(null===da&&(da=[],c.get("WEBGL_compressed_texture_pvrtc")||c.get("WEBGL_compressed_texture_s3tc")||c.get("WEBGL_compressed_texture_etc1")||c.get("WEBGL_compressed_texture_astc")))for(var ia= a.getParameter(34467),Oa=0;Oa<ia.length;Oa++)da.push(ia[Oa]);return da},useProgram:function(ia){return ea!==ia?(a.useProgram(ia),ea=ia,!0):!1},setBlending:B,setMaterial:function(ia,Oa){2===ia.side?A(2884):u(2884);var eb=1===ia.side;Oa&&(eb=!eb);C(eb);1===ia.blending&&!1===ia.transparent?B(0):B(ia.blending,ia.blendEquation,ia.blendSrc,ia.blendDst,ia.blendEquationAlpha,ia.blendSrcAlpha,ia.blendDstAlpha,ia.premultipliedAlpha);O.setFunc(ia.depthFunc);O.setTest(ia.depthTest);O.setMask(ia.depthWrite);P.setMask(ia.colorWrite); I(ia.polygonOffset,ia.polygonOffsetFactor,ia.polygonOffsetUnits)},setFlipSided:C,setCullFace:H,setLineWidth:function(ia){ia!==ra&&(lb&&a.lineWidth(ia),ra=ia)},setPolygonOffset:I,setScissorTest:function(ia){ia?u(3089):A(3089)},activeTexture:K,bindTexture:function(ia,Oa){null===Ya&&K();var eb=db[Ya];void 0===eb&&(eb={type:void 0,texture:void 0},db[Ya]=eb);if(eb.type!==ia||eb.texture!==Oa)a.bindTexture(ia,Oa||Ga[ia]),eb.type=ia,eb.texture=Oa},compressedTexImage2D:function(){try{a.compressedTexImage2D.apply(a, arguments)}catch(ia){console.error("THREE.WebGLState:",ia)}},texImage2D:function(){try{a.texImage2D.apply(a,arguments)}catch(ia){console.error("THREE.WebGLState:",ia)}},texImage3D:function(){try{a.texImage3D.apply(a,arguments)}catch(ia){console.error("THREE.WebGLState:",ia)}},scissor:function(ia){!1===hb.equals(ia)&&(a.scissor(ia.x,ia.y,ia.z,ia.w),hb.copy(ia))},viewport:function(ia){!1===ob.equals(ia)&&(a.viewport(ia.x,ia.y,ia.z,ia.w),ob.copy(ia))},reset:function(){for(var ia=0;ia<ha.length;ia++)1=== ha[ia]&&(a.disableVertexAttribArray(ia),ha[ia]=0);ka={};Ya=da=null;db={};ja=aa=la=ea=null;P.reset();O.reset();S.reset()}}}function Qo(a,c,e,g,k,r,u){function A(W,aa){return wa?new OffscreenCanvas(W,aa):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function B(W,aa,ja,ra){var Aa=1;if(W.width>ra||W.height>ra)Aa=ra/Math.max(W.width,W.height);if(1>Aa||!0===aa){if("undefined"!==typeof HTMLImageElement&&W instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&W instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&W instanceof ImageBitmap)return ra=aa?ab.floorPowerOfTwo:Math.floor,aa=ra(Aa*W.width),Aa=ra(Aa*W.height),void 0===Da&&(Da=A(aa,Aa)),ja=ja?A(aa,Aa):Da,ja.width=aa,ja.height=Aa,ja.getContext("2d").drawImage(W,0,0,aa,Aa),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+W.width+"x"+W.height+") to ("+aa+"x"+Aa+")."),ja;"data"in W&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+W.width+"x"+W.height+").")}return W} function C(W){return ab.isPowerOfTwo(W.width)&&ab.isPowerOfTwo(W.height)}function H(W,aa){return W.generateMipmaps&&aa&&1003!==W.minFilter&&1006!==W.minFilter}function I(W,aa,ja,ra){a.generateMipmap(W);g.get(aa).__maxMipLevel=Math.log(Math.max(ja,ra))*Math.LOG2E}function K(W,aa){if(!k.isWebGL2)return W;var ja=W;6403===W&&(5126===aa&&(ja=33326),5131===aa&&(ja=33325),5121===aa&&(ja=33321));6407===W&&(5126===aa&&(ja=34837),5131===aa&&(ja=34843),5121===aa&&(ja=32849));6408===W&&(5126===aa&&(ja=34836), 5131===aa&&(ja=34842),5121===aa&&(ja=32856));33325===ja||33326===ja||34842===ja||34836===ja?c.get("EXT_color_buffer_float"):(34843===ja||34837===ja)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead.");return ja}function P(W){return 1003===W||1004===W||1005===W?9728:9729}function O(W){W=W.target;W.removeEventListener("dispose",O);var aa=g.get(W);void 0!==aa.__webglInit&&(a.deleteTexture(aa.__webglTexture),g.remove(W));W.isVideoTexture&& delete ua[W.id];u.memory.textures--}function S(W){W=W.target;W.removeEventListener("dispose",S);var aa=g.get(W),ja=g.get(W.texture);if(W){void 0!==ja.__webglTexture&&a.deleteTexture(ja.__webglTexture);W.depthTexture&&W.depthTexture.dispose();if(W.isWebGLRenderTargetCube)for(ja=0;6>ja;ja++)a.deleteFramebuffer(aa.__webglFramebuffer[ja]),aa.__webglDepthbuffer&&a.deleteRenderbuffer(aa.__webglDepthbuffer[ja]);else a.deleteFramebuffer(aa.__webglFramebuffer),aa.__webglDepthbuffer&&a.deleteRenderbuffer(aa.__webglDepthbuffer); g.remove(W.texture);g.remove(W)}u.memory.textures--}function V(W,aa){var ja=g.get(W);if(W.isVideoTexture){var ra=W.id,Aa=u.render.frame;ua[ra]!==Aa&&(ua[ra]=Aa,W.update())}if(0<W.version&&ja.__version!==W.version)if(ra=W.image,void 0===ra)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(!1===ra.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{da(ja,W,aa);return}e.activeTexture(33984+aa);e.bindTexture(3553, ja.__webglTexture)}function ca(W,aa){var ja=g.get(W);if(6===W.image.length)if(0<W.version&&ja.__version!==W.version){ka(ja,W);e.activeTexture(33984+aa);e.bindTexture(34067,ja.__webglTexture);a.pixelStorei(37440,W.flipY);aa=W&&W.isCompressedTexture;for(var ra=W.image[0]&&W.image[0].isDataTexture,Aa=[],Ia=0;6>Ia;Ia++)Aa[Ia]=aa||ra?ra?W.image[Ia].image:W.image[Ia]:B(W.image[Ia],!1,!0,k.maxCubemapSize);var kb=Aa[0],lb=C(kb)||k.isWebGL2,Ya=r.convert(W.format),db=r.convert(W.type),hb=K(Ya,db);ba(34067, W,lb);for(Ia=0;6>Ia;Ia++)if(aa)for(var ob,Ga=Aa[Ia].mipmaps,ia=0,Oa=Ga.length;ia<Oa;ia++)ob=Ga[ia],1023!==W.format&&1022!==W.format?-1<e.getCompressedTextureFormats().indexOf(Ya)?e.compressedTexImage2D(34069+Ia,ia,hb,ob.width,ob.height,0,ob.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):e.texImage2D(34069+Ia,ia,hb,ob.width,ob.height,0,Ya,db,ob.data);else ra?e.texImage2D(34069+Ia,0,hb,Aa[Ia].width,Aa[Ia].height,0,Ya,db,Aa[Ia].data): e.texImage2D(34069+Ia,0,hb,Ya,db,Aa[Ia]);ja.__maxMipLevel=aa?Ga.length-1:0;H(W,lb)&&I(34067,W,kb.width,kb.height);ja.__version=W.version;if(W.onUpdate)W.onUpdate(W)}else e.activeTexture(33984+aa),e.bindTexture(34067,ja.__webglTexture)}function ha(W,aa){e.activeTexture(33984+aa);e.bindTexture(34067,g.get(W).__webglTexture)}function ba(W,aa,ja){ja?(a.texParameteri(W,10242,r.convert(aa.wrapS)),a.texParameteri(W,10243,r.convert(aa.wrapT)),32879!==W&&35866!==W||a.texParameteri(W,32882,r.convert(aa.wrapR)), a.texParameteri(W,10240,r.convert(aa.magFilter)),a.texParameteri(W,10241,r.convert(aa.minFilter))):(a.texParameteri(W,10242,33071),a.texParameteri(W,10243,33071),32879!==W&&35866!==W||a.texParameteri(W,32882,33071),1001===aa.wrapS&&1001===aa.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),a.texParameteri(W,10240,P(aa.magFilter)),a.texParameteri(W,10241,P(aa.minFilter)),1003!==aa.minFilter&&1006!== aa.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));!(ja=c.get("EXT_texture_filter_anisotropic"))||1015===aa.type&&null===c.get("OES_texture_float_linear")||1016===aa.type&&null===(k.isWebGL2||c.get("OES_texture_half_float_linear"))||!(1<aa.anisotropy||g.get(aa).__currentAnisotropy)||(a.texParameterf(W,ja.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(aa.anisotropy,k.getMaxAnisotropy())),g.get(aa).__currentAnisotropy= aa.anisotropy)}function ka(W,aa){void 0===W.__webglInit&&(W.__webglInit=!0,aa.addEventListener("dispose",O),W.__webglTexture=a.createTexture(),u.memory.textures++)}function da(W,aa,ja){var ra=3553;aa.isDataTexture2DArray&&(ra=35866);aa.isDataTexture3D&&(ra=32879);ka(W,aa);e.activeTexture(33984+ja);e.bindTexture(ra,W.__webglTexture);a.pixelStorei(37440,aa.flipY);a.pixelStorei(37441,aa.premultiplyAlpha);a.pixelStorei(3317,aa.unpackAlignment);ja=(k.isWebGL2?!1:1001!==aa.wrapS||1001!==aa.wrapT||1003!== aa.minFilter&&1006!==aa.minFilter)&&!1===C(aa.image);ja=B(aa.image,ja,!1,k.maxTextureSize);var Aa=C(ja)||k.isWebGL2,Ia=r.convert(aa.format),kb=r.convert(aa.type),lb=K(Ia,kb);ba(ra,aa,Aa);var Ya=aa.mipmaps;if(aa.isDepthTexture){lb=6402;if(1015===aa.type){if(!k.isWebGL2)throw Error("Float Depth Texture only supported in WebGL2.0");lb=36012}else k.isWebGL2&&(lb=33189);1026===aa.format&&6402===lb&&1012!==aa.type&&1014!==aa.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."), aa.type=1012,kb=r.convert(aa.type));1027===aa.format&&(lb=34041,1020!==aa.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),aa.type=1020,kb=r.convert(aa.type)));e.texImage2D(3553,0,lb,ja.width,ja.height,0,Ia,kb,null)}else if(aa.isDataTexture)if(0<Ya.length&&Aa){for(var db=0,hb=Ya.length;db<hb;db++)ra=Ya[db],e.texImage2D(3553,db,lb,ra.width,ra.height,0,Ia,kb,ra.data);aa.generateMipmaps=!1;W.__maxMipLevel=Ya.length-1}else e.texImage2D(3553,0,lb, ja.width,ja.height,0,Ia,kb,ja.data),W.__maxMipLevel=0;else if(aa.isCompressedTexture){db=0;for(hb=Ya.length;db<hb;db++)ra=Ya[db],1023!==aa.format&&1022!==aa.format?-1<e.getCompressedTextureFormats().indexOf(Ia)?e.compressedTexImage2D(3553,db,lb,ra.width,ra.height,0,ra.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):e.texImage2D(3553,db,lb,ra.width,ra.height,0,Ia,kb,ra.data);W.__maxMipLevel=Ya.length-1}else if(aa.isDataTexture2DArray)e.texImage3D(35866, 0,lb,ja.width,ja.height,ja.depth,0,Ia,kb,ja.data),W.__maxMipLevel=0;else if(aa.isDataTexture3D)e.texImage3D(32879,0,lb,ja.width,ja.height,ja.depth,0,Ia,kb,ja.data),W.__maxMipLevel=0;else if(0<Ya.length&&Aa){db=0;for(hb=Ya.length;db<hb;db++)ra=Ya[db],e.texImage2D(3553,db,lb,Ia,kb,ra);aa.generateMipmaps=!1;W.__maxMipLevel=Ya.length-1}else e.texImage2D(3553,0,lb,Ia,kb,ja),W.__maxMipLevel=0;H(aa,Aa)&&I(3553,aa,ja.width,ja.height);W.__version=aa.version;if(aa.onUpdate)aa.onUpdate(aa)}function ea(W,aa, ja,ra){var Aa=r.convert(aa.texture.format),Ia=r.convert(aa.texture.type),kb=K(Aa,Ia);e.texImage2D(ra,0,kb,aa.width,aa.height,0,Aa,Ia,null);a.bindFramebuffer(36160,W);a.framebufferTexture2D(36160,ja,ra,g.get(aa.texture).__webglTexture,0);a.bindFramebuffer(36160,null)}function na(W,aa,ja){a.bindRenderbuffer(36161,W);if(aa.depthBuffer&&!aa.stencilBuffer)ja?(ja=la(aa),a.renderbufferStorageMultisample(36161,ja,33189,aa.width,aa.height)):a.renderbufferStorage(36161,33189,aa.width,aa.height),a.framebufferRenderbuffer(36160, 36096,36161,W);else if(aa.depthBuffer&&aa.stencilBuffer)ja?(ja=la(aa),a.renderbufferStorageMultisample(36161,ja,34041,aa.width,aa.height)):a.renderbufferStorage(36161,34041,aa.width,aa.height),a.framebufferRenderbuffer(36160,33306,36161,W);else{W=r.convert(aa.texture.format);var ra=r.convert(aa.texture.type);W=K(W,ra);ja?(ja=la(aa),a.renderbufferStorageMultisample(36161,ja,W,aa.width,aa.height)):a.renderbufferStorage(36161,W,aa.width,aa.height)}a.bindRenderbuffer(36161,null)}function la(W){return k.isWebGL2&& W.isWebGLMultisampleRenderTarget?Math.min(k.maxSamples,W.samples):0}var ua={},Da,wa="undefined"!==typeof OffscreenCanvas,Ca=0,Ea=!1,Qa=!1;this.allocateTextureUnit=function(){var W=Ca;W>=k.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+W+" texture units while this GPU supports only "+k.maxTextures);Ca+=1;return W};this.resetTextureUnits=function(){Ca=0};this.setTexture2D=V;this.setTexture2DArray=function(W,aa){var ja=g.get(W);0<W.version&&ja.__version!==W.version?da(ja,W,aa):(e.activeTexture(33984+ aa),e.bindTexture(35866,ja.__webglTexture))};this.setTexture3D=function(W,aa){var ja=g.get(W);0<W.version&&ja.__version!==W.version?da(ja,W,aa):(e.activeTexture(33984+aa),e.bindTexture(32879,ja.__webglTexture))};this.setTextureCube=ca;this.setTextureCubeDynamic=ha;this.setupRenderTarget=function(W){var aa=g.get(W),ja=g.get(W.texture);W.addEventListener("dispose",S);ja.__webglTexture=a.createTexture();u.memory.textures++;var ra=!0===W.isWebGLRenderTargetCube,Aa=!0===W.isWebGLMultisampleRenderTarget, Ia=C(W)||k.isWebGL2;if(ra)for(aa.__webglFramebuffer=[],Aa=0;6>Aa;Aa++)aa.__webglFramebuffer[Aa]=a.createFramebuffer();else if(aa.__webglFramebuffer=a.createFramebuffer(),Aa)if(k.isWebGL2){aa.__webglMultisampledFramebuffer=a.createFramebuffer();aa.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,aa.__webglColorRenderbuffer);Aa=r.convert(W.texture.format);var kb=r.convert(W.texture.type);Aa=K(Aa,kb);kb=la(W);a.renderbufferStorageMultisample(36161,kb,Aa,W.width,W.height);a.bindFramebuffer(36160, aa.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,aa.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);W.depthBuffer&&(aa.__webglDepthRenderbuffer=a.createRenderbuffer(),na(aa.__webglDepthRenderbuffer,W,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(ra){e.bindTexture(34067,ja.__webglTexture);ba(34067,W.texture,Ia);for(Aa=0;6>Aa;Aa++)ea(aa.__webglFramebuffer[Aa],W,36064,34069+ Aa);H(W.texture,Ia)&&I(34067,W.texture,W.width,W.height);e.bindTexture(34067,null)}else e.bindTexture(3553,ja.__webglTexture),ba(3553,W.texture,Ia),ea(aa.__webglFramebuffer,W,36064,3553),H(W.texture,Ia)&&I(3553,W.texture,W.width,W.height),e.bindTexture(3553,null);if(W.depthBuffer){aa=g.get(W);ja=!0===W.isWebGLRenderTargetCube;if(W.depthTexture){if(ja)throw Error("target.depthTexture not supported in Cube render targets");if(W&&W.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported"); a.bindFramebuffer(36160,aa.__webglFramebuffer);if(!W.depthTexture||!W.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");g.get(W.depthTexture).__webglTexture&&W.depthTexture.image.width===W.width&&W.depthTexture.image.height===W.height||(W.depthTexture.image.width=W.width,W.depthTexture.image.height=W.height,W.depthTexture.needsUpdate=!0);V(W.depthTexture,0);aa=g.get(W.depthTexture).__webglTexture;if(1026===W.depthTexture.format)a.framebufferTexture2D(36160, 36096,3553,aa,0);else if(1027===W.depthTexture.format)a.framebufferTexture2D(36160,33306,3553,aa,0);else throw Error("Unknown depthTexture format");}else if(ja)for(aa.__webglDepthbuffer=[],ja=0;6>ja;ja++)a.bindFramebuffer(36160,aa.__webglFramebuffer[ja]),aa.__webglDepthbuffer[ja]=a.createRenderbuffer(),na(aa.__webglDepthbuffer[ja],W);else a.bindFramebuffer(36160,aa.__webglFramebuffer),aa.__webglDepthbuffer=a.createRenderbuffer(),na(aa.__webglDepthbuffer,W);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap= function(W){var aa=W.texture,ja=C(W)||k.isWebGL2;if(H(aa,ja)){ja=W.isWebGLRenderTargetCube?34067:3553;var ra=g.get(aa).__webglTexture;e.bindTexture(ja,ra);I(ja,aa,W.width,W.height);e.bindTexture(ja,null)}};this.updateMultisampleRenderTarget=function(W){if(W.isWebGLMultisampleRenderTarget)if(k.isWebGL2){var aa=g.get(W);a.bindFramebuffer(36008,aa.__webglMultisampledFramebuffer);a.bindFramebuffer(36009,aa.__webglFramebuffer);aa=W.width;var ja=W.height,ra=16384;W.depthBuffer&&(ra|=256);W.stencilBuffer&& (ra|=1024);a.blitFramebuffer(0,0,aa,ja,0,0,aa,ja,ra,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")};this.safeSetTexture2D=function(W,aa){W&&W.isWebGLRenderTarget&&(!1===Ea&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Ea=!0),W=W.texture);V(W,aa)};this.safeSetTextureCube=function(W,aa){W&&W.isWebGLRenderTargetCube&&(!1===Qa&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."), Qa=!0),W=W.texture);W&&W.isCubeTexture||Array.isArray(W.image)&&6===W.image.length?ca(W,aa):ha(W,aa)}}function Sk(a,c,e){return{convert:function(g){if(1E3===g)return 10497;if(1001===g)return 33071;if(1002===g)return 33648;if(1003===g)return 9728;if(1004===g)return 9984;if(1005===g)return 9986;if(1006===g)return 9729;if(1007===g)return 9985;if(1008===g)return 9987;if(1009===g)return 5121;if(1017===g)return 32819;if(1018===g)return 32820;if(1019===g)return 33635;if(1010===g)return 5120;if(1011===g)return 5122; if(1012===g)return 5123;if(1013===g)return 5124;if(1014===g)return 5125;if(1015===g)return 5126;if(1016===g){if(e.isWebGL2)return 5131;var k=c.get("OES_texture_half_float");if(null!==k)return k.HALF_FLOAT_OES}if(1021===g)return 6406;if(1022===g)return 6407;if(1023===g)return 6408;if(1024===g)return 6409;if(1025===g)return 6410;if(1026===g)return 6402;if(1027===g)return 34041;if(1028===g)return 6403;if(100===g)return 32774;if(101===g)return 32778;if(102===g)return 32779;if(200===g)return 0;if(201=== g)return 1;if(202===g)return 768;if(203===g)return 769;if(204===g)return 770;if(205===g)return 771;if(206===g)return 772;if(207===g)return 773;if(208===g)return 774;if(209===g)return 775;if(210===g)return 776;if(33776===g||33777===g||33778===g||33779===g)if(k=c.get("WEBGL_compressed_texture_s3tc"),null!==k){if(33776===g)return k.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===g)return k.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===g)return k.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===g)return k.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840=== g||35841===g||35842===g||35843===g)if(k=c.get("WEBGL_compressed_texture_pvrtc"),null!==k){if(35840===g)return k.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===g)return k.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===g)return k.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===g)return k.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===g&&(k=c.get("WEBGL_compressed_texture_etc1"),null!==k))return k.COMPRESSED_RGB_ETC1_WEBGL;if(37808===g||37809===g||37810===g||37811===g||37812===g||37813===g||37814===g||37815===g||37816=== g||37817===g||37818===g||37819===g||37820===g||37821===g)if(k=c.get("WEBGL_compressed_texture_astc"),null!==k)return g;if(103===g||104===g){if(e.isWebGL2){if(103===g)return 32775;if(104===g)return 32776}k=c.get("EXT_blend_minmax");if(null!==k){if(103===g)return k.MIN_EXT;if(104===g)return k.MAX_EXT}}if(1020===g){if(e.isWebGL2)return 34042;k=c.get("WEBGL_depth_texture");if(null!==k)return k.UNSIGNED_INT_24_8_WEBGL}return 0}}}function Le(){T.call(this);this.type="Group"}function Yc(){T.call(this);this.type= "Camera";this.matrixWorldInverse=new G;this.projectionMatrix=new G;this.projectionMatrixInverse=new G}function Lb(a,c,e,g){Yc.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==e?e:.1;this.far=void 0!==g?g:2E3;this.focus=10;this.aspect=void 0!==c?c:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Qf(a){Lb.call(this);this.cameras=a||[]}function Tk(a,c,e){Uk.setFromMatrixPosition(c.matrixWorld);Vk.setFromMatrixPosition(e.matrixWorld); var g=Uk.distanceTo(Vk),k=c.projectionMatrix.elements,r=e.projectionMatrix.elements,u=k[14]/(k[10]-1);e=k[14]/(k[10]+1);var A=(k[9]+1)/k[5],B=(k[9]-1)/k[5],C=(k[8]-1)/k[0],H=(r[8]+1)/r[0];k=u*C;r=u*H;H=g/(-C+H);C=H*-C;c.matrixWorld.decompose(a.position,a.quaternion,a.scale);a.translateX(C);a.translateZ(H);a.matrixWorld.compose(a.position,a.quaternion,a.scale);a.matrixWorldInverse.getInverse(a.matrixWorld);c=u+H;u=e+H;a.projectionMatrix.makePerspective(k-C,r+(g-C),A*e/u*c,B*e/u*c,c,u)}function Wk(a){function c(){return null!== k&&!0===k.isPresenting}function e(){if(c()){var ea=k.getEyeParameters("left"),na=ea.renderWidth*H;ea=ea.renderHeight*H;ba=a.getPixelRatio();a.getSize(ha);a.setDrawingBufferSize(2*na,ea,1);da.start()}else g.enabled&&a.setDrawingBufferSize(ha.width,ha.height,ba),da.stop()}var g=this,k=null,r=null,u=null,A=[],B=new G,C=new G,H=1,I="stage";"undefined"!==typeof window&&"VRFrameData"in window&&(r=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",e,!1));var K=new G,P=new h,O=new m, S=new Lb;S.bounds=new p(0,0,.5,1);S.layers.enable(1);var V=new Lb;V.bounds=new p(.5,0,.5,1);V.layers.enable(2);var ca=new Qf([S,V]);ca.layers.enable(1);ca.layers.enable(2);var ha=new f,ba,ka=[];this.enabled=!1;this.getController=function(ea){var na=A[ea];void 0===na&&(na=new Le,na.matrixAutoUpdate=!1,na.visible=!1,A[ea]=na);return na};this.getDevice=function(){return k};this.setDevice=function(ea){void 0!==ea&&(k=ea);da.setContext(ea)};this.setFramebufferScaleFactor=function(ea){H=ea};this.setFrameOfReferenceType= function(ea){I=ea};this.setPoseTarget=function(ea){void 0!==ea&&(u=ea)};this.getCamera=function(ea){var na="stage"===I?1.6:0;if(!1===c())return ea.position.set(0,na,0),ea.rotation.set(0,0,0),ea;k.depthNear=ea.near;k.depthFar=ea.far;k.getFrameData(r);if("stage"===I){var la=k.stageParameters;la?B.fromArray(la.sittingToStandingTransform):B.makeTranslation(0,na,0)}na=r.pose;la=null!==u?u:ea;la.matrix.copy(B);la.matrix.decompose(la.position,la.quaternion,la.scale);null!==na.orientation&&(P.fromArray(na.orientation), la.quaternion.multiply(P));null!==na.position&&(P.setFromRotationMatrix(B),O.fromArray(na.position),O.applyQuaternion(P),la.position.add(O));la.updateMatrixWorld();S.near=ea.near;V.near=ea.near;S.far=ea.far;V.far=ea.far;S.matrixWorldInverse.fromArray(r.leftViewMatrix);V.matrixWorldInverse.fromArray(r.rightViewMatrix);C.getInverse(B);"stage"===I&&(S.matrixWorldInverse.multiply(C),V.matrixWorldInverse.multiply(C));ea=la.parent;null!==ea&&(K.getInverse(ea.matrixWorld),S.matrixWorldInverse.multiply(K), V.matrixWorldInverse.multiply(K));S.matrixWorld.getInverse(S.matrixWorldInverse);V.matrixWorld.getInverse(V.matrixWorldInverse);S.projectionMatrix.fromArray(r.leftProjectionMatrix);V.projectionMatrix.fromArray(r.rightProjectionMatrix);Tk(ca,S,V);ea=k.getLayers();ea.length&&(ea=ea[0],null!==ea.leftBounds&&4===ea.leftBounds.length&&S.bounds.fromArray(ea.leftBounds),null!==ea.rightBounds&&4===ea.rightBounds.length&&V.bounds.fromArray(ea.rightBounds));for(ea=0;ea<A.length;ea++){na=A[ea];a:{la=ea;for(var ua= navigator.getGamepads&&navigator.getGamepads(),Da=0,wa=0,Ca=ua.length;Da<Ca;Da++){var Ea=ua[Da];if(Ea&&("Daydream Controller"===Ea.id||"Gear VR Controller"===Ea.id||"Oculus Go Controller"===Ea.id||"OpenVR Gamepad"===Ea.id||Ea.id.startsWith("Oculus Touch")||Ea.id.startsWith("Spatial Controller"))){if(wa===la){la=Ea;break a}wa++}}la=void 0}if(void 0!==la&&void 0!==la.pose){if(null===la.pose)break;ua=la.pose;!1===ua.hasPosition&&na.position.set(.2,-.6,-.05);null!==ua.position&&na.position.fromArray(ua.position); null!==ua.orientation&&na.quaternion.fromArray(ua.orientation);na.matrix.compose(na.position,na.quaternion,na.scale);na.matrix.premultiply(B);na.matrix.decompose(na.position,na.quaternion,na.scale);na.matrixWorldNeedsUpdate=!0;na.visible=!0;ua="Daydream Controller"===la.id?0:1;ka[ea]!==la.buttons[ua].pressed&&(ka[ea]=la.buttons[ua].pressed,!0===ka[ea]?na.dispatchEvent({type:"selectstart"}):(na.dispatchEvent({type:"selectend"}),na.dispatchEvent({type:"select"})))}else na.visible=!1}return ca};this.getStandingMatrix= function(){return B};this.isPresenting=c;var da=new L;this.setAnimationLoop=function(ea){da.setAnimationLoop(ea);c()&&da.start()};this.submitFrame=function(){c()&&k.submitFrame()};this.dispose=function(){"undefined"!==typeof window&&window.removeEventListener("vrdisplaypresentchange",e)}}function Ro(a){function c(){return null!==A&&null!==C}function e(ba){var ka=K[P.indexOf(ba.inputSource)];ka&&ka.dispatchEvent({type:ba.type})}function g(){a.setFramebuffer(null);a.setRenderTarget(a.getRenderTarget()); ha.stop()}function k(ba,ka){null===ka?ba.matrixWorld.copy(ba.matrix):ba.matrixWorld.multiplyMatrices(ka.matrixWorld,ba.matrix);ba.matrixWorldInverse.getInverse(ba.matrixWorld)}var r=a.context,u=null,A=null,B=1,C=null,H="stage",I=null,K=[],P=[],O=new Lb;O.layers.enable(1);O.viewport=new p;var S=new Lb;S.layers.enable(2);S.viewport=new p;var V=new Qf([O,S]);V.layers.enable(1);V.layers.enable(2);this.enabled=!1;this.getController=function(ba){var ka=K[ba];void 0===ka&&(ka=new Le,ka.matrixAutoUpdate= !1,ka.visible=!1,K[ba]=ka);return ka};this.getDevice=function(){return u};this.setDevice=function(ba){void 0!==ba&&(u=ba);ba instanceof XRDevice&&r.setCompatibleXRDevice(ba)};this.setFramebufferScaleFactor=function(ba){B=ba};this.setFrameOfReferenceType=function(ba){H=ba};this.setSession=function(ba){A=ba;null!==A&&(A.addEventListener("select",e),A.addEventListener("selectstart",e),A.addEventListener("selectend",e),A.addEventListener("end",g),A.baseLayer=new XRWebGLLayer(A,r,{framebufferScaleFactor:B}), A.requestFrameOfReference(H).then(function(ka){C=ka;a.setFramebuffer(A.baseLayer.framebuffer);ha.setContext(A);ha.start()}),P=A.getInputSources(),A.addEventListener("inputsourceschange",function(){P=A.getInputSources();console.log(P);for(var ka=0;ka<K.length;ka++)K[ka].userData.inputSource=P[ka]}))};this.getCamera=function(ba){if(c()){var ka=ba.parent,da=V.cameras;k(V,ka);for(var ea=0;ea<da.length;ea++)k(da[ea],ka);ba.matrixWorld.copy(V.matrixWorld);ba=ba.children;ea=0;for(ka=ba.length;ea<ka;ea++)ba[ea].updateMatrixWorld(!0); Tk(V,O,S);return V}return ba};this.isPresenting=c;var ca=null,ha=new L;ha.setAnimationLoop(function(ba,ka){I=ka.getDevicePose(C);if(null!==I)for(var da=A.baseLayer,ea=ka.views,na=0;na<ea.length;na++){var la=ea[na],ua=da.getViewport(la),Da=I.getViewMatrix(la),wa=V.cameras[na];wa.matrix.fromArray(Da).getInverse(wa.matrix);wa.projectionMatrix.fromArray(la.projectionMatrix);wa.viewport.set(ua.x,ua.y,ua.width,ua.height);0===na&&V.matrix.copy(wa.matrix)}for(na=0;na<K.length;na++){da=K[na];if(ea=P[na])if(ea= ka.getInputPose(ea,C),null!==ea){"targetRay"in ea?da.matrix.elements=ea.targetRay.transformMatrix:"pointerMatrix"in ea&&(da.matrix.elements=ea.pointerMatrix);da.matrix.decompose(da.position,da.rotation,da.scale);da.visible=!0;continue}da.visible=!1}ca&&ca(ba)});this.setAnimationLoop=function(ba){ca=ba};this.dispose=function(){};this.getStandingMatrix=function(){console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed.");return new G};this.submitFrame=function(){}}function fi(a){var c; function e(){Ma=new Rn(ya);Za=new Pn(ya,Ma,a);Za.isWebGL2||(Ma.get("WEBGL_depth_texture"),Ma.get("OES_texture_float"),Ma.get("OES_texture_half_float"),Ma.get("OES_texture_half_float_linear"),Ma.get("OES_standard_derivatives"),Ma.get("OES_element_index_uint"),Ma.get("ANGLE_instanced_arrays"));Ma.get("OES_texture_float_linear");Zc=new Sk(ya,Ma,Za);Ta=new Po(ya,Ma,Zc,Za);Ta.scissor(lb.copy(ia).multiplyScalar(ob));Ta.viewport(kb.copy(Ga).multiplyScalar(ob));nb=new Un(ya);wb=new Ho;ec=new Qo(ya,Ma,Ta, wb,Za,Zc,nb);td=new N(ya);gi=new Sn(ya,td,nb);Me=new Xn(gi,nb);Xk=new Wn(ya);$d=new Go(wa,Ma,Za,ec);Wg=new Ko;Ne=new Oo;Md=new Nn(wa,Ta,Me,ea);Yk=new On(ya,Ma,nb,Za);Zk=new Tn(ya,Ma,nb,Za);nb.programs=$d.programs;wa.context=ya;wa.capabilities=Za;wa.extensions=Ma;wa.properties=wb;wa.renderLists=Wg;wa.state=Ta;wa.info=nb}function g(U){U.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");Ca=!0}function k(){console.log("THREE.WebGLRenderer: Context Restored.");Ca=!1;e()}function r(U){U= U.target;U.removeEventListener("dispose",r);u(U);wb.remove(U)}function u(U){var fa=wb.get(U).program;U.program=void 0;void 0!==fa&&$d.releaseProgram(fa)}function A(U,fa){U.render(function(X){wa.renderBufferImmediate(X,fa)})}function B(U,fa,X,Fa){if(!1!==U.visible){if(U.layers.test(fa.layers))if(U.isGroup)X=U.renderOrder;else if(U.isLight)Da.pushLight(U),U.castShadow&&Da.pushShadow(U);else if(U.isSprite){if(!U.frustumCulled||eb.intersectsSprite(U)){Fa&&Va.setFromMatrixPosition(U.matrixWorld).applyMatrix4(Sa); var Ka=Me.update(U),Na=U.material;Na.visible&&ua.push(U,Ka,Na,X,Va.z,null)}}else if(U.isImmediateRenderObject)Fa&&Va.setFromMatrixPosition(U.matrixWorld).applyMatrix4(Sa),ua.push(U,null,U.material,X,Va.z,null);else if(U.isMesh||U.isLine||U.isPoints)if(U.isSkinnedMesh&&U.skeleton.update(),!U.frustumCulled||eb.intersectsObject(U))if(Fa&&Va.setFromMatrixPosition(U.matrixWorld).applyMatrix4(Sa),Ka=Me.update(U),Na=U.material,Array.isArray(Na))for(var Ja=Ka.groups,Ua=0,ib=Ja.length;Ua<ib;Ua++){var Kb=Ja[Ua], sa=Na[Kb.materialIndex];sa&&sa.visible&&ua.push(U,Ka,sa,X,Va.z,Kb)}else Na.visible&&ua.push(U,Ka,Na,X,Va.z,null);U=U.children;Ua=0;for(ib=U.length;Ua<ib;Ua++)B(U[Ua],fa,X,Fa)}}function C(U,fa,X,Fa){for(var Ka=0,Na=U.length;Ka<Na;Ka++){var Ja=U[Ka],Ua=Ja.object,ib=Ja.geometry,Kb=void 0===Fa?Ja.material:Fa;Ja=Ja.group;if(X.isArrayCamera){Ia=X;for(var sa=X.cameras,$c=0,kc=sa.length;$c<kc;$c++){var Pb=sa[$c];if(Ua.layers.test(Pb.layers)){if("viewport"in Pb)Ta.viewport(kb.copy(Pb.viewport));else{var uc= Pb.bounds;Ta.viewport(kb.set(uc.x*db,uc.y*hb,uc.z*db,uc.w*hb).multiplyScalar(ob))}Da.setupLights(Pb);H(Ua,fa,Pb,ib,Kb,Ja)}}}else Ia=null,H(Ua,fa,X,ib,Kb,Ja)}}function H(U,fa,X,Fa,Ka,Na){U.onBeforeRender(wa,fa,X,Fa,Ka,Na);Da=Ne.get(fa,Ia||X);U.modelViewMatrix.multiplyMatrices(X.matrixWorldInverse,U.matrixWorld);U.normalMatrix.getNormalMatrix(U.modelViewMatrix);U.isImmediateRenderObject?(Ta.setMaterial(Ka),Fa=K(X,fa.fog,Ka,U),ja=c=null,ra=!1,A(U,Fa)):wa.renderBufferDirect(X,fa.fog,Fa,Ka,U,Na);Da=Ne.get(fa, Ia||X)}function I(U,fa,X){var Fa=wb.get(U),Ka=Da.state.lights,Na=Fa.lightsHash,Ja=Ka.state.hash;X=$d.getParameters(U,Ka.state,Da.state.shadowsArray,fa,jb.numPlanes,jb.numIntersection,X);var Ua=$d.getProgramCode(U,X),ib=Fa.program,Kb=!0;if(void 0===ib)U.addEventListener("dispose",r);else if(ib.code!==Ua)u(U);else{if(Na.stateID!==Ja.stateID||Na.directionalLength!==Ja.directionalLength||Na.pointLength!==Ja.pointLength||Na.spotLength!==Ja.spotLength||Na.rectAreaLength!==Ja.rectAreaLength||Na.hemiLength!== Ja.hemiLength||Na.shadowsLength!==Ja.shadowsLength)Na.stateID=Ja.stateID,Na.directionalLength=Ja.directionalLength,Na.pointLength=Ja.pointLength,Na.spotLength=Ja.spotLength,Na.rectAreaLength=Ja.rectAreaLength,Na.hemiLength=Ja.hemiLength,Na.shadowsLength=Ja.shadowsLength;else if(void 0!==X.shaderID)return;Kb=!1}Kb&&(X.shaderID?(Ua=Xc[X.shaderID],Fa.shader={name:U.type,uniforms:J(Ua.uniforms),vertexShader:Ua.vertexShader,fragmentShader:Ua.fragmentShader}):Fa.shader={name:U.type,uniforms:U.uniforms, vertexShader:U.vertexShader,fragmentShader:U.fragmentShader},Ua=$d.getProgramCode(U,X),ib=$d.acquireProgram(U,Fa.shader,X,Ua),Fa.program=ib,U.program=ib);X=ib.getAttributes();if(U.morphTargets)for(Ua=U.numSupportedMorphTargets=0;Ua<wa.maxMorphTargets;Ua++)0<=X["morphTarget"+Ua]&&U.numSupportedMorphTargets++;if(U.morphNormals)for(Ua=U.numSupportedMorphNormals=0;Ua<wa.maxMorphNormals;Ua++)0<=X["morphNormal"+Ua]&&U.numSupportedMorphNormals++;X=Fa.shader.uniforms;if(!U.isShaderMaterial&&!U.isRawShaderMaterial|| !0===U.clipping)Fa.numClippingPlanes=jb.numPlanes,Fa.numIntersection=jb.numIntersection,X.clippingPlanes=jb.uniform;Fa.fog=fa;void 0===Na&&(Fa.lightsHash=Na={});Na.stateID=Ja.stateID;Na.directionalLength=Ja.directionalLength;Na.pointLength=Ja.pointLength;Na.spotLength=Ja.spotLength;Na.rectAreaLength=Ja.rectAreaLength;Na.hemiLength=Ja.hemiLength;Na.shadowsLength=Ja.shadowsLength;U.lights&&(X.ambientLightColor.value=Ka.state.ambient,X.lightProbe.value=Ka.state.probe,X.directionalLights.value=Ka.state.directional, X.spotLights.value=Ka.state.spot,X.rectAreaLights.value=Ka.state.rectArea,X.pointLights.value=Ka.state.point,X.hemisphereLights.value=Ka.state.hemi,X.directionalShadowMap.value=Ka.state.directionalShadowMap,X.directionalShadowMatrix.value=Ka.state.directionalShadowMatrix,X.spotShadowMap.value=Ka.state.spotShadowMap,X.spotShadowMatrix.value=Ka.state.spotShadowMatrix,X.pointShadowMap.value=Ka.state.pointShadowMap,X.pointShadowMatrix.value=Ka.state.pointShadowMatrix);U=Fa.program.getUniforms();U=Jd.seqWithValue(U.seq, X);Fa.uniformsList=U}function K(U,fa,X,Fa){ec.resetTextureUnits();var Ka=wb.get(X),Na=Ka.lightsHash,Ja=Da.state.lights.state.hash;Xa&&(gb||U!==Aa)&&jb.setState(X.clippingPlanes,X.clipIntersection,X.clipShadows,U,Ka,U===Aa&&X.id===aa);!1===X.needsUpdate&&(void 0===Ka.program?X.needsUpdate=!0:X.fog&&Ka.fog!==fa?X.needsUpdate=!0:!X.lights||Na.stateID===Ja.stateID&&Na.directionalLength===Ja.directionalLength&&Na.pointLength===Ja.pointLength&&Na.spotLength===Ja.spotLength&&Na.rectAreaLength===Ja.rectAreaLength&& Na.hemiLength===Ja.hemiLength&&Na.shadowsLength===Ja.shadowsLength?void 0===Ka.numClippingPlanes||Ka.numClippingPlanes===jb.numPlanes&&Ka.numIntersection===jb.numIntersection||(X.needsUpdate=!0):X.needsUpdate=!0);X.needsUpdate&&(I(X,fa,Fa),X.needsUpdate=!1);var Ua=!1,ib=!1,Kb=!1;Na=Ka.program;Ja=Na.getUniforms();var sa=Ka.shader.uniforms;Ta.useProgram(Na.program)&&(Kb=ib=Ua=!0);X.id!==aa&&(aa=X.id,ib=!0);if(Ua||Aa!==U){Ja.setValue(ya,"projectionMatrix",U.projectionMatrix);Za.logarithmicDepthBuffer&& Ja.setValue(ya,"logDepthBufFC",2/(Math.log(U.far+1)/Math.LN2));Aa!==U&&(Aa=U,Kb=ib=!0);if(X.isShaderMaterial||X.isMeshPhongMaterial||X.isMeshStandardMaterial||X.envMap)Ua=Ja.map.cameraPosition,void 0!==Ua&&Ua.setValue(ya,Va.setFromMatrixPosition(U.matrixWorld));(X.isMeshPhongMaterial||X.isMeshLambertMaterial||X.isMeshBasicMaterial||X.isMeshStandardMaterial||X.isShaderMaterial||X.skinning)&&Ja.setValue(ya,"viewMatrix",U.matrixWorldInverse)}if(X.skinning&&(Ja.setOptional(ya,Fa,"bindMatrix"),Ja.setOptional(ya, Fa,"bindMatrixInverse"),U=Fa.skeleton))if(Ua=U.bones,Za.floatVertexTextures){if(void 0===U.boneTexture){Ua=Math.sqrt(4*Ua.length);Ua=ab.ceilPowerOfTwo(Ua);Ua=Math.max(Ua,4);var $c=new Float32Array(Ua*Ua*4);$c.set(U.boneMatrices);var kc=new v($c,Ua,Ua,1023,1015);kc.needsUpdate=!0;U.boneMatrices=$c;U.boneTexture=kc;U.boneTextureSize=Ua}Ja.setValue(ya,"boneTexture",U.boneTexture,ec);Ja.setValue(ya,"boneTextureSize",U.boneTextureSize)}else Ja.setOptional(ya,U,"boneMatrices");ib&&(Ja.setValue(ya,"toneMappingExposure", wa.toneMappingExposure),Ja.setValue(ya,"toneMappingWhitePoint",wa.toneMappingWhitePoint),X.lights&&(ib=Kb,sa.ambientLightColor.needsUpdate=ib,sa.lightProbe.needsUpdate=ib,sa.directionalLights.needsUpdate=ib,sa.pointLights.needsUpdate=ib,sa.spotLights.needsUpdate=ib,sa.rectAreaLights.needsUpdate=ib,sa.hemisphereLights.needsUpdate=ib),fa&&X.fog&&(sa.fogColor.value.copy(fa.color),fa.isFog?(sa.fogNear.value=fa.near,sa.fogFar.value=fa.far):fa.isFogExp2&&(sa.fogDensity.value=fa.density)),X.isMeshBasicMaterial? P(sa,X):X.isMeshLambertMaterial?(P(sa,X),X.emissiveMap&&(sa.emissiveMap.value=X.emissiveMap)):X.isMeshPhongMaterial?(P(sa,X),X.isMeshToonMaterial?(O(sa,X),X.gradientMap&&(sa.gradientMap.value=X.gradientMap)):O(sa,X)):X.isMeshStandardMaterial?(P(sa,X),X.isMeshPhysicalMaterial?(S(sa,X),sa.reflectivity.value=X.reflectivity,sa.clearCoat.value=X.clearCoat,sa.clearCoatRoughness.value=X.clearCoatRoughness):S(sa,X)):X.isMeshMatcapMaterial?(P(sa,X),X.matcap&&(sa.matcap.value=X.matcap),X.bumpMap&&(sa.bumpMap.value= X.bumpMap,sa.bumpScale.value=X.bumpScale,1===X.side&&(sa.bumpScale.value*=-1)),X.normalMap&&(sa.normalMap.value=X.normalMap,sa.normalScale.value.copy(X.normalScale),1===X.side&&sa.normalScale.value.negate()),X.displacementMap&&(sa.displacementMap.value=X.displacementMap,sa.displacementScale.value=X.displacementScale,sa.displacementBias.value=X.displacementBias)):X.isMeshDepthMaterial?(P(sa,X),X.displacementMap&&(sa.displacementMap.value=X.displacementMap,sa.displacementScale.value=X.displacementScale, sa.displacementBias.value=X.displacementBias)):X.isMeshDistanceMaterial?(P(sa,X),X.displacementMap&&(sa.displacementMap.value=X.displacementMap,sa.displacementScale.value=X.displacementScale,sa.displacementBias.value=X.displacementBias),sa.referencePosition.value.copy(X.referencePosition),sa.nearDistance.value=X.nearDistance,sa.farDistance.value=X.farDistance):X.isMeshNormalMaterial?(P(sa,X),X.bumpMap&&(sa.bumpMap.value=X.bumpMap,sa.bumpScale.value=X.bumpScale,1===X.side&&(sa.bumpScale.value*=-1)), X.normalMap&&(sa.normalMap.value=X.normalMap,sa.normalScale.value.copy(X.normalScale),1===X.side&&sa.normalScale.value.negate()),X.displacementMap&&(sa.displacementMap.value=X.displacementMap,sa.displacementScale.value=X.displacementScale,sa.displacementBias.value=X.displacementBias)):X.isLineBasicMaterial?(sa.diffuse.value.copy(X.color),sa.opacity.value=X.opacity,X.isLineDashedMaterial&&(sa.dashSize.value=X.dashSize,sa.totalSize.value=X.dashSize+X.gapSize,sa.scale.value=X.scale)):X.isPointsMaterial? (sa.diffuse.value.copy(X.color),sa.opacity.value=X.opacity,sa.size.value=X.size*ob,sa.scale.value=.5*hb,sa.map.value=X.map,null!==X.map&&(!0===X.map.matrixAutoUpdate&&X.map.updateMatrix(),sa.uvTransform.value.copy(X.map.matrix))):X.isSpriteMaterial?(sa.diffuse.value.copy(X.color),sa.opacity.value=X.opacity,sa.rotation.value=X.rotation,sa.map.value=X.map,null!==X.map&&(!0===X.map.matrixAutoUpdate&&X.map.updateMatrix(),sa.uvTransform.value.copy(X.map.matrix))):X.isShadowMaterial&&(sa.color.value.copy(X.color), sa.opacity.value=X.opacity),void 0!==sa.ltc_1&&(sa.ltc_1.value=Ra.LTC_1),void 0!==sa.ltc_2&&(sa.ltc_2.value=Ra.LTC_2),Jd.upload(ya,Ka.uniformsList,sa,ec));X.isShaderMaterial&&!0===X.uniformsNeedUpdate&&(Jd.upload(ya,Ka.uniformsList,sa,ec),X.uniformsNeedUpdate=!1);X.isSpriteMaterial&&Ja.setValue(ya,"center",Fa.center);Ja.setValue(ya,"modelViewMatrix",Fa.modelViewMatrix);Ja.setValue(ya,"normalMatrix",Fa.normalMatrix);Ja.setValue(ya,"modelMatrix",Fa.matrixWorld);return Na}function P(U,fa){U.opacity.value= fa.opacity;fa.color&&U.diffuse.value.copy(fa.color);fa.emissive&&U.emissive.value.copy(fa.emissive).multiplyScalar(fa.emissiveIntensity);fa.map&&(U.map.value=fa.map);fa.alphaMap&&(U.alphaMap.value=fa.alphaMap);fa.specularMap&&(U.specularMap.value=fa.specularMap);fa.envMap&&(U.envMap.value=fa.envMap,U.flipEnvMap.value=fa.envMap.isCubeTexture?-1:1,U.reflectivity.value=fa.reflectivity,U.refractionRatio.value=fa.refractionRatio,U.maxMipLevel.value=wb.get(fa.envMap).__maxMipLevel);fa.lightMap&&(U.lightMap.value= fa.lightMap,U.lightMapIntensity.value=fa.lightMapIntensity);fa.aoMap&&(U.aoMap.value=fa.aoMap,U.aoMapIntensity.value=fa.aoMapIntensity);if(fa.map)var X=fa.map;else fa.specularMap?X=fa.specularMap:fa.displacementMap?X=fa.displacementMap:fa.normalMap?X=fa.normalMap:fa.bumpMap?X=fa.bumpMap:fa.roughnessMap?X=fa.roughnessMap:fa.metalnessMap?X=fa.metalnessMap:fa.alphaMap?X=fa.alphaMap:fa.emissiveMap&&(X=fa.emissiveMap);void 0!==X&&(X.isWebGLRenderTarget&&(X=X.texture),!0===X.matrixAutoUpdate&&X.updateMatrix(), U.uvTransform.value.copy(X.matrix))}function O(U,fa){U.specular.value.copy(fa.specular);U.shininess.value=Math.max(fa.shininess,1E-4);fa.emissiveMap&&(U.emissiveMap.value=fa.emissiveMap);fa.bumpMap&&(U.bumpMap.value=fa.bumpMap,U.bumpScale.value=fa.bumpScale,1===fa.side&&(U.bumpScale.value*=-1));fa.normalMap&&(U.normalMap.value=fa.normalMap,U.normalScale.value.copy(fa.normalScale),1===fa.side&&U.normalScale.value.negate());fa.displacementMap&&(U.displacementMap.value=fa.displacementMap,U.displacementScale.value= fa.displacementScale,U.displacementBias.value=fa.displacementBias)}function S(U,fa){U.roughness.value=fa.roughness;U.metalness.value=fa.metalness;fa.roughnessMap&&(U.roughnessMap.value=fa.roughnessMap);fa.metalnessMap&&(U.metalnessMap.value=fa.metalnessMap);fa.emissiveMap&&(U.emissiveMap.value=fa.emissiveMap);fa.bumpMap&&(U.bumpMap.value=fa.bumpMap,U.bumpScale.value=fa.bumpScale,1===fa.side&&(U.bumpScale.value*=-1));fa.normalMap&&(U.normalMap.value=fa.normalMap,U.normalScale.value.copy(fa.normalScale), 1===fa.side&&U.normalScale.value.negate());fa.displacementMap&&(U.displacementMap.value=fa.displacementMap,U.displacementScale.value=fa.displacementScale,U.displacementBias.value=fa.displacementBias);fa.envMap&&(U.envMapIntensity.value=fa.envMapIntensity)}console.log("THREE.WebGLRenderer","104");a=a||{};var V=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),ca=void 0!==a.context?a.context:null,ha=void 0!==a.alpha?a.alpha:!1,ba=void 0!==a.depth?a.depth:!0, ka=void 0!==a.stencil?a.stencil:!0,da=void 0!==a.antialias?a.antialias:!1,ea=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,na=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,la=void 0!==a.powerPreference?a.powerPreference:"default",ua=null,Da=null;this.domElement=V;this.context=null;this.debug={checkShaderErrors:!1};this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor= 2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var wa=this,Ca=!1,Ea=null,Qa=null,W=null,aa=-1;var ja=c=null;var ra=!1;var Aa=null,Ia=null,kb=new p,lb=new p,Ya=null,db=V.width,hb=V.height,ob=1,Ga=new p(0,0,db,hb),ia=new p(0,0,db,hb),Oa=!1,eb=new D,jb=new Qn,Xa=!1,gb=!1,Sa=new G,Va=new m;try{ha={alpha:ha,depth:ba,stencil:ka,antialias:da,premultipliedAlpha:ea,preserveDrawingBuffer:na, powerPreference:la};V.addEventListener("webglcontextlost",g,!1);V.addEventListener("webglcontextrestored",k,!1);var ya=ca||V.getContext("webgl",ha)||V.getContext("experimental-webgl",ha);if(null===ya){if(null!==V.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===ya.getShaderPrecisionFormat&&(ya.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(U){throw console.error("THREE.WebGLRenderer: "+ U.message),U;}var Ma,Za,Ta,nb,wb,ec,td,gi,Me,$d,Wg,Ne,Md,Xk,Yk,Zk,Zc;e();var ud="undefined"!==typeof navigator&&"xr"in navigator?new Ro(wa):new Wk(wa);this.vr=ud;var $k=new Rk(wa,Me,Za.maxTextureSize);this.shadowMap=$k;this.getContext=function(){return ya};this.getContextAttributes=function(){return ya.getContextAttributes()};this.forceContextLoss=function(){var U=Ma.get("WEBGL_lose_context");U&&U.loseContext()};this.forceContextRestore=function(){var U=Ma.get("WEBGL_lose_context");U&&U.restoreContext()}; this.getPixelRatio=function(){return ob};this.setPixelRatio=function(){var U=window.devicePixelRatio;void 0!==U&&(ob=U,this.setSize(db,hb,!1))};this.getSize=function(U){void 0===U&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),U=new f);return U.set(db,hb)};this.setSize=function(U,fa,X){ud.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(db=U,hb=fa,V.width=U*ob,V.height=fa*ob,!1!==X&&(V.style.width=U+"px",V.style.height= fa+"px"),this.setViewport(U,fa))};this.getDrawingBufferSize=function(U){void 0===U&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),U=new f);return U.set(db*ob,hb*ob)};this.setDrawingBufferSize=function(U,fa,X){db=U;hb=fa;ob=X;V.width=U*X;V.height=fa*X;this.setViewport(U,fa)};this.getCurrentViewport=function(U){void 0===U&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),U=new p);return U.copy(kb)};this.getViewport= function(U){return U.copy(Ga)};this.setViewport=function(U,fa){(0).isVector4?Ga.set((0).x,(0).y,(0).z,(0).w):Ga.set(0,0,U,fa);Ta.viewport(kb.copy(Ga).multiplyScalar(ob))};this.getScissor=function(U){return U.copy(ia)};this.setScissor=function(U,fa,X,Fa){U.isVector4?ia.set(U.x,U.y,U.z,U.w):ia.set(U,fa,X,Fa);Ta.scissor(lb.copy(ia).multiplyScalar(ob))};this.getScissorTest=function(){return Oa};this.setScissorTest=function(U){Ta.setScissorTest(Oa=U)};this.getClearColor=function(){return Md.getClearColor()}; this.setClearColor=function(){Md.setClearColor.apply(Md,arguments)};this.getClearAlpha=function(){return Md.getClearAlpha()};this.setClearAlpha=function(){Md.setClearAlpha.apply(Md,arguments)};this.clear=function(U,fa,X){var Fa=0;if(void 0===U||U)Fa|=16384;if(void 0===fa||fa)Fa|=256;if(void 0===X||X)Fa|=1024;ya.clear(Fa)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.dispose=function(){V.removeEventListener("webglcontextlost", g,!1);V.removeEventListener("webglcontextrestored",k,!1);Wg.dispose();Ne.dispose();wb.dispose();Me.dispose();ud.dispose();Xg.stop()};this.renderBufferImmediate=function(U,fa){Ta.initAttributes();var X=wb.get(U);U.hasPositions&&!X.position&&(X.position=ya.createBuffer());U.hasNormals&&!X.normal&&(X.normal=ya.createBuffer());U.hasUvs&&!X.uv&&(X.uv=ya.createBuffer());U.hasColors&&!X.color&&(X.color=ya.createBuffer());fa=fa.getAttributes();U.hasPositions&&(ya.bindBuffer(34962,X.position),ya.bufferData(34962, U.positionArray,35048),Ta.enableAttribute(fa.position),ya.vertexAttribPointer(fa.position,3,5126,!1,0,0));U.hasNormals&&(ya.bindBuffer(34962,X.normal),ya.bufferData(34962,U.normalArray,35048),Ta.enableAttribute(fa.normal),ya.vertexAttribPointer(fa.normal,3,5126,!1,0,0));U.hasUvs&&(ya.bindBuffer(34962,X.uv),ya.bufferData(34962,U.uvArray,35048),Ta.enableAttribute(fa.uv),ya.vertexAttribPointer(fa.uv,2,5126,!1,0,0));U.hasColors&&(ya.bindBuffer(34962,X.color),ya.bufferData(34962,U.colorArray,35048),Ta.enableAttribute(fa.color), ya.vertexAttribPointer(fa.color,3,5126,!1,0,0));Ta.disableUnusedAttributes();ya.drawArrays(4,0,U.count);U.count=0};this.renderBufferDirect=function(U,fa,X,Fa,Ka,Na){Ta.setMaterial(Fa,Ka.isMesh&&0>Ka.matrixWorld.determinant());var Ja=K(U,fa,Fa,Ka),Ua=!1;if(c!==X.id||ja!==Ja.id||ra!==(!0===Fa.wireframe))c=X.id,ja=Ja.id,ra=!0===Fa.wireframe,Ua=!0;Ka.morphTargetInfluences&&(Xk.update(Ka,X,Fa,Ja),Ua=!0);var ib=X.index,Kb=X.attributes.position;fa=1;!0===Fa.wireframe&&(ib=gi.getWireframeAttribute(X),fa= 2);U=Yk;if(null!==ib){var sa=td.get(ib);U=Zk;U.setIndex(sa)}if(Ua){if(X&&X.isInstancedBufferGeometry&&!Za.isWebGL2&&null===Ma.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{Ta.initAttributes();Ua=X.attributes;Ja=Ja.getAttributes();var $c=Fa.defaultAttributeValues;for(ae in Ja){var kc=Ja[ae];if(0<=kc){var Pb=Ua[ae];if(void 0!==Pb){var uc=Pb.normalized, al=Pb.itemSize,be=td.get(Pb);if(void 0!==be){var bl=be.buffer,cl=be.type;be=be.bytesPerElement;if(Pb.isInterleavedBufferAttribute){var Oe=Pb.data,So=Oe.stride;Pb=Pb.offset;Oe&&Oe.isInstancedInterleavedBuffer?(Ta.enableAttributeAndDivisor(kc,Oe.meshPerAttribute),void 0===X.maxInstancedCount&&(X.maxInstancedCount=Oe.meshPerAttribute*Oe.count)):Ta.enableAttribute(kc);ya.bindBuffer(34962,bl);ya.vertexAttribPointer(kc,al,cl,uc,So*be,Pb*be)}else Pb.isInstancedBufferAttribute?(Ta.enableAttributeAndDivisor(kc, Pb.meshPerAttribute),void 0===X.maxInstancedCount&&(X.maxInstancedCount=Pb.meshPerAttribute*Pb.count)):Ta.enableAttribute(kc),ya.bindBuffer(34962,bl),ya.vertexAttribPointer(kc,al,cl,uc,0,0)}}else if(void 0!==$c&&(uc=$c[ae],void 0!==uc))switch(uc.length){case 2:ya.vertexAttrib2fv(kc,uc);break;case 3:ya.vertexAttrib3fv(kc,uc);break;case 4:ya.vertexAttrib4fv(kc,uc);break;default:ya.vertexAttrib1fv(kc,uc)}}}Ta.disableUnusedAttributes()}null!==ib&&ya.bindBuffer(34963,sa.buffer)}sa=Infinity;null!==ib?sa= ib.count:void 0!==Kb&&(sa=Kb.count);ib=X.drawRange.start*fa;Kb=null!==Na?Na.start*fa:0;var ae=Math.max(ib,Kb);Na=Math.max(0,Math.min(sa,ib+X.drawRange.count*fa,Kb+(null!==Na?Na.count*fa:Infinity))-1-ae+1);if(0!==Na){if(Ka.isMesh)if(!0===Fa.wireframe)Ta.setLineWidth(Fa.wireframeLinewidth*(null===Qa?ob:1)),U.setMode(1);else switch(Ka.drawMode){case 0:U.setMode(4);break;case 1:U.setMode(5);break;case 2:U.setMode(6)}else Ka.isLine?(Fa=Fa.linewidth,void 0===Fa&&(Fa=1),Ta.setLineWidth(Fa*(null===Qa?ob: 1)),Ka.isLineSegments?U.setMode(1):Ka.isLineLoop?U.setMode(2):U.setMode(3)):Ka.isPoints?U.setMode(0):Ka.isSprite&&U.setMode(4);X&&X.isInstancedBufferGeometry?0<X.maxInstancedCount&&U.renderInstances(X,ae,Na):U.render(ae,Na)}};this.compile=function(U,fa){Da=Ne.get(U,fa);Da.init();U.traverse(function(X){X.isLight&&(Da.pushLight(X),X.castShadow&&Da.pushShadow(X))});Da.setupLights(fa);U.traverse(function(X){if(X.material)if(Array.isArray(X.material))for(var Fa=0;Fa<X.material.length;Fa++)I(X.material[Fa], U.fog,X);else I(X.material,U.fog,X)})};var hi=null,Xg=new L;Xg.setAnimationLoop(function(U){ud.isPresenting()||hi&&hi(U)});"undefined"!==typeof window&&Xg.setContext(window);this.setAnimationLoop=function(U){hi=U;ud.setAnimationLoop(U);Xg.start()};this.render=function(U,fa,X,Fa){if(void 0!==X){console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.");var Ka=X}if(void 0!==Fa){console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."); var Na=Fa}fa&&fa.isCamera?Ca||(ja=c=null,ra=!1,aa=-1,Aa=null,!0===U.autoUpdate&&U.updateMatrixWorld(),null===fa.parent&&fa.updateMatrixWorld(),ud.enabled&&(fa=ud.getCamera(fa)),Da=Ne.get(U,fa),Da.init(),U.onBeforeRender(wa,U,fa,Ka||Qa),Sa.multiplyMatrices(fa.projectionMatrix,fa.matrixWorldInverse),eb.setFromMatrix(Sa),gb=this.localClippingEnabled,Xa=jb.init(this.clippingPlanes,gb,fa),ua=Wg.get(U,fa),ua.init(),B(U,fa,0,wa.sortObjects),!0===wa.sortObjects&&ua.sort(),Xa&&jb.beginShadows(),$k.render(Da.state.shadowsArray, U,fa),Da.setupLights(fa),Xa&&jb.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==Ka&&this.setRenderTarget(Ka),Md.render(ua,U,fa,Na),X=ua.opaque,Fa=ua.transparent,U.overrideMaterial?(Ka=U.overrideMaterial,X.length&&C(X,U,fa,Ka),Fa.length&&C(Fa,U,fa,Ka)):(X.length&&C(X,U,fa),Fa.length&&C(Fa,U,fa)),null!==Qa&&(ec.updateRenderTargetMipmap(Qa),ec.updateMultisampleRenderTarget(Qa)),Ta.buffers.depth.setTest(!0),Ta.buffers.depth.setMask(!0),Ta.buffers.color.setMask(!0),Ta.setPolygonOffset(!1), ud.enabled&&ud.submitFrame(),Da=ua=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")};this.setFramebuffer=function(U){Ea=U};this.getRenderTarget=function(){return Qa};this.setRenderTarget=function(U,fa){(Qa=U)&&void 0===wb.get(U).__webglFramebuffer&&ec.setupRenderTarget(U);var X=Ea,Fa=!1;U?(X=wb.get(U).__webglFramebuffer,U.isWebGLRenderTargetCube?(X=X[fa||0],Fa=!0):X=U.isWebGLMultisampleRenderTarget?wb.get(U).__webglMultisampledFramebuffer:X,kb.copy(U.viewport), lb.copy(U.scissor),Ya=U.scissorTest):(kb.copy(Ga).multiplyScalar(ob),lb.copy(ia).multiplyScalar(ob),Ya=Oa);W!==X&&(ya.bindFramebuffer(36160,X),W=X);Ta.viewport(kb);Ta.scissor(lb);Ta.setScissorTest(Ya);Fa&&(U=wb.get(U.texture),ya.framebufferTexture2D(36160,36064,34069+(fa||0),U.__webglTexture,0))};this.readRenderTargetPixels=function(U,fa,X,Fa,Ka,Na){if(U&&U.isWebGLRenderTarget){var Ja=wb.get(U).__webglFramebuffer;if(Ja){var Ua=!1;Ja!==W&&(ya.bindFramebuffer(36160,Ja),Ua=!0);try{var ib=U.texture,Kb= ib.format,sa=ib.type;1023!==Kb&&Zc.convert(Kb)!==ya.getParameter(35739)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===sa||Zc.convert(sa)===ya.getParameter(35738)||1015===sa&&(Za.isWebGL2||Ma.get("OES_texture_float")||Ma.get("WEBGL_color_buffer_float"))||1016===sa&&(Za.isWebGL2?Ma.get("EXT_color_buffer_float"):Ma.get("EXT_color_buffer_half_float"))?36053===ya.checkFramebufferStatus(36160)?0<=fa&&fa<=U.width-Fa&&0<= X&&X<=U.height-Ka&&ya.readPixels(fa,X,Fa,Ka,Zc.convert(Kb),Zc.convert(sa),Na):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{Ua&&ya.bindFramebuffer(36160,W)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")};this.copyFramebufferToTexture= function(U,fa,X){var Fa=fa.image.width,Ka=fa.image.height,Na=Zc.convert(fa.format);ec.setTexture2D(fa,0);ya.copyTexImage2D(3553,X||0,Na,U.x,U.y,Fa,Ka,0)};this.copyTextureToTexture=function(U,fa,X,Fa){var Ka=fa.image.width,Na=fa.image.height,Ja=Zc.convert(X.format),Ua=Zc.convert(X.type);ec.setTexture2D(X,0);fa.isDataTexture?ya.texSubImage2D(3553,Fa||0,U.x,U.y,Ka,Na,Ja,Ua,fa.image.data):ya.texSubImage2D(3553,Fa||0,U.x,U.y,Ja,Ua,fa.image)}}function Yg(a,c){this.name="";this.color=new E(a);this.density= void 0!==c?c:2.5E-4}function Zg(a,c,e){this.name="";this.color=new E(a);this.near=void 0!==c?c:1;this.far=void 0!==e?e:1E3}function $g(){T.call(this);this.type="Scene";this.overrideMaterial=this.fog=this.background=null;this.autoUpdate=!0}function ce(a,c){this.array=a;this.stride=c;this.count=void 0!==a?a.length/c:0;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function Rf(a,c,e,g){this.data=a;this.itemSize=c;this.offset=e;this.normalized=!0===g}function Nd(a){bb.call(this); this.type="SpriteMaterial";this.color=new E(16777215);this.map=null;this.rotation=0;this.sizeAttenuation=!0;this.lights=!1;this.transparent=!0;this.setValues(a)}function Sf(a){T.call(this);this.type="Sprite";if(void 0===Pe){Pe=new za;var c=new ce(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Pe.setIndex([0,1,2,0,2,3]);Pe.addAttribute("position",new Rf(c,3,0,!1));Pe.addAttribute("uv",new Rf(c,2,3,!1))}this.geometry=Pe;this.material=void 0!==a?a:new Nd;this.center=new f(.5, .5)}function Tf(){T.call(this);this.type="LOD";Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Uf(a,c){a&&a.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");cc.call(this,a,c);this.type="SkinnedMesh";this.bindMode="attached";this.bindMatrix=new G;this.bindMatrixInverse=new G}function ah(a,c){a=a||[];this.bones=a.slice(0);this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===c)this.calculateInverses(); else if(this.bones.length===c.length)this.boneInverses=c.slice(0);else for(console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[],a=0,c=this.bones.length;a<c;a++)this.boneInverses.push(new G)}function ii(){T.call(this);this.type="Bone"}function ub(a){bb.call(this);this.type="LineBasicMaterial";this.color=new E(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.lights=!1;this.setValues(a)}function fc(a,c,e){1===e&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."); T.call(this);this.type="Line";this.geometry=void 0!==a?a:new za;this.material=void 0!==c?c:new ub({color:16777215*Math.random()})}function Ab(a,c){fc.call(this,a,c);this.type="LineSegments"}function bh(a,c){fc.call(this,a,c);this.type="LineLoop"}function Mc(a){bb.call(this);this.type="PointsMaterial";this.color=new E(16777215);this.map=null;this.size=1;this.sizeAttenuation=!0;this.lights=this.morphTargets=!1;this.setValues(a)}function Qe(a,c){T.call(this);this.type="Points";this.geometry=void 0!== a?a:new za;this.material=void 0!==c?c:new Mc({color:16777215*Math.random()})}function ji(a,c,e,g,k,r,u,A,B){l.call(this,a,c,e,g,k,r,u,A,B);this.format=void 0!==u?u:1022;this.minFilter=void 0!==r?r:1006;this.magFilter=void 0!==k?k:1006;this.generateMipmaps=!1}function Re(a,c,e,g,k,r,u,A,B,C,H,I){l.call(this,null,r,u,A,B,C,g,k,H,I);this.image={width:c,height:e};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Vf(a,c,e,g,k,r,u,A,B){l.call(this,a,c,e,g,k,r,u,A,B);this.needsUpdate=!0}function Wf(a, c,e,g,k,r,u,A,B,C){C=void 0!==C?C:1026;if(1026!==C&&1027!==C)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===e&&1026===C&&(e=1012);void 0===e&&1027===C&&(e=1020);l.call(this,null,g,k,r,u,A,C,e,B);this.image={width:a,height:c};this.magFilter=void 0!==u?u:1003;this.minFilter=void 0!==A?A:1003;this.generateMipmaps=this.flipY=!1}function Se(a){za.call(this);this.type="WireframeGeometry";var c=[],e,g,k,r=[0,0],u={},A=["a","b","c"];if(a&&a.isGeometry){var B= a.faces;var C=0;for(g=B.length;C<g;C++){var H=B[C];for(e=0;3>e;e++){var I=H[A[e]];var K=H[A[(e+1)%3]];r[0]=Math.min(I,K);r[1]=Math.max(I,K);I=r[0]+","+r[1];void 0===u[I]&&(u[I]={index1:r[0],index2:r[1]})}}for(I in u)C=u[I],A=a.vertices[C.index1],c.push(A.x,A.y,A.z),A=a.vertices[C.index2],c.push(A.x,A.y,A.z)}else if(a&&a.isBufferGeometry)if(A=new m,null!==a.index){B=a.attributes.position;H=a.index;var P=a.groups;0===P.length&&(P=[{start:0,count:H.count,materialIndex:0}]);a=0;for(k=P.length;a<k;++a)for(C= P[a],e=C.start,g=C.count,C=e,g=e+g;C<g;C+=3)for(e=0;3>e;e++)I=H.getX(C+e),K=H.getX(C+(e+1)%3),r[0]=Math.min(I,K),r[1]=Math.max(I,K),I=r[0]+","+r[1],void 0===u[I]&&(u[I]={index1:r[0],index2:r[1]});for(I in u)C=u[I],A.fromBufferAttribute(B,C.index1),c.push(A.x,A.y,A.z),A.fromBufferAttribute(B,C.index2),c.push(A.x,A.y,A.z)}else for(B=a.attributes.position,C=0,g=B.count/3;C<g;C++)for(e=0;3>e;e++)u=3*C+e,A.fromBufferAttribute(B,u),c.push(A.x,A.y,A.z),u=3*C+(e+1)%3,A.fromBufferAttribute(B,u),c.push(A.x, A.y,A.z);this.addAttribute("position",new qa(c,3))}function Xf(a,c,e){Y.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:c,stacks:e};this.fromBufferGeometry(new Te(a,c,e));this.mergeVertices()}function Te(a,c,e){za.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:c,stacks:e};var g=[],k=[],r=[],u=[],A=new m,B=new m,C=new m,H=new m,I=new m,K,P;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter."); var O=c+1;for(K=0;K<=e;K++){var S=K/e;for(P=0;P<=c;P++){var V=P/c;a(V,S,B);k.push(B.x,B.y,B.z);0<=V-1E-5?(a(V-1E-5,S,C),H.subVectors(B,C)):(a(V+1E-5,S,C),H.subVectors(C,B));0<=S-1E-5?(a(V,S-1E-5,C),I.subVectors(B,C)):(a(V,S+1E-5,C),I.subVectors(C,B));A.crossVectors(H,I).normalize();r.push(A.x,A.y,A.z);u.push(V,S)}}for(K=0;K<e;K++)for(P=0;P<c;P++)a=K*O+P+1,A=(K+1)*O+P+1,B=(K+1)*O+P,g.push(K*O+P,a,B),g.push(a,A,B);this.setIndex(g);this.addAttribute("position",new qa(k,3));this.addAttribute("normal", new qa(r,3));this.addAttribute("uv",new qa(u,2))}function Yf(a,c,e,g){Y.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:c,radius:e,detail:g};this.fromBufferGeometry(new vc(a,c,e,g));this.mergeVertices()}function vc(a,c,e,g){function k(C){A.push(C.x,C.y,C.z)}function r(C,H){C*=3;H.x=a[C+0];H.y=a[C+1];H.z=a[C+2]}function u(C,H,I,K){0>K&&1===C.x&&(B[H]=C.x-1);0===I.x&&0===I.z&&(B[H]=K/2/Math.PI+.5)}za.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a, indices:c,radius:e,detail:g};e=e||1;g=g||0;var A=[],B=[];(function(C){for(var H=new m,I=new m,K=new m,P=0;P<c.length;P+=3){r(c[P+0],H);r(c[P+1],I);r(c[P+2],K);var O,S,V=H,ca=I,ha=K,ba=Math.pow(2,C),ka=[];for(S=0;S<=ba;S++){ka[S]=[];var da=V.clone().lerp(ha,S/ba),ea=ca.clone().lerp(ha,S/ba),na=ba-S;for(O=0;O<=na;O++)ka[S][O]=0===O&&S===ba?da:da.clone().lerp(ea,O/na)}for(S=0;S<ba;S++)for(O=0;O<2*(ba-S)-1;O++)V=Math.floor(O/2),0===O%2?(k(ka[S][V+1]),k(ka[S+1][V]),k(ka[S][V])):(k(ka[S][V+1]),k(ka[S+1][V+ 1]),k(ka[S+1][V]))}})(g);(function(C){for(var H=new m,I=0;I<A.length;I+=3)H.x=A[I+0],H.y=A[I+1],H.z=A[I+2],H.normalize().multiplyScalar(C),A[I+0]=H.x,A[I+1]=H.y,A[I+2]=H.z})(e);(function(){for(var C=new m,H=0;H<A.length;H+=3)C.x=A[H+0],C.y=A[H+1],C.z=A[H+2],B.push(Math.atan2(C.z,-C.x)/2/Math.PI+.5,1-(Math.atan2(-C.y,Math.sqrt(C.x*C.x+C.z*C.z))/Math.PI+.5));C=new m;H=new m;for(var I=new m,K=new m,P=new f,O=new f,S=new f,V=0,ca=0;V<A.length;V+=9,ca+=6){C.set(A[V+0],A[V+1],A[V+2]);H.set(A[V+3],A[V+4], A[V+5]);I.set(A[V+6],A[V+7],A[V+8]);P.set(B[ca+0],B[ca+1]);O.set(B[ca+2],B[ca+3]);S.set(B[ca+4],B[ca+5]);K.copy(C).add(H).add(I).divideScalar(3);var ha=Math.atan2(K.z,-K.x);u(P,ca+0,C,ha);u(O,ca+2,H,ha);u(S,ca+4,I,ha)}for(C=0;C<B.length;C+=6)H=B[C+0],I=B[C+2],K=B[C+4],P=Math.min(H,I,K),.9<Math.max(H,I,K)&&.1>P&&(.2>H&&(B[C+0]+=1),.2>I&&(B[C+2]+=1),.2>K&&(B[C+4]+=1))})();this.addAttribute("position",new qa(A,3));this.addAttribute("normal",new qa(A.slice(),3));this.addAttribute("uv",new qa(B,2));0=== g?this.computeVertexNormals():this.normalizeNormals()}function Zf(a,c){Y.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:c};this.fromBufferGeometry(new Ue(a,c));this.mergeVertices()}function Ue(a,c){vc.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],a,c);this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:c}}function $f(a,c){Y.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:c};this.fromBufferGeometry(new de(a, c));this.mergeVertices()}function de(a,c){vc.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],a,c);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:c}}function ag(a,c){Y.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:c};this.fromBufferGeometry(new Ve(a,c));this.mergeVertices()}function Ve(a,c){var e=(1+Math.sqrt(5))/2;vc.call(this,[-1,e,0,1,e,0,-1,-e,0,1,-e,0,0,-1,e,0,1,e,0,-1,-e,0,1,-e,e,0,-1,e, 0,1,-e,0,-1,-e,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],a,c);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:c}}function bg(a,c){Y.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:c};this.fromBufferGeometry(new We(a,c));this.mergeVertices()}function We(a,c){var e=(1+Math.sqrt(5))/2,g=1/e;vc.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,-g,-e,0,-g,e,0,g,-e,0,g,e,-g,-e,0,-g,e,0,g,-e,0,g,e,0,-e,0,-g,e,0,-g,-e,0,g,e,0,g],[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],a,c);this.type="DodecahedronBufferGeometry";this.parameters={radius:a,detail:c}}function cg(a,c,e,g,k,r){Y.call(this);this.type="TubeGeometry"; this.parameters={path:a,tubularSegments:c,radius:e,radialSegments:g,closed:k};void 0!==r&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new ee(a,c,e,g,k);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function ee(a,c,e,g,k){function r(ca){H=a.getPointAt(ca/c,H);var ha=u.normals[ca];ca=u.binormals[ca];for(K=0;K<=g;K++){var ba=K/g*Math.PI*2,ka=Math.sin(ba);ba=-Math.cos(ba);B.x=ba*ha.x+ka*ca.x;B.y=ba*ha.y+ka* ca.y;B.z=ba*ha.z+ka*ca.z;B.normalize();O.push(B.x,B.y,B.z);A.x=H.x+e*B.x;A.y=H.y+e*B.y;A.z=H.z+e*B.z;P.push(A.x,A.y,A.z)}}za.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:c,radius:e,radialSegments:g,closed:k};c=c||64;e=e||1;g=g||8;k=k||!1;var u=a.computeFrenetFrames(c,k);this.tangents=u.tangents;this.normals=u.normals;this.binormals=u.binormals;var A=new m,B=new m,C=new f,H=new m,I,K,P=[],O=[],S=[],V=[];for(I=0;I<c;I++)r(I);r(!1===k?c:0);for(I=0;I<=c;I++)for(K= 0;K<=g;K++)C.x=I/c,C.y=K/g,S.push(C.x,C.y);(function(){for(K=1;K<=c;K++)for(I=1;I<=g;I++){var ca=(g+1)*K+(I-1),ha=(g+1)*K+I,ba=(g+1)*(K-1)+I;V.push((g+1)*(K-1)+(I-1),ca,ba);V.push(ca,ha,ba)}})();this.setIndex(V);this.addAttribute("position",new qa(P,3));this.addAttribute("normal",new qa(O,3));this.addAttribute("uv",new qa(S,2))}function dg(a,c,e,g,k,r,u){Y.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:c,tubularSegments:e,radialSegments:g,p:k,q:r};void 0!==u&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."); this.fromBufferGeometry(new Xe(a,c,e,g,k,r));this.mergeVertices()}function Xe(a,c,e,g,k,r){function u(ea,na,la,ua,Da){var wa=Math.sin(ea);na=la/na*ea;la=Math.cos(na);Da.x=ua*(2+la)*.5*Math.cos(ea);Da.y=ua*(2+la)*wa*.5;Da.z=ua*Math.sin(na)*.5}za.call(this);this.type="TorusKnotBufferGeometry";this.parameters={radius:a,tube:c,tubularSegments:e,radialSegments:g,p:k,q:r};a=a||1;c=c||.4;e=Math.floor(e)||64;g=Math.floor(g)||8;k=k||2;r=r||3;var A=[],B=[],C=[],H=[],I,K=new m,P=new m,O=new m,S=new m,V=new m, ca=new m,ha=new m;for(I=0;I<=e;++I){var ba=I/e*k*Math.PI*2;u(ba,k,r,a,O);u(ba+.01,k,r,a,S);ca.subVectors(S,O);ha.addVectors(S,O);V.crossVectors(ca,ha);ha.crossVectors(V,ca);V.normalize();ha.normalize();for(ba=0;ba<=g;++ba){var ka=ba/g*Math.PI*2,da=-c*Math.cos(ka);ka=c*Math.sin(ka);K.x=O.x+(da*ha.x+ka*V.x);K.y=O.y+(da*ha.y+ka*V.y);K.z=O.z+(da*ha.z+ka*V.z);B.push(K.x,K.y,K.z);P.subVectors(K,O).normalize();C.push(P.x,P.y,P.z);H.push(I/e);H.push(ba/g)}}for(ba=1;ba<=e;ba++)for(I=1;I<=g;I++)a=(g+1)*ba+ (I-1),c=(g+1)*ba+I,k=(g+1)*(ba-1)+I,A.push((g+1)*(ba-1)+(I-1),a,k),A.push(a,c,k);this.setIndex(A);this.addAttribute("position",new qa(B,3));this.addAttribute("normal",new qa(C,3));this.addAttribute("uv",new qa(H,2))}function eg(a,c,e,g,k){Y.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:c,radialSegments:e,tubularSegments:g,arc:k};this.fromBufferGeometry(new Ye(a,c,e,g,k));this.mergeVertices()}function Ye(a,c,e,g,k){za.call(this);this.type="TorusBufferGeometry";this.parameters= {radius:a,tube:c,radialSegments:e,tubularSegments:g,arc:k};a=a||1;c=c||.4;e=Math.floor(e)||8;g=Math.floor(g)||6;k=k||2*Math.PI;var r=[],u=[],A=[],B=[],C=new m,H=new m,I=new m,K,P;for(K=0;K<=e;K++)for(P=0;P<=g;P++){var O=P/g*k,S=K/e*Math.PI*2;H.x=(a+c*Math.cos(S))*Math.cos(O);H.y=(a+c*Math.cos(S))*Math.sin(O);H.z=c*Math.sin(S);u.push(H.x,H.y,H.z);C.x=a*Math.cos(O);C.y=a*Math.sin(O);I.subVectors(H,C).normalize();A.push(I.x,I.y,I.z);B.push(P/g);B.push(K/e)}for(K=1;K<=e;K++)for(P=1;P<=g;P++)a=(g+1)*(K- 1)+P-1,c=(g+1)*(K-1)+P,k=(g+1)*K+P,r.push((g+1)*K+P-1,a,k),r.push(a,c,k);this.setIndex(r);this.addAttribute("position",new qa(u,3));this.addAttribute("normal",new qa(A,3));this.addAttribute("uv",new qa(B,2))}function dl(a,c,e,g,k){for(var r,u=0,A=c,B=e-g;A<e;A+=g)u+=(a[B]-a[A])*(a[A+1]+a[B+1]),B=A;if(k===0<u)for(k=c;k<e;k+=g)r=el(k,a[k],a[k+1],r);else for(k=e-g;k>=c;k-=g)r=el(k,a[k],a[k+1],r);r&&fe(r,r.next)&&(fg(r),r=r.next);return r}function gg(a,c){if(!a)return a;c||(c=a);do{var e=!1;if(a.steiner|| !fe(a,a.next)&&0!==pc(a.prev,a,a.next))a=a.next;else{fg(a);a=c=a.prev;if(a===a.next)break;e=!0}}while(e||a!==c);return c}function hg(a,c,e,g,k,r,u){if(a){if(!u&&r){var A=a,B=A;do null===B.z&&(B.z=ki(B.x,B.y,g,k,r)),B.prevZ=B.prev,B=B.nextZ=B.next;while(B!==A);B.prevZ.nextZ=null;B.prevZ=null;A=B;var C,H,I,K,P=1;do{B=A;var O=A=null;for(H=0;B;){H++;var S=B;for(C=I=0;C<P&&(I++,S=S.nextZ,S);C++);for(K=P;0<I||0<K&&S;)0!==I&&(0===K||!S||B.z<=S.z)?(C=B,B=B.nextZ,I--):(C=S,S=S.nextZ,K--),O?O.nextZ=C:A=C,C.prevZ= O,O=C;B=S}O.nextZ=null;P*=2}while(1<H)}for(A=a;a.prev!==a.next;){B=a.prev;S=a.next;if(r)a:{O=a;C=g;K=k;var V=r;H=O.prev;I=O.next;if(0<=pc(H,O,I))O=!1;else{var ca=H.x>O.x?H.x>I.x?H.x:I.x:O.x>I.x?O.x:I.x,ha=H.y>O.y?H.y>I.y?H.y:I.y:O.y>I.y?O.y:I.y;P=ki(H.x<O.x?H.x<I.x?H.x:I.x:O.x<I.x?O.x:I.x,H.y<O.y?H.y<I.y?H.y:I.y:O.y<I.y?O.y:I.y,C,K,V);C=ki(ca,ha,C,K,V);for(K=O.nextZ;K&&K.z<=C;){if(K!==O.prev&&K!==O.next&&ch(H.x,H.y,O.x,O.y,I.x,I.y,K.x,K.y)&&0<=pc(K.prev,K,K.next)){O=!1;break a}K=K.nextZ}for(K=O.prevZ;K&& K.z>=P;){if(K!==O.prev&&K!==O.next&&ch(H.x,H.y,O.x,O.y,I.x,I.y,K.x,K.y)&&0<=pc(K.prev,K,K.next)){O=!1;break a}K=K.prevZ}O=!0}}else a:if(O=a,H=O.prev,I=O.next,0<=pc(H,O,I))O=!1;else{for(P=O.next.next;P!==O.prev;){if(ch(H.x,H.y,O.x,O.y,I.x,I.y,P.x,P.y)&&0<=pc(P.prev,P,P.next)){O=!1;break a}P=P.next}O=!0}if(O)c.push(B.i/e),c.push(a.i/e),c.push(S.i/e),fg(a),A=a=S.next;else if(a=S,a===A){if(u)if(1===u){u=c;A=e;B=a;do S=B.prev,O=B.next.next,!fe(S,O)&&fl(S,B,B.next,O)&&ig(S,O)&&ig(O,S)&&(u.push(S.i/A),u.push(B.i/ A),u.push(O.i/A),fg(B),fg(B.next),B=a=O),B=B.next;while(B!==a);a=B;hg(a,c,e,g,k,r,2)}else{if(2===u)a:{u=a;do{for(A=u.next.next;A!==u.prev;){if(B=u.i!==A.i){B=u;S=A;if(O=B.next.i!==S.i&&B.prev.i!==S.i){b:{O=B;do{if(O.i!==B.i&&O.next.i!==B.i&&O.i!==S.i&&O.next.i!==S.i&&fl(O,O.next,B,S)){O=!0;break b}O=O.next}while(O!==B);O=!1}O=!O}if(O=O&&ig(B,S)&&ig(S,B)){O=B;H=!1;I=(B.x+S.x)/2;S=(B.y+S.y)/2;do O.y>S!==O.next.y>S&&O.next.y!==O.y&&I<(O.next.x-O.x)*(S-O.y)/(O.next.y-O.y)+O.x&&(H=!H),O=O.next;while(O!== B);O=H}B=O}if(B){a=gl(u,A);u=gg(u,u.next);a=gg(a,a.next);hg(u,c,e,g,k,r);hg(a,c,e,g,k,r);break a}A=A.next}u=u.next}while(u!==a)}}else hg(gg(a),c,e,g,k,r,1);break}}}}function To(a,c){return a.x-c.x}function Uo(a,c){var e=c,g=a.x,k=a.y,r=-Infinity;do{if(k<=e.y&&k>=e.next.y&&e.next.y!==e.y){var u=e.x+(k-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(u<=g&&u>r){r=u;if(u===g){if(k===e.y)return e;if(k===e.next.y)return e.next}var A=e.x<e.next.x?e:e.next}}e=e.next}while(e!==c);if(!A)return null;if(g===r)return A.prev; c=A;u=A.x;var B=A.y,C=Infinity;for(e=A.next;e!==c;){if(g>=e.x&&e.x>=u&&g!==e.x&&ch(k<B?g:r,k,u,B,k<B?r:g,k,e.x,e.y)){var H=Math.abs(k-e.y)/(g-e.x);(H<C||H===C&&e.x>A.x)&&ig(e,a)&&(A=e,C=H)}e=e.next}return A}function ki(a,c,e,g,k){a=32767*(a-e)*k;c=32767*(c-g)*k;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;c=(c|c<<8)&16711935;c=(c|c<<4)&252645135;c=(c|c<<2)&858993459;return(a|a<<1)&1431655765|((c|c<<1)&1431655765)<<1}function Vo(a){var c=a,e=a;do c.x<e.x&&(e=c),c=c.next;while(c!== a);return e}function ch(a,c,e,g,k,r,u,A){return 0<=(k-u)*(c-A)-(a-u)*(r-A)&&0<=(a-u)*(g-A)-(e-u)*(c-A)&&0<=(e-u)*(r-A)-(k-u)*(g-A)}function pc(a,c,e){return(c.y-a.y)*(e.x-c.x)-(c.x-a.x)*(e.y-c.y)}function fe(a,c){return a.x===c.x&&a.y===c.y}function fl(a,c,e,g){return fe(a,c)&&fe(e,g)||fe(a,g)&&fe(e,c)?!0:0<pc(a,c,e)!==0<pc(a,c,g)&&0<pc(e,g,a)!==0<pc(e,g,c)}function ig(a,c){return 0>pc(a.prev,a,a.next)?0<=pc(a,c,a.next)&&0<=pc(a,a.prev,c):0>pc(a,c,a.prev)||0>pc(a,a.next,c)}function gl(a,c){var e= new li(a.i,a.x,a.y),g=new li(c.i,c.x,c.y),k=a.next,r=c.prev;a.next=c;c.prev=a;e.next=k;k.prev=e;g.next=e;e.prev=g;r.next=g;g.prev=r;return g}function el(a,c,e,g){a=new li(a,c,e);g?(a.next=g.next,a.prev=g,g.next.prev=a,g.next=a):(a.prev=a,a.next=a);return a}function fg(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function li(a,c,e){this.i=a;this.x=c;this.y=e;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function hl(a){var c= a.length;2<c&&a[c-1].equals(a[0])&&a.pop()}function il(a,c){for(var e=0;e<c.length;e++)a.push(c[e].x),a.push(c[e].y)}function ge(a,c){Y.call(this);this.type="ExtrudeGeometry";this.parameters={shapes:a,options:c};this.fromBufferGeometry(new ad(a,c));this.mergeVertices()}function ad(a,c){function e(B){function C(Sa,Va,ya){Va||console.error("THREE.ExtrudeGeometry: vec does not exist");return Va.clone().multiplyScalar(ya).add(Sa)}function H(Sa,Va,ya){var Ma=Sa.x-Va.x;var Za=Sa.y-Va.y;var Ta=ya.x-Sa.x; var nb=ya.y-Sa.y,wb=Ma*Ma+Za*Za;if(Math.abs(Ma*nb-Za*Ta)>Number.EPSILON){var ec=Math.sqrt(wb),td=Math.sqrt(Ta*Ta+nb*nb);wb=Va.x-Za/ec;Va=Va.y+Ma/ec;nb=((ya.x-nb/td-wb)*nb-(ya.y+Ta/td-Va)*Ta)/(Ma*nb-Za*Ta);Ta=wb+Ma*nb-Sa.x;Ma=Va+Za*nb-Sa.y;Za=Ta*Ta+Ma*Ma;if(2>=Za)return new f(Ta,Ma);Za=Math.sqrt(Za/2)}else Sa=!1,Ma>Number.EPSILON?Ta>Number.EPSILON&&(Sa=!0):Ma<-Number.EPSILON?Ta<-Number.EPSILON&&(Sa=!0):Math.sign(Za)===Math.sign(nb)&&(Sa=!0),Sa?(Ta=-Za,Za=Math.sqrt(wb)):(Ta=Ma,Ma=Za,Za=Math.sqrt(wb/ 2));return new f(Ta/Za,Ma/Za)}function I(Sa,Va){for(Ga=Sa.length;0<=--Ga;){var ya=Ga;var Ma=Ga-1;0>Ma&&(Ma=Sa.length-1);var Za,Ta=ha+2*la;for(Za=0;Za<Ta;Za++){var nb=db*Za,wb=db*(Za+1),ec=Va+Ma+nb,td=Va+Ma+wb;wb=Va+ya+wb;O(Va+ya+nb);O(ec);O(wb);O(ec);O(td);O(wb);nb=k.length/3;nb=Da.generateSideWallUV(g,k,nb-6,nb-3,nb-2,nb-1);S(nb[0]);S(nb[1]);S(nb[3]);S(nb[1]);S(nb[2]);S(nb[3])}}}function K(Sa,Va,ya){V.push(Sa);V.push(Va);V.push(ya)}function P(Sa,Va,ya){O(Sa);O(Va);O(ya);Sa=k.length/3;Sa=Da.generateTopUV(g, k,Sa-3,Sa-2,Sa-1);S(Sa[0]);S(Sa[1]);S(Sa[2])}function O(Sa){k.push(V[3*Sa]);k.push(V[3*Sa+1]);k.push(V[3*Sa+2])}function S(Sa){r.push(Sa.x);r.push(Sa.y)}var V=[],ca=void 0!==c.curveSegments?c.curveSegments:12,ha=void 0!==c.steps?c.steps:1,ba=void 0!==c.depth?c.depth:100,ka=void 0!==c.bevelEnabled?c.bevelEnabled:!0,da=void 0!==c.bevelThickness?c.bevelThickness:6,ea=void 0!==c.bevelSize?c.bevelSize:da-2,na=void 0!==c.bevelOffset?c.bevelOffset:0,la=void 0!==c.bevelSegments?c.bevelSegments:3,ua=c.extrudePath, Da=void 0!==c.UVGenerator?c.UVGenerator:Wo;void 0!==c.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),ba=c.amount);var wa=!1;if(ua){var Ca=ua.getSpacedPoints(ha);wa=!0;ka=!1;var Ea=ua.computeFrenetFrames(ha,!1);var Qa=new m;var W=new m;var aa=new m}ka||(na=ea=da=la=0);var ja;ca=B.extractPoints(ca);B=ca.shape;var ra=ca.holes;if(!vd.isClockWise(B)){B=B.reverse();var Aa=0;for(ja=ra.length;Aa<ja;Aa++){var Ia=ra[Aa];vd.isClockWise(Ia)&&(ra[Aa]=Ia.reverse())}}var kb= vd.triangulateShape(B,ra),lb=B;Aa=0;for(ja=ra.length;Aa<ja;Aa++)Ia=ra[Aa],B=B.concat(Ia);var Ya,db=B.length,hb,ob=kb.length;ca=[];var Ga=0;var ia=lb.length;var Oa=ia-1;for(Ya=Ga+1;Ga<ia;Ga++,Oa++,Ya++)Oa===ia&&(Oa=0),Ya===ia&&(Ya=0),ca[Ga]=H(lb[Ga],lb[Oa],lb[Ya]);ua=[];var eb=ca.concat();Aa=0;for(ja=ra.length;Aa<ja;Aa++){Ia=ra[Aa];var jb=[];Ga=0;ia=Ia.length;Oa=ia-1;for(Ya=Ga+1;Ga<ia;Ga++,Oa++,Ya++)Oa===ia&&(Oa=0),Ya===ia&&(Ya=0),jb[Ga]=H(Ia[Ga],Ia[Oa],Ia[Ya]);ua.push(jb);eb=eb.concat(jb)}for(Oa= 0;Oa<la;Oa++){ia=Oa/la;var Xa=da*Math.cos(ia*Math.PI/2);Ya=ea*Math.sin(ia*Math.PI/2)+na;Ga=0;for(ia=lb.length;Ga<ia;Ga++){var gb=C(lb[Ga],ca[Ga],Ya);K(gb.x,gb.y,-Xa)}Aa=0;for(ja=ra.length;Aa<ja;Aa++)for(Ia=ra[Aa],jb=ua[Aa],Ga=0,ia=Ia.length;Ga<ia;Ga++)gb=C(Ia[Ga],jb[Ga],Ya),K(gb.x,gb.y,-Xa)}Ya=ea+na;for(Ga=0;Ga<db;Ga++)gb=ka?C(B[Ga],eb[Ga],Ya):B[Ga],wa?(W.copy(Ea.normals[0]).multiplyScalar(gb.x),Qa.copy(Ea.binormals[0]).multiplyScalar(gb.y),aa.copy(Ca[0]).add(W).add(Qa),K(aa.x,aa.y,aa.z)):K(gb.x, gb.y,0);for(ia=1;ia<=ha;ia++)for(Ga=0;Ga<db;Ga++)gb=ka?C(B[Ga],eb[Ga],Ya):B[Ga],wa?(W.copy(Ea.normals[ia]).multiplyScalar(gb.x),Qa.copy(Ea.binormals[ia]).multiplyScalar(gb.y),aa.copy(Ca[ia]).add(W).add(Qa),K(aa.x,aa.y,aa.z)):K(gb.x,gb.y,ba/ha*ia);for(Oa=la-1;0<=Oa;Oa--){ia=Oa/la;Xa=da*Math.cos(ia*Math.PI/2);Ya=ea*Math.sin(ia*Math.PI/2)+na;Ga=0;for(ia=lb.length;Ga<ia;Ga++)gb=C(lb[Ga],ca[Ga],Ya),K(gb.x,gb.y,ba+Xa);Aa=0;for(ja=ra.length;Aa<ja;Aa++)for(Ia=ra[Aa],jb=ua[Aa],Ga=0,ia=Ia.length;Ga<ia;Ga++)gb= C(Ia[Ga],jb[Ga],Ya),wa?K(gb.x,gb.y+Ca[ha-1].y,Ca[ha-1].x+Xa):K(gb.x,gb.y,ba+Xa)}(function(){var Sa=k.length/3;if(ka){var Va=0*db;for(Ga=0;Ga<ob;Ga++)hb=kb[Ga],P(hb[2]+Va,hb[1]+Va,hb[0]+Va);Va=db*(ha+2*la);for(Ga=0;Ga<ob;Ga++)hb=kb[Ga],P(hb[0]+Va,hb[1]+Va,hb[2]+Va)}else{for(Ga=0;Ga<ob;Ga++)hb=kb[Ga],P(hb[2],hb[1],hb[0]);for(Ga=0;Ga<ob;Ga++)hb=kb[Ga],P(hb[0]+db*ha,hb[1]+db*ha,hb[2]+db*ha)}g.addGroup(Sa,k.length/3-Sa,0)})();(function(){var Sa=k.length/3,Va=0;I(lb,Va);Va+=lb.length;Aa=0;for(ja=ra.length;Aa< ja;Aa++)Ia=ra[Aa],I(Ia,Va),Va+=Ia.length;g.addGroup(Sa,k.length/3-Sa,1)})()}za.call(this);this.type="ExtrudeBufferGeometry";this.parameters={shapes:a,options:c};a=Array.isArray(a)?a:[a];for(var g=this,k=[],r=[],u=0,A=a.length;u<A;u++)e(a[u]);this.addAttribute("position",new qa(k,3));this.addAttribute("uv",new qa(r,2));this.computeVertexNormals()}function jl(a,c,e){e.shapes=[];if(Array.isArray(a))for(var g=0,k=a.length;g<k;g++)e.shapes.push(a[g].uuid);else e.shapes.push(a.uuid);void 0!==c.extrudePath&& (e.options.extrudePath=c.extrudePath.toJSON());return e}function jg(a,c){Y.call(this);this.type="TextGeometry";this.parameters={text:a,parameters:c};this.fromBufferGeometry(new Ze(a,c));this.mergeVertices()}function Ze(a,c){c=c||{};var e=c.font;if(!e||!e.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Y;a=e.generateShapes(a,c.size);c.depth=void 0!==c.height?c.height:50;void 0===c.bevelThickness&&(c.bevelThickness=10);void 0===c.bevelSize&&(c.bevelSize= 8);void 0===c.bevelEnabled&&(c.bevelEnabled=!1);ad.call(this,a,c);this.type="TextBufferGeometry"}function kg(a,c,e,g,k,r,u){Y.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:c,heightSegments:e,phiStart:g,phiLength:k,thetaStart:r,thetaLength:u};this.fromBufferGeometry(new Od(a,c,e,g,k,r,u));this.mergeVertices()}function Od(a,c,e,g,k,r,u){za.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:c,heightSegments:e,phiStart:g,phiLength:k,thetaStart:r, thetaLength:u};a=a||1;c=Math.max(3,Math.floor(c)||8);e=Math.max(2,Math.floor(e)||6);g=void 0!==g?g:0;k=void 0!==k?k:2*Math.PI;r=void 0!==r?r:0;u=void 0!==u?u:Math.PI;var A=r+u,B,C,H=0,I=[],K=new m,P=new m,O=[],S=[],V=[],ca=[];for(C=0;C<=e;C++){var ha=[],ba=C/e,ka=0==C?.5/c:C==e?-.5/c:0;for(B=0;B<=c;B++){var da=B/c;K.x=-a*Math.cos(g+da*k)*Math.sin(r+ba*u);K.y=a*Math.cos(r+ba*u);K.z=a*Math.sin(g+da*k)*Math.sin(r+ba*u);S.push(K.x,K.y,K.z);P.copy(K).normalize();V.push(P.x,P.y,P.z);ca.push(da+ka,1-ba); ha.push(H++)}I.push(ha)}for(C=0;C<e;C++)for(B=0;B<c;B++)a=I[C][B+1],g=I[C][B],k=I[C+1][B],u=I[C+1][B+1],(0!==C||0<r)&&O.push(a,g,u),(C!==e-1||A<Math.PI)&&O.push(g,k,u);this.setIndex(O);this.addAttribute("position",new qa(S,3));this.addAttribute("normal",new qa(V,3));this.addAttribute("uv",new qa(ca,2))}function lg(a,c,e,g,k,r){Y.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:c,thetaSegments:e,phiSegments:g,thetaStart:k,thetaLength:r};this.fromBufferGeometry(new $e(a, c,e,g,k,r));this.mergeVertices()}function $e(a,c,e,g,k,r){za.call(this);this.type="RingBufferGeometry";this.parameters={innerRadius:a,outerRadius:c,thetaSegments:e,phiSegments:g,thetaStart:k,thetaLength:r};a=a||.5;c=c||1;k=void 0!==k?k:0;r=void 0!==r?r:2*Math.PI;e=void 0!==e?Math.max(3,e):8;g=void 0!==g?Math.max(1,g):1;var u=[],A=[],B=[],C=[],H=a,I=(c-a)/g,K=new m,P=new f,O,S;for(O=0;O<=g;O++){for(S=0;S<=e;S++)a=k+S/e*r,K.x=H*Math.cos(a),K.y=H*Math.sin(a),A.push(K.x,K.y,K.z),B.push(0,0,1),P.x=(K.x/ c+1)/2,P.y=(K.y/c+1)/2,C.push(P.x,P.y);H+=I}for(O=0;O<g;O++)for(c=O*(e+1),S=0;S<e;S++)a=S+c,k=a+e+1,r=a+e+2,H=a+1,u.push(a,k,H),u.push(k,r,H);this.setIndex(u);this.addAttribute("position",new qa(A,3));this.addAttribute("normal",new qa(B,3));this.addAttribute("uv",new qa(C,2))}function mg(a,c,e,g){Y.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:c,phiStart:e,phiLength:g};this.fromBufferGeometry(new af(a,c,e,g));this.mergeVertices()}function af(a,c,e,g){za.call(this);this.type= "LatheBufferGeometry";this.parameters={points:a,segments:c,phiStart:e,phiLength:g};c=Math.floor(c)||12;e=e||0;g=g||2*Math.PI;g=ab.clamp(g,0,2*Math.PI);var k=[],r=[],u=[],A=1/c,B=new m,C=new f,H;for(H=0;H<=c;H++){var I=e+H*A*g;var K=Math.sin(I),P=Math.cos(I);for(I=0;I<=a.length-1;I++)B.x=a[I].x*K,B.y=a[I].y,B.z=a[I].x*P,r.push(B.x,B.y,B.z),C.x=H/c,C.y=I/(a.length-1),u.push(C.x,C.y)}for(H=0;H<c;H++)for(I=0;I<a.length-1;I++)e=I+H*a.length,A=e+a.length,B=e+a.length+1,C=e+1,k.push(e,A,C),k.push(A,B,C); this.setIndex(k);this.addAttribute("position",new qa(r,3));this.addAttribute("uv",new qa(u,2));this.computeVertexNormals();if(g===2*Math.PI)for(g=this.attributes.normal.array,k=new m,r=new m,u=new m,e=c*a.length*3,I=H=0;H<a.length;H++,I+=3)k.x=g[I+0],k.y=g[I+1],k.z=g[I+2],r.x=g[e+I+0],r.y=g[e+I+1],r.z=g[e+I+2],u.addVectors(k,r).normalize(),g[I+0]=g[e+I+0]=u.x,g[I+1]=g[e+I+1]=u.y,g[I+2]=g[e+I+2]=u.z}function he(a,c){Y.call(this);this.type="ShapeGeometry";"object"===typeof c&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."), c=c.curveSegments);this.parameters={shapes:a,curveSegments:c};this.fromBufferGeometry(new ie(a,c));this.mergeVertices()}function ie(a,c){function e(H){var I,K=k.length/3;H=H.extractPoints(c);var P=H.shape,O=H.holes;!1===vd.isClockWise(P)&&(P=P.reverse());H=0;for(I=O.length;H<I;H++){var S=O[H];!0===vd.isClockWise(S)&&(O[H]=S.reverse())}var V=vd.triangulateShape(P,O);H=0;for(I=O.length;H<I;H++)S=O[H],P=P.concat(S);H=0;for(I=P.length;H<I;H++)S=P[H],k.push(S.x,S.y,0),r.push(0,0,1),u.push(S.x,S.y);H=0; for(I=V.length;H<I;H++)P=V[H],g.push(P[0]+K,P[1]+K,P[2]+K),B+=3}za.call(this);this.type="ShapeBufferGeometry";this.parameters={shapes:a,curveSegments:c};c=c||12;var g=[],k=[],r=[],u=[],A=0,B=0;if(!1===Array.isArray(a))e(a);else for(var C=0;C<a.length;C++)e(a[C]),this.addGroup(A,B,C),A+=B,B=0;this.setIndex(g);this.addAttribute("position",new qa(k,3));this.addAttribute("normal",new qa(r,3));this.addAttribute("uv",new qa(u,2))}function kl(a,c){c.shapes=[];if(Array.isArray(a))for(var e=0,g=a.length;e< g;e++)c.shapes.push(a[e].uuid);else c.shapes.push(a.uuid);return c}function bf(a,c){za.call(this);this.type="EdgesGeometry";this.parameters={thresholdAngle:c};var e=[];c=Math.cos(ab.DEG2RAD*(void 0!==c?c:1));var g=[0,0],k={},r=["a","b","c"];if(a.isBufferGeometry){var u=new Y;u.fromBufferGeometry(a)}else u=a.clone();u.mergeVertices();u.computeFaceNormals();a=u.vertices;u=u.faces;for(var A=0,B=u.length;A<B;A++)for(var C=u[A],H=0;3>H;H++){var I=C[r[H]];var K=C[r[(H+1)%3]];g[0]=Math.min(I,K);g[1]=Math.max(I, K);I=g[0]+","+g[1];void 0===k[I]?k[I]={index1:g[0],index2:g[1],face1:A,face2:void 0}:k[I].face2=A}for(I in k)if(g=k[I],void 0===g.face2||u[g.face1].normal.dot(u[g.face2].normal)<=c)r=a[g.index1],e.push(r.x,r.y,r.z),r=a[g.index2],e.push(r.x,r.y,r.z);this.addAttribute("position",new qa(e,3))}function je(a,c,e,g,k,r,u,A){Y.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:c,height:e,radialSegments:g,heightSegments:k,openEnded:r,thetaStart:u,thetaLength:A};this.fromBufferGeometry(new wd(a, c,e,g,k,r,u,A));this.mergeVertices()}function wd(a,c,e,g,k,r,u,A){function B(ha){var ba,ka=new f,da=new m,ea=0,na=!0===ha?a:c,la=!0===ha?1:-1;var ua=O;for(ba=1;ba<=g;ba++)I.push(0,V*la,0),K.push(0,la,0),P.push(.5,.5),O++;var Da=O;for(ba=0;ba<=g;ba++){var wa=ba/g*A+u,Ca=Math.cos(wa);wa=Math.sin(wa);da.x=na*wa;da.y=V*la;da.z=na*Ca;I.push(da.x,da.y,da.z);K.push(0,la,0);ka.x=.5*Ca+.5;ka.y=.5*wa*la+.5;P.push(ka.x,ka.y);O++}for(ba=0;ba<g;ba++)ka=ua+ba,da=Da+ba,!0===ha?H.push(da,da+1,ka):H.push(da+1,da, ka),ea+=3;C.addGroup(ca,ea,!0===ha?1:2);ca+=ea}za.call(this);this.type="CylinderBufferGeometry";this.parameters={radiusTop:a,radiusBottom:c,height:e,radialSegments:g,heightSegments:k,openEnded:r,thetaStart:u,thetaLength:A};var C=this;a=void 0!==a?a:1;c=void 0!==c?c:1;e=e||1;g=Math.floor(g)||8;k=Math.floor(k)||1;r=void 0!==r?r:!1;u=void 0!==u?u:0;A=void 0!==A?A:2*Math.PI;var H=[],I=[],K=[],P=[],O=0,S=[],V=e/2,ca=0;(function(){var ha,ba,ka=new m,da=new m,ea=0,na=(c-a)/e;for(ba=0;ba<=k;ba++){var la= [],ua=ba/k,Da=ua*(c-a)+a;for(ha=0;ha<=g;ha++){var wa=ha/g,Ca=wa*A+u,Ea=Math.sin(Ca);Ca=Math.cos(Ca);da.x=Da*Ea;da.y=-ua*e+V;da.z=Da*Ca;I.push(da.x,da.y,da.z);ka.set(Ea,na,Ca).normalize();K.push(ka.x,ka.y,ka.z);P.push(wa,1-ua);la.push(O++)}S.push(la)}for(ha=0;ha<g;ha++)for(ba=0;ba<k;ba++)ka=S[ba+1][ha],da=S[ba+1][ha+1],na=S[ba][ha+1],H.push(S[ba][ha],ka,na),H.push(ka,da,na),ea+=6;C.addGroup(ca,ea,0);ca+=ea})();!1===r&&(0<a&&B(!0),0<c&&B(!1));this.setIndex(H);this.addAttribute("position",new qa(I,3)); this.addAttribute("normal",new qa(K,3));this.addAttribute("uv",new qa(P,2))}function ng(a,c,e,g,k,r,u){je.call(this,0,a,c,e,g,k,r,u);this.type="ConeGeometry";this.parameters={radius:a,height:c,radialSegments:e,heightSegments:g,openEnded:k,thetaStart:r,thetaLength:u}}function og(a,c,e,g,k,r,u){wd.call(this,0,a,c,e,g,k,r,u);this.type="ConeBufferGeometry";this.parameters={radius:a,height:c,radialSegments:e,heightSegments:g,openEnded:k,thetaStart:r,thetaLength:u}}function pg(a,c,e,g){Y.call(this);this.type= "CircleGeometry";this.parameters={radius:a,segments:c,thetaStart:e,thetaLength:g};this.fromBufferGeometry(new cf(a,c,e,g));this.mergeVertices()}function cf(a,c,e,g){za.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:c,thetaStart:e,thetaLength:g};a=a||1;c=void 0!==c?Math.max(3,c):8;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;var k=[],r=[],u=[],A=[],B,C=new m,H=new f;r.push(0,0,0);u.push(0,0,1);A.push(.5,.5);var I=0;for(B=3;I<=c;I++,B+=3){var K=e+I/c*g;C.x=a*Math.cos(K); C.y=a*Math.sin(K);r.push(C.x,C.y,C.z);u.push(0,0,1);H.x=(r[B]/a+1)/2;H.y=(r[B+1]/a+1)/2;A.push(H.x,H.y)}for(B=1;B<=c;B++)k.push(B,B+1,0);this.setIndex(k);this.addAttribute("position",new qa(r,3));this.addAttribute("normal",new qa(u,3));this.addAttribute("uv",new qa(A,2))}function ke(a){bb.call(this);this.type="ShadowMaterial";this.color=new E(0);this.transparent=!0;this.setValues(a)}function df(a){tc.call(this,a);this.type="RawShaderMaterial"}function bd(a){bb.call(this);this.defines={STANDARD:""}; this.type="MeshStandardMaterial";this.color=new E(16777215);this.metalness=this.roughness=.5;this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new E(0);this.emissiveIntensity=1;this.bumpMap=this.emissiveMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=new f(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.envMap=this.alphaMap=this.metalnessMap=this.roughnessMap=null;this.envMapIntensity= 1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function le(a){bd.call(this);this.defines={PHYSICAL:""};this.type="MeshPhysicalMaterial";this.reflectivity=.5;this.clearCoatRoughness=this.clearCoat=0;this.setValues(a)}function Nc(a){bb.call(this);this.type="MeshPhongMaterial";this.color=new E(16777215);this.specular=new E(1118481);this.shininess=30;this.lightMap= this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new E(0);this.emissiveIntensity=1;this.bumpMap=this.emissiveMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=new f(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap= "round";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function me(a){Nc.call(this);this.defines={TOON:""};this.type="MeshToonMaterial";this.gradientMap=null;this.setValues(a)}function ne(a){bb.call(this);this.type="MeshNormalMaterial";this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=new f(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals= this.morphTargets=this.skinning=this.lights=this.fog=!1;this.setValues(a)}function oe(a){bb.call(this);this.type="MeshLambertMaterial";this.color=new E(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new E(0);this.emissiveIntensity=1;this.envMap=this.alphaMap=this.specularMap=this.emissiveMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap= "round";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function pe(a){bb.call(this);this.defines={MATCAP:""};this.type="MeshMatcapMaterial";this.color=new E(16777215);this.bumpMap=this.map=this.matcap=null;this.bumpScale=1;this.normalMap=null;this.normalMapType=0;this.normalScale=new f(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.alphaMap=null;this.lights=this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)}function qe(a){ub.call(this); this.type="LineDashedMaterial";this.scale=1;this.dashSize=3;this.gapSize=1;this.setValues(a)}function Ac(a,c,e,g){this.parameterPositions=a;this._cachedIndex=0;this.resultBuffer=void 0!==g?g:new c.constructor(e);this.sampleValues=c;this.valueSize=e}function dh(a,c,e,g){Ac.call(this,a,c,e,g);this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function qg(a,c,e,g){Ac.call(this,a,c,e,g)}function eh(a,c,e,g){Ac.call(this,a,c,e,g)}function gc(a,c,e,g){if(void 0===a)throw Error("THREE.KeyframeTrack: track name is undefined"); if(void 0===c||0===c.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+a);this.name=a;this.times=Yb.convertArray(c,this.TimeBufferType);this.values=Yb.convertArray(e,this.ValueBufferType);this.setInterpolation(g||this.DefaultInterpolation)}function fh(a,c,e){gc.call(this,a,c,e)}function gh(a,c,e,g){gc.call(this,a,c,e,g)}function ef(a,c,e,g){gc.call(this,a,c,e,g)}function hh(a,c,e,g){Ac.call(this,a,c,e,g)}function rg(a,c,e,g){gc.call(this,a,c,e,g)}function ih(a,c,e,g){gc.call(this, a,c,e,g)}function ff(a,c,e,g){gc.call(this,a,c,e,g)}function Hc(a,c,e){this.name=a;this.tracks=e;this.duration=void 0!==c?c:-1;this.uuid=ab.generateUUID();0>this.duration&&this.resetDuration()}function Xo(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return ef;case "vector":case "vector2":case "vector3":case "vector4":return ff;case "color":return gh;case "quaternion":return rg;case "bool":case "boolean":return fh;case "string":return ih}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+ a);}function Yo(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var c=Xo(a.type);if(void 0===a.times){var e=[],g=[];Yb.flattenJSON(a.keys,e,g,"value");a.times=e;a.values=g}return void 0!==c.parse?c.parse(a):new c(a.name,a.times,a.values,a.interpolation)}function mi(a,c,e){var g=this,k=!1,r=0,u=0,A=void 0;this.onStart=void 0;this.onLoad=a;this.onProgress=c;this.onError=e;this.itemStart=function(B){u++;if(!1===k&&void 0!==g.onStart)g.onStart(B,r,u);k=!0}; this.itemEnd=function(B){r++;if(void 0!==g.onProgress)g.onProgress(B,r,u);if(r===u&&(k=!1,void 0!==g.onLoad))g.onLoad()};this.itemError=function(B){if(void 0!==g.onError)g.onError(B)};this.resolveURL=function(B){return A?A(B):B};this.setURLModifier=function(B){A=B;return this}}function Oc(a){this.manager=void 0!==a?a:wc}function ll(a){this.manager=void 0!==a?a:wc}function ml(a){this.manager=void 0!==a?a:wc;this._parser=null}function ni(a){this.manager=void 0!==a?a:wc;this._parser=null}function sg(a){this.manager= void 0!==a?a:wc}function oi(a){this.manager=void 0!==a?a:wc}function jh(a){this.manager=void 0!==a?a:wc}function Wa(){this.type="Curve";this.arcLengthDivisions=200}function Bc(a,c,e,g,k,r,u,A){Wa.call(this);this.type="EllipseCurve";this.aX=a||0;this.aY=c||0;this.xRadius=e||1;this.yRadius=g||1;this.aStartAngle=k||0;this.aEndAngle=r||2*Math.PI;this.aClockwise=u||!1;this.aRotation=A||0}function gf(a,c,e,g,k,r){Bc.call(this,a,c,e,e,g,k,r);this.type="ArcCurve"}function pi(){var a=0,c=0,e=0,g=0;return{initCatmullRom:function(k, r,u,A,B){k=B*(u-k);A=B*(A-r);a=r;c=k;e=-3*r+3*u-2*k-A;g=2*r-2*u+k+A},initNonuniformCatmullRom:function(k,r,u,A,B,C,H){k=((r-k)/B-(u-k)/(B+C)+(u-r)/C)*C;A=((u-r)/C-(A-r)/(C+H)+(A-u)/H)*C;a=r;c=k;e=-3*r+3*u-2*k-A;g=2*r-2*u+k+A},calc:function(k){var r=k*k;return a+c*k+e*r+g*r*k}}}function lc(a,c,e,g){Wa.call(this);this.type="CatmullRomCurve3";this.points=a||[];this.closed=c||!1;this.curveType=e||"centripetal";this.tension=g||.5}function nl(a,c,e,g,k){c=.5*(g-c);k=.5*(k-e);var r=a*a;return(2*e-2*g+c+ k)*a*r+(-3*e+3*g-2*c-k)*r+c*a+e}function tg(a,c,e,g){var k=1-a;return k*k*c+2*(1-a)*a*e+a*a*g}function ug(a,c,e,g,k){var r=1-a,u=1-a;return r*r*r*c+3*u*u*a*e+3*(1-a)*a*a*g+a*a*a*k}function Pc(a,c,e,g){Wa.call(this);this.type="CubicBezierCurve";this.v0=a||new f;this.v1=c||new f;this.v2=e||new f;this.v3=g||new f}function cd(a,c,e,g){Wa.call(this);this.type="CubicBezierCurve3";this.v0=a||new m;this.v1=c||new m;this.v2=e||new m;this.v3=g||new m}function xc(a,c){Wa.call(this);this.type="LineCurve";this.v1= a||new f;this.v2=c||new f}function Qc(a,c){Wa.call(this);this.type="LineCurve3";this.v1=a||new m;this.v2=c||new m}function Rc(a,c,e){Wa.call(this);this.type="QuadraticBezierCurve";this.v0=a||new f;this.v1=c||new f;this.v2=e||new f}function dd(a,c,e){Wa.call(this);this.type="QuadraticBezierCurve3";this.v0=a||new m;this.v1=c||new m;this.v2=e||new m}function Sc(a){Wa.call(this);this.type="SplineCurve";this.points=a||[]}function xd(){Wa.call(this);this.type="CurvePath";this.curves=[];this.autoClose=!1} function Tc(a){xd.call(this);this.type="Path";this.currentPoint=new f;a&&this.setFromPoints(a)}function Pd(a){Tc.call(this,a);this.uuid=ab.generateUUID();this.type="Shape";this.holes=[]}function Bb(a,c){T.call(this);this.type="Light";this.color=new E(a);this.intensity=void 0!==c?c:1;this.receiveShadow=void 0}function kh(a,c,e){Bb.call(this,a,e);this.type="HemisphereLight";this.castShadow=void 0;this.position.copy(T.DefaultUp);this.updateMatrix();this.groundColor=new E(c)}function re(a){this.camera= a;this.bias=0;this.radius=1;this.mapSize=new f(512,512);this.map=null;this.matrix=new G}function lh(){re.call(this,new Lb(50,1,.5,500))}function mh(a,c,e,g,k,r){Bb.call(this,a,c);this.type="SpotLight";this.position.copy(T.DefaultUp);this.updateMatrix();this.target=new T;Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(u){this.intensity=u/Math.PI}});this.distance=void 0!==e?e:0;this.angle=void 0!==g?g:Math.PI/3;this.penumbra=void 0!==k?k:0;this.decay=void 0!== r?r:1;this.shadow=new lh}function nh(a,c,e,g){Bb.call(this,a,c);this.type="PointLight";Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(k){this.intensity=k/(4*Math.PI)}});this.distance=void 0!==e?e:0;this.decay=void 0!==g?g:1;this.shadow=new re(new Lb(90,1,.5,500))}function vg(a,c,e,g,k,r){Yc.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=void 0!==a?a:-1;this.right=void 0!==c?c:1;this.top=void 0!==e?e:1;this.bottom=void 0!== g?g:-1;this.near=void 0!==k?k:.1;this.far=void 0!==r?r:2E3;this.updateProjectionMatrix()}function oh(){re.call(this,new vg(-5,5,5,-5,.5,500))}function ph(a,c){Bb.call(this,a,c);this.type="DirectionalLight";this.position.copy(T.DefaultUp);this.updateMatrix();this.target=new T;this.shadow=new oh}function qh(a,c){Bb.call(this,a,c);this.type="AmbientLight";this.castShadow=void 0}function rh(a,c,e,g){Bb.call(this,a,c);this.type="RectAreaLight";this.width=void 0!==e?e:10;this.height=void 0!==g?g:10}function sh(a){this.manager= void 0!==a?a:wc;this.textures={}}function qi(a){this.manager=void 0!==a?a:wc}function ri(a){this.manager=void 0!==a?a:wc;this.resourcePath=""}function si(a){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported.");this.manager=void 0!==a?a:wc;this.options=void 0}function ti(){this.type="ShapePath";this.color=new E;this.subPaths=[];this.currentPath= null}function ui(a){this.type="Font";this.data=a}function ol(a){this.manager=void 0!==a?a:wc}function wg(){}function vi(a){this.manager=void 0!==a?a:wc}function th(){this.coefficients=[];for(var a=0;9>a;a++)this.coefficients.push(new m)}function Uc(a,c){Bb.call(this,void 0,c);this.sh=void 0!==a?a:new th}function wi(a,c,e){Uc.call(this,void 0,e);a=(new E).set(a);e=(new E).set(c);c=new m(a.r,a.g,a.b);a=new m(e.r,e.g,e.b);e=Math.sqrt(Math.PI);var g=e*Math.sqrt(.75);this.sh.coefficients[0].copy(c).add(a).multiplyScalar(e); this.sh.coefficients[1].copy(c).sub(a).multiplyScalar(g)}function xi(a,c){Uc.call(this,void 0,c);a=(new E).set(a);this.sh.coefficients[0].set(a.r,a.g,a.b).multiplyScalar(2*Math.sqrt(Math.PI))}function pl(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new Lb;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new Lb;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1}function xg(a,c,e,g){T.call(this);this.type="CubeCamera";var k=new Lb(90, 1,a,c);k.up.set(0,-1,0);k.lookAt(new m(1,0,0));this.add(k);var r=new Lb(90,1,a,c);r.up.set(0,-1,0);r.lookAt(new m(-1,0,0));this.add(r);var u=new Lb(90,1,a,c);u.up.set(0,0,1);u.lookAt(new m(0,1,0));this.add(u);var A=new Lb(90,1,a,c);A.up.set(0,0,-1);A.lookAt(new m(0,-1,0));this.add(A);var B=new Lb(90,1,a,c);B.up.set(0,-1,0);B.lookAt(new m(0,0,1));this.add(B);var C=new Lb(90,1,a,c);C.up.set(0,-1,0);C.lookAt(new m(0,0,-1));this.add(C);g=g||{format:1022,magFilter:1006,minFilter:1006};this.renderTarget= new t(e,e,g);this.renderTarget.texture.name="CubeCamera";this.update=function(H,I){null===this.parent&&this.updateMatrixWorld();var K=H.getRenderTarget(),P=this.renderTarget,O=P.texture.generateMipmaps;P.texture.generateMipmaps=!1;H.setRenderTarget(P,0);H.render(I,k);H.setRenderTarget(P,1);H.render(I,r);H.setRenderTarget(P,2);H.render(I,u);H.setRenderTarget(P,3);H.render(I,A);H.setRenderTarget(P,4);H.render(I,B);P.texture.generateMipmaps=O;H.setRenderTarget(P,5);H.render(I,C);H.setRenderTarget(K)}; this.clear=function(H,I,K,P){for(var O=H.getRenderTarget(),S=this.renderTarget,V=0;6>V;V++)H.setRenderTarget(S,V),H.clear(I,K,P);H.setRenderTarget(O)}}function yi(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function zi(){T.call(this);this.type="AudioListener";this.context=Ai.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0}function hf(a){T.call(this);this.type="Audio"; this.listener=a;this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset=this.startTime=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function Bi(a){hf.call(this,a);this.panner=this.context.createPanner();this.panner.connect(this.gain)}function Ci(a,c){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==c?c:2048; this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function Di(a,c,e){this.binding=a;this.valueSize=e;a=Float64Array;switch(c){case "quaternion":c=this._slerp;break;case "string":case "bool":a=Array;c=this._select;break;default:c=this._lerp}this.buffer=new a(4*e);this._mixBufferRegion=c;this.referenceCount=this.useCount=this.cumulativeWeight=0}function ql(a,c,e){e=e||mc.parseTrackName(c);this._targetGroup=a;this._bindings=a.subscribe_(c,e)}function mc(a, c,e){this.path=c;this.parsedPath=e||mc.parseTrackName(c);this.node=mc.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function rl(){this.uuid=ab.generateUUID();this._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var c=0,e=arguments.length;c!==e;++c)a[arguments[c].uuid]=c;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var g=this;this.stats={objects:{get total(){return g._objects.length},get inUse(){return this.total- g.nCachedObjects_}},get bindingsPerObject(){return g._bindings.length}}}function sl(a,c,e){this._mixer=a;this._clip=c;this._localRoot=e||null;a=c.tracks;c=a.length;e=Array(c);for(var g={endingStart:2400,endingEnd:2400},k=0;k!==c;++k){var r=a[k].createInterpolant(null);e[k]=r;r.settings=g}this._interpolantSettings=g;this._interpolants=e;this._propertyBindings=Array(c);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null;this.loop=2201;this._loopCount=-1;this._startTime= null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0}function Ei(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function uh(a,c){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=c);this.value=a}function Fi(){za.call(this);this.type="InstancedBufferGeometry"; this.maxInstancedCount=void 0}function Gi(a,c,e){ce.call(this,a,c);this.meshPerAttribute=e||1}function Hi(a,c,e,g){"number"===typeof e&&(g=e,e=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument."));ma.call(this,a,c,e);this.meshPerAttribute=g||1}function tl(a,c,e,g){this.ray=new Zd(a,c);this.near=e||0;this.far=g||Infinity;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."); return this.Points}}})}function ul(a,c){return a.distance-c.distance}function Ii(a,c,e,g){if(!1!==a.visible&&(a.raycast(c,e),!0===g)){a=a.children;g=0;for(var k=a.length;g<k;g++)Ii(a[g],c,e,!0)}}function vl(a,c,e){this.radius=void 0!==a?a:1;this.phi=void 0!==c?c:0;this.theta=void 0!==e?e:0;return this}function wl(a,c,e){this.radius=void 0!==a?a:1;this.theta=void 0!==c?c:0;this.y=void 0!==e?e:0;return this}function Ji(a,c){this.min=void 0!==a?a:new f(Infinity,Infinity);this.max=void 0!==c?c:new f(-Infinity, -Infinity)}function Ki(a,c){this.start=void 0!==a?a:new m;this.end=void 0!==c?c:new m}function yg(a){T.call(this);this.material=a;this.render=function(){}}function zg(a,c,e,g){this.object=a;this.size=void 0!==c?c:1;a=void 0!==e?e:16711680;g=void 0!==g?g:1;c=0;(e=this.object.geometry)&&e.isGeometry?c=3*e.faces.length:e&&e.isBufferGeometry&&(c=e.attributes.normal.count);e=new za;c=new qa(6*c,3);e.addAttribute("position",c);Ab.call(this,e,new ub({color:a,linewidth:g}));this.matrixAutoUpdate=!1;this.update()} function jf(a,c){T.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=c;a=new za;c=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(var e=0,g=1;32>e;e++,g++){var k=e/32*Math.PI*2,r=g/32*Math.PI*2;c.push(Math.cos(k),Math.sin(k),1,Math.cos(r),Math.sin(r),1)}a.addAttribute("position",new qa(c,3));c=new ub({fog:!1});this.cone=new Ab(a,c);this.add(this.cone);this.update()}function xl(a){var c=[];a&&a.isBone&&c.push(a); for(var e=0;e<a.children.length;e++)c.push.apply(c,xl(a.children[e]));return c}function kf(a){for(var c=xl(a),e=new za,g=[],k=[],r=new E(0,0,1),u=new E(0,1,0),A=0;A<c.length;A++){var B=c[A];B.parent&&B.parent.isBone&&(g.push(0,0,0),g.push(0,0,0),k.push(r.r,r.g,r.b),k.push(u.r,u.g,u.b))}e.addAttribute("position",new qa(g,3));e.addAttribute("color",new qa(k,3));g=new ub({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Ab.call(this,e,g);this.root=a;this.bones=c;this.matrix=a.matrixWorld;this.matrixAutoUpdate= !1}function lf(a,c,e){this.light=a;this.light.updateMatrixWorld();this.color=e;a=new Od(c,4,2);c=new zc({wireframe:!0,fog:!1});cc.call(this,a,c);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1;this.update()}function mf(a,c){this.type="RectAreaLightHelper";this.light=a;this.color=c;a=new za;a.addAttribute("position",new qa([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3));a.computeBoundingSphere();c=new ub({fog:!1});fc.call(this,a,c);a=new za;a.addAttribute("position",new qa([1,1,0,-1,1,0,-1,-1, 0,1,1,0,-1,-1,0,1,-1,0],3));a.computeBoundingSphere();this.add(new cc(a,new zc({side:1,fog:!1})));this.update()}function nf(a,c,e){T.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=e;a=new de(c);a.rotateY(.5*Math.PI);this.material=new zc({wireframe:!0,fog:!1});void 0===this.color&&(this.material.vertexColors=2);c=a.getAttribute("position");a.addAttribute("color",new ma(new Float32Array(3*c.count),3));this.add(new cc(a,this.material)); this.update()}function of(a,c){this.lightProbe=a;this.size=c;a=new tc({defines:{GAMMA_OUTPUT:""},uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:"varying vec3 vNormal;\nvoid main() {\n\tvNormal \x3d normalize( normalMatrix * normal );\n\tgl_Position \x3d projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"#define RECIPROCAL_PI 0.318309886\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n\t// matrix is assumed to be orthogonal\n\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n}\nvec3 linearToOutput( in vec3 a ) {\n\t#ifdef GAMMA_OUTPUT\n\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n\t#else\n\t\treturn a;\n\t#endif\n}\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\t// normal is assumed to have unit length\n\tfloat x \x3d normal.x, y \x3d normal.y, z \x3d normal.z;\n\t// band 0\n\tvec3 result \x3d shCoefficients[ 0 ] * 0.886227;\n\t// band 1\n\tresult +\x3d shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult +\x3d shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult +\x3d shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\t// band 2\n\tresult +\x3d shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult +\x3d shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult +\x3d shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult +\x3d shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult +\x3d shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nuniform vec3 sh[ 9 ]; // sh coefficients\nuniform float intensity; // light probe intensity\nvarying vec3 vNormal;\nvoid main() {\n\tvec3 normal \x3d normalize( vNormal );\n\tvec3 worldNormal \x3d inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance \x3d shGetIrradianceAt( worldNormal, sh );\n\tvec3 outgoingLight \x3d RECIPROCAL_PI * irradiance * intensity;\n\toutgoingLight \x3d linearToOutput( outgoingLight );\n\tgl_FragColor \x3d vec4( outgoingLight, 1.0 );\n}"}); c=new Od(1,32,16);cc.call(this,c,a);this.onBeforeRender()}function vh(a,c,e,g){a=a||10;c=c||10;e=new E(void 0!==e?e:4473924);g=new E(void 0!==g?g:8947848);var k=c/2,r=a/c,u=a/2;a=[];for(var A=[],B=0,C=0,H=-u;B<=c;B++,H+=r){a.push(-u,0,H,u,0,H);a.push(H,0,-u,H,0,u);var I=B===k?e:g;I.toArray(A,C);C+=3;I.toArray(A,C);C+=3;I.toArray(A,C);C+=3;I.toArray(A,C);C+=3}c=new za;c.addAttribute("position",new qa(a,3));c.addAttribute("color",new qa(A,3));e=new ub({vertexColors:2});Ab.call(this,c,e)}function wh(a, c,e,g,k,r){a=a||10;c=c||16;e=e||8;g=g||64;k=new E(void 0!==k?k:4473924);r=new E(void 0!==r?r:8947848);var u=[],A=[],B;for(B=0;B<=c;B++){var C=B/c*2*Math.PI;var H=Math.sin(C)*a;C=Math.cos(C)*a;u.push(0,0,0);u.push(H,0,C);var I=B&1?k:r;A.push(I.r,I.g,I.b);A.push(I.r,I.g,I.b)}for(B=0;B<=e;B++){I=B&1?k:r;var K=a-a/e*B;for(c=0;c<g;c++)C=c/g*2*Math.PI,H=Math.sin(C)*K,C=Math.cos(C)*K,u.push(H,0,C),A.push(I.r,I.g,I.b),C=(c+1)/g*2*Math.PI,H=Math.sin(C)*K,C=Math.cos(C)*K,u.push(H,0,C),A.push(I.r,I.g,I.b)}a= new za;a.addAttribute("position",new qa(u,3));a.addAttribute("color",new qa(A,3));u=new ub({vertexColors:2});Ab.call(this,a,u)}function pf(a,c,e,g){this.audio=a;this.range=c||1;this.divisionsInnerAngle=e||16;this.divisionsOuterAngle=g||2;a=new za;a.addAttribute("position",new ma(new Float32Array(3*(3*(this.divisionsInnerAngle+2*this.divisionsOuterAngle)+3)),3));c=new ub({color:65280});e=new ub({color:16776960});fc.call(this,a,[e,c]);this.update()}function Ag(a,c,e,g){this.object=a;this.size=void 0!== c?c:1;a=void 0!==e?e:16776960;g=void 0!==g?g:1;c=0;(e=this.object.geometry)&&e.isGeometry?c=e.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");e=new za;c=new qa(6*c,3);e.addAttribute("position",c);Ab.call(this,e,new ub({color:a,linewidth:g}));this.matrixAutoUpdate=!1;this.update()}function qf(a,c,e){T.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=e; void 0===c&&(c=1);a=new za;a.addAttribute("position",new qa([-c,c,0,c,c,0,c,-c,0,-c,-c,0,-c,c,0],3));c=new ub({fog:!1});this.lightPlane=new fc(a,c);this.add(this.lightPlane);a=new za;a.addAttribute("position",new qa([0,0,0,0,0,1],3));this.targetLine=new fc(a,c);this.add(this.targetLine);this.update()}function Bg(a){function c(P,O,S){e(P,S);e(O,S)}function e(P,O){r.push(0,0,0);u.push(O.r,O.g,O.b);void 0===A[P]&&(A[P]=[]);A[P].push(r.length/3-1)}var g=new za,k=new ub({color:16777215,vertexColors:1}), r=[],u=[],A={},B=new E(16755200),C=new E(16711680),H=new E(43775),I=new E(16777215),K=new E(3355443);c("n1","n2",B);c("n2","n4",B);c("n4","n3",B);c("n3","n1",B);c("f1","f2",B);c("f2","f4",B);c("f4","f3",B);c("f3","f1",B);c("n1","f1",B);c("n2","f2",B);c("n3","f3",B);c("n4","f4",B);c("p","n1",C);c("p","n2",C);c("p","n3",C);c("p","n4",C);c("u1","u2",H);c("u2","u3",H);c("u3","u1",H);c("c","t",I);c("p","c",K);c("cn1","cn2",K);c("cn3","cn4",K);c("cf1","cf2",K);c("cf3","cf4",K);g.addAttribute("position", new qa(r,3));g.addAttribute("color",new qa(u,3));Ab.call(this,g,k);this.camera=a;this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=A;this.update()}function yd(a,c){this.object=a;void 0===c&&(c=16776960);a=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);var e=new Float32Array(24),g=new za;g.setIndex(new ma(a,1));g.addAttribute("position",new ma(e,3));Ab.call(this,g,new ub({color:c}));this.matrixAutoUpdate= !1;this.update()}function Cg(a,c){this.type="Box3Helper";this.box=a;a=void 0!==c?c:16776960;c=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);var e=new za;e.setIndex(new ma(c,1));e.addAttribute("position",new qa([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3));Ab.call(this,e,new ub({color:a}));this.geometry.computeBoundingSphere()}function Dg(a,c,e){this.type="PlaneHelper";this.plane=a;this.size=void 0===c?1:c;a=void 0!==e?e:16776960;c=new za;c.addAttribute("position", new qa([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3));c.computeBoundingSphere();fc.call(this,c,new ub({color:a}));c=new za;c.addAttribute("position",new qa([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3));c.computeBoundingSphere();this.add(new cc(c,new zc({color:a,opacity:.2,transparent:!0,depthWrite:!1})))}function zd(a,c,e,g,k,r){T.call(this);void 0===a&&(a=new m(0,0,1));void 0===c&&(c=new m(0,0,0));void 0===e&&(e=1);void 0===g&&(g=16776960);void 0===k&&(k=.2*e);void 0=== r&&(r=.2*k);void 0===xh&&(xh=new za,xh.addAttribute("position",new qa([0,0,0,0,1,0],3)),Li=new wd(0,.5,1,5,1),Li.translate(0,-.5,0));this.position.copy(c);this.line=new fc(xh,new ub({color:g}));this.line.matrixAutoUpdate=!1;this.add(this.line);this.cone=new cc(Li,new zc({color:g}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(a);this.setLength(e,k,r)}function Eg(a){a=a||1;var c=[0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a];a=new za;a.addAttribute("position",new qa(c,3));a.addAttribute("color", new qa([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));c=new ub({vertexColors:2});Ab.call(this,a,c)}function yl(a){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.");lc.call(this,a);this.type="catmullrom";this.closed=!0}function zl(a){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.");lc.call(this,a);this.type="catmullrom"}function Mi(a){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."); lc.call(this,a);this.type="catmullrom"}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52));void 0===Number.isInteger&&(Number.isInteger=function(a){return"number"===typeof a&&isFinite(a)&&Math.floor(a)===a});void 0===Math.sign&&(Math.sign=function(a){return 0>a?-1:0<a?1:+a});!1==="name"in Function.prototype&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}});void 0===Object.assign&&function(){Object.assign=function(a){if(void 0=== a||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var c=Object(a),e=1;e<arguments.length;e++){var g=arguments[e];if(void 0!==g&&null!==g)for(var k in g)Object.prototype.hasOwnProperty.call(g,k)&&(c[k]=g[k])}return c}}();Object.assign(d.prototype,{addEventListener:function(a,c){void 0===this._listeners&&(this._listeners={});var e=this._listeners;void 0===e[a]&&(e[a]=[]);-1===e[a].indexOf(c)&&e[a].push(c)},hasEventListener:function(a,c){if(void 0===this._listeners)return!1; var e=this._listeners;return void 0!==e[a]&&-1!==e[a].indexOf(c)},removeEventListener:function(a,c){void 0!==this._listeners&&(a=this._listeners[a],void 0!==a&&(c=a.indexOf(c),-1!==c&&a.splice(c,1)))},dispatchEvent:function(a){if(void 0!==this._listeners){var c=this._listeners[a.type];if(void 0!==c){a.target=this;c=c.slice(0);for(var e=0,g=c.length;e<g;e++)c[e].call(this,a)}}}});var ab={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var a=[],c=0;256>c;c++)a[c]=(16>c?"0":"")+c.toString(16); return function(){var e=4294967295*Math.random()|0,g=4294967295*Math.random()|0,k=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(a[e&255]+a[e>>8&255]+a[e>>16&255]+a[e>>24&255]+"-"+a[g&255]+a[g>>8&255]+"-"+a[g>>16&15|64]+a[g>>24&255]+"-"+a[k&63|128]+a[k>>8&255]+"-"+a[k>>16&255]+a[k>>24&255]+a[r&255]+a[r>>8&255]+a[r>>16&255]+a[r>>24&255]).toUpperCase()}}(),clamp:function(a,c,e){return Math.max(c,Math.min(e,a))},euclideanModulo:function(a,c){return(a%c+c)%c},mapLinear:function(a,c,e, g,k){return g+(a-c)*(k-g)/(e-c)},lerp:function(a,c,e){return(1-e)*a+e*c},smoothstep:function(a,c,e){if(a<=c)return 0;if(a>=e)return 1;a=(a-c)/(e-c);return a*a*(3-2*a)},smootherstep:function(a,c,e){if(a<=c)return 0;if(a>=e)return 1;a=(a-c)/(e-c);return a*a*a*(a*(6*a-15)+10)},randInt:function(a,c){return a+Math.floor(Math.random()*(c-a+1))},randFloat:function(a,c){return a+Math.random()*(c-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(a){return a*ab.DEG2RAD},radToDeg:function(a){return a* ab.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(f.prototype,{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(f.prototype,{isVector2:!0,set:function(a,c){this.x=a;this.y=c;return this},setScalar:function(a){this.y= this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,c){switch(a){case 0:this.x=c;break;case 1:this.y=c;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a, c){if(void 0!==c)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,c);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;return this},addScaledVector:function(a,c){this.x+=a.x*c;this.y+=a.y*c;return this},sub:function(a,c){if(void 0!==c)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(a,c);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},subVectors:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},applyMatrix3:function(a){var c=this.x,e=this.y;a=a.elements;this.x=a[0]*c+a[3]*e+a[6];this.y= a[1]*c+a[4]*e+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);return this},clamp:function(a,c){this.x=Math.max(a.x,Math.min(c.x,this.x));this.y=Math.max(a.y,Math.min(c.y,this.y));return this},clampScalar:function(a,c){this.x=Math.max(a,Math.min(c,this.x));this.y=Math.max(a,Math.min(c,this.y));return this},clampLength:function(a,c){var e=this.length();return this.divideScalar(e|| 1).multiplyScalar(Math.max(a,Math.min(c,e)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){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);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x* a.x+this.y*a.y},cross:function(a){return this.x*a.y-this.y*a.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var a=Math.atan2(this.y,this.x);0>a&&(a+=2*Math.PI);return a},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var c= this.x-a.x;a=this.y-a.y;return c*c+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,c){this.x+=(a.x-this.x)*c;this.y+=(a.y-this.y)*c;return this},lerpVectors:function(a,c,e){return this.subVectors(c,a).multiplyScalar(e).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,c){void 0===c&&(c=0);this.x=a[c];this.y=a[c+1];return this},toArray:function(a, c){void 0===a&&(a=[]);void 0===c&&(c=0);a[c]=this.x;a[c+1]=this.y;return a},fromBufferAttribute:function(a,c,e){void 0!==e&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute().");this.x=a.getX(c);this.y=a.getY(c);return this},rotateAround:function(a,c){var e=Math.cos(c);c=Math.sin(c);var g=this.x-a.x,k=this.y-a.y;this.x=g*e-k*c+a.x;this.y=g*c+k*e+a.y;return this}});Object.assign(h,{slerp:function(a,c,e,g){return e.copy(a).slerp(c,g)},slerpFlat:function(a,c,e,g,k,r,u){var A= e[g+0],B=e[g+1],C=e[g+2];e=e[g+3];g=k[r+0];var H=k[r+1],I=k[r+2];k=k[r+3];if(e!==k||A!==g||B!==H||C!==I){r=1-u;var K=A*g+B*H+C*I+e*k,P=0<=K?1:-1,O=1-K*K;O>Number.EPSILON&&(O=Math.sqrt(O),K=Math.atan2(O,K*P),r=Math.sin(r*K)/O,u=Math.sin(u*K)/O);P*=u;A=A*r+g*P;B=B*r+H*P;C=C*r+I*P;e=e*r+k*P;r===1-u&&(u=1/Math.sqrt(A*A+B*B+C*C+e*e),A*=u,B*=u,C*=u,e*=u)}a[c]=A;a[c+1]=B;a[c+2]=C;a[c+3]=e}});Object.defineProperties(h.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}}, y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this.onChangeCallback()}}});Object.assign(h.prototype,{isQuaternion:!0,set:function(a,c,e,g){this._x=a;this._y=c;this._z=e;this._w=g;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x= a.x;this._y=a.y;this._z=a.z;this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,c){if(!a||!a.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var e=a._x,g=a._y,k=a._z;a=a.order;var r=Math.cos,u=Math.sin,A=r(e/2),B=r(g/2);r=r(k/2);e=u(e/2);g=u(g/2);k=u(k/2);"XYZ"===a?(this._x=e*B*r+A*g*k,this._y=A*g*r-e*B*k,this._z=A*B*k+e*g*r,this._w=A*B*r-e*g*k):"YXZ"===a?(this._x=e*B*r+A*g*k,this._y=A*g*r-e*B*k,this._z=A* B*k-e*g*r,this._w=A*B*r+e*g*k):"ZXY"===a?(this._x=e*B*r-A*g*k,this._y=A*g*r+e*B*k,this._z=A*B*k+e*g*r,this._w=A*B*r-e*g*k):"ZYX"===a?(this._x=e*B*r-A*g*k,this._y=A*g*r+e*B*k,this._z=A*B*k-e*g*r,this._w=A*B*r+e*g*k):"YZX"===a?(this._x=e*B*r+A*g*k,this._y=A*g*r+e*B*k,this._z=A*B*k-e*g*r,this._w=A*B*r-e*g*k):"XZY"===a&&(this._x=e*B*r-A*g*k,this._y=A*g*r-e*B*k,this._z=A*B*k+e*g*r,this._w=A*B*r+e*g*k);if(!1!==c)this.onChangeCallback();return this},setFromAxisAngle:function(a,c){c/=2;var e=Math.sin(c); this._x=a.x*e;this._y=a.y*e;this._z=a.z*e;this._w=Math.cos(c);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var c=a.elements,e=c[0];a=c[4];var g=c[8],k=c[1],r=c[5],u=c[9],A=c[2],B=c[6];c=c[10];var C=e+r+c;0<C?(e=.5/Math.sqrt(C+1),this._w=.25/e,this._x=(B-u)*e,this._y=(g-A)*e,this._z=(k-a)*e):e>r&&e>c?(e=2*Math.sqrt(1+e-r-c),this._w=(B-u)/e,this._x=.25*e,this._y=(a+k)/e,this._z=(g+A)/e):r>c?(e=2*Math.sqrt(1+r-e-c),this._w=(g-A)/e,this._x=(a+k)/e,this._y=.25*e,this._z=(u+B)/ e):(e=2*Math.sqrt(1+c-e-r),this._w=(k-a)/e,this._x=(g+A)/e,this._y=(u+B)/e,this._z=.25*e);this.onChangeCallback();return this},setFromUnitVectors:function(a,c){var e=a.dot(c)+1;1E-6>e?(e=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x=a.y*c.z-a.z*c.y,this._y=a.z*c.x-a.x*c.z,this._z=a.x*c.y-a.y*c.x);this._w=e;return this.normalize()},angleTo:function(a){return 2*Math.acos(Math.abs(ab.clamp(this.dot(a),-1,1)))},rotateTowards:function(a, c){var e=this.angleTo(a);if(0===e)return this;this.slerp(a,Math.min(1,c/e));return this},inverse:function(){return this.conjugate()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._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 a= this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},multiply:function(a,c){return void 0!==c?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,c)):this.multiplyQuaternions(this,a)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a,c){var e=a._x,g=a._y,k=a._z;a=a._w; var r=c._x,u=c._y,A=c._z;c=c._w;this._x=e*c+a*r+g*A-k*u;this._y=g*c+a*u+k*r-e*A;this._z=k*c+a*A+e*u-g*r;this._w=a*c-e*r-g*u-k*A;this.onChangeCallback();return this},slerp:function(a,c){if(0===c)return this;if(1===c)return this.copy(a);var e=this._x,g=this._y,k=this._z,r=this._w,u=r*a._w+e*a._x+g*a._y+k*a._z;0>u?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,u=-u):this.copy(a);if(1<=u)return this._w=r,this._x=e,this._y=g,this._z=k,this;a=1-u*u;if(a<=Number.EPSILON)return u=1-c,this._w=u* r+c*this._w,this._x=u*e+c*this._x,this._y=u*g+c*this._y,this._z=u*k+c*this._z,this.normalize();a=Math.sqrt(a);var A=Math.atan2(a,u);u=Math.sin((1-c)*A)/a;c=Math.sin(c*A)/a;this._w=r*u+this._w*c;this._x=e*u+this._x*c;this._y=g*u+this._y*c;this._z=k*u+this._z*c;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,c){void 0===c&&(c=0);this._x=a[c];this._y=a[c+1];this._z=a[c+2];this._w=a[c+3];this.onChangeCallback(); return this},toArray:function(a,c){void 0===a&&(a=[]);void 0===c&&(c=0);a[c]=this._x;a[c+1]=this._y;a[c+2]=this._z;a[c+3]=this._w;return a},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(m.prototype,{isVector3:!0,set:function(a,c,e){this.x=a;this.y=c;this.z=e;return this},setScalar:function(a){this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this}, setComponent:function(a,c){switch(a){case 0:this.x=c;break;case 1:this.y=c;break;case 2:this.z=c;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,c){if(void 0!==c)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(a,c);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;this.z=a.z+c.z;return this},addScaledVector:function(a,c){this.x+=a.x*c;this.y+=a.y*c;this.z+=a.z*c;return this},sub:function(a,c){if(void 0!==c)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,c);this.x-=a.x;this.y-=a.y;this.z-=a.z; return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;this.z=a.z-c.z;return this},multiply:function(a,c){if(void 0!==c)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,c);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,c){this.x=a.x* c.x;this.y=a.y*c.y;this.z=a.z*c.z;return this},applyEuler:function(){var a=new h;return function(c){c&&c.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(a.setFromEuler(c))}}(),applyAxisAngle:function(){var a=new h;return function(c,e){return this.applyQuaternion(a.setFromAxisAngle(c,e))}}(),applyMatrix3:function(a){var c=this.x,e=this.y,g=this.z;a=a.elements;this.x=a[0]*c+a[3]*e+a[6]*g;this.y=a[1]*c+ a[4]*e+a[7]*g;this.z=a[2]*c+a[5]*e+a[8]*g;return this},applyMatrix4:function(a){var c=this.x,e=this.y,g=this.z;a=a.elements;var k=1/(a[3]*c+a[7]*e+a[11]*g+a[15]);this.x=(a[0]*c+a[4]*e+a[8]*g+a[12])*k;this.y=(a[1]*c+a[5]*e+a[9]*g+a[13])*k;this.z=(a[2]*c+a[6]*e+a[10]*g+a[14])*k;return this},applyQuaternion:function(a){var c=this.x,e=this.y,g=this.z,k=a.x,r=a.y,u=a.z;a=a.w;var A=a*c+r*g-u*e,B=a*e+u*c-k*g,C=a*g+k*e-r*c;c=-k*c-r*e-u*g;this.x=A*a+c*-k+B*-u-C*-r;this.y=B*a+c*-r+C*-k-A*-u;this.z=C*a+c*-u+ A*-r-B*-k;return this},project:function(a){return this.applyMatrix4(a.matrixWorldInverse).applyMatrix4(a.projectionMatrix)},unproject:function(a){return this.applyMatrix4(a.projectionMatrixInverse).applyMatrix4(a.matrixWorld)},transformDirection:function(a){var c=this.x,e=this.y,g=this.z;a=a.elements;this.x=a[0]*c+a[4]*e+a[8]*g;this.y=a[1]*c+a[5]*e+a[9]*g;this.z=a[2]*c+a[6]*e+a[10]*g;return this.normalize()},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){return this.multiplyScalar(1/ a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);return this},clamp:function(a,c){this.x=Math.max(a.x,Math.min(c.x,this.x));this.y=Math.max(a.y,Math.min(c.y,this.y));this.z=Math.max(a.z,Math.min(c.z,this.z));return this},clampScalar:function(a,c){this.x=Math.max(a,Math.min(c,this.x));this.y=Math.max(a,Math.min(c,this.y));this.z=Math.max(a, Math.min(c,this.z));return this},clampLength:function(a,c){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(a,Math.min(c,e)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){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);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+ Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,c){this.x+=(a.x-this.x)*c;this.y+=(a.y-this.y)*c;this.z+=(a.z-this.z)*c;return this},lerpVectors:function(a,c,e){return this.subVectors(c,a).multiplyScalar(e).add(a)},cross:function(a,c){return void 0!==c?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,c)):this.crossVectors(this, a)},crossVectors:function(a,c){var e=a.x,g=a.y;a=a.z;var k=c.x,r=c.y;c=c.z;this.x=g*c-a*r;this.y=a*k-e*c;this.z=e*r-g*k;return this},projectOnVector:function(a){var c=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(c)},projectOnPlane:function(){var a=new m;return function(c){a.copy(this).projectOnVector(c);return this.sub(a)}}(),reflect:function(){var a=new m;return function(c){return this.sub(a.copy(c).multiplyScalar(2*this.dot(c)))}}(),angleTo:function(a){return Math.acos(ab.clamp(this.dot(a)/ Math.sqrt(this.lengthSq()*a.lengthSq()),-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var c=this.x-a.x,e=this.y-a.y;a=this.z-a.z;return c*c+e*e+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z-a.z)},setFromSpherical:function(a){return this.setFromSphericalCoords(a.radius,a.phi,a.theta)},setFromSphericalCoords:function(a,c,e){var g=Math.sin(c)*a;this.x=g*Math.sin(e);this.y=Math.cos(c)*a; this.z=g*Math.cos(e);return this},setFromCylindrical:function(a){return this.setFromCylindricalCoords(a.radius,a.theta,a.y)},setFromCylindricalCoords:function(a,c,e){this.x=a*Math.sin(c);this.y=e;this.z=a*Math.cos(c);return this},setFromMatrixPosition:function(a){a=a.elements;this.x=a[12];this.y=a[13];this.z=a[14];return this},setFromMatrixScale:function(a){var c=this.setFromMatrixColumn(a,0).length(),e=this.setFromMatrixColumn(a,1).length();a=this.setFromMatrixColumn(a,2).length();this.x=c;this.y= e;this.z=a;return this},setFromMatrixColumn:function(a,c){return this.fromArray(a.elements,4*c)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,c){void 0===c&&(c=0);this.x=a[c];this.y=a[c+1];this.z=a[c+2];return this},toArray:function(a,c){void 0===a&&(a=[]);void 0===c&&(c=0);a[c]=this.x;a[c+1]=this.y;a[c+2]=this.z;return a},fromBufferAttribute:function(a,c,e){void 0!==e&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."); this.x=a.getX(c);this.y=a.getY(c);this.z=a.getZ(c);return this}});Object.assign(w.prototype,{isMatrix3:!0,set:function(a,c,e,g,k,r,u,A,B){var C=this.elements;C[0]=a;C[1]=g;C[2]=u;C[3]=c;C[4]=k;C[5]=A;C[6]=e;C[7]=r;C[8]=B;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(a){var c=this.elements;a=a.elements;c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];c[4]=a[4];c[5]=a[5];c[6]=a[6];c[7]=a[7];c[8]= a[8];return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this},applyToBufferAttribute:function(){var a=new m;return function(c){for(var e=0,g=c.count;e<g;e++)a.x=c.getX(e),a.y=c.getY(e),a.z=c.getZ(e),a.applyMatrix3(this),c.setXYZ(e,a.x,a.y,a.z);return c}}(),multiply:function(a){return this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,c){var e=a.elements,g=c.elements; c=this.elements;a=e[0];var k=e[3],r=e[6],u=e[1],A=e[4],B=e[7],C=e[2],H=e[5];e=e[8];var I=g[0],K=g[3],P=g[6],O=g[1],S=g[4],V=g[7],ca=g[2],ha=g[5];g=g[8];c[0]=a*I+k*O+r*ca;c[3]=a*K+k*S+r*ha;c[6]=a*P+k*V+r*g;c[1]=u*I+A*O+B*ca;c[4]=u*K+A*S+B*ha;c[7]=u*P+A*V+B*g;c[2]=C*I+H*O+e*ca;c[5]=C*K+H*S+e*ha;c[8]=C*P+H*V+e*g;return this},multiplyScalar:function(a){var c=this.elements;c[0]*=a;c[3]*=a;c[6]*=a;c[1]*=a;c[4]*=a;c[7]*=a;c[2]*=a;c[5]*=a;c[8]*=a;return this},determinant:function(){var a=this.elements,c= a[0],e=a[1],g=a[2],k=a[3],r=a[4],u=a[5],A=a[6],B=a[7];a=a[8];return c*r*a-c*u*B-e*k*a+e*u*A+g*k*B-g*r*A},getInverse:function(a,c){a&&a.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var e=a.elements;a=this.elements;var g=e[0],k=e[1],r=e[2],u=e[3],A=e[4],B=e[5],C=e[6],H=e[7];e=e[8];var I=e*A-B*H,K=B*C-e*u,P=H*u-A*C,O=g*I+k*K+r*P;if(0===O){if(!0===c)throw Error("THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0");console.warn("THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0"); return this.identity()}c=1/O;a[0]=I*c;a[1]=(r*H-e*k)*c;a[2]=(B*k-r*A)*c;a[3]=K*c;a[4]=(e*g-r*C)*c;a[5]=(r*u-B*g)*c;a[6]=P*c;a[7]=(k*C-H*g)*c;a[8]=(A*g-k*u)*c;return this},transpose:function(){var a=this.elements;var c=a[1];a[1]=a[3];a[3]=c;c=a[2];a[2]=a[6];a[6]=c;c=a[5];a[5]=a[7];a[7]=c;return this},getNormalMatrix:function(a){return this.setFromMatrix4(a).getInverse(this).transpose()},transposeIntoArray:function(a){var c=this.elements;a[0]=c[0];a[1]=c[3];a[2]=c[6];a[3]=c[1];a[4]=c[4];a[5]=c[7];a[6]= c[2];a[7]=c[5];a[8]=c[8];return this},setUvTransform:function(a,c,e,g,k,r,u){var A=Math.cos(k);k=Math.sin(k);this.set(e*A,e*k,-e*(A*r+k*u)+r+a,-g*k,g*A,-g*(-k*r+A*u)+u+c,0,0,1)},scale:function(a,c){var e=this.elements;e[0]*=a;e[3]*=a;e[6]*=a;e[1]*=c;e[4]*=c;e[7]*=c;return this},rotate:function(a){var c=Math.cos(a);a=Math.sin(a);var e=this.elements,g=e[0],k=e[3],r=e[6],u=e[1],A=e[4],B=e[7];e[0]=c*g+a*u;e[3]=c*k+a*A;e[6]=c*r+a*B;e[1]=-a*g+c*u;e[4]=-a*k+c*A;e[7]=-a*r+c*B;return this},translate:function(a, c){var e=this.elements;e[0]+=a*e[2];e[3]+=a*e[5];e[6]+=a*e[8];e[1]+=c*e[2];e[4]+=c*e[5];e[7]+=c*e[8];return this},equals:function(a){var c=this.elements;a=a.elements;for(var e=0;9>e;e++)if(c[e]!==a[e])return!1;return!0},fromArray:function(a,c){void 0===c&&(c=0);for(var e=0;9>e;e++)this.elements[e]=a[e+c];return this},toArray:function(a,c){void 0===a&&(a=[]);void 0===c&&(c=0);var e=this.elements;a[c]=e[0];a[c+1]=e[1];a[c+2]=e[2];a[c+3]=e[3];a[c+4]=e[4];a[c+5]=e[5];a[c+6]=e[6];a[c+7]=e[7];a[c+8]=e[8]; return a}});var rf,Qd={getDataURL:function(a){if("undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===rf&&(rf=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"));rf.width=a.width;rf.height=a.height;var c=rf.getContext("2d");a instanceof ImageData?c.putImageData(a,0,0):c.drawImage(a,0,0,a.width,a.height);a=rf}return 2048<a.width||2048<a.height?a.toDataURL("image/jpeg",.6):a.toDataURL("image/png")}},In=0;l.DEFAULT_IMAGE=void 0;l.DEFAULT_MAPPING= 300;l.prototype=Object.assign(Object.create(d.prototype),{constructor:l,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.name=a.name;this.image=a.image;this.mipmaps=a.mipmaps.slice(0);this.mapping=a.mapping;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy= a.anisotropy;this.format=a.format;this.type=a.type;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.center.copy(a.center);this.rotation=a.rotation;this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrix.copy(a.matrix);this.generateMipmaps=a.generateMipmaps;this.premultiplyAlpha=a.premultiplyAlpha;this.flipY=a.flipY;this.unpackAlignment=a.unpackAlignment;this.encoding=a.encoding;return this},toJSON:function(a){var c=void 0===a||"string"===typeof a;if(!c&&void 0!==a.textures[this.uuid])return a.textures[this.uuid]; var e={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment}; if(void 0!==this.image){var g=this.image;void 0===g.uuid&&(g.uuid=ab.generateUUID());if(!c&&void 0===a.images[g.uuid]){if(Array.isArray(g)){var k=[];for(var r=0,u=g.length;r<u;r++)k.push(Qd.getDataURL(g[r]))}else k=Qd.getDataURL(g);a.images[g.uuid]={uuid:g.uuid,url:k}}e.image=g.uuid}c||(a.textures[this.uuid]=e);return e},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(a){if(300!==this.mapping)return a;a.applyMatrix3(this.matrix);if(0>a.x||1<a.x)switch(this.wrapS){case 1E3:a.x-= Math.floor(a.x);break;case 1001:a.x=0>a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0>a.y||1<a.y)switch(this.wrapT){case 1E3:a.y-=Math.floor(a.y);break;case 1001:a.y=0>a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y);return a}});Object.defineProperty(l.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(p.prototype,{isVector4:!0,set:function(a, c,e,g){this.x=a;this.y=c;this.z=e;this.w=g;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,c){switch(a){case 0:this.x=c;break;case 1:this.y=c;break;case 2:this.z=c;break;case 3:this.w=c;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){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: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,c){if(void 0!==c)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,c);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this}, addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;this.z=a.z+c.z;this.w=a.w+c.w;return this},addScaledVector:function(a,c){this.x+=a.x*c;this.y+=a.y*c;this.z+=a.z*c;this.w+=a.w*c;return this},sub:function(a,c){if(void 0!==c)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,c);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-= a;this.y-=a;this.z-=a;this.w-=a;return this},subVectors:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;this.z=a.z-c.z;this.w=a.w-c.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var c=this.x,e=this.y,g=this.z,k=this.w;a=a.elements;this.x=a[0]*c+a[4]*e+a[8]*g+a[12]*k;this.y=a[1]*c+a[5]*e+a[9]*g+a[13]*k;this.z=a[2]*c+a[6]*e+a[10]*g+a[14]*k;this.w=a[3]*c+a[7]*e+a[11]*g+a[15]*k;return this},divideScalar:function(a){return this.multiplyScalar(1/ a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var c=Math.sqrt(1-a.w*a.w);1E-4>c?(this.x=1,this.z=this.y=0):(this.x=a.x/c,this.y=a.y/c,this.z=a.z/c);return this},setAxisAngleFromRotationMatrix:function(a){a=a.elements;var c=a[0];var e=a[4];var g=a[8],k=a[1],r=a[5],u=a[9];var A=a[2];var B=a[6];var C=a[10];if(.01>Math.abs(e-k)&&.01>Math.abs(g-A)&&.01>Math.abs(u-B)){if(.1>Math.abs(e+k)&&.1>Math.abs(g+A)&&.1>Math.abs(u+B)&&.1>Math.abs(c+r+C-3))return this.set(1,0,0,0),this;a=Math.PI; c=(c+1)/2;r=(r+1)/2;C=(C+1)/2;e=(e+k)/4;g=(g+A)/4;u=(u+B)/4;c>r&&c>C?.01>c?(B=0,e=A=.707106781):(B=Math.sqrt(c),A=e/B,e=g/B):r>C?.01>r?(B=.707106781,A=0,e=.707106781):(A=Math.sqrt(r),B=e/A,e=u/A):.01>C?(A=B=.707106781,e=0):(e=Math.sqrt(C),B=g/e,A=u/e);this.set(B,A,e,a);return this}a=Math.sqrt((B-u)*(B-u)+(g-A)*(g-A)+(k-e)*(k-e));.001>Math.abs(a)&&(a=1);this.x=(B-u)/a;this.y=(g-A)/a;this.z=(k-e)/a;this.w=Math.acos((c+r+C-1)/2);return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y, a.y);this.z=Math.min(this.z,a.z);this.w=Math.min(this.w,a.w);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);this.w=Math.max(this.w,a.w);return this},clamp:function(a,c){this.x=Math.max(a.x,Math.min(c.x,this.x));this.y=Math.max(a.y,Math.min(c.y,this.y));this.z=Math.max(a.z,Math.min(c.z,this.z));this.w=Math.max(a.w,Math.min(c.w,this.w));return this},clampScalar:function(){var a,c;return function(e,g){void 0===a&&(a=new p,c=new p);a.set(e, e,e,e);c.set(g,g,g,g);return this.clamp(a,c)}}(),clampLength:function(a,c){var e=this.length();return this.divideScalar(e||1).multiplyScalar(Math.max(a,Math.min(c,e)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y); this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){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);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x* this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,c){this.x+=(a.x-this.x)*c;this.y+=(a.y-this.y)*c;this.z+=(a.z-this.z)*c;this.w+=(a.w-this.w)*c;return this},lerpVectors:function(a, c,e){return this.subVectors(c,a).multiplyScalar(e).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,c){void 0===c&&(c=0);this.x=a[c];this.y=a[c+1];this.z=a[c+2];this.w=a[c+3];return this},toArray:function(a,c){void 0===a&&(a=[]);void 0===c&&(c=0);a[c]=this.x;a[c+1]=this.y;a[c+2]=this.z;a[c+3]=this.w;return a},fromBufferAttribute:function(a,c,e){void 0!==e&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."); this.x=a.getX(c);this.y=a.getY(c);this.z=a.getZ(c);this.w=a.getW(c);return this}});n.prototype=Object.assign(Object.create(d.prototype),{constructor:n,isWebGLRenderTarget:!0,setSize:function(a,c){if(this.width!==a||this.height!==c)this.width=a,this.height=c,this.dispose();this.viewport.set(0,0,a,c);this.scissor.set(0,0,a,c)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport);this.texture=a.texture.clone(); this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});q.prototype=Object.assign(Object.create(n.prototype),{constructor:q,isWebGLMultisampleRenderTarget:!0,copy:function(a){n.prototype.copy.call(this,a);this.samples=a.samples;return this}});t.prototype=Object.create(n.prototype);t.prototype.constructor=t;t.prototype.isWebGLRenderTargetCube=!0;v.prototype=Object.create(l.prototype); v.prototype.constructor=v;v.prototype.isDataTexture=!0;Object.assign(z.prototype,{isBox3:!0,set:function(a,c){this.min.copy(a);this.max.copy(c);return this},setFromArray:function(a){for(var c=Infinity,e=Infinity,g=Infinity,k=-Infinity,r=-Infinity,u=-Infinity,A=0,B=a.length;A<B;A+=3){var C=a[A],H=a[A+1],I=a[A+2];C<c&&(c=C);H<e&&(e=H);I<g&&(g=I);C>k&&(k=C);H>r&&(r=H);I>u&&(u=I)}this.min.set(c,e,g);this.max.set(k,r,u);return this},setFromBufferAttribute:function(a){for(var c=Infinity,e=Infinity,g=Infinity, k=-Infinity,r=-Infinity,u=-Infinity,A=0,B=a.count;A<B;A++){var C=a.getX(A),H=a.getY(A),I=a.getZ(A);C<c&&(c=C);H<e&&(e=H);I<g&&(g=I);C>k&&(k=C);H>r&&(r=H);I>u&&(u=I)}this.min.set(c,e,g);this.max.set(k,r,u);return this},setFromPoints:function(a){this.makeEmpty();for(var c=0,e=a.length;c<e;c++)this.expandByPoint(a[c]);return this},setFromCenterAndSize:function(){var a=new m;return function(c,e){e=a.copy(e).multiplyScalar(.5);this.min.copy(c).sub(e);this.max.copy(c).add(e);return this}}(),setFromObject:function(a){this.makeEmpty(); return this.expandByObject(a)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=this.min.z=Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(a){void 0===a&&(console.warn("THREE.Box3: .getCenter() target is now required"),a=new m);return this.isEmpty()? a.set(0,0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(a){void 0===a&&(console.warn("THREE.Box3: .getSize() target is now required"),a=new m);return this.isEmpty()?a.set(0,0,0):a.subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},expandByObject:function(){function a(r){var u= r.geometry;if(void 0!==u)if(u.isGeometry)for(u=u.vertices,e=0,g=u.length;e<g;e++)k.copy(u[e]),k.applyMatrix4(r.matrixWorld),c.expandByPoint(k);else if(u.isBufferGeometry&&(u=u.attributes.position,void 0!==u))for(e=0,g=u.count;e<g;e++)k.fromBufferAttribute(u,e).applyMatrix4(r.matrixWorld),c.expandByPoint(k)}var c,e,g,k=new m;return function(r){c=this;r.updateMatrixWorld(!0);r.traverse(a);return this}}(),containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y|| a.z<this.min.z||a.z>this.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getParameter:function(a,c){void 0===c&&(console.warn("THREE.Box3: .getParameter() target is now required"),c=new m);return c.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(a){return a.max.x<this.min.x|| a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y||a.max.z<this.min.z||a.min.z>this.max.z?!1:!0},intersectsSphere:function(){var a=new m;return function(c){this.clampPoint(c.center,a);return a.distanceToSquared(c.center)<=c.radius*c.radius}}(),intersectsPlane:function(a){if(0<a.normal.x){var c=a.normal.x*this.min.x;var e=a.normal.x*this.max.x}else c=a.normal.x*this.max.x,e=a.normal.x*this.min.x;0<a.normal.y?(c+=a.normal.y*this.min.y,e+=a.normal.y*this.max.y):(c+=a.normal.y*this.max.y,e+= a.normal.y*this.min.y);0<a.normal.z?(c+=a.normal.z*this.min.z,e+=a.normal.z*this.max.z):(c+=a.normal.z*this.max.z,e+=a.normal.z*this.min.z);return c<=-a.constant&&e>=-a.constant},intersectsTriangle:function(){function a(I){var K;var P=0;for(K=I.length-3;P<=K;P+=3){A.fromArray(I,P);var O=c.dot(A),S=e.dot(A),V=g.dot(A);if(Math.max(-Math.max(O,S,V),Math.min(O,S,V))>C.x*Math.abs(A.x)+C.y*Math.abs(A.y)+C.z*Math.abs(A.z))return!1}return!0}var c=new m,e=new m,g=new m,k=new m,r=new m,u=new m,A=new m,B=new m, C=new m,H=new m;return function(I){if(this.isEmpty())return!1;this.getCenter(B);C.subVectors(this.max,B);c.subVectors(I.a,B);e.subVectors(I.b,B);g.subVectors(I.c,B);k.subVectors(e,c);r.subVectors(g,e);u.subVectors(c,g);I=[0,-k.z,k.y,0,-r.z,r.y,0,-u.z,u.y,k.z,0,-k.x,r.z,0,-r.x,u.z,0,-u.x,-k.y,k.x,0,-r.y,r.x,0,-u.y,u.x,0];if(!a(I))return!1;I=[1,0,0,0,1,0,0,0,1];if(!a(I))return!1;H.crossVectors(k,r);I=[H.x,H.y,H.z];return a(I)}}(),clampPoint:function(a,c){void 0===c&&(console.warn("THREE.Box3: .clampPoint() target is now required"), c=new m);return c.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new m;return function(c){return a.copy(c).clamp(this.min,this.max).sub(c).length()}}(),getBoundingSphere:function(){var a=new m;return function(c){void 0===c&&console.error("THREE.Box3: .getBoundingSphere() target is now required");this.getCenter(c.center);c.radius=.5*this.getSize(a).length();return c}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min); this.max.max(a.max);return this},applyMatrix4:function(){var a=[new m,new m,new m,new m,new m,new m,new m,new m];return function(c){if(this.isEmpty())return this;a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(c);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(c);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(c);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(c);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(c);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(c); a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(c);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(c);this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});Object.assign(y.prototype,{set:function(a,c){this.center.copy(a);this.radius=c;return this},setFromPoints:function(){var a=new z;return function(c,e){var g=this.center;void 0!==e?g.copy(e):a.setFromPoints(c).getCenter(g); for(var k=e=0,r=c.length;k<r;k++)e=Math.max(e,g.distanceToSquared(c[k]));this.radius=Math.sqrt(e);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var c=this.radius+ a.radius;return a.center.distanceToSquared(this.center)<=c*c},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(a.distanceToPoint(this.center))<=this.radius},clampPoint:function(a,c){var e=this.center.distanceToSquared(a);void 0===c&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),c=new m);c.copy(a);e>this.radius*this.radius&&(c.sub(this.center).normalize(),c.multiplyScalar(this.radius).add(this.center));return c},getBoundingBox:function(a){void 0=== a&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),a=new z);a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}});Object.assign(x.prototype,{set:function(a,c){this.normal.copy(a);this.constant=c;return this},setComponents:function(a, c,e,g){this.normal.set(a,c,e);this.constant=g;return this},setFromNormalAndCoplanarPoint:function(a,c){this.normal.copy(a);this.constant=-c.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new m,c=new m;return function(e,g,k){g=a.subVectors(k,g).cross(c.subVectors(e,g)).normalize();this.setFromNormalAndCoplanarPoint(g,e);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a= 1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,c){void 0===c&&(console.warn("THREE.Plane: .projectPoint() target is now required"),c=new m);return c.copy(this.normal).multiplyScalar(-this.distanceToPoint(a)).add(a)},intersectLine:function(){var a= new m;return function(c,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new m);var g=c.delta(a),k=this.normal.dot(g);if(0===k){if(0===this.distanceToPoint(c.start))return e.copy(c.start)}else if(k=-(c.start.dot(this.normal)+this.constant)/k,!(0>k||1<k))return e.copy(g).multiplyScalar(k).add(c.start)}}(),intersectsLine:function(a){var c=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>c&&0<a||0>a&&0<c},intersectsBox:function(a){return a.intersectsPlane(this)}, intersectsSphere:function(a){return a.intersectsPlane(this)},coplanarPoint:function(a){void 0===a&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),a=new m);return a.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var a=new m,c=new w;return function(e,g){g=g||c.getNormalMatrix(e);e=this.coplanarPoint(a).applyMatrix4(e);g=this.normal.applyMatrix3(g).normalize();this.constant=-e.dot(g);return this}}(),translate:function(a){this.constant-=a.dot(this.normal); return this},equals:function(a){return a.normal.equals(this.normal)&&a.constant===this.constant}});Object.assign(D.prototype,{set:function(a,c,e,g,k,r){var u=this.planes;u[0].copy(a);u[1].copy(c);u[2].copy(e);u[3].copy(g);u[4].copy(k);u[5].copy(r);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var c=this.planes,e=0;6>e;e++)c[e].copy(a.planes[e]);return this},setFromMatrix:function(a){var c=this.planes,e=a.elements;a=e[0];var g=e[1],k=e[2],r=e[3],u=e[4], A=e[5],B=e[6],C=e[7],H=e[8],I=e[9],K=e[10],P=e[11],O=e[12],S=e[13],V=e[14];e=e[15];c[0].setComponents(r-a,C-u,P-H,e-O).normalize();c[1].setComponents(r+a,C+u,P+H,e+O).normalize();c[2].setComponents(r+g,C+A,P+I,e+S).normalize();c[3].setComponents(r-g,C-A,P-I,e-S).normalize();c[4].setComponents(r-k,C-B,P-K,e-V).normalize();c[5].setComponents(r+k,C+B,P+K,e+V).normalize();return this},intersectsObject:function(){var a=new y;return function(c){var e=c.geometry;null===e.boundingSphere&&e.computeBoundingSphere(); a.copy(e.boundingSphere).applyMatrix4(c.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSprite:function(){var a=new y;return function(c){a.center.set(0,0,0);a.radius=.7071067811865476;a.applyMatrix4(c.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var c=this.planes,e=a.center;a=-a.radius;for(var g=0;6>g;g++)if(c[g].distanceToPoint(e)<a)return!1;return!0},intersectsBox:function(){var a=new m;return function(c){for(var e=this.planes,g=0;6>g;g++){var k=e[g]; a.x=0<k.normal.x?c.max.x:c.min.x;a.y=0<k.normal.y?c.max.y:c.min.y;a.z=0<k.normal.z?c.max.z:c.min.z;if(0>k.distanceToPoint(a))return!1}return!0}}(),containsPoint:function(a){for(var c=this.planes,e=0;6>e;e++)if(0>c[e].distanceToPoint(a))return!1;return!0}});Object.assign(G.prototype,{isMatrix4:!0,set:function(a,c,e,g,k,r,u,A,B,C,H,I,K,P,O,S){var V=this.elements;V[0]=a;V[4]=c;V[8]=e;V[12]=g;V[1]=k;V[5]=r;V[9]=u;V[13]=A;V[2]=B;V[6]=C;V[10]=H;V[14]=I;V[3]=K;V[7]=P;V[11]=O;V[15]=S;return this},identity:function(){this.set(1, 0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new G).fromArray(this.elements)},copy:function(a){var c=this.elements;a=a.elements;c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];c[4]=a[4];c[5]=a[5];c[6]=a[6];c[7]=a[7];c[8]=a[8];c[9]=a[9];c[10]=a[10];c[11]=a[11];c[12]=a[12];c[13]=a[13];c[14]=a[14];c[15]=a[15];return this},copyPosition:function(a){var c=this.elements;a=a.elements;c[12]=a[12];c[13]=a[13];c[14]=a[14];return this},extractBasis:function(a,c,e){a.setFromMatrixColumn(this,0); c.setFromMatrixColumn(this,1);e.setFromMatrixColumn(this,2);return this},makeBasis:function(a,c,e){this.set(a.x,c.x,e.x,0,a.y,c.y,e.y,0,a.z,c.z,e.z,0,0,0,0,1);return this},extractRotation:function(){var a=new m;return function(c){var e=this.elements,g=c.elements,k=1/a.setFromMatrixColumn(c,0).length(),r=1/a.setFromMatrixColumn(c,1).length();c=1/a.setFromMatrixColumn(c,2).length();e[0]=g[0]*k;e[1]=g[1]*k;e[2]=g[2]*k;e[3]=0;e[4]=g[4]*r;e[5]=g[5]*r;e[6]=g[6]*r;e[7]=0;e[8]=g[8]*c;e[9]=g[9]*c;e[10]=g[10]* c;e[11]=0;e[12]=0;e[13]=0;e[14]=0;e[15]=1;return this}}(),makeRotationFromEuler:function(a){a&&a.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var c=this.elements,e=a.x,g=a.y,k=a.z,r=Math.cos(e);e=Math.sin(e);var u=Math.cos(g);g=Math.sin(g);var A=Math.cos(k);k=Math.sin(k);if("XYZ"===a.order){a=r*A;var B=r*k,C=e*A,H=e*k;c[0]=u*A;c[4]=-u*k;c[8]=g;c[1]=B+C*g;c[5]=a-H*g;c[9]=-e*u;c[2]=H-a*g;c[6]=C+B*g;c[10]=r*u}else"YXZ"=== a.order?(a=u*A,B=u*k,C=g*A,H=g*k,c[0]=a+H*e,c[4]=C*e-B,c[8]=r*g,c[1]=r*k,c[5]=r*A,c[9]=-e,c[2]=B*e-C,c[6]=H+a*e,c[10]=r*u):"ZXY"===a.order?(a=u*A,B=u*k,C=g*A,H=g*k,c[0]=a-H*e,c[4]=-r*k,c[8]=C+B*e,c[1]=B+C*e,c[5]=r*A,c[9]=H-a*e,c[2]=-r*g,c[6]=e,c[10]=r*u):"ZYX"===a.order?(a=r*A,B=r*k,C=e*A,H=e*k,c[0]=u*A,c[4]=C*g-B,c[8]=a*g+H,c[1]=u*k,c[5]=H*g+a,c[9]=B*g-C,c[2]=-g,c[6]=e*u,c[10]=r*u):"YZX"===a.order?(a=r*u,B=r*g,C=e*u,H=e*g,c[0]=u*A,c[4]=H-a*k,c[8]=C*k+B,c[1]=k,c[5]=r*A,c[9]=-e*A,c[2]=-g*A,c[6]=B* k+C,c[10]=a-H*k):"XZY"===a.order&&(a=r*u,B=r*g,C=e*u,H=e*g,c[0]=u*A,c[4]=-k,c[8]=g*A,c[1]=a*k+H,c[5]=r*A,c[9]=B*k-C,c[2]=C*k-B,c[6]=e*A,c[10]=H*k+a);c[3]=0;c[7]=0;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return this},makeRotationFromQuaternion:function(){var a=new m(0,0,0),c=new m(1,1,1);return function(e){return this.compose(a,e,c)}}(),lookAt:function(){var a=new m,c=new m,e=new m;return function(g,k,r){var u=this.elements;e.subVectors(g,k);0===e.lengthSq()&&(e.z=1);e.normalize();a.crossVectors(r, e);0===a.lengthSq()&&(1===Math.abs(r.z)?e.x+=1E-4:e.z+=1E-4,e.normalize(),a.crossVectors(r,e));a.normalize();c.crossVectors(e,a);u[0]=a.x;u[4]=c.x;u[8]=e.x;u[1]=a.y;u[5]=c.y;u[9]=e.y;u[2]=a.z;u[6]=c.z;u[10]=e.z;return this}}(),multiply:function(a,c){return void 0!==c?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,c)):this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,this)}, multiplyMatrices:function(a,c){var e=a.elements,g=c.elements;c=this.elements;a=e[0];var k=e[4],r=e[8],u=e[12],A=e[1],B=e[5],C=e[9],H=e[13],I=e[2],K=e[6],P=e[10],O=e[14],S=e[3],V=e[7],ca=e[11];e=e[15];var ha=g[0],ba=g[4],ka=g[8],da=g[12],ea=g[1],na=g[5],la=g[9],ua=g[13],Da=g[2],wa=g[6],Ca=g[10],Ea=g[14],Qa=g[3],W=g[7],aa=g[11];g=g[15];c[0]=a*ha+k*ea+r*Da+u*Qa;c[4]=a*ba+k*na+r*wa+u*W;c[8]=a*ka+k*la+r*Ca+u*aa;c[12]=a*da+k*ua+r*Ea+u*g;c[1]=A*ha+B*ea+C*Da+H*Qa;c[5]=A*ba+B*na+C*wa+H*W;c[9]=A*ka+B*la+C* Ca+H*aa;c[13]=A*da+B*ua+C*Ea+H*g;c[2]=I*ha+K*ea+P*Da+O*Qa;c[6]=I*ba+K*na+P*wa+O*W;c[10]=I*ka+K*la+P*Ca+O*aa;c[14]=I*da+K*ua+P*Ea+O*g;c[3]=S*ha+V*ea+ca*Da+e*Qa;c[7]=S*ba+V*na+ca*wa+e*W;c[11]=S*ka+V*la+ca*Ca+e*aa;c[15]=S*da+V*ua+ca*Ea+e*g;return this},multiplyScalar:function(a){var c=this.elements;c[0]*=a;c[4]*=a;c[8]*=a;c[12]*=a;c[1]*=a;c[5]*=a;c[9]*=a;c[13]*=a;c[2]*=a;c[6]*=a;c[10]*=a;c[14]*=a;c[3]*=a;c[7]*=a;c[11]*=a;c[15]*=a;return this},applyToBufferAttribute:function(){var a=new m;return function(c){for(var e= 0,g=c.count;e<g;e++)a.x=c.getX(e),a.y=c.getY(e),a.z=c.getZ(e),a.applyMatrix4(this),c.setXYZ(e,a.x,a.y,a.z);return c}}(),determinant:function(){var a=this.elements,c=a[0],e=a[4],g=a[8],k=a[12],r=a[1],u=a[5],A=a[9],B=a[13],C=a[2],H=a[6],I=a[10],K=a[14];return a[3]*(+k*A*H-g*B*H-k*u*I+e*B*I+g*u*K-e*A*K)+a[7]*(+c*A*K-c*B*I+k*r*I-g*r*K+g*B*C-k*A*C)+a[11]*(+c*B*H-c*u*K-k*r*H+e*r*K+k*u*C-e*B*C)+a[15]*(-g*u*C-c*A*H+c*u*I+g*r*H-e*r*I+e*A*C)},transpose:function(){var a=this.elements;var c=a[1];a[1]=a[4];a[4]= c;c=a[2];a[2]=a[8];a[8]=c;c=a[6];a[6]=a[9];a[9]=c;c=a[3];a[3]=a[12];a[12]=c;c=a[7];a[7]=a[13];a[13]=c;c=a[11];a[11]=a[14];a[14]=c;return this},setPosition:function(a){var c=this.elements;c[12]=a.x;c[13]=a.y;c[14]=a.z;return this},getInverse:function(a,c){var e=this.elements,g=a.elements;a=g[0];var k=g[1],r=g[2],u=g[3],A=g[4],B=g[5],C=g[6],H=g[7],I=g[8],K=g[9],P=g[10],O=g[11],S=g[12],V=g[13],ca=g[14];g=g[15];var ha=K*ca*H-V*P*H+V*C*O-B*ca*O-K*C*g+B*P*g,ba=S*P*H-I*ca*H-S*C*O+A*ca*O+I*C*g-A*P*g,ka=I* V*H-S*K*H+S*B*O-A*V*O-I*B*g+A*K*g,da=S*K*C-I*V*C-S*B*P+A*V*P+I*B*ca-A*K*ca,ea=a*ha+k*ba+r*ka+u*da;if(0===ea){if(!0===c)throw Error("THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0");console.warn("THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0");return this.identity()}c=1/ea;e[0]=ha*c;e[1]=(V*P*u-K*ca*u-V*r*O+k*ca*O+K*r*g-k*P*g)*c;e[2]=(B*ca*u-V*C*u+V*r*H-k*ca*H-B*r*g+k*C*g)*c;e[3]=(K*C*u-B*P*u-K*r*H+k*P*H+B*r*O-k*C*O)*c;e[4]=ba*c;e[5]=(I*ca*u-S*P*u+S*r*O-a*ca* O-I*r*g+a*P*g)*c;e[6]=(S*C*u-A*ca*u-S*r*H+a*ca*H+A*r*g-a*C*g)*c;e[7]=(A*P*u-I*C*u+I*r*H-a*P*H-A*r*O+a*C*O)*c;e[8]=ka*c;e[9]=(S*K*u-I*V*u-S*k*O+a*V*O+I*k*g-a*K*g)*c;e[10]=(A*V*u-S*B*u+S*k*H-a*V*H-A*k*g+a*B*g)*c;e[11]=(I*B*u-A*K*u-I*k*H+a*K*H+A*k*O-a*B*O)*c;e[12]=da*c;e[13]=(I*V*r-S*K*r+S*k*P-a*V*P-I*k*ca+a*K*ca)*c;e[14]=(S*B*r-A*V*r-S*k*C+a*V*C+A*k*ca-a*B*ca)*c;e[15]=(A*K*r-I*B*r+I*k*C-a*K*C-A*k*P+a*B*P)*c;return this},scale:function(a){var c=this.elements,e=a.x,g=a.y;a=a.z;c[0]*=e;c[4]*=g;c[8]*=a; c[1]*=e;c[5]*=g;c[9]*=a;c[2]*=e;c[6]*=g;c[10]*=a;c[3]*=e;c[7]*=g;c[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10]))},makeTranslation:function(a,c,e){this.set(1,0,0,a,0,1,0,c,0,0,1,e,0,0,0,1);return this},makeRotationX:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,c,-a,0,0,a,c,0,0,0,0,1);return this},makeRotationY:function(a){var c=Math.cos(a); a=Math.sin(a);this.set(c,0,a,0,0,1,0,0,-a,0,c,0,0,0,0,1);return this},makeRotationZ:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,-a,0,0,a,c,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,c){var e=Math.cos(c);c=Math.sin(c);var g=1-e,k=a.x,r=a.y;a=a.z;var u=g*k,A=g*r;this.set(u*k+e,u*r-c*a,u*a+c*r,0,u*r+c*a,A*r+e,A*a-c*k,0,u*a-c*r,A*a+c*k,g*a*a+e,0,0,0,0,1);return this},makeScale:function(a,c,e){this.set(a,0,0,0,0,c,0,0,0,0,e,0,0,0,0,1);return this},makeShear:function(a,c,e){this.set(1, c,e,0,a,1,e,0,a,c,1,0,0,0,0,1);return this},compose:function(a,c,e){var g=this.elements,k=c._x,r=c._y,u=c._z,A=c._w,B=k+k,C=r+r,H=u+u;c=k*B;var I=k*C;k*=H;var K=r*C;r*=H;u*=H;B*=A;C*=A;A*=H;H=e.x;var P=e.y;e=e.z;g[0]=(1-(K+u))*H;g[1]=(I+A)*H;g[2]=(k-C)*H;g[3]=0;g[4]=(I-A)*P;g[5]=(1-(c+u))*P;g[6]=(r+B)*P;g[7]=0;g[8]=(k+C)*e;g[9]=(r-B)*e;g[10]=(1-(c+K))*e;g[11]=0;g[12]=a.x;g[13]=a.y;g[14]=a.z;g[15]=1;return this},decompose:function(){var a=new m,c=new G;return function(e,g,k){var r=this.elements,u= a.set(r[0],r[1],r[2]).length(),A=a.set(r[4],r[5],r[6]).length(),B=a.set(r[8],r[9],r[10]).length();0>this.determinant()&&(u=-u);e.x=r[12];e.y=r[13];e.z=r[14];c.copy(this);e=1/u;r=1/A;var C=1/B;c.elements[0]*=e;c.elements[1]*=e;c.elements[2]*=e;c.elements[4]*=r;c.elements[5]*=r;c.elements[6]*=r;c.elements[8]*=C;c.elements[9]*=C;c.elements[10]*=C;g.setFromRotationMatrix(c);k.x=u;k.y=A;k.z=B;return this}}(),makePerspective:function(a,c,e,g,k,r){void 0===r&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); var u=this.elements;u[0]=2*k/(c-a);u[4]=0;u[8]=(c+a)/(c-a);u[12]=0;u[1]=0;u[5]=2*k/(e-g);u[9]=(e+g)/(e-g);u[13]=0;u[2]=0;u[6]=0;u[10]=-(r+k)/(r-k);u[14]=-2*r*k/(r-k);u[3]=0;u[7]=0;u[11]=-1;u[15]=0;return this},makeOrthographic:function(a,c,e,g,k,r){var u=this.elements,A=1/(c-a),B=1/(e-g),C=1/(r-k);u[0]=2*A;u[4]=0;u[8]=0;u[12]=-((c+a)*A);u[1]=0;u[5]=2*B;u[9]=0;u[13]=-((e+g)*B);u[2]=0;u[6]=0;u[10]=-2*C;u[14]=-((r+k)*C);u[3]=0;u[7]=0;u[11]=0;u[15]=1;return this},equals:function(a){var c=this.elements; a=a.elements;for(var e=0;16>e;e++)if(c[e]!==a[e])return!1;return!0},fromArray:function(a,c){void 0===c&&(c=0);for(var e=0;16>e;e++)this.elements[e]=a[e+c];return this},toArray:function(a,c){void 0===a&&(a=[]);void 0===c&&(c=0);var e=this.elements;a[c]=e[0];a[c+1]=e[1];a[c+2]=e[2];a[c+3]=e[3];a[c+4]=e[4];a[c+5]=e[5];a[c+6]=e[6];a[c+7]=e[7];a[c+8]=e[8];a[c+9]=e[9];a[c+10]=e[10];a[c+11]=e[11];a[c+12]=e[12];a[c+13]=e[13];a[c+14]=e[14];a[c+15]=e[15];return a}});var mb={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *\x3d texture2D( alphaMap, vUv ).g;\n#endif", alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a \x3c ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion \x3d ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *\x3d ambientOcclusion;\n\t#if defined( USE_ENVMAP ) \x26\x26 defined( PHYSICAL )\n\t\tfloat dotNV \x3d saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *\x3d computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif", aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed \x3d vec3( position );",beginnormal_vertex:"vec3 objectNormal \x3d vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent \x3d vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 \x3d vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 \x3d vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r \x3d roughness * c0 + c1;\n\tfloat a004 \x3d min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff \x3d 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance \x3e 0.0 ) {\n\t\tdistanceFalloff *\x3d pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance \x3e 0.0 \x26\x26 decayExponent \x3e 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel \x3d exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 \x3d pow2( alpha );\n\tfloat gl \x3d dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv \x3d dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 \x3d pow2( alpha );\n\tfloat gv \x3d dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl \x3d dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 \x3d pow2( alpha );\n\tfloat denom \x3d pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha \x3d pow2( roughness );\n\tvec3 halfDir \x3d normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL \x3d saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV \x3d saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH \x3d saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH \x3d saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F \x3d F_Schlick( specularColor, dotLH );\n\tfloat G \x3d G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D \x3d D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE \x3d 64.0;\n\tconst float LUT_SCALE \x3d ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS \x3d 0.5 / LUT_SIZE;\n\tfloat dotNV \x3d saturate( dot( N, V ) );\n\tvec2 uv \x3d vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv \x3d uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l \x3d length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x \x3d dot( v1, v2 );\n\tfloat y \x3d abs( x );\n\tfloat a \x3d 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b \x3d 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v \x3d a / b;\n\tfloat theta_sintheta \x3d ( x \x3e 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 \x3d rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 \x3d rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal \x3d cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) \x3c 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 \x3d normalize( V - N * dot( V, N ) );\n\tT2 \x3d - cross( N, T1 );\n\tmat3 mat \x3d mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] \x3d mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] \x3d mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] \x3d mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] \x3d mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] \x3d normalize( coords[ 0 ] );\n\tcoords[ 1 ] \x3d normalize( coords[ 1 ] );\n\tcoords[ 2 ] \x3d normalize( coords[ 2 ] );\n\tcoords[ 3 ] \x3d normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor \x3d vec3( 0.0 );\n\tvectorFormFactor +\x3d LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor +\x3d LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor +\x3d LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor +\x3d LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result \x3d LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV \x3d saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec2 brdf \x3d integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV \x3d saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F \x3d F_Schlick( specularColor, dotNV );\n\tvec2 brdf \x3d integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss \x3d F * brdf.x + brdf.y;\n\tfloat Ess \x3d brdf.x + brdf.y;\n\tfloat Ems \x3d 1.0 - Ess;\n\tvec3 Favg \x3d specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms \x3d FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter +\x3d FssEss;\n\tmultiScatter +\x3d Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir \x3d normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH \x3d saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH \x3d saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F \x3d F_Schlick( specularColor, dotLH );\n\tfloat G \x3d G_BlinnPhong_Implicit( );\n\tfloat D \x3d D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}", bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx \x3d dFdx( vUv );\n\t\tvec2 dSTdy \x3d dFdy( vUv );\n\t\tfloat Hll \x3d bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx \x3d bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy \x3d bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX \x3d vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY \x3d vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN \x3d surf_norm;\n\t\tvec3 R1 \x3d cross( vSigmaY, vN );\n\t\tvec3 R2 \x3d cross( vN, vSigmaX );\n\t\tfloat fDet \x3d dot( vSigmaX, R1 );\n\t\tfDet *\x3d ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad \x3d sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif", clipping_planes_fragment:"#if NUM_CLIPPING_PLANES \x3e 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane \x3d clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) \x3e plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES \x3c NUM_CLIPPING_PLANES\n\t\tbool clipped \x3d true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i \x3d UNION_CLIPPING_PLANES; i \x3c NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane \x3d clippingPlanes[ i ];\n\t\t\tclipped \x3d ( dot( vViewPosition, plane.xyz ) \x3e plane.w ) \x26\x26 clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif", clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES \x3e 0\n\t#if ! defined( PHYSICAL ) \x26\x26 ! defined( PHONG ) \x26\x26 ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES \x3e 0 \x26\x26 ! defined( PHYSICAL ) \x26\x26 ! defined( PHONG ) \x26\x26 ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES \x3e 0 \x26\x26 ! defined( PHYSICAL ) \x26\x26 ! defined( PHONG ) \x26\x26 ! defined( MATCAP )\n\tvViewPosition \x3d - mvPosition.xyz;\n#endif", color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *\x3d vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz \x3d color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 \x3d x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a \x3d 12.9898, b \x3d 78.233, c \x3d 43758.5453;\n\thighp float dt \x3d dot( uv.xy, vec2( a,b ) ), sn \x3d mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance \x3d dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] \x3d vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] \x3d vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] \x3d vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights \x3d vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}", cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection \x3d abs(direction);\n\tint face \x3d -1;\n\tif( absDirection.x \x3e absDirection.z ) {\n\t\tif(absDirection.x \x3e absDirection.y )\n\t\t\tface \x3d direction.x \x3e 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface \x3d direction.y \x3e 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z \x3e absDirection.y )\n\t\t\tface \x3d direction.z \x3e 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface \x3d direction.y \x3e 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale \x3d exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness \x3d dFdx(roughness);\n\tfloat dyRoughness \x3d dFdy(roughness);\n\tvec3 dx \x3d dFdx( vec * scale * dxRoughness );\n\tvec3 dy \x3d dFdy( vec * scale * dyRoughness );\n\tfloat d \x3d max( dot( dx, dx ), dot( dy, dy ) );\n\td \x3d clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel \x3d 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel \x3d roughnessLevel \x3e cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a \x3d 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed \x3d exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed \x3d vec2( 1.0 ) / exp2_packed;\n\tfloat powScale \x3d exp2_packed.x * exp2_packed.y;\n\tfloat scale \x3d rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset \x3d 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes \x3d mipLevel \x3d\x3d 0.0;\n\tscale \x3d bRes \x26\x26 (scale \x3c a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face \x3d getFaceFromDirection(direction);\n\tfloat rcpPowScale \x3d 1.0 / powScale;\n\tif( face \x3d\x3d 0) {\n\t\tr \x3d vec3(direction.x, -direction.z, direction.y);\n\t\toffset \x3d vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y \x3d bRes \x26\x26 (offset.y \x3c 2.0*a) ? a : offset.y;\n\t}\n\telse if( face \x3d\x3d 1) {\n\t\tr \x3d vec3(direction.y, direction.x, direction.z);\n\t\toffset \x3d vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y \x3d bRes \x26\x26 (offset.y \x3c 2.0*a) ? a : offset.y;\n\t}\n\telse if( face \x3d\x3d 2) {\n\t\tr \x3d vec3(direction.z, direction.x, direction.y);\n\t\toffset \x3d vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y \x3d bRes \x26\x26 (offset.y \x3c 2.0*a) ? a : offset.y;\n\t}\n\telse if( face \x3d\x3d 3) {\n\t\tr \x3d vec3(direction.x, direction.z, direction.y);\n\t\toffset \x3d vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y \x3d bRes \x26\x26 (offset.y \x3c 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face \x3d\x3d 4) {\n\t\tr \x3d vec3(direction.y, direction.x, -direction.z);\n\t\toffset \x3d vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y \x3d bRes \x26\x26 (offset.y \x3c 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr \x3d vec3(direction.z, -direction.x, direction.y);\n\t\toffset \x3d vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y \x3d bRes \x26\x26 (offset.y \x3c 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr \x3d normalize(r);\n\tfloat texelOffset \x3d 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s \x3d ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base \x3d offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal \x3d roughness* cubeUV_maxLods3;\n\tfloat r1 \x3d floor(roughnessVal);\n\tfloat r2 \x3d r1 + 1.0;\n\tfloat t \x3d fract(roughnessVal);\n\tvec2 mipInfo \x3d MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s \x3d mipInfo.y;\n\tfloat level0 \x3d mipInfo.x;\n\tfloat level1 \x3d level0 + 1.0;\n\tlevel1 \x3d level1 \x3e 5.0 ? 5.0 : level1;\n\tlevel0 +\x3d min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 \x3d getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 \x3d envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 \x3d getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 \x3d envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result \x3d mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif", defaultnormal_vertex:"vec3 transformedNormal \x3d normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal \x3d - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent \x3d normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent \x3d - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed +\x3d normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif", emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor \x3d texture2D( emissiveMap, vUv );\n\temissiveColor.rgb \x3d emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *\x3d emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor \x3d linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent \x3d max( max( value.r, value.g ), value.b );\n\tfloat fExp \x3d clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB \x3d max( value.r, max( value.g, value.b ) );\n\tfloat M \x3d clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM \x3d ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB \x3d max( value.r, max( value.g, value.b ) );\n\tfloat D \x3d max( maxRange / maxRGB, 1.0 );\n\tD \x3d min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM \x3d mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp \x3d cLogLuvM * value.rgb;\n\tXp_Y_XYZp \x3d max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy \x3d Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le \x3d 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w \x3d fract( Le );\n\tvResult.z \x3d ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM \x3d mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le \x3d value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y \x3d exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z \x3d Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x \x3d value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB \x3d cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}", envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex \x3d normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal \x3d inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec \x3d reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec \x3d refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec \x3d vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor \x3d textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec \x3d normalize( reflectVec );\n\t\tsampleUV.y \x3d asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x \x3d atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor \x3d texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec \x3d normalize( reflectVec );\n\t\tvec3 reflectView \x3d normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor \x3d texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor \x3d vec4( 0.0 );\n\t#endif\n\tenvColor \x3d envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight \x3d mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight \x3d mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight +\x3d envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif", envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) \x26\x26 ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\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\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif", envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP ) \x26\x26 defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal \x3d inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec \x3d vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor \x3d textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor \x3d textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb \x3d envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec \x3d vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor \x3d textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor \x3d vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar \x3d float( maxMIPLevel );\n\t\tfloat desiredMIPLevel \x3d maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec \x3d reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec \x3d refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec \x3d inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel \x3d getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec \x3d vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor \x3d textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor \x3d textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb \x3d envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec \x3d vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor \x3d textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y \x3d asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x \x3d atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor \x3d texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor \x3d texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb \x3d envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView \x3d normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor \x3d texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor \x3d texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb \x3d envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif", envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition \x3d worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex \x3d normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal \x3d inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect \x3d reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect \x3d refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif", fog_vertex:"#ifdef USE_FOG\n\tfogDepth \x3d -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor \x3d whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor \x3d smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb \x3d mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif", gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL \x3d dot( normal, lightDirection );\n\t\tvec2 coord \x3d vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x \x3c 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse +\x3d PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif", lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse \x3d vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position \x3d mvPosition.xyz;\ngeometry.normal \x3d normalize( transformedNormal );\ngeometry.viewDir \x3d normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position \x3d geometry.position;\nbackGeometry.normal \x3d -geometry.normal;\nbackGeometry.viewDir \x3d geometry.viewDir;\nvLightFront \x3d vec3( 0.0 );\nvIndirectFront \x3d vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack \x3d vec3( 0.0 );\n\tvIndirectBack \x3d vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS \x3e 0\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL \x3d dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse \x3d PI * directLight.color;\n\t\tvLightFront +\x3d saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack +\x3d saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS \x3e 0\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL \x3d dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse \x3d PI * directLight.color;\n\t\tvLightFront +\x3d saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack +\x3d saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS \x3e 0\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL \x3d dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse \x3d PI * directLight.color;\n\t\tvLightFront +\x3d saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack +\x3d saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS \x3e 0\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront +\x3d getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack +\x3d getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif", lights_pars_begin:"uniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x \x3d normal.x, y \x3d normal.y, z \x3d normal.z;\n\tvec3 result \x3d shCoefficients[ 0 ] * 0.886227;\n\tresult +\x3d shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult +\x3d shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult +\x3d shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult +\x3d shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult +\x3d shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult +\x3d shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult +\x3d shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult +\x3d shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal \x3d inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance \x3d shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance \x3d ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *\x3d PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS \x3e 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color \x3d directionalLight.color;\n\t\tdirectLight.direction \x3d directionalLight.direction;\n\t\tdirectLight.visible \x3d true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS \x3e 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector \x3d pointLight.position - geometry.position;\n\t\tdirectLight.direction \x3d normalize( lVector );\n\t\tfloat lightDistance \x3d length( lVector );\n\t\tdirectLight.color \x3d pointLight.color;\n\t\tdirectLight.color *\x3d punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible \x3d ( directLight.color !\x3d vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS \x3e 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector \x3d spotLight.position - geometry.position;\n\t\tdirectLight.direction \x3d normalize( lVector );\n\t\tfloat lightDistance \x3d length( lVector );\n\t\tfloat angleCos \x3d dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos \x3e spotLight.coneCos ) {\n\t\t\tfloat spotEffect \x3d smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color \x3d spotLight.color;\n\t\t\tdirectLight.color *\x3d spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible \x3d true;\n\t\t} else {\n\t\t\tdirectLight.color \x3d vec3( 0.0 );\n\t\t\tdirectLight.visible \x3d false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS \x3e 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS \x3e 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL \x3d dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight \x3d 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance \x3d mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *\x3d PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif", lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor \x3d diffuseColor.rgb;\nmaterial.specularColor \x3d specular;\nmaterial.specularShininess \x3d shininess;\nmaterial.specularStrength \x3d specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance \x3d getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL \x3d saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance \x3d dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *\x3d PI;\n\t#endif\n\treflectedLight.directDiffuse +\x3d irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular +\x3d irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse +\x3d irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)", lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor \x3d diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness \x3d clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor \x3d mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor \x3d mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat \x3d saturate( clearCoat );\tmaterial.clearCoatRoughness \x3d clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif", lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS \x3e 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal \x3d geometry.normal;\n\t\tvec3 viewDir \x3d geometry.viewDir;\n\t\tvec3 position \x3d geometry.position;\n\t\tvec3 lightPos \x3d rectAreaLight.position;\n\t\tvec3 halfWidth \x3d rectAreaLight.halfWidth;\n\t\tvec3 halfHeight \x3d rectAreaLight.halfHeight;\n\t\tvec3 lightColor \x3d rectAreaLight.color;\n\t\tfloat roughness \x3d material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] \x3d lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] \x3d lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] \x3d lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] \x3d lightPos + halfWidth + halfHeight;\n\t\tvec2 uv \x3d LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 \x3d texture2D( ltc_1, uv );\n\t\tvec4 t2 \x3d texture2D( ltc_2, uv );\n\t\tmat3 mInv \x3d mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel \x3d ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular +\x3d lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse +\x3d lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL \x3d saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance \x3d dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *\x3d PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR \x3d material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR \x3d 0.0;\n\t#endif\n\treflectedLight.directSpecular +\x3d ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse +\x3d ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular +\x3d irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse +\x3d irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifndef STANDARD\n\t\tfloat dotNV \x3d saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL \x3d dotNV;\n\t\tfloat clearCoatDHR \x3d material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR \x3d 0.0;\n\t#endif\n\tfloat clearCoatInv \x3d 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering \x3d vec3( 0.0 );\n\t\tvec3 multiScattering \x3d vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance \x3d irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse \x3d material.diffuseColor;\n\t\treflectedLight.indirectSpecular +\x3d clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse +\x3d multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse +\x3d diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular +\x3d clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular +\x3d clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}", lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position \x3d - vViewPosition;\ngeometry.normal \x3d normal;\ngeometry.viewDir \x3d normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS \x3e 0 ) \x26\x26 defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight \x3d pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *\x3d all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS \x3e 0 ) \x26\x26 defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight \x3d spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *\x3d all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS \x3e 0 ) \x26\x26 defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight \x3d directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *\x3d all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS \x3e 0 ) \x26\x26 defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight \x3d rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance \x3d getAmbientLightIrradiance( ambientLightColor );\n\tirradiance +\x3d getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS \x3e 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i \x3d 0; i \x3c NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance +\x3d getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance \x3d vec3( 0.0 );\n\tvec3 clearCoatRadiance \x3d vec3( 0.0 );\n#endif", lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance \x3d texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *\x3d PI;\n\t\t#endif\n\t\tirradiance +\x3d lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) \x26\x26 defined( PHYSICAL ) \x26\x26 defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance +\x3d getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) \x26\x26 defined( RE_IndirectSpecular )\n\tradiance +\x3d getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance +\x3d getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif", lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) \x26\x26 defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT \x3d log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) \x26\x26 defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif", logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth \x3d 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z \x3d log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *\x3d gl_Position.w;\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor \x3d texture2D( map, vUv );\n\ttexelColor \x3d mapTexelToLinear( texelColor );\n\tdiffuseColor *\x3d texelColor;\n#endif", map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv \x3d ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel \x3d texture2D( map, uv );\n\tdiffuseColor *\x3d mapTexelToLinear( mapTexel );\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor \x3d metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness \x3d texture2D( metalnessMap, vUv );\n\tmetalnessFactor *\x3d texelMetalness.b;\n#endif", metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal +\x3d ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal +\x3d ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal +\x3d ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal +\x3d ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif", morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed +\x3d ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed +\x3d ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed +\x3d ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed +\x3d ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed +\x3d ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed +\x3d ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed +\x3d ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed +\x3d ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif", normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx \x3d vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy \x3d vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal \x3d normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal \x3d normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal \x3d normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent \x3d normalize( vTangent );\n\t\tvec3 bitangent \x3d normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent \x3d tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent \x3d bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif", normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal \x3d texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal \x3d - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal \x3d normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal \x3d normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN \x3d mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN \x3d texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy \x3d normalScale * mapN.xy;\n\t\t\tnormal \x3d normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal \x3d perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal \x3d perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif", normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 \x3d vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 \x3d vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 \x3d dFdx( vUv.st );\n\t\t\tvec2 st1 \x3d dFdy( vUv.st );\n\t\t\tfloat scale \x3d sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S \x3d normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T \x3d normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N \x3d normalize( surf_norm );\n\t\t\tmat3 tsn \x3d mat3( S, T, N );\n\t\t\tvec3 mapN \x3d texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *\x3d normalScale;\n\t\t\tmapN.xy *\x3d ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif", packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale \x3d 256. / 255.;const float UnpackDownscale \x3d 255. / 256.;\nconst vec3 PackFactors \x3d vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors \x3d UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 \x3d 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r \x3d vec4( fract( v * PackFactors ), v );\n\tr.yzw -\x3d r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}", premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *\x3d gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition \x3d modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position \x3d projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n\tgl_FragColor.rgb \x3d dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position \x3d rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB \x3d vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB \x3d mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif", roughnessmap_fragment:"float roughnessFactor \x3d roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness \x3d texture2D( roughnessMap, vUv );\n\troughnessFactor *\x3d texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS \x3e 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS \x3e 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS \x3e 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset \x3d vec2( 0.0, 1.0 );\n\t\tvec2 texelSize \x3d vec2( 1.0 ) / size;\n\t\tvec2 centroidUV \x3d floor( uv * size + 0.5 ) / size;\n\t\tfloat lb \x3d texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt \x3d texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb \x3d texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt \x3d texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f \x3d fract( uv * size + 0.5 );\n\t\tfloat a \x3d mix( lb, lt, f.y );\n\t\tfloat b \x3d mix( rb, rt, f.y );\n\t\tfloat c \x3d mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow \x3d 1.0;\n\t\tshadowCoord.xyz /\x3d shadowCoord.w;\n\t\tshadowCoord.z +\x3d shadowBias;\n\t\tbvec4 inFrustumVec \x3d bvec4 ( shadowCoord.x \x3e\x3d 0.0, shadowCoord.x \x3c\x3d 1.0, shadowCoord.y \x3e\x3d 0.0, shadowCoord.y \x3c\x3d 1.0 );\n\t\tbool inFrustum \x3d all( inFrustumVec );\n\t\tbvec2 frustumTestVec \x3d bvec2( inFrustum, shadowCoord.z \x3c\x3d 1.0 );\n\t\tbool frustumTest \x3d all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize \x3d vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 \x3d - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 \x3d - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 \x3d + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 \x3d + texelSize.y * shadowRadius;\n\t\t\tshadow \x3d (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize \x3d vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 \x3d - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 \x3d - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 \x3d + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 \x3d + texelSize.y * shadowRadius;\n\t\t\tshadow \x3d (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow \x3d texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV \x3d abs( v );\n\t\tfloat scaleToCube \x3d 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *\x3d scaleToCube;\n\t\tv *\x3d scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar \x3d v.xy;\n\t\tfloat almostATexel \x3d 1.5 * texelSizeY;\n\t\tfloat almostOne \x3d 1.0 - almostATexel;\n\t\tif ( absV.z \x3e\x3d almostOne ) {\n\t\t\tif ( v.z \x3e 0.0 )\n\t\t\t\tplanar.x \x3d 4.0 - v.x;\n\t\t} else if ( absV.x \x3e\x3d almostOne ) {\n\t\t\tfloat signX \x3d sign( v.x );\n\t\t\tplanar.x \x3d v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y \x3e\x3d almostOne ) {\n\t\t\tfloat signY \x3d sign( v.y );\n\t\t\tplanar.x \x3d v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y \x3d v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize \x3d vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition \x3d shadowCoord.xyz;\n\t\tfloat dp \x3d ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp +\x3d shadowBias;\n\t\tvec3 bd3D \x3d normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset \x3d vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif", shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS \x3e 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS \x3e 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS \x3e 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif", shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS \x3e 0\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] \x3d directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS \x3e 0\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] \x3d spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS \x3e 0\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] \x3d pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif", shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow \x3d 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS \x3e 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight \x3d directionalLights[ i ];\n\t\tshadow *\x3d bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS \x3e 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight \x3d spotLights[ i ];\n\t\tshadow *\x3d bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS \x3e 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i \x3d 0; i \x3c NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight \x3d pointLights[ i ];\n\t\tshadow *\x3d bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}", skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX \x3d getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY \x3d getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ \x3d getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW \x3d getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j \x3d i * 4.0;\n\t\t\tfloat x \x3d mod( j, float( boneTextureSize ) );\n\t\t\tfloat y \x3d floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx \x3d 1.0 / float( boneTextureSize );\n\t\t\tfloat dy \x3d 1.0 / float( boneTextureSize );\n\t\t\ty \x3d dy * ( y + 0.5 );\n\t\t\tvec4 v1 \x3d texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 \x3d texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 \x3d texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 \x3d texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone \x3d mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone \x3d boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif", skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex \x3d bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned \x3d vec4( 0.0 );\n\tskinned +\x3d boneMatX * skinVertex * skinWeight.x;\n\tskinned +\x3d boneMatY * skinVertex * skinWeight.y;\n\tskinned +\x3d boneMatZ * skinVertex * skinWeight.z;\n\tskinned +\x3d boneMatW * skinVertex * skinWeight.w;\n\ttransformed \x3d ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix \x3d mat4( 0.0 );\n\tskinMatrix +\x3d skinWeight.x * boneMatX;\n\tskinMatrix +\x3d skinWeight.y * boneMatY;\n\tskinMatrix +\x3d skinWeight.z * boneMatZ;\n\tskinMatrix +\x3d skinWeight.w * boneMatW;\n\tskinMatrix \x3d bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal \x3d vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent \x3d vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif", specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular \x3d texture2D( specularMap, vUv );\n\tspecularStrength \x3d texelSpecular.r;\n#else\n\tspecularStrength \x3d 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb \x3d toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *\x3d toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *\x3d toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *\x3d toneMappingExposure;\n\tcolor \x3d max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *\x3d toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}", uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif", uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv \x3d ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif", uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 \x3d uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition \x3d modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor \x3d texture2D( t2D, vUv );\n\tgl_FragColor \x3d mapTexelToLinear( texColor );\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n}", background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv \x3d ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position \x3d vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor \x3d textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor \x3d mapTexelToLinear( texColor );\n\tgl_FragColor.a *\x3d opacity;\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n}", cube_vert:"varying vec3 vWorldDirection;\n#include \x3ccommon\x3e\nvoid main() {\n\tvWorldDirection \x3d transformDirection( position, modelMatrix );\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\tgl_Position.z \x3d gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING \x3d\x3d 3200\n\tuniform float opacity;\n#endif\n#include \x3ccommon\x3e\n#include \x3cpacking\x3e\n#include \x3cuv_pars_fragment\x3e\n#include \x3cmap_pars_fragment\x3e\n#include \x3calphamap_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main() {\n\t#include \x3cclipping_planes_fragment\x3e\n\tvec4 diffuseColor \x3d vec4( 1.0 );\n\t#if DEPTH_PACKING \x3d\x3d 3200\n\t\tdiffuseColor.a \x3d opacity;\n\t#endif\n\t#include \x3cmap_fragment\x3e\n\t#include \x3calphamap_fragment\x3e\n\t#include \x3calphatest_fragment\x3e\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#if DEPTH_PACKING \x3d\x3d 3200\n\t\tgl_FragColor \x3d vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING \x3d\x3d 3201\n\t\tgl_FragColor \x3d packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}", depth_vert:"#include \x3ccommon\x3e\n#include \x3cuv_pars_vertex\x3e\n#include \x3cdisplacementmap_pars_vertex\x3e\n#include \x3cmorphtarget_pars_vertex\x3e\n#include \x3cskinning_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3cuv_vertex\x3e\n\t#include \x3cskinbase_vertex\x3e\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \x3cbeginnormal_vertex\x3e\n\t\t#include \x3cmorphnormal_vertex\x3e\n\t\t#include \x3cskinnormal_vertex\x3e\n\t#endif\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cmorphtarget_vertex\x3e\n\t#include \x3cskinning_vertex\x3e\n\t#include \x3cdisplacementmap_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\t#include \x3clogdepthbuf_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n}", distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \x3ccommon\x3e\n#include \x3cpacking\x3e\n#include \x3cuv_pars_fragment\x3e\n#include \x3cmap_pars_fragment\x3e\n#include \x3calphamap_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main () {\n\t#include \x3cclipping_planes_fragment\x3e\n\tvec4 diffuseColor \x3d vec4( 1.0 );\n\t#include \x3cmap_fragment\x3e\n\t#include \x3calphamap_fragment\x3e\n\t#include \x3calphatest_fragment\x3e\n\tfloat dist \x3d length( vWorldPosition - referencePosition );\n\tdist \x3d ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist \x3d saturate( dist );\n\tgl_FragColor \x3d packDepthToRGBA( dist );\n}", distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \x3ccommon\x3e\n#include \x3cuv_pars_vertex\x3e\n#include \x3cdisplacementmap_pars_vertex\x3e\n#include \x3cmorphtarget_pars_vertex\x3e\n#include \x3cskinning_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3cuv_vertex\x3e\n\t#include \x3cskinbase_vertex\x3e\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \x3cbeginnormal_vertex\x3e\n\t\t#include \x3cmorphnormal_vertex\x3e\n\t\t#include \x3cskinnormal_vertex\x3e\n\t#endif\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cmorphtarget_vertex\x3e\n\t#include \x3cskinning_vertex\x3e\n\t#include \x3cdisplacementmap_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\t#include \x3cworldpos_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n\tvWorldPosition \x3d worldPosition.xyz;\n}", equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \x3ccommon\x3e\nvoid main() {\n\tvec3 direction \x3d normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y \x3d asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x \x3d atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor \x3d texture2D( tEquirect, sampleUV );\n\tgl_FragColor \x3d mapTexelToLinear( texColor );\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n}", equirect_vert:"varying vec3 vWorldDirection;\n#include \x3ccommon\x3e\nvoid main() {\n\tvWorldDirection \x3d transformDirection( position, modelMatrix );\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \x3ccommon\x3e\n#include \x3ccolor_pars_fragment\x3e\n#include \x3cfog_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main() {\n\t#include \x3cclipping_planes_fragment\x3e\n\tif ( mod( vLineDistance, totalSize ) \x3e dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight \x3d vec3( 0.0 );\n\tvec4 diffuseColor \x3d vec4( diffuse, opacity );\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#include \x3ccolor_fragment\x3e\n\toutgoingLight \x3d diffuseColor.rgb;\n\tgl_FragColor \x3d vec4( outgoingLight, diffuseColor.a );\n\t#include \x3cpremultiplied_alpha_fragment\x3e\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n\t#include \x3cfog_fragment\x3e\n}", linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \x3ccommon\x3e\n#include \x3ccolor_pars_vertex\x3e\n#include \x3cfog_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3ccolor_vertex\x3e\n\tvLineDistance \x3d scale * lineDistance;\n\tvec4 mvPosition \x3d modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position \x3d projectionMatrix * mvPosition;\n\t#include \x3clogdepthbuf_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n\t#include \x3cfog_vertex\x3e\n}", meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \x3ccommon\x3e\n#include \x3ccolor_pars_fragment\x3e\n#include \x3cuv_pars_fragment\x3e\n#include \x3cuv2_pars_fragment\x3e\n#include \x3cmap_pars_fragment\x3e\n#include \x3calphamap_pars_fragment\x3e\n#include \x3caomap_pars_fragment\x3e\n#include \x3clightmap_pars_fragment\x3e\n#include \x3cenvmap_pars_fragment\x3e\n#include \x3cfog_pars_fragment\x3e\n#include \x3cspecularmap_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main() {\n\t#include \x3cclipping_planes_fragment\x3e\n\tvec4 diffuseColor \x3d vec4( diffuse, opacity );\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#include \x3cmap_fragment\x3e\n\t#include \x3ccolor_fragment\x3e\n\t#include \x3calphamap_fragment\x3e\n\t#include \x3calphatest_fragment\x3e\n\t#include \x3cspecularmap_fragment\x3e\n\tReflectedLight reflectedLight \x3d ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse +\x3d texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse +\x3d vec3( 1.0 );\n\t#endif\n\t#include \x3caomap_fragment\x3e\n\treflectedLight.indirectDiffuse *\x3d diffuseColor.rgb;\n\tvec3 outgoingLight \x3d reflectedLight.indirectDiffuse;\n\t#include \x3cenvmap_fragment\x3e\n\tgl_FragColor \x3d vec4( outgoingLight, diffuseColor.a );\n\t#include \x3cpremultiplied_alpha_fragment\x3e\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n\t#include \x3cfog_fragment\x3e\n}", meshbasic_vert:"#include \x3ccommon\x3e\n#include \x3cuv_pars_vertex\x3e\n#include \x3cuv2_pars_vertex\x3e\n#include \x3cenvmap_pars_vertex\x3e\n#include \x3ccolor_pars_vertex\x3e\n#include \x3cfog_pars_vertex\x3e\n#include \x3cmorphtarget_pars_vertex\x3e\n#include \x3cskinning_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3cuv_vertex\x3e\n\t#include \x3cuv2_vertex\x3e\n\t#include \x3ccolor_vertex\x3e\n\t#include \x3cskinbase_vertex\x3e\n\t#ifdef USE_ENVMAP\n\t#include \x3cbeginnormal_vertex\x3e\n\t#include \x3cmorphnormal_vertex\x3e\n\t#include \x3cskinnormal_vertex\x3e\n\t#include \x3cdefaultnormal_vertex\x3e\n\t#endif\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cmorphtarget_vertex\x3e\n\t#include \x3cskinning_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\t#include \x3clogdepthbuf_vertex\x3e\n\t#include \x3cworldpos_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n\t#include \x3cenvmap_vertex\x3e\n\t#include \x3cfog_vertex\x3e\n}", meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \x3ccommon\x3e\n#include \x3cpacking\x3e\n#include \x3cdithering_pars_fragment\x3e\n#include \x3ccolor_pars_fragment\x3e\n#include \x3cuv_pars_fragment\x3e\n#include \x3cuv2_pars_fragment\x3e\n#include \x3cmap_pars_fragment\x3e\n#include \x3calphamap_pars_fragment\x3e\n#include \x3caomap_pars_fragment\x3e\n#include \x3clightmap_pars_fragment\x3e\n#include \x3cemissivemap_pars_fragment\x3e\n#include \x3cenvmap_pars_fragment\x3e\n#include \x3cbsdfs\x3e\n#include \x3clights_pars_begin\x3e\n#include \x3cfog_pars_fragment\x3e\n#include \x3cshadowmap_pars_fragment\x3e\n#include \x3cshadowmask_pars_fragment\x3e\n#include \x3cspecularmap_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main() {\n\t#include \x3cclipping_planes_fragment\x3e\n\tvec4 diffuseColor \x3d vec4( diffuse, opacity );\n\tReflectedLight reflectedLight \x3d ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance \x3d emissive;\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#include \x3cmap_fragment\x3e\n\t#include \x3ccolor_fragment\x3e\n\t#include \x3calphamap_fragment\x3e\n\t#include \x3calphatest_fragment\x3e\n\t#include \x3cspecularmap_fragment\x3e\n\t#include \x3cemissivemap_fragment\x3e\n\treflectedLight.indirectDiffuse \x3d getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse +\x3d ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse +\x3d vIndirectFront;\n\t#endif\n\t#include \x3clightmap_fragment\x3e\n\treflectedLight.indirectDiffuse *\x3d BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse \x3d ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse \x3d vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *\x3d BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \x3caomap_fragment\x3e\n\tvec3 outgoingLight \x3d reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \x3cenvmap_fragment\x3e\n\tgl_FragColor \x3d vec4( outgoingLight, diffuseColor.a );\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n\t#include \x3cfog_fragment\x3e\n\t#include \x3cpremultiplied_alpha_fragment\x3e\n\t#include \x3cdithering_fragment\x3e\n}", meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \x3ccommon\x3e\n#include \x3cuv_pars_vertex\x3e\n#include \x3cuv2_pars_vertex\x3e\n#include \x3cenvmap_pars_vertex\x3e\n#include \x3cbsdfs\x3e\n#include \x3clights_pars_begin\x3e\n#include \x3ccolor_pars_vertex\x3e\n#include \x3cfog_pars_vertex\x3e\n#include \x3cmorphtarget_pars_vertex\x3e\n#include \x3cskinning_pars_vertex\x3e\n#include \x3cshadowmap_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3cuv_vertex\x3e\n\t#include \x3cuv2_vertex\x3e\n\t#include \x3ccolor_vertex\x3e\n\t#include \x3cbeginnormal_vertex\x3e\n\t#include \x3cmorphnormal_vertex\x3e\n\t#include \x3cskinbase_vertex\x3e\n\t#include \x3cskinnormal_vertex\x3e\n\t#include \x3cdefaultnormal_vertex\x3e\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cmorphtarget_vertex\x3e\n\t#include \x3cskinning_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\t#include \x3clogdepthbuf_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n\t#include \x3cworldpos_vertex\x3e\n\t#include \x3cenvmap_vertex\x3e\n\t#include \x3clights_lambert_vertex\x3e\n\t#include \x3cshadowmap_vertex\x3e\n\t#include \x3cfog_vertex\x3e\n}", meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \x3ccommon\x3e\n#include \x3cuv_pars_fragment\x3e\n#include \x3cmap_pars_fragment\x3e\n#include \x3calphamap_pars_fragment\x3e\n#include \x3cfog_pars_fragment\x3e\n#include \x3cbumpmap_pars_fragment\x3e\n#include \x3cnormalmap_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main() {\n\t#include \x3cclipping_planes_fragment\x3e\n\tvec4 diffuseColor \x3d vec4( diffuse, opacity );\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#include \x3cmap_fragment\x3e\n\t#include \x3calphamap_fragment\x3e\n\t#include \x3calphatest_fragment\x3e\n\t#include \x3cnormal_fragment_begin\x3e\n\t#include \x3cnormal_fragment_maps\x3e\n\tvec3 viewDir \x3d normalize( vViewPosition );\n\tvec3 x \x3d normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y \x3d cross( viewDir, x );\n\tvec2 uv \x3d vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor \x3d texture2D( matcap, uv );\n\t\tmatcapColor \x3d matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor \x3d vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight \x3d diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor \x3d vec4( outgoingLight, diffuseColor.a );\n\t#include \x3cpremultiplied_alpha_fragment\x3e\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n\t#include \x3cfog_fragment\x3e\n}", meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \x3ccommon\x3e\n#include \x3cuv_pars_vertex\x3e\n#include \x3cdisplacementmap_pars_vertex\x3e\n#include \x3cfog_pars_vertex\x3e\n#include \x3cmorphtarget_pars_vertex\x3e\n#include \x3cskinning_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3cuv_vertex\x3e\n\t#include \x3cbeginnormal_vertex\x3e\n\t#include \x3cmorphnormal_vertex\x3e\n\t#include \x3cskinbase_vertex\x3e\n\t#include \x3cskinnormal_vertex\x3e\n\t#include \x3cdefaultnormal_vertex\x3e\n\t#ifndef FLAT_SHADED\n\t\tvNormal \x3d normalize( transformedNormal );\n\t#endif\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cmorphtarget_vertex\x3e\n\t#include \x3cskinning_vertex\x3e\n\t#include \x3cdisplacementmap_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\t#include \x3clogdepthbuf_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n\t#include \x3cfog_vertex\x3e\n\tvViewPosition \x3d - mvPosition.xyz;\n}", meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \x3ccommon\x3e\n#include \x3cpacking\x3e\n#include \x3cdithering_pars_fragment\x3e\n#include \x3ccolor_pars_fragment\x3e\n#include \x3cuv_pars_fragment\x3e\n#include \x3cuv2_pars_fragment\x3e\n#include \x3cmap_pars_fragment\x3e\n#include \x3calphamap_pars_fragment\x3e\n#include \x3caomap_pars_fragment\x3e\n#include \x3clightmap_pars_fragment\x3e\n#include \x3cemissivemap_pars_fragment\x3e\n#include \x3cenvmap_pars_fragment\x3e\n#include \x3cgradientmap_pars_fragment\x3e\n#include \x3cfog_pars_fragment\x3e\n#include \x3cbsdfs\x3e\n#include \x3clights_pars_begin\x3e\n#include \x3clights_phong_pars_fragment\x3e\n#include \x3cshadowmap_pars_fragment\x3e\n#include \x3cbumpmap_pars_fragment\x3e\n#include \x3cnormalmap_pars_fragment\x3e\n#include \x3cspecularmap_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main() {\n\t#include \x3cclipping_planes_fragment\x3e\n\tvec4 diffuseColor \x3d vec4( diffuse, opacity );\n\tReflectedLight reflectedLight \x3d ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance \x3d emissive;\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#include \x3cmap_fragment\x3e\n\t#include \x3ccolor_fragment\x3e\n\t#include \x3calphamap_fragment\x3e\n\t#include \x3calphatest_fragment\x3e\n\t#include \x3cspecularmap_fragment\x3e\n\t#include \x3cnormal_fragment_begin\x3e\n\t#include \x3cnormal_fragment_maps\x3e\n\t#include \x3cemissivemap_fragment\x3e\n\t#include \x3clights_phong_fragment\x3e\n\t#include \x3clights_fragment_begin\x3e\n\t#include \x3clights_fragment_maps\x3e\n\t#include \x3clights_fragment_end\x3e\n\t#include \x3caomap_fragment\x3e\n\tvec3 outgoingLight \x3d reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \x3cenvmap_fragment\x3e\n\tgl_FragColor \x3d vec4( outgoingLight, diffuseColor.a );\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n\t#include \x3cfog_fragment\x3e\n\t#include \x3cpremultiplied_alpha_fragment\x3e\n\t#include \x3cdithering_fragment\x3e\n}", meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \x3ccommon\x3e\n#include \x3cuv_pars_vertex\x3e\n#include \x3cuv2_pars_vertex\x3e\n#include \x3cdisplacementmap_pars_vertex\x3e\n#include \x3cenvmap_pars_vertex\x3e\n#include \x3ccolor_pars_vertex\x3e\n#include \x3cfog_pars_vertex\x3e\n#include \x3cmorphtarget_pars_vertex\x3e\n#include \x3cskinning_pars_vertex\x3e\n#include \x3cshadowmap_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3cuv_vertex\x3e\n\t#include \x3cuv2_vertex\x3e\n\t#include \x3ccolor_vertex\x3e\n\t#include \x3cbeginnormal_vertex\x3e\n\t#include \x3cmorphnormal_vertex\x3e\n\t#include \x3cskinbase_vertex\x3e\n\t#include \x3cskinnormal_vertex\x3e\n\t#include \x3cdefaultnormal_vertex\x3e\n#ifndef FLAT_SHADED\n\tvNormal \x3d normalize( transformedNormal );\n#endif\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cmorphtarget_vertex\x3e\n\t#include \x3cskinning_vertex\x3e\n\t#include \x3cdisplacementmap_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\t#include \x3clogdepthbuf_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n\tvViewPosition \x3d - mvPosition.xyz;\n\t#include \x3cworldpos_vertex\x3e\n\t#include \x3cenvmap_vertex\x3e\n\t#include \x3cshadowmap_vertex\x3e\n\t#include \x3cfog_vertex\x3e\n}", meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \x3ccommon\x3e\n#include \x3cpacking\x3e\n#include \x3cdithering_pars_fragment\x3e\n#include \x3ccolor_pars_fragment\x3e\n#include \x3cuv_pars_fragment\x3e\n#include \x3cuv2_pars_fragment\x3e\n#include \x3cmap_pars_fragment\x3e\n#include \x3calphamap_pars_fragment\x3e\n#include \x3caomap_pars_fragment\x3e\n#include \x3clightmap_pars_fragment\x3e\n#include \x3cemissivemap_pars_fragment\x3e\n#include \x3cbsdfs\x3e\n#include \x3ccube_uv_reflection_fragment\x3e\n#include \x3cenvmap_pars_fragment\x3e\n#include \x3cenvmap_physical_pars_fragment\x3e\n#include \x3cfog_pars_fragment\x3e\n#include \x3clights_pars_begin\x3e\n#include \x3clights_physical_pars_fragment\x3e\n#include \x3cshadowmap_pars_fragment\x3e\n#include \x3cbumpmap_pars_fragment\x3e\n#include \x3cnormalmap_pars_fragment\x3e\n#include \x3croughnessmap_pars_fragment\x3e\n#include \x3cmetalnessmap_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main() {\n\t#include \x3cclipping_planes_fragment\x3e\n\tvec4 diffuseColor \x3d vec4( diffuse, opacity );\n\tReflectedLight reflectedLight \x3d ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance \x3d emissive;\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#include \x3cmap_fragment\x3e\n\t#include \x3ccolor_fragment\x3e\n\t#include \x3calphamap_fragment\x3e\n\t#include \x3calphatest_fragment\x3e\n\t#include \x3croughnessmap_fragment\x3e\n\t#include \x3cmetalnessmap_fragment\x3e\n\t#include \x3cnormal_fragment_begin\x3e\n\t#include \x3cnormal_fragment_maps\x3e\n\t#include \x3cemissivemap_fragment\x3e\n\t#include \x3clights_physical_fragment\x3e\n\t#include \x3clights_fragment_begin\x3e\n\t#include \x3clights_fragment_maps\x3e\n\t#include \x3clights_fragment_end\x3e\n\t#include \x3caomap_fragment\x3e\n\tvec3 outgoingLight \x3d reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor \x3d vec4( outgoingLight, diffuseColor.a );\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n\t#include \x3cfog_fragment\x3e\n\t#include \x3cpremultiplied_alpha_fragment\x3e\n\t#include \x3cdithering_fragment\x3e\n}", meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \x3ccommon\x3e\n#include \x3cuv_pars_vertex\x3e\n#include \x3cuv2_pars_vertex\x3e\n#include \x3cdisplacementmap_pars_vertex\x3e\n#include \x3ccolor_pars_vertex\x3e\n#include \x3cfog_pars_vertex\x3e\n#include \x3cmorphtarget_pars_vertex\x3e\n#include \x3cskinning_pars_vertex\x3e\n#include \x3cshadowmap_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3cuv_vertex\x3e\n\t#include \x3cuv2_vertex\x3e\n\t#include \x3ccolor_vertex\x3e\n\t#include \x3cbeginnormal_vertex\x3e\n\t#include \x3cmorphnormal_vertex\x3e\n\t#include \x3cskinbase_vertex\x3e\n\t#include \x3cskinnormal_vertex\x3e\n\t#include \x3cdefaultnormal_vertex\x3e\n#ifndef FLAT_SHADED\n\tvNormal \x3d normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent \x3d normalize( transformedTangent );\n\t\tvBitangent \x3d normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cmorphtarget_vertex\x3e\n\t#include \x3cskinning_vertex\x3e\n\t#include \x3cdisplacementmap_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\t#include \x3clogdepthbuf_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n\tvViewPosition \x3d - mvPosition.xyz;\n\t#include \x3cworldpos_vertex\x3e\n\t#include \x3cshadowmap_vertex\x3e\n\t#include \x3cfog_vertex\x3e\n}", normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) \x26\x26 ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \x3cpacking\x3e\n#include \x3cuv_pars_fragment\x3e\n#include \x3cbumpmap_pars_fragment\x3e\n#include \x3cnormalmap_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\nvoid main() {\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#include \x3cnormal_fragment_begin\x3e\n\t#include \x3cnormal_fragment_maps\x3e\n\tgl_FragColor \x3d vec4( packNormalToRGB( normal ), opacity );\n}", normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) \x26\x26 ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \x3cuv_pars_vertex\x3e\n#include \x3cdisplacementmap_pars_vertex\x3e\n#include \x3cmorphtarget_pars_vertex\x3e\n#include \x3cskinning_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\nvoid main() {\n\t#include \x3cuv_vertex\x3e\n\t#include \x3cbeginnormal_vertex\x3e\n\t#include \x3cmorphnormal_vertex\x3e\n\t#include \x3cskinbase_vertex\x3e\n\t#include \x3cskinnormal_vertex\x3e\n\t#include \x3cdefaultnormal_vertex\x3e\n#ifndef FLAT_SHADED\n\tvNormal \x3d normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent \x3d normalize( transformedTangent );\n\t\tvBitangent \x3d normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cmorphtarget_vertex\x3e\n\t#include \x3cskinning_vertex\x3e\n\t#include \x3cdisplacementmap_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\t#include \x3clogdepthbuf_vertex\x3e\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) \x26\x26 ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition \x3d - mvPosition.xyz;\n#endif\n}", points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \x3ccommon\x3e\n#include \x3ccolor_pars_fragment\x3e\n#include \x3cmap_particle_pars_fragment\x3e\n#include \x3cfog_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main() {\n\t#include \x3cclipping_planes_fragment\x3e\n\tvec3 outgoingLight \x3d vec3( 0.0 );\n\tvec4 diffuseColor \x3d vec4( diffuse, opacity );\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#include \x3cmap_particle_fragment\x3e\n\t#include \x3ccolor_fragment\x3e\n\t#include \x3calphatest_fragment\x3e\n\toutgoingLight \x3d diffuseColor.rgb;\n\tgl_FragColor \x3d vec4( outgoingLight, diffuseColor.a );\n\t#include \x3cpremultiplied_alpha_fragment\x3e\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n\t#include \x3cfog_fragment\x3e\n}", points_vert:"uniform float size;\nuniform float scale;\n#include \x3ccommon\x3e\n#include \x3ccolor_pars_vertex\x3e\n#include \x3cfog_pars_vertex\x3e\n#include \x3cmorphtarget_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3ccolor_vertex\x3e\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cmorphtarget_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\tgl_PointSize \x3d size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective \x3d ( projectionMatrix[ 2 ][ 3 ] \x3d\x3d - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *\x3d ( scale / - mvPosition.z );\n\t#endif\n\t#include \x3clogdepthbuf_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n\t#include \x3cworldpos_vertex\x3e\n\t#include \x3cfog_vertex\x3e\n}", shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \x3ccommon\x3e\n#include \x3cpacking\x3e\n#include \x3cfog_pars_fragment\x3e\n#include \x3cbsdfs\x3e\n#include \x3clights_pars_begin\x3e\n#include \x3cshadowmap_pars_fragment\x3e\n#include \x3cshadowmask_pars_fragment\x3e\nvoid main() {\n\tgl_FragColor \x3d vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \x3cfog_fragment\x3e\n}",shadow_vert:"#include \x3cfog_pars_vertex\x3e\n#include \x3cshadowmap_pars_vertex\x3e\nvoid main() {\n\t#include \x3cbegin_vertex\x3e\n\t#include \x3cproject_vertex\x3e\n\t#include \x3cworldpos_vertex\x3e\n\t#include \x3cshadowmap_vertex\x3e\n\t#include \x3cfog_vertex\x3e\n}", sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \x3ccommon\x3e\n#include \x3cuv_pars_fragment\x3e\n#include \x3cmap_pars_fragment\x3e\n#include \x3cfog_pars_fragment\x3e\n#include \x3clogdepthbuf_pars_fragment\x3e\n#include \x3cclipping_planes_pars_fragment\x3e\nvoid main() {\n\t#include \x3cclipping_planes_fragment\x3e\n\tvec3 outgoingLight \x3d vec3( 0.0 );\n\tvec4 diffuseColor \x3d vec4( diffuse, opacity );\n\t#include \x3clogdepthbuf_fragment\x3e\n\t#include \x3cmap_fragment\x3e\n\t#include \x3calphatest_fragment\x3e\n\toutgoingLight \x3d diffuseColor.rgb;\n\tgl_FragColor \x3d vec4( outgoingLight, diffuseColor.a );\n\t#include \x3ctonemapping_fragment\x3e\n\t#include \x3cencodings_fragment\x3e\n\t#include \x3cfog_fragment\x3e\n}", sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \x3ccommon\x3e\n#include \x3cuv_pars_vertex\x3e\n#include \x3cfog_pars_vertex\x3e\n#include \x3clogdepthbuf_pars_vertex\x3e\n#include \x3cclipping_planes_pars_vertex\x3e\nvoid main() {\n\t#include \x3cuv_vertex\x3e\n\tvec4 mvPosition \x3d modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x \x3d length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y \x3d length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective \x3d ( projectionMatrix[ 2 ][ 3 ] \x3d\x3d - 1.0 );\n\t\tif ( isPerspective ) scale *\x3d - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition \x3d ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x \x3d cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y \x3d sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy +\x3d rotatedPosition;\n\tgl_Position \x3d projectionMatrix * mvPosition;\n\t#include \x3clogdepthbuf_vertex\x3e\n\t#include \x3cclipping_planes_vertex\x3e\n\t#include \x3cfog_vertex\x3e\n}"}, Zo={clone:J,merge:F},$o={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643, darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055, grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184, lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130, palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780, teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Object.assign(E.prototype,{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255; return this},setRGB:function(a,c,e){this.r=a;this.g=c;this.b=e;return this},setHSL:function(){function a(c,e,g){0>g&&(g+=1);1<g&&--g;return g<1/6?c+6*(e-c)*g:.5>g?e:g<2/3?c+6*(e-c)*(2/3-g):c}return function(c,e,g){c=ab.euclideanModulo(c,1);e=ab.clamp(e,0,1);g=ab.clamp(g,0,1);0===e?this.r=this.g=this.b=g:(e=.5>=g?g*(1+e):g+e-g*e,g=2*g-e,this.r=a(g,e,c+1/3),this.g=a(g,e,c),this.b=a(g,e,c-1/3));return this}}(),setStyle:function(a){function c(u){void 0!==u&&1>parseFloat(u)&&console.warn("THREE.Color: Alpha component of "+ a+" will be ignored.")}var e;if(e=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var g=e[2];switch(e[1]){case "rgb":case "rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(g))return 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,c(e[5]),this;if(e=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(g))return 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,c(e[5]),this;break;case "hsl":case "hsla":if(e=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(g)){g=parseFloat(e[1])/360;var k=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100;c(e[5]);return this.setHSL(g,k,r)}}}else if(e=/^#([A-Fa-f0-9]+)$/.exec(a)){e=e[1];g=e.length;if(3===g)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2), 16)/255,this;if(6===g)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}a&&0<a.length&&(e=$o[a],void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+a));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a,c){void 0===c&&(c=2);this.r=Math.pow(a.r,c);this.g=Math.pow(a.g, c);this.b=Math.pow(a.b,c);return this},copyLinearToGamma:function(a,c){void 0===c&&(c=2);c=0<c?1/c:1;this.r=Math.pow(a.r,c);this.g=Math.pow(a.g,c);this.b=Math.pow(a.b,c);return this},convertGammaToLinear:function(a){this.copyGammaToLinear(this,a);return this},convertLinearToGamma:function(a){this.copyLinearToGamma(this,a);return this},copySRGBToLinear:function(){function a(c){return.04045>c?.0773993808*c:Math.pow(.9478672986*c+.0521327014,2.4)}return function(c){this.r=a(c.r);this.g=a(c.g);this.b= a(c.b);return this}}(),copyLinearToSRGB:function(){function a(c){return.0031308>c?12.92*c:1.055*Math.pow(c,.41666)-.055}return function(c){this.r=a(c.r);this.g=a(c.g);this.b=a(c.b);return this}}(),convertSRGBToLinear:function(){this.copySRGBToLinear(this);return this},convertLinearToSRGB:function(){this.copyLinearToSRGB(this);return 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(a){void 0=== a&&(console.warn("THREE.Color: .getHSL() target is now required"),a={h:0,s:0,l:0});var c=this.r,e=this.g,g=this.b,k=Math.max(c,e,g),r=Math.min(c,e,g),u,A=(r+k)/2;if(r===k)r=u=0;else{var B=k-r;r=.5>=A?B/(k+r):B/(2-k-r);switch(k){case c:u=(e-g)/B+(e<g?6:0);break;case e:u=(g-c)/B+2;break;case g:u=(c-e)/B+4}u/=6}a.h=u;a.s=r;a.l=A;return a},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(){var a={};return function(c,e,g){this.getHSL(a);a.h+= c;a.s+=e;a.l+=g;this.setHSL(a.h,a.s,a.l);return this}}(),add:function(a){this.r+=a.r;this.g+=a.g;this.b+=a.b;return this},addColors:function(a,c){this.r=a.r+c.r;this.g=a.g+c.g;this.b=a.b+c.b;return this},addScalar:function(a){this.r+=a;this.g+=a;this.b+=a;return this},sub:function(a){this.r=Math.max(0,this.r-a.r);this.g=Math.max(0,this.g-a.g);this.b=Math.max(0,this.b-a.b);return this},multiply:function(a){this.r*=a.r;this.g*=a.g;this.b*=a.b;return this},multiplyScalar:function(a){this.r*=a;this.g*= a;this.b*=a;return this},lerp:function(a,c){this.r+=(a.r-this.r)*c;this.g+=(a.g-this.g)*c;this.b+=(a.b-this.b)*c;return this},lerpHSL:function(){var a={h:0,s:0,l:0},c={h:0,s:0,l:0};return function(e,g){this.getHSL(a);e.getHSL(c);e=ab.lerp(a.h,c.h,g);var k=ab.lerp(a.s,c.s,g);g=ab.lerp(a.l,c.l,g);this.setHSL(e,k,g);return this}}(),equals:function(a){return a.r===this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a,c){void 0===c&&(c=0);this.r=a[c];this.g=a[c+1];this.b=a[c+2];return this},toArray:function(a, c){void 0===a&&(a=[]);void 0===c&&(c=0);a[c]=this.r;a[c+1]=this.g;a[c+2]=this.b;return a},toJSON:function(){return this.getHex()}});var Ra={common:{diffuse:{value:new E(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new w},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null}, lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new f(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:2.5E-4},fogNear:{value:1},fogFar:{value:2E3},fogColor:{value:new E(16777215)}}, lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{}, position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new E(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new w}},sprite:{diffuse:{value:new E(15658734)}, opacity:{value:1},center:{value:new f(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new w}}},Xc={basic:{uniforms:F([Ra.common,Ra.specularmap,Ra.envmap,Ra.aomap,Ra.lightmap,Ra.fog]),vertexShader:mb.meshbasic_vert,fragmentShader:mb.meshbasic_frag},lambert:{uniforms:F([Ra.common,Ra.specularmap,Ra.envmap,Ra.aomap,Ra.lightmap,Ra.emissivemap,Ra.fog,Ra.lights,{emissive:{value:new E(0)}}]),vertexShader:mb.meshlambert_vert,fragmentShader:mb.meshlambert_frag},phong:{uniforms:F([Ra.common,Ra.specularmap, Ra.envmap,Ra.aomap,Ra.lightmap,Ra.emissivemap,Ra.bumpmap,Ra.normalmap,Ra.displacementmap,Ra.gradientmap,Ra.fog,Ra.lights,{emissive:{value:new E(0)},specular:{value:new E(1118481)},shininess:{value:30}}]),vertexShader:mb.meshphong_vert,fragmentShader:mb.meshphong_frag},standard:{uniforms:F([Ra.common,Ra.envmap,Ra.aomap,Ra.lightmap,Ra.emissivemap,Ra.bumpmap,Ra.normalmap,Ra.displacementmap,Ra.roughnessmap,Ra.metalnessmap,Ra.fog,Ra.lights,{emissive:{value:new E(0)},roughness:{value:.5},metalness:{value:.5}, envMapIntensity:{value:1}}]),vertexShader:mb.meshphysical_vert,fragmentShader:mb.meshphysical_frag},matcap:{uniforms:F([Ra.common,Ra.bumpmap,Ra.normalmap,Ra.displacementmap,Ra.fog,{matcap:{value:null}}]),vertexShader:mb.meshmatcap_vert,fragmentShader:mb.meshmatcap_frag},points:{uniforms:F([Ra.points,Ra.fog]),vertexShader:mb.points_vert,fragmentShader:mb.points_frag},dashed:{uniforms:F([Ra.common,Ra.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:mb.linedashed_vert,fragmentShader:mb.linedashed_frag}, depth:{uniforms:F([Ra.common,Ra.displacementmap]),vertexShader:mb.depth_vert,fragmentShader:mb.depth_frag},normal:{uniforms:F([Ra.common,Ra.bumpmap,Ra.normalmap,Ra.displacementmap,{opacity:{value:1}}]),vertexShader:mb.normal_vert,fragmentShader:mb.normal_frag},sprite:{uniforms:F([Ra.sprite,Ra.fog]),vertexShader:mb.sprite_vert,fragmentShader:mb.sprite_frag},background:{uniforms:{uvTransform:{value:new w},t2D:{value:null}},vertexShader:mb.background_vert,fragmentShader:mb.background_frag},cube:{uniforms:{tCube:{value:null}, tFlip:{value:-1},opacity:{value:1}},vertexShader:mb.cube_vert,fragmentShader:mb.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:mb.equirect_vert,fragmentShader:mb.equirect_frag},distanceRGBA:{uniforms:F([Ra.common,Ra.displacementmap,{referencePosition:{value:new m},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:mb.distanceRGBA_vert,fragmentShader:mb.distanceRGBA_frag},shadow:{uniforms:F([Ra.lights,Ra.fog,{color:{value:new E(0)},opacity:{value:1}}]),vertexShader:mb.shadow_vert, fragmentShader:mb.shadow_frag}};Xc.physical={uniforms:F([Xc.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:mb.meshphysical_vert,fragmentShader:mb.meshphysical_frag};Object.assign(M.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a=a.a;this.b=a.b;this.c=a.c;this.normal.copy(a.normal);this.color.copy(a.color);this.materialIndex=a.materialIndex;for(var c=0,e=a.vertexNormals.length;c<e;c++)this.vertexNormals[c]=a.vertexNormals[c].clone(); c=0;for(e=a.vertexColors.length;c<e;c++)this.vertexColors[c]=a.vertexColors[c].clone();return this}});R.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");R.DefaultOrder="XYZ";Object.defineProperties(R.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},order:{get:function(){return this._order}, set:function(a){this._order=a;this.onChangeCallback()}}});Object.assign(R.prototype,{isEuler:!0,set:function(a,c,e,g){this._x=a;this._y=c;this._z=e;this._order=g||this._order;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,c,e){var g=ab.clamp,k=a.elements;a=k[0];var r=k[4],u=k[8],A= k[1],B=k[5],C=k[9],H=k[2],I=k[6];k=k[10];c=c||this._order;"XYZ"===c?(this._y=Math.asin(g(u,-1,1)),.99999>Math.abs(u)?(this._x=Math.atan2(-C,k),this._z=Math.atan2(-r,a)):(this._x=Math.atan2(I,B),this._z=0)):"YXZ"===c?(this._x=Math.asin(-g(C,-1,1)),.99999>Math.abs(C)?(this._y=Math.atan2(u,k),this._z=Math.atan2(A,B)):(this._y=Math.atan2(-H,a),this._z=0)):"ZXY"===c?(this._x=Math.asin(g(I,-1,1)),.99999>Math.abs(I)?(this._y=Math.atan2(-H,k),this._z=Math.atan2(-r,B)):(this._y=0,this._z=Math.atan2(A,a))): "ZYX"===c?(this._y=Math.asin(-g(H,-1,1)),.99999>Math.abs(H)?(this._x=Math.atan2(I,k),this._z=Math.atan2(A,a)):(this._x=0,this._z=Math.atan2(-r,B))):"YZX"===c?(this._z=Math.asin(g(A,-1,1)),.99999>Math.abs(A)?(this._x=Math.atan2(-C,B),this._y=Math.atan2(-H,a)):(this._x=0,this._y=Math.atan2(u,k))):"XZY"===c?(this._z=Math.asin(-g(r,-1,1)),.99999>Math.abs(r)?(this._x=Math.atan2(I,B),this._y=Math.atan2(u,a)):(this._x=Math.atan2(-C,k),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+ c);this._order=c;if(!1!==e)this.onChangeCallback();return this},setFromQuaternion:function(){var a=new G;return function(c,e,g){a.makeRotationFromQuaternion(c);return this.setFromRotationMatrix(a,e,g)}}(),setFromVector3:function(a,c){return this.set(a.x,a.y,a.z,c||this._order)},reorder:function(){var a=new h;return function(c){a.setFromEuler(this);return this.setFromQuaternion(a,c)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x= a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,c){void 0===a&&(a=[]);void 0===c&&(c=0);a[c]=this._x;a[c+1]=this._y;a[c+2]=this._z;a[c+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new m(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(Z.prototype,{set:function(a){this.mask=1<<a|0},enable:function(a){this.mask= this.mask|1<<a|0},toggle:function(a){this.mask^=1<<a|0},disable:function(a){this.mask&=~(1<<a|0)},test:function(a){return 0!==(this.mask&a.mask)}});var Jn=0;T.DefaultUp=new m(0,1,0);T.DefaultMatrixAutoUpdate=!0;T.prototype=Object.assign(Object.create(d.prototype),{constructor:T,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(a){this.matrixAutoUpdate&&this.updateMatrix();this.matrix.premultiply(a);this.matrix.decompose(this.position,this.quaternion,this.scale)}, applyQuaternion:function(a){this.quaternion.premultiply(a);return this},setRotationFromAxisAngle:function(a,c){this.quaternion.setFromAxisAngle(a,c)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new h;return function(c,e){a.setFromAxisAngle(c,e);this.quaternion.multiply(a);return this}}(),rotateOnWorldAxis:function(){var a= new h;return function(c,e){a.setFromAxisAngle(c,e);this.quaternion.premultiply(a);return this}}(),rotateX:function(){var a=new m(1,0,0);return function(c){return this.rotateOnAxis(a,c)}}(),rotateY:function(){var a=new m(0,1,0);return function(c){return this.rotateOnAxis(a,c)}}(),rotateZ:function(){var a=new m(0,0,1);return function(c){return this.rotateOnAxis(a,c)}}(),translateOnAxis:function(){var a=new m;return function(c,e){a.copy(c).applyQuaternion(this.quaternion);this.position.add(a.multiplyScalar(e)); return this}}(),translateX:function(){var a=new m(1,0,0);return function(c){return this.translateOnAxis(a,c)}}(),translateY:function(){var a=new m(0,1,0);return function(c){return this.translateOnAxis(a,c)}}(),translateZ:function(){var a=new m(0,0,1);return function(c){return this.translateOnAxis(a,c)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new G;return function(c){return c.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a= new h,c=new G,e=new m,g=new m;return function(k,r,u){k.isVector3?e.copy(k):e.set(k,r,u);k=this.parent;this.updateWorldMatrix(!0,!1);g.setFromMatrixPosition(this.matrixWorld);this.isCamera||this.isLight?c.lookAt(g,e,this.up):c.lookAt(e,g,this.up);this.quaternion.setFromRotationMatrix(c);k&&(c.extractRotation(k.matrixWorld),a.setFromRotationMatrix(c),this.quaternion.premultiply(a.inverse()))}}(),add:function(a){if(1<arguments.length){for(var c=0;c<arguments.length;c++)this.add(arguments[c]);return this}if(a=== this)return console.error("THREE.Object3D.add: object can't be added as a child of itself.",a),this;a&&a.isObject3D?(null!==a.parent&&a.parent.remove(a),a.parent=this,a.dispatchEvent({type:"added"}),this.children.push(a)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",a);return this},remove:function(a){if(1<arguments.length){for(var c=0;c<arguments.length;c++)this.remove(arguments[c]);return this}c=this.children.indexOf(a);-1!==c&&(a.parent=null,a.dispatchEvent({type:"removed"}), this.children.splice(c,1));return this},getObjectById:function(a){return this.getObjectByProperty("id",a)},getObjectByName:function(a){return this.getObjectByProperty("name",a)},getObjectByProperty:function(a,c){if(this[a]===c)return this;for(var e=0,g=this.children.length;e<g;e++){var k=this.children[e].getObjectByProperty(a,c);if(void 0!==k)return k}},getWorldPosition:function(a){void 0===a&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),a=new m);this.updateMatrixWorld(!0); return a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new m,c=new m;return function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new h);this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,e,c);return e}}(),getWorldScale:function(){var a=new m,c=new h;return function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new m);this.updateMatrixWorld(!0);this.matrixWorld.decompose(a, c,e);return e}}(),getWorldDirection:function(a){void 0===a&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),a=new m);this.updateMatrixWorld(!0);var c=this.matrixWorld.elements;return a.set(c[8],c[9],c[10]).normalize()},raycast:function(){},traverse:function(a){a(this);for(var c=this.children,e=0,g=c.length;e<g;e++)c[e].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var c=this.children,e=0,g=c.length;e<g;e++)c[e].traverseVisible(a)}},traverseAncestors:function(a){var c= this.parent;null!==c&&(a(c),c.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var c=this.children,e=0,g=c.length;e<g;e++)c[e].updateMatrixWorld(a)}, updateWorldMatrix:function(a,c){var e=this.parent;!0===a&&null!==e&&e.updateWorldMatrix(!0,!1);this.matrixAutoUpdate&&this.updateMatrix();null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix);if(!0===c)for(a=this.children,c=0,e=a.length;c<e;c++)a[c].updateWorldMatrix(!1,!0)},toJSON:function(a){function c(H,I){void 0===H[I.uuid]&&(H[I.uuid]=I.toJSON(a));return I.uuid}function e(H){var I=[],K;for(K in H){var P=H[K];delete P.metadata; I.push(P)}return I}var g=void 0===a||"string"===typeof a,k={};g&&(a={geometries:{},materials:{},textures:{},images:{},shapes:{}},k.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};r.uuid=this.uuid;r.type=this.type;""!==this.name&&(r.name=this.name);!0===this.castShadow&&(r.castShadow=!0);!0===this.receiveShadow&&(r.receiveShadow=!0);!1===this.visible&&(r.visible=!1);!1===this.frustumCulled&&(r.frustumCulled=!1);0!==this.renderOrder&&(r.renderOrder=this.renderOrder);"{}"!== JSON.stringify(this.userData)&&(r.userData=this.userData);r.layers=this.layers.mask;r.matrix=this.matrix.toArray();!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1);this.isMesh&&0!==this.drawMode&&(r.drawMode=this.drawMode);if(this.isMesh||this.isLine||this.isPoints){r.geometry=c(a.geometries,this.geometry);var u=this.geometry.parameters;if(void 0!==u&&void 0!==u.shapes)if(u=u.shapes,Array.isArray(u))for(var A=0,B=u.length;A<B;A++)c(a.shapes,u[A]);else c(a.shapes,u)}if(void 0!==this.material)if(Array.isArray(this.material)){u= [];A=0;for(B=this.material.length;A<B;A++)u.push(c(a.materials,this.material[A]));r.material=u}else r.material=c(a.materials,this.material);if(0<this.children.length)for(r.children=[],A=0;A<this.children.length;A++)r.children.push(this.children[A].toJSON(a).object);if(g){g=e(a.geometries);A=e(a.materials);B=e(a.textures);var C=e(a.images);u=e(a.shapes);0<g.length&&(k.geometries=g);0<A.length&&(k.materials=A);0<B.length&&(k.textures=B);0<C.length&&(k.images=C);0<u.length&&(k.shapes=u)}k.object=r;return k}, clone:function(a){return(new this.constructor).copy(this,a)},copy:function(a,c){void 0===c&&(c=!0);this.name=a.name;this.up.copy(a.up);this.position.copy(a.position);this.quaternion.copy(a.quaternion);this.scale.copy(a.scale);this.matrix.copy(a.matrix);this.matrixWorld.copy(a.matrixWorld);this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrixWorldNeedsUpdate=a.matrixWorldNeedsUpdate;this.layers.mask=a.layers.mask;this.visible=a.visible;this.castShadow=a.castShadow;this.receiveShadow=a.receiveShadow; this.frustumCulled=a.frustumCulled;this.renderOrder=a.renderOrder;this.userData=JSON.parse(JSON.stringify(a.userData));if(!0===c)for(c=0;c<a.children.length;c++)this.add(a.children[c].clone());return this}});var Kn=0;Y.prototype=Object.assign(Object.create(d.prototype),{constructor:Y,isGeometry:!0,applyMatrix:function(a){for(var c=(new w).getNormalMatrix(a),e=0,g=this.vertices.length;e<g;e++)this.vertices[e].applyMatrix4(a);e=0;for(g=this.faces.length;e<g;e++){a=this.faces[e];a.normal.applyMatrix3(c).normalize(); for(var k=0,r=a.vertexNormals.length;k<r;k++)a.vertexNormals[k].applyMatrix3(c).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=this.verticesNeedUpdate=!0;return this},rotateX:function(){var a=new G;return function(c){a.makeRotationX(c);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new G;return function(c){a.makeRotationY(c);this.applyMatrix(a);return this}}(),rotateZ:function(){var a=new G; return function(c){a.makeRotationZ(c);this.applyMatrix(a);return this}}(),translate:function(){var a=new G;return function(c,e,g){a.makeTranslation(c,e,g);this.applyMatrix(a);return this}}(),scale:function(){var a=new G;return function(c,e,g){a.makeScale(c,e,g);this.applyMatrix(a);return this}}(),lookAt:function(){var a=new T;return function(c){a.lookAt(c);a.updateMatrix();this.applyMatrix(a.matrix)}}(),fromBufferGeometry:function(a){function c(O,S,V,ca){var ha=void 0===A?[]:[e.colors[O].clone(), e.colors[S].clone(),e.colors[V].clone()],ba=void 0===u?[]:[(new m).fromArray(u,3*O),(new m).fromArray(u,3*S),(new m).fromArray(u,3*V)];ca=new M(O,S,V,ba,ha,ca);e.faces.push(ca);void 0!==B&&e.faceVertexUvs[0].push([(new f).fromArray(B,2*O),(new f).fromArray(B,2*S),(new f).fromArray(B,2*V)]);void 0!==C&&e.faceVertexUvs[1].push([(new f).fromArray(C,2*O),(new f).fromArray(C,2*S),(new f).fromArray(C,2*V)])}var e=this,g=null!==a.index?a.index.array:void 0,k=a.attributes,r=k.position.array,u=void 0!==k.normal? k.normal.array:void 0,A=void 0!==k.color?k.color.array:void 0,B=void 0!==k.uv?k.uv.array:void 0,C=void 0!==k.uv2?k.uv2.array:void 0;void 0!==C&&(this.faceVertexUvs[1]=[]);for(var H=k=0;k<r.length;k+=3,H+=2)e.vertices.push((new m).fromArray(r,k)),void 0!==A&&e.colors.push((new E).fromArray(A,k));var I=a.groups;if(0<I.length)for(k=0;k<I.length;k++){r=I[k];var K=r.start,P=r.count;H=K;for(K+=P;H<K;H+=3)void 0!==g?c(g[H],g[H+1],g[H+2],r.materialIndex):c(H,H+1,H+2,r.materialIndex)}else if(void 0!==g)for(k= 0;k<g.length;k+=3)c(g[k],g[k+1],g[k+2]);else for(k=0;k<r.length/3;k+=3)c(k,k+1,k+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){var a=new m;return function(){this.computeBoundingBox();this.boundingBox.getCenter(a).negate();this.translate(a.x,a.y,a.z);return this}}(),normalize:function(){this.computeBoundingSphere();var a=this.boundingSphere.center,c=this.boundingSphere.radius; c=0===c?1:1/c;var e=new G;e.set(c,0,0,-c*a.x,0,c,0,-c*a.y,0,0,c,-c*a.z,0,0,0,1);this.applyMatrix(e);return this},computeFaceNormals:function(){for(var a=new m,c=new m,e=0,g=this.faces.length;e<g;e++){var k=this.faces[e],r=this.vertices[k.a],u=this.vertices[k.b];a.subVectors(this.vertices[k.c],u);c.subVectors(r,u);a.cross(c);a.normalize();k.normal.copy(a)}},computeVertexNormals:function(a){void 0===a&&(a=!0);var c;var e=Array(this.vertices.length);var g=0;for(c=this.vertices.length;g<c;g++)e[g]=new m; if(a){var k=new m,r=new m;a=0;for(g=this.faces.length;a<g;a++){c=this.faces[a];var u=this.vertices[c.a];var A=this.vertices[c.b];var B=this.vertices[c.c];k.subVectors(B,A);r.subVectors(u,A);k.cross(r);e[c.a].add(k);e[c.b].add(k);e[c.c].add(k)}}else for(this.computeFaceNormals(),a=0,g=this.faces.length;a<g;a++)c=this.faces[a],e[c.a].add(c.normal),e[c.b].add(c.normal),e[c.c].add(c.normal);g=0;for(c=this.vertices.length;g<c;g++)e[g].normalize();a=0;for(g=this.faces.length;a<g;a++)c=this.faces[a],u=c.vertexNormals, 3===u.length?(u[0].copy(e[c.a]),u[1].copy(e[c.b]),u[2].copy(e[c.c])):(u[0]=e[c.a].clone(),u[1]=e[c.b].clone(),u[2]=e[c.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var a;this.computeFaceNormals();var c=0;for(a=this.faces.length;c<a;c++){var e=this.faces[c];var g=e.vertexNormals;3===g.length?(g[0].copy(e.normal),g[1].copy(e.normal),g[2].copy(e.normal)):(g[0]=e.normal.clone(),g[1]=e.normal.clone(),g[2]=e.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate= !0)},computeMorphNormals:function(){var a,c;var e=0;for(c=this.faces.length;e<c;e++){var g=this.faces[e];g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone();g.__originalVertexNormals||(g.__originalVertexNormals=[]);var k=0;for(a=g.vertexNormals.length;k<a;k++)g.__originalVertexNormals[k]?g.__originalVertexNormals[k].copy(g.vertexNormals[k]):g.__originalVertexNormals[k]=g.vertexNormals[k].clone()}var r=new Y;r.faces=this.faces;k=0;for(a=this.morphTargets.length;k< a;k++){if(!this.morphNormals[k]){this.morphNormals[k]={};this.morphNormals[k].faceNormals=[];this.morphNormals[k].vertexNormals=[];g=this.morphNormals[k].faceNormals;var u=this.morphNormals[k].vertexNormals;e=0;for(c=this.faces.length;e<c;e++){var A=new m;var B={a:new m,b:new m,c:new m};g.push(A);u.push(B)}}u=this.morphNormals[k];r.vertices=this.morphTargets[k].vertices;r.computeFaceNormals();r.computeVertexNormals();e=0;for(c=this.faces.length;e<c;e++)g=this.faces[e],A=u.faceNormals[e],B=u.vertexNormals[e], A.copy(g.normal),B.a.copy(g.vertexNormals[0]),B.b.copy(g.vertexNormals[1]),B.c.copy(g.vertexNormals[2])}e=0;for(c=this.faces.length;e<c;e++)g=this.faces[e],g.normal=g.__originalFaceNormal,g.vertexNormals=g.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new z);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new y);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a, c,e){if(a&&a.isGeometry){var g,k=this.vertices.length,r=this.vertices,u=a.vertices,A=this.faces,B=a.faces,C=this.faceVertexUvs[0],H=a.faceVertexUvs[0],I=this.colors,K=a.colors;void 0===e&&(e=0);void 0!==c&&(g=(new w).getNormalMatrix(c));a=0;for(var P=u.length;a<P;a++){var O=u[a].clone();void 0!==c&&O.applyMatrix4(c);r.push(O)}a=0;for(P=K.length;a<P;a++)I.push(K[a].clone());a=0;for(P=B.length;a<P;a++){u=B[a];var S=u.vertexNormals;K=u.vertexColors;I=new M(u.a+k,u.b+k,u.c+k);I.normal.copy(u.normal); void 0!==g&&I.normal.applyMatrix3(g).normalize();c=0;for(r=S.length;c<r;c++)O=S[c].clone(),void 0!==g&&O.applyMatrix3(g).normalize(),I.vertexNormals.push(O);I.color.copy(u.color);c=0;for(r=K.length;c<r;c++)O=K[c],I.vertexColors.push(O.clone());I.materialIndex=u.materialIndex+e;A.push(I)}a=0;for(P=H.length;a<P;a++)if(e=H[a],g=[],void 0!==e){c=0;for(r=e.length;c<r;c++)g.push(e[c].clone());C.push(g)}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a)},mergeMesh:function(a){a&& a.isMesh?(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a)},mergeVertices:function(){var a={},c=[],e=[],g=Math.pow(10,4),k;var r=0;for(k=this.vertices.length;r<k;r++){var u=this.vertices[r];u=Math.round(u.x*g)+"_"+Math.round(u.y*g)+"_"+Math.round(u.z*g);void 0===a[u]?(a[u]=r,c.push(this.vertices[r]),e[r]=c.length-1):e[r]=e[a[u]]}a=[];r=0;for(k=this.faces.length;r<k;r++)for(g=this.faces[r],g.a=e[g.a], g.b=e[g.b],g.c=e[g.c],g=[g.a,g.b,g.c],u=0;3>u;u++)if(g[u]===g[(u+1)%3]){a.push(r);break}for(r=a.length-1;0<=r;r--)for(g=a[r],this.faces.splice(g,1),e=0,k=this.faceVertexUvs.length;e<k;e++)this.faceVertexUvs[e].splice(g,1);r=this.vertices.length-c.length;this.vertices=c;return r},setFromPoints:function(a){this.vertices=[];for(var c=0,e=a.length;c<e;c++){var g=a[c];this.vertices.push(new m(g.x,g.y,g.z||0))}return this},sortFacesByMaterialIndex:function(){for(var a=this.faces,c=a.length,e=0;e<c;e++)a[e]._id= e;a.sort(function(B,C){return B.materialIndex-C.materialIndex});var g=this.faceVertexUvs[0],k=this.faceVertexUvs[1],r,u;g&&g.length===c&&(r=[]);k&&k.length===c&&(u=[]);for(e=0;e<c;e++){var A=a[e]._id;r&&r.push(g[A]);u&&u.push(k[A])}r&&(this.faceVertexUvs[0]=r);u&&(this.faceVertexUvs[1]=u)},toJSON:function(){function a(da,ea,na){return na?da|1<<ea:da&~(1<<ea)}function c(da){var ea=da.x.toString()+da.y.toString()+da.z.toString();if(void 0!==C[ea])return C[ea];C[ea]=B.length/3;B.push(da.x,da.y,da.z); return C[ea]}function e(da){var ea=da.r.toString()+da.g.toString()+da.b.toString();if(void 0!==I[ea])return I[ea];I[ea]=H.length;H.push(da.getHex());return I[ea]}function g(da){var ea=da.x.toString()+da.y.toString();if(void 0!==P[ea])return P[ea];P[ea]=K.length/2;K.push(da.x,da.y);return P[ea]}var k={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};k.uuid=this.uuid;k.type=this.type;""!==this.name&&(k.name=this.name);if(void 0!==this.parameters){var r=this.parameters,u;for(u in r)void 0!== r[u]&&(k[u]=r[u]);return k}r=[];for(u=0;u<this.vertices.length;u++){var A=this.vertices[u];r.push(A.x,A.y,A.z)}A=[];var B=[],C={},H=[],I={},K=[],P={};for(u=0;u<this.faces.length;u++){var O=this.faces[u],S=void 0!==this.faceVertexUvs[0][u],V=0<O.normal.length(),ca=0<O.vertexNormals.length,ha=1!==O.color.r||1!==O.color.g||1!==O.color.b,ba=0<O.vertexColors.length,ka=0;ka=a(ka,0,0);ka=a(ka,1,!0);ka=a(ka,2,!1);ka=a(ka,3,S);ka=a(ka,4,V);ka=a(ka,5,ca);ka=a(ka,6,ha);ka=a(ka,7,ba);A.push(ka);A.push(O.a,O.b, O.c);A.push(O.materialIndex);S&&(S=this.faceVertexUvs[0][u],A.push(g(S[0]),g(S[1]),g(S[2])));V&&A.push(c(O.normal));ca&&(V=O.vertexNormals,A.push(c(V[0]),c(V[1]),c(V[2])));ha&&A.push(e(O.color));ba&&(O=O.vertexColors,A.push(e(O[0]),e(O[1]),e(O[2])))}k.data={};k.data.vertices=r;k.data.normals=B;0<H.length&&(k.data.colors=H);0<K.length&&(k.data.uvs=[K]);k.data.faces=A;return k},clone:function(){return(new Y).copy(this)},copy:function(a){var c,e,g;this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs= [[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.name=a.name;var k=a.vertices;var r=0;for(c=k.length;r<c;r++)this.vertices.push(k[r].clone());k=a.colors;r=0;for(c=k.length;r<c;r++)this.colors.push(k[r].clone());k=a.faces;r=0;for(c=k.length;r<c;r++)this.faces.push(k[r].clone());r=0;for(c=a.faceVertexUvs.length;r<c;r++){var u=a.faceVertexUvs[r];void 0===this.faceVertexUvs[r]&&(this.faceVertexUvs[r]= []);k=0;for(e=u.length;k<e;k++){var A=u[k],B=[];var C=0;for(g=A.length;C<g;C++)B.push(A[C].clone());this.faceVertexUvs[r].push(B)}}C=a.morphTargets;r=0;for(c=C.length;r<c;r++){g={};g.name=C[r].name;if(void 0!==C[r].vertices)for(g.vertices=[],k=0,e=C[r].vertices.length;k<e;k++)g.vertices.push(C[r].vertices[k].clone());if(void 0!==C[r].normals)for(g.normals=[],k=0,e=C[r].normals.length;k<e;k++)g.normals.push(C[r].normals[k].clone());this.morphTargets.push(g)}C=a.morphNormals;r=0;for(c=C.length;r<c;r++){g= {};if(void 0!==C[r].vertexNormals)for(g.vertexNormals=[],k=0,e=C[r].vertexNormals.length;k<e;k++)u=C[r].vertexNormals[k],A={},A.a=u.a.clone(),A.b=u.b.clone(),A.c=u.c.clone(),g.vertexNormals.push(A);if(void 0!==C[r].faceNormals)for(g.faceNormals=[],k=0,e=C[r].faceNormals.length;k<e;k++)g.faceNormals.push(C[r].faceNormals[k].clone());this.morphNormals.push(g)}k=a.skinWeights;r=0;for(c=k.length;r<c;r++)this.skinWeights.push(k[r].clone());k=a.skinIndices;r=0;for(c=k.length;r<c;r++)this.skinIndices.push(k[r].clone()); k=a.lineDistances;r=0;for(c=k.length;r<c;r++)this.lineDistances.push(k[r]);r=a.boundingBox;null!==r&&(this.boundingBox=r.clone());r=a.boundingSphere;null!==r&&(this.boundingSphere=r.clone());this.elementsNeedUpdate=a.elementsNeedUpdate;this.verticesNeedUpdate=a.verticesNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.lineDistancesNeedUpdate=a.lineDistancesNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this}, dispose:function(){this.dispatchEvent({type:"dispose"})}});Object.defineProperty(ma.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(ma.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(a){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==a?a.length/this.itemSize:0;this.array=a;return this},setDynamic:function(a){this.dynamic=a;return this},copy:function(a){this.name=a.name; this.array=new a.array.constructor(a.array);this.itemSize=a.itemSize;this.count=a.count;this.normalized=a.normalized;this.dynamic=a.dynamic;return this},copyAt:function(a,c,e){a*=this.itemSize;e*=c.itemSize;for(var g=0,k=this.itemSize;g<k;g++)this.array[a+g]=c.array[e+g];return this},copyArray:function(a){this.array.set(a);return this},copyColorsArray:function(a){for(var c=this.array,e=0,g=0,k=a.length;g<k;g++){var r=a[g];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", g),r=new E);c[e++]=r.r;c[e++]=r.g;c[e++]=r.b}return this},copyVector2sArray:function(a){for(var c=this.array,e=0,g=0,k=a.length;g<k;g++){var r=a[g];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",g),r=new f);c[e++]=r.x;c[e++]=r.y}return this},copyVector3sArray:function(a){for(var c=this.array,e=0,g=0,k=a.length;g<k;g++){var r=a[g];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",g),r=new m);c[e++]=r.x;c[e++]=r.y; c[e++]=r.z}return this},copyVector4sArray:function(a){for(var c=this.array,e=0,g=0,k=a.length;g<k;g++){var r=a[g];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",g),r=new p);c[e++]=r.x;c[e++]=r.y;c[e++]=r.z;c[e++]=r.w}return this},set:function(a,c){void 0===c&&(c=0);this.array.set(a,c);return this},getX:function(a){return this.array[a*this.itemSize]},setX:function(a,c){this.array[a*this.itemSize]=c;return this},getY:function(a){return this.array[a*this.itemSize+ 1]},setY:function(a,c){this.array[a*this.itemSize+1]=c;return this},getZ:function(a){return this.array[a*this.itemSize+2]},setZ:function(a,c){this.array[a*this.itemSize+2]=c;return this},getW:function(a){return this.array[a*this.itemSize+3]},setW:function(a,c){this.array[a*this.itemSize+3]=c;return this},setXY:function(a,c,e){a*=this.itemSize;this.array[a+0]=c;this.array[a+1]=e;return this},setXYZ:function(a,c,e,g){a*=this.itemSize;this.array[a+0]=c;this.array[a+1]=e;this.array[a+2]=g;return this}, setXYZW:function(a,c,e,g,k){a*=this.itemSize;this.array[a+0]=c;this.array[a+1]=e;this.array[a+2]=g;this.array[a+3]=k;return this},onUpload:function(a){this.onUploadCallback=a;return this},clone:function(){return(new this.constructor(this.array,this.itemSize)).copy(this)}});va.prototype=Object.create(ma.prototype);va.prototype.constructor=va;Ba.prototype=Object.create(ma.prototype);Ba.prototype.constructor=Ba;oa.prototype=Object.create(ma.prototype);oa.prototype.constructor=oa;xa.prototype=Object.create(ma.prototype); xa.prototype.constructor=xa;Pa.prototype=Object.create(ma.prototype);Pa.prototype.constructor=Pa;Ha.prototype=Object.create(ma.prototype);Ha.prototype.constructor=Ha;La.prototype=Object.create(ma.prototype);La.prototype.constructor=La;qa.prototype=Object.create(ma.prototype);qa.prototype.constructor=qa;Cb.prototype=Object.create(ma.prototype);Cb.prototype.constructor=Cb;Object.assign(tb.prototype,{computeGroups:function(a){var c=[],e=void 0;a=a.faces;for(var g=0;g<a.length;g++){var k=a[g];if(k.materialIndex!== e){e=k.materialIndex;void 0!==r&&(r.count=3*g-r.start,c.push(r));var r={start:3*g,materialIndex:e}}}void 0!==r&&(r.count=3*g-r.start,c.push(r));this.groups=c},fromGeometry:function(a){var c=a.faces,e=a.vertices,g=a.faceVertexUvs,k=g[0]&&0<g[0].length,r=g[1]&&0<g[1].length,u=a.morphTargets,A=u.length;if(0<A){var B=[];for(var C=0;C<A;C++)B[C]={name:u[C].name,data:[]};this.morphTargets.position=B}var H=a.morphNormals,I=H.length;if(0<I){var K=[];for(C=0;C<I;C++)K[C]={name:H[C].name,data:[]};this.morphTargets.normal= K}var P=a.skinIndices,O=a.skinWeights,S=P.length===e.length,V=O.length===e.length;0<e.length&&0===c.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(C=0;C<c.length;C++){var ca=c[C];this.vertices.push(e[ca.a],e[ca.b],e[ca.c]);var ha=ca.vertexNormals;3===ha.length?this.normals.push(ha[0],ha[1],ha[2]):(ha=ca.normal,this.normals.push(ha,ha,ha));ha=ca.vertexColors;3===ha.length?this.colors.push(ha[0],ha[1],ha[2]):(ha=ca.color,this.colors.push(ha,ha,ha));!0===k&& (ha=g[0][C],void 0!==ha?this.uvs.push(ha[0],ha[1],ha[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",C),this.uvs.push(new f,new f,new f)));!0===r&&(ha=g[1][C],void 0!==ha?this.uvs2.push(ha[0],ha[1],ha[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",C),this.uvs2.push(new f,new f,new f)));for(ha=0;ha<A;ha++){var ba=u[ha].vertices;B[ha].data.push(ba[ca.a],ba[ca.b],ba[ca.c])}for(ha=0;ha<I;ha++)ba=H[ha].vertexNormals[C],K[ha].data.push(ba.a,ba.b, ba.c);S&&this.skinIndices.push(P[ca.a],P[ca.b],P[ca.c]);V&&this.skinWeights.push(O[ca.a],O[ca.b],O[ca.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this}});var Ln=1;za.prototype=Object.assign(Object.create(d.prototype),{constructor:za,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(a){this.index= Array.isArray(a)?new (65535<ta(a)?La:Pa)(a,1):a},addAttribute:function(a,c,e){if(!(c&&c.isBufferAttribute||c&&c.isInterleavedBufferAttribute))return console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(a,new ma(c,e));if("index"===a)return console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(c),this;this.attributes[a]=c;return this},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a]; return this},addGroup:function(a,c,e){this.groups.push({start:a,count:c,materialIndex:void 0!==e?e:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(a,c){this.drawRange.start=a;this.drawRange.count=c},applyMatrix:function(a){var c=this.attributes.position;void 0!==c&&(a.applyToBufferAttribute(c),c.needsUpdate=!0);var e=this.attributes.normal;void 0!==e&&(c=(new w).getNormalMatrix(a),c.applyToBufferAttribute(e),e.needsUpdate=!0);e=this.attributes.tangent;void 0!==e&&(c=(new w).getNormalMatrix(a), c.applyToBufferAttribute(e),e.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();return this},rotateX:function(){var a=new G;return function(c){a.makeRotationX(c);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new G;return function(c){a.makeRotationY(c);this.applyMatrix(a);return this}}(),rotateZ:function(){var a=new G;return function(c){a.makeRotationZ(c);this.applyMatrix(a);return this}}(),translate:function(){var a= new G;return function(c,e,g){a.makeTranslation(c,e,g);this.applyMatrix(a);return this}}(),scale:function(){var a=new G;return function(c,e,g){a.makeScale(c,e,g);this.applyMatrix(a);return this}}(),lookAt:function(){var a=new T;return function(c){a.lookAt(c);a.updateMatrix();this.applyMatrix(a.matrix)}}(),center:function(){var a=new m;return function(){this.computeBoundingBox();this.boundingBox.getCenter(a).negate();this.translate(a.x,a.y,a.z);return this}}(),setFromObject:function(a){var c=a.geometry; if(a.isPoints||a.isLine){a=new qa(3*c.vertices.length,3);var e=new qa(3*c.colors.length,3);this.addAttribute("position",a.copyVector3sArray(c.vertices));this.addAttribute("color",e.copyColorsArray(c.colors));c.lineDistances&&c.lineDistances.length===c.vertices.length&&(a=new qa(c.lineDistances.length,1),this.addAttribute("lineDistance",a.copyArray(c.lineDistances)));null!==c.boundingSphere&&(this.boundingSphere=c.boundingSphere.clone());null!==c.boundingBox&&(this.boundingBox=c.boundingBox.clone())}else a.isMesh&& c&&c.isGeometry&&this.fromGeometry(c);return this},setFromPoints:function(a){for(var c=[],e=0,g=a.length;e<g;e++){var k=a[e];c.push(k.x,k.y,k.z||0)}this.addAttribute("position",new qa(c,3));return this},updateFromObject:function(a){var c=a.geometry;if(a.isMesh){var e=c.__directGeometry;!0===c.elementsNeedUpdate&&(e=void 0,c.elementsNeedUpdate=!1);if(void 0===e)return this.fromGeometry(c);e.verticesNeedUpdate=c.verticesNeedUpdate;e.normalsNeedUpdate=c.normalsNeedUpdate;e.colorsNeedUpdate=c.colorsNeedUpdate; e.uvsNeedUpdate=c.uvsNeedUpdate;e.groupsNeedUpdate=c.groupsNeedUpdate;c.verticesNeedUpdate=!1;c.normalsNeedUpdate=!1;c.colorsNeedUpdate=!1;c.uvsNeedUpdate=!1;c.groupsNeedUpdate=!1;c=e}!0===c.verticesNeedUpdate&&(e=this.attributes.position,void 0!==e&&(e.copyVector3sArray(c.vertices),e.needsUpdate=!0),c.verticesNeedUpdate=!1);!0===c.normalsNeedUpdate&&(e=this.attributes.normal,void 0!==e&&(e.copyVector3sArray(c.normals),e.needsUpdate=!0),c.normalsNeedUpdate=!1);!0===c.colorsNeedUpdate&&(e=this.attributes.color, void 0!==e&&(e.copyColorsArray(c.colors),e.needsUpdate=!0),c.colorsNeedUpdate=!1);c.uvsNeedUpdate&&(e=this.attributes.uv,void 0!==e&&(e.copyVector2sArray(c.uvs),e.needsUpdate=!0),c.uvsNeedUpdate=!1);c.lineDistancesNeedUpdate&&(e=this.attributes.lineDistance,void 0!==e&&(e.copyArray(c.lineDistances),e.needsUpdate=!0),c.lineDistancesNeedUpdate=!1);c.groupsNeedUpdate&&(c.computeGroups(a.geometry),this.groups=c.groups,c.groupsNeedUpdate=!1);return this},fromGeometry:function(a){a.__directGeometry=(new tb).fromGeometry(a); return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){this.addAttribute("position",(new ma(new Float32Array(3*a.vertices.length),3)).copyVector3sArray(a.vertices));0<a.normals.length&&this.addAttribute("normal",(new ma(new Float32Array(3*a.normals.length),3)).copyVector3sArray(a.normals));0<a.colors.length&&this.addAttribute("color",(new ma(new Float32Array(3*a.colors.length),3)).copyColorsArray(a.colors));0<a.uvs.length&&this.addAttribute("uv",(new ma(new Float32Array(2* a.uvs.length),2)).copyVector2sArray(a.uvs));0<a.uvs2.length&&this.addAttribute("uv2",(new ma(new Float32Array(2*a.uvs2.length),2)).copyVector2sArray(a.uvs2));this.groups=a.groups;for(var c in a.morphTargets){for(var e=[],g=a.morphTargets[c],k=0,r=g.length;k<r;k++){var u=g[k],A=new qa(3*u.data.length,3);A.name=u.name;e.push(A.copyVector3sArray(u.data))}this.morphAttributes[c]=e}0<a.skinIndices.length&&(c=new qa(4*a.skinIndices.length,4),this.addAttribute("skinIndex",c.copyVector4sArray(a.skinIndices))); 0<a.skinWeights.length&&(c=new qa(4*a.skinWeights.length,4),this.addAttribute("skinWeight",c.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){var a=new z;return function(){null===this.boundingBox&&(this.boundingBox=new z);var c=this.attributes.position,e=this.morphAttributes.position;if(void 0!==c){if(this.boundingBox.setFromBufferAttribute(c), e){c=0;for(var g=e.length;c<g;c++)a.setFromBufferAttribute(e[c]),this.boundingBox.expandByPoint(a.min),this.boundingBox.expandByPoint(a.max)}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=new z,c=new z,e=new m;return function(){null=== this.boundingSphere&&(this.boundingSphere=new y);var g=this.attributes.position,k=this.morphAttributes.position;if(g){var r=this.boundingSphere.center;a.setFromBufferAttribute(g);if(k)for(var u=0,A=k.length;u<A;u++){var B=k[u];c.setFromBufferAttribute(B);a.expandByPoint(c.min);a.expandByPoint(c.max)}a.getCenter(r);var C=0;u=0;for(A=g.count;u<A;u++)e.fromBufferAttribute(g,u),C=Math.max(C,r.distanceToSquared(e));if(k)for(u=0,A=k.length;u<A;u++){B=k[u];g=0;for(var H=B.count;g<H;g++)e.fromBufferAttribute(B, g),C=Math.max(C,r.distanceToSquared(e))}this.boundingSphere.radius=Math.sqrt(C);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.index,c=this.attributes;if(c.position){var e=c.position.array;if(void 0===c.normal)this.addAttribute("normal",new ma(new Float32Array(e.length),3));else for(var g= c.normal.array,k=0,r=g.length;k<r;k++)g[k]=0;g=c.normal.array;var u=new m,A=new m,B=new m,C=new m,H=new m;if(a){var I=a.array;k=0;for(r=a.count;k<r;k+=3){a=3*I[k+0];var K=3*I[k+1];var P=3*I[k+2];u.fromArray(e,a);A.fromArray(e,K);B.fromArray(e,P);C.subVectors(B,A);H.subVectors(u,A);C.cross(H);g[a]+=C.x;g[a+1]+=C.y;g[a+2]+=C.z;g[K]+=C.x;g[K+1]+=C.y;g[K+2]+=C.z;g[P]+=C.x;g[P+1]+=C.y;g[P+2]+=C.z}}else for(k=0,r=e.length;k<r;k+=9)u.fromArray(e,k),A.fromArray(e,k+3),B.fromArray(e,k+6),C.subVectors(B,A), H.subVectors(u,A),C.cross(H),g[k]=C.x,g[k+1]=C.y,g[k+2]=C.z,g[k+3]=C.x,g[k+4]=C.y,g[k+5]=C.z,g[k+6]=C.x,g[k+7]=C.y,g[k+8]=C.z;this.normalizeNormals();c.normal.needsUpdate=!0}},merge:function(a,c){if(a&&a.isBufferGeometry){void 0===c&&(c=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset\x3d0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var e=this.attributes,g;for(g in e)if(void 0!==a.attributes[g]){var k=e[g].array,r=a.attributes[g], u=r.array,A=r.itemSize*c;r=Math.min(u.length,k.length-A);for(var B=0;B<r;B++,A++)k[A]=u[B]}return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a)},normalizeNormals:function(){var a=new m;return function(){for(var c=this.attributes.normal,e=0,g=c.count;e<g;e++)a.x=c.getX(e),a.y=c.getY(e),a.z=c.getZ(e),a.normalize(),c.setXYZ(e,a.x,a.y,a.z)}}(),toNonIndexed:function(){function a(H,I){var K=H.array;H=H.itemSize;for(var P=new K.constructor(I.length* H),O,S=0,V=0,ca=I.length;V<ca;V++){O=I[V]*H;for(var ha=0;ha<H;ha++)P[S++]=K[O++]}return new ma(P,H)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var c=new za,e=this.index.array,g=this.attributes,k;for(k in g){var r=g[k];r=a(r,e);c.addAttribute(k,r)}var u=this.morphAttributes;for(k in u){var A=[],B=u[k];g=0;for(var C=B.length;g<C;g++)r=B[g],r=a(r,e),A.push(r);c.morphAttributes[k]=A}e=this.groups;g=0;for(k=e.length;g<k;g++)r= e[g],c.addGroup(r.start,r.count,r.materialIndex);return c},toJSON:function(){var a={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);0<Object.keys(this.userData).length&&(a.userData=this.userData);if(void 0!==this.parameters){var c=this.parameters;for(C in c)void 0!==c[C]&&(a[C]=c[C]);return a}a.data={attributes:{}};c=this.index;null!==c&&(a.data.index={type:c.array.constructor.name,array:Array.prototype.slice.call(c.array)}); var e=this.attributes;for(C in e){c=e[C];var g={itemSize:c.itemSize,type:c.array.constructor.name,array:Array.prototype.slice.call(c.array),normalized:c.normalized};""!==c.name&&(g.name=c.name);a.data.attributes[C]=g}e={};var k=!1;for(C in this.morphAttributes){for(var r=this.morphAttributes[C],u=[],A=0,B=r.length;A<B;A++)c=r[A],g={itemSize:c.itemSize,type:c.array.constructor.name,array:Array.prototype.slice.call(c.array),normalized:c.normalized},""!==c.name&&(g.name=c.name),u.push(g);0<u.length&& (e[C]=u,k=!0)}k&&(a.data.morphAttributes=e);var C=this.groups;0<C.length&&(a.data.groups=JSON.parse(JSON.stringify(C)));C=this.boundingSphere;null!==C&&(a.data.boundingSphere={center:C.center.toArray(),radius:C.radius});return a},clone:function(){return(new za).copy(this)},copy:function(a){var c;this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.name=a.name;var e=a.index;null!==e&&this.setIndex(e.clone());e=a.attributes;for(u in e)this.addAttribute(u, e[u].clone());var g=a.morphAttributes;for(u in g){var k=[],r=g[u];e=0;for(c=r.length;e<c;e++)k.push(r[e].clone());this.morphAttributes[u]=k}var u=a.groups;e=0;for(c=u.length;e<c;e++)g=u[e],this.addGroup(g.start,g.count,g.materialIndex);u=a.boundingBox;null!==u&&(this.boundingBox=u.clone());u=a.boundingSphere;null!==u&&(this.boundingSphere=u.clone());this.drawRange.start=a.drawRange.start;this.drawRange.count=a.drawRange.count;this.userData=a.userData;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}}); Ib.prototype=Object.create(Y.prototype);Ib.prototype.constructor=Ib;oc.prototype=Object.create(za.prototype);oc.prototype.constructor=oc;Gc.prototype=Object.create(Y.prototype);Gc.prototype.constructor=Gc;Wc.prototype=Object.create(za.prototype);Wc.prototype.constructor=Wc;var Mn=0;bb.prototype=Object.assign(Object.create(d.prototype),{constructor:bb,isMaterial:!0,onBeforeCompile:function(){},setValues:function(a){if(void 0!==a)for(var c in a){var e=a[c];if(void 0===e)console.warn("THREE.Material: '"+ c+"' parameter is undefined.");else if("shading"===c)console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e?!0:!1;else{var g=this[c];void 0===g?console.warn("THREE."+this.type+": '"+c+"' is not a property of this material."):g&&g.isColor?g.set(e):g&&g.isVector3&&e&&e.isVector3?g.copy(e):this[c]=e}}},toJSON:function(a){function c(k){var r=[],u;for(u in k){var A=k[u];delete A.metadata;r.push(A)}return r}var e=void 0===a||"string"=== typeof a;e&&(a={textures:{},images:{}});var g={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};g.uuid=this.uuid;g.type=this.type;""!==this.name&&(g.name=this.name);this.color&&this.color.isColor&&(g.color=this.color.getHex());void 0!==this.roughness&&(g.roughness=this.roughness);void 0!==this.metalness&&(g.metalness=this.metalness);this.emissive&&this.emissive.isColor&&(g.emissive=this.emissive.getHex());1!==this.emissiveIntensity&&(g.emissiveIntensity=this.emissiveIntensity); this.specular&&this.specular.isColor&&(g.specular=this.specular.getHex());void 0!==this.shininess&&(g.shininess=this.shininess);void 0!==this.clearCoat&&(g.clearCoat=this.clearCoat);void 0!==this.clearCoatRoughness&&(g.clearCoatRoughness=this.clearCoatRoughness);this.map&&this.map.isTexture&&(g.map=this.map.toJSON(a).uuid);this.matcap&&this.matcap.isTexture&&(g.matcap=this.matcap.toJSON(a).uuid);this.alphaMap&&this.alphaMap.isTexture&&(g.alphaMap=this.alphaMap.toJSON(a).uuid);this.lightMap&&this.lightMap.isTexture&& (g.lightMap=this.lightMap.toJSON(a).uuid);this.aoMap&&this.aoMap.isTexture&&(g.aoMap=this.aoMap.toJSON(a).uuid,g.aoMapIntensity=this.aoMapIntensity);this.bumpMap&&this.bumpMap.isTexture&&(g.bumpMap=this.bumpMap.toJSON(a).uuid,g.bumpScale=this.bumpScale);this.normalMap&&this.normalMap.isTexture&&(g.normalMap=this.normalMap.toJSON(a).uuid,g.normalMapType=this.normalMapType,g.normalScale=this.normalScale.toArray());this.displacementMap&&this.displacementMap.isTexture&&(g.displacementMap=this.displacementMap.toJSON(a).uuid, g.displacementScale=this.displacementScale,g.displacementBias=this.displacementBias);this.roughnessMap&&this.roughnessMap.isTexture&&(g.roughnessMap=this.roughnessMap.toJSON(a).uuid);this.metalnessMap&&this.metalnessMap.isTexture&&(g.metalnessMap=this.metalnessMap.toJSON(a).uuid);this.emissiveMap&&this.emissiveMap.isTexture&&(g.emissiveMap=this.emissiveMap.toJSON(a).uuid);this.specularMap&&this.specularMap.isTexture&&(g.specularMap=this.specularMap.toJSON(a).uuid);this.envMap&&this.envMap.isTexture&& (g.envMap=this.envMap.toJSON(a).uuid,g.reflectivity=this.reflectivity,void 0!==this.combine&&(g.combine=this.combine),void 0!==this.envMapIntensity&&(g.envMapIntensity=this.envMapIntensity));this.gradientMap&&this.gradientMap.isTexture&&(g.gradientMap=this.gradientMap.toJSON(a).uuid);void 0!==this.size&&(g.size=this.size);void 0!==this.sizeAttenuation&&(g.sizeAttenuation=this.sizeAttenuation);1!==this.blending&&(g.blending=this.blending);!0===this.flatShading&&(g.flatShading=this.flatShading);0!== this.side&&(g.side=this.side);0!==this.vertexColors&&(g.vertexColors=this.vertexColors);1>this.opacity&&(g.opacity=this.opacity);!0===this.transparent&&(g.transparent=this.transparent);g.depthFunc=this.depthFunc;g.depthTest=this.depthTest;g.depthWrite=this.depthWrite;0!==this.rotation&&(g.rotation=this.rotation);!0===this.polygonOffset&&(g.polygonOffset=!0);0!==this.polygonOffsetFactor&&(g.polygonOffsetFactor=this.polygonOffsetFactor);0!==this.polygonOffsetUnits&&(g.polygonOffsetUnits=this.polygonOffsetUnits); 1!==this.linewidth&&(g.linewidth=this.linewidth);void 0!==this.dashSize&&(g.dashSize=this.dashSize);void 0!==this.gapSize&&(g.gapSize=this.gapSize);void 0!==this.scale&&(g.scale=this.scale);!0===this.dithering&&(g.dithering=!0);0<this.alphaTest&&(g.alphaTest=this.alphaTest);!0===this.premultipliedAlpha&&(g.premultipliedAlpha=this.premultipliedAlpha);!0===this.wireframe&&(g.wireframe=this.wireframe);1<this.wireframeLinewidth&&(g.wireframeLinewidth=this.wireframeLinewidth);"round"!==this.wireframeLinecap&& (g.wireframeLinecap=this.wireframeLinecap);"round"!==this.wireframeLinejoin&&(g.wireframeLinejoin=this.wireframeLinejoin);!0===this.morphTargets&&(g.morphTargets=!0);!0===this.skinning&&(g.skinning=!0);!1===this.visible&&(g.visible=!1);"{}"!==JSON.stringify(this.userData)&&(g.userData=this.userData);e&&(e=c(a.textures),a=c(a.images),0<e.length&&(g.textures=e),0<a.length&&(g.images=a));return g},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.name=a.name;this.fog=a.fog; this.lights=a.lights;this.blending=a.blending;this.side=a.side;this.flatShading=a.flatShading;this.vertexColors=a.vertexColors;this.opacity=a.opacity;this.transparent=a.transparent;this.blendSrc=a.blendSrc;this.blendDst=a.blendDst;this.blendEquation=a.blendEquation;this.blendSrcAlpha=a.blendSrcAlpha;this.blendDstAlpha=a.blendDstAlpha;this.blendEquationAlpha=a.blendEquationAlpha;this.depthFunc=a.depthFunc;this.depthTest=a.depthTest;this.depthWrite=a.depthWrite;this.colorWrite=a.colorWrite;this.precision= a.precision;this.polygonOffset=a.polygonOffset;this.polygonOffsetFactor=a.polygonOffsetFactor;this.polygonOffsetUnits=a.polygonOffsetUnits;this.dithering=a.dithering;this.alphaTest=a.alphaTest;this.premultipliedAlpha=a.premultipliedAlpha;this.visible=a.visible;this.userData=JSON.parse(JSON.stringify(a.userData));this.clipShadows=a.clipShadows;this.clipIntersection=a.clipIntersection;var c=a.clippingPlanes,e=null;if(null!==c){var g=c.length;e=Array(g);for(var k=0;k!==g;++k)e[k]=c[k].clone()}this.clippingPlanes= e;this.shadowSide=a.shadowSide;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});tc.prototype=Object.create(bb.prototype);tc.prototype.constructor=tc;tc.prototype.isShaderMaterial=!0;tc.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.fragmentShader=a.fragmentShader;this.vertexShader=a.vertexShader;this.uniforms=J(a.uniforms);this.defines=Object.assign({},a.defines);this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.lights=a.lights;this.clipping= a.clipping;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;this.extensions=a.extensions;return this};tc.prototype.toJSON=function(a){var c=bb.prototype.toJSON.call(this,a);c.uniforms={};for(var e in this.uniforms){var g=this.uniforms[e].value;c.uniforms[e]=g&&g.isTexture?{type:"t",value:g.toJSON(a).uuid}:g&&g.isColor?{type:"c",value:g.getHex()}:g&&g.isVector2?{type:"v2",value:g.toArray()}:g&&g.isVector3?{type:"v3",value:g.toArray()}:g&&g.isVector4?{type:"v4", value:g.toArray()}:g&&g.isMatrix3?{type:"m3",value:g.toArray()}:g&&g.isMatrix4?{type:"m4",value:g.toArray()}:{value:g}}0<Object.keys(this.defines).length&&(c.defines=this.defines);c.vertexShader=this.vertexShader;c.fragmentShader=this.fragmentShader;a={};for(var k in this.extensions)!0===this.extensions[k]&&(a[k]=!0);0<Object.keys(a).length&&(c.extensions=a);return c};Object.assign(Zd.prototype,{set:function(a,c){this.origin.copy(a);this.direction.copy(c);return this},clone:function(){return(new this.constructor).copy(this)}, copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,c){void 0===c&&(console.warn("THREE.Ray: .at() target is now required"),c=new m);return c.copy(this.direction).multiplyScalar(a).add(this.origin)},lookAt:function(a){this.direction.copy(a).sub(this.origin).normalize();return this},recast:function(){var a=new m;return function(c){this.origin.copy(this.at(c,a));return this}}(),closestPointToPoint:function(a,c){void 0===c&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"), c=new m);c.subVectors(a,this.origin);a=c.dot(this.direction);return 0>a?c.copy(this.origin):c.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new m;return function(c){var e=a.subVectors(c,this.origin).dot(this.direction);if(0>e)return this.origin.distanceToSquared(c);a.copy(this.direction).multiplyScalar(e).add(this.origin);return a.distanceToSquared(c)}}(),distanceSqToSegment:function(){var a= new m,c=new m,e=new m;return function(g,k,r,u){a.copy(g).add(k).multiplyScalar(.5);c.copy(k).sub(g).normalize();e.copy(this.origin).sub(a);var A=.5*g.distanceTo(k),B=-this.direction.dot(c),C=e.dot(this.direction),H=-e.dot(c),I=e.lengthSq(),K=Math.abs(1-B*B);if(0<K){g=B*H-C;k=B*C-H;var P=A*K;0<=g?k>=-P?k<=P?(A=1/K,g*=A,k*=A,B=g*(g+B*k+2*C)+k*(B*g+k+2*H)+I):(k=A,g=Math.max(0,-(B*k+C)),B=-g*g+k*(k+2*H)+I):(k=-A,g=Math.max(0,-(B*k+C)),B=-g*g+k*(k+2*H)+I):k<=-P?(g=Math.max(0,-(-B*A+C)),k=0<g?-A:Math.min(Math.max(-A, -H),A),B=-g*g+k*(k+2*H)+I):k<=P?(g=0,k=Math.min(Math.max(-A,-H),A),B=k*(k+2*H)+I):(g=Math.max(0,-(B*A+C)),k=0<g?A:Math.min(Math.max(-A,-H),A),B=-g*g+k*(k+2*H)+I)}else k=0<B?-A:A,g=Math.max(0,-(B*k+C)),B=-g*g+k*(k+2*H)+I;r&&r.copy(this.direction).multiplyScalar(g).add(this.origin);u&&u.copy(c).multiplyScalar(k).add(a);return B}}(),intersectSphere:function(){var a=new m;return function(c,e){a.subVectors(c.center,this.origin);var g=a.dot(this.direction),k=a.dot(a)-g*g;c=c.radius*c.radius;if(k>c)return null; c=Math.sqrt(c-k);k=g-c;g+=c;return 0>k&&0>g?null:0>k?this.at(g,e):this.at(k,e)}}(),intersectsSphere:function(a){return this.distanceSqToPoint(a.center)<=a.radius*a.radius},distanceToPlane:function(a){var c=a.normal.dot(this.direction);if(0===c)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/c;return 0<=a?a:null},intersectPlane:function(a,c){a=this.distanceToPlane(a);return null===a?null:this.at(a,c)},intersectsPlane:function(a){var c=a.distanceToPoint(this.origin); return 0===c||0>a.normal.dot(this.direction)*c?!0:!1},intersectBox:function(a,c){var e=1/this.direction.x;var g=1/this.direction.y;var k=1/this.direction.z,r=this.origin;if(0<=e){var u=(a.min.x-r.x)*e;e*=a.max.x-r.x}else u=(a.max.x-r.x)*e,e*=a.min.x-r.x;if(0<=g){var A=(a.min.y-r.y)*g;g*=a.max.y-r.y}else A=(a.max.y-r.y)*g,g*=a.min.y-r.y;if(u>g||A>e)return null;if(A>u||u!==u)u=A;if(g<e||e!==e)e=g;0<=k?(A=(a.min.z-r.z)*k,a=(a.max.z-r.z)*k):(A=(a.max.z-r.z)*k,a=(a.min.z-r.z)*k);if(u>a||A>e)return null; if(A>u||u!==u)u=A;if(a<e||e!==e)e=a;return 0>e?null:this.at(0<=u?u:e,c)},intersectsBox:function(){var a=new m;return function(c){return null!==this.intersectBox(c,a)}}(),intersectTriangle:function(){var a=new m,c=new m,e=new m,g=new m;return function(k,r,u,A,B){c.subVectors(r,k);e.subVectors(u,k);g.crossVectors(c,e);r=this.direction.dot(g);if(0<r){if(A)return null;A=1}else if(0>r)A=-1,r=-r;else return null;a.subVectors(this.origin,k);k=A*this.direction.dot(e.crossVectors(a,e));if(0>k)return null; u=A*this.direction.dot(c.cross(a));if(0>u||k+u>r)return null;k=-A*a.dot(g);return 0>k?null:this.at(k/r,B)}}(),applyMatrix4:function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}});Object.assign(jc,{getNormal:function(){var a=new m;return function(c,e,g,k){void 0===k&&(console.warn("THREE.Triangle: .getNormal() target is now required"),k=new m);k.subVectors(g,e);a.subVectors(c, e);k.cross(a);c=k.lengthSq();return 0<c?k.multiplyScalar(1/Math.sqrt(c)):k.set(0,0,0)}}(),getBarycoord:function(){var a=new m,c=new m,e=new m;return function(g,k,r,u,A){a.subVectors(u,k);c.subVectors(r,k);e.subVectors(g,k);g=a.dot(a);k=a.dot(c);r=a.dot(e);var B=c.dot(c);u=c.dot(e);var C=g*B-k*k;void 0===A&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),A=new m);if(0===C)return A.set(-2,-1,-1);C=1/C;B=(B*r-k*u)*C;g=(g*u-k*r)*C;return A.set(1-B-g,g,B)}}(),containsPoint:function(){var a= new m;return function(c,e,g,k){jc.getBarycoord(c,e,g,k,a);return 0<=a.x&&0<=a.y&&1>=a.x+a.y}}(),getUV:function(){var a=new m;return function(c,e,g,k,r,u,A,B){this.getBarycoord(c,e,g,k,a);B.set(0,0);B.addScaledVector(r,a.x);B.addScaledVector(u,a.y);B.addScaledVector(A,a.z);return B}}()});Object.assign(jc.prototype,{set:function(a,c,e){this.a.copy(a);this.b.copy(c);this.c.copy(e);return this},setFromPointsAndIndices:function(a,c,e,g){this.a.copy(a[c]);this.b.copy(a[e]);this.c.copy(a[g]);return this}, clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){var a=new m,c=new m;return function(){a.subVectors(this.c,this.b);c.subVectors(this.a,this.b);return.5*a.cross(c).length()}}(),getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),a=new m);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return jc.getNormal(this.a, this.b,this.c,a)},getPlane:function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new m);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,c){return jc.getBarycoord(a,this.a,this.b,this.c,c)},containsPoint:function(a){return jc.containsPoint(a,this.a,this.b,this.c)},getUV:function(a,c,e,g,k){return jc.getUV(a,this.a,this.b,this.c,c,e,g,k)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(){var a= new m,c=new m,e=new m,g=new m,k=new m,r=new m;return function(u,A){void 0===A&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),A=new m);var B=this.a,C=this.b,H=this.c;a.subVectors(C,B);c.subVectors(H,B);g.subVectors(u,B);var I=a.dot(g),K=c.dot(g);if(0>=I&&0>=K)return A.copy(B);k.subVectors(u,C);var P=a.dot(k),O=c.dot(k);if(0<=P&&O<=P)return A.copy(C);var S=I*O-P*K;if(0>=S&&0<=I&&0>=P)return C=I/(I-P),A.copy(B).addScaledVector(a,C);r.subVectors(u,H);u=a.dot(r);var V= c.dot(r);if(0<=V&&u<=V)return A.copy(H);I=u*K-I*V;if(0>=I&&0<=K&&0>=V)return S=K/(K-V),A.copy(B).addScaledVector(c,S);K=P*V-u*O;if(0>=K&&0<=O-P&&0<=u-V)return e.subVectors(H,C),S=(O-P)/(O-P+(u-V)),A.copy(C).addScaledVector(e,S);H=1/(K+I+S);C=I*H;S*=H;return A.copy(B).addScaledVector(a,C).addScaledVector(c,S)}}(),equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});zc.prototype=Object.create(bb.prototype);zc.prototype.constructor=zc;zc.prototype.isMeshBasicMaterial= !0;zc.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap; this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;return this};cc.prototype=Object.assign(Object.create(T.prototype),{constructor:cc,isMesh:!0,setDrawMode:function(a){this.drawMode=a},copy:function(a){T.prototype.copy.call(this,a);this.drawMode=a.drawMode;void 0!==a.morphTargetInfluences&&(this.morphTargetInfluences=a.morphTargetInfluences.slice());void 0!==a.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},a.morphTargetDictionary)); return this},updateMorphTargets:function(){var a=this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var c=Object.keys(a);if(0<c.length){var e=a[c[0]];if(void 0!==e)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},a=0,c=e.length;a<c;a++){var g=e[a].name||String(a);this.morphTargetInfluences.push(0);this.morphTargetDictionary[g]=a}}}else a=a.morphTargets,void 0!==a&&0<a.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}, raycast:function(){function a(ba,ka,da,ea,na,la,ua,Da){if(null===(1===ka.side?ea.intersectTriangle(ua,la,na,!0,Da):ea.intersectTriangle(na,la,ua,2!==ka.side,Da)))return null;ha.copy(Da);ha.applyMatrix4(ba.matrixWorld);ka=da.ray.origin.distanceTo(ha);return ka<da.near||ka>da.far?null:{distance:ka,point:ha.clone(),object:ba}}function c(ba,ka,da,ea,na,la,ua,Da,wa,Ca){r.fromBufferAttribute(na,Da);u.fromBufferAttribute(na,wa);A.fromBufferAttribute(na,Ca);na=ba.morphTargetInfluences;if(ka.morphTargets&& la&&na){I.set(0,0,0);K.set(0,0,0);P.set(0,0,0);for(var Ea=0,Qa=la.length;Ea<Qa;Ea++){var W=na[Ea],aa=la[Ea];0!==W&&(B.fromBufferAttribute(aa,Da),C.fromBufferAttribute(aa,wa),H.fromBufferAttribute(aa,Ca),I.addScaledVector(B.sub(r),W),K.addScaledVector(C.sub(u),W),P.addScaledVector(H.sub(A),W))}r.add(I);u.add(K);A.add(P)}if(ba=a(ba,ka,da,ea,r,u,A,ca))ua&&(O.fromBufferAttribute(ua,Da),S.fromBufferAttribute(ua,wa),V.fromBufferAttribute(ua,Ca),ba.uv=jc.getUV(ca,r,u,A,O,S,V,new f)),ua=new M(Da,wa,Ca),jc.getNormal(r, u,A,ua.normal),ba.face=ua;return ba}var e=new G,g=new Zd,k=new y,r=new m,u=new m,A=new m,B=new m,C=new m,H=new m,I=new m,K=new m,P=new m,O=new f,S=new f,V=new f,ca=new m,ha=new m;return function(ba,ka){var da=this.geometry,ea=this.material,na=this.matrixWorld;if(void 0!==ea&&(null===da.boundingSphere&&da.computeBoundingSphere(),k.copy(da.boundingSphere),k.applyMatrix4(na),!1!==ba.ray.intersectsSphere(k)&&(e.getInverse(na),g.copy(ba.ray).applyMatrix4(e),null===da.boundingBox||!1!==g.intersectsBox(da.boundingBox))))if(da.isBufferGeometry){var la= da.index;na=da.attributes.position;var ua=da.morphAttributes.position,Da=da.attributes.uv,wa=da.groups,Ca=da.drawRange,Ea,Qa;if(null!==la)if(Array.isArray(ea)){var W=0;for(Ea=wa.length;W<Ea;W++){var aa=wa[W];var ja=ea[aa.materialIndex];var ra=Math.max(aa.start,Ca.start);for(Qa=da=Math.min(aa.start+aa.count,Ca.start+Ca.count);ra<Qa;ra+=3){da=la.getX(ra);var Aa=la.getX(ra+1);var Ia=la.getX(ra+2);if(da=c(this,ja,ba,g,na,ua,Da,da,Aa,Ia))da.faceIndex=Math.floor(ra/3),da.face.materialIndex=aa.materialIndex, ka.push(da)}}}else for(ra=Math.max(0,Ca.start),da=Math.min(la.count,Ca.start+Ca.count),W=ra,Ea=da;W<Ea;W+=3){if(da=la.getX(W),Aa=la.getX(W+1),Ia=la.getX(W+2),da=c(this,ea,ba,g,na,ua,Da,da,Aa,Ia))da.faceIndex=Math.floor(W/3),ka.push(da)}else if(void 0!==na)if(Array.isArray(ea))for(W=0,Ea=wa.length;W<Ea;W++)for(aa=wa[W],ja=ea[aa.materialIndex],ra=Math.max(aa.start,Ca.start),Qa=da=Math.min(aa.start+aa.count,Ca.start+Ca.count);ra<Qa;ra+=3){if(da=ra,Aa=ra+1,Ia=ra+2,da=c(this,ja,ba,g,na,ua,Da,da,Aa,Ia))da.faceIndex= Math.floor(ra/3),da.face.materialIndex=aa.materialIndex,ka.push(da)}else for(ra=Math.max(0,Ca.start),da=Math.min(na.count,Ca.start+Ca.count),W=ra,Ea=da;W<Ea;W+=3)if(da=W,Aa=W+1,Ia=W+2,da=c(this,ea,ba,g,na,ua,Da,da,Aa,Ia))da.faceIndex=Math.floor(W/3),ka.push(da)}else if(da.isGeometry)for(na=Array.isArray(ea),ua=da.vertices,Da=da.faces,da=da.faceVertexUvs[0],0<da.length&&(la=da),Ea=0,aa=Da.length;Ea<aa;Ea++)if(ja=Da[Ea],da=na?ea[ja.materialIndex]:ea,void 0!==da&&(wa=ua[ja.a],Ca=ua[ja.b],W=ua[ja.c], da=a(this,da,ba,g,wa,Ca,W,ca)))la&&la[Ea]&&(ra=la[Ea],O.copy(ra[0]),S.copy(ra[1]),V.copy(ra[2]),da.uv=jc.getUV(ca,wa,Ca,W,O,S,V,new f)),da.face=ja,da.faceIndex=Ea,ka.push(da)}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});sd.prototype=Object.create(l.prototype);sd.prototype.constructor=sd;sd.prototype.isCubeTexture=!0;Object.defineProperty(sd.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});Ie.prototype=Object.create(l.prototype); Ie.prototype.constructor=Ie;Ie.prototype.isDataTexture2DArray=!0;Je.prototype=Object.create(l.prototype);Je.prototype.constructor=Je;Je.prototype.isDataTexture3D=!0;var Dk=new l,io=new Ie,ko=new Je,Ek=new sd,xk=[],zk=[],Ck=new Float32Array(16),Bk=new Float32Array(9),Ak=new Float32Array(4);Ik.prototype.updateCache=function(a){var c=this.cache;a instanceof Float32Array&&c.length!==a.length&&(this.cache=new Float32Array(a.length));dc(c,a)};Jk.prototype.setValue=function(a,c,e){for(var g=this.seq,k=0, r=g.length;k!==r;++k){var u=g[k];u.setValue(a,c[u.id],e)}};var di=/([\w\d_]+)(\])?(\[|\.)?/g;Jd.prototype.setValue=function(a,c,e,g){c=this.map[c];void 0!==c&&c.setValue(a,e,g)};Jd.prototype.setOptional=function(a,c,e){c=c[e];void 0!==c&&this.setValue(a,e,c)};Jd.upload=function(a,c,e,g){for(var k=0,r=c.length;k!==r;++k){var u=c[k],A=e[u.id];!1!==A.needsUpdate&&u.setValue(a,A.value,g)}};Jd.seqWithValue=function(a,c){for(var e=[],g=0,k=a.length;g!==k;++g){var r=a[g];r.id in c&&e.push(r)}return e};var Fo= 0,No=0;Kd.prototype=Object.create(bb.prototype);Kd.prototype.constructor=Kd;Kd.prototype.isMeshDepthMaterial=!0;Kd.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.depthPacking=a.depthPacking;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;return this}; Ld.prototype=Object.create(bb.prototype);Ld.prototype.constructor=Ld;Ld.prototype.isMeshDistanceMaterial=!0;Ld.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.referencePosition.copy(a.referencePosition);this.nearDistance=a.nearDistance;this.farDistance=a.farDistance;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias; return this};Le.prototype=Object.assign(Object.create(T.prototype),{constructor:Le,isGroup:!0});Yc.prototype=Object.assign(Object.create(T.prototype),{constructor:Yc,isCamera:!0,copy:function(a,c){T.prototype.copy.call(this,a,c);this.matrixWorldInverse.copy(a.matrixWorldInverse);this.projectionMatrix.copy(a.projectionMatrix);this.projectionMatrixInverse.copy(a.projectionMatrixInverse);return this},getWorldDirection:function(a){void 0===a&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"), a=new m);this.updateMatrixWorld(!0);var c=this.matrixWorld.elements;return a.set(-c[8],-c[9],-c[10]).normalize()},updateMatrixWorld:function(a){T.prototype.updateMatrixWorld.call(this,a);this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}});Lb.prototype=Object.assign(Object.create(Yc.prototype),{constructor:Lb,isPerspectiveCamera:!0,copy:function(a,c){Yc.prototype.copy.call(this,a,c);this.fov=a.fov;this.zoom=a.zoom;this.near=a.near;this.far= a.far;this.focus=a.focus;this.aspect=a.aspect;this.view=null===a.view?null:Object.assign({},a.view);this.filmGauge=a.filmGauge;this.filmOffset=a.filmOffset;return this},setFocalLength:function(a){this.fov=2*ab.RAD2DEG*Math.atan(.5*this.getFilmHeight()/a);this.updateProjectionMatrix()},getFocalLength:function(){return.5*this.getFilmHeight()/Math.tan(.5*ab.DEG2RAD*this.fov)},getEffectiveFOV:function(){return 2*ab.RAD2DEG*Math.atan(Math.tan(.5*ab.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge* Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(a,c,e,g,k,r){this.aspect=a/c;null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1});this.view.enabled=!0;this.view.fullWidth=a;this.view.fullHeight=c;this.view.offsetX=e;this.view.offsetY=g;this.view.width=k;this.view.height=r;this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1);this.updateProjectionMatrix()}, updateProjectionMatrix:function(){var a=this.near,c=a*Math.tan(.5*ab.DEG2RAD*this.fov)/this.zoom,e=2*c,g=this.aspect*e,k=-.5*g,r=this.view;if(null!==this.view&&this.view.enabled){var u=r.fullWidth,A=r.fullHeight;k+=r.offsetX*g/u;c-=r.offsetY*e/A;g*=r.width/u;e*=r.height/A}r=this.filmOffset;0!==r&&(k+=a*r/this.getFilmWidth());this.projectionMatrix.makePerspective(k,k+g,c,c-e,a,this.far);this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(a){a=T.prototype.toJSON.call(this, a);a.object.fov=this.fov;a.object.zoom=this.zoom;a.object.near=this.near;a.object.far=this.far;a.object.focus=this.focus;a.object.aspect=this.aspect;null!==this.view&&(a.object.view=Object.assign({},this.view));a.object.filmGauge=this.filmGauge;a.object.filmOffset=this.filmOffset;return a}});Qf.prototype=Object.assign(Object.create(Lb.prototype),{constructor:Qf,isArrayCamera:!0});var Uk=new m,Vk=new m;Object.assign(Yg.prototype,{isFogExp2:!0,clone:function(){return new Yg(this.color,this.density)}, toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}});Object.assign(Zg.prototype,{isFog:!0,clone:function(){return new Zg(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});$g.prototype=Object.assign(Object.create(T.prototype),{constructor:$g,isScene:!0,copy:function(a,c){T.prototype.copy.call(this,a,c);null!==a.background&&(this.background=a.background.clone());null!==a.fog&&(this.fog= a.fog.clone());null!==a.overrideMaterial&&(this.overrideMaterial=a.overrideMaterial.clone());this.autoUpdate=a.autoUpdate;this.matrixAutoUpdate=a.matrixAutoUpdate;return this},toJSON:function(a){var c=T.prototype.toJSON.call(this,a);null!==this.background&&(c.object.background=this.background.toJSON(a));null!==this.fog&&(c.object.fog=this.fog.toJSON());return c},dispose:function(){this.dispatchEvent({type:"dispose"})}});Object.defineProperty(ce.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}}); Object.assign(ce.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(a){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==a?a.length/this.stride:0;this.array=a;return this},setDynamic:function(a){this.dynamic=a;return this},copy:function(a){this.array=new a.array.constructor(a.array);this.count=a.count;this.stride=a.stride;this.dynamic=a.dynamic;return this},copyAt:function(a,c,e){a*=this.stride;e*=c.stride; for(var g=0,k=this.stride;g<k;g++)this.array[a+g]=c.array[e+g];return this},set:function(a,c){void 0===c&&(c=0);this.array.set(a,c);return this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(a){this.onUploadCallback=a;return this}});Object.defineProperties(Rf.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}});Object.assign(Rf.prototype,{isInterleavedBufferAttribute:!0,setX:function(a,c){this.data.array[a*this.data.stride+ this.offset]=c;return this},setY:function(a,c){this.data.array[a*this.data.stride+this.offset+1]=c;return this},setZ:function(a,c){this.data.array[a*this.data.stride+this.offset+2]=c;return this},setW:function(a,c){this.data.array[a*this.data.stride+this.offset+3]=c;return this},getX:function(a){return this.data.array[a*this.data.stride+this.offset]},getY:function(a){return this.data.array[a*this.data.stride+this.offset+1]},getZ:function(a){return this.data.array[a*this.data.stride+this.offset+2]}, getW:function(a){return this.data.array[a*this.data.stride+this.offset+3]},setXY:function(a,c,e){a=a*this.data.stride+this.offset;this.data.array[a+0]=c;this.data.array[a+1]=e;return this},setXYZ:function(a,c,e,g){a=a*this.data.stride+this.offset;this.data.array[a+0]=c;this.data.array[a+1]=e;this.data.array[a+2]=g;return this},setXYZW:function(a,c,e,g,k){a=a*this.data.stride+this.offset;this.data.array[a+0]=c;this.data.array[a+1]=e;this.data.array[a+2]=g;this.data.array[a+3]=k;return this}});Nd.prototype= Object.create(bb.prototype);Nd.prototype.constructor=Nd;Nd.prototype.isSpriteMaterial=!0;Nd.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.rotation=a.rotation;this.sizeAttenuation=a.sizeAttenuation;return this};var Pe;Sf.prototype=Object.assign(Object.create(T.prototype),{constructor:Sf,isSprite:!0,raycast:function(){function a(P,O,S,V,ca,ha){k.subVectors(P,S).addScalar(.5).multiply(V);void 0!==ca?(r.x=ha*k.x-ca*k.y,r.y=ca*k.x+ha*k.y):r.copy(k); P.copy(O);P.x+=r.x;P.y+=r.y;P.applyMatrix4(u)}var c=new m,e=new m,g=new m,k=new f,r=new f,u=new G,A=new m,B=new m,C=new m,H=new f,I=new f,K=new f;return function(P,O){e.setFromMatrixScale(this.matrixWorld);u.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld);g.setFromMatrixPosition(this.modelViewMatrix);var S=this.material.rotation;if(0!==S){var V=Math.cos(S);var ca=Math.sin(S)}S=this.center;a(A.set(-.5,-.5,0),g,S,e,ca,V);a(B.set(.5,-.5,0),g,S,e,ca,V);a(C.set(.5,.5,0),g,S,e,ca,V);H.set(0, 0);I.set(1,0);K.set(1,1);var ha=P.ray.intersectTriangle(A,B,C,!1,c);if(null===ha&&(a(B.set(-.5,.5,0),g,S,e,ca,V),I.set(0,1),ha=P.ray.intersectTriangle(A,C,B,!1,c),null===ha))return;ca=P.ray.origin.distanceTo(c);ca<P.near||ca>P.far||O.push({distance:ca,point:c.clone(),uv:jc.getUV(c,A,B,C,H,I,K,new f),face:null,object:this})}}(),clone:function(){return(new this.constructor(this.material)).copy(this)},copy:function(a){T.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}}); Tf.prototype=Object.assign(Object.create(T.prototype),{constructor:Tf,isLOD:!0,copy:function(a){T.prototype.copy.call(this,a,!1);a=a.levels;for(var c=0,e=a.length;c<e;c++){var g=a[c];this.addLevel(g.object.clone(),g.distance)}return this},addLevel:function(a,c){void 0===c&&(c=0);c=Math.abs(c);for(var e=this.levels,g=0;g<e.length&&!(c<e[g].distance);g++);e.splice(g,0,{distance:c,object:a});this.add(a);return this},getObjectForDistance:function(a){for(var c=this.levels,e=1,g=c.length;e<g&&!(a<c[e].distance);e++); return c[e-1].object},raycast:function(){var a=new m;return function(c,e){a.setFromMatrixPosition(this.matrixWorld);this.getObjectForDistance(c.ray.origin.distanceTo(a)).raycast(c,e)}}(),update:function(){var a=new m,c=new m;return function(e){var g=this.levels;if(1<g.length){a.setFromMatrixPosition(e.matrixWorld);c.setFromMatrixPosition(this.matrixWorld);e=a.distanceTo(c);g[0].object.visible=!0;for(var k=1,r=g.length;k<r;k++)if(e>=g[k].distance)g[k-1].object.visible=!1,g[k].object.visible=!0;else break; for(;k<r;k++)g[k].object.visible=!1}}}(),toJSON:function(a){a=T.prototype.toJSON.call(this,a);a.object.levels=[];for(var c=this.levels,e=0,g=c.length;e<g;e++){var k=c[e];a.object.levels.push({object:k.object.uuid,distance:k.distance})}return a}});Uf.prototype=Object.assign(Object.create(cc.prototype),{constructor:Uf,isSkinnedMesh:!0,bind:function(a,c){this.skeleton=a;void 0===c&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),c=this.matrixWorld);this.bindMatrix.copy(c);this.bindMatrixInverse.getInverse(c)}, pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var a=new p,c=this.geometry.attributes.skinWeight,e=0,g=c.count;e<g;e++){a.x=c.getX(e);a.y=c.getY(e);a.z=c.getZ(e);a.w=c.getW(e);var k=1/a.manhattanLength();Infinity!==k?a.multiplyScalar(k):a.set(1,0,0,0);c.setXYZW(e,a.x,a.y,a.z,a.w)}},updateMatrixWorld:function(a){cc.prototype.updateMatrixWorld.call(this,a);"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix): console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});Object.assign(ah.prototype,{calculateInverses:function(){this.boneInverses=[];for(var a=0,c=this.bones.length;a<c;a++){var e=new G;this.bones[a]&&e.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(e)}},pose:function(){var a,c;var e=0;for(c=this.bones.length;e<c;e++)(a=this.bones[e])&&a.matrixWorld.getInverse(this.boneInverses[e]); e=0;for(c=this.bones.length;e<c;e++)if(a=this.bones[e])a.parent&&a.parent.isBone?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale)},update:function(){var a=new G,c=new G;return function(){for(var e=this.bones,g=this.boneInverses,k=this.boneMatrices,r=this.boneTexture,u=0,A=e.length;u<A;u++)a.multiplyMatrices(e[u]?e[u].matrixWorld:c,g[u]),a.toArray(k,16*u);void 0!==r&&(r.needsUpdate=!0)}}(), clone:function(){return new ah(this.bones,this.boneInverses)},getBoneByName:function(a){for(var c=0,e=this.bones.length;c<e;c++){var g=this.bones[c];if(g.name===a)return g}}});ii.prototype=Object.assign(Object.create(T.prototype),{constructor:ii,isBone:!0});ub.prototype=Object.create(bb.prototype);ub.prototype.constructor=ub;ub.prototype.isLineBasicMaterial=!0;ub.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.color.copy(a.color);this.linewidth=a.linewidth;this.linecap=a.linecap;this.linejoin= a.linejoin;return this};fc.prototype=Object.assign(Object.create(T.prototype),{constructor:fc,isLine:!0,computeLineDistances:function(){var a=new m,c=new m;return function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var g=e.attributes.position,k=[0],r=1,u=g.count;r<u;r++)a.fromBufferAttribute(g,r-1),c.fromBufferAttribute(g,r),k[r]=k[r-1],k[r]+=a.distanceTo(c);e.addAttribute("lineDistance",new qa(k,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry."); else if(e.isGeometry)for(g=e.vertices,k=e.lineDistances,k[0]=0,r=1,u=g.length;r<u;r++)k[r]=k[r-1],k[r]+=g[r-1].distanceTo(g[r]);return this}}(),raycast:function(){var a=new G,c=new Zd,e=new y;return function(g,k){var r=g.linePrecision,u=this.geometry,A=this.matrixWorld;null===u.boundingSphere&&u.computeBoundingSphere();e.copy(u.boundingSphere);e.applyMatrix4(A);e.radius+=r;if(!1!==g.ray.intersectsSphere(e)){a.getInverse(A);c.copy(g.ray).applyMatrix4(a);r/=(this.scale.x+this.scale.y+this.scale.z)/ 3;r*=r;var B=new m,C=new m;A=new m;var H=new m,I=this&&this.isLineSegments?2:1;if(u.isBufferGeometry){var K=u.index,P=u.attributes.position.array;if(null!==K){K=K.array;u=0;for(var O=K.length-1;u<O;u+=I){var S=K[u+1];B.fromArray(P,3*K[u]);C.fromArray(P,3*S);S=c.distanceSqToSegment(B,C,H,A);S>r||(H.applyMatrix4(this.matrixWorld),S=g.ray.origin.distanceTo(H),S<g.near||S>g.far||k.push({distance:S,point:A.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}))}}else for(u= 0,O=P.length/3-1;u<O;u+=I)B.fromArray(P,3*u),C.fromArray(P,3*u+3),S=c.distanceSqToSegment(B,C,H,A),S>r||(H.applyMatrix4(this.matrixWorld),S=g.ray.origin.distanceTo(H),S<g.near||S>g.far||k.push({distance:S,point:A.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}))}else if(u.isGeometry)for(B=u.vertices,C=B.length,u=0;u<C-1;u+=I)S=c.distanceSqToSegment(B[u],B[u+1],H,A),S>r||(H.applyMatrix4(this.matrixWorld),S=g.ray.origin.distanceTo(H),S<g.near||S>g.far||k.push({distance:S, point:A.clone().applyMatrix4(this.matrixWorld),index:u,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});Ab.prototype=Object.assign(Object.create(fc.prototype),{constructor:Ab,isLineSegments:!0,computeLineDistances:function(){var a=new m,c=new m;return function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var g=e.attributes.position,k=[],r=0,u=g.count;r<u;r+=2)a.fromBufferAttribute(g,r),c.fromBufferAttribute(g, r+1),k[r]=0===r?0:k[r-1],k[r+1]=k[r]+a.distanceTo(c);e.addAttribute("lineDistance",new qa(k,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry)for(g=e.vertices,k=e.lineDistances,r=0,u=g.length;r<u;r+=2)a.copy(g[r]),c.copy(g[r+1]),k[r]=0===r?0:k[r-1],k[r+1]=k[r]+a.distanceTo(c);return this}}()});bh.prototype=Object.assign(Object.create(fc.prototype),{constructor:bh,isLineLoop:!0});Mc.prototype=Object.create(bb.prototype); Mc.prototype.constructor=Mc;Mc.prototype.isPointsMaterial=!0;Mc.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.size=a.size;this.sizeAttenuation=a.sizeAttenuation;this.morphTargets=a.morphTargets;return this};Qe.prototype=Object.assign(Object.create(T.prototype),{constructor:Qe,isPoints:!0,raycast:function(){var a=new G,c=new Zd,e=new y;return function(g,k){function r(V,ca){var ha=c.distanceSqToPoint(V);ha<H&&(c.closestPointToPoint(V,I),I.applyMatrix4(B), V=g.ray.origin.distanceTo(I),V<g.near||V>g.far||k.push({distance:V,distanceToRay:Math.sqrt(ha),point:I.clone(),index:ca,face:null,object:u}))}var u=this,A=this.geometry,B=this.matrixWorld,C=g.params.Points.threshold;null===A.boundingSphere&&A.computeBoundingSphere();e.copy(A.boundingSphere);e.applyMatrix4(B);e.radius+=C;if(!1!==g.ray.intersectsSphere(e)){a.getInverse(B);c.copy(g.ray).applyMatrix4(a);C/=(this.scale.x+this.scale.y+this.scale.z)/3;var H=C*C;C=new m;var I=new m;if(A.isBufferGeometry){var K= A.index;A=A.attributes.position.array;if(null!==K){var P=K.array;K=0;for(var O=P.length;K<O;K++){var S=P[K];C.fromArray(A,3*S);r(C,S)}}else for(K=0,P=A.length/3;K<P;K++)C.fromArray(A,3*K),r(C,K)}else for(C=A.vertices,K=0,P=C.length;K<P;K++)r(C[K],K)}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});ji.prototype=Object.assign(Object.create(l.prototype),{constructor:ji,isVideoTexture:!0,update:function(){var a=this.image;a.readyState>=a.HAVE_CURRENT_DATA&& (this.needsUpdate=!0)}});Re.prototype=Object.create(l.prototype);Re.prototype.constructor=Re;Re.prototype.isCompressedTexture=!0;Vf.prototype=Object.create(l.prototype);Vf.prototype.constructor=Vf;Vf.prototype.isCanvasTexture=!0;Wf.prototype=Object.create(l.prototype);Wf.prototype.constructor=Wf;Wf.prototype.isDepthTexture=!0;Se.prototype=Object.create(za.prototype);Se.prototype.constructor=Se;Xf.prototype=Object.create(Y.prototype);Xf.prototype.constructor=Xf;Te.prototype=Object.create(za.prototype); Te.prototype.constructor=Te;Yf.prototype=Object.create(Y.prototype);Yf.prototype.constructor=Yf;vc.prototype=Object.create(za.prototype);vc.prototype.constructor=vc;Zf.prototype=Object.create(Y.prototype);Zf.prototype.constructor=Zf;Ue.prototype=Object.create(vc.prototype);Ue.prototype.constructor=Ue;$f.prototype=Object.create(Y.prototype);$f.prototype.constructor=$f;de.prototype=Object.create(vc.prototype);de.prototype.constructor=de;ag.prototype=Object.create(Y.prototype);ag.prototype.constructor= ag;Ve.prototype=Object.create(vc.prototype);Ve.prototype.constructor=Ve;bg.prototype=Object.create(Y.prototype);bg.prototype.constructor=bg;We.prototype=Object.create(vc.prototype);We.prototype.constructor=We;cg.prototype=Object.create(Y.prototype);cg.prototype.constructor=cg;ee.prototype=Object.create(za.prototype);ee.prototype.constructor=ee;ee.prototype.toJSON=function(){var a=za.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};dg.prototype=Object.create(Y.prototype); dg.prototype.constructor=dg;Xe.prototype=Object.create(za.prototype);Xe.prototype.constructor=Xe;eg.prototype=Object.create(Y.prototype);eg.prototype.constructor=eg;Ye.prototype=Object.create(za.prototype);Ye.prototype.constructor=Ye;var ap={triangulate:function(a,c,e){e=e||2;var g=c&&c.length,k=g?c[0]*e:a.length,r=dl(a,0,k,e,!0),u=[];if(!r)return u;var A;if(g){var B=e;g=[];var C;var H=0;for(C=c.length;H<C;H++){var I=c[H]*B;var K=H<C-1?c[H+1]*B:a.length;I=dl(a,I,K,B,!1);I===I.next&&(I.steiner=!0); g.push(Vo(I))}g.sort(To);for(H=0;H<g.length;H++){c=g[H];B=r;if(B=Uo(c,B))c=gl(B,c),gg(c,c.next);r=gg(r,r.next)}}if(a.length>80*e){var P=A=a[0];var O=g=a[1];for(B=e;B<k;B+=e)H=a[B],c=a[B+1],H<P&&(P=H),c<O&&(O=c),H>A&&(A=H),c>g&&(g=c);A=Math.max(A-P,g-O);A=0!==A?1/A:0}hg(r,u,e,P,O,A);return u}},vd={area:function(a){for(var c=a.length,e=0,g=c-1,k=0;k<c;g=k++)e+=a[g].x*a[k].y-a[k].x*a[g].y;return.5*e},isClockWise:function(a){return 0>vd.area(a)},triangulateShape:function(a,c){var e=[],g=[],k=[];hl(a); il(e,a);var r=a.length;c.forEach(hl);for(a=0;a<c.length;a++)g.push(r),r+=c[a].length,il(e,c[a]);c=ap.triangulate(e,g);for(a=0;a<c.length;a+=3)k.push(c.slice(a,a+3));return k}};ge.prototype=Object.create(Y.prototype);ge.prototype.constructor=ge;ge.prototype.toJSON=function(){var a=Y.prototype.toJSON.call(this);return jl(this.parameters.shapes,this.parameters.options,a)};ad.prototype=Object.create(za.prototype);ad.prototype.constructor=ad;ad.prototype.toJSON=function(){var a=za.prototype.toJSON.call(this); return jl(this.parameters.shapes,this.parameters.options,a)};var Wo={generateTopUV:function(a,c,e,g,k){a=c[3*g];g=c[3*g+1];var r=c[3*k];k=c[3*k+1];return[new f(c[3*e],c[3*e+1]),new f(a,g),new f(r,k)]},generateSideWallUV:function(a,c,e,g,k,r){a=c[3*e];var u=c[3*e+1];e=c[3*e+2];var A=c[3*g],B=c[3*g+1];g=c[3*g+2];var C=c[3*k],H=c[3*k+1];k=c[3*k+2];var I=c[3*r],K=c[3*r+1];c=c[3*r+2];return.01>Math.abs(u-B)?[new f(a,1-e),new f(A,1-g),new f(C,1-k),new f(I,1-c)]:[new f(u,1-e),new f(B,1-g),new f(H,1-k),new f(K, 1-c)]}};jg.prototype=Object.create(Y.prototype);jg.prototype.constructor=jg;Ze.prototype=Object.create(ad.prototype);Ze.prototype.constructor=Ze;kg.prototype=Object.create(Y.prototype);kg.prototype.constructor=kg;Od.prototype=Object.create(za.prototype);Od.prototype.constructor=Od;lg.prototype=Object.create(Y.prototype);lg.prototype.constructor=lg;$e.prototype=Object.create(za.prototype);$e.prototype.constructor=$e;mg.prototype=Object.create(Y.prototype);mg.prototype.constructor=mg;af.prototype=Object.create(za.prototype); af.prototype.constructor=af;he.prototype=Object.create(Y.prototype);he.prototype.constructor=he;he.prototype.toJSON=function(){var a=Y.prototype.toJSON.call(this);return kl(this.parameters.shapes,a)};ie.prototype=Object.create(za.prototype);ie.prototype.constructor=ie;ie.prototype.toJSON=function(){var a=za.prototype.toJSON.call(this);return kl(this.parameters.shapes,a)};bf.prototype=Object.create(za.prototype);bf.prototype.constructor=bf;je.prototype=Object.create(Y.prototype);je.prototype.constructor= je;wd.prototype=Object.create(za.prototype);wd.prototype.constructor=wd;ng.prototype=Object.create(je.prototype);ng.prototype.constructor=ng;og.prototype=Object.create(wd.prototype);og.prototype.constructor=og;pg.prototype=Object.create(Y.prototype);pg.prototype.constructor=pg;cf.prototype=Object.create(za.prototype);cf.prototype.constructor=cf;var qc=Object.freeze({WireframeGeometry:Se,ParametricGeometry:Xf,ParametricBufferGeometry:Te,TetrahedronGeometry:Zf,TetrahedronBufferGeometry:Ue,OctahedronGeometry:$f, OctahedronBufferGeometry:de,IcosahedronGeometry:ag,IcosahedronBufferGeometry:Ve,DodecahedronGeometry:bg,DodecahedronBufferGeometry:We,PolyhedronGeometry:Yf,PolyhedronBufferGeometry:vc,TubeGeometry:cg,TubeBufferGeometry:ee,TorusKnotGeometry:dg,TorusKnotBufferGeometry:Xe,TorusGeometry:eg,TorusBufferGeometry:Ye,TextGeometry:jg,TextBufferGeometry:Ze,SphereGeometry:kg,SphereBufferGeometry:Od,RingGeometry:lg,RingBufferGeometry:$e,PlaneGeometry:Gc,PlaneBufferGeometry:Wc,LatheGeometry:mg,LatheBufferGeometry:af, ShapeGeometry:he,ShapeBufferGeometry:ie,ExtrudeGeometry:ge,ExtrudeBufferGeometry:ad,EdgesGeometry:bf,ConeGeometry:ng,ConeBufferGeometry:og,CylinderGeometry:je,CylinderBufferGeometry:wd,CircleGeometry:pg,CircleBufferGeometry:cf,BoxGeometry:Ib,BoxBufferGeometry:oc});ke.prototype=Object.create(bb.prototype);ke.prototype.constructor=ke;ke.prototype.isShadowMaterial=!0;ke.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.color.copy(a.color);return this};df.prototype=Object.create(tc.prototype); df.prototype.constructor=df;df.prototype.isRawShaderMaterial=!0;bd.prototype=Object.create(bb.prototype);bd.prototype.constructor=bd;bd.prototype.isMeshStandardMaterial=!0;bd.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive); this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.roughnessMap=a.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio= a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};le.prototype=Object.create(bd.prototype);le.prototype.constructor=le;le.prototype.isMeshPhysicalMaterial=!0;le.prototype.copy=function(a){bd.prototype.copy.call(this,a);this.defines={PHYSICAL:""};this.reflectivity=a.reflectivity; this.clearCoat=a.clearCoat;this.clearCoatRoughness=a.clearCoatRoughness;return this};Nc.prototype=Object.create(bb.prototype);Nc.prototype.constructor=Nc;Nc.prototype.isMeshPhongMaterial=!0;Nc.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive); this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio; this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};me.prototype=Object.create(Nc.prototype);me.prototype.constructor=me;me.prototype.isMeshToonMaterial=!0;me.prototype.copy=function(a){Nc.prototype.copy.call(this,a);this.gradientMap=a.gradientMap;return this};ne.prototype=Object.create(bb.prototype); ne.prototype.constructor=ne;ne.prototype.isMeshNormalMaterial=!0;ne.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets= a.morphTargets;this.morphNormals=a.morphNormals;return this};oe.prototype=Object.create(bb.prototype);oe.prototype.constructor=oe;oe.prototype.isMeshLambertMaterial=!0;oe.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.specularMap= a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};pe.prototype=Object.create(bb.prototype);pe.prototype.constructor=pe;pe.prototype.isMeshMatcapMaterial= !0;pe.prototype.copy=function(a){bb.prototype.copy.call(this,a);this.defines={MATCAP:""};this.color.copy(a.color);this.matcap=a.matcap;this.map=a.map;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.alphaMap=a.alphaMap;this.skinning=a.skinning;this.morphTargets=a.morphTargets; this.morphNormals=a.morphNormals;return this};qe.prototype=Object.create(ub.prototype);qe.prototype.constructor=qe;qe.prototype.isLineDashedMaterial=!0;qe.prototype.copy=function(a){ub.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var bp=Object.freeze({ShadowMaterial:ke,SpriteMaterial:Nd,RawShaderMaterial:df,ShaderMaterial:tc,PointsMaterial:Mc,MeshPhysicalMaterial:le,MeshStandardMaterial:bd,MeshPhongMaterial:Nc,MeshToonMaterial:me,MeshNormalMaterial:ne, MeshLambertMaterial:oe,MeshDepthMaterial:Kd,MeshDistanceMaterial:Ld,MeshBasicMaterial:zc,MeshMatcapMaterial:pe,LineDashedMaterial:qe,LineBasicMaterial:ub,Material:bb}),Yb={arraySlice:function(a,c,e){return Yb.isTypedArray(a)?new a.constructor(a.subarray(c,void 0!==e?e:a.length)):a.slice(c,e)},convertArray:function(a,c,e){return!a||!e&&a.constructor===c?a:"number"===typeof c.BYTES_PER_ELEMENT?new c(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var c=a.length,e=Array(c),g=0;g!==c;++g)e[g]=g;e.sort(function(k,r){return a[k]-a[r]});return e},sortedArray:function(a,c,e){for(var g=a.length,k=new a.constructor(g),r=0,u=0;u!==g;++r)for(var A=e[r]*c,B=0;B!==c;++B)k[u++]=a[A+B];return k},flattenJSON:function(a,c,e,g){for(var k=1,r=a[0];void 0!==r&&void 0===r[g];)r=a[k++];if(void 0!==r){var u=r[g];if(void 0!==u)if(Array.isArray(u)){do u=r[g],void 0!==u&&(c.push(r.time),e.push.apply(e,u)),r=a[k++];while(void 0!== r)}else if(void 0!==u.toArray){do u=r[g],void 0!==u&&(c.push(r.time),u.toArray(e,e.length)),r=a[k++];while(void 0!==r)}else{do u=r[g],void 0!==u&&(c.push(r.time),e.push(u)),r=a[k++];while(void 0!==r)}}}};Object.assign(Ac.prototype,{evaluate:function(a){var c=this.parameterPositions,e=this._cachedIndex,g=c[e],k=c[e-1];a:{b:{c:{d:if(!(a<g)){for(var r=e+2;;){if(void 0===g){if(a<k)break d;this._cachedIndex=e=c.length;return this.afterEnd_(e-1,a,k)}if(e===r)break;k=g;g=c[++e];if(a<g)break b}g=c.length; break c}if(a>=k)break a;else{r=c[1];a<r&&(e=2,k=r);for(r=e-2;;){if(void 0===k)return this._cachedIndex=0,this.beforeStart_(0,a,g);if(e===r)break;g=k;k=c[--e-1];if(a>=k)break b}g=e;e=0}}for(;e<g;)k=e+g>>>1,a<c[k]?g=k:e=k+1;g=c[e];k=c[e-1];if(void 0===k)return this._cachedIndex=0,this.beforeStart_(0,a,g);if(void 0===g)return this._cachedIndex=e=c.length,this.afterEnd_(e-1,k,a)}this._cachedIndex=e;this.intervalChanged_(e,k,g)}return this.interpolate_(e,k,a,g)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings|| this.DefaultSettings_},copySampleValue_:function(a){var c=this.resultBuffer,e=this.sampleValues,g=this.valueSize;a*=g;for(var k=0;k!==g;++k)c[k]=e[a+k];return c},interpolate_:function(){throw Error("call to abstract method");},intervalChanged_:function(){}});Object.assign(Ac.prototype,{beforeStart_:Ac.prototype.copySampleValue_,afterEnd_:Ac.prototype.copySampleValue_});dh.prototype=Object.assign(Object.create(Ac.prototype),{constructor:dh,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(a, c,e){var g=this.parameterPositions,k=a-2,r=a+1,u=g[k],A=g[r];if(void 0===u)switch(this.getSettings_().endingStart){case 2401:k=a;u=2*c-e;break;case 2402:k=g.length-2;u=c+g[k]-g[k+1];break;default:k=a,u=e}if(void 0===A)switch(this.getSettings_().endingEnd){case 2401:r=a;A=2*e-c;break;case 2402:r=1;A=e+g[1]-g[0];break;default:r=a-1,A=c}a=.5*(e-c);g=this.valueSize;this._weightPrev=a/(c-u);this._weightNext=a/(A-e);this._offsetPrev=k*g;this._offsetNext=r*g},interpolate_:function(a,c,e,g){var k=this.resultBuffer, r=this.sampleValues,u=this.valueSize;a*=u;var A=a-u,B=this._offsetPrev,C=this._offsetNext,H=this._weightPrev,I=this._weightNext,K=(e-c)/(g-c);e=K*K;g=e*K;c=-H*g+2*H*e-H*K;H=(1+H)*g+(-1.5-2*H)*e+(-.5+H)*K+1;K=(-1-I)*g+(1.5+I)*e+.5*K;I=I*g-I*e;for(e=0;e!==u;++e)k[e]=c*r[B+e]+H*r[A+e]+K*r[a+e]+I*r[C+e];return k}});qg.prototype=Object.assign(Object.create(Ac.prototype),{constructor:qg,interpolate_:function(a,c,e,g){var k=this.resultBuffer,r=this.sampleValues,u=this.valueSize;a*=u;var A=a-u;c=(e-c)/(g- c);e=1-c;for(g=0;g!==u;++g)k[g]=r[A+g]*e+r[a+g]*c;return k}});eh.prototype=Object.assign(Object.create(Ac.prototype),{constructor:eh,interpolate_:function(a){return this.copySampleValue_(a-1)}});Object.assign(gc,{toJSON:function(a){var c=a.constructor;if(void 0!==c.toJSON)c=c.toJSON(a);else{c={name:a.name,times:Yb.convertArray(a.times,Array),values:Yb.convertArray(a.values,Array)};var e=a.getInterpolation();e!==a.DefaultInterpolation&&(c.interpolation=e)}c.type=a.ValueTypeName;return c}});Object.assign(gc.prototype, {constructor:gc,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(a){return new eh(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodLinear:function(a){return new qg(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:function(a){return new dh(this.times,this.values,this.getValueSize(),a)},setInterpolation:function(a){switch(a){case 2300:var c=this.InterpolantFactoryMethodDiscrete; break;case 2301:c=this.InterpolantFactoryMethodLinear;break;case 2302:c=this.InterpolantFactoryMethodSmooth}if(void 0===c){c="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(a!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(c);console.warn("THREE.KeyframeTrack:",c);return this}this.createInterpolant=c;return this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300; case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(a){if(0!==a)for(var c=this.times,e=0,g=c.length;e!==g;++e)c[e]+=a;return this},scale:function(a){if(1!==a)for(var c=this.times,e=0,g=c.length;e!==g;++e)c[e]*=a;return this},trim:function(a,c){for(var e=this.times,g=e.length,k=0,r=g-1;k!==g&&e[k]<a;)++k;for(;-1!==r&&e[r]>c;)--r;++r;if(0!==k||r!==g)k>=r&&(r=Math.max(r, 1),k=r-1),a=this.getValueSize(),this.times=Yb.arraySlice(e,k,r),this.values=Yb.arraySlice(this.values,k*a,r*a);return this},validate:function(){var a=!0,c=this.getValueSize();0!==c-Math.floor(c)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var e=this.times;c=this.values;var g=e.length;0===g&&(console.error("THREE.KeyframeTrack: Track is empty.",this),a=!1);for(var k=null,r=0;r!==g;r++){var u=e[r];if("number"===typeof u&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.", this,r,u);a=!1;break}if(null!==k&&k>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,r,u,k);a=!1;break}k=u}if(void 0!==c&&Yb.isTypedArray(c))for(r=0,e=c.length;r!==e;++r)if(g=c[r],isNaN(g)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,r,g);a=!1;break}return a},optimize:function(){for(var a=this.times,c=this.values,e=this.getValueSize(),g=2302===this.getInterpolation(),k=1,r=a.length-1,u=1;u<r;++u){var A=!1,B=a[u];if(B!==a[u+1]&&(1!==u||B!==B[0]))if(g)A=!0; else{var C=u*e,H=C-e,I=C+e;for(B=0;B!==e;++B){var K=c[C+B];if(K!==c[H+B]||K!==c[I+B]){A=!0;break}}}if(A){if(u!==k)for(a[k]=a[u],A=u*e,C=k*e,B=0;B!==e;++B)c[C+B]=c[A+B];++k}}if(0<r){a[k]=a[r];A=r*e;C=k*e;for(B=0;B!==e;++B)c[C+B]=c[A+B];++k}k!==a.length&&(this.times=Yb.arraySlice(a,0,k),this.values=Yb.arraySlice(c,0,k*e));return this},clone:function(){var a=Yb.arraySlice(this.times,0),c=Yb.arraySlice(this.values,0);a=new this.constructor(this.name,a,c);a.createInterpolant=this.createInterpolant;return a}}); fh.prototype=Object.assign(Object.create(gc.prototype),{constructor:fh,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});gh.prototype=Object.assign(Object.create(gc.prototype),{constructor:gh,ValueTypeName:"color"});ef.prototype=Object.assign(Object.create(gc.prototype),{constructor:ef,ValueTypeName:"number"});hh.prototype=Object.assign(Object.create(Ac.prototype),{constructor:hh,interpolate_:function(a, c,e,g){var k=this.resultBuffer,r=this.sampleValues,u=this.valueSize;a*=u;c=(e-c)/(g-c);for(e=a+u;a!==e;a+=4)h.slerpFlat(k,0,r,a-u,r,a,c);return k}});rg.prototype=Object.assign(Object.create(gc.prototype),{constructor:rg,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(a){return new hh(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:void 0});ih.prototype=Object.assign(Object.create(gc.prototype),{constructor:ih,ValueTypeName:"string", ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});ff.prototype=Object.assign(Object.create(gc.prototype),{constructor:ff,ValueTypeName:"vector"});Object.assign(Hc,{parse:function(a){for(var c=[],e=a.tracks,g=1/(a.fps||1),k=0,r=e.length;k!==r;++k)c.push(Yo(e[k]).scale(g));return new Hc(a.name,a.duration,c)},toJSON:function(a){var c=[],e=a.tracks;a={name:a.name,duration:a.duration,tracks:c,uuid:a.uuid};for(var g=0,k=e.length;g!== k;++g)c.push(gc.toJSON(e[g]));return a},CreateFromMorphTargetSequence:function(a,c,e,g){for(var k=c.length,r=[],u=0;u<k;u++){var A=[],B=[];A.push((u+k-1)%k,u,(u+1)%k);B.push(0,1,0);var C=Yb.getKeyframeOrder(A);A=Yb.sortedArray(A,1,C);B=Yb.sortedArray(B,1,C);g||0!==A[0]||(A.push(k),B.push(B[0]));r.push((new ef(".morphTargetInfluences["+c[u].name+"]",A,B)).scale(1/e))}return new Hc(a,-1,r)},findByName:function(a,c){var e=a;Array.isArray(a)||(e=a.geometry&&a.geometry.animations||a.animations);for(a= 0;a<e.length;a++)if(e[a].name===c)return e[a];return null},CreateClipsFromMorphTargetSequences:function(a,c,e){for(var g={},k=/^([\w-]*?)([\d]+)$/,r=0,u=a.length;r<u;r++){var A=a[r],B=A.name.match(k);if(B&&1<B.length){var C=B[1];(B=g[C])||(g[C]=B=[]);B.push(A)}}a=[];for(C in g)a.push(Hc.CreateFromMorphTargetSequence(C,g[C],c,e));return a},parseAnimation:function(a,c){function e(S,V,ca,ha,ba){if(0!==ca.length){var ka=[],da=[];Yb.flattenJSON(ca,ka,da,ha);0!==ka.length&&ba.push(new S(V,ka,da))}}if(!a)return console.error("THREE.AnimationClip: No animation in JSONLoader data."), null;var g=[],k=a.name||"default",r=a.length||-1,u=a.fps||30;a=a.hierarchy||[];for(var A=0;A<a.length;A++){var B=a[A].keys;if(B&&0!==B.length)if(B[0].morphTargets){r={};for(var C=0;C<B.length;C++)if(B[C].morphTargets)for(var H=0;H<B[C].morphTargets.length;H++)r[B[C].morphTargets[H]]=-1;for(var I in r){var K=[],P=[];for(H=0;H!==B[C].morphTargets.length;++H){var O=B[C];K.push(O.time);P.push(O.morphTarget===I?1:0)}g.push(new ef(".morphTargetInfluence["+I+"]",K,P))}r=r.length*(u||1)}else C=".bones["+ c[A].name+"]",e(ff,C+".position",B,"pos",g),e(rg,C+".quaternion",B,"rot",g),e(ff,C+".scale",B,"scl",g)}return 0===g.length?null:new Hc(k,r,g)}});Object.assign(Hc.prototype,{resetDuration:function(){for(var a=0,c=0,e=this.tracks.length;c!==e;++c){var g=this.tracks[c];a=Math.max(a,g.times[g.times.length-1])}this.duration=a;return this},trim:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].trim(0,this.duration);return this},validate:function(){for(var a=!0,c=0;c<this.tracks.length;c++)a= a&&this.tracks[c].validate();return a},optimize:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].optimize();return this},clone:function(){for(var a=[],c=0;c<this.tracks.length;c++)a.push(this.tracks[c].clone());return new Hc(this.name,this.duration,a)}});var se={enabled:!1,files:{},add:function(a,c){!1!==this.enabled&&(this.files[a]=c)},get:function(a){if(!1!==this.enabled)return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}},wc=new mi,Vc={}; Object.assign(Oc.prototype,{load:function(a,c,e,g){void 0===a&&(a="");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var k=this,r=se.get(a);if(void 0!==r)return k.manager.itemStart(a),setTimeout(function(){c&&c(r);k.manager.itemEnd(a)},0),r;if(void 0!==Vc[a])Vc[a].push({onLoad:c,onProgress:e,onError:g});else{var u=a.match(/^data:(.*?)(;base64)?,(.*)$/);if(u){e=u[1];var A=!!u[2];u=u[3];u=decodeURIComponent(u);A&&(u=atob(u));try{var B=(this.responseType||"").toLowerCase();switch(B){case "arraybuffer":case "blob":var C= new Uint8Array(u.length);for(A=0;A<u.length;A++)C[A]=u.charCodeAt(A);var H="blob"===B?new Blob([C.buffer],{type:e}):C.buffer;break;case "document":H=(new DOMParser).parseFromString(u,e);break;case "json":H=JSON.parse(u);break;default:H=u}setTimeout(function(){c&&c(H);k.manager.itemEnd(a)},0)}catch(K){setTimeout(function(){g&&g(K);k.manager.itemError(a);k.manager.itemEnd(a)},0)}}else{Vc[a]=[];Vc[a].push({onLoad:c,onProgress:e,onError:g});var I=new XMLHttpRequest;I.open("GET",a,!0);I.addEventListener("load", function(K){var P=this.response;se.add(a,P);var O=Vc[a];delete Vc[a];if(200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var S=0,V=O.length;S<V;S++){var ca=O[S];if(ca.onLoad)ca.onLoad(P)}}else{S=0;for(V=O.length;S<V;S++)if(ca=O[S],ca.onError)ca.onError(K);k.manager.itemError(a)}k.manager.itemEnd(a)},!1);I.addEventListener("progress",function(K){for(var P=Vc[a],O=0,S=P.length;O<S;O++){var V=P[O];if(V.onProgress)V.onProgress(K)}},!1); I.addEventListener("error",function(K){var P=Vc[a];delete Vc[a];for(var O=0,S=P.length;O<S;O++){var V=P[O];if(V.onError)V.onError(K)}k.manager.itemError(a);k.manager.itemEnd(a)},!1);I.addEventListener("abort",function(K){var P=Vc[a];delete Vc[a];for(var O=0,S=P.length;O<S;O++){var V=P[O];if(V.onError)V.onError(K)}k.manager.itemError(a);k.manager.itemEnd(a)},!1);void 0!==this.responseType&&(I.responseType=this.responseType);void 0!==this.withCredentials&&(I.withCredentials=this.withCredentials);I.overrideMimeType&& I.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(A in this.requestHeader)I.setRequestHeader(A,this.requestHeader[A]);I.send(null)}k.manager.itemStart(a);return I}},setPath:function(a){this.path=a;return this},setResponseType:function(a){this.responseType=a;return this},setWithCredentials:function(a){this.withCredentials=a;return this},setMimeType:function(a){this.mimeType=a;return this},setRequestHeader:function(a){this.requestHeader=a;return this}});Object.assign(ll.prototype, {load:function(a,c,e,g){var k=this,r=new Oc(k.manager);r.setPath(k.path);r.load(a,function(u){c(k.parse(JSON.parse(u)))},e,g)},parse:function(a){for(var c=[],e=0;e<a.length;e++){var g=Hc.parse(a[e]);c.push(g)}return c},setPath:function(a){this.path=a;return this}});Object.assign(ml.prototype,{load:function(a,c,e,g){function k(K){B.load(a[K],function(P){P=r._parser(P,!0);u[K]={width:P.width,height:P.height,format:P.format,mipmaps:P.mipmaps};C+=1;6===C&&(1===P.mipmapCount&&(A.minFilter=1006),A.format= P.format,A.needsUpdate=!0,c&&c(A))},e,g)}var r=this,u=[],A=new Re;A.image=u;var B=new Oc(this.manager);B.setPath(this.path);B.setResponseType("arraybuffer");if(Array.isArray(a))for(var C=0,H=0,I=a.length;H<I;++H)k(H);else B.load(a,function(K){K=r._parser(K,!0);if(K.isCubemap)for(var P=K.mipmaps.length/K.mipmapCount,O=0;O<P;O++){u[O]={mipmaps:[]};for(var S=0;S<K.mipmapCount;S++)u[O].mipmaps.push(K.mipmaps[O*K.mipmapCount+S]),u[O].format=K.format,u[O].width=K.width,u[O].height=K.height}else A.image.width= K.width,A.image.height=K.height,A.mipmaps=K.mipmaps;1===K.mipmapCount&&(A.minFilter=1006);A.format=K.format;A.needsUpdate=!0;c&&c(A)},e,g);return A},setPath:function(a){this.path=a;return this}});Object.assign(ni.prototype,{load:function(a,c,e,g){var k=this,r=new v,u=new Oc(this.manager);u.setResponseType("arraybuffer");u.setPath(this.path);u.load(a,function(A){if(A=k._parser(A))void 0!==A.image?r.image=A.image:void 0!==A.data&&(r.image.width=A.width,r.image.height=A.height,r.image.data=A.data),r.wrapS= void 0!==A.wrapS?A.wrapS:1001,r.wrapT=void 0!==A.wrapT?A.wrapT:1001,r.magFilter=void 0!==A.magFilter?A.magFilter:1006,r.minFilter=void 0!==A.minFilter?A.minFilter:1008,r.anisotropy=void 0!==A.anisotropy?A.anisotropy:1,void 0!==A.format&&(r.format=A.format),void 0!==A.type&&(r.type=A.type),void 0!==A.mipmaps&&(r.mipmaps=A.mipmaps),1===A.mipmapCount&&(r.minFilter=1006),r.needsUpdate=!0,c&&c(r,A)},e,g);return r},setPath:function(a){this.path=a;return this}});Object.assign(sg.prototype,{crossOrigin:"anonymous", load:function(a,c,e,g){function k(){B.removeEventListener("load",k,!1);B.removeEventListener("error",r,!1);se.add(a,this);c&&c(this);u.manager.itemEnd(a)}function r(C){B.removeEventListener("load",k,!1);B.removeEventListener("error",r,!1);g&&g(C);u.manager.itemError(a);u.manager.itemEnd(a)}void 0===a&&(a="");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var u=this,A=se.get(a);if(void 0!==A)return u.manager.itemStart(a),setTimeout(function(){c&&c(A);u.manager.itemEnd(a)},0),A;var B= document.createElementNS("http://www.w3.org/1999/xhtml","img");B.addEventListener("load",k,!1);B.addEventListener("error",r,!1);"data:"!==a.substr(0,5)&&void 0!==this.crossOrigin&&(B.crossOrigin=this.crossOrigin);u.manager.itemStart(a);B.src=a;return B},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(oi.prototype,{crossOrigin:"anonymous",load:function(a,c,e,g){function k(B){u.load(a[B],function(C){r.images[B]=C;A++;6===A&&(r.needsUpdate= !0,c&&c(r))},void 0,g)}var r=new sd,u=new sg(this.manager);u.setCrossOrigin(this.crossOrigin);u.setPath(this.path);var A=0;for(e=0;e<a.length;++e)k(e);return r},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(jh.prototype,{crossOrigin:"anonymous",load:function(a,c,e,g){var k=new l,r=new sg(this.manager);r.setCrossOrigin(this.crossOrigin);r.setPath(this.path);r.load(a,function(u){k.image=u;u=0<a.search(/\.jpe?g($|\?)/i)||0===a.search(/^data:image\/jpeg/); k.format=u?1022:1023;k.needsUpdate=!0;void 0!==c&&c(k)},e,g);return k},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(Wa.prototype,{getPoint:function(){console.warn("THREE.Curve: .getPoint() not implemented.");return null},getPointAt:function(a,c){a=this.getUtoTmapping(a);return this.getPoint(a,c)},getPoints:function(a){void 0===a&&(a=5);for(var c=[],e=0;e<=a;e++)c.push(this.getPoint(e/a));return c},getSpacedPoints:function(a){void 0=== a&&(a=5);for(var c=[],e=0;e<=a;e++)c.push(this.getPointAt(e/a));return c},getLength:function(){var a=this.getLengths();return a[a.length-1]},getLengths:function(a){void 0===a&&(a=this.arcLengthDivisions);if(this.cacheArcLengths&&this.cacheArcLengths.length===a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var c=[],e=this.getPoint(0),g,k=0;c.push(0);for(g=1;g<=a;g++){var r=this.getPoint(g/a);k+=r.distanceTo(e);c.push(k);e=r}return this.cacheArcLengths=c},updateArcLengths:function(){this.needsUpdate= !0;this.getLengths()},getUtoTmapping:function(a,c){var e=this.getLengths(),g=e.length;c=c?c:a*e[g-1];for(var k=0,r=g-1,u;k<=r;)if(a=Math.floor(k+(r-k)/2),u=e[a]-c,0>u)k=a+1;else if(0<u)r=a-1;else{r=a;break}a=r;if(e[a]===c)return a/(g-1);k=e[a];return(a+(c-k)/(e[a+1]-k))/(g-1)},getTangent:function(a){var c=a-1E-4;a+=1E-4;0>c&&(c=0);1<a&&(a=1);c=this.getPoint(c);return this.getPoint(a).clone().sub(c).normalize()},getTangentAt:function(a){a=this.getUtoTmapping(a);return this.getTangent(a)},computeFrenetFrames:function(a, c){var e=new m,g=[],k=[],r=[],u=new m,A=new G,B;for(B=0;B<=a;B++){var C=B/a;g[B]=this.getTangentAt(C);g[B].normalize()}k[0]=new m;r[0]=new m;B=Number.MAX_VALUE;C=Math.abs(g[0].x);var H=Math.abs(g[0].y),I=Math.abs(g[0].z);C<=B&&(B=C,e.set(1,0,0));H<=B&&(B=H,e.set(0,1,0));I<=B&&e.set(0,0,1);u.crossVectors(g[0],e).normalize();k[0].crossVectors(g[0],u);r[0].crossVectors(g[0],k[0]);for(B=1;B<=a;B++)k[B]=k[B-1].clone(),r[B]=r[B-1].clone(),u.crossVectors(g[B-1],g[B]),u.length()>Number.EPSILON&&(u.normalize(), e=Math.acos(ab.clamp(g[B-1].dot(g[B]),-1,1)),k[B].applyMatrix4(A.makeRotationAxis(u,e))),r[B].crossVectors(g[B],k[B]);if(!0===c)for(e=Math.acos(ab.clamp(k[0].dot(k[a]),-1,1)),e/=a,0<g[0].dot(u.crossVectors(k[0],k[a]))&&(e=-e),B=1;B<=a;B++)k[B].applyMatrix4(A.makeRotationAxis(g[B],e*B)),r[B].crossVectors(g[B],k[B]);return{tangents:g,normals:k,binormals:r}},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.arcLengthDivisions=a.arcLengthDivisions;return this},toJSON:function(){var a= {metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};a.arcLengthDivisions=this.arcLengthDivisions;a.type=this.type;return a},fromJSON:function(a){this.arcLengthDivisions=a.arcLengthDivisions;return this}});Bc.prototype=Object.create(Wa.prototype);Bc.prototype.constructor=Bc;Bc.prototype.isEllipseCurve=!0;Bc.prototype.getPoint=function(a,c){c=c||new f;for(var e=2*Math.PI,g=this.aEndAngle-this.aStartAngle,k=Math.abs(g)<Number.EPSILON;0>g;)g+=e;for(;g>e;)g-=e;g<Number.EPSILON&&(g=k?0:e);!0!== this.aClockwise||k||(g=g===e?-e:g-e);e=this.aStartAngle+a*g;a=this.aX+this.xRadius*Math.cos(e);var r=this.aY+this.yRadius*Math.sin(e);0!==this.aRotation&&(e=Math.cos(this.aRotation),g=Math.sin(this.aRotation),k=a-this.aX,r-=this.aY,a=k*e-r*g+this.aX,r=k*g+r*e+this.aY);return c.set(a,r)};Bc.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.aX=a.aX;this.aY=a.aY;this.xRadius=a.xRadius;this.yRadius=a.yRadius;this.aStartAngle=a.aStartAngle;this.aEndAngle=a.aEndAngle;this.aClockwise=a.aClockwise; this.aRotation=a.aRotation;return this};Bc.prototype.toJSON=function(){var a=Wa.prototype.toJSON.call(this);a.aX=this.aX;a.aY=this.aY;a.xRadius=this.xRadius;a.yRadius=this.yRadius;a.aStartAngle=this.aStartAngle;a.aEndAngle=this.aEndAngle;a.aClockwise=this.aClockwise;a.aRotation=this.aRotation;return a};Bc.prototype.fromJSON=function(a){Wa.prototype.fromJSON.call(this,a);this.aX=a.aX;this.aY=a.aY;this.xRadius=a.xRadius;this.yRadius=a.yRadius;this.aStartAngle=a.aStartAngle;this.aEndAngle=a.aEndAngle; this.aClockwise=a.aClockwise;this.aRotation=a.aRotation;return this};gf.prototype=Object.create(Bc.prototype);gf.prototype.constructor=gf;gf.prototype.isArcCurve=!0;var yh=new m,Ni=new pi,Oi=new pi,Pi=new pi;lc.prototype=Object.create(Wa.prototype);lc.prototype.constructor=lc;lc.prototype.isCatmullRomCurve3=!0;lc.prototype.getPoint=function(a,c){c=c||new m;var e=this.points,g=e.length;a*=g-(this.closed?0:1);var k=Math.floor(a);a-=k;this.closed?k+=0<k?0:(Math.floor(Math.abs(k)/g)+1)*g:0===a&&k===g- 1&&(k=g-2,a=1);if(this.closed||0<k)var r=e[(k-1)%g];else yh.subVectors(e[0],e[1]).add(e[0]),r=yh;var u=e[k%g];var A=e[(k+1)%g];this.closed||k+2<g?e=e[(k+2)%g]:(yh.subVectors(e[g-1],e[g-2]).add(e[g-1]),e=yh);if("centripetal"===this.curveType||"chordal"===this.curveType){var B="chordal"===this.curveType?.5:.25;g=Math.pow(r.distanceToSquared(u),B);k=Math.pow(u.distanceToSquared(A),B);B=Math.pow(A.distanceToSquared(e),B);1E-4>k&&(k=1);1E-4>g&&(g=k);1E-4>B&&(B=k);Ni.initNonuniformCatmullRom(r.x,u.x,A.x, e.x,g,k,B);Oi.initNonuniformCatmullRom(r.y,u.y,A.y,e.y,g,k,B);Pi.initNonuniformCatmullRom(r.z,u.z,A.z,e.z,g,k,B)}else"catmullrom"===this.curveType&&(Ni.initCatmullRom(r.x,u.x,A.x,e.x,this.tension),Oi.initCatmullRom(r.y,u.y,A.y,e.y,this.tension),Pi.initCatmullRom(r.z,u.z,A.z,e.z,this.tension));c.set(Ni.calc(a),Oi.calc(a),Pi.calc(a));return c};lc.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.points=[];for(var c=0,e=a.points.length;c<e;c++)this.points.push(a.points[c].clone());this.closed= a.closed;this.curveType=a.curveType;this.tension=a.tension;return this};lc.prototype.toJSON=function(){var a=Wa.prototype.toJSON.call(this);a.points=[];for(var c=0,e=this.points.length;c<e;c++)a.points.push(this.points[c].toArray());a.closed=this.closed;a.curveType=this.curveType;a.tension=this.tension;return a};lc.prototype.fromJSON=function(a){Wa.prototype.fromJSON.call(this,a);this.points=[];for(var c=0,e=a.points.length;c<e;c++){var g=a.points[c];this.points.push((new m).fromArray(g))}this.closed= a.closed;this.curveType=a.curveType;this.tension=a.tension;return this};Pc.prototype=Object.create(Wa.prototype);Pc.prototype.constructor=Pc;Pc.prototype.isCubicBezierCurve=!0;Pc.prototype.getPoint=function(a,c){c=c||new f;var e=this.v0,g=this.v1,k=this.v2,r=this.v3;c.set(ug(a,e.x,g.x,k.x,r.x),ug(a,e.y,g.y,k.y,r.y));return c};Pc.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);this.v3.copy(a.v3);return this};Pc.prototype.toJSON=function(){var a= Wa.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();a.v3=this.v3.toArray();return a};Pc.prototype.fromJSON=function(a){Wa.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);this.v3.fromArray(a.v3);return this};cd.prototype=Object.create(Wa.prototype);cd.prototype.constructor=cd;cd.prototype.isCubicBezierCurve3=!0;cd.prototype.getPoint=function(a,c){c=c||new m;var e=this.v0,g=this.v1,k=this.v2,r=this.v3; c.set(ug(a,e.x,g.x,k.x,r.x),ug(a,e.y,g.y,k.y,r.y),ug(a,e.z,g.z,k.z,r.z));return c};cd.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);this.v3.copy(a.v3);return this};cd.prototype.toJSON=function(){var a=Wa.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();a.v3=this.v3.toArray();return a};cd.prototype.fromJSON=function(a){Wa.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1); this.v2.fromArray(a.v2);this.v3.fromArray(a.v3);return this};xc.prototype=Object.create(Wa.prototype);xc.prototype.constructor=xc;xc.prototype.isLineCurve=!0;xc.prototype.getPoint=function(a,c){c=c||new f;1===a?c.copy(this.v2):(c.copy(this.v2).sub(this.v1),c.multiplyScalar(a).add(this.v1));return c};xc.prototype.getPointAt=function(a,c){return this.getPoint(a,c)};xc.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()};xc.prototype.copy=function(a){Wa.prototype.copy.call(this, a);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};xc.prototype.toJSON=function(){var a=Wa.prototype.toJSON.call(this);a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};xc.prototype.fromJSON=function(a){Wa.prototype.fromJSON.call(this,a);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Qc.prototype=Object.create(Wa.prototype);Qc.prototype.constructor=Qc;Qc.prototype.isLineCurve3=!0;Qc.prototype.getPoint=function(a,c){c=c||new m;1===a?c.copy(this.v2):(c.copy(this.v2).sub(this.v1), c.multiplyScalar(a).add(this.v1));return c};Qc.prototype.getPointAt=function(a,c){return this.getPoint(a,c)};Qc.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};Qc.prototype.toJSON=function(){var a=Wa.prototype.toJSON.call(this);a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};Qc.prototype.fromJSON=function(a){Wa.prototype.fromJSON.call(this,a);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Rc.prototype=Object.create(Wa.prototype); Rc.prototype.constructor=Rc;Rc.prototype.isQuadraticBezierCurve=!0;Rc.prototype.getPoint=function(a,c){c=c||new f;var e=this.v0,g=this.v1,k=this.v2;c.set(tg(a,e.x,g.x,k.x),tg(a,e.y,g.y,k.y));return c};Rc.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};Rc.prototype.toJSON=function(){var a=Wa.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};Rc.prototype.fromJSON= function(a){Wa.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};dd.prototype=Object.create(Wa.prototype);dd.prototype.constructor=dd;dd.prototype.isQuadraticBezierCurve3=!0;dd.prototype.getPoint=function(a,c){c=c||new m;var e=this.v0,g=this.v1,k=this.v2;c.set(tg(a,e.x,g.x,k.x),tg(a,e.y,g.y,k.y),tg(a,e.z,g.z,k.z));return c};dd.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2); return this};dd.prototype.toJSON=function(){var a=Wa.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};dd.prototype.fromJSON=function(a){Wa.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Sc.prototype=Object.create(Wa.prototype);Sc.prototype.constructor=Sc;Sc.prototype.isSplineCurve=!0;Sc.prototype.getPoint=function(a,c){c=c||new f;var e=this.points,g=(e.length-1)*a;a=Math.floor(g); g-=a;var k=e[0===a?a:a-1],r=e[a],u=e[a>e.length-2?e.length-1:a+1];e=e[a>e.length-3?e.length-1:a+2];c.set(nl(g,k.x,r.x,u.x,e.x),nl(g,k.y,r.y,u.y,e.y));return c};Sc.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.points=[];for(var c=0,e=a.points.length;c<e;c++)this.points.push(a.points[c].clone());return this};Sc.prototype.toJSON=function(){var a=Wa.prototype.toJSON.call(this);a.points=[];for(var c=0,e=this.points.length;c<e;c++)a.points.push(this.points[c].toArray());return a};Sc.prototype.fromJSON= function(a){Wa.prototype.fromJSON.call(this,a);this.points=[];for(var c=0,e=a.points.length;c<e;c++){var g=a.points[c];this.points.push((new f).fromArray(g))}return this};var Qi=Object.freeze({ArcCurve:gf,CatmullRomCurve3:lc,CubicBezierCurve:Pc,CubicBezierCurve3:cd,EllipseCurve:Bc,LineCurve:xc,LineCurve3:Qc,QuadraticBezierCurve:Rc,QuadraticBezierCurve3:dd,SplineCurve:Sc});xd.prototype=Object.assign(Object.create(Wa.prototype),{constructor:xd,add:function(a){this.curves.push(a)},closePath:function(){var a= this.curves[0].getPoint(0),c=this.curves[this.curves.length-1].getPoint(1);a.equals(c)||this.curves.push(new xc(c,a))},getPoint:function(a){var c=a*this.getLength(),e=this.getCurveLengths();for(a=0;a<e.length;){if(e[a]>=c)return c=e[a]-c,a=this.curves[a],e=a.getLength(),a.getPointAt(0===e?0:1-c/e);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.length-1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&& this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[],c=0,e=0,g=this.curves.length;e<g;e++)c+=this.curves[e].getLength(),a.push(c);return this.cacheLengths=a},getSpacedPoints:function(a){void 0===a&&(a=40);for(var c=[],e=0;e<=a;e++)c.push(this.getPoint(e/a));this.autoClose&&c.push(c[0]);return c},getPoints:function(a){a=a||12;for(var c=[],e,g=0,k=this.curves;g<k.length;g++){var r=k[g];r=r.getPoints(r&&r.isEllipseCurve?2*a:r&&(r.isLineCurve||r.isLineCurve3)?1:r&&r.isSplineCurve? a*r.points.length:a);for(var u=0;u<r.length;u++){var A=r[u];e&&e.equals(A)||(c.push(A),e=A)}}this.autoClose&&1<c.length&&!c[c.length-1].equals(c[0])&&c.push(c[0]);return c},copy:function(a){Wa.prototype.copy.call(this,a);this.curves=[];for(var c=0,e=a.curves.length;c<e;c++)this.curves.push(a.curves[c].clone());this.autoClose=a.autoClose;return this},toJSON:function(){var a=Wa.prototype.toJSON.call(this);a.autoClose=this.autoClose;a.curves=[];for(var c=0,e=this.curves.length;c<e;c++)a.curves.push(this.curves[c].toJSON()); return a},fromJSON:function(a){Wa.prototype.fromJSON.call(this,a);this.autoClose=a.autoClose;this.curves=[];for(var c=0,e=a.curves.length;c<e;c++){var g=a.curves[c];this.curves.push((new Qi[g.type]).fromJSON(g))}return this}});Tc.prototype=Object.assign(Object.create(xd.prototype),{constructor:Tc,setFromPoints:function(a){this.moveTo(a[0].x,a[0].y);for(var c=1,e=a.length;c<e;c++)this.lineTo(a[c].x,a[c].y)},moveTo:function(a,c){this.currentPoint.set(a,c)},lineTo:function(a,c){var e=new xc(this.currentPoint.clone(), new f(a,c));this.curves.push(e);this.currentPoint.set(a,c)},quadraticCurveTo:function(a,c,e,g){a=new Rc(this.currentPoint.clone(),new f(a,c),new f(e,g));this.curves.push(a);this.currentPoint.set(e,g)},bezierCurveTo:function(a,c,e,g,k,r){a=new Pc(this.currentPoint.clone(),new f(a,c),new f(e,g),new f(k,r));this.curves.push(a);this.currentPoint.set(k,r)},splineThru:function(a){var c=[this.currentPoint.clone()].concat(a);c=new Sc(c);this.curves.push(c);this.currentPoint.copy(a[a.length-1])},arc:function(a, c,e,g,k,r){this.absarc(a+this.currentPoint.x,c+this.currentPoint.y,e,g,k,r)},absarc:function(a,c,e,g,k,r){this.absellipse(a,c,e,e,g,k,r)},ellipse:function(a,c,e,g,k,r,u,A){this.absellipse(a+this.currentPoint.x,c+this.currentPoint.y,e,g,k,r,u,A)},absellipse:function(a,c,e,g,k,r,u,A){a=new Bc(a,c,e,g,k,r,u,A);0<this.curves.length&&(c=a.getPoint(0),c.equals(this.currentPoint)||this.lineTo(c.x,c.y));this.curves.push(a);a=a.getPoint(1);this.currentPoint.copy(a)},copy:function(a){xd.prototype.copy.call(this, a);this.currentPoint.copy(a.currentPoint);return this},toJSON:function(){var a=xd.prototype.toJSON.call(this);a.currentPoint=this.currentPoint.toArray();return a},fromJSON:function(a){xd.prototype.fromJSON.call(this,a);this.currentPoint.fromArray(a.currentPoint);return this}});Pd.prototype=Object.assign(Object.create(Tc.prototype),{constructor:Pd,getPointsHoles:function(a){for(var c=[],e=0,g=this.holes.length;e<g;e++)c[e]=this.holes[e].getPoints(a);return c},extractPoints:function(a){return{shape:this.getPoints(a), holes:this.getPointsHoles(a)}},copy:function(a){Tc.prototype.copy.call(this,a);this.holes=[];for(var c=0,e=a.holes.length;c<e;c++)this.holes.push(a.holes[c].clone());return this},toJSON:function(){var a=Tc.prototype.toJSON.call(this);a.uuid=this.uuid;a.holes=[];for(var c=0,e=this.holes.length;c<e;c++)a.holes.push(this.holes[c].toJSON());return a},fromJSON:function(a){Tc.prototype.fromJSON.call(this,a);this.uuid=a.uuid;this.holes=[];for(var c=0,e=a.holes.length;c<e;c++){var g=a.holes[c];this.holes.push((new Tc).fromJSON(g))}return this}}); Bb.prototype=Object.assign(Object.create(T.prototype),{constructor:Bb,isLight:!0,copy:function(a){T.prototype.copy.call(this,a);this.color.copy(a.color);this.intensity=a.intensity;return this},toJSON:function(a){a=T.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();a.object.intensity=this.intensity;void 0!==this.groundColor&&(a.object.groundColor=this.groundColor.getHex());void 0!==this.distance&&(a.object.distance=this.distance);void 0!==this.angle&&(a.object.angle=this.angle);void 0!== this.decay&&(a.object.decay=this.decay);void 0!==this.penumbra&&(a.object.penumbra=this.penumbra);void 0!==this.shadow&&(a.object.shadow=this.shadow.toJSON());return a}});kh.prototype=Object.assign(Object.create(Bb.prototype),{constructor:kh,isHemisphereLight:!0,copy:function(a){Bb.prototype.copy.call(this,a);this.groundColor.copy(a.groundColor);return this}});Object.assign(re.prototype,{copy:function(a){this.camera=a.camera.clone();this.bias=a.bias;this.radius=a.radius;this.mapSize.copy(a.mapSize); return this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var a={};0!==this.bias&&(a.bias=this.bias);1!==this.radius&&(a.radius=this.radius);if(512!==this.mapSize.x||512!==this.mapSize.y)a.mapSize=this.mapSize.toArray();a.camera=this.camera.toJSON(!1).object;delete a.camera.matrix;return a}});lh.prototype=Object.assign(Object.create(re.prototype),{constructor:lh,isSpotLightShadow:!0,update:function(a){var c=this.camera,e=2*ab.RAD2DEG*a.angle,g=this.mapSize.width/this.mapSize.height; a=a.distance||c.far;if(e!==c.fov||g!==c.aspect||a!==c.far)c.fov=e,c.aspect=g,c.far=a,c.updateProjectionMatrix()}});mh.prototype=Object.assign(Object.create(Bb.prototype),{constructor:mh,isSpotLight:!0,copy:function(a){Bb.prototype.copy.call(this,a);this.distance=a.distance;this.angle=a.angle;this.penumbra=a.penumbra;this.decay=a.decay;this.target=a.target.clone();this.shadow=a.shadow.clone();return this}});nh.prototype=Object.assign(Object.create(Bb.prototype),{constructor:nh,isPointLight:!0,copy:function(a){Bb.prototype.copy.call(this, a);this.distance=a.distance;this.decay=a.decay;this.shadow=a.shadow.clone();return this}});vg.prototype=Object.assign(Object.create(Yc.prototype),{constructor:vg,isOrthographicCamera:!0,copy:function(a,c){Yc.prototype.copy.call(this,a,c);this.left=a.left;this.right=a.right;this.top=a.top;this.bottom=a.bottom;this.near=a.near;this.far=a.far;this.zoom=a.zoom;this.view=null===a.view?null:Object.assign({},a.view);return this},setViewOffset:function(a,c,e,g,k,r){null===this.view&&(this.view={enabled:!0, fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1});this.view.enabled=!0;this.view.fullWidth=a;this.view.fullHeight=c;this.view.offsetX=e;this.view.offsetY=g;this.view.width=k;this.view.height=r;this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1);this.updateProjectionMatrix()},updateProjectionMatrix:function(){var a=(this.right-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),e=(this.right+this.left)/2,g=(this.top+this.bottom)/ 2,k=e-a;e+=a;a=g+c;c=g-c;if(null!==this.view&&this.view.enabled){e=this.zoom/(this.view.width/this.view.fullWidth);c=this.zoom/(this.view.height/this.view.fullHeight);var r=(this.right-this.left)/this.view.width;g=(this.top-this.bottom)/this.view.height;k+=this.view.offsetX/e*r;e=k+this.view.width/e*r;a-=this.view.offsetY/c*g;c=a-this.view.height/c*g}this.projectionMatrix.makeOrthographic(k,e,a,c,this.near,this.far);this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(a){a= T.prototype.toJSON.call(this,a);a.object.zoom=this.zoom;a.object.left=this.left;a.object.right=this.right;a.object.top=this.top;a.object.bottom=this.bottom;a.object.near=this.near;a.object.far=this.far;null!==this.view&&(a.object.view=Object.assign({},this.view));return a}});oh.prototype=Object.assign(Object.create(re.prototype),{constructor:oh});ph.prototype=Object.assign(Object.create(Bb.prototype),{constructor:ph,isDirectionalLight:!0,copy:function(a){Bb.prototype.copy.call(this,a);this.target= a.target.clone();this.shadow=a.shadow.clone();return this}});qh.prototype=Object.assign(Object.create(Bb.prototype),{constructor:qh,isAmbientLight:!0});rh.prototype=Object.assign(Object.create(Bb.prototype),{constructor:rh,isRectAreaLight:!0,copy:function(a){Bb.prototype.copy.call(this,a);this.width=a.width;this.height=a.height;return this},toJSON:function(a){a=Bb.prototype.toJSON.call(this,a);a.object.width=this.width;a.object.height=this.height;return a}});Object.assign(sh.prototype,{load:function(a, c,e,g){var k=this,r=new Oc(k.manager);r.setPath(k.path);r.load(a,function(u){c(k.parse(JSON.parse(u)))},e,g)},parse:function(a){function c(A){void 0===e[A]&&console.warn("THREE.MaterialLoader: Undefined texture",A);return e[A]}var e=this.textures,g=new bp[a.type];void 0!==a.uuid&&(g.uuid=a.uuid);void 0!==a.name&&(g.name=a.name);void 0!==a.color&&g.color.setHex(a.color);void 0!==a.roughness&&(g.roughness=a.roughness);void 0!==a.metalness&&(g.metalness=a.metalness);void 0!==a.emissive&&g.emissive.setHex(a.emissive); void 0!==a.specular&&g.specular.setHex(a.specular);void 0!==a.shininess&&(g.shininess=a.shininess);void 0!==a.clearCoat&&(g.clearCoat=a.clearCoat);void 0!==a.clearCoatRoughness&&(g.clearCoatRoughness=a.clearCoatRoughness);void 0!==a.vertexColors&&(g.vertexColors=a.vertexColors);void 0!==a.fog&&(g.fog=a.fog);void 0!==a.flatShading&&(g.flatShading=a.flatShading);void 0!==a.blending&&(g.blending=a.blending);void 0!==a.combine&&(g.combine=a.combine);void 0!==a.side&&(g.side=a.side);void 0!==a.opacity&& (g.opacity=a.opacity);void 0!==a.transparent&&(g.transparent=a.transparent);void 0!==a.alphaTest&&(g.alphaTest=a.alphaTest);void 0!==a.depthTest&&(g.depthTest=a.depthTest);void 0!==a.depthWrite&&(g.depthWrite=a.depthWrite);void 0!==a.colorWrite&&(g.colorWrite=a.colorWrite);void 0!==a.wireframe&&(g.wireframe=a.wireframe);void 0!==a.wireframeLinewidth&&(g.wireframeLinewidth=a.wireframeLinewidth);void 0!==a.wireframeLinecap&&(g.wireframeLinecap=a.wireframeLinecap);void 0!==a.wireframeLinejoin&&(g.wireframeLinejoin= a.wireframeLinejoin);void 0!==a.rotation&&(g.rotation=a.rotation);1!==a.linewidth&&(g.linewidth=a.linewidth);void 0!==a.dashSize&&(g.dashSize=a.dashSize);void 0!==a.gapSize&&(g.gapSize=a.gapSize);void 0!==a.scale&&(g.scale=a.scale);void 0!==a.polygonOffset&&(g.polygonOffset=a.polygonOffset);void 0!==a.polygonOffsetFactor&&(g.polygonOffsetFactor=a.polygonOffsetFactor);void 0!==a.polygonOffsetUnits&&(g.polygonOffsetUnits=a.polygonOffsetUnits);void 0!==a.skinning&&(g.skinning=a.skinning);void 0!==a.morphTargets&& (g.morphTargets=a.morphTargets);void 0!==a.dithering&&(g.dithering=a.dithering);void 0!==a.visible&&(g.visible=a.visible);void 0!==a.userData&&(g.userData=a.userData);if(void 0!==a.uniforms)for(var k in a.uniforms){var r=a.uniforms[k];g.uniforms[k]={};switch(r.type){case "t":g.uniforms[k].value=c(r.value);break;case "c":g.uniforms[k].value=(new E).setHex(r.value);break;case "v2":g.uniforms[k].value=(new f).fromArray(r.value);break;case "v3":g.uniforms[k].value=(new m).fromArray(r.value);break;case "v4":g.uniforms[k].value= (new p).fromArray(r.value);break;case "m3":g.uniforms[k].value=(new w).fromArray(r.value);case "m4":g.uniforms[k].value=(new G).fromArray(r.value);break;default:g.uniforms[k].value=r.value}}void 0!==a.defines&&(g.defines=a.defines);void 0!==a.vertexShader&&(g.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(g.fragmentShader=a.fragmentShader);if(void 0!==a.extensions)for(var u in a.extensions)g.extensions[u]=a.extensions[u];void 0!==a.shading&&(g.flatShading=1===a.shading);void 0!==a.size&& (g.size=a.size);void 0!==a.sizeAttenuation&&(g.sizeAttenuation=a.sizeAttenuation);void 0!==a.map&&(g.map=c(a.map));void 0!==a.matcap&&(g.matcap=c(a.matcap));void 0!==a.alphaMap&&(g.alphaMap=c(a.alphaMap),g.transparent=!0);void 0!==a.bumpMap&&(g.bumpMap=c(a.bumpMap));void 0!==a.bumpScale&&(g.bumpScale=a.bumpScale);void 0!==a.normalMap&&(g.normalMap=c(a.normalMap));void 0!==a.normalMapType&&(g.normalMapType=a.normalMapType);void 0!==a.normalScale&&(k=a.normalScale,!1===Array.isArray(k)&&(k=[k,k]),g.normalScale= (new f).fromArray(k));void 0!==a.displacementMap&&(g.displacementMap=c(a.displacementMap));void 0!==a.displacementScale&&(g.displacementScale=a.displacementScale);void 0!==a.displacementBias&&(g.displacementBias=a.displacementBias);void 0!==a.roughnessMap&&(g.roughnessMap=c(a.roughnessMap));void 0!==a.metalnessMap&&(g.metalnessMap=c(a.metalnessMap));void 0!==a.emissiveMap&&(g.emissiveMap=c(a.emissiveMap));void 0!==a.emissiveIntensity&&(g.emissiveIntensity=a.emissiveIntensity);void 0!==a.specularMap&& (g.specularMap=c(a.specularMap));void 0!==a.envMap&&(g.envMap=c(a.envMap));void 0!==a.envMapIntensity&&(g.envMapIntensity=a.envMapIntensity);void 0!==a.reflectivity&&(g.reflectivity=a.reflectivity);void 0!==a.lightMap&&(g.lightMap=c(a.lightMap));void 0!==a.lightMapIntensity&&(g.lightMapIntensity=a.lightMapIntensity);void 0!==a.aoMap&&(g.aoMap=c(a.aoMap));void 0!==a.aoMapIntensity&&(g.aoMapIntensity=a.aoMapIntensity);void 0!==a.gradientMap&&(g.gradientMap=c(a.gradientMap));return g},setPath:function(a){this.path= a;return this},setTextures:function(a){this.textures=a;return this}});var Ri={decodeText:function(a){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(a);for(var c="",e=0,g=a.length;e<g;e++)c+=String.fromCharCode(a[e]);return decodeURIComponent(escape(c))},extractUrlBase:function(a){var c=a.lastIndexOf("/");return-1===c?"./":a.substr(0,c+1)}};Object.assign(qi.prototype,{load:function(a,c,e,g){var k=this,r=new Oc(k.manager);r.setPath(k.path);r.load(a,function(u){c(k.parse(JSON.parse(u)))}, e,g)},parse:function(a){var c=new za,e=a.data.index;if(void 0!==e){var g=new Si[e.type](e.array);c.setIndex(new ma(g,1))}e=a.data.attributes;for(var k in e){var r=e[k];g=new Si[r.type](r.array);g=new ma(g,r.itemSize,r.normalized);void 0!==r.name&&(g.name=r.name);c.addAttribute(k,g)}var u=a.data.morphAttributes;if(u)for(k in u){var A=u[k],B=[];e=0;for(var C=A.length;e<C;e++)r=A[e],g=new Si[r.type](r.array),g=new ma(g,r.itemSize,r.normalized),void 0!==r.name&&(g.name=r.name),B.push(g);c.morphAttributes[k]= B}k=a.data.groups||a.data.drawcalls||a.data.offsets;if(void 0!==k)for(e=0,r=k.length;e!==r;++e)g=k[e],c.addGroup(g.start,g.count,g.materialIndex);e=a.data.boundingSphere;void 0!==e&&(k=new m,void 0!==e.center&&k.fromArray(e.center),c.boundingSphere=new y(k,e.radius));a.name&&(c.name=a.name);a.userData&&(c.userData=a.userData);return c},setPath:function(a){this.path=a;return this}});var Si={Int8Array,Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array, Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};Object.assign(ri.prototype,{crossOrigin:"anonymous",load:function(a,c,e,g){var k=this,r=void 0===this.path?Ri.extractUrlBase(a):this.path;this.resourcePath=this.resourcePath||r;r=new Oc(k.manager);r.setPath(this.path);r.load(a,function(u){var A=null;try{A=JSON.parse(u)}catch(B){void 0!==g&&g(B);console.error("THREE:ObjectLoader: Can't parse "+a+".",B.message);return}u=A.metadata;void 0===u||void 0===u.type||"geometry"===u.type.toLowerCase()? console.error("THREE.ObjectLoader: Can't load "+a):k.parse(A,c)},e,g)},setPath:function(a){this.path=a;return this},setResourcePath:function(a){this.resourcePath=a;return this},setCrossOrigin:function(a){this.crossOrigin=a;return this},parse:function(a,c){var e=this.parseShape(a.shapes);e=this.parseGeometries(a.geometries,e);var g=this.parseImages(a.images,function(){void 0!==c&&c(k)});g=this.parseTextures(a.textures,g);g=this.parseMaterials(a.materials,g);var k=this.parseObject(a.object,e,g);a.animations&& (k.animations=this.parseAnimations(a.animations));void 0!==a.images&&0!==a.images.length||void 0===c||c(k);return k},parseShape:function(a){var c={};if(void 0!==a)for(var e=0,g=a.length;e<g;e++){var k=(new Pd).fromJSON(a[e]);c[k.uuid]=k}return c},parseGeometries:function(a,c){var e={};if(void 0!==a)for(var g=new qi,k=0,r=a.length;k<r;k++){var u=a[k];switch(u.type){case "PlaneGeometry":case "PlaneBufferGeometry":var A=new qc[u.type](u.width,u.height,u.widthSegments,u.heightSegments);break;case "BoxGeometry":case "BoxBufferGeometry":case "CubeGeometry":A= new qc[u.type](u.width,u.height,u.depth,u.widthSegments,u.heightSegments,u.depthSegments);break;case "CircleGeometry":case "CircleBufferGeometry":A=new qc[u.type](u.radius,u.segments,u.thetaStart,u.thetaLength);break;case "CylinderGeometry":case "CylinderBufferGeometry":A=new qc[u.type](u.radiusTop,u.radiusBottom,u.height,u.radialSegments,u.heightSegments,u.openEnded,u.thetaStart,u.thetaLength);break;case "ConeGeometry":case "ConeBufferGeometry":A=new qc[u.type](u.radius,u.height,u.radialSegments, u.heightSegments,u.openEnded,u.thetaStart,u.thetaLength);break;case "SphereGeometry":case "SphereBufferGeometry":A=new qc[u.type](u.radius,u.widthSegments,u.heightSegments,u.phiStart,u.phiLength,u.thetaStart,u.thetaLength);break;case "DodecahedronGeometry":case "DodecahedronBufferGeometry":case "IcosahedronGeometry":case "IcosahedronBufferGeometry":case "OctahedronGeometry":case "OctahedronBufferGeometry":case "TetrahedronGeometry":case "TetrahedronBufferGeometry":A=new qc[u.type](u.radius,u.detail); break;case "RingGeometry":case "RingBufferGeometry":A=new qc[u.type](u.innerRadius,u.outerRadius,u.thetaSegments,u.phiSegments,u.thetaStart,u.thetaLength);break;case "TorusGeometry":case "TorusBufferGeometry":A=new qc[u.type](u.radius,u.tube,u.radialSegments,u.tubularSegments,u.arc);break;case "TorusKnotGeometry":case "TorusKnotBufferGeometry":A=new qc[u.type](u.radius,u.tube,u.tubularSegments,u.radialSegments,u.p,u.q);break;case "TubeGeometry":case "TubeBufferGeometry":A=new qc[u.type]((new Qi[u.path.type]).fromJSON(u.path), u.tubularSegments,u.radius,u.radialSegments,u.closed);break;case "LatheGeometry":case "LatheBufferGeometry":A=new qc[u.type](u.points,u.segments,u.phiStart,u.phiLength);break;case "PolyhedronGeometry":case "PolyhedronBufferGeometry":A=new qc[u.type](u.vertices,u.indices,u.radius,u.details);break;case "ShapeGeometry":case "ShapeBufferGeometry":A=[];for(var B=0,C=u.shapes.length;B<C;B++){var H=c[u.shapes[B]];A.push(H)}A=new qc[u.type](A,u.curveSegments);break;case "ExtrudeGeometry":case "ExtrudeBufferGeometry":A= [];B=0;for(C=u.shapes.length;B<C;B++)H=c[u.shapes[B]],A.push(H);B=u.options.extrudePath;void 0!==B&&(u.options.extrudePath=(new Qi[B.type]).fromJSON(B));A=new qc[u.type](A,u.options);break;case "BufferGeometry":A=g.parse(u);break;case "Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?A=(new THREE.LegacyJSONLoader).parse(u,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+ u.type+'"');continue}A.uuid=u.uuid;void 0!==u.name&&(A.name=u.name);!0===A.isBufferGeometry&&void 0!==u.userData&&(A.userData=u.userData);e[u.uuid]=A}return e},parseMaterials:function(a,c){var e={},g={};if(void 0!==a){var k=new sh;k.setTextures(c);c=0;for(var r=a.length;c<r;c++){var u=a[c];if("MultiMaterial"===u.type){for(var A=[],B=0;B<u.materials.length;B++){var C=u.materials[B];void 0===e[C.uuid]&&(e[C.uuid]=k.parse(C));A.push(e[C.uuid])}g[u.uuid]=A}else void 0===e[u.uuid]&&(e[u.uuid]=k.parse(u)), g[u.uuid]=e[u.uuid]}}return g},parseAnimations:function(a){for(var c=[],e=0;e<a.length;e++){var g=a[e],k=Hc.parse(g);void 0!==g.uuid&&(k.uuid=g.uuid);c.push(k)}return c},parseImages:function(a,c){function e(K){g.manager.itemStart(K);return r.load(K,function(){g.manager.itemEnd(K)},void 0,function(){g.manager.itemError(K);g.manager.itemEnd(K)})}var g=this,k={};if(void 0!==a&&0<a.length){c=new mi(c);var r=new sg(c);r.setCrossOrigin(this.crossOrigin);c=0;for(var u=a.length;c<u;c++){var A=a[c],B=A.url; if(Array.isArray(B)){k[A.uuid]=[];for(var C=0,H=B.length;C<H;C++){var I=B[C];I=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(I)?I:g.resourcePath+I;k[A.uuid].push(e(I))}}else I=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(A.url)?A.url:g.resourcePath+A.url,k[A.uuid]=e(I)}}return k},parseTextures:function(a,c){function e(B,C){if("number"===typeof B)return B;console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",B);return C[B]}var g={};if(void 0!==a)for(var k=0,r=a.length;k<r;k++){var u=a[k];void 0=== u.image&&console.warn('THREE.ObjectLoader: No "image" specified for',u.uuid);void 0===c[u.image]&&console.warn("THREE.ObjectLoader: Undefined image",u.image);var A=Array.isArray(c[u.image])?new sd(c[u.image]):new l(c[u.image]);A.needsUpdate=!0;A.uuid=u.uuid;void 0!==u.name&&(A.name=u.name);void 0!==u.mapping&&(A.mapping=e(u.mapping,cp));void 0!==u.offset&&A.offset.fromArray(u.offset);void 0!==u.repeat&&A.repeat.fromArray(u.repeat);void 0!==u.center&&A.center.fromArray(u.center);void 0!==u.rotation&& (A.rotation=u.rotation);void 0!==u.wrap&&(A.wrapS=e(u.wrap[0],Al),A.wrapT=e(u.wrap[1],Al));void 0!==u.format&&(A.format=u.format);void 0!==u.type&&(A.type=u.type);void 0!==u.encoding&&(A.encoding=u.encoding);void 0!==u.minFilter&&(A.minFilter=e(u.minFilter,Bl));void 0!==u.magFilter&&(A.magFilter=e(u.magFilter,Bl));void 0!==u.anisotropy&&(A.anisotropy=u.anisotropy);void 0!==u.flipY&&(A.flipY=u.flipY);void 0!==u.premultiplyAlpha&&(A.premultiplyAlpha=u.premultiplyAlpha);void 0!==u.unpackAlignment&&(A.unpackAlignment= u.unpackAlignment);g[u.uuid]=A}return g},parseObject:function(a,c,e){function g(C){void 0===c[C]&&console.warn("THREE.ObjectLoader: Undefined geometry",C);return c[C]}function k(C){if(void 0!==C){if(Array.isArray(C)){for(var H=[],I=0,K=C.length;I<K;I++){var P=C[I];void 0===e[P]&&console.warn("THREE.ObjectLoader: Undefined material",P);H.push(e[P])}return H}void 0===e[C]&&console.warn("THREE.ObjectLoader: Undefined material",C);return e[C]}}switch(a.type){case "Scene":var r=new $g;void 0!==a.background&& Number.isInteger(a.background)&&(r.background=new E(a.background));void 0!==a.fog&&("Fog"===a.fog.type?r.fog=new Zg(a.fog.color,a.fog.near,a.fog.far):"FogExp2"===a.fog.type&&(r.fog=new Yg(a.fog.color,a.fog.density)));break;case "PerspectiveCamera":r=new Lb(a.fov,a.aspect,a.near,a.far);void 0!==a.focus&&(r.focus=a.focus);void 0!==a.zoom&&(r.zoom=a.zoom);void 0!==a.filmGauge&&(r.filmGauge=a.filmGauge);void 0!==a.filmOffset&&(r.filmOffset=a.filmOffset);void 0!==a.view&&(r.view=Object.assign({},a.view)); break;case "OrthographicCamera":r=new vg(a.left,a.right,a.top,a.bottom,a.near,a.far);void 0!==a.zoom&&(r.zoom=a.zoom);void 0!==a.view&&(r.view=Object.assign({},a.view));break;case "AmbientLight":r=new qh(a.color,a.intensity);break;case "DirectionalLight":r=new ph(a.color,a.intensity);break;case "PointLight":r=new nh(a.color,a.intensity,a.distance,a.decay);break;case "RectAreaLight":r=new rh(a.color,a.intensity,a.width,a.height);break;case "SpotLight":r=new mh(a.color,a.intensity,a.distance,a.angle, a.penumbra,a.decay);break;case "HemisphereLight":r=new kh(a.color,a.groundColor,a.intensity);break;case "SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case "Mesh":r=g(a.geometry);var u=k(a.material);r=r.bones&&0<r.bones.length?new Uf(r,u):new cc(r,u);void 0!==a.drawMode&&r.setDrawMode(a.drawMode);break;case "LOD":r=new Tf;break;case "Line":r=new fc(g(a.geometry),k(a.material),a.mode);break;case "LineLoop":r=new bh(g(a.geometry),k(a.material));break; case "LineSegments":r=new Ab(g(a.geometry),k(a.material));break;case "PointCloud":case "Points":r=new Qe(g(a.geometry),k(a.material));break;case "Sprite":r=new Sf(k(a.material));break;case "Group":r=new Le;break;default:r=new T}r.uuid=a.uuid;void 0!==a.name&&(r.name=a.name);void 0!==a.matrix?(r.matrix.fromArray(a.matrix),void 0!==a.matrixAutoUpdate&&(r.matrixAutoUpdate=a.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==a.position&&r.position.fromArray(a.position), void 0!==a.rotation&&r.rotation.fromArray(a.rotation),void 0!==a.quaternion&&r.quaternion.fromArray(a.quaternion),void 0!==a.scale&&r.scale.fromArray(a.scale));void 0!==a.castShadow&&(r.castShadow=a.castShadow);void 0!==a.receiveShadow&&(r.receiveShadow=a.receiveShadow);a.shadow&&(void 0!==a.shadow.bias&&(r.shadow.bias=a.shadow.bias),void 0!==a.shadow.radius&&(r.shadow.radius=a.shadow.radius),void 0!==a.shadow.mapSize&&r.shadow.mapSize.fromArray(a.shadow.mapSize),void 0!==a.shadow.camera&&(r.shadow.camera= this.parseObject(a.shadow.camera)));void 0!==a.visible&&(r.visible=a.visible);void 0!==a.frustumCulled&&(r.frustumCulled=a.frustumCulled);void 0!==a.renderOrder&&(r.renderOrder=a.renderOrder);void 0!==a.userData&&(r.userData=a.userData);void 0!==a.layers&&(r.layers.mask=a.layers);if(void 0!==a.children){u=a.children;for(var A=0;A<u.length;A++)r.add(this.parseObject(u[A],c,e))}if("LOD"===a.type)for(a=a.levels,u=0;u<a.length;u++){A=a[u];var B=r.getObjectByProperty("uuid",A.object);void 0!==B&&r.addLevel(B, A.distance)}return r}});var cp={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},Al={RepeatWrapping:1E3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Bl={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008}; si.prototype={constructor:si,setOptions:function(a){this.options=a;return this},load:function(a,c,e,g){void 0===a&&(a="");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var k=this,r=se.get(a);if(void 0!==r)return k.manager.itemStart(a),setTimeout(function(){c&&c(r);k.manager.itemEnd(a)},0),r;fetch(a).then(function(u){return u.blob()}).then(function(u){return void 0===k.options?createImageBitmap(u):createImageBitmap(u,k.options)}).then(function(u){se.add(a,u);c&&c(u);k.manager.itemEnd(a)}).catch(function(u){g&& g(u);k.manager.itemError(a);k.manager.itemEnd(a)});k.manager.itemStart(a)},setCrossOrigin:function(){return this},setPath:function(a){this.path=a;return this}};Object.assign(ti.prototype,{moveTo:function(a,c){this.currentPath=new Tc;this.subPaths.push(this.currentPath);this.currentPath.moveTo(a,c)},lineTo:function(a,c){this.currentPath.lineTo(a,c)},quadraticCurveTo:function(a,c,e,g){this.currentPath.quadraticCurveTo(a,c,e,g)},bezierCurveTo:function(a,c,e,g,k,r){this.currentPath.bezierCurveTo(a,c, e,g,k,r)},splineThru:function(a){this.currentPath.splineThru(a)},toShapes:function(a,c){function e(V){for(var ca=[],ha=0,ba=V.length;ha<ba;ha++){var ka=V[ha],da=new Pd;da.curves=ka.curves;ca.push(da)}return ca}function g(V,ca){for(var ha=ca.length,ba=!1,ka=ha-1,da=0;da<ha;ka=da++){var ea=ca[ka],na=ca[da],la=na.x-ea.x,ua=na.y-ea.y;if(Math.abs(ua)>Number.EPSILON){if(0>ua&&(ea=ca[da],la=-la,na=ca[ka],ua=-ua),!(V.y<ea.y||V.y>na.y))if(V.y===ea.y){if(V.x===ea.x)return!0}else{ka=ua*(V.x-ea.x)-la*(V.y-ea.y); if(0===ka)return!0;0>ka||(ba=!ba)}}else if(V.y===ea.y&&(na.x<=V.x&&V.x<=ea.x||ea.x<=V.x&&V.x<=na.x))return!0}return ba}var k=vd.isClockWise,r=this.subPaths;if(0===r.length)return[];if(!0===c)return e(r);c=[];if(1===r.length){var u=r[0];var A=new Pd;A.curves=u.curves;c.push(A);return c}var B=!k(r[0].getPoints());B=a?!B:B;A=[];var C=[],H=[],I=0;C[I]=void 0;H[I]=[];for(var K=0,P=r.length;K<P;K++){u=r[K];var O=u.getPoints();var S=k(O);(S=a?!S:S)?(!B&&C[I]&&I++,C[I]={s:new Pd,p:O},C[I].s.curves=u.curves, B&&I++,H[I]=[]):H[I].push({h:u,p:O[0]})}if(!C[0])return e(r);if(1<C.length){K=!1;a=[];k=0;for(r=C.length;k<r;k++)A[k]=[];k=0;for(r=C.length;k<r;k++)for(u=H[k],S=0;S<u.length;S++){B=u[S];I=!0;for(O=0;O<C.length;O++)g(B.p,C[O].p)&&(k!==O&&a.push({froms:k,tos:O,hole:S}),I?(I=!1,A[O].push(B)):K=!0);I&&A[k].push(B)}0<a.length&&(K||(H=A))}K=0;for(k=C.length;K<k;K++)for(A=C[K].s,c.push(A),a=H[K],r=0,u=a.length;r<u;r++)A.holes.push(a[r].h);return c}});Object.assign(ui.prototype,{isFont:!0,generateShapes:function(a, c){void 0===c&&(c=100);var e=[],g=c;c=this.data;var k=Array.from?Array.from(a):String(a).split("");g/=c.resolution;var r=(c.boundingBox.yMax-c.boundingBox.yMin+c.underlineThickness)*g;a=[];for(var u=0,A=0,B=0;B<k.length;B++){var C=k[B];if("\n"===C)u=0,A-=r;else{var H=g;var I=u,K=A;if(C=c.glyphs[C]||c.glyphs["?"]){var P=new ti;if(C.o)for(var O=C._cachedOutline||(C._cachedOutline=C.o.split(" ")),S=0,V=O.length;S<V;)switch(O[S++]){case "m":var ca=O[S++]*H+I;var ha=O[S++]*H+K;P.moveTo(ca,ha);break;case "l":ca= O[S++]*H+I;ha=O[S++]*H+K;P.lineTo(ca,ha);break;case "q":var ba=O[S++]*H+I;var ka=O[S++]*H+K;var da=O[S++]*H+I;var ea=O[S++]*H+K;P.quadraticCurveTo(da,ea,ba,ka);break;case "b":ba=O[S++]*H+I,ka=O[S++]*H+K,da=O[S++]*H+I,ea=O[S++]*H+K,ca=O[S++]*H+I,ha=O[S++]*H+K,P.bezierCurveTo(da,ea,ca,ha,ba,ka)}H={offsetX:C.ha*H,path:P}}else H=void 0;u+=H.offsetX;a.push(H.path)}}c=0;for(k=a.length;c<k;c++)Array.prototype.push.apply(e,a[c].toShapes());return e}});Object.assign(ol.prototype,{load:function(a,c,e,g){var k= this,r=new Oc(this.manager);r.setPath(this.path);r.load(a,function(u){try{var A=JSON.parse(u)}catch(B){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),A=JSON.parse(u.substring(65,u.length-2))}u=k.parse(A);c&&c(u)},e,g)},parse:function(a){return new ui(a)},setPath:function(a){this.path=a;return this}});wg.Handlers={handlers:[],add:function(a,c){this.handlers.push(a,c)},get:function(a){for(var c=this.handlers,e=0,g=c.length;e<g;e+=2){var k=c[e+1]; if(c[e].test(a))return k}return null}};Object.assign(wg.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(a,c,e){for(var g=[],k=0;k<a.length;++k)g[k]=this.createMaterial(a[k],c,e);return g},createMaterial:function(){var a={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},c=new E,e=new jh,g=new sh;return function(k,r,u){function A(K,P,O,S,V){K=r+K;var ca= wg.Handlers.get(K);null!==ca?K=ca.load(K):(e.setCrossOrigin(u),K=e.load(K));void 0!==P&&(K.repeat.fromArray(P),1!==P[0]&&(K.wrapS=1E3),1!==P[1]&&(K.wrapT=1E3));void 0!==O&&K.offset.fromArray(O);void 0!==S&&("repeat"===S[0]&&(K.wrapS=1E3),"mirror"===S[0]&&(K.wrapS=1002),"repeat"===S[1]&&(K.wrapT=1E3),"mirror"===S[1]&&(K.wrapT=1002));void 0!==V&&(K.anisotropy=V);P=ab.generateUUID();B[P]=K;return P}var B={},C={uuid:ab.generateUUID(),type:"MeshLambertMaterial"},H;for(H in k){var I=k[H];switch(H){case "DbgColor":case "DbgIndex":case "opticalDensity":case "illumination":break; case "DbgName":C.name=I;break;case "blending":C.blending=a[I];break;case "colorAmbient":case "mapAmbient":console.warn("THREE.Loader.createMaterial:",H,"is no longer supported.");break;case "colorDiffuse":C.color=c.fromArray(I).getHex();break;case "colorSpecular":C.specular=c.fromArray(I).getHex();break;case "colorEmissive":C.emissive=c.fromArray(I).getHex();break;case "specularCoef":C.shininess=I;break;case "shading":"basic"===I.toLowerCase()&&(C.type="MeshBasicMaterial");"phong"===I.toLowerCase()&& (C.type="MeshPhongMaterial");"standard"===I.toLowerCase()&&(C.type="MeshStandardMaterial");break;case "mapDiffuse":C.map=A(I,k.mapDiffuseRepeat,k.mapDiffuseOffset,k.mapDiffuseWrap,k.mapDiffuseAnisotropy);break;case "mapDiffuseRepeat":case "mapDiffuseOffset":case "mapDiffuseWrap":case "mapDiffuseAnisotropy":break;case "mapEmissive":C.emissiveMap=A(I,k.mapEmissiveRepeat,k.mapEmissiveOffset,k.mapEmissiveWrap,k.mapEmissiveAnisotropy);break;case "mapEmissiveRepeat":case "mapEmissiveOffset":case "mapEmissiveWrap":case "mapEmissiveAnisotropy":break; case "mapLight":C.lightMap=A(I,k.mapLightRepeat,k.mapLightOffset,k.mapLightWrap,k.mapLightAnisotropy);break;case "mapLightRepeat":case "mapLightOffset":case "mapLightWrap":case "mapLightAnisotropy":break;case "mapAO":C.aoMap=A(I,k.mapAORepeat,k.mapAOOffset,k.mapAOWrap,k.mapAOAnisotropy);break;case "mapAORepeat":case "mapAOOffset":case "mapAOWrap":case "mapAOAnisotropy":break;case "mapBump":C.bumpMap=A(I,k.mapBumpRepeat,k.mapBumpOffset,k.mapBumpWrap,k.mapBumpAnisotropy);break;case "mapBumpScale":C.bumpScale= I;break;case "mapBumpRepeat":case "mapBumpOffset":case "mapBumpWrap":case "mapBumpAnisotropy":break;case "mapNormal":C.normalMap=A(I,k.mapNormalRepeat,k.mapNormalOffset,k.mapNormalWrap,k.mapNormalAnisotropy);break;case "mapNormalFactor":C.normalScale=I;break;case "mapNormalRepeat":case "mapNormalOffset":case "mapNormalWrap":case "mapNormalAnisotropy":break;case "mapSpecular":C.specularMap=A(I,k.mapSpecularRepeat,k.mapSpecularOffset,k.mapSpecularWrap,k.mapSpecularAnisotropy);break;case "mapSpecularRepeat":case "mapSpecularOffset":case "mapSpecularWrap":case "mapSpecularAnisotropy":break; case "mapMetalness":C.metalnessMap=A(I,k.mapMetalnessRepeat,k.mapMetalnessOffset,k.mapMetalnessWrap,k.mapMetalnessAnisotropy);break;case "mapMetalnessRepeat":case "mapMetalnessOffset":case "mapMetalnessWrap":case "mapMetalnessAnisotropy":break;case "mapRoughness":C.roughnessMap=A(I,k.mapRoughnessRepeat,k.mapRoughnessOffset,k.mapRoughnessWrap,k.mapRoughnessAnisotropy);break;case "mapRoughnessRepeat":case "mapRoughnessOffset":case "mapRoughnessWrap":case "mapRoughnessAnisotropy":break;case "mapAlpha":C.alphaMap= A(I,k.mapAlphaRepeat,k.mapAlphaOffset,k.mapAlphaWrap,k.mapAlphaAnisotropy);break;case "mapAlphaRepeat":case "mapAlphaOffset":case "mapAlphaWrap":case "mapAlphaAnisotropy":break;case "flipSided":C.side=1;break;case "doubleSided":C.side=2;break;case "transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity");C.opacity=I;break;case "depthTest":case "depthWrite":case "colorWrite":case "opacity":case "reflectivity":case "transparent":case "visible":case "wireframe":C[H]= I;break;case "vertexColors":!0===I&&(C.vertexColors=2);"face"===I&&(C.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",H,I)}}"MeshBasicMaterial"===C.type&&delete C.emissive;"MeshPhongMaterial"!==C.type&&delete C.specular;1>C.opacity&&(C.transparent=!0);g.setTextures(B);return g.parse(C)}}()});var zh,Ai={getContext:function(){void 0===zh&&(zh=new (window.AudioContext||window.webkitAudioContext));return zh},setContext:function(a){zh=a}};Object.assign(vi.prototype, {load:function(a,c,e,g){var k=new Oc(this.manager);k.setResponseType("arraybuffer");k.setPath(this.path);k.load(a,function(r){r=r.slice(0);Ai.getContext().decodeAudioData(r,function(u){c(u)})},e,g)},setPath:function(a){this.path=a;return this}});Object.assign(th.prototype,{isSphericalHarmonics3:!0,set:function(a){for(var c=0;9>c;c++)this.coefficients[c].copy(a[c]);return this},zero:function(){for(var a=0;9>a;a++)this.coefficients[a].set(0,0,0);return this},getAt:function(a,c){var e=a.x,g=a.y;a=a.z; var k=this.coefficients;c=.282095*k[0];c+=.488603*k[1]*g;c+=.488603*k[2]*a;c+=.488603*k[3]*e;c+=1.092548*k[4]*e*g;c+=1.092548*k[5]*g*a;c+=.315392*k[6]*(3*a*a-1);c+=1.092548*k[7]*e*a;return c+=.546274*k[8]*(e*e-g*g)},getIrradianceAt:function(a,c){var e=a.x,g=a.y;a=a.z;var k=this.coefficients;c=.886227*k[0];c+=1.023328*k[1]*g;c+=1.023328*k[2]*a;c+=1.023328*k[3]*e;c+=.858086*k[4]*e*g;c+=.858086*k[5]*g*a;c+=k[6]*(.743125*a*a-.247708);c+=.858086*k[7]*e*a;return c+=.429043*k[8]*(e*e-g*g)},add:function(a){for(var c= 0;9>c;c++)this.coefficients[c].add(a.coefficients[c]);return this},scale:function(a){for(var c=0;9>c;c++)this.coefficients[c].multiplyScalar(a);return this},lerp:function(a,c){for(var e=0;9>e;e++)this.coefficients[e].lerp(a.coefficients[e],c);return this},equals:function(a){for(var c=0;9>c;c++)if(!this.coefficients[c].equals(a.coefficients[c]))return!1;return!0},copy:function(a){return this.set(a.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(a){for(var c= this.coefficients,e=0;9>e;e++)c[e].fromArray(a,3*e);return this},toArray:function(){for(var a=[],c=this.coefficients,e=0;9>e;e++)c[e].toArray(a,3*e);return a}});Object.assign(th,{getBasisAt:function(a,c){var e=a.x,g=a.y;a=a.z;c[0]=.282095;c[1]=.488603*g;c[2]=.488603*a;c[3]=.488603*e;c[4]=1.092548*e*g;c[5]=1.092548*g*a;c[6]=.315392*(3*a*a-1);c[7]=1.092548*e*a;c[8]=.546274*(e*e-g*g)}});Uc.prototype=Object.assign(Object.create(Bb.prototype),{constructor:Uc,isLightProbe:!0,copy:function(a){Bb.prototype.copy.call(this, a);this.sh.copy(a.sh);this.intensity=a.intensity;return this},toJSON:function(a){return Bb.prototype.toJSON.call(this,a)}});wi.prototype=Object.assign(Object.create(Uc.prototype),{constructor:wi,isHemisphereLightProbe:!0,copy:function(a){Uc.prototype.copy.call(this,a);return this},toJSON:function(a){return Uc.prototype.toJSON.call(this,a)}});xi.prototype=Object.assign(Object.create(Uc.prototype),{constructor:xi,isAmbientLightProbe:!0,copy:function(a){Uc.prototype.copy.call(this,a);return this},toJSON:function(a){return Uc.prototype.toJSON.call(this, a)}});Object.assign(pl.prototype,{update:function(){var a,c,e,g,k,r,u,A,B=new G,C=new G;return function(H){if(a!==this||c!==H.focus||e!==H.fov||g!==H.aspect*this.aspect||k!==H.near||r!==H.far||u!==H.zoom||A!==this.eyeSep){a=this;c=H.focus;e=H.fov;g=H.aspect*this.aspect;k=H.near;r=H.far;u=H.zoom;var I=H.projectionMatrix.clone();A=this.eyeSep/2;var K=A*k/c,P=k*Math.tan(ab.DEG2RAD*e*.5)/u;C.elements[12]=-A;B.elements[12]=A;var O=-P*g+K;var S=P*g+K;I.elements[0]=2*k/(S-O);I.elements[8]=(S+O)/(S-O);this.cameraL.projectionMatrix.copy(I); O=-P*g-K;S=P*g-K;I.elements[0]=2*k/(S-O);I.elements[8]=(S+O)/(S-O);this.cameraR.projectionMatrix.copy(I)}this.cameraL.matrixWorld.copy(H.matrixWorld).multiply(C);this.cameraR.matrixWorld.copy(H.matrixWorld).multiply(B)}}()});xg.prototype=Object.create(T.prototype);xg.prototype.constructor=xg;Object.assign(yi.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0},stop:function(){this.getElapsedTime();this.autoStart= this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var c=("undefined"===typeof performance?Date:performance).now();a=(c-this.oldTime)/1E3;this.oldTime=c;this.elapsedTime+=a}return a}});zi.prototype=Object.assign(Object.create(T.prototype),{constructor:zi,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null);return this},getFilter:function(){return this.filter},setFilter:function(a){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination);this.filter=a;this.gain.connect(this.filter);this.filter.connect(this.context.destination);return this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a, this.context.currentTime,.01);return this},updateMatrixWorld:function(){var a=new m,c=new h,e=new m,g=new m,k=new yi;return function(r){T.prototype.updateMatrixWorld.call(this,r);r=this.context.listener;var u=this.up;this.timeDelta=k.getDelta();this.matrixWorld.decompose(a,c,e);g.set(0,0,-1).applyQuaternion(c);if(r.positionX){var A=this.context.currentTime+this.timeDelta;r.positionX.linearRampToValueAtTime(a.x,A);r.positionY.linearRampToValueAtTime(a.y,A);r.positionZ.linearRampToValueAtTime(a.z,A); r.forwardX.linearRampToValueAtTime(g.x,A);r.forwardY.linearRampToValueAtTime(g.y,A);r.forwardZ.linearRampToValueAtTime(g.z,A);r.upX.linearRampToValueAtTime(u.x,A);r.upY.linearRampToValueAtTime(u.y,A);r.upZ.linearRampToValueAtTime(u.z,A)}else r.setPosition(a.x,a.y,a.z),r.setOrientation(g.x,g.y,g.z,u.x,u.y,u.z)}}()});hf.prototype=Object.assign(Object.create(T.prototype),{constructor:hf,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl=!1;this.sourceType="audioNode"; this.source=a;this.connect();return this},setMediaElementSource:function(a){this.hasPlaybackControl=!1;this.sourceType="mediaNode";this.source=this.context.createMediaElementSource(a);this.connect();return this},setBuffer:function(a){this.buffer=a;this.sourceType="buffer";this.autoplay&&this.play();return this},play:function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control."); else{var a=this.context.createBufferSource();a.buffer=this.buffer;a.loop=this.loop;a.onended=this.onEnded.bind(this);this.startTime=this.context.currentTime;a.start(this.startTime,this.offset);this.isPlaying=!0;this.source=a;this.setDetune(this.detune);this.setPlaybackRate(this.playbackRate);return this.connect()}},pause:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return!0===this.isPlaying&&(this.source.stop(),this.source.onended= null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this},stop:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var a=1,c=this.filters.length;a<c;a++)this.filters[a-1].connect(this.filters[a]);this.filters[this.filters.length- 1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var a=1,c=this.filters.length;a<c;a++)this.filters[a-1].disconnect(this.filters[a]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(a){a||(a=[]);!0===this.isPlaying?(this.disconnect(),this.filters= a,this.connect()):this.filters=a;return this},setDetune:function(a){this.detune=a;if(void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(a){return this.setFilters(a?[a]:[])},setPlaybackRate:function(a){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.playbackRate= a,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(a){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.loop=a,!0===this.isPlaying&& (this.source.loop=this.loop),this},getVolume:function(){return this.gain.gain.value},setVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this}});Bi.prototype=Object.assign(Object.create(hf.prototype),{constructor:Bi,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(a){this.panner.refDistance=a;return this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(a){this.panner.rolloffFactor= a;return this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(a){this.panner.distanceModel=a;return this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(a){this.panner.maxDistance=a;return this},setDirectionalCone:function(a,c,e){this.panner.coneInnerAngle=a;this.panner.coneOuterAngle=c;this.panner.coneOuterGain=e;return this},updateMatrixWorld:function(){var a=new m,c=new h,e=new m,g=new m;return function(k){T.prototype.updateMatrixWorld.call(this, k);if(!0!==this.hasPlaybackControl||!1!==this.isPlaying)if(this.matrixWorld.decompose(a,c,e),g.set(0,0,1).applyQuaternion(c),k=this.panner,k.positionX){var r=this.context.currentTime+this.listener.timeDelta;k.positionX.linearRampToValueAtTime(a.x,r);k.positionY.linearRampToValueAtTime(a.y,r);k.positionZ.linearRampToValueAtTime(a.z,r);k.orientationX.linearRampToValueAtTime(g.x,r);k.orientationY.linearRampToValueAtTime(g.y,r);k.orientationZ.linearRampToValueAtTime(g.z,r)}else k.setPosition(a.x,a.y, a.z),k.setOrientation(g.x,g.y,g.z)}}()});Object.assign(Ci.prototype,{getFrequencyData:function(){this.analyser.getByteFrequencyData(this.data);return this.data},getAverageFrequency:function(){for(var a=0,c=this.getFrequencyData(),e=0;e<c.length;e++)a+=c[e];return a/c.length}});Object.assign(Di.prototype,{accumulate:function(a,c){var e=this.buffer,g=this.valueSize;a=a*g+g;var k=this.cumulativeWeight;if(0===k){for(k=0;k!==g;++k)e[a+k]=e[k];k=c}else k+=c,this._mixBufferRegion(e,a,0,c/k,g);this.cumulativeWeight= k},apply:function(a){var c=this.valueSize,e=this.buffer;a=a*c+c;var g=this.cumulativeWeight,k=this.binding;this.cumulativeWeight=0;1>g&&this._mixBufferRegion(e,a,3*c,1-g,c);g=c;for(var r=c+c;g!==r;++g)if(e[g]!==e[g+c]){k.setValue(e,a);break}},saveOriginalState:function(){var a=this.buffer,c=this.valueSize,e=3*c;this.binding.getValue(a,e);for(var g=c;g!==e;++g)a[g]=a[e+g%c];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a, c,e,g,k){if(.5<=g)for(g=0;g!==k;++g)a[c+g]=a[e+g]},_slerp:function(a,c,e,g){h.slerpFlat(a,c,a,c,a,e,g)},_lerp:function(a,c,e,g,k){for(var r=1-g,u=0;u!==k;++u){var A=c+u;a[A]=a[A]*r+a[e+u]*g}}});Object.assign(ql.prototype,{getValue:function(a,c){this.bind();var e=this._bindings[this._targetGroup.nCachedObjects_];void 0!==e&&e.getValue(a,c)},setValue:function(a,c){for(var e=this._bindings,g=this._targetGroup.nCachedObjects_,k=e.length;g!==k;++g)e[g].setValue(a,c)},bind:function(){for(var a=this._bindings, c=this._targetGroup.nCachedObjects_,e=a.length;c!==e;++c)a[c].bind()},unbind:function(){for(var a=this._bindings,c=this._targetGroup.nCachedObjects_,e=a.length;c!==e;++c)a[c].unbind()}});Object.assign(mc,{Composite:ql,create:function(a,c,e){return a&&a.isAnimationObjectGroup?new mc.Composite(a,c,e):new mc(a,c,e)},sanitizeNodeName:function(){var a=/[\[\]\.:\/]/g;return function(c){return c.replace(/\s/g,"_").replace(a,"")}}(),parseTrackName:function(){var a="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]", c=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]");a=/(WCOD+)?/.source.replace("WCOD",a);var e=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),g=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),k=new RegExp("^"+c+a+e+g+"$"),r=["material","materials","bones"];return function(u){var A=k.exec(u);if(!A)throw Error("PropertyBinding: Cannot parse trackName: "+u);A={nodeName:A[2],objectName:A[3],objectIndex:A[4],propertyName:A[5],propertyIndex:A[6]};var B=A.nodeName&& A.nodeName.lastIndexOf(".");if(void 0!==B&&-1!==B){var C=A.nodeName.substring(B+1);-1!==r.indexOf(C)&&(A.nodeName=A.nodeName.substring(0,B),A.objectName=C)}if(null===A.propertyName||0===A.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+u);return A}}(),findNode:function(a,c){if(!c||""===c||"root"===c||"."===c||-1===c||c===a.name||c===a.uuid)return a;if(a.skeleton){var e=a.skeleton.getBoneByName(c);if(void 0!==e)return e}if(a.children){var g=function(k){for(var r= 0;r<k.length;r++){var u=k[r];if(u.name===c||u.uuid===c)return u;if(u=g(u.children))return u}return null};if(a=g(a.children))return a}return null}});Object.assign(mc.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(a,c){a[c]=this.node[this.propertyName]},function(a,c){for(var e=this.resolvedProperty,g=0,k=e.length;g!== k;++g)a[c++]=e[g]},function(a,c){a[c]=this.resolvedProperty[this.propertyIndex]},function(a,c){this.resolvedProperty.toArray(a,c)}],SetterByBindingTypeAndVersioning:[[function(a,c){this.targetObject[this.propertyName]=a[c]},function(a,c){this.targetObject[this.propertyName]=a[c];this.targetObject.needsUpdate=!0},function(a,c){this.targetObject[this.propertyName]=a[c];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,c){for(var e=this.resolvedProperty,g=0,k=e.length;g!==k;++g)e[g]=a[c++]}, function(a,c){for(var e=this.resolvedProperty,g=0,k=e.length;g!==k;++g)e[g]=a[c++];this.targetObject.needsUpdate=!0},function(a,c){for(var e=this.resolvedProperty,g=0,k=e.length;g!==k;++g)e[g]=a[c++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,c){this.resolvedProperty[this.propertyIndex]=a[c]},function(a,c){this.resolvedProperty[this.propertyIndex]=a[c];this.targetObject.needsUpdate=!0},function(a,c){this.resolvedProperty[this.propertyIndex]=a[c];this.targetObject.matrixWorldNeedsUpdate= !0}],[function(a,c){this.resolvedProperty.fromArray(a,c)},function(a,c){this.resolvedProperty.fromArray(a,c);this.targetObject.needsUpdate=!0},function(a,c){this.resolvedProperty.fromArray(a,c);this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(a,c){this.bind();this.getValue(a,c)},setValue:function(a,c){this.bind();this.setValue(a,c)},bind:function(){var a=this.node,c=this.parsedPath,e=c.objectName,g=c.propertyName,k=c.propertyIndex;a||(this.node=a=mc.findNode(this.rootNode,c.nodeName)|| this.rootNode);this.getValue=this._getValue_unavailable;this.setValue=this._setValue_unavailable;if(a){if(e){var r=c.objectIndex;switch(e){case "materials":if(!a.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!a.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}a=a.material.materials;break;case "bones":if(!a.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.", this);return}a=a.skeleton.bones;for(e=0;e<a.length;e++)if(a[e].name===r){r=e;break}break;default:if(void 0===a[e]){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}a=a[e]}if(void 0!==r){if(void 0===a[r]){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,a);return}a=a[r]}}r=a[g];if(void 0===r)console.error("THREE.PropertyBinding: Trying to update property for track: "+c.nodeName+"."+g+" but it wasn't found.", a);else{c=this.Versioning.None;this.targetObject=a;void 0!==a.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==a.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);e=this.BindingType.Direct;if(void 0!==k){if("morphTargetInfluences"===g){if(!a.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(a.geometry.isBufferGeometry){if(!a.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.", this);return}for(e=0;e<this.node.geometry.morphAttributes.position.length;e++)if(a.geometry.morphAttributes.position[e].name===k){k=e;break}}else{if(!a.geometry.morphTargets){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);return}for(e=0;e<this.node.geometry.morphTargets.length;e++)if(a.geometry.morphTargets[e].name===k){k=e;break}}}e=this.BindingType.ArrayElement;this.resolvedProperty=r;this.propertyIndex=k}else void 0!== r.fromArray&&void 0!==r.toArray?(e=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(e=this.BindingType.EntireArray,this.resolvedProperty=r):this.propertyName=g;this.getValue=this.GetterByBindingType[e];this.setValue=this.SetterByBindingTypeAndVersioning[e][c]}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null;this.getValue=this._getValue_unbound;this.setValue=this._setValue_unbound}}); Object.assign(mc.prototype,{_getValue_unbound:mc.prototype.getValue,_setValue_unbound:mc.prototype.setValue});Object.assign(rl.prototype,{isAnimationObjectGroup:!0,add:function(){for(var a=this._objects,c=a.length,e=this.nCachedObjects_,g=this._indicesByUUID,k=this._paths,r=this._parsedPaths,u=this._bindings,A=u.length,B=void 0,C=0,H=arguments.length;C!==H;++C){var I=arguments[C],K=I.uuid,P=g[K];if(void 0===P){P=c++;g[K]=P;a.push(I);K=0;for(var O=A;K!==O;++K)u[K].push(new mc(I,k[K],r[K]))}else if(P< e){B=a[P];var S=--e;O=a[S];g[O.uuid]=P;a[P]=O;g[K]=S;a[S]=I;K=0;for(O=A;K!==O;++K){var V=u[K],ca=V[P];V[P]=V[S];void 0===ca&&(ca=new mc(I,k[K],r[K]));V[S]=ca}}else a[P]!==B&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=e},remove:function(){for(var a=this._objects,c=this.nCachedObjects_,e=this._indicesByUUID,g=this._bindings,k=g.length,r=0,u=arguments.length;r!== u;++r){var A=arguments[r],B=A.uuid,C=e[B];if(void 0!==C&&C>=c){var H=c++,I=a[H];e[I.uuid]=C;a[C]=I;e[B]=H;a[H]=A;A=0;for(B=k;A!==B;++A){I=g[A];var K=I[C];I[C]=I[H];I[H]=K}}}this.nCachedObjects_=c},uncache:function(){for(var a=this._objects,c=a.length,e=this.nCachedObjects_,g=this._indicesByUUID,k=this._bindings,r=k.length,u=0,A=arguments.length;u!==A;++u){var B=arguments[u].uuid,C=g[B];if(void 0!==C)if(delete g[B],C<e){B=--e;var H=a[B],I=--c,K=a[I];g[H.uuid]=C;a[C]=H;g[K.uuid]=B;a[B]=K;a.pop();H= 0;for(K=r;H!==K;++H){var P=k[H],O=P[I];P[C]=P[B];P[B]=O;P.pop()}}else for(I=--c,K=a[I],g[K.uuid]=C,a[C]=K,a.pop(),H=0,K=r;H!==K;++H)P=k[H],P[C]=P[I],P.pop()}this.nCachedObjects_=e},subscribe_:function(a,c){var e=this._bindingsIndicesByPath,g=e[a],k=this._bindings;if(void 0!==g)return k[g];var r=this._paths,u=this._parsedPaths,A=this._objects,B=this.nCachedObjects_,C=Array(A.length);g=k.length;e[a]=g;r.push(a);u.push(c);k.push(C);e=B;for(g=A.length;e!==g;++e)C[e]=new mc(A[e],a,c);return C},unsubscribe_:function(a){var c= this._bindingsIndicesByPath,e=c[a];if(void 0!==e){var g=this._paths,k=this._parsedPaths,r=this._bindings,u=r.length-1,A=r[u];c[a[u]]=e;r[e]=A;r.pop();k[e]=k[u];k.pop();g[e]=g[u];g.pop()}}});Object.assign(sl.prototype,{play:function(){this._mixer._activateAction(this);return this},stop:function(){this._mixer._deactivateAction(this);return this.reset()},reset:function(){this.paused=!1;this.enabled=!0;this.time=0;this._loopCount=-1;this._startTime=null;return this.stopFading().stopWarping()},isRunning:function(){return this.enabled&& !this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(a){this._startTime=a;return this},setLoop:function(a,c){this.loop=a;this.repetitions=c;return this},setEffectiveWeight:function(a){this.weight=a;this._effectiveWeight=this.enabled?a:0;return this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(a){return this._scheduleFading(a,0,1)},fadeOut:function(a){return this._scheduleFading(a, 1,0)},crossFadeFrom:function(a,c,e){a.fadeOut(c);this.fadeIn(c);if(e){e=this._clip.duration;var g=a._clip.duration,k=e/g;a.warp(1,g/e,c);this.warp(k,1,c)}return this},crossFadeTo:function(a,c,e){return a.crossFadeFrom(this,c,e)},stopFading:function(){var a=this._weightInterpolant;null!==a&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},setEffectiveTimeScale:function(a){this.timeScale=a;this._effectiveTimeScale=this.paused?0:a;return this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale}, setDuration:function(a){this.timeScale=this._clip.duration/a;return this.stopWarping()},syncWith:function(a){this.time=a.time;this.timeScale=a.timeScale;return this.stopWarping()},halt:function(a){return this.warp(this._effectiveTimeScale,0,a)},warp:function(a,c,e){var g=this._mixer,k=g.time,r=this._timeScaleInterpolant,u=this.timeScale;null===r&&(this._timeScaleInterpolant=r=g._lendControlInterpolant());g=r.parameterPositions;r=r.sampleValues;g[0]=k;g[1]=k+e;r[0]=a/u;r[1]=c/u;return this},stopWarping:function(){var a= this._timeScaleInterpolant;null!==a&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(a,c,e,g){if(this.enabled){var k=this._startTime;if(null!==k){c=(a-k)*e;if(0>c||0===e)return;this._startTime=null;c*=e}c*=this._updateTimeScale(a);e=this._updateTime(c);a=this._updateWeight(a);if(0<a){c=this._interpolants; k=this._propertyBindings;for(var r=0,u=c.length;r!==u;++r)c[r].evaluate(e),k[r].accumulate(g,a)}}else this._updateWeight(a)},_updateWeight:function(a){var c=0;if(this.enabled){c=this.weight;var e=this._weightInterpolant;if(null!==e){var g=e.evaluate(a)[0];c*=g;a>e.parameterPositions[1]&&(this.stopFading(),0===g&&(this.enabled=!1))}}return this._effectiveWeight=c},_updateTimeScale:function(a){var c=0;if(!this.paused){c=this.timeScale;var e=this._timeScaleInterpolant;if(null!==e){var g=e.evaluate(a)[0]; c*=g;a>e.parameterPositions[1]&&(this.stopWarping(),0===c?this.paused=!0:this.timeScale=c)}}return this._effectiveTimeScale=c},_updateTime:function(a){var c=this.time+a,e=this._clip.duration,g=this.loop,k=this._loopCount,r=2202===g;if(0===a)return-1===k?c:r&&1===(k&1)?e-c:c;if(2200===g)a:{if(-1===k&&(this._loopCount=0,this._setEndings(!0,!0,!1)),c>=e)c=e;else if(0>c)c=0;else break a;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:"finished",action:this,direction:0> a?-1:1})}else{-1===k&&(0<=a?(k=0,this._setEndings(!0,0===this.repetitions,r)):this._setEndings(0===this.repetitions,!0,r));if(c>=e||0>c){g=Math.floor(c/e);c-=e*g;k+=Math.abs(g);var u=this.repetitions-k;0>=u?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,c=0<a?e:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<a?1:-1})):(1===u?(a=0>a,this._setEndings(a,!a,r)):this._setEndings(!1,!1,r),this._loopCount=k,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:g}))}if(r&& 1===(k&1))return this.time=c,e-c}return this.time=c},_setEndings:function(a,c,e){var g=this._interpolantSettings;e?(g.endingStart=2401,g.endingEnd=2401):(g.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,g.endingEnd=c?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,c,e){var g=this._mixer,k=g.time,r=this._weightInterpolant;null===r&&(this._weightInterpolant=r=g._lendControlInterpolant());g=r.parameterPositions;r=r.sampleValues;g[0]=k;r[0]=c;g[1]=k+a;r[1]=e;return this}});Ei.prototype= Object.assign(Object.create(d.prototype),{constructor:Ei,_bindAction:function(a,c){var e=a._localRoot||this._root,g=a._clip.tracks,k=g.length,r=a._propertyBindings;a=a._interpolants;var u=e.uuid,A=this._bindingsByRootAndName,B=A[u];void 0===B&&(B={},A[u]=B);for(A=0;A!==k;++A){var C=g[A],H=C.name,I=B[H];if(void 0===I){I=r[A];if(void 0!==I){null===I._cacheIndex&&(++I.referenceCount,this._addInactiveBinding(I,u,H));continue}I=new Di(mc.create(e,H,c&&c._propertyBindings[A].binding.parsedPath),C.ValueTypeName, C.getValueSize());++I.referenceCount;this._addInactiveBinding(I,u,H)}r[A]=I;a[A].resultBuffer=I.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var c=(a._localRoot||this._root).uuid,e=a._clip.uuid,g=this._actionsByClip[e];this._bindAction(a,g&&g.knownActions[0]);this._addInactiveAction(a,e,c)}c=a._propertyBindings;e=0;for(g=c.length;e!==g;++e){var k=c[e];0===k.useCount++&&(this._lendBinding(k),k.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var c= a._propertyBindings,e=0,g=c.length;e!==g;++e){var k=c[e];0===--k.useCount&&(k.restoreOriginalState(),this._takeBackBinding(k))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length}, get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&a<this._nActiveActions},_addInactiveAction:function(a,c,e){var g=this._actions,k=this._actionsByClip,r=k[c];void 0===r?(r={knownActions:[a],actionByRoot:{}},a._byClipCacheIndex=0,k[c]=r):(c=r.knownActions,a._byClipCacheIndex=c.length,c.push(a));a._cacheIndex=g.length;g.push(a); r.actionByRoot[e]=a},_removeInactiveAction:function(a){var c=this._actions,e=c[c.length-1],g=a._cacheIndex;e._cacheIndex=g;c[g]=e;c.pop();a._cacheIndex=null;c=a._clip.uuid;e=this._actionsByClip;g=e[c];var k=g.knownActions,r=k[k.length-1],u=a._byClipCacheIndex;r._byClipCacheIndex=u;k[u]=r;k.pop();a._byClipCacheIndex=null;delete g.actionByRoot[(a._localRoot||this._root).uuid];0===k.length&&delete e[c];this._removeInactiveBindingsForAction(a)},_removeInactiveBindingsForAction:function(a){a=a._propertyBindings; for(var c=0,e=a.length;c!==e;++c){var g=a[c];0===--g.referenceCount&&this._removeInactiveBinding(g)}},_lendAction:function(a){var c=this._actions,e=a._cacheIndex,g=this._nActiveActions++,k=c[g];a._cacheIndex=g;c[g]=a;k._cacheIndex=e;c[e]=k},_takeBackAction:function(a){var c=this._actions,e=a._cacheIndex,g=--this._nActiveActions,k=c[g];a._cacheIndex=g;c[g]=a;k._cacheIndex=e;c[e]=k},_addInactiveBinding:function(a,c,e){var g=this._bindingsByRootAndName,k=g[c],r=this._bindings;void 0===k&&(k={},g[c]= k);k[e]=a;a._cacheIndex=r.length;r.push(a)},_removeInactiveBinding:function(a){var c=this._bindings,e=a.binding,g=e.rootNode.uuid;e=e.path;var k=this._bindingsByRootAndName,r=k[g],u=c[c.length-1];a=a._cacheIndex;u._cacheIndex=a;c[a]=u;c.pop();delete r[e];a:{for(var A in r)break a;delete k[g]}},_lendBinding:function(a){var c=this._bindings,e=a._cacheIndex,g=this._nActiveBindings++,k=c[g];a._cacheIndex=g;c[g]=a;k._cacheIndex=e;c[e]=k},_takeBackBinding:function(a){var c=this._bindings,e=a._cacheIndex, g=--this._nActiveBindings,k=c[g];a._cacheIndex=g;c[g]=a;k._cacheIndex=e;c[e]=k},_lendControlInterpolant:function(){var a=this._controlInterpolants,c=this._nActiveControlInterpolants++,e=a[c];void 0===e&&(e=new qg(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),e.__cacheIndex=c,a[c]=e);return e},_takeBackControlInterpolant:function(a){var c=this._controlInterpolants,e=a.__cacheIndex,g=--this._nActiveControlInterpolants,k=c[g];a.__cacheIndex=g;c[g]=a;k.__cacheIndex= e;c[e]=k},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(a,c){var e=c||this._root,g=e.uuid;e="string"===typeof a?Hc.findByName(e,a):a;a=null!==e?e.uuid:a;var k=this._actionsByClip[a],r=null;if(void 0!==k){r=k.actionByRoot[g];if(void 0!==r)return r;r=k.knownActions[0];null===e&&(e=r._clip)}if(null===e)return null;c=new sl(this,e,c);this._bindAction(c,r);this._addInactiveAction(c,a,g);return c},existingAction:function(a,c){var e=c||this._root;c=e.uuid;e="string"===typeof a? Hc.findByName(e,a):a;a=this._actionsByClip[e?e.uuid:a];return void 0!==a?a.actionByRoot[c]||null:null},stopAllAction:function(){for(var a=this._actions,c=this._nActiveActions,e=this._bindings,g=this._nActiveBindings,k=this._nActiveBindings=this._nActiveActions=0;k!==c;++k)a[k].reset();for(k=0;k!==g;++k)e[k].useCount=0;return this},update:function(a){a*=this.timeScale;for(var c=this._actions,e=this._nActiveActions,g=this.time+=a,k=Math.sign(a),r=this._accuIndex^=1,u=0;u!==e;++u)c[u]._update(g,a,k, r);a=this._bindings;c=this._nActiveBindings;for(u=0;u!==c;++u)a[u].apply(r);return this},getRoot:function(){return this._root},uncacheClip:function(a){var c=this._actions;a=a.uuid;var e=this._actionsByClip,g=e[a];if(void 0!==g){g=g.knownActions;for(var k=0,r=g.length;k!==r;++k){var u=g[k];this._deactivateAction(u);var A=u._cacheIndex,B=c[c.length-1];u._cacheIndex=null;u._byClipCacheIndex=null;B._cacheIndex=A;c[A]=B;c.pop();this._removeInactiveBindingsForAction(u)}delete e[a]}},uncacheRoot:function(a){a= a.uuid;var c=this._actionsByClip;for(g in c){var e=c[g].actionByRoot[a];void 0!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}var g=this._bindingsByRootAndName[a];if(void 0!==g)for(var k in g)a=g[k],a.restoreOriginalState(),this._removeInactiveBinding(a)},uncacheAction:function(a,c){a=this.existingAction(a,c);null!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}});uh.prototype.clone=function(){return new uh(void 0===this.value.clone?this.value:this.value.clone())};Fi.prototype= Object.assign(Object.create(za.prototype),{constructor:Fi,isInstancedBufferGeometry:!0,copy:function(a){za.prototype.copy.call(this,a);this.maxInstancedCount=a.maxInstancedCount;return this},clone:function(){return(new this.constructor).copy(this)}});Gi.prototype=Object.assign(Object.create(ce.prototype),{constructor:Gi,isInstancedInterleavedBuffer:!0,copy:function(a){ce.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;return this}});Hi.prototype=Object.assign(Object.create(ma.prototype), {constructor:Hi,isInstancedBufferAttribute:!0,copy:function(a){ma.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;return this}});Object.assign(tl.prototype,{linePrecision:1,set:function(a,c){this.ray.set(a,c)},setFromCamera:function(a,c){c&&c.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(c.matrixWorld),this.ray.direction.set(a.x,a.y,.5).unproject(c).sub(this.ray.origin).normalize()):c&&c.isOrthographicCamera?(this.ray.origin.set(a.x,a.y,(c.near+c.far)/(c.near-c.far)).unproject(c), this.ray.direction.set(0,0,-1).transformDirection(c.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(a,c,e){e=e||[];Ii(a,this,e,c);e.sort(ul);return e},intersectObjects:function(a,c,e){e=e||[];if(!1===Array.isArray(a))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),e;for(var g=0,k=a.length;g<k;g++)Ii(a[g],this,e,c);e.sort(ul);return e}});Object.assign(vl.prototype,{set:function(a,c,e){this.radius=a;this.phi=c;this.theta= e;return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.radius=a.radius;this.phi=a.phi;this.theta=a.theta;return this},makeSafe:function(){this.phi=Math.max(1E-6,Math.min(Math.PI-1E-6,this.phi));return this},setFromVector3:function(a){return this.setFromCartesianCoords(a.x,a.y,a.z)},setFromCartesianCoords:function(a,c,e){this.radius=Math.sqrt(a*a+c*c+e*e);0===this.radius?this.phi=this.theta=0:(this.theta=Math.atan2(a,e),this.phi=Math.acos(ab.clamp(c/this.radius, -1,1)));return this}});Object.assign(wl.prototype,{set:function(a,c,e){this.radius=a;this.theta=c;this.y=e;return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.radius=a.radius;this.theta=a.theta;this.y=a.y;return this},setFromVector3:function(a){return this.setFromCartesianCoords(a.x,a.y,a.z)},setFromCartesianCoords:function(a,c,e){this.radius=Math.sqrt(a*a+e*e);this.theta=Math.atan2(a,e);this.y=c;return this}});Object.assign(Ji.prototype,{set:function(a,c){this.min.copy(a); this.max.copy(c);return this},setFromPoints:function(a){this.makeEmpty();for(var c=0,e=a.length;c<e;c++)this.expandByPoint(a[c]);return this},setFromCenterAndSize:function(){var a=new f;return function(c,e){e=a.copy(e).multiplyScalar(.5);this.min.copy(c).sub(e);this.max.copy(c).add(e);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=Infinity;this.max.x=this.max.y= -Infinity;return this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(a){void 0===a&&(console.warn("THREE.Box2: .getCenter() target is now required"),a=new f);return this.isEmpty()?a.set(0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(a){void 0===a&&(console.warn("THREE.Box2: .getSize() target is now required"),a=new f);return this.isEmpty()?a.set(0,0):a.subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a); return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y},getParameter:function(a,c){void 0===c&&(console.warn("THREE.Box2: .getParameter() target is now required"),c=new f); return c.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y?!1:!0},clampPoint:function(a,c){void 0===c&&(console.warn("THREE.Box2: .clampPoint() target is now required"),c=new f);return c.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new f;return function(c){return a.copy(c).clamp(this.min,this.max).sub(c).length()}}(),intersect:function(a){this.min.max(a.min); this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});Object.assign(Ki.prototype,{set:function(a,c){this.start.copy(a);this.end.copy(c);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},getCenter:function(a){void 0=== a&&(console.warn("THREE.Line3: .getCenter() target is now required"),a=new m);return a.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){void 0===a&&(console.warn("THREE.Line3: .delta() target is now required"),a=new m);return a.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,c){void 0===c&&(console.warn("THREE.Line3: .at() target is now required"),c= new m);return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new m,c=new m;return function(e,g){a.subVectors(e,this.start);c.subVectors(this.end,this.start);e=c.dot(a)/c.dot(c);g&&(e=ab.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,c,e){a=this.closestPointToPointParameter(a,c);void 0===e&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),e=new m);return this.delta(e).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}});yg.prototype=Object.create(T.prototype);yg.prototype.constructor=yg;yg.prototype.isImmediateRenderObject=!0;zg.prototype=Object.create(Ab.prototype);zg.prototype.constructor=zg;zg.prototype.update=function(){var a=new m,c=new m,e=new w;return function(){var g=["a","b","c"];this.object.updateMatrixWorld(!0);e.getNormalMatrix(this.object.matrixWorld);var k=this.object.matrixWorld,r= this.geometry.attributes.position,u=this.object.geometry;if(u&&u.isGeometry)for(var A=u.vertices,B=u.faces,C=u=0,H=B.length;C<H;C++)for(var I=B[C],K=0,P=I.vertexNormals.length;K<P;K++){var O=I.vertexNormals[K];a.copy(A[I[g[K]]]).applyMatrix4(k);c.copy(O).applyMatrix3(e).normalize().multiplyScalar(this.size).add(a);r.setXYZ(u,a.x,a.y,a.z);u+=1;r.setXYZ(u,c.x,c.y,c.z);u+=1}else if(u&&u.isBufferGeometry)for(g=u.attributes.position,A=u.attributes.normal,K=u=0,P=g.count;K<P;K++)a.set(g.getX(K),g.getY(K), g.getZ(K)).applyMatrix4(k),c.set(A.getX(K),A.getY(K),A.getZ(K)),c.applyMatrix3(e).normalize().multiplyScalar(this.size).add(a),r.setXYZ(u,a.x,a.y,a.z),u+=1,r.setXYZ(u,c.x,c.y,c.z),u+=1;r.needsUpdate=!0}}();jf.prototype=Object.create(T.prototype);jf.prototype.constructor=jf;jf.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};jf.prototype.update=function(){var a=new m;return function(){this.light.updateMatrixWorld();var c=this.light.distance?this.light.distance: 1E3,e=c*Math.tan(this.light.angle);this.cone.scale.set(e,e,c);a.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(a);void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}();kf.prototype=Object.create(Ab.prototype);kf.prototype.constructor=kf;kf.prototype.updateMatrixWorld=function(){var a=new m,c=new G,e=new G;return function(g){var k=this.bones,r=this.geometry,u=r.getAttribute("position");e.getInverse(this.root.matrixWorld); for(var A=0,B=0;A<k.length;A++){var C=k[A];C.parent&&C.parent.isBone&&(c.multiplyMatrices(e,C.matrixWorld),a.setFromMatrixPosition(c),u.setXYZ(B,a.x,a.y,a.z),c.multiplyMatrices(e,C.parent.matrixWorld),a.setFromMatrixPosition(c),u.setXYZ(B+1,a.x,a.y,a.z),B+=2)}r.getAttribute("position").needsUpdate=!0;T.prototype.updateMatrixWorld.call(this,g)}}();lf.prototype=Object.create(cc.prototype);lf.prototype.constructor=lf;lf.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};lf.prototype.update= function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};mf.prototype=Object.create(fc.prototype);mf.prototype.constructor=mf;mf.prototype.update=function(){this.scale.set(.5*this.light.width,.5*this.light.height,1);if(void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var a=this.material.color,c=Math.max(a.r, a.g,a.b);1<c&&a.multiplyScalar(1/c);this.children[0].material.color.copy(this.material.color)}};mf.prototype.dispose=function(){this.geometry.dispose();this.material.dispose();this.children[0].geometry.dispose();this.children[0].material.dispose()};nf.prototype=Object.create(T.prototype);nf.prototype.constructor=nf;nf.prototype.dispose=function(){this.children[0].geometry.dispose();this.children[0].material.dispose()};nf.prototype.update=function(){var a=new m,c=new E,e=new E;return function(){var g= this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var k=g.geometry.getAttribute("color");c.copy(this.light.color);e.copy(this.light.groundColor);for(var r=0,u=k.count;r<u;r++){var A=r<u/2?c:e;k.setXYZ(r,A.r,A.g,A.b)}k.needsUpdate=!0}g.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate())}}();of.prototype=Object.create(cc.prototype);of.prototype.constructor=of;of.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};of.prototype.onBeforeRender= function(){return function(){this.position.copy(this.lightProbe.position);this.scale.set(1,1,1).multiplyScalar(this.size);this.material.uniforms.intensity.value=this.lightProbe.intensity}}();vh.prototype=Object.assign(Object.create(Ab.prototype),{constructor:vh,copy:function(a){Ab.prototype.copy.call(this,a);this.geometry.copy(a.geometry);this.material.copy(a.material);return this},clone:function(){return(new this.constructor).copy(this)}});wh.prototype=Object.create(Ab.prototype);wh.prototype.constructor= wh;pf.prototype=Object.create(fc.prototype);pf.prototype.constructor=pf;pf.prototype.update=function(){function a(O,S,V,ca){V=(S-O)/V;P.setXYZ(B,0,0,0);C++;for(H=O;H<S;H+=V)I=B+C,P.setXYZ(I,Math.sin(H)*e,0,Math.cos(H)*e),P.setXYZ(I+1,Math.sin(Math.min(H+V,S))*e,0,Math.cos(Math.min(H+V,S))*e),P.setXYZ(I+2,0,0,0),C+=3;K.addGroup(B,C,ca);B+=C;C=0}var c=this.audio,e=this.range,g=this.divisionsInnerAngle,k=this.divisionsOuterAngle,r=ab.degToRad(c.panner.coneInnerAngle);c=ab.degToRad(c.panner.coneOuterAngle); var u=r/2,A=c/2,B=0,C=0,H,I,K=this.geometry,P=K.attributes.position;K.clearGroups();a(-A,-u,k,0);a(-u,u,g,1);a(u,A,k,0);P.needsUpdate=!0;r===c&&(this.material[0].visible=!1)};pf.prototype.dispose=function(){this.geometry.dispose();this.material[0].dispose();this.material[1].dispose()};Ag.prototype=Object.create(Ab.prototype);Ag.prototype.constructor=Ag;Ag.prototype.update=function(){var a=new m,c=new m,e=new w;return function(){this.object.updateMatrixWorld(!0);e.getNormalMatrix(this.object.matrixWorld); var g=this.object.matrixWorld,k=this.geometry.attributes.position,r=this.object.geometry,u=r.vertices;r=r.faces;for(var A=0,B=0,C=r.length;B<C;B++){var H=r[B],I=H.normal;a.copy(u[H.a]).add(u[H.b]).add(u[H.c]).divideScalar(3).applyMatrix4(g);c.copy(I).applyMatrix3(e).normalize().multiplyScalar(this.size).add(a);k.setXYZ(A,a.x,a.y,a.z);A+=1;k.setXYZ(A,c.x,c.y,c.z);A+=1}k.needsUpdate=!0}}();qf.prototype=Object.create(T.prototype);qf.prototype.constructor=qf;qf.prototype.dispose=function(){this.lightPlane.geometry.dispose(); this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};qf.prototype.update=function(){var a=new m,c=new m,e=new m;return function(){a.setFromMatrixPosition(this.light.matrixWorld);c.setFromMatrixPosition(this.light.target.matrixWorld);e.subVectors(c,a);this.lightPlane.lookAt(c);void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color), this.targetLine.material.color.copy(this.light.color));this.targetLine.lookAt(c);this.targetLine.scale.z=e.length()}}();Bg.prototype=Object.create(Ab.prototype);Bg.prototype.constructor=Bg;Bg.prototype.update=function(){function a(r,u,A,B){g.set(u,A,B).unproject(k);r=e[r];if(void 0!==r)for(u=c.getAttribute("position"),A=0,B=r.length;A<B;A++)u.setXYZ(r[A],g.x,g.y,g.z)}var c,e,g=new m,k=new Yc;return function(){c=this.geometry;e=this.pointMap;k.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse); a("c",0,0,-1);a("t",0,0,1);a("n1",-1,-1,-1);a("n2",1,-1,-1);a("n3",-1,1,-1);a("n4",1,1,-1);a("f1",-1,-1,1);a("f2",1,-1,1);a("f3",-1,1,1);a("f4",1,1,1);a("u1",.7,1.1,-1);a("u2",-.7,1.1,-1);a("u3",0,2,-1);a("cf1",-1,0,1);a("cf2",1,0,1);a("cf3",0,-1,1);a("cf4",0,1,1);a("cn1",-1,0,-1);a("cn2",1,0,-1);a("cn3",0,-1,-1);a("cn4",0,1,-1);c.getAttribute("position").needsUpdate=!0}}();yd.prototype=Object.create(Ab.prototype);yd.prototype.constructor=yd;yd.prototype.update=function(){var a=new z;return function(c){void 0!== c&&console.warn("THREE.BoxHelper: .update() has no longer arguments.");void 0!==this.object&&a.setFromObject(this.object);if(!a.isEmpty()){c=a.min;var e=a.max,g=this.geometry.attributes.position,k=g.array;k[0]=e.x;k[1]=e.y;k[2]=e.z;k[3]=c.x;k[4]=e.y;k[5]=e.z;k[6]=c.x;k[7]=c.y;k[8]=e.z;k[9]=e.x;k[10]=c.y;k[11]=e.z;k[12]=e.x;k[13]=e.y;k[14]=c.z;k[15]=c.x;k[16]=e.y;k[17]=c.z;k[18]=c.x;k[19]=c.y;k[20]=c.z;k[21]=e.x;k[22]=c.y;k[23]=c.z;g.needsUpdate=!0;this.geometry.computeBoundingSphere()}}}();yd.prototype.setFromObject= function(a){this.object=a;this.update();return this};yd.prototype.copy=function(a){Ab.prototype.copy.call(this,a);this.object=a.object;return this};yd.prototype.clone=function(){return(new this.constructor).copy(this)};Cg.prototype=Object.create(Ab.prototype);Cg.prototype.constructor=Cg;Cg.prototype.updateMatrixWorld=function(a){var c=this.box;c.isEmpty()||(c.getCenter(this.position),c.getSize(this.scale),this.scale.multiplyScalar(.5),T.prototype.updateMatrixWorld.call(this,a))};Dg.prototype=Object.create(fc.prototype); Dg.prototype.constructor=Dg;Dg.prototype.updateMatrixWorld=function(a){var c=-this.plane.constant;1E-8>Math.abs(c)&&(c=1E-8);this.scale.set(.5*this.size,.5*this.size,c);this.children[0].material.side=0>c?1:0;this.lookAt(this.plane.normal);T.prototype.updateMatrixWorld.call(this,a)};var xh,Li;zd.prototype=Object.create(T.prototype);zd.prototype.constructor=zd;zd.prototype.setDirection=function(){var a=new m,c;return function(e){.99999<e.y?this.quaternion.set(0,0,0,1):-.99999>e.y?this.quaternion.set(1, 0,0,0):(a.set(e.z,0,-e.x).normalize(),c=Math.acos(e.y),this.quaternion.setFromAxisAngle(a,c))}}();zd.prototype.setLength=function(a,c,e){void 0===c&&(c=.2*a);void 0===e&&(e=.2*c);this.line.scale.set(1,Math.max(0,a-c),1);this.line.updateMatrix();this.cone.scale.set(e,c,e);this.cone.position.y=a;this.cone.updateMatrix()};zd.prototype.setColor=function(a){this.line.material.color.copy(a);this.cone.material.color.copy(a)};zd.prototype.copy=function(a){T.prototype.copy.call(this,a,!1);this.line.copy(a.line); this.cone.copy(a.cone);return this};zd.prototype.clone=function(){return(new this.constructor).copy(this)};Eg.prototype=Object.create(Ab.prototype);Eg.prototype.constructor=Eg;Wa.create=function(a,c){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(Wa.prototype);a.prototype.constructor=a;a.prototype.getPoint=c;return a};Object.assign(xd.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."); a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getSpacedPoints(a);return this.createGeometry(a)},createGeometry:function(a){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var c=new Y,e=0,g=a.length;e<g;e++){var k=a[e];c.vertices.push(new m(k.x, k.y,k.z||0))}return c}});Object.assign(Tc.prototype,{fromPoints:function(a){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints().");this.setFromPoints(a)}});yl.prototype=Object.create(lc.prototype);zl.prototype=Object.create(lc.prototype);Mi.prototype=Object.create(lc.prototype);Object.assign(Mi.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")}, reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}});vh.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};kf.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};Object.assign(wg.prototype,{extractUrlBase:function(a){console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."); return Ri.extractUrlBase(a)}});Object.assign(ri.prototype,{setTexturePath:function(a){console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().");return this.setResourcePath(a)}});Object.assign(Ji.prototype,{center:function(a){console.warn("THREE.Box2: .center() has been renamed to .getCenter().");return this.getCenter(a)},empty:function(){console.warn("THREE.Box2: .empty() has been renamed to .isEmpty().");return this.isEmpty()},isIntersectionBox:function(a){console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."); return this.intersectsBox(a)},size:function(a){console.warn("THREE.Box2: .size() has been renamed to .getSize().");return this.getSize(a)}});Object.assign(z.prototype,{center:function(a){console.warn("THREE.Box3: .center() has been renamed to .getCenter().");return this.getCenter(a)},empty:function(){console.warn("THREE.Box3: .empty() has been renamed to .isEmpty().");return this.isEmpty()},isIntersectionBox:function(a){console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."); return this.intersectsBox(a)},isIntersectionSphere:function(a){console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().");return this.intersectsSphere(a)},size:function(a){console.warn("THREE.Box3: .size() has been renamed to .getSize().");return this.getSize(a)}});Ki.prototype.center=function(a){console.warn("THREE.Line3: .center() has been renamed to .getCenter().");return this.getCenter(a)};Object.assign(ab,{random16:function(){console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."); return Math.random()},nearestPowerOfTwo:function(a){console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo().");return ab.floorPowerOfTwo(a)},nextPowerOfTwo:function(a){console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo().");return ab.ceilPowerOfTwo(a)}});Object.assign(w.prototype,{flattenToArrayOffset:function(a,c){console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.");return this.toArray(a,c)}, multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(a){console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.");return this.applyToBufferAttribute(a)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}); Object.assign(G.prototype,{extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},flattenToArrayOffset:function(a,c){console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.");return this.toArray(a,c)},getPosition:function(){var a;return function(){void 0===a&&(a=new m);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."); return a.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."); return a.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")}, rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(a){console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.");return this.applyToBufferAttribute(a)}, applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(a,c,e,g,k,r){console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.");return this.makePerspective(a,c,g,e,k,r)}});x.prototype.isIntersectionLine=function(a){console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().");return this.intersectsLine(a)};h.prototype.multiplyVector3= function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");return a.applyQuaternion(this)};Object.assign(Zd.prototype,{isIntersectionBox:function(a){console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)},isIntersectionPlane:function(a){console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().");return this.intersectsPlane(a)},isIntersectionSphere:function(a){console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."); return this.intersectsSphere(a)}});Object.assign(jc.prototype,{area:function(){console.warn("THREE.Triangle: .area() has been renamed to .getArea().");return this.getArea()},barycoordFromPoint:function(a,c){console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().");return this.getBarycoord(a,c)},midpoint:function(a){console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint().");return this.getMidpoint(a)},normal:function(a){console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."); return this.getNormal(a)},plane:function(a){console.warn("THREE.Triangle: .plane() has been renamed to .getPlane().");return this.getPlane(a)}});Object.assign(jc,{barycoordFromPoint:function(a,c,e,g,k){console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().");return jc.getBarycoord(a,c,e,g,k)},normal:function(a,c,e,g){console.warn("THREE.Triangle: .normal() has been renamed to .getNormal().");return jc.getNormal(a,c,e,g)}});Object.assign(Pd.prototype,{extractAllPoints:function(a){console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."); return this.extractPoints(a)},extrude:function(a){console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.");return new ge(this,a)},makeGeometry:function(a){console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.");return new he(this,a)}});Object.assign(f.prototype,{fromAttribute:function(a,c,e){console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().");return this.fromBufferAttribute(a,c,e)},distanceToManhattan:function(a){console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."); return this.manhattanDistanceTo(a)},lengthManhattan:function(){console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().");return this.manhattanLength()}});Object.assign(m.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")}, getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,c){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(c, a)},applyProjection:function(a){console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.");return this.applyMatrix4(a)},fromAttribute:function(a,c,e){console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().");return this.fromBufferAttribute(a,c,e)},distanceToManhattan:function(a){console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().");return this.manhattanDistanceTo(a)},lengthManhattan:function(){console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."); return this.manhattanLength()}});Object.assign(p.prototype,{fromAttribute:function(a,c,e){console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().");return this.fromBufferAttribute(a,c,e)},lengthManhattan:function(){console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().");return this.manhattanLength()}});Object.assign(Y.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}); Object.assign(T.prototype,{getChildByName:function(a){console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(a)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(a,c){console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.");return this.translateOnAxis(c,a)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}); Object.defineProperties(T.prototype,{eulerOrder:{get:function(){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");return this.rotation.order},set:function(a){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");this.rotation.order=a}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}); Object.defineProperties(Tf.prototype,{objects:{get:function(){console.warn("THREE.LOD: .objects has been renamed to .levels.");return this.levels}}});Object.defineProperty(ah.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}});Uf.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")};Object.defineProperty(Wa.prototype, "__arcLengthDivisions",{get:function(){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.");return this.arcLengthDivisions},set:function(a){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.");this.arcLengthDivisions=a}});Lb.prototype.setLens=function(a,c){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup.");void 0!==c&&(this.filmGauge=c);this.setFocalLength(a)};Object.defineProperties(Bb.prototype, {onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(a){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov.");this.shadow.camera.fov=a}},shadowCameraLeft:{set:function(a){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left.");this.shadow.camera.left=a}},shadowCameraRight:{set:function(a){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right.");this.shadow.camera.right=a}},shadowCameraTop:{set:function(a){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."); this.shadow.camera.top=a}},shadowCameraBottom:{set:function(a){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.");this.shadow.camera.bottom=a}},shadowCameraNear:{set:function(a){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near.");this.shadow.camera.near=a}},shadowCameraFar:{set:function(a){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far.");this.shadow.camera.far=a}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}}, shadowBias:{set:function(a){console.warn("THREE.Light: .shadowBias is now .shadow.bias.");this.shadow.bias=a}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(a){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.");this.shadow.mapSize.width=a}},shadowMapHeight:{set:function(a){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.");this.shadow.mapSize.height=a}}});Object.defineProperties(ma.prototype, {length:{get:function(){console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead.");return this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}});Object.assign(za.prototype,{addIndex:function(a){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().");this.setIndex(a)},addDrawCall:function(a,c,e){void 0!==e&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."); console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup().");this.addGroup(a,c)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().");this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}});Object.defineProperties(za.prototype,{drawcalls:{get:function(){console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."); return this.groups}},offsets:{get:function(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups.");return this.groups}}});Object.assign(ad.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}});Object.defineProperties(uh.prototype, {dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.");return this}}});Object.defineProperties(bb.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")}, set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){console.warn("THREE.Material: .wrapRGB has been removed.");return new E}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(a){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.");this.flatShading=1===a}}});Object.defineProperties(Nc.prototype,{metal:{get:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."); return!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}});Object.defineProperties(tc.prototype,{derivatives:{get:function(){console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.");return this.extensions.derivatives},set:function(a){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.");this.extensions.derivatives=a}}});Object.assign(fi.prototype, {clearTarget:function(a,c,e,g){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.");this.setRenderTarget(a);this.clear(c,e,g)},animate:function(a){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop().");this.setAnimationLoop(a)},getCurrentRenderTarget:function(){console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().");return this.getRenderTarget()},getMaxAnisotropy:function(){console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."); return this.capabilities.getMaxAnisotropy()},getPrecision:function(){console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.");return this.capabilities.precision},resetGLState:function(){console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset().");return this.state.reset()},supportsFloatTextures:function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return this.extensions.get("OES_texture_float")}, supportsHalfFloatTextures:function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."); return this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."); return this.capabilities.vertexTextures},supportsInstancedArrays:function(){console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");return this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(a){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().");this.setScissorTest(a)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")}, addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")}, setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")}});Object.defineProperties(fi.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");this.shadowMap.enabled=a}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");this.shadowMap.type=a}}, shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}});Object.defineProperties(Rk.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}}, renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}); Object.defineProperties(t.prototype,{activeCubeFace:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}});Object.defineProperties(n.prototype,{wrapS:{get:function(){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."); return this.texture.wrapS},set:function(a){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");this.texture.wrapS=a}},wrapT:{get:function(){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");return this.texture.wrapT},set:function(a){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");this.texture.wrapT=a}},magFilter:{get:function(){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");return this.texture.magFilter}, set:function(a){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");this.texture.magFilter=a}},minFilter:{get:function(){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");return this.texture.minFilter},set:function(a){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");this.texture.minFilter=a}},anisotropy:{get:function(){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");return this.texture.anisotropy}, set:function(a){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");this.texture.anisotropy=a}},offset:{get:function(){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");return this.texture.offset},set:function(a){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");this.texture.offset=a}},repeat:{get:function(){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");return this.texture.repeat},set:function(a){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."); this.texture.repeat=a}},format:{get:function(){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");return this.texture.format},set:function(a){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");this.texture.format=a}},type:{get:function(){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");return this.texture.type},set:function(a){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");this.texture.type=a}},generateMipmaps:{get:function(){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."); return this.texture.generateMipmaps},set:function(a){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");this.texture.generateMipmaps=a}}});Object.defineProperties(Wk.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}});hf.prototype.load=function(a){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead."); var c=this;(new vi).load(a,function(e){c.setBuffer(e)});return this};Ci.prototype.getData=function(){console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData().");return this.getFrequencyData()};xg.prototype.updateCubeMap=function(a,c){console.warn("THREE.CubeCamera: .updateCubeMap() is now .update().");return this.update(a,c)};Qd.crossOrigin=void 0;Qd.loadTexture=function(a,c,e,g){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var k= new jh;k.setCrossOrigin(this.crossOrigin);a=k.load(a,e,void 0,g);c&&(a.mapping=c);return a};Qd.loadTextureCube=function(a,c,e,g){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var k=new oi;k.setCrossOrigin(this.crossOrigin);a=k.load(a,e,void 0,g);c&&(a.mapping=c);return a};Qd.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")};Qd.loadCompressedTextureCube= function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};b.WebGLMultisampleRenderTarget=q;b.WebGLRenderTargetCube=t;b.WebGLRenderTarget=n;b.WebGLRenderer=fi;b.ShaderLib=Xc;b.UniformsLib=Ra;b.UniformsUtils=Zo;b.ShaderChunk=mb;b.FogExp2=Yg;b.Fog=Zg;b.Scene=$g;b.Sprite=Sf;b.LOD=Tf;b.SkinnedMesh=Uf;b.Skeleton=ah;b.Bone=ii;b.Mesh=cc;b.LineSegments=Ab;b.LineLoop=bh;b.Line=fc;b.Points=Qe;b.Group=Le;b.VideoTexture=ji;b.DataTexture=v;b.DataTexture2DArray= Ie;b.DataTexture3D=Je;b.CompressedTexture=Re;b.CubeTexture=sd;b.CanvasTexture=Vf;b.DepthTexture=Wf;b.Texture=l;b.AnimationLoader=ll;b.CompressedTextureLoader=ml;b.DataTextureLoader=ni;b.CubeTextureLoader=oi;b.TextureLoader=jh;b.ObjectLoader=ri;b.MaterialLoader=sh;b.BufferGeometryLoader=qi;b.DefaultLoadingManager=wc;b.LoadingManager=mi;b.ImageLoader=sg;b.ImageBitmapLoader=si;b.FontLoader=ol;b.FileLoader=Oc;b.Loader=wg;b.LoaderUtils=Ri;b.Cache=se;b.AudioLoader=vi;b.SpotLightShadow=lh;b.SpotLight=mh; b.PointLight=nh;b.RectAreaLight=rh;b.HemisphereLight=kh;b.HemisphereLightProbe=wi;b.DirectionalLightShadow=oh;b.DirectionalLight=ph;b.AmbientLight=qh;b.AmbientLightProbe=xi;b.LightShadow=re;b.Light=Bb;b.LightProbe=Uc;b.StereoCamera=pl;b.PerspectiveCamera=Lb;b.OrthographicCamera=vg;b.CubeCamera=xg;b.ArrayCamera=Qf;b.Camera=Yc;b.AudioListener=zi;b.PositionalAudio=Bi;b.AudioContext=Ai;b.AudioAnalyser=Ci;b.Audio=hf;b.VectorKeyframeTrack=ff;b.StringKeyframeTrack=ih;b.QuaternionKeyframeTrack=rg;b.NumberKeyframeTrack= ef;b.ColorKeyframeTrack=gh;b.BooleanKeyframeTrack=fh;b.PropertyMixer=Di;b.PropertyBinding=mc;b.KeyframeTrack=gc;b.AnimationUtils=Yb;b.AnimationObjectGroup=rl;b.AnimationMixer=Ei;b.AnimationClip=Hc;b.Uniform=uh;b.InstancedBufferGeometry=Fi;b.BufferGeometry=za;b.Geometry=Y;b.InterleavedBufferAttribute=Rf;b.InstancedInterleavedBuffer=Gi;b.InterleavedBuffer=ce;b.InstancedBufferAttribute=Hi;b.Face3=M;b.Object3D=T;b.Raycaster=tl;b.Layers=Z;b.EventDispatcher=d;b.Clock=yi;b.QuaternionLinearInterpolant=hh; b.LinearInterpolant=qg;b.DiscreteInterpolant=eh;b.CubicInterpolant=dh;b.Interpolant=Ac;b.Triangle=jc;b.Math=ab;b.Spherical=vl;b.Cylindrical=wl;b.Plane=x;b.Frustum=D;b.Sphere=y;b.Ray=Zd;b.Matrix4=G;b.Matrix3=w;b.Box3=z;b.Box2=Ji;b.Line3=Ki;b.Euler=R;b.Vector4=p;b.Vector3=m;b.Vector2=f;b.Quaternion=h;b.Color=E;b.SphericalHarmonics3=th;b.ImmediateRenderObject=yg;b.VertexNormalsHelper=zg;b.SpotLightHelper=jf;b.SkeletonHelper=kf;b.PointLightHelper=lf;b.RectAreaLightHelper=mf;b.HemisphereLightHelper=nf; b.LightProbeHelper=of;b.GridHelper=vh;b.PolarGridHelper=wh;b.PositionalAudioHelper=pf;b.FaceNormalsHelper=Ag;b.DirectionalLightHelper=qf;b.CameraHelper=Bg;b.BoxHelper=yd;b.Box3Helper=Cg;b.PlaneHelper=Dg;b.ArrowHelper=zd;b.AxesHelper=Eg;b.Shape=Pd;b.Path=Tc;b.ShapePath=ti;b.Font=ui;b.CurvePath=xd;b.Curve=Wa;b.ImageUtils=Qd;b.ShapeUtils=vd;b.WebGLUtils=Sk;b.WireframeGeometry=Se;b.ParametricGeometry=Xf;b.ParametricBufferGeometry=Te;b.TetrahedronGeometry=Zf;b.TetrahedronBufferGeometry=Ue;b.OctahedronGeometry= $f;b.OctahedronBufferGeometry=de;b.IcosahedronGeometry=ag;b.IcosahedronBufferGeometry=Ve;b.DodecahedronGeometry=bg;b.DodecahedronBufferGeometry=We;b.PolyhedronGeometry=Yf;b.PolyhedronBufferGeometry=vc;b.TubeGeometry=cg;b.TubeBufferGeometry=ee;b.TorusKnotGeometry=dg;b.TorusKnotBufferGeometry=Xe;b.TorusGeometry=eg;b.TorusBufferGeometry=Ye;b.TextGeometry=jg;b.TextBufferGeometry=Ze;b.SphereGeometry=kg;b.SphereBufferGeometry=Od;b.RingGeometry=lg;b.RingBufferGeometry=$e;b.PlaneGeometry=Gc;b.PlaneBufferGeometry= Wc;b.LatheGeometry=mg;b.LatheBufferGeometry=af;b.ShapeGeometry=he;b.ShapeBufferGeometry=ie;b.ExtrudeGeometry=ge;b.ExtrudeBufferGeometry=ad;b.EdgesGeometry=bf;b.ConeGeometry=ng;b.ConeBufferGeometry=og;b.CylinderGeometry=je;b.CylinderBufferGeometry=wd;b.CircleGeometry=pg;b.CircleBufferGeometry=cf;b.BoxGeometry=Ib;b.CubeGeometry=Ib;b.BoxBufferGeometry=oc;b.ShadowMaterial=ke;b.SpriteMaterial=Nd;b.RawShaderMaterial=df;b.ShaderMaterial=tc;b.PointsMaterial=Mc;b.MeshPhysicalMaterial=le;b.MeshStandardMaterial= bd;b.MeshPhongMaterial=Nc;b.MeshToonMaterial=me;b.MeshNormalMaterial=ne;b.MeshLambertMaterial=oe;b.MeshDepthMaterial=Kd;b.MeshDistanceMaterial=Ld;b.MeshBasicMaterial=zc;b.MeshMatcapMaterial=pe;b.LineDashedMaterial=qe;b.LineBasicMaterial=ub;b.Material=bb;b.Float64BufferAttribute=Cb;b.Float32BufferAttribute=qa;b.Uint32BufferAttribute=La;b.Int32BufferAttribute=Ha;b.Uint16BufferAttribute=Pa;b.Int16BufferAttribute=xa;b.Uint8ClampedBufferAttribute=oa;b.Uint8BufferAttribute=Ba;b.Int8BufferAttribute=va;b.BufferAttribute= ma;b.ArcCurve=gf;b.CatmullRomCurve3=lc;b.CubicBezierCurve=Pc;b.CubicBezierCurve3=cd;b.EllipseCurve=Bc;b.LineCurve=xc;b.LineCurve3=Qc;b.QuadraticBezierCurve=Rc;b.QuadraticBezierCurve3=dd;b.SplineCurve=Sc;b.REVISION="104";b.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2};b.CullFaceNone=0;b.CullFaceBack=1;b.CullFaceFront=2;b.CullFaceFrontBack=3;b.FrontFaceDirectionCW=0;b.FrontFaceDirectionCCW=1;b.BasicShadowMap=0;b.PCFShadowMap=1;b.PCFSoftShadowMap=2;b.FrontSide=0;b.BackSide=1;b.DoubleSide=2;b.FlatShading=1;b.SmoothShading= 2;b.NoColors=0;b.FaceColors=1;b.VertexColors=2;b.NoBlending=0;b.NormalBlending=1;b.AdditiveBlending=2;b.SubtractiveBlending=3;b.MultiplyBlending=4;b.CustomBlending=5;b.AddEquation=100;b.SubtractEquation=101;b.ReverseSubtractEquation=102;b.MinEquation=103;b.MaxEquation=104;b.ZeroFactor=200;b.OneFactor=201;b.SrcColorFactor=202;b.OneMinusSrcColorFactor=203;b.SrcAlphaFactor=204;b.OneMinusSrcAlphaFactor=205;b.DstAlphaFactor=206;b.OneMinusDstAlphaFactor=207;b.DstColorFactor=208;b.OneMinusDstColorFactor= 209;b.SrcAlphaSaturateFactor=210;b.NeverDepth=0;b.AlwaysDepth=1;b.LessDepth=2;b.LessEqualDepth=3;b.EqualDepth=4;b.GreaterEqualDepth=5;b.GreaterDepth=6;b.NotEqualDepth=7;b.MultiplyOperation=0;b.MixOperation=1;b.AddOperation=2;b.NoToneMapping=0;b.LinearToneMapping=1;b.ReinhardToneMapping=2;b.Uncharted2ToneMapping=3;b.CineonToneMapping=4;b.ACESFilmicToneMapping=5;b.UVMapping=300;b.CubeReflectionMapping=301;b.CubeRefractionMapping=302;b.EquirectangularReflectionMapping=303;b.EquirectangularRefractionMapping= 304;b.SphericalReflectionMapping=305;b.CubeUVReflectionMapping=306;b.CubeUVRefractionMapping=307;b.RepeatWrapping=1E3;b.ClampToEdgeWrapping=1001;b.MirroredRepeatWrapping=1002;b.NearestFilter=1003;b.NearestMipMapNearestFilter=1004;b.NearestMipMapLinearFilter=1005;b.LinearFilter=1006;b.LinearMipMapNearestFilter=1007;b.LinearMipMapLinearFilter=1008;b.UnsignedByteType=1009;b.ByteType=1010;b.ShortType=1011;b.UnsignedShortType=1012;b.IntType=1013;b.UnsignedIntType=1014;b.FloatType=1015;b.HalfFloatType= 1016;b.UnsignedShort4444Type=1017;b.UnsignedShort5551Type=1018;b.UnsignedShort565Type=1019;b.UnsignedInt248Type=1020;b.AlphaFormat=1021;b.RGBFormat=1022;b.RGBAFormat=1023;b.LuminanceFormat=1024;b.LuminanceAlphaFormat=1025;b.RGBEFormat=1023;b.DepthFormat=1026;b.DepthStencilFormat=1027;b.RedFormat=1028;b.RGB_S3TC_DXT1_Format=33776;b.RGBA_S3TC_DXT1_Format=33777;b.RGBA_S3TC_DXT3_Format=33778;b.RGBA_S3TC_DXT5_Format=33779;b.RGB_PVRTC_4BPPV1_Format=35840;b.RGB_PVRTC_2BPPV1_Format=35841;b.RGBA_PVRTC_4BPPV1_Format= 35842;b.RGBA_PVRTC_2BPPV1_Format=35843;b.RGB_ETC1_Format=36196;b.RGBA_ASTC_4x4_Format=37808;b.RGBA_ASTC_5x4_Format=37809;b.RGBA_ASTC_5x5_Format=37810;b.RGBA_ASTC_6x5_Format=37811;b.RGBA_ASTC_6x6_Format=37812;b.RGBA_ASTC_8x5_Format=37813;b.RGBA_ASTC_8x6_Format=37814;b.RGBA_ASTC_8x8_Format=37815;b.RGBA_ASTC_10x5_Format=37816;b.RGBA_ASTC_10x6_Format=37817;b.RGBA_ASTC_10x8_Format=37818;b.RGBA_ASTC_10x10_Format=37819;b.RGBA_ASTC_12x10_Format=37820;b.RGBA_ASTC_12x12_Format=37821;b.LoopOnce=2200;b.LoopRepeat= 2201;b.LoopPingPong=2202;b.InterpolateDiscrete=2300;b.InterpolateLinear=2301;b.InterpolateSmooth=2302;b.ZeroCurvatureEnding=2400;b.ZeroSlopeEnding=2401;b.WrapAroundEnding=2402;b.TrianglesDrawMode=0;b.TriangleStripDrawMode=1;b.TriangleFanDrawMode=2;b.LinearEncoding=3E3;b.sRGBEncoding=3001;b.GammaEncoding=3007;b.RGBEEncoding=3002;b.LogLuvEncoding=3003;b.RGBM7Encoding=3004;b.RGBM16Encoding=3005;b.RGBDEncoding=3006;b.BasicDepthPacking=3200;b.RGBADepthPacking=3201;b.TangentSpaceNormalMap=0;b.ObjectSpaceNormalMap= 1;b.Face4=function(a,c,e,g,k,r,u){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new M(a,c,e,k,r,u)};b.LineStrip=0;b.LinePieces=1;b.MeshFaceMaterial=function(a){console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead.");return a};b.MultiMaterial=function(a){void 0===a&&(a=[]);console.warn("THREE.MultiMaterial has been removed. Use an Array instead.");a.isMultiMaterial=!0;a.materials=a;a.clone=function(){return a.slice()};return a};b.PointCloud= function(a,c){console.warn("THREE.PointCloud has been renamed to THREE.Points.");return new Qe(a,c)};b.Particle=function(a){console.warn("THREE.Particle has been renamed to THREE.Sprite.");return new Sf(a)};b.ParticleSystem=function(a,c){console.warn("THREE.ParticleSystem has been renamed to THREE.Points.");return new Qe(a,c)};b.PointCloudMaterial=function(a){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.");return new Mc(a)};b.ParticleBasicMaterial=function(a){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."); return new Mc(a)};b.ParticleSystemMaterial=function(a){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.");return new Mc(a)};b.Vertex=function(a,c,e){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead.");return new m(a,c,e)};b.DynamicBufferAttribute=function(a,c){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.");return(new ma(a,c)).setDynamic(!0)};b.Int8Attribute=function(a, c){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.");return new va(a,c)};b.Uint8Attribute=function(a,c){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.");return new Ba(a,c)};b.Uint8ClampedAttribute=function(a,c){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.");return new oa(a,c)};b.Int16Attribute=function(a,c){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."); return new xa(a,c)};b.Uint16Attribute=function(a,c){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.");return new Pa(a,c)};b.Int32Attribute=function(a,c){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.");return new Ha(a,c)};b.Uint32Attribute=function(a,c){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.");return new La(a,c)};b.Float32Attribute= function(a,c){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.");return new qa(a,c)};b.Float64Attribute=function(a,c){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.");return new Cb(a,c)};b.ClosedSplineCurve3=yl;b.SplineCurve3=zl;b.Spline=Mi;b.AxisHelper=function(a){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper.");return new Eg(a)};b.BoundingBoxHelper=function(a,c){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."); return new yd(a,c)};b.EdgesHelper=function(a,c){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.");return new Ab(new bf(a.geometry),new ub({color:void 0!==c?c:16777215}))};b.WireframeHelper=function(a,c){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.");return new Ab(new Se(a.geometry),new ub({color:void 0!==c?c:16777215}))};b.XHRLoader=function(a){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader.");return new Oc(a)}; b.BinaryTextureLoader=function(a){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.");return new ni(a)};b.GeometryUtils={merge:function(a,c,e){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");if(c.isMesh){c.matrixAutoUpdate&&c.updateMatrix();var g=c.matrix;c=c.geometry}a.merge(c,g,e)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."); return a.center()}};b.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js.");this.projectVector=function(a,c){console.warn("THREE.Projector: .projectVector() is now vector.project().");a.project(c)};this.unprojectVector=function(a,c){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject().");a.unproject(c)};this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}};b.CanvasRenderer= function(){console.error("THREE.CanvasRenderer has been removed")};b.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")};b.SceneUtils={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};b.LensFlare= function(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")};Object.defineProperty(b,"__esModule",{value:!0})}"object"===typeof exports&&"undefined"!==typeof module?Km(exports):"function"===typeof define&&define.amd?define(["exports"],Km):(Jm=Jm||self,Km(Jm.THREE={})); </script> <script>//~~WEBPATH~~/tf-imports/OrbitControls.js THREE.OrbitControls=function(b,d){function f(){return Math.pow(.95,x.zoomSpeed)}function h(ta){x.object.isPerspectiveCamera?R/=ta:x.object.isOrthographicCamera?(x.object.zoom=Math.max(x.minZoom,Math.min(x.maxZoom,x.object.zoom*ta)),x.object.updateProjectionMatrix(),T=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),x.enableZoom=!1)}function m(ta){x.object.isPerspectiveCamera?R*=ta:x.object.isOrthographicCamera?(x.object.zoom=Math.max(x.minZoom, Math.min(x.maxZoom,x.object.zoom/ta)),x.object.updateProjectionMatrix(),T=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),x.enableZoom=!1)}function w(ta){if(!1!==x.enabled){ta.preventDefault();x.domElement.focus?x.domElement.focus():window.focus();switch(ta.button){case x.mouseButtons.LEFT:if(ta.ctrlKey||ta.metaKey||ta.shiftKey){if(!1===x.enablePan)return;Ba.set(ta.clientX,ta.clientY);E=F.PAN}else{if(!1===x.enableRotate)return;Y.set(ta.clientX, ta.clientY);E=F.ROTATE}break;case x.mouseButtons.MIDDLE:if(!1===x.enableZoom)return;Pa.set(ta.clientX,ta.clientY);E=F.DOLLY;break;case x.mouseButtons.RIGHT:if(!1===x.enablePan)return;Ba.set(ta.clientX,ta.clientY);E=F.PAN}E!==F.NONE&&(document.addEventListener("mousemove",l,!1),document.addEventListener("mouseup",p,!1),x.dispatchEvent(G))}}function l(ta){if(!1!==x.enabled)switch(ta.preventDefault(),E){case F.ROTATE:if(!1===x.enableRotate)break;ma.set(ta.clientX,ta.clientY);va.subVectors(ma,Y).multiplyScalar(x.rotateSpeed); ta=x.domElement===document?x.domElement.body:x.domElement;M.theta-=2*Math.PI*va.x/ta.clientHeight;M.phi-=2*Math.PI*va.y/ta.clientHeight;Y.copy(ma);x.update();break;case F.DOLLY:if(!1===x.enableZoom)break;Ha.set(ta.clientX,ta.clientY);La.subVectors(Ha,Pa);0<La.y?h(f()):0>La.y&&m(f());Pa.copy(Ha);x.update();break;case F.PAN:!1!==x.enablePan&&(oa.set(ta.clientX,ta.clientY),xa.subVectors(oa,Ba).multiplyScalar(x.panSpeed),tb(xa.x,xa.y),Ba.copy(oa),x.update())}}function p(){!1!==x.enabled&&(document.removeEventListener("mousemove", l,!1),document.removeEventListener("mouseup",p,!1),x.dispatchEvent(J),E=F.NONE)}function n(ta){!1===x.enabled||!1===x.enableZoom||E!==F.NONE&&E!==F.ROTATE||(ta.preventDefault(),ta.stopPropagation(),x.dispatchEvent(G),0>ta.deltaY?m(f()):0<ta.deltaY&&h(f()),x.update(),x.dispatchEvent(J))}function q(ta){if(!1!==x.enabled&&!1!==x.enableKeys&&!1!==x.enablePan){var za=!1;switch(ta.keyCode){case x.keys.UP:tb(0,x.keyPanSpeed);za=!0;break;case x.keys.BOTTOM:tb(0,-x.keyPanSpeed);za=!0;break;case x.keys.LEFT:tb(x.keyPanSpeed, 0);za=!0;break;case x.keys.RIGHT:tb(-x.keyPanSpeed,0),za=!0}za&&(ta.preventDefault(),x.update())}}function t(ta){if(!1!==x.enabled){ta.preventDefault();switch(ta.touches.length){case 1:if(!1===x.enableRotate)return;Y.set(ta.touches[0].pageX,ta.touches[0].pageY);E=F.TOUCH_ROTATE;break;case 2:if(!1===x.enableZoom&&!1===x.enablePan)return;if(x.enableZoom){var za=ta.touches[0].pageX-ta.touches[1].pageX,Ib=ta.touches[0].pageY-ta.touches[1].pageY;Pa.set(0,Math.sqrt(za*za+Ib*Ib))}x.enablePan&&Ba.set(.5* (ta.touches[0].pageX+ta.touches[1].pageX),.5*(ta.touches[0].pageY+ta.touches[1].pageY));E=F.TOUCH_DOLLY_PAN;break;default:E=F.NONE}E!==F.NONE&&x.dispatchEvent(G)}}function v(ta){if(!1!==x.enabled)switch(ta.preventDefault(),ta.stopPropagation(),ta.touches.length){case 1:if(!1===x.enableRotate)break;if(E!==F.TOUCH_ROTATE)break;ma.set(ta.touches[0].pageX,ta.touches[0].pageY);va.subVectors(ma,Y).multiplyScalar(x.rotateSpeed);ta=x.domElement===document?x.domElement.body:x.domElement;M.theta-=2*Math.PI* va.x/ta.clientHeight;M.phi-=2*Math.PI*va.y/ta.clientHeight;Y.copy(ma);x.update();break;case 2:if(!1===x.enableZoom&&!1===x.enablePan)break;if(E!==F.TOUCH_DOLLY_PAN)break;if(x.enableZoom){var za=ta.touches[0].pageX-ta.touches[1].pageX,Ib=ta.touches[0].pageY-ta.touches[1].pageY;Ha.set(0,Math.sqrt(za*za+Ib*Ib));La.set(0,Math.pow(Ha.y/Pa.y,x.zoomSpeed));h(La.y);Pa.copy(Ha)}x.enablePan&&(oa.set(.5*(ta.touches[0].pageX+ta.touches[1].pageX),.5*(ta.touches[0].pageY+ta.touches[1].pageY)),xa.subVectors(oa, Ba).multiplyScalar(x.panSpeed),tb(xa.x,xa.y),Ba.copy(oa));x.update();break;default:E=F.NONE}}function z(){!1!==x.enabled&&(x.dispatchEvent(J),E=F.NONE)}function y(ta){!1!==x.enabled&&ta.preventDefault()}this.object=b;this.domElement=void 0!==d?d:document;this.enabled=!0;this.target=new THREE.Vector3;this.minDistance=0;this.maxDistance=Infinity;this.minZoom=0;this.maxZoom=Infinity;this.minPolarAngle=0;this.maxPolarAngle=Math.PI;this.minAzimuthAngle=-Infinity;this.maxAzimuthAngle=Infinity;this.enableDamping= !1;this.dampingFactor=.25;this.enableZoom=!0;this.zoomSpeed=1;this.enableRotate=!0;this.rotateSpeed=1;this.enablePan=!0;this.panSpeed=1;this.screenSpacePanning=!1;this.keyPanSpeed=7;this.autoRotate=!1;this.autoRotateSpeed=2;this.enableKeys=!0;this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40};this.mouseButtons={LEFT:THREE.MOUSE.LEFT,MIDDLE:THREE.MOUSE.MIDDLE,RIGHT:THREE.MOUSE.RIGHT};this.target0=this.target.clone();this.position0=this.object.position.clone();this.zoom0=this.object.zoom;this.getPolarAngle= function(){return N.phi};this.getAzimuthalAngle=function(){return N.theta};this.saveState=function(){x.target0.copy(x.target);x.position0.copy(x.object.position);x.zoom0=x.object.zoom};this.reset=function(){x.target.copy(x.target0);x.object.position.copy(x.position0);x.object.zoom=x.zoom0;x.object.updateProjectionMatrix();x.dispatchEvent(D);x.update();E=F.NONE};this.update=function(){var ta=new THREE.Vector3,za=(new THREE.Quaternion).setFromUnitVectors(b.up,new THREE.Vector3(0,1,0)),Ib=za.clone().inverse(), oc=new THREE.Vector3,Gc=new THREE.Quaternion;return function(){var Wc=x.object.position;ta.copy(Wc).sub(x.target);ta.applyQuaternion(za);N.setFromVector3(ta);x.autoRotate&&E===F.NONE&&(M.theta-=2*Math.PI/60/60*x.autoRotateSpeed);N.theta+=M.theta;N.phi+=M.phi;N.theta=Math.max(x.minAzimuthAngle,Math.min(x.maxAzimuthAngle,N.theta));N.phi=Math.max(x.minPolarAngle,Math.min(x.maxPolarAngle,N.phi));N.makeSafe();N.radius*=R;N.radius=Math.max(x.minDistance,Math.min(x.maxDistance,N.radius));x.target.add(Z); ta.setFromSpherical(N);ta.applyQuaternion(Ib);Wc.copy(x.target).add(ta);x.object.lookAt(x.target);!0===x.enableDamping?(M.theta*=1-x.dampingFactor,M.phi*=1-x.dampingFactor,Z.multiplyScalar(1-x.dampingFactor)):(M.set(0,0,0),Z.set(0,0,0));R=1;return T||oc.distanceToSquared(x.object.position)>L||8*(1-Gc.dot(x.object.quaternion))>L?(x.dispatchEvent(D),oc.copy(x.object.position),Gc.copy(x.object.quaternion),T=!1,!0):!1}}();this.dispose=function(){x.domElement.removeEventListener("contextmenu",y,!1);x.domElement.removeEventListener("mousedown", w,!1);x.domElement.removeEventListener("wheel",n,!1);x.domElement.removeEventListener("touchstart",t,!1);x.domElement.removeEventListener("touchend",z,!1);x.domElement.removeEventListener("touchmove",v,!1);document.removeEventListener("mousemove",l,!1);document.removeEventListener("mouseup",p,!1);window.removeEventListener("keydown",q,!1)};var x=this,D={type:"change"},G={type:"start"},J={type:"end"},F={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},E=F.NONE,L=1E-6,N=new THREE.Spherical, M=new THREE.Spherical,R=1,Z=new THREE.Vector3,T=!1,Y=new THREE.Vector2,ma=new THREE.Vector2,va=new THREE.Vector2,Ba=new THREE.Vector2,oa=new THREE.Vector2,xa=new THREE.Vector2,Pa=new THREE.Vector2,Ha=new THREE.Vector2,La=new THREE.Vector2,qa=function(){var ta=new THREE.Vector3;return function(za,Ib){ta.setFromMatrixColumn(Ib,0);ta.multiplyScalar(-za);Z.add(ta)}}(),Cb=function(){var ta=new THREE.Vector3;return function(za,Ib){!0===x.screenSpacePanning?ta.setFromMatrixColumn(Ib,1):(ta.setFromMatrixColumn(Ib, 0),ta.crossVectors(x.object.up,ta));ta.multiplyScalar(za);Z.add(ta)}}(),tb=function(){var ta=new THREE.Vector3;return function(za,Ib){var oc=x.domElement===document?x.domElement.body:x.domElement;if(x.object.isPerspectiveCamera){ta.copy(x.object.position).sub(x.target);var Gc=ta.length();Gc*=Math.tan(x.object.fov/2*Math.PI/180);qa(2*za*Gc/oc.clientHeight,x.object.matrix);Cb(2*Ib*Gc/oc.clientHeight,x.object.matrix)}else x.object.isOrthographicCamera?(qa(za*(x.object.right-x.object.left)/x.object.zoom/ oc.clientWidth,x.object.matrix),Cb(Ib*(x.object.top-x.object.bottom)/x.object.zoom/oc.clientHeight,x.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),x.enablePan=!1)}}();x.domElement.addEventListener("contextmenu",y,!1);x.domElement.addEventListener("mousedown",w,!1);x.domElement.addEventListener("wheel",n,!1);x.domElement.addEventListener("touchstart",t,!1);x.domElement.addEventListener("touchend",z,!1);x.domElement.addEventListener("touchmove", v,!1);window.addEventListener("keydown",q,!1);this.update()};THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype);THREE.OrbitControls.prototype.constructor=THREE.OrbitControls; Object.defineProperties(THREE.OrbitControls.prototype,{center:{get:function(){console.warn("THREE.OrbitControls: .center has been renamed to .target");return this.target}},noZoom:{get:function(){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.");return!this.enableZoom},set:function(b){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.");this.enableZoom=!b}},noRotate:{get:function(){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."); return!this.enableRotate},set:function(b){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.");this.enableRotate=!b}},noPan:{get:function(){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.");return!this.enablePan},set:function(b){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.");this.enablePan=!b}},noKeys:{get:function(){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."); return!this.enableKeys},set:function(b){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.");this.enableKeys=!b}},staticMoving:{get:function(){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.");return!this.enableDamping},set:function(b){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.");this.enableDamping=!b}},dynamicDampingFactor:{get:function(){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."); return this.dampingFactor},set:function(b){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.");this.dampingFactor=b}}}); </script> <script>//~~WEBPATH~~/facets-dive/lib/sprite-atlas.js function Lm(b){b.drawQueue=[];b.callbackQueue=[];b.pendingImageCount=0;return b.lastClearTimestamp=Date.now()}function Mm(b){b.isDrawQueued||(b.isDrawQueued=!0,setTimeout(()=>{b.isDrawQueued&&Nm(b)},b.waitTimeout))} function Om(b,d,f,h){const m=Lm(b),w=new Image;void 0!==f&&(w.crossOrigin=f);b.pendingImageCount++;w.onerror=()=>{b.lastClearTimestamp>m||b.pendingImageCount--};w.onload=()=>{if(!(b.lastClearTimestamp>m)){b.pendingImageCount--;var l=w.width,p=w.height;if(l!==b.imageWidth*b.spriteColumns||p!==b.imageHeight*b.spriteRows){var n=l/b.imageWidth,q=p/b.imageHeight;if(n*q<b.capacity)throw Error("Atlas image too small to accommodate atlas capacity.");if(n!==Math.round(n)||q!==Math.round(q))throw Error("Atlas image dimensions do not fit sprite image dimensions."); b.spriteColumns=n;b.spriteRows=q;b.canvas.width=l;b.canvas.height=p}b.context.drawImage(w,0,0,b.canvas.width,b.canvas.height);b.needsUpdate=!0;h&&b.callbackQueue.push({callback:h,args:[w]});if(b.onDrawFinished)b.onDrawFinished()}};w.src=d} function Nm(b){b.isDrawQueued=!1;const d=Date.now(),f=d+(b.drawTimeout||Infinity);for(;b.drawQueue.length&&Date.now()<f;){const {spriteIndex:q,timestamp:t,imageData:v,image:z,callback:y}=b.drawQueue.shift();if(z){var h=b.imageWidth,m=b.imageHeight,w=q%b.spriteColumns*h,l=m*Math.floor(q/b.spriteColumns);b.context.clearRect(w,l,h,m);b.context.drawImage(z,w,l,h,m);"function"===typeof y&&b.callbackQueue.push({callback:y,args:[q]})}else if(v&&"text"===v.type){h=q%b.spriteColumns*b.imageWidth;m=b.imageHeight* Math.floor(q/b.spriteColumns);var p=h+b.imageWidth/2,n=m+b.imageHeight/2;w=b.fitter.fit(v.data+"");l=b.context;l.clearRect(h,m,b.imageWidth,b.imageHeight);l.save();l.translate(p,n);l.scale(b.imageWidth,b.imageHeight);l.beginPath();l.arc(0,0,.5,0,2*Math.PI);l.restore();l.fillStyle="#555555";l.fill();l.fillStyle="white";l.textBaseline="hanging";l.font=`${v.special?"italic":"bold"} ${w.fontSize}px ${"'Roboto Mono', 'Consolas', 'Menlo', monospace"}`;p=w.lines;for(n=0;n<p.length;n++){const x=p[n];l.fillText(x.text, h+x.x,m+x.y,x.text.length*b.fitter.settings.glyphAspectRatio*w.fontSize)}"function"===typeof y&&b.callbackQueue.push({callback:y,args:[q]})}else if(v){const x=new Image;b.pendingImageCount++;x.onload=()=>{d<b.lastClearTimestamp||(b.pendingImageCount--,b.drawQueue.unshift({spriteIndex:q,timestamp:t,image:x,callback:y}),Mm(b))};x.onerror=()=>{d<b.lastClearTimestamp||(b.pendingImageCount--,b.drawQueue.push({spriteIndex:q,timestamp:t,imageData:v,callback:y}),Mm(b))};x.src="svg"===v.type?URL.createObjectURL(new Blob([v.data], {type:"image/svg+xml;charset\x3dutf-8"})):`data:${v.type};base64,${v.data}`}}if(b.drawQueue.length||0<b.pendingImageCount)Mm(b);else if(b.needsUpdate=!0,b.onDrawFinished)b.onDrawFinished()} class Pm extends THREE.Texture{constructor(b,d,f){const h=Math.ceil(Math.sqrt(b)),m=Math.ceil(b/h),w=document.createElement("canvas");w.width=d*h;w.height=f*m;const l=w.getContext("2d");super(w);this.capacity=b;this.imageWidth=d;this.imageHeight=f;this.spriteColumns=h;this.spriteRows=m;this.canvas=w;this.context=l;this.magFilter=this.minFilter=THREE.LinearFilter;this.drawTimeout=50;this.waitTimeout=1;this.drawQueue=[];this.isDrawQueued=!1;this.lastClearTimestamp=0;this.callbackQueue=[];this.pendingImageCount= 0;this.fitter=new Im({x:.125*d,y:.125*f,width:.75*d,height:.75*f})}setSpriteImageData(b,d,f){this.drawQueue.push({spriteIndex:b,timestamp:Date.now(),imageData:d,callback:f});Mm(this)}}; </script> <script>//~~WEBPATH~~/facets-dive/lib/sprite-material.js class Qm extends THREE.RawShaderMaterial{constructor(b,d){super({vertexShader:"\n\n precision highp float;\n precision highp int;\n\n #define SHADER_NAME SpriteMaterial\n\n // Standard uniforms provided by THREE.js for projecting through the camera.\n uniform mat4 modelViewMatrix;\n uniform mat4 projectionMatrix;\n\n uniform float time;\n\n uniform float spriteColumns;\n uniform float spriteRows;\n\n attribute vec3 position;\n attribute vec3 basePosition;\n\n attribute vec4 color;\n attribute vec4 baseColor;\n\n attribute float opacity;\n attribute float baseOpacity;\n\n attribute float timestamp;\n attribute float baseTimestamp;\n\n attribute float vertexIndex;\n\n attribute float textureIndex;\n attribute float baseTextureIndex;\n\n attribute float textureTimestamp;\n attribute float baseTextureTimestamp;\n\n // Computed UV coordinates into the defaultTexture based on the vertexIndex.\n varying vec2 vDefaultUv;\n\n // Computed UV coordinates into the sprite texture atlas.\n varying vec2 vSpriteUv;\n\n // Interpolated color used by the fragment shader.\n varying vec4 vColor;\n\n // Interpolated opacity used by the fragment shader.\n varying float vOpacity;\n\n // Degree of mixing between base and current texture.\n varying float vTextureMix;\n\n float applyEasing(float t) {\n return t \x3c 0.5 ? 4.0 * t * t * t :\n 4.0 * (t - 1.0) * (t - 1.0) * (t - 1.0) + 1.0;\n }\n\n void main() {\n\n // Compute default UVs. A \x3d\x3e (0,0), B \x3d\x3e (1,0), etc.\n vDefaultUv.x \x3d mod(floor((vertexIndex + 1.0) / 2.0), 2.0);\n vDefaultUv.y \x3d mod(floor(vertexIndex / 2.0), 2.0);\n\n // Determine the row and column indices for this sprite.\n float spriteIndex \x3d floor(vertexIndex / 4.0) + 0.5;\n float columnIndex \x3d floor(mod(spriteIndex, spriteColumns));\n float rowIndex \x3d spriteRows - 1.0 - floor(spriteIndex / spriteColumns);\n\n // Compute sprite UVs from row and column indices.\n vSpriteUv.x \x3d (columnIndex + vDefaultUv.x) / spriteColumns;\n vSpriteUv.y \x3d (rowIndex + vDefaultUv.y) / spriteRows;\n\n float blend \x3d applyEasing(smoothstep(baseTimestamp, timestamp, time));\n\n vTextureMix \x3d mix(baseTextureIndex, textureIndex,\n smoothstep(baseTextureTimestamp, textureTimestamp, time));\n\n vColor \x3d mix(baseColor, color, blend);\n\n vOpacity \x3d mix(baseOpacity, opacity, blend);\n\n gl_Position \x3d projectionMatrix * modelViewMatrix *\n vec4(mix(basePosition, position, vec3(blend)), 1.0);\n\n }\n\n", fragmentShader:"\n\n precision highp float;\n precision highp int;\n\n #define SHADER_NAME SpriteMaterial\n\n // Lightness that should ideally exactly match the vColor.\n #define TARGET_LIGHTNESS 0.6\n\n uniform float time;\n\n uniform sampler2D defaultTexture;\n uniform sampler2D spriteAtlas;\n\n varying vec2 vDefaultUv;\n varying vec2 vSpriteUv;\n varying vec4 vColor;\n varying float vOpacity;\n varying float vTextureMix;\n\n // Compute relative luminance from RGB.\n float rgbToL(vec3 rgb) {\n return dot(rgb, vec3(0.3, 0.59, 0.11));\n }\n\n // Apply luminance easing.\n float easeL(float l) {\n return 1.0 - (1.0 - l) * (1.0 - l) * (1.0 - l);\n }\n\n void main() {\n if (vOpacity \x3c\x3d 0.05) {\n discard;\n }\n\n // Interpolate between default texture and sprite texture.\n vec4 defaultColor \x3d\n vTextureMix \x3c 1.0 ? texture2D(defaultTexture, vDefaultUv) : vec4(0.0);\n vec4 spriteColor \x3d\n vTextureMix \x3e 0.0 ? texture2D(spriteAtlas, vSpriteUv) : vec4(0.0);\n vec4 mixedColor \x3d mix(defaultColor, spriteColor, vTextureMix);\n\n // Lightness of the mixed pixel.\n float mixedL \x3d rgbToL(mixedColor.rgb);\n\n // Using the mixed and target lightness, determine the color that's between\n // black, vColor and white.\n vec3 color \x3d mixedL \x3c TARGET_LIGHTNESS ?\n mix(vec3(0.0), vColor.rgb, easeL(mixedL / TARGET_LIGHTNESS)) :\n mix(vec3(1.0), vColor.rgb,\n easeL((1.0 - mixedL) / (1.0 - TARGET_LIGHTNESS)));\n\n vec3 finalColor \x3d mix(mixedColor.rgb, color, vColor.a);\n\n // Apply opacity.\n gl_FragColor \x3d vec4(finalColor, mixedColor.a * vOpacity);\n }\n", uniforms:{time:{type:"f",value:0},defaultTexture:{type:"t",value:b},spriteAtlas:{type:"t",value:d},spriteColumns:{type:"f",value:d?d.spriteColumns:1},spriteRows:{type:"f",value:d?d.spriteRows:1}},transparent:!0})}get time(){return this.uniforms.time.value}set time(b){this.uniforms.time.value=b}get defaultTexture(){return this.uniforms.defaultTexture.value}set defaultTexture(b){this.uniforms.defaultTexture.value=b}get spriteAtlas(){return this.uniforms.spriteAtlas.value}set spriteAtlas(b){this.uniforms.spriteAtlas.value= b}}; </script> <script>//~~WEBPATH~~/facets-dive/lib/sprite-mesh.js class Rm{constructor(b,d){this._spriteMesh=b;this._spriteIndex=d}get spriteMesh(){return this._spriteMesh}get spriteIndex(){return this._spriteIndex}get x(){return this._spriteMesh.getX(this._spriteIndex)}set x(b){this._spriteMesh.setX(this._spriteIndex,b)}get y(){return this._spriteMesh.getY(this._spriteIndex)}set y(b){this._spriteMesh.setY(this._spriteIndex,b)}get z(){return this._spriteMesh.getZ(this._spriteIndex)}set z(b){this._spriteMesh.setZ(this._spriteIndex,b)}get r(){return this._spriteMesh.colorData[16* this._spriteIndex]}set r(b){{var d=this._spriteMesh;const f=16*this._spriteIndex;d.colorData[f+0]=b;d.colorData[f+4]=b;d.colorData[f+8]=b;d.colorData[f+12]=b;d.colorAttribute.needsUpdate=!0}}get g(){return this._spriteMesh.colorData[16*this._spriteIndex+1]}set g(b){{var d=this._spriteMesh;const f=16*this._spriteIndex;d.colorData[f+1]=b;d.colorData[f+5]=b;d.colorData[f+9]=b;d.colorData[f+13]=b;d.colorAttribute.needsUpdate=!0}}get b(){return this._spriteMesh.colorData[16*this._spriteIndex+2]}set b(b){{var d= this._spriteMesh;const f=16*this._spriteIndex;d.colorData[f+2]=b;d.colorData[f+6]=b;d.colorData[f+10]=b;d.colorData[f+14]=b;d.colorAttribute.needsUpdate=!0}}get a(){return this._spriteMesh.colorData[16*this._spriteIndex+3]}set a(b){{var d=this._spriteMesh;const f=16*this._spriteIndex;d.colorData[f+3]=b;d.colorData[f+7]=b;d.colorData[f+11]=b;d.colorData[f+15]=b;d.colorAttribute.needsUpdate=!0}}get opacity(){return this._spriteMesh.opacityData[4*this._spriteIndex]}set opacity(b){{var d=this._spriteMesh; const f=4*this._spriteIndex;d.opacityData[f+0]=b;d.opacityData[f+1]=b;d.opacityData[f+2]=b;d.opacityData[f+3]=b;d.opacityAttribute.needsUpdate=!0}}get timestamp(){var b=this._spriteMesh;return b.timestampData[4*this._spriteIndex]+b.constructionTimestamp}set timestamp(b){{var d=this._spriteMesh;const f=4*this._spriteIndex;b-=d.constructionTimestamp;d.timestampData[f+0]=b;d.timestampData[f+1]=b;d.timestampData[f+2]=b;d.timestampData[f+3]=b;d.timestampAttribute.needsUpdate=!0}}get baseX(){return this._spriteMesh.basePositionData[12* this._spriteIndex]}set baseX(b){Sm(this._spriteMesh,this._spriteIndex,b)}get baseY(){return this._spriteMesh.basePositionData[12*this._spriteIndex+1]}set baseY(b){Tm(this._spriteMesh,this._spriteIndex,b)}get baseZ(){return this._spriteMesh.basePositionData[12*this._spriteIndex+2]}set baseZ(b){Um(this._spriteMesh,this._spriteIndex,b)}get baseR(){return this._spriteMesh.baseColorData[16*this._spriteIndex]}set baseR(b){Vm(this._spriteMesh,this._spriteIndex,b)}get baseG(){return this._spriteMesh.baseColorData[16* this._spriteIndex+1]}set baseG(b){Wm(this._spriteMesh,this._spriteIndex,b)}get baseB(){return this._spriteMesh.baseColorData[16*this._spriteIndex+2]}set baseB(b){Xm(this._spriteMesh,this._spriteIndex,b)}get baseA(){return this._spriteMesh.baseColorData[16*this._spriteIndex+3]}set baseA(b){Ym(this._spriteMesh,this._spriteIndex,b)}get baseOpacity(){return this._spriteMesh.baseOpacityData[4*this._spriteIndex]}set baseOpacity(b){Zm(this._spriteMesh,this._spriteIndex,b)}get baseTimestamp(){var b=this._spriteMesh; return b.baseTimestampData[4*this._spriteIndex]+b.constructionTimestamp}set baseTimestamp(b){$m(this._spriteMesh,this._spriteIndex,b)}get textureIndex(){return this._spriteMesh.textureIndexData[4*this._spriteIndex]}set textureIndex(b){an(this._spriteMesh,this._spriteIndex,b)}get baseTextureIndex(){return this._spriteMesh.baseTextureIndexData[4*this._spriteIndex]}set baseTextureIndex(b){bn(this._spriteMesh,this._spriteIndex,b)}get textureTimestamp(){var b=this._spriteMesh;return b.textureTimestampData[4* this._spriteIndex]+b.constructionTimestamp}set textureTimestamp(b){cn(this._spriteMesh,this._spriteIndex,b)}get baseTextureTimestamp(){var b=this._spriteMesh;return b.baseTextureTimestampData[4*this._spriteIndex]+b.constructionTimestamp}set baseTextureTimestamp(b){dn(this._spriteMesh,this._spriteIndex,b)}rebase(b){this._spriteMesh.rebase(this._spriteIndex,b)}setSpriteImageData(b,d){this._spriteMesh.setSpriteImageData(this._spriteIndex,b,d)}switchTextures(b,d){this._spriteMesh.switchTextures(this._spriteIndex, b,d)}}function Sm(b,d,f){d*=12;b.basePositionData[d+0]=f;b.basePositionData[d+3]=f+b.spriteWidth;b.basePositionData[d+6]=f+b.spriteWidth;b.basePositionData[d+9]=f;b.basePositionAttribute.needsUpdate=!0}function Tm(b,d,f){d*=12;b.basePositionData[d+1]=f;b.basePositionData[d+4]=f;b.basePositionData[d+7]=f+b.spriteHeight;b.basePositionData[d+10]=f+b.spriteHeight;b.basePositionAttribute.needsUpdate=!0} function Um(b,d,f){d*=12;b.basePositionData[d+2]=f;b.basePositionData[d+5]=f;b.basePositionData[d+8]=f;b.basePositionData[d+11]=f;b.basePositionAttribute.needsUpdate=!0}function Vm(b,d,f){d*=16;b.baseColorData[d+0]=f;b.baseColorData[d+4]=f;b.baseColorData[d+8]=f;b.baseColorData[d+12]=f;b.baseColorAttribute.needsUpdate=!0}function Wm(b,d,f){d*=16;b.baseColorData[d+1]=f;b.baseColorData[d+5]=f;b.baseColorData[d+9]=f;b.baseColorData[d+13]=f;b.baseColorAttribute.needsUpdate=!0} function Xm(b,d,f){d*=16;b.baseColorData[d+2]=f;b.baseColorData[d+6]=f;b.baseColorData[d+10]=f;b.baseColorData[d+14]=f;b.baseColorAttribute.needsUpdate=!0}function Ym(b,d,f){d*=16;b.baseColorData[d+3]=f;b.baseColorData[d+7]=f;b.baseColorData[d+11]=f;b.baseColorData[d+15]=f;b.baseColorAttribute.needsUpdate=!0}function Zm(b,d,f){d*=4;b.baseOpacityData[d+0]=f;b.baseOpacityData[d+1]=f;b.baseOpacityData[d+2]=f;b.baseOpacityData[d+3]=f;b.baseOpacityAttribute.needsUpdate=!0} function $m(b,d,f){d*=4;f-=b.constructionTimestamp;b.baseTimestampData[d+0]=f;b.baseTimestampData[d+1]=f;b.baseTimestampData[d+2]=f;b.baseTimestampData[d+3]=f;b.baseTimestampAttribute.needsUpdate=!0}function an(b,d,f){d*=4;b.textureIndexData[d+0]=f;b.textureIndexData[d+1]=f;b.textureIndexData[d+2]=f;b.textureIndexData[d+3]=f;b.textureIndexAttribute.needsUpdate=!0} function bn(b,d,f){d*=4;b.baseTextureIndexData[d+0]=f;b.baseTextureIndexData[d+1]=f;b.baseTextureIndexData[d+2]=f;b.baseTextureIndexData[d+3]=f;b.baseTextureIndexAttribute.needsUpdate=!0}function cn(b,d,f){d*=4;f-=b.constructionTimestamp;b.textureTimestampData[d+0]=f;b.textureTimestampData[d+1]=f;b.textureTimestampData[d+2]=f;b.textureTimestampData[d+3]=f;b.textureTimestampAttribute.needsUpdate=!0} function dn(b,d,f){d*=4;f-=b.constructionTimestamp;b.baseTextureTimestampData[d+0]=f;b.baseTextureTimestampData[d+1]=f;b.baseTextureTimestampData[d+2]=f;b.baseTextureTimestampData[d+3]=f;b.baseTextureTimestampAttribute.needsUpdate=!0} function en(b){const d=b.defaultTextureCanvas=document.createElement("canvas"),f=d.width=b.imageWidth,h=d.height=b.imageHeight,m=d.getContext("2d"),w=new Image;w.onload=()=>{m.drawImage(w,0,0,f,h);b.defaultTexture.needsUpdate=!0};w.src=URL.createObjectURL(new Blob(['\n\x3csvg version\x3d"1.1"\n baseProfile\x3d"full"\n width\x3d"128" height\x3d"128"\n xmlns\x3d"http://www.w3.org/2000/svg"\n xmlns:xlink\x3d"http://www.w3.org/1999/xlink"\x3e\n \x3cdefs\x3e\n \x3clinearGradient id\x3d"linearGradient3774"\x3e\n \x3cstop\n style\x3d"stop-color:#808080;stop-opacity:1;"\n offset\x3d"0" /\x3e\n \x3cstop\n style\x3d"stop-color:#555555;stop-opacity:1;"\n offset\x3d"1" /\x3e\n \x3c/linearGradient\x3e\n \x3cradialGradient\n xlink:href\x3d"#linearGradient3774"\n id\x3d"radialGradient3780"\n cx\x3d"80"\n cy\x3d"40"\n fx\x3d"80"\n fy\x3d"40"\n r\x3d"80"\n gradientUnits\x3d"userSpaceOnUse"\n spreadMethod\x3d"pad" /\x3e\n \x3c/defs\x3e\n \x3ccircle cx\x3d"50%" cy\x3d"50%" r\x3d"50%" fill\x3d"url(#radialGradient3780)" /\x3e\n\x3c/svg\x3e\n'],{type:"image/svg+xml;charset\x3dutf-8"})); return d}function fn(b){return new Rm(b,b.nextIndex++)}function gn(b,d,f){const h=[];for(let m=0;m<b.capacity;m++){const w=12*m;d>=b.positionData[w+0]&&d<=b.positionData[w+6]&&f>=b.positionData[w+1]&&f<=b.positionData[w+7]&&h.push(m)}return h} class hn extends THREE.Mesh{constructor(b,d=32,f=32){super();this.capacity=b;this.imageWidth=d;this.imageHeight=f;this.nextIndex=0;this.spriteWidth=this.imageWidth/this.imageHeight;this.spriteHeight=1;this.geometry=new THREE.BufferGeometry;this.positionData=new Float32Array(12*b);this.positionAttribute=new THREE.BufferAttribute(this.positionData,3);this.positionAttribute.setDynamic(!0);this.geometry.addAttribute("position",this.positionAttribute);this.basePositionData=new Float32Array(12*b);this.basePositionAttribute= new THREE.BufferAttribute(this.basePositionData,3);this.basePositionAttribute.setDynamic(!0);this.geometry.addAttribute("basePosition",this.basePositionAttribute);this.colorData=new Uint8Array(16*b);this.colorAttribute=new THREE.BufferAttribute(this.colorData,4);this.colorAttribute.normalized=!0;this.colorAttribute.setDynamic(!0);this.geometry.addAttribute("color",this.colorAttribute);this.baseColorData=new Uint8Array(16*b);this.baseColorAttribute=new THREE.BufferAttribute(this.baseColorData,4);this.baseColorAttribute.normalized= !0;this.baseColorAttribute.setDynamic(!0);this.geometry.addAttribute("baseColor",this.baseColorAttribute);this.opacityData=new Float32Array(4*b);this.opacityAttribute=new THREE.BufferAttribute(this.opacityData,1);this.opacityAttribute.setDynamic(!0);this.geometry.addAttribute("opacity",this.opacityAttribute);this.baseOpacityData=new Float32Array(4*b);this.baseOpacityAttribute=new THREE.BufferAttribute(this.baseOpacityData,1);this.baseOpacityAttribute.setDynamic(!0);this.geometry.addAttribute("baseOpacity", this.baseOpacityAttribute);this.timestampData=new Float32Array(4*b);this.timestampAttribute=new THREE.BufferAttribute(this.timestampData,1);this.timestampAttribute.setDynamic(!0);this.geometry.addAttribute("timestamp",this.timestampAttribute);this.baseTimestampData=new Float32Array(4*b);this.baseTimestampAttribute=new THREE.BufferAttribute(this.baseTimestampData,1);this.baseTimestampAttribute.setDynamic(!0);this.geometry.addAttribute("baseTimestamp",this.baseTimestampAttribute);this.faceIndexData= new Uint32Array(6*b);for(var h=0;h<b;h++){var m=6*h;const w=4*h;this.faceIndexData[m+0]=w+0;this.faceIndexData[m+1]=w+1;this.faceIndexData[m+2]=w+2;this.faceIndexData[m+3]=w+0;this.faceIndexData[m+4]=w+2;this.faceIndexData[m+5]=w+3}this.faceIndexAttribute=new THREE.BufferAttribute(this.faceIndexData,1);this.geometry.setIndex(this.faceIndexAttribute);this.textureIndexData=new Float32Array(4*b);this.textureIndexAttribute=new THREE.BufferAttribute(this.textureIndexData,1);this.textureIndexAttribute.setDynamic(!0); this.geometry.addAttribute("textureIndex",this.textureIndexAttribute);this.baseTextureIndexData=new Float32Array(4*b);this.baseTextureIndexAttribute=new THREE.BufferAttribute(this.baseTextureIndexData,1);this.baseTextureIndexAttribute.setDynamic(!0);this.geometry.addAttribute("baseTextureIndex",this.baseTextureIndexAttribute);this.textureTimestampData=new Float32Array(4*b);this.textureTimestampAttribute=new THREE.BufferAttribute(this.textureTimestampData,1);this.textureTimestampAttribute.setDynamic(!0); this.geometry.addAttribute("textureTimestamp",this.textureTimestampAttribute);this.baseTextureTimestampData=new Float32Array(4*b);this.baseTextureTimestampAttribute=new THREE.BufferAttribute(this.baseTextureTimestampData,1);this.baseTextureTimestampAttribute.setDynamic(!0);this.geometry.addAttribute("baseTextureTimestamp",this.baseTextureTimestampAttribute);h=4*b;this.vertexIndexData=new Float32Array(h);for(m=0;m<h;m++)this.vertexIndexData[m]=m;this.vertexIndexAttribute=new THREE.BufferAttribute(this.vertexIndexData, 1);this.geometry.addAttribute("vertexIndex",this.vertexIndexAttribute);this.defaultTextureCanvas=en(this);this.defaultTexture=new THREE.Texture(this.defaultTextureCanvas);this.defaultTexture.minFilter=THREE.LinearFilter;this.defaultTexture.magFilter=THREE.NearestFilter;this.defaultTexture.needsUpdate=!0;this.spriteAtlas=new Pm(b,d,f);this.material=new Qm(this.defaultTexture,this.spriteAtlas);this.onBeforeRender=()=>{var w=this.material;w.uniforms.spriteColumns.value=w.spriteAtlas.spriteColumns;w.uniforms.spriteRows.value= w.spriteAtlas.spriteRows};this.time=this.constructionTimestamp=Date.now();this.frustumCulled=!1}get time(){return this.material.time+this.constructionTimestamp}set time(b){this.material.time=b-this.constructionTimestamp}getX(b){return this.positionData[12*b]}setX(b,d){b*=12;this.positionData[b+0]=d;this.positionData[b+3]=d+this.spriteWidth;this.positionData[b+6]=d+this.spriteWidth;this.positionData[b+9]=d;this.positionAttribute.needsUpdate=!0}getY(b){return this.positionData[12*b+1]}setY(b,d){b*= 12;this.positionData[b+1]=d;this.positionData[b+4]=d;this.positionData[b+7]=d+this.spriteHeight;this.positionData[b+10]=d+this.spriteHeight;this.positionAttribute.needsUpdate=!0}getZ(b){return this.positionData[12*b+2]}setZ(b,d){b*=12;this.positionData[b+2]=d;this.positionData[b+5]=d;this.positionData[b+8]=d;this.positionData[b+11]=d;this.positionAttribute.needsUpdate=!0}rebase(b,d){d=void 0===d?this.time:d;const f=this.baseTimestampData[4*b]+this.constructionTimestamp,h=this.timestampData[4*b]+this.constructionTimestamp; if(d>=h)var m=1;else d<=f?m=0:(m=(d-f)/(h-f),m=.5>m?4*m*m*m:4*(m-1)*(m-1)*(m-1)+1);Sm(this,b,this.getX(b)*m+this.basePositionData[12*b]*(1-m));Tm(this,b,this.getY(b)*m+this.basePositionData[12*b+1]*(1-m));Um(this,b,this.getZ(b)*m+this.basePositionData[12*b+2]*(1-m));Vm(this,b,this.colorData[16*b]*m+this.baseColorData[16*b]*(1-m));Wm(this,b,this.colorData[16*b+1]*m+this.baseColorData[16*b+1]*(1-m));Xm(this,b,this.colorData[16*b+2]*m+this.baseColorData[16*b+2]*(1-m));Ym(this,b,this.colorData[16*b+3]* m+this.baseColorData[16*b+3]*(1-m));Zm(this,b,this.opacityData[4*b]*m+this.baseOpacityData[4*b]*(1-m));$m(this,b,d>=h?d:h*m+f*(1-m))}setSpriteImageData(b,d,f){this.spriteAtlas.setSpriteImageData(b,d,f)}switchTextures(b,d,f){const h=this.textureIndexData[4*b];bn(this,b,h);an(this,b,0===h?1:0);dn(this,b,d);cn(this,b,f)}}; </script> <script>//~~WEBPATH~~/facets-dive/lib/wordtree.js const jn=/\b[-'\w]+\b/g;function kn(b){return`${typeof b}\u001F${b}`} function ln(b){if(2>b.valueCount)return null;for(var d={},f=b;f;){var h=f.commonWords,m=d;for(var w=0;w<h.length;w++)m[h[w]]=!0;f=f.parent}for(m=0;m<b.children.length;m++)for(f=b.children[m].commonWords,h=d,w=0;w<f.length;w++)h[f[w]]=!0;f={};for(const l in b.valueHash){const {count:p,words:n}=b.valueHash[l];for(const q in n)q in d||(f[q]=(f[q]||0)+p,f[q]===b.totalCount&&(b.commonWords.push(q),d[q]=!0,delete f[q]))}b=null;d=0;for(const l in f)f[l]>d&&(b=l,d=f[l]);return b} function mn(b){var d={parent:null,commonWords:[],level:1,order:0,totalCount:0,valueHash:{},valueCount:0,nonValueCount:0,children:[]};const f={root:d,nodeHash:{},highestLevel:1,levelHash:{1:d}};for(var h in b){if(!b.hasOwnProperty(h))continue;const {value:q,count:t,words:v}=b[h];"string"===typeof q?(d.valueHash[h]={value:q,count:t,words:v},d.valueCount+=t):d.nonValueCount+=t;d.totalCount+=t;f.nodeHash[h]=d}b=d.level;if(d.nonValueCount){b++;h={parent:d,commonWords:[],level:b,order:0,totalCount:d.nonValueCount, valueHash:{},valueCount:0,nonValueCount:d.nonValueCount,children:[]};d.nonValueCount=0;d.children.push(h);f.highestLevel=b;f.levelHash[b]=h;for(var m in f.nodeHash)m in d.valueHash||(f.nodeHash[m]=h)}d=[d];for(m=q=>q.valueCount+q.nonValueCount;100>b&&d.length;){h=0;var w=m(d[h]);for(var l=1;l<d.length;l++){const q=m(d[l]);q>w&&(h=l,w=q)}w=d[h];if(l=ln(w)){b++;h={parent:w,commonWords:[l],level:b,order:0,totalCount:0,valueHash:{},valueCount:0,nonValueCount:0,children:[]};w.children.push(h);d.push(h); for(const q in w.valueHash){if(!w.valueHash.hasOwnProperty(q))continue;const {value:t,count:v,words:z}=w.valueHash[q];z&&l in z&&(h.valueHash[q]={value:t,count:v,words:z},h.valueCount+=v,h.totalCount+=v,delete w.valueHash[q],w.valueCount-=v,f.nodeHash[q]=h,f.highestLevel=b,f.levelHash[b]=h)}}else d.splice(h,1)}let p=0;const n=q=>{q.order=++p;for(let t=0;t<q.children.length;t++)n(q.children[t])};n(f.root);return f}; </script> <script>//~~WEBPATH~~/facets-dive/lib/stats.js function nn(b){return 0<b.numberCount&&null!==b.numberMin&&null!==b.numberMax&&b.numberMax>b.numberMin} class on{constructor(){this.uniqueCount=this.totalCount=0;this.valueHash={};this.otherCount=this.stringCount=this.integerCount=this.numberCount=0;this.stringLengthsCount=this.stringMeanLength=this.stringMaxLength=this.stringMinLength=this.numberMax=this.numberMin=null;this.stringLengthsHash={};this.totalWordCount=this.multiwordCount=0;this.wordCounts={};this.uniqueWordCount=0;this.wordTree=null}isInteger(){return 0<this.numberCount&&this.integerCount===this.numberCount}} function pn(b){if(!b||!b.length)return{};const d={};for(let l=0;l<b.length;l++){const p=b[l];if(null==p)continue;const n=Object.keys(p);for(let q=0;q<n.length;q++){var f=n[q],h=p[f];f in d||(d[f]=new on);f=d[f];var m=h;f.totalCount++;h=kn(m);h in f.valueHash||(f.valueHash[h]={value:m,count:0},f.uniqueCount++);f.valueHash[h].count++;switch(typeof m){case "number":h=m;f.numberCount++;"number"===typeof h&&h>>0===h&&f.integerCount++;isNaN(h)||(f.numberMin=null===f.numberMin?h:Math.min(f.numberMin,h), f.numberMax=null===f.numberMax?h:Math.max(f.numberMax,h));break;case "string":f.stringCount++;var w=m.length;w in f.stringLengthsHash||(f.stringLengthsCount=(f.stringLengthsCount||0)+1);f.stringLengthsHash[w]=(f.stringLengthsHash[w]||0)+1;f.stringMinLength=null===f.stringMinLength?w:Math.min(f.stringMinLength,w);f.stringMaxLength=null===f.stringMaxLength?w:Math.max(f.stringMaxLength,w);f.stringMeanLength=(f.stringMeanLength||0)*(f.stringCount-1)/f.stringCount+w/f.stringCount;if(!f.valueHash[h].words){m= m.toLowerCase().toLowerCase().match(jn)||[];1<m.length&&(f.multiwordCount++,f.totalWordCount+=m.length);w=f.valueHash[h].words={};for(let t=0;t<m.length;t++){const v=m[t];w[v]=(w[v]||0)+1;v in f.wordCounts||(f.wordCounts[v]=0,f.uniqueWordCount++)}}h=f.valueHash[h].words;for(const t in h)f.wordCounts[t]=(f.wordCounts[t]||0)+1;break;default:f.otherCount++}}}for(const l in d)b=d[l],b.multiwordCount&&(b.wordTree=mn(b.valueHash));return d}; </script> <script>//~~WEBPATH~~/facets-dive/lib/string-format.js function qn(b){return 65>b.length?b:b.substr(0,30)+"..."+b.substr(-30)}; </script> <dom-module id="facets-dive-vis"> <template> <style> :host { box-sizing: border-box; display: block; height: 100%; width: 100%; } .labels { @apply --paper-font-common-base; @apply --paper-font-headline; } .rotate { stroke-dasharray: 1.5, 0.5; animation: rotate 1s linear infinite; } @keyframes rotate { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 2; } } </style> <div id="holder"> </div> </template> </dom-module> <script>//~~WEBPATH~~/facets-dive/components/facets-dive-vis/facets-dive-vis.js /* Copyright 2018 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ const rn={bottom:6,left:6,right:6,top:6},sn={"\ufffcOTHER\ufffc":"other","\ufffcNO_WORDS\ufffc":"non-words","\ufffcALL_WORDS\ufffc":"other"},tn=b=>null!==b&&b in sn?{label:sn[b],special:!0}:"number"!==typeof b&&"string"!==typeof b?{label:""+b,special:!0}:{label:qn(""+b),special:!1},un="#4285F4 #DB4437 #F4B400 #0F9D58 #AB47BC #00ACC1 #FF7043 #9E9D24 #5C6BC0 #F06292 #00796B #C2185B".split(" "),vn="#4285F4 #0F9D58 #00ACC1 #9E9D24 #5C6BC0 #00796B #607D8B".split(" "),wn="#DB4437 #F4B400 #AB47BC #F06292 #AB47BC #795548 #FF7043 #C2185B".split(" "), xn="#4285F4 #C53929 #F7CB4D #0B8043 #5E35B1 #80DEEA #FF7043 #C0CA33".split(" "),yn={"alignment-baseline":"middle",fill:"#444444","font-size":18,"font-style":"normal","text-anchor":"middle",x:0,y:0};class zn extends am{} function An(b){const d=-b.camera.position.x*b.scale,f=b.camera.position.y*b.scale;b.cellBackgroundSVGRoot.attr("transform",`translate(${d},${f}) scale(${b.scale},${-b.scale})`);b.labelsAndAxesSVGRoot.attr("transform",`translate(${d},${f}) scale(${b.scale},${-b.scale})`);b.labelsAndAxesSVGRoot.selectAll(".unscale").attr("transform",`scale(${1/b.scale})`);b.axesLayer.selectAll(".axis").select("path").attr("d",h=>h.path(b.scale)).attr("stroke-width",()=>1.2/b.scale)} function Bn(b){var d=b.labelsLayer.selectAll(".label");const f=d.filter(function(m){return(void 0===m.visible||!m.visible)&&b.isVisible(m,this)}).each(m=>m.visible=!0),h=d.filter(function(m){return(void 0===m.visible||m.visible)&&!b.isVisible(m,this)}).each(m=>m.visible=!1);f.selectAll(".opacity").transition().duration(b.elem.tweenDuration).attr("opacity",1);h.selectAll(".opacity").transition().duration(b.elem.tweenDuration).attr("opacity",0);d.filter(m=>!!m.scaleDown).selectAll(".scale").attr("transform", m=>`scale(${b.scale<m.minScale?b.scale/m.minScale:1})`);d=b.axesLayer.selectAll(".axis").each(function(m){m.visible=b.isVisible(m,this)});d.filter(m=>!!m.visible).select("path").transition().duration(b.elem.tweenDuration).attr("stroke-opacity",1);d.filter(m=>!m.visible).select("path").transition().duration(b.elem.tweenDuration).attr("stroke-opacity",0)} function Cn(b){b.renderQueued||(b.renderQueued=!0,requestAnimationFrame(()=>{if(b.renderQueued){b.renderQueued=!1;var d=Date.now();b.endTimestamp>d&&Cn(b);if(b.spriteMesh&&(b.spriteMesh.time=d,81>+THREE.REVISION&&b.spriteMesh.onBeforeRender))b.spriteMesh.onBeforeRender();b.renderer&&b.renderer.render(b.scene,b.camera);if(b.spriteMesh&&b.spriteMesh.spriteAtlas&&(d=b.spriteMesh.spriteAtlas,!(d.drawQueue.length||0<d.pendingImageCount)))for(;d.callbackQueue.length;){const {callback:f,args:h}=d.callbackQueue.shift(); f.apply(null,h)}}}))} function Dn(b){var d=b.elem.selectedIndices.map(h=>({x:b.spriteMesh.getX(h),y:b.spriteMesh.getY(h)}));d=b.selectedLayer.selectAll(".selected").data(d);var f=d.enter().append("g").classed("selected",!0).attr("transform",h=>`translate(${.5+(h.x||0)},${.5+(h.y||0)}) scale(${3})`).style("opacity",0);f.append("rect").attr("x",-.5).attr("y",-.5).attr("width",1).attr("height",1).attr("stroke","#483d06").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke-opacity",0).attr("stroke-width", .3).attr("fill-opacity",0);f.append("rect").attr("x",-.5).attr("y",-.5).attr("width",1).attr("height",1).attr("stroke","#fad411").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke-opacity",0).attr("stroke-width",.15).attr("fill-opacity",0);f=f.merge(d);f.transition().attr("transform",h=>`translate(${.5+(h.x||0)},${.5+(h.y||0)}) scale(${.8})`).style("opacity",1);f.selectAll("rect").classed("rotate",!0).attr("stroke-opacity",1);d.exit().transition().style("opacity",0).remove()} function En(b){var d=b.elem.comparedIndices.map(h=>({x:b.spriteMesh.getX(h),y:b.spriteMesh.getY(h)}));d=b.comparedLayer.selectAll(".compared").data(d);var f=d.enter().append("g").classed("compared",!0).attr("transform",h=>`translate(${.5+(h.x||0)},${.5+(h.y||0)}) scale(${3})`).style("opacity",0);f.append("rect").attr("x",-.5).attr("y",-.5).attr("width",1).attr("height",1).attr("stroke","#44ff44").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke-opacity",0).attr("stroke-width", .3).attr("fill-opacity",0);f.append("rect").attr("x",-.5).attr("y",-.5).attr("width",1).attr("height",1).attr("stroke","#1d6b1d").attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("stroke-opacity",0).attr("stroke-width",.15).attr("fill-opacity",0);f=f.merge(d);f.transition().attr("transform",h=>`translate(${.5+(h.x||0)},${.5+(h.y||0)}) scale(${.8})`).style("opacity",1);f.selectAll("rect").classed("rotate",!0).attr("stroke-opacity",1);d.exit().transition().style("opacity",0).remove()} function Fn(b,d){b.elem.verticalFacet in b.stats&&vm(b.grid,b.grid.horizontalKeys[b.grid.horizontalKeys.length-1]).forEach(f=>{const h=b.verticalFacetInfo.labelingFunction(f.verticalKey),m=new zn;m.text=h.label;m.x=f.x+f.width;m.y=f.contentY+f.innerHeight/2;m.side=Zl.Right;m.cell=f;m.attributes={"alignment-baseline":"middle",fill:"#666666","font-size":yn["font-size"],"text-anchor":"start","font-style":h.special?"italic":"normal"};m.offsetPosition={x:8};m.minScale=yn["font-size"]/(f.height+b.grid.cellMargin); m.scaleDown=!0;d.push(m)})} function Gn(b,d){b.elem.horizontalFacet in b.stats&&um(b.grid,b.grid.verticalKeys[b.grid.verticalKeys.length-1]).forEach(f=>{const h=b.horizontalFacetInfo.labelingFunction(f.horizontalKey),m=new zn;m.text=h.label;m.x=f.contentX+f.innerWidth/2;m.y=f.y+f.height;m.side=Zl.Top;m.cell=f;m.rotate=-45;m.attributes={"alignment-baseline":"ideographic",fill:"#dd6622","font-size":yn["font-size"],"text-anchor":"start","font-style":h.special?"italic":"normal"};m.offsetPosition={x:8,y:-8};m.minScale=yn["font-size"]/ (f.width+b.grid.cellMargin/2);m.scaleDown=!0;d.push(m)})}function Hn(b,d=3){if(null===b)return"null";b=parseFloat(b.toPrecision(d));return 1E3<=Math.abs(b)?d3.format(`.${d}s`)(b):`${b}`} function dp(b,d){if("scatter"===b.elem.positionMode&&b.elem.verticalPosition in b.stats){var f=b.stats[b.elem.verticalPosition],[h,m]=d3.scaleLinear().domain([f.numberMin,f.numberMax]).nice().domain(),w=Hn(h),l=Hn(m),p=(w.length+3)/(w.length+l.length+6);qm(b.grid,n=>{if(n.items.length){for(var q=n.siblings.left;!(!q||q.items.length||q.siblings.above&&q.siblings.above.items.length);)q=q.siblings.left;q=q?q.contentX+q.innerWidth:-Infinity;var t=n.x+8,v=n.contentY,z=n.contentY+n.innerHeight,y=new zn; y.id=`${n.compoundKey}-left-start`;y.text=w;y.x=n.x+8;y.y=n.y+(b.elem.horizontalPosition?8:0);y.side=Zl.Left;y.cell=n;y.rotate=-90;y.attributes={"alignment-baseline":"ideographic",fill:"#2255aa","font-size":16,"text-anchor":"start"};y.offsetPosition={x:rn.bottom,y:-rn.right};y.boundingBox={bottom:v,left:q,right:t,top:v+n.innerHeight*(Math.max(p,.1)-.05)};y.elementMargin=rn;d.push(y);y=new zn;y.id=`${n.compoundKey}-left-end`;y.text=l;y.x=n.x+8;y.y=n.y+n.height;y.side=Zl.Left;y.cell=n;y.rotate=-90; y.attributes={"alignment-baseline":"ideographic",fill:"#2255aa","font-size":16,"text-anchor":"end"};y.offsetPosition={x:-rn.top,y:-rn.right};y.boundingBox={bottom:v+n.innerHeight*(Math.min(p,.9)+.05),left:q,right:t,top:z};y.elementMargin=rn;d.push(y)}})}} function ep(b,d){if("scatter"===b.elem.positionMode&&b.elem.horizontalPosition in b.stats){var f=b.stats[b.elem.horizontalPosition],[h,m]=d3.scaleLinear().domain([f.numberMin,f.numberMax]).nice().domain(),w=Hn(h),l=Hn(m),p=(w.length+3)/(w.length+l.length+6);qm(b.grid,n=>{if(n.items.length){for(var q=n.siblings.below;!(!q||q.items.length||q.siblings.right&&q.siblings.right.items.length);)q=q.siblings.below;q=q?q.contentY+q.innerHeight:-Infinity;var t=n.contentY,v=n.contentX,z=v+n.innerWidth,y=new zn; y.id=`${n.compoundKey}-bottom-start`;y.text=w;y.x=n.x+(b.elem.verticalPosition?8:0);y.y=n.y+8;y.side=Zl.Bottom;y.cell=n;y.attributes={"alignment-baseline":"hanging",fill:"#118844","font-size":16,"text-anchor":"start"};y.offsetPosition={x:rn.left,y:rn.top};y.boundingBox={bottom:q,left:v,right:v+n.innerWidth*(Math.max(p,.1)-.05),top:t};y.elementMargin=rn;d.push(y);y=new zn;y.id=`${n.compoundKey}-bottom-end`;y.text=l;y.x=n.x+n.width;y.y=n.y+8;y.side=Zl.Bottom;y.cell=n;y.attributes={"alignment-baseline":"hanging", fill:"#118844","font-size":16,"text-anchor":"end"};y.offsetPosition={x:-rn.right,y:rn.top};y.boundingBox={bottom:q,left:v+n.innerWidth*(Math.min(p,.9)+.05),right:z,top:t};y.elementMargin=rn;d.push(y)}})}}function fp(b){const d=[];Fn(b,d);Gn(b,d);dp(b,d);ep(b,d);return d} function gp(b){var d=tm(b.grid).filter(f=>f.items.length);d=b.cellBackgroundLayer.selectAll(".cell").data(d,f=>f.compoundKey);d.enter().append("rect").attr("class","cell").attr("x",f=>f.contentX||0).attr("y",f=>f.contentY||0).attr("width",f=>f.innerWidth||0).attr("height",f=>f.innerHeight||0).attr("fill","#f8f8f9").attr("fill-opacity",0).merge(d).transition().duration(b.elem.tweenDuration).attr("x",f=>f.contentX||0).attr("y",f=>f.contentY||0).attr("width",f=>f.innerWidth||0).attr("height",f=>f.innerHeight|| 0).attr("fill-opacity",1);d.exit().transition().duration(b.elem.tweenDuration).remove().attr("fill-opacity",0)} function hp(b){const d=[];"stacked"!==b.elem.positionMode&&qm(b.grid,m=>{if(m.items.length){if(b.elem.verticalPosition){const w=new xm(Zl.Left,m);d.push(w)}b.elem.horizontalPosition&&(m=new xm(Zl.Bottom,m),d.push(m))}});const f=b.axesLayer.selectAll(".axis").data(d,m=>m.key()),h=f.enter().append("g").attr("class","axis").attr("opacity",0);h.append("path").attr("d",m=>m.path(b.scale)).attr("stroke",m=>m.side===Zl.Left?"#2255aa":"#118844").attr("stroke-width",()=>1.2/b.scale).attr("stroke-opacity", 0).attr("fill","none");h.merge(f).transition().duration(b.elem.tweenDuration).attr("opacity",1);h.merge(f).select("path").transition().duration(b.elem.tweenDuration).attr("d",m=>m.path(b.scale));f.exit().transition().duration(b.elem.tweenDuration).remove().attr("opacity",0)} function ip(b){if(b.scale){b.labels=fp(b);var d=b.labelsLayer.selectAll(".label").data(b.labels,l=>l.id||`${l.side}-${l.text}`);d.each(function(l){const p=d3.select(this),n=p.select(".current");l.text!==n.text()&&(n.attr("fill-opacity",0),p.select(".old").attr("fill-opacity",1).text(n.text()))}).select(".current").text(l=>l.text);var f=l=>p=>void 0===p.attributes||void 0===p.attributes[l]?yn[l]:p.attributes[l],h=d.enter().append("g").attr("class","label").attr("transform",l=>`translate(${l.x},${l.y})`), m=h.append("g").attr("class","flip").attr("transform","scale(1,-1)").append("g").attr("class","rotate").attr("transform",l=>"rotate("+("rotate"in l?l.rotate:0)+")").append("g").attr("class","unscale").attr("transform",`scale(${1/b.scale})`).append("g").attr("class","position").append("g").attr("class","opacity scale"),w=m.append("text").attr("class","old").attr("fill-opacity",0);m=m.append("text").attr("class","current").attr("fill-opacity",0).text(l=>l.text);for(const l in yn)yn.hasOwnProperty(l)&& (w.attr(l,f(l)),m.attr(l,f(l)));w=h.merge(d).transition().duration(b.elem.tweenDuration).attr("transform",l=>`translate(${l.x},${l.y})`);w.select(".rotate").attr("transform",l=>"rotate("+("rotate"in l?l.rotate:0)+")");w.filter(l=>!!l.offsetPosition).select(".position").attr("transform",l=>`translate(${l.offsetPosition.x||0},${l.offsetPosition.y||0})`);h=w.select(".old").attr("fill-opacity",0);w=w.select(".current").attr("fill-opacity",1);for(const l in yn)yn.hasOwnProperty(l)&&(h.attr(l,f(l)),w.attr(l, f(l)));d.exit().transition().duration(b.elem.tweenDuration).remove().select(".current").attr("fill-opacity",0)}} function jp(b){const d=b.elem.getBoundingClientRect();d.width&&d.height?(b.labelsAndAxesSVG.attr("width",d.width).attr("height",d.height),b.cellBackgroundSVG.attr("width",d.width).attr("height",d.height),b.renderer&&b.renderer.setSize(d.width,d.height),b.camera.right=d.width/b.scale,b.camera.bottom=-d.height/b.scale,b.camera.updateProjectionMatrix(),Cn(b)):requestAnimationFrame(()=>jp(b))} function kp(b){b.spriteMesh&&(b.scene.remove(b.spriteMesh),Lm(b.spriteMesh.spriteAtlas),delete b.spriteMesh);const d=b.elem.data,f=d.length;var h=b.elem.spriteImageWidth,m=b.elem.spriteImageHeight;const w=h/m;b.spriteMesh=new hn(f,h,m);b.scene.add(b.spriteMesh);b.spriteMesh.spriteAtlas.onDrawFinished=()=>Cn(b);b.items=[];h=Math.ceil(Math.sqrt(f));m=Math.ceil(f/h);for(let l=0;l<f;l++){const p=fn(b.spriteMesh);p.x=h/2;p.y=m/2;p.opacity=0;p.timestamp=Date.now();p.rebase(p.timestamp);b.items.push({sprite:p, data:d[l]})}b.grid=new wm(b.items);b.grid.cellMargin=1;b.grid.itemAspectRatio=w;b.grid.itemPositionSetter=(l,p,n)=>{const q=Date.now();l.sprite.rebase(q);l.sprite.x=p;l.sprite.y=n;l.sprite.opacity=1;l.sprite.timestamp=q+b.elem.tweenDuration;lp(b,l.sprite.timestamp)}} function mp(b){if(!b.ignoreChange&&b.grid){np(b);var d=b.elem.imageFieldName;if(d in b.stats){var f=b.grid.items;for(let h=0;h<f.length;h++){const {sprite:m,data:w}=f[h];m.setSpriteImageData({type:"text",data:tn(w[d]).label},()=>{const l=Date.now();m.baseTextureTimestamp=l;m.baseTextureIndex=0;m.textureTimestamp=l+b.elem.tweenDuration;m.textureIndex=1;lp(b,m.textureTimestamp)})}}else delete b.lastAtlasUrl,op(b)}} function pp(b){if(b.grid){qp(b);var d=b.verticalFacetInfo=rp(b,b.elem.verticalFacet,b.elem.verticalBuckets,b.elem.verticalBagOfWords,!0);b.grid.verticalFacet=d.facetingFunction;b.grid.verticalKeyCompare=d.keyCompareFunction;d=b.horizontalFacetInfo=rp(b,b.elem.horizontalFacet,b.elem.horizontalBuckets,b.elem.horizontalBagOfWords,!1);b.grid.horizontalFacet=d.facetingFunction;b.grid.horizontalKeyCompare=d.keyCompareFunction;b.elem.fitGridAspectRatioToViewport?(d=b.elem.getBoundingClientRect(),b.grid.targetGridAspectRatio= d&&d.width&&d.height?d.width/d.height||1:1):b.grid.targetGridAspectRatio=1;sm(b.grid);gp(b);hp(b);ip(b);Dn(b);En(b);b.fitToViewport()}} function sp(b){if(b.grid){qp(b);var d=b.grid.cellPadding,f=im.Tight,h=im.Uniform,m=!1;if("stacked"===b.elem.positionMode)m=b.grid.verticalGridAlignment!==f||b.grid.horizontalGridAlignment!==f,b.grid.verticalGridAlignment=f,b.grid.horizontalGridAlignment=f,b.grid.cellPadding.top=0,b.grid.cellPadding.left=0,b.grid.cellPadding.right=0,b.grid.cellPadding.bottom=0,b.grid.minCellAspectRatio=0,b.grid.maxCellAspectRatio=Infinity;else{b.elem.verticalPosition?(m=b.grid.verticalGridAlignment!==h,b.grid.verticalGridAlignment= h):(m=b.grid.verticalGridAlignment!==f,b.grid.verticalGridAlignment=f);b.elem.horizontalPosition?(m=m||b.grid.horizontalGridAlignment!==h,b.grid.horizontalGridAlignment=h):(m=m||b.grid.horizontalGridAlignment!==f,b.grid.horizontalGridAlignment=f);const w=tp(b,b.elem.horizontalPosition)||em,l=tp(b,b.elem.verticalPosition)||fm;b.grid.computeItemPosition=(p,n,q,t)=>({x:w(p,n,q,t),y:l(p,n,q,t)});f=b.elem.verticalPosition?8:0;h=b.elem.horizontalPosition?8:0;m=m||0!==d.top||f!==d.left||0!==d.right||h!== d.bottom;b.grid.cellPadding.top=0;b.grid.cellPadding.right=0;b.grid.cellPadding.left=f;b.grid.cellPadding.bottom=h;b.grid.minCellAspectRatio=1;b.grid.maxCellAspectRatio=2}m?(sm(b.grid),gp(b)):rm(b.grid);hp(b);ip(b);Dn(b);En(b);b.fitToViewport()}} function up(b){if(b.grid){var d=b.elem.colorBy;if(d in b.stats){d=b.stats[d];var f=vp(b);d=d.uniqueCount>f.length&&nn(d)?wp(b):xp(b,f);f=b.grid.items;var h=Date.now(),m=h+b.elem.tweenDuration;for(var w=0;w<f.length;w++){const l=f[w],p=d[w];l.sprite.rebase(h);l.sprite.r=p.r;l.sprite.g=p.g;l.sprite.b=p.b;l.sprite.a=180;l.sprite.timestamp=m}lp(b,m);yp(b)}else{d=b.grid.items;f=Date.now();h=f+b.elem.tweenDuration;for(m=0;m<d.length;m++)w=d[m],w.sprite.rebase(f),w.sprite.r=0,w.sprite.g=0,w.sprite.b=0,w.sprite.a= 0,w.sprite.timestamp=h;lp(b,h);b.elem.set("palette",[]);b.grid.cellItemComparator&&(b.grid.cellItemComparator=null,yp(b))}}}function lp(b,d){b.endTimestamp=Math.max(b.endTimestamp,d);Cn(b)}function op(b){b.atlasUrlChangeTimer&&clearTimeout(b.atlasUrlChangeTimer);b.atlasUrlChangeTimer=setTimeout(()=>{b.atlasUrlChangeTimer&&b.atlasUrlChange()},100)} function np(b){const d=b.grid.items;Lm(b.spriteMesh.spriteAtlas);const f=Date.now(),h=f+b.elem.fadeDuration;for(let m=0;m<d.length;m++){const w=d[m];0<w.sprite.textureIndex&&w.sprite.switchTextures(f,h)}lp(b,h)}function qp(b){"stacked"===b.elem.positionMode&&(b.grid.computeItemPosition=gm(b.elem.verticalFacet?"middle":"bottom",b.elem.horizontalFacet?"middle":"right"))} function rp(b,d,f,h,m){if(!(d in b.stats)||isNaN(+f)||1>+f)return{facetingFunction:()=>"",keyCompareFunction:()=>0,labelingFunction:tn};const w=b.stats[d];if(w.wordTree&&1<w.wordTree.highestLevel&&h)return zp(b,d,f,m);if(w.uniqueCount<=f)return{facetingFunction:p=>d in p.data?p.data[d]:null,keyCompareFunction:nn(w)?dm:m?cm:bm,labelingFunction:tn};if(nn(w)&&w.numberMax!==w.numberMin)return Ap(b,d,f);b=Object.keys(w.valueHash);b.sort((p,n)=>w.valueHash[n].count-w.valueHash[p].count);const l=b.slice(0, f).reduce((p,n)=>{p[n]=!0;return p},{});return{facetingFunction:p=>{if(!(d in p.data))return null;p=p.data[d];return kn(p)in l?p:"\ufffcOTHER\ufffc"},keyCompareFunction:m?cm:bm,labelingFunction:tn}}function tp(b,d){b=b.stats[d];if(!b||!nn(b))return null;const f=d3.scaleLinear().domain([b.numberMin,b.numberMax]).nice();return h=>f(h.data[d])}function vp(b){switch(b.elem.paletteChoice){case "warm":return wn;case "cool":return vn;case "assist":return xn;default:return un}} function wp(b){const d=b.elem.colorBy,f=b.stats[d];var h=b.grid.items,m=d3.rgb("#A52714"),w=d3.scaleLinear();w.domain([f.numberMin,f.numberMax]).range(["white","#1C3AA9"]).nice();const l=[];for(var p=0;p<h.length;p++){var n=h[p];n=d in n.data?n.data[d]:NaN;n="number"!==typeof n||isNaN(n)?m:d3.rgb(w(n));l.push(n)}h=rp(b,d,5,!1,!1).labelingFunction;m=d3.scaleLinear();m.domain([0,4]).range(["white","#1C3AA9"]);w=[];for(p=4;0<=p;p--)n=h(p),w.push({key:p,color:m(p),content:n});(f.otherCount||f.stringCount|| f.totalCount<b.grid.items.length)&&w.push({key:NaN,color:"#A52714",content:{label:"missing",special:!0}});b.elem.set("palette",w);b.grid.cellItemComparator=(q,t)=>{if(!(d in q.data||d in t.data))return 0;if(!(d in q.data))return-1;if(!(d in t.data))return 1;q=q.data[d];t=t.data[d];if(q===t)return 0;const v="number"!==typeof q||isNaN(q),z="number"!==typeof t||isNaN(t);return v&&z?0:v?-1:z?1:q-t};return l} function xp(b,d){const f=b.elem.colorBy,h=b.stats[f],m=b.grid.items,w=Object.keys(h.valueHash);b.elem.stableColors?w.sort():w.sort((z,y)=>h.valueHash[y].count-h.valueHash[z].count);const l=Math.min(d.length,w.length),p=w.slice(0,l).reduce((z,y,x)=>{z[y]=x;return z},{}),n=d3.rgb("#F0F0F0"),q=d.map(z=>d3.rgb(z));let t=!1;const v=[];for(let z=0;z<m.length;z++){const y=kn(m[z].data[f]);t=t||!(y in p);v.push(q[p[y]]||n)}d=d.slice(0,l).map((z,y)=>{y=h.valueHash[w[y]].value;return{key:y,color:z,content:{label:y+ "",special:"number"!==typeof y&&"string"!==typeof y||y in sn}}});t&&d.push({key:null,color:"#F0F0F0",content:{label:"other",special:!0}});b.elem.set("palette",d);b.grid.cellItemComparator=(z,y)=>{if(!(f in z.data||f in y.data))return 0;if(!(f in z.data))return 1;if(!(f in y.data))return-1;z=z.data[f];y=y.data[f];if(z===y)return 0;z=kn(z);y=kn(y);return z in p||y in p?z in p?y in p?p[z]-p[y]:-1:1:0};return v} function yp(b){"stacked"!==b.elem.positionMode&&b.elem.verticalPosition&&b.elem.horizontalPosition||sp(b)} function zp(b,d,f,h){const m=b.stats[d].wordTree,w=m.levelHash;return{facetingFunction:l=>{if(!(d in l.data))return null;for(l=m.nodeHash[kn(l.data[d])];l.parent&&l.level>f;)l=l.parent;return l.level},keyCompareFunction:(l,p)=>{l=w[l];p=w[p];if(void 0===l&&void 0===p)return 0;if(void 0===l)return-1;if(void 0===p)return 1;if(l.nonValueCount&&p.nonValueCount)return 0;if(l.nonValueCount)return-1;if(p.nonValueCount)return 1;p=p.order-l.order;return h?p:-p},labelingFunction:l=>{l=w[+l];if(!l.parent&&!l.commonWords.length)return{label:"other", special:!0};if(l.nonValueCount)return{label:"non-words",special:!0};let p=` ${"\u2022"} ${l.commonWords.join(" ")}`;for(let n=0;n<l.children.length;n++)if(l.children[n].level>f){p+=" \u2026";break}for(;l.parent;)l=l.parent,l.commonWords.length&&(p=` ${"\u2022"} ${l.commonWords.join(" ")} `+p);return{label:p}}}} function Ap(b,d,f){const h=b.stats[d],[m,w]=d3.scaleLinear().domain([h.numberMin,h.numberMax]).nice().domain(),l=w-m;let p=1;for(b=0;b<f;b++){var n=b;const q=n/f*l+m;n=(1+n)/f*l+m;q!==n&&(p=Math.max(p,Bp(q,n,p)))}return{facetingFunction:q=>{if(!(d in q.data))return null;q=q.data[d];return"number"!==typeof q?q:isNaN(q)?q:Math.min(Math.floor(f*(q-m)/l),f-1)},keyCompareFunction:dm,labelingFunction:q=>{if("number"!==typeof q||isNaN(+q))return tn(q);const t=q/f*l+m;q=(1+q)/f*l+m;return h.isInteger()?{label:Cp(Math.ceil(t), Math.floor(q),p)}:{label:Cp(t,q,p)}}}}function Bp(b,d,f=1){for(;100>=f&&b.toPrecision(f)===d.toPrecision(f);)f++;return f}function Cp(b,d,f=3){if(b===d)return Hn(b,f);f=Bp(b,d,f);return`${Hn(b,f)} \u2014 ${Hn(d,f)}`} class Dp{constructor(b){this.elem=b;this.endTimestamp=0;this.renderQueued=!1;this.labels=[];this.autoColorBy=!1;this.horizontalFacetInfo=this.verticalFacetInfo=null}ready(){this.layout=new Cm;this.holder=this.elem.$.holder;this.elem.scopeSubtree(this.holder,!0);this.cellBackgroundSVG=d3.select(this.holder).append("svg").style("left",0).style("position","absolute").style("top",0);this.cellBackgroundSVGRoot=this.cellBackgroundSVG.append("g").attr("class","root");this.cellBackgroundLayer=this.cellBackgroundSVGRoot.append("g").attr("class", "labels");this.scene=new THREE.Scene;this.camera=new THREE.OrthographicCamera(0,100,0,100,.1,1E3);try{this.renderer=new THREE.WebGLRenderer({alpha:!0}),this.renderer.setPixelRatio(),d3.select(this.renderer.domElement).style("left",0).style("pointer-events","none").style("position","absolute").style("top",0),this.holder.appendChild(this.renderer.domElement)}catch(b){}this.zoom=d3.zoom().scaleExtent([1,500]).on("zoom",this.zoomed.bind(this));d3.select(this.elem).call(this.zoom);this.labelsAndAxesSVG= d3.select(this.holder).append("svg").style("left",0).style("position","absolute").style("top",0);this.labelsAndAxesSVGRoot=this.labelsAndAxesSVG.append("g").attr("class","root");this.labelsLayer=this.labelsAndAxesSVGRoot.append("g").attr("class","labels");this.axesLayer=this.labelsAndAxesSVGRoot.append("g").attr("class","axes");this.comparedLayer=this.labelsAndAxesSVGRoot.append("g").attr("class","comparedboxes");this.selectedLayer=this.labelsAndAxesSVGRoot.append("g").attr("class","selectedboxes"); this.labelsAndAxesSVG.on("click",this.clicked.bind(this));this.renderer||(this.labelsAndAxesSVG.style("display","none"),this.cellBackgroundSVG.style("display","none"),d3.select(this.holder).append("p").attr("class","error").style("color","darkred").html('\n \x3cstrong\x3eERROR\x3c/strong\x3e: Facets Dive requires WebGL, and it is not\n enabled in your browser. See\n \x3ca rel\x3d"noreferrer" href\x3d"http://webglreport.com/"\x3e\n WebGL Report\x3c/a\x3e for details.\n '))}zoomed(){const {x:b, y:d,k:f}=d3.event.transform,h=this.scale/f;this.camera.top*=h;this.camera.left*=h;this.camera.right*=h;this.camera.bottom*=h;this.camera.position.set(-b/f,d/f,this.camera.position.z);this.camera.updateProjectionMatrix();this.scale=f;An(this);Bn(this);Cn(this)}clicked(){var b=this.elem.getBoundingClientRect(),d=d3.event;b=gn(this.spriteMesh,this.camera.position.x+(d.clientX-b.left)/this.scale,this.camera.position.y-(d.clientY-b.top)/this.scale);var f={};if(d.ctrlKey)for(d=0;d<this.elem.selectedIndices.length;d++)f[this.elem.selectedIndices[d]]= !0;for(d=0;d<b.length;d++)f[b[d]]=!0;this.elem.set("selectedIndices",Array.from(Object.keys(f).map(h=>+h)));b=[];for(f=0;f<this.elem.selectedIndices.length;f++)b.push(this.elem.data[this.elem.selectedIndices[f]]);this.elem.set("selectedData",b)}fitToViewport(){const b=this.elem.getBoundingClientRect();if(b.width&&b.height){this.layout.viewport.width=b.width;this.layout.viewport.height=b.height;this.layout.padding.bottom=this.elem.scenePadding;this.layout.padding.left=this.elem.scenePadding;this.layout.padding.right= this.elem.scenePadding;this.layout.padding.top=this.elem.scenePadding;this.layout.grid={bottom:0,left:0,right:this.grid.width,top:this.grid.height};if(this.labels.length){var d=0,f=0,h=0,m=0;this.labelsLayer.selectAll(".label").each(function(p){var n=d3.select(this).select(".current").node().getBoundingClientRect();const q=p.elementMargin||{bottom:0,left:0,right:0,top:0},t=n.height+q.top+q.bottom;n=n.width+q.left+q.right;switch(p.side){case Zl.Bottom:d=Math.max(d,t);break;case Zl.Top:m=Math.max(m, t);break;case Zl.Left:f=Math.max(f,n);break;case Zl.Right:h=Math.max(h,n);break;default:throw Error("Unrecognized Side.");}});this.layout.padding.bottom+=d;this.layout.padding.left+=f;this.layout.padding.right+=h;this.layout.padding.top+=m}Am(this.layout,b.width);Bm(this.layout,b.height);this.scale=ym(this.layout);var {position:w,frustum:l}=zm(this.layout);this.camera.left=l.left;this.camera.right=l.right;this.camera.top=l.top;this.camera.bottom=l.bottom;this.camera.position.set(w.x,w.y,100);this.camera.updateProjectionMatrix(); d3.select(this.elem).call(this.zoom.transform,d3.zoomIdentity.scale(this.scale).translate(-this.camera.position.x,this.camera.position.y));An(this);Bn(this);Cn(this)}else setTimeout(()=>this.fitToViewport(),100)}zoomIn(){this.zoom.scaleBy(d3.select(this.elem),1.1)}zoomOut(){this.zoom.scaleBy(d3.select(this.elem),1/1.1)}isVisible(b,d){var f=this.scale;var h=this.camera.position,m=this.camera;if(void 0!==b.minScale)f=b.scaleDown||f>=b.minScale;else if(b.boundingBox){var w=b.boundingBox;w.left>h.x+m.right|| w.right<h.x+m.left||w.bottom>h.y+m.top||w.top<h.y+m.bottom?f=!1:(m=b.elementMargin||{bottom:0,left:0,right:0,top:0},h=void 0===b.width?d.getBoundingClientRect().width+m.left+m.right:b.width,b=void 0===b.height?d.getBoundingClientRect().height+m.top+m.bottom:b.height,d=isFinite(w.top)&&isFinite(w.bottom)?w.top-w.bottom:Infinity,f=(isFinite(w.left)&&isFinite(w.right)?w.right-w.left:Infinity)*f>=h&&d*f>=b)}else f=!0;return f}atlasUrlChange(){clearTimeout(this.atlasUrlChangeTimer);delete this.atlasUrlChangeTimer; if(this.spriteMesh){var b=this.elem.atlasUrl;b&&b.length&&b!==this.lastAtlasUrl&&(this.lastAtlasUrl=b,np(this),Om(this.spriteMesh.spriteAtlas,b,this.elem.crossOrigin,()=>{const d=this.elem.data,f=Date.now(),h=f+this.elem.fadeDuration;for(let m=0;d&&m<d.length;m++)this.spriteMesh.switchTextures(m,f,h);lp(this,h);this.ignoreChange=!0;this.elem.set("imageFieldName","");delete this.ignoreChange;this.autoColorBy&&(this.autoColorBy=!1,this.elem.set("colorBy",""))}))}else requestAnimationFrame(this.atlasUrlChange.bind(this))}spriteUrlChange(){const b= this.elem.spriteUrl;if(b)if(this.spriteMesh){const d=new Image;void 0!==this.elem.crossOrigin&&(d.crossOrigin=this.elem.crossOrigin);d.onload=()=>{const f=this.spriteMesh.defaultTextureCanvas,h=f.getContext("2d");h.clearRect(0,0,f.width,f.height);h.drawImage(d,0,0,f.width,f.height);this.spriteMesh.defaultTexture.needsUpdate=!0;Cn(this)};d.src=b}else requestAnimationFrame(this.spriteUrlChange.bind(this))}getKeys(){var b;if((b=this.elem.data)&&b.length){var d={};for(let f=0;f<b.length;f++)if(b[f]){const h= Object.keys(b[f]);for(let m=0;m<h.length;m++)d[h[m]]=!0}b=Object.keys(d)}else b=[];return b.sort()}} Polymer({is:"facets-dive-vis",behaviors:[Polymer.IronResizableBehavior],properties:{data:{type:Array,value:null,observer:"_dataChange"},filteredDataIndices:{type:Array,value:null,observer:"_filteredDataIndicesChange"},atlasUrl:{type:String,value:null,observer:"_queueAtlasUrlChange"},spriteUrl:{type:String,value:null,observer:"_spriteUrlChange"},crossOrigin:{type:String,value:null},keys:{type:Array,value:[],notify:!0,readOnly:!0},stats:{type:Object,value:{},notify:!0,readOnly:!0},scenePadding:{type:Number, value:8},tweenDuration:{type:Number,value:600},fadeDuration:{type:Number,value:200},spriteImageWidth:{type:Number,value:64},spriteImageHeight:{type:Number,value:64},gridFacetingVerticalLabelColor:{type:String,value:"#666666"},gridFacetingHorizontalLabelColor:{type:String,value:"#dd6622"},itemPositioningVerticalLabelColor:{type:String,value:"#2255aa"},itemPositioningHorizontalLabelColor:{type:String,value:"#118844"},fitGridAspectRatioToViewport:{type:Boolean,value:!1},verticalFacet:{type:String,value:"", observer:"_updateGridFaceting"},verticalBuckets:{type:Number,value:10,observer:"_updateGridFaceting"},verticalBagOfWords:{type:Boolean,value:!1,observer:"_updateGridFaceting"},horizontalFacet:{type:String,value:"",observer:"_updateGridFaceting"},horizontalBuckets:{type:Number,value:10,observer:"_updateGridFaceting"},horizontalBagOfWords:{type:Boolean,value:!1,observer:"_updateGridFaceting"},positionMode:{type:String,value:"",observer:"_updateGridItemPositions"},verticalPosition:{type:String,value:"", observer:"_updateGridItemPositions"},horizontalPosition:{type:String,value:"",observer:"_updateGridItemPositions"},colorBy:{type:String,value:"",observer:"_updateColors",notify:!0},imageFieldName:{type:String,value:"",observer:"_updateImageFieldName",notify:!0},palette:{type:Array,value:[],notify:!0},paletteChoice:{type:String,value:"standard",observer:"_updateColors"},selectedData:{type:Array,value:[],notify:!0},selectedIndices:{type:Array,value:[],notify:!0,observer:"_selectedIndicesUpdated"},comparedData:{type:Array, value:[],notify:!0},comparedIndices:{type:Array,value:[],notify:!0,observer:"_comparedIndicesUpdated"},stableColors:{type:Boolean,value:!1,observer:"_updateColors"}},listeners:{"iron-resize":"_onIronResize"},created(){this._backing=new Dp(this)},ready(){this._backing.ready()},_dataChange(b){if(this._backing.scene){b=this._backing;var d=b.elem.data;if(d&&d.length){jp(b);b.stats=pn(d);if(b.items)if(b.items.length!==d.length)kp(b),mp(b);else for(var f=0;f<d.length;f++)b.items[f].data=d[f];else{kp(b); d=null;var h=Infinity;for(var m in b.stats)if(b.stats.hasOwnProperty(m)){const w=b.stats[m],l=Math.abs(w.uniqueCount-un.length);1<w.uniqueCount&&l<h&&(d=m,h=l)}isFinite(h)&&d in b.stats&&(b.autoColorBy=!0,b.elem.set("colorBy",d));m="";d=-Infinity;for(f in b.stats)b.stats.hasOwnProperty(f)&&(h=b.stats[f],h=h.stringCount+h.stringLengthsCount-h.totalCount,h>d&&(m=f,d=h));isFinite(d)&&m in b.stats&&b.elem.set("imageFieldName",m)}pp(b);sp(b);up(b)}this._setKeys(this._backing.getKeys());this._setStats(this._backing.stats)}else requestAnimationFrame(this._dataChange.bind(this, b))},_filteredDataIndicesChange(b){if(this._backing.scene&&this._backing.items){{b=this._backing;const h=b.elem.filteredDataIndices,m=[];if(h)for(var d=0;d<h.length;d++){var f=h[d];f<b.items.length&&(m[f]=!0)}d=[];f=[];const w=Date.now(),l=w+b.elem.tweenDuration;for(let p=0;p<b.items.length;p++){const n=b.items[p];!h||m[p]?(d.push(n.data),f.push(n),n.sprite.opacity||(n.sprite.rebase(w),n.sprite.timestamp=l,n.sprite.opacity=1)):0<n.sprite.opacity&&(n.sprite.rebase(w),n.sprite.timestamp=l,n.sprite.opacity= 0)}lp(b,l);b.stats=pn(d);b.grid.items=f;pp(b);sp(b)}this._setKeys(this._backing.getKeys());this._setStats(this._backing.stats)}else requestAnimationFrame(this._filteredDataIndicesChange.bind(this,b))},_queueAtlasUrlChange(){op(this._backing)},_spriteUrlChange(){this._backing.spriteUrlChange()},_updateGridFaceting(){pp(this._backing)},_updateGridItemPositions(){sp(this._backing)},_updateColors(){up(this._backing)},_updateImageFieldName(){mp(this._backing)},_onIronResize(){jp(this._backing)},_selectedIndicesUpdated(){var b= this._backing;b.spriteMesh&&Dn(b)},_comparedIndicesUpdated(){var b=this._backing;if(b.spriteMesh){var d=[];for(let f=0;f<b.elem.comparedIndices.length;f++)d.push(b.elem.data[b.elem.comparedIndices[f]]);b.elem.set("comparedData",d);En(b)}},fitToViewport(){this._backing.fitToViewport()},zoomIn(){this._backing.zoomIn()},zoomOut(){this._backing.zoomOut()}}); </script> <dom-module id="facets-dive-controls"> <template> <style> :host { @apply --paper-font-common-base; display: flex; overflow: visible; } .main-controls { position: absolute; top: 0; bottom: 0; left: 0; right: 60px; display: flex; height: 100%; overflow: visible; } .overflow-holder { position: absolute; top: 0; bottom: 0; width: 60px; right: 0; overflow: visible; } #overflowmenu { margin: 0 40px; } .overflow-div { display: flex; flex-direction: column; } .overflow-checkbox { margin: 8px 0; padding } .dropdown-holder { display: flex; width: 150px; margin: 0 10px; } .dropdown-trigger { margin-top: 10px; } .expand-button { color: #9b9b9b; --paper-icon-button-ink-color: #9b9b9b; } paper-menu paper-checkbox { display: block; font-weight: normal; font-size: 12.5px; text-align: center; } paper-item { padding: 0 14px; --paper-item-min-height: 36px; } paper-dropdown-menu paper-item { border-bottom: 1px solid #ccc; } #verticalFacet { --paper-input-container-input: { color: var(--grid-faceting-vertical-label-color); }; } #horizontalFacet { --paper-input-container-input: { color: var(--grid-faceting-horizontal-label-color); }; } #verticalPosition { --paper-input-container-input: { color: var(--item-positioning-vertical-label-color); }; } #horizontalPosition { --paper-input-container-input: { color: var(--item-positioning-horizontal-label-color); }; } .vertical-facet { color: var(--grid-faceting-vertical-label-color); } .horizontal-facet { color: var(--grid-faceting-horizontal-label-color); } .vertical-position { color: var(--item-positioning-vertical-label-color); } .horizontal-position { color: var(--item-positioning-horizontal-label-color); } </style> <div class="main-controls"> <div class="dropdown-holder horizontal-facet"> <paper-dropdown-menu id="horizontalFacet" label="Binning | X-Axis" class="facet-selector"> <paper-listbox class="dropdown-content" selected="{{horizontalFacet}}" attr-for-selected="value" slot="dropdown-content"> <paper-item value="">(none)</paper-item> <template is="dom-repeat" items="[[keys]]"> <paper-item value="[[item]]">[[_breakUpAndTruncate(item)]]</paper-item> </template> </paper-listbox> </paper-dropdown-menu> </div> <template is="dom-if" if="[[horizontalFacet]]"> <paper-input type="number" min="1" max="[[_maxBuckets(horizontalFacet, horizontalBagOfWords)]]" value="{{horizontalBuckets}}" label="Count"> </paper-input> </template> <div class="dropdown-holder vertical-facet"> <paper-dropdown-menu id="verticalFacet" label="Binning | Y-Axis" class="facet-selector"> <paper-listbox class="dropdown-content" selected="{{verticalFacet}}" attr-for-selected="value" slot="dropdown-content"> <paper-item value="">(none)</paper-item> <template is="dom-repeat" items="[[keys]]"> <paper-item value="[[item]]">[[_breakUpAndTruncate(item)]]</paper-item> </template> </paper-listbox> </paper-dropdown-menu> </div> <template is="dom-if" if="[[verticalFacet]]"> <paper-input type="number" min="1" max="[[_maxBuckets(verticalFacet,verticalBagOfWords)]]" value="{{verticalBuckets}}" label="Count"> </paper-input> </template> <div class="dropdown-holder"> <paper-dropdown-menu id="colorBy" label="Color By"> <paper-listbox class="dropdown-content" selected="{{colorBy}}" attr-for-selected="value" slot="dropdown-content"> <paper-item value="">(none)</paper-item> <template is="dom-repeat" items="[[keys]]"> <paper-item value="[[item]]">[[item]]</paper-item> </template> </paper-listbox> </paper-dropdown-menu> </div> <div class="dropdown-holder"> <paper-dropdown-menu id="imageFieldName" label="Label By"> <paper-listbox class="dropdown-content" selected="{{imageFieldName}}" attr-for-selected="value" slot="dropdown-content"> <paper-item value=""> [[_getImageFieldNameDefaultLabel(atlasUrl)]] </paper-item> <template is="dom-repeat" items="[[keys]]"> <paper-item value="[[item]]">[[item]]</paper-item> </template> </paper-listbox> </paper-dropdown-menu> </div> <div class="dropdown-holder horizontal-position"> <paper-dropdown-menu id="horizontalPosition" label="Scatter | X-Axis" class="position-selector"> <paper-listbox class="dropdown-content" selected="{{horizontalPosition}}" attr-for-selected="value" slot="dropdown-content"> <paper-item value="">(default)</paper-item> <template is="dom-repeat" items="[[keys]]" filter="_isKeyNumeric"> <paper-item value="[[item]]">[[item]]</paper-item> </template> </paper-listbox> </paper-dropdown-menu> </div> <div class="dropdown-holder vertical-position"> <paper-dropdown-menu id="verticalPosition" label="Scatter | Y-Axis" class="position-selector"> <paper-listbox class="dropdown-content" selected="{{verticalPosition}}" attr-for-selected="value" slot="dropdown-content"> <paper-item value="">(default)</paper-item> <template is="dom-repeat" items="[[keys]]" filter="_isKeyNumeric"> <paper-item value="[[item]]">[[item]]</paper-item> </template> </paper-listbox> </paper-dropdown-menu> </div> </div> <div class="overflow-holder"> <template is="dom-if" if="[[_shouldShowOverflowMenu(colorBy, verticalFacet, horizontalFacet)]]"> <paper-icon-button class="dropdown-trigger" icon="more-vert" alt="more-vert" id="overflowbtn" on-click="_openOverflow"> </paper-icon-button> </template> <paper-dialog id="overflowmenu" no-overlap horizontal-align="right" vertical-align="top"> <div class="overflow-div"> <template is="dom-if" if="{{_isKeyCategorical(colorBy)}}"> <div class="dropdown-holder"> <paper-dropdown-menu id="paletteChoice" label="Display | Color Palette"> <paper-listbox class="dropdown-content" selected="{{paletteChoice}}" attr-for-selected="value" slot="dropdown-content"> <paper-item value="standard">standard</paper-item> <paper-item value="warm">warm</paper-item> <paper-item value="cool">cool</paper-item> <paper-item value="assist">assist</paper-item> </paper-listbox> </paper-dropdown-menu> </div> </template> <template is="dom-if" if="[[_hasWordTree(verticalFacet)]]"> <paper-checkbox class="overflow-checkbox" checked="{{verticalBagOfWords}}"> X-Axis Bag of words </paper-checkbox> </template> <template is="dom-if" if="[[_hasWordTree(horizontalFacet)]]"> <paper-checkbox class="overflow-checkbox" checked="{{horizontalBagOfWords}}"> Y-Axis Bag of words </paper-checkbox> </template> </div> </paper-dialog> </div> </template> </dom-module> <script>//~~WEBPATH~~/facets-dive/components/facets-dive-controls/facets-dive-controls.js Polymer({is:"facets-dive-controls",properties:{atlasUrl:{type:String,value:""},keys:{type:Array,value:[]},stats:{type:Object,value:{}},verticalFacet:{type:String,value:"",notify:!0},verticalBuckets:{type:Number,value:10,notify:!0},verticalBagOfWords:{type:Boolean,value:!1,notify:!0},horizontalFacet:{type:String,value:"",notify:!0},horizontalBuckets:{type:Number,value:10,notify:!0},horizontalBagOfWords:{type:Boolean,value:!1,notify:!0},positionMode:{type:String,computed:"_getPositionMode(verticalPosition, horizontalPosition)", notify:!0},verticalPosition:{type:String,value:"",notify:!0},horizontalPosition:{type:String,value:"",notify:!0},colorBy:{type:String,value:"",notify:!0},imageFieldName:{type:String,value:"",notify:!0},palette:{type:Array,value:[]},paletteChoice:{type:String,value:"standard",notify:!0},gridFacetingVerticalLabelColor:{type:String,value:"#666666",observer:"_updateCSSVars"},gridFacetingHorizontalLabelColor:{type:String,value:"#dd6622",observer:"_updateCSSVars"},itemPositioningVerticalLabelColor:{type:String, value:"#2255aa",observer:"_updateCSSVars"},itemPositioningHorizontalLabelColor:{type:String,value:"#118844",observer:"_updateCSSVars"}},_getImageFieldNameDefaultLabel(b){return b?"(image)":"(default)"},_isModeScatter(b){return"scatter"===b},_isKeyNumeric:function(b){return this.stats&&b in this.stats&&nn(this.stats[b])},_isKeyCategorical:function(b){return this.stats&&b in this.stats&&!nn(this.stats[b])},_updateCSSVars(){this.updateStyles({"--grid-faceting-vertical-label-color":this.gridFacetingVerticalLabelColor, "--grid-faceting-horizontal-label-color":this.gridFacetingHorizontalLabelColor,"--item-positioning-vertical-label-color":this.itemPositioningVerticalLabelColor,"--item-positioning-horizontal-label-color":this.itemPositioningHorizontalLabelColor})},_breakUpAndTruncate(b){return qn(""+b).replace(/([\W_])/g,"$1\u200b")},_maxBuckets(b,d){const f=this.stats?this.stats[b]:null;return f?d&&this._hasWordTree(b)?Math.min(100,f.wordTree.highestLevel):Math.min(100,f.uniqueCount+1):100},_hasWordTree:function(b){b= this.stats?this.stats[b]:null;return!!b&&!!b.wordTree&&1<b.wordTree.highestLevel},_getPositionMode(b,d){return""==b&&""==d?"stacked":"scatter"},_openOverflow(){this.$.overflowmenu.positionElement=this.$.overflowbtn;this.$.overflowmenu.open()},_shouldShowOverflowMenu(b,d,f){return this._isKeyCategorical(b)||this._hasWordTree(d)||this._hasWordTree(f)}}); </script> <dom-module id="iron-image"> <template> <style> :host { display: inline-block; overflow: hidden; position: relative; } #baseURIAnchor { display: none; } #sizedImgDiv { position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; display: none; } #img { display: block; width: var(--iron-image-width, auto); height: var(--iron-image-height, auto); } :host([sizing]) #sizedImgDiv { display: block; } :host([sizing]) #img { display: none; } #placeholder { position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; background-color: inherit; opacity: 1; @apply --iron-image-placeholder; } #placeholder.faded-out { transition: opacity 0.5s linear; opacity: 0; } </style> <a id="baseURIAnchor" href="#"></a> <div id="sizedImgDiv" role="img" hidden$="[[_computeImgDivHidden(sizing)]]" aria-hidden$="[[_computeImgDivARIAHidden(alt)]]" aria-label$="[[_computeImgDivARIALabel(alt, src)]]"></div> <img id="img" alt$="[[alt]]" hidden$="[[_computeImgHidden(sizing)]]" on-load="_imgOnLoad" on-error="_imgOnError"> <div id="placeholder" hidden$="[[_computePlaceholderHidden(preload, fade, loading, loaded)]]" class$="[[_computePlaceholderClassName(preload, fade, loading, loaded)]]"></div> </template> <script>//~~WEBPATH~~/iron-image/iron-image.html.js Polymer({is:"iron-image",properties:{src:{type:String,value:""},alt:{type:String,value:null},preventLoad:{type:Boolean,value:!1},sizing:{type:String,value:null,reflectToAttribute:!0},position:{type:String,value:"center"},preload:{type:Boolean,value:!1},placeholder:{type:String,value:null,observer:"_placeholderChanged"},fade:{type:Boolean,value:!1},loaded:{notify:!0,readOnly:!0,type:Boolean,value:!1},loading:{notify:!0,readOnly:!0,type:Boolean,value:!1},error:{notify:!0,readOnly:!0,type:Boolean,value:!1}, width:{observer:"_widthChanged",type:Number,value:null},height:{observer:"_heightChanged",type:Number,value:null}},observers:["_transformChanged(sizing, position)","_loadStateObserver(src, preventLoad)"],created:function(){this._resolvedSrc=""},_imgOnLoad:function(){this.$.img.src===this._resolveSrc(this.src)&&(this._setLoading(!1),this._setLoaded(!0),this._setError(!1))},_imgOnError:function(){this.$.img.src===this._resolveSrc(this.src)&&(this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage= "",this._setLoading(!1),this._setLoaded(!1),this._setError(!0))},_computePlaceholderHidden:function(){return!this.preload||!this.fade&&!this.loading&&this.loaded},_computePlaceholderClassName:function(){return this.preload&&this.fade&&!this.loading&&this.loaded?"faded-out":""},_computeImgDivHidden:function(){return!this.sizing},_computeImgDivARIAHidden:function(){return""===this.alt?"true":void 0},_computeImgDivARIALabel:function(){return null!==this.alt?this.alt:""===this.src?"":this._resolveSrc(this.src).replace(/[?|#].*/g, "").split("/").pop()},_computeImgHidden:function(){return!!this.sizing},_widthChanged:function(){this.style.width=isNaN(this.width)?this.width:this.width+"px"},_heightChanged:function(){this.style.height=isNaN(this.height)?this.height:this.height+"px"},_loadStateObserver:function(b,d){var f=this._resolveSrc(b);f!==this._resolvedSrc&&(this._resolvedSrc=f,this.$.img.removeAttribute("src"),this.$.sizedImgDiv.style.backgroundImage="",""===b||d?this._setLoading(!1):(this.$.img.src=this._resolvedSrc,this.$.sizedImgDiv.style.backgroundImage= 'url("'+this._resolvedSrc+'")',this._setLoading(!0)),this._setLoaded(!1),this._setError(!1))},_placeholderChanged:function(){this.$.placeholder.style.backgroundImage=this.placeholder?'url("'+this.placeholder+'")':""},_transformChanged:function(){var b=this.$.sizedImgDiv.style,d=this.$.placeholder.style;b.backgroundSize=d.backgroundSize=this.sizing;b.backgroundPosition=d.backgroundPosition=this.sizing?this.position:"";b.backgroundRepeat=d.backgroundRepeat=this.sizing?"no-repeat":""},_resolveSrc:function(b){b= Polymer.ResolveUrl.resolveUrl(b,this.$.baseURIAnchor.href);"/"===b[0]&&(b=(location.origin||location.protocol+"//"+location.host)+b);return b}}); </script> </dom-module> <dom-module id="paper-card"> <template> <style include="paper-material-styles"> :host { display: inline-block; position: relative; box-sizing: border-box; background-color: var(--paper-card-background-color, var(--primary-background-color)); border-radius: 2px; @apply --paper-font-common-base; @apply --paper-card; } /* IE 10 support for HTML5 hidden attr */ [hidden] { display: none !important; } .header { position: relative; border-top-left-radius: inherit; border-top-right-radius: inherit; overflow: hidden; @apply --paper-card-header; } .header iron-image { display: block; width: 100%; --iron-image-width: 100%; pointer-events: none; @apply --paper-card-header-image; } .header .title-text { padding: 16px; font-size: 24px; font-weight: 400; color: var(--paper-card-header-color, #000); @apply --paper-card-header-text; } .header .title-text.over-image { position: absolute; bottom: 0px; @apply --paper-card-header-image-text; } :host ::slotted(.card-content) { padding: 16px; position:relative; @apply --paper-card-content; } :host ::slotted(.card-actions) { border-top: 1px solid #e8e8e8; padding: 5px 16px; position:relative; @apply --paper-card-actions; } :host([elevation="1"]) { @apply --paper-material-elevation-1; } :host([elevation="2"]) { @apply --paper-material-elevation-2; } :host([elevation="3"]) { @apply --paper-material-elevation-3; } :host([elevation="4"]) { @apply --paper-material-elevation-4; } :host([elevation="5"]) { @apply --paper-material-elevation-5; } </style> <div class="header"> <iron-image hidden$="[[!image]]" aria-hidden$="[[_isHidden(image)]]" src="[[image]]" alt="[[alt]]" placeholder="[[placeholderImage]]" preload="[[preloadImage]]" fade="[[fadeImage]]"></iron-image> <div hidden$="[[!heading]]" class$="title-text [[_computeHeadingClass(image)]]">[[heading]]</div> </div> <slot></slot> </template> <script>//~~WEBPATH~~/paper-card/paper-card.html.js Polymer({is:"paper-card",properties:{heading:{type:String,value:"",observer:"_headingChanged"},image:{type:String,value:""},alt:{type:String},preloadImage:{type:Boolean,value:!1},fadeImage:{type:Boolean,value:!1},placeholderImage:{type:String,value:null},elevation:{type:Number,value:1,reflectToAttribute:!0},animatedShadow:{type:Boolean,value:!1},animated:{type:Boolean,reflectToAttribute:!0,readOnly:!0,computed:"_computeAnimated(animatedShadow)"}},_isHidden:function(b){return b?"false":"true"},_headingChanged:function(b){var d= this.getAttribute("heading"),f=this.getAttribute("aria-label");"string"===typeof f&&f!==d||this.setAttribute("aria-label",b)},_computeHeadingClass:function(b){return b?" over-image":""},_computeAnimated:function(b){return b}}); </script> </dom-module> <script>//~~WEBPATH~~/facets-dive/lib/info-renderers.js const Ep=(b,d)=>{const f=document.createElement("dl");for(const m in b)if(b.hasOwnProperty(m)){var h=document.createElement("dt");h.textContent=m;f.appendChild(h);h=document.createElement("dd");h.textContent=b[m];f.appendChild(h)}d.appendChild(f)}; </script> <dom-module id="facets-dive-info-card"> <template> <style> :host { @apply --paper-font-common-base; box-sizing: border-box; max-height: 100%; max-width: 100%; overflow: auto; padding: 8px; } dt { color: #9e7c65; font-size: 14px; } dd { @apply --paper-font-common-code; color: #513726; margin: 0 0 16px 0; } </style> <div id="holder"></div> </template> </dom-module> <script>//~~WEBPATH~~/facets-dive/components/facets-dive-info-card/facets-dive-info-card.js Polymer({is:"facets-dive-info-card",properties:{infoRenderer:{type:Object},selectedData:{type:Array,value:[],observer:"_updateSelected"}},ready(){this.scopeSubtree(this.$.holder,!0)},_updateSelected(b){this.$.holder.innerHTML="";if(b){var d=this.infoRenderer||Ep;for(let f=0;f<b.length;f++){const h=b[f],m=document.createElement("div");m.style.width="100%";this.$.holder.appendChild(m);d(h,m)}}}}); </script> <dom-module id="iron-collapse"> <template> <style> :host { display: block; transition-duration: var(--iron-collapse-transition-duration, 300ms); /* Safari 10 needs this property prefixed to correctly apply the custom property */ -webkit-transition-duration: var(--iron-collapse-transition-duration, 300ms); overflow: visible; } :host(.iron-collapse-closed) { display: none; } :host(:not(.iron-collapse-opened)) { overflow: hidden; } </style> <slot></slot> </template> </dom-module> <script>//~~WEBPATH~~/iron-collapse/iron-collapse.html.js Polymer({is:"iron-collapse",behaviors:[Polymer.IronResizableBehavior],properties:{horizontal:{type:Boolean,value:!1,observer:"_horizontalChanged"},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},transitioning:{type:Boolean,notify:!0,readOnly:!0},noAnimation:{type:Boolean},_desiredSize:{type:String,value:""}},get dimension(){return this.horizontal?"width":"height"},get _dimensionMax(){return this.horizontal?"maxWidth":"maxHeight"},get _dimensionMaxCss(){return this.horizontal?"max-width": "max-height"},hostAttributes:{role:"group","aria-hidden":"true"},listeners:{transitionend:"_onTransitionEnd"},toggle:function(){this.opened=!this.opened},show:function(){this.opened=!0},hide:function(){this.opened=!1},updateSize:function(b,d){b="auto"===b?"":b;d=d&&!this.noAnimation&&this.isAttached&&this._desiredSize!==b;this._desiredSize=b;this._updateTransition(!1);d&&(d=this._calcSize(),""===b&&(this.style[this._dimensionMax]="",b=this._calcSize()),this.style[this._dimensionMax]=d,this.scrollTop= this.scrollTop,this._updateTransition(!0),d=b!==d);this.style[this._dimensionMax]=b;d||this._transitionEnd()},enableTransition:function(b){Polymer.Base._warn("`enableTransition()` is deprecated, use `noAnimation` instead.");this.noAnimation=!b},_updateTransition:function(b){this.style.transitionDuration=b&&!this.noAnimation?"":"0s"},_horizontalChanged:function(){this.style.transitionProperty=this._dimensionMaxCss;this.style["maxWidth"===this._dimensionMax?"maxHeight":"maxWidth"]="";this.updateSize(this.opened? "auto":"0px",!1)},_openedChanged:function(){this.setAttribute("aria-hidden",!this.opened);this._setTransitioning(!0);this.toggleClass("iron-collapse-closed",!1);this.toggleClass("iron-collapse-opened",!1);this.updateSize(this.opened?"auto":"0px",!0);this.opened&&this.focus()},_transitionEnd:function(){this.style[this._dimensionMax]=this._desiredSize;this.toggleClass("iron-collapse-closed",!this.opened);this.toggleClass("iron-collapse-opened",this.opened);this._updateTransition(!1);this.notifyResize(); this._setTransitioning(!1)},_onTransitionEnd:function(b){Polymer.dom(b).rootTarget===this&&this._transitionEnd()},_calcSize:function(){return this.getBoundingClientRect()[this.dimension]+"px"}}); </script> <iron-iconset-svg name="av" size="24"> <svg><defs> <g id="add-to-queue"><path d="M21 3H3c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.11-.9-2-2-2zm0 14H3V5h18v12zm-5-7v2h-3v3h-2v-3H8v-2h3V7h2v3h3z" /></g> <g id="airplay"><path d="M6 22h12l-6-6zM21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4v-2H3V5h18v12h-4v2h4c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" /></g> <g id="album"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 14.5c-2.49 0-4.5-2.01-4.5-4.5S9.51 7.5 12 7.5s4.5 2.01 4.5 4.5-2.01 4.5-4.5 4.5zm0-5.5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1z" /></g> <g id="art-track"><path d="M22 13h-8v-2h8v2zm0-6h-8v2h8V7zm-8 10h8v-2h-8v2zm-2-8v6c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2zm-1.5 6l-2.25-3-1.75 2.26-1.25-1.51L3.5 15h7z" /></g> <g id="av-timer"><path d="M11 17c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1-1 .45-1 1zm0-14v4h2V5.08c3.39.49 6 3.39 6 6.92 0 3.87-3.13 7-7 7s-7-3.13-7-7c0-1.68.59-3.22 1.58-4.42L12 13l1.41-1.41-6.8-6.8v.02C4.42 6.45 3 9.05 3 12c0 4.97 4.02 9 9 9 4.97 0 9-4.03 9-9s-4.03-9-9-9h-1zm7 9c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zM6 12c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1-1 .45-1 1z" /></g> <g id="branding-watermark"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16h-9v-6h9v6z" /></g> <g id="call-to-action"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3v-3h18v3z" /></g> <g id="closed-caption"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z" /></g> <g id="equalizer"><path d="M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z" /></g> <g id="explicit"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4 6h-4v2h4v2h-4v2h4v2H9V7h6v2z" /></g> <g id="fast-forward"><path d="M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z" /></g> <g id="fast-rewind"><path d="M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z" /></g> <g id="featured-play-list"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-9 8H3V9h9v2zm0-4H3V5h9v2z" /></g> <g id="featured-video"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-9 9H3V5h9v7z" /></g> <g id="fiber-dvr"><path d="M17.5 10.5h2v1h-2zm-13 0h2v3h-2zM21 3H3c-1.11 0-2 .89-2 2v14c0 1.1.89 2 2 2h18c1.11 0 2-.9 2-2V5c0-1.11-.89-2-2-2zM8 13.5c0 .85-.65 1.5-1.5 1.5H3V9h3.5c.85 0 1.5.65 1.5 1.5v3zm4.62 1.5h-1.5L9.37 9h1.5l1 3.43 1-3.43h1.5l-1.75 6zM21 11.5c0 .6-.4 1.15-.9 1.4L21 15h-1.5l-.85-2H17.5v2H16V9h3.5c.85 0 1.5.65 1.5 1.5v1z" /></g> <g id="fiber-manual-record"><circle cx="12" cy="12" r="8" /></g> <g id="fiber-new"><path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zM8.5 15H7.3l-2.55-3.5V15H3.5V9h1.25l2.5 3.5V9H8.5v6zm5-4.74H11v1.12h2.5v1.26H11v1.11h2.5V15h-4V9h4v1.26zm7 3.74c0 .55-.45 1-1 1h-4c-.55 0-1-.45-1-1V9h1.25v4.51h1.13V9.99h1.25v3.51h1.12V9h1.25v5z" /></g> <g id="fiber-pin"><path d="M5.5 10.5h2v1h-2zM20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zM9 11.5c0 .85-.65 1.5-1.5 1.5h-2v2H4V9h3.5c.85 0 1.5.65 1.5 1.5v1zm3.5 3.5H11V9h1.5v6zm7.5 0h-1.2l-2.55-3.5V15H15V9h1.25l2.5 3.5V9H20v6z" /></g> <g id="fiber-smart-record"><g><circle cx="9" cy="12" r="8" /><path d="M17 4.26v2.09c2.33.82 4 3.04 4 5.65s-1.67 4.83-4 5.65v2.09c3.45-.89 6-4.01 6-7.74s-2.55-6.85-6-7.74z" /></g></g> <g id="forward-10"><path d="M4 13c0 4.4 3.6 8 8 8s8-3.6 8-8h-2c0 3.3-2.7 6-6 6s-6-2.7-6-6 2.7-6 6-6v4l5-5-5-5v4c-4.4 0-8 3.6-8 8zm6.8 3H10v-3.3L9 13v-.7l1.8-.6h.1V16zm4.3-1.8c0 .3 0 .6-.1.8l-.3.6s-.3.3-.5.3-.4.1-.6.1-.4 0-.6-.1-.3-.2-.5-.3-.2-.3-.3-.6-.1-.5-.1-.8v-.7c0-.3 0-.6.1-.8l.3-.6s.3-.3.5-.3.4-.1.6-.1.4 0 .6.1.3.2.5.3.2.3.3.6.1.5.1.8v.7zm-.8-.8v-.5s-.1-.2-.1-.3-.1-.1-.2-.2-.2-.1-.3-.1-.2 0-.3.1l-.2.2s-.1.2-.1.3v2s.1.2.1.3.1.1.2.2.2.1.3.1.2 0 .3-.1l.2-.2s.1-.2.1-.3v-1.5z" /></g> <g id="forward-30"><path d="M9.6 13.5h.4c.2 0 .4-.1.5-.2s.2-.2.2-.4v-.2s-.1-.1-.1-.2-.1-.1-.2-.1h-.5s-.1.1-.2.1-.1.1-.1.2v.2h-1c0-.2 0-.3.1-.5s.2-.3.3-.4.3-.2.4-.2.4-.1.5-.1c.2 0 .4 0 .6.1s.3.1.5.2.2.2.3.4.1.3.1.5v.3s-.1.2-.1.3-.1.2-.2.2-.2.1-.3.2c.2.1.4.2.5.4s.2.4.2.6c0 .2 0 .4-.1.5s-.2.3-.3.4-.3.2-.5.2-.4.1-.6.1c-.2 0-.4 0-.5-.1s-.3-.1-.5-.2-.2-.2-.3-.4-.1-.4-.1-.6h.8v.2s.1.1.1.2.1.1.2.1h.5s.1-.1.2-.1.1-.1.1-.2v-.5s-.1-.1-.1-.2-.1-.1-.2-.1h-.6v-.7zm5.7.7c0 .3 0 .6-.1.8l-.3.6s-.3.3-.5.3-.4.1-.6.1-.4 0-.6-.1-.3-.2-.5-.3-.2-.3-.3-.6-.1-.5-.1-.8v-.7c0-.3 0-.6.1-.8l.3-.6s.3-.3.5-.3.4-.1.6-.1.4 0 .6.1.3.2.5.3.2.3.3.6.1.5.1.8v.7zm-.9-.8v-.5s-.1-.2-.1-.3-.1-.1-.2-.2-.2-.1-.3-.1-.2 0-.3.1l-.2.2s-.1.2-.1.3v2s.1.2.1.3.1.1.2.2.2.1.3.1.2 0 .3-.1l.2-.2s.1-.2.1-.3v-1.5zM4 13c0 4.4 3.6 8 8 8s8-3.6 8-8h-2c0 3.3-2.7 6-6 6s-6-2.7-6-6 2.7-6 6-6v4l5-5-5-5v4c-4.4 0-8 3.6-8 8z" /></g> <g id="forward-5"><path d="M4 13c0 4.4 3.6 8 8 8s8-3.6 8-8h-2c0 3.3-2.7 6-6 6s-6-2.7-6-6 2.7-6 6-6v4l5-5-5-5v4c-4.4 0-8 3.6-8 8zm6.7.9l.2-2.2h2.4v.7h-1.7l-.1.9s.1 0 .1-.1.1 0 .1-.1.1 0 .2 0h.2c.2 0 .4 0 .5.1s.3.2.4.3.2.3.3.5.1.4.1.6c0 .2 0 .4-.1.5s-.1.3-.3.5-.3.2-.5.3-.4.1-.6.1c-.2 0-.4 0-.5-.1s-.3-.1-.5-.2-.2-.2-.3-.4-.1-.3-.1-.5h.8c0 .2.1.3.2.4s.2.1.4.1c.1 0 .2 0 .3-.1l.2-.2s.1-.2.1-.3v-.6l-.1-.2-.2-.2s-.2-.1-.3-.1h-.2s-.1 0-.2.1-.1 0-.1.1-.1.1-.1.1h-.6z" /></g> <g id="games"><path d="M15 7.5V2H9v5.5l3 3 3-3zM7.5 9H2v6h5.5l3-3-3-3zM9 16.5V22h6v-5.5l-3-3-3 3zM16.5 9l-3 3 3 3H22V9h-5.5z" /></g> <g id="hd"><path d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z" /></g> <g id="hearing"><path d="M17 20c-.29 0-.56-.06-.76-.15-.71-.37-1.21-.88-1.71-2.38-.51-1.56-1.47-2.29-2.39-3-.79-.61-1.61-1.24-2.32-2.53C9.29 10.98 9 9.93 9 9c0-2.8 2.2-5 5-5s5 2.2 5 5h2c0-3.93-3.07-7-7-7S7 5.07 7 9c0 1.26.38 2.65 1.07 3.9.91 1.65 1.98 2.48 2.85 3.15.81.62 1.39 1.07 1.71 2.05.6 1.82 1.37 2.84 2.73 3.55.51.23 1.07.35 1.64.35 2.21 0 4-1.79 4-4h-2c0 1.1-.9 2-2 2zM7.64 2.64L6.22 1.22C4.23 3.21 3 5.96 3 9s1.23 5.79 3.22 7.78l1.41-1.41C6.01 13.74 5 11.49 5 9s1.01-4.74 2.64-6.36zM11.5 9c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5-1.12-2.5-2.5-2.5-2.5 1.12-2.5 2.5z" /></g> <g id="high-quality"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 11H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm7-1c0 .55-.45 1-1 1h-.75v1.5h-1.5V15H14c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v4zm-3.5-.5h2v-3h-2v3z" /></g> <g id="library-add"><path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z" /></g> <g id="library-books"><path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9H9V9h10v2zm-4 4H9v-2h6v2zm4-8H9V5h10v2z" /></g> <g id="library-music"><path d="M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 5h-3v5.5c0 1.38-1.12 2.5-2.5 2.5S10 13.88 10 12.5s1.12-2.5 2.5-2.5c.57 0 1.08.19 1.5.51V5h4v2zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6z" /></g> <g id="loop"><path d="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z" /></g> <g id="mic"><path d="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z" /></g> <g id="mic-none"><path d="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm-1.2-9.1c0-.66.54-1.2 1.2-1.2.66 0 1.2.54 1.2 1.2l-.01 6.2c0 .66-.53 1.2-1.19 1.2-.66 0-1.2-.54-1.2-1.2V4.9zm6.5 6.1c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z" /></g> <g id="mic-off"><path d="M19 11h-1.7c0 .74-.16 1.43-.43 2.05l1.23 1.23c.56-.98.9-2.09.9-3.28zm-4.02.17c0-.06.02-.11.02-.17V5c0-1.66-1.34-3-3-3S9 3.34 9 5v.18l5.98 5.99zM4.27 3L3 4.27l6.01 6.01V11c0 1.66 1.33 3 2.99 3 .22 0 .44-.03.65-.08l1.66 1.66c-.71.33-1.5.52-2.31.52-2.76 0-5.3-2.1-5.3-5.1H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c.91-.13 1.77-.45 2.54-.9L19.73 21 21 19.73 4.27 3z" /></g> <g id="movie"><path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z" /></g> <g id="music-video"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM8 15c0-1.66 1.34-3 3-3 .35 0 .69.07 1 .18V6h5v2h-3v7.03c-.02 1.64-1.35 2.97-3 2.97-1.66 0-3-1.34-3-3z" /></g> <g id="new-releases"><path d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-10 5h-2v-2h2v2zm0-4h-2V7h2v6z" /></g> <g id="not-interested"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z" /></g> <g id="note"><path d="M22 10l-6-6H4c-1.1 0-2 .9-2 2v12.01c0 1.1.9 1.99 2 1.99l16-.01c1.1 0 2-.89 2-1.99v-8zm-7-4.5l5.5 5.5H15V5.5z" /></g> <g id="pause"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" /></g> <g id="pause-circle-filled"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z" /></g> <g id="pause-circle-outline"><path d="M9 16h2V8H9v8zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm1-4h2V8h-2v8z" /></g> <g id="play-arrow"><path d="M8 5v14l11-7z" /></g> <g id="play-circle-filled"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z" /></g> <g id="play-circle-outline"><path d="M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z" /></g> <g id="playlist-add"><path d="M14 10H2v2h12v-2zm0-4H2v2h12V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM2 16h8v-2H2v2z" /></g> <g id="playlist-add-check"><path d="M14 10H2v2h12v-2zm0-4H2v2h12V6zM2 16h8v-2H2v2zm19.5-4.5L23 13l-6.99 7-4.51-4.5L13 14l3.01 3 5.49-5.5z" /></g> <g id="playlist-play"><path d="M19 9H2v2h17V9zm0-4H2v2h17V5zM2 15h13v-2H2v2zm15-2v6l5-3-5-3z" /></g> <g id="queue"><path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z" /></g> <g id="queue-music"><path d="M15 6H3v2h12V6zm0 4H3v2h12v-2zM3 16h8v-2H3v2zM17 6v8.18c-.31-.11-.65-.18-1-.18-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3V8h3V6h-5z" /></g> <g id="queue-play-next"><path d="M21 3H3c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h5v2h8v-2h2v-2H3V5h18v8h2V5c0-1.11-.9-2-2-2zm-8 7V7h-2v3H8v2h3v3h2v-3h3v-2h-3zm11 8l-4.5 4.5L18 21l3-3-3-3 1.5-1.5L24 18z" /></g> <g id="radio"><path d="M3.24 6.15C2.51 6.43 2 7.17 2 8v12c0 1.1.89 2 2 2h16c1.11 0 2-.9 2-2V8c0-1.11-.89-2-2-2H8.3l8.26-3.34L15.88 1 3.24 6.15zM7 20c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm13-8h-2v-2h-2v2H4V8h16v4z" /></g> <g id="recent-actors"><path d="M21 5v14h2V5h-2zm-4 14h2V5h-2v14zM14 5H2c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zM8 7.75c1.24 0 2.25 1.01 2.25 2.25S9.24 12.25 8 12.25 5.75 11.24 5.75 10 6.76 7.75 8 7.75zM12.5 17h-9v-.75c0-1.5 3-2.25 4.5-2.25s4.5.75 4.5 2.25V17z" /></g> <g id="remove-from-queue"><path d="M21 3H3c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.11-.9-2-2-2zm0 14H3V5h18v12zm-5-7v2H8v-2h8z" /></g> <g id="repeat"><path d="M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z" /></g> <g id="repeat-one"><path d="M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4zm-4-2V9h-1l-2 1v1h1.5v4H13z" /></g> <g id="replay"><path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" /></g> <g id="replay-10"><path d="M12 5V1L7 6l5 5V7c3.3 0 6 2.7 6 6s-2.7 6-6 6-6-2.7-6-6H4c0 4.4 3.6 8 8 8s8-3.6 8-8-3.6-8-8-8zm-1.1 11H10v-3.3L9 13v-.7l1.8-.6h.1V16zm4.3-1.8c0 .3 0 .6-.1.8l-.3.6s-.3.3-.5.3-.4.1-.6.1-.4 0-.6-.1-.3-.2-.5-.3-.2-.3-.3-.6-.1-.5-.1-.8v-.7c0-.3 0-.6.1-.8l.3-.6s.3-.3.5-.3.4-.1.6-.1.4 0 .6.1c.2.1.3.2.5.3s.2.3.3.6.1.5.1.8v.7zm-.9-.8v-.5s-.1-.2-.1-.3-.1-.1-.2-.2-.2-.1-.3-.1-.2 0-.3.1l-.2.2s-.1.2-.1.3v2s.1.2.1.3.1.1.2.2.2.1.3.1.2 0 .3-.1l.2-.2s.1-.2.1-.3v-1.5z" /></g> <g id="replay-30"><path d="M12 5V1L7 6l5 5V7c3.3 0 6 2.7 6 6s-2.7 6-6 6-6-2.7-6-6H4c0 4.4 3.6 8 8 8s8-3.6 8-8-3.6-8-8-8zm-2.4 8.5h.4c.2 0 .4-.1.5-.2s.2-.2.2-.4v-.2s-.1-.1-.1-.2-.1-.1-.2-.1h-.5s-.1.1-.2.1-.1.1-.1.2v.2h-1c0-.2 0-.3.1-.5s.2-.3.3-.4.3-.2.4-.2.4-.1.5-.1c.2 0 .4 0 .6.1s.3.1.5.2.2.2.3.4.1.3.1.5v.3s-.1.2-.1.3-.1.2-.2.2-.2.1-.3.2c.2.1.4.2.5.4s.2.4.2.6c0 .2 0 .4-.1.5s-.2.3-.3.4-.3.2-.5.2-.4.1-.6.1c-.2 0-.4 0-.5-.1s-.3-.1-.5-.2-.2-.2-.3-.4-.1-.4-.1-.6h.8v.2s.1.1.1.2.1.1.2.1h.5s.1-.1.2-.1.1-.1.1-.2v-.5s-.1-.1-.1-.2-.1-.1-.2-.1h-.6v-.7zm5.7.7c0 .3 0 .6-.1.8l-.3.6s-.3.3-.5.3-.4.1-.6.1-.4 0-.6-.1-.3-.2-.5-.3-.2-.3-.3-.6-.1-.5-.1-.8v-.7c0-.3 0-.6.1-.8l.3-.6s.3-.3.5-.3.4-.1.6-.1.4 0 .6.1.3.2.5.3.2.3.3.6.1.5.1.8v.7zm-.8-.8v-.5c0-.1-.1-.2-.1-.3s-.1-.1-.2-.2-.2-.1-.3-.1-.2 0-.3.1l-.2.2s-.1.2-.1.3v2s.1.2.1.3.1.1.2.2.2.1.3.1.2 0 .3-.1l.2-.2s.1-.2.1-.3v-1.5z" /></g> <g id="replay-5"><path d="M12 5V1L7 6l5 5V7c3.3 0 6 2.7 6 6s-2.7 6-6 6-6-2.7-6-6H4c0 4.4 3.6 8 8 8s8-3.6 8-8-3.6-8-8-8zm-1.3 8.9l.2-2.2h2.4v.7h-1.7l-.1.9s.1 0 .1-.1.1 0 .1-.1.1 0 .2 0h.2c.2 0 .4 0 .5.1s.3.2.4.3.2.3.3.5.1.4.1.6c0 .2 0 .4-.1.5s-.1.3-.3.5-.3.2-.4.3-.4.1-.6.1c-.2 0-.4 0-.5-.1s-.3-.1-.5-.2-.2-.2-.3-.4-.1-.3-.1-.5h.8c0 .2.1.3.2.4s.2.1.4.1c.1 0 .2 0 .3-.1l.2-.2s.1-.2.1-.3v-.6l-.1-.2-.2-.2s-.2-.1-.3-.1h-.2s-.1 0-.2.1-.1 0-.1.1-.1.1-.1.1h-.7z" /></g> <g id="shuffle"><path d="M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z" /></g> <g id="skip-next"><path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z" /></g> <g id="skip-previous"><path d="M6 6h2v12H6zm3.5 6l8.5 6V6z" /></g> <g id="slow-motion-video"><path d="M13.05 9.79L10 7.5v9l3.05-2.29L16 12zm0 0L10 7.5v9l3.05-2.29L16 12zm0 0L10 7.5v9l3.05-2.29L16 12zM11 4.07V2.05c-2.01.2-3.84 1-5.32 2.21L7.1 5.69c1.11-.86 2.44-1.44 3.9-1.62zM5.69 7.1L4.26 5.68C3.05 7.16 2.25 8.99 2.05 11h2.02c.18-1.46.76-2.79 1.62-3.9zM4.07 13H2.05c.2 2.01 1 3.84 2.21 5.32l1.43-1.43c-.86-1.1-1.44-2.43-1.62-3.89zm1.61 6.74C7.16 20.95 9 21.75 11 21.95v-2.02c-1.46-.18-2.79-.76-3.9-1.62l-1.42 1.43zM22 12c0 5.16-3.92 9.42-8.95 9.95v-2.02C16.97 19.41 20 16.05 20 12s-3.03-7.41-6.95-7.93V2.05C18.08 2.58 22 6.84 22 12z" /></g> <g id="snooze"><path d="M7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7zm-3-9h3.63L9 15.2V17h6v-2h-3.63L15 10.8V9H9v2z" /></g> <g id="sort-by-alpha"><path d="M14.94 4.66h-4.72l2.36-2.36zm-4.69 14.71h4.66l-2.33 2.33zM6.1 6.27L1.6 17.73h1.84l.92-2.45h5.11l.92 2.45h1.84L7.74 6.27H6.1zm-1.13 7.37l1.94-5.18 1.94 5.18H4.97zm10.76 2.5h6.12v1.59h-8.53v-1.29l5.92-8.56h-5.88v-1.6h8.3v1.26l-5.93 8.6z" /></g> <g id="stop"><path d="M6 6h12v12H6z" /></g> <g id="subscriptions"><path d="M20 8H4V6h16v2zm-2-6H6v2h12V2zm4 10v8c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2v-8c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2zm-6 4l-6-3.27v6.53L16 16z" /></g> <g id="subtitles"><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z" /></g> <g id="surround-sound"><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7.76 16.24l-1.41 1.41C4.78 16.1 4 14.05 4 12c0-2.05.78-4.1 2.34-5.66l1.41 1.41C6.59 8.93 6 10.46 6 12s.59 3.07 1.76 4.24zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm5.66 1.66l-1.41-1.41C17.41 15.07 18 13.54 18 12s-.59-3.07-1.76-4.24l1.41-1.41C19.22 7.9 20 9.95 20 12c0 2.05-.78 4.1-2.34 5.66zM12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" /></g> <g id="video-call"><path d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4zM14 13h-3v3H9v-3H6v-2h3V8h2v3h3v2z" /></g> <g id="video-label"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 13H3V5h18v11z" /></g> <g id="video-library"><path d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8 12.5v-9l6 4.5-6 4.5z" /></g> <g id="videocam"><path d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z" /></g> <g id="videocam-off"><path d="M21 6.5l-4 4V7c0-.55-.45-1-1-1H9.82L21 17.18V6.5zM3.27 2L2 3.27 4.73 6H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.21 0 .39-.08.54-.18L19.73 21 21 19.73 3.27 2z" /></g> <g id="volume-down"><path d="M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z" /></g> <g id="volume-mute"><path d="M7 9v6h4l5 5V4l-5 5H7z" /></g> <g id="volume-off"><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z" /></g> <g id="volume-up"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" /></g> <g id="web"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 14H4v-4h11v4zm0-5H4V9h11v4zm5 5h-4V9h4v9z" /></g> <g id="web-asset"><path d="M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm0 14H5V8h14v10z" /></g> </defs></svg> </iron-iconset-svg> <dom-module id="paper-tooltip"> <template> <style> :host { display: block; position: absolute; outline: none; z-index: 1002; -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; user-select: none; cursor: default; } #tooltip { display: block; outline: none; @apply --paper-font-common-base; font-size: 10px; line-height: 1; background-color: var(--paper-tooltip-background, #616161); color: var(--paper-tooltip-text-color, white); padding: 8px; border-radius: 2px; @apply --paper-tooltip; } @keyframes keyFrameScaleUp { 0% { transform: scale(0.0); } 100% { transform: scale(1.0); } } @keyframes keyFrameScaleDown { 0% { transform: scale(1.0); } 100% { transform: scale(0.0); } } @keyframes keyFrameFadeInOpacity { 0% { opacity: 0; } 100% { opacity: var(--paper-tooltip-opacity, 0.9); } } @keyframes keyFrameFadeOutOpacity { 0% { opacity: var(--paper-tooltip-opacity, 0.9); } 100% { opacity: 0; } } @keyframes keyFrameSlideDownIn { 0% { transform: translateY(-2000px); opacity: 0; } 10% { opacity: 0.2; } 100% { transform: translateY(0); opacity: var(--paper-tooltip-opacity, 0.9); } } @keyframes keyFrameSlideDownOut { 0% { transform: translateY(0); opacity: var(--paper-tooltip-opacity, 0.9); } 10% { opacity: 0.2; } 100% { transform: translateY(-2000px); opacity: 0; } } .fade-in-animation { opacity: 0; animation-delay: var(--paper-tooltip-delay-in, 500ms); animation-name: keyFrameFadeInOpacity; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: var(--paper-tooltip-duration-in, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .fade-out-animation { opacity: var(--paper-tooltip-opacity, 0.9); animation-delay: var(--paper-tooltip-delay-out, 0ms); animation-name: keyFrameFadeOutOpacity; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: var(--paper-tooltip-duration-out, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .scale-up-animation { transform: scale(0); opacity: var(--paper-tooltip-opacity, 0.9); animation-delay: var(--paper-tooltip-delay-in, 500ms); animation-name: keyFrameScaleUp; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: var(--paper-tooltip-duration-in, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .scale-down-animation { transform: scale(1); opacity: var(--paper-tooltip-opacity, 0.9); animation-delay: var(--paper-tooltip-delay-out, 500ms); animation-name: keyFrameScaleDown; animation-iteration-count: 1; animation-timing-function: ease-in; animation-duration: var(--paper-tooltip-duration-out, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .slide-down-animation { transform: translateY(-2000px); opacity: 0; animation-delay: var(--paper-tooltip-delay-out, 500ms); animation-name: keyFrameSlideDownIn; animation-iteration-count: 1; animation-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1); animation-duration: var(--paper-tooltip-duration-out, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .slide-down-animation-out { transform: translateY(0); opacity: var(--paper-tooltip-opacity, 0.9); animation-delay: var(--paper-tooltip-delay-out, 500ms); animation-name: keyFrameSlideDownOut; animation-iteration-count: 1; animation-timing-function: cubic-bezier(0.4, 0.0, 1, 1); animation-duration: var(--paper-tooltip-duration-out, 500ms); animation-fill-mode: forwards; @apply --paper-tooltip-animation; } .cancel-animation { animation-delay: -30s !important; } /* Thanks IE 10. */ .hidden { display: none !important; } </style> <div id="tooltip" class="hidden"> <slot></slot> </div> </template> <script>//~~WEBPATH~~/paper-tooltip/paper-tooltip.html.js Polymer({is:"paper-tooltip",hostAttributes:{role:"tooltip",tabindex:-1},properties:{for:{type:String,observer:"_findTarget"},manualMode:{type:Boolean,value:!1,observer:"_manualModeChanged"},position:{type:String,value:"bottom"},fitToVisibleBounds:{type:Boolean,value:!1},offset:{type:Number,value:14},marginTop:{type:Number,value:14},animationDelay:{type:Number,value:500,observer:"_delayChange"},animationEntry:{type:String,value:""},animationExit:{type:String,value:""},animationConfig:{type:Object, value:function(){return{entry:[{name:"fade-in-animation",node:this,timing:{delay:0}}],exit:[{name:"fade-out-animation",node:this}]}}},_showing:{type:Boolean,value:!1}},listeners:{webkitAnimationEnd:"_onAnimationEnd"},get target(){var b=Polymer.dom(this).parentNode,d=Polymer.dom(this).getOwnerRoot();return this.for?Polymer.dom(d).querySelector("#"+this.for):b.nodeType==Node.DOCUMENT_FRAGMENT_NODE?d.host:b},attached:function(){this._findTarget()},detached:function(){this.manualMode||this._removeListeners()}, playAnimation:function(b){"entry"===b?this.show():"exit"===b&&this.hide()},cancelAnimation:function(){this.$.tooltip.classList.add("cancel-animation")},show:function(){if(!this._showing){if(""===Polymer.dom(this).textContent.trim()){for(var b=!0,d=Polymer.dom(this).getEffectiveChildNodes(),f=0;f<d.length;f++)if(""!==d[f].textContent.trim()){b=!1;break}if(b)return}this._showing=!0;this.$.tooltip.classList.remove("hidden");this.$.tooltip.classList.remove("cancel-animation");this.$.tooltip.classList.remove(this._getAnimationType("exit")); this.updatePosition();this._animationPlaying=!0;this.$.tooltip.classList.add(this._getAnimationType("entry"))}},hide:function(){this._showing&&(this._animationPlaying?(this._showing=!1,this._cancelAnimation()):(this._onAnimationFinish(),this._showing=!1,this._animationPlaying=!0))},updatePosition:function(){if(this._target&&this.offsetParent){var b=this.offset;14!=this.marginTop&&14==this.offset&&(b=this.marginTop);var d=this.offsetParent.getBoundingClientRect(),f=this._target.getBoundingClientRect(), h=this.getBoundingClientRect(),m=(f.width-h.width)/2,w=(f.height-h.height)/2,l=f.left-d.left,p=f.top-d.top;switch(this.position){case "top":var n=l+m;var q=p-h.height-b;break;case "bottom":n=l+m;q=p+f.height+b;break;case "left":n=l-h.width-b;q=p+w;break;case "right":n=l+f.width+b,q=p+w}this.fitToVisibleBounds?(d.left+n+h.width>window.innerWidth?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,n)+"px",this.style.right="auto"),d.top+q+h.height>window.innerHeight?(this.style.bottom= d.height+"px",this.style.top="auto"):(this.style.top=Math.max(-d.top,q)+"px",this.style.bottom="auto")):(this.style.left=n+"px",this.style.top=q+"px")}},_addListeners:function(){this._target&&(this.listen(this._target,"mouseenter","show"),this.listen(this._target,"focus","show"),this.listen(this._target,"mouseleave","hide"),this.listen(this._target,"blur","hide"),this.listen(this._target,"tap","hide"));this.listen(this.$.tooltip,"animationend","_onAnimationEnd");this.listen(this,"mouseenter","hide")}, _findTarget:function(){this.manualMode||this._removeListeners();this._target=this.target;this.manualMode||this._addListeners()},_delayChange:function(b){500!==b&&this.updateStyles({"--paper-tooltip-delay-in":b+"ms"})},_manualModeChanged:function(){this.manualMode?this._removeListeners():this._addListeners()},_cancelAnimation:function(){this.$.tooltip.classList.remove(this._getAnimationType("entry"));this.$.tooltip.classList.remove(this._getAnimationType("exit"));this.$.tooltip.classList.remove("cancel-animation"); this.$.tooltip.classList.add("hidden")},_onAnimationFinish:function(){this._showing&&(this.$.tooltip.classList.remove(this._getAnimationType("entry")),this.$.tooltip.classList.remove("cancel-animation"),this.$.tooltip.classList.add(this._getAnimationType("exit")))},_onAnimationEnd:function(){this._animationPlaying=!1;this._showing||(this.$.tooltip.classList.remove(this._getAnimationType("exit")),this.$.tooltip.classList.add("hidden"))},_getAnimationType:function(b){if("entry"===b&&""!==this.animationEntry)return this.animationEntry; if("exit"===b&&""!==this.animationExit)return this.animationExit;if(this.animationConfig[b]&&"string"===typeof this.animationConfig[b][0].name){if(this.animationConfig[b][0].timing&&this.animationConfig[b][0].timing.delay&&0!==this.animationConfig[b][0].timing.delay){var d=this.animationConfig[b][0].timing.delay;"entry"===b?this.updateStyles({"--paper-tooltip-delay-in":d+"ms"}):"exit"===b&&this.updateStyles({"--paper-tooltip-delay-out":d+"ms"})}return this.animationConfig[b][0].name}},_removeListeners:function(){this._target&& (this.unlisten(this._target,"mouseenter","show"),this.unlisten(this._target,"focus","show"),this.unlisten(this._target,"mouseleave","hide"),this.unlisten(this._target,"blur","hide"),this.unlisten(this._target,"tap","hide"));this.unlisten(this.$.tooltip,"animationend","_onAnimationEnd");this.unlisten(this,"mouseenter","hide")}}); </script> </dom-module> <dom-module id="facets-dive-legend"> <template> <style> :host { @apply --paper-font-common-base; } .legend { border: 1px solid #a9a9a9; min-width: 200px; } .topbar { display: flex; justify-content: space-between; padding: 8px; background: #E6E6FA; } .expand-button { padding: 0; width: 20px; height: 20px; margin-left: 10px; } .legend-body { border-top: 1px solid #a9a9a9; padding: 8px; background: white; } .legend .layout-row { margin: 0; } .legend .layout-row span { margin: 2px 0 0 8px; } /** * Legend table shim. Polymer's dom-repeat feature has a known issue in * which it doesn't work with <tr> elements inside of a <table>. So * instead, we use CSS with classed divs to achieve table behavior. */ .legend-table { display: table; margin-left: 2px; } .legend-row { display: table-row; } .legend-cell { display: table-cell; } /** * Color legend. */ .legend .color { font-size: 14px; } .legend .color iron-icon { --iron-icon-width: 16px; --iron-icon-height: 16px; margin: 0 2px; } .legend .color iron-icon[fill="#ffffff"] { background: #dddddd; } .legend .color span { margin: 0; } .legend .special { font-style: italic; } .legend h2 { @apply --paper-font-subhead; color: #4f423e; font-weight: bold; line-height: 1; margin: 0; } .legend .color-by-field { color: #968e8c; display: block; font-size: 12.5px; font-weight: normal; margin: 2px 0 4px 20px; } </style> <template is="dom-if" if="[[_anyColor(colorBy, palette)]]"> <div class="legend"> <div class="topbar"> <div class="title">Legend</div> <paper-icon-button class="expand-button" on-click="_toggleOpened" icon="[[_getIcon(_opened)]]"> </paper-icon-button> </div> <iron-collapse id="collapse" opened="{{_opened}}"> <div class="legend-body"> <h2>Colors</h2> <span class="color-by-field"> by [[_breakUpAndTruncate(colorBy)]] <paper-tooltip position="top">[[colorBy]]</paper-tooltip> </span> <div class="legend-table"> <template is="dom-repeat" items="[[palette]]"> <div class="legend-row color"> <div class="legend-cell"> <iron-icon icon="av:fiber-manual-record" fill$="[[item.color]]" style$="fill:[[item.color]]"></iron-icon> </div> <div class="legend-cell"> <span class$="[[_specialClass(item.content.special)]]"> [[_breakUpAndTruncate(item.content.label)]] </span> <paper-tooltip position="top">[[item.content.label]]</paper-tooltip> </div> </div> </template> </div> </div> </iron-collapse> </div> </template> </template> </dom-module> <script>//~~WEBPATH~~/facets-dive/components/facets-dive-legend/facets-dive-legend.js Polymer({is:"facets-dive-legend",properties:{colorBy:{type:String,value:"",observer:"_open"},palette:{type:Array,value:[]},_opened:{type:Boolean,value:!1}},_breakUpAndTruncate(b){return qn(""+b).replace(/([\W_])/g,"$1\u200b")},_anyColor(){return!!(this.colorBy&&this.palette&&this.palette.length)},_specialClass(b){return b?"special":""},_open(){this._opened=!0},_toggleOpened(){this._opened=!this._opened},_getIcon(b){return b?"expand-less":"expand-more"}}); </script> <dom-module id="facets-dive"> <template> <style> /** * paper-input-container uses an element containing only for * spacing purposes. Aggressive vulcanizers sometimes remove this content. * This CSS rule forces the containing element to have the correct height * in either case. */ :host paper-input-container > .floated-label-placeholder { min-height: 20px; } :host { background: #ffffff; box-sizing: border-box; display: flex; flex-grow: 1; height: 100%; overflow: hidden; position: relative; width: 100%; } .fill { display: flex; flex-grow: 1; position: relative; } .main { flex-direction: column; } facets-dive-controls { border-bottom: 1px solid #d3d3d3; flex-grow: 0; flex-shrink: 0; height: 60px; } .row { display: flex; flex-direction: row; } facets-dive-legend { position: absolute; bottom: 14px; right: 24px; } .zoom-controls { bottom: 14px; box-sizing: border-box; left: 0; position: absolute; } .zoom-controls paper-button { background-color: #e7e7e7; clear: left; color: #2b2b2b; display: block; float: left; margin: 4px 8px; min-width: 0; padding: 8px; } facets-dive-info-card { background: #fff8f4; border-left: 1px solid #c6c6c6; box-sizing: border-box; flex-grow: 0; flex-shrink: 0; width: 240px; } </style> <div class="fill main"> <facets-dive-controls id="controls" atlas-url="[[atlasUrl]]" keys="[[_keys]]" stats="[[stats]]" vertical-facet="{{verticalFacet}}" vertical-buckets="{{verticalBuckets}}" vertical-bag-of-words="{{verticalBagOfWords}}" horizontal-facet="{{horizontalFacet}}" horizontal-buckets="{{horizontalBuckets}}" horizontal-bag-of-words="{{horizontalBagOfWords}}" position-mode="{{positionMode}}" vertical-position="{{verticalPosition}}" horizontal-position="{{horizontalPosition}}" color-by="{{colorBy}}" image-field-name="{{imageFieldName}}" palette="[[_palette]]" palette-choice="{{paletteChoice}}" grid-faceting-vertical-label-color="[[gridFacetingVerticalLabelColor]]" grid-faceting-horizontal-label-color="[[gridFacetingHorizontalLabelColor]]" item-positioning-vertical-label-color="[[itemPositioningVerticalLabelColor]]" item-positioning-horizontal-label-color="[[itemPositioningHorizontalLabelColor]]"></facets-dive-controls> <div class="fill row"> <div class="fill"> <facets-dive-vis id="vis" class="fill" data="[[data]]" filtered-data-indices="[[filteredDataIndices]]" atlas-url="[[atlasUrl]]" sprite-url="[[spriteUrl]]" cross-origin="[[crossOrigin]]" keys="{{_keys}}" stats="{{stats}}" sprite-image-width="[[spriteImageWidth]]" sprite-image-height="[[spriteImageHeight]]" vertical-facet="[[verticalFacet]]" vertical-buckets="[[verticalBuckets]]" vertical-bag-of-words="[[verticalBagOfWords]]" horizontal-facet="[[horizontalFacet]]" horizontal-buckets="[[horizontalBuckets]]" horizontal-bag-of-words="[[horizontalBagOfWords]]" position-mode="[[positionMode]]" vertical-position="[[verticalPosition]]" horizontal-position="[[horizontalPosition]]" color-by="{{colorBy}}" image-field-name="{{imageFieldName}}" palette="{{_palette}}" palette-choice="[[paletteChoice]]" grid-faceting-vertical-label-color="{{gridFacetingVerticalLabelColor}}" grid-faceting-horizontal-label-color="{{gridFacetingHorizontalLabelColor}}" item-positioning-vertical-label-color="{{itemPositioningVerticalLabelColor}}" item-positioning-horizontal-label-color="{{itemPositioningHorizontalLabelColor}}" fit-grid-aspect-ratio-to-viewport="[[fitGridAspectRatioToViewport]]" selected-data="{{selectedData}}" selected-indices="{{selectedIndices}}" compared-data="{{comparedData}}" compared-indices="{{comparedIndices}}" stable-colors="[[stableColors]]"></facets-dive-vis> <div class="zoom-controls"> <paper-button raised id="zoomInButton"> <iron-icon icon="icons:add"></iron-icon> </paper-button> <paper-button raised id="zoomOutButton"> <iron-icon icon="icons:remove"></iron-icon> </paper-button> <paper-button raised id="fitButton"> <iron-icon icon="icons:aspect-ratio"></iron-icon> </paper-button> </div> <facets-dive-legend id="legend" color-by="[[colorBy]]" palette="[[_palette]]"> </facets-dive-legend> </div> <template is="dom-if" if="[[!hideInfoCard]]"> <facets-dive-info-card id="infoCard" selected-data="[[selectedData]]" info-renderer="[[infoRenderer]]"> </facets-dive-info-card> </template> </div> </div> </template> </dom-module> <script>//~~WEBPATH~~/facets-dive/components/facets-dive/facets-dive.js Polymer({is:"facets-dive",properties:{data:{type:Array,value:null,notify:!0},filteredDataIndices:{type:Array,value:null},_keys:{type:Array,value:[]},stats:{type:Object,value:{},notify:!0},atlasUrl:{type:String,value:null,notify:!0},spriteUrl:{type:String,value:null,notify:!0},crossOrigin:{type:String,value:null,notify:!0},spriteImageWidth:{type:Number,value:64},spriteImageHeight:{type:Number,value:64},gridFacetingVerticalLabelColor:{type:String,value:"#666666"},gridFacetingHorizontalLabelColor:{type:String, value:"#dd6622"},itemPositioningVerticalLabelColor:{type:String,value:"#2255aa"},itemPositioningHorizontalLabelColor:{type:String,value:"#118844"},fitGridAspectRatioToViewport:{type:Boolean,value:!1},verticalFacet:{type:String,value:"",notify:!0},verticalBuckets:{type:Number,value:10,notify:!0},verticalBagOfWords:{type:Boolean,value:!1,notify:!0},horizontalFacet:{type:String,value:"",notify:!0},horizontalBuckets:{type:Number,value:10,notify:!0},horizontalBagOfWords:{type:Boolean,value:!1,notify:!0}, positionMode:{type:String,value:"stacked",notify:!0},verticalPosition:{type:String,value:"",notify:!0},horizontalPosition:{type:String,value:"",notify:!0},colorBy:{type:String,value:"",notify:!0},imageFieldName:{type:String,value:"",notify:!0},_palette:{type:Array,value:[]},paletteChoice:{type:String,value:"standard",notify:!0},selectedData:{type:Array,value:[],notify:!0},selectedIndices:{type:Array,value:[],notify:!0},comparedData:{type:Array,value:[],notify:!0},comparedIndices:{type:Array,value:[], notify:!0},height:{type:Number,value:null,observer:"_updateHeight"},infoRenderer:{type:Object},hideInfoCard:{type:Boolean,value:!1},stableColors:{type:Boolean,value:!1}},ready(){const b=this.$;b.fitButton.onclick=()=>b.vis.fitToViewport();b.zoomInButton.onclick=()=>b.vis.zoomIn();b.zoomOutButton.onclick=()=>b.vis.zoomOut();this.hideInfoCard&&(b.vis.style.right="0");this._updateHeight()},_updateHeight:function(){null!==this.height&&(this.style.height="number"===typeof this.height?this.height+"px": this.height)}});</script>