Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: appengine/swarming/elements/build/elements.html

Issue 2403543002: Add Machine Provider ui parts (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html><html><head><meta charset="UTF-8"> </head><body><div hidden="" by -vulcanize=""><script>!function(){function e(){document.body.removeAttribute("un resolved")}window.WebComponents?addEventListener("WebComponentsReady",e):"intera ctive"===document.readyState||"complete"===document.readyState?e():addEventListe ner("DOMContentLoaded",e)}(),window.Polymer={Settings:function(){var e=window.Po lymer||{};if(!e.noUrlSettings)for(var t,r=location.search.slice(1).split("&"),i= 0;i<r.length&&(t=r[i]);i++)t=t.split("="),t[0]&&(e[t[0]]=t[1]||!0);return e.want Shadow="shadow"===e.dom,e.hasShadow=Boolean(Element.prototype.createShadowRoot), e.nativeShadow=e.hasShadow&&!window.ShadowDOMPolyfill,e.useShadow=e.wantShadow&& e.hasShadow,e.hasNativeImports=Boolean("import"in document.createElement("link") ),e.useNativeImports=e.hasNativeImports,e.useNativeCustomElements=!window.Custom Elements||window.CustomElements.useNative,e.useNativeShadow=e.useShadow&&e.nativ eShadow,e.usePolyfillProto=!e.useNativeCustomElements&&!Object.__proto__,e.hasNa tiveCSSProperties=!navigator.userAgent.match("AppleWebKit/601")&&window.CSS&&CSS .supports&&CSS.supports("box-shadow","0 0 0 var(--foo)"),e.useNativeCSSPropertie s=e.hasNativeCSSProperties&&e.lazyRegister&&e.useNativeCSSProperties,e}()},funct ion(){var e=window.Polymer;window.Polymer=function(e){"function"==typeof e&&(e=e .prototype),e||(e={});var r=t(e);e=r.prototype;var i={prototype:e};return e.exte nds&&(i.extends=e.extends),Polymer.telemetry._registrate(e),document.registerEle ment(e.is,i),r};var t=function(e){var t=Polymer.Base;return e.extends&&(t=Polyme r.Base._getExtendedPrototype(e.extends)),e=Polymer.Base.chainObject(e,t),e.regis terCallback(),e.constructor};if(e)for(var r in e)Polymer[r]=e[r];Polymer.Class=t }(),Polymer.telemetry={registrations:[],_regLog:function(e){console.log("["+e.is +"]: registered")},_registrate:function(e){this.registrations.push(e),Polymer.lo g&&this._regLog(e)},dumpRegistrations:function(){this.registrations.forEach(this ._regLog)}},Object.defineProperty(window,"currentImport",{enumerable:!0,configur able:!0,get:function(){return(document._currentScript||document.currentScript).o wnerDocument}}),Polymer.RenderStatus={_ready:!1,_callbacks:[],whenReady:function (e){this._ready?e():this._callbacks.push(e)},_makeReady:function(){this._ready=! 0;for(var e=0;e<this._callbacks.length;e++)this._callbacks[e]();this._callbacks= []},_catchFirstRender:function(){requestAnimationFrame(function(){Polymer.Render Status._makeReady()})},_afterNextRenderQueue:[],_waitingNextRender:!1,afterNextR ender:function(e,t,r){this._watchNextRender(),this._afterNextRenderQueue.push([e ,t,r])},hasRendered:function(){return this._ready},_watchNextRender:function(){i f(!this._waitingNextRender){this._waitingNextRender=!0;var e=function(){Polymer. RenderStatus._flushNextRender()};this._ready?requestAnimationFrame(e):this.whenR eady(e)}},_flushNextRender:function(){var e=this;setTimeout(function(){e._flushR enderCallbacks(e._afterNextRenderQueue),e._afterNextRenderQueue=[],e._waitingNex tRender=!1})},_flushRenderCallbacks:function(e){for(var t,r=0;r<e.length;r++)t=e [r],t[1].apply(t[0],t[2]||Polymer.nar)}},window.HTMLImports?HTMLImports.whenRead y(function(){Polymer.RenderStatus._catchFirstRender()}):Polymer.RenderStatus._ca tchFirstRender(),Polymer.ImportStatus=Polymer.RenderStatus,Polymer.ImportStatus. whenLoaded=Polymer.ImportStatus.whenReady,function(){"use strict";var e=Polymer. Settings;Polymer.Base={__isPolymerInstance__:!0,_addFeature:function(e){this.ext end(this,e)},registerCallback:function(){"max"===e.lazyRegister?this.beforeRegis ter&&this.beforeRegister():(this._desugarBehaviors(),this._doBehavior("beforeReg ister")),this._registerFeatures(),e.lazyRegister||this.ensureRegisterFinished()} ,createdCallback:function(){this.__hasRegisterFinished||this._ensureRegisterFini shed(this.__proto__),Polymer.telemetry.instanceCount++,this.root=this,this._doBe havior("created"),this._initFeatures()},ensureRegisterFinished:function(){this._ ensureRegisterFinished(this)},_ensureRegisterFinished:function(t){t.__hasRegiste rFinished===t.is&&t.is||("max"===e.lazyRegister&&(t._desugarBehaviors(),t._doBeh aviorOnly("beforeRegister")),t.__hasRegisterFinished=t.is,t._finishRegisterFeatu res&&t._finishRegisterFeatures(),t._doBehavior("registered"),e.usePolyfillProto& &t!==this&&t.extend(this,t))},attachedCallback:function(){var e=this;Polymer.Ren derStatus.whenReady(function(){e.isAttached=!0,e._doBehavior("attached")})},deta chedCallback:function(){var e=this;Polymer.RenderStatus.whenReady(function(){e.i sAttached=!1,e._doBehavior("detached")})},attributeChangedCallback:function(e,t, r){this._attributeChangedImpl(e),this._doBehavior("attributeChanged",[e,t,r])},_ attributeChangedImpl:function(e){this._setAttributeToProperty(this,e)},extend:fu nction(e,t){if(e&&t)for(var r,i=Object.getOwnPropertyNames(t),o=0;o<i.length&&(r =i[o]);o++)this.copyOwnProperty(r,t,e);return e||t},mixin:function(e,t){for(var r in t)e[r]=t[r];return e},copyOwnProperty:function(e,t,r){var i=Object.getOwnPr opertyDescriptor(t,e);i&&Object.defineProperty(r,e,i)},_logger:function(e,t){swi tch(1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"err or":console[e].apply(console,t)}},_log:function(){var e=Array.prototype.slice.ca ll(arguments,0);this._logger("log",e)},_warn:function(){var e=Array.prototype.sl ice.call(arguments,0);this._logger("warn",e)},_error:function(){var e=Array.prot otype.slice.call(arguments,0);this._logger("error",e)},_logf:function(){return t his._logPrefix.concat(this.is).concat(Array.prototype.slice.call(arguments,0))}} ,Polymer.Base._logPrefix=function(){var e=window.chrome&&!/edge/i.test(navigator .userAgent)||/firefox/i.test(navigator.userAgent);return e?["%c[%s::%s]:","font- weight: bold; background-color:#EEEE00;"]:["[%s::%s]:"]}(),Polymer.Base.chainObj ect=function(e,t){return e&&t&&e!==t&&(Object.__proto__||(e=Polymer.Base.extend( Object.create(t),e)),e.__proto__=t),e},Polymer.Base=Polymer.Base.chainObject(Pol ymer.Base,HTMLElement.prototype),window.CustomElements?Polymer.instanceof=Custom Elements.instanceof:Polymer.instanceof=function(e,t){return e instanceof t},Poly mer.isInstance=function(e){return Boolean(e&&e.__isPolymerInstance__)},Polymer.t elemetry.instanceCount=0}(),function(){function e(){if(s)for(var e,t=document._c urrentScript||document.currentScript,r=t&&t.ownerDocument||document,i=r.querySel ectorAll("dom-module"),o=i.length-1;o>=0&&(e=i[o]);o--){if(e.__upgraded__)return ;CustomElements.upgrade(e)}}var t={},r={},i=function(e){return t[e]||r[e.toLower Case()]},o=function(){return document.createElement("dom-module")};o.prototype=O bject.create(HTMLElement.prototype),Polymer.Base.extend(o.prototype,{constructor :o,createdCallback:function(){this.register()},register:function(e){e=e||this.id ||this.getAttribute("name")||this.getAttribute("is"),e&&(this.id=e,t[e]=this,r[e .toLowerCase()]=this)},import:function(t,r){if(t){var o=i(t);return o||(e(),o=i( t)),o&&r&&(o=o.querySelector(r)),o}}});var s=window.CustomElements&&!CustomEleme nts.useNative;document.registerElement("dom-module",o)}(),Polymer.Base._addFeatu re({_prepIs:function(){if(!this.is){var e=(document._currentScript||document.cur rentScript).parentNode;if("dom-module"===e.localName){var t=e.id||e.getAttribute ("name")||e.getAttribute("is");this.is=t}}this.is&&(this.is=this.is.toLowerCase( ))}}),Polymer.Base._addFeature({behaviors:[],_desugarBehaviors:function(){this.b ehaviors.length&&(this.behaviors=this._desugarSomeBehaviors(this.behaviors))},_d esugarSomeBehaviors:function(e){var t=[];e=this._flattenBehaviorsList(e);for(var r=e.length-1;r>=0;r--){var i=e[r];t.indexOf(i)===-1&&(this._mixinBehavior(i),t. unshift(i))}return t},_flattenBehaviorsList:function(e){for(var t=[],r=0;r<e.len gth;r++){var i=e[r];i instanceof Array?t=t.concat(this._flattenBehaviorsList(i)) :i?t.push(i):this._warn(this._logf("_flattenBehaviorsList","behavior is null, ch eck for missing or 404 import"))}return t},_mixinBehavior:function(e){for(var t, r=Object.getOwnPropertyNames(e),i=0;i<r.length&&(t=r[i]);i++)Polymer.Base._behav iorProperties[t]||this.hasOwnProperty(t)||this.copyOwnProperty(t,e,this)},_prepB ehaviors:function(){this._prepFlattenedBehaviors(this.behaviors)},_prepFlattened Behaviors:function(e){for(var t=0,r=e.length;t<r;t++)this._prepBehavior(e[t]);th is._prepBehavior(this)},_doBehavior:function(e,t){for(var r=0;r<this.behaviors.l ength;r++)this._invokeBehavior(this.behaviors[r],e,t);this._invokeBehavior(this, e,t)},_doBehaviorOnly:function(e,t){for(var r=0;r<this.behaviors.length;r++)this ._invokeBehavior(this.behaviors[r],e,t)},_invokeBehavior:function(e,t,r){var i=e [t];i&&i.apply(this,r||Polymer.nar)},_marshalBehaviors:function(){for(var e=0;e< this.behaviors.length;e++)this._marshalBehavior(this.behaviors[e]);this._marshal Behavior(this)}}),Polymer.Base._behaviorProperties={hostAttributes:!0,beforeRegi ster:!0,registered:!0,properties:!0,observers:!0,listeners:!0,created:!0,attache d:!0,detached:!0,attributeChanged:!0,ready:!0},Polymer.Base._addFeature({_getExt endedPrototype:function(e){return this._getExtendedNativePrototype(e)},_nativePr ototypes:{},_getExtendedNativePrototype:function(e){var t=this._nativePrototypes [e];if(!t){var r=this.getNativePrototype(e);t=this.extend(Object.create(r),Polym er.Base),this._nativePrototypes[e]=t}return t},getNativePrototype:function(e){re turn Object.getPrototypeOf(document.createElement(e))}}),Polymer.Base._addFeatur e({_prepConstructor:function(){this._factoryArgs=this.extends?[this.extends,this .is]:[this.is];var e=function(){return this._factory(arguments)};this.hasOwnProp erty("extends")&&(e.extends=this.extends),Object.defineProperty(this,"constructo r",{value:e,writable:!0,configurable:!0}),e.prototype=this},_factory:function(e) {var t=document.createElement.apply(document,this._factoryArgs);return this.fact oryImpl&&this.factoryImpl.apply(t,e),t}}),Polymer.nob=Object.create(null),Polyme r.Base._addFeature({properties:{},getPropertyInfo:function(e){var t=this._getPro pertyInfo(e,this.properties);if(!t)for(var r=0;r<this.behaviors.length;r++)if(t= this._getPropertyInfo(e,this.behaviors[r].properties))return t;return t||Polymer .nob},_getPropertyInfo:function(e,t){var r=t&&t[e];return"function"==typeof r&&( r=t[e]={type:r}),r&&(r.defined=!0),r},_prepPropertyInfo:function(){this._propert yInfo={};for(var e=0;e<this.behaviors.length;e++)this._addPropertyInfo(this._pro pertyInfo,this.behaviors[e].properties);this._addPropertyInfo(this._propertyInfo ,this.properties),this._addPropertyInfo(this._propertyInfo,this._propertyEffects )},_addPropertyInfo:function(e,t){if(t){var r,i;for(var o in t)r=e[o],i=t[o],("_ "!==o[0]||i.readOnly)&&(e[o]?(r.type||(r.type=i.type),r.readOnly||(r.readOnly=i. readOnly)):e[o]={type:"function"==typeof i?i:i.type,readOnly:i.readOnly,attribut e:Polymer.CaseMap.camelToDashCase(o)})}}}),Polymer.CaseMap={_caseMap:{},_rx:{das hToCamel:/-[a-z]/g,camelToDash:/([A-Z])/g},dashToCamelCase:function(e){return th is._caseMap[e]||(this._caseMap[e]=e.indexOf("-")<0?e:e.replace(this._rx.dashToCa mel,function(e){return e[1].toUpperCase()}))},camelToDashCase:function(e){return this._caseMap[e]||(this._caseMap[e]=e.replace(this._rx.camelToDash,"-$1").toLow erCase())}},Polymer.Base._addFeature({_addHostAttributes:function(e){this._aggre gatedAttributes||(this._aggregatedAttributes={}),e&&this.mixin(this._aggregatedA ttributes,e)},_marshalHostAttributes:function(){this._aggregatedAttributes&&this ._applyAttributes(this,this._aggregatedAttributes)},_applyAttributes:function(e, t){for(var r in t)if(!this.hasAttribute(r)&&"class"!==r){var i=t[r];this.seriali zeValueToAttribute(i,r,this)}},_marshalAttributes:function(){this._takeAttribute sToModel(this)},_takeAttributesToModel:function(e){if(this.hasAttributes())for(v ar t in this._propertyInfo){var r=this._propertyInfo[t];this.hasAttribute(r.attr ibute)&&this._setAttributeToProperty(e,r.attribute,t,r)}},_setAttributeToPropert y:function(e,t,r,i){if(!this._serializing&&(r=r||Polymer.CaseMap.dashToCamelCase (t),i=i||this._propertyInfo&&this._propertyInfo[r],i&&!i.readOnly)){var o=this.g etAttribute(t);e[r]=this.deserialize(o,i.type)}},_serializing:!1,reflectProperty ToAttribute:function(e,t,r){this._serializing=!0,r=void 0===r?this[e]:r,this.ser ializeValueToAttribute(r,t||Polymer.CaseMap.camelToDashCase(e)),this._serializin g=!1},serializeValueToAttribute:function(e,t,r){var i=this.serialize(e);r=r||thi s,void 0===i?r.removeAttribute(t):r.setAttribute(t,i)},deserialize:function(e,t) {switch(t){case Number:e=Number(e);break;case Boolean:e=null!=e;break;case Objec t:try{e=JSON.parse(e)}catch(e){}break;case Array:try{e=JSON.parse(e)}catch(t){e= null,console.warn("Polymer::Attributes: couldn`t decode Array as JSON")}break;ca se Date:e=new Date(e);break;case String:}return e},serialize:function(e){switch( typeof e){case"boolean":return e?"":void 0;case"object":if(e instanceof Date)ret urn e.toString();if(e)try{return JSON.stringify(e)}catch(e){return""}default:ret urn null!=e?e:void 0}}}),Polymer.version="1.6.1",Polymer.Base._addFeature({_regi sterFeatures:function(){this._prepIs(),this._prepBehaviors(),this._prepConstruct or(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHostAttributes (e.hostAttributes)},_marshalBehavior:function(e){},_initFeatures:function(){this ._marshalHostAttributes(),this._marshalBehaviors()}})</script> <script>Polymer.B ase._addFeature({_prepTemplate:function(){void 0===this._template&&(this._templa te=Polymer.DomModule.import(this.is,"template")),this._template&&this._template. hasAttribute("is")&&this._warn(this._logf("_prepTemplate","top-level Polymer tem plate must not be a type-extension, found",this._template,"Move inside simple <t emplate>.")),this._template&&!this._template.content&&window.HTMLTemplateElement &&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(this._template)},_s tampTemplate:function(){this._template&&(this.root=this.instanceTemplate(this._t emplate))},instanceTemplate:function(e){var t=document.importNode(e._content||e. content,!0);return t}}),function(){var e=Polymer.Base.attachedCallback;Polymer.B ase._addFeature({_hostStack:[],ready:function(){},_registerHost:function(e){this .dataHost=e=e||Polymer.Base._hostStack[Polymer.Base._hostStack.length-1],e&&e._c lients&&e._clients.push(this),this._clients=null,this._clientsReadied=!1},_begin Hosting:function(){Polymer.Base._hostStack.push(this),this._clients||(this._clie nts=[])},_endHosting:function(){Polymer.Base._hostStack.pop()},_tryReady:functio n(){this._readied=!1,this._canReady()&&this._ready()},_canReady:function(){retur n!this.dataHost||this.dataHost._clientsReadied},_ready:function(){this._beforeCl ientsReady(),this._template&&(this._setupRoot(),this._readyClients()),this._clie ntsReadied=!0,this._clients=null,this._afterClientsReady(),this._readySelf()},_r eadyClients:function(){this._beginDistribute();var e=this._clients;if(e)for(var t,o=0,i=e.length;o<i&&(t=e[o]);o++)t._ready();this._finishDistribute()},_readySe lf:function(){this._doBehavior("ready"),this._readied=!0,this._attachedPending&& (this._attachedPending=!1,this.attachedCallback())},_beforeClientsReady:function (){},_afterClientsReady:function(){},_beforeAttached:function(){},attachedCallba ck:function(){this._readied?(this._beforeAttached(),e.call(this)):this._attached Pending=!0}})}(),Polymer.ArraySplice=function(){function e(e,t,o){return{index:e ,removed:t,addedCount:o}}function t(){}var o=0,i=1,n=2,s=3;return t.prototype={c alcEditDistances:function(e,t,o,i,n,s){for(var r=s-n+1,d=o-t+1,a=new Array(r),l= 0;l<r;l++)a[l]=new Array(d),a[l][0]=l;for(var h=0;h<d;h++)a[0][h]=h;for(l=1;l<r; l++)for(h=1;h<d;h++)if(this.equals(e[t+h-1],i[n+l-1]))a[l][h]=a[l-1][h-1];else{v ar u=a[l-1][h]+1,c=a[l][h-1]+1;a[l][h]=u<c?u:c}return a},spliceOperationsFromEdi tDistances:function(e){for(var t=e.length-1,r=e[0].length-1,d=e[t][r],a=[];t>0|| r>0;)if(0!=t)if(0!=r){var l,h=e[t-1][r-1],u=e[t-1][r],c=e[t][r-1];l=u<c?u<h?u:h: c<h?c:h,l==h?(h==d?a.push(o):(a.push(i),d=h),t--,r--):l==u?(a.push(s),t--,d=u):( a.push(n),r--,d=c)}else a.push(s),t--;else a.push(n),r--;return a.reverse(),a},c alcSplices:function(t,r,d,a,l,h){var u=0,c=0,_=Math.min(d-r,h-l);if(0==r&&0==l&& (u=this.sharedPrefix(t,a,_)),d==t.length&&h==a.length&&(c=this.sharedSuffix(t,a, _-u)),r+=u,l+=u,d-=c,h-=c,d-r==0&&h-l==0)return[];if(r==d){for(var f=e(r,[],0);l <h;)f.removed.push(a[l++]);return[f]}if(l==h)return[e(r,[],d-r)];var m=this.spli ceOperationsFromEditDistances(this.calcEditDistances(t,r,d,a,l,h));f=void 0;for( var p=[],v=r,g=l,b=0;b<m.length;b++)switch(m[b]){case o:f&&(p.push(f),f=void 0), v++,g++;break;case i:f||(f=e(v,[],0)),f.addedCount++,v++,f.removed.push(a[g]),g+ +;break;case n:f||(f=e(v,[],0)),f.addedCount++,v++;break;case s:f||(f=e(v,[],0)) ,f.removed.push(a[g]),g++}return f&&p.push(f),p},sharedPrefix:function(e,t,o){fo r(var i=0;i<o;i++)if(!this.equals(e[i],t[i]))return i;return o},sharedSuffix:fun ction(e,t,o){for(var i=e.length,n=t.length,s=0;s<o&&this.equals(e[--i],t[--n]);) s++;return s},calculateSplices:function(e,t){return this.calcSplices(e,0,e.lengt h,t,0,t.length)},equals:function(e,t){return e===t}},new t}(),Polymer.domInnerHT ML=function(){function e(e){switch(e){case"&":return"&amp;";case"<":return"&lt;" ;case">":return"&gt;";case'"':return"&quot;";case" ":return"&nbsp;"}}function t( t){return t.replace(r,e)}function o(t){return t.replace(d,e)}function i(e){for(v ar t={},o=0;o<e.length;o++)t[e[o]]=!0;return t}function n(e,i,n){switch(e.nodeTy pe){case Node.ELEMENT_NODE:for(var r,d=e.localName,h="<"+d,u=e.attributes,c=0;r= u[c];c++)h+=" "+r.name+'="'+t(r.value)+'"';return h+=">",a[d]?h:h+s(e,n)+"</"+d+ ">";case Node.TEXT_NODE:var _=e.data;return i&&l[i.localName]?_:o(_);case Node.C OMMENT_NODE:return"\x3c!--"+e.data+"--\x3e";default:throw console.error(e),new E rror("not implemented")}}function s(e,t){e instanceof HTMLTemplateElement&&(e=e. content);for(var o,i="",s=Polymer.dom(e).childNodes,r=0,d=s.length;r<d&&(o=s[r]) ;r++)i+=n(o,e,t);return i}var r=/[&\u00A0"]/g,d=/[&\u00A0<>]/g,a=i(["area","base ","br","col","command","embed","hr","img","input","keygen","link","meta","param" ,"source","track","wbr"]),l=i(["style","script","xmp","iframe","noembed","nofram es","plaintext","noscript"]);return{getInnerHTML:s}}(),function(){"use strict";v ar e=Element.prototype.insertBefore,t=Element.prototype.appendChild,o=Element.pr ototype.removeChild;Polymer.TreeApi={arrayCopyChildNodes:function(e){for(var t=[ ],o=0,i=e.firstChild;i;i=i.nextSibling)t[o++]=i;return t},arrayCopyChildren:func tion(e){for(var t=[],o=0,i=e.firstElementChild;i;i=i.nextElementSibling)t[o++]=i ;return t},arrayCopy:function(e){for(var t=e.length,o=new Array(t),i=0;i<t;i++)o [i]=e[i];return o}},Polymer.TreeApi.Logical={hasParentNode:function(e){return Bo olean(e.__dom&&e.__dom.parentNode)},hasChildNodes:function(e){return Boolean(e._ _dom&&void 0!==e.__dom.childNodes)},getChildNodes:function(e){return this.hasChi ldNodes(e)?this._getChildNodes(e):e.childNodes},_getChildNodes:function(e){if(!e .__dom.childNodes){e.__dom.childNodes=[];for(var t=e.__dom.firstChild;t;t=t.__do m.nextSibling)e.__dom.childNodes.push(t)}return e.__dom.childNodes},getParentNod e:function(e){return e.__dom&&void 0!==e.__dom.parentNode?e.__dom.parentNode:e.p arentNode},getFirstChild:function(e){return e.__dom&&void 0!==e.__dom.firstChild ?e.__dom.firstChild:e.firstChild},getLastChild:function(e){return e.__dom&&void 0!==e.__dom.lastChild?e.__dom.lastChild:e.lastChild},getNextSibling:function(e){ return e.__dom&&void 0!==e.__dom.nextSibling?e.__dom.nextSibling:e.nextSibling}, getPreviousSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling? e.__dom.previousSibling:e.previousSibling},getFirstElementChild:function(e){retu rn e.__dom&&void 0!==e.__dom.firstChild?this._getFirstElementChild(e):e.firstEle mentChild},_getFirstElementChild:function(e){for(var t=e.__dom.firstChild;t&&t.n odeType!==Node.ELEMENT_NODE;)t=t.__dom.nextSibling;return t},getLastElementChild :function(e){return e.__dom&&void 0!==e.__dom.lastChild?this._getLastElementChil d(e):e.lastElementChild},_getLastElementChild:function(e){for(var t=e.__dom.last Child;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},get NextElementSibling:function(e){return e.__dom&&void 0!==e.__dom.nextSibling?this ._getNextElementSibling(e):e.nextElementSibling},_getNextElementSibling:function (e){for(var t=e.__dom.nextSibling;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.n extSibling;return t},getPreviousElementSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling?this._getPreviousElementSibling(e):e.previousElement Sibling},_getPreviousElementSibling:function(e){for(var t=e.__dom.previousSiblin g;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},saveChi ldNodes:function(e){if(!this.hasChildNodes(e)){e.__dom=e.__dom||{},e.__dom.first Child=e.firstChild,e.__dom.lastChild=e.lastChild,e.__dom.childNodes=[];for(var t =e.firstChild;t;t=t.nextSibling)t.__dom=t.__dom||{},t.__dom.parentNode=e,e.__dom .childNodes.push(t),t.__dom.nextSibling=t.nextSibling,t.__dom.previousSibling=t. previousSibling}},recordInsertBefore:function(e,t,o){if(t.__dom.childNodes=null, e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(var i=e.firstChild;i;i=i.nextSiblin g)this._linkNode(i,t,o);else this._linkNode(e,t,o)},_linkNode:function(e,t,o){e. __dom=e.__dom||{},t.__dom=t.__dom||{},o&&(o.__dom=o.__dom||{}),e.__dom.previousS ibling=o?o.__dom.previousSibling:t.__dom.lastChild,e.__dom.previousSibling&&(e._ _dom.previousSibling.__dom.nextSibling=e),e.__dom.nextSibling=o||null,e.__dom.ne xtSibling&&(e.__dom.nextSibling.__dom.previousSibling=e),e.__dom.parentNode=t,o? o===t.__dom.firstChild&&(t.__dom.firstChild=e):(t.__dom.lastChild=e,t.__dom.firs tChild||(t.__dom.firstChild=e)),t.__dom.childNodes=null},recordRemoveChild:funct ion(e,t){e.__dom=e.__dom||{},t.__dom=t.__dom||{},e===t.__dom.firstChild&&(t.__do m.firstChild=e.__dom.nextSibling),e===t.__dom.lastChild&&(t.__dom.lastChild=e.__ dom.previousSibling);var o=e.__dom.previousSibling,i=e.__dom.nextSibling;o&&(o._ _dom.nextSibling=i),i&&(i.__dom.previousSibling=o),e.__dom.parentNode=e.__dom.pr eviousSibling=e.__dom.nextSibling=void 0,t.__dom.childNodes=null}},Polymer.TreeA pi.Composed={getChildNodes:function(e){return Polymer.TreeApi.arrayCopyChildNode s(e)},getParentNode:function(e){return e.parentNode},clearChildNodes:function(e) {e.textContent=""},insertBefore:function(t,o,i){return e.call(t,o,i||null)},appe ndChild:function(e,o){return t.call(e,o)},removeChild:function(e,t){return o.cal l(e,t)}}}(),Polymer.DomApi=function(){"use strict";var e=Polymer.Settings,t=Poly mer.TreeApi,o=function(e){this.node=i?o.wrap(e):e},i=e.hasShadow&&!e.nativeShado w;o.wrap=window.wrap?window.wrap:function(e){return e},o.prototype={flush:functi on(){Polymer.dom.flush()},deepContains:function(e){if(this.node.contains(e))retu rn!0;for(var t=e,o=e.ownerDocument;t&&t!==o&&t!==this.node;)t=Polymer.dom(t).par entNode||t.host;return t===this.node},queryDistributedElements:function(e){for(v ar t,i=this.getEffectiveChildNodes(),n=[],s=0,r=i.length;s<r&&(t=i[s]);s++)t.nod eType===Node.ELEMENT_NODE&&o.matchesSelector.call(t,e)&&n.push(t);return n},getE ffectiveChildNodes:function(){for(var e,t=[],o=this.childNodes,i=0,r=o.length;i< r&&(e=o[i]);i++)if(e.localName===n)for(var d=s(e).getDistributedNodes(),a=0;a<d. length;a++)t.push(d[a]);else t.push(e);return t},observeNodes:function(e){if(e)r eturn this.observer||(this.observer=this.node.localName===n?new o.DistributedNod esObserver(this):new o.EffectiveNodesObserver(this)),this.observer.addListener(e )},unobserveNodes:function(e){this.observer&&this.observer.removeListener(e)},no tifyObserver:function(){this.observer&&this.observer.notify()},_query:function(e ,o,i){o=o||this.node;var n=[];return this._queryElements(t.Logical.getChildNodes (o),e,i,n),n},_queryElements:function(e,t,o,i){for(var n,s=0,r=e.length;s<r&&(n= e[s]);s++)if(n.nodeType===Node.ELEMENT_NODE&&this._queryElement(n,t,o,i))return! 0},_queryElement:function(e,o,i,n){var s=o(e);return s&&n.push(e),i&&i(s)?s:void this._queryElements(t.Logical.getChildNodes(e),o,i,n)}};var n=o.CONTENT="conten t",s=o.factory=function(e){return e=e||document,e.__domApi||(e.__domApi=new o.ct or(e)),e.__domApi};o.hasApi=function(e){return Boolean(e.__domApi)},o.ctor=o,Pol ymer.dom=function(e,t){return e instanceof Event?Polymer.EventApi.factory(e):o.f actory(e,t)};var r=Element.prototype;return o.matchesSelector=r.matches||r.match esSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.web kitMatchesSelector,o}(),function(){"use strict";var e=Polymer.Settings,t=Polymer .DomApi,o=t.factory,i=Polymer.TreeApi,n=Polymer.domInnerHTML.getInnerHTML,s=t.CO NTENT;if(!e.useShadow){var r=Element.prototype.cloneNode,d=Document.prototype.im portNode;Polymer.Base.extend(t.prototype,{_lazyDistribute:function(e){e.shadyRoo t&&e.shadyRoot._distributionClean&&(e.shadyRoot._distributionClean=!1,Polymer.do m.addDebouncer(e.debounce("_distribute",e._distributeContent)))},appendChild:fun ction(e){return this.insertBefore(e)},insertBefore:function(e,n){if(n&&i.Logical .getParentNode(n)!==this.node)throw Error("The ref_node to be inserted before is not a child of this node");if(e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var r=i .Logical.getParentNode(e);r?(t.hasApi(r)&&o(r).notifyObserver(),this._removeNode (e)):this._removeOwnerShadyRoot(e)}if(!this._addNode(e,n)){n&&(n=n.localName===s ?this._firstComposedNode(n):n);var d=this.node._isShadyRoot?this.node.host:this. node;n?i.Composed.insertBefore(d,e,n):i.Composed.appendChild(d,e)}return this.no tifyObserver(),e},_addNode:function(e,t){var o=this.getOwnerRoot();if(o){var n=t his._maybeAddInsertionPoint(e,this.node);o._invalidInsertionPoints||(o._invalidI nsertionPoints=n),this._addNodeToHost(o.host,e)}i.Logical.hasChildNodes(this.nod e)&&i.Logical.recordInsertBefore(e,this.node,t);var s=this._maybeDistribute(e)|| this.node.shadyRoot;if(s)if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(;e.firs tChild;)i.Composed.removeChild(e,e.firstChild);else{var r=i.Composed.getParentNo de(e);r&&i.Composed.removeChild(r,e)}return s},removeChild:function(e){if(i.Logi cal.getParentNode(e)!==this.node)throw Error("The node to be removed is not a ch ild of this node: "+e);if(!this._removeNode(e)){var t=this.node._isShadyRoot?thi s.node.host:this.node,o=i.Composed.getParentNode(e);t===o&&i.Composed.removeChil d(t,e)}return this.notifyObserver(),e},_removeNode:function(e){var t,n=i.Logical .hasParentNode(e)&&i.Logical.getParentNode(e),s=this._ownerShadyRootForNode(e);r eturn n&&(t=o(e)._maybeDistributeParent(),i.Logical.recordRemoveChild(e,n),s&&th is._removeDistributedChildren(s,e)&&(s._invalidInsertionPoints=!0,this._lazyDist ribute(s.host))),this._removeOwnerShadyRoot(e),s&&this._removeNodeFromHost(s.hos t,e),t},replaceChild:function(e,t){return this.insertBefore(e,t),this.removeChil d(t),e},_hasCachedOwnerRoot:function(e){return Boolean(void 0!==e._ownerShadyRoo t)},getOwnerRoot:function(){return this._ownerShadyRootForNode(this.node)},_owne rShadyRootForNode:function(e){if(e){var t=e._ownerShadyRoot;if(void 0===t){if(e. _isShadyRoot)t=e;else{var o=i.Logical.getParentNode(e);t=o?o._isShadyRoot?o:this ._ownerShadyRootForNode(o):null}(t||document.documentElement.contains(e))&&(e._o wnerShadyRoot=t)}return t}},_maybeDistribute:function(e){var t=e.nodeType===Node .DOCUMENT_FRAGMENT_NODE&&!e.__noContent&&o(e).querySelector(s),n=t&&i.Logical.ge tParentNode(t).nodeType!==Node.DOCUMENT_FRAGMENT_NODE,r=t||e.localName===s;if(r) {var d=this.getOwnerRoot();d&&this._lazyDistribute(d.host)}var a=this._nodeNeeds Distribution(this.node);return a&&this._lazyDistribute(this.node),a||r&&!n},_may beAddInsertionPoint:function(e,t){var n;if(e.nodeType!==Node.DOCUMENT_FRAGMENT_N ODE||e.__noContent)e.localName===s&&(i.Logical.saveChildNodes(t),i.Logical.saveC hildNodes(e),n=!0);else for(var r,d,a,l=o(e).querySelectorAll(s),h=0;h<l.length& &(r=l[h]);h++)d=i.Logical.getParentNode(r),d===e&&(d=t),a=this._maybeAddInsertio nPoint(r,d),n=n||a;return n},_updateInsertionPoints:function(e){for(var t,n=e.sh adyRoot._insertionPoints=o(e.shadyRoot).querySelectorAll(s),r=0;r<n.length;r++)t =n[r],i.Logical.saveChildNodes(t),i.Logical.saveChildNodes(i.Logical.getParentNo de(t))},_nodeNeedsDistribution:function(e){return e&&e.shadyRoot&&t.hasInsertion Point(e.shadyRoot)},_addNodeToHost:function(e,t){e._elementAdd&&e._elementAdd(t) },_removeNodeFromHost:function(e,t){e._elementRemove&&e._elementRemove(t)},_remo veDistributedChildren:function(e,t){for(var n,s=e._insertionPoints,r=0;r<s.lengt h;r++){var d=s[r];if(this._contains(t,d))for(var a=o(d).getDistributedNodes(),l= 0;l<a.length;l++){n=!0;var h=a[l],u=i.Composed.getParentNode(h);u&&i.Composed.re moveChild(u,h)}}return n},_contains:function(e,t){for(;t;){if(t==e)return!0;t=i. Logical.getParentNode(t)}},_removeOwnerShadyRoot:function(e){if(this._hasCachedO wnerRoot(e))for(var t,o=i.Logical.getChildNodes(e),n=0,s=o.length;n<s&&(t=o[n]); n++)this._removeOwnerShadyRoot(t);e._ownerShadyRoot=void 0},_firstComposedNode:f unction(e){for(var t,i,n=o(e).getDistributedNodes(),s=0,r=n.length;s<r&&(t=n[s]) ;s++)if(i=o(t).getDestinationInsertionPoints(),i[i.length-1]===e)return t},query Selector:function(e){var o=this._query(function(o){return t.matchesSelector.call (o,e)},this.node,function(e){return Boolean(e)})[0];return o||null},querySelecto rAll:function(e){return this._query(function(o){return t.matchesSelector.call(o, e)},this.node)},getDestinationInsertionPoints:function(){return this.node._desti nationInsertionPoints||[]},getDistributedNodes:function(){return this.node._dist ributedNodes||[]},_clear:function(){for(;this.childNodes.length;)this.removeChil d(this.childNodes[0])},setAttribute:function(e,t){this.node.setAttribute(e,t),th is._maybeDistributeParent()},removeAttribute:function(e){this.node.removeAttribu te(e),this._maybeDistributeParent()},_maybeDistributeParent:function(){if(this._ nodeNeedsDistribution(this.parentNode))return this._lazyDistribute(this.parentNo de),!0},cloneNode:function(e){var t=r.call(this.node,!1);if(e)for(var i,n=this.c hildNodes,s=o(t),d=0;d<n.length;d++)i=o(n[d]).cloneNode(!0),s.appendChild(i);ret urn t},importNode:function(e,t){var n=this.node instanceof Document?this.node:th is.node.ownerDocument,s=d.call(n,e,!1);if(t)for(var r,a=i.Logical.getChildNodes( e),l=o(s),h=0;h<a.length;h++)r=o(n).importNode(a[h],!0),l.appendChild(r);return s},_getComposedInnerHTML:function(){return n(this.node,!0)}}),Object.definePrope rties(t.prototype,{activeElement:{get:function(){var e=document.activeElement;if (!e)return null;var t=!!this.node._isShadyRoot;if(this.node!==document){if(!t)re turn null;if(this.node.host===e||!this.node.host.contains(e))return null}for(var i=o(e).getOwnerRoot();i&&i!==this.node;)e=i.host,i=o(e).getOwnerRoot();return t his.node===document?i?null:e:i===this.node?e:null},configurable:!0},childNodes:{ get:function(){var e=i.Logical.getChildNodes(this.node);return Array.isArray(e)? e:i.arrayCopyChildNodes(this.node)},configurable:!0},children:{get:function(){re turn i.Logical.hasChildNodes(this.node)?Array.prototype.filter.call(this.childNo des,function(e){return e.nodeType===Node.ELEMENT_NODE}):i.arrayCopyChildren(this .node)},configurable:!0},parentNode:{get:function(){return i.Logical.getParentNo de(this.node)},configurable:!0},firstChild:{get:function(){return i.Logical.getF irstChild(this.node)},configurable:!0},lastChild:{get:function(){return i.Logica l.getLastChild(this.node)},configurable:!0},nextSibling:{get:function(){return i .Logical.getNextSibling(this.node)},configurable:!0},previousSibling:{get:functi on(){return i.Logical.getPreviousSibling(this.node)},configurable:!0},firstEleme ntChild:{get:function(){return i.Logical.getFirstElementChild(this.node)},config urable:!0},lastElementChild:{get:function(){return i.Logical.getLastElementChild (this.node)},configurable:!0},nextElementSibling:{get:function(){return i.Logica l.getNextElementSibling(this.node)},configurable:!0},previousElementSibling:{get :function(){return i.Logical.getPreviousElementSibling(this.node)},configurable: !0},textContent:{get:function(){var e=this.node.nodeType;if(e===Node.TEXT_NODE|| e===Node.COMMENT_NODE)return this.node.textContent;for(var t,o=[],i=0,n=this.chi ldNodes;t=n[i];i++)t.nodeType!==Node.COMMENT_NODE&&o.push(t.textContent);return o.join("")},set:function(e){var t=this.node.nodeType;t===Node.TEXT_NODE||t===Nod e.COMMENT_NODE?this.node.textContent=e:(this._clear(),e&&this.appendChild(docume nt.createTextNode(e)))},configurable:!0},innerHTML:{get:function(){var e=this.no de.nodeType;return e===Node.TEXT_NODE||e===Node.COMMENT_NODE?null:n(this.node)}, set:function(e){var t=this.node.nodeType;if(t!==Node.TEXT_NODE||t!==Node.COMMENT _NODE){this._clear();var o=document.createElement("div");o.innerHTML=e;for(var n =i.arrayCopyChildNodes(o),s=0;s<n.length;s++)this.appendChild(n[s])}},configurab le:!0}}),t.hasInsertionPoint=function(e){return Boolean(e&&e._insertionPoints.le ngth)}}}(),function(){"use strict";var e=Polymer.Settings,t=Polymer.TreeApi,o=Po lymer.DomApi;if(e.useShadow){Polymer.Base.extend(o.prototype,{querySelectorAll:f unction(e){return t.arrayCopy(this.node.querySelectorAll(e))},getOwnerRoot:funct ion(){for(var e=this.node;e;){if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.hos t)return e;e=e.parentNode}},importNode:function(e,t){var o=this.node instanceof Document?this.node:this.node.ownerDocument;return o.importNode(e,t)},getDestinat ionInsertionPoints:function(){var e=this.node.getDestinationInsertionPoints&&thi s.node.getDestinationInsertionPoints();return e?t.arrayCopy(e):[]},getDistribute dNodes:function(){var e=this.node.getDistributedNodes&&this.node.getDistributedN odes();return e?t.arrayCopy(e):[]}}),Object.defineProperties(o.prototype,{active Element:{get:function(){var e=o.wrap(this.node),t=e.activeElement;return e.conta ins(t)?t:null},configurable:!0},childNodes:{get:function(){return t.arrayCopyChi ldNodes(this.node)},configurable:!0},children:{get:function(){return t.arrayCopy Children(this.node)},configurable:!0},textContent:{get:function(){return this.no de.textContent},set:function(e){return this.node.textContent=e},configurable:!0} ,innerHTML:{get:function(){return this.node.innerHTML},set:function(e){return th is.node.innerHTML=e},configurable:!0}});var i=function(e){for(var t=0;t<e.length ;t++)n(e[t])},n=function(e){o.prototype[e]=function(){return this.node[e].apply( this.node,arguments)}};i(["cloneNode","appendChild","insertBefore","removeChild" ,"replaceChild","setAttribute","removeAttribute","querySelector"]);var s=functio n(e){for(var t=0;t<e.length;t++)r(e[t])},r=function(e){Object.defineProperty(o.p rototype,e,{get:function(){return this.node[e]},configurable:!0})};s(["parentNod e","firstChild","lastChild","nextSibling","previousSibling","firstElementChild", "lastElementChild","nextElementSibling","previousElementSibling"])}}(),Polymer.B ase.extend(Polymer.dom,{_flushGuard:0,_FLUSH_MAX:100,_needsTakeRecords:!Polymer. Settings.useNativeCustomElements,_debouncers:[],_staticFlushList:[],_finishDebou ncer:null,flush:function(){for(this._flushGuard=0,this._prepareFlush();this._deb ouncers.length&&this._flushGuard<this._FLUSH_MAX;){for(;this._debouncers.length; )this._debouncers.shift().complete();this._finishDebouncer&&this._finishDebounce r.complete(),this._prepareFlush(),this._flushGuard++}this._flushGuard>=this._FLU SH_MAX&&console.warn("Polymer.dom.flush aborted. Flush may not be complete.")},_ prepareFlush:function(){this._needsTakeRecords&&CustomElements.takeRecords();for (var e=0;e<this._staticFlushList.length;e++)this._staticFlushList[e]()},addStati cFlush:function(e){this._staticFlushList.push(e)},removeStaticFlush:function(e){ var t=this._staticFlushList.indexOf(e);t>=0&&this._staticFlushList.splice(t,1)}, addDebouncer:function(e){this._debouncers.push(e),this._finishDebouncer=Polymer. Debounce(this._finishDebouncer,this._finishFlush)},_finishFlush:function(){Polym er.dom._debouncers=[]}}),Polymer.EventApi=function(){"use strict";var e=Polymer. DomApi.ctor,t=Polymer.Settings;e.Event=function(e){this.event=e},t.useShadow?e.E vent.prototype={get rootTarget(){return this.event.path[0]},get localTarget(){re turn this.event.target},get path(){var e=this.event.path;return Array.isArray(e) ||(e=Array.prototype.slice.call(e)),e}}:e.Event.prototype={get rootTarget(){retu rn this.event.target},get localTarget(){for(var e=this.event.currentTarget,t=e&& Polymer.dom(e).getOwnerRoot(),o=this.path,i=0;i<o.length;i++)if(Polymer.dom(o[i] ).getOwnerRoot()===t)return o[i]},get path(){if(!this.event._path){for(var e=[], t=this.rootTarget;t;){e.push(t);var o=Polymer.dom(t).getDestinationInsertionPoin ts();if(o.length){for(var i=0;i<o.length-1;i++)e.push(o[i]);t=o[o.length-1]}else t=Polymer.dom(t).parentNode||t.host}e.push(window),this.event._path=e}return th is.event._path}};var o=function(t){return t.__eventApi||(t.__eventApi=new e.Even t(t)),t.__eventApi};return{factory:o}}(),function(){"use strict";var e=Polymer.D omApi.ctor,t=Polymer.Settings.useShadow;Object.defineProperty(e.prototype,"class List",{get:function(){return this._classList||(this._classList=new e.ClassList(t his)),this._classList},configurable:!0}),e.ClassList=function(e){this.domApi=e,t his.node=e.node},e.ClassList.prototype={add:function(){this.node.classList.add.a pply(this.node.classList,arguments),this._distributeParent()},remove:function(){ this.node.classList.remove.apply(this.node.classList,arguments),this._distribute Parent()},toggle:function(){this.node.classList.toggle.apply(this.node.classList ,arguments),this._distributeParent()},_distributeParent:function(){t||this.domAp i._maybeDistributeParent()},contains:function(){return this.node.classList.conta ins.apply(this.node.classList,arguments)}}}(),function(){"use strict";var e=Poly mer.DomApi.ctor,t=Polymer.Settings;if(e.EffectiveNodesObserver=function(e){this. domApi=e,this.node=this.domApi.node,this._listeners=[]},e.EffectiveNodesObserver .prototype={addListener:function(e){this._isSetup||(this._setup(),this._isSetup= !0);var t={fn:e,_nodes:[]};return this._listeners.push(t),this._scheduleNotify() ,t},removeListener:function(e){var t=this._listeners.indexOf(e);t>=0&&(this._lis teners.splice(t,1),e._nodes=[]),this._hasListeners()||(this._cleanup(),this._isS etup=!1)},_setup:function(){this._observeContentElements(this.domApi.childNodes) },_cleanup:function(){this._unobserveContentElements(this.domApi.childNodes)},_h asListeners:function(){return Boolean(this._listeners.length)},_scheduleNotify:f unction(){this._debouncer&&this._debouncer.stop(),this._debouncer=Polymer.Deboun ce(this._debouncer,this._notify),this._debouncer.context=this,Polymer.dom.addDeb ouncer(this._debouncer)},notify:function(){this._hasListeners()&&this._scheduleN otify()},_notify:function(){this._beforeCallListeners(),this._callListeners()},_ beforeCallListeners:function(){this._updateContentElements()},_updateContentElem ents:function(){this._observeContentElements(this.domApi.childNodes)},_observeCo ntentElements:function(e){for(var t,o=0;o<e.length&&(t=e[o]);o++)this._isContent (t)&&(t.__observeNodesMap=t.__observeNodesMap||new WeakMap,t.__observeNodesMap.h as(this)||t.__observeNodesMap.set(this,this._observeContent(t)))},_observeConten t:function(e){var t=this,o=Polymer.dom(e).observeNodes(function(){t._scheduleNot ify()});return o._avoidChangeCalculation=!0,o},_unobserveContentElements:functio n(e){for(var t,o,i=0;i<e.length&&(t=e[i]);i++)this._isContent(t)&&(o=t.__observe NodesMap.get(this),o&&(Polymer.dom(t).unobserveNodes(o),t.__observeNodesMap.dele te(this)))},_isContent:function(e){return"content"===e.localName},_callListeners :function(){for(var e,t=this._listeners,o=this._getEffectiveNodes(),i=0;i<t.leng th&&(e=t[i]);i++){var n=this._generateListenerInfo(e,o);(n||e._alwaysNotify)&&th is._callListener(e,n)}},_getEffectiveNodes:function(){return this.domApi.getEffe ctiveChildNodes()},_generateListenerInfo:function(e,t){if(e._avoidChangeCalculat ion)return!0;for(var o,i=e._nodes,n={target:this.node,addedNodes:[],removedNodes :[]},s=Polymer.ArraySplice.calculateSplices(t,i),r=0;r<s.length&&(o=s[r]);r++)fo r(var d,a=0;a<o.removed.length&&(d=o.removed[a]);a++)n.removedNodes.push(d);for( r=0,o;r<s.length&&(o=s[r]);r++)for(a=o.index;a<o.index+o.addedCount;a++)n.addedN odes.push(t[a]);return e._nodes=t,n.addedNodes.length||n.removedNodes.length?n:v oid 0},_callListener:function(e,t){return e.fn.call(this.node,t)},enableShadowAt tributeTracking:function(){}},t.useShadow){var o=e.EffectiveNodesObserver.protot ype._setup,i=e.EffectiveNodesObserver.prototype._cleanup;Polymer.Base.extend(e.E ffectiveNodesObserver.prototype,{_setup:function(){if(!this._observer){var e=thi s;this._mutationHandler=function(t){t&&t.length&&e._scheduleNotify()},this._obse rver=new MutationObserver(this._mutationHandler),this._boundFlush=function(){e._ flush()},Polymer.dom.addStaticFlush(this._boundFlush),this._observer.observe(thi s.node,{childList:!0})}o.call(this)},_cleanup:function(){this._observer.disconne ct(),this._observer=null,this._mutationHandler=null,Polymer.dom.removeStaticFlus h(this._boundFlush),i.call(this)},_flush:function(){this._observer&&this._mutati onHandler(this._observer.takeRecords())},enableShadowAttributeTracking:function( ){if(this._observer){this._makeContentListenersAlwaysNotify(),this._observer.dis connect(),this._observer.observe(this.node,{childList:!0,attributes:!0,subtree:! 0});var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).observer&&Pol ymer.dom(t).observer.enableShadowAttributeTracking()}},_makeContentListenersAlwa ysNotify:function(){for(var e,t=0;t<this._listeners.length;t++)e=this._listeners [t],e._alwaysNotify=e._isContentListener}})}}(),function(){"use strict";var e=Po lymer.DomApi.ctor,t=Polymer.Settings;e.DistributedNodesObserver=function(t){e.Ef fectiveNodesObserver.call(this,t)},e.DistributedNodesObserver.prototype=Object.c reate(e.EffectiveNodesObserver.prototype),Polymer.Base.extend(e.DistributedNodes Observer.prototype,{_setup:function(){},_cleanup:function(){},_beforeCallListene rs:function(){},_getEffectiveNodes:function(){return this.domApi.getDistributedN odes()}}),t.useShadow&&Polymer.Base.extend(e.DistributedNodesObserver.prototype, {_setup:function(){if(!this._observer){var e=this.domApi.getOwnerRoot(),t=e&&e.h ost;if(t){var o=this;this._observer=Polymer.dom(t).observeNodes(function(){o._sc heduleNotify()}),this._observer._isContentListener=!0,this._hasAttrSelect()&&Pol ymer.dom(t).observer.enableShadowAttributeTracking()}}},_hasAttrSelect:function( ){var e=this.node.getAttribute("select");return e&&e.match(/[[.]+/)},_cleanup:fu nction(){var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).unobserv eNodes(this._observer),this._observer=null}})}(),function(){function e(e,t){t._d istributedNodes.push(e);var o=e._destinationInsertionPoints;o?o.push(t):e._desti nationInsertionPoints=[t]}function t(e){var t=e._distributedNodes;if(t)for(var o =0;o<t.length;o++){var i=t[o]._destinationInsertionPoints;i&&i.splice(i.indexOf( e)+1,i.length)}}function o(e,t){var o=u.Logical.getParentNode(e);o&&o.shadyRoot& &h.hasInsertionPoint(o.shadyRoot)&&o.shadyRoot._distributionClean&&(o.shadyRoot. _distributionClean=!1,t.shadyRoot._dirtyRoots.push(o))}function i(e,t){var o=t._ destinationInsertionPoints;return o&&o[o.length-1]===e}function n(e){return"cont ent"==e.localName}function s(e){for(;e&&r(e);)e=e.domHost;return e}function r(e) {for(var t,o=u.Logical.getChildNodes(e),i=0;i<o.length;i++)if(t=o[i],t.localName &&"content"===t.localName)return e.domHost}function d(e){for(var t,o=0;o<e._inse rtionPoints.length;o++)t=e._insertionPoints[o],h.hasApi(t)&&Polymer.dom(t).notif yObserver()}function a(e){h.hasApi(e)&&Polymer.dom(e).notifyObserver()}function l(e){if(c&&e)for(var t=0;t<e.length;t++)CustomElements.upgrade(e[t])}var h=Polym er.DomApi,u=Polymer.TreeApi;Polymer.Base._addFeature({_prepShady:function(){this ._useContent=this._useContent||Boolean(this._template)},_setupShady:function(){t his.shadyRoot=null,this.__domApi||(this.__domApi=null),this.__dom||(this.__dom=n ull),this._ownerShadyRoot||(this._ownerShadyRoot=void 0)},_poolContent:function( ){this._useContent&&u.Logical.saveChildNodes(this)},_setupRoot:function(){this._ useContent&&(this._createLocalRoot(),this.dataHost||l(u.Logical.getChildNodes(th is)))},_createLocalRoot:function(){this.shadyRoot=this.root,this.shadyRoot._dist ributionClean=!1,this.shadyRoot._hasDistributed=!1,this.shadyRoot._isShadyRoot=! 0,this.shadyRoot._dirtyRoots=[];var e=this.shadyRoot._insertionPoints=!this._not es||this._notes._hasContent?this.shadyRoot.querySelectorAll("content"):[];u.Logi cal.saveChildNodes(this.shadyRoot);for(var t,o=0;o<e.length;o++)t=e[o],u.Logical .saveChildNodes(t),u.Logical.saveChildNodes(t.parentNode);this.shadyRoot.host=th is},get domHost(){var e=Polymer.dom(this).getOwnerRoot();return e&&e.host},distr ibuteContent:function(e){if(this.shadyRoot){this.shadyRoot._invalidInsertionPoin ts=this.shadyRoot._invalidInsertionPoints||e;var t=s(this);Polymer.dom(this)._la zyDistribute(t)}},_distributeContent:function(){this._useContent&&!this.shadyRoo t._distributionClean&&(this.shadyRoot._invalidInsertionPoints&&(Polymer.dom(this )._updateInsertionPoints(this),this.shadyRoot._invalidInsertionPoints=!1),this._ beginDistribute(),this._distributeDirtyRoots(),this._finishDistribute())},_begin Distribute:function(){this._useContent&&h.hasInsertionPoint(this.shadyRoot)&&(th is._resetDistribution(),this._distributePool(this.shadyRoot,this._collectPool()) ); 1 <!DOCTYPE html><html><head><meta charset="UTF-8"> </head><body><div hidden="" by -vulcanize=""><script>!function(){function e(){document.body.removeAttribute("un resolved")}window.WebComponents?addEventListener("WebComponentsReady",e):"intera ctive"===document.readyState||"complete"===document.readyState?e():addEventListe ner("DOMContentLoaded",e)}(),window.Polymer={Settings:function(){var e=window.Po lymer||{};if(!e.noUrlSettings)for(var t,r=location.search.slice(1).split("&"),i= 0;i<r.length&&(t=r[i]);i++)t=t.split("="),t[0]&&(e[t[0]]=t[1]||!0);return e.want Shadow="shadow"===e.dom,e.hasShadow=Boolean(Element.prototype.createShadowRoot), e.nativeShadow=e.hasShadow&&!window.ShadowDOMPolyfill,e.useShadow=e.wantShadow&& e.hasShadow,e.hasNativeImports=Boolean("import"in document.createElement("link") ),e.useNativeImports=e.hasNativeImports,e.useNativeCustomElements=!window.Custom Elements||window.CustomElements.useNative,e.useNativeShadow=e.useShadow&&e.nativ eShadow,e.usePolyfillProto=!e.useNativeCustomElements&&!Object.__proto__,e.hasNa tiveCSSProperties=!navigator.userAgent.match("AppleWebKit/601")&&window.CSS&&CSS .supports&&CSS.supports("box-shadow","0 0 0 var(--foo)"),e.useNativeCSSPropertie s=e.hasNativeCSSProperties&&e.lazyRegister&&e.useNativeCSSProperties,e}()},funct ion(){var e=window.Polymer;window.Polymer=function(e){"function"==typeof e&&(e=e .prototype),e||(e={});var r=t(e);e=r.prototype;var i={prototype:e};return e.exte nds&&(i.extends=e.extends),Polymer.telemetry._registrate(e),document.registerEle ment(e.is,i),r};var t=function(e){var t=Polymer.Base;return e.extends&&(t=Polyme r.Base._getExtendedPrototype(e.extends)),e=Polymer.Base.chainObject(e,t),e.regis terCallback(),e.constructor};if(e)for(var r in e)Polymer[r]=e[r];Polymer.Class=t }(),Polymer.telemetry={registrations:[],_regLog:function(e){console.log("["+e.is +"]: registered")},_registrate:function(e){this.registrations.push(e),Polymer.lo g&&this._regLog(e)},dumpRegistrations:function(){this.registrations.forEach(this ._regLog)}},Object.defineProperty(window,"currentImport",{enumerable:!0,configur able:!0,get:function(){return(document._currentScript||document.currentScript).o wnerDocument}}),Polymer.RenderStatus={_ready:!1,_callbacks:[],whenReady:function (e){this._ready?e():this._callbacks.push(e)},_makeReady:function(){this._ready=! 0;for(var e=0;e<this._callbacks.length;e++)this._callbacks[e]();this._callbacks= []},_catchFirstRender:function(){requestAnimationFrame(function(){Polymer.Render Status._makeReady()})},_afterNextRenderQueue:[],_waitingNextRender:!1,afterNextR ender:function(e,t,r){this._watchNextRender(),this._afterNextRenderQueue.push([e ,t,r])},hasRendered:function(){return this._ready},_watchNextRender:function(){i f(!this._waitingNextRender){this._waitingNextRender=!0;var e=function(){Polymer. RenderStatus._flushNextRender()};this._ready?requestAnimationFrame(e):this.whenR eady(e)}},_flushNextRender:function(){var e=this;setTimeout(function(){e._flushR enderCallbacks(e._afterNextRenderQueue),e._afterNextRenderQueue=[],e._waitingNex tRender=!1})},_flushRenderCallbacks:function(e){for(var t,r=0;r<e.length;r++)t=e [r],t[1].apply(t[0],t[2]||Polymer.nar)}},window.HTMLImports?HTMLImports.whenRead y(function(){Polymer.RenderStatus._catchFirstRender()}):Polymer.RenderStatus._ca tchFirstRender(),Polymer.ImportStatus=Polymer.RenderStatus,Polymer.ImportStatus. whenLoaded=Polymer.ImportStatus.whenReady,function(){"use strict";var e=Polymer. Settings;Polymer.Base={__isPolymerInstance__:!0,_addFeature:function(e){this.ext end(this,e)},registerCallback:function(){"max"===e.lazyRegister?this.beforeRegis ter&&this.beforeRegister():(this._desugarBehaviors(),this._doBehavior("beforeReg ister")),this._registerFeatures(),e.lazyRegister||this.ensureRegisterFinished()} ,createdCallback:function(){this.__hasRegisterFinished||this._ensureRegisterFini shed(this.__proto__),Polymer.telemetry.instanceCount++,this.root=this,this._doBe havior("created"),this._initFeatures()},ensureRegisterFinished:function(){this._ ensureRegisterFinished(this)},_ensureRegisterFinished:function(t){t.__hasRegiste rFinished===t.is&&t.is||("max"===e.lazyRegister&&(t._desugarBehaviors(),t._doBeh aviorOnly("beforeRegister")),t.__hasRegisterFinished=t.is,t._finishRegisterFeatu res&&t._finishRegisterFeatures(),t._doBehavior("registered"),e.usePolyfillProto& &t!==this&&t.extend(this,t))},attachedCallback:function(){var e=this;Polymer.Ren derStatus.whenReady(function(){e.isAttached=!0,e._doBehavior("attached")})},deta chedCallback:function(){var e=this;Polymer.RenderStatus.whenReady(function(){e.i sAttached=!1,e._doBehavior("detached")})},attributeChangedCallback:function(e,t, r){this._attributeChangedImpl(e),this._doBehavior("attributeChanged",[e,t,r])},_ attributeChangedImpl:function(e){this._setAttributeToProperty(this,e)},extend:fu nction(e,t){if(e&&t)for(var r,i=Object.getOwnPropertyNames(t),o=0;o<i.length&&(r =i[o]);o++)this.copyOwnProperty(r,t,e);return e||t},mixin:function(e,t){for(var r in t)e[r]=t[r];return e},copyOwnProperty:function(e,t,r){var i=Object.getOwnPr opertyDescriptor(t,e);i&&Object.defineProperty(r,e,i)},_logger:function(e,t){swi tch(1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"err or":console[e].apply(console,t)}},_log:function(){var e=Array.prototype.slice.ca ll(arguments,0);this._logger("log",e)},_warn:function(){var e=Array.prototype.sl ice.call(arguments,0);this._logger("warn",e)},_error:function(){var e=Array.prot otype.slice.call(arguments,0);this._logger("error",e)},_logf:function(){return t his._logPrefix.concat(this.is).concat(Array.prototype.slice.call(arguments,0))}} ,Polymer.Base._logPrefix=function(){var e=window.chrome&&!/edge/i.test(navigator .userAgent)||/firefox/i.test(navigator.userAgent);return e?["%c[%s::%s]:","font- weight: bold; background-color:#EEEE00;"]:["[%s::%s]:"]}(),Polymer.Base.chainObj ect=function(e,t){return e&&t&&e!==t&&(Object.__proto__||(e=Polymer.Base.extend( Object.create(t),e)),e.__proto__=t),e},Polymer.Base=Polymer.Base.chainObject(Pol ymer.Base,HTMLElement.prototype),window.CustomElements?Polymer.instanceof=Custom Elements.instanceof:Polymer.instanceof=function(e,t){return e instanceof t},Poly mer.isInstance=function(e){return Boolean(e&&e.__isPolymerInstance__)},Polymer.t elemetry.instanceCount=0}(),function(){function e(){if(s)for(var e,t=document._c urrentScript||document.currentScript,r=t&&t.ownerDocument||document,i=r.querySel ectorAll("dom-module"),o=i.length-1;o>=0&&(e=i[o]);o--){if(e.__upgraded__)return ;CustomElements.upgrade(e)}}var t={},r={},i=function(e){return t[e]||r[e.toLower Case()]},o=function(){return document.createElement("dom-module")};o.prototype=O bject.create(HTMLElement.prototype),Polymer.Base.extend(o.prototype,{constructor :o,createdCallback:function(){this.register()},register:function(e){e=e||this.id ||this.getAttribute("name")||this.getAttribute("is"),e&&(this.id=e,t[e]=this,r[e .toLowerCase()]=this)},import:function(t,r){if(t){var o=i(t);return o||(e(),o=i( t)),o&&r&&(o=o.querySelector(r)),o}}});var s=window.CustomElements&&!CustomEleme nts.useNative;document.registerElement("dom-module",o)}(),Polymer.Base._addFeatu re({_prepIs:function(){if(!this.is){var e=(document._currentScript||document.cur rentScript).parentNode;if("dom-module"===e.localName){var t=e.id||e.getAttribute ("name")||e.getAttribute("is");this.is=t}}this.is&&(this.is=this.is.toLowerCase( ))}}),Polymer.Base._addFeature({behaviors:[],_desugarBehaviors:function(){this.b ehaviors.length&&(this.behaviors=this._desugarSomeBehaviors(this.behaviors))},_d esugarSomeBehaviors:function(e){var t=[];e=this._flattenBehaviorsList(e);for(var r=e.length-1;r>=0;r--){var i=e[r];t.indexOf(i)===-1&&(this._mixinBehavior(i),t. unshift(i))}return t},_flattenBehaviorsList:function(e){for(var t=[],r=0;r<e.len gth;r++){var i=e[r];i instanceof Array?t=t.concat(this._flattenBehaviorsList(i)) :i?t.push(i):this._warn(this._logf("_flattenBehaviorsList","behavior is null, ch eck for missing or 404 import"))}return t},_mixinBehavior:function(e){for(var t, r=Object.getOwnPropertyNames(e),i=0;i<r.length&&(t=r[i]);i++)Polymer.Base._behav iorProperties[t]||this.hasOwnProperty(t)||this.copyOwnProperty(t,e,this)},_prepB ehaviors:function(){this._prepFlattenedBehaviors(this.behaviors)},_prepFlattened Behaviors:function(e){for(var t=0,r=e.length;t<r;t++)this._prepBehavior(e[t]);th is._prepBehavior(this)},_doBehavior:function(e,t){for(var r=0;r<this.behaviors.l ength;r++)this._invokeBehavior(this.behaviors[r],e,t);this._invokeBehavior(this, e,t)},_doBehaviorOnly:function(e,t){for(var r=0;r<this.behaviors.length;r++)this ._invokeBehavior(this.behaviors[r],e,t)},_invokeBehavior:function(e,t,r){var i=e [t];i&&i.apply(this,r||Polymer.nar)},_marshalBehaviors:function(){for(var e=0;e< this.behaviors.length;e++)this._marshalBehavior(this.behaviors[e]);this._marshal Behavior(this)}}),Polymer.Base._behaviorProperties={hostAttributes:!0,beforeRegi ster:!0,registered:!0,properties:!0,observers:!0,listeners:!0,created:!0,attache d:!0,detached:!0,attributeChanged:!0,ready:!0},Polymer.Base._addFeature({_getExt endedPrototype:function(e){return this._getExtendedNativePrototype(e)},_nativePr ototypes:{},_getExtendedNativePrototype:function(e){var t=this._nativePrototypes [e];if(!t){var r=this.getNativePrototype(e);t=this.extend(Object.create(r),Polym er.Base),this._nativePrototypes[e]=t}return t},getNativePrototype:function(e){re turn Object.getPrototypeOf(document.createElement(e))}}),Polymer.Base._addFeatur e({_prepConstructor:function(){this._factoryArgs=this.extends?[this.extends,this .is]:[this.is];var e=function(){return this._factory(arguments)};this.hasOwnProp erty("extends")&&(e.extends=this.extends),Object.defineProperty(this,"constructo r",{value:e,writable:!0,configurable:!0}),e.prototype=this},_factory:function(e) {var t=document.createElement.apply(document,this._factoryArgs);return this.fact oryImpl&&this.factoryImpl.apply(t,e),t}}),Polymer.nob=Object.create(null),Polyme r.Base._addFeature({properties:{},getPropertyInfo:function(e){var t=this._getPro pertyInfo(e,this.properties);if(!t)for(var r=0;r<this.behaviors.length;r++)if(t= this._getPropertyInfo(e,this.behaviors[r].properties))return t;return t||Polymer .nob},_getPropertyInfo:function(e,t){var r=t&&t[e];return"function"==typeof r&&( r=t[e]={type:r}),r&&(r.defined=!0),r},_prepPropertyInfo:function(){this._propert yInfo={};for(var e=0;e<this.behaviors.length;e++)this._addPropertyInfo(this._pro pertyInfo,this.behaviors[e].properties);this._addPropertyInfo(this._propertyInfo ,this.properties),this._addPropertyInfo(this._propertyInfo,this._propertyEffects )},_addPropertyInfo:function(e,t){if(t){var r,i;for(var o in t)r=e[o],i=t[o],("_ "!==o[0]||i.readOnly)&&(e[o]?(r.type||(r.type=i.type),r.readOnly||(r.readOnly=i. readOnly)):e[o]={type:"function"==typeof i?i:i.type,readOnly:i.readOnly,attribut e:Polymer.CaseMap.camelToDashCase(o)})}}}),Polymer.CaseMap={_caseMap:{},_rx:{das hToCamel:/-[a-z]/g,camelToDash:/([A-Z])/g},dashToCamelCase:function(e){return th is._caseMap[e]||(this._caseMap[e]=e.indexOf("-")<0?e:e.replace(this._rx.dashToCa mel,function(e){return e[1].toUpperCase()}))},camelToDashCase:function(e){return this._caseMap[e]||(this._caseMap[e]=e.replace(this._rx.camelToDash,"-$1").toLow erCase())}},Polymer.Base._addFeature({_addHostAttributes:function(e){this._aggre gatedAttributes||(this._aggregatedAttributes={}),e&&this.mixin(this._aggregatedA ttributes,e)},_marshalHostAttributes:function(){this._aggregatedAttributes&&this ._applyAttributes(this,this._aggregatedAttributes)},_applyAttributes:function(e, t){for(var r in t)if(!this.hasAttribute(r)&&"class"!==r){var i=t[r];this.seriali zeValueToAttribute(i,r,this)}},_marshalAttributes:function(){this._takeAttribute sToModel(this)},_takeAttributesToModel:function(e){if(this.hasAttributes())for(v ar t in this._propertyInfo){var r=this._propertyInfo[t];this.hasAttribute(r.attr ibute)&&this._setAttributeToProperty(e,r.attribute,t,r)}},_setAttributeToPropert y:function(e,t,r,i){if(!this._serializing&&(r=r||Polymer.CaseMap.dashToCamelCase (t),i=i||this._propertyInfo&&this._propertyInfo[r],i&&!i.readOnly)){var o=this.g etAttribute(t);e[r]=this.deserialize(o,i.type)}},_serializing:!1,reflectProperty ToAttribute:function(e,t,r){this._serializing=!0,r=void 0===r?this[e]:r,this.ser ializeValueToAttribute(r,t||Polymer.CaseMap.camelToDashCase(e)),this._serializin g=!1},serializeValueToAttribute:function(e,t,r){var i=this.serialize(e);r=r||thi s,void 0===i?r.removeAttribute(t):r.setAttribute(t,i)},deserialize:function(e,t) {switch(t){case Number:e=Number(e);break;case Boolean:e=null!=e;break;case Objec t:try{e=JSON.parse(e)}catch(e){}break;case Array:try{e=JSON.parse(e)}catch(t){e= null,console.warn("Polymer::Attributes: couldn`t decode Array as JSON")}break;ca se Date:e=new Date(e);break;case String:}return e},serialize:function(e){switch( typeof e){case"boolean":return e?"":void 0;case"object":if(e instanceof Date)ret urn e.toString();if(e)try{return JSON.stringify(e)}catch(e){return""}default:ret urn null!=e?e:void 0}}}),Polymer.version="1.6.1",Polymer.Base._addFeature({_regi sterFeatures:function(){this._prepIs(),this._prepBehaviors(),this._prepConstruct or(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHostAttributes (e.hostAttributes)},_marshalBehavior:function(e){},_initFeatures:function(){this ._marshalHostAttributes(),this._marshalBehaviors()}})</script> <script>Polymer.B ase._addFeature({_prepTemplate:function(){void 0===this._template&&(this._templa te=Polymer.DomModule.import(this.is,"template")),this._template&&this._template. hasAttribute("is")&&this._warn(this._logf("_prepTemplate","top-level Polymer tem plate must not be a type-extension, found",this._template,"Move inside simple <t emplate>.")),this._template&&!this._template.content&&window.HTMLTemplateElement &&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(this._template)},_s tampTemplate:function(){this._template&&(this.root=this.instanceTemplate(this._t emplate))},instanceTemplate:function(e){var t=document.importNode(e._content||e. content,!0);return t}}),function(){var e=Polymer.Base.attachedCallback;Polymer.B ase._addFeature({_hostStack:[],ready:function(){},_registerHost:function(e){this .dataHost=e=e||Polymer.Base._hostStack[Polymer.Base._hostStack.length-1],e&&e._c lients&&e._clients.push(this),this._clients=null,this._clientsReadied=!1},_begin Hosting:function(){Polymer.Base._hostStack.push(this),this._clients||(this._clie nts=[])},_endHosting:function(){Polymer.Base._hostStack.pop()},_tryReady:functio n(){this._readied=!1,this._canReady()&&this._ready()},_canReady:function(){retur n!this.dataHost||this.dataHost._clientsReadied},_ready:function(){this._beforeCl ientsReady(),this._template&&(this._setupRoot(),this._readyClients()),this._clie ntsReadied=!0,this._clients=null,this._afterClientsReady(),this._readySelf()},_r eadyClients:function(){this._beginDistribute();var e=this._clients;if(e)for(var t,o=0,i=e.length;o<i&&(t=e[o]);o++)t._ready();this._finishDistribute()},_readySe lf:function(){this._doBehavior("ready"),this._readied=!0,this._attachedPending&& (this._attachedPending=!1,this.attachedCallback())},_beforeClientsReady:function (){},_afterClientsReady:function(){},_beforeAttached:function(){},attachedCallba ck:function(){this._readied?(this._beforeAttached(),e.call(this)):this._attached Pending=!0}})}(),Polymer.ArraySplice=function(){function e(e,t,o){return{index:e ,removed:t,addedCount:o}}function t(){}var o=0,i=1,n=2,s=3;return t.prototype={c alcEditDistances:function(e,t,o,i,n,s){for(var r=s-n+1,d=o-t+1,a=new Array(r),l= 0;l<r;l++)a[l]=new Array(d),a[l][0]=l;for(var h=0;h<d;h++)a[0][h]=h;for(l=1;l<r; l++)for(h=1;h<d;h++)if(this.equals(e[t+h-1],i[n+l-1]))a[l][h]=a[l-1][h-1];else{v ar u=a[l-1][h]+1,c=a[l][h-1]+1;a[l][h]=u<c?u:c}return a},spliceOperationsFromEdi tDistances:function(e){for(var t=e.length-1,r=e[0].length-1,d=e[t][r],a=[];t>0|| r>0;)if(0!=t)if(0!=r){var l,h=e[t-1][r-1],u=e[t-1][r],c=e[t][r-1];l=u<c?u<h?u:h: c<h?c:h,l==h?(h==d?a.push(o):(a.push(i),d=h),t--,r--):l==u?(a.push(s),t--,d=u):( a.push(n),r--,d=c)}else a.push(s),t--;else a.push(n),r--;return a.reverse(),a},c alcSplices:function(t,r,d,a,l,h){var u=0,c=0,_=Math.min(d-r,h-l);if(0==r&&0==l&& (u=this.sharedPrefix(t,a,_)),d==t.length&&h==a.length&&(c=this.sharedSuffix(t,a, _-u)),r+=u,l+=u,d-=c,h-=c,d-r==0&&h-l==0)return[];if(r==d){for(var f=e(r,[],0);l <h;)f.removed.push(a[l++]);return[f]}if(l==h)return[e(r,[],d-r)];var m=this.spli ceOperationsFromEditDistances(this.calcEditDistances(t,r,d,a,l,h));f=void 0;for( var p=[],v=r,g=l,b=0;b<m.length;b++)switch(m[b]){case o:f&&(p.push(f),f=void 0), v++,g++;break;case i:f||(f=e(v,[],0)),f.addedCount++,v++,f.removed.push(a[g]),g+ +;break;case n:f||(f=e(v,[],0)),f.addedCount++,v++;break;case s:f||(f=e(v,[],0)) ,f.removed.push(a[g]),g++}return f&&p.push(f),p},sharedPrefix:function(e,t,o){fo r(var i=0;i<o;i++)if(!this.equals(e[i],t[i]))return i;return o},sharedSuffix:fun ction(e,t,o){for(var i=e.length,n=t.length,s=0;s<o&&this.equals(e[--i],t[--n]);) s++;return s},calculateSplices:function(e,t){return this.calcSplices(e,0,e.lengt h,t,0,t.length)},equals:function(e,t){return e===t}},new t}(),Polymer.domInnerHT ML=function(){function e(e){switch(e){case"&":return"&amp;";case"<":return"&lt;" ;case">":return"&gt;";case'"':return"&quot;";case" ":return"&nbsp;"}}function t( t){return t.replace(r,e)}function o(t){return t.replace(d,e)}function i(e){for(v ar t={},o=0;o<e.length;o++)t[e[o]]=!0;return t}function n(e,i,n){switch(e.nodeTy pe){case Node.ELEMENT_NODE:for(var r,d=e.localName,h="<"+d,u=e.attributes,c=0;r= u[c];c++)h+=" "+r.name+'="'+t(r.value)+'"';return h+=">",a[d]?h:h+s(e,n)+"</"+d+ ">";case Node.TEXT_NODE:var _=e.data;return i&&l[i.localName]?_:o(_);case Node.C OMMENT_NODE:return"\x3c!--"+e.data+"--\x3e";default:throw console.error(e),new E rror("not implemented")}}function s(e,t){e instanceof HTMLTemplateElement&&(e=e. content);for(var o,i="",s=Polymer.dom(e).childNodes,r=0,d=s.length;r<d&&(o=s[r]) ;r++)i+=n(o,e,t);return i}var r=/[&\u00A0"]/g,d=/[&\u00A0<>]/g,a=i(["area","base ","br","col","command","embed","hr","img","input","keygen","link","meta","param" ,"source","track","wbr"]),l=i(["style","script","xmp","iframe","noembed","nofram es","plaintext","noscript"]);return{getInnerHTML:s}}(),function(){"use strict";v ar e=Element.prototype.insertBefore,t=Element.prototype.appendChild,o=Element.pr ototype.removeChild;Polymer.TreeApi={arrayCopyChildNodes:function(e){for(var t=[ ],o=0,i=e.firstChild;i;i=i.nextSibling)t[o++]=i;return t},arrayCopyChildren:func tion(e){for(var t=[],o=0,i=e.firstElementChild;i;i=i.nextElementSibling)t[o++]=i ;return t},arrayCopy:function(e){for(var t=e.length,o=new Array(t),i=0;i<t;i++)o [i]=e[i];return o}},Polymer.TreeApi.Logical={hasParentNode:function(e){return Bo olean(e.__dom&&e.__dom.parentNode)},hasChildNodes:function(e){return Boolean(e._ _dom&&void 0!==e.__dom.childNodes)},getChildNodes:function(e){return this.hasChi ldNodes(e)?this._getChildNodes(e):e.childNodes},_getChildNodes:function(e){if(!e .__dom.childNodes){e.__dom.childNodes=[];for(var t=e.__dom.firstChild;t;t=t.__do m.nextSibling)e.__dom.childNodes.push(t)}return e.__dom.childNodes},getParentNod e:function(e){return e.__dom&&void 0!==e.__dom.parentNode?e.__dom.parentNode:e.p arentNode},getFirstChild:function(e){return e.__dom&&void 0!==e.__dom.firstChild ?e.__dom.firstChild:e.firstChild},getLastChild:function(e){return e.__dom&&void 0!==e.__dom.lastChild?e.__dom.lastChild:e.lastChild},getNextSibling:function(e){ return e.__dom&&void 0!==e.__dom.nextSibling?e.__dom.nextSibling:e.nextSibling}, getPreviousSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling? e.__dom.previousSibling:e.previousSibling},getFirstElementChild:function(e){retu rn e.__dom&&void 0!==e.__dom.firstChild?this._getFirstElementChild(e):e.firstEle mentChild},_getFirstElementChild:function(e){for(var t=e.__dom.firstChild;t&&t.n odeType!==Node.ELEMENT_NODE;)t=t.__dom.nextSibling;return t},getLastElementChild :function(e){return e.__dom&&void 0!==e.__dom.lastChild?this._getLastElementChil d(e):e.lastElementChild},_getLastElementChild:function(e){for(var t=e.__dom.last Child;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},get NextElementSibling:function(e){return e.__dom&&void 0!==e.__dom.nextSibling?this ._getNextElementSibling(e):e.nextElementSibling},_getNextElementSibling:function (e){for(var t=e.__dom.nextSibling;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.n extSibling;return t},getPreviousElementSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling?this._getPreviousElementSibling(e):e.previousElement Sibling},_getPreviousElementSibling:function(e){for(var t=e.__dom.previousSiblin g;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},saveChi ldNodes:function(e){if(!this.hasChildNodes(e)){e.__dom=e.__dom||{},e.__dom.first Child=e.firstChild,e.__dom.lastChild=e.lastChild,e.__dom.childNodes=[];for(var t =e.firstChild;t;t=t.nextSibling)t.__dom=t.__dom||{},t.__dom.parentNode=e,e.__dom .childNodes.push(t),t.__dom.nextSibling=t.nextSibling,t.__dom.previousSibling=t. previousSibling}},recordInsertBefore:function(e,t,o){if(t.__dom.childNodes=null, e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(var i=e.firstChild;i;i=i.nextSiblin g)this._linkNode(i,t,o);else this._linkNode(e,t,o)},_linkNode:function(e,t,o){e. __dom=e.__dom||{},t.__dom=t.__dom||{},o&&(o.__dom=o.__dom||{}),e.__dom.previousS ibling=o?o.__dom.previousSibling:t.__dom.lastChild,e.__dom.previousSibling&&(e._ _dom.previousSibling.__dom.nextSibling=e),e.__dom.nextSibling=o||null,e.__dom.ne xtSibling&&(e.__dom.nextSibling.__dom.previousSibling=e),e.__dom.parentNode=t,o? o===t.__dom.firstChild&&(t.__dom.firstChild=e):(t.__dom.lastChild=e,t.__dom.firs tChild||(t.__dom.firstChild=e)),t.__dom.childNodes=null},recordRemoveChild:funct ion(e,t){e.__dom=e.__dom||{},t.__dom=t.__dom||{},e===t.__dom.firstChild&&(t.__do m.firstChild=e.__dom.nextSibling),e===t.__dom.lastChild&&(t.__dom.lastChild=e.__ dom.previousSibling);var o=e.__dom.previousSibling,i=e.__dom.nextSibling;o&&(o._ _dom.nextSibling=i),i&&(i.__dom.previousSibling=o),e.__dom.parentNode=e.__dom.pr eviousSibling=e.__dom.nextSibling=void 0,t.__dom.childNodes=null}},Polymer.TreeA pi.Composed={getChildNodes:function(e){return Polymer.TreeApi.arrayCopyChildNode s(e)},getParentNode:function(e){return e.parentNode},clearChildNodes:function(e) {e.textContent=""},insertBefore:function(t,o,i){return e.call(t,o,i||null)},appe ndChild:function(e,o){return t.call(e,o)},removeChild:function(e,t){return o.cal l(e,t)}}}(),Polymer.DomApi=function(){"use strict";var e=Polymer.Settings,t=Poly mer.TreeApi,o=function(e){this.node=i?o.wrap(e):e},i=e.hasShadow&&!e.nativeShado w;o.wrap=window.wrap?window.wrap:function(e){return e},o.prototype={flush:functi on(){Polymer.dom.flush()},deepContains:function(e){if(this.node.contains(e))retu rn!0;for(var t=e,o=e.ownerDocument;t&&t!==o&&t!==this.node;)t=Polymer.dom(t).par entNode||t.host;return t===this.node},queryDistributedElements:function(e){for(v ar t,i=this.getEffectiveChildNodes(),n=[],s=0,r=i.length;s<r&&(t=i[s]);s++)t.nod eType===Node.ELEMENT_NODE&&o.matchesSelector.call(t,e)&&n.push(t);return n},getE ffectiveChildNodes:function(){for(var e,t=[],o=this.childNodes,i=0,r=o.length;i< r&&(e=o[i]);i++)if(e.localName===n)for(var d=s(e).getDistributedNodes(),a=0;a<d. length;a++)t.push(d[a]);else t.push(e);return t},observeNodes:function(e){if(e)r eturn this.observer||(this.observer=this.node.localName===n?new o.DistributedNod esObserver(this):new o.EffectiveNodesObserver(this)),this.observer.addListener(e )},unobserveNodes:function(e){this.observer&&this.observer.removeListener(e)},no tifyObserver:function(){this.observer&&this.observer.notify()},_query:function(e ,o,i){o=o||this.node;var n=[];return this._queryElements(t.Logical.getChildNodes (o),e,i,n),n},_queryElements:function(e,t,o,i){for(var n,s=0,r=e.length;s<r&&(n= e[s]);s++)if(n.nodeType===Node.ELEMENT_NODE&&this._queryElement(n,t,o,i))return! 0},_queryElement:function(e,o,i,n){var s=o(e);return s&&n.push(e),i&&i(s)?s:void this._queryElements(t.Logical.getChildNodes(e),o,i,n)}};var n=o.CONTENT="conten t",s=o.factory=function(e){return e=e||document,e.__domApi||(e.__domApi=new o.ct or(e)),e.__domApi};o.hasApi=function(e){return Boolean(e.__domApi)},o.ctor=o,Pol ymer.dom=function(e,t){return e instanceof Event?Polymer.EventApi.factory(e):o.f actory(e,t)};var r=Element.prototype;return o.matchesSelector=r.matches||r.match esSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.web kitMatchesSelector,o}(),function(){"use strict";var e=Polymer.Settings,t=Polymer .DomApi,o=t.factory,i=Polymer.TreeApi,n=Polymer.domInnerHTML.getInnerHTML,s=t.CO NTENT;if(!e.useShadow){var r=Element.prototype.cloneNode,d=Document.prototype.im portNode;Polymer.Base.extend(t.prototype,{_lazyDistribute:function(e){e.shadyRoo t&&e.shadyRoot._distributionClean&&(e.shadyRoot._distributionClean=!1,Polymer.do m.addDebouncer(e.debounce("_distribute",e._distributeContent)))},appendChild:fun ction(e){return this.insertBefore(e)},insertBefore:function(e,n){if(n&&i.Logical .getParentNode(n)!==this.node)throw Error("The ref_node to be inserted before is not a child of this node");if(e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var r=i .Logical.getParentNode(e);r?(t.hasApi(r)&&o(r).notifyObserver(),this._removeNode (e)):this._removeOwnerShadyRoot(e)}if(!this._addNode(e,n)){n&&(n=n.localName===s ?this._firstComposedNode(n):n);var d=this.node._isShadyRoot?this.node.host:this. node;n?i.Composed.insertBefore(d,e,n):i.Composed.appendChild(d,e)}return this.no tifyObserver(),e},_addNode:function(e,t){var o=this.getOwnerRoot();if(o){var n=t his._maybeAddInsertionPoint(e,this.node);o._invalidInsertionPoints||(o._invalidI nsertionPoints=n),this._addNodeToHost(o.host,e)}i.Logical.hasChildNodes(this.nod e)&&i.Logical.recordInsertBefore(e,this.node,t);var s=this._maybeDistribute(e)|| this.node.shadyRoot;if(s)if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(;e.firs tChild;)i.Composed.removeChild(e,e.firstChild);else{var r=i.Composed.getParentNo de(e);r&&i.Composed.removeChild(r,e)}return s},removeChild:function(e){if(i.Logi cal.getParentNode(e)!==this.node)throw Error("The node to be removed is not a ch ild of this node: "+e);if(!this._removeNode(e)){var t=this.node._isShadyRoot?thi s.node.host:this.node,o=i.Composed.getParentNode(e);t===o&&i.Composed.removeChil d(t,e)}return this.notifyObserver(),e},_removeNode:function(e){var t,n=i.Logical .hasParentNode(e)&&i.Logical.getParentNode(e),s=this._ownerShadyRootForNode(e);r eturn n&&(t=o(e)._maybeDistributeParent(),i.Logical.recordRemoveChild(e,n),s&&th is._removeDistributedChildren(s,e)&&(s._invalidInsertionPoints=!0,this._lazyDist ribute(s.host))),this._removeOwnerShadyRoot(e),s&&this._removeNodeFromHost(s.hos t,e),t},replaceChild:function(e,t){return this.insertBefore(e,t),this.removeChil d(t),e},_hasCachedOwnerRoot:function(e){return Boolean(void 0!==e._ownerShadyRoo t)},getOwnerRoot:function(){return this._ownerShadyRootForNode(this.node)},_owne rShadyRootForNode:function(e){if(e){var t=e._ownerShadyRoot;if(void 0===t){if(e. _isShadyRoot)t=e;else{var o=i.Logical.getParentNode(e);t=o?o._isShadyRoot?o:this ._ownerShadyRootForNode(o):null}(t||document.documentElement.contains(e))&&(e._o wnerShadyRoot=t)}return t}},_maybeDistribute:function(e){var t=e.nodeType===Node .DOCUMENT_FRAGMENT_NODE&&!e.__noContent&&o(e).querySelector(s),n=t&&i.Logical.ge tParentNode(t).nodeType!==Node.DOCUMENT_FRAGMENT_NODE,r=t||e.localName===s;if(r) {var d=this.getOwnerRoot();d&&this._lazyDistribute(d.host)}var a=this._nodeNeeds Distribution(this.node);return a&&this._lazyDistribute(this.node),a||r&&!n},_may beAddInsertionPoint:function(e,t){var n;if(e.nodeType!==Node.DOCUMENT_FRAGMENT_N ODE||e.__noContent)e.localName===s&&(i.Logical.saveChildNodes(t),i.Logical.saveC hildNodes(e),n=!0);else for(var r,d,a,l=o(e).querySelectorAll(s),h=0;h<l.length& &(r=l[h]);h++)d=i.Logical.getParentNode(r),d===e&&(d=t),a=this._maybeAddInsertio nPoint(r,d),n=n||a;return n},_updateInsertionPoints:function(e){for(var t,n=e.sh adyRoot._insertionPoints=o(e.shadyRoot).querySelectorAll(s),r=0;r<n.length;r++)t =n[r],i.Logical.saveChildNodes(t),i.Logical.saveChildNodes(i.Logical.getParentNo de(t))},_nodeNeedsDistribution:function(e){return e&&e.shadyRoot&&t.hasInsertion Point(e.shadyRoot)},_addNodeToHost:function(e,t){e._elementAdd&&e._elementAdd(t) },_removeNodeFromHost:function(e,t){e._elementRemove&&e._elementRemove(t)},_remo veDistributedChildren:function(e,t){for(var n,s=e._insertionPoints,r=0;r<s.lengt h;r++){var d=s[r];if(this._contains(t,d))for(var a=o(d).getDistributedNodes(),l= 0;l<a.length;l++){n=!0;var h=a[l],u=i.Composed.getParentNode(h);u&&i.Composed.re moveChild(u,h)}}return n},_contains:function(e,t){for(;t;){if(t==e)return!0;t=i. Logical.getParentNode(t)}},_removeOwnerShadyRoot:function(e){if(this._hasCachedO wnerRoot(e))for(var t,o=i.Logical.getChildNodes(e),n=0,s=o.length;n<s&&(t=o[n]); n++)this._removeOwnerShadyRoot(t);e._ownerShadyRoot=void 0},_firstComposedNode:f unction(e){for(var t,i,n=o(e).getDistributedNodes(),s=0,r=n.length;s<r&&(t=n[s]) ;s++)if(i=o(t).getDestinationInsertionPoints(),i[i.length-1]===e)return t},query Selector:function(e){var o=this._query(function(o){return t.matchesSelector.call (o,e)},this.node,function(e){return Boolean(e)})[0];return o||null},querySelecto rAll:function(e){return this._query(function(o){return t.matchesSelector.call(o, e)},this.node)},getDestinationInsertionPoints:function(){return this.node._desti nationInsertionPoints||[]},getDistributedNodes:function(){return this.node._dist ributedNodes||[]},_clear:function(){for(;this.childNodes.length;)this.removeChil d(this.childNodes[0])},setAttribute:function(e,t){this.node.setAttribute(e,t),th is._maybeDistributeParent()},removeAttribute:function(e){this.node.removeAttribu te(e),this._maybeDistributeParent()},_maybeDistributeParent:function(){if(this._ nodeNeedsDistribution(this.parentNode))return this._lazyDistribute(this.parentNo de),!0},cloneNode:function(e){var t=r.call(this.node,!1);if(e)for(var i,n=this.c hildNodes,s=o(t),d=0;d<n.length;d++)i=o(n[d]).cloneNode(!0),s.appendChild(i);ret urn t},importNode:function(e,t){var n=this.node instanceof Document?this.node:th is.node.ownerDocument,s=d.call(n,e,!1);if(t)for(var r,a=i.Logical.getChildNodes( e),l=o(s),h=0;h<a.length;h++)r=o(n).importNode(a[h],!0),l.appendChild(r);return s},_getComposedInnerHTML:function(){return n(this.node,!0)}}),Object.definePrope rties(t.prototype,{activeElement:{get:function(){var e=document.activeElement;if (!e)return null;var t=!!this.node._isShadyRoot;if(this.node!==document){if(!t)re turn null;if(this.node.host===e||!this.node.host.contains(e))return null}for(var i=o(e).getOwnerRoot();i&&i!==this.node;)e=i.host,i=o(e).getOwnerRoot();return t his.node===document?i?null:e:i===this.node?e:null},configurable:!0},childNodes:{ get:function(){var e=i.Logical.getChildNodes(this.node);return Array.isArray(e)? e:i.arrayCopyChildNodes(this.node)},configurable:!0},children:{get:function(){re turn i.Logical.hasChildNodes(this.node)?Array.prototype.filter.call(this.childNo des,function(e){return e.nodeType===Node.ELEMENT_NODE}):i.arrayCopyChildren(this .node)},configurable:!0},parentNode:{get:function(){return i.Logical.getParentNo de(this.node)},configurable:!0},firstChild:{get:function(){return i.Logical.getF irstChild(this.node)},configurable:!0},lastChild:{get:function(){return i.Logica l.getLastChild(this.node)},configurable:!0},nextSibling:{get:function(){return i .Logical.getNextSibling(this.node)},configurable:!0},previousSibling:{get:functi on(){return i.Logical.getPreviousSibling(this.node)},configurable:!0},firstEleme ntChild:{get:function(){return i.Logical.getFirstElementChild(this.node)},config urable:!0},lastElementChild:{get:function(){return i.Logical.getLastElementChild (this.node)},configurable:!0},nextElementSibling:{get:function(){return i.Logica l.getNextElementSibling(this.node)},configurable:!0},previousElementSibling:{get :function(){return i.Logical.getPreviousElementSibling(this.node)},configurable: !0},textContent:{get:function(){var e=this.node.nodeType;if(e===Node.TEXT_NODE|| e===Node.COMMENT_NODE)return this.node.textContent;for(var t,o=[],i=0,n=this.chi ldNodes;t=n[i];i++)t.nodeType!==Node.COMMENT_NODE&&o.push(t.textContent);return o.join("")},set:function(e){var t=this.node.nodeType;t===Node.TEXT_NODE||t===Nod e.COMMENT_NODE?this.node.textContent=e:(this._clear(),e&&this.appendChild(docume nt.createTextNode(e)))},configurable:!0},innerHTML:{get:function(){var e=this.no de.nodeType;return e===Node.TEXT_NODE||e===Node.COMMENT_NODE?null:n(this.node)}, set:function(e){var t=this.node.nodeType;if(t!==Node.TEXT_NODE||t!==Node.COMMENT _NODE){this._clear();var o=document.createElement("div");o.innerHTML=e;for(var n =i.arrayCopyChildNodes(o),s=0;s<n.length;s++)this.appendChild(n[s])}},configurab le:!0}}),t.hasInsertionPoint=function(e){return Boolean(e&&e._insertionPoints.le ngth)}}}(),function(){"use strict";var e=Polymer.Settings,t=Polymer.TreeApi,o=Po lymer.DomApi;if(e.useShadow){Polymer.Base.extend(o.prototype,{querySelectorAll:f unction(e){return t.arrayCopy(this.node.querySelectorAll(e))},getOwnerRoot:funct ion(){for(var e=this.node;e;){if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.hos t)return e;e=e.parentNode}},importNode:function(e,t){var o=this.node instanceof Document?this.node:this.node.ownerDocument;return o.importNode(e,t)},getDestinat ionInsertionPoints:function(){var e=this.node.getDestinationInsertionPoints&&thi s.node.getDestinationInsertionPoints();return e?t.arrayCopy(e):[]},getDistribute dNodes:function(){var e=this.node.getDistributedNodes&&this.node.getDistributedN odes();return e?t.arrayCopy(e):[]}}),Object.defineProperties(o.prototype,{active Element:{get:function(){var e=o.wrap(this.node),t=e.activeElement;return e.conta ins(t)?t:null},configurable:!0},childNodes:{get:function(){return t.arrayCopyChi ldNodes(this.node)},configurable:!0},children:{get:function(){return t.arrayCopy Children(this.node)},configurable:!0},textContent:{get:function(){return this.no de.textContent},set:function(e){return this.node.textContent=e},configurable:!0} ,innerHTML:{get:function(){return this.node.innerHTML},set:function(e){return th is.node.innerHTML=e},configurable:!0}});var i=function(e){for(var t=0;t<e.length ;t++)n(e[t])},n=function(e){o.prototype[e]=function(){return this.node[e].apply( this.node,arguments)}};i(["cloneNode","appendChild","insertBefore","removeChild" ,"replaceChild","setAttribute","removeAttribute","querySelector"]);var s=functio n(e){for(var t=0;t<e.length;t++)r(e[t])},r=function(e){Object.defineProperty(o.p rototype,e,{get:function(){return this.node[e]},configurable:!0})};s(["parentNod e","firstChild","lastChild","nextSibling","previousSibling","firstElementChild", "lastElementChild","nextElementSibling","previousElementSibling"])}}(),Polymer.B ase.extend(Polymer.dom,{_flushGuard:0,_FLUSH_MAX:100,_needsTakeRecords:!Polymer. Settings.useNativeCustomElements,_debouncers:[],_staticFlushList:[],_finishDebou ncer:null,flush:function(){for(this._flushGuard=0,this._prepareFlush();this._deb ouncers.length&&this._flushGuard<this._FLUSH_MAX;){for(;this._debouncers.length; )this._debouncers.shift().complete();this._finishDebouncer&&this._finishDebounce r.complete(),this._prepareFlush(),this._flushGuard++}this._flushGuard>=this._FLU SH_MAX&&console.warn("Polymer.dom.flush aborted. Flush may not be complete.")},_ prepareFlush:function(){this._needsTakeRecords&&CustomElements.takeRecords();for (var e=0;e<this._staticFlushList.length;e++)this._staticFlushList[e]()},addStati cFlush:function(e){this._staticFlushList.push(e)},removeStaticFlush:function(e){ var t=this._staticFlushList.indexOf(e);t>=0&&this._staticFlushList.splice(t,1)}, addDebouncer:function(e){this._debouncers.push(e),this._finishDebouncer=Polymer. Debounce(this._finishDebouncer,this._finishFlush)},_finishFlush:function(){Polym er.dom._debouncers=[]}}),Polymer.EventApi=function(){"use strict";var e=Polymer. DomApi.ctor,t=Polymer.Settings;e.Event=function(e){this.event=e},t.useShadow?e.E vent.prototype={get rootTarget(){return this.event.path[0]},get localTarget(){re turn this.event.target},get path(){var e=this.event.path;return Array.isArray(e) ||(e=Array.prototype.slice.call(e)),e}}:e.Event.prototype={get rootTarget(){retu rn this.event.target},get localTarget(){for(var e=this.event.currentTarget,t=e&& Polymer.dom(e).getOwnerRoot(),o=this.path,i=0;i<o.length;i++)if(Polymer.dom(o[i] ).getOwnerRoot()===t)return o[i]},get path(){if(!this.event._path){for(var e=[], t=this.rootTarget;t;){e.push(t);var o=Polymer.dom(t).getDestinationInsertionPoin ts();if(o.length){for(var i=0;i<o.length-1;i++)e.push(o[i]);t=o[o.length-1]}else t=Polymer.dom(t).parentNode||t.host}e.push(window),this.event._path=e}return th is.event._path}};var o=function(t){return t.__eventApi||(t.__eventApi=new e.Even t(t)),t.__eventApi};return{factory:o}}(),function(){"use strict";var e=Polymer.D omApi.ctor,t=Polymer.Settings.useShadow;Object.defineProperty(e.prototype,"class List",{get:function(){return this._classList||(this._classList=new e.ClassList(t his)),this._classList},configurable:!0}),e.ClassList=function(e){this.domApi=e,t his.node=e.node},e.ClassList.prototype={add:function(){this.node.classList.add.a pply(this.node.classList,arguments),this._distributeParent()},remove:function(){ this.node.classList.remove.apply(this.node.classList,arguments),this._distribute Parent()},toggle:function(){this.node.classList.toggle.apply(this.node.classList ,arguments),this._distributeParent()},_distributeParent:function(){t||this.domAp i._maybeDistributeParent()},contains:function(){return this.node.classList.conta ins.apply(this.node.classList,arguments)}}}(),function(){"use strict";var e=Poly mer.DomApi.ctor,t=Polymer.Settings;if(e.EffectiveNodesObserver=function(e){this. domApi=e,this.node=this.domApi.node,this._listeners=[]},e.EffectiveNodesObserver .prototype={addListener:function(e){this._isSetup||(this._setup(),this._isSetup= !0);var t={fn:e,_nodes:[]};return this._listeners.push(t),this._scheduleNotify() ,t},removeListener:function(e){var t=this._listeners.indexOf(e);t>=0&&(this._lis teners.splice(t,1),e._nodes=[]),this._hasListeners()||(this._cleanup(),this._isS etup=!1)},_setup:function(){this._observeContentElements(this.domApi.childNodes) },_cleanup:function(){this._unobserveContentElements(this.domApi.childNodes)},_h asListeners:function(){return Boolean(this._listeners.length)},_scheduleNotify:f unction(){this._debouncer&&this._debouncer.stop(),this._debouncer=Polymer.Deboun ce(this._debouncer,this._notify),this._debouncer.context=this,Polymer.dom.addDeb ouncer(this._debouncer)},notify:function(){this._hasListeners()&&this._scheduleN otify()},_notify:function(){this._beforeCallListeners(),this._callListeners()},_ beforeCallListeners:function(){this._updateContentElements()},_updateContentElem ents:function(){this._observeContentElements(this.domApi.childNodes)},_observeCo ntentElements:function(e){for(var t,o=0;o<e.length&&(t=e[o]);o++)this._isContent (t)&&(t.__observeNodesMap=t.__observeNodesMap||new WeakMap,t.__observeNodesMap.h as(this)||t.__observeNodesMap.set(this,this._observeContent(t)))},_observeConten t:function(e){var t=this,o=Polymer.dom(e).observeNodes(function(){t._scheduleNot ify()});return o._avoidChangeCalculation=!0,o},_unobserveContentElements:functio n(e){for(var t,o,i=0;i<e.length&&(t=e[i]);i++)this._isContent(t)&&(o=t.__observe NodesMap.get(this),o&&(Polymer.dom(t).unobserveNodes(o),t.__observeNodesMap.dele te(this)))},_isContent:function(e){return"content"===e.localName},_callListeners :function(){for(var e,t=this._listeners,o=this._getEffectiveNodes(),i=0;i<t.leng th&&(e=t[i]);i++){var n=this._generateListenerInfo(e,o);(n||e._alwaysNotify)&&th is._callListener(e,n)}},_getEffectiveNodes:function(){return this.domApi.getEffe ctiveChildNodes()},_generateListenerInfo:function(e,t){if(e._avoidChangeCalculat ion)return!0;for(var o,i=e._nodes,n={target:this.node,addedNodes:[],removedNodes :[]},s=Polymer.ArraySplice.calculateSplices(t,i),r=0;r<s.length&&(o=s[r]);r++)fo r(var d,a=0;a<o.removed.length&&(d=o.removed[a]);a++)n.removedNodes.push(d);for( r=0,o;r<s.length&&(o=s[r]);r++)for(a=o.index;a<o.index+o.addedCount;a++)n.addedN odes.push(t[a]);return e._nodes=t,n.addedNodes.length||n.removedNodes.length?n:v oid 0},_callListener:function(e,t){return e.fn.call(this.node,t)},enableShadowAt tributeTracking:function(){}},t.useShadow){var o=e.EffectiveNodesObserver.protot ype._setup,i=e.EffectiveNodesObserver.prototype._cleanup;Polymer.Base.extend(e.E ffectiveNodesObserver.prototype,{_setup:function(){if(!this._observer){var e=thi s;this._mutationHandler=function(t){t&&t.length&&e._scheduleNotify()},this._obse rver=new MutationObserver(this._mutationHandler),this._boundFlush=function(){e._ flush()},Polymer.dom.addStaticFlush(this._boundFlush),this._observer.observe(thi s.node,{childList:!0})}o.call(this)},_cleanup:function(){this._observer.disconne ct(),this._observer=null,this._mutationHandler=null,Polymer.dom.removeStaticFlus h(this._boundFlush),i.call(this)},_flush:function(){this._observer&&this._mutati onHandler(this._observer.takeRecords())},enableShadowAttributeTracking:function( ){if(this._observer){this._makeContentListenersAlwaysNotify(),this._observer.dis connect(),this._observer.observe(this.node,{childList:!0,attributes:!0,subtree:! 0});var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).observer&&Pol ymer.dom(t).observer.enableShadowAttributeTracking()}},_makeContentListenersAlwa ysNotify:function(){for(var e,t=0;t<this._listeners.length;t++)e=this._listeners [t],e._alwaysNotify=e._isContentListener}})}}(),function(){"use strict";var e=Po lymer.DomApi.ctor,t=Polymer.Settings;e.DistributedNodesObserver=function(t){e.Ef fectiveNodesObserver.call(this,t)},e.DistributedNodesObserver.prototype=Object.c reate(e.EffectiveNodesObserver.prototype),Polymer.Base.extend(e.DistributedNodes Observer.prototype,{_setup:function(){},_cleanup:function(){},_beforeCallListene rs:function(){},_getEffectiveNodes:function(){return this.domApi.getDistributedN odes()}}),t.useShadow&&Polymer.Base.extend(e.DistributedNodesObserver.prototype, {_setup:function(){if(!this._observer){var e=this.domApi.getOwnerRoot(),t=e&&e.h ost;if(t){var o=this;this._observer=Polymer.dom(t).observeNodes(function(){o._sc heduleNotify()}),this._observer._isContentListener=!0,this._hasAttrSelect()&&Pol ymer.dom(t).observer.enableShadowAttributeTracking()}}},_hasAttrSelect:function( ){var e=this.node.getAttribute("select");return e&&e.match(/[[.]+/)},_cleanup:fu nction(){var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).unobserv eNodes(this._observer),this._observer=null}})}(),function(){function e(e,t){t._d istributedNodes.push(e);var o=e._destinationInsertionPoints;o?o.push(t):e._desti nationInsertionPoints=[t]}function t(e){var t=e._distributedNodes;if(t)for(var o =0;o<t.length;o++){var i=t[o]._destinationInsertionPoints;i&&i.splice(i.indexOf( e)+1,i.length)}}function o(e,t){var o=u.Logical.getParentNode(e);o&&o.shadyRoot& &h.hasInsertionPoint(o.shadyRoot)&&o.shadyRoot._distributionClean&&(o.shadyRoot. _distributionClean=!1,t.shadyRoot._dirtyRoots.push(o))}function i(e,t){var o=t._ destinationInsertionPoints;return o&&o[o.length-1]===e}function n(e){return"cont ent"==e.localName}function s(e){for(;e&&r(e);)e=e.domHost;return e}function r(e) {for(var t,o=u.Logical.getChildNodes(e),i=0;i<o.length;i++)if(t=o[i],t.localName &&"content"===t.localName)return e.domHost}function d(e){for(var t,o=0;o<e._inse rtionPoints.length;o++)t=e._insertionPoints[o],h.hasApi(t)&&Polymer.dom(t).notif yObserver()}function a(e){h.hasApi(e)&&Polymer.dom(e).notifyObserver()}function l(e){if(c&&e)for(var t=0;t<e.length;t++)CustomElements.upgrade(e[t])}var h=Polym er.DomApi,u=Polymer.TreeApi;Polymer.Base._addFeature({_prepShady:function(){this ._useContent=this._useContent||Boolean(this._template)},_setupShady:function(){t his.shadyRoot=null,this.__domApi||(this.__domApi=null),this.__dom||(this.__dom=n ull),this._ownerShadyRoot||(this._ownerShadyRoot=void 0)},_poolContent:function( ){this._useContent&&u.Logical.saveChildNodes(this)},_setupRoot:function(){this._ useContent&&(this._createLocalRoot(),this.dataHost||l(u.Logical.getChildNodes(th is)))},_createLocalRoot:function(){this.shadyRoot=this.root,this.shadyRoot._dist ributionClean=!1,this.shadyRoot._hasDistributed=!1,this.shadyRoot._isShadyRoot=! 0,this.shadyRoot._dirtyRoots=[];var e=this.shadyRoot._insertionPoints=!this._not es||this._notes._hasContent?this.shadyRoot.querySelectorAll("content"):[];u.Logi cal.saveChildNodes(this.shadyRoot);for(var t,o=0;o<e.length;o++)t=e[o],u.Logical .saveChildNodes(t),u.Logical.saveChildNodes(t.parentNode);this.shadyRoot.host=th is},get domHost(){var e=Polymer.dom(this).getOwnerRoot();return e&&e.host},distr ibuteContent:function(e){if(this.shadyRoot){this.shadyRoot._invalidInsertionPoin ts=this.shadyRoot._invalidInsertionPoints||e;var t=s(this);Polymer.dom(this)._la zyDistribute(t)}},_distributeContent:function(){this._useContent&&!this.shadyRoo t._distributionClean&&(this.shadyRoot._invalidInsertionPoints&&(Polymer.dom(this )._updateInsertionPoints(this),this.shadyRoot._invalidInsertionPoints=!1),this._ beginDistribute(),this._distributeDirtyRoots(),this._finishDistribute())},_begin Distribute:function(){this._useContent&&h.hasInsertionPoint(this.shadyRoot)&&(th is._resetDistribution(),this._distributePool(this.shadyRoot,this._collectPool()) );
2 },_distributeDirtyRoots:function(){for(var e,t=this.shadyRoot._dirtyRoots,o=0,i= t.length;o<i&&(e=t[o]);o++)e._distributeContent();this.shadyRoot._dirtyRoots=[]} ,_finishDistribute:function(){if(this._useContent){if(this.shadyRoot._distributi onClean=!0,h.hasInsertionPoint(this.shadyRoot))this._composeTree(),d(this.shadyR oot);else if(this.shadyRoot._hasDistributed){var e=this._composeNode(this);this. _updateChildNodes(this,e)}else u.Composed.clearChildNodes(this),this.appendChild (this.shadyRoot);this.shadyRoot._hasDistributed||a(this),this.shadyRoot._hasDist ributed=!0}},elementMatches:function(e,t){return t=t||this,h.matchesSelector.cal l(t,e)},_resetDistribution:function(){for(var e=u.Logical.getChildNodes(this),o= 0;o<e.length;o++){var i=e[o];i._destinationInsertionPoints&&(i._destinationInser tionPoints=void 0),n(i)&&t(i)}for(var s=this.shadyRoot,r=s._insertionPoints,d=0; d<r.length;d++)r[d]._distributedNodes=[]},_collectPool:function(){for(var e=[],t =u.Logical.getChildNodes(this),o=0;o<t.length;o++){var i=t[o];n(i)?e.push.apply( e,i._distributedNodes):e.push(i)}return e},_distributePool:function(e,t){for(var i,n=e._insertionPoints,s=0,r=n.length;s<r&&(i=n[s]);s++)this._distributeInserti onPoint(i,t),o(i,this)},_distributeInsertionPoint:function(t,o){for(var i,n=!1,s =0,r=o.length;s<r;s++)i=o[s],i&&this._matchesContentSelect(i,t)&&(e(i,t),o[s]=vo id 0,n=!0);if(!n)for(var d=u.Logical.getChildNodes(t),a=0;a<d.length;a++)e(d[a], t)},_composeTree:function(){this._updateChildNodes(this,this._composeNode(this)) ;for(var e,t,o=this.shadyRoot._insertionPoints,i=0,n=o.length;i<n&&(e=o[i]);i++) t=u.Logical.getParentNode(e),t._useContent||t===this||t===this.shadyRoot||this._ updateChildNodes(t,this._composeNode(t))},_composeNode:function(e){for(var t=[], o=u.Logical.getChildNodes(e.shadyRoot||e),s=0;s<o.length;s++){var r=o[s];if(n(r) )for(var d=r._distributedNodes,a=0;a<d.length;a++){var l=d[a];i(r,l)&&t.push(l)} else t.push(r)}return t},_updateChildNodes:function(e,t){for(var o,i=u.Composed. getChildNodes(e),n=Polymer.ArraySplice.calculateSplices(t,i),s=0,r=0;s<n.length& &(o=n[s]);s++){for(var d,a=0;a<o.removed.length&&(d=o.removed[a]);a++)u.Composed .getParentNode(d)===e&&u.Composed.removeChild(e,d),i.splice(o.index+r,1);r-=o.ad dedCount}for(var o,l,s=0;s<n.length&&(o=n[s]);s++)for(l=i[o.index],a=o.index,d;a <o.index+o.addedCount;a++)d=t[a],u.Composed.insertBefore(e,d,l),i.splice(a,0,d)} ,_matchesContentSelect:function(e,t){var o=t.getAttribute("select");if(!o)return !0;if(o=o.trim(),!o)return!0;if(!(e instanceof Element))return!1;var i=/^(:not\( )?[*.#[a-zA-Z_|]/;return!!i.test(o)&&this.elementMatches(o,e)},_elementAdd:funct ion(){},_elementRemove:function(){}});var c=window.CustomElements&&!CustomElemen ts.useNative}(),Polymer.Settings.useShadow&&Polymer.Base._addFeature({_poolConte nt:function(){},_beginDistribute:function(){},distributeContent:function(){},_di stributeContent:function(){},_finishDistribute:function(){},_createLocalRoot:fun ction(){this.createShadowRoot(),this.shadowRoot.appendChild(this.root),this.root =this.shadowRoot}}),Polymer.Async={_currVal:0,_lastVal:0,_callbacks:[],_twiddleC ontent:0,_twiddle:document.createTextNode(""),run:function(e,t){return t>0?~setT imeout(e,t):(this._twiddle.textContent=this._twiddleContent++,this._callbacks.pu sh(e),this._currVal++)},cancel:function(e){if(e<0)clearTimeout(~e);else{var t=e- this._lastVal;if(t>=0){if(!this._callbacks[t])throw"invalid async handle: "+e;th is._callbacks[t]=null}}},_atEndOfMicrotask:function(){for(var e=this._callbacks. length,t=0;t<e;t++){var o=this._callbacks[t];if(o)try{o()}catch(e){throw t++,thi s._callbacks.splice(0,t),this._lastVal+=t,this._twiddle.textContent=this._twiddl eContent++,e}}this._callbacks.splice(0,e),this._lastVal+=e}},new window.Mutation Observer(function(){Polymer.Async._atEndOfMicrotask()}).observe(Polymer.Async._t widdle,{characterData:!0}),Polymer.Debounce=function(){function e(e,t,i){return e?e.stop():e=new o(this),e.go(t,i),e}var t=Polymer.Async,o=function(e){this.cont ext=e;var t=this;this.boundComplete=function(){t.complete()}};return o.prototype ={go:function(e,o){var i;this.finish=function(){t.cancel(i)},i=t.run(this.boundC omplete,o),this.callback=e},stop:function(){this.finish&&(this.finish(),this.fin ish=null,this.callback=null)},complete:function(){if(this.finish){var e=this.cal lback;this.stop(),e.call(this.context)}}},e}(),Polymer.Base._addFeature({_setupD ebouncers:function(){this._debouncers={}},debounce:function(e,t,o){return this._ debouncers[e]=Polymer.Debounce.call(this,this._debouncers[e],t,o)},isDebouncerAc tive:function(e){var t=this._debouncers[e];return!(!t||!t.finish)},flushDebounce r:function(e){var t=this._debouncers[e];t&&t.complete()},cancelDebouncer:functio n(e){var t=this._debouncers[e];t&&t.stop()}}),Polymer.DomModule=document.createE lement("dom-module"),Polymer.Base._addFeature({_registerFeatures:function(){this ._prepIs(),this._prepBehaviors(),this._prepConstructor(),this._prepTemplate(),th is._prepShady(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHos tAttributes(e.hostAttributes)},_initFeatures:function(){this._registerHost(),thi s._template&&(this._poolContent(),this._beginHosting(),this._stampTemplate(),thi s._endHosting()),this._marshalHostAttributes(),this._setupDebouncers(),this._mar shalBehaviors(),this._tryReady()},_marshalBehavior:function(e){}})</script> <scr ipt>Polymer.nar=[],Polymer.Annotations={parseAnnotations:function(e){var t=[],n= e._content||e.content;return this._parseNodeAnnotations(n,t,e.hasAttribute("stri p-whitespace")),t},_parseNodeAnnotations:function(e,t,n){return e.nodeType===Nod e.TEXT_NODE?this._parseTextNodeAnnotation(e,t):this._parseElementAnnotations(e,t ,n)},_bindingRegex:function(){var e="(?:[a-zA-Z_$][\\w.:$\\-*]*)",t="(?:[-+]?[0- 9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)",n="(?:'(?:[^'\\\\]|\\\\.)*')",r='(?:"(?:[^"\ \\\]|\\\\.)*")',s="(?:"+n+"|"+r+")",i="(?:"+e+"|"+t+"|"+s+"\\s*)",o="(?:"+i+"(?: ,\\s*"+i+")*)",a="(?:\\(\\s*(?:"+o+"?)\\)\\s*)",l="("+e+"\\s*"+a+"?)",h="(\\[\\[ |{{)\\s*",c="(?:]]|}})",u="(?:(!)\\s*)?",f=h+u+l+c;return new RegExp(f,"g")}(),_ parseBindings:function(e){for(var t,n=this._bindingRegex,r=[],s=0;null!==(t=n.ex ec(e));){t.index>s&&r.push({literal:e.slice(s,t.index)});var i,o,a,l=t[1][0],h=B oolean(t[2]),c=t[3].trim();"{"==l&&(a=c.indexOf("::"))>0&&(o=c.substring(a+2),c= c.substring(0,a),i=!0),r.push({compoundIndex:r.length,value:c,mode:l,negate:h,ev ent:o,customEvent:i}),s=n.lastIndex}if(s&&s<e.length){var u=e.substring(s);u&&r. push({literal:u})}if(r.length)return r},_literalFromParts:function(e){for(var t= "",n=0;n<e.length;n++){var r=e[n].literal;t+=r||""}return t},_parseTextNodeAnnot ation:function(e,t){var n=this._parseBindings(e.textContent);if(n){e.textContent =this._literalFromParts(n)||" ";var r={bindings:[{kind:"text",name:"textContent" ,parts:n,isCompound:1!==n.length}]};return t.push(r),r}},_parseElementAnnotation s:function(e,t,n){var r={bindings:[],events:[]};return"content"===e.localName&&( t._hasContent=!0),this._parseChildNodesAnnotations(e,r,t,n),e.attributes&&(this. _parseNodeAttributeAnnotations(e,r,t),this.prepElement&&this.prepElement(e)),(r. bindings.length||r.events.length||r.id)&&t.push(r),r},_parseChildNodesAnnotation s:function(e,t,n,r){if(e.firstChild)for(var s=e.firstChild,i=0;s;){var o=s.nextS ibling;if("template"!==s.localName||s.hasAttribute("preserve-content")||this._pa rseTemplate(s,i,n,t),s.nodeType===Node.TEXT_NODE){for(var a=o;a&&a.nodeType===No de.TEXT_NODE;)s.textContent+=a.textContent,o=a.nextSibling,e.removeChild(a),a=o; r&&!s.textContent.trim()&&(e.removeChild(s),i--)}if(s.parentNode){var l=this._pa rseNodeAnnotations(s,n,r);l&&(l.parent=t,l.index=i)}s=o,i++}},_parseTemplate:fun ction(e,t,n,r){var s=document.createDocumentFragment();s._notes=this.parseAnnota tions(e),s.appendChild(e.content),n.push({bindings:Polymer.nar,events:Polymer.na r,templateContent:s,parent:r,index:t})},_parseNodeAttributeAnnotations:function( e,t){for(var n,r=Array.prototype.slice.call(e.attributes),s=r.length-1;n=r[s];s- -){var i,o=n.name,a=n.value;"on-"===o.slice(0,3)?(e.removeAttribute(o),t.events. push({name:o.slice(3),value:a})):(i=this._parseNodeAttributeAnnotation(e,o,a))?t .bindings.push(i):"id"===o&&(t.id=a)}},_parseNodeAttributeAnnotation:function(e, t,n){var r=this._parseBindings(n);if(r){var s=t,i="property";"$"==t[t.length-1]& &(t=t.slice(0,-1),i="attribute");var o=this._literalFromParts(r);o&&"attribute"= =i&&e.setAttribute(t,o),"input"===e.localName&&"value"===s&&e.setAttribute(s,"") ,e.removeAttribute(s);var a=Polymer.CaseMap.dashToCamelCase(t);return"property"= ==i&&(t=a),{kind:i,name:t,propertyName:a,parts:r,literal:o,isCompound:1!==r.leng th}}},findAnnotatedNode:function(e,t){var n=t.parent&&Polymer.Annotations.findAn notatedNode(e,t.parent);if(!n)return e;for(var r=n.firstChild,s=0;r;r=r.nextSibl ing)if(t.index===s++)return r}},function(){function e(e,t){return e.replace(a,fu nction(e,r,s,i){return r+"'"+n(s.replace(/["']/g,""),t)+"'"+i})}function t(t,r){ for(var s in l)for(var i,o,a,h=l[s],u=0,f=h.length;u<f&&(i=h[u]);u++)"*"!==s&&t. localName!==s||(o=t.attributes[i],a=o&&o.value,a&&a.search(c)<0&&(o.value="style "===i?e(a,r):n(a,r)))}function n(e,t){if(e&&h.test(e))return e;var n=s(t);return n.href=e,n.href||e}function r(e,t){return i||(i=document.implementation.createH TMLDocument("temp"),o=i.createElement("base"),i.head.appendChild(o)),o.href=t,n( e,i)}function s(e){return e.__urlResolver||(e.__urlResolver=e.createElement("a") )}var i,o,a=/(url\()([^)]*)(\))/g,l={"*":["href","src","style","url"],form:["act ion"]},h=/(^\/)|(^#)|(^[\w-\d]*:)/,c=/\{\{|\[\[/;Polymer.ResolveUrl={resolveCss: e,resolveAttrs:t,resolveUrl:r}}(),Polymer.Base._addFeature({_prepAnnotations:fun ction(){if(this._template){var e=this;Polymer.Annotations.prepElement=function(t ){e._prepElement(t)},this._template._content&&this._template._content._notes?thi s._notes=this._template._content._notes:(this._notes=Polymer.Annotations.parseAn notations(this._template),this._processAnnotations(this._notes)),Polymer.Annotat ions.prepElement=null}else this._notes=[]},_processAnnotations:function(e){for(v ar t=0;t<e.length;t++){for(var n=e[t],r=0;r<n.bindings.length;r++)for(var s=n.bi ndings[r],i=0;i<s.parts.length;i++){var o=s.parts[i];if(!o.literal){var a=this._ parseMethod(o.value);a?o.signature=a:o.model=this._modelForPath(o.value)}}if(n.t emplateContent){this._processAnnotations(n.templateContent._notes);var l=n.templ ateContent._parentProps=this._discoverTemplateParentProps(n.templateContent._not es),h=[];for(var c in l){var u="_parent_"+c;h.push({index:n.index,kind:"property ",name:u,propertyName:u,parts:[{mode:"{",model:c,value:c}]})}n.bindings=n.bindin gs.concat(h)}}},_discoverTemplateParentProps:function(e){for(var t,n={},r=0;r<e. length&&(t=e[r]);r++){for(var s,i=0,o=t.bindings;i<o.length&&(s=o[i]);i++)for(va r a,l=0,h=s.parts;l<h.length&&(a=h[l]);l++)if(a.signature){for(var c=a.signature .args,u=0;u<c.length;u++){var f=c[u].model;f&&(n[f]=!0)}a.signature.dynamicFn&&( n[a.signature.method]=!0)}else a.model&&(n[a.model]=!0);if(t.templateContent){va r p=t.templateContent._parentProps;Polymer.Base.mixin(n,p)}}return n},_prepEleme nt:function(e){Polymer.ResolveUrl.resolveAttrs(e,this._template.ownerDocument)}, _findAnnotatedNode:Polymer.Annotations.findAnnotatedNode,_marshalAnnotationRefer ences:function(){this._template&&(this._marshalIdNodes(),this._marshalAnnotatedN odes(),this._marshalAnnotatedListeners())},_configureAnnotationReferences:functi on(){for(var e=this._notes,t=this._nodes,n=0;n<e.length;n++){var r=e[n],s=t[n];t his._configureTemplateContent(r,s),this._configureCompoundBindings(r,s)}},_confi gureTemplateContent:function(e,t){e.templateContent&&(t._content=e.templateConte nt)},_configureCompoundBindings:function(e,t){for(var n=e.bindings,r=0;r<n.lengt h;r++){var s=n[r];if(s.isCompound){for(var i=t.__compoundStorage__||(t.__compoun dStorage__={}),o=s.parts,a=new Array(o.length),l=0;l<o.length;l++)a[l]=o[l].lite ral;var h=s.name;i[h]=a,s.literal&&"property"==s.kind&&(t._configValue?t._config Value(h,s.literal):t[h]=s.literal)}}},_marshalIdNodes:function(){this.$={};for(v ar e,t=0,n=this._notes.length;t<n&&(e=this._notes[t]);t++)e.id&&(this.$[e.id]=th is._findAnnotatedNode(this.root,e))},_marshalAnnotatedNodes:function(){if(this._ notes&&this._notes.length){for(var e=new Array(this._notes.length),t=0;t<this._n otes.length;t++)e[t]=this._findAnnotatedNode(this.root,this._notes[t]);this._nod es=e}},_marshalAnnotatedListeners:function(){for(var e,t=0,n=this._notes.length; t<n&&(e=this._notes[t]);t++)if(e.events&&e.events.length)for(var r,s=this._findA nnotatedNode(this.root,e),i=0,o=e.events;i<o.length&&(r=o[i]);i++)this.listen(s, r.name,r.value)}}),Polymer.Base._addFeature({listeners:{},_listenListeners:funct ion(e){var t,n,r;for(r in e)r.indexOf(".")<0?(t=this,n=r):(n=r.split("."),t=this .$[n[0]],n=n[1]),this.listen(t,n,e[r])},listen:function(e,t,n){var r=this._recal lEventHandler(this,t,e,n);r||(r=this._createEventHandler(e,t,n)),r._listening||( this._listen(e,t,r),r._listening=!0)},_boundListenerKey:function(e,t){return e+" :"+t},_recordEventHandler:function(e,t,n,r,s){var i=e.__boundListeners;i||(i=e._ _boundListeners=new WeakMap);var o=i.get(n);o||(o={},i.set(n,o));var a=this._bou ndListenerKey(t,r);o[a]=s},_recallEventHandler:function(e,t,n,r){var s=e.__bound Listeners;if(s){var i=s.get(n);if(i){var o=this._boundListenerKey(t,r);return i[ o]}}},_createEventHandler:function(e,t,n){var r=this,s=function(e){r[n]?r[n](e,e .detail):r._warn(r._logf("_createEventHandler","listener method `"+n+"` not defi ned"))};return s._listening=!1,this._recordEventHandler(r,t,e,n,s),s},unlisten:f unction(e,t,n){var r=this._recallEventHandler(this,t,e,n);r&&(this._unlisten(e,t ,r),r._listening=!1)},_listen:function(e,t,n){e.addEventListener(t,n)},_unlisten :function(e,t,n){e.removeEventListener(t,n)}}),function(){"use strict";function e(e){for(var t,n=0;n<m.length;n++)t=m[n],e?document.addEventListener(t,P,!0):doc ument.removeEventListener(t,P,!0)}function t(){if(!g){S.mouse.mouseIgnoreJob||e( !0);var t=function(){e(),S.mouse.target=null,S.mouse.mouseIgnoreJob=null};S.mous e.mouseIgnoreJob=Polymer.Debounce(S.mouse.mouseIgnoreJob,t,d)}}function n(e){var t=e.type;if(m.indexOf(t)===-1)return!1;if("mousemove"===t){var n=void 0===e.but tons?1:e.buttons;return e instanceof window.MouseEvent&&!v&&(n=y[e.which]||0),Bo olean(1&n)}var r=void 0===e.button?0:e.button;return 0===r}function r(e){if("cli ck"===e.type){if(0===e.detail)return!0;var t=E.findOriginalTarget(e),n=t.getBoun dingClientRect(),r=e.pageX,s=e.pageY;return!(r>=n.left&&r<=n.right&&s>=n.top&&s< =n.bottom)}return!1}function s(e){for(var t,n=Polymer.dom(e).path,r="auto",s=0;s <n.length;s++)if(t=n[s],t[u]){r=t[u];break}return r}function i(e,t,n){e.movefn=t ,e.upfn=n,document.addEventListener("mousemove",t),document.addEventListener("mo useup",n)}function o(e){document.removeEventListener("mousemove",e.movefn),docum ent.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}var a=Polyme r.DomApi.wrap,l="string"==typeof document.head.style.touchAction,h="__polymerGes tures",c="__polymerGesturesHandled",u="__polymerGesturesTouchAction",f=25,p=5,_= 2,d=2500,m=["mousedown","mousemove","mouseup","click"],y=[0,1,4,2],v=function(){ try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}(), g=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/),P=function(e){var t=e.so urceCapabilities;if((!t||t.firesTouchEvents)&&(e[c]={skip:!0},"click"===e.type)) {for(var n=Polymer.dom(e).path,r=0;r<n.length;r++)if(n[r]===S.mouse.target)retur n;e.preventDefault(),e.stopPropagation()}},S={mouse:{target:null,mouseIgnoreJob: null},touch:{x:0,y:0,id:-1,scrollDecided:!1}},E={gestures:{},recognizers:[],deep TargetFind:function(e,t){for(var n=document.elementFromPoint(e,t),r=n;r&&r.shado wRoot;)r=r.shadowRoot.elementFromPoint(e,t),r&&(n=r);return n},findOriginalTarge t:function(e){return e.path?e.path[0]:e.target},handleNative:function(e){var n,r =e.type,s=a(e.currentTarget),i=s[h];if(i){var o=i[r];if(o){if(!e[c]&&(e[c]={},"t ouch"===r.slice(0,5))){var u=e.changedTouches[0];if("touchstart"===r&&1===e.touc hes.length&&(S.touch.id=u.identifier),S.touch.id!==u.identifier)return;l||"touch start"!==r&&"touchmove"!==r||E.handleTouchAction(e),"touchend"===r&&(S.mouse.tar get=Polymer.dom(e).rootTarget,t())}if(n=e[c],!n.skip){for(var f,p=E.recognizers, _=0;_<p.length;_++)f=p[_],o[f.name]&&!n[f.name]&&f.flow&&f.flow.start.indexOf(e. type)>-1&&f.reset&&f.reset();for(_=0,f;_<p.length;_++)f=p[_],o[f.name]&&!n[f.nam e]&&(n[f.name]=!0,f[r](e))}}}},handleTouchAction:function(e){var t=e.changedTouc hes[0],n=e.type;if("touchstart"===n)S.touch.x=t.clientX,S.touch.y=t.clientY,S.to uch.scrollDecided=!1;else if("touchmove"===n){if(S.touch.scrollDecided)return;S. touch.scrollDecided=!0;var r=s(e),i=!1,o=Math.abs(S.touch.x-t.clientX),a=Math.ab s(S.touch.y-t.clientY);e.cancelable&&("none"===r?i=!0:"pan-x"===r?i=a>o:"pan-y"= ==r&&(i=o>a)),i?e.preventDefault():E.prevent("track")}},add:function(e,t,n){e=a( e);var r=this.gestures[t],s=r.deps,i=r.name,o=e[h];o||(e[h]=o={});for(var l,c,u= 0;u<s.length;u++)l=s[u],g&&m.indexOf(l)>-1||(c=o[l],c||(o[l]=c={_count:0}),0===c ._count&&e.addEventListener(l,this.handleNative),c[i]=(c[i]||0)+1,c._count=(c._c ount||0)+1);e.addEventListener(t,n),r.touchAction&&this.setTouchAction(e,r.touch Action)},remove:function(e,t,n){e=a(e);var r=this.gestures[t],s=r.deps,i=r.name, o=e[h];if(o)for(var l,c,u=0;u<s.length;u++)l=s[u],c=o[l],c&&c[i]&&(c[i]=(c[i]||1 )-1,c._count=(c._count||1)-1,0===c._count&&e.removeEventListener(l,this.handleNa tive));e.removeEventListener(t,n)},register:function(e){this.recognizers.push(e) ;for(var t=0;t<e.emits.length;t++)this.gestures[e.emits[t]]=e},findRecognizerByE vent:function(e){for(var t,n=0;n<this.recognizers.length;n++){t=this.recognizers [n];for(var r,s=0;s<t.emits.length;s++)if(r=t.emits[s],r===e)return t}return nul l},setTouchAction:function(e,t){l&&(e.style.touchAction=t),e[u]=t},fire:function (e,t,n){var r=Polymer.Base.fire(t,n,{node:e,bubbles:!0,cancelable:!0});if(r.defa ultPrevented){var s=n.preventer||n.sourceEvent;s&&s.preventDefault&&s.preventDef ault()}},prevent:function(e){var t=this.findRecognizerByEvent(e);t.info&&(t.info .prevent=!0)},resetMouseCanceller:function(){S.mouse.mouseIgnoreJob&&S.mouse.mou seIgnoreJob.complete()}};E.register({name:"downup",deps:["mousedown","touchstart ","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]} ,emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){o(this.info)} ,mousedown:function(e){if(n(e)){var t=E.findOriginalTarget(e),r=this,s=function( e){n(e)||(r.fire("up",t,e),o(r.info))},a=function(e){n(e)&&r.fire("up",t,e),o(r. info)};i(this.info,s,a),this.fire("down",t,e)}},touchstart:function(e){this.fire ("down",E.findOriginalTarget(e),e.changedTouches[0],e)},touchend:function(e){thi s.fire("up",E.findOriginalTarget(e),e.changedTouches[0],e)},fire:function(e,t,n, r){E.fire(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:r,prevent:functio n(e){return E.prevent(e)}})}}),E.register({name:"track",touchAction:"none",deps: ["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touc hstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start" ,started:!1,moves:[],addMove:function(e){this.moves.length>_&&this.moves.shift() ,this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.inf o.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info. y=0,this.info.prevent=!1,o(this.info)},hasMovedEnough:function(e,t){if(this.info .prevent)return!1;if(this.info.started)return!0;var n=Math.abs(this.info.x-e),r= Math.abs(this.info.y-t);return n>=p||r>=p},mousedown:function(e){if(n(e)){var t= E.findOriginalTarget(e),r=this,s=function(e){var s=e.clientX,i=e.clientY;r.hasMo vedEnough(s,i)&&(r.info.state=r.info.started?"mouseup"===e.type?"end":"track":"s tart","start"===r.info.state&&E.prevent("tap"),r.info.addMove({x:s,y:i}),n(e)||( r.info.state="end",o(r.info)),r.fire(t,e),r.info.started=!0)},a=function(e){r.in fo.started&&s(e),o(r.info)};i(this.info,s,a),this.info.x=e.clientX,this.info.y=e .clientY}},touchstart:function(e){var t=e.changedTouches[0];this.info.x=t.client X,this.info.y=t.clientY},touchmove:function(e){var t=E.findOriginalTarget(e),n=e .changedTouches[0],r=n.clientX,s=n.clientY;this.hasMovedEnough(r,s)&&("start"=== this.info.state&&E.prevent("tap"),this.info.addMove({x:r,y:s}),this.fire(t,n),th is.info.state="track",this.info.started=!0)},touchend:function(e){var t=E.findOr iginalTarget(e),n=e.changedTouches[0];this.info.started&&(this.info.state="end", this.info.addMove({x:n.clientX,y:n.clientY}),this.fire(t,n,e))},fire:function(e, t,n){var r,s=this.info.moves[this.info.moves.length-2],i=this.info.moves[this.in fo.moves.length-1],o=i.x-this.info.x,a=i.y-this.info.y,l=0;return s&&(r=i.x-s.x, l=i.y-s.y),E.fire(e,"track",{state:this.info.state,x:t.clientX,y:t.clientY,dx:o, dy:a,ddx:r,ddy:l,sourceEvent:t,preventer:n,hover:function(){return E.deepTargetF ind(t.clientX,t.clientY)}})}}),E.register({name:"tap",deps:["mousedown","click", "touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","to uchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info .x=NaN,this.info.y=NaN,this.info.prevent=!1},save:function(e){this.info.x=e.clie ntX,this.info.y=e.clientY},mousedown:function(e){n(e)&&this.save(e)},click:funct ion(e){n(e)&&this.forward(e)},touchstart:function(e){this.save(e.changedTouches[ 0],e)},touchend:function(e){this.forward(e.changedTouches[0],e)},forward:functio n(e,t){var n=Math.abs(e.clientX-this.info.x),s=Math.abs(e.clientY-this.info.y),i =E.findOriginalTarget(e);(isNaN(n)||isNaN(s)||n<=f&&s<=f||r(e))&&(this.info.prev ent||E.fire(i,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:t}))}});var C={x:"pan-x",y:"pan-y",none:"none",all:"auto"};Polymer.Base._addFeature({_setup Gestures:function(){this.__polymerGestures=null},_listen:function(e,t,n){E.gestu res[t]?E.add(e,t,n):e.addEventListener(t,n)},_unlisten:function(e,t,n){E.gesture s[t]?E.remove(e,t,n):e.removeEventListener(t,n)},setScrollDirection:function(e,t ){t=t||this,E.setTouchAction(t,C[e]||"auto")}}),Polymer.Gestures=E}(),function() {"use strict";if(Polymer.Base._addFeature({$$:function(e){return Polymer.dom(thi s.root).querySelector(e)},toggleClass:function(e,t,n){n=n||this,1==arguments.len gth&&(t=!n.classList.contains(e)),t?Polymer.dom(n).classList.add(e):Polymer.dom( n).classList.remove(e)},toggleAttribute:function(e,t,n){n=n||this,1==arguments.l ength&&(t=!n.hasAttribute(e)),t?Polymer.dom(n).setAttribute(e,""):Polymer.dom(n) .removeAttribute(e)},classFollows:function(e,t,n){n&&Polymer.dom(n).classList.re move(e),t&&Polymer.dom(t).classList.add(e)},attributeFollows:function(e,t,n){n&& Polymer.dom(n).removeAttribute(e),t&&Polymer.dom(t).setAttribute(e,"")},getEffec tiveChildNodes:function(){return Polymer.dom(this).getEffectiveChildNodes()},get EffectiveChildren:function(){var e=Polymer.dom(this).getEffectiveChildNodes();re turn e.filter(function(e){return e.nodeType===Node.ELEMENT_NODE})},getEffectiveT extContent:function(){for(var e,t=this.getEffectiveChildNodes(),n=[],r=0;e=t[r]; r++)e.nodeType!==Node.COMMENT_NODE&&n.push(Polymer.dom(e).textContent);return n. join("")},queryEffectiveChildren:function(e){var t=Polymer.dom(this).queryDistri butedElements(e);return t&&t[0]},queryAllEffectiveChildren:function(e){return Po lymer.dom(this).queryDistributedElements(e)},getContentChildNodes:function(e){va r t=Polymer.dom(this.root).querySelector(e||"content");return t?Polymer.dom(t).g etDistributedNodes():[]},getContentChildren:function(e){return this.getContentCh ildNodes(e).filter(function(e){return e.nodeType===Node.ELEMENT_NODE})},fire:fun ction(e,t,n){n=n||Polymer.nob;var r=n.node||this;t=null===t||void 0===t?{}:t;var s=void 0===n.bubbles||n.bubbles,i=Boolean(n.cancelable),o=n._useCache,a=this._g etEvent(e,s,i,o);return a.detail=t,o&&(this.__eventCache[e]=null),r.dispatchEven t(a),o&&(this.__eventCache[e]=a),a},__eventCache:{},_getEvent:function(e,t,n,r){ var s=r&&this.__eventCache[e];return s&&s.bubbles==t&&s.cancelable==n||(s=new Ev ent(e,{bubbles:Boolean(t),cancelable:n})),s},async:function(e,t){var n=this;retu rn Polymer.Async.run(function(){e.call(n)},t)},cancelAsync:function(e){Polymer.A sync.cancel(e)},arrayDelete:function(e,t){var n;if(Array.isArray(e)){if(n=e.inde xOf(t),n>=0)return e.splice(n,1)}else{var r=this._get(e);if(n=r.indexOf(t),n>=0) return this.splice(e,n,1)}},transform:function(e,t){t=t||this,t.style.webkitTran sform=e,t.style.transform=e},translate3d:function(e,t,n,r){r=r||this,this.transf orm("translate3d("+e+","+t+","+n+")",r)},importHref:function(e,t,n,r){var s=docu ment.createElement("link");s.rel="import",s.href=e;var i=Polymer.Base.importHref .imported=Polymer.Base.importHref.imported||{},o=i[s.href],a=o||s,l=this;if(t){v ar h=function(e){return e.target.__firedLoad=!0,e.target.removeEventListener("lo ad",h),t.call(l,e)};a.addEventListener("load",h)}if(n){var c=function(e){return e.target.__firedError=!0,e.target.removeEventListener("error",c),n.call(l,e)};a. addEventListener("error",c)}return o?(o.__firedLoad&&o.dispatchEvent(new Event(" load")),o.__firedError&&o.dispatchEvent(new Event("error"))):(i[s.href]=s,r=Bool ean(r),r&&s.setAttribute("async",""),document.head.appendChild(s)),a},create:fun ction(e,t){var n=document.createElement(e);if(t)for(var r in t)n[r]=t[r];return n},isLightDescendant:function(e){return this!==e&&this.contains(e)&&Polymer.dom( this).getOwnerRoot()===Polymer.dom(e).getOwnerRoot()},isLocalDescendant:function (e){return this.root===Polymer.dom(e).getOwnerRoot()}}),!Polymer.Settings.useNat iveCustomElements){var e=Polymer.Base.importHref;Polymer.Base.importHref=functio n(t,n,r,s){CustomElements.ready=!1;var i=function(e){if(CustomElements.upgradeDo cumentTree(document),CustomElements.ready=!0,n)return n.call(this,e)};return e.c all(this,t,i,r,s)}}}(),Polymer.Bind={prepareModel:function(e){Polymer.Base.mixin (e,this._modelApi)},_modelApi:{_notifyChange:function(e,t,n){n=void 0===n?this[e ]:n,t=t||Polymer.CaseMap.camelToDashCase(e)+"-changed",this.fire(t,{value:n},{bu bbles:!1,cancelable:!1,_useCache:!0})},_propertySetter:function(e,t,n,r){var s=t his.__data__[e];return s===t||s!==s&&t!==t||(this.__data__[e]=t,"object"==typeof t&&this._clearPath(e),this._propertyChanged&&this._propertyChanged(e,t,s),n&&th is._effectEffects(e,t,n,s,r)),s},__setProperty:function(e,t,n,r){r=r||this;var s =r._propertyEffects&&r._propertyEffects[e];s?r._propertySetter(e,t,s,n):r[e]!==t &&(r[e]=t)},_effectEffects:function(e,t,n,r,s){for(var i,o=0,a=n.length;o<a&&(i= n[o]);o++)i.fn.call(this,e,this[e],i.effect,r,s)},_clearPath:function(e){for(var t in this.__data__)0===t.indexOf(e+".")&&(this.__data__[t]=void 0)}},ensureProp ertyEffects:function(e,t){e._propertyEffects||(e._propertyEffects={});var n=e._p ropertyEffects[t];return n||(n=e._propertyEffects[t]=[]),n},addPropertyEffect:fu nction(e,t,n,r){var s=this.ensurePropertyEffects(e,t),i={kind:n,effect:r,fn:Poly mer.Bind["_"+n+"Effect"]};return s.push(i),i},createBindings:function(e){var t=e ._propertyEffects;if(t)for(var n in t){var r=t[n];r.sort(this._sortPropertyEffec ts),this._createAccessors(e,n,r)}},_sortPropertyEffects:function(){var e={comput e:0,annotation:1,annotatedComputation:2,reflect:3,notify:4,observer:5,complexObs erver:6,function:7};return function(t,n){return e[t.kind]-e[n.kind]}}(),_createA ccessors:function(e,t,n){var r={get:function(){return this.__data__[t]}},s=funct ion(e){this._propertySetter(t,e,n)},i=e.getPropertyInfo&&e.getPropertyInfo(t);i& &i.readOnly?i.computed||(e["_set"+this.upper(t)]=s):r.set=s,Object.definePropert y(e,t,r)},upper:function(e){return e[0].toUpperCase()+e.substring(1)},_addAnnota tedListener:function(e,t,n,r,s,i){e._bindListeners||(e._bindListeners=[]);var o= this._notedListenerFactory(n,r,this._isStructured(r),i),a=s||Polymer.CaseMap.cam elToDashCase(n)+"-changed";e._bindListeners.push({index:t,property:n,path:r,chan gedFn:o,event:a})},_isStructured:function(e){return e.indexOf(".")>0},_isEventBo gus:function(e,t){return e.path&&e.path[0]!==t},_notedListenerFactory:function(e ,t,n,r){return function(s,i,o){o?this._notifyPath(this._fixPath(t,e,o),i):(i=s[e ],r&&(i=!i),n?this.__data__[t]!=i&&this.set(t,i):this[t]=i)}},prepareInstance:fu nction(e){e.__data__=Object.create(null)},setupBindListeners:function(e){for(var t,n=e._bindListeners,r=0,s=n.length;r<s&&(t=n[r]);r++){var i=e._nodes[t.index]; this._addNotifyListener(i,e,t.event,t.changedFn)}},_addNotifyListener:function(e ,t,n,r){e.addEventListener(n,function(e){return t._notifyListener(r,e)})}},Polym er.Base.extend(Polymer.Bind,{_shouldAddListener:function(e){return e.name&&"attr ibute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode},_annotatio nEffect:function(e,t,n){e!=n.value&&(t=this._get(n.value),this.__data__[n.value] =t),this._applyEffectValue(n,t)},_reflectEffect:function(e,t,n){this.reflectProp ertyToAttribute(e,n.attribute,t)},_notifyEffect:function(e,t,n,r,s){s||this._not ifyChange(e,n.event,t)},_functionEffect:function(e,t,n,r,s){n.call(this,e,t,r,s) },_observerEffect:function(e,t,n,r){var s=this[n.method];s?s.call(this,t,r):this ._warn(this._logf("_observerEffect","observer method `"+n.method+"` not defined" ))},_complexObserverEffect:function(e,t,n){var r=this[n.method];if(r){var s=Poly mer.Bind._marshalArgs(this.__data__,n,e,t);s&&r.apply(this,s)}else n.dynamicFn|| this._warn(this._logf("_complexObserverEffect","observer method `"+n.method+"` n ot defined"))},_computeEffect:function(e,t,n){var r=this[n.method];if(r){var s=P olymer.Bind._marshalArgs(this.__data__,n,e,t);if(s){var i=r.apply(this,s);this._ _setProperty(n.name,i)}}else n.dynamicFn||this._warn(this._logf("_computeEffect" ,"compute method `"+n.method+"` not defined"))},_annotatedComputationEffect:func tion(e,t,n){var r=this._rootDataHost||this,s=r[n.method];if(s){var i=Polymer.Bin d._marshalArgs(this.__data__,n,e,t);if(i){var o=s.apply(r,i);this._applyEffectVa lue(n,o)}}else n.dynamicFn||r._warn(r._logf("_annotatedComputationEffect","compu te method `"+n.method+"` not defined"))},_marshalArgs:function(e,t,n,r){for(var s=[],i=t.args,o=i.length>1||t.dynamicFn,a=0,l=i.length;a<l;a++){var h,c=i[a],u=c .name;if(c.literal?h=c.value:n===u?h=r:(h=e[u],void 0===h&&c.structured&&(h=Poly mer.Base._get(u,e))),o&&void 0===h)return;if(c.wildcard){var f=0===n.indexOf(u+" .");s[a]={path:f?n:u,value:f?r:h,base:h}}else s[a]=h}return s}}),Polymer.Base._a ddFeature({_addPropertyEffect:function(e,t,n){var r=Polymer.Bind.addPropertyEffe ct(this,e,t,n);r.pathFn=this["_"+r.kind+"PathEffect"]},_prepEffects:function(){P olymer.Bind.prepareModel(this),this._addAnnotationEffects(this._notes)},_prepBin dings:function(){Polymer.Bind.createBindings(this)},_addPropertyEffects:function (e){if(e)for(var t in e){var n=e[t];if(n.observer&&this._addObserverEffect(t,n.o bserver),n.computed&&(n.readOnly=!0,this._addComputedEffect(t,n.computed)),n.not ify&&this._addPropertyEffect(t,"notify",{event:Polymer.CaseMap.camelToDashCase(t )+"-changed"}),n.reflectToAttribute){var r=Polymer.CaseMap.camelToDashCase(t);"- "===r[0]?this._warn(this._logf("_addPropertyEffects","Property "+t+" cannot be r eflected to attribute "+r+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')):this._addPropertyEffec t(t,"reflect",{attribute:r})}n.readOnly&&Polymer.Bind.ensurePropertyEffects(this ,t)}},_addComputedEffect:function(e,t){for(var n,r=this._parseMethod(t),s=r.dyna micFn,i=0;i<r.args.length&&(n=r.args[i]);i++)this._addPropertyEffect(n.model,"co mpute",{method:r.method,args:r.args,trigger:n,name:e,dynamicFn:s});s&&this._addP ropertyEffect(r.method,"compute",{method:r.method,args:r.args,trigger:null,name: e,dynamicFn:s})},_addObserverEffect:function(e,t){this._addPropertyEffect(e,"obs erver",{method:t,property:e})},_addComplexObserverEffects:function(e){if(e)for(v ar t,n=0;n<e.length&&(t=e[n]);n++)this._addComplexObserverEffect(t)},_addComplex ObserverEffect:function(e){var t=this._parseMethod(e);if(!t)throw new Error("Mal formed observer expression '"+e+"'");for(var n,r=t.dynamicFn,s=0;s<t.args.length &&(n=t.args[s]);s++)this._addPropertyEffect(n.model,"complexObserver",{method:t. method,args:t.args,trigger:n,dynamicFn:r});r&&this._addPropertyEffect(t.method," complexObserver",{method:t.method,args:t.args,trigger:null,dynamicFn:r})},_addAn notationEffects:function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++)for(var r,s=t .bindings,i=0;i<s.length&&(r=s[i]);i++)this._addAnnotationEffect(r,n)},_addAnnot ationEffect:function(e,t){Polymer.Bind._shouldAddListener(e)&&Polymer.Bind._addA nnotatedListener(this,t,e.name,e.parts[0].value,e.parts[0].event,e.parts[0].nega te);for(var n=0;n<e.parts.length;n++){var r=e.parts[n];r.signature?this._addAnno tatedComputationEffect(e,r,t):r.literal||("attribute"===e.kind&&"-"===e.name[0]? this._warn(this._logf("_addAnnotationEffect","Cannot set attribute "+e.name+' be cause "-" is not a valid attribute starting character')):this._addPropertyEffect (r.model,"annotation",{kind:e.kind,index:t,name:e.name,propertyName:e.propertyNa me,value:r.value,isCompound:e.isCompound,compoundIndex:r.compoundIndex,event:r.e vent,customEvent:r.customEvent,negate:r.negate}))}},_addAnnotatedComputationEffe ct:function(e,t,n){var r=t.signature;if(r.static)this.__addAnnotatedComputationE ffect("__static__",n,e,t,null);else{for(var s,i=0;i<r.args.length&&(s=r.args[i]) ;i++)s.literal||this.__addAnnotatedComputationEffect(s.model,n,e,t,s);r.dynamicF n&&this.__addAnnotatedComputationEffect(r.method,n,e,t,null)}},__addAnnotatedCom putationEffect:function(e,t,n,r,s){this._addPropertyEffect(e,"annotatedComputati on",{index:t,isCompound:n.isCompound,compoundIndex:r.compoundIndex,kind:n.kind,n ame:n.name,negate:r.negate,method:r.signature.method,args:r.signature.args,trigg er:s,dynamicFn:r.signature.dynamicFn})},_parseMethod:function(e){var t=e.match(/ ([^\s]+?)\(([\s\S]*)\)/);if(t){var n={method:t[1],static:!0};if(this.getProperty Info(n.method)!==Polymer.nob&&(n.static=!1,n.dynamicFn=!0),t[2].trim()){var r=t[ 2].replace(/\\,/g,"&comma;").split(",");return this._parseArgs(r,n)}return n.arg s=Polymer.nar,n}},_parseArgs:function(e,t){return t.args=e.map(function(e){var n =this._parseArg(e);return n.literal||(t.static=!1),n},this),t},_parseArg:functio n(e){var t=e.trim().replace(/&comma;/g,",").replace(/\\(.)/g,"$1"),n={name:t},r= t[0];switch("-"===r&&(r=t[1]),r>="0"&&r<="9"&&(r="#"),r){case"'":case'"':n.value =t.slice(1,-1),n.literal=!0;break;case"#":n.value=Number(t),n.literal=!0}return n.literal||(n.model=this._modelForPath(t),n.structured=t.indexOf(".")>0,n.struct ured&&(n.wildcard=".*"==t.slice(-2),n.wildcard&&(n.name=t.slice(0,-2)))),n},_mar shalInstanceEffects:function(){Polymer.Bind.prepareInstance(this),this._bindList eners&&Polymer.Bind.setupBindListeners(this)},_applyEffectValue:function(e,t){va r n=this._nodes[e.index],r=e.name;if(t=this._computeFinalAnnotationValue(n,r,t,e ),"attribute"==e.kind)this.serializeValueToAttribute(t,r,n);else{var s=n._proper tyInfo&&n._propertyInfo[r];if(s&&s.readOnly)return;this.__setProperty(r,t,!1,n)} },_computeFinalAnnotationValue:function(e,t,n,r){if(r.negate&&(n=!n),r.isCompoun d){var s=e.__compoundStorage__[t];s[r.compoundIndex]=n,n=s.join("")}return"attri bute"!==r.kind&&("className"===t&&(n=this._scopeElementClass(e,n)),("textContent "===t||"input"==e.localName&&"value"==t)&&(n=void 0==n?"":n)),n},_executeStaticE ffects:function(){this._propertyEffects&&this._propertyEffects.__static__&&this. _effectEffects("__static__",null,this._propertyEffects.__static__)}}),function() {var e=Polymer.Settings.usePolyfillProto;Polymer.Base._addFeature({_setupConfigu re:function(e){if(this._config={},this._handlers=[],this._aboveConfig=null,e)for (var t in e)void 0!==e[t]&&(this._config[t]=e[t])},_marshalAttributes:function() {this._takeAttributesToModel(this._config)},_attributeChangedImpl:function(e){va r t=this._clientsReadied?this:this._config;this._setAttributeToProperty(t,e)},_c onfigValue:function(e,t){var n=this._propertyInfo[e];n&&n.readOnly||(this._confi g[e]=t)},_beforeClientsReady:function(){this._configure()},_configure:function() {this._configureAnnotationReferences(),this._configureInstanceProperties(),this. _aboveConfig=this.mixin({},this._config);for(var e={},t=0;t<this.behaviors.lengt h;t++)this._configureProperties(this.behaviors[t].properties,e);this._configureP roperties(this.properties,e),this.mixin(e,this._aboveConfig),this._config=e,this ._clients&&this._clients.length&&this._distributeConfig(this._config)},_configur eInstanceProperties:function(){for(var t in this._propertyEffects)!e&&this.hasOw nProperty(t)&&(this._configValue(t,this[t]),delete this[t])},_configurePropertie s:function(e,t){for(var n in e){var r=e[n];if(void 0!==r.value){var s=r.value;"f unction"==typeof s&&(s=s.call(this,this._config)),t[n]=s}}},_distributeConfig:fu nction(e){var t=this._propertyEffects;if(t)for(var n in e){var r=t[n];if(r)for(v ar s,i=0,o=r.length;i<o&&(s=r[i]);i++)if("annotation"===s.kind){var a=this._node s[s.effect.index],l=s.effect.propertyName,h="attribute"==s.effect.kind,c=a._prop ertyEffects&&a._propertyEffects[l];if(a._configValue&&(c||!h)){var u=n===s.effec t.value?e[n]:this._get(s.effect.value,e);u=this._computeFinalAnnotationValue(a,l ,u,s.effect),h&&(u=a.deserialize(this.serialize(u),a._propertyInfo[l].type)),a._ configValue(l,u)}}}},_afterClientsReady:function(){this._executeStaticEffects(), this._applyConfig(this._config,this._aboveConfig), 2 },_distributeDirtyRoots:function(){for(var e,t=this.shadyRoot._dirtyRoots,o=0,i= t.length;o<i&&(e=t[o]);o++)e._distributeContent();this.shadyRoot._dirtyRoots=[]} ,_finishDistribute:function(){if(this._useContent){if(this.shadyRoot._distributi onClean=!0,h.hasInsertionPoint(this.shadyRoot))this._composeTree(),d(this.shadyR oot);else if(this.shadyRoot._hasDistributed){var e=this._composeNode(this);this. _updateChildNodes(this,e)}else u.Composed.clearChildNodes(this),this.appendChild (this.shadyRoot);this.shadyRoot._hasDistributed||a(this),this.shadyRoot._hasDist ributed=!0}},elementMatches:function(e,t){return t=t||this,h.matchesSelector.cal l(t,e)},_resetDistribution:function(){for(var e=u.Logical.getChildNodes(this),o= 0;o<e.length;o++){var i=e[o];i._destinationInsertionPoints&&(i._destinationInser tionPoints=void 0),n(i)&&t(i)}for(var s=this.shadyRoot,r=s._insertionPoints,d=0; d<r.length;d++)r[d]._distributedNodes=[]},_collectPool:function(){for(var e=[],t =u.Logical.getChildNodes(this),o=0;o<t.length;o++){var i=t[o];n(i)?e.push.apply( e,i._distributedNodes):e.push(i)}return e},_distributePool:function(e,t){for(var i,n=e._insertionPoints,s=0,r=n.length;s<r&&(i=n[s]);s++)this._distributeInserti onPoint(i,t),o(i,this)},_distributeInsertionPoint:function(t,o){for(var i,n=!1,s =0,r=o.length;s<r;s++)i=o[s],i&&this._matchesContentSelect(i,t)&&(e(i,t),o[s]=vo id 0,n=!0);if(!n)for(var d=u.Logical.getChildNodes(t),a=0;a<d.length;a++)e(d[a], t)},_composeTree:function(){this._updateChildNodes(this,this._composeNode(this)) ;for(var e,t,o=this.shadyRoot._insertionPoints,i=0,n=o.length;i<n&&(e=o[i]);i++) t=u.Logical.getParentNode(e),t._useContent||t===this||t===this.shadyRoot||this._ updateChildNodes(t,this._composeNode(t))},_composeNode:function(e){for(var t=[], o=u.Logical.getChildNodes(e.shadyRoot||e),s=0;s<o.length;s++){var r=o[s];if(n(r) )for(var d=r._distributedNodes,a=0;a<d.length;a++){var l=d[a];i(r,l)&&t.push(l)} else t.push(r)}return t},_updateChildNodes:function(e,t){for(var o,i=u.Composed. getChildNodes(e),n=Polymer.ArraySplice.calculateSplices(t,i),s=0,r=0;s<n.length& &(o=n[s]);s++){for(var d,a=0;a<o.removed.length&&(d=o.removed[a]);a++)u.Composed .getParentNode(d)===e&&u.Composed.removeChild(e,d),i.splice(o.index+r,1);r-=o.ad dedCount}for(var o,l,s=0;s<n.length&&(o=n[s]);s++)for(l=i[o.index],a=o.index,d;a <o.index+o.addedCount;a++)d=t[a],u.Composed.insertBefore(e,d,l),i.splice(a,0,d)} ,_matchesContentSelect:function(e,t){var o=t.getAttribute("select");if(!o)return !0;if(o=o.trim(),!o)return!0;if(!(e instanceof Element))return!1;var i=/^(:not\( )?[*.#[a-zA-Z_|]/;return!!i.test(o)&&this.elementMatches(o,e)},_elementAdd:funct ion(){},_elementRemove:function(){}});var c=window.CustomElements&&!CustomElemen ts.useNative}(),Polymer.Settings.useShadow&&Polymer.Base._addFeature({_poolConte nt:function(){},_beginDistribute:function(){},distributeContent:function(){},_di stributeContent:function(){},_finishDistribute:function(){},_createLocalRoot:fun ction(){this.createShadowRoot(),this.shadowRoot.appendChild(this.root),this.root =this.shadowRoot}}),Polymer.Async={_currVal:0,_lastVal:0,_callbacks:[],_twiddleC ontent:0,_twiddle:document.createTextNode(""),run:function(e,t){return t>0?~setT imeout(e,t):(this._twiddle.textContent=this._twiddleContent++,this._callbacks.pu sh(e),this._currVal++)},cancel:function(e){if(e<0)clearTimeout(~e);else{var t=e- this._lastVal;if(t>=0){if(!this._callbacks[t])throw"invalid async handle: "+e;th is._callbacks[t]=null}}},_atEndOfMicrotask:function(){for(var e=this._callbacks. length,t=0;t<e;t++){var o=this._callbacks[t];if(o)try{o()}catch(e){throw t++,thi s._callbacks.splice(0,t),this._lastVal+=t,this._twiddle.textContent=this._twiddl eContent++,e}}this._callbacks.splice(0,e),this._lastVal+=e}},new window.Mutation Observer(function(){Polymer.Async._atEndOfMicrotask()}).observe(Polymer.Async._t widdle,{characterData:!0}),Polymer.Debounce=function(){function e(e,t,i){return e?e.stop():e=new o(this),e.go(t,i),e}var t=Polymer.Async,o=function(e){this.cont ext=e;var t=this;this.boundComplete=function(){t.complete()}};return o.prototype ={go:function(e,o){var i;this.finish=function(){t.cancel(i)},i=t.run(this.boundC omplete,o),this.callback=e},stop:function(){this.finish&&(this.finish(),this.fin ish=null,this.callback=null)},complete:function(){if(this.finish){var e=this.cal lback;this.stop(),e.call(this.context)}}},e}(),Polymer.Base._addFeature({_setupD ebouncers:function(){this._debouncers={}},debounce:function(e,t,o){return this._ debouncers[e]=Polymer.Debounce.call(this,this._debouncers[e],t,o)},isDebouncerAc tive:function(e){var t=this._debouncers[e];return!(!t||!t.finish)},flushDebounce r:function(e){var t=this._debouncers[e];t&&t.complete()},cancelDebouncer:functio n(e){var t=this._debouncers[e];t&&t.stop()}}),Polymer.DomModule=document.createE lement("dom-module"),Polymer.Base._addFeature({_registerFeatures:function(){this ._prepIs(),this._prepBehaviors(),this._prepConstructor(),this._prepTemplate(),th is._prepShady(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHos tAttributes(e.hostAttributes)},_initFeatures:function(){this._registerHost(),thi s._template&&(this._poolContent(),this._beginHosting(),this._stampTemplate(),thi s._endHosting()),this._marshalHostAttributes(),this._setupDebouncers(),this._mar shalBehaviors(),this._tryReady()},_marshalBehavior:function(e){}})</script> <scr ipt>Polymer.nar=[],Polymer.Annotations={parseAnnotations:function(e){var t=[],n= e._content||e.content;return this._parseNodeAnnotations(n,t,e.hasAttribute("stri p-whitespace")),t},_parseNodeAnnotations:function(e,t,n){return e.nodeType===Nod e.TEXT_NODE?this._parseTextNodeAnnotation(e,t):this._parseElementAnnotations(e,t ,n)},_bindingRegex:function(){var e="(?:[a-zA-Z_$][\\w.:$\\-*]*)",t="(?:[-+]?[0- 9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)",n="(?:'(?:[^'\\\\]|\\\\.)*')",r='(?:"(?:[^"\ \\\]|\\\\.)*")',s="(?:"+n+"|"+r+")",i="(?:"+e+"|"+t+"|"+s+"\\s*)",o="(?:"+i+"(?: ,\\s*"+i+")*)",a="(?:\\(\\s*(?:"+o+"?)\\)\\s*)",l="("+e+"\\s*"+a+"?)",h="(\\[\\[ |{{)\\s*",c="(?:]]|}})",u="(?:(!)\\s*)?",f=h+u+l+c;return new RegExp(f,"g")}(),_ parseBindings:function(e){for(var t,n=this._bindingRegex,r=[],s=0;null!==(t=n.ex ec(e));){t.index>s&&r.push({literal:e.slice(s,t.index)});var i,o,a,l=t[1][0],h=B oolean(t[2]),c=t[3].trim();"{"==l&&(a=c.indexOf("::"))>0&&(o=c.substring(a+2),c= c.substring(0,a),i=!0),r.push({compoundIndex:r.length,value:c,mode:l,negate:h,ev ent:o,customEvent:i}),s=n.lastIndex}if(s&&s<e.length){var u=e.substring(s);u&&r. push({literal:u})}if(r.length)return r},_literalFromParts:function(e){for(var t= "",n=0;n<e.length;n++){var r=e[n].literal;t+=r||""}return t},_parseTextNodeAnnot ation:function(e,t){var n=this._parseBindings(e.textContent);if(n){e.textContent =this._literalFromParts(n)||" ";var r={bindings:[{kind:"text",name:"textContent" ,parts:n,isCompound:1!==n.length}]};return t.push(r),r}},_parseElementAnnotation s:function(e,t,n){var r={bindings:[],events:[]};return"content"===e.localName&&( t._hasContent=!0),this._parseChildNodesAnnotations(e,r,t,n),e.attributes&&(this. _parseNodeAttributeAnnotations(e,r,t),this.prepElement&&this.prepElement(e)),(r. bindings.length||r.events.length||r.id)&&t.push(r),r},_parseChildNodesAnnotation s:function(e,t,n,r){if(e.firstChild)for(var s=e.firstChild,i=0;s;){var o=s.nextS ibling;if("template"!==s.localName||s.hasAttribute("preserve-content")||this._pa rseTemplate(s,i,n,t),s.nodeType===Node.TEXT_NODE){for(var a=o;a&&a.nodeType===No de.TEXT_NODE;)s.textContent+=a.textContent,o=a.nextSibling,e.removeChild(a),a=o; r&&!s.textContent.trim()&&(e.removeChild(s),i--)}if(s.parentNode){var l=this._pa rseNodeAnnotations(s,n,r);l&&(l.parent=t,l.index=i)}s=o,i++}},_parseTemplate:fun ction(e,t,n,r){var s=document.createDocumentFragment();s._notes=this.parseAnnota tions(e),s.appendChild(e.content),n.push({bindings:Polymer.nar,events:Polymer.na r,templateContent:s,parent:r,index:t})},_parseNodeAttributeAnnotations:function( e,t){for(var n,r=Array.prototype.slice.call(e.attributes),s=r.length-1;n=r[s];s- -){var i,o=n.name,a=n.value;"on-"===o.slice(0,3)?(e.removeAttribute(o),t.events. push({name:o.slice(3),value:a})):(i=this._parseNodeAttributeAnnotation(e,o,a))?t .bindings.push(i):"id"===o&&(t.id=a)}},_parseNodeAttributeAnnotation:function(e, t,n){var r=this._parseBindings(n);if(r){var s=t,i="property";"$"==t[t.length-1]& &(t=t.slice(0,-1),i="attribute");var o=this._literalFromParts(r);o&&"attribute"= =i&&e.setAttribute(t,o),"input"===e.localName&&"value"===s&&e.setAttribute(s,"") ,e.removeAttribute(s);var a=Polymer.CaseMap.dashToCamelCase(t);return"property"= ==i&&(t=a),{kind:i,name:t,propertyName:a,parts:r,literal:o,isCompound:1!==r.leng th}}},findAnnotatedNode:function(e,t){var n=t.parent&&Polymer.Annotations.findAn notatedNode(e,t.parent);if(!n)return e;for(var r=n.firstChild,s=0;r;r=r.nextSibl ing)if(t.index===s++)return r}},function(){function e(e,t){return e.replace(a,fu nction(e,r,s,i){return r+"'"+n(s.replace(/["']/g,""),t)+"'"+i})}function t(t,r){ for(var s in l)for(var i,o,a,h=l[s],u=0,f=h.length;u<f&&(i=h[u]);u++)"*"!==s&&t. localName!==s||(o=t.attributes[i],a=o&&o.value,a&&a.search(c)<0&&(o.value="style "===i?e(a,r):n(a,r)))}function n(e,t){if(e&&h.test(e))return e;var n=s(t);return n.href=e,n.href||e}function r(e,t){return i||(i=document.implementation.createH TMLDocument("temp"),o=i.createElement("base"),i.head.appendChild(o)),o.href=t,n( e,i)}function s(e){return e.__urlResolver||(e.__urlResolver=e.createElement("a") )}var i,o,a=/(url\()([^)]*)(\))/g,l={"*":["href","src","style","url"],form:["act ion"]},h=/(^\/)|(^#)|(^[\w-\d]*:)/,c=/\{\{|\[\[/;Polymer.ResolveUrl={resolveCss: e,resolveAttrs:t,resolveUrl:r}}(),Polymer.Base._addFeature({_prepAnnotations:fun ction(){if(this._template){var e=this;Polymer.Annotations.prepElement=function(t ){e._prepElement(t)},this._template._content&&this._template._content._notes?thi s._notes=this._template._content._notes:(this._notes=Polymer.Annotations.parseAn notations(this._template),this._processAnnotations(this._notes)),Polymer.Annotat ions.prepElement=null}else this._notes=[]},_processAnnotations:function(e){for(v ar t=0;t<e.length;t++){for(var n=e[t],r=0;r<n.bindings.length;r++)for(var s=n.bi ndings[r],i=0;i<s.parts.length;i++){var o=s.parts[i];if(!o.literal){var a=this._ parseMethod(o.value);a?o.signature=a:o.model=this._modelForPath(o.value)}}if(n.t emplateContent){this._processAnnotations(n.templateContent._notes);var l=n.templ ateContent._parentProps=this._discoverTemplateParentProps(n.templateContent._not es),h=[];for(var c in l){var u="_parent_"+c;h.push({index:n.index,kind:"property ",name:u,propertyName:u,parts:[{mode:"{",model:c,value:c}]})}n.bindings=n.bindin gs.concat(h)}}},_discoverTemplateParentProps:function(e){for(var t,n={},r=0;r<e. length&&(t=e[r]);r++){for(var s,i=0,o=t.bindings;i<o.length&&(s=o[i]);i++)for(va r a,l=0,h=s.parts;l<h.length&&(a=h[l]);l++)if(a.signature){for(var c=a.signature .args,u=0;u<c.length;u++){var f=c[u].model;f&&(n[f]=!0)}a.signature.dynamicFn&&( n[a.signature.method]=!0)}else a.model&&(n[a.model]=!0);if(t.templateContent){va r p=t.templateContent._parentProps;Polymer.Base.mixin(n,p)}}return n},_prepEleme nt:function(e){Polymer.ResolveUrl.resolveAttrs(e,this._template.ownerDocument)}, _findAnnotatedNode:Polymer.Annotations.findAnnotatedNode,_marshalAnnotationRefer ences:function(){this._template&&(this._marshalIdNodes(),this._marshalAnnotatedN odes(),this._marshalAnnotatedListeners())},_configureAnnotationReferences:functi on(){for(var e=this._notes,t=this._nodes,n=0;n<e.length;n++){var r=e[n],s=t[n];t his._configureTemplateContent(r,s),this._configureCompoundBindings(r,s)}},_confi gureTemplateContent:function(e,t){e.templateContent&&(t._content=e.templateConte nt)},_configureCompoundBindings:function(e,t){for(var n=e.bindings,r=0;r<n.lengt h;r++){var s=n[r];if(s.isCompound){for(var i=t.__compoundStorage__||(t.__compoun dStorage__={}),o=s.parts,a=new Array(o.length),l=0;l<o.length;l++)a[l]=o[l].lite ral;var h=s.name;i[h]=a,s.literal&&"property"==s.kind&&(t._configValue?t._config Value(h,s.literal):t[h]=s.literal)}}},_marshalIdNodes:function(){this.$={};for(v ar e,t=0,n=this._notes.length;t<n&&(e=this._notes[t]);t++)e.id&&(this.$[e.id]=th is._findAnnotatedNode(this.root,e))},_marshalAnnotatedNodes:function(){if(this._ notes&&this._notes.length){for(var e=new Array(this._notes.length),t=0;t<this._n otes.length;t++)e[t]=this._findAnnotatedNode(this.root,this._notes[t]);this._nod es=e}},_marshalAnnotatedListeners:function(){for(var e,t=0,n=this._notes.length; t<n&&(e=this._notes[t]);t++)if(e.events&&e.events.length)for(var r,s=this._findA nnotatedNode(this.root,e),i=0,o=e.events;i<o.length&&(r=o[i]);i++)this.listen(s, r.name,r.value)}}),Polymer.Base._addFeature({listeners:{},_listenListeners:funct ion(e){var t,n,r;for(r in e)r.indexOf(".")<0?(t=this,n=r):(n=r.split("."),t=this .$[n[0]],n=n[1]),this.listen(t,n,e[r])},listen:function(e,t,n){var r=this._recal lEventHandler(this,t,e,n);r||(r=this._createEventHandler(e,t,n)),r._listening||( this._listen(e,t,r),r._listening=!0)},_boundListenerKey:function(e,t){return e+" :"+t},_recordEventHandler:function(e,t,n,r,s){var i=e.__boundListeners;i||(i=e._ _boundListeners=new WeakMap);var o=i.get(n);o||(o={},i.set(n,o));var a=this._bou ndListenerKey(t,r);o[a]=s},_recallEventHandler:function(e,t,n,r){var s=e.__bound Listeners;if(s){var i=s.get(n);if(i){var o=this._boundListenerKey(t,r);return i[ o]}}},_createEventHandler:function(e,t,n){var r=this,s=function(e){r[n]?r[n](e,e .detail):r._warn(r._logf("_createEventHandler","listener method `"+n+"` not defi ned"))};return s._listening=!1,this._recordEventHandler(r,t,e,n,s),s},unlisten:f unction(e,t,n){var r=this._recallEventHandler(this,t,e,n);r&&(this._unlisten(e,t ,r),r._listening=!1)},_listen:function(e,t,n){e.addEventListener(t,n)},_unlisten :function(e,t,n){e.removeEventListener(t,n)}}),function(){"use strict";function e(e){for(var t,n=0;n<m.length;n++)t=m[n],e?document.addEventListener(t,P,!0):doc ument.removeEventListener(t,P,!0)}function t(){if(!g){S.mouse.mouseIgnoreJob||e( !0);var t=function(){e(),S.mouse.target=null,S.mouse.mouseIgnoreJob=null};S.mous e.mouseIgnoreJob=Polymer.Debounce(S.mouse.mouseIgnoreJob,t,d)}}function n(e){var t=e.type;if(m.indexOf(t)===-1)return!1;if("mousemove"===t){var n=void 0===e.but tons?1:e.buttons;return e instanceof window.MouseEvent&&!v&&(n=y[e.which]||0),Bo olean(1&n)}var r=void 0===e.button?0:e.button;return 0===r}function r(e){if("cli ck"===e.type){if(0===e.detail)return!0;var t=E.findOriginalTarget(e),n=t.getBoun dingClientRect(),r=e.pageX,s=e.pageY;return!(r>=n.left&&r<=n.right&&s>=n.top&&s< =n.bottom)}return!1}function s(e){for(var t,n=Polymer.dom(e).path,r="auto",s=0;s <n.length;s++)if(t=n[s],t[u]){r=t[u];break}return r}function i(e,t,n){e.movefn=t ,e.upfn=n,document.addEventListener("mousemove",t),document.addEventListener("mo useup",n)}function o(e){document.removeEventListener("mousemove",e.movefn),docum ent.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}var a=Polyme r.DomApi.wrap,l="string"==typeof document.head.style.touchAction,h="__polymerGes tures",c="__polymerGesturesHandled",u="__polymerGesturesTouchAction",f=25,p=5,_= 2,d=2500,m=["mousedown","mousemove","mouseup","click"],y=[0,1,4,2],v=function(){ try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}(), g=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/),P=function(e){var t=e.so urceCapabilities;if((!t||t.firesTouchEvents)&&(e[c]={skip:!0},"click"===e.type)) {for(var n=Polymer.dom(e).path,r=0;r<n.length;r++)if(n[r]===S.mouse.target)retur n;e.preventDefault(),e.stopPropagation()}},S={mouse:{target:null,mouseIgnoreJob: null},touch:{x:0,y:0,id:-1,scrollDecided:!1}},E={gestures:{},recognizers:[],deep TargetFind:function(e,t){for(var n=document.elementFromPoint(e,t),r=n;r&&r.shado wRoot;)r=r.shadowRoot.elementFromPoint(e,t),r&&(n=r);return n},findOriginalTarge t:function(e){return e.path?e.path[0]:e.target},handleNative:function(e){var n,r =e.type,s=a(e.currentTarget),i=s[h];if(i){var o=i[r];if(o){if(!e[c]&&(e[c]={},"t ouch"===r.slice(0,5))){var u=e.changedTouches[0];if("touchstart"===r&&1===e.touc hes.length&&(S.touch.id=u.identifier),S.touch.id!==u.identifier)return;l||"touch start"!==r&&"touchmove"!==r||E.handleTouchAction(e),"touchend"===r&&(S.mouse.tar get=Polymer.dom(e).rootTarget,t())}if(n=e[c],!n.skip){for(var f,p=E.recognizers, _=0;_<p.length;_++)f=p[_],o[f.name]&&!n[f.name]&&f.flow&&f.flow.start.indexOf(e. type)>-1&&f.reset&&f.reset();for(_=0,f;_<p.length;_++)f=p[_],o[f.name]&&!n[f.nam e]&&(n[f.name]=!0,f[r](e))}}}},handleTouchAction:function(e){var t=e.changedTouc hes[0],n=e.type;if("touchstart"===n)S.touch.x=t.clientX,S.touch.y=t.clientY,S.to uch.scrollDecided=!1;else if("touchmove"===n){if(S.touch.scrollDecided)return;S. touch.scrollDecided=!0;var r=s(e),i=!1,o=Math.abs(S.touch.x-t.clientX),a=Math.ab s(S.touch.y-t.clientY);e.cancelable&&("none"===r?i=!0:"pan-x"===r?i=a>o:"pan-y"= ==r&&(i=o>a)),i?e.preventDefault():E.prevent("track")}},add:function(e,t,n){e=a( e);var r=this.gestures[t],s=r.deps,i=r.name,o=e[h];o||(e[h]=o={});for(var l,c,u= 0;u<s.length;u++)l=s[u],g&&m.indexOf(l)>-1||(c=o[l],c||(o[l]=c={_count:0}),0===c ._count&&e.addEventListener(l,this.handleNative),c[i]=(c[i]||0)+1,c._count=(c._c ount||0)+1);e.addEventListener(t,n),r.touchAction&&this.setTouchAction(e,r.touch Action)},remove:function(e,t,n){e=a(e);var r=this.gestures[t],s=r.deps,i=r.name, o=e[h];if(o)for(var l,c,u=0;u<s.length;u++)l=s[u],c=o[l],c&&c[i]&&(c[i]=(c[i]||1 )-1,c._count=(c._count||1)-1,0===c._count&&e.removeEventListener(l,this.handleNa tive));e.removeEventListener(t,n)},register:function(e){this.recognizers.push(e) ;for(var t=0;t<e.emits.length;t++)this.gestures[e.emits[t]]=e},findRecognizerByE vent:function(e){for(var t,n=0;n<this.recognizers.length;n++){t=this.recognizers [n];for(var r,s=0;s<t.emits.length;s++)if(r=t.emits[s],r===e)return t}return nul l},setTouchAction:function(e,t){l&&(e.style.touchAction=t),e[u]=t},fire:function (e,t,n){var r=Polymer.Base.fire(t,n,{node:e,bubbles:!0,cancelable:!0});if(r.defa ultPrevented){var s=n.preventer||n.sourceEvent;s&&s.preventDefault&&s.preventDef ault()}},prevent:function(e){var t=this.findRecognizerByEvent(e);t.info&&(t.info .prevent=!0)},resetMouseCanceller:function(){S.mouse.mouseIgnoreJob&&S.mouse.mou seIgnoreJob.complete()}};E.register({name:"downup",deps:["mousedown","touchstart ","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]} ,emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){o(this.info)} ,mousedown:function(e){if(n(e)){var t=E.findOriginalTarget(e),r=this,s=function( e){n(e)||(r.fire("up",t,e),o(r.info))},a=function(e){n(e)&&r.fire("up",t,e),o(r. info)};i(this.info,s,a),this.fire("down",t,e)}},touchstart:function(e){this.fire ("down",E.findOriginalTarget(e),e.changedTouches[0],e)},touchend:function(e){thi s.fire("up",E.findOriginalTarget(e),e.changedTouches[0],e)},fire:function(e,t,n, r){E.fire(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:r,prevent:functio n(e){return E.prevent(e)}})}}),E.register({name:"track",touchAction:"none",deps: ["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touc hstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start" ,started:!1,moves:[],addMove:function(e){this.moves.length>_&&this.moves.shift() ,this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.inf o.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info. y=0,this.info.prevent=!1,o(this.info)},hasMovedEnough:function(e,t){if(this.info .prevent)return!1;if(this.info.started)return!0;var n=Math.abs(this.info.x-e),r= Math.abs(this.info.y-t);return n>=p||r>=p},mousedown:function(e){if(n(e)){var t= E.findOriginalTarget(e),r=this,s=function(e){var s=e.clientX,i=e.clientY;r.hasMo vedEnough(s,i)&&(r.info.state=r.info.started?"mouseup"===e.type?"end":"track":"s tart","start"===r.info.state&&E.prevent("tap"),r.info.addMove({x:s,y:i}),n(e)||( r.info.state="end",o(r.info)),r.fire(t,e),r.info.started=!0)},a=function(e){r.in fo.started&&s(e),o(r.info)};i(this.info,s,a),this.info.x=e.clientX,this.info.y=e .clientY}},touchstart:function(e){var t=e.changedTouches[0];this.info.x=t.client X,this.info.y=t.clientY},touchmove:function(e){var t=E.findOriginalTarget(e),n=e .changedTouches[0],r=n.clientX,s=n.clientY;this.hasMovedEnough(r,s)&&("start"=== this.info.state&&E.prevent("tap"),this.info.addMove({x:r,y:s}),this.fire(t,n),th is.info.state="track",this.info.started=!0)},touchend:function(e){var t=E.findOr iginalTarget(e),n=e.changedTouches[0];this.info.started&&(this.info.state="end", this.info.addMove({x:n.clientX,y:n.clientY}),this.fire(t,n,e))},fire:function(e, t,n){var r,s=this.info.moves[this.info.moves.length-2],i=this.info.moves[this.in fo.moves.length-1],o=i.x-this.info.x,a=i.y-this.info.y,l=0;return s&&(r=i.x-s.x, l=i.y-s.y),E.fire(e,"track",{state:this.info.state,x:t.clientX,y:t.clientY,dx:o, dy:a,ddx:r,ddy:l,sourceEvent:t,preventer:n,hover:function(){return E.deepTargetF ind(t.clientX,t.clientY)}})}}),E.register({name:"tap",deps:["mousedown","click", "touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","to uchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info .x=NaN,this.info.y=NaN,this.info.prevent=!1},save:function(e){this.info.x=e.clie ntX,this.info.y=e.clientY},mousedown:function(e){n(e)&&this.save(e)},click:funct ion(e){n(e)&&this.forward(e)},touchstart:function(e){this.save(e.changedTouches[ 0],e)},touchend:function(e){this.forward(e.changedTouches[0],e)},forward:functio n(e,t){var n=Math.abs(e.clientX-this.info.x),s=Math.abs(e.clientY-this.info.y),i =E.findOriginalTarget(e);(isNaN(n)||isNaN(s)||n<=f&&s<=f||r(e))&&(this.info.prev ent||E.fire(i,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:t}))}});var C={x:"pan-x",y:"pan-y",none:"none",all:"auto"};Polymer.Base._addFeature({_setup Gestures:function(){this.__polymerGestures=null},_listen:function(e,t,n){E.gestu res[t]?E.add(e,t,n):e.addEventListener(t,n)},_unlisten:function(e,t,n){E.gesture s[t]?E.remove(e,t,n):e.removeEventListener(t,n)},setScrollDirection:function(e,t ){t=t||this,E.setTouchAction(t,C[e]||"auto")}}),Polymer.Gestures=E}(),function() {"use strict";if(Polymer.Base._addFeature({$$:function(e){return Polymer.dom(thi s.root).querySelector(e)},toggleClass:function(e,t,n){n=n||this,1==arguments.len gth&&(t=!n.classList.contains(e)),t?Polymer.dom(n).classList.add(e):Polymer.dom( n).classList.remove(e)},toggleAttribute:function(e,t,n){n=n||this,1==arguments.l ength&&(t=!n.hasAttribute(e)),t?Polymer.dom(n).setAttribute(e,""):Polymer.dom(n) .removeAttribute(e)},classFollows:function(e,t,n){n&&Polymer.dom(n).classList.re move(e),t&&Polymer.dom(t).classList.add(e)},attributeFollows:function(e,t,n){n&& Polymer.dom(n).removeAttribute(e),t&&Polymer.dom(t).setAttribute(e,"")},getEffec tiveChildNodes:function(){return Polymer.dom(this).getEffectiveChildNodes()},get EffectiveChildren:function(){var e=Polymer.dom(this).getEffectiveChildNodes();re turn e.filter(function(e){return e.nodeType===Node.ELEMENT_NODE})},getEffectiveT extContent:function(){for(var e,t=this.getEffectiveChildNodes(),n=[],r=0;e=t[r]; r++)e.nodeType!==Node.COMMENT_NODE&&n.push(Polymer.dom(e).textContent);return n. join("")},queryEffectiveChildren:function(e){var t=Polymer.dom(this).queryDistri butedElements(e);return t&&t[0]},queryAllEffectiveChildren:function(e){return Po lymer.dom(this).queryDistributedElements(e)},getContentChildNodes:function(e){va r t=Polymer.dom(this.root).querySelector(e||"content");return t?Polymer.dom(t).g etDistributedNodes():[]},getContentChildren:function(e){return this.getContentCh ildNodes(e).filter(function(e){return e.nodeType===Node.ELEMENT_NODE})},fire:fun ction(e,t,n){n=n||Polymer.nob;var r=n.node||this;t=null===t||void 0===t?{}:t;var s=void 0===n.bubbles||n.bubbles,i=Boolean(n.cancelable),o=n._useCache,a=this._g etEvent(e,s,i,o);return a.detail=t,o&&(this.__eventCache[e]=null),r.dispatchEven t(a),o&&(this.__eventCache[e]=a),a},__eventCache:{},_getEvent:function(e,t,n,r){ var s=r&&this.__eventCache[e];return s&&s.bubbles==t&&s.cancelable==n||(s=new Ev ent(e,{bubbles:Boolean(t),cancelable:n})),s},async:function(e,t){var n=this;retu rn Polymer.Async.run(function(){e.call(n)},t)},cancelAsync:function(e){Polymer.A sync.cancel(e)},arrayDelete:function(e,t){var n;if(Array.isArray(e)){if(n=e.inde xOf(t),n>=0)return e.splice(n,1)}else{var r=this._get(e);if(n=r.indexOf(t),n>=0) return this.splice(e,n,1)}},transform:function(e,t){t=t||this,t.style.webkitTran sform=e,t.style.transform=e},translate3d:function(e,t,n,r){r=r||this,this.transf orm("translate3d("+e+","+t+","+n+")",r)},importHref:function(e,t,n,r){var s=docu ment.createElement("link");s.rel="import",s.href=e;var i=Polymer.Base.importHref .imported=Polymer.Base.importHref.imported||{},o=i[s.href],a=o||s,l=this;if(t){v ar h=function(e){return e.target.__firedLoad=!0,e.target.removeEventListener("lo ad",h),t.call(l,e)};a.addEventListener("load",h)}if(n){var c=function(e){return e.target.__firedError=!0,e.target.removeEventListener("error",c),n.call(l,e)};a. addEventListener("error",c)}return o?(o.__firedLoad&&o.dispatchEvent(new Event(" load")),o.__firedError&&o.dispatchEvent(new Event("error"))):(i[s.href]=s,r=Bool ean(r),r&&s.setAttribute("async",""),document.head.appendChild(s)),a},create:fun ction(e,t){var n=document.createElement(e);if(t)for(var r in t)n[r]=t[r];return n},isLightDescendant:function(e){return this!==e&&this.contains(e)&&Polymer.dom( this).getOwnerRoot()===Polymer.dom(e).getOwnerRoot()},isLocalDescendant:function (e){return this.root===Polymer.dom(e).getOwnerRoot()}}),!Polymer.Settings.useNat iveCustomElements){var e=Polymer.Base.importHref;Polymer.Base.importHref=functio n(t,n,r,s){CustomElements.ready=!1;var i=function(e){if(CustomElements.upgradeDo cumentTree(document),CustomElements.ready=!0,n)return n.call(this,e)};return e.c all(this,t,i,r,s)}}}(),Polymer.Bind={prepareModel:function(e){Polymer.Base.mixin (e,this._modelApi)},_modelApi:{_notifyChange:function(e,t,n){n=void 0===n?this[e ]:n,t=t||Polymer.CaseMap.camelToDashCase(e)+"-changed",this.fire(t,{value:n},{bu bbles:!1,cancelable:!1,_useCache:!0})},_propertySetter:function(e,t,n,r){var s=t his.__data__[e];return s===t||s!==s&&t!==t||(this.__data__[e]=t,"object"==typeof t&&this._clearPath(e),this._propertyChanged&&this._propertyChanged(e,t,s),n&&th is._effectEffects(e,t,n,s,r)),s},__setProperty:function(e,t,n,r){r=r||this;var s =r._propertyEffects&&r._propertyEffects[e];s?r._propertySetter(e,t,s,n):r[e]!==t &&(r[e]=t)},_effectEffects:function(e,t,n,r,s){for(var i,o=0,a=n.length;o<a&&(i= n[o]);o++)i.fn.call(this,e,this[e],i.effect,r,s)},_clearPath:function(e){for(var t in this.__data__)0===t.indexOf(e+".")&&(this.__data__[t]=void 0)}},ensureProp ertyEffects:function(e,t){e._propertyEffects||(e._propertyEffects={});var n=e._p ropertyEffects[t];return n||(n=e._propertyEffects[t]=[]),n},addPropertyEffect:fu nction(e,t,n,r){var s=this.ensurePropertyEffects(e,t),i={kind:n,effect:r,fn:Poly mer.Bind["_"+n+"Effect"]};return s.push(i),i},createBindings:function(e){var t=e ._propertyEffects;if(t)for(var n in t){var r=t[n];r.sort(this._sortPropertyEffec ts),this._createAccessors(e,n,r)}},_sortPropertyEffects:function(){var e={comput e:0,annotation:1,annotatedComputation:2,reflect:3,notify:4,observer:5,complexObs erver:6,function:7};return function(t,n){return e[t.kind]-e[n.kind]}}(),_createA ccessors:function(e,t,n){var r={get:function(){return this.__data__[t]}},s=funct ion(e){this._propertySetter(t,e,n)},i=e.getPropertyInfo&&e.getPropertyInfo(t);i& &i.readOnly?i.computed||(e["_set"+this.upper(t)]=s):r.set=s,Object.definePropert y(e,t,r)},upper:function(e){return e[0].toUpperCase()+e.substring(1)},_addAnnota tedListener:function(e,t,n,r,s,i){e._bindListeners||(e._bindListeners=[]);var o= this._notedListenerFactory(n,r,this._isStructured(r),i),a=s||Polymer.CaseMap.cam elToDashCase(n)+"-changed";e._bindListeners.push({index:t,property:n,path:r,chan gedFn:o,event:a})},_isStructured:function(e){return e.indexOf(".")>0},_isEventBo gus:function(e,t){return e.path&&e.path[0]!==t},_notedListenerFactory:function(e ,t,n,r){return function(s,i,o){o?this._notifyPath(this._fixPath(t,e,o),i):(i=s[e ],r&&(i=!i),n?this.__data__[t]!=i&&this.set(t,i):this[t]=i)}},prepareInstance:fu nction(e){e.__data__=Object.create(null)},setupBindListeners:function(e){for(var t,n=e._bindListeners,r=0,s=n.length;r<s&&(t=n[r]);r++){var i=e._nodes[t.index]; this._addNotifyListener(i,e,t.event,t.changedFn)}},_addNotifyListener:function(e ,t,n,r){e.addEventListener(n,function(e){return t._notifyListener(r,e)})}},Polym er.Base.extend(Polymer.Bind,{_shouldAddListener:function(e){return e.name&&"attr ibute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode},_annotatio nEffect:function(e,t,n){e!=n.value&&(t=this._get(n.value),this.__data__[n.value] =t),this._applyEffectValue(n,t)},_reflectEffect:function(e,t,n){this.reflectProp ertyToAttribute(e,n.attribute,t)},_notifyEffect:function(e,t,n,r,s){s||this._not ifyChange(e,n.event,t)},_functionEffect:function(e,t,n,r,s){n.call(this,e,t,r,s) },_observerEffect:function(e,t,n,r){var s=this[n.method];s?s.call(this,t,r):this ._warn(this._logf("_observerEffect","observer method `"+n.method+"` not defined" ))},_complexObserverEffect:function(e,t,n){var r=this[n.method];if(r){var s=Poly mer.Bind._marshalArgs(this.__data__,n,e,t);s&&r.apply(this,s)}else n.dynamicFn|| this._warn(this._logf("_complexObserverEffect","observer method `"+n.method+"` n ot defined"))},_computeEffect:function(e,t,n){var r=this[n.method];if(r){var s=P olymer.Bind._marshalArgs(this.__data__,n,e,t);if(s){var i=r.apply(this,s);this._ _setProperty(n.name,i)}}else n.dynamicFn||this._warn(this._logf("_computeEffect" ,"compute method `"+n.method+"` not defined"))},_annotatedComputationEffect:func tion(e,t,n){var r=this._rootDataHost||this,s=r[n.method];if(s){var i=Polymer.Bin d._marshalArgs(this.__data__,n,e,t);if(i){var o=s.apply(r,i);this._applyEffectVa lue(n,o)}}else n.dynamicFn||r._warn(r._logf("_annotatedComputationEffect","compu te method `"+n.method+"` not defined"))},_marshalArgs:function(e,t,n,r){for(var s=[],i=t.args,o=i.length>1||t.dynamicFn,a=0,l=i.length;a<l;a++){var h,c=i[a],u=c .name;if(c.literal?h=c.value:n===u?h=r:(h=e[u],void 0===h&&c.structured&&(h=Poly mer.Base._get(u,e))),o&&void 0===h)return;if(c.wildcard){var f=0===n.indexOf(u+" .");s[a]={path:f?n:u,value:f?r:h,base:h}}else s[a]=h}return s}}),Polymer.Base._a ddFeature({_addPropertyEffect:function(e,t,n){var r=Polymer.Bind.addPropertyEffe ct(this,e,t,n);r.pathFn=this["_"+r.kind+"PathEffect"]},_prepEffects:function(){P olymer.Bind.prepareModel(this),this._addAnnotationEffects(this._notes)},_prepBin dings:function(){Polymer.Bind.createBindings(this)},_addPropertyEffects:function (e){if(e)for(var t in e){var n=e[t];if(n.observer&&this._addObserverEffect(t,n.o bserver),n.computed&&(n.readOnly=!0,this._addComputedEffect(t,n.computed)),n.not ify&&this._addPropertyEffect(t,"notify",{event:Polymer.CaseMap.camelToDashCase(t )+"-changed"}),n.reflectToAttribute){var r=Polymer.CaseMap.camelToDashCase(t);"- "===r[0]?this._warn(this._logf("_addPropertyEffects","Property "+t+" cannot be r eflected to attribute "+r+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')):this._addPropertyEffec t(t,"reflect",{attribute:r})}n.readOnly&&Polymer.Bind.ensurePropertyEffects(this ,t)}},_addComputedEffect:function(e,t){for(var n,r=this._parseMethod(t),s=r.dyna micFn,i=0;i<r.args.length&&(n=r.args[i]);i++)this._addPropertyEffect(n.model,"co mpute",{method:r.method,args:r.args,trigger:n,name:e,dynamicFn:s});s&&this._addP ropertyEffect(r.method,"compute",{method:r.method,args:r.args,trigger:null,name: e,dynamicFn:s})},_addObserverEffect:function(e,t){this._addPropertyEffect(e,"obs erver",{method:t,property:e})},_addComplexObserverEffects:function(e){if(e)for(v ar t,n=0;n<e.length&&(t=e[n]);n++)this._addComplexObserverEffect(t)},_addComplex ObserverEffect:function(e){var t=this._parseMethod(e);if(!t)throw new Error("Mal formed observer expression '"+e+"'");for(var n,r=t.dynamicFn,s=0;s<t.args.length &&(n=t.args[s]);s++)this._addPropertyEffect(n.model,"complexObserver",{method:t. method,args:t.args,trigger:n,dynamicFn:r});r&&this._addPropertyEffect(t.method," complexObserver",{method:t.method,args:t.args,trigger:null,dynamicFn:r})},_addAn notationEffects:function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++)for(var r,s=t .bindings,i=0;i<s.length&&(r=s[i]);i++)this._addAnnotationEffect(r,n)},_addAnnot ationEffect:function(e,t){Polymer.Bind._shouldAddListener(e)&&Polymer.Bind._addA nnotatedListener(this,t,e.name,e.parts[0].value,e.parts[0].event,e.parts[0].nega te);for(var n=0;n<e.parts.length;n++){var r=e.parts[n];r.signature?this._addAnno tatedComputationEffect(e,r,t):r.literal||("attribute"===e.kind&&"-"===e.name[0]? this._warn(this._logf("_addAnnotationEffect","Cannot set attribute "+e.name+' be cause "-" is not a valid attribute starting character')):this._addPropertyEffect (r.model,"annotation",{kind:e.kind,index:t,name:e.name,propertyName:e.propertyNa me,value:r.value,isCompound:e.isCompound,compoundIndex:r.compoundIndex,event:r.e vent,customEvent:r.customEvent,negate:r.negate}))}},_addAnnotatedComputationEffe ct:function(e,t,n){var r=t.signature;if(r.static)this.__addAnnotatedComputationE ffect("__static__",n,e,t,null);else{for(var s,i=0;i<r.args.length&&(s=r.args[i]) ;i++)s.literal||this.__addAnnotatedComputationEffect(s.model,n,e,t,s);r.dynamicF n&&this.__addAnnotatedComputationEffect(r.method,n,e,t,null)}},__addAnnotatedCom putationEffect:function(e,t,n,r,s){this._addPropertyEffect(e,"annotatedComputati on",{index:t,isCompound:n.isCompound,compoundIndex:r.compoundIndex,kind:n.kind,n ame:n.name,negate:r.negate,method:r.signature.method,args:r.signature.args,trigg er:s,dynamicFn:r.signature.dynamicFn})},_parseMethod:function(e){var t=e.match(/ ([^\s]+?)\(([\s\S]*)\)/);if(t){var n={method:t[1],static:!0};if(this.getProperty Info(n.method)!==Polymer.nob&&(n.static=!1,n.dynamicFn=!0),t[2].trim()){var r=t[ 2].replace(/\\,/g,"&comma;").split(",");return this._parseArgs(r,n)}return n.arg s=Polymer.nar,n}},_parseArgs:function(e,t){return t.args=e.map(function(e){var n =this._parseArg(e);return n.literal||(t.static=!1),n},this),t},_parseArg:functio n(e){var t=e.trim().replace(/&comma;/g,",").replace(/\\(.)/g,"$1"),n={name:t},r= t[0];switch("-"===r&&(r=t[1]),r>="0"&&r<="9"&&(r="#"),r){case"'":case'"':n.value =t.slice(1,-1),n.literal=!0;break;case"#":n.value=Number(t),n.literal=!0}return n.literal||(n.model=this._modelForPath(t),n.structured=t.indexOf(".")>0,n.struct ured&&(n.wildcard=".*"==t.slice(-2),n.wildcard&&(n.name=t.slice(0,-2)))),n},_mar shalInstanceEffects:function(){Polymer.Bind.prepareInstance(this),this._bindList eners&&Polymer.Bind.setupBindListeners(this)},_applyEffectValue:function(e,t){va r n=this._nodes[e.index],r=e.name;if(t=this._computeFinalAnnotationValue(n,r,t,e ),"attribute"==e.kind)this.serializeValueToAttribute(t,r,n);else{var s=n._proper tyInfo&&n._propertyInfo[r];if(s&&s.readOnly)return;this.__setProperty(r,t,!1,n)} },_computeFinalAnnotationValue:function(e,t,n,r){if(r.negate&&(n=!n),r.isCompoun d){var s=e.__compoundStorage__[t];s[r.compoundIndex]=n,n=s.join("")}return"attri bute"!==r.kind&&("className"===t&&(n=this._scopeElementClass(e,n)),("textContent "===t||"input"==e.localName&&"value"==t)&&(n=void 0==n?"":n)),n},_executeStaticE ffects:function(){this._propertyEffects&&this._propertyEffects.__static__&&this. _effectEffects("__static__",null,this._propertyEffects.__static__)}}),function() {var e=Polymer.Settings.usePolyfillProto;Polymer.Base._addFeature({_setupConfigu re:function(e){if(this._config={},this._handlers=[],this._aboveConfig=null,e)for (var t in e)void 0!==e[t]&&(this._config[t]=e[t])},_marshalAttributes:function() {this._takeAttributesToModel(this._config)},_attributeChangedImpl:function(e){va r t=this._clientsReadied?this:this._config;this._setAttributeToProperty(t,e)},_c onfigValue:function(e,t){var n=this._propertyInfo[e];n&&n.readOnly||(this._confi g[e]=t)},_beforeClientsReady:function(){this._configure()},_configure:function() {this._configureAnnotationReferences(),this._configureInstanceProperties(),this. _aboveConfig=this.mixin({},this._config);for(var e={},t=0;t<this.behaviors.lengt h;t++)this._configureProperties(this.behaviors[t].properties,e);this._configureP roperties(this.properties,e),this.mixin(e,this._aboveConfig),this._config=e,this ._clients&&this._clients.length&&this._distributeConfig(this._config)},_configur eInstanceProperties:function(){for(var t in this._propertyEffects)!e&&this.hasOw nProperty(t)&&(this._configValue(t,this[t]),delete this[t])},_configurePropertie s:function(e,t){for(var n in e){var r=e[n];if(void 0!==r.value){var s=r.value;"f unction"==typeof s&&(s=s.call(this,this._config)),t[n]=s}}},_distributeConfig:fu nction(e){var t=this._propertyEffects;if(t)for(var n in e){var r=t[n];if(r)for(v ar s,i=0,o=r.length;i<o&&(s=r[i]);i++)if("annotation"===s.kind){var a=this._node s[s.effect.index],l=s.effect.propertyName,h="attribute"==s.effect.kind,c=a._prop ertyEffects&&a._propertyEffects[l];if(a._configValue&&(c||!h)){var u=n===s.effec t.value?e[n]:this._get(s.effect.value,e);u=this._computeFinalAnnotationValue(a,l ,u,s.effect),h&&(u=a.deserialize(this.serialize(u),a._propertyInfo[l].type)),a._ configValue(l,u)}}}},_afterClientsReady:function(){this._executeStaticEffects(), this._applyConfig(this._config,this._aboveConfig),
3 this._flushHandlers()},_applyConfig:function(e,t){for(var n in e)void 0===this[n ]&&this.__setProperty(n,e[n],n in t)},_notifyListener:function(e,t){if(!Polymer. Bind._isEventBogus(t,t.target)){var n,r;if(t.detail&&(n=t.detail.value,r=t.detai l.path),this._clientsReadied)return e.call(this,t.target,n,r);this._queueHandler ([e,t.target,n,r])}},_queueHandler:function(e){this._handlers.push(e)},_flushHan dlers:function(){for(var e,t=this._handlers,n=0,r=t.length;n<r&&(e=t[n]);n++)e[0 ].call(this,e[1],e[2],e[3]);this._handlers=[]}})}(),function(){"use strict";Poly mer.Base._addFeature({notifyPath:function(e,t,n){var r={},s=this._get(e,this,r); 1===arguments.length&&(t=s),r.path&&this._notifyPath(r.path,t,n)},_notifyPath:fu nction(e,t,n){var r=this._propertySetter(e,t);if(r!==t&&(r===r||t===t))return th is._pathEffector(e,t),n||this._notifyPathUp(e,t),!0},_getPathParts:function(e){i f(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)for(var r=e[n].toString().sp lit("."),s=0;s<r.length;s++)t.push(r[s]);return t}return e.toString().split(".") },set:function(e,t,n){var r,s=n||this,i=this._getPathParts(e),o=i[i.length-1];if (i.length>1){for(var a=0;a<i.length-1;a++){var l=i[a];if(r&&"#"==l[0]?s=Polymer. Collection.get(r).getItem(l):(s=s[l],r&&parseInt(l,10)==l&&(i[a]=Polymer.Collect ion.get(r).getKey(s))),!s)return;r=Array.isArray(s)?s:null}if(r){var h,c,u=Polym er.Collection.get(r);"#"==o[0]?(c=o,h=u.getItem(c),o=r.indexOf(h),u.setItem(c,t) ):parseInt(o,10)==o&&(h=s[o],c=u.getKey(h),i[a]=c,u.setItem(c,t))}s[o]=t,n||this ._notifyPath(i.join("."),t)}else s[e]=t},get:function(e,t){return this._get(e,t) },_get:function(e,t,n){for(var r,s=t||this,i=this._getPathParts(e),o=0;o<i.lengt h;o++){if(!s)return;var a=i[o];r&&"#"==a[0]?s=Polymer.Collection.get(r).getItem( a):(s=s[a],n&&r&&parseInt(a,10)==a&&(i[o]=Polymer.Collection.get(r).getKey(s))), r=Array.isArray(s)?s:null}return n&&(n.path=i.join(".")),s},_pathEffector:functi on(e,t){var n=this._modelForPath(e),r=this._propertyEffects&&this._propertyEffec ts[n];if(r)for(var s,i=0;i<r.length&&(s=r[i]);i++){var o=s.pathFn;o&&o.call(this ,e,t,s.effect)}this._boundPaths&&this._notifyBoundPaths(e,t)},_annotationPathEff ect:function(e,t,n){if(n.value===e||0===n.value.indexOf(e+"."))Polymer.Bind._ann otationEffect.call(this,e,t,n);else if(0===e.indexOf(n.value+".")&&!n.negate){va r r=this._nodes[n.index];if(r&&r._notifyPath){var s=this._fixPath(n.name,n.value ,e);r._notifyPath(s,t,!0)}}},_complexObserverPathEffect:function(e,t,n){this._pa thMatchesEffect(e,n)&&Polymer.Bind._complexObserverEffect.call(this,e,t,n)},_com putePathEffect:function(e,t,n){this._pathMatchesEffect(e,n)&&Polymer.Bind._compu teEffect.call(this,e,t,n)},_annotatedComputationPathEffect:function(e,t,n){this. _pathMatchesEffect(e,n)&&Polymer.Bind._annotatedComputationEffect.call(this,e,t, n)},_pathMatchesEffect:function(e,t){var n=t.trigger.name;return n==e||0===n.ind exOf(e+".")||t.trigger.wildcard&&0===e.indexOf(n+".")},linkPaths:function(e,t){t his._boundPaths=this._boundPaths||{},t?this._boundPaths[e]=t:this.unlinkPaths(e) },unlinkPaths:function(e){this._boundPaths&&delete this._boundPaths[e]},_notifyB oundPaths:function(e,t){for(var n in this._boundPaths){var r=this._boundPaths[n] ;0==e.indexOf(n+".")?this._notifyPath(this._fixPath(r,n,e),t):0==e.indexOf(r+"." )&&this._notifyPath(this._fixPath(n,r,e),t)}},_fixPath:function(e,t,n){return e+ n.slice(t.length)},_notifyPathUp:function(e,t){var n=this._modelForPath(e),r=Pol ymer.CaseMap.camelToDashCase(n),s=r+this._EVENT_CHANGED;this.fire(s,{path:e,valu e:t},{bubbles:!1,_useCache:!0})},_modelForPath:function(e){var t=e.indexOf("."); return t<0?e:e.slice(0,t)},_EVENT_CHANGED:"-changed",notifySplices:function(e,t) {var n={},r=this._get(e,this,n);this._notifySplices(r,n.path,t)},_notifySplices: function(e,t,n){var r={keySplices:Polymer.Collection.applySplices(e,n),indexSpli ces:n},s=t+".splices";this._notifyPath(s,r),this._notifyPath(t+".length",e.lengt h),this.__data__[s]={keySplices:null,indexSplices:null}},_notifySplice:function( e,t,n,r,s){this._notifySplices(e,t,[{index:n,addedCount:r,removed:s,object:e,typ e:"splice"}])},push:function(e){var t={},n=this._get(e,this,t),r=Array.prototype .slice.call(arguments,1),s=n.length,i=n.push.apply(n,r);return r.length&&this._n otifySplice(n,t.path,s,r.length,[]),i},pop:function(e){var t={},n=this._get(e,th is,t),r=Boolean(n.length),s=Array.prototype.slice.call(arguments,1),i=n.pop.appl y(n,s);return r&&this._notifySplice(n,t.path,n.length,0,[i]),i},splice:function( e,t){var n={},r=this._get(e,this,n);t=t<0?r.length-Math.floor(-t):Math.floor(t), t||(t=0);var s=Array.prototype.slice.call(arguments,1),i=r.splice.apply(r,s),o=M ath.max(s.length-2,0);return(o||i.length)&&this._notifySplice(r,n.path,t,o,i),i} ,shift:function(e){var t={},n=this._get(e,this,t),r=Boolean(n.length),s=Array.pr ototype.slice.call(arguments,1),i=n.shift.apply(n,s);return r&&this._notifySplic e(n,t.path,0,0,[i]),i},unshift:function(e){var t={},n=this._get(e,this,t),r=Arra y.prototype.slice.call(arguments,1),s=n.unshift.apply(n,r);return r.length&&this ._notifySplice(n,t.path,0,r.length,[]),s},prepareModelNotifyPath:function(e){thi s.mixin(e,{fire:Polymer.Base.fire,_getEvent:Polymer.Base._getEvent,__eventCache: Polymer.Base.__eventCache,notifyPath:Polymer.Base.notifyPath,_get:Polymer.Base._ get,_EVENT_CHANGED:Polymer.Base._EVENT_CHANGED,_notifyPath:Polymer.Base._notifyP ath,_notifyPathUp:Polymer.Base._notifyPathUp,_pathEffector:Polymer.Base._pathEff ector,_annotationPathEffect:Polymer.Base._annotationPathEffect,_complexObserverP athEffect:Polymer.Base._complexObserverPathEffect,_annotatedComputationPathEffec t:Polymer.Base._annotatedComputationPathEffect,_computePathEffect:Polymer.Base._ computePathEffect,_modelForPath:Polymer.Base._modelForPath,_pathMatchesEffect:Po lymer.Base._pathMatchesEffect,_notifyBoundPaths:Polymer.Base._notifyBoundPaths,_ getPathParts:Polymer.Base._getPathParts})}})}(),Polymer.Base._addFeature({resolv eUrl:function(e){var t=Polymer.DomModule.import(this.is),n="";if(t){var r=t.getA ttribute("assetpath")||"";n=Polymer.ResolveUrl.resolveUrl(r,t.ownerDocument.base URI)}return Polymer.ResolveUrl.resolveUrl(e,n)}}),Polymer.CssParse=function(){re turn{parse:function(e){return e=this._clean(e),this._parseCss(this._lex(e),e)},_ clean:function(e){return e.replace(this._rx.comments,"").replace(this._rx.port," ")},_lex:function(e){for(var t={start:0,end:e.length},n=t,r=0,s=e.length;r<s;r++ )switch(e[r]){case this.OPEN_BRACE:n.rules||(n.rules=[]);var i=n,o=i.rules[i.rul es.length-1];n={start:r+1,parent:i,previous:o},i.rules.push(n);break;case this.C LOSE_BRACE:n.end=r+1,n=n.parent||t}return t},_parseCss:function(e,t){var n=t.sub string(e.start,e.end-1);if(e.parsedCssText=e.cssText=n.trim(),e.parent){var r=e. previous?e.previous.end:e.parent.start;n=t.substring(r,e.start-1),n=this._expand UnicodeEscapes(n),n=n.replace(this._rx.multipleSpaces," "),n=n.substring(n.lastI ndexOf(";")+1);var s=e.parsedSelector=e.selector=n.trim();e.atRule=0===s.indexOf (this.AT_START),e.atRule?0===s.indexOf(this.MEDIA_START)?e.type=this.types.MEDIA _RULE:s.match(this._rx.keyframesRule)&&(e.type=this.types.KEYFRAMES_RULE,e.keyfr amesName=e.selector.split(this._rx.multipleSpaces).pop()):0===s.indexOf(this.VAR _START)?e.type=this.types.MIXIN_RULE:e.type=this.types.STYLE_RULE}var i=e.rules; if(i)for(var o,a=0,l=i.length;a<l&&(o=i[a]);a++)this._parseCss(o,t);return e},_e xpandUnicodeEscapes:function(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,functio n(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e})},stringify:f unction(e,t,n){n=n||"";var r="";if(e.cssText||e.rules){var s=e.rules;if(s&&!this ._hasMixinRules(s))for(var i,o=0,a=s.length;o<a&&(i=s[o]);o++)r=this.stringify(i ,t,r);else r=t?e.cssText:this.removeCustomProps(e.cssText),r=r.trim(),r&&(r=" " +r+"\n")}return r&&(e.selector&&(n+=e.selector+" "+this.OPEN_BRACE+"\n"),n+=r,e. selector&&(n+=this.CLOSE_BRACE+"\n\n")),n},_hasMixinRules:function(e){return 0== =e[0].selector.indexOf(this.VAR_START)},removeCustomProps:function(e){return e=t his.removeCustomPropAssignment(e),this.removeCustomPropApply(e)},removeCustomPro pAssignment:function(e){return e.replace(this._rx.customProp,"").replace(this._r x.mixinProp,"")},removeCustomPropApply:function(e){return e.replace(this._rx.mix inApply,"").replace(this._rx.varApply,"")},types:{STYLE_RULE:1,KEYFRAMES_RULE:7, MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE:"{",CLOSE_BRACE:"}",_rx:{comments:/\/\*[ ^*]*\*+([^\/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}] +)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{} ;]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gi m,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*ke yframes/,multipleSpaces:/\s+/g},VAR_START:"--",MEDIA_START:"@media",AT_START:"@" }}(),Polymer.StyleUtil=function(){var e=Polymer.Settings;return{NATIVE_VARIABLES :Polymer.Settings.useNativeCSSProperties,MODULE_STYLES_SELECTOR:"style, link[rel =import][type~=css], template",INCLUDE_ATTR:"include",toCssText:function(e,t){re turn"string"==typeof e&&(e=this.parser.parse(e)),t&&this.forEachRule(e,t),this.p arser.stringify(e,this.NATIVE_VARIABLES)},forRulesInStyles:function(e,t,n){if(e) for(var r,s=0,i=e.length;s<i&&(r=e[s]);s++)this.forEachRuleInStyle(r,t,n)},forAc tiveRulesInStyles:function(e,t,n){if(e)for(var r,s=0,i=e.length;s<i&&(r=e[s]);s+ +)this.forEachRuleInStyle(r,t,n,!0)},rulesForStyle:function(e){return!e.__cssRul es&&e.textContent&&(e.__cssRules=this.parser.parse(e.textContent)),e.__cssRules} ,isKeyframesSelector:function(e){return e.parent&&e.parent.type===this.ruleTypes .KEYFRAMES_RULE},forEachRuleInStyle:function(e,t,n,r){var s,i,o=this.rulesForSty le(e);t&&(s=function(n){t(n,e)}),n&&(i=function(t){n(t,e)}),this.forEachRule(o,s ,i,r)},forEachRule:function(e,t,n,r){if(e){var s=!1;if(r&&e.type===this.ruleType s.MEDIA_RULE){var i=e.selector.match(this.rx.MEDIA_MATCH);i&&(window.matchMedia( i[1]).matches||(s=!0))}e.type===this.ruleTypes.STYLE_RULE?t(e):n&&e.type===this. ruleTypes.KEYFRAMES_RULE?n(e):e.type===this.ruleTypes.MIXIN_RULE&&(s=!0);var o=e .rules;if(o&&!s)for(var a,l=0,h=o.length;l<h&&(a=o[l]);l++)this.forEachRule(a,t, n,r)}},applyCss:function(e,t,n,r){var s=this.createScopeStyle(e,t);return this.a pplyStyle(s,n,r)},applyStyle:function(e,t,n){t=t||document.head;var r=n&&n.nextS ibling||t.firstChild;return this.__lastHeadApplyNode=e,t.insertBefore(e,r)},crea teScopeStyle:function(e,t){var n=document.createElement("style");return t&&n.set Attribute("scope",t),n.textContent=e,n},__lastHeadApplyNode:null,applyStylePlace Holder:function(e){var t=document.createComment(" Shady DOM styles for "+e+" "), n=this.__lastHeadApplyNode?this.__lastHeadApplyNode.nextSibling:null,r=document. head;return r.insertBefore(t,n||r.firstChild),this.__lastHeadApplyNode=t,t},cssF romModules:function(e,t){for(var n=e.trim().split(" "),r="",s=0;s<n.length;s++)r +=this.cssFromModule(n[s],t);return r},cssFromModule:function(e,t){var n=Polymer .DomModule.import(e);return n&&!n._cssText&&(n._cssText=this.cssFromElement(n)), !n&&t&&console.warn("Could not find style data in module named",e),n&&n._cssText ||""},cssFromElement:function(e){for(var t,n="",r=e.content||e,s=Polymer.TreeApi .arrayCopy(r.querySelectorAll(this.MODULE_STYLES_SELECTOR)),i=0;i<s.length;i++)i f(t=s[i],"template"===t.localName)n+=this.cssFromElement(t);else if("style"===t. localName){var o=t.getAttribute(this.INCLUDE_ATTR);o&&(n+=this.cssFromModules(o, !0)),t=t.__appliedElement||t,t.parentNode.removeChild(t),n+=this.resolveCss(t.te xtContent,e.ownerDocument)}else t.import&&t.import.body&&(n+=this.resolveCss(t.i mport.body.textContent,t.import));return n},isTargetedBuild:function(t){return e .useNativeShadow?"shadow"===t:"shady"===t},cssBuildTypeForModule:function(e){var t=Polymer.DomModule.import(e);if(t)return this.getCssBuildType(t)},getCssBuildT ype:function(e){return e.getAttribute("css-build")},_findMatchingParen:function( e,t){for(var n=0,r=t,s=e.length;r<s;r++)switch(e[r]){case"(":n++;break;case")":i f(0===--n)return r}return-1},processVariableAndFallback:function(e,t){var n=e.in dexOf("var(");if(n===-1)return t(e,"","","");var r=this._findMatchingParen(e,n+3 ),s=e.substring(n+4,r),i=e.substring(0,n),o=this.processVariableAndFallback(e.su bstring(r+1),t),a=s.indexOf(",");if(a===-1)return t(i,s.trim(),"",o);var l=s.sub string(0,a).trim(),h=s.substring(a+1).trim();return t(i,l,h,o)},rx:{VAR_ASSIGN:/ (?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\s}])|$)/gi,MIXIN _MATCH:/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,VAR_CONSUMED:/(--[\w-]+)\s*([:,;)] |$)/gi,ANIMATION_MATCH:/(animation\s*:)|(animation-name\s*:)/,MEDIA_MATCH:/@medi a[^(]*(\([^)]*\))/,IS_VAR:/^--/,BRACKETED:/\{[^}]*\}/g,HOST_PREFIX:"(?:^|[^.#[:] )",HOST_SUFFIX:"($|[.:[\\s>+~])"},resolveCss:Polymer.ResolveUrl.resolveCss,parse r:Polymer.CssParse,ruleTypes:Polymer.CssParse.types}}(),Polymer.StyleTransformer =function(){var e=Polymer.StyleUtil,t=Polymer.Settings,n={dom:function(e,t,n,r){ this._transformDom(e,t||"",n,r)},_transformDom:function(e,t,n,r){e.setAttribute& &this.element(e,t,n,r);for(var s=Polymer.dom(e).childNodes,i=0;i<s.length;i++)th is._transformDom(s[i],t,n,r)},element:function(e,t,n,s){if(n)s?e.removeAttribute (r):e.setAttribute(r,t);else if(t)if(e.classList)s?(e.classList.remove(r),e.clas sList.remove(t)):(e.classList.add(r),e.classList.add(t));else if(e.getAttribute) {var i=e.getAttribute(g);s?i&&e.setAttribute(g,i.replace(r,"").replace(t,"")):e. setAttribute(g,(i?i+" ":"")+r+" "+t)}},elementStyles:function(n,r){for(var s,i=n ._styles,o="",a=n.__cssBuild,l=0,h=i.length;l<h&&(s=i[l]);l++){var c=e.rulesForS tyle(s);o+=t.useNativeShadow||"shady"===a?e.toCssText(c,r):this.css(c,n.is,n.ext ends,r,n._scopeCssViaAttr)+"\n\n"}return o.trim()},css:function(t,n,r,s,i){var o =this._calcHostScope(n,r);n=this._calcElementScope(n,i);var a=this;return e.toCs sText(t,function(e){e.isScoped||(a.rule(e,n,o),e.isScoped=!0),s&&s(e,n,o)})},_ca lcElementScope:function(e,t){return e?t?m+e+y:d+e:""},_calcHostScope:function(e, t){return t?"[is="+e+"]":e},rule:function(e,t,n){this._transformRule(e,this._tra nsformComplexSelector,t,n)},_transformRule:function(e,t,n,r){e.selector=e.transf ormedSelector=this._transformRuleCss(e,t,n,r)},_transformRuleCss:function(t,n,r, s){var o=t.selector.split(i);if(!e.isKeyframesSelector(t))for(var a,l=0,h=o.leng th;l<h&&(a=o[l]);l++)o[l]=n.call(this,a,r,s);return o.join(i)},_transformComplex Selector:function(e,t,n){var r=!1,s=!1,a=this;return e=e.trim(),e=e.replace(P,l+ " $1"),e=e.replace(o,function(e,i,o){if(r)o=o.replace(_," ");else{var l=a._trans formCompoundSelector(o,i,t,n);r=r||l.stop,s=s||l.hostContext,i=l.combinator,o=l. value}return i+o}),s&&(e=e.replace(f,function(e,t,r,s){return t+r+" "+n+s+i+" "+ t+n+r+s})),e},_transformCompoundSelector:function(e,t,n,r){var s=e.search(_),i=! 1;e.indexOf(u)>=0?i=!0:e.indexOf(l)>=0?e=this._transformHostSelector(e,r):0!==s& &(e=n?this._transformSimpleSelector(e,n):e),e.indexOf(p)>=0&&(t="");var o;return s>=0&&(e=e.replace(_," "),o=!0),{value:e,combinator:t,stop:o,hostContext:i}},_t ransformSimpleSelector:function(e,t){var n=e.split(v);return n[0]+=t,n.join(v)}, _transformHostSelector:function(e,t){var n=e.match(c),r=n&&n[2].trim()||"";if(r) {if(r[0].match(a))return e.replace(c,function(e,n,r){return t+r});var s=r.split( a)[0];return s===t?r:S}return e.replace(l,t)},documentRule:function(e){e.selecto r=e.parsedSelector,this.normalizeRootSelector(e),t.useNativeShadow||this._transf ormRule(e,this._transformDocumentSelector)},normalizeRootSelector:function(e){e. selector===h&&(e.selector="html")},_transformDocumentSelector:function(e){return e.match(_)?this._transformComplexSelector(e,s):this._transformSimpleSelector(e. trim(),s)},SCOPE_NAME:"style-scope"},r=n.SCOPE_NAME,s=":not(["+r+"]):not(."+r+") ",i=",",o=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,a=/[[.:#*]/,l=":host",h=":ro ot",c=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,u=":host-context",f=/(.*)(?::ho st-context)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))(.*)/,p="::content",_=/::content|::s hadow|\/deep\//,d=".",m="["+r+"~=",y="]",v=":",g="class",P=new RegExp("^("+p+")" ),S="should_not_match";return n}(),Polymer.StyleExtends=function(){var e=Polymer .StyleUtil;return{hasExtends:function(e){return Boolean(e.match(this.rx.EXTEND)) },transform:function(t){var n=e.rulesForStyle(t),r=this;return e.forEachRule(n,f unction(e){if(r._mapRuleOntoParent(e),e.parent)for(var t;t=r.rx.EXTEND.exec(e.cs sText);){var n=t[1],s=r._findExtendor(n,e);s&&r._extendRule(e,s)}e.cssText=e.css Text.replace(r.rx.EXTEND,"")}),e.toCssText(n,function(e){e.selector.match(r.rx.S TRIP)&&(e.cssText="")},!0)},_mapRuleOntoParent:function(e){if(e.parent){for(var t,n=e.parent.map||(e.parent.map={}),r=e.selector.split(","),s=0;s<r.length;s++)t =r[s],n[t.trim()]=e;return n}},_findExtendor:function(e,t){return t.parent&&t.pa rent.map&&t.parent.map[e]||this._findExtendor(e,t.parent)},_extendRule:function( e,t){e.parent!==t.parent&&this._cloneAndAddRuleToParent(t,e.parent),e.extends=e. extends||[],e.extends.push(t),t.selector=t.selector.replace(this.rx.STRIP,""),t. selector=(t.selector&&t.selector+",\n")+e.selector,t.extends&&t.extends.forEach( function(t){this._extendRule(e,t)},this)},_cloneAndAddRuleToParent:function(e,t) {e=Object.create(e),e.parent=t,e.extends&&(e.extends=e.extends.slice()),t.rules. push(e)},rx:{EXTEND:/@extends\(([^)]*)\)\s*?;/gim,STRIP:/%[^,]*$/}}}(),Polymer.A pplyShim=function(){"use strict";function e(e,t){e=e.trim(),m[e]={properties:t,d ependants:{}}}function t(e){return e=e.trim(),m[e]}function n(e,t){var n=_.exec( t);return n&&(t=n[1]?y._getInitialValueForProperty(e):"apply-shim-inherit"),t}fu nction r(e){for(var t,r,s,i,o=e.split(";"),a={},l=0;l<o.length;l++)s=o[l],s&&(i= s.split(":"),i.length>1&&(t=i[0].trim(),r=n(t,i.slice(1).join(":")),a[t]=r));ret urn a}function s(e){var t=y.__currentElementProto,n=t&&t.is;for(var r in e.depen dants)r!==n&&(e.dependants[r].__applyShimInvalid=!0)}function i(n,i,o,a){if(o&&h .processVariableAndFallback(o,function(e,n){n&&t(n)&&(a="@apply "+n+";")}),!a)re turn n;var c=l(a),u=n.slice(0,n.indexOf("--")),f=r(c),p=f,_=t(i),m=_&&_.properti es;m?(p=Object.create(m),p=Polymer.Base.mixin(p,f)):e(i,p);var y,v,g=[],P=!1;for (y in p)v=f[y],void 0===v&&(v="initial"),!m||y in m||(P=!0),g.push(i+d+y+": "+v) ;return P&&s(_),_&&(_.properties=p),o&&(u=n+";"+u),u+g.join("; ")+";"}function o (e,t,n){return"var("+t+",var("+n+"));"}function a(n,r){n=n.replace(p,"");var s=[ ],i=t(n);if(i||(e(n,{}),i=t(n)),i){var o=y.__currentElementProto;o&&(i.dependant s[o.is]=o);var a,l,h;for(a in i.properties)h=r&&r[a],l=[a,": var(",n,d,a],h&&l.p ush(",",h),l.push(")"),s.push(l.join(""))}return s.join("; ")}function l(e){for( var t;t=c.exec(e);){var n=t[0],s=t[1],i=t.index,o=i+n.indexOf("@apply"),l=i+n.le ngth,h=e.slice(0,o),u=e.slice(l),f=r(h),p=a(s,f);e=[h,p,u].join(""),c.lastIndex= i+p.length}return e}var h=Polymer.StyleUtil,c=h.rx.MIXIN_MATCH,u=h.rx.VAR_ASSIGN ,f=/var\(\s*(--[^,]*),\s*(--[^)]*)\)/g,p=/;\s*/m,_=/^\s*(initial)|(inherit)\s*$/ ,d="_-_",m={},y={_measureElement:null,_map:m,_separator:d,transform:function(e,t ){this.__currentElementProto=t,h.forRulesInStyles(e,this._boundTransformRule),t. __applyShimInvalid=!1,this.__currentElementProto=null},transformRule:function(e) {e.cssText=this.transformCssText(e.parsedCssText),":root"===e.selector&&(e.selec tor=":host > *")},transformCssText:function(e){return e=e.replace(f,o),e=e.repla ce(u,i),l(e)},_getInitialValueForProperty:function(e){return this._measureElemen t||(this._measureElement=document.createElement("meta"),this._measureElement.sty le.all="initial",document.head.appendChild(this._measureElement)),window.getComp utedStyle(this._measureElement).getPropertyValue(e)}};return y._boundTransformRu le=y.transformRule.bind(y),y}(),function(){var e=Polymer.Base._prepElement,t=Pol ymer.Settings.useNativeShadow,n=Polymer.StyleUtil,r=Polymer.StyleTransformer,s=P olymer.StyleExtends,i=Polymer.ApplyShim,o=Polymer.Settings;Polymer.Base._addFeat ure({_prepElement:function(t){this._encapsulateStyle&&"shady"!==this.__cssBuild& &r.element(t,this.is,this._scopeCssViaAttr),e.call(this,t)},_prepStyles:function (){void 0===this._encapsulateStyle&&(this._encapsulateStyle=!t),t||(this._scopeS tyle=n.applyStylePlaceHolder(this.is)),this.__cssBuild=n.cssBuildTypeForModule(t his.is)},_prepShimStyles:function(){if(this._template){var e=n.isTargetedBuild(t his.__cssBuild);if(o.useNativeCSSProperties&&"shadow"===this.__cssBuild&&e)retur n;this._styles=this._styles||this._collectStyles(),o.useNativeCSSProperties&&!th is.__cssBuild&&i.transform(this._styles,this);var s=o.useNativeCSSProperties&&e? this._styles.length&&this._styles[0].textContent.trim():r.elementStyles(this);th is._prepStyleProperties(),!this._needsStyleProperties()&&s&&n.applyCss(s,this.is ,t?this._template.content:null,this._scopeStyle)}else this._styles=[]},_collectS tyles:function(){var e=[],t="",r=this.styleModules;if(r)for(var i,o=0,a=r.length ;o<a&&(i=r[o]);o++)t+=n.cssFromModule(i);t+=n.cssFromModule(this.is);var l=this. _template&&this._template.parentNode;if(!this._template||l&&l.id.toLowerCase()== =this.is||(t+=n.cssFromElement(this._template)),t){var h=document.createElement( "style");h.textContent=t,s.hasExtends(h.textContent)&&(t=s.transform(h)),e.push( h)}return e},_elementAdd:function(e){this._encapsulateStyle&&(e.__styleScoped?e. __styleScoped=!1:r.dom(e,this.is,this._scopeCssViaAttr))},_elementRemove:functio n(e){this._encapsulateStyle&&r.dom(e,this.is,this._scopeCssViaAttr,!0)},scopeSub tree:function(e,n){if(!t){var r=this,s=function(e){if(e.nodeType===Node.ELEMENT_ NODE){var t=e.getAttribute("class");e.setAttribute("class",r._scopeElementClass( e,t));for(var n,s=e.querySelectorAll("*"),i=0;i<s.length&&(n=s[i]);i++)t=n.getAt tribute("class"),n.setAttribute("class",r._scopeElementClass(n,t))}};if(s(e),n){ var i=new MutationObserver(function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++)if (t.addedNodes)for(var r=0;r<t.addedNodes.length;r++)s(t.addedNodes[r])});return i.observe(e,{childList:!0,subtree:!0}),i}}}})}(),Polymer.StyleProperties=functio n(){"use strict";function e(e,t){var n=parseInt(e/32),r=1<<e%32;t[n]=(t[n]||0)|r }var t=Polymer.DomApi.matchesSelector,n=Polymer.StyleUtil,r=Polymer.StyleTransfo rmer,s=navigator.userAgent.match("Trident"),i=Polymer.Settings;return{decorateSt yles:function(e,t){var s=this,i={},o=[],a=0,l=r._calcHostScope(t.is,t.extends);n .forRulesInStyles(e,function(e,r){s.decorateRule(e),e.index=a++,s.whenHostOrRoot Rule(t,e,r,function(r){if(e.parent.type===n.ruleTypes.MEDIA_RULE&&(t.__notStyleS copeCacheable=!0),r.isHost){var s=r.selector.split(" ").some(function(e){return 0===e.indexOf(l)&&e.length!==l.length});t.__notStyleScopeCacheable=t.__notStyleS copeCacheable||s}}),s.collectPropertiesInCssText(e.propertyInfo.cssText,i)},func tion(e){o.push(e)}),e._keyframes=o;var h=[];for(var c in i)h.push(c);return h},d ecorateRule:function(e){if(e.propertyInfo)return e.propertyInfo;var t={},n={},r= this.collectProperties(e,n);return r&&(t.properties=n,e.rules=null),t.cssText=th is.collectCssText(e),e.propertyInfo=t,t},collectProperties:function(e,t){var n=e .propertyInfo;if(!n){for(var r,s,i,o=this.rx.VAR_ASSIGN,a=e.parsedCssText;r=o.ex ec(a);)s=(r[2]||r[3]).trim(),"inherit"!==s&&(t[r[1].trim()]=s),i=!0;return i}if( n.properties)return Polymer.Base.mixin(t,n.properties),!0},collectCssText:functi on(e){return this.collectConsumingCssText(e.parsedCssText)},collectConsumingCssT ext:function(e){return e.replace(this.rx.BRACKETED,"").replace(this.rx.VAR_ASSIG N,"")},collectPropertiesInCssText:function(e,t){for(var n;n=this.rx.VAR_CONSUMED .exec(e);){var r=n[1];":"!==n[2]&&(t[r]=!0)}},reify:function(e){for(var t,n=Obje ct.getOwnPropertyNames(e),r=0;r<n.length;r++)t=n[r],e[t]=this.valueForProperty(e [t],e)},valueForProperty:function(e,t){if(e)if(e.indexOf(";")>=0)e=this.valueFor Properties(e,t);else{var r=this,s=function(e,n,s,i){var o=r.valueForProperty(t[n ],t);return o&&"initial"!==o?"apply-shim-inherit"===o&&(o="inherit"):o=r.valueFo rProperty(t[s]||s,t)||s,e+(o||"")+i};e=n.processVariableAndFallback(e,s)}return e&&e.trim()||""},valueForProperties:function(e,t){for(var n,r,s=e.split(";"),i=0 ;i<s.length;i++)if(n=s[i]){if(this.rx.MIXIN_MATCH.lastIndex=0,r=this.rx.MIXIN_MA TCH.exec(n))n=this.valueForProperty(t[r[1]],t);else{var o=n.indexOf(":");if(o!== -1){var a=n.substring(o);a=a.trim(),a=this.valueForProperty(a,t)||a,n=n.substrin g(0,o)+a}}s[i]=n&&n.lastIndexOf(";")===n.length-1?n.slice(0,-1):n||""}return s.j oin(";")},applyProperties:function(e,t){var n="";e.propertyInfo||this.decorateRu le(e),e.propertyInfo.cssText&&(n=this.valueForProperties(e.propertyInfo.cssText, t)),e.cssText=n},applyKeyframeTransforms:function(e,t){var n=e.cssText,r=e.cssTe xt;if(null==e.hasAnimations&&(e.hasAnimations=this.rx.ANIMATION_MATCH.test(n)),e .hasAnimations){var s;if(null==e.keyframeNamesToTransform){e.keyframeNamesToTran sform=[];for(var i in t)s=t[i],r=s(n),n!==r&&(n=r,e.keyframeNamesToTransform.pus h(i))}else{for(var o=0;o<e.keyframeNamesToTransform.length;++o)s=t[e.keyframeNam esToTransform[o]],n=s(n);r=n}}e.cssText=r},propertyDataFromStyles:function(r,s){ var i={},o=this,a=[];return n.forActiveRulesInStyles(r,function(n){n.propertyInf o||o.decorateRule(n);var r=n.transformedSelector||n.parsedSelector;s&&n.property Info.properties&&r&&t.call(s,r)&&(o.collectProperties(n,i),e(n.index,a))}),{prop erties:i,key:a}},whenHostOrRootRule:function(e,t,n,s){if(t.propertyInfo||self.de corateRule(t),t.propertyInfo.properties){var o=e.is?r._calcHostScope(e.is,e.exte nds):"html",a=t.parsedSelector,l=":root"===a,h=0===a.indexOf(":host"),c=e.__cssB uild||n.__cssBuild;if("shady"===c&&(l=a===o+" > *."+o||a.indexOf("html")!==-1,h= !l&&0===a.indexOf(o)),"shadow"===c&&(l=":host > *"===a||"html"===a,h=h&&!l),l||h ){var u=o;h&&(i.useNativeShadow&&!t.transformedSelector&&(t.transformedSelector= r._transformRuleCss(t,r._transformComplexSelector,e.is,o)),u=t.transformedSelect or||t.parsedSelector),s({selector:u,isHost:h,isRoot:l})}}},hostAndRootProperties ForScope:function(e){var r={},s={},i=this;return n.forActiveRulesInStyles(e._sty les,function(n,o){i.whenHostOrRootRule(e,n,o,function(o){var a=e._element||e;t.c all(a,o.selector)&&(o.isHost?i.collectProperties(n,r):i.collectProperties(n,s))} )}),{rootProps:s,hostProps:r}},transformStyles:function(e,t,n){var s=this,o=r._c alcHostScope(e.is,e.extends),a=e.extends?"\\"+o.slice(0,-1)+"\\]":o,l=new RegExp (this.rx.HOST_PREFIX+a+this.rx.HOST_SUFFIX),h=this._elementKeyframeTransforms(e, n);return r.elementStyles(e,function(r){s.applyProperties(r,t),i.useNativeShadow ||Polymer.StyleUtil.isKeyframesSelector(r)||!r.cssText||(s.applyKeyframeTransfor ms(r,h),s._scopeSelector(r,l,o,e._scopeCssViaAttr,n))})},_elementKeyframeTransfo rms:function(e,t){var n=e._styles._keyframes,r={};if(!i.useNativeShadow&&n)for(v ar s=0,o=n[s];s<n.length;o=n[++s])this._scopeKeyframes(o,t),r[o.keyframesName]=t his._keyframesRuleTransformer(o);return r},_keyframesRuleTransformer:function(e) {return function(t){return t.replace(e.keyframesNameRx,e.transformedKeyframesNam e)}},_scopeKeyframes:function(e,t){e.keyframesNameRx=new RegExp(e.keyframesName, "g"),e.transformedKeyframesName=e.keyframesName+"-"+t,e.transformedSelector=e.tr ansformedSelector||e.selector,e.selector=e.transformedSelector.replace(e.keyfram esName,e.transformedKeyframesName)},_scopeSelector:function(e,t,n,s,i){e.transfo rmedSelector=e.transformedSelector||e.selector;for(var o,a=e.transformedSelector ,l=s?"["+r.SCOPE_NAME+"~="+i+"]":"."+i,h=a.split(","),c=0,u=h.length;c<u&&(o=h[c ]);c++)h[c]=o.match(t)?o.replace(n,l):l+" "+o;e.selector=h.join(",")},applyEleme ntScopeSelector:function(e,t,n,s){var i=s?e.getAttribute(r.SCOPE_NAME):e.getAttr ibute("class")||"",o=n?i.replace(n,t):(i?i+" ":"")+this.XSCOPE_NAME+" "+t;i!==o& &(s?e.setAttribute(r.SCOPE_NAME,o):e.setAttribute("class",o))},applyElementStyle :function(e,t,r,o){var a=o?o.textContent||"":this.transformStyles(e,t,r),l=e._cu stomStyle;return l&&!i.useNativeShadow&&l!==o&&(l._useCount--,l._useCount<=0&&l. parentNode&&l.parentNode.removeChild(l)),i.useNativeShadow?e._customStyle?(e._cu stomStyle.textContent=a,o=e._customStyle):a&&(o=n.applyCss(a,r,e.root,e._scopeSt yle)):o?o.parentNode||n.applyStyle(o,null,e._scopeStyle):a&&(o=n.applyCss(a,r,nu ll,e._scopeStyle)),o&&(o._useCount=o._useCount||0,e._customStyle!=o&&o._useCount ++,e._customStyle=o),s&&(o.textContent=o.textContent),o},mixinCustomStyle:functi on(e,t){var n;for(var r in t)n=t[r],(n||0===n)&&(e[r]=n)},updateNativeStylePrope rties:function(e,t){var n=e.__customStyleProperties;if(n)for(var r=0;r<n.length; r++)e.style.removeProperty(n[r]);var s=[];for(var i in t)null!==t[i]&&(e.style.s etProperty(i,t[i]),s.push(i));e.__customStyleProperties=s},rx:n.rx,XSCOPE_NAME:" x-scope"}}(),function(){Polymer.StyleCache=function(){this.cache={}},Polymer.Sty leCache.prototype={MAX:100,store:function(e,t,n,r){t.keyValues=n,t.styles=r;var s=this.cache[e]=this.cache[e]||[];s.push(t),s.length>this.MAX&&s.shift()},retrie ve:function(e,t,n){var r=this.cache[e];if(r)for(var s,i=r.length-1;i>=0;i--)if(s =r[i],n===s.styles&&this._objectsEqual(t,s.keyValues))return s},clear:function() {this.cache={}},_objectsEqual:function(e,t){var n,r;for(var s in e)if(n=e[s],r=t [s],!("object"==typeof n&&n?this._objectsStrictlyEqual(n,r):n===r))return!1;retu rn!Array.isArray(e)||e.length===t.length},_objectsStrictlyEqual:function(e,t){re turn this._objectsEqual(e,t)&&this._objectsEqual(t,e)}}}(),Polymer.StyleDefaults =function(){var e=Polymer.StyleProperties,t=Polymer.StyleCache,n=Polymer.Setting s.useNativeCSSProperties,r={_styles:[],_properties:null,customStyle:{},_styleCac he:new t,_element:Polymer.DomApi.wrap(document.documentElement),addStyle:functio n(e){this._styles.push(e),this._properties=null},get _styleProperties(){return t his._properties||(e.decorateStyles(this._styles,this),this._styles._scopeStylePr operties=null,this._properties=e.hostAndRootPropertiesForScope(this).rootProps,e .mixinCustomStyle(this._properties,this.customStyle),e.reify(this._properties)), this._properties},hasStyleProperties:function(){return Boolean(this._properties) },_needsStyleProperties:function(){},_computeStyleProperties:function(){return t his._styleProperties},updateStyles:function(t){this._properties=null,t&&Polymer. Base.mixin(this.customStyle,t),this._styleCache.clear();for(var r,s=0;s<this._st yles.length;s++)r=this._styles[s],r=r.__importElement||r,r._apply();n&&e.updateN ativeStyleProperties(document.documentElement,this.customStyle)}};return r}(),fu nction(){"use strict";var e=Polymer.Base.serializeValueToAttribute,t=Polymer.Sty leProperties,n=Polymer.StyleTransformer,r=Polymer.StyleDefaults,s=Polymer.Settin gs.useNativeShadow,i=Polymer.Settings.useNativeCSSProperties;Polymer.Base._addFe ature({_prepStyleProperties:function(){i||(this._ownStylePropertyNames=this._sty les&&this._styles.length?t.decorateStyles(this._styles,this):null)},customStyle: null,getComputedStyleValue:function(e){return!i&&this._styleProperties&&this._st yleProperties[e]||getComputedStyle(this).getPropertyValue(e)},_setupStylePropert ies:function(){this.customStyle={},this._styleCache=null,this._styleProperties=n ull,this._scopeSelector=null,this._ownStyleProperties=null,this._customStyle=nul l},_needsStyleProperties:function(){return Boolean(!i&&this._ownStylePropertyNam es&&this._ownStylePropertyNames.length)},_validateApplyShim:function(){if(this._ _applyShimInvalid){Polymer.ApplyShim.transform(this._styles,this.__proto__);var e=n.elementStyles(this);if(s){var t=this._template.content.querySelector("style" );t&&(t.textContent=e)}else{var r=this._scopeStyle&&this._scopeStyle.nextSibling ;r&&(r.textContent=e)}}},_beforeAttached:function(){this._scopeSelector&&!this._ _stylePropertiesInvalid||!this._needsStyleProperties()||(this.__stylePropertiesI nvalid=!1,this._updateStyleProperties())},_findStyleHost:function(){for(var e,t= this;e=Polymer.dom(t).getOwnerRoot();){if(Polymer.isInstance(e.host))return e.ho st;t=e.host}return r},_updateStyleProperties:function(){var e,n=this._findStyleH ost();n._styleProperties||n._computeStyleProperties(),n._styleCache||(n._styleCa che=new Polymer.StyleCache); 3 this._flushHandlers()},_applyConfig:function(e,t){for(var n in e)void 0===this[n ]&&this.__setProperty(n,e[n],n in t)},_notifyListener:function(e,t){if(!Polymer. Bind._isEventBogus(t,t.target)){var n,r;if(t.detail&&(n=t.detail.value,r=t.detai l.path),this._clientsReadied)return e.call(this,t.target,n,r);this._queueHandler ([e,t.target,n,r])}},_queueHandler:function(e){this._handlers.push(e)},_flushHan dlers:function(){for(var e,t=this._handlers,n=0,r=t.length;n<r&&(e=t[n]);n++)e[0 ].call(this,e[1],e[2],e[3]);this._handlers=[]}})}(),function(){"use strict";Poly mer.Base._addFeature({notifyPath:function(e,t,n){var r={},s=this._get(e,this,r); 1===arguments.length&&(t=s),r.path&&this._notifyPath(r.path,t,n)},_notifyPath:fu nction(e,t,n){var r=this._propertySetter(e,t);if(r!==t&&(r===r||t===t))return th is._pathEffector(e,t),n||this._notifyPathUp(e,t),!0},_getPathParts:function(e){i f(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)for(var r=e[n].toString().sp lit("."),s=0;s<r.length;s++)t.push(r[s]);return t}return e.toString().split(".") },set:function(e,t,n){var r,s=n||this,i=this._getPathParts(e),o=i[i.length-1];if (i.length>1){for(var a=0;a<i.length-1;a++){var l=i[a];if(r&&"#"==l[0]?s=Polymer. Collection.get(r).getItem(l):(s=s[l],r&&parseInt(l,10)==l&&(i[a]=Polymer.Collect ion.get(r).getKey(s))),!s)return;r=Array.isArray(s)?s:null}if(r){var h,c,u=Polym er.Collection.get(r);"#"==o[0]?(c=o,h=u.getItem(c),o=r.indexOf(h),u.setItem(c,t) ):parseInt(o,10)==o&&(h=s[o],c=u.getKey(h),i[a]=c,u.setItem(c,t))}s[o]=t,n||this ._notifyPath(i.join("."),t)}else s[e]=t},get:function(e,t){return this._get(e,t) },_get:function(e,t,n){for(var r,s=t||this,i=this._getPathParts(e),o=0;o<i.lengt h;o++){if(!s)return;var a=i[o];r&&"#"==a[0]?s=Polymer.Collection.get(r).getItem( a):(s=s[a],n&&r&&parseInt(a,10)==a&&(i[o]=Polymer.Collection.get(r).getKey(s))), r=Array.isArray(s)?s:null}return n&&(n.path=i.join(".")),s},_pathEffector:functi on(e,t){var n=this._modelForPath(e),r=this._propertyEffects&&this._propertyEffec ts[n];if(r)for(var s,i=0;i<r.length&&(s=r[i]);i++){var o=s.pathFn;o&&o.call(this ,e,t,s.effect)}this._boundPaths&&this._notifyBoundPaths(e,t)},_annotationPathEff ect:function(e,t,n){if(n.value===e||0===n.value.indexOf(e+"."))Polymer.Bind._ann otationEffect.call(this,e,t,n);else if(0===e.indexOf(n.value+".")&&!n.negate){va r r=this._nodes[n.index];if(r&&r._notifyPath){var s=this._fixPath(n.name,n.value ,e);r._notifyPath(s,t,!0)}}},_complexObserverPathEffect:function(e,t,n){this._pa thMatchesEffect(e,n)&&Polymer.Bind._complexObserverEffect.call(this,e,t,n)},_com putePathEffect:function(e,t,n){this._pathMatchesEffect(e,n)&&Polymer.Bind._compu teEffect.call(this,e,t,n)},_annotatedComputationPathEffect:function(e,t,n){this. _pathMatchesEffect(e,n)&&Polymer.Bind._annotatedComputationEffect.call(this,e,t, n)},_pathMatchesEffect:function(e,t){var n=t.trigger.name;return n==e||0===n.ind exOf(e+".")||t.trigger.wildcard&&0===e.indexOf(n+".")},linkPaths:function(e,t){t his._boundPaths=this._boundPaths||{},t?this._boundPaths[e]=t:this.unlinkPaths(e) },unlinkPaths:function(e){this._boundPaths&&delete this._boundPaths[e]},_notifyB oundPaths:function(e,t){for(var n in this._boundPaths){var r=this._boundPaths[n] ;0==e.indexOf(n+".")?this._notifyPath(this._fixPath(r,n,e),t):0==e.indexOf(r+"." )&&this._notifyPath(this._fixPath(n,r,e),t)}},_fixPath:function(e,t,n){return e+ n.slice(t.length)},_notifyPathUp:function(e,t){var n=this._modelForPath(e),r=Pol ymer.CaseMap.camelToDashCase(n),s=r+this._EVENT_CHANGED;this.fire(s,{path:e,valu e:t},{bubbles:!1,_useCache:!0})},_modelForPath:function(e){var t=e.indexOf("."); return t<0?e:e.slice(0,t)},_EVENT_CHANGED:"-changed",notifySplices:function(e,t) {var n={},r=this._get(e,this,n);this._notifySplices(r,n.path,t)},_notifySplices: function(e,t,n){var r={keySplices:Polymer.Collection.applySplices(e,n),indexSpli ces:n},s=t+".splices";this._notifyPath(s,r),this._notifyPath(t+".length",e.lengt h),this.__data__[s]={keySplices:null,indexSplices:null}},_notifySplice:function( e,t,n,r,s){this._notifySplices(e,t,[{index:n,addedCount:r,removed:s,object:e,typ e:"splice"}])},push:function(e){var t={},n=this._get(e,this,t),r=Array.prototype .slice.call(arguments,1),s=n.length,i=n.push.apply(n,r);return r.length&&this._n otifySplice(n,t.path,s,r.length,[]),i},pop:function(e){var t={},n=this._get(e,th is,t),r=Boolean(n.length),s=Array.prototype.slice.call(arguments,1),i=n.pop.appl y(n,s);return r&&this._notifySplice(n,t.path,n.length,0,[i]),i},splice:function( e,t){var n={},r=this._get(e,this,n);t=t<0?r.length-Math.floor(-t):Math.floor(t), t||(t=0);var s=Array.prototype.slice.call(arguments,1),i=r.splice.apply(r,s),o=M ath.max(s.length-2,0);return(o||i.length)&&this._notifySplice(r,n.path,t,o,i),i} ,shift:function(e){var t={},n=this._get(e,this,t),r=Boolean(n.length),s=Array.pr ototype.slice.call(arguments,1),i=n.shift.apply(n,s);return r&&this._notifySplic e(n,t.path,0,0,[i]),i},unshift:function(e){var t={},n=this._get(e,this,t),r=Arra y.prototype.slice.call(arguments,1),s=n.unshift.apply(n,r);return r.length&&this ._notifySplice(n,t.path,0,r.length,[]),s},prepareModelNotifyPath:function(e){thi s.mixin(e,{fire:Polymer.Base.fire,_getEvent:Polymer.Base._getEvent,__eventCache: Polymer.Base.__eventCache,notifyPath:Polymer.Base.notifyPath,_get:Polymer.Base._ get,_EVENT_CHANGED:Polymer.Base._EVENT_CHANGED,_notifyPath:Polymer.Base._notifyP ath,_notifyPathUp:Polymer.Base._notifyPathUp,_pathEffector:Polymer.Base._pathEff ector,_annotationPathEffect:Polymer.Base._annotationPathEffect,_complexObserverP athEffect:Polymer.Base._complexObserverPathEffect,_annotatedComputationPathEffec t:Polymer.Base._annotatedComputationPathEffect,_computePathEffect:Polymer.Base._ computePathEffect,_modelForPath:Polymer.Base._modelForPath,_pathMatchesEffect:Po lymer.Base._pathMatchesEffect,_notifyBoundPaths:Polymer.Base._notifyBoundPaths,_ getPathParts:Polymer.Base._getPathParts})}})}(),Polymer.Base._addFeature({resolv eUrl:function(e){var t=Polymer.DomModule.import(this.is),n="";if(t){var r=t.getA ttribute("assetpath")||"";n=Polymer.ResolveUrl.resolveUrl(r,t.ownerDocument.base URI)}return Polymer.ResolveUrl.resolveUrl(e,n)}}),Polymer.CssParse=function(){re turn{parse:function(e){return e=this._clean(e),this._parseCss(this._lex(e),e)},_ clean:function(e){return e.replace(this._rx.comments,"").replace(this._rx.port," ")},_lex:function(e){for(var t={start:0,end:e.length},n=t,r=0,s=e.length;r<s;r++ )switch(e[r]){case this.OPEN_BRACE:n.rules||(n.rules=[]);var i=n,o=i.rules[i.rul es.length-1];n={start:r+1,parent:i,previous:o},i.rules.push(n);break;case this.C LOSE_BRACE:n.end=r+1,n=n.parent||t}return t},_parseCss:function(e,t){var n=t.sub string(e.start,e.end-1);if(e.parsedCssText=e.cssText=n.trim(),e.parent){var r=e. previous?e.previous.end:e.parent.start;n=t.substring(r,e.start-1),n=this._expand UnicodeEscapes(n),n=n.replace(this._rx.multipleSpaces," "),n=n.substring(n.lastI ndexOf(";")+1);var s=e.parsedSelector=e.selector=n.trim();e.atRule=0===s.indexOf (this.AT_START),e.atRule?0===s.indexOf(this.MEDIA_START)?e.type=this.types.MEDIA _RULE:s.match(this._rx.keyframesRule)&&(e.type=this.types.KEYFRAMES_RULE,e.keyfr amesName=e.selector.split(this._rx.multipleSpaces).pop()):0===s.indexOf(this.VAR _START)?e.type=this.types.MIXIN_RULE:e.type=this.types.STYLE_RULE}var i=e.rules; if(i)for(var o,a=0,l=i.length;a<l&&(o=i[a]);a++)this._parseCss(o,t);return e},_e xpandUnicodeEscapes:function(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,functio n(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e})},stringify:f unction(e,t,n){n=n||"";var r="";if(e.cssText||e.rules){var s=e.rules;if(s&&!this ._hasMixinRules(s))for(var i,o=0,a=s.length;o<a&&(i=s[o]);o++)r=this.stringify(i ,t,r);else r=t?e.cssText:this.removeCustomProps(e.cssText),r=r.trim(),r&&(r=" " +r+"\n")}return r&&(e.selector&&(n+=e.selector+" "+this.OPEN_BRACE+"\n"),n+=r,e. selector&&(n+=this.CLOSE_BRACE+"\n\n")),n},_hasMixinRules:function(e){return 0== =e[0].selector.indexOf(this.VAR_START)},removeCustomProps:function(e){return e=t his.removeCustomPropAssignment(e),this.removeCustomPropApply(e)},removeCustomPro pAssignment:function(e){return e.replace(this._rx.customProp,"").replace(this._r x.mixinProp,"")},removeCustomPropApply:function(e){return e.replace(this._rx.mix inApply,"").replace(this._rx.varApply,"")},types:{STYLE_RULE:1,KEYFRAMES_RULE:7, MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE:"{",CLOSE_BRACE:"}",_rx:{comments:/\/\*[ ^*]*\*+([^\/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}] +)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{} ;]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gi m,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*ke yframes/,multipleSpaces:/\s+/g},VAR_START:"--",MEDIA_START:"@media",AT_START:"@" }}(),Polymer.StyleUtil=function(){var e=Polymer.Settings;return{NATIVE_VARIABLES :Polymer.Settings.useNativeCSSProperties,MODULE_STYLES_SELECTOR:"style, link[rel =import][type~=css], template",INCLUDE_ATTR:"include",toCssText:function(e,t){re turn"string"==typeof e&&(e=this.parser.parse(e)),t&&this.forEachRule(e,t),this.p arser.stringify(e,this.NATIVE_VARIABLES)},forRulesInStyles:function(e,t,n){if(e) for(var r,s=0,i=e.length;s<i&&(r=e[s]);s++)this.forEachRuleInStyle(r,t,n)},forAc tiveRulesInStyles:function(e,t,n){if(e)for(var r,s=0,i=e.length;s<i&&(r=e[s]);s+ +)this.forEachRuleInStyle(r,t,n,!0)},rulesForStyle:function(e){return!e.__cssRul es&&e.textContent&&(e.__cssRules=this.parser.parse(e.textContent)),e.__cssRules} ,isKeyframesSelector:function(e){return e.parent&&e.parent.type===this.ruleTypes .KEYFRAMES_RULE},forEachRuleInStyle:function(e,t,n,r){var s,i,o=this.rulesForSty le(e);t&&(s=function(n){t(n,e)}),n&&(i=function(t){n(t,e)}),this.forEachRule(o,s ,i,r)},forEachRule:function(e,t,n,r){if(e){var s=!1;if(r&&e.type===this.ruleType s.MEDIA_RULE){var i=e.selector.match(this.rx.MEDIA_MATCH);i&&(window.matchMedia( i[1]).matches||(s=!0))}e.type===this.ruleTypes.STYLE_RULE?t(e):n&&e.type===this. ruleTypes.KEYFRAMES_RULE?n(e):e.type===this.ruleTypes.MIXIN_RULE&&(s=!0);var o=e .rules;if(o&&!s)for(var a,l=0,h=o.length;l<h&&(a=o[l]);l++)this.forEachRule(a,t, n,r)}},applyCss:function(e,t,n,r){var s=this.createScopeStyle(e,t);return this.a pplyStyle(s,n,r)},applyStyle:function(e,t,n){t=t||document.head;var r=n&&n.nextS ibling||t.firstChild;return this.__lastHeadApplyNode=e,t.insertBefore(e,r)},crea teScopeStyle:function(e,t){var n=document.createElement("style");return t&&n.set Attribute("scope",t),n.textContent=e,n},__lastHeadApplyNode:null,applyStylePlace Holder:function(e){var t=document.createComment(" Shady DOM styles for "+e+" "), n=this.__lastHeadApplyNode?this.__lastHeadApplyNode.nextSibling:null,r=document. head;return r.insertBefore(t,n||r.firstChild),this.__lastHeadApplyNode=t,t},cssF romModules:function(e,t){for(var n=e.trim().split(" "),r="",s=0;s<n.length;s++)r +=this.cssFromModule(n[s],t);return r},cssFromModule:function(e,t){var n=Polymer .DomModule.import(e);return n&&!n._cssText&&(n._cssText=this.cssFromElement(n)), !n&&t&&console.warn("Could not find style data in module named",e),n&&n._cssText ||""},cssFromElement:function(e){for(var t,n="",r=e.content||e,s=Polymer.TreeApi .arrayCopy(r.querySelectorAll(this.MODULE_STYLES_SELECTOR)),i=0;i<s.length;i++)i f(t=s[i],"template"===t.localName)n+=this.cssFromElement(t);else if("style"===t. localName){var o=t.getAttribute(this.INCLUDE_ATTR);o&&(n+=this.cssFromModules(o, !0)),t=t.__appliedElement||t,t.parentNode.removeChild(t),n+=this.resolveCss(t.te xtContent,e.ownerDocument)}else t.import&&t.import.body&&(n+=this.resolveCss(t.i mport.body.textContent,t.import));return n},isTargetedBuild:function(t){return e .useNativeShadow?"shadow"===t:"shady"===t},cssBuildTypeForModule:function(e){var t=Polymer.DomModule.import(e);if(t)return this.getCssBuildType(t)},getCssBuildT ype:function(e){return e.getAttribute("css-build")},_findMatchingParen:function( e,t){for(var n=0,r=t,s=e.length;r<s;r++)switch(e[r]){case"(":n++;break;case")":i f(0===--n)return r}return-1},processVariableAndFallback:function(e,t){var n=e.in dexOf("var(");if(n===-1)return t(e,"","","");var r=this._findMatchingParen(e,n+3 ),s=e.substring(n+4,r),i=e.substring(0,n),o=this.processVariableAndFallback(e.su bstring(r+1),t),a=s.indexOf(",");if(a===-1)return t(i,s.trim(),"",o);var l=s.sub string(0,a).trim(),h=s.substring(a+1).trim();return t(i,l,h,o)},rx:{VAR_ASSIGN:/ (?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\s}])|$)/gi,MIXIN _MATCH:/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,VAR_CONSUMED:/(--[\w-]+)\s*([:,;)] |$)/gi,ANIMATION_MATCH:/(animation\s*:)|(animation-name\s*:)/,MEDIA_MATCH:/@medi a[^(]*(\([^)]*\))/,IS_VAR:/^--/,BRACKETED:/\{[^}]*\}/g,HOST_PREFIX:"(?:^|[^.#[:] )",HOST_SUFFIX:"($|[.:[\\s>+~])"},resolveCss:Polymer.ResolveUrl.resolveCss,parse r:Polymer.CssParse,ruleTypes:Polymer.CssParse.types}}(),Polymer.StyleTransformer =function(){var e=Polymer.StyleUtil,t=Polymer.Settings,n={dom:function(e,t,n,r){ this._transformDom(e,t||"",n,r)},_transformDom:function(e,t,n,r){e.setAttribute& &this.element(e,t,n,r);for(var s=Polymer.dom(e).childNodes,i=0;i<s.length;i++)th is._transformDom(s[i],t,n,r)},element:function(e,t,n,s){if(n)s?e.removeAttribute (r):e.setAttribute(r,t);else if(t)if(e.classList)s?(e.classList.remove(r),e.clas sList.remove(t)):(e.classList.add(r),e.classList.add(t));else if(e.getAttribute) {var i=e.getAttribute(g);s?i&&e.setAttribute(g,i.replace(r,"").replace(t,"")):e. setAttribute(g,(i?i+" ":"")+r+" "+t)}},elementStyles:function(n,r){for(var s,i=n ._styles,o="",a=n.__cssBuild,l=0,h=i.length;l<h&&(s=i[l]);l++){var c=e.rulesForS tyle(s);o+=t.useNativeShadow||"shady"===a?e.toCssText(c,r):this.css(c,n.is,n.ext ends,r,n._scopeCssViaAttr)+"\n\n"}return o.trim()},css:function(t,n,r,s,i){var o =this._calcHostScope(n,r);n=this._calcElementScope(n,i);var a=this;return e.toCs sText(t,function(e){e.isScoped||(a.rule(e,n,o),e.isScoped=!0),s&&s(e,n,o)})},_ca lcElementScope:function(e,t){return e?t?m+e+y:d+e:""},_calcHostScope:function(e, t){return t?"[is="+e+"]":e},rule:function(e,t,n){this._transformRule(e,this._tra nsformComplexSelector,t,n)},_transformRule:function(e,t,n,r){e.selector=e.transf ormedSelector=this._transformRuleCss(e,t,n,r)},_transformRuleCss:function(t,n,r, s){var o=t.selector.split(i);if(!e.isKeyframesSelector(t))for(var a,l=0,h=o.leng th;l<h&&(a=o[l]);l++)o[l]=n.call(this,a,r,s);return o.join(i)},_transformComplex Selector:function(e,t,n){var r=!1,s=!1,a=this;return e=e.trim(),e=e.replace(P,l+ " $1"),e=e.replace(o,function(e,i,o){if(r)o=o.replace(_," ");else{var l=a._trans formCompoundSelector(o,i,t,n);r=r||l.stop,s=s||l.hostContext,i=l.combinator,o=l. value}return i+o}),s&&(e=e.replace(f,function(e,t,r,s){return t+r+" "+n+s+i+" "+ t+n+r+s})),e},_transformCompoundSelector:function(e,t,n,r){var s=e.search(_),i=! 1;e.indexOf(u)>=0?i=!0:e.indexOf(l)>=0?e=this._transformHostSelector(e,r):0!==s& &(e=n?this._transformSimpleSelector(e,n):e),e.indexOf(p)>=0&&(t="");var o;return s>=0&&(e=e.replace(_," "),o=!0),{value:e,combinator:t,stop:o,hostContext:i}},_t ransformSimpleSelector:function(e,t){var n=e.split(v);return n[0]+=t,n.join(v)}, _transformHostSelector:function(e,t){var n=e.match(c),r=n&&n[2].trim()||"";if(r) {if(r[0].match(a))return e.replace(c,function(e,n,r){return t+r});var s=r.split( a)[0];return s===t?r:S}return e.replace(l,t)},documentRule:function(e){e.selecto r=e.parsedSelector,this.normalizeRootSelector(e),t.useNativeShadow||this._transf ormRule(e,this._transformDocumentSelector)},normalizeRootSelector:function(e){e. selector===h&&(e.selector="html")},_transformDocumentSelector:function(e){return e.match(_)?this._transformComplexSelector(e,s):this._transformSimpleSelector(e. trim(),s)},SCOPE_NAME:"style-scope"},r=n.SCOPE_NAME,s=":not(["+r+"]):not(."+r+") ",i=",",o=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,a=/[[.:#*]/,l=":host",h=":ro ot",c=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,u=":host-context",f=/(.*)(?::ho st-context)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))(.*)/,p="::content",_=/::content|::s hadow|\/deep\//,d=".",m="["+r+"~=",y="]",v=":",g="class",P=new RegExp("^("+p+")" ),S="should_not_match";return n}(),Polymer.StyleExtends=function(){var e=Polymer .StyleUtil;return{hasExtends:function(e){return Boolean(e.match(this.rx.EXTEND)) },transform:function(t){var n=e.rulesForStyle(t),r=this;return e.forEachRule(n,f unction(e){if(r._mapRuleOntoParent(e),e.parent)for(var t;t=r.rx.EXTEND.exec(e.cs sText);){var n=t[1],s=r._findExtendor(n,e);s&&r._extendRule(e,s)}e.cssText=e.css Text.replace(r.rx.EXTEND,"")}),e.toCssText(n,function(e){e.selector.match(r.rx.S TRIP)&&(e.cssText="")},!0)},_mapRuleOntoParent:function(e){if(e.parent){for(var t,n=e.parent.map||(e.parent.map={}),r=e.selector.split(","),s=0;s<r.length;s++)t =r[s],n[t.trim()]=e;return n}},_findExtendor:function(e,t){return t.parent&&t.pa rent.map&&t.parent.map[e]||this._findExtendor(e,t.parent)},_extendRule:function( e,t){e.parent!==t.parent&&this._cloneAndAddRuleToParent(t,e.parent),e.extends=e. extends||[],e.extends.push(t),t.selector=t.selector.replace(this.rx.STRIP,""),t. selector=(t.selector&&t.selector+",\n")+e.selector,t.extends&&t.extends.forEach( function(t){this._extendRule(e,t)},this)},_cloneAndAddRuleToParent:function(e,t) {e=Object.create(e),e.parent=t,e.extends&&(e.extends=e.extends.slice()),t.rules. push(e)},rx:{EXTEND:/@extends\(([^)]*)\)\s*?;/gim,STRIP:/%[^,]*$/}}}(),Polymer.A pplyShim=function(){"use strict";function e(e,t){e=e.trim(),m[e]={properties:t,d ependants:{}}}function t(e){return e=e.trim(),m[e]}function n(e,t){var n=_.exec( t);return n&&(t=n[1]?y._getInitialValueForProperty(e):"apply-shim-inherit"),t}fu nction r(e){for(var t,r,s,i,o=e.split(";"),a={},l=0;l<o.length;l++)s=o[l],s&&(i= s.split(":"),i.length>1&&(t=i[0].trim(),r=n(t,i.slice(1).join(":")),a[t]=r));ret urn a}function s(e){var t=y.__currentElementProto,n=t&&t.is;for(var r in e.depen dants)r!==n&&(e.dependants[r].__applyShimInvalid=!0)}function i(n,i,o,a){if(o&&h .processVariableAndFallback(o,function(e,n){n&&t(n)&&(a="@apply "+n+";")}),!a)re turn n;var c=l(a),u=n.slice(0,n.indexOf("--")),f=r(c),p=f,_=t(i),m=_&&_.properti es;m?(p=Object.create(m),p=Polymer.Base.mixin(p,f)):e(i,p);var y,v,g=[],P=!1;for (y in p)v=f[y],void 0===v&&(v="initial"),!m||y in m||(P=!0),g.push(i+d+y+": "+v) ;return P&&s(_),_&&(_.properties=p),o&&(u=n+";"+u),u+g.join("; ")+";"}function o (e,t,n){return"var("+t+",var("+n+"));"}function a(n,r){n=n.replace(p,"");var s=[ ],i=t(n);if(i||(e(n,{}),i=t(n)),i){var o=y.__currentElementProto;o&&(i.dependant s[o.is]=o);var a,l,h;for(a in i.properties)h=r&&r[a],l=[a,": var(",n,d,a],h&&l.p ush(",",h),l.push(")"),s.push(l.join(""))}return s.join("; ")}function l(e){for( var t;t=c.exec(e);){var n=t[0],s=t[1],i=t.index,o=i+n.indexOf("@apply"),l=i+n.le ngth,h=e.slice(0,o),u=e.slice(l),f=r(h),p=a(s,f);e=[h,p,u].join(""),c.lastIndex= i+p.length}return e}var h=Polymer.StyleUtil,c=h.rx.MIXIN_MATCH,u=h.rx.VAR_ASSIGN ,f=/var\(\s*(--[^,]*),\s*(--[^)]*)\)/g,p=/;\s*/m,_=/^\s*(initial)|(inherit)\s*$/ ,d="_-_",m={},y={_measureElement:null,_map:m,_separator:d,transform:function(e,t ){this.__currentElementProto=t,h.forRulesInStyles(e,this._boundTransformRule),t. __applyShimInvalid=!1,this.__currentElementProto=null},transformRule:function(e) {e.cssText=this.transformCssText(e.parsedCssText),":root"===e.selector&&(e.selec tor=":host > *")},transformCssText:function(e){return e=e.replace(f,o),e=e.repla ce(u,i),l(e)},_getInitialValueForProperty:function(e){return this._measureElemen t||(this._measureElement=document.createElement("meta"),this._measureElement.sty le.all="initial",document.head.appendChild(this._measureElement)),window.getComp utedStyle(this._measureElement).getPropertyValue(e)}};return y._boundTransformRu le=y.transformRule.bind(y),y}(),function(){var e=Polymer.Base._prepElement,t=Pol ymer.Settings.useNativeShadow,n=Polymer.StyleUtil,r=Polymer.StyleTransformer,s=P olymer.StyleExtends,i=Polymer.ApplyShim,o=Polymer.Settings;Polymer.Base._addFeat ure({_prepElement:function(t){this._encapsulateStyle&&"shady"!==this.__cssBuild& &r.element(t,this.is,this._scopeCssViaAttr),e.call(this,t)},_prepStyles:function (){void 0===this._encapsulateStyle&&(this._encapsulateStyle=!t),t||(this._scopeS tyle=n.applyStylePlaceHolder(this.is)),this.__cssBuild=n.cssBuildTypeForModule(t his.is)},_prepShimStyles:function(){if(this._template){var e=n.isTargetedBuild(t his.__cssBuild);if(o.useNativeCSSProperties&&"shadow"===this.__cssBuild&&e)retur n;this._styles=this._styles||this._collectStyles(),o.useNativeCSSProperties&&!th is.__cssBuild&&i.transform(this._styles,this);var s=o.useNativeCSSProperties&&e? this._styles.length&&this._styles[0].textContent.trim():r.elementStyles(this);th is._prepStyleProperties(),!this._needsStyleProperties()&&s&&n.applyCss(s,this.is ,t?this._template.content:null,this._scopeStyle)}else this._styles=[]},_collectS tyles:function(){var e=[],t="",r=this.styleModules;if(r)for(var i,o=0,a=r.length ;o<a&&(i=r[o]);o++)t+=n.cssFromModule(i);t+=n.cssFromModule(this.is);var l=this. _template&&this._template.parentNode;if(!this._template||l&&l.id.toLowerCase()== =this.is||(t+=n.cssFromElement(this._template)),t){var h=document.createElement( "style");h.textContent=t,s.hasExtends(h.textContent)&&(t=s.transform(h)),e.push( h)}return e},_elementAdd:function(e){this._encapsulateStyle&&(e.__styleScoped?e. __styleScoped=!1:r.dom(e,this.is,this._scopeCssViaAttr))},_elementRemove:functio n(e){this._encapsulateStyle&&r.dom(e,this.is,this._scopeCssViaAttr,!0)},scopeSub tree:function(e,n){if(!t){var r=this,s=function(e){if(e.nodeType===Node.ELEMENT_ NODE){var t=e.getAttribute("class");e.setAttribute("class",r._scopeElementClass( e,t));for(var n,s=e.querySelectorAll("*"),i=0;i<s.length&&(n=s[i]);i++)t=n.getAt tribute("class"),n.setAttribute("class",r._scopeElementClass(n,t))}};if(s(e),n){ var i=new MutationObserver(function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++)if (t.addedNodes)for(var r=0;r<t.addedNodes.length;r++)s(t.addedNodes[r])});return i.observe(e,{childList:!0,subtree:!0}),i}}}})}(),Polymer.StyleProperties=functio n(){"use strict";function e(e,t){var n=parseInt(e/32),r=1<<e%32;t[n]=(t[n]||0)|r }var t=Polymer.DomApi.matchesSelector,n=Polymer.StyleUtil,r=Polymer.StyleTransfo rmer,s=navigator.userAgent.match("Trident"),i=Polymer.Settings;return{decorateSt yles:function(e,t){var s=this,i={},o=[],a=0,l=r._calcHostScope(t.is,t.extends);n .forRulesInStyles(e,function(e,r){s.decorateRule(e),e.index=a++,s.whenHostOrRoot Rule(t,e,r,function(r){if(e.parent.type===n.ruleTypes.MEDIA_RULE&&(t.__notStyleS copeCacheable=!0),r.isHost){var s=r.selector.split(" ").some(function(e){return 0===e.indexOf(l)&&e.length!==l.length});t.__notStyleScopeCacheable=t.__notStyleS copeCacheable||s}}),s.collectPropertiesInCssText(e.propertyInfo.cssText,i)},func tion(e){o.push(e)}),e._keyframes=o;var h=[];for(var c in i)h.push(c);return h},d ecorateRule:function(e){if(e.propertyInfo)return e.propertyInfo;var t={},n={},r= this.collectProperties(e,n);return r&&(t.properties=n,e.rules=null),t.cssText=th is.collectCssText(e),e.propertyInfo=t,t},collectProperties:function(e,t){var n=e .propertyInfo;if(!n){for(var r,s,i,o=this.rx.VAR_ASSIGN,a=e.parsedCssText;r=o.ex ec(a);)s=(r[2]||r[3]).trim(),"inherit"!==s&&(t[r[1].trim()]=s),i=!0;return i}if( n.properties)return Polymer.Base.mixin(t,n.properties),!0},collectCssText:functi on(e){return this.collectConsumingCssText(e.parsedCssText)},collectConsumingCssT ext:function(e){return e.replace(this.rx.BRACKETED,"").replace(this.rx.VAR_ASSIG N,"")},collectPropertiesInCssText:function(e,t){for(var n;n=this.rx.VAR_CONSUMED .exec(e);){var r=n[1];":"!==n[2]&&(t[r]=!0)}},reify:function(e){for(var t,n=Obje ct.getOwnPropertyNames(e),r=0;r<n.length;r++)t=n[r],e[t]=this.valueForProperty(e [t],e)},valueForProperty:function(e,t){if(e)if(e.indexOf(";")>=0)e=this.valueFor Properties(e,t);else{var r=this,s=function(e,n,s,i){var o=r.valueForProperty(t[n ],t);return o&&"initial"!==o?"apply-shim-inherit"===o&&(o="inherit"):o=r.valueFo rProperty(t[s]||s,t)||s,e+(o||"")+i};e=n.processVariableAndFallback(e,s)}return e&&e.trim()||""},valueForProperties:function(e,t){for(var n,r,s=e.split(";"),i=0 ;i<s.length;i++)if(n=s[i]){if(this.rx.MIXIN_MATCH.lastIndex=0,r=this.rx.MIXIN_MA TCH.exec(n))n=this.valueForProperty(t[r[1]],t);else{var o=n.indexOf(":");if(o!== -1){var a=n.substring(o);a=a.trim(),a=this.valueForProperty(a,t)||a,n=n.substrin g(0,o)+a}}s[i]=n&&n.lastIndexOf(";")===n.length-1?n.slice(0,-1):n||""}return s.j oin(";")},applyProperties:function(e,t){var n="";e.propertyInfo||this.decorateRu le(e),e.propertyInfo.cssText&&(n=this.valueForProperties(e.propertyInfo.cssText, t)),e.cssText=n},applyKeyframeTransforms:function(e,t){var n=e.cssText,r=e.cssTe xt;if(null==e.hasAnimations&&(e.hasAnimations=this.rx.ANIMATION_MATCH.test(n)),e .hasAnimations){var s;if(null==e.keyframeNamesToTransform){e.keyframeNamesToTran sform=[];for(var i in t)s=t[i],r=s(n),n!==r&&(n=r,e.keyframeNamesToTransform.pus h(i))}else{for(var o=0;o<e.keyframeNamesToTransform.length;++o)s=t[e.keyframeNam esToTransform[o]],n=s(n);r=n}}e.cssText=r},propertyDataFromStyles:function(r,s){ var i={},o=this,a=[];return n.forActiveRulesInStyles(r,function(n){n.propertyInf o||o.decorateRule(n);var r=n.transformedSelector||n.parsedSelector;s&&n.property Info.properties&&r&&t.call(s,r)&&(o.collectProperties(n,i),e(n.index,a))}),{prop erties:i,key:a}},whenHostOrRootRule:function(e,t,n,s){if(t.propertyInfo||self.de corateRule(t),t.propertyInfo.properties){var o=e.is?r._calcHostScope(e.is,e.exte nds):"html",a=t.parsedSelector,l=":root"===a,h=0===a.indexOf(":host"),c=e.__cssB uild||n.__cssBuild;if("shady"===c&&(l=a===o+" > *."+o||a.indexOf("html")!==-1,h= !l&&0===a.indexOf(o)),"shadow"===c&&(l=":host > *"===a||"html"===a,h=h&&!l),l||h ){var u=o;h&&(i.useNativeShadow&&!t.transformedSelector&&(t.transformedSelector= r._transformRuleCss(t,r._transformComplexSelector,e.is,o)),u=t.transformedSelect or||t.parsedSelector),s({selector:u,isHost:h,isRoot:l})}}},hostAndRootProperties ForScope:function(e){var r={},s={},i=this;return n.forActiveRulesInStyles(e._sty les,function(n,o){i.whenHostOrRootRule(e,n,o,function(o){var a=e._element||e;t.c all(a,o.selector)&&(o.isHost?i.collectProperties(n,r):i.collectProperties(n,s))} )}),{rootProps:s,hostProps:r}},transformStyles:function(e,t,n){var s=this,o=r._c alcHostScope(e.is,e.extends),a=e.extends?"\\"+o.slice(0,-1)+"\\]":o,l=new RegExp (this.rx.HOST_PREFIX+a+this.rx.HOST_SUFFIX),h=this._elementKeyframeTransforms(e, n);return r.elementStyles(e,function(r){s.applyProperties(r,t),i.useNativeShadow ||Polymer.StyleUtil.isKeyframesSelector(r)||!r.cssText||(s.applyKeyframeTransfor ms(r,h),s._scopeSelector(r,l,o,e._scopeCssViaAttr,n))})},_elementKeyframeTransfo rms:function(e,t){var n=e._styles._keyframes,r={};if(!i.useNativeShadow&&n)for(v ar s=0,o=n[s];s<n.length;o=n[++s])this._scopeKeyframes(o,t),r[o.keyframesName]=t his._keyframesRuleTransformer(o);return r},_keyframesRuleTransformer:function(e) {return function(t){return t.replace(e.keyframesNameRx,e.transformedKeyframesNam e)}},_scopeKeyframes:function(e,t){e.keyframesNameRx=new RegExp(e.keyframesName, "g"),e.transformedKeyframesName=e.keyframesName+"-"+t,e.transformedSelector=e.tr ansformedSelector||e.selector,e.selector=e.transformedSelector.replace(e.keyfram esName,e.transformedKeyframesName)},_scopeSelector:function(e,t,n,s,i){e.transfo rmedSelector=e.transformedSelector||e.selector;for(var o,a=e.transformedSelector ,l=s?"["+r.SCOPE_NAME+"~="+i+"]":"."+i,h=a.split(","),c=0,u=h.length;c<u&&(o=h[c ]);c++)h[c]=o.match(t)?o.replace(n,l):l+" "+o;e.selector=h.join(",")},applyEleme ntScopeSelector:function(e,t,n,s){var i=s?e.getAttribute(r.SCOPE_NAME):e.getAttr ibute("class")||"",o=n?i.replace(n,t):(i?i+" ":"")+this.XSCOPE_NAME+" "+t;i!==o& &(s?e.setAttribute(r.SCOPE_NAME,o):e.setAttribute("class",o))},applyElementStyle :function(e,t,r,o){var a=o?o.textContent||"":this.transformStyles(e,t,r),l=e._cu stomStyle;return l&&!i.useNativeShadow&&l!==o&&(l._useCount--,l._useCount<=0&&l. parentNode&&l.parentNode.removeChild(l)),i.useNativeShadow?e._customStyle?(e._cu stomStyle.textContent=a,o=e._customStyle):a&&(o=n.applyCss(a,r,e.root,e._scopeSt yle)):o?o.parentNode||n.applyStyle(o,null,e._scopeStyle):a&&(o=n.applyCss(a,r,nu ll,e._scopeStyle)),o&&(o._useCount=o._useCount||0,e._customStyle!=o&&o._useCount ++,e._customStyle=o),s&&(o.textContent=o.textContent),o},mixinCustomStyle:functi on(e,t){var n;for(var r in t)n=t[r],(n||0===n)&&(e[r]=n)},updateNativeStylePrope rties:function(e,t){var n=e.__customStyleProperties;if(n)for(var r=0;r<n.length; r++)e.style.removeProperty(n[r]);var s=[];for(var i in t)null!==t[i]&&(e.style.s etProperty(i,t[i]),s.push(i));e.__customStyleProperties=s},rx:n.rx,XSCOPE_NAME:" x-scope"}}(),function(){Polymer.StyleCache=function(){this.cache={}},Polymer.Sty leCache.prototype={MAX:100,store:function(e,t,n,r){t.keyValues=n,t.styles=r;var s=this.cache[e]=this.cache[e]||[];s.push(t),s.length>this.MAX&&s.shift()},retrie ve:function(e,t,n){var r=this.cache[e];if(r)for(var s,i=r.length-1;i>=0;i--)if(s =r[i],n===s.styles&&this._objectsEqual(t,s.keyValues))return s},clear:function() {this.cache={}},_objectsEqual:function(e,t){var n,r;for(var s in e)if(n=e[s],r=t [s],!("object"==typeof n&&n?this._objectsStrictlyEqual(n,r):n===r))return!1;retu rn!Array.isArray(e)||e.length===t.length},_objectsStrictlyEqual:function(e,t){re turn this._objectsEqual(e,t)&&this._objectsEqual(t,e)}}}(),Polymer.StyleDefaults =function(){var e=Polymer.StyleProperties,t=Polymer.StyleCache,n=Polymer.Setting s.useNativeCSSProperties,r={_styles:[],_properties:null,customStyle:{},_styleCac he:new t,_element:Polymer.DomApi.wrap(document.documentElement),addStyle:functio n(e){this._styles.push(e),this._properties=null},get _styleProperties(){return t his._properties||(e.decorateStyles(this._styles,this),this._styles._scopeStylePr operties=null,this._properties=e.hostAndRootPropertiesForScope(this).rootProps,e .mixinCustomStyle(this._properties,this.customStyle),e.reify(this._properties)), this._properties},hasStyleProperties:function(){return Boolean(this._properties) },_needsStyleProperties:function(){},_computeStyleProperties:function(){return t his._styleProperties},updateStyles:function(t){this._properties=null,t&&Polymer. Base.mixin(this.customStyle,t),this._styleCache.clear();for(var r,s=0;s<this._st yles.length;s++)r=this._styles[s],r=r.__importElement||r,r._apply();n&&e.updateN ativeStyleProperties(document.documentElement,this.customStyle)}};return r}(),fu nction(){"use strict";var e=Polymer.Base.serializeValueToAttribute,t=Polymer.Sty leProperties,n=Polymer.StyleTransformer,r=Polymer.StyleDefaults,s=Polymer.Settin gs.useNativeShadow,i=Polymer.Settings.useNativeCSSProperties;Polymer.Base._addFe ature({_prepStyleProperties:function(){i||(this._ownStylePropertyNames=this._sty les&&this._styles.length?t.decorateStyles(this._styles,this):null)},customStyle: null,getComputedStyleValue:function(e){return!i&&this._styleProperties&&this._st yleProperties[e]||getComputedStyle(this).getPropertyValue(e)},_setupStylePropert ies:function(){this.customStyle={},this._styleCache=null,this._styleProperties=n ull,this._scopeSelector=null,this._ownStyleProperties=null,this._customStyle=nul l},_needsStyleProperties:function(){return Boolean(!i&&this._ownStylePropertyNam es&&this._ownStylePropertyNames.length)},_validateApplyShim:function(){if(this._ _applyShimInvalid){Polymer.ApplyShim.transform(this._styles,this.__proto__);var e=n.elementStyles(this);if(s){var t=this._template.content.querySelector("style" );t&&(t.textContent=e)}else{var r=this._scopeStyle&&this._scopeStyle.nextSibling ;r&&(r.textContent=e)}}},_beforeAttached:function(){this._scopeSelector&&!this._ _stylePropertiesInvalid||!this._needsStyleProperties()||(this.__stylePropertiesI nvalid=!1,this._updateStyleProperties())},_findStyleHost:function(){for(var e,t= this;e=Polymer.dom(t).getOwnerRoot();){if(Polymer.isInstance(e.host))return e.ho st;t=e.host}return r},_updateStyleProperties:function(){var e,n=this._findStyleH ost();n._styleProperties||n._computeStyleProperties(),n._styleCache||(n._styleCa che=new Polymer.StyleCache);
4 var r=t.propertyDataFromStyles(n._styles,this),i=!this.__notStyleScopeCacheable; i&&(r.key.customStyle=this.customStyle,e=n._styleCache.retrieve(this.is,r.key,th is._styles));var a=Boolean(e);a?this._styleProperties=e._styleProperties:this._c omputeStyleProperties(r.properties),this._computeOwnStyleProperties(),a||(e=o.re trieve(this.is,this._ownStyleProperties,this._styles));var l=Boolean(e)&&!a,h=th is._applyStyleProperties(e);a||(h=h&&s?h.cloneNode(!0):h,e={style:h,_scopeSelect or:this._scopeSelector,_styleProperties:this._styleProperties},i&&(r.key.customS tyle={},this.mixin(r.key.customStyle,this.customStyle),n._styleCache.store(this. is,e,r.key,this._styles)),l||o.store(this.is,Object.create(e),this._ownStyleProp erties,this._styles))},_computeStyleProperties:function(e){var n=this._findStyle Host();n._styleProperties||n._computeStyleProperties();var r=Object.create(n._st yleProperties),s=t.hostAndRootPropertiesForScope(this);this.mixin(r,s.hostProps) ,e=e||t.propertyDataFromStyles(n._styles,this).properties,this.mixin(r,e),this.m ixin(r,s.rootProps),t.mixinCustomStyle(r,this.customStyle),t.reify(r),this._styl eProperties=r},_computeOwnStyleProperties:function(){for(var e,t={},n=0;n<this._ ownStylePropertyNames.length;n++)e=this._ownStylePropertyNames[n],t[e]=this._sty leProperties[e];this._ownStyleProperties=t},_scopeCount:0,_applyStyleProperties: function(e){var n=this._scopeSelector;this._scopeSelector=e?e._scopeSelector:thi s.is+"-"+this.__proto__._scopeCount++;var r=t.applyElementStyle(this,this._style Properties,this._scopeSelector,e&&e.style);return s||t.applyElementScopeSelector (this,this._scopeSelector,n,this._scopeCssViaAttr),r},serializeValueToAttribute: function(t,n,r){if(r=r||this,"class"===n&&!s){var i=r===this?this.domHost||this. dataHost:this;i&&(t=i._scopeElementClass(r,t))}r=this.shadyRoot&&this.shadyRoot. _hasDistributed?Polymer.dom(r):r,e.call(this,t,n,r)},_scopeElementClass:function (e,t){return s||this._scopeCssViaAttr||(t=(t?t+" ":"")+a+" "+this.is+(e._scopeSe lector?" "+l+" "+e._scopeSelector:"")),t},updateStyles:function(e){e&&this.mixin (this.customStyle,e),i?t.updateNativeStyleProperties(this,this.customStyle):(thi s.isAttached?this._needsStyleProperties()?this._updateStyleProperties():this._st yleProperties=null:this.__stylePropertiesInvalid=!0,this._styleCache&&this._styl eCache.clear(),this._updateRootStyles())},_updateRootStyles:function(e){e=e||thi s.root;for(var t,n=Polymer.dom(e)._query(function(e){return e.shadyRoot||e.shado wRoot}),r=0,s=n.length;r<s&&(t=n[r]);r++)t.updateStyles&&t.updateStyles()}}),Pol ymer.updateStyles=function(e){r.updateStyles(e),Polymer.Base._updateRootStyles(d ocument)};var o=new Polymer.StyleCache;Polymer.customStyleCache=o;var a=n.SCOPE_ NAME,l=t.XSCOPE_NAME}(),Polymer.Base._addFeature({_registerFeatures:function(){t his._prepIs(),this._prepConstructor(),this._prepStyles()},_finishRegisterFeature s:function(){this._prepTemplate(),this._prepShimStyles(),this._prepAnnotations() ,this._prepEffects(),this._prepBehaviors(),this._prepPropertyInfo(),this._prepBi ndings(),this._prepShady()},_prepBehavior:function(e){this._addPropertyEffects(e .properties),this._addComplexObserverEffects(e.observers),this._addHostAttribute s(e.hostAttributes)},_initFeatures:function(){this._setupGestures(),this._setupC onfigure(),this._setupStyleProperties(),this._setupDebouncers(),this._setupShady (),this._registerHost(),this._template&&(this._validateApplyShim(),this._poolCon tent(),this._beginHosting(),this._stampTemplate(),this._endHosting(),this._marsh alAnnotationReferences()),this._marshalInstanceEffects(),this._marshalBehaviors( ),this._marshalHostAttributes(),this._marshalAttributes(),this._tryReady()},_mar shalBehavior:function(e){e.listeners&&this._listenListeners(e.listeners)}}),func tion(){var e,t=Polymer.StyleProperties,n=Polymer.StyleUtil,r=Polymer.CssParse,s= Polymer.StyleDefaults,i=Polymer.StyleTransformer,o=Polymer.ApplyShim,a=Polymer.D ebounce,l=Polymer.Settings;Polymer({is:"custom-style",extends:"style",_template: null,properties:{include:String},ready:function(){this.__appliedElement=this.__a ppliedElement||this,this.__cssBuild=n.getCssBuildType(this),this.__appliedElemen t!==this&&(this.__appliedElement.__cssBuild=this.__cssBuild),this._tryApply()},a ttached:function(){this._tryApply()},_tryApply:function(){if(!this._appliesToDoc ument&&this.parentNode&&"dom-module"!==this.parentNode.localName){this._appliesT oDocument=!0;var e=this.__appliedElement;if(l.useNativeCSSProperties||(this.__ne edsUpdateStyles=s.hasStyleProperties(),s.addStyle(e)),e.textContent||this.includ e)this._apply(!0);else{var t=this,n=new MutationObserver(function(){n.disconnect (),t._apply(!0)});n.observe(e,{childList:!0})}}},_updateStyles:function(){Polyme r.updateStyles()},_apply:function(e){var t=this.__appliedElement;if(this.include &&(t.textContent=n.cssFromModules(this.include,!0)+t.textContent),t.textContent) {var r=this.__cssBuild,s=n.isTargetedBuild(r);if(!l.useNativeCSSProperties||!s){ var a=n.rulesForStyle(t);if(s||n.forEachRule(a,function(e){i.documentRule(e),l.u seNativeCSSProperties&&!r&&o.transformRule(e)}),l.useNativeCSSProperties)t.textC ontent=n.toCssText(a);else{var h=this,c=function(){h._flushCustomProperties()};e ?Polymer.RenderStatus.whenReady(c):c()}}}},_flushCustomProperties:function(){thi s.__needsUpdateStyles?(this.__needsUpdateStyles=!1,e=a(e,this._updateStyles)):th is._applyCustomProperties()},_applyCustomProperties:function(){var e=this.__appl iedElement;this._computeStyleProperties();var s=this._styleProperties,i=n.rulesF orStyle(e);i&&(e.textContent=n.toCssText(i,function(e){var n=e.cssText=e.parsedC ssText;e.propertyInfo&&e.propertyInfo.cssText&&(n=r.removeCustomPropAssignment(n ),e.cssText=t.valueForProperties(n,s))}))}})}(),Polymer.Templatizer={properties: {__hideTemplateChildren__:{observer:"_showHideChildren"}},_instanceProps:Polymer .nob,_parentPropPrefix:"_parent_",templatize:function(e){if(this._templatized=e, e._content||(e._content=e.content),e._content._ctor)return this.ctor=e._content. _ctor,void this._prepParentProperties(this.ctor.prototype,e);var t=Object.create (Polymer.Base);this._customPrepAnnotations(t,e),this._prepParentProperties(t,e), t._prepEffects(),this._customPrepEffects(t),t._prepBehaviors(),t._prepPropertyIn fo(),t._prepBindings(),t._notifyPathUp=this._notifyPathUpImpl,t._scopeElementCla ss=this._scopeElementClassImpl,t.listen=this._listenImpl,t._showHideChildren=thi s._showHideChildrenImpl,t.__setPropertyOrig=this.__setProperty,t.__setProperty=t his.__setPropertyImpl;var n=this._constructorImpl,r=function(e,t){n.call(this,e, t)};r.prototype=t,t.constructor=r,e._content._ctor=r,this.ctor=r},_getRootDataHo st:function(){return this.dataHost&&this.dataHost._rootDataHost||this.dataHost}, _showHideChildrenImpl:function(e){for(var t=this._children,n=0;n<t.length;n++){v ar r=t[n];Boolean(e)!=Boolean(r.__hideTemplateChildren__)&&(r.nodeType===Node.TE XT_NODE?e?(r.__polymerTextContent__=r.textContent,r.textContent=""):r.textConten t=r.__polymerTextContent__:r.style&&(e?(r.__polymerDisplay__=r.style.display,r.s tyle.display="none"):r.style.display=r.__polymerDisplay__)),r.__hideTemplateChil dren__=e}},__setPropertyImpl:function(e,t,n,r){r&&r.__hideTemplateChildren__&&"t extContent"==e&&(e="__polymerTextContent__"),this.__setPropertyOrig(e,t,n,r)},_d ebounceTemplate:function(e){Polymer.dom.addDebouncer(this.debounce("_debounceTem plate",e))},_flushTemplates:function(){Polymer.dom.flush()},_customPrepEffects:f unction(e){var t=e._parentProps;for(var n in t)e._addPropertyEffect(n,"function" ,this._createHostPropEffector(n));for(n in this._instanceProps)e._addPropertyEff ect(n,"function",this._createInstancePropEffector(n))},_customPrepAnnotations:fu nction(e,t){e._template=t;var n=t._content;if(!n._notes){var r=e._rootDataHost;r &&(Polymer.Annotations.prepElement=function(){r._prepElement()}),n._notes=Polyme r.Annotations.parseAnnotations(t),Polymer.Annotations.prepElement=null,this._pro cessAnnotations(n._notes)}e._notes=n._notes,e._parentProps=n._parentProps},_prep ParentProperties:function(e,t){var n=this._parentProps=e._parentProps;if(this._f orwardParentProp&&n){var r,s=e._parentPropProto;if(!s){for(r in this._instancePr ops)delete n[r];s=e._parentPropProto=Object.create(null),t!=this&&(Polymer.Bind. prepareModel(s),Polymer.Base.prepareModelNotifyPath(s));for(r in n){var i=this._ parentPropPrefix+r,o=[{kind:"function",effect:this._createForwardPropEffector(r) ,fn:Polymer.Bind._functionEffect},{kind:"notify",fn:Polymer.Bind._notifyEffect,e ffect:{event:Polymer.CaseMap.camelToDashCase(i)+"-changed"}}];Polymer.Bind._crea teAccessors(s,i,o)}}var a=this;t!=this&&(Polymer.Bind.prepareInstance(t),t._forw ardParentProp=function(e,t){a._forwardParentProp(e,t)}),this._extendTemplate(t,s ),t._pathEffector=function(e,t,n){return a._pathEffectorImpl(e,t,n)}}},_createFo rwardPropEffector:function(e){return function(t,n){this._forwardParentProp(e,n)} },_createHostPropEffector:function(e){var t=this._parentPropPrefix;return functi on(n,r){this.dataHost._templatized[t+e]=r}},_createInstancePropEffector:function (e){return function(t,n,r,s){s||this.dataHost._forwardInstanceProp(this,e,n)}},_ extendTemplate:function(e,t){var n=Object.getOwnPropertyNames(t);t._propertySett er&&(e._propertySetter=t._propertySetter);for(var r,s=0;s<n.length&&(r=n[s]);s++ ){var i=e[r],o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o) ,void 0!==i&&e._propertySetter(r,i)}},_showHideChildren:function(e){},_forwardIn stancePath:function(e,t,n){},_forwardInstanceProp:function(e,t,n){},_notifyPathU pImpl:function(e,t){var n=this.dataHost,r=e.indexOf("."),s=r<0?e:e.slice(0,r);n. _forwardInstancePath.call(n,this,e,t),s in n._parentProps&&n._templatized._notif yPath(n._parentPropPrefix+e,t)},_pathEffectorImpl:function(e,t,n){if(this._forwa rdParentPath&&0===e.indexOf(this._parentPropPrefix)){var r=e.substring(this._par entPropPrefix.length),s=this._modelForPath(r);s in this._parentProps&&this._forw ardParentPath(r,t)}Polymer.Base._pathEffector.call(this._templatized,e,t,n)},_co nstructorImpl:function(e,t){this._rootDataHost=t._getRootDataHost(),this._setupC onfigure(e),this._registerHost(t),this._beginHosting(),this.root=this.instanceTe mplate(this._template),this.root.__noContent=!this._notes._hasContent,this.root. __styleScoped=!0,this._endHosting(),this._marshalAnnotatedNodes(),this._marshalI nstanceEffects(),this._marshalAnnotatedListeners();for(var n=[],r=this.root.firs tChild;r;r=r.nextSibling)n.push(r),r._templateInstance=this;this._children=n,t._ _hideTemplateChildren__&&this._showHideChildren(!0),this._tryReady()},_listenImp l:function(e,t,n){var r=this,s=this._rootDataHost,i=s._createEventHandler(e,t,n) ,o=function(e){e.model=r,i(e)};s._listen(e,t,o)},_scopeElementClassImpl:function (e,t){var n=this._rootDataHost;return n?n._scopeElementClass(e,t):t},stamp:funct ion(e){if(e=e||{},this._parentProps){var t=this._templatized;for(var n in this._ parentProps)void 0===e[n]&&(e[n]=t[this._parentPropPrefix+n])}return new this.ct or(e,this)},modelForElement:function(e){for(var t;e;)if(t=e._templateInstance){i f(t.dataHost==this)return t;e=t.dataHost}else e=e.parentNode}},Polymer({is:"dom- template",extends:"template",_template:null,behaviors:[Polymer.Templatizer],read y:function(){this.templatize(this)}}),Polymer._collections=new WeakMap,Polymer.C ollection=function(e){Polymer._collections.set(e,this),this.userArray=e,this.sto re=e.slice(),this.initMap()},Polymer.Collection.prototype={constructor:Polymer.C ollection,initMap:function(){for(var e=this.omap=new WeakMap,t=this.pmap={},n=th is.store,r=0;r<n.length;r++){var s=n[r];s&&"object"==typeof s?e.set(s,r):t[s]=r} },add:function(e){var t=this.store.push(e)-1;return e&&"object"==typeof e?this.o map.set(e,t):this.pmap[e]=t,"#"+t},removeKey:function(e){(e=this._parseKey(e))&& (this._removeFromMap(this.store[e]),delete this.store[e])},_removeFromMap:functi on(e){e&&"object"==typeof e?this.omap.delete(e):delete this.pmap[e]},remove:func tion(e){var t=this.getKey(e);return this.removeKey(t),t},getKey:function(e){var t;if(t=e&&"object"==typeof e?this.omap.get(e):this.pmap[e],void 0!=t)return"#"+t },getKeys:function(){return Object.keys(this.store).map(function(e){return"#"+e} )},_parseKey:function(e){if(e&&"#"==e[0])return e.slice(1)},setItem:function(e,t ){if(e=this._parseKey(e)){var n=this.store[e];n&&this._removeFromMap(n),t&&"obje ct"==typeof t?this.omap.set(t,e):this.pmap[t]=e,this.store[e]=t}},getItem:functi on(e){if(e=this._parseKey(e))return this.store[e]},getItems:function(){var e=[], t=this.store;for(var n in t)e.push(t[n]);return e},_applySplices:function(e){for (var t,n,r={},s=0;s<e.length&&(n=e[s]);s++){n.addedKeys=[];for(var i=0;i<n.remov ed.length;i++)t=this.getKey(n.removed[i]),r[t]=r[t]?null:-1;for(i=0;i<n.addedCou nt;i++){var o=this.userArray[n.index+i];t=this.getKey(o),t=void 0===t?this.add(o ):t,r[t]=r[t]?null:1,n.addedKeys.push(t)}}var a=[],l=[];for(t in r)r[t]<0&&(this .removeKey(t),a.push(t)),r[t]>0&&l.push(t);return[{removed:a,added:l}]}},Polymer .Collection.get=function(e){return Polymer._collections.get(e)||new Polymer.Coll ection(e)},Polymer.Collection.applySplices=function(e,t){var n=Polymer._collecti ons.get(e);return n?n._applySplices(t):null},Polymer({is:"dom-repeat",extends:"t emplate",_template:null,properties:{items:{type:Array},as:{type:String,value:"it em"},indexAs:{type:String,value:"index"},sort:{type:Function,observer:"_sortChan ged"},filter:{type:Function,observer:"_filterChanged"},observe:{type:String,obse rver:"_observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!0,re adOnly:!0},initialCount:{type:Number,observer:"_initializeChunking"},targetFrame rate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"_computeFram eTime(targetFramerate)"}},behaviors:[Polymer.Templatizer],observers:["_itemsChan ged(items.*)"],created:function(){this._instances=[],this._pool=[],this._limit=1 /0;var e=this;this._boundRenderChunk=function(){e._renderChunk()}},detached:func tion(){this.__isDetached=!0;for(var e=0;e<this._instances.length;e++)this._detac hInstance(e)},attached:function(){if(this.__isDetached){this.__isDetached=!1;for (var e=Polymer.dom(Polymer.dom(this).parentNode),t=0;t<this._instances.length;t+ +)this._attachInstance(t,e)}},ready:function(){this._instanceProps={__key__:!0}, this._instanceProps[this.as]=!0,this._instanceProps[this.indexAs]=!0,this.ctor|| this.templatize(this)},_sortChanged:function(e){var t=this._getRootDataHost();th is._sortFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,arguments)} ),this._needFullRefresh=!0,this.items&&this._debounceTemplate(this._render)},_fi lterChanged:function(e){var t=this._getRootDataHost();this._filterFn=e&&("functi on"==typeof e?e:function(){return t[e].apply(t,arguments)}),this._needFullRefres h=!0,this.items&&this._debounceTemplate(this._render)},_computeFrameTime:functio n(e){return Math.ceil(1e3/e)},_initializeChunking:function(){this.initialCount&& (this._limit=this.initialCount,this._chunkCount=this.initialCount,this._lastChun kTime=performance.now())},_tryRenderChunk:function(){this.items&&this._limit<thi s.items.length&&this.debounce("renderChunk",this._requestRenderChunk)},_requestR enderChunk:function(){requestAnimationFrame(this._boundRenderChunk)},_renderChun k:function(){var e=performance.now(),t=this._targetFrameTime/(e-this._lastChunkT ime);this._chunkCount=Math.round(this._chunkCount*t)||1,this._limit+=this._chunk Count,this._lastChunkTime=e,this._debounceTemplate(this._render)},_observeChange d:function(){this._observePaths=this.observe&&this.observe.replace(".*",".").spl it(" ")},_itemsChanged:function(e){if("items"==e.path)Array.isArray(this.items)? this.collection=Polymer.Collection.get(this.items):this.items?this._error(this._ logf("dom-repeat","expected array for `items`, found",this.items)):this.collecti on=null,this._keySplices=[],this._indexSplices=[],this._needFullRefresh=!0,this. _initializeChunking(),this._debounceTemplate(this._render);else if("items.splice s"==e.path)this._keySplices=this._keySplices.concat(e.value.keySplices),this._in dexSplices=this._indexSplices.concat(e.value.indexSplices),this._debounceTemplat e(this._render);else{var t=e.path.slice(6);this._forwardItemPath(t,e.value),this ._checkObservedPaths(t)}},_checkObservedPaths:function(e){if(this._observePaths) {e=e.substring(e.indexOf(".")+1);for(var t=this._observePaths,n=0;n<t.length;n++ )if(0===e.indexOf(t[n]))return this._needFullRefresh=!0,void(this.delay?this.deb ounce("render",this._render,this.delay):this._debounceTemplate(this._render))}}, render:function(){this._needFullRefresh=!0,this._debounceTemplate(this._render), this._flushTemplates()},_render:function(){this._needFullRefresh?(this._applyFul lRefresh(),this._needFullRefresh=!1):this._keySplices.length&&(this._sortFn?this ._applySplicesUserSort(this._keySplices):this._filterFn?this._applyFullRefresh() :this._applySplicesArrayOrder(this._indexSplices)),this._keySplices=[],this._ind exSplices=[];for(var e=this._keyToInstIdx={},t=this._instances.length-1;t>=0;t-- ){var n=this._instances[t];n.isPlaceholder&&t<this._limit?n=this._insertInstance (t,n.__key__):!n.isPlaceholder&&t>=this._limit&&(n=this._downgradeInstance(t,n._ _key__)),e[n.__key__]=t,n.isPlaceholder||n.__setProperty(this.indexAs,t,!0)}this ._pool.length=0,this._setRenderedItemCount(this._instances.length),this.fire("do m-change"),this._tryRenderChunk()},_applyFullRefresh:function(){var e,t=this.col lection;if(this._sortFn)e=t?t.getKeys():[];else{e=[];var n=this.items;if(n)for(v ar r=0;r<n.length;r++)e.push(t.getKey(n[r]))}var s=this;for(this._filterFn&&(e=e .filter(function(e){return s._filterFn(t.getItem(e))})),this._sortFn&&e.sort(fun ction(e,n){return s._sortFn(t.getItem(e),t.getItem(n))}),r=0;r<e.length;r++){var i=e[r],o=this._instances[r];o?(o.__key__=i,!o.isPlaceholder&&r<this._limit&&o._ _setProperty(this.as,t.getItem(i),!0)):r<this._limit?this._insertInstance(r,i):t his._insertPlaceholder(r,i)}for(var a=this._instances.length-1;a>=r;a--)this._de tachAndRemoveInstance(a)},_numericSort:function(e,t){return e-t},_applySplicesUs erSort:function(e){for(var t,n,r=this.collection,s={},i=0;i<e.length&&(n=e[i]);i ++){for(var o=0;o<n.removed.length;o++)t=n.removed[o],s[t]=s[t]?null:-1;for(o=0; o<n.added.length;o++)t=n.added[o],s[t]=s[t]?null:1}var a=[],l=[];for(t in s)s[t] ===-1&&a.push(this._keyToInstIdx[t]),1===s[t]&&l.push(t);if(a.length)for(a.sort( this._numericSort),i=a.length-1;i>=0;i--){var h=a[i];void 0!==h&&this._detachAnd RemoveInstance(h)}var c=this;if(l.length){this._filterFn&&(l=l.filter(function(e ){return c._filterFn(r.getItem(e))})),l.sort(function(e,t){return c._sortFn(r.ge tItem(e),r.getItem(t))});var u=0;for(i=0;i<l.length;i++)u=this._insertRowUserSor t(u,l[i])}},_insertRowUserSort:function(e,t){for(var n=this.collection,r=n.getIt em(t),s=this._instances.length-1,i=-1;e<=s;){var o=e+s>>1,a=this._instances[o]._ _key__,l=this._sortFn(n.getItem(a),r);if(l<0)e=o+1;else{if(!(l>0)){i=o;break}s=o -1}}return i<0&&(i=s+1),this._insertPlaceholder(i,t),i},_applySplicesArrayOrder: function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++){for(var r=0;r<t.removed.leng th;r++)this._detachAndRemoveInstance(t.index);for(r=0;r<t.addedKeys.length;r++)t his._insertPlaceholder(t.index+r,t.addedKeys[r])}},_detachInstance:function(e){v ar t=this._instances[e];if(!t.isPlaceholder){for(var n=0;n<t._children.length;n+ +){var r=t._children[n];Polymer.dom(t.root).appendChild(r)}return t}},_attachIns tance:function(e,t){var n=this._instances[e];n.isPlaceholder||t.insertBefore(n.r oot,this)},_detachAndRemoveInstance:function(e){var t=this._detachInstance(e);t& &this._pool.push(t),this._instances.splice(e,1)},_insertPlaceholder:function(e,t ){this._instances.splice(e,0,{isPlaceholder:!0,__key__:t})},_stampInstance:funct ion(e,t){var n={__key__:t};return n[this.as]=this.collection.getItem(t),n[this.i ndexAs]=e,this.stamp(n)},_insertInstance:function(e,t){var n=this._pool.pop();n? (n.__setProperty(this.as,this.collection.getItem(t),!0),n.__setProperty("__key__ ",t,!0)):n=this._stampInstance(e,t);var r=this._instances[e+1],s=r&&!r.isPlaceho lder?r._children[0]:this,i=Polymer.dom(this).parentNode;return Polymer.dom(i).in sertBefore(n.root,s),this._instances[e]=n,n},_downgradeInstance:function(e,t){va r n=this._detachInstance(e);return n&&this._pool.push(n),n={isPlaceholder:!0,__k ey__:t},this._instances[e]=n,n},_showHideChildren:function(e){for(var t=0;t<this ._instances.length;t++)this._instances[t]._showHideChildren(e)},_forwardInstance Prop:function(e,t,n){if(t==this.as){var r;r=this._sortFn||this._filterFn?this.it ems.indexOf(this.collection.getItem(e.__key__)):e[this.indexAs],this.set("items. "+r,n)}},_forwardInstancePath:function(e,t,n){0===t.indexOf(this.as+".")&&this._ notifyPath("items."+e.__key__+"."+t.slice(this.as.length+1),n)},_forwardParentPr op:function(e,t){for(var n,r=this._instances,s=0;s<r.length&&(n=r[s]);s++)n.isPl aceholder||n.__setProperty(e,t,!0)},_forwardParentPath:function(e,t){for(var n,r =this._instances,s=0;s<r.length&&(n=r[s]);s++)n.isPlaceholder||n._notifyPath(e,t ,!0)},_forwardItemPath:function(e,t){if(this._keyToInstIdx){var n=e.indexOf(".") ,r=e.substring(0,n<0?e.length:n),s=this._keyToInstIdx[r],i=this._instances[s];i& &!i.isPlaceholder&&(n>=0?(e=this.as+"."+e.substring(n+1),i._notifyPath(e,t,!0)): i.__setProperty(this.as,t,!0))}},itemForElement:function(e){var t=this.modelForE lement(e);return t&&t[this.as]},keyForElement:function(e){var t=this.modelForEle ment(e);return t&&t.__key__},indexForElement:function(e){var t=this.modelForElem ent(e);return t&&t[this.indexAs]}}),Polymer({is:"array-selector",_template:null, properties:{items:{type:Array,observer:"clearSelection"},multi:{type:Boolean,val ue:!1,observer:"clearSelection"},selected:{type:Object,notify:!0},selectedItem:{ type:Object,notify:!0},toggle:{type:Boolean,value:!1}},clearSelection:function() {if(Array.isArray(this.selected))for(var e=0;e<this.selected.length;e++)this.unl inkPaths("selected."+e);else this.unlinkPaths("selected"),this.unlinkPaths("sele ctedItem");this.multi?this.selected&&!this.selected.length||(this.selected=[],th is._selectedColl=Polymer.Collection.get(this.selected)):(this.selected=null,this ._selectedColl=null),this.selectedItem=null},isSelected:function(e){return this. multi?void 0!==this._selectedColl.getKey(e):this.selected==e},deselect:function( e){if(this.multi){if(this.isSelected(e)){var t=this._selectedColl.getKey(e);this .arrayDelete("selected",e),this.unlinkPaths("selected."+t)}}else this.selected=n ull,this.selectedItem=null,this.unlinkPaths("selected"),this.unlinkPaths("select edItem")},select:function(e){var t=Polymer.Collection.get(this.items),n=t.getKey (e);if(this.multi)if(this.isSelected(e))this.toggle&&this.deselect(e);else{this. push("selected",e);var r=this._selectedColl.getKey(e);this.linkPaths("selected." +r,"items."+n)}else this.toggle&&e==this.selected?this.deselect():(this.selected =e,this.selectedItem=e,this.linkPaths("selected","items."+n),this.linkPaths("sel ectedItem","items."+n))}}),Polymer({is:"dom-if",extends:"template",_template:nul l,properties:{if:{type:Boolean,value:!1,observer:"_queueRender"},restamp:{type:B oolean,value:!1,observer:"_queueRender"}},behaviors:[Polymer.Templatizer],_queue Render:function(){this._debounceTemplate(this._render)},detached:function(){this .parentNode&&(this.parentNode.nodeType!=Node.DOCUMENT_FRAGMENT_NODE||Polymer.Set tings.hasShadow&&this.parentNode instanceof ShadowRoot)||this._teardownInstance( )},attached:function(){this.if&&this.ctor&&this.async(this._ensureInstance)},ren der:function(){this._flushTemplates()},_render:function(){this.if?(this.ctor||th is.templatize(this),this._ensureInstance(),this._showHideChildren()):this.restam p&&this._teardownInstance(),!this.restamp&&this._instance&&this._showHideChildre n(),this.if!=this._lastIf&&(this.fire("dom-change"),this._lastIf=this.if)},_ensu reInstance:function(){var e=Polymer.dom(this).parentNode;if(e){var t=Polymer.dom (e);if(this._instance){var n=this._instance._children;if(n&&n.length){var r=Poly mer.dom(this).previousSibling;if(r!==n[n.length-1])for(var s,i=0;i<n.length&&(s= n[i]);i++)t.insertBefore(s,this)}}else{this._instance=this.stamp();var o=this._i nstance.root;t.insertBefore(o,this)}}},_teardownInstance:function(){if(this._ins tance){var e=this._instance._children;if(e&&e.length)for(var t,n=Polymer.dom(Pol ymer.dom(e[0]).parentNode),r=0;r<e.length&&(t=e[r]);r++)n.removeChild(t);this._i nstance=null}},_showHideChildren:function(){var e=this.__hideTemplateChildren__| |!this.if;this._instance&&this._instance._showHideChildren(e)},_forwardParentPro p:function(e,t){this._instance&&this._instance.__setProperty(e,t,!0)},_forwardPa rentPath:function(e,t){this._instance&&this._instance._notifyPath(e,t,!0)}}),Pol ymer({is:"dom-bind",extends:"template",_template:null,created:function(){var e=t his;Polymer.RenderStatus.whenReady(function(){"loading"==document.readyState?doc ument.addEventListener("DOMContentLoaded",function(){e._markImportsReady()}):e._ markImportsReady()})},_ensureReady:function(){this._readied||this._readySelf()}, _markImportsReady:function(){this._importsReady=!0,this._ensureReady()},_registe rFeatures:function(){this._prepConstructor()},_insertChildren:function(){var e=P olymer.dom(Polymer.dom(this).parentNode);e.insertBefore(this.root,this)},_remove Children:function(){if(this._children)for(var e=0;e<this._children.length;e++)th is.root.appendChild(this._children[e])},_initFeatures:function(){},_scopeElement Class:function(e,t){return this.dataHost?this.dataHost._scopeElementClass(e,t):t },_configureInstanceProperties:function(){},_prepConfigure:function(){var e={};f or(var t in this._propertyEffects)e[t]=this[t];var n=this._setupConfigure;this._ setupConfigure=function(){n.call(this,e)}},attached:function(){this._importsRead y&&this.render()},detached:function(){this._removeChildren()},render:function(){ this._ensureReady(),this._children||(this._template=this,this._prepAnnotations() ,this._prepEffects(),this._prepBehaviors(),this._prepConfigure(),this._prepBindi ngs(),this._prepPropertyInfo(),Polymer.Base._initFeatures.call(this),this._child ren=Polymer.TreeApi.arrayCopyChildNodes(this.root)),this._insertChildren(),this. fire("dom-change")}})</script> <script> window.SwarmingBehaviors = window.Swarmi ngBehaviors || {}; 4 var r=t.propertyDataFromStyles(n._styles,this),i=!this.__notStyleScopeCacheable; i&&(r.key.customStyle=this.customStyle,e=n._styleCache.retrieve(this.is,r.key,th is._styles));var a=Boolean(e);a?this._styleProperties=e._styleProperties:this._c omputeStyleProperties(r.properties),this._computeOwnStyleProperties(),a||(e=o.re trieve(this.is,this._ownStyleProperties,this._styles));var l=Boolean(e)&&!a,h=th is._applyStyleProperties(e);a||(h=h&&s?h.cloneNode(!0):h,e={style:h,_scopeSelect or:this._scopeSelector,_styleProperties:this._styleProperties},i&&(r.key.customS tyle={},this.mixin(r.key.customStyle,this.customStyle),n._styleCache.store(this. is,e,r.key,this._styles)),l||o.store(this.is,Object.create(e),this._ownStyleProp erties,this._styles))},_computeStyleProperties:function(e){var n=this._findStyle Host();n._styleProperties||n._computeStyleProperties();var r=Object.create(n._st yleProperties),s=t.hostAndRootPropertiesForScope(this);this.mixin(r,s.hostProps) ,e=e||t.propertyDataFromStyles(n._styles,this).properties,this.mixin(r,e),this.m ixin(r,s.rootProps),t.mixinCustomStyle(r,this.customStyle),t.reify(r),this._styl eProperties=r},_computeOwnStyleProperties:function(){for(var e,t={},n=0;n<this._ ownStylePropertyNames.length;n++)e=this._ownStylePropertyNames[n],t[e]=this._sty leProperties[e];this._ownStyleProperties=t},_scopeCount:0,_applyStyleProperties: function(e){var n=this._scopeSelector;this._scopeSelector=e?e._scopeSelector:thi s.is+"-"+this.__proto__._scopeCount++;var r=t.applyElementStyle(this,this._style Properties,this._scopeSelector,e&&e.style);return s||t.applyElementScopeSelector (this,this._scopeSelector,n,this._scopeCssViaAttr),r},serializeValueToAttribute: function(t,n,r){if(r=r||this,"class"===n&&!s){var i=r===this?this.domHost||this. dataHost:this;i&&(t=i._scopeElementClass(r,t))}r=this.shadyRoot&&this.shadyRoot. _hasDistributed?Polymer.dom(r):r,e.call(this,t,n,r)},_scopeElementClass:function (e,t){return s||this._scopeCssViaAttr||(t=(t?t+" ":"")+a+" "+this.is+(e._scopeSe lector?" "+l+" "+e._scopeSelector:"")),t},updateStyles:function(e){e&&this.mixin (this.customStyle,e),i?t.updateNativeStyleProperties(this,this.customStyle):(thi s.isAttached?this._needsStyleProperties()?this._updateStyleProperties():this._st yleProperties=null:this.__stylePropertiesInvalid=!0,this._styleCache&&this._styl eCache.clear(),this._updateRootStyles())},_updateRootStyles:function(e){e=e||thi s.root;for(var t,n=Polymer.dom(e)._query(function(e){return e.shadyRoot||e.shado wRoot}),r=0,s=n.length;r<s&&(t=n[r]);r++)t.updateStyles&&t.updateStyles()}}),Pol ymer.updateStyles=function(e){r.updateStyles(e),Polymer.Base._updateRootStyles(d ocument)};var o=new Polymer.StyleCache;Polymer.customStyleCache=o;var a=n.SCOPE_ NAME,l=t.XSCOPE_NAME}(),Polymer.Base._addFeature({_registerFeatures:function(){t his._prepIs(),this._prepConstructor(),this._prepStyles()},_finishRegisterFeature s:function(){this._prepTemplate(),this._prepShimStyles(),this._prepAnnotations() ,this._prepEffects(),this._prepBehaviors(),this._prepPropertyInfo(),this._prepBi ndings(),this._prepShady()},_prepBehavior:function(e){this._addPropertyEffects(e .properties),this._addComplexObserverEffects(e.observers),this._addHostAttribute s(e.hostAttributes)},_initFeatures:function(){this._setupGestures(),this._setupC onfigure(),this._setupStyleProperties(),this._setupDebouncers(),this._setupShady (),this._registerHost(),this._template&&(this._validateApplyShim(),this._poolCon tent(),this._beginHosting(),this._stampTemplate(),this._endHosting(),this._marsh alAnnotationReferences()),this._marshalInstanceEffects(),this._marshalBehaviors( ),this._marshalHostAttributes(),this._marshalAttributes(),this._tryReady()},_mar shalBehavior:function(e){e.listeners&&this._listenListeners(e.listeners)}}),func tion(){var e,t=Polymer.StyleProperties,n=Polymer.StyleUtil,r=Polymer.CssParse,s= Polymer.StyleDefaults,i=Polymer.StyleTransformer,o=Polymer.ApplyShim,a=Polymer.D ebounce,l=Polymer.Settings;Polymer({is:"custom-style",extends:"style",_template: null,properties:{include:String},ready:function(){this.__appliedElement=this.__a ppliedElement||this,this.__cssBuild=n.getCssBuildType(this),this.__appliedElemen t!==this&&(this.__appliedElement.__cssBuild=this.__cssBuild),this._tryApply()},a ttached:function(){this._tryApply()},_tryApply:function(){if(!this._appliesToDoc ument&&this.parentNode&&"dom-module"!==this.parentNode.localName){this._appliesT oDocument=!0;var e=this.__appliedElement;if(l.useNativeCSSProperties||(this.__ne edsUpdateStyles=s.hasStyleProperties(),s.addStyle(e)),e.textContent||this.includ e)this._apply(!0);else{var t=this,n=new MutationObserver(function(){n.disconnect (),t._apply(!0)});n.observe(e,{childList:!0})}}},_updateStyles:function(){Polyme r.updateStyles()},_apply:function(e){var t=this.__appliedElement;if(this.include &&(t.textContent=n.cssFromModules(this.include,!0)+t.textContent),t.textContent) {var r=this.__cssBuild,s=n.isTargetedBuild(r);if(!l.useNativeCSSProperties||!s){ var a=n.rulesForStyle(t);if(s||n.forEachRule(a,function(e){i.documentRule(e),l.u seNativeCSSProperties&&!r&&o.transformRule(e)}),l.useNativeCSSProperties)t.textC ontent=n.toCssText(a);else{var h=this,c=function(){h._flushCustomProperties()};e ?Polymer.RenderStatus.whenReady(c):c()}}}},_flushCustomProperties:function(){thi s.__needsUpdateStyles?(this.__needsUpdateStyles=!1,e=a(e,this._updateStyles)):th is._applyCustomProperties()},_applyCustomProperties:function(){var e=this.__appl iedElement;this._computeStyleProperties();var s=this._styleProperties,i=n.rulesF orStyle(e);i&&(e.textContent=n.toCssText(i,function(e){var n=e.cssText=e.parsedC ssText;e.propertyInfo&&e.propertyInfo.cssText&&(n=r.removeCustomPropAssignment(n ),e.cssText=t.valueForProperties(n,s))}))}})}(),Polymer.Templatizer={properties: {__hideTemplateChildren__:{observer:"_showHideChildren"}},_instanceProps:Polymer .nob,_parentPropPrefix:"_parent_",templatize:function(e){if(this._templatized=e, e._content||(e._content=e.content),e._content._ctor)return this.ctor=e._content. _ctor,void this._prepParentProperties(this.ctor.prototype,e);var t=Object.create (Polymer.Base);this._customPrepAnnotations(t,e),this._prepParentProperties(t,e), t._prepEffects(),this._customPrepEffects(t),t._prepBehaviors(),t._prepPropertyIn fo(),t._prepBindings(),t._notifyPathUp=this._notifyPathUpImpl,t._scopeElementCla ss=this._scopeElementClassImpl,t.listen=this._listenImpl,t._showHideChildren=thi s._showHideChildrenImpl,t.__setPropertyOrig=this.__setProperty,t.__setProperty=t his.__setPropertyImpl;var n=this._constructorImpl,r=function(e,t){n.call(this,e, t)};r.prototype=t,t.constructor=r,e._content._ctor=r,this.ctor=r},_getRootDataHo st:function(){return this.dataHost&&this.dataHost._rootDataHost||this.dataHost}, _showHideChildrenImpl:function(e){for(var t=this._children,n=0;n<t.length;n++){v ar r=t[n];Boolean(e)!=Boolean(r.__hideTemplateChildren__)&&(r.nodeType===Node.TE XT_NODE?e?(r.__polymerTextContent__=r.textContent,r.textContent=""):r.textConten t=r.__polymerTextContent__:r.style&&(e?(r.__polymerDisplay__=r.style.display,r.s tyle.display="none"):r.style.display=r.__polymerDisplay__)),r.__hideTemplateChil dren__=e}},__setPropertyImpl:function(e,t,n,r){r&&r.__hideTemplateChildren__&&"t extContent"==e&&(e="__polymerTextContent__"),this.__setPropertyOrig(e,t,n,r)},_d ebounceTemplate:function(e){Polymer.dom.addDebouncer(this.debounce("_debounceTem plate",e))},_flushTemplates:function(){Polymer.dom.flush()},_customPrepEffects:f unction(e){var t=e._parentProps;for(var n in t)e._addPropertyEffect(n,"function" ,this._createHostPropEffector(n));for(n in this._instanceProps)e._addPropertyEff ect(n,"function",this._createInstancePropEffector(n))},_customPrepAnnotations:fu nction(e,t){e._template=t;var n=t._content;if(!n._notes){var r=e._rootDataHost;r &&(Polymer.Annotations.prepElement=function(){r._prepElement()}),n._notes=Polyme r.Annotations.parseAnnotations(t),Polymer.Annotations.prepElement=null,this._pro cessAnnotations(n._notes)}e._notes=n._notes,e._parentProps=n._parentProps},_prep ParentProperties:function(e,t){var n=this._parentProps=e._parentProps;if(this._f orwardParentProp&&n){var r,s=e._parentPropProto;if(!s){for(r in this._instancePr ops)delete n[r];s=e._parentPropProto=Object.create(null),t!=this&&(Polymer.Bind. prepareModel(s),Polymer.Base.prepareModelNotifyPath(s));for(r in n){var i=this._ parentPropPrefix+r,o=[{kind:"function",effect:this._createForwardPropEffector(r) ,fn:Polymer.Bind._functionEffect},{kind:"notify",fn:Polymer.Bind._notifyEffect,e ffect:{event:Polymer.CaseMap.camelToDashCase(i)+"-changed"}}];Polymer.Bind._crea teAccessors(s,i,o)}}var a=this;t!=this&&(Polymer.Bind.prepareInstance(t),t._forw ardParentProp=function(e,t){a._forwardParentProp(e,t)}),this._extendTemplate(t,s ),t._pathEffector=function(e,t,n){return a._pathEffectorImpl(e,t,n)}}},_createFo rwardPropEffector:function(e){return function(t,n){this._forwardParentProp(e,n)} },_createHostPropEffector:function(e){var t=this._parentPropPrefix;return functi on(n,r){this.dataHost._templatized[t+e]=r}},_createInstancePropEffector:function (e){return function(t,n,r,s){s||this.dataHost._forwardInstanceProp(this,e,n)}},_ extendTemplate:function(e,t){var n=Object.getOwnPropertyNames(t);t._propertySett er&&(e._propertySetter=t._propertySetter);for(var r,s=0;s<n.length&&(r=n[s]);s++ ){var i=e[r],o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o) ,void 0!==i&&e._propertySetter(r,i)}},_showHideChildren:function(e){},_forwardIn stancePath:function(e,t,n){},_forwardInstanceProp:function(e,t,n){},_notifyPathU pImpl:function(e,t){var n=this.dataHost,r=e.indexOf("."),s=r<0?e:e.slice(0,r);n. _forwardInstancePath.call(n,this,e,t),s in n._parentProps&&n._templatized._notif yPath(n._parentPropPrefix+e,t)},_pathEffectorImpl:function(e,t,n){if(this._forwa rdParentPath&&0===e.indexOf(this._parentPropPrefix)){var r=e.substring(this._par entPropPrefix.length),s=this._modelForPath(r);s in this._parentProps&&this._forw ardParentPath(r,t)}Polymer.Base._pathEffector.call(this._templatized,e,t,n)},_co nstructorImpl:function(e,t){this._rootDataHost=t._getRootDataHost(),this._setupC onfigure(e),this._registerHost(t),this._beginHosting(),this.root=this.instanceTe mplate(this._template),this.root.__noContent=!this._notes._hasContent,this.root. __styleScoped=!0,this._endHosting(),this._marshalAnnotatedNodes(),this._marshalI nstanceEffects(),this._marshalAnnotatedListeners();for(var n=[],r=this.root.firs tChild;r;r=r.nextSibling)n.push(r),r._templateInstance=this;this._children=n,t._ _hideTemplateChildren__&&this._showHideChildren(!0),this._tryReady()},_listenImp l:function(e,t,n){var r=this,s=this._rootDataHost,i=s._createEventHandler(e,t,n) ,o=function(e){e.model=r,i(e)};s._listen(e,t,o)},_scopeElementClassImpl:function (e,t){var n=this._rootDataHost;return n?n._scopeElementClass(e,t):t},stamp:funct ion(e){if(e=e||{},this._parentProps){var t=this._templatized;for(var n in this._ parentProps)void 0===e[n]&&(e[n]=t[this._parentPropPrefix+n])}return new this.ct or(e,this)},modelForElement:function(e){for(var t;e;)if(t=e._templateInstance){i f(t.dataHost==this)return t;e=t.dataHost}else e=e.parentNode}},Polymer({is:"dom- template",extends:"template",_template:null,behaviors:[Polymer.Templatizer],read y:function(){this.templatize(this)}}),Polymer._collections=new WeakMap,Polymer.C ollection=function(e){Polymer._collections.set(e,this),this.userArray=e,this.sto re=e.slice(),this.initMap()},Polymer.Collection.prototype={constructor:Polymer.C ollection,initMap:function(){for(var e=this.omap=new WeakMap,t=this.pmap={},n=th is.store,r=0;r<n.length;r++){var s=n[r];s&&"object"==typeof s?e.set(s,r):t[s]=r} },add:function(e){var t=this.store.push(e)-1;return e&&"object"==typeof e?this.o map.set(e,t):this.pmap[e]=t,"#"+t},removeKey:function(e){(e=this._parseKey(e))&& (this._removeFromMap(this.store[e]),delete this.store[e])},_removeFromMap:functi on(e){e&&"object"==typeof e?this.omap.delete(e):delete this.pmap[e]},remove:func tion(e){var t=this.getKey(e);return this.removeKey(t),t},getKey:function(e){var t;if(t=e&&"object"==typeof e?this.omap.get(e):this.pmap[e],void 0!=t)return"#"+t },getKeys:function(){return Object.keys(this.store).map(function(e){return"#"+e} )},_parseKey:function(e){if(e&&"#"==e[0])return e.slice(1)},setItem:function(e,t ){if(e=this._parseKey(e)){var n=this.store[e];n&&this._removeFromMap(n),t&&"obje ct"==typeof t?this.omap.set(t,e):this.pmap[t]=e,this.store[e]=t}},getItem:functi on(e){if(e=this._parseKey(e))return this.store[e]},getItems:function(){var e=[], t=this.store;for(var n in t)e.push(t[n]);return e},_applySplices:function(e){for (var t,n,r={},s=0;s<e.length&&(n=e[s]);s++){n.addedKeys=[];for(var i=0;i<n.remov ed.length;i++)t=this.getKey(n.removed[i]),r[t]=r[t]?null:-1;for(i=0;i<n.addedCou nt;i++){var o=this.userArray[n.index+i];t=this.getKey(o),t=void 0===t?this.add(o ):t,r[t]=r[t]?null:1,n.addedKeys.push(t)}}var a=[],l=[];for(t in r)r[t]<0&&(this .removeKey(t),a.push(t)),r[t]>0&&l.push(t);return[{removed:a,added:l}]}},Polymer .Collection.get=function(e){return Polymer._collections.get(e)||new Polymer.Coll ection(e)},Polymer.Collection.applySplices=function(e,t){var n=Polymer._collecti ons.get(e);return n?n._applySplices(t):null},Polymer({is:"dom-repeat",extends:"t emplate",_template:null,properties:{items:{type:Array},as:{type:String,value:"it em"},indexAs:{type:String,value:"index"},sort:{type:Function,observer:"_sortChan ged"},filter:{type:Function,observer:"_filterChanged"},observe:{type:String,obse rver:"_observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!0,re adOnly:!0},initialCount:{type:Number,observer:"_initializeChunking"},targetFrame rate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"_computeFram eTime(targetFramerate)"}},behaviors:[Polymer.Templatizer],observers:["_itemsChan ged(items.*)"],created:function(){this._instances=[],this._pool=[],this._limit=1 /0;var e=this;this._boundRenderChunk=function(){e._renderChunk()}},detached:func tion(){this.__isDetached=!0;for(var e=0;e<this._instances.length;e++)this._detac hInstance(e)},attached:function(){if(this.__isDetached){this.__isDetached=!1;for (var e=Polymer.dom(Polymer.dom(this).parentNode),t=0;t<this._instances.length;t+ +)this._attachInstance(t,e)}},ready:function(){this._instanceProps={__key__:!0}, this._instanceProps[this.as]=!0,this._instanceProps[this.indexAs]=!0,this.ctor|| this.templatize(this)},_sortChanged:function(e){var t=this._getRootDataHost();th is._sortFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,arguments)} ),this._needFullRefresh=!0,this.items&&this._debounceTemplate(this._render)},_fi lterChanged:function(e){var t=this._getRootDataHost();this._filterFn=e&&("functi on"==typeof e?e:function(){return t[e].apply(t,arguments)}),this._needFullRefres h=!0,this.items&&this._debounceTemplate(this._render)},_computeFrameTime:functio n(e){return Math.ceil(1e3/e)},_initializeChunking:function(){this.initialCount&& (this._limit=this.initialCount,this._chunkCount=this.initialCount,this._lastChun kTime=performance.now())},_tryRenderChunk:function(){this.items&&this._limit<thi s.items.length&&this.debounce("renderChunk",this._requestRenderChunk)},_requestR enderChunk:function(){requestAnimationFrame(this._boundRenderChunk)},_renderChun k:function(){var e=performance.now(),t=this._targetFrameTime/(e-this._lastChunkT ime);this._chunkCount=Math.round(this._chunkCount*t)||1,this._limit+=this._chunk Count,this._lastChunkTime=e,this._debounceTemplate(this._render)},_observeChange d:function(){this._observePaths=this.observe&&this.observe.replace(".*",".").spl it(" ")},_itemsChanged:function(e){if("items"==e.path)Array.isArray(this.items)? this.collection=Polymer.Collection.get(this.items):this.items?this._error(this._ logf("dom-repeat","expected array for `items`, found",this.items)):this.collecti on=null,this._keySplices=[],this._indexSplices=[],this._needFullRefresh=!0,this. _initializeChunking(),this._debounceTemplate(this._render);else if("items.splice s"==e.path)this._keySplices=this._keySplices.concat(e.value.keySplices),this._in dexSplices=this._indexSplices.concat(e.value.indexSplices),this._debounceTemplat e(this._render);else{var t=e.path.slice(6);this._forwardItemPath(t,e.value),this ._checkObservedPaths(t)}},_checkObservedPaths:function(e){if(this._observePaths) {e=e.substring(e.indexOf(".")+1);for(var t=this._observePaths,n=0;n<t.length;n++ )if(0===e.indexOf(t[n]))return this._needFullRefresh=!0,void(this.delay?this.deb ounce("render",this._render,this.delay):this._debounceTemplate(this._render))}}, render:function(){this._needFullRefresh=!0,this._debounceTemplate(this._render), this._flushTemplates()},_render:function(){this._needFullRefresh?(this._applyFul lRefresh(),this._needFullRefresh=!1):this._keySplices.length&&(this._sortFn?this ._applySplicesUserSort(this._keySplices):this._filterFn?this._applyFullRefresh() :this._applySplicesArrayOrder(this._indexSplices)),this._keySplices=[],this._ind exSplices=[];for(var e=this._keyToInstIdx={},t=this._instances.length-1;t>=0;t-- ){var n=this._instances[t];n.isPlaceholder&&t<this._limit?n=this._insertInstance (t,n.__key__):!n.isPlaceholder&&t>=this._limit&&(n=this._downgradeInstance(t,n._ _key__)),e[n.__key__]=t,n.isPlaceholder||n.__setProperty(this.indexAs,t,!0)}this ._pool.length=0,this._setRenderedItemCount(this._instances.length),this.fire("do m-change"),this._tryRenderChunk()},_applyFullRefresh:function(){var e,t=this.col lection;if(this._sortFn)e=t?t.getKeys():[];else{e=[];var n=this.items;if(n)for(v ar r=0;r<n.length;r++)e.push(t.getKey(n[r]))}var s=this;for(this._filterFn&&(e=e .filter(function(e){return s._filterFn(t.getItem(e))})),this._sortFn&&e.sort(fun ction(e,n){return s._sortFn(t.getItem(e),t.getItem(n))}),r=0;r<e.length;r++){var i=e[r],o=this._instances[r];o?(o.__key__=i,!o.isPlaceholder&&r<this._limit&&o._ _setProperty(this.as,t.getItem(i),!0)):r<this._limit?this._insertInstance(r,i):t his._insertPlaceholder(r,i)}for(var a=this._instances.length-1;a>=r;a--)this._de tachAndRemoveInstance(a)},_numericSort:function(e,t){return e-t},_applySplicesUs erSort:function(e){for(var t,n,r=this.collection,s={},i=0;i<e.length&&(n=e[i]);i ++){for(var o=0;o<n.removed.length;o++)t=n.removed[o],s[t]=s[t]?null:-1;for(o=0; o<n.added.length;o++)t=n.added[o],s[t]=s[t]?null:1}var a=[],l=[];for(t in s)s[t] ===-1&&a.push(this._keyToInstIdx[t]),1===s[t]&&l.push(t);if(a.length)for(a.sort( this._numericSort),i=a.length-1;i>=0;i--){var h=a[i];void 0!==h&&this._detachAnd RemoveInstance(h)}var c=this;if(l.length){this._filterFn&&(l=l.filter(function(e ){return c._filterFn(r.getItem(e))})),l.sort(function(e,t){return c._sortFn(r.ge tItem(e),r.getItem(t))});var u=0;for(i=0;i<l.length;i++)u=this._insertRowUserSor t(u,l[i])}},_insertRowUserSort:function(e,t){for(var n=this.collection,r=n.getIt em(t),s=this._instances.length-1,i=-1;e<=s;){var o=e+s>>1,a=this._instances[o]._ _key__,l=this._sortFn(n.getItem(a),r);if(l<0)e=o+1;else{if(!(l>0)){i=o;break}s=o -1}}return i<0&&(i=s+1),this._insertPlaceholder(i,t),i},_applySplicesArrayOrder: function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++){for(var r=0;r<t.removed.leng th;r++)this._detachAndRemoveInstance(t.index);for(r=0;r<t.addedKeys.length;r++)t his._insertPlaceholder(t.index+r,t.addedKeys[r])}},_detachInstance:function(e){v ar t=this._instances[e];if(!t.isPlaceholder){for(var n=0;n<t._children.length;n+ +){var r=t._children[n];Polymer.dom(t.root).appendChild(r)}return t}},_attachIns tance:function(e,t){var n=this._instances[e];n.isPlaceholder||t.insertBefore(n.r oot,this)},_detachAndRemoveInstance:function(e){var t=this._detachInstance(e);t& &this._pool.push(t),this._instances.splice(e,1)},_insertPlaceholder:function(e,t ){this._instances.splice(e,0,{isPlaceholder:!0,__key__:t})},_stampInstance:funct ion(e,t){var n={__key__:t};return n[this.as]=this.collection.getItem(t),n[this.i ndexAs]=e,this.stamp(n)},_insertInstance:function(e,t){var n=this._pool.pop();n? (n.__setProperty(this.as,this.collection.getItem(t),!0),n.__setProperty("__key__ ",t,!0)):n=this._stampInstance(e,t);var r=this._instances[e+1],s=r&&!r.isPlaceho lder?r._children[0]:this,i=Polymer.dom(this).parentNode;return Polymer.dom(i).in sertBefore(n.root,s),this._instances[e]=n,n},_downgradeInstance:function(e,t){va r n=this._detachInstance(e);return n&&this._pool.push(n),n={isPlaceholder:!0,__k ey__:t},this._instances[e]=n,n},_showHideChildren:function(e){for(var t=0;t<this ._instances.length;t++)this._instances[t]._showHideChildren(e)},_forwardInstance Prop:function(e,t,n){if(t==this.as){var r;r=this._sortFn||this._filterFn?this.it ems.indexOf(this.collection.getItem(e.__key__)):e[this.indexAs],this.set("items. "+r,n)}},_forwardInstancePath:function(e,t,n){0===t.indexOf(this.as+".")&&this._ notifyPath("items."+e.__key__+"."+t.slice(this.as.length+1),n)},_forwardParentPr op:function(e,t){for(var n,r=this._instances,s=0;s<r.length&&(n=r[s]);s++)n.isPl aceholder||n.__setProperty(e,t,!0)},_forwardParentPath:function(e,t){for(var n,r =this._instances,s=0;s<r.length&&(n=r[s]);s++)n.isPlaceholder||n._notifyPath(e,t ,!0)},_forwardItemPath:function(e,t){if(this._keyToInstIdx){var n=e.indexOf(".") ,r=e.substring(0,n<0?e.length:n),s=this._keyToInstIdx[r],i=this._instances[s];i& &!i.isPlaceholder&&(n>=0?(e=this.as+"."+e.substring(n+1),i._notifyPath(e,t,!0)): i.__setProperty(this.as,t,!0))}},itemForElement:function(e){var t=this.modelForE lement(e);return t&&t[this.as]},keyForElement:function(e){var t=this.modelForEle ment(e);return t&&t.__key__},indexForElement:function(e){var t=this.modelForElem ent(e);return t&&t[this.indexAs]}}),Polymer({is:"array-selector",_template:null, properties:{items:{type:Array,observer:"clearSelection"},multi:{type:Boolean,val ue:!1,observer:"clearSelection"},selected:{type:Object,notify:!0},selectedItem:{ type:Object,notify:!0},toggle:{type:Boolean,value:!1}},clearSelection:function() {if(Array.isArray(this.selected))for(var e=0;e<this.selected.length;e++)this.unl inkPaths("selected."+e);else this.unlinkPaths("selected"),this.unlinkPaths("sele ctedItem");this.multi?this.selected&&!this.selected.length||(this.selected=[],th is._selectedColl=Polymer.Collection.get(this.selected)):(this.selected=null,this ._selectedColl=null),this.selectedItem=null},isSelected:function(e){return this. multi?void 0!==this._selectedColl.getKey(e):this.selected==e},deselect:function( e){if(this.multi){if(this.isSelected(e)){var t=this._selectedColl.getKey(e);this .arrayDelete("selected",e),this.unlinkPaths("selected."+t)}}else this.selected=n ull,this.selectedItem=null,this.unlinkPaths("selected"),this.unlinkPaths("select edItem")},select:function(e){var t=Polymer.Collection.get(this.items),n=t.getKey (e);if(this.multi)if(this.isSelected(e))this.toggle&&this.deselect(e);else{this. push("selected",e);var r=this._selectedColl.getKey(e);this.linkPaths("selected." +r,"items."+n)}else this.toggle&&e==this.selected?this.deselect():(this.selected =e,this.selectedItem=e,this.linkPaths("selected","items."+n),this.linkPaths("sel ectedItem","items."+n))}}),Polymer({is:"dom-if",extends:"template",_template:nul l,properties:{if:{type:Boolean,value:!1,observer:"_queueRender"},restamp:{type:B oolean,value:!1,observer:"_queueRender"}},behaviors:[Polymer.Templatizer],_queue Render:function(){this._debounceTemplate(this._render)},detached:function(){this .parentNode&&(this.parentNode.nodeType!=Node.DOCUMENT_FRAGMENT_NODE||Polymer.Set tings.hasShadow&&this.parentNode instanceof ShadowRoot)||this._teardownInstance( )},attached:function(){this.if&&this.ctor&&this.async(this._ensureInstance)},ren der:function(){this._flushTemplates()},_render:function(){this.if?(this.ctor||th is.templatize(this),this._ensureInstance(),this._showHideChildren()):this.restam p&&this._teardownInstance(),!this.restamp&&this._instance&&this._showHideChildre n(),this.if!=this._lastIf&&(this.fire("dom-change"),this._lastIf=this.if)},_ensu reInstance:function(){var e=Polymer.dom(this).parentNode;if(e){var t=Polymer.dom (e);if(this._instance){var n=this._instance._children;if(n&&n.length){var r=Poly mer.dom(this).previousSibling;if(r!==n[n.length-1])for(var s,i=0;i<n.length&&(s= n[i]);i++)t.insertBefore(s,this)}}else{this._instance=this.stamp();var o=this._i nstance.root;t.insertBefore(o,this)}}},_teardownInstance:function(){if(this._ins tance){var e=this._instance._children;if(e&&e.length)for(var t,n=Polymer.dom(Pol ymer.dom(e[0]).parentNode),r=0;r<e.length&&(t=e[r]);r++)n.removeChild(t);this._i nstance=null}},_showHideChildren:function(){var e=this.__hideTemplateChildren__| |!this.if;this._instance&&this._instance._showHideChildren(e)},_forwardParentPro p:function(e,t){this._instance&&this._instance.__setProperty(e,t,!0)},_forwardPa rentPath:function(e,t){this._instance&&this._instance._notifyPath(e,t,!0)}}),Pol ymer({is:"dom-bind",extends:"template",_template:null,created:function(){var e=t his;Polymer.RenderStatus.whenReady(function(){"loading"==document.readyState?doc ument.addEventListener("DOMContentLoaded",function(){e._markImportsReady()}):e._ markImportsReady()})},_ensureReady:function(){this._readied||this._readySelf()}, _markImportsReady:function(){this._importsReady=!0,this._ensureReady()},_registe rFeatures:function(){this._prepConstructor()},_insertChildren:function(){var e=P olymer.dom(Polymer.dom(this).parentNode);e.insertBefore(this.root,this)},_remove Children:function(){if(this._children)for(var e=0;e<this._children.length;e++)th is.root.appendChild(this._children[e])},_initFeatures:function(){},_scopeElement Class:function(e,t){return this.dataHost?this.dataHost._scopeElementClass(e,t):t },_configureInstanceProperties:function(){},_prepConfigure:function(){var e={};f or(var t in this._propertyEffects)e[t]=this[t];var n=this._setupConfigure;this._ setupConfigure=function(){n.call(this,e)}},attached:function(){this._importsRead y&&this.render()},detached:function(){this._removeChildren()},render:function(){ this._ensureReady(),this._children||(this._template=this,this._prepAnnotations() ,this._prepEffects(),this._prepBehaviors(),this._prepConfigure(),this._prepBindi ngs(),this._prepPropertyInfo(),Polymer.Base._initFeatures.call(this),this._child ren=Polymer.TreeApi.arrayCopyChildNodes(this.root)),this._insertChildren(),this. fire("dom-change")}})</script> <script> window.SwarmingBehaviors = window.Swarmi ngBehaviors || {};
5 (function(){ 5 (function(){
6 // This behavior wraps up all the shared swarming functionality. 6 // This behavior wraps up all the shared swarming functionality.
7 SwarmingBehaviors.CommonBehavior = { 7 SwarmingBehaviors.CommonBehavior = {
8 8
9 _botLink: function(bot_id) { 9 _botLink: function(bot_id) {
10 if (!bot_id) { 10 if (!bot_id) {
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 610
611 _reload: function() { 611 _reload: function() {
612 if (!this._auth_headers || !this._query_params) { 612 if (!this._auth_headers || !this._query_params) {
613 return; 613 return;
614 } 614 }
615 var url = "/_ah/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this ._query_params); 615 var url = "/_ah/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this ._query_params);
616 this.$.page_bots.load(url,this._auth_headers); 616 this.$.page_bots.load(url,this._auth_headers);
617 } 617 }
618 618
619 }); 619 });
620 })(); </script> </dom-module> <dom-module id="paper-button" assetpath="/res/im p/bower_components/paper-button/"> <template strip-whitespace=""> <style include ="paper-material-shared-styles">:host{@apply(--layout-inline);@apply(--layout-ce nter-center);position:relative;box-sizing:border-box;min-width:5.14em;margin:0 . 29em;background:0 0;-webkit-tap-highlight-color:transparent;-webkit-tap-highligh t-color:transparent;font:inherit;text-transform:uppercase;outline-width:0;border -radius:3px;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none; user-select:none;cursor:pointer;z-index:0;padding:.7em .57em;@apply(--paper-font -common-base);@apply(--paper-button)}:host([hidden]){display:none!important}:hos t([raised].keyboard-focus){font-weight:700;@apply(--paper-button-raised-keyboard -focus)}:host(:not([raised]).keyboard-focus){font-weight:700;@apply(--paper-butt on-flat-keyboard-focus)}:host([disabled]){background:#eaeaea;color:#a8a8a8;curso r:auto;pointer-events:none;@apply(--paper-button-disabled)}:host([animated]){@ap ply(--shadow-transition)}paper-ripple{color:var(--paper-button-ink-color)}</styl e> <content></content> </template> <script>Polymer({is:"paper-button",behaviors: [Polymer.PaperButtonBehavior],properties:{raised:{type:Boolean,reflectToAttribut e:!0,value:!1,observer:"_calculateElevation"}},_calculateElevation:function(){th is.raised?Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this):this._ setElevation(0)}})</script> </dom-module> <script>Polymer.NeonAnimatableBehavior ={properties:{animationConfig:{type:Object},entryAnimation:{observer:"_entryAnim ationChanged",type:String},exitAnimation:{observer:"_exitAnimationChanged",type: String}},_entryAnimationChanged:function(){this.animationConfig=this.animationCo nfig||{},this.animationConfig.entry=[{name:this.entryAnimation,node:this}]},_exi tAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this. animationConfig.exit=[{name:this.exitAnimation,node:this}]},_copyProperties:func tion(i,n){for(var t in n)i[t]=n[t]},_cloneConfig:function(i){var n={isClone:!0}; return this._copyProperties(n,i),n},_getAnimationConfigRecursive:function(i,n,t) {if(this.animationConfig){if(this.animationConfig.value&&"function"==typeof this .animationConfig.value)return void this._warn(this._logf("playAnimation","Please put 'animationConfig' inside of your components 'properties' object instead of outside of it."));var o;if(o=i?this.animationConfig[i]:this.animationConfig,Arra y.isArray(o)||(o=[o]),o)for(var e,a=0;e=o[a];a++)if(e.animatable)e.animatable._g etAnimationConfigRecursive(e.type||i,n,t);else if(e.id){var r=n[e.id];r?(r.isClo ne||(n[e.id]=this._cloneConfig(r),r=n[e.id]),this._copyProperties(r,e)):n[e.id]= e}else t.push(e)}},getAnimationConfig:function(i){var n={},t=[];this._getAnimati onConfigRecursive(i,n,t);for(var o in n)t.push(n[o]);return t}}</script> <script >Polymer.NeonAnimationRunnerBehaviorImpl={_configureAnimations:function(n){var i =[];if(n.length>0)for(var e,t=0;e=n[t];t++){var o=document.createElement(e.name) ;if(o.isNeonAnimation){var a=null;try{a=o.configure(e),"function"!=typeof a.canc el&&(a=document.timeline.play(a))}catch(n){a=null,console.warn("Couldnt play","( ",e.name,").",n)}a&&i.push({neonAnimation:o,config:e,animation:a})}else console. warn(this.is+":",e.name,"not found!")}return i},_shouldComplete:function(n){for( var i=!0,e=0;e<n.length;e++)if("finished"!=n[e].animation.playState){i=!1;break} return i},_complete:function(n){for(var i=0;i<n.length;i++)n[i].neonAnimation.co mplete(n[i].config);for(var i=0;i<n.length;i++)n[i].animation.cancel()},playAnim ation:function(n,i){var e=this.getAnimationConfig(n);if(e){this._active=this._ac tive||{},this._active[n]&&(this._complete(this._active[n]),delete this._active[n ]);var t=this._configureAnimations(e);if(0==t.length)return void this.fire("neon -animation-finish",i,{bubbles:!1});this._active[n]=t;for(var o=0;o<t.length;o++) t[o].animation.onfinish=function(){this._shouldComplete(t)&&(this._complete(t),d elete this._active[n],this.fire("neon-animation-finish",i,{bubbles:!1}))}.bind(t his)}},cancelAnimation:function(){for(var n in this._animations)this._animations [n].cancel();this._animations={}}},Polymer.NeonAnimationRunnerBehavior=[Polymer. NeonAnimatableBehavior,Polymer.NeonAnimationRunnerBehaviorImpl]</script> <script >Polymer.PaperDialogBehaviorImpl={hostAttributes:{role:"dialog",tabindex:"-1"},p roperties:{modal:{type:Boolean,value:!1}},observers:["_modalChanged(modal, _read ied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOu tsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancel OnEscKey,this.__prevWithBackdrop=this.withBackdrop},_modalChanged:function(i,e){ e&&(i?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prev NoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop ,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):( this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOu tsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEsc Key,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosi ngReasonConfirmed:function(i){this.closingReason=this.closingReason||{},this.clo singReason.confirmed=i},_onDialogClick:function(i){for(var e=Polymer.dom(i).path ,o=0;o<e.indexOf(this);o++){var t=e[o];if(t.hasAttribute&&(t.hasAttribute("dialo g-dismiss")||t.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirm ed(t.hasAttribute("dialog-confirm")),this.close(),i.stopPropagation();break}}}}, Polymer.PaperDialogBehavior=[Polymer.IronOverlayBehavior,Polymer.PaperDialogBeha viorImpl]</script> <dom-module id="paper-dialog-shared-styles" assetpath="/res/i mp/bower_components/paper-dialog-behavior/"> <template> <style>:host{display:blo ck;margin:24px 40px;background:var(--paper-dialog-background-color,--primary-bac kground-color);color:var(--paper-dialog-color,--primary-text-color);@apply(--pap er-font-body1);@apply(--shadow-elevation-16dp);@apply(--paper-dialog)}:host>::co ntent>*{margin-top:20px;padding:0 24px}:host>::content>.no-padding{padding:0}:ho st>::content>:first-child{margin-top:24px}:host>::content>:last-child{margin-bot tom:24px}:host>::content h2{position:relative;margin:0;@apply(--paper-font-title );@apply(--paper-dialog-title)}:host>::content .buttons{position:relative;paddin g:8px 8px 8px 24px;margin:0;color:var(--paper-dialog-button-color,--primary-colo r);@apply(--layout-horizontal);@apply(--layout-end-justified)}</style> </templat e> </dom-module> <dom-module id="paper-dialog" assetpath="/res/imp/bower_compone nts/paper-dialog/"> <template> <style include="paper-dialog-shared-styles"></sty le> <content></content> </template> </dom-module> <script>!function(){Polymer({i s:"paper-dialog",behaviors:[Polymer.PaperDialogBehavior,Polymer.NeonAnimationRun nerBehavior],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_rende rOpened:function(){this.cancelAnimation(),this.playAnimation("entry")},_renderCl osed:function(){this.cancelAnimation(),this.playAnimation("exit")},_onNeonAnimat ionFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderCl osed()}})}()</script> <script>window.SwarmingBehaviors=window.SwarmingBehaviors| |{},function(){SwarmingBehaviors.TaskBehavior={properties:{BOT_DIED:{type:String ,value:"BOT_DIED"},CANCELED:{type:String,value:"CANCELED"},COMPLETED:{type:Strin g,value:"COMPLETED"},COMPLETED_DEDUPED:{type:String,value:"COMPLETED (DEDUPED)"} ,COMPLETED_FAILURE:{type:String,value:"COMPLETED (FAILURE)"},COMPLETED_SUCCESS:{ type:String,value:"COMPLETED (SUCCESS)"},EXPIRED:{type:String,value:"EXPIRED"},P ENDING:{type:String,value:"PENDING"},RUNNING:{type:String,value:"RUNNING"},TIMED _OUT:{type:String,value:"TIMED_OUT"}},stateClass:function(E){return E===this.CAN CELED||E===this.TIMED_OUT||E===this.EXPIRED?"exception":E===this.BOT_DIED?"bot_d ied":E===this.COMPLETED_FAILURE?"failed_task":E===this.RUNNING||E===this.PENDING ?"pending_task":""}}}()</script> <dom-module id="task-style" assetpath="/res/imp /common/"> <template> <style>.failed_task{background-color:#fdd}.bot_died{backgr ound-color:#ccc}.exception{background-color:#edd2ff}.pending_task{background-col or:#fffc6c}</style> </template> </dom-module><dom-module id="task-filters" asset path="/res/imp/tasklist/"> <template> <style is="custom-style" include="iron-fle x iron-flex-alignment iron-positioning query-column-filter-style">.item.wide{max -width:400px}.selector.wide{min-width:275px}</style> <url-param name="f" value=" {{_filters}}" default_values="[]" multi=""> </url-param> <url-param name="c" val ue="{{columns}}" default_values="[&quot;name&quot;,&quot;state&quot;,&quot;creat ed_ts&quot;,&quot;user&quot;]" multi=""> </url-param> <url-param name="q" value= "{{_query}}" default_value=""> </url-param> <url-param name="l" default_value="5 0" value="{{_limit}}"> </url-param> <div class="container horizontal layout"> <d iv class="narrow-down-selector"> <div> <iron-a11y-keys target="[[_filter_input]] " keys="enter" on-keys-pressed="_manuallyAddFilter"></iron-a11y-keys> <paper-inp ut id="filter" label="Search columns and filters or supply a filter and press en ter" placeholder="gpu nvidia pool:Chrome" value="{{_query::input}}"> </paper-inp ut> </div> <div class="wide selector side-by-side" title="This shows all task ta gs and other interesting task properties. Mark the check box to add as a column. Select the row to see filter options."> <iron-selector attr-for-selected="label " selected="{{_primarySelected}}"> <template is="dom-repeat" items="[[_primaryIt ems]]" as="item"> <div class="selectable item horizontal layout" label="[[item]] "> <span>[[_beforeBold(item,_query)]]<span class="bold">[[_bold(item,_query)]]</ span>[[_afterBold(item,_query)]]</span> <span class="flex"></span> <paper-checkb ox noink="" disabled$="[[_cantToggleColumn(item)]]" checked="[[_columnState(item ,columns.*)]]" on-change="_toggleColumn"> </paper-checkbox> </div> </template> < /iron-selector> </div> <div class="selector side-by-side" title="These are all o ptions (if any) that the task list can be filtered on."> <template is="dom-repea t" id="secondaryList" items="[[_secondaryItems]]" as="item"> <div class="item ho rizontal layout" label="[[item]]"> <span>[[_beforeBold(item,_query)]]<span class ="bold">[[_bold(item,_query)]]</span>[[_afterBold(item,_query)]]</span> <span cl ass="flex"></span> <iron-icon class="icons" icon="icons:arrow-forward" hidden="[ [_cantAddFilter(_primarySelected,item,_filters.*)]]" on-tap="_addFilter"> </iron -icon> </div> </template> </div> <div class="selector side-by-side" title="These tag filters are AND'd together and applied to all tasks."> <template is="dom-re peat" items="[[_filters]]" as="fil"> <div class="item horizontal layout" label=" [[fil]]"> <span>[[fil]]</span> <span class="flex"></span> <iron-icon class="icon s" icon="icons:remove-circle-outline" hidden="[[_cantRemoveFilter(fil,_filters.* )]]" on-tap="_removeFilter"> </iron-icon> </div> </template> </div> <div class=" side-by-side"> <paper-input id="_limit" label="Limit Results" auto-validate="" m in="0" max="1000" pattern="[0-9]+" value="{{_limit}}"> </paper-input> </div> </d iv> </div> </template> <script>!function(){var t={state:function(t,i){var r=this ._attribute(t,"state")[0];if(i===r||"ALL"===i)return!0;if("PENDING_RUNNING"===i) return r===this.PENDING||r===this.RUNNING;var e=this._attribute(t,"failure",!1)[ 0];if("COMPLETED_SUCCESS"===i)return r===this.COMPLETED&&!e;if("COMPLETED_FAILUR E"===i)return r===this.COMPLETED&&e;var a=this._attribute(t,"try_number","-1")[0 ];return"DEDUPED"===i?r===this.COMPLETED&&"0"===a:void 0}};Polymer({is:"task-fil ters",behaviors:[SwarmingBehaviors.QueryColumnFilter,SwarmingBehaviors.TaskBehav ior],properties:{columns:{type:Array,notify:!0},query_params:{type:Object,comput ed:"_extractQueryParams(_filters.*, _limit)",notify:!0},_filterMap:{type:Object, value:function(){var i=this._commonFilters();for(var r in t)i[r]=t[r];return i}} },_cantToggleColumn:function(t){return!t||"name"===t},_extractQueryParams:functi on(){var t={},i=[];this._filters.forEach(function(r){var e=r.split(this.FILTER_S EP,1),a=e[0],s=r.substring(a.length+this.FILTER_SEP.length);"state"===a?t.state= [s]:("user"===a&&"none"===s&&(s=""),i.push(a+this.FILTER_SEP+swarming.alias.unap ply(s)))}.bind(this)),t.tags=i;var r=parseInt(this._limit);return Number.isInteg er(r)&&(r=Math.max(r,1),r=Math.min(1e3,r),t.limit=[r],this._limit!=r&&this.set(" _limit",r)),t}})}()</script> </dom-module><dom-module id="task-list-data" assetp ath="/res/imp/tasklist/"> <script>!function(){var t=["abandoned_ts","completed_t s","created_ts","modified_ts","started_ts"];Polymer({is:"task-list-data",behavio rs:[SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties: {auth_headers:{type:Object,observer:"signIn"},query_params:{type:Object},tasks:{ type:Array},busy:{type:Boolean,computed:"_or(_busy2,_busy1)",notify:!0},primary_ map:{type:Object,computed:"_primaryMap(_tags,_dimensions,tasks.*)",notify:!0},pr imary_arr:{type:Array,computed:"_primaryArr(primary_map)",notify:!0},_busy2:{typ e:Boolean,value:!1},_busy1:{type:Boolean,value:!1},_dimensions:{type:Object},_li st:{type:Object},_tags:{type:Object}},signIn:function(){this._getJsonAsync("_tag s","/_ah/api/swarming/v1/tasks/tags","_busy2",this.auth_headers),this._getJsonAs ync("_dimensions","/_ah/api/swarming/v1/bots/dimensions","_busy1",this.auth_head ers)},_primaryArr:function(t){var a=Object.keys(t);return a.sort(),a},_primaryMa p:function(a,s){a=a&&a.tasks_tags||[],s=s&&s.bots_dimensions||[],tasks=this.task s||[];var e={};a.forEach(function(t){e[t.key]||(e[t.key]={});var a=t.value||[];a .forEach(function(a){e[t.key][a]=!0})}),s.forEach(function(t){var a=t.value;e[t. key]||(e[t.key]={}),a.forEach(function(a){e[t.key][a]=!0})}),tasks.forEach(funct ion(t){Object.keys(t.tagMap).forEach(function(a){var s=t.tagMap[a];e[a]||(e[a]={ }),e[a][s]=!0})}),delete e.user[""],e.user.none=!0;var r={};for(key in e){var i= Object.keys(e[key]);if(swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(key)===-1) r[key]=i;else{var n=[];i.forEach(function(t){n.push(swarming.alias.apply(t,key)) }),r[key]=n}}return r.name=[],r.state=[this.PENDING,this.RUNNING,"PENDING_RUNNIN G",this.COMPLETED,"COMPLETED_SUCCESS","COMPLETED_FAILURE",this.EXPIRED,this.TIME D_OUT,this.BOT_DIED,this.CANCELED,"DEDUPED","ALL"],r.costs_usd=[],r.deduped_from =[],r.duration=[],r.server_versions=[],r.bot=[],t.forEach(function(t){r[t]=[]}), r},parseTasks:function(a){if(console.log("ping",a),!a||!a.items)return[];var s=n ew Date;return a.items.forEach(function(a){var e={};a.tags=a.tags||[],a.tags.for Each(function(t){var a=t.split(":",1),s=a[0],r=t.substring(s.length+1);e[s]=r}), a.tagMap=e,t.forEach(function(t){a[t]&&(a[t]=new Date(a[t]),a["human_"+t]=sk.hum an.localeTime(a[t]))}),!a.duration&&a.state===this.RUNNING&&a.started_ts&&(a.dur ation=(s-a.started_ts)/1e3),a.duration&&(a.human_duration=this._humanDuration(a. duration))}.bind(this)),a.items}})}()</script> </dom-module> <dom-module id="tas k-list" assetpath="/res/imp/tasklist/"> <template> <style include="iron-flex iro n-flex-alignment iron-positioning swarming-app-style dynamic-table-style task-st yle">task-filters{margin-bottom:8px;margin-right:10px}.task-list th>span{padding -right:30px}</style> <url-param name="s" value="{{_sortstr}}" default_value="cre ated_ts:desc"> </url-param> <swarming-app client_id="[[client_id]]" auth_headers ="{{_auth_headers}}" permissions="{{_permissions}}" signed_in="{{_signed_in}}" b usy="[[_or(_busy1,_busy2)]]" name="Swarming Task List"> <h2 hidden$="[[_signed_i n]]">You must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_ in)]]"> <task-list-data id="data" auth_headers="[[_auth_headers]]" query_params= "[[_query_params]]" tasks="[[_items]]" busy="{{_busy1)}}" primary_map="{{_primar y_map}}" primary_arr="{{_primary_arr}}"> </task-list-data> <div class="horizonta l layout"> <task-filters primary_map="[[_primary_map]]" primary_arr="[[_primary_ arr]]" columns="{{_columns}}" query_params="{{_query_params}}" filter="{{_filter }}"> </task-filters> </div> <table class="task-list"> <thead on-sort_change="_so rtChange"> <tr> <th> <span>Task Name</span> <sort-toggle name="name" current="[[ _sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('state', _columns.*)]]"> <sp an>State</span> <sort-toggle name="state" current="[[_sort]]"> </sort-toggle> </ th> <th hidden$="[[_hide('bot', _columns.*)]]"> <span>Bot Assigned</span> <sort- toggle name="bot" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide ('deduped_from', _columns.*)]]"> <span>Deduped from</span> <sort-toggle name="de duped_from" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('sk_r evision', _columns.*)]]"> <span>Skia Revision</span> <sort-toggle name="sk_revis ion" current="[[_sort]]"> </sort-toggle> </th> <template is="dom-repeat" items=" [[_plainColumns]]" as="c"> <th hidden$="[[_hide(c)]]"> <span>[[_header(c)]]</spa n> <sort-toggle name="[[c]]" current="[[_sort]]"> </sort-toggle> </th> </templat e> </tr> </thead> <tbody> <template id="tasks_table" is="dom-repeat" items="[[_f ilteredSortedItems]]" as="task" initial-count="50"> <tr class$="[[_taskClass(tas k)]]"> <td> <a class="center" href$="[[_taskLink(task.task_id)]]" target="_blank "> [[task.name]] </a> </td> <td hidden$="[[_hide('state', _columns.*)]]"> [[_col umn('state', task)]] <paper-button raised="" hidden$="[[_cannotCancel(task,_perm issions)]]" on-tap="_promptCancel"> Cancel </paper-button> </td> <td hidden$="[[ _hide('bot', _columns.*)]]"> <a class="center" href$="[[_botLink(task.bot_id)]]" target="_blank"> [[_column('bot',task)]] </a> </td> <td hidden$="[[_hide('dedup ed_from', _columns.*)]]"> <a class="center" href$="[[_taskLink(task.deduped_from )]]" target="_blank"> [[_column('deduped_from',task)]] </a> </td> <td hidden$="[ [_hide('sk_revision', _columns.*)]]"> <a class="center" href$="[[_skLink(task)]] " target="_blank"> [[_column('sk_revision',task)]] </a> </td> <template is="dom- repeat" items="[[_plainColumns]]" as="c"> <td hidden$="[[_hide(c)]]"> [[_column( c, task)]] </td> </template> </tr> </template> </tbody> </table> <pageable-data id="page_tasks" busy="{{_busy2}}" label="Show more tasks" output="{{_items}}" pa rse="[[_parseTasks]]"> </pageable-data> </div> </swarming-app> <paper-dialog id= "prompt" modal="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <p aper-button dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialo g-confirm="">Yes</paper-button> </div> </paper-dialog> <error-toast></error-toas t> </template> <script>!function(){function t(t){return function(e){return this. _attribute(e,"human_"+t)[0]}}function e(t){return function(e,a,s){var i=this._at tribute(a,t,"0")[0],r=this._attribute(s,t,"0")[0];return e*(i-r)}}var a=["dedupe d_from","name","state","bot"],s={abandoned_ts:t("abandoned_ts"),bot:function(t){ return this._attribute(t,"bot_id")[0]},completed_ts:t("completed_ts"),costs_usd: function(t){return this._attribute(t,"costs_usd",0)[0]},created_ts:t("created_ts "),duration:t("duration"),modified_ts:t("modified_ts"),sk_revision:function(t){v ar e=this._attribute(t,"sk_revision")[0];return e.substring(0,8)},started_ts:t(" started_ts"),state:function(t){var e=this._attribute(t,"state")[0];if("COMPLETED "===e){if(this._attribute(t,"failure",!1)[0])return"COMPLETED (FAILURE)";var a=t his._attribute(t,"try_number","-1")[0];return"0"===a?"COMPLETED (DEDUPED)":"COMP LETED (SUCCESS)"}return e}},i={user:"Requesting User"},r={abandoned_ts:e("abando ned_ts"),completed_ts:e("completed_ts"),created_ts:e("created_ts"),duration:e("d uration"),modified_ts:e("modified_ts"),started_ts:e("started_ts")};Polymer({is:" task-list",behaviors:[SwarmingBehaviors.DynamicTableBehavior,SwarmingBehaviors.T askBehavior],properties:{client_id:{type:String},_busy1:{type:Boolean,value:!1}, _busy2:{type:Boolean,value:!1},_parseTasks:{type:Function,value:function(){retur n this.$.data.parseTasks.bind(this)}},_toCancel:{type:String},_columnMap:{type:O bject,value:function(){var t=this._commonColumns();for(var e in s)t[e]=s[e];retu rn t}},_headerMap:{type:Object,value:i},_specialColumns:{type:Array,value:a},_sp ecialSort:{type:Object,value:r}},observers:["reload(_query_params,_auth_headers) "],_attribute:function(t,e,a){void 0===a&&(a="none");var s=this._tag(t,e)||t[e]| |[a];return Array.isArray(s)?s:[s]},_cannotCancel:function(t,e){return!(e&&e.can cel_task&&"PENDING"===this._column("state",t))},_cancelTask:function(){var t="/_ ah/api/swarming/v1/task/"+this._toCancel+"/cancel";swarming.postWithToast(t,"Can celing task "+this._toCancel,this._auth_headers),this.set("_toCancel","")},_prom ptClosed:function(t){t.detail.confirmed&&this._cancelTask()},_promptCancel:funct ion(t){var e=t.model.task;return e&&e.task_id?(this.set("_toCancel",e.task_id),t his.set("_dialogPrompt",'cancel task "'+e.name+'"'),void this.$.prompt.open()):v oid console.log("Missing task info",e)},reload:function(){if(this._auth_headers& &this._query_params){var t="/_ah/api/swarming/v1/tasks/list?"+sk.query.fromParam Set(this._query_params);this.$.page_tasks.load(t,this._auth_headers)}},_skLink:f unction(t){var e=this._attribute(t,"sk_revision")[0];return"none"!==e&&"https:// skia.googlesource.com/skia/+/"+e},_tag:function(t,e){if(t&&t.tagMap)return t.tag Map[e]},_taskClass:function(t){return this.stateClass(this._column("state",t))}} )}()</script> </dom-module> <dom-module id="iron-collapse" assetpath="/res/imp/b ower_components/iron-collapse/"> <template> <style>:host{display:block;transitio n-duration:var(--iron-collapse-transition-duration,300ms);overflow:visible}:host (.iron-collapse-closed){display:none}:host(:not(.iron-collapse-opened)){overflow :hidden}</style> <content></content> </template> </dom-module> <script>Polymer({ is:"iron-collapse",behaviors:[Polymer.IronResizableBehavior],properties:{horizon tal:{type:Boolean,value:!1,observer:"_horizontalChanged"},opened:{type:Boolean,v alue:!1,notify:!0,observer:"_openedChanged"},noAnimation:{type:Boolean},_desired Size:{type:String,value:""}},get dimension(){return this.horizontal?"width":"hei ght"},get _dimensionMax(){return this.horizontal?"maxWidth":"maxHeight"},get _di mensionMaxCss(){return this.horizontal?"max-width":"max-height"},hostAttributes: {role:"group","aria-hidden":"true","aria-expanded":"false"},listeners:{transitio nend:"_transitionEnd"},attached:function(){this._transitionEnd()},toggle:functio n(){this.opened=!this.opened},show:function(){this.opened=!0},hide:function(){th is.opened=!1},updateSize:function(i,t){if(i="auto"===i?"":i,this._desiredSize!== i){this._desiredSize=i,this._updateTransition(!1);var e=t&&!this.noAnimation&&th is._isDisplayed;if(e){var n=this._calcSize();""===i&&(this.style[this._dimension Max]="",i=this._calcSize()),this.style[this._dimensionMax]=n,this.scrollTop=this .scrollTop,this._updateTransition(!0),e=i!==n}this.style[this._dimensionMax]=i,e ||this._transitionEnd()}},enableTransition:function(i){Polymer.Base._warn("`enab leTransition()` is deprecated, use `noAnimation` instead."),this.noAnimation=!i} ,_updateTransition:function(i){this.style.transitionDuration=i&&!this.noAnimatio n?"":"0s"},_horizontalChanged:function(){this.style.transitionProperty=this._dim ensionMaxCss;var i="maxWidth"===this._dimensionMax?"maxHeight":"maxWidth";this.s tyle[i]="",this.updateSize(this.opened?"auto":"0px",!1)},_openedChanged:function (){this.setAttribute("aria-expanded",this.opened),this.setAttribute("aria-hidden ",!this.opened),this.toggleClass("iron-collapse-closed",!1),this.toggleClass("ir on-collapse-opened",!1),this.updateSize(this.opened?"auto":"0px",!0),this.opened &&this.focus()},_transitionEnd:function(){this.style[this._dimensionMax]=this._d esiredSize,this.toggleClass("iron-collapse-closed",!this.opened),this.toggleClas s("iron-collapse-opened",this.opened),this._updateTransition(!1),this.notifyResi ze()},get _isDisplayed(){var i=this.getBoundingClientRect();for(var t in i)if(0! ==i[t])return!0;return!1},_calcSize:function(){return this.getBoundingClientRect ()[this.dimension]+"px"}})</script> <script>Polymer.IronMenuBehaviorImpl={proper ties:{focusedItem:{observer:"_focusedItemChanged",readOnly:!0,type:Object},attrF orItemTitle:{type:String}},hostAttributes:{role:"menu",tabindex:"0"},observers:[ "_updateMultiselectable(multi)"],listeners:{focus:"_onFocus",keydown:"_onKeydown ","iron-items-changed":"_onIronItemsChanged"},keyBindings:{up:"_onUpKey",down:"_ onDownKey",esc:"_onEscKey","shift+tab:keydown":"_onShiftTabDown"},attached:funct ion(){this._resetTabindices()},select:function(e){this._defaultFocusAsync&&(this .cancelAsync(this._defaultFocusAsync),this._defaultFocusAsync=null);var t=this._ valueToItem(e);t&&t.hasAttribute("disabled")||(this._setFocusedItem(t),Polymer.I ronMultiSelectableBehaviorImpl.select.apply(this,arguments))},_resetTabindices:f unction(){var e=this.multi?this.selectedItems&&this.selectedItems[0]:this.select edItem;this.items.forEach(function(t){t.setAttribute("tabindex",t===e?"0":"-1")} ,this)},_updateMultiselectable:function(e){e?this.setAttribute("aria-multiselect able","true"):this.removeAttribute("aria-multiselectable")},_focusWithKeyboardEv ent:function(e){for(var t,i=0;t=this.items[i];i++){var s=this.attrForItemTitle|| "textContent",o=t[s]||t.getAttribute(s);if(!t.hasAttribute("disabled")&&o&&o.tri m().charAt(0).toLowerCase()===String.fromCharCode(e.keyCode).toLowerCase()){this ._setFocusedItem(t);break}}},_focusPrevious:function(){for(var e=this.items.leng th,t=Number(this.indexOf(this.focusedItem)),i=1;i<e+1;i++){var s=this.items[(t-i +e)%e];if(!s.hasAttribute("disabled")){var o=Polymer.dom(s).getOwnerRoot()||docu ment;if(this._setFocusedItem(s),Polymer.dom(o).activeElement==s)return}}},_focus Next:function(){for(var e=this.items.length,t=Number(this.indexOf(this.focusedIt em)),i=1;i<e+1;i++){var s=this.items[(t+i)%e];if(!s.hasAttribute("disabled")){va r o=Polymer.dom(s).getOwnerRoot()||document;if(this._setFocusedItem(s),Polymer.d om(o).activeElement==s)return}}},_applySelection:function(e,t){t?e.setAttribute( "aria-selected","true"):e.removeAttribute("aria-selected"),Polymer.IronSelectabl eBehavior._applySelection.apply(this,arguments)},_focusedItemChanged:function(e, t){t&&t.setAttribute("tabindex","-1"),e&&(e.setAttribute("tabindex","0"),e.focus ())},_onIronItemsChanged:function(e){e.detail.addedNodes.length&&this._resetTabi ndices()},_onShiftTabDown:function(e){var t=this.getAttribute("tabindex");Polyme r.IronMenuBehaviorImpl._shiftTabPressed=!0,this._setFocusedItem(null),this.setAt tribute("tabindex","-1"),this.async(function(){this.setAttribute("tabindex",t),P olymer.IronMenuBehaviorImpl._shiftTabPressed=!1},1)},_onFocus:function(e){if(!Po lymer.IronMenuBehaviorImpl._shiftTabPressed){var t=Polymer.dom(e).rootTarget;(t= ==this||"undefined"==typeof t.tabIndex||this.isLightDescendant(t))&&(this._defau ltFocusAsync=this.async(function(){var e=this.multi?this.selectedItems&&this.sel ectedItems[0]:this.selectedItem;this._setFocusedItem(null),e?this._setFocusedIte m(e):this.items[0]&&this._focusNext()}))}},_onUpKey:function(e){this._focusPrevi ous(),e.detail.keyboardEvent.preventDefault()},_onDownKey:function(e){this._focu sNext(),e.detail.keyboardEvent.preventDefault()},_onEscKey:function(e){this.focu sedItem.blur()},_onKeydown:function(e){this.keyboardEventMatchesKeys(e,"up down esc")||this._focusWithKeyboardEvent(e),e.stopPropagation()},_activateHandler:fun ction(e){Polymer.IronSelectableBehavior._activateHandler.call(this,e),e.stopProp agation()}},Polymer.IronMenuBehaviorImpl._shiftTabPressed=!1,Polymer.IronMenuBeh avior=[Polymer.IronMultiSelectableBehavior,Polymer.IronA11yKeysBehavior,Polymer. IronMenuBehaviorImpl]</script> <script>Polymer.IronMenubarBehaviorImpl={hostAttr ibutes:{role:"menubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onU pKey:function(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault( )},_onDownKey:function(e){this.focusedItem.click(),e.detail.keyboardEvent.preven tDefault()},get _isRTL(){return"rtl"===window.getComputedStyle(this).direction}, _onLeftKey:function(e){this._isRTL?this._focusNext():this._focusPrevious(),e.det ail.keyboardEvent.preventDefault()},_onRightKey:function(e){this._isRTL?this._fo cusPrevious():this._focusNext(),e.detail.keyboardEvent.preventDefault()},_onKeyd own:function(e){this.keyboardEventMatchesKeys(e,"up down left right esc")||this. _focusWithKeyboardEvent(e)}},Polymer.IronMenubarBehavior=[Polymer.IronMenuBehavi or,Polymer.IronMenubarBehaviorImpl]</script> <iron-iconset-svg name="paper-tabs" size="24"> <svg><defs> <g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path></g> <g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g> </defs></svg> </iron-iconset-svg> <d om-module id="paper-tab" assetpath="/res/imp/bower_components/paper-tabs/"> <tem plate> <style>:host{@apply(--layout-inline);@apply(--layout-center);@apply(--lay out-center-justified);@apply(--layout-flex-auto);position:relative;padding:0 12p x;overflow:hidden;cursor:pointer;vertical-align:middle;@apply(--paper-font-commo n-base);@apply(--paper-tab)}:host(:focus){outline:0}:host([link]){padding:0}.tab -content{height:100%;transform:translateZ(0);-webkit-transform:translateZ(0);tra nsition:opacity .1s cubic-bezier(.4,0,1,1);@apply(--layout-horizontal);@apply(-- layout-center-center);@apply(--layout-flex-auto);@apply(--paper-tab-content)}:ho st(:not(.iron-selected))>.tab-content{opacity:.8;@apply(--paper-tab-content-unse lected)}:host(:focus) .tab-content{opacity:1;font-weight:700}paper-ripple{color: var(--paper-tab-ink,--paper-yellow-a100)}.tab-content>::content>a{@apply(--layou t-flex-auto);height:100%}</style> <div class="tab-content"> <content></content> </div> </template> <script>Polymer({is:"paper-tab",behaviors:[Polymer.IronContro lState,Polymer.IronButtonState,Polymer.PaperRippleBehavior],properties:{link:{ty pe:Boolean,value:!1,reflectToAttribute:!0}},hostAttributes:{role:"tab"},listener s:{down:"_updateNoink",tap:"_onTap"},attached:function(){this._updateNoink()},ge t _parentNoink(){var t=Polymer.dom(this).parentNode;return!!t&&!!t.noink},_updat eNoink:function(){this.noink=!!this.noink||!!this._parentNoink},_onTap:function( t){if(this.link){var e=this.queryEffectiveChildren("a");if(!e)return;if(t.target ===e)return;e.click()}}})</script> </dom-module> <dom-module id="paper-tabs" ass etpath="/res/imp/bower_components/paper-tabs/"> <template> <style>:host{@apply(- -layout);@apply(--layout-center);height:48px;font-size:14px;font-weight:500;over flow:hidden;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none; user-select:none;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-c olor:transparent;@apply(--paper-tabs)}:host-context([dir=rtl]){@apply(--layout-h orizontal-reverse)}#tabsContainer{position:relative;height:100%;white-space:nowr ap;overflow:hidden;@apply(--layout-flex-auto)}#tabsContent{height:100%;-moz-flex -basis:auto;-ms-flex-basis:auto;flex-basis:auto}#tabsContent.scrollable{position :absolute;white-space:nowrap}#tabsContent.scrollable.fit-container,#tabsContent: not(.scrollable){@apply(--layout-horizontal)}#tabsContent.scrollable.fit-contain er{min-width:100%}#tabsContent.scrollable.fit-container>::content>*{-ms-flex:1 0 auto;-webkit-flex:1 0 auto;flex:1 0 auto}.hidden{display:none}.not-visible{opac ity:0;cursor:default}paper-icon-button{width:48px;height:48px;padding:12px;margi n:0 4px}#selectionBar{position:absolute;height:2px;bottom:0;left:0;right:0;backg round-color:var(--paper-tabs-selection-bar-color,--paper-yellow-a100);-webkit-tr ansform:scale(0);transform:scale(0);-webkit-transform-origin:left center;transfo rm-origin:left center;transition:-webkit-transform;transition:transform;@apply(- -paper-tabs-selection-bar)}#selectionBar.align-bottom{top:0;bottom:auto}#selecti onBar.expand{transition-duration:.15s;transition-timing-function:cubic-bezier(.4 ,0,1,1)}#selectionBar.contract{transition-duration:.18s;transition-timing-functi on:cubic-bezier(0,0,.2,1)}#tabsContent>::content>:not(#selectionBar){height:100% }</style> <paper-icon-button icon="paper-tabs:chevron-left" class$="[[_computeSc rollButtonClass(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollB uttonUp" on-down="_onLeftScrollButtonDown" tabindex="-1"></paper-icon-button> <d iv id="tabsContainer" on-track="_scroll" on-down="_down"> <div id="tabsContent" class$="[[_computeTabsContentClass(scrollable, fitContainer)]]"> <div id="select ionBar" class$="[[_computeSelectionBarClass(noBar, alignBottom)]]" on-transition end="_onBarTransitionEnd"></div> <content select="*"></content> </div> </div> <p aper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonC lass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" o n-down="_onRightScrollButtonDown" tabindex="-1"></paper-icon-button> </template> <script>Polymer({is:"paper-tabs",behaviors:[Polymer.IronResizableBehavior,Polym er.IronMenubarBehavior],properties:{noink:{type:Boolean,value:!1,observer:"_noin kChanged"},noBar:{type:Boolean,value:!1},noSlide:{type:Boolean,value:!1},scrolla ble:{type:Boolean,value:!1},fitContainer:{type:Boolean,value:!1},disableDrag:{ty pe:Boolean,value:!1},hideScrollButtons:{type:Boolean,value:!1},alignBottom:{type :Boolean,value:!1},selectable:{type:String,value:"paper-tab"},autoselect:{type:B oolean,value:!1},autoselectDelay:{type:Number,value:0},_step:{type:Number,value: 10},_holdDelay:{type:Number,value:1},_leftHidden:{type:Boolean,value:!1},_rightH idden:{type:Boolean,value:!1},_previousTab:{type:Object}},hostAttributes:{role:" tablist"},listeners:{"iron-resize":"_onTabSizingChanged","iron-items-changed":"_ onTabSizingChanged","iron-select":"_onIronSelect","iron-deselect":"_onIronDesele ct"},keyBindings:{"left:keyup right:keyup":"_onArrowKeyup"},created:function(){t his._holdJob=null,this._pendingActivationItem=void 0,this._pendingActivationTime out=void 0,this._bindDelayedActivationHandler=this._delayedActivationHandler.bin d(this),this.addEventListener("blur",this._onBlurCapture.bind(this),!0)},ready:f unction(){this.setScrollDirection("y",this.$.tabsContainer)},detached:function() {this._cancelPendingActivation()},_noinkChanged:function(t){var e=Polymer.dom(th is).querySelectorAll("paper-tab");e.forEach(t?this._setNoinkAttribute:this._remo veNoinkAttribute)},_setNoinkAttribute:function(t){t.setAttribute("noink","")},_r emoveNoinkAttribute:function(t){t.removeAttribute("noink")},_computeScrollButton Class:function(t,e,i){return!e||i?"hidden":t?"not-visible":""},_computeTabsConte ntClass:function(t,e){return t?"scrollable"+(e?" fit-container":""):" fit-contai ner"},_computeSelectionBarClass:function(t,e){return t?"hidden":e?"align-bottom" :""},_onTabSizingChanged:function(){this.debounce("_onTabSizingChanged",function (){this._scroll(),this._tabChanged(this.selectedItem)},10)},_onIronSelect:functi on(t){this._tabChanged(t.detail.item,this._previousTab),this._previousTab=t.deta il.item,this.cancelDebouncer("tab-changed")},_onIronDeselect:function(t){this.de bounce("tab-changed",function(){this._tabChanged(null,this._previousTab),this._p reviousTab=null},1)},_activateHandler:function(){this._cancelPendingActivation() ,Polymer.IronMenuBehaviorImpl._activateHandler.apply(this,arguments)},_scheduleA ctivation:function(t,e){this._pendingActivationItem=t,this._pendingActivationTim eout=this.async(this._bindDelayedActivationHandler,e)},_delayedActivationHandler :function(){var t=this._pendingActivationItem;this._pendingActivationItem=void 0 ,this._pendingActivationTimeout=void 0,t.fire(this.activateEvent,null,{bubbles:! 0,cancelable:!0})},_cancelPendingActivation:function(){void 0!==this._pendingAct ivationTimeout&&(this.cancelAsync(this._pendingActivationTimeout),this._pendingA ctivationItem=void 0,this._pendingActivationTimeout=void 0)},_onArrowKeyup:funct ion(t){this.autoselect&&this._scheduleActivation(this.focusedItem,this.autoselec tDelay)},_onBlurCapture:function(t){t.target===this._pendingActivationItem&&this ._cancelPendingActivation()},get _tabContainerScrollSize(){return Math.max(0,thi s.$.tabsContainer.scrollWidth-this.$.tabsContainer.offsetWidth)},_scroll:functio n(t,e){if(this.scrollable){var i=e&&-e.ddx||0;this._affectScroll(i)}},_down:func tion(t){this.async(function(){this._defaultFocusAsync&&(this.cancelAsync(this._d efaultFocusAsync),this._defaultFocusAsync=null)},1)},_affectScroll:function(t){t his.$.tabsContainer.scrollLeft+=t;var e=this.$.tabsContainer.scrollLeft;this._le ftHidden=0===e,this._rightHidden=e===this._tabContainerScrollSize},_onLeftScroll ButtonDown:function(){this._scrollToLeft(),this._holdJob=setInterval(this._scrol lToLeft.bind(this),this._holdDelay)},_onRightScrollButtonDown:function(){this._s crollToRight(),this._holdJob=setInterval(this._scrollToRight.bind(this),this._ho ldDelay)},_onScrollButtonUp:function(){clearInterval(this._holdJob),this._holdJo b=null},_scrollToLeft:function(){this._affectScroll(-this._step)},_scrollToRight :function(){this._affectScroll(this._step)},_tabChanged:function(t,e){if(!t)retu rn this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList. remove("contract"),void this._positionBar(0,0);var i=this.$.tabsContent.getBound ingClientRect(),n=i.width,o=t.getBoundingClientRect(),s=o.left-i.left;if(this._p os={width:this._calcPercent(o.width,n),left:this._calcPercent(s,n)},this.noSlide ||null==e)return this.$.selectionBar.classList.remove("expand"),this.$.selection Bar.classList.remove("contract"),void this._positionBar(this._pos.width,this._po s.left);var a=e.getBoundingClientRect(),l=this.items.indexOf(e),c=this.items.ind exOf(t),r=5;this.$.selectionBar.classList.add("expand");var h=l<c,d=this._isRTL; d&&(h=!h),h?this._positionBar(this._calcPercent(o.left+o.width-a.left,n)-r,this. _left):this._positionBar(this._calcPercent(a.left+a.width-o.left,n)-r,this._calc Percent(s,n)+r),this.scrollable&&this._scrollToSelectedIfNeeded(o.width,s)},_scr ollToSelectedIfNeeded:function(t,e){var i=e-this.$.tabsContainer.scrollLeft;i<0? this.$.tabsContainer.scrollLeft+=i:(i+=t-this.$.tabsContainer.offsetWidth,i>0&&( this.$.tabsContainer.scrollLeft+=i))},_calcPercent:function(t,e){return 100*t/e} ,_positionBar:function(t,e){t=t||0,e=e||0,this._width=t,this._left=e,this.transf orm("translateX("+e+"%) scaleX("+t/100+")",this.$.selectionBar)},_onBarTransitio nEnd:function(t){var e=this.$.selectionBar.classList;e.contains("expand")?(e.rem ove("expand"),e.add("contract"),this._positionBar(this._pos.width,this._pos.left )):e.contains("contract")&&e.remove("contract")}})</script> </dom-module> <dom-m odule id="single-page-style" assetpath="/res/imp/common/"> <template> <style>.he ader{max-width:450px}.title{font-size:1.5em;font-weight:700;margin:5px}.id_input {margin-left:5px;--paper-input-container-input:{font-size:2em};}.refresh{max-wid th:40px;max-height:40px;width:initial;height:initial}button{min-width:4em;max-he ight:55px}table{border-collapse:collapse;margin-left:5px;margin-bottom:8px}td,th {border:1px solid #BBB;padding:5px}.tabs{background-color:#1F78B4;color:#fff;max -width:600px;margin-left:5px;--paper-checkbox-label-color:#fff}paper-tab{backgro und-color:#A6CEE3;color:#000}paper-tab.iron-selected{background-color:#1F78B4;co lor:#fff;font-weight:700;text-decoration:underline}paper-tab[disabled]{backgroun d-color:#AAA;text-decoration:line-through}.quarantined{background-color:#fdd}.de ad{background-color:#ccc}</style> </template> </dom-module><script>!function(){S warmingBehaviors.BotPageBehavior=[SwarmingBehaviors.CommonBehavior,{}]}()</scrip t> <dom-module id="bot-page-data" assetpath="/res/imp/botpage/"> <script>!functi on(){function t(t){if(!s){var e=t.toString();s=e.substring(e.indexOf("("))}retur n t.toLocaleString()+" "+s}var e,s,n=400,i=["first_seen_ts","last_seen_ts"],a=[" started_ts","completed_ts","abandoned_ts","modified_ts"];Polymer({is:"bot-page-d ata",behaviors:[SwarmingBehaviors.BotPageBehavior],properties:{auth_headers:{typ e:Object},bot_id:{type:String},busy:{type:Boolean,computed:"_or(_busy1)",notify: !0},bot:{type:Object,computed:"_parseBot(_bot)",notify:!0},_busy1:{type:Boolean, value:!1},_bot:{type:Object},_events:{type:Object},_tasks:{type:Object}},observe rs:["request(auth_headers,bot_id)"],request:function(){this.bot_id&&this.auth_he aders&&(e&&this.cancelAsync(e),e=this.async(function(){e=void 0;var t="/_ah/api/ swarming/v1/bot/"+this.bot_id;this._getJsonAsync("_bot",t+"/get","_busy1",this.a uth_headers),this.fire("reload",{id:this.bot_id})},n))},_parseBot:function(e){if (!e)return{};e.state=e.state||"{}",e.state=JSON.parse(e.state);var s=e.state.dis ks||{},n=Object.keys(s);if(n.length){e.disks=[];for(var a=0;a<n.length;a++)e.dis ks.push({id:n[a],mb:s[n[a]].free_mb});e.disks.sort(function(t,e){return e.mb-t.m b})}else e.disks=[{id:"unknown",mb:0}];return e.dimensions=e.dimensions||[],e.di mensions.forEach(function(t){swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(t.ke y)!==-1&&t.value.forEach(function(e,s){t.value[s]=swarming.alias.apply(e,t.key)} )}),i.forEach(function(s){e[s]&&(e[s]=new Date(e[s]),e["human_"+s]=t(e[s]))}),e} ,parseEvents:function(e){if(!e||!e.items)return[];var e=e.items;return e.forEach (function(e){e.ts&&(e.ts=new Date(e.ts),e.human_ts=t(e.ts))}),e.sort(function(t, e){return e.ts-t.ts}),e},parseTasks:function(e){if(!e||!e.items)return[];var e=e .items;return e.forEach(function(e){if(a.forEach(function(s){e[s]&&(e[s]=new Dat e(e[s]),e["human_"+s]=t(e[s]))}),e.duration)e.human_duration=this._humanDuration (e.duration);else{var s=e.completed_ts||e.abandoned_ts||e.modified_ts||new Date; e.human_duration=this._timeDiffExact(e.started_ts,s),e.duration=(s.getTime()-e.s tarted_ts)/1e3}e.state=e.state||"UNKNOWN","COMPLETED"===e.state&&(e.failure?e.st ate="FAILURE":e.state="SUCCESS")}.bind(this)),e.sort(function(t,e){return e.star ted_ts-t.started_ts}),e}})}()</script> </dom-module> <dom-module id="bot-page-su mmary" assetpath="/res/imp/botpage/"> <template> <style include="single-page-sty le">.wrapper{display:table;margin-left:auto;margin-bottom:10px;margin-right:5px} paper-checkbox{margin-left:5px}.thick{border-top-style:solid}</style> <url-param name="show_full_names" value="{{_show_full_names}}"> </url-param> <url-param na me="show_all_tasks" value="{{_show_all_tasks}}"> </url-param> <url-param name="s ort_stats" value="{{_sortstr}}" default_value="total:desc"> </url-param> <div cl ass="wrapper"> <table> <thead on-sort_change="_sortChange"> <tr> <th> <span>Name </span> <sort-toggle name="full_name" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Total</span> <sort-toggle name="total" current="[[_sort]]"> </sort-to ggle> </th> <th> <span>Success</span> <sort-toggle name="success" current="[[_so rt]]"> </sort-toggle> </th> <th> <span>Failed</span> <sort-toggle name="failed" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Died</span> <sort-toggle na me="bot_died" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Average Durat ion</span> <sort-toggle name="avg_duration" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Total Duration</span> <sort-toggle name="total_time" current="[ [_sort]]"> </sort-toggle> </th> <th>Percent of Total</th> </tr> </thead> <tbody> <template is="dom-repeat" items="[[_tasksToShow]]" as="task"> <tr> <td hidden$= "[[_truthy(_show_full_names)]]" title="[[task.full_name]]">[[task.name]]</td> <t d hidden$="[[_not(_show_full_names)]]" title="[[task.full_name]]">[[task.full_na me]]</td> <td>[[task.total]]</td> <td>[[task.success]]</td> <td>[[task.failed]]< /td> <td>[[task.bot_died]]</td> <td>[[_humanDuration(task.avg_duration)]]</td> < td>[[_humanDuration(task.total_time)]]</td> <td>[[task.total_time_percent]]%</td > </tr> </template> </tbody> <tbody><tr class="thick"> <td>Total</td> <td>[[_tot alStats.total]]</td> <td>[[_totalStats.success]]</td> <td>[[_totalStats.failed]] </td> <td>[[_totalStats.bot_died]]</td> <td>[[_humanDuration(_totalStats.avg_dur ation)]]</td> <td>[[_humanDuration(_totalStats.total_time)]]</td> <td>100.0%</td > </tr> </tbody></table> <div> <table> <thead> <tr> <th title="How much time pas sed between the oldest task fetched and now."> Total Wall Time </th> <th title=" How much of the wall time this bot was busy with a task."> Wall Time Utilization </th> </tr> </thead> <tbody> <tr> <td>[[_humanDuration(_totalStats.wall_time)]] </td> <td>[[_totalStats.wall_time_utilization]]%</td> </tr> </tbody> </table> <p aper-checkbox checked="{{_show_full_names}}"> Show Full Names </paper-checkbox> <paper-checkbox hidden$="[[_cannotExpand]]" checked="{{_show_all_tasks}}"> Show All Tasks </paper-checkbox> </div> </div> </template> <script>!function(){var t= 15;Polymer({is:"bot-page-summary",behaviors:[SwarmingBehaviors.BotPageBehavior], properties:{tasks:{type:Array},_cannotExpand:{type:Boolean,computed:"_countTasks (_taskStats.*)"},_show_all_tasks:{type:Boolean},_show_full_names:{type:Boolean}, _sortstr:{type:String},_sort:{type:Object,computed:"_makeSortObject(_sortstr)"}, _taskStats:{type:Array},_tasksToShow:{type:Array,computed:"_sortAndLimitTasks(_t askStats.*,_sort.*,_show_all_tasks)"},_totalStats:{type:Object}},observers:["_ag gregate(tasks.*)"],_aggregate:function(){if(this.tasks&&this.tasks.length){var t =new Date(1e3*sk.now()),a={},e={total:this.tasks.length,success:0,failed:0,bot_d ied:0,avg_duration:0,total_time:0,wall_time:(t-this.tasks[this.tasks.length-1].s tarted_ts)/1e3};this.tasks.forEach(function(t){var s=t.name.trim(),i=s.split("/" );5===i.length&&(s=i[0]+"/"+i[3]),a[s]||(a[s]={full_name:s,name:s,total:0,succes s:0,failed:0,bot_died:0,avg_duration:0,total_time:0}),a[s].total++,t.failure?(e. failed++,a[s].failed++):t.internal_failure?(e.bot_died++,a[s].bot_died++):(e.suc cess++,a[s].success++),e.total_time+=t.duration,a[s].total_time+=t.duration}),e. avg_duration=e.total_time/e.total,e.wall_time_utilization=(100*e.total_time/e.wa ll_time).toFixed(1),this.set("_totalStats",e);var s=Object.keys(a),i=[];s.forEac h(function(t){a[t].avg_duration=a[t].total_time/a[t].total,a[t].total_time_perce nt=(100*a[t].total_time/e.total_time).toFixed(1),i.push(a[t])});var o=new Substr ings({minOccurrence:Math.max(2,s.length-1),minLength:6});o.build(s);var n=o.weig hByAverage()||[];n.length&&n[0].source.forEach(function(t){var a=i[t].full_name; i[t].name=a.replace(n[0].name,"...")}),this.set("_taskStats",i)}},_compare:funct ion(t,a){if(!this._sort)return 0;var e=1;return"desc"===this._sort.direction&&(e =-1),e*swarming.naturalCompare(t[this._sort.name],a[this._sort.name])},_countTas ks:function(){return this._taskStats.length<=t},_makeSortObject:function(t){if(t ){var a=t.split(":");return 2!=a.length?{name:"full_name",direction:"asc"}:{name :a[0],direction:a[1]}}},_sortAndLimitTasks:function(){swarming.stableSort(this._ taskStats,this._compare.bind(this));var a=this._taskStats.length;return!this._sh ow_all_tasks&&this._taskStats.length>t&&(a=t),this._taskStats.slice(0,a)},_sortC hange:function(t){t&&t.detail&&t.detail.name&&(t.preventDefault(),t.stopPropagat ion(),this.set("_sortstr",t.detail.name+":"+t.detail.direction))}})}()</script> </dom-module><dom-module id="bot-page" assetpath="/res/imp/botpage/"> <template> <style include="iron-flex iron-flex-alignment iron-positioning swarming-app-sty le single-page-style task-style">.message{white-space:pre-line;font-family:monos pace}.bot_state{white-space:pre;font-family:monospace;margin-bottom:10px}.events _table,.tasks_table{border:3px solid #1F78B4}.old_version{background-color:#ffd} .stats{min-width:700px;flex-grow:2}#collapse{max-width:700px}.cloud{white-space: nowrap;margin-bottom:5px;margin-top:auto}paper-checkbox{--paper-checkbox-label-c olor:#fff;--paper-checkbox-checked-color:#fff;--paper-checkbox-checkmark-color:# 000;--paper-checkbox-unchecked-color:#fff;padding:3px}paper-dialog{border-radius :6px}</style> <url-param name="id" value="{{bot_id}}"> </url-param> <url-param n ame="show_all_events" value="{{_show_all}}"> </url-param> <url-param name="selec ted" value="{{_selected}}"> </url-param> <url-param name="show_state" value="{{_ show_state}}"> </url-param> <swarming-app client_id="[[client_id]]" auth_headers ="{{_auth_headers}}" permissions="{{_permissions}}" server_version="{{_server_ve rsion}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2,_busy3)]]" name="S warming Bot Page"> <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <bot-page-data id="data" auth _headers="[[_auth_headers]]" bot_id="[[bot_id]]" bot="{{_bot}}" busy="{{_busy1}} " events="{{_events}}" tasks="{{_tasks}}" on-reload="_clearAndReload"> </bot-pag e-data> <div class="header horizontal layout"> <paper-input class="id_input" lab el="Bot id" value="{{bot_id}}"></paper-input> <template is="dom-if" if="[[_ccLin k(_bot)]]"> <div class="vertical layout"> <a href$="[[_ccLink(_bot)]]" class="cl oud">Cloud Console</a> </div> </template> <button on-click="_refresh"> <iron-ico n class="refresh" icon="icons:refresh"></iron-icon> </button> </div> <div class= "horizontal wrap layout"> <div class="flex"> <table> <tbody><tr class$="[[_isDea d(_bot)]]" title="Last time the bot contacted the server."> <td>Last Seen</td> < td title="[[_bot.human_last_seen_ts]]"> [[_timeDiffExact(_bot.last_seen_ts)]] ag o</td> <td> <template is="dom-if" if="[[_canShutdown(_bot,_permissions)]]"> <but ton class="raised" on-click="_promptShutdown"> Shut Down Gracefully </button> </ template> <template is="dom-if" if="[[_canDelete(_bot,_permissions)]]"> <button class="raised" on-click="_promptDelete"> Delete </button> </template> </td> </tr > <template is="dom-if" if="[[_bot.quarantined]]"> <tr class="quarantined"> <td> Quarantined</td> <td colspan="2" class="message">[[_quarantineMessage(_bot)]]</t d> </tr> </template> <tr> <td>Current Task</td> <td> <a target="_blank" rel="noo pener" href$="[[_taskLink(_bot.task_id)]]"> [[_task(_bot)]] </a> </td> <td> </td > </tr> <tr> <td rowspan$="[[_numRows(_bot.dimensions)]]">Dimensions</td> </tr> <template is="dom-repeat" items="[[_bot.dimensions]]" as="dim"> <tr> <td>[[dim.k ey]]</td> <td>[[_concat(dim.value)]]</td> </tr> </template> <tr title="IP addres s that the server saw the connection from."> <td>External IP</td> <td><a href$=" [[_bot.external_ip]]">[[_bot.external_ip]]</a></td> <td></td> </tr> <tr class$=" [[_classVersion(_server_version.bot_version,_bot.version)]]" title="Version is b ased on the content of swarming_bot.zip which is the swarming bot code. The bot won't update if quarantined, dead, or busy."> <td>Bot Version</td> <td>[[_shorte n(_bot.version,'8')]]</td> <td></td> </tr> <tr title="The version the server exp ects the bot to be using."> <td>Expected Bot Version</td> <td>[[_shorten(_server _version.bot_version,'8')]]</td> <td></td> </tr> <tr title="First time ever a bo t with this id contacted the server."> <td>First seen</td> <td title="[[_bot.hum an_first_seen_ts]]"> [[_timeDiffApprox(_bot.first_seen_ts)]] ago </td> <td></td> </tr> <tr title="How the bot is authenticated by the server."> <td>Authenticate d as</td> <td colspan="2">[[_bot.authenticated_as]]</td> </tr> </tbody></table> <span class="title">State</span> <template is="dom-if" if="[[_not(_show_state)]] "> <button on-click="_toggleState"> <iron-icon icon="icons:add-circle-outline">< /iron-icon> </button> </template> <template is="dom-if" if="[[_show_state]]"> <b utton on-click="_toggleState"> <iron-icon icon="icons:remove-circle-outline"></i ron-icon> </button> </template> <iron-collapse id="collapse" opened="[[_show_sta te]]"> <div class="bot_state">[[_prettyPrint(_bot.state)]]</div> </iron-collapse > </div> <div class="stats flex"> <bot-page-summary tasks="[[_tasks]]"> </bot-pa ge-summary> </div> </div> <div class="tabs"> <paper-tabs selected="{{_selected}} " no-bar=""> <paper-tab>Tasks</paper-tab> <paper-tab>Events</paper-tab> </paper- tabs> <template is="dom-if" if="[[_showEvents]]"> <paper-checkbox checked="{{_sh ow_all}}"> Show all events </paper-checkbox> </template> </div> <template is="do m-if" if="[[_not(_showEvents)]]"> <table class="tasks_table"> <thead> <tr> <th>T ask</th> <th>Started</th> <th>Duration</th> <th>Result</th> </tr> </thead> <tbod y> <template is="dom-repeat" items="{{_tasks}}" as="task"> <tr class$="[[_taskCl ass(task)]]"> <td> <a target="_blank" rel="noopener" href$="[[_taskLink(task.tas k_id)]]"> [[task.name]] </a> </td> <td>[[task.human_started_ts]]</td> <td title= "[[task.human_completed_ts]]">[[task.human_duration]]</td> <td>[[task.state]]</t d> </tr> </template> </tbody> </table> </template> <template is="dom-if" if="[[_ showEvents]]"> <table class="events_table"> <thead> <tr> <th>Message</th> <th>Ty pe</th> <th>Timestamp</th> <th>Task ID</th> <th>Version</th> </tr> </thead> <tbo dy> <template is="dom-repeat" items="{{_eventList(_show_all,_events.*)}}" as="ev ent"> <tr> <td class="message">[[event.message]]</td> <td>[[event.event_type]]</ td> <td>[[event.human_ts]]</td> <td> <a target="_blank" rel="noopener" href$="[[ _taskLink(event.task_id)]]"> [[event.task_id]] </a> </td> <td class$="[[_classVe rsion(_server_version.bot_version,event.version)]]"> <a target="_blank" rel="noo pener" href$="[[_luciLink(event.version)]]"> [[_shorten(event.version,'8')]] </a > </td> </tr> </template> </tbody> </table> </template> <pageable-data id="page_ tasks" hidden$="[[_showEvents]]" busy="{{_busy2}}" label="Show more tasks" outpu t="{{_tasks}}" parse="[[_parseTasks]]"> </pageable-data> <pageable-data id="page _events" hidden$="[[_not(_showEvents)]]" busy="{{_busy3}}" label="Show more even ts" output="{{_events}}" parse="[[_parseEvents]]"> </pageable-data> </div> </swa rming-app> <paper-dialog id="prompt" modal="" on-iron-overlay-closed="_promptClo sed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</d iv> <div class="buttons"> <paper-button dialog-dismiss="" autofocus="">No</paper -button> <paper-button dialog-confirm="">Yes</paper-button> </div> </paper-dialo g> <error-toast></error-toast> </template> <script> (function(){ 620 })(); </script> </dom-module> <dom-module id="paper-button" assetpath="/res/im p/bower_components/paper-button/"> <template strip-whitespace=""> <style include ="paper-material-shared-styles">:host{@apply(--layout-inline);@apply(--layout-ce nter-center);position:relative;box-sizing:border-box;min-width:5.14em;margin:0 . 29em;background:0 0;-webkit-tap-highlight-color:transparent;-webkit-tap-highligh t-color:transparent;font:inherit;text-transform:uppercase;outline-width:0;border -radius:3px;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none; user-select:none;cursor:pointer;z-index:0;padding:.7em .57em;@apply(--paper-font -common-base);@apply(--paper-button)}:host([hidden]){display:none!important}:hos t([raised].keyboard-focus){font-weight:700;@apply(--paper-button-raised-keyboard -focus)}:host(:not([raised]).keyboard-focus){font-weight:700;@apply(--paper-butt on-flat-keyboard-focus)}:host([disabled]){background:#eaeaea;color:#a8a8a8;curso r:auto;pointer-events:none;@apply(--paper-button-disabled)}:host([animated]){@ap ply(--shadow-transition)}paper-ripple{color:var(--paper-button-ink-color)}</styl e> <content></content> </template> <script>Polymer({is:"paper-button",behaviors: [Polymer.PaperButtonBehavior],properties:{raised:{type:Boolean,reflectToAttribut e:!0,value:!1,observer:"_calculateElevation"}},_calculateElevation:function(){th is.raised?Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this):this._ setElevation(0)}})</script> </dom-module> <script>Polymer.NeonAnimatableBehavior ={properties:{animationConfig:{type:Object},entryAnimation:{observer:"_entryAnim ationChanged",type:String},exitAnimation:{observer:"_exitAnimationChanged",type: String}},_entryAnimationChanged:function(){this.animationConfig=this.animationCo nfig||{},this.animationConfig.entry=[{name:this.entryAnimation,node:this}]},_exi tAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this. animationConfig.exit=[{name:this.exitAnimation,node:this}]},_copyProperties:func tion(i,n){for(var t in n)i[t]=n[t]},_cloneConfig:function(i){var n={isClone:!0}; return this._copyProperties(n,i),n},_getAnimationConfigRecursive:function(i,n,t) {if(this.animationConfig){if(this.animationConfig.value&&"function"==typeof this .animationConfig.value)return void this._warn(this._logf("playAnimation","Please put 'animationConfig' inside of your components 'properties' object instead of outside of it."));var o;if(o=i?this.animationConfig[i]:this.animationConfig,Arra y.isArray(o)||(o=[o]),o)for(var e,a=0;e=o[a];a++)if(e.animatable)e.animatable._g etAnimationConfigRecursive(e.type||i,n,t);else if(e.id){var r=n[e.id];r?(r.isClo ne||(n[e.id]=this._cloneConfig(r),r=n[e.id]),this._copyProperties(r,e)):n[e.id]= e}else t.push(e)}},getAnimationConfig:function(i){var n={},t=[];this._getAnimati onConfigRecursive(i,n,t);for(var o in n)t.push(n[o]);return t}}</script> <script >Polymer.NeonAnimationRunnerBehaviorImpl={_configureAnimations:function(n){var i =[];if(n.length>0)for(var e,t=0;e=n[t];t++){var o=document.createElement(e.name) ;if(o.isNeonAnimation){var a=null;try{a=o.configure(e),"function"!=typeof a.canc el&&(a=document.timeline.play(a))}catch(n){a=null,console.warn("Couldnt play","( ",e.name,").",n)}a&&i.push({neonAnimation:o,config:e,animation:a})}else console. warn(this.is+":",e.name,"not found!")}return i},_shouldComplete:function(n){for( var i=!0,e=0;e<n.length;e++)if("finished"!=n[e].animation.playState){i=!1;break} return i},_complete:function(n){for(var i=0;i<n.length;i++)n[i].neonAnimation.co mplete(n[i].config);for(var i=0;i<n.length;i++)n[i].animation.cancel()},playAnim ation:function(n,i){var e=this.getAnimationConfig(n);if(e){this._active=this._ac tive||{},this._active[n]&&(this._complete(this._active[n]),delete this._active[n ]);var t=this._configureAnimations(e);if(0==t.length)return void this.fire("neon -animation-finish",i,{bubbles:!1});this._active[n]=t;for(var o=0;o<t.length;o++) t[o].animation.onfinish=function(){this._shouldComplete(t)&&(this._complete(t),d elete this._active[n],this.fire("neon-animation-finish",i,{bubbles:!1}))}.bind(t his)}},cancelAnimation:function(){for(var n in this._animations)this._animations [n].cancel();this._animations={}}},Polymer.NeonAnimationRunnerBehavior=[Polymer. NeonAnimatableBehavior,Polymer.NeonAnimationRunnerBehaviorImpl]</script> <script >Polymer.PaperDialogBehaviorImpl={hostAttributes:{role:"dialog",tabindex:"-1"},p roperties:{modal:{type:Boolean,value:!1}},observers:["_modalChanged(modal, _read ied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOu tsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancel OnEscKey,this.__prevWithBackdrop=this.withBackdrop},_modalChanged:function(i,e){ e&&(i?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prev NoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop ,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):( this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOu tsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEsc Key,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosi ngReasonConfirmed:function(i){this.closingReason=this.closingReason||{},this.clo singReason.confirmed=i},_onDialogClick:function(i){for(var e=Polymer.dom(i).path ,o=0;o<e.indexOf(this);o++){var t=e[o];if(t.hasAttribute&&(t.hasAttribute("dialo g-dismiss")||t.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirm ed(t.hasAttribute("dialog-confirm")),this.close(),i.stopPropagation();break}}}}, Polymer.PaperDialogBehavior=[Polymer.IronOverlayBehavior,Polymer.PaperDialogBeha viorImpl]</script> <dom-module id="paper-dialog-shared-styles" assetpath="/res/i mp/bower_components/paper-dialog-behavior/"> <template> <style>:host{display:blo ck;margin:24px 40px;background:var(--paper-dialog-background-color,--primary-bac kground-color);color:var(--paper-dialog-color,--primary-text-color);@apply(--pap er-font-body1);@apply(--shadow-elevation-16dp);@apply(--paper-dialog)}:host>::co ntent>*{margin-top:20px;padding:0 24px}:host>::content>.no-padding{padding:0}:ho st>::content>:first-child{margin-top:24px}:host>::content>:last-child{margin-bot tom:24px}:host>::content h2{position:relative;margin:0;@apply(--paper-font-title );@apply(--paper-dialog-title)}:host>::content .buttons{position:relative;paddin g:8px 8px 8px 24px;margin:0;color:var(--paper-dialog-button-color,--primary-colo r);@apply(--layout-horizontal);@apply(--layout-end-justified)}</style> </templat e> </dom-module> <dom-module id="paper-dialog" assetpath="/res/imp/bower_compone nts/paper-dialog/"> <template> <style include="paper-dialog-shared-styles"></sty le> <content></content> </template> </dom-module> <script>!function(){Polymer({i s:"paper-dialog",behaviors:[Polymer.PaperDialogBehavior,Polymer.NeonAnimationRun nerBehavior],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_rende rOpened:function(){this.cancelAnimation(),this.playAnimation("entry")},_renderCl osed:function(){this.cancelAnimation(),this.playAnimation("exit")},_onNeonAnimat ionFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderCl osed()}})}()</script> <script>window.SwarmingBehaviors=window.SwarmingBehaviors| |{},function(){SwarmingBehaviors.TaskBehavior={properties:{BOT_DIED:{type:String ,value:"BOT_DIED"},CANCELED:{type:String,value:"CANCELED"},COMPLETED:{type:Strin g,value:"COMPLETED"},COMPLETED_DEDUPED:{type:String,value:"COMPLETED (DEDUPED)"} ,COMPLETED_FAILURE:{type:String,value:"COMPLETED (FAILURE)"},COMPLETED_SUCCESS:{ type:String,value:"COMPLETED (SUCCESS)"},EXPIRED:{type:String,value:"EXPIRED"},P ENDING:{type:String,value:"PENDING"},RUNNING:{type:String,value:"RUNNING"},TIMED _OUT:{type:String,value:"TIMED_OUT"}},stateClass:function(E){return E===this.CAN CELED||E===this.TIMED_OUT||E===this.EXPIRED?"exception":E===this.BOT_DIED?"bot_d ied":E===this.COMPLETED_FAILURE?"failed_task":E===this.RUNNING||E===this.PENDING ?"pending_task":""}}}()</script> <dom-module id="task-style" assetpath="/res/imp /common/"> <template> <style>.failed_task{background-color:#fdd}.bot_died{backgr ound-color:#ccc}.exception{background-color:#edd2ff}.pending_task{background-col or:#fffc6c}</style> </template> </dom-module><dom-module id="task-filters" asset path="/res/imp/tasklist/"> <template> <style is="custom-style" include="iron-fle x iron-flex-alignment iron-positioning query-column-filter-style">.item.wide{max -width:400px}.selector.wide{min-width:275px}</style> <url-param name="f" value=" {{_filters}}" default_values="[]" multi=""> </url-param> <url-param name="c" val ue="{{columns}}" default_values="[&quot;name&quot;,&quot;state&quot;,&quot;creat ed_ts&quot;,&quot;user&quot;]" multi=""> </url-param> <url-param name="q" value= "{{_query}}" default_value=""> </url-param> <url-param name="l" default_value="5 0" value="{{_limit}}"> </url-param> <div class="container horizontal layout"> <d iv class="narrow-down-selector"> <div> <iron-a11y-keys target="[[_filter_input]] " keys="enter" on-keys-pressed="_manuallyAddFilter"></iron-a11y-keys> <paper-inp ut id="filter" label="Search columns and filters or supply a filter and press en ter" placeholder="gpu nvidia pool:Chrome" value="{{_query::input}}"> </paper-inp ut> </div> <div class="wide selector side-by-side" title="This shows all task ta gs and other interesting task properties. Mark the check box to add as a column. Select the row to see filter options."> <iron-selector attr-for-selected="label " selected="{{_primarySelected}}"> <template is="dom-repeat" items="[[_primaryIt ems]]" as="item"> <div class="selectable item horizontal layout" label="[[item]] "> <span>[[_beforeBold(item,_query)]]<span class="bold">[[_bold(item,_query)]]</ span>[[_afterBold(item,_query)]]</span> <span class="flex"></span> <paper-checkb ox noink="" disabled$="[[_cantToggleColumn(item)]]" checked="[[_columnState(item ,columns.*)]]" on-change="_toggleColumn"> </paper-checkbox> </div> </template> < /iron-selector> </div> <div class="selector side-by-side" title="These are all o ptions (if any) that the task list can be filtered on."> <template is="dom-repea t" id="secondaryList" items="[[_secondaryItems]]" as="item"> <div class="item ho rizontal layout" label="[[item]]"> <span>[[_beforeBold(item,_query)]]<span class ="bold">[[_bold(item,_query)]]</span>[[_afterBold(item,_query)]]</span> <span cl ass="flex"></span> <iron-icon class="icons" icon="icons:arrow-forward" hidden="[ [_cantAddFilter(_primarySelected,item,_filters.*)]]" on-tap="_addFilter"> </iron -icon> </div> </template> </div> <div class="selector side-by-side" title="These tag filters are AND'd together and applied to all tasks."> <template is="dom-re peat" items="[[_filters]]" as="fil"> <div class="item horizontal layout" label=" [[fil]]"> <span>[[fil]]</span> <span class="flex"></span> <iron-icon class="icon s" icon="icons:remove-circle-outline" hidden="[[_cantRemoveFilter(fil,_filters.* )]]" on-tap="_removeFilter"> </iron-icon> </div> </template> </div> <div class=" side-by-side"> <paper-input id="_limit" label="Limit Results" auto-validate="" m in="0" max="1000" pattern="[0-9]+" value="{{_limit}}"> </paper-input> </div> </d iv> </div> </template> <script>!function(){var t={state:function(t,i){var r=this ._attribute(t,"state")[0];if(i===r||"ALL"===i)return!0;if("PENDING_RUNNING"===i) return r===this.PENDING||r===this.RUNNING;var e=this._attribute(t,"failure",!1)[ 0];if("COMPLETED_SUCCESS"===i)return r===this.COMPLETED&&!e;if("COMPLETED_FAILUR E"===i)return r===this.COMPLETED&&e;var a=this._attribute(t,"try_number","-1")[0 ];return"DEDUPED"===i?r===this.COMPLETED&&"0"===a:void 0}};Polymer({is:"task-fil ters",behaviors:[SwarmingBehaviors.QueryColumnFilter,SwarmingBehaviors.TaskBehav ior],properties:{columns:{type:Array,notify:!0},query_params:{type:Object,comput ed:"_extractQueryParams(_filters.*, _limit)",notify:!0},_filterMap:{type:Object, value:function(){var i=this._commonFilters();for(var r in t)i[r]=t[r];return i}} },_cantToggleColumn:function(t){return!t||"name"===t},_extractQueryParams:functi on(){var t={},i=[];this._filters.forEach(function(r){var e=r.split(this.FILTER_S EP,1),a=e[0],s=r.substring(a.length+this.FILTER_SEP.length);"state"===a?t.state= [s]:("user"===a&&"none"===s&&(s=""),i.push(a+this.FILTER_SEP+swarming.alias.unap ply(s)))}.bind(this)),t.tags=i;var r=parseInt(this._limit);return Number.isInteg er(r)&&(r=Math.max(r,1),r=Math.min(1e3,r),t.limit=[r],this._limit!=r&&this.set(" _limit",r)),t}})}()</script> </dom-module><dom-module id="task-list-data" assetp ath="/res/imp/tasklist/"> <script>!function(){var t=["abandoned_ts","completed_t s","created_ts","modified_ts","started_ts"];Polymer({is:"task-list-data",behavio rs:[SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties: {auth_headers:{type:Object,observer:"signIn"},query_params:{type:Object},tasks:{ type:Array},busy:{type:Boolean,computed:"_or(_busy2,_busy1)",notify:!0},primary_ map:{type:Object,computed:"_primaryMap(_tags,_dimensions,tasks.*)",notify:!0},pr imary_arr:{type:Array,computed:"_primaryArr(primary_map)",notify:!0},_busy2:{typ e:Boolean,value:!1},_busy1:{type:Boolean,value:!1},_dimensions:{type:Object},_li st:{type:Object},_tags:{type:Object}},signIn:function(){this._getJsonAsync("_tag s","/_ah/api/swarming/v1/tasks/tags","_busy2",this.auth_headers),this._getJsonAs ync("_dimensions","/_ah/api/swarming/v1/bots/dimensions","_busy1",this.auth_head ers)},_primaryArr:function(t){var a=Object.keys(t);return a.sort(),a},_primaryMa p:function(a,s){a=a&&a.tasks_tags||[],s=s&&s.bots_dimensions||[],tasks=this.task s||[];var e={};a.forEach(function(t){e[t.key]||(e[t.key]={});var a=t.value||[];a .forEach(function(a){e[t.key][a]=!0})}),s.forEach(function(t){var a=t.value;e[t. key]||(e[t.key]={}),a.forEach(function(a){e[t.key][a]=!0})}),tasks.forEach(funct ion(t){Object.keys(t.tagMap).forEach(function(a){var s=t.tagMap[a];e[a]||(e[a]={ }),e[a][s]=!0})}),delete e.user[""],e.user.none=!0;var r={};for(key in e){var i= Object.keys(e[key]);if(swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(key)===-1) r[key]=i;else{var n=[];i.forEach(function(t){n.push(swarming.alias.apply(t,key)) }),r[key]=n}}return r.name=[],r.state=[this.PENDING,this.RUNNING,"PENDING_RUNNIN G",this.COMPLETED,"COMPLETED_SUCCESS","COMPLETED_FAILURE",this.EXPIRED,this.TIME D_OUT,this.BOT_DIED,this.CANCELED,"DEDUPED","ALL"],r.costs_usd=[],r.deduped_from =[],r.duration=[],r.server_versions=[],r.bot=[],t.forEach(function(t){r[t]=[]}), r},parseTasks:function(a){if(console.log("ping",a),!a||!a.items)return[];var s=n ew Date;return a.items.forEach(function(a){var e={};a.tags=a.tags||[],a.tags.for Each(function(t){var a=t.split(":",1),s=a[0],r=t.substring(s.length+1);e[s]=r}), a.tagMap=e,t.forEach(function(t){a[t]&&(a[t]=new Date(a[t]),a["human_"+t]=sk.hum an.localeTime(a[t]))}),!a.duration&&a.state===this.RUNNING&&a.started_ts&&(a.dur ation=(s-a.started_ts)/1e3),a.duration&&(a.human_duration=this._humanDuration(a. duration))}.bind(this)),a.items}})}()</script> </dom-module> <dom-module id="tas k-list" assetpath="/res/imp/tasklist/"> <template> <style include="iron-flex iro n-flex-alignment iron-positioning swarming-app-style dynamic-table-style task-st yle">task-filters{margin-bottom:8px;margin-right:10px}.task-list th>span{padding -right:30px}</style> <url-param name="s" value="{{_sortstr}}" default_value="cre ated_ts:desc"> </url-param> <swarming-app client_id="[[client_id]]" auth_headers ="{{_auth_headers}}" permissions="{{_permissions}}" signed_in="{{_signed_in}}" b usy="[[_or(_busy1,_busy2)]]" name="Swarming Task List"> <h2 hidden$="[[_signed_i n]]">You must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_ in)]]"> <task-list-data id="data" auth_headers="[[_auth_headers]]" query_params= "[[_query_params]]" tasks="[[_items]]" busy="{{_busy1)}}" primary_map="{{_primar y_map}}" primary_arr="{{_primary_arr}}"> </task-list-data> <div class="horizonta l layout"> <task-filters primary_map="[[_primary_map]]" primary_arr="[[_primary_ arr]]" columns="{{_columns}}" query_params="{{_query_params}}" filter="{{_filter }}"> </task-filters> </div> <table class="task-list"> <thead on-sort_change="_so rtChange"> <tr> <th> <span>Task Name</span> <sort-toggle name="name" current="[[ _sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('state', _columns.*)]]"> <sp an>State</span> <sort-toggle name="state" current="[[_sort]]"> </sort-toggle> </ th> <th hidden$="[[_hide('bot', _columns.*)]]"> <span>Bot Assigned</span> <sort- toggle name="bot" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide ('deduped_from', _columns.*)]]"> <span>Deduped from</span> <sort-toggle name="de duped_from" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('sk_r evision', _columns.*)]]"> <span>Skia Revision</span> <sort-toggle name="sk_revis ion" current="[[_sort]]"> </sort-toggle> </th> <template is="dom-repeat" items=" [[_plainColumns]]" as="c"> <th hidden$="[[_hide(c)]]"> <span>[[_header(c)]]</spa n> <sort-toggle name="[[c]]" current="[[_sort]]"> </sort-toggle> </th> </templat e> </tr> </thead> <tbody> <template id="tasks_table" is="dom-repeat" items="[[_f ilteredSortedItems]]" as="task" initial-count="50"> <tr class$="[[_taskClass(tas k)]]"> <td> <a class="center" href$="[[_taskLink(task.task_id)]]" target="_blank "> [[task.name]] </a> </td> <td hidden$="[[_hide('state', _columns.*)]]"> [[_col umn('state', task)]] <paper-button raised="" hidden$="[[_cannotCancel(task,_perm issions)]]" on-tap="_promptCancel"> Cancel </paper-button> </td> <td hidden$="[[ _hide('bot', _columns.*)]]"> <a class="center" href$="[[_botLink(task.bot_id)]]" target="_blank"> [[_column('bot',task)]] </a> </td> <td hidden$="[[_hide('dedup ed_from', _columns.*)]]"> <a class="center" href$="[[_taskLink(task.deduped_from )]]" target="_blank"> [[_column('deduped_from',task)]] </a> </td> <td hidden$="[ [_hide('sk_revision', _columns.*)]]"> <a class="center" href$="[[_skLink(task)]] " target="_blank"> [[_column('sk_revision',task)]] </a> </td> <template is="dom- repeat" items="[[_plainColumns]]" as="c"> <td hidden$="[[_hide(c)]]"> [[_column( c, task)]] </td> </template> </tr> </template> </tbody> </table> <pageable-data id="page_tasks" busy="{{_busy2}}" label="Show more tasks" output="{{_items}}" pa rse="[[_parseTasks]]"> </pageable-data> </div> </swarming-app> <paper-dialog id= "prompt" modal="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <p aper-button dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialo g-confirm="">Yes</paper-button> </div> </paper-dialog> <error-toast></error-toas t> </template> <script>!function(){function t(t){return function(e){return this. _attribute(e,"human_"+t)[0]}}function e(t){return function(e,a,s){var i=this._at tribute(a,t,"0")[0],r=this._attribute(s,t,"0")[0];return e*(i-r)}}var a=["dedupe d_from","name","state","bot"],s={abandoned_ts:t("abandoned_ts"),bot:function(t){ return this._attribute(t,"bot_id")[0]},completed_ts:t("completed_ts"),costs_usd: function(t){return this._attribute(t,"costs_usd",0)[0]},created_ts:t("created_ts "),duration:t("duration"),modified_ts:t("modified_ts"),sk_revision:function(t){v ar e=this._attribute(t,"sk_revision")[0];return e.substring(0,8)},started_ts:t(" started_ts"),state:function(t){var e=this._attribute(t,"state")[0];if("COMPLETED "===e){if(this._attribute(t,"failure",!1)[0])return"COMPLETED (FAILURE)";var a=t his._attribute(t,"try_number","-1")[0];return"0"===a?"COMPLETED (DEDUPED)":"COMP LETED (SUCCESS)"}return e}},i={user:"Requesting User"},r={abandoned_ts:e("abando ned_ts"),completed_ts:e("completed_ts"),created_ts:e("created_ts"),duration:e("d uration"),modified_ts:e("modified_ts"),started_ts:e("started_ts")};Polymer({is:" task-list",behaviors:[SwarmingBehaviors.DynamicTableBehavior,SwarmingBehaviors.T askBehavior],properties:{client_id:{type:String},_busy1:{type:Boolean,value:!1}, _busy2:{type:Boolean,value:!1},_parseTasks:{type:Function,value:function(){retur n this.$.data.parseTasks.bind(this)}},_toCancel:{type:String},_columnMap:{type:O bject,value:function(){var t=this._commonColumns();for(var e in s)t[e]=s[e];retu rn t}},_headerMap:{type:Object,value:i},_specialColumns:{type:Array,value:a},_sp ecialSort:{type:Object,value:r}},observers:["reload(_query_params,_auth_headers) "],_attribute:function(t,e,a){void 0===a&&(a="none");var s=this._tag(t,e)||t[e]| |[a];return Array.isArray(s)?s:[s]},_cannotCancel:function(t,e){return!(e&&e.can cel_task&&"PENDING"===this._column("state",t))},_cancelTask:function(){var t="/_ ah/api/swarming/v1/task/"+this._toCancel+"/cancel";swarming.postWithToast(t,"Can celing task "+this._toCancel,this._auth_headers),this.set("_toCancel","")},_prom ptClosed:function(t){t.detail.confirmed&&this._cancelTask()},_promptCancel:funct ion(t){var e=t.model.task;return e&&e.task_id?(this.set("_toCancel",e.task_id),t his.set("_dialogPrompt",'cancel task "'+e.name+'"'),void this.$.prompt.open()):v oid console.log("Missing task info",e)},reload:function(){if(this._auth_headers& &this._query_params){var t="/_ah/api/swarming/v1/tasks/list?"+sk.query.fromParam Set(this._query_params);this.$.page_tasks.load(t,this._auth_headers)}},_skLink:f unction(t){var e=this._attribute(t,"sk_revision")[0];return"none"!==e&&"https:// skia.googlesource.com/skia/+/"+e},_tag:function(t,e){if(t&&t.tagMap)return t.tag Map[e]},_taskClass:function(t){return this.stateClass(this._column("state",t))}} )}()</script> </dom-module> <dom-module id="iron-collapse" assetpath="/res/imp/b ower_components/iron-collapse/"> <template> <style>:host{display:block;transitio n-duration:var(--iron-collapse-transition-duration,300ms);overflow:visible}:host (.iron-collapse-closed){display:none}:host(:not(.iron-collapse-opened)){overflow :hidden}</style> <content></content> </template> </dom-module> <script>Polymer({ is:"iron-collapse",behaviors:[Polymer.IronResizableBehavior],properties:{horizon tal:{type:Boolean,value:!1,observer:"_horizontalChanged"},opened:{type:Boolean,v alue:!1,notify:!0,observer:"_openedChanged"},noAnimation:{type:Boolean},_desired Size:{type:String,value:""}},get dimension(){return this.horizontal?"width":"hei ght"},get _dimensionMax(){return this.horizontal?"maxWidth":"maxHeight"},get _di mensionMaxCss(){return this.horizontal?"max-width":"max-height"},hostAttributes: {role:"group","aria-hidden":"true","aria-expanded":"false"},listeners:{transitio nend:"_transitionEnd"},attached:function(){this._transitionEnd()},toggle:functio n(){this.opened=!this.opened},show:function(){this.opened=!0},hide:function(){th is.opened=!1},updateSize:function(i,t){if(i="auto"===i?"":i,this._desiredSize!== i){this._desiredSize=i,this._updateTransition(!1);var e=t&&!this.noAnimation&&th is._isDisplayed;if(e){var n=this._calcSize();""===i&&(this.style[this._dimension Max]="",i=this._calcSize()),this.style[this._dimensionMax]=n,this.scrollTop=this .scrollTop,this._updateTransition(!0),e=i!==n}this.style[this._dimensionMax]=i,e ||this._transitionEnd()}},enableTransition:function(i){Polymer.Base._warn("`enab leTransition()` is deprecated, use `noAnimation` instead."),this.noAnimation=!i} ,_updateTransition:function(i){this.style.transitionDuration=i&&!this.noAnimatio n?"":"0s"},_horizontalChanged:function(){this.style.transitionProperty=this._dim ensionMaxCss;var i="maxWidth"===this._dimensionMax?"maxHeight":"maxWidth";this.s tyle[i]="",this.updateSize(this.opened?"auto":"0px",!1)},_openedChanged:function (){this.setAttribute("aria-expanded",this.opened),this.setAttribute("aria-hidden ",!this.opened),this.toggleClass("iron-collapse-closed",!1),this.toggleClass("ir on-collapse-opened",!1),this.updateSize(this.opened?"auto":"0px",!0),this.opened &&this.focus()},_transitionEnd:function(){this.style[this._dimensionMax]=this._d esiredSize,this.toggleClass("iron-collapse-closed",!this.opened),this.toggleClas s("iron-collapse-opened",this.opened),this._updateTransition(!1),this.notifyResi ze()},get _isDisplayed(){var i=this.getBoundingClientRect();for(var t in i)if(0! ==i[t])return!0;return!1},_calcSize:function(){return this.getBoundingClientRect ()[this.dimension]+"px"}})</script> <script>Polymer.IronMenuBehaviorImpl={proper ties:{focusedItem:{observer:"_focusedItemChanged",readOnly:!0,type:Object},attrF orItemTitle:{type:String}},hostAttributes:{role:"menu",tabindex:"0"},observers:[ "_updateMultiselectable(multi)"],listeners:{focus:"_onFocus",keydown:"_onKeydown ","iron-items-changed":"_onIronItemsChanged"},keyBindings:{up:"_onUpKey",down:"_ onDownKey",esc:"_onEscKey","shift+tab:keydown":"_onShiftTabDown"},attached:funct ion(){this._resetTabindices()},select:function(e){this._defaultFocusAsync&&(this .cancelAsync(this._defaultFocusAsync),this._defaultFocusAsync=null);var t=this._ valueToItem(e);t&&t.hasAttribute("disabled")||(this._setFocusedItem(t),Polymer.I ronMultiSelectableBehaviorImpl.select.apply(this,arguments))},_resetTabindices:f unction(){var e=this.multi?this.selectedItems&&this.selectedItems[0]:this.select edItem;this.items.forEach(function(t){t.setAttribute("tabindex",t===e?"0":"-1")} ,this)},_updateMultiselectable:function(e){e?this.setAttribute("aria-multiselect able","true"):this.removeAttribute("aria-multiselectable")},_focusWithKeyboardEv ent:function(e){for(var t,i=0;t=this.items[i];i++){var s=this.attrForItemTitle|| "textContent",o=t[s]||t.getAttribute(s);if(!t.hasAttribute("disabled")&&o&&o.tri m().charAt(0).toLowerCase()===String.fromCharCode(e.keyCode).toLowerCase()){this ._setFocusedItem(t);break}}},_focusPrevious:function(){for(var e=this.items.leng th,t=Number(this.indexOf(this.focusedItem)),i=1;i<e+1;i++){var s=this.items[(t-i +e)%e];if(!s.hasAttribute("disabled")){var o=Polymer.dom(s).getOwnerRoot()||docu ment;if(this._setFocusedItem(s),Polymer.dom(o).activeElement==s)return}}},_focus Next:function(){for(var e=this.items.length,t=Number(this.indexOf(this.focusedIt em)),i=1;i<e+1;i++){var s=this.items[(t+i)%e];if(!s.hasAttribute("disabled")){va r o=Polymer.dom(s).getOwnerRoot()||document;if(this._setFocusedItem(s),Polymer.d om(o).activeElement==s)return}}},_applySelection:function(e,t){t?e.setAttribute( "aria-selected","true"):e.removeAttribute("aria-selected"),Polymer.IronSelectabl eBehavior._applySelection.apply(this,arguments)},_focusedItemChanged:function(e, t){t&&t.setAttribute("tabindex","-1"),e&&(e.setAttribute("tabindex","0"),e.focus ())},_onIronItemsChanged:function(e){e.detail.addedNodes.length&&this._resetTabi ndices()},_onShiftTabDown:function(e){var t=this.getAttribute("tabindex");Polyme r.IronMenuBehaviorImpl._shiftTabPressed=!0,this._setFocusedItem(null),this.setAt tribute("tabindex","-1"),this.async(function(){this.setAttribute("tabindex",t),P olymer.IronMenuBehaviorImpl._shiftTabPressed=!1},1)},_onFocus:function(e){if(!Po lymer.IronMenuBehaviorImpl._shiftTabPressed){var t=Polymer.dom(e).rootTarget;(t= ==this||"undefined"==typeof t.tabIndex||this.isLightDescendant(t))&&(this._defau ltFocusAsync=this.async(function(){var e=this.multi?this.selectedItems&&this.sel ectedItems[0]:this.selectedItem;this._setFocusedItem(null),e?this._setFocusedIte m(e):this.items[0]&&this._focusNext()}))}},_onUpKey:function(e){this._focusPrevi ous(),e.detail.keyboardEvent.preventDefault()},_onDownKey:function(e){this._focu sNext(),e.detail.keyboardEvent.preventDefault()},_onEscKey:function(e){this.focu sedItem.blur()},_onKeydown:function(e){this.keyboardEventMatchesKeys(e,"up down esc")||this._focusWithKeyboardEvent(e),e.stopPropagation()},_activateHandler:fun ction(e){Polymer.IronSelectableBehavior._activateHandler.call(this,e),e.stopProp agation()}},Polymer.IronMenuBehaviorImpl._shiftTabPressed=!1,Polymer.IronMenuBeh avior=[Polymer.IronMultiSelectableBehavior,Polymer.IronA11yKeysBehavior,Polymer. IronMenuBehaviorImpl]</script> <script>Polymer.IronMenubarBehaviorImpl={hostAttr ibutes:{role:"menubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onU pKey:function(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault( )},_onDownKey:function(e){this.focusedItem.click(),e.detail.keyboardEvent.preven tDefault()},get _isRTL(){return"rtl"===window.getComputedStyle(this).direction}, _onLeftKey:function(e){this._isRTL?this._focusNext():this._focusPrevious(),e.det ail.keyboardEvent.preventDefault()},_onRightKey:function(e){this._isRTL?this._fo cusPrevious():this._focusNext(),e.detail.keyboardEvent.preventDefault()},_onKeyd own:function(e){this.keyboardEventMatchesKeys(e,"up down left right esc")||this. _focusWithKeyboardEvent(e)}},Polymer.IronMenubarBehavior=[Polymer.IronMenuBehavi or,Polymer.IronMenubarBehaviorImpl]</script> <iron-iconset-svg name="paper-tabs" size="24"> <svg><defs> <g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path></g> <g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g> </defs></svg> </iron-iconset-svg> <d om-module id="paper-tab" assetpath="/res/imp/bower_components/paper-tabs/"> <tem plate> <style>:host{@apply(--layout-inline);@apply(--layout-center);@apply(--lay out-center-justified);@apply(--layout-flex-auto);position:relative;padding:0 12p x;overflow:hidden;cursor:pointer;vertical-align:middle;@apply(--paper-font-commo n-base);@apply(--paper-tab)}:host(:focus){outline:0}:host([link]){padding:0}.tab -content{height:100%;transform:translateZ(0);-webkit-transform:translateZ(0);tra nsition:opacity .1s cubic-bezier(.4,0,1,1);@apply(--layout-horizontal);@apply(-- layout-center-center);@apply(--layout-flex-auto);@apply(--paper-tab-content)}:ho st(:not(.iron-selected))>.tab-content{opacity:.8;@apply(--paper-tab-content-unse lected)}:host(:focus) .tab-content{opacity:1;font-weight:700}paper-ripple{color: var(--paper-tab-ink,--paper-yellow-a100)}.tab-content>::content>a{@apply(--layou t-flex-auto);height:100%}</style> <div class="tab-content"> <content></content> </div> </template> <script>Polymer({is:"paper-tab",behaviors:[Polymer.IronContro lState,Polymer.IronButtonState,Polymer.PaperRippleBehavior],properties:{link:{ty pe:Boolean,value:!1,reflectToAttribute:!0}},hostAttributes:{role:"tab"},listener s:{down:"_updateNoink",tap:"_onTap"},attached:function(){this._updateNoink()},ge t _parentNoink(){var t=Polymer.dom(this).parentNode;return!!t&&!!t.noink},_updat eNoink:function(){this.noink=!!this.noink||!!this._parentNoink},_onTap:function( t){if(this.link){var e=this.queryEffectiveChildren("a");if(!e)return;if(t.target ===e)return;e.click()}}})</script> </dom-module> <dom-module id="paper-tabs" ass etpath="/res/imp/bower_components/paper-tabs/"> <template> <style>:host{@apply(- -layout);@apply(--layout-center);height:48px;font-size:14px;font-weight:500;over flow:hidden;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none; user-select:none;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-c olor:transparent;@apply(--paper-tabs)}:host-context([dir=rtl]){@apply(--layout-h orizontal-reverse)}#tabsContainer{position:relative;height:100%;white-space:nowr ap;overflow:hidden;@apply(--layout-flex-auto)}#tabsContent{height:100%;-moz-flex -basis:auto;-ms-flex-basis:auto;flex-basis:auto}#tabsContent.scrollable{position :absolute;white-space:nowrap}#tabsContent.scrollable.fit-container,#tabsContent: not(.scrollable){@apply(--layout-horizontal)}#tabsContent.scrollable.fit-contain er{min-width:100%}#tabsContent.scrollable.fit-container>::content>*{-ms-flex:1 0 auto;-webkit-flex:1 0 auto;flex:1 0 auto}.hidden{display:none}.not-visible{opac ity:0;cursor:default}paper-icon-button{width:48px;height:48px;padding:12px;margi n:0 4px}#selectionBar{position:absolute;height:2px;bottom:0;left:0;right:0;backg round-color:var(--paper-tabs-selection-bar-color,--paper-yellow-a100);-webkit-tr ansform:scale(0);transform:scale(0);-webkit-transform-origin:left center;transfo rm-origin:left center;transition:-webkit-transform;transition:transform;@apply(- -paper-tabs-selection-bar)}#selectionBar.align-bottom{top:0;bottom:auto}#selecti onBar.expand{transition-duration:.15s;transition-timing-function:cubic-bezier(.4 ,0,1,1)}#selectionBar.contract{transition-duration:.18s;transition-timing-functi on:cubic-bezier(0,0,.2,1)}#tabsContent>::content>:not(#selectionBar){height:100% }</style> <paper-icon-button icon="paper-tabs:chevron-left" class$="[[_computeSc rollButtonClass(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollB uttonUp" on-down="_onLeftScrollButtonDown" tabindex="-1"></paper-icon-button> <d iv id="tabsContainer" on-track="_scroll" on-down="_down"> <div id="tabsContent" class$="[[_computeTabsContentClass(scrollable, fitContainer)]]"> <div id="select ionBar" class$="[[_computeSelectionBarClass(noBar, alignBottom)]]" on-transition end="_onBarTransitionEnd"></div> <content select="*"></content> </div> </div> <p aper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonC lass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" o n-down="_onRightScrollButtonDown" tabindex="-1"></paper-icon-button> </template> <script>Polymer({is:"paper-tabs",behaviors:[Polymer.IronResizableBehavior,Polym er.IronMenubarBehavior],properties:{noink:{type:Boolean,value:!1,observer:"_noin kChanged"},noBar:{type:Boolean,value:!1},noSlide:{type:Boolean,value:!1},scrolla ble:{type:Boolean,value:!1},fitContainer:{type:Boolean,value:!1},disableDrag:{ty pe:Boolean,value:!1},hideScrollButtons:{type:Boolean,value:!1},alignBottom:{type :Boolean,value:!1},selectable:{type:String,value:"paper-tab"},autoselect:{type:B oolean,value:!1},autoselectDelay:{type:Number,value:0},_step:{type:Number,value: 10},_holdDelay:{type:Number,value:1},_leftHidden:{type:Boolean,value:!1},_rightH idden:{type:Boolean,value:!1},_previousTab:{type:Object}},hostAttributes:{role:" tablist"},listeners:{"iron-resize":"_onTabSizingChanged","iron-items-changed":"_ onTabSizingChanged","iron-select":"_onIronSelect","iron-deselect":"_onIronDesele ct"},keyBindings:{"left:keyup right:keyup":"_onArrowKeyup"},created:function(){t his._holdJob=null,this._pendingActivationItem=void 0,this._pendingActivationTime out=void 0,this._bindDelayedActivationHandler=this._delayedActivationHandler.bin d(this),this.addEventListener("blur",this._onBlurCapture.bind(this),!0)},ready:f unction(){this.setScrollDirection("y",this.$.tabsContainer)},detached:function() {this._cancelPendingActivation()},_noinkChanged:function(t){var e=Polymer.dom(th is).querySelectorAll("paper-tab");e.forEach(t?this._setNoinkAttribute:this._remo veNoinkAttribute)},_setNoinkAttribute:function(t){t.setAttribute("noink","")},_r emoveNoinkAttribute:function(t){t.removeAttribute("noink")},_computeScrollButton Class:function(t,e,i){return!e||i?"hidden":t?"not-visible":""},_computeTabsConte ntClass:function(t,e){return t?"scrollable"+(e?" fit-container":""):" fit-contai ner"},_computeSelectionBarClass:function(t,e){return t?"hidden":e?"align-bottom" :""},_onTabSizingChanged:function(){this.debounce("_onTabSizingChanged",function (){this._scroll(),this._tabChanged(this.selectedItem)},10)},_onIronSelect:functi on(t){this._tabChanged(t.detail.item,this._previousTab),this._previousTab=t.deta il.item,this.cancelDebouncer("tab-changed")},_onIronDeselect:function(t){this.de bounce("tab-changed",function(){this._tabChanged(null,this._previousTab),this._p reviousTab=null},1)},_activateHandler:function(){this._cancelPendingActivation() ,Polymer.IronMenuBehaviorImpl._activateHandler.apply(this,arguments)},_scheduleA ctivation:function(t,e){this._pendingActivationItem=t,this._pendingActivationTim eout=this.async(this._bindDelayedActivationHandler,e)},_delayedActivationHandler :function(){var t=this._pendingActivationItem;this._pendingActivationItem=void 0 ,this._pendingActivationTimeout=void 0,t.fire(this.activateEvent,null,{bubbles:! 0,cancelable:!0})},_cancelPendingActivation:function(){void 0!==this._pendingAct ivationTimeout&&(this.cancelAsync(this._pendingActivationTimeout),this._pendingA ctivationItem=void 0,this._pendingActivationTimeout=void 0)},_onArrowKeyup:funct ion(t){this.autoselect&&this._scheduleActivation(this.focusedItem,this.autoselec tDelay)},_onBlurCapture:function(t){t.target===this._pendingActivationItem&&this ._cancelPendingActivation()},get _tabContainerScrollSize(){return Math.max(0,thi s.$.tabsContainer.scrollWidth-this.$.tabsContainer.offsetWidth)},_scroll:functio n(t,e){if(this.scrollable){var i=e&&-e.ddx||0;this._affectScroll(i)}},_down:func tion(t){this.async(function(){this._defaultFocusAsync&&(this.cancelAsync(this._d efaultFocusAsync),this._defaultFocusAsync=null)},1)},_affectScroll:function(t){t his.$.tabsContainer.scrollLeft+=t;var e=this.$.tabsContainer.scrollLeft;this._le ftHidden=0===e,this._rightHidden=e===this._tabContainerScrollSize},_onLeftScroll ButtonDown:function(){this._scrollToLeft(),this._holdJob=setInterval(this._scrol lToLeft.bind(this),this._holdDelay)},_onRightScrollButtonDown:function(){this._s crollToRight(),this._holdJob=setInterval(this._scrollToRight.bind(this),this._ho ldDelay)},_onScrollButtonUp:function(){clearInterval(this._holdJob),this._holdJo b=null},_scrollToLeft:function(){this._affectScroll(-this._step)},_scrollToRight :function(){this._affectScroll(this._step)},_tabChanged:function(t,e){if(!t)retu rn this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList. remove("contract"),void this._positionBar(0,0);var i=this.$.tabsContent.getBound ingClientRect(),n=i.width,o=t.getBoundingClientRect(),s=o.left-i.left;if(this._p os={width:this._calcPercent(o.width,n),left:this._calcPercent(s,n)},this.noSlide ||null==e)return this.$.selectionBar.classList.remove("expand"),this.$.selection Bar.classList.remove("contract"),void this._positionBar(this._pos.width,this._po s.left);var a=e.getBoundingClientRect(),l=this.items.indexOf(e),c=this.items.ind exOf(t),r=5;this.$.selectionBar.classList.add("expand");var h=l<c,d=this._isRTL; d&&(h=!h),h?this._positionBar(this._calcPercent(o.left+o.width-a.left,n)-r,this. _left):this._positionBar(this._calcPercent(a.left+a.width-o.left,n)-r,this._calc Percent(s,n)+r),this.scrollable&&this._scrollToSelectedIfNeeded(o.width,s)},_scr ollToSelectedIfNeeded:function(t,e){var i=e-this.$.tabsContainer.scrollLeft;i<0? this.$.tabsContainer.scrollLeft+=i:(i+=t-this.$.tabsContainer.offsetWidth,i>0&&( this.$.tabsContainer.scrollLeft+=i))},_calcPercent:function(t,e){return 100*t/e} ,_positionBar:function(t,e){t=t||0,e=e||0,this._width=t,this._left=e,this.transf orm("translateX("+e+"%) scaleX("+t/100+")",this.$.selectionBar)},_onBarTransitio nEnd:function(t){var e=this.$.selectionBar.classList;e.contains("expand")?(e.rem ove("expand"),e.add("contract"),this._positionBar(this._pos.width,this._pos.left )):e.contains("contract")&&e.remove("contract")}})</script> </dom-module> <dom-m odule id="single-page-style" assetpath="/res/imp/common/"> <template> <style>.he ader{max-width:450px}.title{font-size:1.5em;font-weight:700;margin:5px}.id_input {margin-left:5px;--paper-input-container-input:{font-size:2em};}.refresh{max-wid th:40px;max-height:40px;width:initial;height:initial}button{min-width:4em;max-he ight:55px}table{border-collapse:collapse;margin-left:5px;margin-bottom:8px}td,th {border:1px solid #BBB;padding:5px}.tabs{background-color:#1F78B4;color:#fff;max -width:600px;margin-left:5px;--paper-checkbox-label-color:#fff}paper-tab{backgro und-color:#A6CEE3;color:#000}paper-tab.iron-selected{background-color:#1F78B4;co lor:#fff;font-weight:700;text-decoration:underline}paper-tab[disabled]{backgroun d-color:#AAA;text-decoration:line-through}.quarantined{background-color:#fdd}.de ad{background-color:#ccc}</style> </template> </dom-module><script>!function(){S warmingBehaviors.BotPageBehavior=[SwarmingBehaviors.CommonBehavior,{}]}()</scrip t> <dom-module id="bot-page-data" assetpath="/res/imp/botpage/"> <script>!functi on(){function t(t){if(!s){var e=t.toString();s=e.substring(e.indexOf("("))}retur n t.toLocaleString()+" "+s}var e,s,n=400,i=["first_seen_ts","last_seen_ts","leas e_expiration_ts"],a=["started_ts","completed_ts","abandoned_ts","modified_ts"];P olymer({is:"bot-page-data",behaviors:[SwarmingBehaviors.BotPageBehavior],propert ies:{auth_headers:{type:Object},bot_id:{type:String},busy:{type:Boolean,computed :"_or(_busy1)",notify:!0},bot:{type:Object,computed:"_parseBot(_bot)",notify:!0} ,_busy1:{type:Boolean,value:!1},_bot:{type:Object},_events:{type:Object},_tasks: {type:Object}},observers:["request(auth_headers,bot_id)"],request:function(){thi s.bot_id&&this.auth_headers&&(e&&this.cancelAsync(e),e=this.async(function(){e=v oid 0;var t="/_ah/api/swarming/v1/bot/"+this.bot_id;this._getJsonAsync("_bot",t+ "/get","_busy1",this.auth_headers),this.fire("reload",{id:this.bot_id})},n))},_p arseBot:function(e){if(!e)return{};e.state=e.state||"{}",e.state=JSON.parse(e.st ate);var s=e.state.disks||{},n=Object.keys(s);if(n.length){e.disks=[];for(var a= 0;a<n.length;a++)e.disks.push({id:n[a],mb:s[n[a]].free_mb});e.disks.sort(functio n(t,e){return e.mb-t.mb})}else e.disks=[{id:"unknown",mb:0}];return e.dimensions =e.dimensions||[],e.dimensions.forEach(function(t){swarming.alias.DIMENSIONS_WIT H_ALIASES.indexOf(t.key)!==-1&&t.value.forEach(function(e,s){t.value[s]=swarming .alias.apply(e,t.key)})}),i.forEach(function(s){e[s]&&(e[s]=new Date(e[s]),e["hu man_"+s]=t(e[s]))}),e},parseEvents:function(e){if(!e||!e.items)return[];var e=e. items;return e.forEach(function(e){e.ts&&(e.ts=new Date(e.ts),e.human_ts=t(e.ts) )}),e.sort(function(t,e){return e.ts-t.ts}),e},parseTasks:function(e){if(!e||!e. items)return[];var e=e.items;return e.forEach(function(e){if(a.forEach(function( s){e[s]&&(e[s]=new Date(e[s]),e["human_"+s]=t(e[s]))}),e.duration)e.human_durati on=this._humanDuration(e.duration);else{var s=e.completed_ts||e.abandoned_ts||e. modified_ts||new Date;e.human_duration=this._timeDiffExact(e.started_ts,s),e.dur ation=(s.getTime()-e.started_ts)/1e3}e.state=e.state||"UNKNOWN","COMPLETED"===e. state&&(e.failure?e.state="FAILURE":e.state="SUCCESS")}.bind(this)),e.sort(funct ion(t,e){return e.started_ts-t.started_ts}),e}})}()</script> </dom-module> <dom- module id="bot-page-summary" assetpath="/res/imp/botpage/"> <template> <style in clude="single-page-style">.wrapper{display:table;margin-left:auto;margin-bottom: 10px;margin-right:5px}paper-checkbox{margin-left:5px}.thick{border-top-style:sol id}</style> <url-param name="show_full_names" value="{{_show_full_names}}"> </ur l-param> <url-param name="show_all_tasks" value="{{_show_all_tasks}}"> </url-par am> <url-param name="sort_stats" value="{{_sortstr}}" default_value="total:desc" > </url-param> <div class="wrapper"> <table> <thead on-sort_change="_sortChange" > <tr> <th> <span>Name</span> <sort-toggle name="full_name" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Total</span> <sort-toggle name="total" current= "[[_sort]]"> </sort-toggle> </th> <th> <span>Success</span> <sort-toggle name="s uccess" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Failed</span> <sort -toggle name="failed" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Died< /span> <sort-toggle name="bot_died" current="[[_sort]]"> </sort-toggle> </th> <t h> <span>Average Duration</span> <sort-toggle name="avg_duration" current="[[_so rt]]"> </sort-toggle> </th> <th> <span>Total Duration</span> <sort-toggle name=" total_time" current="[[_sort]]"> </sort-toggle> </th> <th>Percent of Total</th> </tr> </thead> <tbody> <template is="dom-repeat" items="[[_tasksToShow]]" as="ta sk"> <tr> <td hidden$="[[_truthy(_show_full_names)]]" title="[[task.full_name]]" >[[task.name]]</td> <td hidden$="[[_not(_show_full_names)]]" title="[[task.full_ name]]">[[task.full_name]]</td> <td>[[task.total]]</td> <td>[[task.success]]</td > <td>[[task.failed]]</td> <td>[[task.bot_died]]</td> <td>[[_humanDuration(task. avg_duration)]]</td> <td>[[_humanDuration(task.total_time)]]</td> <td>[[task.tot al_time_percent]]%</td> </tr> </template> </tbody> <tbody><tr class="thick"> <td >Total</td> <td>[[_totalStats.total]]</td> <td>[[_totalStats.success]]</td> <td> [[_totalStats.failed]]</td> <td>[[_totalStats.bot_died]]</td> <td>[[_humanDurati on(_totalStats.avg_duration)]]</td> <td>[[_humanDuration(_totalStats.total_time) ]]</td> <td>100.0%</td> </tr> </tbody></table> <div> <table> <thead> <tr> <th ti tle="How much time passed between the oldest task fetched and now."> Total Wall Time </th> <th title="How much of the wall time this bot was busy with a task."> Wall Time Utilization </th> </tr> </thead> <tbody> <tr> <td>[[_humanDuration(_t otalStats.wall_time)]]</td> <td>[[_totalStats.wall_time_utilization]]%</td> </tr > </tbody> </table> <paper-checkbox checked="{{_show_full_names}}"> Show Full Na mes </paper-checkbox> <paper-checkbox hidden$="[[_cannotExpand]]" checked="{{_sh ow_all_tasks}}"> Show All Tasks </paper-checkbox> </div> </div> </template> <scr ipt>!function(){var t=15;Polymer({is:"bot-page-summary",behaviors:[SwarmingBehav iors.BotPageBehavior],properties:{tasks:{type:Array},_cannotExpand:{type:Boolean ,computed:"_countTasks(_taskStats.*)"},_show_all_tasks:{type:Boolean},_show_full _names:{type:Boolean},_sortstr:{type:String},_sort:{type:Object,computed:"_makeS ortObject(_sortstr)"},_taskStats:{type:Array},_tasksToShow:{type:Array,computed: "_sortAndLimitTasks(_taskStats.*,_sort.*,_show_all_tasks)"},_totalStats:{type:Ob ject}},observers:["_aggregate(tasks.*)"],_aggregate:function(){if(this.tasks&&th is.tasks.length){var t=new Date(1e3*sk.now()),a={},e={total:this.tasks.length,su ccess:0,failed:0,bot_died:0,avg_duration:0,total_time:0,wall_time:(t-this.tasks[ this.tasks.length-1].started_ts)/1e3};this.tasks.forEach(function(t){var s=t.nam e.trim(),i=s.split("/");5===i.length&&(s=i[0]+"/"+i[3]),a[s]||(a[s]={full_name:s ,name:s,total:0,success:0,failed:0,bot_died:0,avg_duration:0,total_time:0}),a[s] .total++,t.failure?(e.failed++,a[s].failed++):t.internal_failure?(e.bot_died++,a [s].bot_died++):(e.success++,a[s].success++),e.total_time+=t.duration,a[s].total _time+=t.duration}),e.avg_duration=e.total_time/e.total,e.wall_time_utilization= (100*e.total_time/e.wall_time).toFixed(1),this.set("_totalStats",e);var s=Object .keys(a),i=[];s.forEach(function(t){a[t].avg_duration=a[t].total_time/a[t].total ,a[t].total_time_percent=(100*a[t].total_time/e.total_time).toFixed(1),i.push(a[ t])});var o=new Substrings({minOccurrence:Math.max(2,s.length-1),minLength:6});o .build(s);var n=o.weighByAverage()||[];n.length&&n[0].source.forEach(function(t) {var a=i[t].full_name;i[t].name=a.replace(n[0].name,"...")}),this.set("_taskStat s",i)}},_compare:function(t,a){if(!this._sort)return 0;var e=1;return"desc"===th is._sort.direction&&(e=-1),e*swarming.naturalCompare(t[this._sort.name],a[this._ sort.name])},_countTasks:function(){return this._taskStats.length<=t},_makeSortO bject:function(t){if(t){var a=t.split(":");return 2!=a.length?{name:"full_name", direction:"asc"}:{name:a[0],direction:a[1]}}},_sortAndLimitTasks:function(){swar ming.stableSort(this._taskStats,this._compare.bind(this));var a=this._taskStats. length;return!this._show_all_tasks&&this._taskStats.length>t&&(a=t),this._taskSt ats.slice(0,a)},_sortChange:function(t){t&&t.detail&&t.detail.name&&(t.preventDe fault(),t.stopPropagation(),this.set("_sortstr",t.detail.name+":"+t.detail.direc tion))}})}()</script> </dom-module><dom-module id="bot-page" assetpath="/res/imp /botpage/"> <template> <style include="iron-flex iron-flex-alignment iron-positi oning swarming-app-style single-page-style task-style">.message{white-space:pre- line;font-family:monospace}.bot_state{white-space:pre;font-family:monospace;marg in-bottom:10px}.events_table,.tasks_table{border:3px solid #1F78B4}.old_version{ background-color:#ffd}.stats{min-width:700px;flex-grow:2}#collapse{max-width:700 px}.cloud{white-space:nowrap;margin-bottom:5px;margin-top:auto}paper-checkbox{-- paper-checkbox-label-color:#fff;--paper-checkbox-checked-color:#fff;--paper-chec kbox-checkmark-color:#000;--paper-checkbox-unchecked-color:#fff;padding:3px}pape r-dialog{border-radius:6px}</style> <url-param name="id" value="{{bot_id}}"> </u rl-param> <url-param name="show_all_events" value="{{_show_all}}"> </url-param> <url-param name="selected" value="{{_selected}}"> </url-param> <url-param name=" show_state" value="{{_show_state}}"> </url-param> <swarming-app client_id="[[cli ent_id]]" auth_headers="{{_auth_headers}}" permissions="{{_permissions}}" server _version="{{_server_version}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_bu sy2,_busy3)]]" name="Swarming Bot Page"> <h2 hidden$="[[_signed_in]]">You must s ign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <bot-pa ge-data id="data" auth_headers="[[_auth_headers]]" bot_id="[[bot_id]]" bot="{{_b ot}}" busy="{{_busy1}}" events="{{_events}}" tasks="{{_tasks}}" on-reload="_clea rAndReload"> </bot-page-data> <div class="header horizontal layout"> <paper-inpu t class="id_input" label="Bot id" value="{{bot_id}}"></paper-input> <template is ="dom-if" if="[[_ccLink(_bot)]]"> <div class="vertical layout"> <a href$="[[_ccL ink(_bot)]]" class="cloud">Cloud Console</a> </div> </template> <button on-click ="_refresh"> <iron-icon class="refresh" icon="icons:refresh"></iron-icon> </butt on> </div> <div class="horizontal wrap layout"> <div class="flex"> <table> <tbod y><tr class$="[[_isDead(_bot)]]" title="Last time the bot contacted the server." > <td>Last Seen</td> <td title="[[_bot.human_last_seen_ts]]"> [[_timeDiffExact(_ bot.last_seen_ts)]] ago</td> <td> <template is="dom-if" if="[[_canShutdown(_bot, _permissions)]]"> <button class="raised" on-click="_promptShutdown"> Shut Down G racefully </button> </template> <template is="dom-if" if="[[_canDelete(_bot,_per missions)]]"> <button class="raised" on-click="_promptDelete"> Delete </button> </template> </td> </tr> <template is="dom-if" if="[[_bot.quarantined]]"> <tr cla ss="quarantined"> <td>Quarantined</td> <td colspan="2" class="message">[[_quaran tineMessage(_bot)]]</td> </tr> </template> <tr> <td>Current Task</td> <td> <a ta rget="_blank" rel="noopener" href$="[[_taskLink(_bot.task_id)]]"> [[_task(_bot)] ] </a> </td> <td> </td> </tr> <tr> <td rowspan$="[[_numRows(_bot.dimensions)]]"> Dimensions</td> </tr> <template is="dom-repeat" items="[[_bot.dimensions]]" as=" dim"> <tr> <td>[[dim.key]]</td> <td>[[_concat(dim.value)]]</td> </tr> </template > <tr title="IP address that the server saw the connection from."> <td>External IP</td> <td><a href$="[[_bot.external_ip]]">[[_bot.external_ip]]</a></td> <td></ td> </tr> <tr class$="[[_classVersion(_server_version.bot_version,_bot.version)] ]" title="Version is based on the content of swarming_bot.zip which is the swarm ing bot code. The bot won't update if quarantined, dead, or busy."> <td>Bot Vers ion</td> <td>[[_shorten(_bot.version,'8')]]</td> <td></td> </tr> <tr title="The version the server expects the bot to be using."> <td>Expected Bot Version</td> <td>[[_shorten(_server_version.bot_version,'8')]]</td> <td></td> </tr> <tr title ="First time ever a bot with this id contacted the server."> <td>First seen</td> <td title="[[_bot.human_first_seen_ts]]"> [[_timeDiffApprox(_bot.first_seen_ts) ]] ago </td> <td></td> </tr> <tr title="How the bot is authenticated by the serv er."> <td>Authenticated as</td> <td colspan="2">[[_bot.authenticated_as]]</td> < /tr> <template is="dom-if" if="[[_bot.lease_id]]"> <tr> <td>Machine Provider Lea se ID</td> <td colspan="2">[[_bot.lease_id]]</td> </tr> <tr> <td>Machine Provide r Lease Expires</td> <td colspan="2">[[_bot.human_lease_expiration_ts]]</td> </t r> </template> </tbody></table> <span class="title">State</span> <template is="d om-if" if="[[_not(_show_state)]]"> <button on-click="_toggleState"> <iron-icon i con="icons:add-circle-outline"></iron-icon> </button> </template> <template is=" dom-if" if="[[_show_state]]"> <button on-click="_toggleState"> <iron-icon icon=" icons:remove-circle-outline"></iron-icon> </button> </template> <iron-collapse i d="collapse" opened="[[_show_state]]"> <div class="bot_state">[[_prettyPrint(_bo t.state)]]</div> </iron-collapse> </div> <div class="stats flex"> <bot-page-summ ary tasks="[[_tasks]]"> </bot-page-summary> </div> </div> <div class="tabs"> <pa per-tabs selected="{{_selected}}" no-bar=""> <paper-tab>Tasks</paper-tab> <paper -tab>Events</paper-tab> </paper-tabs> <template is="dom-if" if="[[_showEvents]]" > <paper-checkbox checked="{{_show_all}}"> Show all events </paper-checkbox> </t emplate> </div> <template is="dom-if" if="[[_not(_showEvents)]]"> <table class=" tasks_table"> <thead> <tr> <th>Task</th> <th>Started</th> <th>Duration</th> <th> Result</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_tasks}}" as="task"> <tr class$="[[_taskClass(task)]]"> <td> <a target="_blank" rel="noope ner" href$="[[_taskLink(task.task_id)]]"> [[task.name]] </a> </td> <td>[[task.hu man_started_ts]]</td> <td title="[[task.human_completed_ts]]">[[task.human_durat ion]]</td> <td>[[task.state]]</td> </tr> </template> </tbody> </table> </templat e> <template is="dom-if" if="[[_showEvents]]"> <table class="events_table"> <the ad> <tr> <th>Message</th> <th>Type</th> <th>Timestamp</th> <th>Task ID</th> <th> Version</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_eventLis t(_show_all,_events.*)}}" as="event"> <tr> <td class="message">[[event.message]] </td> <td>[[event.event_type]]</td> <td>[[event.human_ts]]</td> <td> <a target=" _blank" rel="noopener" href$="[[_taskLink(event.task_id)]]"> [[event.task_id]] < /a> </td> <td class$="[[_classVersion(_server_version.bot_version,event.version) ]]"> <a target="_blank" rel="noopener" href$="[[_luciLink(event.version)]]"> [[_ shorten(event.version,'8')]] </a> </td> </tr> </template> </tbody> </table> </te mplate> <pageable-data id="page_tasks" hidden$="[[_showEvents]]" busy="{{_busy2} }" label="Show more tasks" output="{{_tasks}}" parse="[[_parseTasks]]"> </pageab le-data> <pageable-data id="page_events" hidden$="[[_not(_showEvents)]]" busy="{ {_busy3}}" label="Show more events" output="{{_events}}" parse="[[_parseEvents]] "> </pageable-data> </div> </swarming-app> <paper-dialog id="prompt" modal="" on -iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are you sure y ou want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-button dialog-d ismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm="">Yes</pa per-button> </div> </paper-dialog> <error-toast></error-toast> </template> <scri pt> (function(){
621 621
622 Polymer({ 622 Polymer({
623 is: 'bot-page', 623 is: 'bot-page',
624 624
625 behaviors: [ 625 behaviors: [
626 SwarmingBehaviors.BotPageBehavior, 626 SwarmingBehaviors.BotPageBehavior,
627 ], 627 ],
628 628
629 properties: { 629 properties: {
630 bot_id: { 630 bot_id: {
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 } 836 }
837 return ""; 837 return "";
838 }, 838 },
839 839
840 _toggleState: function() { 840 _toggleState: function() {
841 this.set("_show_state", !this._show_state); 841 this.set("_show_state", !this._show_state);
842 } 842 }
843 843
844 }); 844 });
845 })(); </script> </dom-module><dom-module id="interval-timer" assetpath="/res/i mp/common/"> <script>!function(){Polymer({is:"interval-timer",properties:{period :{type:Number,value:-1,observer:"_periodChanged"}},_periodChanged:function(e){th is._timeout&&window.clearTimeout(this._timeout),e>0&&(this._timeout=window.setTi meout(function(){this.fire("trigger"),this._periodChanged(e)}.bind(this),1e3*e)) }})}()</script> </dom-module> <dom-module id="task-page-data" assetpath="/res/im p/taskpage/"> <script>!function(){var t,e=400,s=["abandoned_ts","completed_ts"," created_ts","modified_ts","started_ts"];Polymer({is:"task-page-data",behaviors:[ SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{aut h_headers:{type:Object},task_id:{type:String},busy:{type:Boolean,computed:"_or(_ busy1,_busy2,_busy3)",notify:!0},request:{type:Object,computed:"_parseRequest(_r equest)",notify:!0},result:{type:Object,computed:"_parseResult(_result)",notify: !0},stdout:{type:String,computed:"_parseStdout(_stdout)",notify:!0},_busy1:{type :Boolean,value:!1},_busy2:{type:Boolean,value:!1},_busy3:{type:Boolean,value:!1} ,_request:{type:Object},_result:{type:Object},_stdout:{type:Object}},observers:[ "reload(auth_headers,task_id)"],reload:function(){if(!this.task_id||!this.auth_h eaders)return void console.log("task_id and auth_headers can't be empty");t&&thi s.cancelAsync(t);var s="/_ah/api/swarming/v1/task/"+this.task_id;t=this.async(fu nction(){t=void 0,this._getJsonAsync("_request",s+"/request","_busy1",this.auth_ headers),this._getJsonAsync("_result",s+"/result?include_performance_stats=true" ,"_busy2",this.auth_headers),this.reloadStdout()},e)},_parseRequest:function(t){ return t?(t.tagMap={},t.tags=t.tags||[],t.tags.forEach(function(e){var s=e.split (":",1),a=s[0],u=e.substring(a.length+1);t.tagMap[a]=u}),s.forEach(function(e){t [e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),t):{}},_par seResult:function(t){if(!t)return{};var e=new Date;return s.forEach(function(e){ t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),!t.duratio n&&t.state===this.RUNNING&&t.started_ts&&(t.duration=(e-t.started_ts)/1e3),t.dur ation&&(t.human_duration=this._humanDuration(t.duration)),t},_parseStdout:functi on(t){return t&&t.output?t.output:"[No output yet]"},reloadStdout:function(){thi s._getJsonAsync("_stdout","/_ah/api/swarming/v1/task/"+this.task_id+"/stdout","_ busy3",this.auth_headers)}})}()</script> </dom-module><dom-module id="task-page" assetpath="/res/imp/taskpage/"> <template> <style include="iron-flex iron-flex- alignment swarming-app-style single-page-style task-style">.milo{width:calc(100% - 11px);height:2000px}.left{min-width:550px}.right{min-width:500px;margin-top:8 px}.expand{min-width:3em;vertical-align:middle;padding:.5em}.code{font-family:mo nospace}.stdout{white-space:pre-line;padding:2px}.refresh_input{padding:0 5px}.t abbed{border:3px solid #1F78B4;margin-left:5px;min-height:80vh}</style> <url-par am name="id" value="{{task_id}}"> </url-param> <url-param name="request_detail" value="{{_request_detail}}"> </url-param> <url-param name="show_raw" value="{{_s how_raw}}"> </url-param> <url-param name="refresh" value="{{_refresh_interval}}" default_value="10"> </url-param> <swarming-app client_id="[[client_id]]" auth_h eaders="{{_auth_headers}}" permissions="{{_permissions}}" profile="{{_profile}}" signed_in="{{_signed_in}}" busy="[[_busy]]" name="Swarming Task Page"> <h2 hidd en$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden$= "[[_not(_signed_in)]]"> <task-page-data id="data" auth_headers="[[_auth_headers] ]" task_id="[[task_id]]" busy="{{_busy}}" request="{{_request}}" result="{{_resu lt}}" stdout="{{_stdout}}"> </task-page-data> <div class="horizontal layout wrap "> <div class="left flex"> <div class="horizontal layout"> <paper-input class="i d_input" label="Task id" value="{{task_id}}"></paper-input> <button on-click="_r efresh"> <iron-icon class="refresh" icon="icons:refresh"></iron-icon> </button> <button on-click="_promptRetry">Retry</button> <template is="dom-if" if="[[_canC ancelTask(_result,_permissions)]]"> <button on-click="_promptCancel">Cancel</but ton> </template> </div> <table> <tbody><tr> <td>Name</td> <td>[[_request.name]]< /td> </tr> <tr> <td>State</td> <td class$="[[_stateClass(_result)]]">[[_state(_r esult)]]</td> </tr> <tr> <td>Created</td> <td title$="[[_request.created_ts]]">[ [_request.human_created_ts]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp (_result)]]"> <tr> <td>Started</td> <td title$="[[_result.started_ts]]">[[_resul t.human_started_ts]]</td> </tr> </template> <template is="dom-if" if="[[_wasNotP ickedUp(_result)]]"> <tr> <td>Expires</td> <td>[[_expires(_request)]]</td> </tr> </template> <template is="dom-if" if="[[_result.human_completed_ts]]"> <tr> <td >Completed</td> <td title$="[[_result.completed_ts]]">[[_result.human_completed_ ts]]</td> </tr> </template> <template is="dom-if" if="[[_result.human_abandoned_ ts]]"> <tr> <td>Abandoned</td> <td title$="[[_result.abandoned_ts]]">[[_result.h uman_abandoned_ts]]</td> </tr> </template> <tr> <td>Last Updated</td> <td title$ ="[[_result.modified_ts]]">[[_result.human_modified_ts]]</td> </tr> <template is ="dom-if" if="[[_result.deduped_from]]"> <tr> <td><b>Deduped from</b></td> <td> <a href$="[[_taskLink(_result.deduped_from)]]"> [[_result.deduped_from]] </a> </ td> </tr> </template> <tr> <td>Pending Time</td> <td>[[_pending(_result)]]</td> </tr> <tr> <td>Duration</td> <td>[[_result.human_duration]]</td> </tr> <tr> <td> Priority</td> <td>[[_request.priority]]</td> </tr> <tr> <td>User</td> <td>[[_req uest.user]]</td> </tr> <tr> <td>Authenticated</td> <td>[[_request.authenticated] ]</td> </tr> <template is="dom-if" if="[[_request.service_account]]"> <tr> <td>S ervice Account</td> <td>[[_request.service_account]]</td> </tr> </template> <tem plate is="dom-if" if="[[_request.properties.secret_bytes]]"> <tr> <td>Secret Byt es</td> <td>[[_request.properties.secret_bytes]]</td> </tr> </template> <templat e is="dom-if" if="[[_request.parent_task_id]]"> <tr> <td>Parent Task</td> <td> < a href$="[[_taskLink(_request.parent_task_id)]]">[[_request.parent_task_id]]</a> </td> </tr> </template> <tr> <td rowspan$="[[_rowspan(_request.properties.dimen sions)]]"> <a title="The list of bots that matches the list of dimensions" href$ ="[[_botListLink(_request.properties.dimensions)]]"> Requested Dimensions </a> < /td> </tr> <template is="dom-repeat" items="{{_request.properties.dimensions}}" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</td> </ tr> </template> <tr> <td>Isolated Inputs</td> <td> <a href$="[[_isolateLink(_req uest.properties.inputs_ref)]]"> [[_request.properties.inputs_ref.isolated]] </a> </td> </tr> <template is="dom-if" if="[[_not(_request_detail)]]"> <tr> <td>More Details</td> <td> <button on-click="_toggleDetails"> <iron-icon icon="icons:add -circle-outline"></iron-icon> </button> </td> </tr> </template> <template is="do m-if" if="[[_request_detail]]"> <tr> <td>Hide Details</td> <td> <button on-click ="_toggleDetails"> <iron-icon icon="icons:remove-circle-outline"></iron-icon> </ button> </td> </tr> </template> <template is="dom-if" if="[[_request_detail]]"> <tr> <td>Extra Args</td> <td class="code">[[_extraArgs(_request)]]</td> </tr> <t r> <td rowspan$="[[_rowspan(_request.tags)]]">Tags</td> </tr> <template is="dom- repeat" items="{{_request.tags}}" as="tag"> <tr> <td>[[tag]]</td> </tr> </templa te> <tr> <td>Execution timeout</td> <td>[[_humanDuration(_request.properties.exe cution_timeout_secs)]]</td> </tr> <tr> <td>I/O timeout</td> <td>[[_humanDuration (_request.properties.io_timeout_secs)]]</td> </tr> <tr> <td>Grace period</td> <t d>[[_humanDuration(_request.properties.grace_period_secs)]]</td> </tr> <tr> <td> CIPD server</td> <td> <a href$="[[_request.properties.cipd_input.server]]"> [[_r equest.properties.cipd_input.server]] </a> </td> </tr> <tr> <td>CIPD version</td > <td>[[_request.properties.cipd_input.client_package.version]]</td> </tr> <temp late is="dom-if" if="[[_wasPickedUp(_result)]]"> <tr> <td>CIPD package name</td> <td>[[_result.cipd_pins.client_package.package_name]]</td> </tr> </template> <t r hidden$="[[_not(_request.properties.cipd_input)]]"> <td rowspan$="[[_cipdRowsp an(_request,_result)]]">CIPD packages</td> </tr> <template is="dom-repeat" items ="[[_cipdPackages(_request,_result)]]" as="cipd"> <tr> <td>[[cipd.path]]/</td> < /tr> <tr> <td><b>Requested:</b>[[cipd.requested]]</td> </tr> <tr hidden$="[[_was NotPickedUp(_result)]]"> <td><b>Actual:</b>[[cipd.actual]]</td> </tr> </template > </template> </tbody></table> <div class="title">Task Execution</div> <template is="dom-if" if="[[_wasPickedUp(_result)]]"> <table> <tbody><tr> <td>Bot assigne d to task</td> <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]]</a ></td> </tr> <tr> <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> <a>Bot Di mensions</a> </td> </tr> <template is="dom-repeat" items="[[_result.bot_dimensio ns]]" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</ td> </tr> </template> <tr> <td>Exit code</td> <td>[[_result.exit_code]]</td> </t r> <tr> <td>Try number</td> <td>[[_result.try_number]]</td> </tr> <tr> <td>Failu re</td> <td class$="[[_failureClass(_result.failure)]]">[[_result.failure]]</td> </tr> <tr> <td>Internal Failure</td> <td class$="[[_internalClass(_result.inter nal_failure)]]">[[_result.internal_failure]]</td> </tr> <tr> <td>Isolated Output s</td> <td> <a href$="[[_isolateLink(_result.outputs_ref)]]"> [[_result.outputs_ ref.isolated]] </a> </td> </tr> <tr> <td>Bot version</td> <td>[[_result.bot_vers ion]]</td> </tr> <tr> <td>Server version</td> <td>[[_result.server_versions]]</t d> </tr> </tbody></table> </template> <template is="dom-if" if="[[_wasNotPickedU p(_result)]]"> This space left blank until a bot is assigned to the task. </temp late> <template is="dom-if" if="[[_result.performance_stats]]"> <div class="titl e">Performance Stats</div> <table> <tbody><tr> <td title="This includes time tak en to download inputs, isolate outputs, and setup CIPD">Total Overhead</td> <td> [[_humanDuration(_result.performance_stats.bot_overhead)]]</td> </tr> <tr> <td>D ownloading Inputs From Isolate</td> <td>[[_humanDuration(_result.performance_sta ts.isolated_download.duration)]]</td> </tr> <tr> <td>Uploading Outputs To Isolat e</td> <td>[[_humanDuration(_result.performance_stats.isolated_upload.duration)] ]</td> </tr> <tr> <td>Initial bot cache</td> <td>[[_result.performance_stats.iso lated_download.initial_number_items]] items; [[_bytes(_result.performance_stats. isolated_download.initial_size)]]</td> </tr> </tbody></table> </template> </div> <div class="flex right"> <div class="horizontal layout"> <div class="tabs"> <pa per-tabs selected="{{_show_raw}}" no-bar=""> <paper-tab disabled$="[[_noMilo(_re quest)]]">Milo Output</paper-tab> <paper-tab>Raw Output</paper-tab> </paper-tabs > </div> <paper-input class="refresh_input" label="Refresh Interval (seconds)" v alue="{{_refresh_interval}}" title="How often to refresh all information about t he task" auto-validate="" min="1" max="1000" pattern="[0-9]+"> </paper-input> </ div> <template is="dom-if" if="[[_supportsMilo(_request,_show_raw)]]"> <iframe i d="miloFrame" class="milo tabbed" src$="[[_getMiloLink(milo_prefix,task_id)]]">< /iframe> </template> <template is="dom-if" if="[[_show_raw]]"> <div class="code stdout tabbed">[[_stdout]]</div> </template> </div> </div> </div> </swarming-app > <paper-dialog id="prompt" modal="" on-iron-overlay-closed="_promptClosed"> <h2 >Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-button dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm="">Yes</paper-button> </div> </paper-dialog> <error -toast></error-toast> <interval-timer period="[[_refresh_interval]]" on-trigger= "_softRefresh"> </interval-timer> </template> <script>!function(){Polymer({is:"t ask-page",behaviors:[SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBeha vior],properties:{task_id:{type:String},client_id:{type:String},milo_prefix:{typ e:String},_dialogPrompt:{type:String,value:""},_refresh_interval:{type:Number},_ request:{type:Object,observer:"_requestUpdated"},_request_detail:{type:Boolean}, _result:{type:Object},_stdout:{type:String}},_alias:function(t){var e=t.value;re turn Array.isArray(e)||(e=[e]),swarming.alias.has(t.key)&&e.forEach(function(i,s ){e[s]=swarming.alias.apply(i,t.key)}),e.join(" | ")},_bytes:function(t){return sk.human.bytes(t)},_canCancelTask:function(t,e){return t&&"PENDING"===t.state&&e .cancel_task},_cancelTask:function(){var t="/_ah/api/swarming/v1/task/"+this.tas k_id+"/cancel";swarming.postWithToast(t,"Canceling task "+this.task_id,this._aut h_headers)},_cipdRowspan:function(t,e){if(!t||!t.properties||!t.properties.cipd_ input)return 0;var i=(t.properties.cipd_input.packages||[]).length;return i*=e&& e.cipd_pins&&e.cipd_pins.packages?3:2,i+1},_cipdPackages:function(t,e){if(!t||!t .properties||!t.properties.cipd_input)return[];var i=t.properties.cipd_input.pac kages||[],s=e&&e.cipd_pins&&e.cipd_pins.packages||[];return i.forEach(function(t ){t.requested=t.package_name+":"+t.version,s.forEach(function(e){e.path===t.path &&(t.actual=e.package_name+":"+e.version)})}),i},_expires:function(t){var e=pars eInt(t.expiration_secs);return e?sk.human.localeTime(new Date(t.created_ts.getTi me()+1e3*e)):t.expiration_secs+" seconds from created time"},_extraArgs:function (t){if(!t||!t.properties)return"";var e=t.properties.extra_args||[];return e.joi n(" ")},_failureClass:function(t){return t?"failed_task":""},_getMiloLink:functi on(t,e){if(t)return t+e},_internalClass:function(t){return t?"exception":""},_is olateLink:function(t){if(t&&t.isolatedserver)return t.isolatedserver+"/browse?na mespace="+t.namespace+"&hash="+t.isolated},_noMilo:function(t){return!this._tag( t,"allow_milo")},_pending:function(t){if(!t.created_ts)return"";var e=t.started_ ts||t.abandoned_ts||new Date;return e<=t.created_ts?"0s":this._timeDiffExact(t.c reated_ts,e)},_promptClosed:function(t){t.detail.confirmed&&(this._dialogPrompt. startsWith("cancel")?this._cancelTask():this._retryTask())},_promptCancel:functi on(){this.set("_dialogPrompt","cancel task "+this.task_id),this.$.prompt.open()} ,_promptRetry:function(){this.set("_dialogPrompt","retry task "+this.task_id),th is.$.prompt.open()},_refresh:function(){this.$.data.reload()},_requestUpdated:fu nction(t){this._noMilo(t)&&this.set("_show_raw",1)},_softRefresh:function(){if(! this._result||"RUNNING"===this._result.state||"PENDING"===this._result.state){th is.$.data.reload();var t=this.$$("iframe");t&&(t.src=this._getMiloLink(this.milo _prefix,this.task_id))}},_retryTask:function(){if(!this._request)return void sk. errorMessage("Task not yet loaded",3e3);var t={expiration_secs:this._request.exp iration_secs,name:this._request.name+" (retry)",parent_task_id:this._request.par ent_task_id,priority:this._request.priority,properties:this._request.properties, tags:this._request.tags,user:this._profile.email,service_account:this._request.s ervice_account};swarming.postWithToast("/_ah/api/swarming/v1/tasks/new","Retryin g task "+this.task_id,this._auth_headers,t).then(function(t){t=JSON.parse(t),t&& t.task_id&&this.set("task_id",t.task_id)}.bind(this),function(t){console.log("Ta sk could not be retried",t)})},_rowspan:function(t){return t=t||[],t.length+1},_ supportsMilo:function(t,e){return!e&&t&&this._tag(t,"allow_milo")},_state:functi on(t){return t?t.state===this.COMPLETED?t.failure?this.COMPLETED_FAILURE:"0"===t .try_number?this.COMPLETED_DEDUPED:this.COMPLETED_SUCCESS:t.state:""},_stateClas s:function(t){return this.stateClass(this._state(t))},_toggleDetails:function(){ this.set("_request_detail",!this._request_detail)},_tag:function(t,e){if(t&&t.ta gMap)return t.tagMap[e]},_wasPickedUp:function(t){return t&&t.state!==this.PENDI NG&&t.state!==this.CANCELED&&t.state!=this.EXPIRED},_wasNotPickedUp:function(t){ return t&&!this._wasPickedUp(t)}})}()</script> </dom-module></div></body></html> 845 })(); </script> </dom-module><dom-module id="interval-timer" assetpath="/res/i mp/common/"> <script>!function(){Polymer({is:"interval-timer",properties:{period :{type:Number,value:-1,observer:"_periodChanged"}},_periodChanged:function(e){th is._timeout&&window.clearTimeout(this._timeout),e>0&&(this._timeout=window.setTi meout(function(){this.fire("trigger"),this._periodChanged(e)}.bind(this),1e3*e)) }})}()</script> </dom-module> <dom-module id="task-page-data" assetpath="/res/im p/taskpage/"> <script>!function(){var t,e=400,s=["abandoned_ts","completed_ts"," created_ts","modified_ts","started_ts"];Polymer({is:"task-page-data",behaviors:[ SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{aut h_headers:{type:Object},task_id:{type:String},busy:{type:Boolean,computed:"_or(_ busy1,_busy2,_busy3)",notify:!0},request:{type:Object,computed:"_parseRequest(_r equest)",notify:!0},result:{type:Object,computed:"_parseResult(_result)",notify: !0},stdout:{type:String,computed:"_parseStdout(_stdout)",notify:!0},_busy1:{type :Boolean,value:!1},_busy2:{type:Boolean,value:!1},_busy3:{type:Boolean,value:!1} ,_request:{type:Object},_result:{type:Object},_stdout:{type:Object}},observers:[ "reload(auth_headers,task_id)"],reload:function(){if(!this.task_id||!this.auth_h eaders)return void console.log("task_id and auth_headers can't be empty");t&&thi s.cancelAsync(t);var s="/_ah/api/swarming/v1/task/"+this.task_id;t=this.async(fu nction(){t=void 0,this._getJsonAsync("_request",s+"/request","_busy1",this.auth_ headers),this._getJsonAsync("_result",s+"/result?include_performance_stats=true" ,"_busy2",this.auth_headers),this.reloadStdout()},e)},_parseRequest:function(t){ return t?(t.tagMap={},t.tags=t.tags||[],t.tags.forEach(function(e){var s=e.split (":",1),a=s[0],u=e.substring(a.length+1);t.tagMap[a]=u}),s.forEach(function(e){t [e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),t):{}},_par seResult:function(t){if(!t)return{};var e=new Date;return s.forEach(function(e){ t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),!t.duratio n&&t.state===this.RUNNING&&t.started_ts&&(t.duration=(e-t.started_ts)/1e3),t.dur ation&&(t.human_duration=this._humanDuration(t.duration)),t},_parseStdout:functi on(t){return t&&t.output?t.output:"[No output yet]"},reloadStdout:function(){thi s._getJsonAsync("_stdout","/_ah/api/swarming/v1/task/"+this.task_id+"/stdout","_ busy3",this.auth_headers)}})}()</script> </dom-module><dom-module id="task-page" assetpath="/res/imp/taskpage/"> <template> <style include="iron-flex iron-flex- alignment swarming-app-style single-page-style task-style">.milo{width:calc(100% - 11px);height:2000px}.left{min-width:550px}.right{min-width:500px;margin-top:8 px}.expand{min-width:3em;vertical-align:middle;padding:.5em}.code{font-family:mo nospace}.stdout{white-space:pre-line;padding:2px}.refresh_input{padding:0 5px}.t abbed{border:3px solid #1F78B4;margin-left:5px;min-height:80vh}</style> <url-par am name="id" value="{{task_id}}"> </url-param> <url-param name="request_detail" value="{{_request_detail}}"> </url-param> <url-param name="show_raw" value="{{_s how_raw}}"> </url-param> <url-param name="refresh" value="{{_refresh_interval}}" default_value="10"> </url-param> <swarming-app client_id="[[client_id]]" auth_h eaders="{{_auth_headers}}" permissions="{{_permissions}}" profile="{{_profile}}" signed_in="{{_signed_in}}" busy="[[_busy]]" name="Swarming Task Page"> <h2 hidd en$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden$= "[[_not(_signed_in)]]"> <task-page-data id="data" auth_headers="[[_auth_headers] ]" task_id="[[task_id]]" busy="{{_busy}}" request="{{_request}}" result="{{_resu lt}}" stdout="{{_stdout}}"> </task-page-data> <div class="horizontal layout wrap "> <div class="left flex"> <div class="horizontal layout"> <paper-input class="i d_input" label="Task id" value="{{task_id}}"></paper-input> <button on-click="_r efresh"> <iron-icon class="refresh" icon="icons:refresh"></iron-icon> </button> <button on-click="_promptRetry">Retry</button> <template is="dom-if" if="[[_canC ancelTask(_result,_permissions)]]"> <button on-click="_promptCancel">Cancel</but ton> </template> </div> <table> <tbody><tr> <td>Name</td> <td>[[_request.name]]< /td> </tr> <tr> <td>State</td> <td class$="[[_stateClass(_result)]]">[[_state(_r esult)]]</td> </tr> <tr> <td>Created</td> <td title$="[[_request.created_ts]]">[ [_request.human_created_ts]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp (_result)]]"> <tr> <td>Started</td> <td title$="[[_result.started_ts]]">[[_resul t.human_started_ts]]</td> </tr> </template> <template is="dom-if" if="[[_wasNotP ickedUp(_result)]]"> <tr> <td>Expires</td> <td>[[_expires(_request)]]</td> </tr> </template> <template is="dom-if" if="[[_result.human_completed_ts]]"> <tr> <td >Completed</td> <td title$="[[_result.completed_ts]]">[[_result.human_completed_ ts]]</td> </tr> </template> <template is="dom-if" if="[[_result.human_abandoned_ ts]]"> <tr> <td>Abandoned</td> <td title$="[[_result.abandoned_ts]]">[[_result.h uman_abandoned_ts]]</td> </tr> </template> <tr> <td>Last Updated</td> <td title$ ="[[_result.modified_ts]]">[[_result.human_modified_ts]]</td> </tr> <template is ="dom-if" if="[[_result.deduped_from]]"> <tr> <td><b>Deduped from</b></td> <td> <a href$="[[_taskLink(_result.deduped_from)]]"> [[_result.deduped_from]] </a> </ td> </tr> </template> <tr> <td>Pending Time</td> <td>[[_pending(_result)]]</td> </tr> <tr> <td>Duration</td> <td>[[_result.human_duration]]</td> </tr> <tr> <td> Priority</td> <td>[[_request.priority]]</td> </tr> <tr> <td>User</td> <td>[[_req uest.user]]</td> </tr> <tr> <td>Authenticated</td> <td>[[_request.authenticated] ]</td> </tr> <template is="dom-if" if="[[_request.service_account]]"> <tr> <td>S ervice Account</td> <td>[[_request.service_account]]</td> </tr> </template> <tem plate is="dom-if" if="[[_request.properties.secret_bytes]]"> <tr> <td>Secret Byt es</td> <td>[[_request.properties.secret_bytes]]</td> </tr> </template> <templat e is="dom-if" if="[[_request.parent_task_id]]"> <tr> <td>Parent Task</td> <td> < a href$="[[_taskLink(_request.parent_task_id)]]">[[_request.parent_task_id]]</a> </td> </tr> </template> <tr> <td rowspan$="[[_rowspan(_request.properties.dimen sions)]]"> <a title="The list of bots that matches the list of dimensions" href$ ="[[_botListLink(_request.properties.dimensions)]]"> Requested Dimensions </a> < /td> </tr> <template is="dom-repeat" items="{{_request.properties.dimensions}}" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</td> </ tr> </template> <tr> <td>Isolated Inputs</td> <td> <a href$="[[_isolateLink(_req uest.properties.inputs_ref)]]"> [[_request.properties.inputs_ref.isolated]] </a> </td> </tr> <template is="dom-if" if="[[_not(_request_detail)]]"> <tr> <td>More Details</td> <td> <button on-click="_toggleDetails"> <iron-icon icon="icons:add -circle-outline"></iron-icon> </button> </td> </tr> </template> <template is="do m-if" if="[[_request_detail]]"> <tr> <td>Hide Details</td> <td> <button on-click ="_toggleDetails"> <iron-icon icon="icons:remove-circle-outline"></iron-icon> </ button> </td> </tr> </template> <template is="dom-if" if="[[_request_detail]]"> <tr> <td>Extra Args</td> <td class="code">[[_extraArgs(_request)]]</td> </tr> <t r> <td rowspan$="[[_rowspan(_request.tags)]]">Tags</td> </tr> <template is="dom- repeat" items="{{_request.tags}}" as="tag"> <tr> <td>[[tag]]</td> </tr> </templa te> <tr> <td>Execution timeout</td> <td>[[_humanDuration(_request.properties.exe cution_timeout_secs)]]</td> </tr> <tr> <td>I/O timeout</td> <td>[[_humanDuration (_request.properties.io_timeout_secs)]]</td> </tr> <tr> <td>Grace period</td> <t d>[[_humanDuration(_request.properties.grace_period_secs)]]</td> </tr> <tr> <td> CIPD server</td> <td> <a href$="[[_request.properties.cipd_input.server]]"> [[_r equest.properties.cipd_input.server]] </a> </td> </tr> <tr> <td>CIPD version</td > <td>[[_request.properties.cipd_input.client_package.version]]</td> </tr> <temp late is="dom-if" if="[[_wasPickedUp(_result)]]"> <tr> <td>CIPD package name</td> <td>[[_result.cipd_pins.client_package.package_name]]</td> </tr> </template> <t r hidden$="[[_not(_request.properties.cipd_input)]]"> <td rowspan$="[[_cipdRowsp an(_request,_result)]]">CIPD packages</td> </tr> <template is="dom-repeat" items ="[[_cipdPackages(_request,_result)]]" as="cipd"> <tr> <td>[[cipd.path]]/</td> < /tr> <tr> <td><b>Requested:</b>[[cipd.requested]]</td> </tr> <tr hidden$="[[_was NotPickedUp(_result)]]"> <td><b>Actual:</b>[[cipd.actual]]</td> </tr> </template > </template> </tbody></table> <div class="title">Task Execution</div> <template is="dom-if" if="[[_wasPickedUp(_result)]]"> <table> <tbody><tr> <td>Bot assigne d to task</td> <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]]</a ></td> </tr> <tr> <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> <a>Bot Di mensions</a> </td> </tr> <template is="dom-repeat" items="[[_result.bot_dimensio ns]]" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</ td> </tr> </template> <tr> <td>Exit code</td> <td>[[_result.exit_code]]</td> </t r> <tr> <td>Try number</td> <td>[[_result.try_number]]</td> </tr> <tr> <td>Failu re</td> <td class$="[[_failureClass(_result.failure)]]">[[_result.failure]]</td> </tr> <tr> <td>Internal Failure</td> <td class$="[[_internalClass(_result.inter nal_failure)]]">[[_result.internal_failure]]</td> </tr> <tr> <td>Isolated Output s</td> <td> <a href$="[[_isolateLink(_result.outputs_ref)]]"> [[_result.outputs_ ref.isolated]] </a> </td> </tr> <tr> <td>Bot version</td> <td>[[_result.bot_vers ion]]</td> </tr> <tr> <td>Server version</td> <td>[[_result.server_versions]]</t d> </tr> </tbody></table> </template> <template is="dom-if" if="[[_wasNotPickedU p(_result)]]"> This space left blank until a bot is assigned to the task. </temp late> <template is="dom-if" if="[[_result.performance_stats]]"> <div class="titl e">Performance Stats</div> <table> <tbody><tr> <td title="This includes time tak en to download inputs, isolate outputs, and setup CIPD">Total Overhead</td> <td> [[_humanDuration(_result.performance_stats.bot_overhead)]]</td> </tr> <tr> <td>D ownloading Inputs From Isolate</td> <td>[[_humanDuration(_result.performance_sta ts.isolated_download.duration)]]</td> </tr> <tr> <td>Uploading Outputs To Isolat e</td> <td>[[_humanDuration(_result.performance_stats.isolated_upload.duration)] ]</td> </tr> <tr> <td>Initial bot cache</td> <td>[[_result.performance_stats.iso lated_download.initial_number_items]] items; [[_bytes(_result.performance_stats. isolated_download.initial_size)]]</td> </tr> </tbody></table> </template> </div> <div class="flex right"> <div class="horizontal layout"> <div class="tabs"> <pa per-tabs selected="{{_show_raw}}" no-bar=""> <paper-tab disabled$="[[_noMilo(_re quest)]]">Milo Output</paper-tab> <paper-tab>Raw Output</paper-tab> </paper-tabs > </div> <paper-input class="refresh_input" label="Refresh Interval (seconds)" v alue="{{_refresh_interval}}" title="How often to refresh all information about t he task" auto-validate="" min="1" max="1000" pattern="[0-9]+"> </paper-input> </ div> <template is="dom-if" if="[[_supportsMilo(_request,_show_raw)]]"> <iframe i d="miloFrame" class="milo tabbed" src$="[[_getMiloLink(milo_prefix,task_id)]]">< /iframe> </template> <template is="dom-if" if="[[_show_raw]]"> <div class="code stdout tabbed">[[_stdout]]</div> </template> </div> </div> </div> </swarming-app > <paper-dialog id="prompt" modal="" on-iron-overlay-closed="_promptClosed"> <h2 >Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-button dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm="">Yes</paper-button> </div> </paper-dialog> <error -toast></error-toast> <interval-timer period="[[_refresh_interval]]" on-trigger= "_softRefresh"> </interval-timer> </template> <script>!function(){Polymer({is:"t ask-page",behaviors:[SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBeha vior],properties:{task_id:{type:String},client_id:{type:String},milo_prefix:{typ e:String},_dialogPrompt:{type:String,value:""},_refresh_interval:{type:Number},_ request:{type:Object,observer:"_requestUpdated"},_request_detail:{type:Boolean}, _result:{type:Object},_stdout:{type:String}},_alias:function(t){var e=t.value;re turn Array.isArray(e)||(e=[e]),swarming.alias.has(t.key)&&e.forEach(function(i,s ){e[s]=swarming.alias.apply(i,t.key)}),e.join(" | ")},_bytes:function(t){return sk.human.bytes(t)},_canCancelTask:function(t,e){return t&&"PENDING"===t.state&&e .cancel_task},_cancelTask:function(){var t="/_ah/api/swarming/v1/task/"+this.tas k_id+"/cancel";swarming.postWithToast(t,"Canceling task "+this.task_id,this._aut h_headers)},_cipdRowspan:function(t,e){if(!t||!t.properties||!t.properties.cipd_ input)return 0;var i=(t.properties.cipd_input.packages||[]).length;return i*=e&& e.cipd_pins&&e.cipd_pins.packages?3:2,i+1},_cipdPackages:function(t,e){if(!t||!t .properties||!t.properties.cipd_input)return[];var i=t.properties.cipd_input.pac kages||[],s=e&&e.cipd_pins&&e.cipd_pins.packages||[];return i.forEach(function(t ){t.requested=t.package_name+":"+t.version,s.forEach(function(e){e.path===t.path &&(t.actual=e.package_name+":"+e.version)})}),i},_expires:function(t){var e=pars eInt(t.expiration_secs);return e?sk.human.localeTime(new Date(t.created_ts.getTi me()+1e3*e)):t.expiration_secs+" seconds from created time"},_extraArgs:function (t){if(!t||!t.properties)return"";var e=t.properties.extra_args||[];return e.joi n(" ")},_failureClass:function(t){return t?"failed_task":""},_getMiloLink:functi on(t,e){if(t)return t+e},_internalClass:function(t){return t?"exception":""},_is olateLink:function(t){if(t&&t.isolatedserver)return t.isolatedserver+"/browse?na mespace="+t.namespace+"&hash="+t.isolated},_noMilo:function(t){return!this._tag( t,"allow_milo")},_pending:function(t){if(!t.created_ts)return"";var e=t.started_ ts||t.abandoned_ts||new Date;return e<=t.created_ts?"0s":this._timeDiffExact(t.c reated_ts,e)},_promptClosed:function(t){t.detail.confirmed&&(this._dialogPrompt. startsWith("cancel")?this._cancelTask():this._retryTask())},_promptCancel:functi on(){this.set("_dialogPrompt","cancel task "+this.task_id),this.$.prompt.open()} ,_promptRetry:function(){this.set("_dialogPrompt","retry task "+this.task_id),th is.$.prompt.open()},_refresh:function(){this.$.data.reload()},_requestUpdated:fu nction(t){this._noMilo(t)&&this.set("_show_raw",1)},_softRefresh:function(){if(! this._result||"RUNNING"===this._result.state||"PENDING"===this._result.state){th is.$.data.reload();var t=this.$$("iframe");t&&(t.src=this._getMiloLink(this.milo _prefix,this.task_id))}},_retryTask:function(){if(!this._request)return void sk. errorMessage("Task not yet loaded",3e3);var t={expiration_secs:this._request.exp iration_secs,name:this._request.name+" (retry)",parent_task_id:this._request.par ent_task_id,priority:this._request.priority,properties:this._request.properties, tags:this._request.tags,user:this._profile.email,service_account:this._request.s ervice_account};swarming.postWithToast("/_ah/api/swarming/v1/tasks/new","Retryin g task "+this.task_id,this._auth_headers,t).then(function(t){t=JSON.parse(t),t&& t.task_id&&this.set("task_id",t.task_id)}.bind(this),function(t){console.log("Ta sk could not be retried",t)})},_rowspan:function(t){return t=t||[],t.length+1},_ supportsMilo:function(t,e){return!e&&t&&this._tag(t,"allow_milo")},_state:functi on(t){return t?t.state===this.COMPLETED?t.failure?this.COMPLETED_FAILURE:"0"===t .try_number?this.COMPLETED_DEDUPED:this.COMPLETED_SUCCESS:t.state:""},_stateClas s:function(t){return this.stateClass(this._state(t))},_toggleDetails:function(){ this.set("_request_detail",!this._request_detail)},_tag:function(t,e){if(t&&t.ta gMap)return t.tagMap[e]},_wasPickedUp:function(t){return t&&t.state!==this.PENDI NG&&t.state!==this.CANCELED&&t.state!=this.EXPIRED},_wasNotPickedUp:function(t){ return t&&!this._wasPickedUp(t)}})}()</script> </dom-module></div></body></html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698