| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 function assert(condition,opt_message){if(!condition){var message="Assertion fai
led";if(opt_message)message=message+": "+opt_message;var error=new Error(message
);var global=function(){return this}();if(global.traceAssertionsForTesting)conso
le.warn(error.stack);throw error}return condition}function assertNotReached(opt_
message){assert(false,opt_message||"Unreachable code hit")}function assertInstan
ceof(value,type,opt_message){if(!(value instanceof type)){assertNotReached(opt_m
essage||"Value "+value+" is not a[n] "+(type.name||typeof type))}return value} | 4 function assert(condition,opt_message){if(!condition){var message="Assertion fai
led";if(opt_message)message=message+": "+opt_message;var error=new Error(message
);var global=function(){return this}();if(global.traceAssertionsForTesting)conso
le.warn(error.stack);throw error}return condition}function assertNotReached(opt_
message){assert(false,opt_message||"Unreachable code hit")}function assertInstan
ceof(value,type,opt_message){if(!(value instanceof type)){assertNotReached(opt_m
essage||"Value "+value+" is not a[n] "+(type.name||typeof type))}return value} |
| 5 // Copyright 2016 The Chromium Authors. All rights reserved. | 5 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 6 // Use of this source code is governed by a BSD-style license that can be | 6 // Use of this source code is governed by a BSD-style license that can be |
| 7 // found in the LICENSE file. | 7 // found in the LICENSE file. |
| 8 function PromiseResolver(){this.resolve_;this.reject_;this.promise_=new Promise(
function(resolve,reject){this.resolve_=resolve;this.reject_=reject}.bind(this))}
PromiseResolver.prototype={get promise(){return this.promise_},set promise(p){as
sertNotReached()},get resolve(){return this.resolve_},set resolve(r){assertNotRe
ached()},get reject(){return this.reject_},set reject(s){assertNotReached()}}; | 8 function PromiseResolver(){this.resolve_;this.reject_;this.promise_=new Promise(
function(resolve,reject){this.resolve_=resolve;this.reject_=reject}.bind(this))}
PromiseResolver.prototype={get promise(){return this.promise_},set promise(p){as
sertNotReached()},get resolve(){return this.resolve_},set resolve(r){assertNotRe
ached()},get reject(){return this.reject_},set reject(s){assertNotReached()}}; |
| 9 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 9 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 10 // Use of this source code is governed by a BSD-style license that can be | 10 // Use of this source code is governed by a BSD-style license that can be |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // Use of this source code is governed by a BSD-style license that can be | 36 // Use of this source code is governed by a BSD-style license that can be |
| 37 // found in the LICENSE file. | 37 // found in the LICENSE file. |
| 38 cr.define("downloads",function(){var DangerType={NOT_DANGEROUS:"NOT_DANGEROUS",D
ANGEROUS_FILE:"DANGEROUS_FILE",DANGEROUS_URL:"DANGEROUS_URL",DANGEROUS_CONTENT:"
DANGEROUS_CONTENT",UNCOMMON_CONTENT:"UNCOMMON_CONTENT",DANGEROUS_HOST:"DANGEROUS
_HOST",POTENTIALLY_UNWANTED:"POTENTIALLY_UNWANTED"};var States={IN_PROGRESS:"IN_
PROGRESS",CANCELLED:"CANCELLED",COMPLETE:"COMPLETE",PAUSED:"PAUSED",DANGEROUS:"D
ANGEROUS",INTERRUPTED:"INTERRUPTED"};return{DangerType:DangerType,States:States}
}); | 38 cr.define("downloads",function(){var DangerType={NOT_DANGEROUS:"NOT_DANGEROUS",D
ANGEROUS_FILE:"DANGEROUS_FILE",DANGEROUS_URL:"DANGEROUS_URL",DANGEROUS_CONTENT:"
DANGEROUS_CONTENT",UNCOMMON_CONTENT:"UNCOMMON_CONTENT",DANGEROUS_HOST:"DANGEROUS
_HOST",POTENTIALLY_UNWANTED:"POTENTIALLY_UNWANTED"};var States={IN_PROGRESS:"IN_
PROGRESS",CANCELLED:"CANCELLED",COMPLETE:"COMPLETE",PAUSED:"PAUSED",DANGEROUS:"D
ANGEROUS",INTERRUPTED:"INTERRUPTED"};return{DangerType:DangerType,States:States}
}); |
| 39 // Copyright 2014 The Chromium Authors. All rights reserved. | 39 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 40 // Use of this source code is governed by a BSD-style license that can be | 40 // Use of this source code is governed by a BSD-style license that can be |
| 41 // found in the LICENSE file. | 41 // found in the LICENSE file. |
| 42 var ActionLink=document.registerElement("action-link",{prototype:{__proto__:HTML
AnchorElement.prototype,createdCallback:function(){this.tabIndex=this.disabled?-
1:0;if(!this.hasAttribute("role"))this.setAttribute("role","link");this.addEvent
Listener("keydown",function(e){if(!this.disabled&&e.key=="Enter"&&!this.href){wi
ndow.setTimeout(this.click.bind(this),0)}});function preventDefault(e){e.prevent
Default()}function removePreventDefault(){document.removeEventListener("selectst
art",preventDefault);document.removeEventListener("mouseup",removePreventDefault
)}this.addEventListener("mousedown",function(){document.addEventListener("select
start",preventDefault);document.addEventListener("mouseup",removePreventDefault)
;if(document.activeElement!=this)this.classList.add("no-outline")});this.addEven
tListener("blur",function(){this.classList.remove("no-outline")})},set disabled(
disabled){if(disabled)HTMLAnchorElement.prototype.setAttribute.call(this,"disabl
ed","");else HTMLAnchorElement.prototype.removeAttribute.call(this,"disabled");t
his.tabIndex=disabled?-1:0},get disabled(){return this.hasAttribute("disabled")}
,setAttribute:function(attr,val){if(attr.toLowerCase()=="disabled")this.disabled
=true;else HTMLAnchorElement.prototype.setAttribute.apply(this,arguments)},remov
eAttribute:function(attr){if(attr.toLowerCase()=="disabled")this.disabled=false;
else HTMLAnchorElement.prototype.removeAttribute.apply(this,arguments)}},"extend
s":"a"});(function(){var metaDatas={};var metaArrays={};var singleton=null;Polym
er.IronMeta=Polymer({is:"iron-meta",properties:{type:{type:String,value:"default
",observer:"_typeChanged"},key:{type:String,observer:"_keyChanged"},value:{type:
Object,notify:true,observer:"_valueChanged"},self:{type:Boolean,observer:"_selfC
hanged"},list:{type:Array,notify:true}},hostAttributes:{hidden:true},factoryImpl
:function(config){if(config){for(var n in config){switch(n){case"type":case"key"
:case"value":this[n]=config[n];break}}}},created:function(){this._metaDatas=meta
Datas;this._metaArrays=metaArrays},_keyChanged:function(key,old){this._resetRegi
stration(old)},_valueChanged:function(value){this._resetRegistration(this.key)},
_selfChanged:function(self){if(self){this.value=this}},_typeChanged:function(typ
e){this._unregisterKey(this.key);if(!metaDatas[type]){metaDatas[type]={}}this._m
etaData=metaDatas[type];if(!metaArrays[type]){metaArrays[type]=[]}this.list=meta
Arrays[type];this._registerKeyValue(this.key,this.value)},byKey:function(key){re
turn this._metaData&&this._metaData[key]},_resetRegistration:function(oldKey){th
is._unregisterKey(oldKey);this._registerKeyValue(this.key,this.value)},_unregist
erKey:function(key){this._unregister(key,this._metaData,this.list)},_registerKey
Value:function(key,value){this._register(key,value,this._metaData,this.list)},_r
egister:function(key,value,data,list){if(key&&data&&value!==undefined){data[key]
=value;list.push(value)}},_unregister:function(key,data,list){if(key&&data){if(k
ey in data){var value=data[key];delete data[key];this.arrayDelete(list,value)}}}
});Polymer.IronMeta.getIronMeta=function getIronMeta(){if(singleton===null){sing
leton=new Polymer.IronMeta}return singleton};Polymer.IronMetaQuery=Polymer({is:"
iron-meta-query",properties:{type:{type:String,value:"default",observer:"_typeCh
anged"},key:{type:String,observer:"_keyChanged"},value:{type:Object,notify:true,
readOnly:true},list:{type:Array,notify:true}},factoryImpl:function(config){if(co
nfig){for(var n in config){switch(n){case"type":case"key":this[n]=config[n];brea
k}}}},created:function(){this._metaDatas=metaDatas;this._metaArrays=metaArrays},
_keyChanged:function(key){this._setValue(this._metaData&&this._metaData[key])},_
typeChanged:function(type){this._metaData=metaDatas[type];this.list=metaArrays[t
ype];if(this.key){this._keyChanged(this.key)}},byKey:function(key){return this._
metaData&&this._metaData[key]}})})();Polymer({is:"iron-icon",properties:{icon:{t
ype:String,observer:"_iconChanged"},theme:{type:String,observer:"_updateIcon"},s
rc:{type:String,observer:"_srcChanged"},_meta:{value:Polymer.Base.create("iron-m
eta",{type:"iconset"}),observer:"_updateIcon"}},_DEFAULT_ICONSET:"icons",_iconCh
anged:function(icon){var parts=(icon||"").split(":");this._iconName=parts.pop();
this._iconsetName=parts.pop()||this._DEFAULT_ICONSET;this._updateIcon()},_srcCha
nged:function(src){this._updateIcon()},_usesIconset:function(){return this.icon|
|!this.src},_updateIcon:function(){if(this._usesIconset()){if(this._img&&this._i
mg.parentNode){Polymer.dom(this.root).removeChild(this._img)}if(this._iconName==
=""){if(this._iconset){this._iconset.removeIcon(this)}}else if(this._iconsetName
&&this._meta){this._iconset=this._meta.byKey(this._iconsetName);if(this._iconset
){this._iconset.applyIcon(this,this._iconName,this.theme);this.unlisten(window,"
iron-iconset-added","_updateIcon")}else{this.listen(window,"iron-iconset-added",
"_updateIcon")}}}else{if(this._iconset){this._iconset.removeIcon(this)}if(!this.
_img){this._img=document.createElement("img");this._img.style.width="100%";this.
_img.style.height="100%";this._img.draggable=false}this._img.src=this.src;Polyme
r.dom(this.root).appendChild(this._img)}}});Polymer.IronControlState={properties
:{focused:{type:Boolean,value:false,notify:true,readOnly:true,reflectToAttribute
:true},disabled:{type:Boolean,value:false,notify:true,observer:"_disabledChanged
",reflectToAttribute:true},_oldTabIndex:{type:Number},_boundFocusBlurHandler:{ty
pe:Function,value:function(){return this._focusBlurHandler.bind(this)}}},observe
rs:["_changedControlState(focused, disabled)"],ready:function(){this.addEventLis
tener("focus",this._boundFocusBlurHandler,true);this.addEventListener("blur",thi
s._boundFocusBlurHandler,true)},_focusBlurHandler:function(event){if(event.targe
t===this){this._setFocused(event.type==="focus")}else if(!this.shadowRoot){var t
arget=Polymer.dom(event).localTarget;if(!this.isLightDescendant(target)){this.fi
re(event.type,{sourceEvent:event},{node:this,bubbles:event.bubbles,cancelable:ev
ent.cancelable})}}},_disabledChanged:function(disabled,old){this.setAttribute("a
ria-disabled",disabled?"true":"false");this.style.pointerEvents=disabled?"none":
"";if(disabled){this._oldTabIndex=this.tabIndex;this._setFocused(false);this.tab
Index=-1;this.blur()}else if(this._oldTabIndex!==undefined){this.tabIndex=this._
oldTabIndex}},_changedControlState:function(){if(this._controlStateChanged){this
._controlStateChanged()}}};Polymer.IronButtonStateImpl={properties:{pressed:{typ
e:Boolean,readOnly:true,value:false,reflectToAttribute:true,observer:"_pressedCh
anged"},toggles:{type:Boolean,value:false,reflectToAttribute:true},active:{type:
Boolean,value:false,notify:true,reflectToAttribute:true},pointerDown:{type:Boole
an,readOnly:true,value:false},receivedFocusFromKeyboard:{type:Boolean,readOnly:t
rue},ariaActiveAttribute:{type:String,value:"aria-pressed",observer:"_ariaActive
AttributeChanged"}},listeners:{down:"_downHandler",up:"_upHandler",tap:"_tapHand
ler"},observers:["_detectKeyboardFocus(focused)","_activeChanged(active, ariaAct
iveAttribute)"],keyBindings:{"enter:keydown":"_asyncClick","space:keydown":"_spa
ceKeyDownHandler","space:keyup":"_spaceKeyUpHandler"},_mouseEventRe:/^mouse/,_ta
pHandler:function(){if(this.toggles){this._userActivate(!this.active)}else{this.
active=false}},_detectKeyboardFocus:function(focused){this._setReceivedFocusFrom
Keyboard(!this.pointerDown&&focused)},_userActivate:function(active){if(this.act
ive!==active){this.active=active;this.fire("change")}},_downHandler:function(eve
nt){this._setPointerDown(true);this._setPressed(true);this._setReceivedFocusFrom
Keyboard(false)},_upHandler:function(){this._setPointerDown(false);this._setPres
sed(false)},_spaceKeyDownHandler:function(event){var keyboardEvent=event.detail.
keyboardEvent;var target=Polymer.dom(keyboardEvent).localTarget;if(this.isLightD
escendant(target))return;keyboardEvent.preventDefault();keyboardEvent.stopImmedi
atePropagation();this._setPressed(true)},_spaceKeyUpHandler:function(event){var
keyboardEvent=event.detail.keyboardEvent;var target=Polymer.dom(keyboardEvent).l
ocalTarget;if(this.isLightDescendant(target))return;if(this.pressed){this._async
Click()}this._setPressed(false)},_asyncClick:function(){this.async(function(){th
is.click()},1)},_pressedChanged:function(pressed){this._changedButtonState()},_a
riaActiveAttributeChanged:function(value,oldValue){if(oldValue&&oldValue!=value&
&this.hasAttribute(oldValue)){this.removeAttribute(oldValue)}},_activeChanged:fu
nction(active,ariaActiveAttribute){if(this.toggles){this.setAttribute(this.ariaA
ctiveAttribute,active?"true":"false")}else{this.removeAttribute(this.ariaActiveA
ttribute)}this._changedButtonState()},_controlStateChanged:function(){if(this.di
sabled){this._setPressed(false)}else{this._changedButtonState()}},_changedButton
State:function(){if(this._buttonStateChanged){this._buttonStateChanged()}}};Poly
mer.IronButtonState=[Polymer.IronA11yKeysBehavior,Polymer.IronButtonStateImpl];(
function(){var Utility={distance:function(x1,y1,x2,y2){var xDelta=x1-x2;var yDel
ta=y1-y2;return Math.sqrt(xDelta*xDelta+yDelta*yDelta)},now:window.performance&&
window.performance.now?window.performance.now.bind(window.performance):Date.now}
;function ElementMetrics(element){this.element=element;this.width=this.boundingR
ect.width;this.height=this.boundingRect.height;this.size=Math.max(this.width,thi
s.height)}ElementMetrics.prototype={get boundingRect(){return this.element.getBo
undingClientRect()},furthestCornerDistanceFrom:function(x,y){var topLeft=Utility
.distance(x,y,0,0);var topRight=Utility.distance(x,y,this.width,0);var bottomLef
t=Utility.distance(x,y,0,this.height);var bottomRight=Utility.distance(x,y,this.
width,this.height);return Math.max(topLeft,topRight,bottomLeft,bottomRight)}};fu
nction Ripple(element){this.element=element;this.color=window.getComputedStyle(e
lement).color;this.wave=document.createElement("div");this.waveContainer=documen
t.createElement("div");this.wave.style.backgroundColor=this.color;this.wave.clas
sList.add("wave");this.waveContainer.classList.add("wave-container");Polymer.dom
(this.waveContainer).appendChild(this.wave);this.resetInteractionState()}Ripple.
MAX_RADIUS=300;Ripple.prototype={get recenters(){return this.element.recenters},
get center(){return this.element.center},get mouseDownElapsed(){var elapsed;if(!
this.mouseDownStart){return 0}elapsed=Utility.now()-this.mouseDownStart;if(this.
mouseUpStart){elapsed-=this.mouseUpElapsed}return elapsed},get mouseUpElapsed(){
return this.mouseUpStart?Utility.now()-this.mouseUpStart:0},get mouseDownElapsed
Seconds(){return this.mouseDownElapsed/1e3},get mouseUpElapsedSeconds(){return t
his.mouseUpElapsed/1e3},get mouseInteractionSeconds(){return this.mouseDownElaps
edSeconds+this.mouseUpElapsedSeconds},get initialOpacity(){return this.element.i
nitialOpacity},get opacityDecayVelocity(){return this.element.opacityDecayVeloci
ty},get radius(){var width2=this.containerMetrics.width*this.containerMetrics.wi
dth;var height2=this.containerMetrics.height*this.containerMetrics.height;var wa
veRadius=Math.min(Math.sqrt(width2+height2),Ripple.MAX_RADIUS)*1.1+5;var duratio
n=1.1-.2*(waveRadius/Ripple.MAX_RADIUS);var timeNow=this.mouseInteractionSeconds
/duration;var size=waveRadius*(1-Math.pow(80,-timeNow));return Math.abs(size)},g
et opacity(){if(!this.mouseUpStart){return this.initialOpacity}return Math.max(0
,this.initialOpacity-this.mouseUpElapsedSeconds*this.opacityDecayVelocity)},get
outerOpacity(){var outerOpacity=this.mouseUpElapsedSeconds*.3;var waveOpacity=th
is.opacity;return Math.max(0,Math.min(outerOpacity,waveOpacity))},get isOpacityF
ullyDecayed(){return this.opacity<.01&&this.radius>=Math.min(this.maxRadius,Ripp
le.MAX_RADIUS)},get isRestingAtMaxRadius(){return this.opacity>=this.initialOpac
ity&&this.radius>=Math.min(this.maxRadius,Ripple.MAX_RADIUS)},get isAnimationCom
plete(){return this.mouseUpStart?this.isOpacityFullyDecayed:this.isRestingAtMaxR
adius},get translationFraction(){return Math.min(1,this.radius/this.containerMet
rics.size*2/Math.sqrt(2))},get xNow(){if(this.xEnd){return this.xStart+this.tran
slationFraction*(this.xEnd-this.xStart)}return this.xStart},get yNow(){if(this.y
End){return this.yStart+this.translationFraction*(this.yEnd-this.yStart)}return
this.yStart},get isMouseDown(){return this.mouseDownStart&&!this.mouseUpStart},r
esetInteractionState:function(){this.maxRadius=0;this.mouseDownStart=0;this.mous
eUpStart=0;this.xStart=0;this.yStart=0;this.xEnd=0;this.yEnd=0;this.slideDistanc
e=0;this.containerMetrics=new ElementMetrics(this.element)},draw:function(){var
scale;var translateString;var dx;var dy;this.wave.style.opacity=this.opacity;sca
le=this.radius/(this.containerMetrics.size/2);dx=this.xNow-this.containerMetrics
.width/2;dy=this.yNow-this.containerMetrics.height/2;this.waveContainer.style.we
bkitTransform="translate("+dx+"px, "+dy+"px)";this.waveContainer.style.transform
="translate3d("+dx+"px, "+dy+"px, 0)";this.wave.style.webkitTransform="scale("+s
cale+","+scale+")";this.wave.style.transform="scale3d("+scale+","+scale+",1)"},d
ownAction:function(event){var xCenter=this.containerMetrics.width/2;var yCenter=
this.containerMetrics.height/2;this.resetInteractionState();this.mouseDownStart=
Utility.now();if(this.center){this.xStart=xCenter;this.yStart=yCenter;this.slide
Distance=Utility.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)}else{this
.xStart=event?event.detail.x-this.containerMetrics.boundingRect.left:this.contai
nerMetrics.width/2;this.yStart=event?event.detail.y-this.containerMetrics.boundi
ngRect.top:this.containerMetrics.height/2}if(this.recenters){this.xEnd=xCenter;t
his.yEnd=yCenter;this.slideDistance=Utility.distance(this.xStart,this.yStart,thi
s.xEnd,this.yEnd)}this.maxRadius=this.containerMetrics.furthestCornerDistanceFro
m(this.xStart,this.yStart);this.waveContainer.style.top=(this.containerMetrics.h
eight-this.containerMetrics.size)/2+"px";this.waveContainer.style.left=(this.con
tainerMetrics.width-this.containerMetrics.size)/2+"px";this.waveContainer.style.
width=this.containerMetrics.size+"px";this.waveContainer.style.height=this.conta
inerMetrics.size+"px"},upAction:function(event){if(!this.isMouseDown){return}thi
s.mouseUpStart=Utility.now()},remove:function(){Polymer.dom(this.waveContainer.p
arentNode).removeChild(this.waveContainer)}};Polymer({is:"paper-ripple",behavior
s:[Polymer.IronA11yKeysBehavior],properties:{initialOpacity:{type:Number,value:.
25},opacityDecayVelocity:{type:Number,value:.8},recenters:{type:Boolean,value:fa
lse},center:{type:Boolean,value:false},ripples:{type:Array,value:function(){retu
rn[]}},animating:{type:Boolean,readOnly:true,reflectToAttribute:true,value:false
},holdDown:{type:Boolean,value:false,observer:"_holdDownChanged"},noink:{type:Bo
olean,value:false},_animating:{type:Boolean},_boundAnimate:{type:Function,value:
function(){return this.animate.bind(this)}}},get target(){return this.keyEventTa
rget},keyBindings:{"enter:keydown":"_onEnterKeydown","space:keydown":"_onSpaceKe
ydown","space:keyup":"_onSpaceKeyup"},attached:function(){if(this.parentNode.nod
eType==11){this.keyEventTarget=Polymer.dom(this).getOwnerRoot().host}else{this.k
eyEventTarget=this.parentNode}var keyEventTarget=this.keyEventTarget;this.listen
(keyEventTarget,"up","uiUpAction");this.listen(keyEventTarget,"down","uiDownActi
on")},detached:function(){this.unlisten(this.keyEventTarget,"up","uiUpAction");t
his.unlisten(this.keyEventTarget,"down","uiDownAction");this.keyEventTarget=null
},get shouldKeepAnimating(){for(var index=0;index<this.ripples.length;++index){i
f(!this.ripples[index].isAnimationComplete){return true}}return false},simulated
Ripple:function(){this.downAction(null);this.async(function(){this.upAction()},1
)},uiDownAction:function(event){if(!this.noink){this.downAction(event)}},downAct
ion:function(event){if(this.holdDown&&this.ripples.length>0){return}var ripple=t
his.addRipple();ripple.downAction(event);if(!this._animating){this._animating=tr
ue;this.animate()}},uiUpAction:function(event){if(!this.noink){this.upAction(eve
nt)}},upAction:function(event){if(this.holdDown){return}this.ripples.forEach(fun
ction(ripple){ripple.upAction(event)});this._animating=true;this.animate()},onAn
imationComplete:function(){this._animating=false;this.$.background.style.backgro
undColor=null;this.fire("transitionend")},addRipple:function(){var ripple=new Ri
pple(this);Polymer.dom(this.$.waves).appendChild(ripple.waveContainer);this.$.ba
ckground.style.backgroundColor=ripple.color;this.ripples.push(ripple);this._setA
nimating(true);return ripple},removeRipple:function(ripple){var rippleIndex=this
.ripples.indexOf(ripple);if(rippleIndex<0){return}this.ripples.splice(rippleInde
x,1);ripple.remove();if(!this.ripples.length){this._setAnimating(false)}},animat
e:function(){if(!this._animating){return}var index;var ripple;for(index=0;index<
this.ripples.length;++index){ripple=this.ripples[index];ripple.draw();this.$.bac
kground.style.opacity=ripple.outerOpacity;if(ripple.isOpacityFullyDecayed&&!ripp
le.isRestingAtMaxRadius){this.removeRipple(ripple)}}if(!this.shouldKeepAnimating
&&this.ripples.length===0){this.onAnimationComplete()}else{window.requestAnimati
onFrame(this._boundAnimate)}},_onEnterKeydown:function(){this.uiDownAction();thi
s.async(this.uiUpAction,1)},_onSpaceKeydown:function(){this.uiDownAction()},_onS
paceKeyup:function(){this.uiUpAction()},_holdDownChanged:function(newVal,oldVal)
{if(oldVal===undefined){return}if(newVal){this.downAction()}else{this.upAction()
}}})})();Polymer.PaperRippleBehavior={properties:{noink:{type:Boolean,observer:"
_noinkChanged"},_rippleContainer:{type:Object}},_buttonStateChanged:function(){i
f(this.focused){this.ensureRipple()}},_downHandler:function(event){Polymer.IronB
uttonStateImpl._downHandler.call(this,event);if(this.pressed){this.ensureRipple(
event)}},ensureRipple:function(optTriggeringEvent){if(!this.hasRipple()){this._r
ipple=this._createRipple();this._ripple.noink=this.noink;var rippleContainer=thi
s._rippleContainer||this.root;if(rippleContainer){Polymer.dom(rippleContainer).a
ppendChild(this._ripple)}if(optTriggeringEvent){var domContainer=Polymer.dom(thi
s._rippleContainer||this);var target=Polymer.dom(optTriggeringEvent).rootTarget;
if(domContainer.deepContains(target)){this._ripple.uiDownAction(optTriggeringEve
nt)}}}},getRipple:function(){this.ensureRipple();return this._ripple},hasRipple:
function(){return Boolean(this._ripple)},_createRipple:function(){return documen
t.createElement("paper-ripple")},_noinkChanged:function(noink){if(this.hasRipple
()){this._ripple.noink=noink}}};Polymer.PaperButtonBehaviorImpl={properties:{ele
vation:{type:Number,reflectToAttribute:true,readOnly:true}},observers:["_calcula
teElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)","_co
mputeKeyboardClass(receivedFocusFromKeyboard)"],hostAttributes:{role:"button",ta
bindex:"0",animated:true},_calculateElevation:function(){var e=1;if(this.disable
d){e=0}else if(this.active||this.pressed){e=4}else if(this.receivedFocusFromKeyb
oard){e=3}this._setElevation(e)},_computeKeyboardClass:function(receivedFocusFro
mKeyboard){this.toggleClass("keyboard-focus",receivedFocusFromKeyboard)},_spaceK
eyDownHandler:function(event){Polymer.IronButtonStateImpl._spaceKeyDownHandler.c
all(this,event);if(this.hasRipple()&&this.getRipple().ripples.length<1){this._ri
pple.uiDownAction()}},_spaceKeyUpHandler:function(event){Polymer.IronButtonState
Impl._spaceKeyUpHandler.call(this,event);if(this.hasRipple()){this._ripple.uiUpA
ction()}}};Polymer.PaperButtonBehavior=[Polymer.IronButtonState,Polymer.IronCont
rolState,Polymer.PaperRippleBehavior,Polymer.PaperButtonBehaviorImpl];Polymer({i
s:"paper-button",behaviors:[Polymer.PaperButtonBehavior],properties:{raised:{typ
e:Boolean,reflectToAttribute:true,value:false,observer:"_calculateElevation"}},_
calculateElevation:function(){if(!this.raised){this._setElevation(0)}else{Polyme
r.PaperButtonBehaviorImpl._calculateElevation.apply(this)}}});Polymer({is:"paper
-icon-button-light","extends":"button",behaviors:[Polymer.PaperRippleBehavior],l
isteners:{down:"_rippleDown",up:"_rippleUp",focus:"_rippleDown",blur:"_rippleUp"
},_rippleDown:function(){this.getRipple().downAction()},_rippleUp:function(){thi
s.getRipple().upAction()},ensureRipple:function(var_args){var lastRipple=this._r
ipple;Polymer.PaperRippleBehavior.ensureRipple.apply(this,arguments);if(this._ri
pple&&this._ripple!==lastRipple){this._ripple.center=true;this._ripple.classList
.add("circle")}}});Polymer.IronRangeBehavior={properties:{value:{type:Number,val
ue:0,notify:true,reflectToAttribute:true},min:{type:Number,value:0,notify:true},
max:{type:Number,value:100,notify:true},step:{type:Number,value:1,notify:true},r
atio:{type:Number,value:0,readOnly:true,notify:true}},observers:["_update(value,
min, max, step)"],_calcRatio:function(value){return(this._clampValue(value)-thi
s.min)/(this.max-this.min)},_clampValue:function(value){return Math.min(this.max
,Math.max(this.min,this._calcStep(value)))},_calcStep:function(value){value=pars
eFloat(value);if(!this.step){return value}var numSteps=Math.round((value-this.mi
n)/this.step);if(this.step<1){return numSteps/(1/this.step)+this.min}else{return
numSteps*this.step+this.min}},_validateValue:function(){var v=this._clampValue(
this.value);this.value=this.oldValue=isNaN(v)?this.oldValue:v;return this.value!
==v},_update:function(){this._validateValue();this._setRatio(this._calcRatio(thi
s.value)*100)}};Polymer({is:"paper-progress",behaviors:[Polymer.IronRangeBehavio
r],properties:{secondaryProgress:{type:Number,value:0},secondaryRatio:{type:Numb
er,value:0,readOnly:true},indeterminate:{type:Boolean,value:false,observer:"_tog
gleIndeterminate"},disabled:{type:Boolean,value:false,reflectToAttribute:true,ob
server:"_disabledChanged"}},observers:["_progressChanged(secondaryProgress, valu
e, min, max)"],hostAttributes:{role:"progressbar"},_toggleIndeterminate:function
(indeterminate){this.toggleClass("indeterminate",indeterminate,this.$.primaryPro
gress)},_transformProgress:function(progress,ratio){var transform="scaleX("+rati
o/100+")";progress.style.transform=progress.style.webkitTransform=transform},_ma
inRatioChanged:function(ratio){this._transformProgress(this.$.primaryProgress,ra
tio)},_progressChanged:function(secondaryProgress,value,min,max){secondaryProgre
ss=this._clampValue(secondaryProgress);value=this._clampValue(value);var seconda
ryRatio=this._calcRatio(secondaryProgress)*100;var mainRatio=this._calcRatio(val
ue)*100;this._setSecondaryRatio(secondaryRatio);this._transformProgress(this.$.s
econdaryProgress,secondaryRatio);this._transformProgress(this.$.primaryProgress,
mainRatio);this.secondaryProgress=secondaryProgress;this.setAttribute("aria-valu
enow",value);this.setAttribute("aria-valuemin",min);this.setAttribute("aria-valu
emax",max)},_disabledChanged:function(disabled){this.setAttribute("aria-disabled
",disabled?"true":"false")},_hideSecondaryProgress:function(secondaryRatio){retu
rn secondaryRatio===0}});Polymer({is:"iron-iconset-svg",properties:{name:{type:S
tring,observer:"_nameChanged"},size:{type:Number,value:24},rtlMirroring:{type:Bo
olean,value:false}},_targetIsRTL:function(target){if(target&&target.nodeType!==N
ode.ELEMENT_NODE){target=target.host}return target&&window.getComputedStyle(targ
et)["direction"]==="rtl"},attached:function(){this.style.display="none"},getIcon
Names:function(){this._icons=this._createIconMap();return Object.keys(this._icon
s).map(function(n){return this.name+":"+n},this)},applyIcon:function(element,ico
nName){element=element.root||element;this.removeIcon(element);var svg=this._clon
eIcon(iconName,this.rtlMirroring&&this._targetIsRTL(element));if(svg){var pde=Po
lymer.dom(element);pde.insertBefore(svg,pde.childNodes[0]);return element._svgIc
on=svg}return null},removeIcon:function(element){element=element.root||element;i
f(element._svgIcon){Polymer.dom(element).removeChild(element._svgIcon);element._
svgIcon=null}},_nameChanged:function(){new Polymer.IronMeta({type:"iconset",key:
this.name,value:this});this.async(function(){this.fire("iron-iconset-added",this
,{node:window})})},_createIconMap:function(){var icons=Object.create(null);Polym
er.dom(this).querySelectorAll("[id]").forEach(function(icon){icons[icon.id]=icon
});return icons},_cloneIcon:function(id,mirrorAllowed){this._icons=this._icons||
this._createIconMap();return this._prepareSvgClone(this._icons[id],this.size,mir
rorAllowed)},_prepareSvgClone:function(sourceSvg,size,mirrorAllowed){if(sourceSv
g){var content=sourceSvg.cloneNode(true),svg=document.createElementNS("http://ww
w.w3.org/2000/svg","svg"),viewBox=content.getAttribute("viewBox")||"0 0 "+size+"
"+size,cssText="pointer-events: none; display: block; width: 100%; height: 100%
;";if(mirrorAllowed&&content.hasAttribute("mirror-in-rtl")){cssText+="-webkit-tr
ansform:scale(-1,1);transform:scale(-1,1);"}svg.setAttribute("viewBox",viewBox);
svg.setAttribute("preserveAspectRatio","xMidYMid meet");svg.style.cssText=cssTex
t;svg.appendChild(content).removeAttribute("id");return svg}return null}}); | 42 var ActionLink=document.registerElement("action-link",{prototype:{__proto__:HTML
AnchorElement.prototype,createdCallback:function(){this.tabIndex=this.disabled?-
1:0;if(!this.hasAttribute("role"))this.setAttribute("role","link");this.addEvent
Listener("keydown",function(e){if(!this.disabled&&e.key=="Enter"&&!this.href){wi
ndow.setTimeout(this.click.bind(this),0)}});function preventDefault(e){e.prevent
Default()}function removePreventDefault(){document.removeEventListener("selectst
art",preventDefault);document.removeEventListener("mouseup",removePreventDefault
)}this.addEventListener("mousedown",function(){document.addEventListener("select
start",preventDefault);document.addEventListener("mouseup",removePreventDefault)
;if(document.activeElement!=this)this.classList.add("no-outline")});this.addEven
tListener("blur",function(){this.classList.remove("no-outline")})},set disabled(
disabled){if(disabled)HTMLAnchorElement.prototype.setAttribute.call(this,"disabl
ed","");else HTMLAnchorElement.prototype.removeAttribute.call(this,"disabled");t
his.tabIndex=disabled?-1:0},get disabled(){return this.hasAttribute("disabled")}
,setAttribute:function(attr,val){if(attr.toLowerCase()=="disabled")this.disabled
=true;else HTMLAnchorElement.prototype.setAttribute.apply(this,arguments)},remov
eAttribute:function(attr){if(attr.toLowerCase()=="disabled")this.disabled=false;
else HTMLAnchorElement.prototype.removeAttribute.apply(this,arguments)}},"extend
s":"a"});(function(){var metaDatas={};var metaArrays={};var singleton=null;Polym
er.IronMeta=Polymer({is:"iron-meta",properties:{type:{type:String,value:"default
",observer:"_typeChanged"},key:{type:String,observer:"_keyChanged"},value:{type:
Object,notify:true,observer:"_valueChanged"},self:{type:Boolean,observer:"_selfC
hanged"},list:{type:Array,notify:true}},hostAttributes:{hidden:true},factoryImpl
:function(config){if(config){for(var n in config){switch(n){case"type":case"key"
:case"value":this[n]=config[n];break}}}},created:function(){this._metaDatas=meta
Datas;this._metaArrays=metaArrays},_keyChanged:function(key,old){this._resetRegi
stration(old)},_valueChanged:function(value){this._resetRegistration(this.key)},
_selfChanged:function(self){if(self){this.value=this}},_typeChanged:function(typ
e){this._unregisterKey(this.key);if(!metaDatas[type]){metaDatas[type]={}}this._m
etaData=metaDatas[type];if(!metaArrays[type]){metaArrays[type]=[]}this.list=meta
Arrays[type];this._registerKeyValue(this.key,this.value)},byKey:function(key){re
turn this._metaData&&this._metaData[key]},_resetRegistration:function(oldKey){th
is._unregisterKey(oldKey);this._registerKeyValue(this.key,this.value)},_unregist
erKey:function(key){this._unregister(key,this._metaData,this.list)},_registerKey
Value:function(key,value){this._register(key,value,this._metaData,this.list)},_r
egister:function(key,value,data,list){if(key&&data&&value!==undefined){data[key]
=value;list.push(value)}},_unregister:function(key,data,list){if(key&&data){if(k
ey in data){var value=data[key];delete data[key];this.arrayDelete(list,value)}}}
});Polymer.IronMeta.getIronMeta=function getIronMeta(){if(singleton===null){sing
leton=new Polymer.IronMeta}return singleton};Polymer.IronMetaQuery=Polymer({is:"
iron-meta-query",properties:{type:{type:String,value:"default",observer:"_typeCh
anged"},key:{type:String,observer:"_keyChanged"},value:{type:Object,notify:true,
readOnly:true},list:{type:Array,notify:true}},factoryImpl:function(config){if(co
nfig){for(var n in config){switch(n){case"type":case"key":this[n]=config[n];brea
k}}}},created:function(){this._metaDatas=metaDatas;this._metaArrays=metaArrays},
_keyChanged:function(key){this._setValue(this._metaData&&this._metaData[key])},_
typeChanged:function(type){this._metaData=metaDatas[type];this.list=metaArrays[t
ype];if(this.key){this._keyChanged(this.key)}},byKey:function(key){return this._
metaData&&this._metaData[key]}})})();Polymer({is:"iron-icon",properties:{icon:{t
ype:String,observer:"_iconChanged"},theme:{type:String,observer:"_updateIcon"},s
rc:{type:String,observer:"_srcChanged"},_meta:{value:Polymer.Base.create("iron-m
eta",{type:"iconset"}),observer:"_updateIcon"}},_DEFAULT_ICONSET:"icons",_iconCh
anged:function(icon){var parts=(icon||"").split(":");this._iconName=parts.pop();
this._iconsetName=parts.pop()||this._DEFAULT_ICONSET;this._updateIcon()},_srcCha
nged:function(src){this._updateIcon()},_usesIconset:function(){return this.icon|
|!this.src},_updateIcon:function(){if(this._usesIconset()){if(this._img&&this._i
mg.parentNode){Polymer.dom(this.root).removeChild(this._img)}if(this._iconName==
=""){if(this._iconset){this._iconset.removeIcon(this)}}else if(this._iconsetName
&&this._meta){this._iconset=this._meta.byKey(this._iconsetName);if(this._iconset
){this._iconset.applyIcon(this,this._iconName,this.theme);this.unlisten(window,"
iron-iconset-added","_updateIcon")}else{this.listen(window,"iron-iconset-added",
"_updateIcon")}}}else{if(this._iconset){this._iconset.removeIcon(this)}if(!this.
_img){this._img=document.createElement("img");this._img.style.width="100%";this.
_img.style.height="100%";this._img.draggable=false}this._img.src=this.src;Polyme
r.dom(this.root).appendChild(this._img)}}});Polymer.IronControlState={properties
:{focused:{type:Boolean,value:false,notify:true,readOnly:true,reflectToAttribute
:true},disabled:{type:Boolean,value:false,notify:true,observer:"_disabledChanged
",reflectToAttribute:true},_oldTabIndex:{type:Number},_boundFocusBlurHandler:{ty
pe:Function,value:function(){return this._focusBlurHandler.bind(this)}}},observe
rs:["_changedControlState(focused, disabled)"],ready:function(){this.addEventLis
tener("focus",this._boundFocusBlurHandler,true);this.addEventListener("blur",thi
s._boundFocusBlurHandler,true)},_focusBlurHandler:function(event){if(event.targe
t===this){this._setFocused(event.type==="focus")}else if(!this.shadowRoot){var t
arget=Polymer.dom(event).localTarget;if(!this.isLightDescendant(target)){this.fi
re(event.type,{sourceEvent:event},{node:this,bubbles:event.bubbles,cancelable:ev
ent.cancelable})}}},_disabledChanged:function(disabled,old){this.setAttribute("a
ria-disabled",disabled?"true":"false");this.style.pointerEvents=disabled?"none":
"";if(disabled){this._oldTabIndex=this.tabIndex;this._setFocused(false);this.tab
Index=-1;this.blur()}else if(this._oldTabIndex!==undefined){this.tabIndex=this._
oldTabIndex}},_changedControlState:function(){if(this._controlStateChanged){this
._controlStateChanged()}}};Polymer.IronButtonStateImpl={properties:{pressed:{typ
e:Boolean,readOnly:true,value:false,reflectToAttribute:true,observer:"_pressedCh
anged"},toggles:{type:Boolean,value:false,reflectToAttribute:true},active:{type:
Boolean,value:false,notify:true,reflectToAttribute:true},pointerDown:{type:Boole
an,readOnly:true,value:false},receivedFocusFromKeyboard:{type:Boolean,readOnly:t
rue},ariaActiveAttribute:{type:String,value:"aria-pressed",observer:"_ariaActive
AttributeChanged"}},listeners:{down:"_downHandler",up:"_upHandler",tap:"_tapHand
ler"},observers:["_detectKeyboardFocus(focused)","_activeChanged(active, ariaAct
iveAttribute)"],keyBindings:{"enter:keydown":"_asyncClick","space:keydown":"_spa
ceKeyDownHandler","space:keyup":"_spaceKeyUpHandler"},_mouseEventRe:/^mouse/,_ta
pHandler:function(){if(this.toggles){this._userActivate(!this.active)}else{this.
active=false}},_detectKeyboardFocus:function(focused){this._setReceivedFocusFrom
Keyboard(!this.pointerDown&&focused)},_userActivate:function(active){if(this.act
ive!==active){this.active=active;this.fire("change")}},_downHandler:function(eve
nt){this._setPointerDown(true);this._setPressed(true);this._setReceivedFocusFrom
Keyboard(false)},_upHandler:function(){this._setPointerDown(false);this._setPres
sed(false)},_spaceKeyDownHandler:function(event){var keyboardEvent=event.detail.
keyboardEvent;var target=Polymer.dom(keyboardEvent).localTarget;if(this.isLightD
escendant(target))return;keyboardEvent.preventDefault();keyboardEvent.stopImmedi
atePropagation();this._setPressed(true)},_spaceKeyUpHandler:function(event){var
keyboardEvent=event.detail.keyboardEvent;var target=Polymer.dom(keyboardEvent).l
ocalTarget;if(this.isLightDescendant(target))return;if(this.pressed){this._async
Click()}this._setPressed(false)},_asyncClick:function(){this.async(function(){th
is.click()},1)},_pressedChanged:function(pressed){this._changedButtonState()},_a
riaActiveAttributeChanged:function(value,oldValue){if(oldValue&&oldValue!=value&
&this.hasAttribute(oldValue)){this.removeAttribute(oldValue)}},_activeChanged:fu
nction(active,ariaActiveAttribute){if(this.toggles){this.setAttribute(this.ariaA
ctiveAttribute,active?"true":"false")}else{this.removeAttribute(this.ariaActiveA
ttribute)}this._changedButtonState()},_controlStateChanged:function(){if(this.di
sabled){this._setPressed(false)}else{this._changedButtonState()}},_changedButton
State:function(){if(this._buttonStateChanged){this._buttonStateChanged()}}};Poly
mer.IronButtonState=[Polymer.IronA11yKeysBehavior,Polymer.IronButtonStateImpl];(
function(){var Utility={distance:function(x1,y1,x2,y2){var xDelta=x1-x2;var yDel
ta=y1-y2;return Math.sqrt(xDelta*xDelta+yDelta*yDelta)},now:window.performance&&
window.performance.now?window.performance.now.bind(window.performance):Date.now}
;function ElementMetrics(element){this.element=element;this.width=this.boundingR
ect.width;this.height=this.boundingRect.height;this.size=Math.max(this.width,thi
s.height)}ElementMetrics.prototype={get boundingRect(){return this.element.getBo
undingClientRect()},furthestCornerDistanceFrom:function(x,y){var topLeft=Utility
.distance(x,y,0,0);var topRight=Utility.distance(x,y,this.width,0);var bottomLef
t=Utility.distance(x,y,0,this.height);var bottomRight=Utility.distance(x,y,this.
width,this.height);return Math.max(topLeft,topRight,bottomLeft,bottomRight)}};fu
nction Ripple(element){this.element=element;this.color=window.getComputedStyle(e
lement).color;this.wave=document.createElement("div");this.waveContainer=documen
t.createElement("div");this.wave.style.backgroundColor=this.color;this.wave.clas
sList.add("wave");this.waveContainer.classList.add("wave-container");Polymer.dom
(this.waveContainer).appendChild(this.wave);this.resetInteractionState()}Ripple.
MAX_RADIUS=300;Ripple.prototype={get recenters(){return this.element.recenters},
get center(){return this.element.center},get mouseDownElapsed(){var elapsed;if(!
this.mouseDownStart){return 0}elapsed=Utility.now()-this.mouseDownStart;if(this.
mouseUpStart){elapsed-=this.mouseUpElapsed}return elapsed},get mouseUpElapsed(){
return this.mouseUpStart?Utility.now()-this.mouseUpStart:0},get mouseDownElapsed
Seconds(){return this.mouseDownElapsed/1e3},get mouseUpElapsedSeconds(){return t
his.mouseUpElapsed/1e3},get mouseInteractionSeconds(){return this.mouseDownElaps
edSeconds+this.mouseUpElapsedSeconds},get initialOpacity(){return this.element.i
nitialOpacity},get opacityDecayVelocity(){return this.element.opacityDecayVeloci
ty},get radius(){var width2=this.containerMetrics.width*this.containerMetrics.wi
dth;var height2=this.containerMetrics.height*this.containerMetrics.height;var wa
veRadius=Math.min(Math.sqrt(width2+height2),Ripple.MAX_RADIUS)*1.1+5;var duratio
n=1.1-.2*(waveRadius/Ripple.MAX_RADIUS);var timeNow=this.mouseInteractionSeconds
/duration;var size=waveRadius*(1-Math.pow(80,-timeNow));return Math.abs(size)},g
et opacity(){if(!this.mouseUpStart){return this.initialOpacity}return Math.max(0
,this.initialOpacity-this.mouseUpElapsedSeconds*this.opacityDecayVelocity)},get
outerOpacity(){var outerOpacity=this.mouseUpElapsedSeconds*.3;var waveOpacity=th
is.opacity;return Math.max(0,Math.min(outerOpacity,waveOpacity))},get isOpacityF
ullyDecayed(){return this.opacity<.01&&this.radius>=Math.min(this.maxRadius,Ripp
le.MAX_RADIUS)},get isRestingAtMaxRadius(){return this.opacity>=this.initialOpac
ity&&this.radius>=Math.min(this.maxRadius,Ripple.MAX_RADIUS)},get isAnimationCom
plete(){return this.mouseUpStart?this.isOpacityFullyDecayed:this.isRestingAtMaxR
adius},get translationFraction(){return Math.min(1,this.radius/this.containerMet
rics.size*2/Math.sqrt(2))},get xNow(){if(this.xEnd){return this.xStart+this.tran
slationFraction*(this.xEnd-this.xStart)}return this.xStart},get yNow(){if(this.y
End){return this.yStart+this.translationFraction*(this.yEnd-this.yStart)}return
this.yStart},get isMouseDown(){return this.mouseDownStart&&!this.mouseUpStart},r
esetInteractionState:function(){this.maxRadius=0;this.mouseDownStart=0;this.mous
eUpStart=0;this.xStart=0;this.yStart=0;this.xEnd=0;this.yEnd=0;this.slideDistanc
e=0;this.containerMetrics=new ElementMetrics(this.element)},draw:function(){var
scale;var translateString;var dx;var dy;this.wave.style.opacity=this.opacity;sca
le=this.radius/(this.containerMetrics.size/2);dx=this.xNow-this.containerMetrics
.width/2;dy=this.yNow-this.containerMetrics.height/2;this.waveContainer.style.we
bkitTransform="translate("+dx+"px, "+dy+"px)";this.waveContainer.style.transform
="translate3d("+dx+"px, "+dy+"px, 0)";this.wave.style.webkitTransform="scale("+s
cale+","+scale+")";this.wave.style.transform="scale3d("+scale+","+scale+",1)"},d
ownAction:function(event){var xCenter=this.containerMetrics.width/2;var yCenter=
this.containerMetrics.height/2;this.resetInteractionState();this.mouseDownStart=
Utility.now();if(this.center){this.xStart=xCenter;this.yStart=yCenter;this.slide
Distance=Utility.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)}else{this
.xStart=event?event.detail.x-this.containerMetrics.boundingRect.left:this.contai
nerMetrics.width/2;this.yStart=event?event.detail.y-this.containerMetrics.boundi
ngRect.top:this.containerMetrics.height/2}if(this.recenters){this.xEnd=xCenter;t
his.yEnd=yCenter;this.slideDistance=Utility.distance(this.xStart,this.yStart,thi
s.xEnd,this.yEnd)}this.maxRadius=this.containerMetrics.furthestCornerDistanceFro
m(this.xStart,this.yStart);this.waveContainer.style.top=(this.containerMetrics.h
eight-this.containerMetrics.size)/2+"px";this.waveContainer.style.left=(this.con
tainerMetrics.width-this.containerMetrics.size)/2+"px";this.waveContainer.style.
width=this.containerMetrics.size+"px";this.waveContainer.style.height=this.conta
inerMetrics.size+"px"},upAction:function(event){if(!this.isMouseDown){return}thi
s.mouseUpStart=Utility.now()},remove:function(){Polymer.dom(this.waveContainer.p
arentNode).removeChild(this.waveContainer)}};Polymer({is:"paper-ripple",behavior
s:[Polymer.IronA11yKeysBehavior],properties:{initialOpacity:{type:Number,value:.
25},opacityDecayVelocity:{type:Number,value:.8},recenters:{type:Boolean,value:fa
lse},center:{type:Boolean,value:false},ripples:{type:Array,value:function(){retu
rn[]}},animating:{type:Boolean,readOnly:true,reflectToAttribute:true,value:false
},holdDown:{type:Boolean,value:false,observer:"_holdDownChanged"},noink:{type:Bo
olean,value:false},_animating:{type:Boolean},_boundAnimate:{type:Function,value:
function(){return this.animate.bind(this)}}},get target(){return this.keyEventTa
rget},keyBindings:{"enter:keydown":"_onEnterKeydown","space:keydown":"_onSpaceKe
ydown","space:keyup":"_onSpaceKeyup"},attached:function(){if(this.parentNode.nod
eType==11){this.keyEventTarget=Polymer.dom(this).getOwnerRoot().host}else{this.k
eyEventTarget=this.parentNode}var keyEventTarget=this.keyEventTarget;this.listen
(keyEventTarget,"up","uiUpAction");this.listen(keyEventTarget,"down","uiDownActi
on")},detached:function(){this.unlisten(this.keyEventTarget,"up","uiUpAction");t
his.unlisten(this.keyEventTarget,"down","uiDownAction");this.keyEventTarget=null
},get shouldKeepAnimating(){for(var index=0;index<this.ripples.length;++index){i
f(!this.ripples[index].isAnimationComplete){return true}}return false},simulated
Ripple:function(){this.downAction(null);this.async(function(){this.upAction()},1
)},uiDownAction:function(event){if(!this.noink){this.downAction(event)}},downAct
ion:function(event){if(this.holdDown&&this.ripples.length>0){return}var ripple=t
his.addRipple();ripple.downAction(event);if(!this._animating){this._animating=tr
ue;this.animate()}},uiUpAction:function(event){if(!this.noink){this.upAction(eve
nt)}},upAction:function(event){if(this.holdDown){return}this.ripples.forEach(fun
ction(ripple){ripple.upAction(event)});this._animating=true;this.animate()},onAn
imationComplete:function(){this._animating=false;this.$.background.style.backgro
undColor=null;this.fire("transitionend")},addRipple:function(){var ripple=new Ri
pple(this);Polymer.dom(this.$.waves).appendChild(ripple.waveContainer);this.$.ba
ckground.style.backgroundColor=ripple.color;this.ripples.push(ripple);this._setA
nimating(true);return ripple},removeRipple:function(ripple){var rippleIndex=this
.ripples.indexOf(ripple);if(rippleIndex<0){return}this.ripples.splice(rippleInde
x,1);ripple.remove();if(!this.ripples.length){this._setAnimating(false)}},animat
e:function(){if(!this._animating){return}var index;var ripple;for(index=0;index<
this.ripples.length;++index){ripple=this.ripples[index];ripple.draw();this.$.bac
kground.style.opacity=ripple.outerOpacity;if(ripple.isOpacityFullyDecayed&&!ripp
le.isRestingAtMaxRadius){this.removeRipple(ripple)}}if(!this.shouldKeepAnimating
&&this.ripples.length===0){this.onAnimationComplete()}else{window.requestAnimati
onFrame(this._boundAnimate)}},_onEnterKeydown:function(){this.uiDownAction();thi
s.async(this.uiUpAction,1)},_onSpaceKeydown:function(){this.uiDownAction()},_onS
paceKeyup:function(){this.uiUpAction()},_holdDownChanged:function(newVal,oldVal)
{if(oldVal===undefined){return}if(newVal){this.downAction()}else{this.upAction()
}}})})();Polymer.PaperRippleBehavior={properties:{noink:{type:Boolean,observer:"
_noinkChanged"},_rippleContainer:{type:Object}},_buttonStateChanged:function(){i
f(this.focused){this.ensureRipple()}},_downHandler:function(event){Polymer.IronB
uttonStateImpl._downHandler.call(this,event);if(this.pressed){this.ensureRipple(
event)}},ensureRipple:function(optTriggeringEvent){if(!this.hasRipple()){this._r
ipple=this._createRipple();this._ripple.noink=this.noink;var rippleContainer=thi
s._rippleContainer||this.root;if(rippleContainer){Polymer.dom(rippleContainer).a
ppendChild(this._ripple)}if(optTriggeringEvent){var domContainer=Polymer.dom(thi
s._rippleContainer||this);var target=Polymer.dom(optTriggeringEvent).rootTarget;
if(domContainer.deepContains(target)){this._ripple.uiDownAction(optTriggeringEve
nt)}}}},getRipple:function(){this.ensureRipple();return this._ripple},hasRipple:
function(){return Boolean(this._ripple)},_createRipple:function(){return documen
t.createElement("paper-ripple")},_noinkChanged:function(noink){if(this.hasRipple
()){this._ripple.noink=noink}}};Polymer.PaperButtonBehaviorImpl={properties:{ele
vation:{type:Number,reflectToAttribute:true,readOnly:true}},observers:["_calcula
teElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)","_co
mputeKeyboardClass(receivedFocusFromKeyboard)"],hostAttributes:{role:"button",ta
bindex:"0",animated:true},_calculateElevation:function(){var e=1;if(this.disable
d){e=0}else if(this.active||this.pressed){e=4}else if(this.receivedFocusFromKeyb
oard){e=3}this._setElevation(e)},_computeKeyboardClass:function(receivedFocusFro
mKeyboard){this.toggleClass("keyboard-focus",receivedFocusFromKeyboard)},_spaceK
eyDownHandler:function(event){Polymer.IronButtonStateImpl._spaceKeyDownHandler.c
all(this,event);if(this.hasRipple()&&this.getRipple().ripples.length<1){this._ri
pple.uiDownAction()}},_spaceKeyUpHandler:function(event){Polymer.IronButtonState
Impl._spaceKeyUpHandler.call(this,event);if(this.hasRipple()){this._ripple.uiUpA
ction()}}};Polymer.PaperButtonBehavior=[Polymer.IronButtonState,Polymer.IronCont
rolState,Polymer.PaperRippleBehavior,Polymer.PaperButtonBehaviorImpl];Polymer({i
s:"paper-button",behaviors:[Polymer.PaperButtonBehavior],properties:{raised:{typ
e:Boolean,reflectToAttribute:true,value:false,observer:"_calculateElevation"}},_
calculateElevation:function(){if(!this.raised){this._setElevation(0)}else{Polyme
r.PaperButtonBehaviorImpl._calculateElevation.apply(this)}}});Polymer({is:"paper
-icon-button-light","extends":"button",behaviors:[Polymer.PaperRippleBehavior],l
isteners:{down:"_rippleDown",up:"_rippleUp",focus:"_rippleDown",blur:"_rippleUp"
},_rippleDown:function(){this.getRipple().downAction()},_rippleUp:function(){thi
s.getRipple().upAction()},ensureRipple:function(var_args){var lastRipple=this._r
ipple;Polymer.PaperRippleBehavior.ensureRipple.apply(this,arguments);if(this._ri
pple&&this._ripple!==lastRipple){this._ripple.center=true;this._ripple.classList
.add("circle")}}});Polymer.IronRangeBehavior={properties:{value:{type:Number,val
ue:0,notify:true,reflectToAttribute:true},min:{type:Number,value:0,notify:true},
max:{type:Number,value:100,notify:true},step:{type:Number,value:1,notify:true},r
atio:{type:Number,value:0,readOnly:true,notify:true}},observers:["_update(value,
min, max, step)"],_calcRatio:function(value){return(this._clampValue(value)-thi
s.min)/(this.max-this.min)},_clampValue:function(value){return Math.min(this.max
,Math.max(this.min,this._calcStep(value)))},_calcStep:function(value){value=pars
eFloat(value);if(!this.step){return value}var numSteps=Math.round((value-this.mi
n)/this.step);if(this.step<1){return numSteps/(1/this.step)+this.min}else{return
numSteps*this.step+this.min}},_validateValue:function(){var v=this._clampValue(
this.value);this.value=this.oldValue=isNaN(v)?this.oldValue:v;return this.value!
==v},_update:function(){this._validateValue();this._setRatio(this._calcRatio(thi
s.value)*100)}};Polymer({is:"paper-progress",behaviors:[Polymer.IronRangeBehavio
r],properties:{secondaryProgress:{type:Number,value:0},secondaryRatio:{type:Numb
er,value:0,readOnly:true},indeterminate:{type:Boolean,value:false,observer:"_tog
gleIndeterminate"},disabled:{type:Boolean,value:false,reflectToAttribute:true,ob
server:"_disabledChanged"}},observers:["_progressChanged(secondaryProgress, valu
e, min, max)"],hostAttributes:{role:"progressbar"},_toggleIndeterminate:function
(indeterminate){this.toggleClass("indeterminate",indeterminate,this.$.primaryPro
gress)},_transformProgress:function(progress,ratio){var transform="scaleX("+rati
o/100+")";progress.style.transform=progress.style.webkitTransform=transform},_ma
inRatioChanged:function(ratio){this._transformProgress(this.$.primaryProgress,ra
tio)},_progressChanged:function(secondaryProgress,value,min,max){secondaryProgre
ss=this._clampValue(secondaryProgress);value=this._clampValue(value);var seconda
ryRatio=this._calcRatio(secondaryProgress)*100;var mainRatio=this._calcRatio(val
ue)*100;this._setSecondaryRatio(secondaryRatio);this._transformProgress(this.$.s
econdaryProgress,secondaryRatio);this._transformProgress(this.$.primaryProgress,
mainRatio);this.secondaryProgress=secondaryProgress;this.setAttribute("aria-valu
enow",value);this.setAttribute("aria-valuemin",min);this.setAttribute("aria-valu
emax",max)},_disabledChanged:function(disabled){this.setAttribute("aria-disabled
",disabled?"true":"false")},_hideSecondaryProgress:function(secondaryRatio){retu
rn secondaryRatio===0}});Polymer({is:"iron-iconset-svg",properties:{name:{type:S
tring,observer:"_nameChanged"},size:{type:Number,value:24},rtlMirroring:{type:Bo
olean,value:false}},_targetIsRTL:function(target){if(target&&target.nodeType!==N
ode.ELEMENT_NODE){target=target.host}return target&&window.getComputedStyle(targ
et)["direction"]==="rtl"},attached:function(){this.style.display="none"},getIcon
Names:function(){this._icons=this._createIconMap();return Object.keys(this._icon
s).map(function(n){return this.name+":"+n},this)},applyIcon:function(element,ico
nName){element=element.root||element;this.removeIcon(element);var svg=this._clon
eIcon(iconName,this.rtlMirroring&&this._targetIsRTL(element));if(svg){var pde=Po
lymer.dom(element);pde.insertBefore(svg,pde.childNodes[0]);return element._svgIc
on=svg}return null},removeIcon:function(element){element=element.root||element;i
f(element._svgIcon){Polymer.dom(element).removeChild(element._svgIcon);element._
svgIcon=null}},_nameChanged:function(){new Polymer.IronMeta({type:"iconset",key:
this.name,value:this});this.async(function(){this.fire("iron-iconset-added",this
,{node:window})})},_createIconMap:function(){var icons=Object.create(null);Polym
er.dom(this).querySelectorAll("[id]").forEach(function(icon){icons[icon.id]=icon
});return icons},_cloneIcon:function(id,mirrorAllowed){this._icons=this._icons||
this._createIconMap();return this._prepareSvgClone(this._icons[id],this.size,mir
rorAllowed)},_prepareSvgClone:function(sourceSvg,size,mirrorAllowed){if(sourceSv
g){var content=sourceSvg.cloneNode(true),svg=document.createElementNS("http://ww
w.w3.org/2000/svg","svg"),viewBox=content.getAttribute("viewBox")||"0 0 "+size+"
"+size,cssText="pointer-events: none; display: block; width: 100%; height: 100%
;";if(mirrorAllowed&&content.hasAttribute("mirror-in-rtl")){cssText+="-webkit-tr
ansform:scale(-1,1);transform:scale(-1,1);"}svg.setAttribute("viewBox",viewBox);
svg.setAttribute("preserveAspectRatio","xMidYMid meet");svg.style.cssText=cssTex
t;svg.appendChild(content).removeAttribute("id");return svg}return null}}); |
| 43 // Copyright 2015 The Chromium Authors. All rights reserved. | 43 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 44 // Use of this source code is governed by a BSD-style license that can be | 44 // Use of this source code is governed by a BSD-style license that can be |
| 45 // found in the LICENSE file. | 45 // found in the LICENSE file. |
| 46 cr.define("downloads",function(){var Item=Polymer({is:"downloads-item",propertie
s:{data:{type:Object},completelyOnDisk_:{computed:"computeCompletelyOnDisk_("+"d
ata.state, data.file_externally_removed)",type:Boolean,value:true},controlledBy_
:{computed:"computeControlledBy_(data.by_ext_id, data.by_ext_name)",type:String,
value:""},isActive_:{computed:"computeIsActive_("+"data.state, data.file_externa
lly_removed)",type:Boolean,value:true},isDangerous_:{computed:"computeIsDangerou
s_(data.state)",type:Boolean,value:false},isMalware_:{computed:"computeIsMalware
_(isDangerous_, data.danger_type)",type:Boolean,value:false},isInProgress_:{comp
uted:"computeIsInProgress_(data.state)",type:Boolean,value:false},pauseOrResumeT
ext_:{computed:"computePauseOrResumeText_(isInProgress_, data.resume)",type:Stri
ng},showCancel_:{computed:"computeShowCancel_(data.state)",type:Boolean,value:fa
lse},showProgress_:{computed:"computeShowProgress_(showCancel_, data.percent)",t
ype:Boolean,value:false}},observers:["observeControlledBy_(controlledBy_)","obse
rveIsDangerous_(isDangerous_, data)"],ready:function(){this.content=this.$.conte
nt},computeClass_:function(){var classes=[];if(this.isActive_)classes.push("is-a
ctive");if(this.isDangerous_)classes.push("dangerous");if(this.showProgress_)cla
sses.push("show-progress");return classes.join(" ")},computeCompletelyOnDisk_:fu
nction(){return this.data.state==downloads.States.COMPLETE&&!this.data.file_exte
rnally_removed},computeControlledBy_:function(){if(!this.data.by_ext_id||!this.d
ata.by_ext_name)return"";var url="chrome://extensions#"+this.data.by_ext_id;var
name=this.data.by_ext_name;return loadTimeData.getStringF("controlledByUrl",url,
name)},computeDangerIcon_:function(){if(!this.isDangerous_)return"";switch(this.
data.danger_type){case downloads.DangerType.DANGEROUS_CONTENT:case downloads.Dan
gerType.DANGEROUS_HOST:case downloads.DangerType.DANGEROUS_URL:case downloads.Da
ngerType.POTENTIALLY_UNWANTED:case downloads.DangerType.UNCOMMON_CONTENT:return"
downloads:remove-circle";default:return"cr:warning"}},computeDate_:function(){as
sert(typeof this.data.hideDate=="boolean");if(this.data.hideDate)return"";return
assert(this.data.since_string||this.data.date_string)},computeDescription_:func
tion(){var data=this.data;switch(data.state){case downloads.States.DANGEROUS:var
fileName=data.file_name;switch(data.danger_type){case downloads.DangerType.DANG
EROUS_FILE:return loadTimeData.getString("dangerFileDesc");case downloads.Danger
Type.DANGEROUS_URL:case downloads.DangerType.DANGEROUS_CONTENT:case downloads.Da
ngerType.DANGEROUS_HOST:return loadTimeData.getString("dangerDownloadDesc");case
downloads.DangerType.UNCOMMON_CONTENT:return loadTimeData.getString("dangerUnco
mmonDesc");case downloads.DangerType.POTENTIALLY_UNWANTED:return loadTimeData.ge
tString("dangerSettingsDesc")}break;case downloads.States.IN_PROGRESS:case downl
oads.States.PAUSED:return data.progress_status_text}return""},computeIsActive_:f
unction(){return this.data.state!=downloads.States.CANCELLED&&this.data.state!=d
ownloads.States.INTERRUPTED&&!this.data.file_externally_removed},computeIsDanger
ous_:function(){return this.data.state==downloads.States.DANGEROUS},computeIsInP
rogress_:function(){return this.data.state==downloads.States.IN_PROGRESS},comput
eIsMalware_:function(){return this.isDangerous_&&(this.data.danger_type==downloa
ds.DangerType.DANGEROUS_CONTENT||this.data.danger_type==downloads.DangerType.DAN
GEROUS_HOST||this.data.danger_type==downloads.DangerType.DANGEROUS_URL||this.dat
a.danger_type==downloads.DangerType.POTENTIALLY_UNWANTED)},computePauseOrResumeT
ext_:function(){if(this.isInProgress_)return loadTimeData.getString("controlPaus
e");if(this.data.resume)return loadTimeData.getString("controlResume");return""}
,computeRemoveStyle_:function(){var canDelete=loadTimeData.getBoolean("allowDele
tingHistory");var hideRemove=this.isDangerous_||this.showCancel_||!canDelete;ret
urn hideRemove?"visibility: hidden":""},computeShowCancel_:function(){return thi
s.data.state==downloads.States.IN_PROGRESS||this.data.state==downloads.States.PA
USED},computeShowProgress_:function(){return this.showCancel_&&this.data.percent
>=-1},computeTag_:function(){switch(this.data.state){case downloads.States.CANCE
LLED:return loadTimeData.getString("statusCancelled");case downloads.States.INTE
RRUPTED:return this.data.last_reason_text;case downloads.States.COMPLETE:return
this.data.file_externally_removed?loadTimeData.getString("statusRemoved"):""}ret
urn""},isIndeterminate_:function(){return this.data.percent==-1},observeControll
edBy_:function(){this.$["controlled-by"].innerHTML=this.controlledBy_},observeIs
Dangerous_:function(){if(!this.data)return;if(this.isDangerous_){this.$.url.remo
veAttribute("href")}else{this.$.url.href=assert(this.data.url);var filePath=enco
deURIComponent(this.data.file_path);var scaleFactor="?scale="+window.devicePixel
Ratio+"x";this.$["file-icon"].src="chrome://fileicon/"+filePath+scaleFactor}},on
CancelTap_:function(){downloads.ActionService.getInstance().cancel(this.data.id)
},onDiscardDangerousTap_:function(){downloads.ActionService.getInstance().discar
dDangerous(this.data.id)},onDragStart_:function(e){e.preventDefault();downloads.
ActionService.getInstance().drag(this.data.id)},onFileLinkTap_:function(e){e.pre
ventDefault();downloads.ActionService.getInstance().openFile(this.data.id)},onPa
useOrResumeTap_:function(){if(this.isInProgress_)downloads.ActionService.getInst
ance().pause(this.data.id);else downloads.ActionService.getInstance().resume(thi
s.data.id)},onRemoveTap_:function(){downloads.ActionService.getInstance().remove
(this.data.id)},onRetryTap_:function(){downloads.ActionService.getInstance().dow
nload(this.data.url)},onSaveDangerousTap_:function(){downloads.ActionService.get
Instance().saveDangerous(this.data.id)},onShowTap_:function(){downloads.ActionSe
rvice.getInstance().show(this.data.id)}});return{Item:Item}});Polymer.PaperItemB
ehaviorImpl={hostAttributes:{role:"option",tabindex:"0"}};Polymer.PaperItemBehav
ior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperItemBehaviorI
mpl];Polymer({is:"paper-item",behaviors:[Polymer.PaperItemBehavior]});Polymer.Ir
onSelection=function(selectCallback){this.selection=[];this.selectCallback=selec
tCallback};Polymer.IronSelection.prototype={get:function(){return this.multi?thi
s.selection.slice():this.selection[0]},clear:function(excludes){this.selection.s
lice().forEach(function(item){if(!excludes||excludes.indexOf(item)<0){this.setIt
emSelected(item,false)}},this)},isSelected:function(item){return this.selection.
indexOf(item)>=0},setItemSelected:function(item,isSelected){if(item!=null){if(is
Selected!==this.isSelected(item)){if(isSelected){this.selection.push(item)}else{
var i=this.selection.indexOf(item);if(i>=0){this.selection.splice(i,1)}}if(this.
selectCallback){this.selectCallback(item,isSelected)}}}},select:function(item){i
f(this.multi){this.toggle(item)}else if(this.get()!==item){this.setItemSelected(
this.get(),false);this.setItemSelected(item,true)}},toggle:function(item){this.s
etItemSelected(item,!this.isSelected(item))}};Polymer.IronSelectableBehavior={pr
operties:{attrForSelected:{type:String,value:null},selected:{type:String,notify:
true},selectedItem:{type:Object,readOnly:true,notify:true},activateEvent:{type:S
tring,value:"tap",observer:"_activateEventChanged"},selectable:String,selectedCl
ass:{type:String,value:"iron-selected"},selectedAttribute:{type:String,value:nul
l},fallbackSelection:{type:String,value:null},items:{type:Array,readOnly:true,no
tify:true,value:function(){return[]}},_excludedLocalNames:{type:Object,value:fun
ction(){return{template:1}}}},observers:["_updateAttrForSelected(attrForSelected
)","_updateSelected(selected)","_checkFallback(fallbackSelection)"],created:func
tion(){this._bindFilterItem=this._filterItem.bind(this);this._selection=new Poly
mer.IronSelection(this._applySelection.bind(this))},attached:function(){this._ob
server=this._observeItems(this);this._updateItems();if(!this._shouldUpdateSelect
ion){this._updateSelected()}this._addListener(this.activateEvent)},detached:func
tion(){if(this._observer){Polymer.dom(this).unobserveNodes(this._observer)}this.
_removeListener(this.activateEvent)},indexOf:function(item){return this.items.in
dexOf(item)},select:function(value){this.selected=value},selectPrevious:function
(){var length=this.items.length;var index=(Number(this._valueToIndex(this.select
ed))-1+length)%length;this.selected=this._indexToValue(index)},selectNext:functi
on(){var index=(Number(this._valueToIndex(this.selected))+1)%this.items.length;t
his.selected=this._indexToValue(index)},selectIndex:function(index){this.select(
this._indexToValue(index))},forceSynchronousItemUpdate:function(){this._updateIt
ems()},get _shouldUpdateSelection(){return this.selected!=null},_checkFallback:f
unction(){if(this._shouldUpdateSelection){this._updateSelected()}},_addListener:
function(eventName){this.listen(this,eventName,"_activateHandler")},_removeListe
ner:function(eventName){this.unlisten(this,eventName,"_activateHandler")},_activ
ateEventChanged:function(eventName,old){this._removeListener(old);this._addListe
ner(eventName)},_updateItems:function(){var nodes=Polymer.dom(this).queryDistrib
utedElements(this.selectable||"*");nodes=Array.prototype.filter.call(nodes,this.
_bindFilterItem);this._setItems(nodes)},_updateAttrForSelected:function(){if(thi
s._shouldUpdateSelection){this.selected=this._indexToValue(this.indexOf(this.sel
ectedItem))}},_updateSelected:function(){this._selectSelected(this.selected)},_s
electSelected:function(selected){this._selection.select(this._valueToItem(this.s
elected));if(this.fallbackSelection&&this.items.length&&this._selection.get()===
undefined){this.selected=this.fallbackSelection}},_filterItem:function(node){ret
urn!this._excludedLocalNames[node.localName]},_valueToItem:function(value){retur
n value==null?null:this.items[this._valueToIndex(value)]},_valueToIndex:function
(value){if(this.attrForSelected){for(var i=0,item;item=this.items[i];i++){if(thi
s._valueForItem(item)==value){return i}}}else{return Number(value)}},_indexToVal
ue:function(index){if(this.attrForSelected){var item=this.items[index];if(item){
return this._valueForItem(item)}}else{return index}},_valueForItem:function(item
){var propValue=item[Polymer.CaseMap.dashToCamelCase(this.attrForSelected)];retu
rn propValue!=undefined?propValue:item.getAttribute(this.attrForSelected)},_appl
ySelection:function(item,isSelected){if(this.selectedClass){this.toggleClass(thi
s.selectedClass,isSelected,item)}if(this.selectedAttribute){this.toggleAttribute
(this.selectedAttribute,isSelected,item)}this._selectionChange();this.fire("iron
-"+(isSelected?"select":"deselect"),{item:item})},_selectionChange:function(){th
is._setSelectedItem(this._selection.get())},_observeItems:function(node){return
Polymer.dom(node).observeNodes(function(mutation){this._updateItems();if(this._s
houldUpdateSelection){this._updateSelected()}this.fire("iron-items-changed",muta
tion,{bubbles:false,cancelable:false})})},_activateHandler:function(e){var t=e.t
arget;var items=this.items;while(t&&t!=this){var i=items.indexOf(t);if(i>=0){var
value=this._indexToValue(i);this._itemActivate(value,t);return}t=t.parentNode}}
,_itemActivate:function(value,item){if(!this.fire("iron-activate",{selected:valu
e,item:item},{cancelable:true}).defaultPrevented){this.select(value)}}};Polymer.
IronMultiSelectableBehaviorImpl={properties:{multi:{type:Boolean,value:false,obs
erver:"multiChanged"},selectedValues:{type:Array,notify:true},selectedItems:{typ
e:Array,readOnly:true,notify:true}},observers:["_updateSelected(selectedValues.s
plices)"],select:function(value){if(this.multi){if(this.selectedValues){this._to
ggleSelected(value)}else{this.selectedValues=[value]}}else{this.selected=value}}
,multiChanged:function(multi){this._selection.multi=multi},get _shouldUpdateSele
ction(){return this.selected!=null||this.selectedValues!=null&&this.selectedValu
es.length},_updateAttrForSelected:function(){if(!this.multi){Polymer.IronSelecta
bleBehavior._updateAttrForSelected.apply(this)}else if(this._shouldUpdateSelecti
on){this.selectedValues=this.selectedItems.map(function(selectedItem){return thi
s._indexToValue(this.indexOf(selectedItem))},this).filter(function(unfilteredVal
ue){return unfilteredValue!=null},this)}},_updateSelected:function(){if(this.mul
ti){this._selectMulti(this.selectedValues)}else{this._selectSelected(this.select
ed)}},_selectMulti:function(values){if(values){var selectedItems=this._valuesToI
tems(values);this._selection.clear(selectedItems);for(var i=0;i<selectedItems.le
ngth;i++){this._selection.setItemSelected(selectedItems[i],true)}if(this.fallbac
kSelection&&this.items.length&&!this._selection.get().length){var fallback=this.
_valueToItem(this.fallbackSelection);if(fallback){this.selectedValues=[this.fall
backSelection]}}}else{this._selection.clear()}},_selectionChange:function(){var
s=this._selection.get();if(this.multi){this._setSelectedItems(s)}else{this._setS
electedItems([s]);this._setSelectedItem(s)}},_toggleSelected:function(value){var
i=this.selectedValues.indexOf(value);var unselected=i<0;if(unselected){this.pus
h("selectedValues",value)}else{this.splice("selectedValues",i,1)}},_valuesToItem
s:function(values){return values==null?null:values.map(function(value){return th
is._valueToItem(value)},this)}};Polymer.IronMultiSelectableBehavior=[Polymer.Iro
nSelectableBehavior,Polymer.IronMultiSelectableBehaviorImpl];Polymer.IronMenuBeh
aviorImpl={properties:{focusedItem:{observer:"_focusedItemChanged",readOnly:true
,type:Object},attrForItemTitle:{type:String}},hostAttributes:{role:"menu",tabind
ex:"0"},observers:["_updateMultiselectable(multi)"],listeners:{focus:"_onFocus",
keydown:"_onKeydown","iron-items-changed":"_onIronItemsChanged"},keyBindings:{up
:"_onUpKey",down:"_onDownKey",esc:"_onEscKey","shift+tab:keydown":"_onShiftTabDo
wn"},attached:function(){this._resetTabindices()},select:function(value){if(this
._defaultFocusAsync){this.cancelAsync(this._defaultFocusAsync);this._defaultFocu
sAsync=null}var item=this._valueToItem(value);if(item&&item.hasAttribute("disabl
ed"))return;this._setFocusedItem(item);Polymer.IronMultiSelectableBehaviorImpl.s
elect.apply(this,arguments)},_resetTabindices:function(){var selectedItem=this.m
ulti?this.selectedItems&&this.selectedItems[0]:this.selectedItem;this.items.forE
ach(function(item){item.setAttribute("tabindex",item===selectedItem?"0":"-1")},t
his)},_updateMultiselectable:function(multi){if(multi){this.setAttribute("aria-m
ultiselectable","true")}else{this.removeAttribute("aria-multiselectable")}},_foc
usWithKeyboardEvent:function(event){for(var i=0,item;item=this.items[i];i++){var
attr=this.attrForItemTitle||"textContent";var title=item[attr]||item.getAttribu
te(attr);if(!item.hasAttribute("disabled")&&title&&title.trim().charAt(0).toLowe
rCase()===String.fromCharCode(event.keyCode).toLowerCase()){this._setFocusedItem
(item);break}}},_focusPrevious:function(){var length=this.items.length;var curFo
cusIndex=Number(this.indexOf(this.focusedItem));for(var i=1;i<length+1;i++){var
item=this.items[(curFocusIndex-i+length)%length];if(!item.hasAttribute("disabled
")){var owner=Polymer.dom(item).getOwnerRoot()||document;this._setFocusedItem(it
em);if(Polymer.dom(owner).activeElement==item){return}}}},_focusNext:function(){
var length=this.items.length;var curFocusIndex=Number(this.indexOf(this.focusedI
tem));for(var i=1;i<length+1;i++){var item=this.items[(curFocusIndex+i)%length];
if(!item.hasAttribute("disabled")){var owner=Polymer.dom(item).getOwnerRoot()||d
ocument;this._setFocusedItem(item);if(Polymer.dom(owner).activeElement==item){re
turn}}}},_applySelection:function(item,isSelected){if(isSelected){item.setAttrib
ute("aria-selected","true")}else{item.removeAttribute("aria-selected")}Polymer.I
ronSelectableBehavior._applySelection.apply(this,arguments)},_focusedItemChanged
:function(focusedItem,old){old&&old.setAttribute("tabindex","-1");if(focusedItem
){focusedItem.setAttribute("tabindex","0");focusedItem.focus()}},_onIronItemsCha
nged:function(event){if(event.detail.addedNodes.length){this._resetTabindices()}
},_onShiftTabDown:function(event){var oldTabIndex=this.getAttribute("tabindex");
Polymer.IronMenuBehaviorImpl._shiftTabPressed=true;this._setFocusedItem(null);th
is.setAttribute("tabindex","-1");this.async(function(){this.setAttribute("tabind
ex",oldTabIndex);Polymer.IronMenuBehaviorImpl._shiftTabPressed=false},1)},_onFoc
us:function(event){if(Polymer.IronMenuBehaviorImpl._shiftTabPressed){return}var
rootTarget=Polymer.dom(event).rootTarget;if(rootTarget!==this&&typeof rootTarget
.tabIndex!=="undefined"&&!this.isLightDescendant(rootTarget)){return}this._defau
ltFocusAsync=this.async(function(){var selectedItem=this.multi?this.selectedItem
s&&this.selectedItems[0]:this.selectedItem;this._setFocusedItem(null);if(selecte
dItem){this._setFocusedItem(selectedItem)}else if(this.items[0]){this._focusNext
()}})},_onUpKey:function(event){this._focusPrevious();event.detail.keyboardEvent
.preventDefault()},_onDownKey:function(event){this._focusNext();event.detail.key
boardEvent.preventDefault()},_onEscKey:function(event){this.focusedItem.blur()},
_onKeydown:function(event){if(!this.keyboardEventMatchesKeys(event,"up down esc"
)){this._focusWithKeyboardEvent(event)}event.stopPropagation()},_activateHandler
:function(event){Polymer.IronSelectableBehavior._activateHandler.call(this,event
);event.stopPropagation()}};Polymer.IronMenuBehaviorImpl._shiftTabPressed=false;
Polymer.IronMenuBehavior=[Polymer.IronMultiSelectableBehavior,Polymer.IronA11yKe
ysBehavior,Polymer.IronMenuBehaviorImpl];(function(){Polymer({is:"paper-menu",be
haviors:[Polymer.IronMenuBehavior]})})();Polymer.IronFitBehavior={properties:{si
zingTarget:{type:Object,value:function(){return this}},fitInto:{type:Object,valu
e:window},noOverlap:{type:Boolean},positionTarget:{type:Element},horizontalAlign
:{type:String},verticalAlign:{type:String},dynamicAlign:{type:Boolean},horizonta
lOffset:{type:Number,value:0,notify:true},verticalOffset:{type:Number,value:0,no
tify:true},autoFitOnAttach:{type:Boolean,value:false},_fitInfo:{type:Object}},ge
t _fitWidth(){var fitWidth;if(this.fitInto===window){fitWidth=this.fitInto.inner
Width}else{fitWidth=this.fitInto.getBoundingClientRect().width}return fitWidth},
get _fitHeight(){var fitHeight;if(this.fitInto===window){fitHeight=this.fitInto.
innerHeight}else{fitHeight=this.fitInto.getBoundingClientRect().height}return fi
tHeight},get _fitLeft(){var fitLeft;if(this.fitInto===window){fitLeft=0}else{fit
Left=this.fitInto.getBoundingClientRect().left}return fitLeft},get _fitTop(){var
fitTop;if(this.fitInto===window){fitTop=0}else{fitTop=this.fitInto.getBoundingC
lientRect().top}return fitTop},get _defaultPositionTarget(){var parent=Polymer.d
om(this).parentNode;if(parent&&parent.nodeType===Node.DOCUMENT_FRAGMENT_NODE){pa
rent=parent.host}return parent},get _localeHorizontalAlign(){if(this._isRTL){if(
this.horizontalAlign==="right"){return"left"}if(this.horizontalAlign==="left"){r
eturn"right"}}return this.horizontalAlign},attached:function(){this._isRTL=windo
w.getComputedStyle(this).direction=="rtl";this.positionTarget=this.positionTarge
t||this._defaultPositionTarget;if(this.autoFitOnAttach){if(window.getComputedSty
le(this).display==="none"){setTimeout(function(){this.fit()}.bind(this))}else{th
is.fit()}}},fit:function(){this.position();this.constrain();this.center()},_disc
overInfo:function(){if(this._fitInfo){return}var target=window.getComputedStyle(
this);var sizer=window.getComputedStyle(this.sizingTarget);this._fitInfo={inline
Style:{top:this.style.top||"",left:this.style.left||"",position:this.style.posit
ion||""},sizerInlineStyle:{maxWidth:this.sizingTarget.style.maxWidth||"",maxHeig
ht:this.sizingTarget.style.maxHeight||"",boxSizing:this.sizingTarget.style.boxSi
zing||""},positionedBy:{vertically:target.top!=="auto"?"top":target.bottom!=="au
to"?"bottom":null,horizontally:target.left!=="auto"?"left":target.right!=="auto"
?"right":null},sizedBy:{height:sizer.maxHeight!=="none",width:sizer.maxWidth!=="
none",minWidth:parseInt(sizer.minWidth,10)||0,minHeight:parseInt(sizer.minHeight
,10)||0},margin:{top:parseInt(target.marginTop,10)||0,right:parseInt(target.marg
inRight,10)||0,bottom:parseInt(target.marginBottom,10)||0,left:parseInt(target.m
arginLeft,10)||0}};if(this.verticalOffset){this._fitInfo.margin.top=this._fitInf
o.margin.bottom=this.verticalOffset;this._fitInfo.inlineStyle.marginTop=this.sty
le.marginTop||"";this._fitInfo.inlineStyle.marginBottom=this.style.marginBottom|
|"";this.style.marginTop=this.style.marginBottom=this.verticalOffset+"px"}if(thi
s.horizontalOffset){this._fitInfo.margin.left=this._fitInfo.margin.right=this.ho
rizontalOffset;this._fitInfo.inlineStyle.marginLeft=this.style.marginLeft||"";th
is._fitInfo.inlineStyle.marginRight=this.style.marginRight||"";this.style.margin
Left=this.style.marginRight=this.horizontalOffset+"px"}},resetFit:function(){var
info=this._fitInfo||{};for(var property in info.sizerInlineStyle){this.sizingTa
rget.style[property]=info.sizerInlineStyle[property]}for(var property in info.in
lineStyle){this.style[property]=info.inlineStyle[property]}this._fitInfo=null},r
efit:function(){var scrollLeft=this.sizingTarget.scrollLeft;var scrollTop=this.s
izingTarget.scrollTop;this.resetFit();this.fit();this.sizingTarget.scrollLeft=sc
rollLeft;this.sizingTarget.scrollTop=scrollTop},position:function(){if(!this.hor
izontalAlign&&!this.verticalAlign){return}this._discoverInfo();this.style.positi
on="fixed";this.sizingTarget.style.boxSizing="border-box";this.style.left="0px";
this.style.top="0px";var rect=this.getBoundingClientRect();var positionRect=this
.__getNormalizedRect(this.positionTarget);var fitRect=this.__getNormalizedRect(t
his.fitInto);var margin=this._fitInfo.margin;var size={width:rect.width+margin.l
eft+margin.right,height:rect.height+margin.top+margin.bottom};var position=this.
__getPosition(this._localeHorizontalAlign,this.verticalAlign,size,positionRect,f
itRect);var left=position.left+margin.left;var top=position.top+margin.top;var r
ight=Math.min(fitRect.right-margin.right,left+rect.width);var bottom=Math.min(fi
tRect.bottom-margin.bottom,top+rect.height);var minWidth=this._fitInfo.sizedBy.m
inWidth;var minHeight=this._fitInfo.sizedBy.minHeight;if(left<margin.left){left=
margin.left;if(right-left<minWidth){left=right-minWidth}}if(top<margin.top){top=
margin.top;if(bottom-top<minHeight){top=bottom-minHeight}}this.sizingTarget.styl
e.maxWidth=right-left+"px";this.sizingTarget.style.maxHeight=bottom-top+"px";thi
s.style.left=left-rect.left+"px";this.style.top=top-rect.top+"px"},constrain:fun
ction(){if(this.horizontalAlign||this.verticalAlign){return}this._discoverInfo()
;var info=this._fitInfo;if(!info.positionedBy.vertically){this.style.position="f
ixed";this.style.top="0px"}if(!info.positionedBy.horizontally){this.style.positi
on="fixed";this.style.left="0px"}this.sizingTarget.style.boxSizing="border-box";
var rect=this.getBoundingClientRect();if(!info.sizedBy.height){this.__sizeDimens
ion(rect,info.positionedBy.vertically,"top","bottom","Height")}if(!info.sizedBy.
width){this.__sizeDimension(rect,info.positionedBy.horizontally,"left","right","
Width")}},_sizeDimension:function(rect,positionedBy,start,end,extent){this.__siz
eDimension(rect,positionedBy,start,end,extent)},__sizeDimension:function(rect,po
sitionedBy,start,end,extent){var info=this._fitInfo;var fitRect=this.__getNormal
izedRect(this.fitInto);var max=extent==="Width"?fitRect.width:fitRect.height;var
flip=positionedBy===end;var offset=flip?max-rect[end]:rect[start];var margin=in
fo.margin[flip?start:end];var offsetExtent="offset"+extent;var sizingOffset=this
[offsetExtent]-this.sizingTarget[offsetExtent];this.sizingTarget.style["max"+ext
ent]=max-margin-offset-sizingOffset+"px"},center:function(){if(this.horizontalAl
ign||this.verticalAlign){return}this._discoverInfo();var positionedBy=this._fitI
nfo.positionedBy;if(positionedBy.vertically&&positionedBy.horizontally){return}t
his.style.position="fixed";if(!positionedBy.vertically){this.style.top="0px"}if(
!positionedBy.horizontally){this.style.left="0px"}var rect=this.getBoundingClien
tRect();var fitRect=this.__getNormalizedRect(this.fitInto);if(!positionedBy.vert
ically){var top=fitRect.top-rect.top+(fitRect.height-rect.height)/2;this.style.t
op=top+"px"}if(!positionedBy.horizontally){var left=fitRect.left-rect.left+(fitR
ect.width-rect.width)/2;this.style.left=left+"px"}},__getNormalizedRect:function
(target){if(target===document.documentElement||target===window){return{top:0,lef
t:0,width:window.innerWidth,height:window.innerHeight,right:window.innerWidth,bo
ttom:window.innerHeight}}return target.getBoundingClientRect()},__getCroppedArea
:function(position,size,fitRect){var verticalCrop=Math.min(0,position.top)+Math.
min(0,fitRect.bottom-(position.top+size.height));var horizontalCrop=Math.min(0,p
osition.left)+Math.min(0,fitRect.right-(position.left+size.width));return Math.a
bs(verticalCrop)*size.width+Math.abs(horizontalCrop)*size.height},__getPosition:
function(hAlign,vAlign,size,positionRect,fitRect){var positions=[{verticalAlign:
"top",horizontalAlign:"left",top:positionRect.top,left:positionRect.left},{verti
calAlign:"top",horizontalAlign:"right",top:positionRect.top,left:positionRect.ri
ght-size.width},{verticalAlign:"bottom",horizontalAlign:"left",top:positionRect.
bottom-size.height,left:positionRect.left},{verticalAlign:"bottom",horizontalAli
gn:"right",top:positionRect.bottom-size.height,left:positionRect.right-size.widt
h}];if(this.noOverlap){for(var i=0,l=positions.length;i<l;i++){var copy={};for(v
ar key in positions[i]){copy[key]=positions[i][key]}positions.push(copy)}positio
ns[0].top=positions[1].top+=positionRect.height;positions[2].top=positions[3].to
p-=positionRect.height;positions[4].left=positions[6].left+=positionRect.width;p
ositions[5].left=positions[7].left-=positionRect.width}vAlign=vAlign==="auto"?nu
ll:vAlign;hAlign=hAlign==="auto"?null:hAlign;var position;for(var i=0;i<position
s.length;i++){var pos=positions[i];if(!this.dynamicAlign&&!this.noOverlap&&pos.v
erticalAlign===vAlign&&pos.horizontalAlign===hAlign){position=pos;break}var alig
nOk=(!vAlign||pos.verticalAlign===vAlign)&&(!hAlign||pos.horizontalAlign===hAlig
n);if(!this.dynamicAlign&&!alignOk){continue}position=position||pos;pos.croppedA
rea=this.__getCroppedArea(pos,size,fitRect);var diff=pos.croppedArea-position.cr
oppedArea;if(diff<0||diff===0&&alignOk){position=pos}if(position.croppedArea===0
&&alignOk){break}}return position}};(function(){"use strict";Polymer({is:"iron-o
verlay-backdrop",properties:{opened:{reflectToAttribute:true,type:Boolean,value:
false,observer:"_openedChanged"}},listeners:{transitionend:"_onTransitionend"},c
reated:function(){this.__openedRaf=null},attached:function(){this.opened&&this._
openedChanged(this.opened)},prepare:function(){if(this.opened&&!this.parentNode)
{Polymer.dom(document.body).appendChild(this)}},open:function(){this.opened=true
},close:function(){this.opened=false},complete:function(){if(!this.opened&&this.
parentNode===document.body){Polymer.dom(this.parentNode).removeChild(this)}},_on
Transitionend:function(event){if(event&&event.target===this){this.complete()}},_
openedChanged:function(opened){if(opened){this.prepare()}else{var cs=window.getC
omputedStyle(this);if(cs.transitionDuration==="0s"||cs.opacity==0){this.complete
()}}if(!this.isAttached){return}if(this.__openedRaf){window.cancelAnimationFrame
(this.__openedRaf);this.__openedRaf=null}this.scrollTop=this.scrollTop;this.__op
enedRaf=window.requestAnimationFrame(function(){this.__openedRaf=null;this.toggl
eClass("opened",this.opened)}.bind(this))}})})();Polymer.IronOverlayManagerClass
=function(){this._overlays=[];this._minimumZ=101;this._backdropElement=null;Poly
mer.Gestures.add(document,"tap",this._onCaptureClick.bind(this));document.addEve
ntListener("focus",this._onCaptureFocus.bind(this),true);document.addEventListen
er("keydown",this._onCaptureKeyDown.bind(this),true)};Polymer.IronOverlayManager
Class.prototype={constructor:Polymer.IronOverlayManagerClass,get backdropElement
(){if(!this._backdropElement){this._backdropElement=document.createElement("iron
-overlay-backdrop")}return this._backdropElement},get deepActiveElement(){var ac
tive=document.activeElement||document.body;while(active.root&&Polymer.dom(active
.root).activeElement){active=Polymer.dom(active.root).activeElement}return activ
e},_bringOverlayAtIndexToFront:function(i){var overlay=this._overlays[i];if(!ove
rlay){return}var lastI=this._overlays.length-1;var currentOverlay=this._overlays
[lastI];if(currentOverlay&&this._shouldBeBehindOverlay(overlay,currentOverlay)){
lastI--}if(i>=lastI){return}var minimumZ=Math.max(this.currentOverlayZ(),this._m
inimumZ);if(this._getZ(overlay)<=minimumZ){this._applyOverlayZ(overlay,minimumZ)
}while(i<lastI){this._overlays[i]=this._overlays[i+1];i++}this._overlays[lastI]=
overlay},addOrRemoveOverlay:function(overlay){if(overlay.opened){this.addOverlay
(overlay)}else{this.removeOverlay(overlay)}},addOverlay:function(overlay){var i=
this._overlays.indexOf(overlay);if(i>=0){this._bringOverlayAtIndexToFront(i);thi
s.trackBackdrop();return}var insertionIndex=this._overlays.length;var currentOve
rlay=this._overlays[insertionIndex-1];var minimumZ=Math.max(this._getZ(currentOv
erlay),this._minimumZ);var newZ=this._getZ(overlay);if(currentOverlay&&this._sho
uldBeBehindOverlay(overlay,currentOverlay)){this._applyOverlayZ(currentOverlay,m
inimumZ);insertionIndex--;var previousOverlay=this._overlays[insertionIndex-1];m
inimumZ=Math.max(this._getZ(previousOverlay),this._minimumZ)}if(newZ<=minimumZ){
this._applyOverlayZ(overlay,minimumZ)}this._overlays.splice(insertionIndex,0,ove
rlay);this.trackBackdrop()},removeOverlay:function(overlay){var i=this._overlays
.indexOf(overlay);if(i===-1){return}this._overlays.splice(i,1);this.trackBackdro
p()},currentOverlay:function(){var i=this._overlays.length-1;return this._overla
ys[i]},currentOverlayZ:function(){return this._getZ(this.currentOverlay())},ensu
reMinimumZ:function(minimumZ){this._minimumZ=Math.max(this._minimumZ,minimumZ)},
focusOverlay:function(){var current=this.currentOverlay();if(current){current._a
pplyFocus()}},trackBackdrop:function(){var overlay=this._overlayWithBackdrop();i
f(!overlay&&!this._backdropElement){return}this.backdropElement.style.zIndex=thi
s._getZ(overlay)-1;this.backdropElement.opened=!!overlay},getBackdrops:function(
){var backdrops=[];for(var i=0;i<this._overlays.length;i++){if(this._overlays[i]
.withBackdrop){backdrops.push(this._overlays[i])}}return backdrops},backdropZ:fu
nction(){return this._getZ(this._overlayWithBackdrop())-1},_overlayWithBackdrop:
function(){for(var i=0;i<this._overlays.length;i++){if(this._overlays[i].withBac
kdrop){return this._overlays[i]}}},_getZ:function(overlay){var z=this._minimumZ;
if(overlay){var z1=Number(overlay.style.zIndex||window.getComputedStyle(overlay)
.zIndex);if(z1===z1){z=z1}}return z},_setZ:function(element,z){element.style.zIn
dex=z},_applyOverlayZ:function(overlay,aboveZ){this._setZ(overlay,aboveZ+2)},_ov
erlayInPath:function(path){path=path||[];for(var i=0;i<path.length;i++){if(path[
i]._manager===this){return path[i]}}},_onCaptureClick:function(event){var overla
y=this.currentOverlay();if(overlay&&this._overlayInPath(Polymer.dom(event).path)
!==overlay){overlay._onCaptureClick(event)}},_onCaptureFocus:function(event){var
overlay=this.currentOverlay();if(overlay){overlay._onCaptureFocus(event)}},_onC
aptureKeyDown:function(event){var overlay=this.currentOverlay();if(overlay){if(P
olymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(event,"esc")){overlay._onCa
ptureEsc(event)}else if(Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(ev
ent,"tab")){overlay._onCaptureTab(event)}}},_shouldBeBehindOverlay:function(over
lay1,overlay2){return!overlay1.alwaysOnTop&&overlay2.alwaysOnTop}};Polymer.IronO
verlayManager=new Polymer.IronOverlayManagerClass;(function(){"use strict";Polym
er.IronOverlayBehaviorImpl={properties:{opened:{observer:"_openedChanged",type:B
oolean,value:false,notify:true},canceled:{observer:"_canceledChanged",readOnly:t
rue, | 46 cr.define("downloads",function(){var Item=Polymer({is:"downloads-item",propertie
s:{data:{type:Object},completelyOnDisk_:{computed:"computeCompletelyOnDisk_("+"d
ata.state, data.file_externally_removed)",type:Boolean,value:true},controlledBy_
:{computed:"computeControlledBy_(data.by_ext_id, data.by_ext_name)",type:String,
value:""},isActive_:{computed:"computeIsActive_("+"data.state, data.file_externa
lly_removed)",type:Boolean,value:true},isDangerous_:{computed:"computeIsDangerou
s_(data.state)",type:Boolean,value:false},isMalware_:{computed:"computeIsMalware
_(isDangerous_, data.danger_type)",type:Boolean,value:false},isInProgress_:{comp
uted:"computeIsInProgress_(data.state)",type:Boolean,value:false},pauseOrResumeT
ext_:{computed:"computePauseOrResumeText_(isInProgress_, data.resume)",type:Stri
ng},showCancel_:{computed:"computeShowCancel_(data.state)",type:Boolean,value:fa
lse},showProgress_:{computed:"computeShowProgress_(showCancel_, data.percent)",t
ype:Boolean,value:false}},observers:["observeControlledBy_(controlledBy_)","obse
rveIsDangerous_(isDangerous_, data)"],ready:function(){this.content=this.$.conte
nt},chopString_:function(text,maxLength){return text.slice(0,maxLength)},compute
Class_:function(){var classes=[];if(this.isActive_)classes.push("is-active");if(
this.isDangerous_)classes.push("dangerous");if(this.showProgress_)classes.push("
show-progress");return classes.join(" ")},computeCompletelyOnDisk_:function(){re
turn this.data.state==downloads.States.COMPLETE&&!this.data.file_externally_remo
ved},computeControlledBy_:function(){if(!this.data.by_ext_id||!this.data.by_ext_
name)return"";var url="chrome://extensions#"+this.data.by_ext_id;var name=this.d
ata.by_ext_name;return loadTimeData.getStringF("controlledByUrl",url,name)},comp
uteDangerIcon_:function(){if(!this.isDangerous_)return"";switch(this.data.danger
_type){case downloads.DangerType.DANGEROUS_CONTENT:case downloads.DangerType.DAN
GEROUS_HOST:case downloads.DangerType.DANGEROUS_URL:case downloads.DangerType.PO
TENTIALLY_UNWANTED:case downloads.DangerType.UNCOMMON_CONTENT:return"downloads:r
emove-circle";default:return"cr:warning"}},computeDate_:function(){assert(typeof
this.data.hideDate=="boolean");if(this.data.hideDate)return"";return assert(thi
s.data.since_string||this.data.date_string)},computeDescription_:function(){var
data=this.data;switch(data.state){case downloads.States.DANGEROUS:var fileName=d
ata.file_name;switch(data.danger_type){case downloads.DangerType.DANGEROUS_FILE:
return loadTimeData.getString("dangerFileDesc");case downloads.DangerType.DANGER
OUS_URL:case downloads.DangerType.DANGEROUS_CONTENT:case downloads.DangerType.DA
NGEROUS_HOST:return loadTimeData.getString("dangerDownloadDesc");case downloads.
DangerType.UNCOMMON_CONTENT:return loadTimeData.getString("dangerUncommonDesc");
case downloads.DangerType.POTENTIALLY_UNWANTED:return loadTimeData.getString("da
ngerSettingsDesc")}break;case downloads.States.IN_PROGRESS:case downloads.States
.PAUSED:return data.progress_status_text}return""},computeIsActive_:function(){r
eturn this.data.state!=downloads.States.CANCELLED&&this.data.state!=downloads.St
ates.INTERRUPTED&&!this.data.file_externally_removed},computeIsDangerous_:functi
on(){return this.data.state==downloads.States.DANGEROUS},computeIsInProgress_:fu
nction(){return this.data.state==downloads.States.IN_PROGRESS},computeIsMalware_
:function(){return this.isDangerous_&&(this.data.danger_type==downloads.DangerTy
pe.DANGEROUS_CONTENT||this.data.danger_type==downloads.DangerType.DANGEROUS_HOST
||this.data.danger_type==downloads.DangerType.DANGEROUS_URL||this.data.danger_ty
pe==downloads.DangerType.POTENTIALLY_UNWANTED)},computePauseOrResumeText_:functi
on(){if(this.isInProgress_)return loadTimeData.getString("controlPause");if(this
.data.resume)return loadTimeData.getString("controlResume");return""},computeRem
oveStyle_:function(){var canDelete=loadTimeData.getBoolean("allowDeletingHistory
");var hideRemove=this.isDangerous_||this.showCancel_||!canDelete;return hideRem
ove?"visibility: hidden":""},computeShowCancel_:function(){return this.data.stat
e==downloads.States.IN_PROGRESS||this.data.state==downloads.States.PAUSED},compu
teShowProgress_:function(){return this.showCancel_&&this.data.percent>=-1},compu
teTag_:function(){switch(this.data.state){case downloads.States.CANCELLED:return
loadTimeData.getString("statusCancelled");case downloads.States.INTERRUPTED:ret
urn this.data.last_reason_text;case downloads.States.COMPLETE:return this.data.f
ile_externally_removed?loadTimeData.getString("statusRemoved"):""}return""},isIn
determinate_:function(){return this.data.percent==-1},observeControlledBy_:funct
ion(){this.$["controlled-by"].innerHTML=this.controlledBy_},observeIsDangerous_:
function(){if(!this.data)return;if(this.isDangerous_){this.$.url.removeAttribute
("href")}else{this.$.url.href=assert(this.data.url);var filePath=encodeURICompon
ent(this.data.file_path);var scaleFactor="?scale="+window.devicePixelRatio+"x";t
his.$["file-icon"].src="chrome://fileicon/"+filePath+scaleFactor}},onCancelTap_:
function(){downloads.ActionService.getInstance().cancel(this.data.id)},onDiscard
DangerousTap_:function(){downloads.ActionService.getInstance().discardDangerous(
this.data.id)},onDragStart_:function(e){e.preventDefault();downloads.ActionServi
ce.getInstance().drag(this.data.id)},onFileLinkTap_:function(e){e.preventDefault
();downloads.ActionService.getInstance().openFile(this.data.id)},onPauseOrResume
Tap_:function(){if(this.isInProgress_)downloads.ActionService.getInstance().paus
e(this.data.id);else downloads.ActionService.getInstance().resume(this.data.id)}
,onRemoveTap_:function(){downloads.ActionService.getInstance().remove(this.data.
id)},onRetryTap_:function(){downloads.ActionService.getInstance().download(this.
data.url)},onSaveDangerousTap_:function(){downloads.ActionService.getInstance().
saveDangerous(this.data.id)},onShowTap_:function(){downloads.ActionService.getIn
stance().show(this.data.id)}});return{Item:Item}});Polymer.PaperItemBehaviorImpl
={hostAttributes:{role:"option",tabindex:"0"}};Polymer.PaperItemBehavior=[Polyme
r.IronButtonState,Polymer.IronControlState,Polymer.PaperItemBehaviorImpl];Polyme
r({is:"paper-item",behaviors:[Polymer.PaperItemBehavior]});Polymer.IronSelection
=function(selectCallback){this.selection=[];this.selectCallback=selectCallback};
Polymer.IronSelection.prototype={get:function(){return this.multi?this.selection
.slice():this.selection[0]},clear:function(excludes){this.selection.slice().forE
ach(function(item){if(!excludes||excludes.indexOf(item)<0){this.setItemSelected(
item,false)}},this)},isSelected:function(item){return this.selection.indexOf(ite
m)>=0},setItemSelected:function(item,isSelected){if(item!=null){if(isSelected!==
this.isSelected(item)){if(isSelected){this.selection.push(item)}else{var i=this.
selection.indexOf(item);if(i>=0){this.selection.splice(i,1)}}if(this.selectCallb
ack){this.selectCallback(item,isSelected)}}}},select:function(item){if(this.mult
i){this.toggle(item)}else if(this.get()!==item){this.setItemSelected(this.get(),
false);this.setItemSelected(item,true)}},toggle:function(item){this.setItemSelec
ted(item,!this.isSelected(item))}};Polymer.IronSelectableBehavior={properties:{a
ttrForSelected:{type:String,value:null},selected:{type:String,notify:true},selec
tedItem:{type:Object,readOnly:true,notify:true},activateEvent:{type:String,value
:"tap",observer:"_activateEventChanged"},selectable:String,selectedClass:{type:S
tring,value:"iron-selected"},selectedAttribute:{type:String,value:null},fallback
Selection:{type:String,value:null},items:{type:Array,readOnly:true,notify:true,v
alue:function(){return[]}},_excludedLocalNames:{type:Object,value:function(){ret
urn{template:1}}}},observers:["_updateAttrForSelected(attrForSelected)","_update
Selected(selected)","_checkFallback(fallbackSelection)"],created:function(){this
._bindFilterItem=this._filterItem.bind(this);this._selection=new Polymer.IronSel
ection(this._applySelection.bind(this))},attached:function(){this._observer=this
._observeItems(this);this._updateItems();if(!this._shouldUpdateSelection){this._
updateSelected()}this._addListener(this.activateEvent)},detached:function(){if(t
his._observer){Polymer.dom(this).unobserveNodes(this._observer)}this._removeList
ener(this.activateEvent)},indexOf:function(item){return this.items.indexOf(item)
},select:function(value){this.selected=value},selectPrevious:function(){var leng
th=this.items.length;var index=(Number(this._valueToIndex(this.selected))-1+leng
th)%length;this.selected=this._indexToValue(index)},selectNext:function(){var in
dex=(Number(this._valueToIndex(this.selected))+1)%this.items.length;this.selecte
d=this._indexToValue(index)},selectIndex:function(index){this.select(this._index
ToValue(index))},forceSynchronousItemUpdate:function(){this._updateItems()},get
_shouldUpdateSelection(){return this.selected!=null},_checkFallback:function(){i
f(this._shouldUpdateSelection){this._updateSelected()}},_addListener:function(ev
entName){this.listen(this,eventName,"_activateHandler")},_removeListener:functio
n(eventName){this.unlisten(this,eventName,"_activateHandler")},_activateEventCha
nged:function(eventName,old){this._removeListener(old);this._addListener(eventNa
me)},_updateItems:function(){var nodes=Polymer.dom(this).queryDistributedElement
s(this.selectable||"*");nodes=Array.prototype.filter.call(nodes,this._bindFilter
Item);this._setItems(nodes)},_updateAttrForSelected:function(){if(this._shouldUp
dateSelection){this.selected=this._indexToValue(this.indexOf(this.selectedItem))
}},_updateSelected:function(){this._selectSelected(this.selected)},_selectSelect
ed:function(selected){this._selection.select(this._valueToItem(this.selected));i
f(this.fallbackSelection&&this.items.length&&this._selection.get()===undefined){
this.selected=this.fallbackSelection}},_filterItem:function(node){return!this._e
xcludedLocalNames[node.localName]},_valueToItem:function(value){return value==nu
ll?null:this.items[this._valueToIndex(value)]},_valueToIndex:function(value){if(
this.attrForSelected){for(var i=0,item;item=this.items[i];i++){if(this._valueFor
Item(item)==value){return i}}}else{return Number(value)}},_indexToValue:function
(index){if(this.attrForSelected){var item=this.items[index];if(item){return this
._valueForItem(item)}}else{return index}},_valueForItem:function(item){var propV
alue=item[Polymer.CaseMap.dashToCamelCase(this.attrForSelected)];return propValu
e!=undefined?propValue:item.getAttribute(this.attrForSelected)},_applySelection:
function(item,isSelected){if(this.selectedClass){this.toggleClass(this.selectedC
lass,isSelected,item)}if(this.selectedAttribute){this.toggleAttribute(this.selec
tedAttribute,isSelected,item)}this._selectionChange();this.fire("iron-"+(isSelec
ted?"select":"deselect"),{item:item})},_selectionChange:function(){this._setSele
ctedItem(this._selection.get())},_observeItems:function(node){return Polymer.dom
(node).observeNodes(function(mutation){this._updateItems();if(this._shouldUpdate
Selection){this._updateSelected()}this.fire("iron-items-changed",mutation,{bubbl
es:false,cancelable:false})})},_activateHandler:function(e){var t=e.target;var i
tems=this.items;while(t&&t!=this){var i=items.indexOf(t);if(i>=0){var value=this
._indexToValue(i);this._itemActivate(value,t);return}t=t.parentNode}},_itemActiv
ate:function(value,item){if(!this.fire("iron-activate",{selected:value,item:item
},{cancelable:true}).defaultPrevented){this.select(value)}}};Polymer.IronMultiSe
lectableBehaviorImpl={properties:{multi:{type:Boolean,value:false,observer:"mult
iChanged"},selectedValues:{type:Array,notify:true},selectedItems:{type:Array,rea
dOnly:true,notify:true}},observers:["_updateSelected(selectedValues.splices)"],s
elect:function(value){if(this.multi){if(this.selectedValues){this._toggleSelecte
d(value)}else{this.selectedValues=[value]}}else{this.selected=value}},multiChang
ed:function(multi){this._selection.multi=multi},get _shouldUpdateSelection(){ret
urn this.selected!=null||this.selectedValues!=null&&this.selectedValues.length},
_updateAttrForSelected:function(){if(!this.multi){Polymer.IronSelectableBehavior
._updateAttrForSelected.apply(this)}else if(this._shouldUpdateSelection){this.se
lectedValues=this.selectedItems.map(function(selectedItem){return this._indexToV
alue(this.indexOf(selectedItem))},this).filter(function(unfilteredValue){return
unfilteredValue!=null},this)}},_updateSelected:function(){if(this.multi){this._s
electMulti(this.selectedValues)}else{this._selectSelected(this.selected)}},_sele
ctMulti:function(values){if(values){var selectedItems=this._valuesToItems(values
);this._selection.clear(selectedItems);for(var i=0;i<selectedItems.length;i++){t
his._selection.setItemSelected(selectedItems[i],true)}if(this.fallbackSelection&
&this.items.length&&!this._selection.get().length){var fallback=this._valueToIte
m(this.fallbackSelection);if(fallback){this.selectedValues=[this.fallbackSelecti
on]}}}else{this._selection.clear()}},_selectionChange:function(){var s=this._sel
ection.get();if(this.multi){this._setSelectedItems(s)}else{this._setSelectedItem
s([s]);this._setSelectedItem(s)}},_toggleSelected:function(value){var i=this.sel
ectedValues.indexOf(value);var unselected=i<0;if(unselected){this.push("selected
Values",value)}else{this.splice("selectedValues",i,1)}},_valuesToItems:function(
values){return values==null?null:values.map(function(value){return this._valueTo
Item(value)},this)}};Polymer.IronMultiSelectableBehavior=[Polymer.IronSelectable
Behavior,Polymer.IronMultiSelectableBehaviorImpl];Polymer.IronMenuBehaviorImpl={
properties:{focusedItem:{observer:"_focusedItemChanged",readOnly:true,type:Objec
t},attrForItemTitle:{type:String}},hostAttributes:{role:"menu",tabindex:"0"},obs
ervers:["_updateMultiselectable(multi)"],listeners:{focus:"_onFocus",keydown:"_o
nKeydown","iron-items-changed":"_onIronItemsChanged"},keyBindings:{up:"_onUpKey"
,down:"_onDownKey",esc:"_onEscKey","shift+tab:keydown":"_onShiftTabDown"},attach
ed:function(){this._resetTabindices()},select:function(value){if(this._defaultFo
cusAsync){this.cancelAsync(this._defaultFocusAsync);this._defaultFocusAsync=null
}var item=this._valueToItem(value);if(item&&item.hasAttribute("disabled"))return
;this._setFocusedItem(item);Polymer.IronMultiSelectableBehaviorImpl.select.apply
(this,arguments)},_resetTabindices:function(){var selectedItem=this.multi?this.s
electedItems&&this.selectedItems[0]:this.selectedItem;this.items.forEach(functio
n(item){item.setAttribute("tabindex",item===selectedItem?"0":"-1")},this)},_upda
teMultiselectable:function(multi){if(multi){this.setAttribute("aria-multiselecta
ble","true")}else{this.removeAttribute("aria-multiselectable")}},_focusWithKeybo
ardEvent:function(event){for(var i=0,item;item=this.items[i];i++){var attr=this.
attrForItemTitle||"textContent";var title=item[attr]||item.getAttribute(attr);if
(!item.hasAttribute("disabled")&&title&&title.trim().charAt(0).toLowerCase()===S
tring.fromCharCode(event.keyCode).toLowerCase()){this._setFocusedItem(item);brea
k}}},_focusPrevious:function(){var length=this.items.length;var curFocusIndex=Nu
mber(this.indexOf(this.focusedItem));for(var i=1;i<length+1;i++){var item=this.i
tems[(curFocusIndex-i+length)%length];if(!item.hasAttribute("disabled")){var own
er=Polymer.dom(item).getOwnerRoot()||document;this._setFocusedItem(item);if(Poly
mer.dom(owner).activeElement==item){return}}}},_focusNext:function(){var length=
this.items.length;var curFocusIndex=Number(this.indexOf(this.focusedItem));for(v
ar i=1;i<length+1;i++){var item=this.items[(curFocusIndex+i)%length];if(!item.ha
sAttribute("disabled")){var owner=Polymer.dom(item).getOwnerRoot()||document;thi
s._setFocusedItem(item);if(Polymer.dom(owner).activeElement==item){return}}}},_a
pplySelection:function(item,isSelected){if(isSelected){item.setAttribute("aria-s
elected","true")}else{item.removeAttribute("aria-selected")}Polymer.IronSelectab
leBehavior._applySelection.apply(this,arguments)},_focusedItemChanged:function(f
ocusedItem,old){old&&old.setAttribute("tabindex","-1");if(focusedItem){focusedIt
em.setAttribute("tabindex","0");focusedItem.focus()}},_onIronItemsChanged:functi
on(event){if(event.detail.addedNodes.length){this._resetTabindices()}},_onShiftT
abDown:function(event){var oldTabIndex=this.getAttribute("tabindex");Polymer.Iro
nMenuBehaviorImpl._shiftTabPressed=true;this._setFocusedItem(null);this.setAttri
bute("tabindex","-1");this.async(function(){this.setAttribute("tabindex",oldTabI
ndex);Polymer.IronMenuBehaviorImpl._shiftTabPressed=false},1)},_onFocus:function
(event){if(Polymer.IronMenuBehaviorImpl._shiftTabPressed){return}var rootTarget=
Polymer.dom(event).rootTarget;if(rootTarget!==this&&typeof rootTarget.tabIndex!=
="undefined"&&!this.isLightDescendant(rootTarget)){return}this._defaultFocusAsyn
c=this.async(function(){var selectedItem=this.multi?this.selectedItems&&this.sel
ectedItems[0]:this.selectedItem;this._setFocusedItem(null);if(selectedItem){this
._setFocusedItem(selectedItem)}else if(this.items[0]){this._focusNext()}})},_onU
pKey:function(event){this._focusPrevious();event.detail.keyboardEvent.preventDef
ault()},_onDownKey:function(event){this._focusNext();event.detail.keyboardEvent.
preventDefault()},_onEscKey:function(event){this.focusedItem.blur()},_onKeydown:
function(event){if(!this.keyboardEventMatchesKeys(event,"up down esc")){this._fo
cusWithKeyboardEvent(event)}event.stopPropagation()},_activateHandler:function(e
vent){Polymer.IronSelectableBehavior._activateHandler.call(this,event);event.sto
pPropagation()}};Polymer.IronMenuBehaviorImpl._shiftTabPressed=false;Polymer.Iro
nMenuBehavior=[Polymer.IronMultiSelectableBehavior,Polymer.IronA11yKeysBehavior,
Polymer.IronMenuBehaviorImpl];(function(){Polymer({is:"paper-menu",behaviors:[Po
lymer.IronMenuBehavior]})})();Polymer.IronFitBehavior={properties:{sizingTarget:
{type:Object,value:function(){return this}},fitInto:{type:Object,value:window},n
oOverlap:{type:Boolean},positionTarget:{type:Element},horizontalAlign:{type:Stri
ng},verticalAlign:{type:String},dynamicAlign:{type:Boolean},horizontalOffset:{ty
pe:Number,value:0,notify:true},verticalOffset:{type:Number,value:0,notify:true},
autoFitOnAttach:{type:Boolean,value:false},_fitInfo:{type:Object}},get _fitWidth
(){var fitWidth;if(this.fitInto===window){fitWidth=this.fitInto.innerWidth}else{
fitWidth=this.fitInto.getBoundingClientRect().width}return fitWidth},get _fitHei
ght(){var fitHeight;if(this.fitInto===window){fitHeight=this.fitInto.innerHeight
}else{fitHeight=this.fitInto.getBoundingClientRect().height}return fitHeight},ge
t _fitLeft(){var fitLeft;if(this.fitInto===window){fitLeft=0}else{fitLeft=this.f
itInto.getBoundingClientRect().left}return fitLeft},get _fitTop(){var fitTop;if(
this.fitInto===window){fitTop=0}else{fitTop=this.fitInto.getBoundingClientRect()
.top}return fitTop},get _defaultPositionTarget(){var parent=Polymer.dom(this).pa
rentNode;if(parent&&parent.nodeType===Node.DOCUMENT_FRAGMENT_NODE){parent=parent
.host}return parent},get _localeHorizontalAlign(){if(this._isRTL){if(this.horizo
ntalAlign==="right"){return"left"}if(this.horizontalAlign==="left"){return"right
"}}return this.horizontalAlign},attached:function(){this._isRTL=window.getComput
edStyle(this).direction=="rtl";this.positionTarget=this.positionTarget||this._de
faultPositionTarget;if(this.autoFitOnAttach){if(window.getComputedStyle(this).di
splay==="none"){setTimeout(function(){this.fit()}.bind(this))}else{this.fit()}}}
,fit:function(){this.position();this.constrain();this.center()},_discoverInfo:fu
nction(){if(this._fitInfo){return}var target=window.getComputedStyle(this);var s
izer=window.getComputedStyle(this.sizingTarget);this._fitInfo={inlineStyle:{top:
this.style.top||"",left:this.style.left||"",position:this.style.position||""},si
zerInlineStyle:{maxWidth:this.sizingTarget.style.maxWidth||"",maxHeight:this.siz
ingTarget.style.maxHeight||"",boxSizing:this.sizingTarget.style.boxSizing||""},p
ositionedBy:{vertically:target.top!=="auto"?"top":target.bottom!=="auto"?"bottom
":null,horizontally:target.left!=="auto"?"left":target.right!=="auto"?"right":nu
ll},sizedBy:{height:sizer.maxHeight!=="none",width:sizer.maxWidth!=="none",minWi
dth:parseInt(sizer.minWidth,10)||0,minHeight:parseInt(sizer.minHeight,10)||0},ma
rgin:{top:parseInt(target.marginTop,10)||0,right:parseInt(target.marginRight,10)
||0,bottom:parseInt(target.marginBottom,10)||0,left:parseInt(target.marginLeft,1
0)||0}};if(this.verticalOffset){this._fitInfo.margin.top=this._fitInfo.margin.bo
ttom=this.verticalOffset;this._fitInfo.inlineStyle.marginTop=this.style.marginTo
p||"";this._fitInfo.inlineStyle.marginBottom=this.style.marginBottom||"";this.st
yle.marginTop=this.style.marginBottom=this.verticalOffset+"px"}if(this.horizonta
lOffset){this._fitInfo.margin.left=this._fitInfo.margin.right=this.horizontalOff
set;this._fitInfo.inlineStyle.marginLeft=this.style.marginLeft||"";this._fitInfo
.inlineStyle.marginRight=this.style.marginRight||"";this.style.marginLeft=this.s
tyle.marginRight=this.horizontalOffset+"px"}},resetFit:function(){var info=this.
_fitInfo||{};for(var property in info.sizerInlineStyle){this.sizingTarget.style[
property]=info.sizerInlineStyle[property]}for(var property in info.inlineStyle){
this.style[property]=info.inlineStyle[property]}this._fitInfo=null},refit:functi
on(){var scrollLeft=this.sizingTarget.scrollLeft;var scrollTop=this.sizingTarget
.scrollTop;this.resetFit();this.fit();this.sizingTarget.scrollLeft=scrollLeft;th
is.sizingTarget.scrollTop=scrollTop},position:function(){if(!this.horizontalAlig
n&&!this.verticalAlign){return}this._discoverInfo();this.style.position="fixed";
this.sizingTarget.style.boxSizing="border-box";this.style.left="0px";this.style.
top="0px";var rect=this.getBoundingClientRect();var positionRect=this.__getNorma
lizedRect(this.positionTarget);var fitRect=this.__getNormalizedRect(this.fitInto
);var margin=this._fitInfo.margin;var size={width:rect.width+margin.left+margin.
right,height:rect.height+margin.top+margin.bottom};var position=this.__getPositi
on(this._localeHorizontalAlign,this.verticalAlign,size,positionRect,fitRect);var
left=position.left+margin.left;var top=position.top+margin.top;var right=Math.m
in(fitRect.right-margin.right,left+rect.width);var bottom=Math.min(fitRect.botto
m-margin.bottom,top+rect.height);var minWidth=this._fitInfo.sizedBy.minWidth;var
minHeight=this._fitInfo.sizedBy.minHeight;if(left<margin.left){left=margin.left
;if(right-left<minWidth){left=right-minWidth}}if(top<margin.top){top=margin.top;
if(bottom-top<minHeight){top=bottom-minHeight}}this.sizingTarget.style.maxWidth=
right-left+"px";this.sizingTarget.style.maxHeight=bottom-top+"px";this.style.lef
t=left-rect.left+"px";this.style.top=top-rect.top+"px"},constrain:function(){if(
this.horizontalAlign||this.verticalAlign){return}this._discoverInfo();var info=t
his._fitInfo;if(!info.positionedBy.vertically){this.style.position="fixed";this.
style.top="0px"}if(!info.positionedBy.horizontally){this.style.position="fixed";
this.style.left="0px"}this.sizingTarget.style.boxSizing="border-box";var rect=th
is.getBoundingClientRect();if(!info.sizedBy.height){this.__sizeDimension(rect,in
fo.positionedBy.vertically,"top","bottom","Height")}if(!info.sizedBy.width){this
.__sizeDimension(rect,info.positionedBy.horizontally,"left","right","Width")}},_
sizeDimension:function(rect,positionedBy,start,end,extent){this.__sizeDimension(
rect,positionedBy,start,end,extent)},__sizeDimension:function(rect,positionedBy,
start,end,extent){var info=this._fitInfo;var fitRect=this.__getNormalizedRect(th
is.fitInto);var max=extent==="Width"?fitRect.width:fitRect.height;var flip=posit
ionedBy===end;var offset=flip?max-rect[end]:rect[start];var margin=info.margin[f
lip?start:end];var offsetExtent="offset"+extent;var sizingOffset=this[offsetExte
nt]-this.sizingTarget[offsetExtent];this.sizingTarget.style["max"+extent]=max-ma
rgin-offset-sizingOffset+"px"},center:function(){if(this.horizontalAlign||this.v
erticalAlign){return}this._discoverInfo();var positionedBy=this._fitInfo.positio
nedBy;if(positionedBy.vertically&&positionedBy.horizontally){return}this.style.p
osition="fixed";if(!positionedBy.vertically){this.style.top="0px"}if(!positioned
By.horizontally){this.style.left="0px"}var rect=this.getBoundingClientRect();var
fitRect=this.__getNormalizedRect(this.fitInto);if(!positionedBy.vertically){var
top=fitRect.top-rect.top+(fitRect.height-rect.height)/2;this.style.top=top+"px"
}if(!positionedBy.horizontally){var left=fitRect.left-rect.left+(fitRect.width-r
ect.width)/2;this.style.left=left+"px"}},__getNormalizedRect:function(target){if
(target===document.documentElement||target===window){return{top:0,left:0,width:w
indow.innerWidth,height:window.innerHeight,right:window.innerWidth,bottom:window
.innerHeight}}return target.getBoundingClientRect()},__getCroppedArea:function(p
osition,size,fitRect){var verticalCrop=Math.min(0,position.top)+Math.min(0,fitRe
ct.bottom-(position.top+size.height));var horizontalCrop=Math.min(0,position.lef
t)+Math.min(0,fitRect.right-(position.left+size.width));return Math.abs(vertical
Crop)*size.width+Math.abs(horizontalCrop)*size.height},__getPosition:function(hA
lign,vAlign,size,positionRect,fitRect){var positions=[{verticalAlign:"top",horiz
ontalAlign:"left",top:positionRect.top,left:positionRect.left},{verticalAlign:"t
op",horizontalAlign:"right",top:positionRect.top,left:positionRect.right-size.wi
dth},{verticalAlign:"bottom",horizontalAlign:"left",top:positionRect.bottom-size
.height,left:positionRect.left},{verticalAlign:"bottom",horizontalAlign:"right",
top:positionRect.bottom-size.height,left:positionRect.right-size.width}];if(this
.noOverlap){for(var i=0,l=positions.length;i<l;i++){var copy={};for(var key in p
ositions[i]){copy[key]=positions[i][key]}positions.push(copy)}positions[0].top=p
ositions[1].top+=positionRect.height;positions[2].top=positions[3].top-=position
Rect.height;positions[4].left=positions[6].left+=positionRect.width;positions[5]
.left=positions[7].left-=positionRect.width}vAlign=vAlign==="auto"?null:vAlign;h
Align=hAlign==="auto"?null:hAlign;var position;for(var i=0;i<positions.length;i+
+){var pos=positions[i];if(!this.dynamicAlign&&!this.noOverlap&&pos.verticalAlig
n===vAlign&&pos.horizontalAlign===hAlign){position=pos;break}var alignOk=(!vAlig
n||pos.verticalAlign===vAlign)&&(!hAlign||pos.horizontalAlign===hAlign);if(!this
.dynamicAlign&&!alignOk){continue}position=position||pos;pos.croppedArea=this.__
getCroppedArea(pos,size,fitRect);var diff=pos.croppedArea-position.croppedArea;i
f(diff<0||diff===0&&alignOk){position=pos}if(position.croppedArea===0&&alignOk){
break}}return position}};(function(){"use strict";Polymer({is:"iron-overlay-back
drop",properties:{opened:{reflectToAttribute:true,type:Boolean,value:false,obser
ver:"_openedChanged"}},listeners:{transitionend:"_onTransitionend"},created:func
tion(){this.__openedRaf=null},attached:function(){this.opened&&this._openedChang
ed(this.opened)},prepare:function(){if(this.opened&&!this.parentNode){Polymer.do
m(document.body).appendChild(this)}},open:function(){this.opened=true},close:fun
ction(){this.opened=false},complete:function(){if(!this.opened&&this.parentNode=
==document.body){Polymer.dom(this.parentNode).removeChild(this)}},_onTransitione
nd:function(event){if(event&&event.target===this){this.complete()}},_openedChang
ed:function(opened){if(opened){this.prepare()}else{var cs=window.getComputedStyl
e(this);if(cs.transitionDuration==="0s"||cs.opacity==0){this.complete()}}if(!thi
s.isAttached){return}if(this.__openedRaf){window.cancelAnimationFrame(this.__ope
nedRaf);this.__openedRaf=null}this.scrollTop=this.scrollTop;this.__openedRaf=win
dow.requestAnimationFrame(function(){this.__openedRaf=null;this.toggleClass("ope
ned",this.opened)}.bind(this))}})})();Polymer.IronOverlayManagerClass=function()
{this._overlays=[];this._minimumZ=101;this._backdropElement=null;Polymer.Gesture
s.add(document,"tap",this._onCaptureClick.bind(this));document.addEventListener(
"focus",this._onCaptureFocus.bind(this),true);document.addEventListener("keydown
",this._onCaptureKeyDown.bind(this),true)};Polymer.IronOverlayManagerClass.proto
type={constructor:Polymer.IronOverlayManagerClass,get backdropElement(){if(!this
._backdropElement){this._backdropElement=document.createElement("iron-overlay-ba
ckdrop")}return this._backdropElement},get deepActiveElement(){var active=docume
nt.activeElement||document.body;while(active.root&&Polymer.dom(active.root).acti
veElement){active=Polymer.dom(active.root).activeElement}return active},_bringOv
erlayAtIndexToFront:function(i){var overlay=this._overlays[i];if(!overlay){retur
n}var lastI=this._overlays.length-1;var currentOverlay=this._overlays[lastI];if(
currentOverlay&&this._shouldBeBehindOverlay(overlay,currentOverlay)){lastI--}if(
i>=lastI){return}var minimumZ=Math.max(this.currentOverlayZ(),this._minimumZ);if
(this._getZ(overlay)<=minimumZ){this._applyOverlayZ(overlay,minimumZ)}while(i<la
stI){this._overlays[i]=this._overlays[i+1];i++}this._overlays[lastI]=overlay},ad
dOrRemoveOverlay:function(overlay){if(overlay.opened){this.addOverlay(overlay)}e
lse{this.removeOverlay(overlay)}},addOverlay:function(overlay){var i=this._overl
ays.indexOf(overlay);if(i>=0){this._bringOverlayAtIndexToFront(i);this.trackBack
drop();return}var insertionIndex=this._overlays.length;var currentOverlay=this._
overlays[insertionIndex-1];var minimumZ=Math.max(this._getZ(currentOverlay),this
._minimumZ);var newZ=this._getZ(overlay);if(currentOverlay&&this._shouldBeBehind
Overlay(overlay,currentOverlay)){this._applyOverlayZ(currentOverlay,minimumZ);in
sertionIndex--;var previousOverlay=this._overlays[insertionIndex-1];minimumZ=Mat
h.max(this._getZ(previousOverlay),this._minimumZ)}if(newZ<=minimumZ){this._apply
OverlayZ(overlay,minimumZ)}this._overlays.splice(insertionIndex,0,overlay);this.
trackBackdrop()},removeOverlay:function(overlay){var i=this._overlays.indexOf(ov
erlay);if(i===-1){return}this._overlays.splice(i,1);this.trackBackdrop()},curren
tOverlay:function(){var i=this._overlays.length-1;return this._overlays[i]},curr
entOverlayZ:function(){return this._getZ(this.currentOverlay())},ensureMinimumZ:
function(minimumZ){this._minimumZ=Math.max(this._minimumZ,minimumZ)},focusOverla
y:function(){var current=this.currentOverlay();if(current){current._applyFocus()
}},trackBackdrop:function(){var overlay=this._overlayWithBackdrop();if(!overlay&
&!this._backdropElement){return}this.backdropElement.style.zIndex=this._getZ(ove
rlay)-1;this.backdropElement.opened=!!overlay},getBackdrops:function(){var backd
rops=[];for(var i=0;i<this._overlays.length;i++){if(this._overlays[i].withBackdr
op){backdrops.push(this._overlays[i])}}return backdrops},backdropZ:function(){re
turn this._getZ(this._overlayWithBackdrop())-1},_overlayWithBackdrop:function(){
for(var i=0;i<this._overlays.length;i++){if(this._overlays[i].withBackdrop){retu
rn this._overlays[i]}}},_getZ:function(overlay){var z=this._minimumZ;if(overlay)
{var z1=Number(overlay.style.zIndex||window.getComputedStyle(overlay).zIndex);if
(z1===z1){z=z1}}return z},_setZ:function(element,z){element.style.zIndex=z},_app
lyOverlayZ:function(overlay,aboveZ){this._setZ(overlay,aboveZ+2)},_overlayInPath
:function(path){path=path||[];for(var i=0;i<path.length;i++){if(path[i]._manager
===this){return path[i]}}},_onCaptureClick:function(event){var overlay=this.curr
entOverlay();if(overlay&&this._overlayInPath(Polymer.dom(event).path)!==overlay)
{overlay._onCaptureClick(event)}},_onCaptureFocus:function(event){var overlay=th
is.currentOverlay();if(overlay){overlay._onCaptureFocus(event)}},_onCaptureKeyDo
wn:function(event){var overlay=this.currentOverlay();if(overlay){if(Polymer.Iron
A11yKeysBehavior.keyboardEventMatchesKeys(event,"esc")){overlay._onCaptureEsc(ev
ent)}else if(Polymer.IronA11yKeysBehavior.keyboardEventMatchesKeys(event,"tab"))
{overlay._onCaptureTab(event)}}},_shouldBeBehindOverlay:function(overlay1,overla
y2){return!overlay1.alwaysOnTop&&overlay2.alwaysOnTop}};Polymer.IronOverlayManag
er=new Polymer.IronOverlayManagerClass;(function(){"use strict";Polymer.IronOver
layBehaviorImpl={properties:{opened:{observer:"_openedChanged",type:Boolean,valu
e:false, |
| 47 type:Boolean,value:false},withBackdrop:{observer:"_withBackdropChanged",type:Boo
lean},noAutoFocus:{type:Boolean,value:false},noCancelOnEscKey:{type:Boolean,valu
e:false},noCancelOnOutsideClick:{type:Boolean,value:false},closingReason:{type:O
bject},restoreFocusOnClose:{type:Boolean,value:false},alwaysOnTop:{type:Boolean}
,_manager:{type:Object,value:Polymer.IronOverlayManager},_focusedChild:{type:Obj
ect}},listeners:{"iron-resize":"_onIronResize"},get backdropElement(){return thi
s._manager.backdropElement},get _focusNode(){return this._focusedChild||Polymer.
dom(this).querySelector("[autofocus]")||this},get _focusableNodes(){var FOCUSABL
E_WITH_DISABLED=["a[href]","area[href]","iframe","[tabindex]","[contentEditable=
true]"];var FOCUSABLE_WITHOUT_DISABLED=["input","select","textarea","button"];va
r selector=FOCUSABLE_WITH_DISABLED.join(':not([tabindex="-1"]),')+':not([tabinde
x="-1"]),'+FOCUSABLE_WITHOUT_DISABLED.join(':not([disabled]):not([tabindex="-1"]
),')+':not([disabled]):not([tabindex="-1"])';var focusables=Polymer.dom(this).qu
erySelectorAll(selector);if(this.tabIndex>=0){focusables.splice(0,0,this)}return
focusables.sort(function(a,b){if(a.tabIndex===b.tabIndex){return 0}if(a.tabInde
x===0||a.tabIndex>b.tabIndex){return 1}return-1})},ready:function(){this.__isAni
mating=false;this.__shouldRemoveTabIndex=false;this.__firstFocusableNode=this.__
lastFocusableNode=null;this.__raf=null;this.__restoreFocusNode=null;this._ensure
Setup()},attached:function(){if(this.opened){this._openedChanged(this.opened)}th
is._observer=Polymer.dom(this).observeNodes(this._onNodesChange)},detached:funct
ion(){Polymer.dom(this).unobserveNodes(this._observer);this._observer=null;if(th
is.__raf){window.cancelAnimationFrame(this.__raf);this.__raf=null}this._manager.
removeOverlay(this)},toggle:function(){this._setCanceled(false);this.opened=!thi
s.opened},open:function(){this._setCanceled(false);this.opened=true},close:funct
ion(){this._setCanceled(false);this.opened=false},cancel:function(event){var can
celEvent=this.fire("iron-overlay-canceled",event,{cancelable:true});if(cancelEve
nt.defaultPrevented){return}this._setCanceled(true);this.opened=false},_ensureSe
tup:function(){if(this._overlaySetup){return}this._overlaySetup=true;this.style.
outline="none";this.style.display="none"},_openedChanged:function(opened){if(ope
ned){this.removeAttribute("aria-hidden")}else{this.setAttribute("aria-hidden","t
rue")}if(!this.isAttached){return}this.__isAnimating=true;this.__onNextAnimation
Frame(this.__openedChanged)},_canceledChanged:function(){this.closingReason=this
.closingReason||{};this.closingReason.canceled=this.canceled},_withBackdropChang
ed:function(){if(this.withBackdrop&&!this.hasAttribute("tabindex")){this.setAttr
ibute("tabindex","-1");this.__shouldRemoveTabIndex=true}else if(this.__shouldRem
oveTabIndex){this.removeAttribute("tabindex");this.__shouldRemoveTabIndex=false}
if(this.opened&&this.isAttached){this._manager.trackBackdrop()}},_prepareRenderO
pened:function(){this.__restoreFocusNode=this._manager.deepActiveElement;this._p
reparePositioning();this.refit();this._finishPositioning();if(this.noAutoFocus&&
document.activeElement===this._focusNode){this._focusNode.blur();this.__restoreF
ocusNode.focus()}},_renderOpened:function(){this._finishRenderOpened()},_renderC
losed:function(){this._finishRenderClosed()},_finishRenderOpened:function(){this
.notifyResize();this.__isAnimating=false;var focusableNodes=this._focusableNodes
;this.__firstFocusableNode=focusableNodes[0];this.__lastFocusableNode=focusableN
odes[focusableNodes.length-1];this.fire("iron-overlay-opened")},_finishRenderClo
sed:function(){this.style.display="none";this.style.zIndex="";this.notifyResize(
);this.__isAnimating=false;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.displa
y=""},_finishPositioning:function(){this.style.display="none";this.scrollTop=thi
s.scrollTop;this.style.transition=this.style.webkitTransition="";this.style.tran
sform=this.style.webkitTransform="";this.style.display="";this.scrollTop=this.sc
rollTop},_applyFocus:function(){if(this.opened){if(!this.noAutoFocus){this._focu
sNode.focus()}}else{this._focusNode.blur();this._focusedChild=null;if(this.resto
reFocusOnClose&&this.__restoreFocusNode){this.__restoreFocusNode.focus()}this.__
restoreFocusNode=null;var currentOverlay=this._manager.currentOverlay();if(curre
ntOverlay&&this!==currentOverlay){currentOverlay._applyFocus()}}},_onCaptureClic
k:function(event){if(!this.noCancelOnOutsideClick){this.cancel(event)}},_onCaptu
reFocus:function(event){if(!this.withBackdrop){return}var path=Polymer.dom(event
).path;if(path.indexOf(this)===-1){event.stopPropagation();this._applyFocus()}el
se{this._focusedChild=path[0]}},_onCaptureEsc:function(event){if(!this.noCancelO
nEscKey){this.cancel(event)}},_onCaptureTab:function(event){if(!this.withBackdro
p){return}var shift=event.shiftKey;var nodeToCheck=shift?this.__firstFocusableNo
de:this.__lastFocusableNode;var nodeToSet=shift?this.__lastFocusableNode:this.__
firstFocusableNode;var shouldWrap=false;if(nodeToCheck===nodeToSet){shouldWrap=t
rue}else{var focusedNode=this._manager.deepActiveElement;shouldWrap=focusedNode=
==nodeToCheck||focusedNode===this}if(shouldWrap){event.preventDefault();this._fo
cusedChild=nodeToSet;this._applyFocus()}},_onIronResize:function(){if(this.opene
d&&!this.__isAnimating){this.__onNextAnimationFrame(this.refit)}},_onNodesChange
:function(){if(this.opened&&!this.__isAnimating){this.notifyResize()}},__openedC
hanged:function(){if(this.opened){this._prepareRenderOpened();this._manager.addO
verlay(this);this._applyFocus();this._renderOpened()}else{this._manager.removeOv
erlay(this);this._applyFocus();this._renderClosed()}},__onNextAnimationFrame:fun
ction(callback){if(this.__raf){window.cancelAnimationFrame(this.__raf)}var self=
this;this.__raf=window.requestAnimationFrame(function nextAnimationFrame(){self.
__raf=null;callback.call(self)})}};Polymer.IronOverlayBehavior=[Polymer.IronFitB
ehavior,Polymer.IronResizableBehavior,Polymer.IronOverlayBehaviorImpl]})();Polym
er.NeonAnimatableBehavior={properties:{animationConfig:{type:Object},entryAnimat
ion:{observer:"_entryAnimationChanged",type:String},exitAnimation:{observer:"_ex
itAnimationChanged",type:String}},_entryAnimationChanged:function(){this.animati
onConfig=this.animationConfig||{};this.animationConfig["entry"]=[{name:this.entr
yAnimation,node:this}]},_exitAnimationChanged:function(){this.animationConfig=th
is.animationConfig||{};this.animationConfig["exit"]=[{name:this.exitAnimation,no
de:this}]},_copyProperties:function(config1,config2){for(var property in config2
){config1[property]=config2[property]}},_cloneConfig:function(config){var clone=
{isClone:true};this._copyProperties(clone,config);return clone},_getAnimationCon
figRecursive:function(type,map,allConfigs){if(!this.animationConfig){return}if(t
his.animationConfig.value&&typeof this.animationConfig.value==="function"){this.
_warn(this._logf("playAnimation","Please put 'animationConfig' inside of your co
mponents 'properties' object instead of outside of it."));return}var thisConfig;
if(type){thisConfig=this.animationConfig[type]}else{thisConfig=this.animationCon
fig}if(!Array.isArray(thisConfig)){thisConfig=[thisConfig]}if(thisConfig){for(va
r config,index=0;config=thisConfig[index];index++){if(config.animatable){config.
animatable._getAnimationConfigRecursive(config.type||type,map,allConfigs)}else{i
f(config.id){var cachedConfig=map[config.id];if(cachedConfig){if(!cachedConfig.i
sClone){map[config.id]=this._cloneConfig(cachedConfig);cachedConfig=map[config.i
d]}this._copyProperties(cachedConfig,config)}else{map[config.id]=config}}else{al
lConfigs.push(config)}}}}},getAnimationConfig:function(type){var map={};var allC
onfigs=[];this._getAnimationConfigRecursive(type,map,allConfigs);for(var key in
map){allConfigs.push(map[key])}return allConfigs}};Polymer.NeonAnimationRunnerBe
haviorImpl={_configureAnimations:function(configs){var results=[];if(configs.len
gth>0){for(var config,index=0;config=configs[index];index++){var neonAnimation=d
ocument.createElement(config.name);if(neonAnimation.isNeonAnimation){var result=
null;try{result=neonAnimation.configure(config);if(typeof result.cancel!="functi
on"){result=document.timeline.play(result)}}catch(e){result=null;console.warn("C
ouldnt play","(",config.name,").",e)}if(result){results.push({neonAnimation:neon
Animation,config:config,animation:result})}}else{console.warn(this.is+":",config
.name,"not found!")}}}return results},_shouldComplete:function(activeEntries){va
r finished=true;for(var i=0;i<activeEntries.length;i++){if(activeEntries[i].anim
ation.playState!="finished"){finished=false;break}}return finished},_complete:fu
nction(activeEntries){for(var i=0;i<activeEntries.length;i++){activeEntries[i].n
eonAnimation.complete(activeEntries[i].config)}for(var i=0;i<activeEntries.lengt
h;i++){activeEntries[i].animation.cancel()}},playAnimation:function(type,cookie)
{var configs=this.getAnimationConfig(type);if(!configs){return}this._active=this
._active||{};if(this._active[type]){this._complete(this._active[type]);delete th
is._active[type]}var activeEntries=this._configureAnimations(configs);if(activeE
ntries.length==0){this.fire("neon-animation-finish",cookie,{bubbles:false});retu
rn}this._active[type]=activeEntries;for(var i=0;i<activeEntries.length;i++){acti
veEntries[i].animation.onfinish=function(){if(this._shouldComplete(activeEntries
)){this._complete(activeEntries);delete this._active[type];this.fire("neon-anima
tion-finish",cookie,{bubbles:false})}}.bind(this)}},cancelAnimation:function(){f
or(var k in this._animations){this._animations[k].cancel()}this._animations={}}}
;Polymer.NeonAnimationRunnerBehavior=[Polymer.NeonAnimatableBehavior,Polymer.Neo
nAnimationRunnerBehaviorImpl];Polymer.NeonAnimationBehavior={properties:{animati
onTiming:{type:Object,value:function(){return{duration:500,easing:"cubic-bezier(
0.4, 0, 0.2, 1)",fill:"both"}}}},isNeonAnimation:true,timingFromConfig:function(
config){if(config.timing){for(var property in config.timing){this.animationTimin
g[property]=config.timing[property]}}return this.animationTiming},setPrefixedPro
perty:function(node,property,value){var map={transform:["webkitTransform"],trans
formOrigin:["mozTransformOrigin","webkitTransformOrigin"]};var prefixes=map[prop
erty];for(var prefix,index=0;prefix=prefixes[index];index++){node.style[prefix]=
value}node.style[property]=value},complete:function(){}};Polymer({is:"opaque-ani
mation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(config){var
node=config.node;this._effect=new KeyframeEffect(node,[{opacity:"1"},{opacity:"
1"}],this.timingFromConfig(config));node.style.opacity="0";return this._effect},
complete:function(config){config.node.style.opacity=""}});(function(){"use stric
t";var LAST_TOUCH_POSITION={pageX:0,pageY:0};var ROOT_TARGET=null;var SCROLLABLE
_NODES=[];Polymer.IronDropdownScrollManager={get currentLockingElement(){return
this._lockingElements[this._lockingElements.length-1]},elementIsScrollLocked:fun
ction(element){var currentLockingElement=this.currentLockingElement;if(currentLo
ckingElement===undefined)return false;var scrollLocked;if(this._hasCachedLockedE
lement(element)){return true}if(this._hasCachedUnlockedElement(element)){return
false}scrollLocked=!!currentLockingElement&¤tLockingElement!==element&&!th
is._composedTreeContains(currentLockingElement,element);if(scrollLocked){this._l
ockedElementCache.push(element)}else{this._unlockedElementCache.push(element)}re
turn scrollLocked},pushScrollLock:function(element){if(this._lockingElements.ind
exOf(element)>=0){return}if(this._lockingElements.length===0){this._lockScrollIn
teractions()}this._lockingElements.push(element);this._lockedElementCache=[];thi
s._unlockedElementCache=[]},removeScrollLock:function(element){var index=this._l
ockingElements.indexOf(element);if(index===-1){return}this._lockingElements.spli
ce(index,1);this._lockedElementCache=[];this._unlockedElementCache=[];if(this._l
ockingElements.length===0){this._unlockScrollInteractions()}},_lockingElements:[
],_lockedElementCache:null,_unlockedElementCache:null,_hasCachedLockedElement:fu
nction(element){return this._lockedElementCache.indexOf(element)>-1},_hasCachedU
nlockedElement:function(element){return this._unlockedElementCache.indexOf(eleme
nt)>-1},_composedTreeContains:function(element,child){var contentElements;var di
stributedNodes;var contentIndex;var nodeIndex;if(element.contains(child)){return
true}contentElements=Polymer.dom(element).querySelectorAll("content");for(conte
ntIndex=0;contentIndex<contentElements.length;++contentIndex){distributedNodes=P
olymer.dom(contentElements[contentIndex]).getDistributedNodes();for(nodeIndex=0;
nodeIndex<distributedNodes.length;++nodeIndex){if(this._composedTreeContains(dis
tributedNodes[nodeIndex],child)){return true}}}return false},_scrollInteractionH
andler:function(event){if(event.cancelable&&this._shouldPreventScrolling(event))
{event.preventDefault()}if(event.targetTouches){var touch=event.targetTouches[0]
;LAST_TOUCH_POSITION.pageX=touch.pageX;LAST_TOUCH_POSITION.pageY=touch.pageY}},_
lockScrollInteractions:function(){this._boundScrollHandler=this._boundScrollHand
ler||this._scrollInteractionHandler.bind(this);document.addEventListener("wheel"
,this._boundScrollHandler,true);document.addEventListener("mousewheel",this._bou
ndScrollHandler,true);document.addEventListener("DOMMouseScroll",this._boundScro
llHandler,true);document.addEventListener("touchstart",this._boundScrollHandler,
true);document.addEventListener("touchmove",this._boundScrollHandler,true)},_unl
ockScrollInteractions:function(){document.removeEventListener("wheel",this._boun
dScrollHandler,true);document.removeEventListener("mousewheel",this._boundScroll
Handler,true);document.removeEventListener("DOMMouseScroll",this._boundScrollHan
dler,true);document.removeEventListener("touchstart",this._boundScrollHandler,tr
ue);document.removeEventListener("touchmove",this._boundScrollHandler,true)},_sh
ouldPreventScrolling:function(event){var target=Polymer.dom(event).rootTarget;if
(event.type!=="touchmove"&&ROOT_TARGET!==target){ROOT_TARGET=target;SCROLLABLE_N
ODES=this._getScrollableNodes(Polymer.dom(event).path)}if(!SCROLLABLE_NODES.leng
th){return true}if(event.type==="touchstart"){return false}var info=this._getScr
ollInfo(event);return!this._getScrollingNode(SCROLLABLE_NODES,info.deltaX,info.d
eltaY)},_getScrollableNodes:function(nodes){var scrollables=[];var lockingIndex=
nodes.indexOf(this.currentLockingElement);for(var i=0;i<=lockingIndex;i++){var n
ode=nodes[i];if(node.nodeType===11){continue}var style=node.style;if(style.overf
low!=="scroll"&&style.overflow!=="auto"){style=window.getComputedStyle(node)}if(
style.overflow==="scroll"||style.overflow==="auto"){scrollables.push(node)}}retu
rn scrollables},_getScrollingNode:function(nodes,deltaX,deltaY){if(!deltaX&&!del
taY){return}var verticalScroll=Math.abs(deltaY)>=Math.abs(deltaX);for(var i=0;i<
nodes.length;i++){var node=nodes[i];var canScroll=false;if(verticalScroll){canSc
roll=deltaY<0?node.scrollTop>0:node.scrollTop<node.scrollHeight-node.clientHeigh
t}else{canScroll=deltaX<0?node.scrollLeft>0:node.scrollLeft<node.scrollWidth-nod
e.clientWidth}if(canScroll){return node}}},_getScrollInfo:function(event){var in
fo={deltaX:event.deltaX,deltaY:event.deltaY};if("deltaX"in event){}else if("whee
lDeltaX"in event){info.deltaX=-event.wheelDeltaX;info.deltaY=-event.wheelDeltaY}
else if("axis"in event){info.deltaX=event.axis===1?event.detail:0;info.deltaY=ev
ent.axis===2?event.detail:0}else if(event.targetTouches){var touch=event.targetT
ouches[0];info.deltaX=LAST_TOUCH_POSITION.pageX-touch.pageX;info.deltaY=LAST_TOU
CH_POSITION.pageY-touch.pageY}return info}}})();(function(){"use strict";Polymer
({is:"iron-dropdown",behaviors:[Polymer.IronControlState,Polymer.IronA11yKeysBeh
avior,Polymer.IronOverlayBehavior,Polymer.NeonAnimationRunnerBehavior],propertie
s:{horizontalAlign:{type:String,value:"left",reflectToAttribute:true},verticalAl
ign:{type:String,value:"top",reflectToAttribute:true},openAnimationConfig:{type:
Object},closeAnimationConfig:{type:Object},focusTarget:{type:Object},noAnimation
s:{type:Boolean,value:false},allowOutsideScroll:{type:Boolean,value:false},_boun
dOnCaptureScroll:{type:Function,value:function(){return this._onCaptureScroll.bi
nd(this)}}},listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},observe
rs:["_updateOverlayPosition(positionTarget, verticalAlign, horizontalAlign, vert
icalOffset, horizontalOffset)"],get containedElement(){return Polymer.dom(this.$
.content).getDistributedNodes()[0]},get _focusTarget(){return this.focusTarget||
this.containedElement},ready:function(){this._scrollTop=0;this._scrollLeft=0;thi
s._refitOnScrollRAF=null},attached:function(){if(!this.sizingTarget||this.sizing
Target===this){this.sizingTarget=this.containedElement}},detached:function(){thi
s.cancelAnimation();document.removeEventListener("scroll",this._boundOnCaptureSc
roll);Polymer.IronDropdownScrollManager.removeScrollLock(this)},_openedChanged:f
unction(){if(this.opened&&this.disabled){this.cancel()}else{this.cancelAnimation
();this._updateAnimationConfig();this._saveScrollPosition();if(this.opened){docu
ment.addEventListener("scroll",this._boundOnCaptureScroll);!this.allowOutsideScr
oll&&Polymer.IronDropdownScrollManager.pushScrollLock(this)}else{document.remove
EventListener("scroll",this._boundOnCaptureScroll);Polymer.IronDropdownScrollMan
ager.removeScrollLock(this)}Polymer.IronOverlayBehaviorImpl._openedChanged.apply
(this,arguments)}},_renderOpened:function(){if(!this.noAnimations&&this.animatio
nConfig.open){this.$.contentWrapper.classList.add("animating");this.playAnimatio
n("open")}else{Polymer.IronOverlayBehaviorImpl._renderOpened.apply(this,argument
s)}},_renderClosed:function(){if(!this.noAnimations&&this.animationConfig.close)
{this.$.contentWrapper.classList.add("animating");this.playAnimation("close")}el
se{Polymer.IronOverlayBehaviorImpl._renderClosed.apply(this,arguments)}},_onNeon
AnimationFinish:function(){this.$.contentWrapper.classList.remove("animating");i
f(this.opened){this._finishRenderOpened()}else{this._finishRenderClosed()}},_onC
aptureScroll:function(){if(!this.allowOutsideScroll){this._restoreScrollPosition
()}else{this._refitOnScrollRAF&&window.cancelAnimationFrame(this._refitOnScrollR
AF);this._refitOnScrollRAF=window.requestAnimationFrame(this.refit.bind(this))}}
,_saveScrollPosition:function(){if(document.scrollingElement){this._scrollTop=do
cument.scrollingElement.scrollTop;this._scrollLeft=document.scrollingElement.scr
ollLeft}else{this._scrollTop=Math.max(document.documentElement.scrollTop,documen
t.body.scrollTop);this._scrollLeft=Math.max(document.documentElement.scrollLeft,
document.body.scrollLeft)}},_restoreScrollPosition:function(){if(document.scroll
ingElement){document.scrollingElement.scrollTop=this._scrollTop;document.scrolli
ngElement.scrollLeft=this._scrollLeft}else{document.documentElement.scrollTop=th
is._scrollTop;document.documentElement.scrollLeft=this._scrollLeft;document.body
.scrollTop=this._scrollTop;document.body.scrollLeft=this._scrollLeft}},_updateAn
imationConfig:function(){var animations=(this.openAnimationConfig||[]).concat(th
is.closeAnimationConfig||[]);for(var i=0;i<animations.length;i++){animations[i].
node=this.containedElement}this.animationConfig={open:this.openAnimationConfig,c
lose:this.closeAnimationConfig}},_updateOverlayPosition:function(){if(this.isAtt
ached){this.notifyResize()}},_applyFocus:function(){var focusTarget=this.focusTa
rget||this.containedElement;if(focusTarget&&this.opened&&!this.noAutoFocus){focu
sTarget.focus()}else{Polymer.IronOverlayBehaviorImpl._applyFocus.apply(this,argu
ments)}}})})();Polymer({is:"fade-in-animation",behaviors:[Polymer.NeonAnimationB
ehavior],configure:function(config){var node=config.node;this._effect=new Keyfra
meEffect(node,[{opacity:"0"},{opacity:"1"}],this.timingFromConfig(config));retur
n this._effect}});Polymer({is:"fade-out-animation",behaviors:[Polymer.NeonAnimat
ionBehavior],configure:function(config){var node=config.node;this._effect=new Ke
yframeEffect(node,[{opacity:"1"},{opacity:"0"}],this.timingFromConfig(config));r
eturn this._effect}});Polymer({is:"paper-menu-grow-height-animation",behaviors:[
Polymer.NeonAnimationBehavior],configure:function(config){var node=config.node;v
ar rect=node.getBoundingClientRect();var height=rect.height;this._effect=new Key
frameEffect(node,[{height:height/2+"px"},{height:height+"px"}],this.timingFromCo
nfig(config));return this._effect}});Polymer({is:"paper-menu-grow-width-animatio
n",behaviors:[Polymer.NeonAnimationBehavior],configure:function(config){var node
=config.node;var rect=node.getBoundingClientRect();var width=rect.width;this._ef
fect=new KeyframeEffect(node,[{width:width/2+"px"},{width:width+"px"}],this.timi
ngFromConfig(config));return this._effect}});Polymer({is:"paper-menu-shrink-widt
h-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(config
){var node=config.node;var rect=node.getBoundingClientRect();var width=rect.widt
h;this._effect=new KeyframeEffect(node,[{width:width+"px"},{width:width-width/20
+"px"}],this.timingFromConfig(config));return this._effect}});Polymer({is:"paper
-menu-shrink-height-animation",behaviors:[Polymer.NeonAnimationBehavior],configu
re:function(config){var node=config.node;var rect=node.getBoundingClientRect();v
ar height=rect.height;var top=rect.top;this.setPrefixedProperty(node,"transformO
rigin","0 0");this._effect=new KeyframeEffect(node,[{height:height+"px",transfor
m:"translateY(0)"},{height:height/2+"px",transform:"translateY(-20px)"}],this.ti
mingFromConfig(config));return this._effect}});(function(){"use strict";var conf
ig={ANIMATION_CUBIC_BEZIER:"cubic-bezier(.3,.95,.5,1)",MAX_ANIMATION_TIME_MS:400
};var PaperMenuButton=Polymer({is:"paper-menu-button",behaviors:[Polymer.IronA11
yKeysBehavior,Polymer.IronControlState],properties:{opened:{type:Boolean,value:f
alse,notify:true,observer:"_openedChanged"},horizontalAlign:{type:String,value:"
left",reflectToAttribute:true},verticalAlign:{type:String,value:"top",reflectToA
ttribute:true},dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0
,notify:true},verticalOffset:{type:Number,value:0,notify:true},noOverlap:{type:B
oolean},noAnimations:{type:Boolean,value:false},ignoreSelect:{type:Boolean,value
:false},closeOnActivate:{type:Boolean,value:false},openAnimationConfig:{type:Obj
ect,value:function(){return[{name:"fade-in-animation",timing:{delay:100,duration
:200}},{name:"paper-menu-grow-width-animation",timing:{delay:100,duration:150,ea
sing:config.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-grow-height-animation",ti
ming:{delay:100,duration:275,easing:config.ANIMATION_CUBIC_BEZIER}}]}},closeAnim
ationConfig:{type:Object,value:function(){return[{name:"fade-out-animation",timi
ng:{duration:150}},{name:"paper-menu-shrink-width-animation",timing:{delay:100,d
uration:50,easing:config.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-shrink-heigh
t-animation",timing:{duration:200,easing:"ease-in"}}]}},allowOutsideScroll:{type
:Boolean,value:false},restoreFocusOnClose:{type:Boolean,value:true},_dropdownCon
tent:{type:Object}},hostAttributes:{role:"group","aria-haspopup":"true"},listene
rs:{"iron-activate":"_onIronActivate","iron-select":"_onIronSelect"},get content
Element(){return Polymer.dom(this.$.content).getDistributedNodes()[0]},toggle:fu
nction(){if(this.opened){this.close()}else{this.open()}},open:function(){if(this
.disabled){return}this.$.dropdown.open()},close:function(){this.$.dropdown.close
()},_onIronSelect:function(event){if(!this.ignoreSelect){this.close()}},_onIronA
ctivate:function(event){if(this.closeOnActivate){this.close()}},_openedChanged:f
unction(opened,oldOpened){if(opened){this._dropdownContent=this.contentElement;t
his.fire("paper-dropdown-open")}else if(oldOpened!=null){this.fire("paper-dropdo
wn-close")}},_disabledChanged:function(disabled){Polymer.IronControlState._disab
ledChanged.apply(this,arguments);if(disabled&&this.opened){this.close()}},__onIr
onOverlayCanceled:function(event){var uiEvent=event.detail;var target=Polymer.do
m(uiEvent).rootTarget;var trigger=this.$.trigger;var path=Polymer.dom(uiEvent).p
ath;if(path.indexOf(trigger)>-1){event.preventDefault()}}});Object.keys(config).
forEach(function(key){PaperMenuButton[key]=config[key]});Polymer.PaperMenuButton
=PaperMenuButton})();Polymer.PaperInkyFocusBehaviorImpl={observers:["_focusedCha
nged(receivedFocusFromKeyboard)"],_focusedChanged:function(receivedFocusFromKeyb
oard){if(receivedFocusFromKeyboard){this.ensureRipple()}if(this.hasRipple()){thi
s._ripple.holdDown=receivedFocusFromKeyboard}},_createRipple:function(){var ripp
le=Polymer.PaperRippleBehavior._createRipple();ripple.id="ink";ripple.setAttribu
te("center","");ripple.classList.add("circle");return ripple}};Polymer.PaperInky
FocusBehavior=[Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRip
pleBehavior,Polymer.PaperInkyFocusBehaviorImpl];Polymer({is:"paper-icon-button",
hostAttributes:{role:"button",tabindex:"0"},behaviors:[Polymer.PaperInkyFocusBeh
avior],properties:{src:{type:String},icon:{type:String},alt:{type:String,observe
r:"_altChanged"}},_altChanged:function(newValue,oldValue){var label=this.getAttr
ibute("aria-label");if(!label||oldValue==label){this.setAttribute("aria-label",n
ewValue)}}});Polymer({is:"iron-media-query",properties:{queryMatches:{type:Boole
an,value:false,readOnly:true,notify:true},query:{type:String,observer:"queryChan
ged"},full:{type:Boolean,value:false},_boundMQHandler:{value:function(){return t
his.queryHandler.bind(this)}},_mq:{value:null}},attached:function(){this.style.d
isplay="none";this.queryChanged()},detached:function(){this._remove()},_add:func
tion(){if(this._mq){this._mq.addListener(this._boundMQHandler)}},_remove:functio
n(){if(this._mq){this._mq.removeListener(this._boundMQHandler)}this._mq=null},qu
eryChanged:function(){this._remove();var query=this.query;if(!query){return}if(!
this.full&&query[0]!=="("){query="("+query+")"}this._mq=window.matchMedia(query)
;this._add();this.queryHandler(this._mq)},queryHandler:function(mq){this._setQue
ryMatches(mq.matches)}});(function(){"use strict";Polymer.IronA11yAnnouncer=Poly
mer({is:"iron-a11y-announcer",properties:{mode:{type:String,value:"polite"},_tex
t:{type:String,value:""}},created:function(){if(!Polymer.IronA11yAnnouncer.insta
nce){Polymer.IronA11yAnnouncer.instance=this}document.body.addEventListener("iro
n-announce",this._onIronAnnounce.bind(this))},announce:function(text){this._text
="";this.async(function(){this._text=text},100)},_onIronAnnounce:function(event)
{if(event.detail&&event.detail.text){this.announce(event.detail.text)}}});Polyme
r.IronA11yAnnouncer.instance=null;Polymer.IronA11yAnnouncer.requestAvailability=
function(){if(!Polymer.IronA11yAnnouncer.instance){Polymer.IronA11yAnnouncer.ins
tance=document.createElement("iron-a11y-announcer")}document.body.appendChild(Po
lymer.IronA11yAnnouncer.instance)}})();Polymer.IronValidatableBehaviorMeta=null;
Polymer.IronValidatableBehavior={properties:{validator:{type:String},invalid:{no
tify:true,reflectToAttribute:true,type:Boolean,value:false},_validatorMeta:{type
:Object},validatorType:{type:String,value:"validator"},_validator:{type:Object,c
omputed:"__computeValidator(validator)"}},observers:["_invalidChanged(invalid)"]
,registered:function(){Polymer.IronValidatableBehaviorMeta=new Polymer.IronMeta(
{type:"validator"})},_invalidChanged:function(){if(this.invalid){this.setAttribu
te("aria-invalid","true")}else{this.removeAttribute("aria-invalid")}},hasValidat
or:function(){return this._validator!=null},validate:function(value){this.invali
d=!this._getValidity(value);return!this.invalid},_getValidity:function(value){if
(this.hasValidator()){return this._validator.validate(value)}return true},__comp
uteValidator:function(){return Polymer.IronValidatableBehaviorMeta&&Polymer.Iron
ValidatableBehaviorMeta.byKey(this.validator)}};Polymer({is:"iron-input","extend
s":"input",behaviors:[Polymer.IronValidatableBehavior],properties:{bindValue:{ob
server:"_bindValueChanged",type:String},preventInvalidInput:{type:Boolean},allow
edPattern:{type:String,observer:"_allowedPatternChanged"},_previousValidInput:{t
ype:String,value:""},_patternAlreadyChecked:{type:Boolean,value:false}},listener
s:{input:"_onInput",keypress:"_onKeypress"},registered:function(){if(!this._canD
ispatchEventOnDisabled()){this._origDispatchEvent=this.dispatchEvent;this.dispat
chEvent=this._dispatchEventFirefoxIE}},created:function(){Polymer.IronA11yAnnoun
cer.requestAvailability()},_canDispatchEventOnDisabled:function(){var input=docu
ment.createElement("input");var canDispatch=false;input.disabled=true;input.addE
ventListener("feature-check-dispatch-event",function(){canDispatch=true});try{in
put.dispatchEvent(new Event("feature-check-dispatch-event"))}catch(e){}return ca
nDispatch},_dispatchEventFirefoxIE:function(){var disabled=this.disabled;this.di
sabled=false;this._origDispatchEvent.apply(this,arguments);this.disabled=disable
d},get _patternRegExp(){var pattern;if(this.allowedPattern){pattern=new RegExp(t
his.allowedPattern)}else{switch(this.type){case"number":pattern=/[0-9.,e-]/;brea
k}}return pattern},ready:function(){this.bindValue=this.value},_bindValueChanged
:function(){if(this.value!==this.bindValue){this.value=!(this.bindValue||this.bi
ndValue===0||this.bindValue===false)?"":this.bindValue}this.fire("bind-value-cha
nged",{value:this.bindValue})},_allowedPatternChanged:function(){this.preventInv
alidInput=this.allowedPattern?true:false},_onInput:function(){if(this.preventInv
alidInput&&!this._patternAlreadyChecked){var valid=this._checkPatternValidity();
if(!valid){this._announceInvalidCharacter("Invalid string of characters not ente
red.");this.value=this._previousValidInput}}this.bindValue=this.value;this._prev
iousValidInput=this.value;this._patternAlreadyChecked=false},_isPrintable:functi
on(event){var anyNonPrintable=event.keyCode==8||event.keyCode==9||event.keyCode=
=13||event.keyCode==27;var mozNonPrintable=event.keyCode==19||event.keyCode==20|
|event.keyCode==45||event.keyCode==46||event.keyCode==144||event.keyCode==145||e
vent.keyCode>32&&event.keyCode<41||event.keyCode>111&&event.keyCode<124;return!a
nyNonPrintable&&!(event.charCode==0&&mozNonPrintable)},_onKeypress:function(even
t){if(!this.preventInvalidInput&&this.type!=="number"){return}var regexp=this._p
atternRegExp;if(!regexp){return}if(event.metaKey||event.ctrlKey||event.altKey)re
turn;this._patternAlreadyChecked=true;var thisChar=String.fromCharCode(event.cha
rCode);if(this._isPrintable(event)&&!regexp.test(thisChar)){event.preventDefault
();this._announceInvalidCharacter("Invalid character "+thisChar+" not entered.")
}},_checkPatternValidity:function(){var regexp=this._patternRegExp;if(!regexp){r
eturn true}for(var i=0;i<this.value.length;i++){if(!regexp.test(this.value[i])){
return false}}return true},validate:function(){var valid=this.checkValidity();if
(valid){if(this.required&&this.value===""){valid=false}else if(this.hasValidator
()){valid=Polymer.IronValidatableBehavior.validate.call(this,this.value)}}this.i
nvalid=!valid;this.fire("iron-input-validate");return valid},_announceInvalidCha
racter:function(message){this.fire("iron-announce",{text:message})}});Polymer({i
s:"paper-input-container",properties:{noLabelFloat:{type:Boolean,value:false},al
waysFloatLabel:{type:Boolean,value:false},attrForValue:{type:String,value:"bind-
value"},autoValidate:{type:Boolean,value:false},invalid:{observer:"_invalidChang
ed",type:Boolean,value:false},focused:{readOnly:true,type:Boolean,value:false,no
tify:true},_addons:{type:Array},_inputHasContent:{type:Boolean,value:false},_inp
utSelector:{type:String,value:"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)}},_boundValueChan
ged:{ | 47 notify:true},canceled:{observer:"_canceledChanged",readOnly:true,type:Boolean,va
lue:false},withBackdrop:{observer:"_withBackdropChanged",type:Boolean},noAutoFoc
us:{type:Boolean,value:false},noCancelOnEscKey:{type:Boolean,value:false},noCanc
elOnOutsideClick:{type:Boolean,value:false},closingReason:{type:Object},restoreF
ocusOnClose:{type:Boolean,value:false},alwaysOnTop:{type:Boolean},_manager:{type
:Object,value:Polymer.IronOverlayManager},_focusedChild:{type:Object}},listeners
:{"iron-resize":"_onIronResize"},get backdropElement(){return this._manager.back
dropElement},get _focusNode(){return this._focusedChild||Polymer.dom(this).query
Selector("[autofocus]")||this},get _focusableNodes(){var FOCUSABLE_WITH_DISABLED
=["a[href]","area[href]","iframe","[tabindex]","[contentEditable=true]"];var FOC
USABLE_WITHOUT_DISABLED=["input","select","textarea","button"];var selector=FOCU
SABLE_WITH_DISABLED.join(':not([tabindex="-1"]),')+':not([tabindex="-1"]),'+FOCU
SABLE_WITHOUT_DISABLED.join(':not([disabled]):not([tabindex="-1"]),')+':not([dis
abled]):not([tabindex="-1"])';var focusables=Polymer.dom(this).querySelectorAll(
selector);if(this.tabIndex>=0){focusables.splice(0,0,this)}return focusables.sor
t(function(a,b){if(a.tabIndex===b.tabIndex){return 0}if(a.tabIndex===0||a.tabInd
ex>b.tabIndex){return 1}return-1})},ready:function(){this.__isAnimating=false;th
is.__shouldRemoveTabIndex=false;this.__firstFocusableNode=this.__lastFocusableNo
de=null;this.__raf=null;this.__restoreFocusNode=null;this._ensureSetup()},attach
ed:function(){if(this.opened){this._openedChanged(this.opened)}this._observer=Po
lymer.dom(this).observeNodes(this._onNodesChange)},detached:function(){Polymer.d
om(this).unobserveNodes(this._observer);this._observer=null;if(this.__raf){windo
w.cancelAnimationFrame(this.__raf);this.__raf=null}this._manager.removeOverlay(t
his)},toggle:function(){this._setCanceled(false);this.opened=!this.opened},open:
function(){this._setCanceled(false);this.opened=true},close:function(){this._set
Canceled(false);this.opened=false},cancel:function(event){var cancelEvent=this.f
ire("iron-overlay-canceled",event,{cancelable:true});if(cancelEvent.defaultPreve
nted){return}this._setCanceled(true);this.opened=false},_ensureSetup:function(){
if(this._overlaySetup){return}this._overlaySetup=true;this.style.outline="none";
this.style.display="none"},_openedChanged:function(opened){if(opened){this.remov
eAttribute("aria-hidden")}else{this.setAttribute("aria-hidden","true")}if(!this.
isAttached){return}this.__isAnimating=true;this.__onNextAnimationFrame(this.__op
enedChanged)},_canceledChanged:function(){this.closingReason=this.closingReason|
|{};this.closingReason.canceled=this.canceled},_withBackdropChanged:function(){i
f(this.withBackdrop&&!this.hasAttribute("tabindex")){this.setAttribute("tabindex
","-1");this.__shouldRemoveTabIndex=true}else if(this.__shouldRemoveTabIndex){th
is.removeAttribute("tabindex");this.__shouldRemoveTabIndex=false}if(this.opened&
&this.isAttached){this._manager.trackBackdrop()}},_prepareRenderOpened:function(
){this.__restoreFocusNode=this._manager.deepActiveElement;this._preparePositioni
ng();this.refit();this._finishPositioning();if(this.noAutoFocus&&document.active
Element===this._focusNode){this._focusNode.blur();this.__restoreFocusNode.focus(
)}},_renderOpened:function(){this._finishRenderOpened()},_renderClosed:function(
){this._finishRenderClosed()},_finishRenderOpened:function(){this.notifyResize()
;this.__isAnimating=false;var focusableNodes=this._focusableNodes;this.__firstFo
cusableNode=focusableNodes[0];this.__lastFocusableNode=focusableNodes[focusableN
odes.length-1];this.fire("iron-overlay-opened")},_finishRenderClosed:function(){
this.style.display="none";this.style.zIndex="";this.notifyResize();this.__isAnim
ating=false;this.fire("iron-overlay-closed",this.closingReason)},_preparePositio
ning:function(){this.style.transition=this.style.webkitTransition="none";this.st
yle.transform=this.style.webkitTransform="none";this.style.display=""},_finishPo
sitioning:function(){this.style.display="none";this.scrollTop=this.scrollTop;thi
s.style.transition=this.style.webkitTransition="";this.style.transform=this.styl
e.webkitTransform="";this.style.display="";this.scrollTop=this.scrollTop},_apply
Focus:function(){if(this.opened){if(!this.noAutoFocus){this._focusNode.focus()}}
else{this._focusNode.blur();this._focusedChild=null;if(this.restoreFocusOnClose&
&this.__restoreFocusNode){this.__restoreFocusNode.focus()}this.__restoreFocusNod
e=null;var currentOverlay=this._manager.currentOverlay();if(currentOverlay&&this
!==currentOverlay){currentOverlay._applyFocus()}}},_onCaptureClick:function(even
t){if(!this.noCancelOnOutsideClick){this.cancel(event)}},_onCaptureFocus:functio
n(event){if(!this.withBackdrop){return}var path=Polymer.dom(event).path;if(path.
indexOf(this)===-1){event.stopPropagation();this._applyFocus()}else{this._focuse
dChild=path[0]}},_onCaptureEsc:function(event){if(!this.noCancelOnEscKey){this.c
ancel(event)}},_onCaptureTab:function(event){if(!this.withBackdrop){return}var s
hift=event.shiftKey;var nodeToCheck=shift?this.__firstFocusableNode:this.__lastF
ocusableNode;var nodeToSet=shift?this.__lastFocusableNode:this.__firstFocusableN
ode;var shouldWrap=false;if(nodeToCheck===nodeToSet){shouldWrap=true}else{var fo
cusedNode=this._manager.deepActiveElement;shouldWrap=focusedNode===nodeToCheck||
focusedNode===this}if(shouldWrap){event.preventDefault();this._focusedChild=node
ToSet;this._applyFocus()}},_onIronResize:function(){if(this.opened&&!this.__isAn
imating){this.__onNextAnimationFrame(this.refit)}},_onNodesChange:function(){if(
this.opened&&!this.__isAnimating){this.notifyResize()}},__openedChanged:function
(){if(this.opened){this._prepareRenderOpened();this._manager.addOverlay(this);th
is._applyFocus();this._renderOpened()}else{this._manager.removeOverlay(this);thi
s._applyFocus();this._renderClosed()}},__onNextAnimationFrame:function(callback)
{if(this.__raf){window.cancelAnimationFrame(this.__raf)}var self=this;this.__raf
=window.requestAnimationFrame(function nextAnimationFrame(){self.__raf=null;call
back.call(self)})}};Polymer.IronOverlayBehavior=[Polymer.IronFitBehavior,Polymer
.IronResizableBehavior,Polymer.IronOverlayBehaviorImpl]})();Polymer.NeonAnimatab
leBehavior={properties:{animationConfig:{type:Object},entryAnimation:{observer:"
_entryAnimationChanged",type:String},exitAnimation:{observer:"_exitAnimationChan
ged",type:String}},_entryAnimationChanged:function(){this.animationConfig=this.a
nimationConfig||{};this.animationConfig["entry"]=[{name:this.entryAnimation,node
:this}]},_exitAnimationChanged:function(){this.animationConfig=this.animationCon
fig||{};this.animationConfig["exit"]=[{name:this.exitAnimation,node:this}]},_cop
yProperties:function(config1,config2){for(var property in config2){config1[prope
rty]=config2[property]}},_cloneConfig:function(config){var clone={isClone:true};
this._copyProperties(clone,config);return clone},_getAnimationConfigRecursive:fu
nction(type,map,allConfigs){if(!this.animationConfig){return}if(this.animationCo
nfig.value&&typeof this.animationConfig.value==="function"){this._warn(this._log
f("playAnimation","Please put 'animationConfig' inside of your components 'prope
rties' object instead of outside of it."));return}var thisConfig;if(type){thisCo
nfig=this.animationConfig[type]}else{thisConfig=this.animationConfig}if(!Array.i
sArray(thisConfig)){thisConfig=[thisConfig]}if(thisConfig){for(var config,index=
0;config=thisConfig[index];index++){if(config.animatable){config.animatable._get
AnimationConfigRecursive(config.type||type,map,allConfigs)}else{if(config.id){va
r cachedConfig=map[config.id];if(cachedConfig){if(!cachedConfig.isClone){map[con
fig.id]=this._cloneConfig(cachedConfig);cachedConfig=map[config.id]}this._copyPr
operties(cachedConfig,config)}else{map[config.id]=config}}else{allConfigs.push(c
onfig)}}}}},getAnimationConfig:function(type){var map={};var allConfigs=[];this.
_getAnimationConfigRecursive(type,map,allConfigs);for(var key in map){allConfigs
.push(map[key])}return allConfigs}};Polymer.NeonAnimationRunnerBehaviorImpl={_co
nfigureAnimations:function(configs){var results=[];if(configs.length>0){for(var
config,index=0;config=configs[index];index++){var neonAnimation=document.createE
lement(config.name);if(neonAnimation.isNeonAnimation){var result=null;try{result
=neonAnimation.configure(config);if(typeof result.cancel!="function"){result=doc
ument.timeline.play(result)}}catch(e){result=null;console.warn("Couldnt play","(
",config.name,").",e)}if(result){results.push({neonAnimation:neonAnimation,confi
g:config,animation:result})}}else{console.warn(this.is+":",config.name,"not foun
d!")}}}return results},_shouldComplete:function(activeEntries){var finished=true
;for(var i=0;i<activeEntries.length;i++){if(activeEntries[i].animation.playState
!="finished"){finished=false;break}}return finished},_complete:function(activeEn
tries){for(var i=0;i<activeEntries.length;i++){activeEntries[i].neonAnimation.co
mplete(activeEntries[i].config)}for(var i=0;i<activeEntries.length;i++){activeEn
tries[i].animation.cancel()}},playAnimation:function(type,cookie){var configs=th
is.getAnimationConfig(type);if(!configs){return}this._active=this._active||{};if
(this._active[type]){this._complete(this._active[type]);delete this._active[type
]}var activeEntries=this._configureAnimations(configs);if(activeEntries.length==
0){this.fire("neon-animation-finish",cookie,{bubbles:false});return}this._active
[type]=activeEntries;for(var i=0;i<activeEntries.length;i++){activeEntries[i].an
imation.onfinish=function(){if(this._shouldComplete(activeEntries)){this._comple
te(activeEntries);delete this._active[type];this.fire("neon-animation-finish",co
okie,{bubbles:false})}}.bind(this)}},cancelAnimation:function(){for(var k in thi
s._animations){this._animations[k].cancel()}this._animations={}}};Polymer.NeonAn
imationRunnerBehavior=[Polymer.NeonAnimatableBehavior,Polymer.NeonAnimationRunne
rBehaviorImpl];Polymer.NeonAnimationBehavior={properties:{animationTiming:{type:
Object,value:function(){return{duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)
",fill:"both"}}}},isNeonAnimation:true,timingFromConfig:function(config){if(conf
ig.timing){for(var property in config.timing){this.animationTiming[property]=con
fig.timing[property]}}return this.animationTiming},setPrefixedProperty:function(
node,property,value){var map={transform:["webkitTransform"],transformOrigin:["mo
zTransformOrigin","webkitTransformOrigin"]};var prefixes=map[property];for(var p
refix,index=0;prefix=prefixes[index];index++){node.style[prefix]=value}node.styl
e[property]=value},complete:function(){}};Polymer({is:"opaque-animation",behavio
rs:[Polymer.NeonAnimationBehavior],configure:function(config){var node=config.no
de;this._effect=new KeyframeEffect(node,[{opacity:"1"},{opacity:"1"}],this.timin
gFromConfig(config));node.style.opacity="0";return this._effect},complete:functi
on(config){config.node.style.opacity=""}});(function(){"use strict";var LAST_TOU
CH_POSITION={pageX:0,pageY:0};var ROOT_TARGET=null;var SCROLLABLE_NODES=[];Polym
er.IronDropdownScrollManager={get currentLockingElement(){return this._lockingEl
ements[this._lockingElements.length-1]},elementIsScrollLocked:function(element){
var currentLockingElement=this.currentLockingElement;if(currentLockingElement===
undefined)return false;var scrollLocked;if(this._hasCachedLockedElement(element)
){return true}if(this._hasCachedUnlockedElement(element)){return false}scrollLoc
ked=!!currentLockingElement&¤tLockingElement!==element&&!this._composedTre
eContains(currentLockingElement,element);if(scrollLocked){this._lockedElementCac
he.push(element)}else{this._unlockedElementCache.push(element)}return scrollLock
ed},pushScrollLock:function(element){if(this._lockingElements.indexOf(element)>=
0){return}if(this._lockingElements.length===0){this._lockScrollInteractions()}th
is._lockingElements.push(element);this._lockedElementCache=[];this._unlockedElem
entCache=[]},removeScrollLock:function(element){var index=this._lockingElements.
indexOf(element);if(index===-1){return}this._lockingElements.splice(index,1);thi
s._lockedElementCache=[];this._unlockedElementCache=[];if(this._lockingElements.
length===0){this._unlockScrollInteractions()}},_lockingElements:[],_lockedElemen
tCache:null,_unlockedElementCache:null,_hasCachedLockedElement:function(element)
{return this._lockedElementCache.indexOf(element)>-1},_hasCachedUnlockedElement:
function(element){return this._unlockedElementCache.indexOf(element)>-1},_compos
edTreeContains:function(element,child){var contentElements;var distributedNodes;
var contentIndex;var nodeIndex;if(element.contains(child)){return true}contentEl
ements=Polymer.dom(element).querySelectorAll("content");for(contentIndex=0;conte
ntIndex<contentElements.length;++contentIndex){distributedNodes=Polymer.dom(cont
entElements[contentIndex]).getDistributedNodes();for(nodeIndex=0;nodeIndex<distr
ibutedNodes.length;++nodeIndex){if(this._composedTreeContains(distributedNodes[n
odeIndex],child)){return true}}}return false},_scrollInteractionHandler:function
(event){if(event.cancelable&&this._shouldPreventScrolling(event)){event.preventD
efault()}if(event.targetTouches){var touch=event.targetTouches[0];LAST_TOUCH_POS
ITION.pageX=touch.pageX;LAST_TOUCH_POSITION.pageY=touch.pageY}},_lockScrollInter
actions:function(){this._boundScrollHandler=this._boundScrollHandler||this._scro
llInteractionHandler.bind(this);document.addEventListener("wheel",this._boundScr
ollHandler,true);document.addEventListener("mousewheel",this._boundScrollHandler
,true);document.addEventListener("DOMMouseScroll",this._boundScrollHandler,true)
;document.addEventListener("touchstart",this._boundScrollHandler,true);document.
addEventListener("touchmove",this._boundScrollHandler,true)},_unlockScrollIntera
ctions:function(){document.removeEventListener("wheel",this._boundScrollHandler,
true);document.removeEventListener("mousewheel",this._boundScrollHandler,true);d
ocument.removeEventListener("DOMMouseScroll",this._boundScrollHandler,true);docu
ment.removeEventListener("touchstart",this._boundScrollHandler,true);document.re
moveEventListener("touchmove",this._boundScrollHandler,true)},_shouldPreventScro
lling:function(event){var target=Polymer.dom(event).rootTarget;if(event.type!=="
touchmove"&&ROOT_TARGET!==target){ROOT_TARGET=target;SCROLLABLE_NODES=this._getS
crollableNodes(Polymer.dom(event).path)}if(!SCROLLABLE_NODES.length){return true
}if(event.type==="touchstart"){return false}var info=this._getScrollInfo(event);
return!this._getScrollingNode(SCROLLABLE_NODES,info.deltaX,info.deltaY)},_getScr
ollableNodes:function(nodes){var scrollables=[];var lockingIndex=nodes.indexOf(t
his.currentLockingElement);for(var i=0;i<=lockingIndex;i++){var node=nodes[i];if
(node.nodeType===11){continue}var style=node.style;if(style.overflow!=="scroll"&
&style.overflow!=="auto"){style=window.getComputedStyle(node)}if(style.overflow=
=="scroll"||style.overflow==="auto"){scrollables.push(node)}}return scrollables}
,_getScrollingNode:function(nodes,deltaX,deltaY){if(!deltaX&&!deltaY){return}var
verticalScroll=Math.abs(deltaY)>=Math.abs(deltaX);for(var i=0;i<nodes.length;i+
+){var node=nodes[i];var canScroll=false;if(verticalScroll){canScroll=deltaY<0?n
ode.scrollTop>0:node.scrollTop<node.scrollHeight-node.clientHeight}else{canScrol
l=deltaX<0?node.scrollLeft>0:node.scrollLeft<node.scrollWidth-node.clientWidth}i
f(canScroll){return node}}},_getScrollInfo:function(event){var info={deltaX:even
t.deltaX,deltaY:event.deltaY};if("deltaX"in event){}else if("wheelDeltaX"in even
t){info.deltaX=-event.wheelDeltaX;info.deltaY=-event.wheelDeltaY}else if("axis"i
n event){info.deltaX=event.axis===1?event.detail:0;info.deltaY=event.axis===2?ev
ent.detail:0}else if(event.targetTouches){var touch=event.targetTouches[0];info.
deltaX=LAST_TOUCH_POSITION.pageX-touch.pageX;info.deltaY=LAST_TOUCH_POSITION.pag
eY-touch.pageY}return info}}})();(function(){"use strict";Polymer({is:"iron-drop
down",behaviors:[Polymer.IronControlState,Polymer.IronA11yKeysBehavior,Polymer.I
ronOverlayBehavior,Polymer.NeonAnimationRunnerBehavior],properties:{horizontalAl
ign:{type:String,value:"left",reflectToAttribute:true},verticalAlign:{type:Strin
g,value:"top",reflectToAttribute:true},openAnimationConfig:{type:Object},closeAn
imationConfig:{type:Object},focusTarget:{type:Object},noAnimations:{type:Boolean
,value:false},allowOutsideScroll:{type:Boolean,value:false},_boundOnCaptureScrol
l:{type:Function,value:function(){return this._onCaptureScroll.bind(this)}}},lis
teners:{"neon-animation-finish":"_onNeonAnimationFinish"},observers:["_updateOve
rlayPosition(positionTarget, verticalAlign, horizontalAlign, verticalOffset, hor
izontalOffset)"],get containedElement(){return Polymer.dom(this.$.content).getDi
stributedNodes()[0]},get _focusTarget(){return this.focusTarget||this.containedE
lement},ready:function(){this._scrollTop=0;this._scrollLeft=0;this._refitOnScrol
lRAF=null},attached:function(){if(!this.sizingTarget||this.sizingTarget===this){
this.sizingTarget=this.containedElement}},detached:function(){this.cancelAnimati
on();document.removeEventListener("scroll",this._boundOnCaptureScroll);Polymer.I
ronDropdownScrollManager.removeScrollLock(this)},_openedChanged:function(){if(th
is.opened&&this.disabled){this.cancel()}else{this.cancelAnimation();this._update
AnimationConfig();this._saveScrollPosition();if(this.opened){document.addEventLi
stener("scroll",this._boundOnCaptureScroll);!this.allowOutsideScroll&&Polymer.Ir
onDropdownScrollManager.pushScrollLock(this)}else{document.removeEventListener("
scroll",this._boundOnCaptureScroll);Polymer.IronDropdownScrollManager.removeScro
llLock(this)}Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this,arguments
)}},_renderOpened:function(){if(!this.noAnimations&&this.animationConfig.open){t
his.$.contentWrapper.classList.add("animating");this.playAnimation("open")}else{
Polymer.IronOverlayBehaviorImpl._renderOpened.apply(this,arguments)}},_renderClo
sed:function(){if(!this.noAnimations&&this.animationConfig.close){this.$.content
Wrapper.classList.add("animating");this.playAnimation("close")}else{Polymer.Iron
OverlayBehaviorImpl._renderClosed.apply(this,arguments)}},_onNeonAnimationFinish
:function(){this.$.contentWrapper.classList.remove("animating");if(this.opened){
this._finishRenderOpened()}else{this._finishRenderClosed()}},_onCaptureScroll:fu
nction(){if(!this.allowOutsideScroll){this._restoreScrollPosition()}else{this._r
efitOnScrollRAF&&window.cancelAnimationFrame(this._refitOnScrollRAF);this._refit
OnScrollRAF=window.requestAnimationFrame(this.refit.bind(this))}},_saveScrollPos
ition:function(){if(document.scrollingElement){this._scrollTop=document.scrollin
gElement.scrollTop;this._scrollLeft=document.scrollingElement.scrollLeft}else{th
is._scrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTo
p);this._scrollLeft=Math.max(document.documentElement.scrollLeft,document.body.s
crollLeft)}},_restoreScrollPosition:function(){if(document.scrollingElement){doc
ument.scrollingElement.scrollTop=this._scrollTop;document.scrollingElement.scrol
lLeft=this._scrollLeft}else{document.documentElement.scrollTop=this._scrollTop;d
ocument.documentElement.scrollLeft=this._scrollLeft;document.body.scrollTop=this
._scrollTop;document.body.scrollLeft=this._scrollLeft}},_updateAnimationConfig:f
unction(){var animations=(this.openAnimationConfig||[]).concat(this.closeAnimati
onConfig||[]);for(var i=0;i<animations.length;i++){animations[i].node=this.conta
inedElement}this.animationConfig={open:this.openAnimationConfig,close:this.close
AnimationConfig}},_updateOverlayPosition:function(){if(this.isAttached){this.not
ifyResize()}},_applyFocus:function(){var focusTarget=this.focusTarget||this.cont
ainedElement;if(focusTarget&&this.opened&&!this.noAutoFocus){focusTarget.focus()
}else{Polymer.IronOverlayBehaviorImpl._applyFocus.apply(this,arguments)}}})})();
Polymer({is:"fade-in-animation",behaviors:[Polymer.NeonAnimationBehavior],config
ure:function(config){var node=config.node;this._effect=new KeyframeEffect(node,[
{opacity:"0"},{opacity:"1"}],this.timingFromConfig(config));return this._effect}
});Polymer({is:"fade-out-animation",behaviors:[Polymer.NeonAnimationBehavior],co
nfigure:function(config){var node=config.node;this._effect=new KeyframeEffect(no
de,[{opacity:"1"},{opacity:"0"}],this.timingFromConfig(config));return this._eff
ect}});Polymer({is:"paper-menu-grow-height-animation",behaviors:[Polymer.NeonAni
mationBehavior],configure:function(config){var node=config.node;var rect=node.ge
tBoundingClientRect();var height=rect.height;this._effect=new KeyframeEffect(nod
e,[{height:height/2+"px"},{height:height+"px"}],this.timingFromConfig(config));r
eturn this._effect}});Polymer({is:"paper-menu-grow-width-animation",behaviors:[P
olymer.NeonAnimationBehavior],configure:function(config){var node=config.node;va
r rect=node.getBoundingClientRect();var width=rect.width;this._effect=new Keyfra
meEffect(node,[{width:width/2+"px"},{width:width+"px"}],this.timingFromConfig(co
nfig));return this._effect}});Polymer({is:"paper-menu-shrink-width-animation",be
haviors:[Polymer.NeonAnimationBehavior],configure:function(config){var node=conf
ig.node;var rect=node.getBoundingClientRect();var width=rect.width;this._effect=
new KeyframeEffect(node,[{width:width+"px"},{width:width-width/20+"px"}],this.ti
mingFromConfig(config));return this._effect}});Polymer({is:"paper-menu-shrink-he
ight-animation",behaviors:[Polymer.NeonAnimationBehavior],configure:function(con
fig){var node=config.node;var rect=node.getBoundingClientRect();var height=rect.
height;var top=rect.top;this.setPrefixedProperty(node,"transformOrigin","0 0");t
his._effect=new KeyframeEffect(node,[{height:height+"px",transform:"translateY(0
)"},{height:height/2+"px",transform:"translateY(-20px)"}],this.timingFromConfig(
config));return this._effect}});(function(){"use strict";var config={ANIMATION_C
UBIC_BEZIER:"cubic-bezier(.3,.95,.5,1)",MAX_ANIMATION_TIME_MS:400};var PaperMenu
Button=Polymer({is:"paper-menu-button",behaviors:[Polymer.IronA11yKeysBehavior,P
olymer.IronControlState],properties:{opened:{type:Boolean,value:false,notify:tru
e,observer:"_openedChanged"},horizontalAlign:{type:String,value:"left",reflectTo
Attribute:true},verticalAlign:{type:String,value:"top",reflectToAttribute:true},
dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0,notify:true},v
erticalOffset:{type:Number,value:0,notify:true},noOverlap:{type:Boolean},noAnima
tions:{type:Boolean,value:false},ignoreSelect:{type:Boolean,value:false},closeOn
Activate:{type:Boolean,value:false},openAnimationConfig:{type:Object,value:funct
ion(){return[{name:"fade-in-animation",timing:{delay:100,duration:200}},{name:"p
aper-menu-grow-width-animation",timing:{delay:100,duration:150,easing:config.ANI
MATION_CUBIC_BEZIER}},{name:"paper-menu-grow-height-animation",timing:{delay:100
,duration:275,easing:config.ANIMATION_CUBIC_BEZIER}}]}},closeAnimationConfig:{ty
pe:Object,value:function(){return[{name:"fade-out-animation",timing:{duration:15
0}},{name:"paper-menu-shrink-width-animation",timing:{delay:100,duration:50,easi
ng:config.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-shrink-height-animation",ti
ming:{duration:200,easing:"ease-in"}}]}},allowOutsideScroll:{type:Boolean,value:
false},restoreFocusOnClose:{type:Boolean,value:true},_dropdownContent:{type:Obje
ct}},hostAttributes:{role:"group","aria-haspopup":"true"},listeners:{"iron-activ
ate":"_onIronActivate","iron-select":"_onIronSelect"},get contentElement(){retur
n Polymer.dom(this.$.content).getDistributedNodes()[0]},toggle:function(){if(thi
s.opened){this.close()}else{this.open()}},open:function(){if(this.disabled){retu
rn}this.$.dropdown.open()},close:function(){this.$.dropdown.close()},_onIronSele
ct:function(event){if(!this.ignoreSelect){this.close()}},_onIronActivate:functio
n(event){if(this.closeOnActivate){this.close()}},_openedChanged:function(opened,
oldOpened){if(opened){this._dropdownContent=this.contentElement;this.fire("paper
-dropdown-open")}else if(oldOpened!=null){this.fire("paper-dropdown-close")}},_d
isabledChanged:function(disabled){Polymer.IronControlState._disabledChanged.appl
y(this,arguments);if(disabled&&this.opened){this.close()}},__onIronOverlayCancel
ed:function(event){var uiEvent=event.detail;var target=Polymer.dom(uiEvent).root
Target;var trigger=this.$.trigger;var path=Polymer.dom(uiEvent).path;if(path.ind
exOf(trigger)>-1){event.preventDefault()}}});Object.keys(config).forEach(functio
n(key){PaperMenuButton[key]=config[key]});Polymer.PaperMenuButton=PaperMenuButto
n})();Polymer.PaperInkyFocusBehaviorImpl={observers:["_focusedChanged(receivedFo
cusFromKeyboard)"],_focusedChanged:function(receivedFocusFromKeyboard){if(receiv
edFocusFromKeyboard){this.ensureRipple()}if(this.hasRipple()){this._ripple.holdD
own=receivedFocusFromKeyboard}},_createRipple:function(){var ripple=Polymer.Pape
rRippleBehavior._createRipple();ripple.id="ink";ripple.setAttribute("center","")
;ripple.classList.add("circle");return ripple}};Polymer.PaperInkyFocusBehavior=[
Polymer.IronButtonState,Polymer.IronControlState,Polymer.PaperRippleBehavior,Pol
ymer.PaperInkyFocusBehaviorImpl];Polymer({is:"paper-icon-button",hostAttributes:
{role:"button",tabindex:"0"},behaviors:[Polymer.PaperInkyFocusBehavior],properti
es:{src:{type:String},icon:{type:String},alt:{type:String,observer:"_altChanged"
}},_altChanged:function(newValue,oldValue){var label=this.getAttribute("aria-lab
el");if(!label||oldValue==label){this.setAttribute("aria-label",newValue)}}});Po
lymer({is:"iron-media-query",properties:{queryMatches:{type:Boolean,value:false,
readOnly:true,notify:true},query:{type:String,observer:"queryChanged"},full:{typ
e:Boolean,value:false},_boundMQHandler:{value:function(){return this.queryHandle
r.bind(this)}},_mq:{value:null}},attached:function(){this.style.display="none";t
his.queryChanged()},detached:function(){this._remove()},_add:function(){if(this.
_mq){this._mq.addListener(this._boundMQHandler)}},_remove:function(){if(this._mq
){this._mq.removeListener(this._boundMQHandler)}this._mq=null},queryChanged:func
tion(){this._remove();var query=this.query;if(!query){return}if(!this.full&&quer
y[0]!=="("){query="("+query+")"}this._mq=window.matchMedia(query);this._add();th
is.queryHandler(this._mq)},queryHandler:function(mq){this._setQueryMatches(mq.ma
tches)}});(function(){"use strict";Polymer.IronA11yAnnouncer=Polymer({is:"iron-a
11y-announcer",properties:{mode:{type:String,value:"polite"},_text:{type:String,
value:""}},created:function(){if(!Polymer.IronA11yAnnouncer.instance){Polymer.Ir
onA11yAnnouncer.instance=this}document.body.addEventListener("iron-announce",thi
s._onIronAnnounce.bind(this))},announce:function(text){this._text="";this.async(
function(){this._text=text},100)},_onIronAnnounce:function(event){if(event.detai
l&&event.detail.text){this.announce(event.detail.text)}}});Polymer.IronA11yAnnou
ncer.instance=null;Polymer.IronA11yAnnouncer.requestAvailability=function(){if(!
Polymer.IronA11yAnnouncer.instance){Polymer.IronA11yAnnouncer.instance=document.
createElement("iron-a11y-announcer")}document.body.appendChild(Polymer.IronA11yA
nnouncer.instance)}})();Polymer.IronValidatableBehaviorMeta=null;Polymer.IronVal
idatableBehavior={properties:{validator:{type:String},invalid:{notify:true,refle
ctToAttribute:true,type:Boolean,value:false},_validatorMeta:{type:Object},valida
torType:{type:String,value:"validator"},_validator:{type:Object,computed:"__comp
uteValidator(validator)"}},observers:["_invalidChanged(invalid)"],registered:fun
ction(){Polymer.IronValidatableBehaviorMeta=new Polymer.IronMeta({type:"validato
r"})},_invalidChanged:function(){if(this.invalid){this.setAttribute("aria-invali
d","true")}else{this.removeAttribute("aria-invalid")}},hasValidator:function(){r
eturn this._validator!=null},validate:function(value){this.invalid=!this._getVal
idity(value);return!this.invalid},_getValidity:function(value){if(this.hasValida
tor()){return this._validator.validate(value)}return true},__computeValidator:fu
nction(){return Polymer.IronValidatableBehaviorMeta&&Polymer.IronValidatableBeha
viorMeta.byKey(this.validator)}};Polymer({is:"iron-input","extends":"input",beha
viors:[Polymer.IronValidatableBehavior],properties:{bindValue:{observer:"_bindVa
lueChanged",type:String},preventInvalidInput:{type:Boolean},allowedPattern:{type
:String,observer:"_allowedPatternChanged"},_previousValidInput:{type:String,valu
e:""},_patternAlreadyChecked:{type:Boolean,value:false}},listeners:{input:"_onIn
put",keypress:"_onKeypress"},registered:function(){if(!this._canDispatchEventOnD
isabled()){this._origDispatchEvent=this.dispatchEvent;this.dispatchEvent=this._d
ispatchEventFirefoxIE}},created:function(){Polymer.IronA11yAnnouncer.requestAvai
lability()},_canDispatchEventOnDisabled:function(){var input=document.createElem
ent("input");var canDispatch=false;input.disabled=true;input.addEventListener("f
eature-check-dispatch-event",function(){canDispatch=true});try{input.dispatchEve
nt(new Event("feature-check-dispatch-event"))}catch(e){}return canDispatch},_dis
patchEventFirefoxIE:function(){var disabled=this.disabled;this.disabled=false;th
is._origDispatchEvent.apply(this,arguments);this.disabled=disabled},get _pattern
RegExp(){var pattern;if(this.allowedPattern){pattern=new RegExp(this.allowedPatt
ern)}else{switch(this.type){case"number":pattern=/[0-9.,e-]/;break}}return patte
rn},ready:function(){this.bindValue=this.value},_bindValueChanged:function(){if(
this.value!==this.bindValue){this.value=!(this.bindValue||this.bindValue===0||th
is.bindValue===false)?"":this.bindValue}this.fire("bind-value-changed",{value:th
is.bindValue})},_allowedPatternChanged:function(){this.preventInvalidInput=this.
allowedPattern?true:false},_onInput:function(){if(this.preventInvalidInput&&!thi
s._patternAlreadyChecked){var valid=this._checkPatternValidity();if(!valid){this
._announceInvalidCharacter("Invalid string of characters not entered.");this.val
ue=this._previousValidInput}}this.bindValue=this.value;this._previousValidInput=
this.value;this._patternAlreadyChecked=false},_isPrintable:function(event){var a
nyNonPrintable=event.keyCode==8||event.keyCode==9||event.keyCode==13||event.keyC
ode==27;var mozNonPrintable=event.keyCode==19||event.keyCode==20||event.keyCode=
=45||event.keyCode==46||event.keyCode==144||event.keyCode==145||event.keyCode>32
&&event.keyCode<41||event.keyCode>111&&event.keyCode<124;return!anyNonPrintable&
&!(event.charCode==0&&mozNonPrintable)},_onKeypress:function(event){if(!this.pre
ventInvalidInput&&this.type!=="number"){return}var regexp=this._patternRegExp;if
(!regexp){return}if(event.metaKey||event.ctrlKey||event.altKey)return;this._patt
ernAlreadyChecked=true;var thisChar=String.fromCharCode(event.charCode);if(this.
_isPrintable(event)&&!regexp.test(thisChar)){event.preventDefault();this._announ
ceInvalidCharacter("Invalid character "+thisChar+" not entered.")}},_checkPatter
nValidity:function(){var regexp=this._patternRegExp;if(!regexp){return true}for(
var i=0;i<this.value.length;i++){if(!regexp.test(this.value[i])){return false}}r
eturn true},validate:function(){var valid=this.checkValidity();if(valid){if(this
.required&&this.value===""){valid=false}else if(this.hasValidator()){valid=Polym
er.IronValidatableBehavior.validate.call(this,this.value)}}this.invalid=!valid;t
his.fire("iron-input-validate");return valid},_announceInvalidCharacter:function
(message){this.fire("iron-announce",{text:message})}});Polymer({is:"paper-input-
container",properties:{noLabelFloat:{type:Boolean,value:false},alwaysFloatLabel:
{type:Boolean,value:false},attrForValue:{type:String,value:"bind-value"},autoVal
idate:{type:Boolean,value:false},invalid:{observer:"_invalidChanged",type:Boolea
n,value:false},focused:{readOnly:true,type:Boolean,value:false,notify:true},_add
ons:{type:Array},_inputHasContent:{type:Boolean,value:false},_inputSelector:{typ
e:String,value:"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,v
alue:function(){ |
| 48 type:Function,value:function(){return this._onValueChanged.bind(this)}}},listene
rs:{"addon-attached":"_onAddonAttached","iron-input-validate":"_onIronInputValid
ate"},get _valueChangedEvent(){return this.attrForValue+"-changed"},get _propert
yForValue(){return Polymer.CaseMap.dashToCamelCase(this.attrForValue)},get _inpu
tElement(){return Polymer.dom(this).querySelector(this._inputSelector)},get _inp
utElementValue(){return this._inputElement[this._propertyForValue]||this._inputE
lement.value},ready:function(){if(!this._addons){this._addons=[]}this.addEventLi
stener("focus",this._boundOnFocus,true);this.addEventListener("blur",this._bound
OnBlur,true)},attached:function(){if(this.attrForValue){this._inputElement.addEv
entListener(this._valueChangedEvent,this._boundValueChanged)}else{this.addEventL
istener("input",this._onInput)}if(this._inputElementValue!=""){this._handleValue
AndAutoValidate(this._inputElement)}else{this._handleValue(this._inputElement)}}
,_onAddonAttached:function(event){if(!this._addons){this._addons=[]}var target=e
vent.target;if(this._addons.indexOf(target)===-1){this._addons.push(target);if(t
his.isAttached){this._handleValue(this._inputElement)}}},_onFocus:function(){thi
s._setFocused(true)},_onBlur:function(){this._setFocused(false);this._handleValu
eAndAutoValidate(this._inputElement)},_onInput:function(event){this._handleValue
AndAutoValidate(event.target)},_onValueChanged:function(event){this._handleValue
AndAutoValidate(event.target)},_handleValue:function(inputElement){var value=thi
s._inputElementValue;if(value||value===0||inputElement.type==="number"&&!inputEl
ement.checkValidity()){this._inputHasContent=true}else{this._inputHasContent=fal
se}this.updateAddons({inputElement:inputElement,value:value,invalid:this.invalid
})},_handleValueAndAutoValidate:function(inputElement){if(this.autoValidate){var
valid;if(inputElement.validate){valid=inputElement.validate(this._inputElementV
alue)}else{valid=inputElement.checkValidity()}this.invalid=!valid}this._handleVa
lue(inputElement)},_onIronInputValidate:function(event){this.invalid=this._input
Element.invalid},_invalidChanged:function(){if(this._addons){this.updateAddons({
invalid:this.invalid})}},updateAddons:function(state){for(var addon,index=0;addo
n=this._addons[index];index++){addon.update(state)}},_computeInputContentClass:f
unction(noLabelFloat,alwaysFloatLabel,focused,invalid,_inputHasContent){var cls=
"input-content";if(!noLabelFloat){var label=this.querySelector("label");if(alway
sFloatLabel||_inputHasContent){cls+=" label-is-floating";this.$.labelAndInputCon
tainer.style.position="static";if(invalid){cls+=" is-invalid"}else if(focused){c
ls+=" label-is-highlighted"}}else{if(label){this.$.labelAndInputContainer.style.
position="relative"}}}else{if(_inputHasContent){cls+=" label-is-hidden"}}return
cls},_computeUnderlineClass:function(focused,invalid){var cls="underline";if(inv
alid){cls+=" is-invalid"}else if(focused){cls+=" is-highlighted"}return cls},_co
mputeAddOnContentClass:function(focused,invalid){var cls="add-on-content";if(inv
alid){cls+=" is-invalid"}else if(focused){cls+=" is-highlighted"}return cls}});P
olymer.PaperSpinnerBehavior={listeners:{animationend:"__reset",webkitAnimationEn
d:"__reset"},properties:{active:{type:Boolean,value:false,reflectToAttribute:tru
e,observer:"__activeChanged"},alt:{type:String,value:"loading",observer:"__altCh
anged"},__coolingDown:{type:Boolean,value:false}},__computeContainerClasses:func
tion(active,coolingDown){return[active||coolingDown?"active":"",coolingDown?"coo
ldown":""].join(" ")},__activeChanged:function(active,old){this.__setAriaHidden(
!active);this.__coolingDown=!active&&old},__altChanged:function(alt){if(alt===th
is.getPropertyInfo("alt").value){this.alt=this.getAttribute("aria-label")||alt}e
lse{this.__setAriaHidden(alt==="");this.setAttribute("aria-label",alt)}},__setAr
iaHidden:function(hidden){var attr="aria-hidden";if(hidden){this.setAttribute(at
tr,"true")}else{this.removeAttribute(attr)}},__reset:function(){this.active=fals
e;this.__coolingDown=false}};Polymer({is:"paper-spinner-lite",behaviors:[Polymer
.PaperSpinnerBehavior]}); | 48 return this._onInput.bind(this)}},_boundValueChanged:{type:Function,value:functi
on(){return this._onValueChanged.bind(this)}}},listeners:{"addon-attached":"_onA
ddonAttached","iron-input-validate":"_onIronInputValidate"},get _valueChangedEve
nt(){return this.attrForValue+"-changed"},get _propertyForValue(){return Polymer
.CaseMap.dashToCamelCase(this.attrForValue)},get _inputElement(){return Polymer.
dom(this).querySelector(this._inputSelector)},get _inputElementValue(){return th
is._inputElement[this._propertyForValue]||this._inputElement.value},ready:functi
on(){if(!this._addons){this._addons=[]}this.addEventListener("focus",this._bound
OnFocus,true);this.addEventListener("blur",this._boundOnBlur,true)},attached:fun
ction(){if(this.attrForValue){this._inputElement.addEventListener(this._valueCha
ngedEvent,this._boundValueChanged)}else{this.addEventListener("input",this._onIn
put)}if(this._inputElementValue!=""){this._handleValueAndAutoValidate(this._inpu
tElement)}else{this._handleValue(this._inputElement)}},_onAddonAttached:function
(event){if(!this._addons){this._addons=[]}var target=event.target;if(this._addon
s.indexOf(target)===-1){this._addons.push(target);if(this.isAttached){this._hand
leValue(this._inputElement)}}},_onFocus:function(){this._setFocused(true)},_onBl
ur:function(){this._setFocused(false);this._handleValueAndAutoValidate(this._inp
utElement)},_onInput:function(event){this._handleValueAndAutoValidate(event.targ
et)},_onValueChanged:function(event){this._handleValueAndAutoValidate(event.targ
et)},_handleValue:function(inputElement){var value=this._inputElementValue;if(va
lue||value===0||inputElement.type==="number"&&!inputElement.checkValidity()){thi
s._inputHasContent=true}else{this._inputHasContent=false}this.updateAddons({inpu
tElement:inputElement,value:value,invalid:this.invalid})},_handleValueAndAutoVal
idate:function(inputElement){if(this.autoValidate){var valid;if(inputElement.val
idate){valid=inputElement.validate(this._inputElementValue)}else{valid=inputElem
ent.checkValidity()}this.invalid=!valid}this._handleValue(inputElement)},_onIron
InputValidate:function(event){this.invalid=this._inputElement.invalid},_invalidC
hanged:function(){if(this._addons){this.updateAddons({invalid:this.invalid})}},u
pdateAddons:function(state){for(var addon,index=0;addon=this._addons[index];inde
x++){addon.update(state)}},_computeInputContentClass:function(noLabelFloat,alway
sFloatLabel,focused,invalid,_inputHasContent){var cls="input-content";if(!noLabe
lFloat){var label=this.querySelector("label");if(alwaysFloatLabel||_inputHasCont
ent){cls+=" label-is-floating";this.$.labelAndInputContainer.style.position="sta
tic";if(invalid){cls+=" is-invalid"}else if(focused){cls+=" label-is-highlighted
"}}else{if(label){this.$.labelAndInputContainer.style.position="relative"}}}else
{if(_inputHasContent){cls+=" label-is-hidden"}}return cls},_computeUnderlineClas
s:function(focused,invalid){var cls="underline";if(invalid){cls+=" is-invalid"}e
lse if(focused){cls+=" is-highlighted"}return cls},_computeAddOnContentClass:fun
ction(focused,invalid){var cls="add-on-content";if(invalid){cls+=" is-invalid"}e
lse if(focused){cls+=" is-highlighted"}return cls}});Polymer.PaperSpinnerBehavio
r={listeners:{animationend:"__reset",webkitAnimationEnd:"__reset"},properties:{a
ctive:{type:Boolean,value:false,reflectToAttribute:true,observer:"__activeChange
d"},alt:{type:String,value:"loading",observer:"__altChanged"},__coolingDown:{typ
e:Boolean,value:false}},__computeContainerClasses:function(active,coolingDown){r
eturn[active||coolingDown?"active":"",coolingDown?"cooldown":""].join(" ")},__ac
tiveChanged:function(active,old){this.__setAriaHidden(!active);this.__coolingDow
n=!active&&old},__altChanged:function(alt){if(alt===this.getPropertyInfo("alt").
value){this.alt=this.getAttribute("aria-label")||alt}else{this.__setAriaHidden(a
lt==="");this.setAttribute("aria-label",alt)}},__setAriaHidden:function(hidden){
var attr="aria-hidden";if(hidden){this.setAttribute(attr,"true")}else{this.remov
eAttribute(attr)}},__reset:function(){this.active=false;this.__coolingDown=false
}};Polymer({is:"paper-spinner-lite",behaviors:[Polymer.PaperSpinnerBehavior]}); |
| 49 // Copyright 2016 The Chromium Authors. All rights reserved. | 49 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 50 // Use of this source code is governed by a BSD-style license that can be | 50 // Use of this source code is governed by a BSD-style license that can be |
| 51 // found in the LICENSE file. | 51 // found in the LICENSE file. |
| 52 var CrSearchFieldBehavior={properties:{label:{type:String,value:""},clearLabel:{
type:String,value:""},showingSearch:{type:Boolean,value:false,notify:true,observ
er:"showingSearchChanged_",reflectToAttribute:true},lastValue_:{type:String,valu
e:""}},getSearchInput:function(){},getValue:function(){return this.getSearchInpu
t().value},setValue:function(value){this.getSearchInput().bindValue=value;this.o
nValueChanged_(value)},showAndFocus:function(){this.showingSearch=true;this.focu
s_()},focus_:function(){this.getSearchInput().focus()},onSearchTermSearch:functi
on(){this.onValueChanged_(this.getValue())},onValueChanged_:function(newValue){i
f(newValue==this.lastValue_)return;this.lastValue_=newValue;this.fire("search-ch
anged",newValue)},onSearchTermKeydown:function(e){if(e.key=="Escape")this.showin
gSearch=false},showingSearchChanged_:function(){if(this.showingSearch){this.focu
s_();return}this.setValue("");this.getSearchInput().blur()}}; | 52 var CrSearchFieldBehavior={properties:{label:{type:String,value:""},clearLabel:{
type:String,value:""},showingSearch:{type:Boolean,value:false,notify:true,observ
er:"showingSearchChanged_",reflectToAttribute:true},lastValue_:{type:String,valu
e:""}},getSearchInput:function(){},getValue:function(){return this.getSearchInpu
t().value},setValue:function(value){this.getSearchInput().bindValue=value;this.o
nValueChanged_(value)},showAndFocus:function(){this.showingSearch=true;this.focu
s_()},focus_:function(){this.getSearchInput().focus()},onSearchTermSearch:functi
on(){this.onValueChanged_(this.getValue())},onValueChanged_:function(newValue){i
f(newValue==this.lastValue_)return;this.lastValue_=newValue;this.fire("search-ch
anged",newValue)},onSearchTermKeydown:function(e){if(e.key=="Escape")this.showin
gSearch=false},showingSearchChanged_:function(){if(this.showingSearch){this.focu
s_();return}this.setValue("");this.getSearchInput().blur()}}; |
| 53 // Copyright 2016 The Chromium Authors. All rights reserved. | 53 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 54 // Use of this source code is governed by a BSD-style license that can be | 54 // Use of this source code is governed by a BSD-style license that can be |
| 55 // found in the LICENSE file. | 55 // found in the LICENSE file. |
| 56 Polymer({is:"cr-toolbar-search-field",behaviors:[CrSearchFieldBehavior],properti
es:{narrow:{type:Boolean,reflectToAttribute:true},label:String,clearLabel:String
,spinnerActive:{type:Boolean,reflectToAttribute:true},hasSearchText_:Boolean,isS
pinnerShown_:{type:Boolean,computed:"computeIsSpinnerShown_(spinnerActive, showi
ngSearch)"}},listeners:{tap:"showSearch_","searchInput.bind-value-changed":"onBi
ndValueChanged_"},getSearchInput:function(){return this.$.searchInput},isSearchF
ocused:function(){return this.$.searchTerm.focused},computeIconTabIndex_:functio
n(narrow){return narrow?0:-1},computeIsSpinnerShown_:function(){return this.spin
nerActive&&this.showingSearch},onInputBlur_:function(){if(!this.hasSearchText_)t
his.showingSearch=false},onBindValueChanged_:function(){var newValue=this.$.sear
chInput.bindValue;this.hasSearchText_=newValue!="";if(newValue!="")this.showingS
earch=true},showSearch_:function(e){if(e.target!=this.$.clearSearch)this.showing
Search=true},clearSearch_:function(e){this.setValue("");this.getSearchInput().fo
cus()}}); | 56 Polymer({is:"cr-toolbar-search-field",behaviors:[CrSearchFieldBehavior],properti
es:{narrow:{type:Boolean,reflectToAttribute:true},label:String,clearLabel:String
,spinnerActive:{type:Boolean,reflectToAttribute:true},hasSearchText_:Boolean,isS
pinnerShown_:{type:Boolean,computed:"computeIsSpinnerShown_(spinnerActive, showi
ngSearch)"}},listeners:{tap:"showSearch_","searchInput.bind-value-changed":"onBi
ndValueChanged_"},getSearchInput:function(){return this.$.searchInput},isSearchF
ocused:function(){return this.$.searchTerm.focused},computeIconTabIndex_:functio
n(narrow){return narrow?0:-1},computeIsSpinnerShown_:function(){return this.spin
nerActive&&this.showingSearch},onInputBlur_:function(){if(!this.hasSearchText_)t
his.showingSearch=false},onBindValueChanged_:function(){var newValue=this.$.sear
chInput.bindValue;this.hasSearchText_=newValue!="";if(newValue!="")this.showingS
earch=true},showSearch_:function(e){if(e.target!=this.$.clearSearch)this.showing
Search=true},clearSearch_:function(e){this.setValue("");this.getSearchInput().fo
cus()}}); |
| 57 // Copyright 2016 The Chromium Authors. All rights reserved. | 57 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 58 // Use of this source code is governed by a BSD-style license that can be | 58 // Use of this source code is governed by a BSD-style license that can be |
| 59 // found in the LICENSE file. | 59 // found in the LICENSE file. |
| 60 Polymer({is:"cr-toolbar",properties:{pageName:String,searchPrompt:String,clearLa
bel:String,menuLabel:String,menuPromo:String,spinnerActive:Boolean,showMenu:{typ
e:Boolean,value:false},showMenuPromo:{type:Boolean,value:false},closeMenuPromo:S
tring,narrow_:{type:Boolean,reflectToAttribute:true},showingSearch_:{type:Boolea
n,reflectToAttribute:true}},observers:["possiblyShowMenuPromo_(showMenu, showMen
uPromo, showingSearch_)"],getSearchField:function(){return this.$.search},onClos
ePromoTap_:function(){this.showMenuPromo=false},onMenuTap_:function(){this.fire(
"cr-menu-tap");this.onClosePromoTap_()},possiblyShowMenuPromo_:function(){Polyme
r.RenderStatus.afterNextRender(this,function(){if(this.showMenu&&this.showMenuPr
omo&&!this.showingSearch_){this.$$("#menuPromo").animate({opacity:[0,.9]},{durat
ion:500,fill:"forwards"});this.fire("cr-menu-promo-shown")}}.bind(this))},titleI
fNotShowMenuPromo_:function(title,showMenuPromo){return showMenuPromo?"":title}}
); | 60 Polymer({is:"cr-toolbar",properties:{pageName:String,searchPrompt:String,clearLa
bel:String,menuLabel:String,menuPromo:String,spinnerActive:Boolean,showMenu:{typ
e:Boolean,value:false},showMenuPromo:{type:Boolean,value:false},closeMenuPromo:S
tring,narrow_:{type:Boolean,reflectToAttribute:true},showingSearch_:{type:Boolea
n,reflectToAttribute:true}},observers:["possiblyShowMenuPromo_(showMenu, showMen
uPromo, showingSearch_)"],getSearchField:function(){return this.$.search},onClos
ePromoTap_:function(){this.showMenuPromo=false},onMenuTap_:function(){this.fire(
"cr-menu-tap");this.onClosePromoTap_()},possiblyShowMenuPromo_:function(){Polyme
r.RenderStatus.afterNextRender(this,function(){if(this.showMenu&&this.showMenuPr
omo&&!this.showingSearch_){this.$$("#menuPromo").animate({opacity:[0,.9]},{durat
ion:500,fill:"forwards"});this.fire("cr-menu-promo-shown")}}.bind(this))},titleI
fNotShowMenuPromo_:function(title,showMenuPromo){return showMenuPromo?"":title}}
); |
| 61 // Copyright 2015 The Chromium Authors. All rights reserved. | 61 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 62 // Use of this source code is governed by a BSD-style license that can be | 62 // Use of this source code is governed by a BSD-style license that can be |
| 63 // found in the LICENSE file. | 63 // found in the LICENSE file. |
| 64 cr.define("downloads",function(){var Toolbar=Polymer({is:"downloads-toolbar",pro
perties:{downloadsShowing:{reflectToAttribute:true,type:Boolean,value:false,obse
rver:"downloadsShowingChanged_"},spinnerActive:{type:Boolean,notify:true}},liste
ners:{"paper-dropdown-close":"onPaperDropdownClose_","paper-dropdown-open":"onPa
perDropdownOpen_"},canUndo:function(){return!this.$.toolbar.getSearchField().isS
earchFocused()},canClearAll:function(){return!this.$.toolbar.getSearchField().ge
tValue()&&this.downloadsShowing},onFindCommand:function(){this.$.toolbar.getSear
chField().showAndFocus()},closeMoreActions_:function(){this.$.more.close()},down
loadsShowingChanged_:function(){this.updateClearAll_()},onClearAllTap_:function(
){assert(this.canClearAll());downloads.ActionService.getInstance().clearAll()},o
nPaperDropdownClose_:function(){window.removeEventListener("resize",assert(this.
boundClose_))},onItemBlur_:function(e){var menu=this.$$("paper-menu");if(menu.it
ems.indexOf(e.relatedTarget)>=0)return;this.$.more.restoreFocusOnClose=false;thi
s.closeMoreActions_();this.$.more.restoreFocusOnClose=true},onPaperDropdownOpen_
:function(){this.boundClose_=this.boundClose_||this.closeMoreActions_.bind(this)
;window.addEventListener("resize",this.boundClose_)},onSearchChanged_:function(e
vent){var actionService=downloads.ActionService.getInstance();if(actionService.s
earch(event.detail))this.spinnerActive=actionService.isSearching();this.updateCl
earAll_()},onOpenDownloadsFolderTap_:function(){downloads.ActionService.getInsta
nce().openDownloadsFolder()},updateClearAll_:function(){this.$$("paper-menu .cle
ar-all").hidden=!this.canClearAll()}});return{Toolbar:Toolbar}}); | 64 cr.define("downloads",function(){var Toolbar=Polymer({is:"downloads-toolbar",pro
perties:{downloadsShowing:{reflectToAttribute:true,type:Boolean,value:false,obse
rver:"downloadsShowingChanged_"},spinnerActive:{type:Boolean,notify:true}},liste
ners:{"paper-dropdown-close":"onPaperDropdownClose_","paper-dropdown-open":"onPa
perDropdownOpen_"},canUndo:function(){return!this.$.toolbar.getSearchField().isS
earchFocused()},canClearAll:function(){return!this.$.toolbar.getSearchField().ge
tValue()&&this.downloadsShowing},onFindCommand:function(){this.$.toolbar.getSear
chField().showAndFocus()},closeMoreActions_:function(){this.$.more.close()},down
loadsShowingChanged_:function(){this.updateClearAll_()},onClearAllTap_:function(
){assert(this.canClearAll());downloads.ActionService.getInstance().clearAll()},o
nPaperDropdownClose_:function(){window.removeEventListener("resize",assert(this.
boundClose_))},onItemBlur_:function(e){var menu=this.$$("paper-menu");if(menu.it
ems.indexOf(e.relatedTarget)>=0)return;this.$.more.restoreFocusOnClose=false;thi
s.closeMoreActions_();this.$.more.restoreFocusOnClose=true},onPaperDropdownOpen_
:function(){this.boundClose_=this.boundClose_||this.closeMoreActions_.bind(this)
;window.addEventListener("resize",this.boundClose_)},onSearchChanged_:function(e
vent){var actionService=downloads.ActionService.getInstance();if(actionService.s
earch(event.detail))this.spinnerActive=actionService.isSearching();this.updateCl
earAll_()},onOpenDownloadsFolderTap_:function(){downloads.ActionService.getInsta
nce().openDownloadsFolder()},updateClearAll_:function(){this.$$("paper-menu .cle
ar-all").hidden=!this.canClearAll()}});return{Toolbar:Toolbar}}); |
| 65 // Copyright 2015 The Chromium Authors. All rights reserved. | 65 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 66 // Use of this source code is governed by a BSD-style license that can be | 66 // Use of this source code is governed by a BSD-style license that can be |
| 67 // found in the LICENSE file. | 67 // found in the LICENSE file. |
| 68 cr.define("downloads",function(){var Manager=Polymer({is:"downloads-manager",pro
perties:{hasDownloads_:{observer:"hasDownloadsChanged_",type:Boolean},hasShadow_
:{type:Boolean,value:false,reflectToAttribute:true},inSearchMode_:{type:Boolean,
value:false},items_:{type:Array,value:function(){return[]}},spinnerActive_:{type
:Boolean,notify:true}},hostAttributes:{loading:true},listeners:{"downloads-list.
scroll":"onListScroll_","toolbar.search-changed":"onSearchChanged_"},observers:[
"itemsChanged_(items_.*)"],clearAll_:function(){this.set("items_",[])},hasDownlo
adsChanged_:function(){if(loadTimeData.getBoolean("allowDeletingHistory"))this.$
.toolbar.downloadsShowing=this.hasDownloads_;if(this.hasDownloads_)this.$["downl
oads-list"].fire("iron-resize")},insertItems_:function(index,list){this.splice.a
pply(this,["items_",index,0].concat(list));this.updateHideDates_(index,index+lis
t.length);this.removeAttribute("loading");this.spinnerActive_=false},itemsChange
d_:function(){this.hasDownloads_=this.items_.length>0},noDownloadsText_:function
(){return loadTimeData.getString(this.inSearchMode_?"noSearchResults":"noDownloa
ds")},onCanExecute_:function(e){e=e;switch(e.command.id){case"undo-command":e.ca
nExecute=this.$.toolbar.canUndo();break;case"clear-all-command":e.canExecute=thi
s.$.toolbar.canClearAll();break;case"find-command":e.canExecute=true;break}},onC
ommand_:function(e){if(e.command.id=="clear-all-command")downloads.ActionService
.getInstance().clearAll();else if(e.command.id=="undo-command")downloads.ActionS
ervice.getInstance().undo();else if(e.command.id=="find-command")this.$.toolbar.
onFindCommand()},onListScroll_:function(){var list=this.$["downloads-list"];if(l
ist.scrollHeight-list.scrollTop-list.offsetHeight<=100){downloads.ActionService.
getInstance().loadMore()}this.hasShadow_=list.scrollTop>0},onLoad_:function(){cr
.ui.decorate("command",cr.ui.Command);document.addEventListener("canExecute",thi
s.onCanExecute_.bind(this));document.addEventListener("command",this.onCommand_.
bind(this));downloads.ActionService.getInstance().loadMore()},onSearchChanged_:f
unction(){this.inSearchMode_=downloads.ActionService.getInstance().isSearching()
},removeItem_:function(index){this.splice("items_",index,1);this.updateHideDates
_(index,index);this.onListScroll_()},updateHideDates_:function(start,end){for(va
r i=start;i<=end;++i){var current=this.items_[i];if(!current)continue;var prev=t
his.items_[i-1];var hideDate=!!prev&&prev.date_string==current.date_string;this.
set("items_."+i+".hideDate",hideDate)}},updateItem_:function(index,data){this.se
t("items_."+index,data);this.updateHideDates_(index,index);var list=this.$["down
loads-list"];list.updateSizeForItem(index)}});Manager.clearAll=function(){Manage
r.get().clearAll_()};Manager.get=function(){return queryRequiredElement("downloa
ds-manager")};Manager.insertItems=function(index,list){Manager.get().insertItems
_(index,list)};Manager.onLoad=function(){Manager.get().onLoad_()};Manager.remove
Item=function(index){Manager.get().removeItem_(index)};Manager.updateItem=functi
on(index,data){Manager.get().updateItem_(index,data)};return{Manager:Manager}}); | 68 cr.define("downloads",function(){var Manager=Polymer({is:"downloads-manager",pro
perties:{hasDownloads_:{observer:"hasDownloadsChanged_",type:Boolean},hasShadow_
:{type:Boolean,value:false,reflectToAttribute:true},inSearchMode_:{type:Boolean,
value:false},items_:{type:Array,value:function(){return[]}},spinnerActive_:{type
:Boolean,notify:true}},hostAttributes:{loading:true},listeners:{"downloads-list.
scroll":"onListScroll_","toolbar.search-changed":"onSearchChanged_"},observers:[
"itemsChanged_(items_.*)"],clearAll_:function(){this.set("items_",[])},hasDownlo
adsChanged_:function(){if(loadTimeData.getBoolean("allowDeletingHistory"))this.$
.toolbar.downloadsShowing=this.hasDownloads_;if(this.hasDownloads_)this.$["downl
oads-list"].fire("iron-resize")},insertItems_:function(index,list){this.splice.a
pply(this,["items_",index,0].concat(list));this.updateHideDates_(index,index+lis
t.length);this.removeAttribute("loading");this.spinnerActive_=false},itemsChange
d_:function(){this.hasDownloads_=this.items_.length>0},noDownloadsText_:function
(){return loadTimeData.getString(this.inSearchMode_?"noSearchResults":"noDownloa
ds")},onCanExecute_:function(e){e=e;switch(e.command.id){case"undo-command":e.ca
nExecute=this.$.toolbar.canUndo();break;case"clear-all-command":e.canExecute=thi
s.$.toolbar.canClearAll();break;case"find-command":e.canExecute=true;break}},onC
ommand_:function(e){if(e.command.id=="clear-all-command")downloads.ActionService
.getInstance().clearAll();else if(e.command.id=="undo-command")downloads.ActionS
ervice.getInstance().undo();else if(e.command.id=="find-command")this.$.toolbar.
onFindCommand()},onListScroll_:function(){var list=this.$["downloads-list"];if(l
ist.scrollHeight-list.scrollTop-list.offsetHeight<=100){downloads.ActionService.
getInstance().loadMore()}this.hasShadow_=list.scrollTop>0},onLoad_:function(){cr
.ui.decorate("command",cr.ui.Command);document.addEventListener("canExecute",thi
s.onCanExecute_.bind(this));document.addEventListener("command",this.onCommand_.
bind(this));downloads.ActionService.getInstance().loadMore()},onSearchChanged_:f
unction(){this.inSearchMode_=downloads.ActionService.getInstance().isSearching()
},removeItem_:function(index){this.splice("items_",index,1);this.updateHideDates
_(index,index);this.onListScroll_()},updateHideDates_:function(start,end){for(va
r i=start;i<=end;++i){var current=this.items_[i];if(!current)continue;var prev=t
his.items_[i-1];var hideDate=!!prev&&prev.date_string==current.date_string;this.
set("items_."+i+".hideDate",hideDate)}},updateItem_:function(index,data){this.se
t("items_."+index,data);this.updateHideDates_(index,index);var list=this.$["down
loads-list"];list.updateSizeForItem(index)}});Manager.clearAll=function(){Manage
r.get().clearAll_()};Manager.get=function(){return queryRequiredElement("downloa
ds-manager")};Manager.insertItems=function(index,list){Manager.get().insertItems
_(index,list)};Manager.onLoad=function(){Manager.get().onLoad_()};Manager.remove
Item=function(index){Manager.get().removeItem_(index)};Manager.updateItem=functi
on(index,data){Manager.get().updateItem_(index,data)};return{Manager:Manager}}); |
| 69 // Copyright 2015 The Chromium Authors. All rights reserved. | 69 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 70 // Use of this source code is governed by a BSD-style license that can be | 70 // Use of this source code is governed by a BSD-style license that can be |
| 71 // found in the LICENSE file. | 71 // found in the LICENSE file. |
| 72 window.addEventListener("load",function(){downloads.Manager.onLoad();document.fo
nts.load("bold 12px Roboto")}); | 72 window.addEventListener("load",function(){downloads.Manager.onLoad();document.fo
nts.load("bold 12px Roboto")}); |
| OLD | NEW |