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

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

Issue 2497663003: Make silent task retries more obvious (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « no previous file | appengine/swarming/ui/res/imp/botlist/bot-list.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.7.0",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.7.0",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+"?)",c="(\\[\\[ |{{)\\s*",h="(?:]]|}})",u="(?:(!)\\s*)?",f=c+u+l+h;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],c=B oolean(t[2]),h=t[3].trim();"{"==l&&(a=h.indexOf("::"))>0&&(o=h.substring(a+2),h= h.substring(0,a),i=!0),r.push({compoundIndex:r.length,value:h,mode:l,negate:c,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),"slot"==s.localName&&(s=this._replaceSlotWithContent(s)),s. nodeType===Node.TEXT_NODE){for(var a=o;a&&a.nodeType===Node.TEXT_NODE;)s.textCon tent+=a.textContent,o=a.nextSibling,e.removeChild(a),a=o;r&&!s.textContent.trim( )&&(e.removeChild(s),i--)}if(s.parentNode){var l=this._parseNodeAnnotations(s,n, r);l&&(l.parent=t,l.index=i)}s=o,i++}},_replaceSlotWithContent:function(e){for(v ar t=e.ownerDocument.createElement("content");e.firstChild;)t.appendChild(e.firs tChild);for(var n=e.attributes,r=0;r<n.length;r++){var s=n[r];t.setAttribute(s.n ame,s.value)}var i=e.getAttribute("name"),o=i?"[slot='"+i+"']":":not([slot])";re turn t.setAttribute("select",o),e.parentNode.replaceChild(t,e),t},_parseTemplate :function(e,t,n,r){var s=document.createDocumentFragment();s._notes=this.parseAn notations(e),s.appendChild(e.content),n.push({bindings:Polymer.nar,events:Polyme r.nar,templateContent:s,parent:r,index:t})},_parseNodeAttributeAnnotations:funct ion(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.eve nts.push({name:o.slice(3),value:a})):(i=this._parseNodeAttributeAnnotation(e,o,a ))?t.bindings.push(i):"id"===o&&(t.id=a)}},_parseNodeAttributeAnnotation:functio n(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&&"attribu te"==i&&e.setAttribute(t,o),"input"===e.localName&&"value"===s&&e.setAttribute(s ,""),e.removeAttribute(s);var a=Polymer.CaseMap.dashToCamelCase(t);return"proper ty"===i&&(t=a),{kind:i,name:t,propertyName:a,parts:r,literal:o,isCompound:1!==r. length}}},findAnnotatedNode:function(e,t){var n=t.parent&&Polymer.Annotations.fi ndAnnotatedNode(e,t.parent);if(!n)return e;for(var r=n.firstChild,s=0;r;r=r.next Sibling)if(t.index===s++)return r}},function(){function e(e,t){return e.replace( a,function(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,c=l[s],u=0,f=c.length;u<f&&(i=c[u]);u++)"*"!==s &&t.localName!==s||(o=t.attributes[i],a=o&&o.value,a&&a.search(h)<0&&(o.value="s tyle"===i?e(a,r):n(a,r)))}function n(e,t){if(e&&c.test(e))return e;var n=s(t);re turn n.href=e,n.href||e}function r(e,t){return i||(i=document.implementation.cre ateHTMLDocument("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:[ "action"]},c=/(^\/)|(^#)|(^[\w-\d]*:)/,h=/\{\{|\[\[/;Polymer.ResolveUrl={resolve Css:e,resolveAttrs:t,resolveUrl:r}}(),Polymer.Path={root:function(e){var t=e.ind exOf(".");return t===-1?e:e.slice(0,t)},isDeep:function(e){return e.indexOf(".") !==-1},isAncestor:function(e,t){return 0===e.indexOf(t+".")},isDescendant:functi on(e,t){return 0===t.indexOf(e+".")},translate:function(e,t,n){return t+n.slice( e.length)},matches:function(e,t,n){return e===n||this.isAncestor(e,n)||Boolean(t )&&this.isDescendant(e,n)}},Polymer.Base._addFeature({_prepAnnotations:function( ){if(this._template){var e=this;Polymer.Annotations.prepElement=function(t){e._p repElement(t)},this._template._content&&this._template._content._notes?this._not es=this._template._content._notes:(this._notes=Polymer.Annotations.parseAnnotati ons(this._template),this._processAnnotations(this._notes)),Polymer.Annotations.p repElement=null}else this._notes=[]},_processAnnotations:function(e){for(var t=0 ;t<e.length;t++){for(var n=e[t],r=0;r<n.bindings.length;r++)for(var s=n.bindings [r],i=0;i<s.parts.length;i++){var o=s.parts[i];if(!o.literal){var a=this._parseM ethod(o.value);a?o.signature=a:o.model=Polymer.Path.root(o.value)}}if(n.template Content){this._processAnnotations(n.templateContent._notes);var l=n.templateCont ent._parentProps=this._discoverTemplateParentProps(n.templateContent._notes),c=[ ];for(var h in l){var u="_parent_"+h;c.push({index:n.index,kind:"property",name: u,propertyName:u,parts:[{mode:"{",model:h,value:h}]})}n.bindings=n.bindings.conc at(c)}}},_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(var a,l=0 ,c=s.parts;l<c.length&&(a=c[l]);l++)if(a.signature){for(var h=a.signature.args,u =0;u<h.length;u++){var f=h[u].model;f&&(n[f]=!0)}a.signature.dynamicFn&&(n[a.sig nature.method]=!0)}else a.model&&(n[a.model]=!0);if(t.templateContent){var p=t.t emplateContent._parentProps;Polymer.Base.mixin(n,p)}}return n},_prepElement:func tion(e){Polymer.ResolveUrl.resolveAttrs(e,this._template.ownerDocument)},_findAn notatedNode:Polymer.Annotations.findAnnotatedNode,_marshalAnnotationReferences:f unction(){this._template&&(this._marshalIdNodes(),this._marshalAnnotatedNodes(), this._marshalAnnotatedListeners())},_configureAnnotationReferences:function(){fo r(var e=this._notes,t=this._nodes,n=0;n<e.length;n++){var r=e[n],s=t[n];this._co nfigureTemplateContent(r,s),this._configureCompoundBindings(r,s)}},_configureTem plateContent:function(e,t){e.templateContent&&(t._content=e.templateContent)},_c onfigureCompoundBindings:function(e,t){for(var n=e.bindings,r=0;r<n.length;r++){ var s=n[r];if(s.isCompound){for(var i=t.__compoundStorage__||(t.__compoundStorag e__={}),o=s.parts,a=new Array(o.length),l=0;l<o.length;l++)a[l]=o[l].literal;var c=s.name;i[c]=a,s.literal&&"property"==s.kind&&(t._configValue?t._configValue(c ,s.literal):t[c]=s.literal)}}},_marshalIdNodes:function(){this.$={};for(var e,t= 0,n=this._notes.length;t<n&&(e=this._notes[t]);t++)e.id&&(this.$[e.id]=this._fin dAnnotatedNode(this.root,e))},_marshalAnnotatedNodes:function(){if(this._notes&& this._notes.length){for(var e=new Array(this._notes.length),t=0;t<this._notes.le ngth;t++)e[t]=this._findAnnotatedNode(this.root,this._notes[t]);this._nodes=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._findAnnotate dNode(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:function(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._recallEventH andler(this,t,e,n);r||(r=this._createEventHandler(e,t,n)),r._listening||(this._l isten(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.__boundL isteners=new WeakMap);var o=i.get(n);o||(o={},i.set(n,o));var a=this._boundListe nerKey(t,r);o[a]=s},_recallEventHandler:function(e,t,n,r){var s=e.__boundListene rs;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 defined"))} ;return s._listening=!1,this._recordEventHandler(r,t,e,n,s),s},unlisten:function (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:functi on(e,t,n){e.removeEventListener(t,n)}}),function(){"use strict";function e(e){fo r(var t,n=g?["click"]:m,r=0;r<n.length;r++)t=n[r],e?document.addEventListener(t, P,!0):document.removeEventListener(t,P,!0)}function t(){S.mouse.mouseIgnoreJob|| e(!0);var t=function(){e(),S.mouse.target=null,S.mouse.mouseIgnoreJob=null};S.mo use.mouseIgnoreJob=Polymer.Debounce(S.mouse.mouseIgnoreJob,t,d)}function n(e){va r t=e.type;if(m.indexOf(t)===-1)return!1;if("mousemove"===t){var n=void 0===e.bu ttons?1:e.buttons;return e instanceof window.MouseEvent&&!v&&(n=y[e.which]||0),B oolean(1&n)}var r=void 0===e.button?0:e.button;return 0===r}function r(e){if("cl ick"===e.type){if(0===e.detail)return!0;var t=C.findOriginalTarget(e),n=t.getBou ndingClientRect(),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("m ouseup",n)}function o(e){document.removeEventListener("mousemove",e.movefn),docu ment.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}var a=Polym er.DomApi.wrap,l="string"==typeof document.head.style.touchAction,c="__polymerGe stures",h="__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.s ourceCapabilities;if((!t||t.firesTouchEvents)&&(e[h]={skip:!0},"click"===e.type) ){for(var n=Polymer.dom(e).path,r=0;r<n.length;r++)if(n[r]===S.mouse.target)retu rn;e.preventDefault(),e.stopPropagation()}},S={mouse:{target:null,mouseIgnoreJob :null},touch:{x:0,y:0,id:-1,scrollDecided:!1}},C={gestures:{},recognizers:[],dee pTargetFind:function(e,t){for(var n=document.elementFromPoint(e,t),r=n;r&&r.shad owRoot;)r=r.shadowRoot.elementFromPoint(e,t),r&&(n=r);return n},findOriginalTarg et:function(e){return e.path?e.path[0]:e.target},handleNative:function(e){var n, r=e.type,s=a(e.currentTarget),i=s[c];if(i){var o=i[r];if(o){if(!e[h]&&(e[h]={}," touch"===r.slice(0,5))){var u=e.changedTouches[0];if("touchstart"===r&&1===e.tou ches.length&&(S.touch.id=u.identifier),S.touch.id!==u.identifier)return;l||"touc hstart"!==r&&"touchmove"!==r||C.handleTouchAction(e),"touchend"===r&&(S.mouse.ta rget=Polymer.dom(e).rootTarget,t())}if(n=e[h],!n.skip){for(var f,p=C.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.na me]&&(n[f.name]=!0,f[r](e))}}}},handleTouchAction:function(e){var t=e.changedTou ches[0],n=e.type;if("touchstart"===n)S.touch.x=t.clientX,S.touch.y=t.clientY,S.t ouch.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.a bs(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():C.prevent("track")}},add:function(e,t,n){e=a (e);var r=this.gestures[t],s=r.deps,i=r.name,o=e[c];o||(e[c]=o={});for(var l,h,u =0;u<s.length;u++)l=s[u],g&&m.indexOf(l)>-1&&"click"!==l||(h=o[l],h||(o[l]=h={_c ount:0}),0===h._count&&e.addEventListener(l,this.handleNative),h[i]=(h[i]||0)+1, h._count=(h._count||0)+1);e.addEventListener(t,n),r.touchAction&&this.setTouchAc tion(e,r.touchAction)},remove:function(e,t,n){e=a(e);var r=this.gestures[t],s=r. deps,i=r.name,o=e[c];if(o)for(var l,h,u=0;u<s.length;u++)l=s[u],h=o[l],h&&h[i]&& (h[i]=(h[i]||1)-1,h._count=(h._count||1)-1,0===h._count&&e.removeEventListener(l ,this.handleNative));e.removeEventListener(t,n)},register:function(e){this.recog nizers.push(e);for(var t=0;t<e.emits.length;t++)this.gestures[e.emits[t]]=e},fin dRecognizerByEvent:function(e){for(var t,n=0;n<this.recognizers.length;n++){t=th is.recognizers[n];for(var r,s=0;s<t.emits.length;s++)if(r=t.emits[s],r===e)retur n t}return null},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.defaultPrevented){var s=n.preventer||n.sourceEvent;s&&s.preventDefault &&s.preventDefault()}},prevent:function(e){var t=this.findRecognizerByEvent(e);t .info&&(t.info.prevent=!0)},resetMouseCanceller:function(){S.mouse.mouseIgnoreJo b&&S.mouse.mouseIgnoreJob.complete()}};C.register({name:"downup",deps:["mousedow n","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=C.findOriginalTarget(e),r=th is,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:functio n(e){this.fire("down",C.findOriginalTarget(e),e.changedTouches[0],e)},touchend:f unction(e){this.fire("up",C.findOriginalTarget(e),e.changedTouches[0],e)},fire:f unction(e,t,n,r){C.fire(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:r,p revent:function(e){return C.prevent(e)}})}}),C.register({name:"track",touchActio n:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mo usedown","touchstart"],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:funct ion(){this.info.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(thi s.info.x-e),r=Math.abs(this.info.y-t);return n>=p||r>=p},mousedown:function(e){i f(n(e)){var t=C.findOriginalTarget(e),r=this,s=function(e){var s=e.clientX,i=e.c lientY;r.hasMovedEnough(s,i)&&(r.info.state=r.info.started?"mouseup"===e.type?"e nd":"track":"start","start"===r.info.state&&C.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=fu nction(e){r.info.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.i nfo.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){var t=C.findOrigina lTarget(e),n=e.changedTouches[0],r=n.clientX,s=n.clientY;this.hasMovedEnough(r,s )&&("start"===this.info.state&&C.prevent("tap"),this.info.addMove({x:r,y:s}),thi s.fire(t,n),this.info.state="track",this.info.started=!0)},touchend:function(e){ var t=C.findOriginalTarget(e),n=e.changedTouches[0];this.info.started&&(this.inf o.state="end",this.info.addMove({x:n.clientX,y:n.clientY}),this.fire(t,n,e))},fi re:function(e,t,n){var r,s=this.info.moves[this.info.moves.length-2],i=this.info .moves[this.info.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),C.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 C.deepTargetFind(t.clientX,t.clientY)}})}}),C.register({name:"tap",deps:["mouse down","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],en d:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:functi on(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},save:function(e){this .info.x=e.clientX,this.info.y=e.clientY},mousedown:function(e){n(e)&&this.save(e )},click:function(e){n(e)&&this.forward(e)},touchstart:function(e){this.save(e.c hangedTouches[0],e)},touchend:function(e){this.forward(e.changedTouches[0],e)},f orward:function(e,t){var n=Math.abs(e.clientX-this.info.x),s=Math.abs(e.clientY- this.info.y),i=C.findOriginalTarget(e);(isNaN(n)||isNaN(s)||n<=f&&s<=f||r(e))&&( this.info.prevent||C.fire(i,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,prevent er:t}))}});var E={x:"pan-x",y:"pan-y",none:"none",all:"auto"};Polymer.Base._addF eature({_setupGestures:function(){this.__polymerGestures=null},_listen:function( e,t,n){C.gestures[t]?C.add(e,t,n):e.addEventListener(t,n)},_unlisten:function(e, t,n){C.gestures[t]?C.remove(e,t,n):e.removeEventListener(t,n)},setScrollDirectio n:function(e,t){t=t||this,C.setTouchAction(t,E[e]||"auto")}}),Polymer.Gestures=C }(),function(){"use strict";if(Polymer.Base._addFeature({$$:function(e){return P olymer.dom(this.root).querySelector(e)},toggleClass:function(e,t,n){n=n||this,1= =arguments.length&&(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.length&&(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.remove(e),t&&Polymer.dom(t).classList.add(e)},attributeFollows:funct ion(e,t,n){n&&Polymer.dom(n).removeAttribute(e),t&&Polymer.dom(t).setAttribute(e ,"")},getEffectiveChildNodes:function(){return Polymer.dom(this).getEffectiveChi ldNodes()},getEffectiveChildren:function(){var e=Polymer.dom(this).getEffectiveC hildNodes();return e.filter(function(e){return e.nodeType===Node.ELEMENT_NODE})} ,getEffectiveTextContent:function(){for(var e,t=this.getEffectiveChildNodes(),n= [],r=0;e=t[r];r++)e.nodeType!==Node.COMMENT_NODE&&n.push(Polymer.dom(e).textCont ent);return n.join("")},queryEffectiveChildren:function(e){var t=Polymer.dom(thi s).queryDistributedElements(e);return t&&t[0]},queryAllEffectiveChildren:functio n(e){return Polymer.dom(this).queryDistributedElements(e)},getContentChildNodes: function(e){var t=Polymer.dom(this.root).querySelector(e||"content");return t?Po lymer.dom(t).getDistributedNodes():[]},getContentChildren:function(e){return thi s.getContentChildNodes(e).filter(function(e){return e.nodeType===Node.ELEMENT_NO DE})},fire:function(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._useC ache,a=this._getEvent(e,s,i,o);return a.detail=t,o&&(this.__eventCache[e]=null), r.dispatchEvent(a),o&&(this.__eventCache[e]=a),a},__eventCache:{},_getEvent:func tion(e,t,n,r){var s=r&&this.__eventCache[e];return s&&s.bubbles==t&&s.cancelable ==n||(s=new Event(e,{bubbles:Boolean(t),cancelable:n})),s},async:function(e,t){v ar n=this;return Polymer.Async.run(function(){e.call(n)},t)},cancelAsync:functio n(e){Polymer.Async.cancel(e)},arrayDelete:function(e,t){var n;if(Array.isArray(e )){if(n=e.indexOf(t),n>=0)return e.splice(n,1)}else{var r=this._get(e);if(n=r.in dexOf(t),n>=0)return this.splice(e,n,1)}},transform:function(e,t){t=t||this,t.st yle.webkitTransform=e,t.style.transform=e},translate3d:function(e,t,n,r){r=r||th is,this.transform("translate3d("+e+","+t+","+n+")",r)},importHref:function(e,t,n ,r){var s=document.createElement("link");s.rel="import",s.href=e;var i=Polymer.B ase.importHref.imported=Polymer.Base.importHref.imported||{},o=i[s.href],a=o||s, l=this;if(t){var c=function(e){return e.target.__firedLoad=!0,e.target.removeEve ntListener("load",c),t.call(l,e)};a.addEventListener("load",c)}if(n){var h=funct ion(e){return e.target.__firedError=!0,e.target.removeEventListener("error",h),n .call(l,e)};a.addEventListener("error",h)}return o?(o.__firedLoad&&o.dispatchEve nt(new Event("load")),o.__firedError&&o.dispatchEvent(new Event("error"))):(i[s. href]=s,r=Boolean(r),r&&s.setAttribute("async",""),document.head.appendChild(s)) ,a},create:function(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()},isLocalDesce ndant:function(e){return this.root===Polymer.dom(e).getOwnerRoot()}}),!Polymer.S ettings.useNativeCustomElements){var e=Polymer.Base.importHref;Polymer.Base.impo rtHref=function(t,n,r,s){CustomElements.ready=!1;var i=function(e){if(CustomElem ents.upgradeDocumentTree(document),CustomElements.ready=!0,n)return n.call(this, e)};return e.call(this,t,i,r,s)}}}(),Polymer.Bind={prepareModel:function(e){Poly mer.Base.mixin(e,this._modelApi)},_modelApi:{_notifyChange:function(e,t,n){n=voi d 0===n?this[e]:n,t=t||Polymer.CaseMap.camelToDashCase(e)+"-changed",this.fire(t ,{value:n},{bubbles:!1,cancelable:!1,_useCache:!0})},_propertySetter:function(e, t,n,r){var s=this.__data__[e];return s===t||s!==s&&t!==t||(this.__data__[e]=t,"o bject"==typeof t&&this._clearPath(e),this._propertyChanged&&this._propertyChange d(e,t,s),n&&this._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.l ength;o<a&&(i=n[o]);o++)i.fn.call(this,e,this[e],i.effect,r,s)},_clearPath:funct ion(e){for(var t in this.__data__)Polymer.Path.isDescendant(e,t)&&(this.__data__ [t]=void 0)}},ensurePropertyEffects:function(e,t){e._propertyEffects||(e._proper tyEffects={});var n=e._propertyEffects[t];return n||(n=e._propertyEffects[t]=[]) ,n},addPropertyEffect:function(e,t,n,r){var s=this.ensurePropertyEffects(e,t),i= {kind:n,effect:r,fn:Polymer.Bind["_"+n+"Effect"]};return s.push(i),i},createBind ings:function(e){var t=e._propertyEffects;if(t)for(var n in t){var r=t[n];r.sort (this._sortPropertyEffects),this._createAccessors(e,n,r)}},_sortPropertyEffects: function(){var e={compute:0,annotation:1,annotatedComputation:2,reflect:3,notify :4,observer:5,complexObserver:6,function:7};return function(t,n){return e[t.kind ]-e[n.kind]}}(),_createAccessors:function(e,t,n){var r={get:function(){return th is.__data__[t]}},s=function(e){this._propertySetter(t,e,n)},i=e.getPropertyInfo& &e.getPropertyInfo(t);i&&i.readOnly?i.computed||(e["_set"+this.upper(t)]=s):r.se t=s,Object.defineProperty(e,t,r)},upper:function(e){return e[0].toUpperCase()+e. substring(1)},_addAnnotatedListener:function(e,t,n,r,s,i){e._bindListeners||(e._ bindListeners=[]);var o=this._notedListenerFactory(n,r,Polymer.Path.isDeep(r),i) ,a=s||Polymer.CaseMap.camelToDashCase(n)+"-changed";e._bindListeners.push({index :t,property:n,path:r,changedFn:o,event:a})},_isEventBogus:function(e,t){return e .path&&e.path[0]!==t},_notedListenerFactory:function(e,t,n,r){return function(s, i,o){if(o){var a=Polymer.Path.translate(e,t,o);this._notifyPath(a,i)}else i=s[e] ,r&&(i=!i),n?this.__data__[t]!=i&&this.set(t,i):this[t]=i}},prepareInstance:func tion(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];th is._addNotifyListener(i,e,t.event,t.changedFn)}},_addNotifyListener:function(e,t ,n,r){e.addEventListener(n,function(e){return t._notifyListener(r,e)})}},Polymer .Base.extend(Polymer.Bind,{_shouldAddListener:function(e){return e.name&&"attrib ute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode},_annotationE ffect: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.reflectProper tyToAttribute(e,n.attribute,t)},_notifyEffect:function(e,t,n,r,s){s||this._notif yChange(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=Polyme r.Bind._marshalArgs(this.__data__,n,e,t);s&&r.apply(this,s)}else n.dynamicFn||th is._warn(this._logf("_complexObserverEffect","observer method `"+n.method+"` not defined"))},_computeEffect:function(e,t,n){var r=this[n.method];if(r){var s=Pol ymer.Bind._marshalArgs(this.__data__,n,e,t);if(s){var i=r.apply(this,s);this.__s etProperty(n.name,i)}}else n.dynamicFn||this._warn(this._logf("_computeEffect"," compute method `"+n.method+"` not defined"))},_annotatedComputationEffect:functi on(e,t,n){var r=this._rootDataHost||this,s=r[n.method];if(s){var i=Polymer.Bind. _marshalArgs(this.__data__,n,e,t);if(i){var o=s.apply(r,i);this._applyEffectValu e(n,o)}}else n.dynamicFn||r._warn(r._logf("_annotatedComputationEffect","compute 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 c,h=i[a],u=h.n ame;if(h.literal?c=h.value:n===u?c=r:(c=e[u],void 0===c&&h.structured&&(c=Polyme r.Base._get(u,e))),o&&void 0===c)return;if(h.wildcard){var f=Polymer.Path.isAnce stor(n,u);s[a]={path:f?n:u,value:f?r:c,base:c}}else s[a]=c}return s}}),Polymer.B ase._addFeature({_addPropertyEffect:function(e,t,n){var r=Polymer.Bind.addProper tyEffect(this,e,t,n);r.pathFn=this["_"+r.kind+"PathEffect"]},_prepEffects:functi on(){Polymer.Bind.prepareModel(this),this._addAnnotationEffects(this._notes)},_p repBindings:function(){Polymer.Bind.createBindings(this)},_addPropertyEffects:fu nction(e){if(e)for(var t in e){var n=e[t];if(n.observer&&this._addObserverEffect (t,n.observer),n.computed&&(n.readOnly=!0,this._addComputedEffect(t,n.computed)) ,n.notify&&this._addPropertyEffect(t,"notify",{event:Polymer.CaseMap.camelToDash Case(t)+"-changed"}),n.reflectToAttribute){var r=Polymer.CaseMap.camelToDashCase (t);"-"===r[0]?this._warn(this._logf("_addPropertyEffects","Property "+t+" canno t be reflected to attribute "+r+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')):this._addPropert yEffect(t,"reflect",{attribute:r})}n.readOnly&&Polymer.Bind.ensurePropertyEffect s(this,t)}},_addComputedEffect:function(e,t){for(var n,r=this._parseMethod(t),s= r.dynamicFn,i=0;i<r.args.length&&(n=r.args[i]);i++)this._addPropertyEffect(n.mod el,"compute",{method:r.method,args:r.args,trigger:n,name:e,dynamicFn:s});s&&this ._addPropertyEffect(r.method,"compute",{method:r.method,args:r.args,trigger:null ,name:e,dynamicFn:s})},_addObserverEffect:function(e,t){this._addPropertyEffect( e,"observer",{method:t,property:e})},_addComplexObserverEffects:function(e){if(e )for(var t,n=0;n<e.length&&(t=e[n]);n++)this._addComplexObserverEffect(t)},_addC omplexObserverEffect:function(e){var t=this._parseMethod(e);if(!t)throw new Erro r("Malformed 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",{met hod:t.method,args:t.args,trigger:n,dynamicFn:r});r&&this._addPropertyEffect(t.me thod,"complexObserver",{method:t.method,args:t.args,trigger:null,dynamicFn:r})}, _addAnnotationEffects: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)},_ad dAnnotationEffect:function(e,t){Polymer.Bind._shouldAddListener(e)&&Polymer.Bind ._addAnnotatedListener(this,t,e.name,e.parts[0].value,e.parts[0].event,e.parts[0 ].negate);for(var n=0;n<e.parts.length;n++){var r=e.parts[n];r.signature?this._a ddAnnotatedComputationEffect(e,r,t):r.literal||("attribute"===e.kind&&"-"===e.na me[0]?this._warn(this._logf("_addAnnotationEffect","Cannot set attribute "+e.nam e+' because "-" is not a valid attribute starting character')):this._addProperty Effect(r.model,"annotation",{kind:e.kind,index:t,name:e.name,propertyName:e.prop ertyName,value:r.value,isCompound:e.isCompound,compoundIndex:r.compoundIndex,eve nt:r.event,customEvent:r.customEvent,negate:r.negate}))}},_addAnnotatedComputati onEffect:function(e,t,n){var r=t.signature;if(r.static)this.__addAnnotatedComput ationEffect("__static__",n,e,t,null);else{for(var s,i=0;i<r.args.length&&(s=r.ar gs[i]);i++)s.literal||this.__addAnnotatedComputationEffect(s.model,n,e,t,s);r.dy namicFn&&this.__addAnnotatedComputationEffect(r.method,n,e,t,null)}},__addAnnota tedComputationEffect:function(e,t,n,r,s){this._addPropertyEffect(e,"annotatedCom putation",{index:t,isCompound:n.isCompound,compoundIndex:r.compoundIndex,kind:n. kind,name:n.name,negate:r.negate,method:r.signature.method,args:r.signature.args ,trigger:s,dynamicFn:r.signature.dynamicFn})},_parseMethod:function(e){var t=e.m atch(/([^\s]+?)\(([\s\S]*)\)/);if(t){var n={method:t[1],static:!0};if(this.getPr opertyInfo(n.method)!==Polymer.nob&&(n.static=!1,n.dynamicFn=!0),t[2].trim()){va r r=t[2].replace(/\\,/g,"&comma;").split(",");return this._parseArgs(r,n)}return n.args=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:f unction(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}r eturn n.literal||(n.model=Polymer.Path.root(t),n.structured=Polymer.Path.isDeep( t),n.structured&&(n.wildcard=".*"==t.slice(-2),n.wildcard&&(n.name=t.slice(0,-2) ))),n},_marshalInstanceEffects:function(){Polymer.Bind.prepareInstance(this),thi s._bindListeners&&Polymer.Bind.setupBindListeners(this)},_applyEffectValue:funct ion(e,t){var n=this._nodes[e.index],r=e.name;if(t=this._computeFinalAnnotationVa lue(n,r,t,e),"attribute"==e.kind)this.serializeValueToAttribute(t,r,n);else{var s=n._propertyInfo&&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.isCompound){var s=e.__compoundStorage__[t];s[r.compoundIndex]=n,n=s.join("")}r eturn"attribute"!==r.kind&&("className"===t&&(n=this._scopeElementClass(e,n)),(" textContent"===t||"input"==e.localName&&"value"==t)&&(n=void 0==n?"":n)),n},_exe cuteStaticEffects:function(){this._propertyEffects&&this._propertyEffects.__stat ic__&&this._effectEffects("__static__",null,this._propertyEffects.__static__)}}) ,function(){var e=Polymer.Settings.usePolyfillProto;Polymer.Base._addFeature({_s etupConfigure: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:fun ction(e){var t=this._clientsReadied?this:this._config;this._setAttributeToProper ty(t,e)},_configValue:function(e,t){var n=this._propertyInfo[e];n&&n.readOnly||( this._config[e]=t)},_beforeClientsReady:function(){this._configure()},_configure :function(){this._configureAnnotationReferences(),this._configureInstancePropert ies(),this._aboveConfig=this.mixin({},this._config);for(var e={},t=0;t<this.beha viors.length;t++)this._configureProperties(this.behaviors[t].properties,e);this. _configureProperties(this.properties,e),this.mixin(e,this._aboveConfig),this._co nfig=e,this._clients&&this._clients.length&&this._distributeConfig(this._config) },_configureInstanceProperties:function(){for(var t in this._propertyEffects)!e& &this.hasOwnProperty(t)&&(this._configValue(t,this[t]), 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+"?)",c="(\\[\\[ |{{)\\s*",h="(?:]]|}})",u="(?:(!)\\s*)?",f=c+u+l+h;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],c=B oolean(t[2]),h=t[3].trim();"{"==l&&(a=h.indexOf("::"))>0&&(o=h.substring(a+2),h= h.substring(0,a),i=!0),r.push({compoundIndex:r.length,value:h,mode:l,negate:c,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),"slot"==s.localName&&(s=this._replaceSlotWithContent(s)),s. nodeType===Node.TEXT_NODE){for(var a=o;a&&a.nodeType===Node.TEXT_NODE;)s.textCon tent+=a.textContent,o=a.nextSibling,e.removeChild(a),a=o;r&&!s.textContent.trim( )&&(e.removeChild(s),i--)}if(s.parentNode){var l=this._parseNodeAnnotations(s,n, r);l&&(l.parent=t,l.index=i)}s=o,i++}},_replaceSlotWithContent:function(e){for(v ar t=e.ownerDocument.createElement("content");e.firstChild;)t.appendChild(e.firs tChild);for(var n=e.attributes,r=0;r<n.length;r++){var s=n[r];t.setAttribute(s.n ame,s.value)}var i=e.getAttribute("name"),o=i?"[slot='"+i+"']":":not([slot])";re turn t.setAttribute("select",o),e.parentNode.replaceChild(t,e),t},_parseTemplate :function(e,t,n,r){var s=document.createDocumentFragment();s._notes=this.parseAn notations(e),s.appendChild(e.content),n.push({bindings:Polymer.nar,events:Polyme r.nar,templateContent:s,parent:r,index:t})},_parseNodeAttributeAnnotations:funct ion(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.eve nts.push({name:o.slice(3),value:a})):(i=this._parseNodeAttributeAnnotation(e,o,a ))?t.bindings.push(i):"id"===o&&(t.id=a)}},_parseNodeAttributeAnnotation:functio n(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&&"attribu te"==i&&e.setAttribute(t,o),"input"===e.localName&&"value"===s&&e.setAttribute(s ,""),e.removeAttribute(s);var a=Polymer.CaseMap.dashToCamelCase(t);return"proper ty"===i&&(t=a),{kind:i,name:t,propertyName:a,parts:r,literal:o,isCompound:1!==r. length}}},findAnnotatedNode:function(e,t){var n=t.parent&&Polymer.Annotations.fi ndAnnotatedNode(e,t.parent);if(!n)return e;for(var r=n.firstChild,s=0;r;r=r.next Sibling)if(t.index===s++)return r}},function(){function e(e,t){return e.replace( a,function(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,c=l[s],u=0,f=c.length;u<f&&(i=c[u]);u++)"*"!==s &&t.localName!==s||(o=t.attributes[i],a=o&&o.value,a&&a.search(h)<0&&(o.value="s tyle"===i?e(a,r):n(a,r)))}function n(e,t){if(e&&c.test(e))return e;var n=s(t);re turn n.href=e,n.href||e}function r(e,t){return i||(i=document.implementation.cre ateHTMLDocument("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:[ "action"]},c=/(^\/)|(^#)|(^[\w-\d]*:)/,h=/\{\{|\[\[/;Polymer.ResolveUrl={resolve Css:e,resolveAttrs:t,resolveUrl:r}}(),Polymer.Path={root:function(e){var t=e.ind exOf(".");return t===-1?e:e.slice(0,t)},isDeep:function(e){return e.indexOf(".") !==-1},isAncestor:function(e,t){return 0===e.indexOf(t+".")},isDescendant:functi on(e,t){return 0===t.indexOf(e+".")},translate:function(e,t,n){return t+n.slice( e.length)},matches:function(e,t,n){return e===n||this.isAncestor(e,n)||Boolean(t )&&this.isDescendant(e,n)}},Polymer.Base._addFeature({_prepAnnotations:function( ){if(this._template){var e=this;Polymer.Annotations.prepElement=function(t){e._p repElement(t)},this._template._content&&this._template._content._notes?this._not es=this._template._content._notes:(this._notes=Polymer.Annotations.parseAnnotati ons(this._template),this._processAnnotations(this._notes)),Polymer.Annotations.p repElement=null}else this._notes=[]},_processAnnotations:function(e){for(var t=0 ;t<e.length;t++){for(var n=e[t],r=0;r<n.bindings.length;r++)for(var s=n.bindings [r],i=0;i<s.parts.length;i++){var o=s.parts[i];if(!o.literal){var a=this._parseM ethod(o.value);a?o.signature=a:o.model=Polymer.Path.root(o.value)}}if(n.template Content){this._processAnnotations(n.templateContent._notes);var l=n.templateCont ent._parentProps=this._discoverTemplateParentProps(n.templateContent._notes),c=[ ];for(var h in l){var u="_parent_"+h;c.push({index:n.index,kind:"property",name: u,propertyName:u,parts:[{mode:"{",model:h,value:h}]})}n.bindings=n.bindings.conc at(c)}}},_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(var a,l=0 ,c=s.parts;l<c.length&&(a=c[l]);l++)if(a.signature){for(var h=a.signature.args,u =0;u<h.length;u++){var f=h[u].model;f&&(n[f]=!0)}a.signature.dynamicFn&&(n[a.sig nature.method]=!0)}else a.model&&(n[a.model]=!0);if(t.templateContent){var p=t.t emplateContent._parentProps;Polymer.Base.mixin(n,p)}}return n},_prepElement:func tion(e){Polymer.ResolveUrl.resolveAttrs(e,this._template.ownerDocument)},_findAn notatedNode:Polymer.Annotations.findAnnotatedNode,_marshalAnnotationReferences:f unction(){this._template&&(this._marshalIdNodes(),this._marshalAnnotatedNodes(), this._marshalAnnotatedListeners())},_configureAnnotationReferences:function(){fo r(var e=this._notes,t=this._nodes,n=0;n<e.length;n++){var r=e[n],s=t[n];this._co nfigureTemplateContent(r,s),this._configureCompoundBindings(r,s)}},_configureTem plateContent:function(e,t){e.templateContent&&(t._content=e.templateContent)},_c onfigureCompoundBindings:function(e,t){for(var n=e.bindings,r=0;r<n.length;r++){ var s=n[r];if(s.isCompound){for(var i=t.__compoundStorage__||(t.__compoundStorag e__={}),o=s.parts,a=new Array(o.length),l=0;l<o.length;l++)a[l]=o[l].literal;var c=s.name;i[c]=a,s.literal&&"property"==s.kind&&(t._configValue?t._configValue(c ,s.literal):t[c]=s.literal)}}},_marshalIdNodes:function(){this.$={};for(var e,t= 0,n=this._notes.length;t<n&&(e=this._notes[t]);t++)e.id&&(this.$[e.id]=this._fin dAnnotatedNode(this.root,e))},_marshalAnnotatedNodes:function(){if(this._notes&& this._notes.length){for(var e=new Array(this._notes.length),t=0;t<this._notes.le ngth;t++)e[t]=this._findAnnotatedNode(this.root,this._notes[t]);this._nodes=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._findAnnotate dNode(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:function(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._recallEventH andler(this,t,e,n);r||(r=this._createEventHandler(e,t,n)),r._listening||(this._l isten(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.__boundL isteners=new WeakMap);var o=i.get(n);o||(o={},i.set(n,o));var a=this._boundListe nerKey(t,r);o[a]=s},_recallEventHandler:function(e,t,n,r){var s=e.__boundListene rs;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 defined"))} ;return s._listening=!1,this._recordEventHandler(r,t,e,n,s),s},unlisten:function (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:functi on(e,t,n){e.removeEventListener(t,n)}}),function(){"use strict";function e(e){fo r(var t,n=g?["click"]:m,r=0;r<n.length;r++)t=n[r],e?document.addEventListener(t, P,!0):document.removeEventListener(t,P,!0)}function t(){S.mouse.mouseIgnoreJob|| e(!0);var t=function(){e(),S.mouse.target=null,S.mouse.mouseIgnoreJob=null};S.mo use.mouseIgnoreJob=Polymer.Debounce(S.mouse.mouseIgnoreJob,t,d)}function n(e){va r t=e.type;if(m.indexOf(t)===-1)return!1;if("mousemove"===t){var n=void 0===e.bu ttons?1:e.buttons;return e instanceof window.MouseEvent&&!v&&(n=y[e.which]||0),B oolean(1&n)}var r=void 0===e.button?0:e.button;return 0===r}function r(e){if("cl ick"===e.type){if(0===e.detail)return!0;var t=C.findOriginalTarget(e),n=t.getBou ndingClientRect(),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("m ouseup",n)}function o(e){document.removeEventListener("mousemove",e.movefn),docu ment.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}var a=Polym er.DomApi.wrap,l="string"==typeof document.head.style.touchAction,c="__polymerGe stures",h="__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.s ourceCapabilities;if((!t||t.firesTouchEvents)&&(e[h]={skip:!0},"click"===e.type) ){for(var n=Polymer.dom(e).path,r=0;r<n.length;r++)if(n[r]===S.mouse.target)retu rn;e.preventDefault(),e.stopPropagation()}},S={mouse:{target:null,mouseIgnoreJob :null},touch:{x:0,y:0,id:-1,scrollDecided:!1}},C={gestures:{},recognizers:[],dee pTargetFind:function(e,t){for(var n=document.elementFromPoint(e,t),r=n;r&&r.shad owRoot;)r=r.shadowRoot.elementFromPoint(e,t),r&&(n=r);return n},findOriginalTarg et:function(e){return e.path?e.path[0]:e.target},handleNative:function(e){var n, r=e.type,s=a(e.currentTarget),i=s[c];if(i){var o=i[r];if(o){if(!e[h]&&(e[h]={}," touch"===r.slice(0,5))){var u=e.changedTouches[0];if("touchstart"===r&&1===e.tou ches.length&&(S.touch.id=u.identifier),S.touch.id!==u.identifier)return;l||"touc hstart"!==r&&"touchmove"!==r||C.handleTouchAction(e),"touchend"===r&&(S.mouse.ta rget=Polymer.dom(e).rootTarget,t())}if(n=e[h],!n.skip){for(var f,p=C.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.na me]&&(n[f.name]=!0,f[r](e))}}}},handleTouchAction:function(e){var t=e.changedTou ches[0],n=e.type;if("touchstart"===n)S.touch.x=t.clientX,S.touch.y=t.clientY,S.t ouch.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.a bs(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():C.prevent("track")}},add:function(e,t,n){e=a (e);var r=this.gestures[t],s=r.deps,i=r.name,o=e[c];o||(e[c]=o={});for(var l,h,u =0;u<s.length;u++)l=s[u],g&&m.indexOf(l)>-1&&"click"!==l||(h=o[l],h||(o[l]=h={_c ount:0}),0===h._count&&e.addEventListener(l,this.handleNative),h[i]=(h[i]||0)+1, h._count=(h._count||0)+1);e.addEventListener(t,n),r.touchAction&&this.setTouchAc tion(e,r.touchAction)},remove:function(e,t,n){e=a(e);var r=this.gestures[t],s=r. deps,i=r.name,o=e[c];if(o)for(var l,h,u=0;u<s.length;u++)l=s[u],h=o[l],h&&h[i]&& (h[i]=(h[i]||1)-1,h._count=(h._count||1)-1,0===h._count&&e.removeEventListener(l ,this.handleNative));e.removeEventListener(t,n)},register:function(e){this.recog nizers.push(e);for(var t=0;t<e.emits.length;t++)this.gestures[e.emits[t]]=e},fin dRecognizerByEvent:function(e){for(var t,n=0;n<this.recognizers.length;n++){t=th is.recognizers[n];for(var r,s=0;s<t.emits.length;s++)if(r=t.emits[s],r===e)retur n t}return null},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.defaultPrevented){var s=n.preventer||n.sourceEvent;s&&s.preventDefault &&s.preventDefault()}},prevent:function(e){var t=this.findRecognizerByEvent(e);t .info&&(t.info.prevent=!0)},resetMouseCanceller:function(){S.mouse.mouseIgnoreJo b&&S.mouse.mouseIgnoreJob.complete()}};C.register({name:"downup",deps:["mousedow n","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=C.findOriginalTarget(e),r=th is,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:functio n(e){this.fire("down",C.findOriginalTarget(e),e.changedTouches[0],e)},touchend:f unction(e){this.fire("up",C.findOriginalTarget(e),e.changedTouches[0],e)},fire:f unction(e,t,n,r){C.fire(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:r,p revent:function(e){return C.prevent(e)}})}}),C.register({name:"track",touchActio n:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mo usedown","touchstart"],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:funct ion(){this.info.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(thi s.info.x-e),r=Math.abs(this.info.y-t);return n>=p||r>=p},mousedown:function(e){i f(n(e)){var t=C.findOriginalTarget(e),r=this,s=function(e){var s=e.clientX,i=e.c lientY;r.hasMovedEnough(s,i)&&(r.info.state=r.info.started?"mouseup"===e.type?"e nd":"track":"start","start"===r.info.state&&C.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=fu nction(e){r.info.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.i nfo.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){var t=C.findOrigina lTarget(e),n=e.changedTouches[0],r=n.clientX,s=n.clientY;this.hasMovedEnough(r,s )&&("start"===this.info.state&&C.prevent("tap"),this.info.addMove({x:r,y:s}),thi s.fire(t,n),this.info.state="track",this.info.started=!0)},touchend:function(e){ var t=C.findOriginalTarget(e),n=e.changedTouches[0];this.info.started&&(this.inf o.state="end",this.info.addMove({x:n.clientX,y:n.clientY}),this.fire(t,n,e))},fi re:function(e,t,n){var r,s=this.info.moves[this.info.moves.length-2],i=this.info .moves[this.info.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),C.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 C.deepTargetFind(t.clientX,t.clientY)}})}}),C.register({name:"tap",deps:["mouse down","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],en d:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:functi on(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},save:function(e){this .info.x=e.clientX,this.info.y=e.clientY},mousedown:function(e){n(e)&&this.save(e )},click:function(e){n(e)&&this.forward(e)},touchstart:function(e){this.save(e.c hangedTouches[0],e)},touchend:function(e){this.forward(e.changedTouches[0],e)},f orward:function(e,t){var n=Math.abs(e.clientX-this.info.x),s=Math.abs(e.clientY- this.info.y),i=C.findOriginalTarget(e);(isNaN(n)||isNaN(s)||n<=f&&s<=f||r(e))&&( this.info.prevent||C.fire(i,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,prevent er:t}))}});var E={x:"pan-x",y:"pan-y",none:"none",all:"auto"};Polymer.Base._addF eature({_setupGestures:function(){this.__polymerGestures=null},_listen:function( e,t,n){C.gestures[t]?C.add(e,t,n):e.addEventListener(t,n)},_unlisten:function(e, t,n){C.gestures[t]?C.remove(e,t,n):e.removeEventListener(t,n)},setScrollDirectio n:function(e,t){t=t||this,C.setTouchAction(t,E[e]||"auto")}}),Polymer.Gestures=C }(),function(){"use strict";if(Polymer.Base._addFeature({$$:function(e){return P olymer.dom(this.root).querySelector(e)},toggleClass:function(e,t,n){n=n||this,1= =arguments.length&&(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.length&&(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.remove(e),t&&Polymer.dom(t).classList.add(e)},attributeFollows:funct ion(e,t,n){n&&Polymer.dom(n).removeAttribute(e),t&&Polymer.dom(t).setAttribute(e ,"")},getEffectiveChildNodes:function(){return Polymer.dom(this).getEffectiveChi ldNodes()},getEffectiveChildren:function(){var e=Polymer.dom(this).getEffectiveC hildNodes();return e.filter(function(e){return e.nodeType===Node.ELEMENT_NODE})} ,getEffectiveTextContent:function(){for(var e,t=this.getEffectiveChildNodes(),n= [],r=0;e=t[r];r++)e.nodeType!==Node.COMMENT_NODE&&n.push(Polymer.dom(e).textCont ent);return n.join("")},queryEffectiveChildren:function(e){var t=Polymer.dom(thi s).queryDistributedElements(e);return t&&t[0]},queryAllEffectiveChildren:functio n(e){return Polymer.dom(this).queryDistributedElements(e)},getContentChildNodes: function(e){var t=Polymer.dom(this.root).querySelector(e||"content");return t?Po lymer.dom(t).getDistributedNodes():[]},getContentChildren:function(e){return thi s.getContentChildNodes(e).filter(function(e){return e.nodeType===Node.ELEMENT_NO DE})},fire:function(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._useC ache,a=this._getEvent(e,s,i,o);return a.detail=t,o&&(this.__eventCache[e]=null), r.dispatchEvent(a),o&&(this.__eventCache[e]=a),a},__eventCache:{},_getEvent:func tion(e,t,n,r){var s=r&&this.__eventCache[e];return s&&s.bubbles==t&&s.cancelable ==n||(s=new Event(e,{bubbles:Boolean(t),cancelable:n})),s},async:function(e,t){v ar n=this;return Polymer.Async.run(function(){e.call(n)},t)},cancelAsync:functio n(e){Polymer.Async.cancel(e)},arrayDelete:function(e,t){var n;if(Array.isArray(e )){if(n=e.indexOf(t),n>=0)return e.splice(n,1)}else{var r=this._get(e);if(n=r.in dexOf(t),n>=0)return this.splice(e,n,1)}},transform:function(e,t){t=t||this,t.st yle.webkitTransform=e,t.style.transform=e},translate3d:function(e,t,n,r){r=r||th is,this.transform("translate3d("+e+","+t+","+n+")",r)},importHref:function(e,t,n ,r){var s=document.createElement("link");s.rel="import",s.href=e;var i=Polymer.B ase.importHref.imported=Polymer.Base.importHref.imported||{},o=i[s.href],a=o||s, l=this;if(t){var c=function(e){return e.target.__firedLoad=!0,e.target.removeEve ntListener("load",c),t.call(l,e)};a.addEventListener("load",c)}if(n){var h=funct ion(e){return e.target.__firedError=!0,e.target.removeEventListener("error",h),n .call(l,e)};a.addEventListener("error",h)}return o?(o.__firedLoad&&o.dispatchEve nt(new Event("load")),o.__firedError&&o.dispatchEvent(new Event("error"))):(i[s. href]=s,r=Boolean(r),r&&s.setAttribute("async",""),document.head.appendChild(s)) ,a},create:function(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()},isLocalDesce ndant:function(e){return this.root===Polymer.dom(e).getOwnerRoot()}}),!Polymer.S ettings.useNativeCustomElements){var e=Polymer.Base.importHref;Polymer.Base.impo rtHref=function(t,n,r,s){CustomElements.ready=!1;var i=function(e){if(CustomElem ents.upgradeDocumentTree(document),CustomElements.ready=!0,n)return n.call(this, e)};return e.call(this,t,i,r,s)}}}(),Polymer.Bind={prepareModel:function(e){Poly mer.Base.mixin(e,this._modelApi)},_modelApi:{_notifyChange:function(e,t,n){n=voi d 0===n?this[e]:n,t=t||Polymer.CaseMap.camelToDashCase(e)+"-changed",this.fire(t ,{value:n},{bubbles:!1,cancelable:!1,_useCache:!0})},_propertySetter:function(e, t,n,r){var s=this.__data__[e];return s===t||s!==s&&t!==t||(this.__data__[e]=t,"o bject"==typeof t&&this._clearPath(e),this._propertyChanged&&this._propertyChange d(e,t,s),n&&this._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.l ength;o<a&&(i=n[o]);o++)i.fn.call(this,e,this[e],i.effect,r,s)},_clearPath:funct ion(e){for(var t in this.__data__)Polymer.Path.isDescendant(e,t)&&(this.__data__ [t]=void 0)}},ensurePropertyEffects:function(e,t){e._propertyEffects||(e._proper tyEffects={});var n=e._propertyEffects[t];return n||(n=e._propertyEffects[t]=[]) ,n},addPropertyEffect:function(e,t,n,r){var s=this.ensurePropertyEffects(e,t),i= {kind:n,effect:r,fn:Polymer.Bind["_"+n+"Effect"]};return s.push(i),i},createBind ings:function(e){var t=e._propertyEffects;if(t)for(var n in t){var r=t[n];r.sort (this._sortPropertyEffects),this._createAccessors(e,n,r)}},_sortPropertyEffects: function(){var e={compute:0,annotation:1,annotatedComputation:2,reflect:3,notify :4,observer:5,complexObserver:6,function:7};return function(t,n){return e[t.kind ]-e[n.kind]}}(),_createAccessors:function(e,t,n){var r={get:function(){return th is.__data__[t]}},s=function(e){this._propertySetter(t,e,n)},i=e.getPropertyInfo& &e.getPropertyInfo(t);i&&i.readOnly?i.computed||(e["_set"+this.upper(t)]=s):r.se t=s,Object.defineProperty(e,t,r)},upper:function(e){return e[0].toUpperCase()+e. substring(1)},_addAnnotatedListener:function(e,t,n,r,s,i){e._bindListeners||(e._ bindListeners=[]);var o=this._notedListenerFactory(n,r,Polymer.Path.isDeep(r),i) ,a=s||Polymer.CaseMap.camelToDashCase(n)+"-changed";e._bindListeners.push({index :t,property:n,path:r,changedFn:o,event:a})},_isEventBogus:function(e,t){return e .path&&e.path[0]!==t},_notedListenerFactory:function(e,t,n,r){return function(s, i,o){if(o){var a=Polymer.Path.translate(e,t,o);this._notifyPath(a,i)}else i=s[e] ,r&&(i=!i),n?this.__data__[t]!=i&&this.set(t,i):this[t]=i}},prepareInstance:func tion(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];th is._addNotifyListener(i,e,t.event,t.changedFn)}},_addNotifyListener:function(e,t ,n,r){e.addEventListener(n,function(e){return t._notifyListener(r,e)})}},Polymer .Base.extend(Polymer.Bind,{_shouldAddListener:function(e){return e.name&&"attrib ute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode},_annotationE ffect: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.reflectProper tyToAttribute(e,n.attribute,t)},_notifyEffect:function(e,t,n,r,s){s||this._notif yChange(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=Polyme r.Bind._marshalArgs(this.__data__,n,e,t);s&&r.apply(this,s)}else n.dynamicFn||th is._warn(this._logf("_complexObserverEffect","observer method `"+n.method+"` not defined"))},_computeEffect:function(e,t,n){var r=this[n.method];if(r){var s=Pol ymer.Bind._marshalArgs(this.__data__,n,e,t);if(s){var i=r.apply(this,s);this.__s etProperty(n.name,i)}}else n.dynamicFn||this._warn(this._logf("_computeEffect"," compute method `"+n.method+"` not defined"))},_annotatedComputationEffect:functi on(e,t,n){var r=this._rootDataHost||this,s=r[n.method];if(s){var i=Polymer.Bind. _marshalArgs(this.__data__,n,e,t);if(i){var o=s.apply(r,i);this._applyEffectValu e(n,o)}}else n.dynamicFn||r._warn(r._logf("_annotatedComputationEffect","compute 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 c,h=i[a],u=h.n ame;if(h.literal?c=h.value:n===u?c=r:(c=e[u],void 0===c&&h.structured&&(c=Polyme r.Base._get(u,e))),o&&void 0===c)return;if(h.wildcard){var f=Polymer.Path.isAnce stor(n,u);s[a]={path:f?n:u,value:f?r:c,base:c}}else s[a]=c}return s}}),Polymer.B ase._addFeature({_addPropertyEffect:function(e,t,n){var r=Polymer.Bind.addProper tyEffect(this,e,t,n);r.pathFn=this["_"+r.kind+"PathEffect"]},_prepEffects:functi on(){Polymer.Bind.prepareModel(this),this._addAnnotationEffects(this._notes)},_p repBindings:function(){Polymer.Bind.createBindings(this)},_addPropertyEffects:fu nction(e){if(e)for(var t in e){var n=e[t];if(n.observer&&this._addObserverEffect (t,n.observer),n.computed&&(n.readOnly=!0,this._addComputedEffect(t,n.computed)) ,n.notify&&this._addPropertyEffect(t,"notify",{event:Polymer.CaseMap.camelToDash Case(t)+"-changed"}),n.reflectToAttribute){var r=Polymer.CaseMap.camelToDashCase (t);"-"===r[0]?this._warn(this._logf("_addPropertyEffects","Property "+t+" canno t be reflected to attribute "+r+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')):this._addPropert yEffect(t,"reflect",{attribute:r})}n.readOnly&&Polymer.Bind.ensurePropertyEffect s(this,t)}},_addComputedEffect:function(e,t){for(var n,r=this._parseMethod(t),s= r.dynamicFn,i=0;i<r.args.length&&(n=r.args[i]);i++)this._addPropertyEffect(n.mod el,"compute",{method:r.method,args:r.args,trigger:n,name:e,dynamicFn:s});s&&this ._addPropertyEffect(r.method,"compute",{method:r.method,args:r.args,trigger:null ,name:e,dynamicFn:s})},_addObserverEffect:function(e,t){this._addPropertyEffect( e,"observer",{method:t,property:e})},_addComplexObserverEffects:function(e){if(e )for(var t,n=0;n<e.length&&(t=e[n]);n++)this._addComplexObserverEffect(t)},_addC omplexObserverEffect:function(e){var t=this._parseMethod(e);if(!t)throw new Erro r("Malformed 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",{met hod:t.method,args:t.args,trigger:n,dynamicFn:r});r&&this._addPropertyEffect(t.me thod,"complexObserver",{method:t.method,args:t.args,trigger:null,dynamicFn:r})}, _addAnnotationEffects: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)},_ad dAnnotationEffect:function(e,t){Polymer.Bind._shouldAddListener(e)&&Polymer.Bind ._addAnnotatedListener(this,t,e.name,e.parts[0].value,e.parts[0].event,e.parts[0 ].negate);for(var n=0;n<e.parts.length;n++){var r=e.parts[n];r.signature?this._a ddAnnotatedComputationEffect(e,r,t):r.literal||("attribute"===e.kind&&"-"===e.na me[0]?this._warn(this._logf("_addAnnotationEffect","Cannot set attribute "+e.nam e+' because "-" is not a valid attribute starting character')):this._addProperty Effect(r.model,"annotation",{kind:e.kind,index:t,name:e.name,propertyName:e.prop ertyName,value:r.value,isCompound:e.isCompound,compoundIndex:r.compoundIndex,eve nt:r.event,customEvent:r.customEvent,negate:r.negate}))}},_addAnnotatedComputati onEffect:function(e,t,n){var r=t.signature;if(r.static)this.__addAnnotatedComput ationEffect("__static__",n,e,t,null);else{for(var s,i=0;i<r.args.length&&(s=r.ar gs[i]);i++)s.literal||this.__addAnnotatedComputationEffect(s.model,n,e,t,s);r.dy namicFn&&this.__addAnnotatedComputationEffect(r.method,n,e,t,null)}},__addAnnota tedComputationEffect:function(e,t,n,r,s){this._addPropertyEffect(e,"annotatedCom putation",{index:t,isCompound:n.isCompound,compoundIndex:r.compoundIndex,kind:n. kind,name:n.name,negate:r.negate,method:r.signature.method,args:r.signature.args ,trigger:s,dynamicFn:r.signature.dynamicFn})},_parseMethod:function(e){var t=e.m atch(/([^\s]+?)\(([\s\S]*)\)/);if(t){var n={method:t[1],static:!0};if(this.getPr opertyInfo(n.method)!==Polymer.nob&&(n.static=!1,n.dynamicFn=!0),t[2].trim()){va r r=t[2].replace(/\\,/g,"&comma;").split(",");return this._parseArgs(r,n)}return n.args=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:f unction(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}r eturn n.literal||(n.model=Polymer.Path.root(t),n.structured=Polymer.Path.isDeep( t),n.structured&&(n.wildcard=".*"==t.slice(-2),n.wildcard&&(n.name=t.slice(0,-2) ))),n},_marshalInstanceEffects:function(){Polymer.Bind.prepareInstance(this),thi s._bindListeners&&Polymer.Bind.setupBindListeners(this)},_applyEffectValue:funct ion(e,t){var n=this._nodes[e.index],r=e.name;if(t=this._computeFinalAnnotationVa lue(n,r,t,e),"attribute"==e.kind)this.serializeValueToAttribute(t,r,n);else{var s=n._propertyInfo&&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.isCompound){var s=e.__compoundStorage__[t];s[r.compoundIndex]=n,n=s.join("")}r eturn"attribute"!==r.kind&&("className"===t&&(n=this._scopeElementClass(e,n)),(" textContent"===t||"input"==e.localName&&"value"==t)&&(n=void 0==n?"":n)),n},_exe cuteStaticEffects:function(){this._propertyEffects&&this._propertyEffects.__stat ic__&&this._effectEffects("__static__",null,this._propertyEffects.__static__)}}) ,function(){var e=Polymer.Settings.usePolyfillProto;Polymer.Base._addFeature({_s etupConfigure: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:fun ction(e){var t=this._clientsReadied?this:this._config;this._setAttributeToProper ty(t,e)},_configValue:function(e,t){var n=this._propertyInfo[e];n&&n.readOnly||( this._config[e]=t)},_beforeClientsReady:function(){this._configure()},_configure :function(){this._configureAnnotationReferences(),this._configureInstancePropert ies(),this._aboveConfig=this.mixin({},this._config);for(var e={},t=0;t<this.beha viors.length;t++)this._configureProperties(this.behaviors[t].properties,e);this. _configureProperties(this.properties,e),this.mixin(e,this._aboveConfig),this._co nfig=e,this._clients&&this._clients.length&&this._distributeConfig(this._config) },_configureInstanceProperties:function(){for(var t in this._propertyEffects)!e& &this.hasOwnProperty(t)&&(this._configValue(t,this[t]),
3 delete this[t])},_configureProperties:function(e,t){for(var n in e){var r=e[n];i f(void 0!==r.value){var s=r.value;"function"==typeof s&&(s=s.call(this,this._con fig)),t[n]=s}}},_distributeConfig:function(e){var t=this._propertyEffects;if(t)f or(var n in e){var r=t[n];if(r)for(var s,i=0,o=r.length;i<o&&(s=r[i]);i++)if("an notation"===s.kind){var a=this._nodes[s.effect.index],l=s.effect.propertyName,c= "attribute"==s.effect.kind,h=a._propertyEffects&&a._propertyEffects[l];if(a._con figValue&&(h||!c)){var u=n===s.effect.value?e[n]:this._get(s.effect.value,e);u=t his._computeFinalAnnotationValue(a,l,u,s.effect),c&&(u=a.deserialize(this.serial ize(u),a._propertyInfo[l].type)),a._configValue(l,u)}}}},_afterClientsReady:func tion(){this._executeStaticEffects(),this._applyConfig(this._config,this._aboveCo nfig),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(!Po lymer.Bind._isEventBogus(t,t.target)){var n,r;if(t.detail&&(n=t.detail.value,r=t .detail.path),this._clientsReadied)return e.call(this,t.target,n,r);this._queueH andler([e,t.target,n,r])}},_queueHandler:function(e){this._handlers.push(e)},_fl ushHandlers: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 ";var e=Polymer.Path;Polymer.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:function(e,t,n){var r=this._propertySetter(e,t);if(r!==t& &(r===r||t===t))return this._pathEffector(e,t),n||this._notifyPathUp(e,t),!0},_g etPathParts:function(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)for (var r=e[n].toString().split("."),s=0;s<r.length;s++)t.push(r[s]);return t}retur n e.toString().split(".")},set:function(e,t,n){var r,s=n||this,i=this._getPathPa rts(e),o=i[i.length-1];if(i.length>1){for(var a=0;a<i.length-1;a++){var l=i[a];i f(r&&"#"==l[0]?s=Polymer.Collection.get(r).getItem(l):(s=s[l],r&&parseInt(l,10)= =l&&(i[a]=Polymer.Collection.get(r).getKey(s))),!s)return;r=Array.isArray(s)?s:n ull}if(r){var c,h,u=Polymer.Collection.get(r);"#"==o[0]?(h=o,c=u.getItem(h),o=r. indexOf(c),u.setItem(h,t)):parseInt(o,10)==o&&(c=s[o],h=u.getKey(c),i[a]=h,u.set Item(h,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._getP athParts(e),o=0;o<i.length;o++){if(!s)return;var a=i[o];r&&"#"==a[0]?s=Polymer.C ollection.get(r).getItem(a):(s=s[a],n&&r&&parseInt(a,10)==a&&(i[o]=Polymer.Colle ction.get(r).getKey(s))),r=Array.isArray(s)?s:null}return n&&(n.path=i.join(".") ),s},_pathEffector:function(t,n){var r=e.root(t),s=this._propertyEffects&&this._ propertyEffects[r];if(s)for(var i,o=0;o<s.length&&(i=s[o]);o++){var a=i.pathFn;a &&a.call(this,t,n,i.effect)}this._boundPaths&&this._notifyBoundPaths(t,n)},_anno tationPathEffect:function(t,n,r){if(e.matches(r.value,!1,t))Polymer.Bind._annota tionEffect.call(this,t,n,r);else if(!r.negate&&e.isDescendant(r.value,t)){var s= this._nodes[r.index];if(s&&s._notifyPath){var i=e.translate(r.value,r.name,t);s. _notifyPath(i,n,!0)}}},_complexObserverPathEffect:function(t,n,r){e.matches(r.tr igger.name,r.trigger.wildcard,t)&&Polymer.Bind._complexObserverEffect.call(this, t,n,r)},_computePathEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wi ldcard,t)&&Polymer.Bind._computeEffect.call(this,t,n,r)},_annotatedComputationPa thEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wildcard,t)&&Polymer .Bind._annotatedComputationEffect.call(this,t,n,r)},linkPaths:function(e,t){this ._boundPaths=this._boundPaths||{},t?this._boundPaths[e]=t:this.unlinkPaths(e)},u nlinkPaths:function(e){this._boundPaths&&delete this._boundPaths[e]},_notifyBoun dPaths:function(t,n){for(var r in this._boundPaths){var s=this._boundPaths[r];e. isDescendant(r,t)?this._notifyPath(e.translate(r,s,t),n):e.isDescendant(s,t)&&th is._notifyPath(e.translate(s,r,t),n)}},_notifyPathUp:function(t,n){var r=e.root( t),s=Polymer.CaseMap.camelToDashCase(r),i=s+this._EVENT_CHANGED;this.fire(i,{pat h:t,value:n},{bubbles:!1,_useCache:!0})},_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),indexSplices:n},s=t+".splices";this._notifyPath(s,r),this._notifyPath(t+".l ength",e.length),this.__data__[s]={keySplices:null,indexSplices:null}},_notifySp lice:function(e,t,n,r,s){this._notifySplices(e,t,[{index:n,addedCount:r,removed: s,object:e,type:"splice"}])},push:function(e){var t={},n=this._get(e,this,t),r=A rray.prototype.slice.call(arguments,1),s=n.length,i=n.push.apply(n,r);return r.l ength&&this._notifySplice(n,t.path,s,r.length,[]),i},pop:function(e){var t={},n= this._get(e,this,t),r=Boolean(n.length),s=Array.prototype.slice.call(arguments,1 ),i=n.pop.apply(n,s);return r&&this._notifySplice(n,t.path,n.length,0,[i]),i},sp lice: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=Math.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.leng th),s=Array.prototype.slice.call(arguments,1),i=n.shift.apply(n,s);return r&&thi s._notifySplice(n,t.path,0,0,[i]),i},unshift:function(e){var t={},n=this._get(e, this,t),r=Array.prototype.slice.call(arguments,1),s=n.unshift.apply(n,r);return r.length&&this._notifySplice(n,t.path,0,r.length,[]),s},prepareModelNotifyPath:f unction(e){this.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._notifyPath,_notifyPathUp:Polymer.Base._notifyPathUp,_pathEffector:Polymer .Base._pathEffector,_annotationPathEffect:Polymer.Base._annotationPathEffect,_co mplexObserverPathEffect:Polymer.Base._complexObserverPathEffect,_annotatedComput ationPathEffect:Polymer.Base._annotatedComputationPathEffect,_computePathEffect: Polymer.Base._computePathEffect,_notifyBoundPaths:Polymer.Base._notifyBoundPaths ,_getPathParts:Polymer.Base._getPathParts})}})}(),Polymer.Base._addFeature({reso lveUrl:function(e){var t=Polymer.DomModule.import(this.is),n="";if(t){var r=t.ge tAttribute("assetpath")||"";n=Polymer.ResolveUrl.resolveUrl(r,t.ownerDocument.ba seURI)}return Polymer.ResolveUrl.resolveUrl(e,n)}}),Polymer.CssParse=function(){ return{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.r ules.length-1];n={start:r+1,parent:i,previous:o},i.rules.push(n);break;case this .CLOSE_BRACE:n.end=r+1,n=n.parent||t}return t},_parseCss:function(e,t){var n=t.s ubstring(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._expa ndUnicodeEscapes(n),n=n.replace(this._rx.multipleSpaces," "),n=n.substring(n.las tIndexOf(";")+1);var s=e.parsedSelector=e.selector=n.trim();e.atRule=0===s.index Of(this.AT_START),e.atRule?0===s.indexOf(this.MEDIA_START)?e.type=this.types.MED IA_RULE:s.match(this._rx.keyframesRule)&&(e.type=this.types.KEYFRAMES_RULE,e.key framesName=e.selector.split(this._rx.multipleSpaces).pop()):0===s.indexOf(this.V AR_START)?e.type=this.types.MIXIN_RULE:e.type=this.types.STYLE_RULE}var i=e.rule s;if(i)for(var o,a=0,l=i.length;a<l&&(o=i[a]);a++)this._parseCss(o,t);return e}, _expandUnicodeEscapes:function(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,funct ion(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e})},stringify :function(e,t,n){n=n||"";var r="";if(e.cssText||e.rules){var s=e.rules;if(s&&!th is._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 =this.removeCustomPropAssignment(e),this.removeCustomPropApply(e)},removeCustomP ropAssignment:function(e){return e.replace(this._rx.customProp,"").replace(this. _rx.mixinProp,"")},removeCustomPropApply:function(e){return e.replace(this._rx.m ixinApply,"").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]|$)?/ gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]* keyframes/,multipleSpaces:/\s+/g},VAR_START:"--",MEDIA_START:"@media",AT_START:" @"}}(),Polymer.StyleUtil=function(){var e=Polymer.Settings;return{NATIVE_VARIABL ES:Polymer.Settings.useNativeCSSProperties,MODULE_STYLES_SELECTOR:"style, link[r el=import][type~=css], template",INCLUDE_ATTR:"include",toCssText:function(e,t){ return"string"==typeof e&&(e=this.parser.parse(e)),t&&this.forEachRule(e,t),this .parser.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)},for ActiveRulesInStyles: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.__cssR ules&&e.textContent&&(e.__cssRules=this.parser.parse(e.textContent)),e.__cssRule s},isKeyframesSelector:function(e){return e.parent&&e.parent.type===this.ruleTyp es.KEYFRAMES_RULE},forEachRuleInStyle:function(e,t,n,r){var s,i,o=this.rulesForS tyle(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.ruleTy pes.MEDIA_RULE){var i=e.selector.match(this.rx.MEDIA_MATCH);i&&(window.matchMedi a(i[1]).matches||(s=!0))}e.type===this.ruleTypes.STYLE_RULE?t(e):n&&e.type===thi s.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,c=o.length;l<c&&(a=o[l]);l++)this.forEachRule(a, t,n,r)}},applyCss:function(e,t,n,r){var s=this.createScopeStyle(e,t);return this .applyStyle(s,n,r)},applyStyle:function(e,t,n){t=t||document.head;var r=n&&n.nex tSibling||t.firstChild;return this.__lastHeadApplyNode=e,t.insertBefore(e,r)},cr eateScopeStyle:function(e,t){var n=document.createElement("style");return t&&n.s etAttribute("scope",t),n.textContent=e,n},__lastHeadApplyNode:null,applyStylePla ceHolder:function(e){var t=document.createComment(" Shady DOM styles for "+e+" " ),n=this.__lastHeadApplyNode?this.__lastHeadApplyNode.nextSibling:null,r=documen t.head;return r.insertBefore(t,n||r.firstChild),this.__lastHeadApplyNode=t,t},cs sFromModules: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=Polym er.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._cssTe xt||""},cssFromElement:function(e){for(var t,n="",r=e.content||e,s=Polymer.TreeA pi.arrayCopy(r.querySelectorAll(this.MODULE_STYLES_SELECTOR)),i=0;i<s.length;i++ )if(t=s[i],"template"===t.localName)t.hasAttribute("preserve-content")||(n+=this .cssFromElement(t));else if("style"===t.localName){var o=t.getAttribute(this.INC LUDE_ATTR);o&&(n+=this.cssFromModules(o,!0)),t=t.__appliedElement||t,t.parentNod e.removeChild(t),n+=this.resolveCss(t.textContent,e.ownerDocument)}else t.import &&t.import.body&&(n+=this.resolveCss(t.import.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)retu rn this.getCssBuildType(t)},getCssBuildType:function(e){return e.getAttribute("c ss-build")},_findMatchingParen:function(e,t){for(var n=0,r=t,s=e.length;r<s;r++) switch(e[r]){case"(":n++;break;case")":if(0===--n)return r}return-1},processVari ableAndFallback:function(e,t){var n=e.indexOf("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.substring(r+1),t),a=s.indexOf(",");if(a=== -1)return t(i,s.trim(),"",o);var l=s.substring(0,a).trim(),c=s.substring(a+1).tr im();return t(i,l,c,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:/@media[^(]*(\([^)]*\))/,IS_VAR:/^--/,BRACKETE D:/\{[^}]*\}/g,HOST_PREFIX:"(?:^|[^.#[:])",HOST_SUFFIX:"($|[.:[\\s>+~])"},resolv eCss:Polymer.ResolveUrl.resolveCss,parser:Polymer.CssParse,ruleTypes:Polymer.Css Parse.types}}(),Polymer.StyleTransformer=function(){var e=Polymer.StyleUtil,t=Po lymer.Settings,n={dom:function(e,t,n,r){this._transformDom(e,t||"",n,r)},_transf ormDom: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++)this._transformDom(s[i],t,n,r)},element:fu nction(e,t,n,s){if(n)s?e.removeAttribute(r):e.setAttribute(r,t);else if(t)if(e.c lassList)s?(e.classList.remove(r),e.classList.remove(t)):(e.classList.add(r),e.c lassList.add(t));else if(e.getAttribute){var i=e.getAttribute(g);s?i&&e.setAttri bute(g,i.replace(r,"").replace(t,"")):e.setAttribute(g,(i?i+" ":"")+r+" "+t)}},e lementStyles:function(n,r){var s,i=n._styles,o="",a=n.__cssBuild,l=t.useNativeSh adow||"shady"===a;if(l){var h=this;s=function(e){e.selector=h._slottedToContent( e.selector),e.selector=e.selector.replace(c,":host > *"),r&&r(e)}}for(var u,f=0, p=i.length;f<p&&(u=i[f]);f++){var _=e.rulesForStyle(u);o+=l?e.toCssText(_,s):thi s.css(_,n.is,n.extends,r,n._scopeCssViaAttr)+"\n\n"}return o.trim()},css:functio n(t,n,r,s,i){var o=this._calcHostScope(n,r);n=this._calcElementScope(n,i);var a= this;return e.toCssText(t,function(e){e.isScoped||(a.rule(e,n,o),e.isScoped=!0), s&&s(e,n,o)})},_calcElementScope:function(e,t){return e?t?m+e+y:d+e:""},_calcHos tScope:function(e,t){return t?"[is="+e+"]":e},rule:function(e,t,n){this._transfo rmRule(e,this._transformComplexSelector,t,n)},_transformRule:function(e,t,n,r){e .selector=e.transformedSelector=this._transformRuleCss(e,t,n,r)},_transformRuleC ss:function(t,n,r,s){var o=t.selector.split(i);if(!e.isKeyframesSelector(t))for( var a,l=0,c=o.length;l<c&&(a=o[l]);l++)o[l]=n.call(this,a,r,s);return o.join(i)} ,_transformComplexSelector:function(e,t,n){var r=!1,s=!1,a=this;return e=e.trim( ),e=this._slottedToContent(e),e=e.replace(c,":host > *"),e=e.replace(P,l+" $1"), e=e.replace(o,function(e,i,o){if(r)o=o.replace(_," ");else{var l=a._transformCom poundSelector(o,i,t,n);r=r||l.stop,s=s||l.hostContext,i=l.combinator,o=l.value}r eturn 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.ind exOf(u)>=0?i=!0:e.indexOf(l)>=0?e=this._transformHostSelector(e,r):0!==s&&(e=n?t his._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}},_transfor mSimpleSelector:function(e,t){var n=e.split(v);return n[0]+=t,n.join(v)},_transf ormHostSelector:function(e,t){var n=e.match(h),r=n&&n[2].trim()||"";if(r){if(r[0 ].match(a))return e.replace(h,function(e,n,r){return t+r});var s=r.split(a)[0];r eturn s===t?r:S}return e.replace(l,t)},documentRule:function(e){e.selector=e.par sedSelector,this.normalizeRootSelector(e),t.useNativeShadow||this._transformRule (e,this._transformDocumentSelector)},normalizeRootSelector:function(e){e.selecto r=e.selector.replace(c,"html")},_transformDocumentSelector:function(e){return e. match(_)?this._transformComplexSelector(e,s):this._transformSimpleSelector(e.tri m(),s)},_slottedToContent:function(e){return e.replace(C,p+"> $1")},SCOPE_NAME:" style-scope"},r=n.SCOPE_NAME,s=":not(["+r+"]):not(."+r+")",i=",",o=/(^|[\s>+~]+) ((?:\[.+?\]|[^\s>+~=\[])+)/g,a=/[[.:#*]/,l=":host",c=":root",h=/(:host)(?:\(((?: \([^)(]*\)|[^)(]*)+?)\))/,u=":host-context",f=/(.*)(?::host-context)(?:\(((?:\([ ^)(]*\)|[^)(]*)+?)\))(.*)/,p="::content",_=/::content|::shadow|\/deep\//,d=".",m ="["+r+"~=",y="]",v=":",g="class",P=new RegExp("^("+p+")"),S="should_not_match", C=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g;return n}(),Polymer.StyleExt ends=function(){var e=Polymer.StyleUtil;return{hasExtends:function(e){return Boo lean(e.match(this.rx.EXTEND))},transform:function(t){var n=e.rulesForStyle(t),r= this;return e.forEachRule(n,function(e){if(r._mapRuleOntoParent(e),e.parent)for( var t;t=r.rx.EXTEND.exec(e.cssText);){var n=t[1],s=r._findExtendor(n,e);s&&r._ex tendRule(e,s)}e.cssText=e.cssText.replace(r.rx.EXTEND,"")}),e.toCssText(n,functi on(e){e.selector.match(r.rx.STRIP)&&(e.cssText="")},!0)},_mapRuleOntoParent:func tion(e){if(e.parent){for(var t,n=e.parent.map||(e.parent.map={}),r=e.selector.sp lit(","),s=0;s<r.length;s++)t=r[s],n[t.trim()]=e;return n}},_findExtendor:functi on(e,t){return t.parent&&t.parent.map&&t.parent.map[e]||this._findExtendor(e,t.p arent)},_extendRule:function(e,t){e.parent!==t.parent&&this._cloneAndAddRuleToPa rent(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)},_cloneAnd AddRuleToParent:function(e,t){e=Object.create(e),e.parent=t,e.extends&&(e.extend s=e.extends.slice()),t.rules.push(e)},rx:{EXTEND:/@extends\(([^)]*)\)\s*?;/gim,S TRIP:/%[^,]*$/}}}(),Polymer.ApplyShim=function(){"use strict";function e(e,t){e= e.trim(),m[e]={properties:t,dependants:{}}}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}function 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.sli ce(1).join(":")),a[t]=r));return a}function s(e){var t=y.__currentElementProto,n =t&&t.is;for(var r in e.dependants)r!==n&&(e.dependants[r].__applyShimInvalid=!0 )}function i(n,i,o,a){if(o&&c.processVariableAndFallback(o,function(e,n){n&&t(n) &&(a="@apply "+n+";")}),!a)return n;var h=l(a),u=n.slice(0,n.indexOf("--")),f=r( h),p=f,_=t(i),m=_&&_.properties;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.__current ElementProto;o&&(i.dependants[o.is]=o);var a,l,c;for(a in i.properties)c=r&&r[a] ,l=[a,": var(",n,d,a],c&&l.push(",",c),l.push(")"),s.push(l.join(""))}return s.j oin("; ")}function l(e){for(var t;t=h.exec(e);){var n=t[0],s=t[1],i=t.index,o=i+ n.indexOf("@apply"),l=i+n.length,c=e.slice(0,o),u=e.slice(l),f=r(c),p=a(s,f);e=[ c,p,u].join(""),h.lastIndex=i+p.length}return e}var c=Polymer.StyleUtil,h=c.rx.M IXIN_MATCH,u=c.rx.VAR_ASSIGN,f=/var\(\s*(--[^,]*),\s*(--[^)]*)\)/g,p=/;\s*/m,_=/ ^\s*(initial)|(inherit)\s*$/,d="_-_",m={},y={_measureElement:null,_map:m,_separa tor:d,transform:function(e,t){this.__currentElementProto=t,c.forRulesInStyles(e, this._boundFindDefinitions),c.forRulesInStyles(e,this._boundFindApplications),t& &(t.__applyShimInvalid=!1),this.__currentElementProto=null},_findDefinitions:fun ction(e){var t=e.parsedCssText;t=t.replace(f,o),t=t.replace(u,i),e.cssText=t,":r oot"===e.selector&&(e.selector=":host > *")},_findApplications:function(e){e.css Text=l(e.cssText)},transformRule:function(e){this._findDefinitions(e),this._find Applications(e)},_getInitialValueForProperty:function(e){return this._measureEle ment||(this._measureElement=document.createElement("meta"),this._measureElement. style.all="initial",document.head.appendChild(this._measureElement)),window.getC omputedStyle(this._measureElement).getPropertyValue(e)}};return y._boundTransfor mRule=y.transformRule.bind(y),y._boundFindDefinitions=y._findDefinitions.bind(y) ,y._boundFindApplications=y._findApplications.bind(y),y}(),function(){var e=Poly mer.Base._prepElement,t=Polymer.Settings.useNativeShadow,n=Polymer.StyleUtil,r=P olymer.StyleTransformer,s=Polymer.StyleExtends,i=Polymer.ApplyShim,o=Polymer.Set tings;Polymer.Base._addFeature({_prepElement:function(t){this._encapsulateStyle& &"shady"!==this.__cssBuild&&r.element(t,this.is,this._scopeCssViaAttr),e.call(th is,t)},_prepStyles:function(){void 0===this._encapsulateStyle&&(this._encapsulat eStyle=!t),t||(this._scopeStyle=n.applyStylePlaceHolder(this.is)),this.__cssBuil d=n.cssBuildTypeForModule(this.is)},_prepShimStyles:function(){if(this._template ){var e=n.isTargetedBuild(this.__cssBuild);if(o.useNativeCSSProperties&&"shadow" ===this.__cssBuild&&e)return;this._styles=this._styles||this._collectStyles(),o. useNativeCSSProperties&&!this.__cssBuild&&i.transform(this._styles,this);var s=o .useNativeCSSProperties&&e?this._styles.length&&this._styles[0].textContent.trim ():r.elementStyles(this);this._prepStyleProperties(),!this._needsStyleProperties ()&&s&&n.applyCss(s,this.is,t?this._template.content:null,this._scopeStyle)}else this._styles=[]},_collectStyles: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.cssFrom Module(this.is);var l=this._template&&this._template.parentNode;if(!this._templa te||l&&l.id.toLowerCase()===this.is||(t+=n.cssFromElement(this._template)),t){va r c=document.createElement("style");c.textContent=t,s.hasExtends(c.textContent)& &(t=s.transform(c)),e.push(c)}return e},_elementAdd:function(e){this._encapsulat eStyle&&(e.__styleScoped?e.__styleScoped=!1:r.dom(e,this.is,this._scopeCssViaAtt r))},_elementRemove:function(e){this._encapsulateStyle&&r.dom(e,this.is,this._sc opeCssViaAttr,!0)},scopeSubtree:function(e,n){if(!t){var r=this,s=function(e){if (e.nodeType===Node.ELEMENT_NODE){var t=e.getAttribute("class");e.setAttribute("c lass",r._scopeElementClass(e,t));for(var n,s=e.querySelectorAll("*"),i=0;i<s.len gth&&(n=s[i]);i++)t=n.getAttribute("class"),n.setAttribute("class",r._scopeEleme ntClass(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}}}})}(),Poly mer.StyleProperties=function(){"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.Style Util,r=Polymer.StyleTransformer,s=navigator.userAgent.match("Trident"),i=Polymer .Settings;return{decorateStyles:function(e,t){var s=this,i={},o=[],a=0,l=r._calc HostScope(t.is,t.extends);n.forRulesInStyles(e,function(e,r){s.decorateRule(e),e .index=a++,s.whenHostOrRootRule(t,e,r,function(r){if(e.parent.type===n.ruleTypes .MEDIA_RULE&&(t.__notStyleScopeCacheable=!0),r.isHost){var s=r.selector.split(" ").some(function(e){return 0===e.indexOf(l)&&e.length!==l.length});t.__notStyleS copeCacheable=t.__notStyleScopeCacheable||s}}),s.collectPropertiesInCssText(e.pr opertyInfo.cssText,i)},function(e){o.push(e)}),e._keyframes=o;var c=[];for(var h in i)c.push(h);return c},decorateRule:function(e){if(e.propertyInfo)return e.pr opertyInfo;var t={},n={},r=this.collectProperties(e,n);return r&&(t.properties=n ,e.rules=null),t.cssText=this.collectCssText(e),e.propertyInfo=t,t},collectPrope rties:function(e,t){var n=e.propertyInfo;if(!n){for(var r,s,i,o=this.rx.VAR_ASSI GN,a=e.parsedCssText;r=o.exec(a);)s=(r[2]||r[3]).trim(),"inherit"!==s&&(t[r[1].t rim()]=s),i=!0;return i}if(n.properties)return Polymer.Base.mixin(t,n.properties ),!0},collectCssText:function(e){return this.collectConsumingCssText(e.parsedCss Text)},collectConsumingCssText:function(e){return e.replace(this.rx.BRACKETED,"" ).replace(this.rx.VAR_ASSIGN,"")},collectPropertiesInCssText:function(e,t){for(v ar n;n=this.rx.VAR_CONSUMED.exec(e);){var r=n[1];":"!==n[2]&&(t[r]=!0)}},reify:f unction(e){for(var t,n=Object.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.inde xOf(";")>=0)e=this.valueForProperties(e,t);else{var r=this,s=function(e,n,s,i){v ar o=r.valueForProperty(t[n],t);return o&&"initial"!==o?"apply-shim-inherit"===o &&(o="inherit"):o=r.valueForProperty(t[s]||s,t)||s,e+(o||"")+i};e=n.processVaria bleAndFallback(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.las tIndex=0,r=this.rx.MIXIN_MATCH.exec(n))n=this.valueForProperty(t[r[1]],t);else{v ar o=n.indexOf(":");if(o!==-1){var a=n.substring(o);a=a.trim(),a=this.valueForPr operty(a,t)||a,n=n.substring(0,o)+a}}s[i]=n&&n.lastIndexOf(";")===n.length-1?n.s lice(0,-1):n||""}return s.join(";")},applyProperties:function(e,t){var n="";e.pr opertyInfo||this.decorateRule(e),e.propertyInfo.cssText&&(n=this.valueForPropert ies(e.propertyInfo.cssText,t)),e.cssText=n},applyKeyframeTransforms:function(e,t ){var n=e.cssText,r=e.cssText;if(null==e.hasAnimations&&(e.hasAnimations=this.rx .ANIMATION_MATCH.test(n)),e.hasAnimations){var s;if(null==e.keyframeNamesToTrans form){e.keyframeNamesToTransform=[];for(var i in t)s=t[i],r=s(n),n!==r&&(n=r,e.k eyframeNamesToTransform.push(i))}else{for(var o=0;o<e.keyframeNamesToTransform.l ength;++o)s=t[e.keyframeNamesToTransform[o]],n=s(n);r=n}}e.cssText=r},propertyDa taFromStyles:function(r,s){var i={},o=this,a=[];return n.forActiveRulesInStyles( r,function(n){n.propertyInfo||o.decorateRule(n);var r=n.transformedSelector||n.p arsedSelector;s&&n.propertyInfo.properties&&r&&t.call(s,r)&&(o.collectProperties (n,i),e(n.index,a))}),{properties:i,key:a}},_rootSelector:/:root|:host\s*>\s*\*/ ,_checkRoot:function(e,t){return Boolean(t.match(this._rootSelector))||"html"=== e&&t.indexOf("html")>-1},whenHostOrRootRule:function(e,t,n,s){if(t.propertyInfo| |self.decorateRule(t),t.propertyInfo.properties){var o=e.is?r._calcHostScope(e.i s,e.extends):"html",a=t.parsedSelector,l=this._checkRoot(o,a),c=!l&&0===a.indexO f(":host"),h=e.__cssBuild||n.__cssBuild;if("shady"===h&&(l=a===o+" > *."+o||a.in dexOf("html")>-1,c=!l&&0===a.indexOf(o)),l||c){var u=o;c&&(i.useNativeShadow&&!t .transformedSelector&&(t.transformedSelector=r._transformRuleCss(t,r._transformC omplexSelector,e.is,o)),u=t.transformedSelector||t.parsedSelector),l&&"html"===o &&(u=t.transformedSelector||t.parsedSelector),s({selector:u,isHost:c,isRoot:l})} }},hostAndRootPropertiesForScope:function(e){var r={},s={},i=this;return n.forAc tiveRulesInStyles(e._styles,function(n,o){i.whenHostOrRootRule(e,n,o,function(o) {var a=e._element||e;t.call(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._calcHostScope(e.is,e.extends),a=e.extends?"\\"+o.slice(0, -1)+"\\]":o,l=new RegExp(this.rx.HOST_PREFIX+a+this.rx.HOST_SUFFIX),c=this._elem entKeyframeTransforms(e,n);return r.elementStyles(e,function(r){s.applyPropertie s(r,t),i.useNativeShadow||Polymer.StyleUtil.isKeyframesSelector(r)||!r.cssText|| (s.applyKeyframeTransforms(r,c),s._scopeSelector(r,l,o,e._scopeCssViaAttr,n))})} ,_elementKeyframeTransforms:function(e,t){var n=e._styles._keyframes,r={};if(!i. useNativeShadow&&n)for(var s=0,o=n[s];s<n.length;o=n[++s])this._scopeKeyframes(o ,t),r[o.keyframesName]=this._keyframesRuleTransformer(o);return r},_keyframesRul eTransformer:function(e){return function(t){return t.replace(e.keyframesNameRx,e .transformedKeyframesName)}},_scopeKeyframes:function(e,t){e.keyframesNameRx=new RegExp(e.keyframesName,"g"),e.transformedKeyframesName=e.keyframesName+"-"+t,e. transformedSelector=e.transformedSelector||e.selector,e.selector=e.transformedSe lector.replace(e.keyframesName,e.transformedKeyframesName)},_scopeSelector:funct ion(e,t,n,s,i){e.transformedSelector=e.transformedSelector||e.selector;for(var o ,a=e.transformedSelector,l=s?"["+r.SCOPE_NAME+"~="+i+"]":"."+i,c=a.split(","),h= 0,u=c.length;h<u&&(o=c[h]);h++)c[h]=o.match(t)?o.replace(n,l):l+" "+o;e.selector =c.join(",")},applyElementScopeSelector:function(e,t,n,s){var i=s?e.getAttribute (r.SCOPE_NAME):e.getAttribute("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.transf ormStyles(e,t,r),l=e._customStyle;return l&&!i.useNativeShadow&&l!==o&&(l._useCo unt--,l._useCount<=0&&l.parentNode&&l.parentNode.removeChild(l)),i.useNativeShad ow?e._customStyle?(e._customStyle.textContent=a,o=e._customStyle):a&&(o=n.applyC ss(a,r,e.root,e._scopeStyle)):o?o.parentNode||(s&&a.indexOf("@media")>-1&&(o.tex tContent=a),n.applyStyle(o,null,e._scopeStyle)):a&&(o=n.applyCss(a,r,null,e._sco peStyle)),o&&(o._useCount=o._useCount||0,e._customStyle!=o&&o._useCount++,e._cus tomStyle=o),o},mixinCustomStyle:function(e,t){var n;for(var r in t)n=t[r],(n||0= ==n)&&(e[r]=n)},updateNativeStyleProperties:function(e,t){var n=e.__customStyleP roperties;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.setProperty(i,t[i]),s.push(i));e.__customSt yleProperties=s},rx:n.rx,XSCOPE_NAME:"x-scope"}}(),function(){Polymer.StyleCache =function(){this.cache={}},Polymer.StyleCache.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()},retrieve: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._objectsS trictlyEqual(n,r):n===r))return!1;return!Array.isArray(e)||e.length===t.length}, _objectsStrictlyEqual:function(e,t){return this._objectsEqual(e,t)&&this._object sEqual(t,e)}}}(),Polymer.StyleDefaults=function(){var e=Polymer.StyleProperties, t=Polymer.StyleCache,n=Polymer.Settings.useNativeCSSProperties,r={_styles:[],_pr operties:null,customStyle:{},_styleCache:new t,_element:Polymer.DomApi.wrap(docu ment.documentElement),addStyle:function(e){this._styles.push(e),this._properties =null},get _styleProperties(){return this._properties||(e.decorateStyles(this._s tyles,this),this._styles._scopeStyleProperties=null,this._properties=e.hostAndRo otPropertiesForScope(this).rootProps,e.mixinCustomStyle(this._properties,this.cu stomStyle),e.reify(this._properties)),this._properties},hasStyleProperties:funct ion(){return Boolean(this._properties)},_needsStyleProperties:function(){},_comp uteStyleProperties:function(){return this._styleProperties},updateStyles:functio n(t){this._properties=null,t&&Polymer.Base.mixin(this.customStyle,t),this._style Cache.clear();for(var r,s=0;s<this._styles.length;s++)r=this._styles[s],r=r.__im portElement||r,r._apply();n&&e.updateNativeStyleProperties(document.documentElem ent,this.customStyle)}};return r}(),function(){"use strict";var e=Polymer.Base.s erializeValueToAttribute,t=Polymer.StyleProperties,n=Polymer.StyleTransformer,r= Polymer.StyleDefaults,s=Polymer.Settings.useNativeShadow,i=Polymer.Settings.useN ativeCSSProperties;Polymer.Base._addFeature({_prepStyleProperties:function(){i|| (this._ownStylePropertyNames=this._styles&&this._styles.length?t.decorateStyles( this._styles,this):null); 3 delete this[t])},_configureProperties:function(e,t){for(var n in e){var r=e[n];i f(void 0!==r.value){var s=r.value;"function"==typeof s&&(s=s.call(this,this._con fig)),t[n]=s}}},_distributeConfig:function(e){var t=this._propertyEffects;if(t)f or(var n in e){var r=t[n];if(r)for(var s,i=0,o=r.length;i<o&&(s=r[i]);i++)if("an notation"===s.kind){var a=this._nodes[s.effect.index],l=s.effect.propertyName,c= "attribute"==s.effect.kind,h=a._propertyEffects&&a._propertyEffects[l];if(a._con figValue&&(h||!c)){var u=n===s.effect.value?e[n]:this._get(s.effect.value,e);u=t his._computeFinalAnnotationValue(a,l,u,s.effect),c&&(u=a.deserialize(this.serial ize(u),a._propertyInfo[l].type)),a._configValue(l,u)}}}},_afterClientsReady:func tion(){this._executeStaticEffects(),this._applyConfig(this._config,this._aboveCo nfig),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(!Po lymer.Bind._isEventBogus(t,t.target)){var n,r;if(t.detail&&(n=t.detail.value,r=t .detail.path),this._clientsReadied)return e.call(this,t.target,n,r);this._queueH andler([e,t.target,n,r])}},_queueHandler:function(e){this._handlers.push(e)},_fl ushHandlers: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 ";var e=Polymer.Path;Polymer.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:function(e,t,n){var r=this._propertySetter(e,t);if(r!==t& &(r===r||t===t))return this._pathEffector(e,t),n||this._notifyPathUp(e,t),!0},_g etPathParts:function(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)for (var r=e[n].toString().split("."),s=0;s<r.length;s++)t.push(r[s]);return t}retur n e.toString().split(".")},set:function(e,t,n){var r,s=n||this,i=this._getPathPa rts(e),o=i[i.length-1];if(i.length>1){for(var a=0;a<i.length-1;a++){var l=i[a];i f(r&&"#"==l[0]?s=Polymer.Collection.get(r).getItem(l):(s=s[l],r&&parseInt(l,10)= =l&&(i[a]=Polymer.Collection.get(r).getKey(s))),!s)return;r=Array.isArray(s)?s:n ull}if(r){var c,h,u=Polymer.Collection.get(r);"#"==o[0]?(h=o,c=u.getItem(h),o=r. indexOf(c),u.setItem(h,t)):parseInt(o,10)==o&&(c=s[o],h=u.getKey(c),i[a]=h,u.set Item(h,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._getP athParts(e),o=0;o<i.length;o++){if(!s)return;var a=i[o];r&&"#"==a[0]?s=Polymer.C ollection.get(r).getItem(a):(s=s[a],n&&r&&parseInt(a,10)==a&&(i[o]=Polymer.Colle ction.get(r).getKey(s))),r=Array.isArray(s)?s:null}return n&&(n.path=i.join(".") ),s},_pathEffector:function(t,n){var r=e.root(t),s=this._propertyEffects&&this._ propertyEffects[r];if(s)for(var i,o=0;o<s.length&&(i=s[o]);o++){var a=i.pathFn;a &&a.call(this,t,n,i.effect)}this._boundPaths&&this._notifyBoundPaths(t,n)},_anno tationPathEffect:function(t,n,r){if(e.matches(r.value,!1,t))Polymer.Bind._annota tionEffect.call(this,t,n,r);else if(!r.negate&&e.isDescendant(r.value,t)){var s= this._nodes[r.index];if(s&&s._notifyPath){var i=e.translate(r.value,r.name,t);s. _notifyPath(i,n,!0)}}},_complexObserverPathEffect:function(t,n,r){e.matches(r.tr igger.name,r.trigger.wildcard,t)&&Polymer.Bind._complexObserverEffect.call(this, t,n,r)},_computePathEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wi ldcard,t)&&Polymer.Bind._computeEffect.call(this,t,n,r)},_annotatedComputationPa thEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wildcard,t)&&Polymer .Bind._annotatedComputationEffect.call(this,t,n,r)},linkPaths:function(e,t){this ._boundPaths=this._boundPaths||{},t?this._boundPaths[e]=t:this.unlinkPaths(e)},u nlinkPaths:function(e){this._boundPaths&&delete this._boundPaths[e]},_notifyBoun dPaths:function(t,n){for(var r in this._boundPaths){var s=this._boundPaths[r];e. isDescendant(r,t)?this._notifyPath(e.translate(r,s,t),n):e.isDescendant(s,t)&&th is._notifyPath(e.translate(s,r,t),n)}},_notifyPathUp:function(t,n){var r=e.root( t),s=Polymer.CaseMap.camelToDashCase(r),i=s+this._EVENT_CHANGED;this.fire(i,{pat h:t,value:n},{bubbles:!1,_useCache:!0})},_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),indexSplices:n},s=t+".splices";this._notifyPath(s,r),this._notifyPath(t+".l ength",e.length),this.__data__[s]={keySplices:null,indexSplices:null}},_notifySp lice:function(e,t,n,r,s){this._notifySplices(e,t,[{index:n,addedCount:r,removed: s,object:e,type:"splice"}])},push:function(e){var t={},n=this._get(e,this,t),r=A rray.prototype.slice.call(arguments,1),s=n.length,i=n.push.apply(n,r);return r.l ength&&this._notifySplice(n,t.path,s,r.length,[]),i},pop:function(e){var t={},n= this._get(e,this,t),r=Boolean(n.length),s=Array.prototype.slice.call(arguments,1 ),i=n.pop.apply(n,s);return r&&this._notifySplice(n,t.path,n.length,0,[i]),i},sp lice: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=Math.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.leng th),s=Array.prototype.slice.call(arguments,1),i=n.shift.apply(n,s);return r&&thi s._notifySplice(n,t.path,0,0,[i]),i},unshift:function(e){var t={},n=this._get(e, this,t),r=Array.prototype.slice.call(arguments,1),s=n.unshift.apply(n,r);return r.length&&this._notifySplice(n,t.path,0,r.length,[]),s},prepareModelNotifyPath:f unction(e){this.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._notifyPath,_notifyPathUp:Polymer.Base._notifyPathUp,_pathEffector:Polymer .Base._pathEffector,_annotationPathEffect:Polymer.Base._annotationPathEffect,_co mplexObserverPathEffect:Polymer.Base._complexObserverPathEffect,_annotatedComput ationPathEffect:Polymer.Base._annotatedComputationPathEffect,_computePathEffect: Polymer.Base._computePathEffect,_notifyBoundPaths:Polymer.Base._notifyBoundPaths ,_getPathParts:Polymer.Base._getPathParts})}})}(),Polymer.Base._addFeature({reso lveUrl:function(e){var t=Polymer.DomModule.import(this.is),n="";if(t){var r=t.ge tAttribute("assetpath")||"";n=Polymer.ResolveUrl.resolveUrl(r,t.ownerDocument.ba seURI)}return Polymer.ResolveUrl.resolveUrl(e,n)}}),Polymer.CssParse=function(){ return{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.r ules.length-1];n={start:r+1,parent:i,previous:o},i.rules.push(n);break;case this .CLOSE_BRACE:n.end=r+1,n=n.parent||t}return t},_parseCss:function(e,t){var n=t.s ubstring(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._expa ndUnicodeEscapes(n),n=n.replace(this._rx.multipleSpaces," "),n=n.substring(n.las tIndexOf(";")+1);var s=e.parsedSelector=e.selector=n.trim();e.atRule=0===s.index Of(this.AT_START),e.atRule?0===s.indexOf(this.MEDIA_START)?e.type=this.types.MED IA_RULE:s.match(this._rx.keyframesRule)&&(e.type=this.types.KEYFRAMES_RULE,e.key framesName=e.selector.split(this._rx.multipleSpaces).pop()):0===s.indexOf(this.V AR_START)?e.type=this.types.MIXIN_RULE:e.type=this.types.STYLE_RULE}var i=e.rule s;if(i)for(var o,a=0,l=i.length;a<l&&(o=i[a]);a++)this._parseCss(o,t);return e}, _expandUnicodeEscapes:function(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,funct ion(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e})},stringify :function(e,t,n){n=n||"";var r="";if(e.cssText||e.rules){var s=e.rules;if(s&&!th is._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 =this.removeCustomPropAssignment(e),this.removeCustomPropApply(e)},removeCustomP ropAssignment:function(e){return e.replace(this._rx.customProp,"").replace(this. _rx.mixinProp,"")},removeCustomPropApply:function(e){return e.replace(this._rx.m ixinApply,"").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]|$)?/ gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]* keyframes/,multipleSpaces:/\s+/g},VAR_START:"--",MEDIA_START:"@media",AT_START:" @"}}(),Polymer.StyleUtil=function(){var e=Polymer.Settings;return{NATIVE_VARIABL ES:Polymer.Settings.useNativeCSSProperties,MODULE_STYLES_SELECTOR:"style, link[r el=import][type~=css], template",INCLUDE_ATTR:"include",toCssText:function(e,t){ return"string"==typeof e&&(e=this.parser.parse(e)),t&&this.forEachRule(e,t),this .parser.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)},for ActiveRulesInStyles: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.__cssR ules&&e.textContent&&(e.__cssRules=this.parser.parse(e.textContent)),e.__cssRule s},isKeyframesSelector:function(e){return e.parent&&e.parent.type===this.ruleTyp es.KEYFRAMES_RULE},forEachRuleInStyle:function(e,t,n,r){var s,i,o=this.rulesForS tyle(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.ruleTy pes.MEDIA_RULE){var i=e.selector.match(this.rx.MEDIA_MATCH);i&&(window.matchMedi a(i[1]).matches||(s=!0))}e.type===this.ruleTypes.STYLE_RULE?t(e):n&&e.type===thi s.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,c=o.length;l<c&&(a=o[l]);l++)this.forEachRule(a, t,n,r)}},applyCss:function(e,t,n,r){var s=this.createScopeStyle(e,t);return this .applyStyle(s,n,r)},applyStyle:function(e,t,n){t=t||document.head;var r=n&&n.nex tSibling||t.firstChild;return this.__lastHeadApplyNode=e,t.insertBefore(e,r)},cr eateScopeStyle:function(e,t){var n=document.createElement("style");return t&&n.s etAttribute("scope",t),n.textContent=e,n},__lastHeadApplyNode:null,applyStylePla ceHolder:function(e){var t=document.createComment(" Shady DOM styles for "+e+" " ),n=this.__lastHeadApplyNode?this.__lastHeadApplyNode.nextSibling:null,r=documen t.head;return r.insertBefore(t,n||r.firstChild),this.__lastHeadApplyNode=t,t},cs sFromModules: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=Polym er.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._cssTe xt||""},cssFromElement:function(e){for(var t,n="",r=e.content||e,s=Polymer.TreeA pi.arrayCopy(r.querySelectorAll(this.MODULE_STYLES_SELECTOR)),i=0;i<s.length;i++ )if(t=s[i],"template"===t.localName)t.hasAttribute("preserve-content")||(n+=this .cssFromElement(t));else if("style"===t.localName){var o=t.getAttribute(this.INC LUDE_ATTR);o&&(n+=this.cssFromModules(o,!0)),t=t.__appliedElement||t,t.parentNod e.removeChild(t),n+=this.resolveCss(t.textContent,e.ownerDocument)}else t.import &&t.import.body&&(n+=this.resolveCss(t.import.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)retu rn this.getCssBuildType(t)},getCssBuildType:function(e){return e.getAttribute("c ss-build")},_findMatchingParen:function(e,t){for(var n=0,r=t,s=e.length;r<s;r++) switch(e[r]){case"(":n++;break;case")":if(0===--n)return r}return-1},processVari ableAndFallback:function(e,t){var n=e.indexOf("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.substring(r+1),t),a=s.indexOf(",");if(a=== -1)return t(i,s.trim(),"",o);var l=s.substring(0,a).trim(),c=s.substring(a+1).tr im();return t(i,l,c,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:/@media[^(]*(\([^)]*\))/,IS_VAR:/^--/,BRACKETE D:/\{[^}]*\}/g,HOST_PREFIX:"(?:^|[^.#[:])",HOST_SUFFIX:"($|[.:[\\s>+~])"},resolv eCss:Polymer.ResolveUrl.resolveCss,parser:Polymer.CssParse,ruleTypes:Polymer.Css Parse.types}}(),Polymer.StyleTransformer=function(){var e=Polymer.StyleUtil,t=Po lymer.Settings,n={dom:function(e,t,n,r){this._transformDom(e,t||"",n,r)},_transf ormDom: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++)this._transformDom(s[i],t,n,r)},element:fu nction(e,t,n,s){if(n)s?e.removeAttribute(r):e.setAttribute(r,t);else if(t)if(e.c lassList)s?(e.classList.remove(r),e.classList.remove(t)):(e.classList.add(r),e.c lassList.add(t));else if(e.getAttribute){var i=e.getAttribute(g);s?i&&e.setAttri bute(g,i.replace(r,"").replace(t,"")):e.setAttribute(g,(i?i+" ":"")+r+" "+t)}},e lementStyles:function(n,r){var s,i=n._styles,o="",a=n.__cssBuild,l=t.useNativeSh adow||"shady"===a;if(l){var h=this;s=function(e){e.selector=h._slottedToContent( e.selector),e.selector=e.selector.replace(c,":host > *"),r&&r(e)}}for(var u,f=0, p=i.length;f<p&&(u=i[f]);f++){var _=e.rulesForStyle(u);o+=l?e.toCssText(_,s):thi s.css(_,n.is,n.extends,r,n._scopeCssViaAttr)+"\n\n"}return o.trim()},css:functio n(t,n,r,s,i){var o=this._calcHostScope(n,r);n=this._calcElementScope(n,i);var a= this;return e.toCssText(t,function(e){e.isScoped||(a.rule(e,n,o),e.isScoped=!0), s&&s(e,n,o)})},_calcElementScope:function(e,t){return e?t?m+e+y:d+e:""},_calcHos tScope:function(e,t){return t?"[is="+e+"]":e},rule:function(e,t,n){this._transfo rmRule(e,this._transformComplexSelector,t,n)},_transformRule:function(e,t,n,r){e .selector=e.transformedSelector=this._transformRuleCss(e,t,n,r)},_transformRuleC ss:function(t,n,r,s){var o=t.selector.split(i);if(!e.isKeyframesSelector(t))for( var a,l=0,c=o.length;l<c&&(a=o[l]);l++)o[l]=n.call(this,a,r,s);return o.join(i)} ,_transformComplexSelector:function(e,t,n){var r=!1,s=!1,a=this;return e=e.trim( ),e=this._slottedToContent(e),e=e.replace(c,":host > *"),e=e.replace(P,l+" $1"), e=e.replace(o,function(e,i,o){if(r)o=o.replace(_," ");else{var l=a._transformCom poundSelector(o,i,t,n);r=r||l.stop,s=s||l.hostContext,i=l.combinator,o=l.value}r eturn 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.ind exOf(u)>=0?i=!0:e.indexOf(l)>=0?e=this._transformHostSelector(e,r):0!==s&&(e=n?t his._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}},_transfor mSimpleSelector:function(e,t){var n=e.split(v);return n[0]+=t,n.join(v)},_transf ormHostSelector:function(e,t){var n=e.match(h),r=n&&n[2].trim()||"";if(r){if(r[0 ].match(a))return e.replace(h,function(e,n,r){return t+r});var s=r.split(a)[0];r eturn s===t?r:S}return e.replace(l,t)},documentRule:function(e){e.selector=e.par sedSelector,this.normalizeRootSelector(e),t.useNativeShadow||this._transformRule (e,this._transformDocumentSelector)},normalizeRootSelector:function(e){e.selecto r=e.selector.replace(c,"html")},_transformDocumentSelector:function(e){return e. match(_)?this._transformComplexSelector(e,s):this._transformSimpleSelector(e.tri m(),s)},_slottedToContent:function(e){return e.replace(C,p+"> $1")},SCOPE_NAME:" style-scope"},r=n.SCOPE_NAME,s=":not(["+r+"]):not(."+r+")",i=",",o=/(^|[\s>+~]+) ((?:\[.+?\]|[^\s>+~=\[])+)/g,a=/[[.:#*]/,l=":host",c=":root",h=/(:host)(?:\(((?: \([^)(]*\)|[^)(]*)+?)\))/,u=":host-context",f=/(.*)(?::host-context)(?:\(((?:\([ ^)(]*\)|[^)(]*)+?)\))(.*)/,p="::content",_=/::content|::shadow|\/deep\//,d=".",m ="["+r+"~=",y="]",v=":",g="class",P=new RegExp("^("+p+")"),S="should_not_match", C=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g;return n}(),Polymer.StyleExt ends=function(){var e=Polymer.StyleUtil;return{hasExtends:function(e){return Boo lean(e.match(this.rx.EXTEND))},transform:function(t){var n=e.rulesForStyle(t),r= this;return e.forEachRule(n,function(e){if(r._mapRuleOntoParent(e),e.parent)for( var t;t=r.rx.EXTEND.exec(e.cssText);){var n=t[1],s=r._findExtendor(n,e);s&&r._ex tendRule(e,s)}e.cssText=e.cssText.replace(r.rx.EXTEND,"")}),e.toCssText(n,functi on(e){e.selector.match(r.rx.STRIP)&&(e.cssText="")},!0)},_mapRuleOntoParent:func tion(e){if(e.parent){for(var t,n=e.parent.map||(e.parent.map={}),r=e.selector.sp lit(","),s=0;s<r.length;s++)t=r[s],n[t.trim()]=e;return n}},_findExtendor:functi on(e,t){return t.parent&&t.parent.map&&t.parent.map[e]||this._findExtendor(e,t.p arent)},_extendRule:function(e,t){e.parent!==t.parent&&this._cloneAndAddRuleToPa rent(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)},_cloneAnd AddRuleToParent:function(e,t){e=Object.create(e),e.parent=t,e.extends&&(e.extend s=e.extends.slice()),t.rules.push(e)},rx:{EXTEND:/@extends\(([^)]*)\)\s*?;/gim,S TRIP:/%[^,]*$/}}}(),Polymer.ApplyShim=function(){"use strict";function e(e,t){e= e.trim(),m[e]={properties:t,dependants:{}}}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}function 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.sli ce(1).join(":")),a[t]=r));return a}function s(e){var t=y.__currentElementProto,n =t&&t.is;for(var r in e.dependants)r!==n&&(e.dependants[r].__applyShimInvalid=!0 )}function i(n,i,o,a){if(o&&c.processVariableAndFallback(o,function(e,n){n&&t(n) &&(a="@apply "+n+";")}),!a)return n;var h=l(a),u=n.slice(0,n.indexOf("--")),f=r( h),p=f,_=t(i),m=_&&_.properties;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.__current ElementProto;o&&(i.dependants[o.is]=o);var a,l,c;for(a in i.properties)c=r&&r[a] ,l=[a,": var(",n,d,a],c&&l.push(",",c),l.push(")"),s.push(l.join(""))}return s.j oin("; ")}function l(e){for(var t;t=h.exec(e);){var n=t[0],s=t[1],i=t.index,o=i+ n.indexOf("@apply"),l=i+n.length,c=e.slice(0,o),u=e.slice(l),f=r(c),p=a(s,f);e=[ c,p,u].join(""),h.lastIndex=i+p.length}return e}var c=Polymer.StyleUtil,h=c.rx.M IXIN_MATCH,u=c.rx.VAR_ASSIGN,f=/var\(\s*(--[^,]*),\s*(--[^)]*)\)/g,p=/;\s*/m,_=/ ^\s*(initial)|(inherit)\s*$/,d="_-_",m={},y={_measureElement:null,_map:m,_separa tor:d,transform:function(e,t){this.__currentElementProto=t,c.forRulesInStyles(e, this._boundFindDefinitions),c.forRulesInStyles(e,this._boundFindApplications),t& &(t.__applyShimInvalid=!1),this.__currentElementProto=null},_findDefinitions:fun ction(e){var t=e.parsedCssText;t=t.replace(f,o),t=t.replace(u,i),e.cssText=t,":r oot"===e.selector&&(e.selector=":host > *")},_findApplications:function(e){e.css Text=l(e.cssText)},transformRule:function(e){this._findDefinitions(e),this._find Applications(e)},_getInitialValueForProperty:function(e){return this._measureEle ment||(this._measureElement=document.createElement("meta"),this._measureElement. style.all="initial",document.head.appendChild(this._measureElement)),window.getC omputedStyle(this._measureElement).getPropertyValue(e)}};return y._boundTransfor mRule=y.transformRule.bind(y),y._boundFindDefinitions=y._findDefinitions.bind(y) ,y._boundFindApplications=y._findApplications.bind(y),y}(),function(){var e=Poly mer.Base._prepElement,t=Polymer.Settings.useNativeShadow,n=Polymer.StyleUtil,r=P olymer.StyleTransformer,s=Polymer.StyleExtends,i=Polymer.ApplyShim,o=Polymer.Set tings;Polymer.Base._addFeature({_prepElement:function(t){this._encapsulateStyle& &"shady"!==this.__cssBuild&&r.element(t,this.is,this._scopeCssViaAttr),e.call(th is,t)},_prepStyles:function(){void 0===this._encapsulateStyle&&(this._encapsulat eStyle=!t),t||(this._scopeStyle=n.applyStylePlaceHolder(this.is)),this.__cssBuil d=n.cssBuildTypeForModule(this.is)},_prepShimStyles:function(){if(this._template ){var e=n.isTargetedBuild(this.__cssBuild);if(o.useNativeCSSProperties&&"shadow" ===this.__cssBuild&&e)return;this._styles=this._styles||this._collectStyles(),o. useNativeCSSProperties&&!this.__cssBuild&&i.transform(this._styles,this);var s=o .useNativeCSSProperties&&e?this._styles.length&&this._styles[0].textContent.trim ():r.elementStyles(this);this._prepStyleProperties(),!this._needsStyleProperties ()&&s&&n.applyCss(s,this.is,t?this._template.content:null,this._scopeStyle)}else this._styles=[]},_collectStyles: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.cssFrom Module(this.is);var l=this._template&&this._template.parentNode;if(!this._templa te||l&&l.id.toLowerCase()===this.is||(t+=n.cssFromElement(this._template)),t){va r c=document.createElement("style");c.textContent=t,s.hasExtends(c.textContent)& &(t=s.transform(c)),e.push(c)}return e},_elementAdd:function(e){this._encapsulat eStyle&&(e.__styleScoped?e.__styleScoped=!1:r.dom(e,this.is,this._scopeCssViaAtt r))},_elementRemove:function(e){this._encapsulateStyle&&r.dom(e,this.is,this._sc opeCssViaAttr,!0)},scopeSubtree:function(e,n){if(!t){var r=this,s=function(e){if (e.nodeType===Node.ELEMENT_NODE){var t=e.getAttribute("class");e.setAttribute("c lass",r._scopeElementClass(e,t));for(var n,s=e.querySelectorAll("*"),i=0;i<s.len gth&&(n=s[i]);i++)t=n.getAttribute("class"),n.setAttribute("class",r._scopeEleme ntClass(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}}}})}(),Poly mer.StyleProperties=function(){"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.Style Util,r=Polymer.StyleTransformer,s=navigator.userAgent.match("Trident"),i=Polymer .Settings;return{decorateStyles:function(e,t){var s=this,i={},o=[],a=0,l=r._calc HostScope(t.is,t.extends);n.forRulesInStyles(e,function(e,r){s.decorateRule(e),e .index=a++,s.whenHostOrRootRule(t,e,r,function(r){if(e.parent.type===n.ruleTypes .MEDIA_RULE&&(t.__notStyleScopeCacheable=!0),r.isHost){var s=r.selector.split(" ").some(function(e){return 0===e.indexOf(l)&&e.length!==l.length});t.__notStyleS copeCacheable=t.__notStyleScopeCacheable||s}}),s.collectPropertiesInCssText(e.pr opertyInfo.cssText,i)},function(e){o.push(e)}),e._keyframes=o;var c=[];for(var h in i)c.push(h);return c},decorateRule:function(e){if(e.propertyInfo)return e.pr opertyInfo;var t={},n={},r=this.collectProperties(e,n);return r&&(t.properties=n ,e.rules=null),t.cssText=this.collectCssText(e),e.propertyInfo=t,t},collectPrope rties:function(e,t){var n=e.propertyInfo;if(!n){for(var r,s,i,o=this.rx.VAR_ASSI GN,a=e.parsedCssText;r=o.exec(a);)s=(r[2]||r[3]).trim(),"inherit"!==s&&(t[r[1].t rim()]=s),i=!0;return i}if(n.properties)return Polymer.Base.mixin(t,n.properties ),!0},collectCssText:function(e){return this.collectConsumingCssText(e.parsedCss Text)},collectConsumingCssText:function(e){return e.replace(this.rx.BRACKETED,"" ).replace(this.rx.VAR_ASSIGN,"")},collectPropertiesInCssText:function(e,t){for(v ar n;n=this.rx.VAR_CONSUMED.exec(e);){var r=n[1];":"!==n[2]&&(t[r]=!0)}},reify:f unction(e){for(var t,n=Object.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.inde xOf(";")>=0)e=this.valueForProperties(e,t);else{var r=this,s=function(e,n,s,i){v ar o=r.valueForProperty(t[n],t);return o&&"initial"!==o?"apply-shim-inherit"===o &&(o="inherit"):o=r.valueForProperty(t[s]||s,t)||s,e+(o||"")+i};e=n.processVaria bleAndFallback(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.las tIndex=0,r=this.rx.MIXIN_MATCH.exec(n))n=this.valueForProperty(t[r[1]],t);else{v ar o=n.indexOf(":");if(o!==-1){var a=n.substring(o);a=a.trim(),a=this.valueForPr operty(a,t)||a,n=n.substring(0,o)+a}}s[i]=n&&n.lastIndexOf(";")===n.length-1?n.s lice(0,-1):n||""}return s.join(";")},applyProperties:function(e,t){var n="";e.pr opertyInfo||this.decorateRule(e),e.propertyInfo.cssText&&(n=this.valueForPropert ies(e.propertyInfo.cssText,t)),e.cssText=n},applyKeyframeTransforms:function(e,t ){var n=e.cssText,r=e.cssText;if(null==e.hasAnimations&&(e.hasAnimations=this.rx .ANIMATION_MATCH.test(n)),e.hasAnimations){var s;if(null==e.keyframeNamesToTrans form){e.keyframeNamesToTransform=[];for(var i in t)s=t[i],r=s(n),n!==r&&(n=r,e.k eyframeNamesToTransform.push(i))}else{for(var o=0;o<e.keyframeNamesToTransform.l ength;++o)s=t[e.keyframeNamesToTransform[o]],n=s(n);r=n}}e.cssText=r},propertyDa taFromStyles:function(r,s){var i={},o=this,a=[];return n.forActiveRulesInStyles( r,function(n){n.propertyInfo||o.decorateRule(n);var r=n.transformedSelector||n.p arsedSelector;s&&n.propertyInfo.properties&&r&&t.call(s,r)&&(o.collectProperties (n,i),e(n.index,a))}),{properties:i,key:a}},_rootSelector:/:root|:host\s*>\s*\*/ ,_checkRoot:function(e,t){return Boolean(t.match(this._rootSelector))||"html"=== e&&t.indexOf("html")>-1},whenHostOrRootRule:function(e,t,n,s){if(t.propertyInfo| |self.decorateRule(t),t.propertyInfo.properties){var o=e.is?r._calcHostScope(e.i s,e.extends):"html",a=t.parsedSelector,l=this._checkRoot(o,a),c=!l&&0===a.indexO f(":host"),h=e.__cssBuild||n.__cssBuild;if("shady"===h&&(l=a===o+" > *."+o||a.in dexOf("html")>-1,c=!l&&0===a.indexOf(o)),l||c){var u=o;c&&(i.useNativeShadow&&!t .transformedSelector&&(t.transformedSelector=r._transformRuleCss(t,r._transformC omplexSelector,e.is,o)),u=t.transformedSelector||t.parsedSelector),l&&"html"===o &&(u=t.transformedSelector||t.parsedSelector),s({selector:u,isHost:c,isRoot:l})} }},hostAndRootPropertiesForScope:function(e){var r={},s={},i=this;return n.forAc tiveRulesInStyles(e._styles,function(n,o){i.whenHostOrRootRule(e,n,o,function(o) {var a=e._element||e;t.call(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._calcHostScope(e.is,e.extends),a=e.extends?"\\"+o.slice(0, -1)+"\\]":o,l=new RegExp(this.rx.HOST_PREFIX+a+this.rx.HOST_SUFFIX),c=this._elem entKeyframeTransforms(e,n);return r.elementStyles(e,function(r){s.applyPropertie s(r,t),i.useNativeShadow||Polymer.StyleUtil.isKeyframesSelector(r)||!r.cssText|| (s.applyKeyframeTransforms(r,c),s._scopeSelector(r,l,o,e._scopeCssViaAttr,n))})} ,_elementKeyframeTransforms:function(e,t){var n=e._styles._keyframes,r={};if(!i. useNativeShadow&&n)for(var s=0,o=n[s];s<n.length;o=n[++s])this._scopeKeyframes(o ,t),r[o.keyframesName]=this._keyframesRuleTransformer(o);return r},_keyframesRul eTransformer:function(e){return function(t){return t.replace(e.keyframesNameRx,e .transformedKeyframesName)}},_scopeKeyframes:function(e,t){e.keyframesNameRx=new RegExp(e.keyframesName,"g"),e.transformedKeyframesName=e.keyframesName+"-"+t,e. transformedSelector=e.transformedSelector||e.selector,e.selector=e.transformedSe lector.replace(e.keyframesName,e.transformedKeyframesName)},_scopeSelector:funct ion(e,t,n,s,i){e.transformedSelector=e.transformedSelector||e.selector;for(var o ,a=e.transformedSelector,l=s?"["+r.SCOPE_NAME+"~="+i+"]":"."+i,c=a.split(","),h= 0,u=c.length;h<u&&(o=c[h]);h++)c[h]=o.match(t)?o.replace(n,l):l+" "+o;e.selector =c.join(",")},applyElementScopeSelector:function(e,t,n,s){var i=s?e.getAttribute (r.SCOPE_NAME):e.getAttribute("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.transf ormStyles(e,t,r),l=e._customStyle;return l&&!i.useNativeShadow&&l!==o&&(l._useCo unt--,l._useCount<=0&&l.parentNode&&l.parentNode.removeChild(l)),i.useNativeShad ow?e._customStyle?(e._customStyle.textContent=a,o=e._customStyle):a&&(o=n.applyC ss(a,r,e.root,e._scopeStyle)):o?o.parentNode||(s&&a.indexOf("@media")>-1&&(o.tex tContent=a),n.applyStyle(o,null,e._scopeStyle)):a&&(o=n.applyCss(a,r,null,e._sco peStyle)),o&&(o._useCount=o._useCount||0,e._customStyle!=o&&o._useCount++,e._cus tomStyle=o),o},mixinCustomStyle:function(e,t){var n;for(var r in t)n=t[r],(n||0= ==n)&&(e[r]=n)},updateNativeStyleProperties:function(e,t){var n=e.__customStyleP roperties;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.setProperty(i,t[i]),s.push(i));e.__customSt yleProperties=s},rx:n.rx,XSCOPE_NAME:"x-scope"}}(),function(){Polymer.StyleCache =function(){this.cache={}},Polymer.StyleCache.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()},retrieve: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._objectsS trictlyEqual(n,r):n===r))return!1;return!Array.isArray(e)||e.length===t.length}, _objectsStrictlyEqual:function(e,t){return this._objectsEqual(e,t)&&this._object sEqual(t,e)}}}(),Polymer.StyleDefaults=function(){var e=Polymer.StyleProperties, t=Polymer.StyleCache,n=Polymer.Settings.useNativeCSSProperties,r={_styles:[],_pr operties:null,customStyle:{},_styleCache:new t,_element:Polymer.DomApi.wrap(docu ment.documentElement),addStyle:function(e){this._styles.push(e),this._properties =null},get _styleProperties(){return this._properties||(e.decorateStyles(this._s tyles,this),this._styles._scopeStyleProperties=null,this._properties=e.hostAndRo otPropertiesForScope(this).rootProps,e.mixinCustomStyle(this._properties,this.cu stomStyle),e.reify(this._properties)),this._properties},hasStyleProperties:funct ion(){return Boolean(this._properties)},_needsStyleProperties:function(){},_comp uteStyleProperties:function(){return this._styleProperties},updateStyles:functio n(t){this._properties=null,t&&Polymer.Base.mixin(this.customStyle,t),this._style Cache.clear();for(var r,s=0;s<this._styles.length;s++)r=this._styles[s],r=r.__im portElement||r,r._apply();n&&e.updateNativeStyleProperties(document.documentElem ent,this.customStyle)}};return r}(),function(){"use strict";var e=Polymer.Base.s erializeValueToAttribute,t=Polymer.StyleProperties,n=Polymer.StyleTransformer,r= Polymer.StyleDefaults,s=Polymer.Settings.useNativeShadow,i=Polymer.Settings.useN ativeCSSProperties;Polymer.Base._addFeature({_prepStyleProperties:function(){i|| (this._ownStylePropertyNames=this._styles&&this._styles.length?t.decorateStyles( this._styles,this):null);
4 },customStyle:null,getComputedStyleValue:function(e){return!i&&this._styleProper ties&&this._styleProperties[e]||getComputedStyle(this).getPropertyValue(e)},_set upStyleProperties:function(){this.customStyle={},this._styleCache=null,this._sty leProperties=null,this._scopeSelector=null,this._ownStyleProperties=null,this._c ustomStyle=null},_needsStyleProperties:function(){return Boolean(!i&&this._ownSt ylePropertyNames&&this._ownStylePropertyNames.length)},_validateApplyShim:functi on(){if(this.__applyShimInvalid){Polymer.ApplyShim.transform(this._styles,this._ _proto__);var e=n.elementStyles(this);if(s){var t=this._template.content.querySe lector("style");t&&(t.textContent=e)}else{var r=this._scopeStyle&&this._scopeSty le.nextSibling;r&&(r.textContent=e)}}},_beforeAttached:function(){this._scopeSel ector&&!this.__stylePropertiesInvalid||!this._needsStyleProperties()||(this.__st ylePropertiesInvalid=!1,this._updateStyleProperties())},_findStyleHost:function( ){for(var e,t=this;e=Polymer.dom(t).getOwnerRoot();){if(Polymer.isInstance(e.hos t))return e.host;t=e.host}return r},_updateStyleProperties:function(){var e,n=th is._findStyleHost();n._styleProperties||n._computeStyleProperties(),n._styleCach e||(n._styleCache=new Polymer.StyleCache);var r=t.propertyDataFromStyles(n._styl es,this),i=!this.__notStyleScopeCacheable;i&&(r.key.customStyle=this.customStyle ,e=n._styleCache.retrieve(this.is,r.key,this._styles));var a=Boolean(e);a?this._ styleProperties=e._styleProperties:this._computeStyleProperties(r.properties),th is._computeOwnStyleProperties(),a||(e=o.retrieve(this.is,this._ownStylePropertie s,this._styles));var l=Boolean(e)&&!a,c=this._applyStyleProperties(e);a||(c=c&&s ?c.cloneNode(!0):c,e={style:c,_scopeSelector:this._scopeSelector,_stylePropertie s:this._styleProperties},i&&(r.key.customStyle={},this.mixin(r.key.customStyle,t his.customStyle),n._styleCache.store(this.is,e,r.key,this._styles)),l||o.store(t his.is,Object.create(e),this._ownStyleProperties,this._styles))},_computeStylePr operties:function(e){var n=this._findStyleHost();n._styleProperties||n._computeS tyleProperties();var r=Object.create(n._styleProperties),s=t.hostAndRootProperti esForScope(this);this.mixin(r,s.hostProps),e=e||t.propertyDataFromStyles(n._styl es,this).properties,this.mixin(r,e),this.mixin(r,s.rootProps),t.mixinCustomStyle (r,this.customStyle),t.reify(r),this._styleProperties=r},_computeOwnStylePropert ies:function(){for(var e,t={},n=0;n<this._ownStylePropertyNames.length;n++)e=thi s._ownStylePropertyNames[n],t[e]=this._styleProperties[e];this._ownStyleProperti es=t},_scopeCount:0,_applyStyleProperties:function(e){var n=this._scopeSelector; this._scopeSelector=e?e._scopeSelector:this.is+"-"+this.__proto__._scopeCount++; var r=t.applyElementStyle(this,this._styleProperties,this._scopeSelector,e&&e.st yle);return s||t.applyElementScopeSelector(this,this._scopeSelector,n,this._scop eCssViaAttr),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._scopeElementCla ss(r,t))}r=this.shadyRoot&&this.shadyRoot._hasDistributed?Polymer.dom(r):r,e.cal l(this,t,n,r)},_scopeElementClass:function(e,t){return s||this._scopeCssViaAttr| |(t=(t?t+" ":"")+a+" "+this.is+(e._scopeSelector?" "+l+" "+e._scopeSelector:"")) ,t},updateStyles:function(e){e&&this.mixin(this.customStyle,e),i?t.updateNativeS tyleProperties(this,this.customStyle):(this.isAttached?this._needsStylePropertie s()?this._updateStyleProperties():this._styleProperties=null:this.__stylePropert iesInvalid=!0,this._styleCache&&this._styleCache.clear(),this._updateRootStyles( ))},_updateRootStyles:function(e){e=e||this.root;for(var t,n=Polymer.dom(e)._que ry(function(e){return e.shadyRoot||e.shadowRoot}),r=0,s=n.length;r<s&&(t=n[r]);r ++)t.updateStyles&&t.updateStyles()}}),Polymer.updateStyles=function(e){r.update Styles(e),Polymer.Base._updateRootStyles(document)};var o=new Polymer.StyleCache ;Polymer.customStyleCache=o;var a=n.SCOPE_NAME,l=t.XSCOPE_NAME}(),Polymer.Base._ addFeature({_registerFeatures:function(){this._prepIs(),this._prepConstructor(), this._prepStyles()},_finishRegisterFeatures:function(){this._prepTemplate(),this ._prepShimStyles(),this._prepAnnotations(),this._prepEffects(),this._prepBehavio rs(),this._prepPropertyInfo(),this._prepBindings(),this._prepShady()},_prepBehav ior:function(e){this._addPropertyEffects(e.properties),this._addComplexObserverE ffects(e.observers),this._addHostAttributes(e.hostAttributes)},_initFeatures:fun ction(){this._setupGestures(),this._setupConfigure(),this._setupStyleProperties( ),this._setupDebouncers(),this._setupShady(),this._registerHost(),this._template &&(this._validateApplyShim(),this._poolContent(),this._beginHosting(),this._stam pTemplate(),this._endHosting(),this._marshalAnnotationReferences()),this._marsha lInstanceEffects(),this._marshalBehaviors(),this._marshalHostAttributes(),this._ marshalAttributes(),this._tryReady()},_marshalBehavior:function(e){e.listeners&& this._listenListeners(e.listeners)}}),function(){var e,t=Polymer.StyleProperties ,n=Polymer.StyleUtil,r=Polymer.CssParse,s=Polymer.StyleDefaults,i=Polymer.StyleT ransformer,o=Polymer.ApplyShim,a=Polymer.Debounce,l=Polymer.Settings;Polymer({is :"custom-style",extends:"style",_template:null,properties:{include:String},ready :function(){this.__appliedElement=this.__appliedElement||this,this.__cssBuild=n. getCssBuildType(this),this.__appliedElement!==this&&(this.__appliedElement.__css Build=this.__cssBuild),this._tryApply()},attached:function(){this._tryApply()},_ tryApply:function(){if(!this._appliesToDocument&&this.parentNode&&"dom-module"!= =this.parentNode.localName){this._appliesToDocument=!0;var e=this.__appliedEleme nt;if(l.useNativeCSSProperties||(this.__needsUpdateStyles=s.hasStyleProperties() ,s.addStyle(e)),e.textContent||this.include)this._apply(!0);else{var t=this,n=ne w MutationObserver(function(){n.disconnect(),t._apply(!0)});n.observe(e,{childLi st:!0})}}},_updateStyles:function(){Polymer.updateStyles()},_apply:function(e){v ar t=this.__appliedElement;if(this.include&&(t.textContent=n.cssFromModules(this .include,!0)+t.textContent),t.textContent){var r=this.__cssBuild,s=n.isTargetedB uild(r);if(!l.useNativeCSSProperties||!s){var a=n.rulesForStyle(t);if(s||(n.forE achRule(a,function(e){i.documentRule(e)}),l.useNativeCSSProperties&&!r&&o.transf orm([t])),l.useNativeCSSProperties)t.textContent=n.toCssText(a);else{var c=this, h=function(){c._flushCustomProperties()};e?Polymer.RenderStatus.whenReady(h):h() }}}},_flushCustomProperties:function(){this.__needsUpdateStyles?(this.__needsUpd ateStyles=!1,e=a(e,this._updateStyles)):this._applyCustomProperties()},_applyCus tomProperties:function(){var e=this.__appliedElement;this._computeStylePropertie s();var s=this._styleProperties,i=n.rulesForStyle(e);i&&(e.textContent=n.toCssTe xt(i,function(e){var n=e.cssText=e.parsedCssText;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_",temp latize: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._customPrepAnnotat ions(t,e),this._prepParentProperties(t,e),t._prepEffects(),this._customPrepEffec ts(t),t._prepBehaviors(),t._prepPropertyInfo(),t._prepBindings(),t._notifyPathUp =this._notifyPathUpImpl,t._scopeElementClass=this._scopeElementClassImpl,t.liste n=this._listenImpl,t._showHideChildren=this._showHideChildrenImpl,t.__setPropert yOrig=this.__setProperty,t.__setProperty=this.__setPropertyImpl;var n=this._cons tructorImpl,r=function(e,t){n.call(this,e,t)};r.prototype=t,t.constructor=r,e._c ontent._ctor=r,this.ctor=r},_getRootDataHost:function(){return this.dataHost&&th is.dataHost._rootDataHost||this.dataHost},_showHideChildrenImpl:function(e){for( var t=this._children,n=0;n<t.length;n++){var r=t[n];Boolean(e)!=Boolean(r.__hide TemplateChildren__)&&(r.nodeType===Node.TEXT_NODE?e?(r.__polymerTextContent__=r. textContent,r.textContent=""):r.textContent=r.__polymerTextContent__:r.style&&(e ?(r.__polymerDisplay__=r.style.display,r.style.display="none"):r.style.display=r .__polymerDisplay__)),r.__hideTemplateChildren__=e}},__setPropertyImpl:function( e,t,n,r){r&&r.__hideTemplateChildren__&&"textContent"==e&&(e="__polymerTextConte nt__"),this.__setPropertyOrig(e,t,n,r)},_debounceTemplate:function(e){Polymer.do m.addDebouncer(this.debounce("_debounceTemplate",e))},_flushTemplates:function() {Polymer.dom.flush()},_customPrepEffects:function(e){var t=e._parentProps;for(va r n in t)e._addPropertyEffect(n,"function",this._createHostPropEffector(n));for( n in this._instanceProps)e._addPropertyEffect(n,"function",this._createInstanceP ropEffector(n))},_customPrepAnnotations:function(e,t){e._template=t;var n=t._con tent;if(!n._notes){var r=e._rootDataHost;r&&(Polymer.Annotations.prepElement=fun ction(){r._prepElement()}),n._notes=Polymer.Annotations.parseAnnotations(t),Poly mer.Annotations.prepElement=null,this._processAnnotations(n._notes)}e._notes=n._ notes,e._parentProps=n._parentProps},_prepParentProperties:function(e,t){var n=t his._parentProps=e._parentProps;if(this._forwardParentProp&&n){var r,s=e._parent PropProto;if(!s){for(r in this._instanceProps)delete n[r];s=e._parentPropProto=O bject.create(null),t!=this&&(Polymer.Bind.prepareModel(s),Polymer.Base.prepareMo delNotifyPath(s));for(r in n){var i=this._parentPropPrefix+r,o=[{kind:"function" ,effect:this._createForwardPropEffector(r),fn:Polymer.Bind._functionEffect},{kin d:"notify",fn:Polymer.Bind._notifyEffect,effect:{event:Polymer.CaseMap.camelToDa shCase(i)+"-changed"}}];Polymer.Bind._createAccessors(s,i,o)}}var a=this;t!=this &&(Polymer.Bind.prepareInstance(t),t._forwardParentProp=function(e,t){a._forward ParentProp(e,t)}),this._extendTemplate(t,s),t._pathEffector=function(e,t,n){retu rn a._pathEffectorImpl(e,t,n)}}},_createForwardPropEffector:function(e){return f unction(t,n){this._forwardParentProp(e,n)}},_createHostPropEffector:function(e){ var t=this._parentPropPrefix;return function(n,r){this.dataHost._templatized[t+e ]=r}},_createInstancePropEffector:function(e){return function(t,n,r,s){s||this.d ataHost._forwardInstanceProp(this,e,n)}},_extendTemplate:function(e,t){var n=Obj ect.getOwnPropertyNames(t);t._propertySetter&&(e._propertySetter=t._propertySett er);for(var r,s=0;s<n.length&&(r=n[s]);s++){var i=e[r],o=Object.getOwnPropertyDe scriptor(t,r);Object.defineProperty(e,r,o),void 0!==i&&e._propertySetter(r,i)}}, _showHideChildren:function(e){},_forwardInstancePath:function(e,t,n){},_forwardI nstanceProp:function(e,t,n){},_notifyPathUpImpl:function(e,t){var n=this.dataHos t,r=Polymer.Path.root(e);n._forwardInstancePath.call(n,this,e,t),r in n._parentP rops&&n._templatized._notifyPath(n._parentPropPrefix+e,t)},_pathEffectorImpl:fun ction(e,t,n){if(this._forwardParentPath&&0===e.indexOf(this._parentPropPrefix)){ var r=e.substring(this._parentPropPrefix.length),s=Polymer.Path.root(r);s in thi s._parentProps&&this._forwardParentPath(r,t)}Polymer.Base._pathEffector.call(thi s._templatized,e,t,n)},_constructorImpl:function(e,t){this._rootDataHost=t._getR ootDataHost(),this._setupConfigure(e),this._registerHost(t),this._beginHosting() ,this.root=this.instanceTemplate(this._template),this.root.__noContent=!this._no tes._hasContent,this.root.__styleScoped=!0,this._endHosting(),this._marshalAnnot atedNodes(),this._marshalInstanceEffects(),this._marshalAnnotatedListeners();for (var n=[],r=this.root.firstChild;r;r=r.nextSibling)n.push(r),r._templateInstance =this;this._children=n,t.__hideTemplateChildren__&&this._showHideChildren(!0),th is._tryReady()},_listenImpl: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)},_scop eElementClassImpl:function(e,t){var n=this._rootDataHost;return n?n._scopeElemen tClass(e,t):t},stamp:function(e){if(e=e||{},this._parentProps){var t=this._templ atized;for(var n in this._parentProps)void 0===e[n]&&(e[n]=t[this._parentPropPre fix+n])}return new this.ctor(e,this)},modelForElement:function(e){for(var t;e;)i f(t=e._templateInstance){if(t.dataHost==this)return t;e=t.dataHost}else e=e.pare ntNode}},Polymer({is:"dom-template",extends:"template",_template:null,behaviors: [Polymer.Templatizer],ready:function(){this.templatize(this)}}),Polymer._collect ions=new WeakMap,Polymer.Collection=function(e){Polymer._collections.set(e,this) ,this.userArray=e,this.store=e.slice(),this.initMap()},Polymer.Collection.protot ype={constructor:Polymer.Collection,initMap:function(){for(var e=this.omap=new W eakMap,t=this.pmap={},n=this.store,r=0;r<n.length;r++){var s=n[r];s&&"object"==t ypeof s?e.set(s,r):t[s]=r}},add:function(e){var t=this.store.push(e)-1;return e& &"object"==typeof e?this.omap.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:function(e){e&&"object"==typeof e?this.omap.delete(e):delete this.pmap[e]},remove:function(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.pma p[e],void 0!=t)return"#"+t},getKeys:function(){return Object.keys(this.store).ma p(function(e){return"#"+e})},_parseKey:function(e){if(e&&"#"==e[0])return e.slic e(1)},setItem:function(e,t){if(e=this._parseKey(e)){var n=this.store[e];n&&this. _removeFromMap(n),t&&"object"==typeof t?this.omap.set(t,e):this.pmap[t]=e,this.s tore[e]=t}},getItem:function(e){if(e=this._parseKey(e))return this.store[e]},get Items:function(){var e=[],t=this.store;for(var n in t)e.push(t[n]);return e},_ap plySplices:function(e){for(var t,n,r={},s=0;s<e.length&&(n=e[s]);s++){n.addedKey s=[];for(var i=0;i<n.removed.length;i++)t=this.getKey(n.removed[i]),r[t]=r[t]?nu ll:-1;for(i=0;i<n.addedCount;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[{rem oved:a,added:l}]}},Polymer.Collection.get=function(e){return Polymer._collection s.get(e)||new Polymer.Collection(e)},Polymer.Collection.applySplices=function(e, t){var n=Polymer._collections.get(e);return n?n._applySplices(t):null},Polymer({ is:"dom-repeat",extends:"template",_template:null,properties:{items:{type:Array} ,as:{type:String,value:"item"},indexAs:{type:String,value:"index"},sort:{type:Fu nction,observer:"_sortChanged"},filter:{type:Function,observer:"_filterChanged"} ,observe:{type:String,observer:"_observeChanged"},delay:Number,renderedItemCount :{type:Number,notify:!0,readOnly:!0},initialCount:{type:Number,observer:"_initia lizeChunking"},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Num ber,computed:"_computeFrameTime(targetFramerate)"}},behaviors:[Polymer.Templatiz er],observers:["_itemsChanged(items.*)"],created:function(){this._instances=[],t his._pool=[],this._limit=1/0;var e=this;this._boundRenderChunk=function(){e._ren derChunk()}},detached:function(){this.__isDetached=!0;for(var e=0;e<this._instan ces.length;e++)this._detachInstance(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._i nstanceProps={__key__:!0},this._instanceProps[this.as]=!0,this._instanceProps[th is.indexAs]=!0,this.ctor||this.templatize(this)},_sortChanged:function(e){var t= this._getRootDataHost();this._sortFn=e&&("function"==typeof e?e:function(){retur n t[e].apply(t,arguments)}),this._needFullRefresh=!0,this.items&&this._debounceT emplate(this._render)},_filterChanged:function(e){var t=this._getRootDataHost(); this._filterFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,argumen ts)}),this._needFullRefresh=!0,this.items&&this._debounceTemplate(this._render)} ,_computeFrameTime:function(e){return Math.ceil(1e3/e)},_initializeChunking:func tion(){this.initialCount&&(this._limit=this.initialCount,this._chunkCount=this.i nitialCount,this._lastChunkTime=performance.now())},_tryRenderChunk:function(){t his.items&&this._limit<this.items.length&&this.debounce("renderChunk",this._requ estRenderChunk)},_requestRenderChunk:function(){requestAnimationFrame(this._boun dRenderChunk)},_renderChunk:function(){var e=performance.now(),t=this._targetFra meTime/(e-this._lastChunkTime);this._chunkCount=Math.round(this._chunkCount*t)|| 1,this._limit+=this._chunkCount,this._lastChunkTime=e,this._debounceTemplate(thi s._render)},_observeChanged:function(){this._observePaths=this.observe&&this.obs erve.replace(".*",".").split(" ")},_itemsChanged:function(e){if("items"==e.path) Array.isArray(this.items)?this.collection=Polymer.Collection.get(this.items):thi s.items?this._error(this._logf("dom-repeat","expected array for `items`, found", this.items)):this.collection=null,this._keySplices=[],this._indexSplices=[],this ._needFullRefresh=!0,this._initializeChunking(),this._debounceTemplate(this._ren der);else if("items.splices"==e.path)this._keySplices=this._keySplices.concat(e. value.keySplices),this._indexSplices=this._indexSplices.concat(e.value.indexSpli ces),this._debounceTemplate(this._render);else{var t=e.path.slice(6);this._forwa rdItemPath(t,e.value),this._checkObservedPaths(t)}},_checkObservedPaths:function (e){if(this._observePaths){e=e.substring(e.indexOf(".")+1);for(var t=this._obser vePaths,n=0;n<t.length;n++)if(0===e.indexOf(t[n]))return this._needFullRefresh=! 0,void(this.delay?this.debounce("render",this._render,this.delay):this._debounce Template(this._render))}},render:function(){this._needFullRefresh=!0,this._debou nceTemplate(this._render),this._flushTemplates()},_render:function(){this._needF ullRefresh?(this._applyFullRefresh(),this._needFullRefresh=!1):this._keySplices. length&&(this._sortFn?this._applySplicesUserSort(this._keySplices):this._filterF n?this._applyFullRefresh():this._applySplicesArrayOrder(this._indexSplices)),thi s._keySplices=[],this._indexSplices=[];for(var e=this._keyToInstIdx={},t=this._i nstances.length-1;t>=0;t--){var n=this._instances[t];n.isPlaceholder&&t<this._li mit?n=this._insertInstance(t,n.__key__):!n.isPlaceholder&&t>=this._limit&&(n=thi s._downgradeInstance(t,n.__key__)),e[n.__key__]=t,n.isPlaceholder||n.__setProper ty(this.indexAs,t,!0)}this._pool.length=0,this._setRenderedItemCount(this._insta nces.length),this.fire("dom-change"),this._tryRenderChunk()},_applyFullRefresh:f unction(){var e,t=this.collection;if(this._sortFn)e=t?t.getKeys():[];else{e=[];v ar n=this.items;if(n)for(var r=0;r<n.length;r++)e.push(t.getKey(n[r]))}var s=thi s;for(this._filterFn&&(e=e.filter(function(e){return s._filterFn(t.getItem(e))}) ),this._sortFn&&e.sort(function(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.isPlace holder&&r<this._limit&&o.__setProperty(this.as,t.getItem(i),!0)):r<this._limit?t his._insertInstance(r,i):this._insertPlaceholder(r,i)}for(var a=this._instances. length-1;a>=r;a--)this._detachAndRemoveInstance(a)},_numericSort:function(e,t){r eturn e-t},_applySplicesUserSort: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 c=a[i];v oid 0!==c&&this._detachAndRemoveInstance(c)}var h=this;if(l.length){this._filter Fn&&(l=l.filter(function(e){return h._filterFn(r.getItem(e))})),l.sort(function( e,t){return h._sortFn(r.getItem(e),r.getItem(t))});var u=0;for(i=0;i<l.length;i+ +)u=this._insertRowUserSort(u,l[i])}},_insertRowUserSort:function(e,t){for(var n =this.collection,r=n.getItem(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;els e{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++){fo r(var r=0;r<t.removed.length;r++)this._detachAndRemoveInstance(t.index);for(r=0; r<t.addedKeys.length;r++)this._insertPlaceholder(t.index+r,t.addedKeys[r])}},_de tachInstance:function(e){var 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).appendChil d(r)}return t}},_attachInstance:function(e,t){var n=this._instances[e];n.isPlace holder||t.insertBefore(n.root,this)},_detachAndRemoveInstance:function(e){var t= this._detachInstance(e);t&&this._pool.push(t),this._instances.splice(e,1)},_inse rtPlaceholder:function(e,t){this._instances.splice(e,0,{isPlaceholder:!0,__key__ :t})},_stampInstance:function(e,t){var n={__key__:t};return n[this.as]=this.coll ection.getItem(t),n[this.indexAs]=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._instan ces[e+1],s=r&&!r.isPlaceholder?r._children[0]:this,i=Polymer.dom(this).parentNod e;return Polymer.dom(i).insertBefore(n.root,s),this._instances[e]=n,n},_downgrad eInstance:function(e,t){var n=this._detachInstance(e);return n&&this._pool.push( n),n={isPlaceholder:!0,__key__:t},this._instances[e]=n,n},_showHideChildren:func tion(e){for(var t=0;t<this._instances.length;t++)this._instances[t]._showHideChi ldren(e)},_forwardInstanceProp:function(e,t,n){if(t==this.as){var r;r=this._sort Fn||this._filterFn?this.items.indexOf(this.collection.getItem(e.__key__)):e[this .indexAs],this.set("items."+r,n)}},_forwardInstancePath:function(e,t,n){0===t.in dexOf(this.as+".")&&this._notifyPath("items."+e.__key__+"."+t.slice(this.as.leng th+1),n)},_forwardParentProp:function(e,t){for(var n,r=this._instances,s=0;s<r.l ength&&(n=r[s]);s++)n.isPlaceholder||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.isPlac eholder||n._notifyPath(e,t,!0)},_forwardItemPath:function(e,t){if(this._keyToIns tIdx){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:functi on(e){var t=this.modelForElement(e);return t&&t[this.as]},keyForElement:function (e){var t=this.modelForElement(e);return t&&t.__key__},indexForElement:function( e){var t=this.modelForElement(e);return t&&t[this.indexAs]}}),Polymer({is:"array -selector",_template:null,properties:{items:{type:Array,observer:"clearSelection "},multi:{type:Boolean,value:!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.se lected.length;e++)this.unlinkPaths("selected."+e);else this.unlinkPaths("selecte d"),this.unlinkPaths("selectedItem");this.multi?this.selected&&!this.selected.le ngth||(this.selected=[],this._selectedColl=Polymer.Collection.get(this.selected) ):(this.selected=null,this._selectedColl=null),this.selectedItem=null},isSelecte d:function(e){return this.multi?void 0!==this._selectedColl.getKey(e):this.selec ted==e},deselect:function(e){if(this.multi){if(this.isSelected(e)){var t=this._s electedColl.getKey(e);this.arrayDelete("selected",e),this.unlinkPaths("selected. "+t)}}else this.selected=null,this.selectedItem=null,this.unlinkPaths("selected" ),this.unlinkPaths("selectedItem")},select:function(e){var t=Polymer.Collection. get(this.items),n=t.getKey(e);if(this.multi)if(this.isSelected(e))this.toggle&&t his.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","item s."+n),this.linkPaths("selectedItem","items."+n))}}),Polymer({is:"dom-if",extend s:"template",_template:null,properties:{if:{type:Boolean,value:!1,observer:"_que ueRender"},restamp:{type:Boolean,value:!1,observer:"_queueRender"}},behaviors:[P olymer.Templatizer],_queueRender:function(){this._debounceTemplate(this._render) },detached:function(){this.parentNode&&(this.parentNode.nodeType!=Node.DOCUMENT_ FRAGMENT_NODE||Polymer.Settings.hasShadow&&this.parentNode instanceof ShadowRoot )||this._teardownInstance()},attached:function(){this.if&&this.ctor&&this.async( this._ensureInstance)},render:function(){this._flushTemplates()},_render:functio n(){this.if?(this.ctor||this.templatize(this),this._ensureInstance(),this._showH ideChildren()):this.restamp&&this._teardownInstance(),!this.restamp&&this._insta nce&&this._showHideChildren(),this.if!=this._lastIf&&(this.fire("dom-change"),th is._lastIf=this.if)},_ensureInstance:function(){var e=Polymer.dom(this).parentNo de;if(e){var t=Polymer.dom(e);if(this._instance){var n=this._instance._children; if(n&&n.length){var r=Polymer.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._instance.root;t.insertBefore(o,this)}}},_teardownInstan ce:function(){if(this._instance){var e=this._instance._children;if(e&&e.length)f or(var t,n=Polymer.dom(Polymer.dom(e[0]).parentNode),r=0;r<e.length&&(t=e[r]);r+ +)n.removeChild(t);this._instance=null}},_showHideChildren:function(){var e=this .__hideTemplateChildren__||!this.if;this._instance&&this._instance._showHideChil dren(e)},_forwardParentProp:function(e,t){this._instance&&this._instance.__setPr operty(e,t,!0)},_forwardParentPath:function(e,t){this._instance&&this._instance. _notifyPath(e,t,!0)}}),Polymer({is:"dom-bind",extends:"template",_template:null, created:function(){var e=this;Polymer.RenderStatus.whenReady(function(){"loading "==document.readyState?document.addEventListener("DOMContentLoaded",function(){e ._markImportsReady()}):e._markImportsReady()})},_ensureReady:function(){this._re adied||this._readySelf()},_markImportsReady:function(){this._importsReady=!0,thi s._ensureReady()},_registerFeatures:function(){this._prepConstructor()},_insertC hildren:function(){var e=Polymer.dom(Polymer.dom(this).parentNode);e.insertBefor e(this.root,this)},_removeChildren:function(){if(this._children)for(var e=0;e<th is._children.length;e++)this.root.appendChild(this._children[e])},_initFeatures: function(){},_scopeElementClass:function(e,t){return this.dataHost?this.dataHost ._scopeElementClass(e,t):t},_configureInstanceProperties:function(){},_prepConfi gure:function(){var e={};for(var t in this._propertyEffects)e[t]=this[t];var n=t his._setupConfigure;this._setupConfigure=function(){n.call(this,e)}},attached:fu nction(){this._importsReady&&this.render()},detached:function(){this._removeChil dren()},render:function(){this._ensureReady(),this._children||(this._template=th is,this._prepAnnotations(),this._prepEffects(),this._prepBehaviors(),this._prepC onfigure(),this._prepBindings(),this._prepPropertyInfo(),Polymer.Base._initFeatu res.call(this),this._children=Polymer.TreeApi.arrayCopyChildNodes(this.root)),th is._insertChildren(),this.fire("dom-change")}})</script> <script> window.Swarmin gBehaviors = window.SwarmingBehaviors || {}; 4 },customStyle:null,getComputedStyleValue:function(e){return!i&&this._styleProper ties&&this._styleProperties[e]||getComputedStyle(this).getPropertyValue(e)},_set upStyleProperties:function(){this.customStyle={},this._styleCache=null,this._sty leProperties=null,this._scopeSelector=null,this._ownStyleProperties=null,this._c ustomStyle=null},_needsStyleProperties:function(){return Boolean(!i&&this._ownSt ylePropertyNames&&this._ownStylePropertyNames.length)},_validateApplyShim:functi on(){if(this.__applyShimInvalid){Polymer.ApplyShim.transform(this._styles,this._ _proto__);var e=n.elementStyles(this);if(s){var t=this._template.content.querySe lector("style");t&&(t.textContent=e)}else{var r=this._scopeStyle&&this._scopeSty le.nextSibling;r&&(r.textContent=e)}}},_beforeAttached:function(){this._scopeSel ector&&!this.__stylePropertiesInvalid||!this._needsStyleProperties()||(this.__st ylePropertiesInvalid=!1,this._updateStyleProperties())},_findStyleHost:function( ){for(var e,t=this;e=Polymer.dom(t).getOwnerRoot();){if(Polymer.isInstance(e.hos t))return e.host;t=e.host}return r},_updateStyleProperties:function(){var e,n=th is._findStyleHost();n._styleProperties||n._computeStyleProperties(),n._styleCach e||(n._styleCache=new Polymer.StyleCache);var r=t.propertyDataFromStyles(n._styl es,this),i=!this.__notStyleScopeCacheable;i&&(r.key.customStyle=this.customStyle ,e=n._styleCache.retrieve(this.is,r.key,this._styles));var a=Boolean(e);a?this._ styleProperties=e._styleProperties:this._computeStyleProperties(r.properties),th is._computeOwnStyleProperties(),a||(e=o.retrieve(this.is,this._ownStylePropertie s,this._styles));var l=Boolean(e)&&!a,c=this._applyStyleProperties(e);a||(c=c&&s ?c.cloneNode(!0):c,e={style:c,_scopeSelector:this._scopeSelector,_stylePropertie s:this._styleProperties},i&&(r.key.customStyle={},this.mixin(r.key.customStyle,t his.customStyle),n._styleCache.store(this.is,e,r.key,this._styles)),l||o.store(t his.is,Object.create(e),this._ownStyleProperties,this._styles))},_computeStylePr operties:function(e){var n=this._findStyleHost();n._styleProperties||n._computeS tyleProperties();var r=Object.create(n._styleProperties),s=t.hostAndRootProperti esForScope(this);this.mixin(r,s.hostProps),e=e||t.propertyDataFromStyles(n._styl es,this).properties,this.mixin(r,e),this.mixin(r,s.rootProps),t.mixinCustomStyle (r,this.customStyle),t.reify(r),this._styleProperties=r},_computeOwnStylePropert ies:function(){for(var e,t={},n=0;n<this._ownStylePropertyNames.length;n++)e=thi s._ownStylePropertyNames[n],t[e]=this._styleProperties[e];this._ownStyleProperti es=t},_scopeCount:0,_applyStyleProperties:function(e){var n=this._scopeSelector; this._scopeSelector=e?e._scopeSelector:this.is+"-"+this.__proto__._scopeCount++; var r=t.applyElementStyle(this,this._styleProperties,this._scopeSelector,e&&e.st yle);return s||t.applyElementScopeSelector(this,this._scopeSelector,n,this._scop eCssViaAttr),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._scopeElementCla ss(r,t))}r=this.shadyRoot&&this.shadyRoot._hasDistributed?Polymer.dom(r):r,e.cal l(this,t,n,r)},_scopeElementClass:function(e,t){return s||this._scopeCssViaAttr| |(t=(t?t+" ":"")+a+" "+this.is+(e._scopeSelector?" "+l+" "+e._scopeSelector:"")) ,t},updateStyles:function(e){e&&this.mixin(this.customStyle,e),i?t.updateNativeS tyleProperties(this,this.customStyle):(this.isAttached?this._needsStylePropertie s()?this._updateStyleProperties():this._styleProperties=null:this.__stylePropert iesInvalid=!0,this._styleCache&&this._styleCache.clear(),this._updateRootStyles( ))},_updateRootStyles:function(e){e=e||this.root;for(var t,n=Polymer.dom(e)._que ry(function(e){return e.shadyRoot||e.shadowRoot}),r=0,s=n.length;r<s&&(t=n[r]);r ++)t.updateStyles&&t.updateStyles()}}),Polymer.updateStyles=function(e){r.update Styles(e),Polymer.Base._updateRootStyles(document)};var o=new Polymer.StyleCache ;Polymer.customStyleCache=o;var a=n.SCOPE_NAME,l=t.XSCOPE_NAME}(),Polymer.Base._ addFeature({_registerFeatures:function(){this._prepIs(),this._prepConstructor(), this._prepStyles()},_finishRegisterFeatures:function(){this._prepTemplate(),this ._prepShimStyles(),this._prepAnnotations(),this._prepEffects(),this._prepBehavio rs(),this._prepPropertyInfo(),this._prepBindings(),this._prepShady()},_prepBehav ior:function(e){this._addPropertyEffects(e.properties),this._addComplexObserverE ffects(e.observers),this._addHostAttributes(e.hostAttributes)},_initFeatures:fun ction(){this._setupGestures(),this._setupConfigure(),this._setupStyleProperties( ),this._setupDebouncers(),this._setupShady(),this._registerHost(),this._template &&(this._validateApplyShim(),this._poolContent(),this._beginHosting(),this._stam pTemplate(),this._endHosting(),this._marshalAnnotationReferences()),this._marsha lInstanceEffects(),this._marshalBehaviors(),this._marshalHostAttributes(),this._ marshalAttributes(),this._tryReady()},_marshalBehavior:function(e){e.listeners&& this._listenListeners(e.listeners)}}),function(){var e,t=Polymer.StyleProperties ,n=Polymer.StyleUtil,r=Polymer.CssParse,s=Polymer.StyleDefaults,i=Polymer.StyleT ransformer,o=Polymer.ApplyShim,a=Polymer.Debounce,l=Polymer.Settings;Polymer({is :"custom-style",extends:"style",_template:null,properties:{include:String},ready :function(){this.__appliedElement=this.__appliedElement||this,this.__cssBuild=n. getCssBuildType(this),this.__appliedElement!==this&&(this.__appliedElement.__css Build=this.__cssBuild),this._tryApply()},attached:function(){this._tryApply()},_ tryApply:function(){if(!this._appliesToDocument&&this.parentNode&&"dom-module"!= =this.parentNode.localName){this._appliesToDocument=!0;var e=this.__appliedEleme nt;if(l.useNativeCSSProperties||(this.__needsUpdateStyles=s.hasStyleProperties() ,s.addStyle(e)),e.textContent||this.include)this._apply(!0);else{var t=this,n=ne w MutationObserver(function(){n.disconnect(),t._apply(!0)});n.observe(e,{childLi st:!0})}}},_updateStyles:function(){Polymer.updateStyles()},_apply:function(e){v ar t=this.__appliedElement;if(this.include&&(t.textContent=n.cssFromModules(this .include,!0)+t.textContent),t.textContent){var r=this.__cssBuild,s=n.isTargetedB uild(r);if(!l.useNativeCSSProperties||!s){var a=n.rulesForStyle(t);if(s||(n.forE achRule(a,function(e){i.documentRule(e)}),l.useNativeCSSProperties&&!r&&o.transf orm([t])),l.useNativeCSSProperties)t.textContent=n.toCssText(a);else{var c=this, h=function(){c._flushCustomProperties()};e?Polymer.RenderStatus.whenReady(h):h() }}}},_flushCustomProperties:function(){this.__needsUpdateStyles?(this.__needsUpd ateStyles=!1,e=a(e,this._updateStyles)):this._applyCustomProperties()},_applyCus tomProperties:function(){var e=this.__appliedElement;this._computeStylePropertie s();var s=this._styleProperties,i=n.rulesForStyle(e);i&&(e.textContent=n.toCssTe xt(i,function(e){var n=e.cssText=e.parsedCssText;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_",temp latize: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._customPrepAnnotat ions(t,e),this._prepParentProperties(t,e),t._prepEffects(),this._customPrepEffec ts(t),t._prepBehaviors(),t._prepPropertyInfo(),t._prepBindings(),t._notifyPathUp =this._notifyPathUpImpl,t._scopeElementClass=this._scopeElementClassImpl,t.liste n=this._listenImpl,t._showHideChildren=this._showHideChildrenImpl,t.__setPropert yOrig=this.__setProperty,t.__setProperty=this.__setPropertyImpl;var n=this._cons tructorImpl,r=function(e,t){n.call(this,e,t)};r.prototype=t,t.constructor=r,e._c ontent._ctor=r,this.ctor=r},_getRootDataHost:function(){return this.dataHost&&th is.dataHost._rootDataHost||this.dataHost},_showHideChildrenImpl:function(e){for( var t=this._children,n=0;n<t.length;n++){var r=t[n];Boolean(e)!=Boolean(r.__hide TemplateChildren__)&&(r.nodeType===Node.TEXT_NODE?e?(r.__polymerTextContent__=r. textContent,r.textContent=""):r.textContent=r.__polymerTextContent__:r.style&&(e ?(r.__polymerDisplay__=r.style.display,r.style.display="none"):r.style.display=r .__polymerDisplay__)),r.__hideTemplateChildren__=e}},__setPropertyImpl:function( e,t,n,r){r&&r.__hideTemplateChildren__&&"textContent"==e&&(e="__polymerTextConte nt__"),this.__setPropertyOrig(e,t,n,r)},_debounceTemplate:function(e){Polymer.do m.addDebouncer(this.debounce("_debounceTemplate",e))},_flushTemplates:function() {Polymer.dom.flush()},_customPrepEffects:function(e){var t=e._parentProps;for(va r n in t)e._addPropertyEffect(n,"function",this._createHostPropEffector(n));for( n in this._instanceProps)e._addPropertyEffect(n,"function",this._createInstanceP ropEffector(n))},_customPrepAnnotations:function(e,t){e._template=t;var n=t._con tent;if(!n._notes){var r=e._rootDataHost;r&&(Polymer.Annotations.prepElement=fun ction(){r._prepElement()}),n._notes=Polymer.Annotations.parseAnnotations(t),Poly mer.Annotations.prepElement=null,this._processAnnotations(n._notes)}e._notes=n._ notes,e._parentProps=n._parentProps},_prepParentProperties:function(e,t){var n=t his._parentProps=e._parentProps;if(this._forwardParentProp&&n){var r,s=e._parent PropProto;if(!s){for(r in this._instanceProps)delete n[r];s=e._parentPropProto=O bject.create(null),t!=this&&(Polymer.Bind.prepareModel(s),Polymer.Base.prepareMo delNotifyPath(s));for(r in n){var i=this._parentPropPrefix+r,o=[{kind:"function" ,effect:this._createForwardPropEffector(r),fn:Polymer.Bind._functionEffect},{kin d:"notify",fn:Polymer.Bind._notifyEffect,effect:{event:Polymer.CaseMap.camelToDa shCase(i)+"-changed"}}];Polymer.Bind._createAccessors(s,i,o)}}var a=this;t!=this &&(Polymer.Bind.prepareInstance(t),t._forwardParentProp=function(e,t){a._forward ParentProp(e,t)}),this._extendTemplate(t,s),t._pathEffector=function(e,t,n){retu rn a._pathEffectorImpl(e,t,n)}}},_createForwardPropEffector:function(e){return f unction(t,n){this._forwardParentProp(e,n)}},_createHostPropEffector:function(e){ var t=this._parentPropPrefix;return function(n,r){this.dataHost._templatized[t+e ]=r}},_createInstancePropEffector:function(e){return function(t,n,r,s){s||this.d ataHost._forwardInstanceProp(this,e,n)}},_extendTemplate:function(e,t){var n=Obj ect.getOwnPropertyNames(t);t._propertySetter&&(e._propertySetter=t._propertySett er);for(var r,s=0;s<n.length&&(r=n[s]);s++){var i=e[r],o=Object.getOwnPropertyDe scriptor(t,r);Object.defineProperty(e,r,o),void 0!==i&&e._propertySetter(r,i)}}, _showHideChildren:function(e){},_forwardInstancePath:function(e,t,n){},_forwardI nstanceProp:function(e,t,n){},_notifyPathUpImpl:function(e,t){var n=this.dataHos t,r=Polymer.Path.root(e);n._forwardInstancePath.call(n,this,e,t),r in n._parentP rops&&n._templatized._notifyPath(n._parentPropPrefix+e,t)},_pathEffectorImpl:fun ction(e,t,n){if(this._forwardParentPath&&0===e.indexOf(this._parentPropPrefix)){ var r=e.substring(this._parentPropPrefix.length),s=Polymer.Path.root(r);s in thi s._parentProps&&this._forwardParentPath(r,t)}Polymer.Base._pathEffector.call(thi s._templatized,e,t,n)},_constructorImpl:function(e,t){this._rootDataHost=t._getR ootDataHost(),this._setupConfigure(e),this._registerHost(t),this._beginHosting() ,this.root=this.instanceTemplate(this._template),this.root.__noContent=!this._no tes._hasContent,this.root.__styleScoped=!0,this._endHosting(),this._marshalAnnot atedNodes(),this._marshalInstanceEffects(),this._marshalAnnotatedListeners();for (var n=[],r=this.root.firstChild;r;r=r.nextSibling)n.push(r),r._templateInstance =this;this._children=n,t.__hideTemplateChildren__&&this._showHideChildren(!0),th is._tryReady()},_listenImpl: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)},_scop eElementClassImpl:function(e,t){var n=this._rootDataHost;return n?n._scopeElemen tClass(e,t):t},stamp:function(e){if(e=e||{},this._parentProps){var t=this._templ atized;for(var n in this._parentProps)void 0===e[n]&&(e[n]=t[this._parentPropPre fix+n])}return new this.ctor(e,this)},modelForElement:function(e){for(var t;e;)i f(t=e._templateInstance){if(t.dataHost==this)return t;e=t.dataHost}else e=e.pare ntNode}},Polymer({is:"dom-template",extends:"template",_template:null,behaviors: [Polymer.Templatizer],ready:function(){this.templatize(this)}}),Polymer._collect ions=new WeakMap,Polymer.Collection=function(e){Polymer._collections.set(e,this) ,this.userArray=e,this.store=e.slice(),this.initMap()},Polymer.Collection.protot ype={constructor:Polymer.Collection,initMap:function(){for(var e=this.omap=new W eakMap,t=this.pmap={},n=this.store,r=0;r<n.length;r++){var s=n[r];s&&"object"==t ypeof s?e.set(s,r):t[s]=r}},add:function(e){var t=this.store.push(e)-1;return e& &"object"==typeof e?this.omap.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:function(e){e&&"object"==typeof e?this.omap.delete(e):delete this.pmap[e]},remove:function(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.pma p[e],void 0!=t)return"#"+t},getKeys:function(){return Object.keys(this.store).ma p(function(e){return"#"+e})},_parseKey:function(e){if(e&&"#"==e[0])return e.slic e(1)},setItem:function(e,t){if(e=this._parseKey(e)){var n=this.store[e];n&&this. _removeFromMap(n),t&&"object"==typeof t?this.omap.set(t,e):this.pmap[t]=e,this.s tore[e]=t}},getItem:function(e){if(e=this._parseKey(e))return this.store[e]},get Items:function(){var e=[],t=this.store;for(var n in t)e.push(t[n]);return e},_ap plySplices:function(e){for(var t,n,r={},s=0;s<e.length&&(n=e[s]);s++){n.addedKey s=[];for(var i=0;i<n.removed.length;i++)t=this.getKey(n.removed[i]),r[t]=r[t]?nu ll:-1;for(i=0;i<n.addedCount;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[{rem oved:a,added:l}]}},Polymer.Collection.get=function(e){return Polymer._collection s.get(e)||new Polymer.Collection(e)},Polymer.Collection.applySplices=function(e, t){var n=Polymer._collections.get(e);return n?n._applySplices(t):null},Polymer({ is:"dom-repeat",extends:"template",_template:null,properties:{items:{type:Array} ,as:{type:String,value:"item"},indexAs:{type:String,value:"index"},sort:{type:Fu nction,observer:"_sortChanged"},filter:{type:Function,observer:"_filterChanged"} ,observe:{type:String,observer:"_observeChanged"},delay:Number,renderedItemCount :{type:Number,notify:!0,readOnly:!0},initialCount:{type:Number,observer:"_initia lizeChunking"},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Num ber,computed:"_computeFrameTime(targetFramerate)"}},behaviors:[Polymer.Templatiz er],observers:["_itemsChanged(items.*)"],created:function(){this._instances=[],t his._pool=[],this._limit=1/0;var e=this;this._boundRenderChunk=function(){e._ren derChunk()}},detached:function(){this.__isDetached=!0;for(var e=0;e<this._instan ces.length;e++)this._detachInstance(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._i nstanceProps={__key__:!0},this._instanceProps[this.as]=!0,this._instanceProps[th is.indexAs]=!0,this.ctor||this.templatize(this)},_sortChanged:function(e){var t= this._getRootDataHost();this._sortFn=e&&("function"==typeof e?e:function(){retur n t[e].apply(t,arguments)}),this._needFullRefresh=!0,this.items&&this._debounceT emplate(this._render)},_filterChanged:function(e){var t=this._getRootDataHost(); this._filterFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,argumen ts)}),this._needFullRefresh=!0,this.items&&this._debounceTemplate(this._render)} ,_computeFrameTime:function(e){return Math.ceil(1e3/e)},_initializeChunking:func tion(){this.initialCount&&(this._limit=this.initialCount,this._chunkCount=this.i nitialCount,this._lastChunkTime=performance.now())},_tryRenderChunk:function(){t his.items&&this._limit<this.items.length&&this.debounce("renderChunk",this._requ estRenderChunk)},_requestRenderChunk:function(){requestAnimationFrame(this._boun dRenderChunk)},_renderChunk:function(){var e=performance.now(),t=this._targetFra meTime/(e-this._lastChunkTime);this._chunkCount=Math.round(this._chunkCount*t)|| 1,this._limit+=this._chunkCount,this._lastChunkTime=e,this._debounceTemplate(thi s._render)},_observeChanged:function(){this._observePaths=this.observe&&this.obs erve.replace(".*",".").split(" ")},_itemsChanged:function(e){if("items"==e.path) Array.isArray(this.items)?this.collection=Polymer.Collection.get(this.items):thi s.items?this._error(this._logf("dom-repeat","expected array for `items`, found", this.items)):this.collection=null,this._keySplices=[],this._indexSplices=[],this ._needFullRefresh=!0,this._initializeChunking(),this._debounceTemplate(this._ren der);else if("items.splices"==e.path)this._keySplices=this._keySplices.concat(e. value.keySplices),this._indexSplices=this._indexSplices.concat(e.value.indexSpli ces),this._debounceTemplate(this._render);else{var t=e.path.slice(6);this._forwa rdItemPath(t,e.value),this._checkObservedPaths(t)}},_checkObservedPaths:function (e){if(this._observePaths){e=e.substring(e.indexOf(".")+1);for(var t=this._obser vePaths,n=0;n<t.length;n++)if(0===e.indexOf(t[n]))return this._needFullRefresh=! 0,void(this.delay?this.debounce("render",this._render,this.delay):this._debounce Template(this._render))}},render:function(){this._needFullRefresh=!0,this._debou nceTemplate(this._render),this._flushTemplates()},_render:function(){this._needF ullRefresh?(this._applyFullRefresh(),this._needFullRefresh=!1):this._keySplices. length&&(this._sortFn?this._applySplicesUserSort(this._keySplices):this._filterF n?this._applyFullRefresh():this._applySplicesArrayOrder(this._indexSplices)),thi s._keySplices=[],this._indexSplices=[];for(var e=this._keyToInstIdx={},t=this._i nstances.length-1;t>=0;t--){var n=this._instances[t];n.isPlaceholder&&t<this._li mit?n=this._insertInstance(t,n.__key__):!n.isPlaceholder&&t>=this._limit&&(n=thi s._downgradeInstance(t,n.__key__)),e[n.__key__]=t,n.isPlaceholder||n.__setProper ty(this.indexAs,t,!0)}this._pool.length=0,this._setRenderedItemCount(this._insta nces.length),this.fire("dom-change"),this._tryRenderChunk()},_applyFullRefresh:f unction(){var e,t=this.collection;if(this._sortFn)e=t?t.getKeys():[];else{e=[];v ar n=this.items;if(n)for(var r=0;r<n.length;r++)e.push(t.getKey(n[r]))}var s=thi s;for(this._filterFn&&(e=e.filter(function(e){return s._filterFn(t.getItem(e))}) ),this._sortFn&&e.sort(function(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.isPlace holder&&r<this._limit&&o.__setProperty(this.as,t.getItem(i),!0)):r<this._limit?t his._insertInstance(r,i):this._insertPlaceholder(r,i)}for(var a=this._instances. length-1;a>=r;a--)this._detachAndRemoveInstance(a)},_numericSort:function(e,t){r eturn e-t},_applySplicesUserSort: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 c=a[i];v oid 0!==c&&this._detachAndRemoveInstance(c)}var h=this;if(l.length){this._filter Fn&&(l=l.filter(function(e){return h._filterFn(r.getItem(e))})),l.sort(function( e,t){return h._sortFn(r.getItem(e),r.getItem(t))});var u=0;for(i=0;i<l.length;i+ +)u=this._insertRowUserSort(u,l[i])}},_insertRowUserSort:function(e,t){for(var n =this.collection,r=n.getItem(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;els e{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++){fo r(var r=0;r<t.removed.length;r++)this._detachAndRemoveInstance(t.index);for(r=0; r<t.addedKeys.length;r++)this._insertPlaceholder(t.index+r,t.addedKeys[r])}},_de tachInstance:function(e){var 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).appendChil d(r)}return t}},_attachInstance:function(e,t){var n=this._instances[e];n.isPlace holder||t.insertBefore(n.root,this)},_detachAndRemoveInstance:function(e){var t= this._detachInstance(e);t&&this._pool.push(t),this._instances.splice(e,1)},_inse rtPlaceholder:function(e,t){this._instances.splice(e,0,{isPlaceholder:!0,__key__ :t})},_stampInstance:function(e,t){var n={__key__:t};return n[this.as]=this.coll ection.getItem(t),n[this.indexAs]=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._instan ces[e+1],s=r&&!r.isPlaceholder?r._children[0]:this,i=Polymer.dom(this).parentNod e;return Polymer.dom(i).insertBefore(n.root,s),this._instances[e]=n,n},_downgrad eInstance:function(e,t){var n=this._detachInstance(e);return n&&this._pool.push( n),n={isPlaceholder:!0,__key__:t},this._instances[e]=n,n},_showHideChildren:func tion(e){for(var t=0;t<this._instances.length;t++)this._instances[t]._showHideChi ldren(e)},_forwardInstanceProp:function(e,t,n){if(t==this.as){var r;r=this._sort Fn||this._filterFn?this.items.indexOf(this.collection.getItem(e.__key__)):e[this .indexAs],this.set("items."+r,n)}},_forwardInstancePath:function(e,t,n){0===t.in dexOf(this.as+".")&&this._notifyPath("items."+e.__key__+"."+t.slice(this.as.leng th+1),n)},_forwardParentProp:function(e,t){for(var n,r=this._instances,s=0;s<r.l ength&&(n=r[s]);s++)n.isPlaceholder||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.isPlac eholder||n._notifyPath(e,t,!0)},_forwardItemPath:function(e,t){if(this._keyToIns tIdx){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:functi on(e){var t=this.modelForElement(e);return t&&t[this.as]},keyForElement:function (e){var t=this.modelForElement(e);return t&&t.__key__},indexForElement:function( e){var t=this.modelForElement(e);return t&&t[this.indexAs]}}),Polymer({is:"array -selector",_template:null,properties:{items:{type:Array,observer:"clearSelection "},multi:{type:Boolean,value:!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.se lected.length;e++)this.unlinkPaths("selected."+e);else this.unlinkPaths("selecte d"),this.unlinkPaths("selectedItem");this.multi?this.selected&&!this.selected.le ngth||(this.selected=[],this._selectedColl=Polymer.Collection.get(this.selected) ):(this.selected=null,this._selectedColl=null),this.selectedItem=null},isSelecte d:function(e){return this.multi?void 0!==this._selectedColl.getKey(e):this.selec ted==e},deselect:function(e){if(this.multi){if(this.isSelected(e)){var t=this._s electedColl.getKey(e);this.arrayDelete("selected",e),this.unlinkPaths("selected. "+t)}}else this.selected=null,this.selectedItem=null,this.unlinkPaths("selected" ),this.unlinkPaths("selectedItem")},select:function(e){var t=Polymer.Collection. get(this.items),n=t.getKey(e);if(this.multi)if(this.isSelected(e))this.toggle&&t his.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","item s."+n),this.linkPaths("selectedItem","items."+n))}}),Polymer({is:"dom-if",extend s:"template",_template:null,properties:{if:{type:Boolean,value:!1,observer:"_que ueRender"},restamp:{type:Boolean,value:!1,observer:"_queueRender"}},behaviors:[P olymer.Templatizer],_queueRender:function(){this._debounceTemplate(this._render) },detached:function(){this.parentNode&&(this.parentNode.nodeType!=Node.DOCUMENT_ FRAGMENT_NODE||Polymer.Settings.hasShadow&&this.parentNode instanceof ShadowRoot )||this._teardownInstance()},attached:function(){this.if&&this.ctor&&this.async( this._ensureInstance)},render:function(){this._flushTemplates()},_render:functio n(){this.if?(this.ctor||this.templatize(this),this._ensureInstance(),this._showH ideChildren()):this.restamp&&this._teardownInstance(),!this.restamp&&this._insta nce&&this._showHideChildren(),this.if!=this._lastIf&&(this.fire("dom-change"),th is._lastIf=this.if)},_ensureInstance:function(){var e=Polymer.dom(this).parentNo de;if(e){var t=Polymer.dom(e);if(this._instance){var n=this._instance._children; if(n&&n.length){var r=Polymer.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._instance.root;t.insertBefore(o,this)}}},_teardownInstan ce:function(){if(this._instance){var e=this._instance._children;if(e&&e.length)f or(var t,n=Polymer.dom(Polymer.dom(e[0]).parentNode),r=0;r<e.length&&(t=e[r]);r+ +)n.removeChild(t);this._instance=null}},_showHideChildren:function(){var e=this .__hideTemplateChildren__||!this.if;this._instance&&this._instance._showHideChil dren(e)},_forwardParentProp:function(e,t){this._instance&&this._instance.__setPr operty(e,t,!0)},_forwardParentPath:function(e,t){this._instance&&this._instance. _notifyPath(e,t,!0)}}),Polymer({is:"dom-bind",extends:"template",_template:null, created:function(){var e=this;Polymer.RenderStatus.whenReady(function(){"loading "==document.readyState?document.addEventListener("DOMContentLoaded",function(){e ._markImportsReady()}):e._markImportsReady()})},_ensureReady:function(){this._re adied||this._readySelf()},_markImportsReady:function(){this._importsReady=!0,thi s._ensureReady()},_registerFeatures:function(){this._prepConstructor()},_insertC hildren:function(){var e=Polymer.dom(Polymer.dom(this).parentNode);e.insertBefor e(this.root,this)},_removeChildren:function(){if(this._children)for(var e=0;e<th is._children.length;e++)this.root.appendChild(this._children[e])},_initFeatures: function(){},_scopeElementClass:function(e,t){return this.dataHost?this.dataHost ._scopeElementClass(e,t):t},_configureInstanceProperties:function(){},_prepConfi gure:function(){var e={};for(var t in this._propertyEffects)e[t]=this[t];var n=t his._setupConfigure;this._setupConfigure=function(){n.call(this,e)}},attached:fu nction(){this._importsReady&&this.render()},detached:function(){this._removeChil dren()},render:function(){this._ensureReady(),this._children||(this._template=th is,this._prepAnnotations(),this._prepEffects(),this._prepBehaviors(),this._prepC onfigure(),this._prepBindings(),this._prepPropertyInfo(),Polymer.Base._initFeatu res.call(this),this._children=Polymer.TreeApi.arrayCopyChildNodes(this.root)),th is._insertChildren(),this.fire("dom-change")}})</script> <script> window.Swarmin gBehaviors = window.SwarmingBehaviors || {};
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 console.log("ignoring failure because a second request happened."); 79 console.log("ignoring failure because a second request happened.");
80 this.set(busy, false); 80 this.set(busy, false);
81 return; 81 return;
82 } 82 }
83 this.set(bindTo, false); 83 this.set(bindTo, false);
84 this.set(busy, false); 84 this.set(busy, false);
85 return Promise.reject(reason); 85 return Promise.reject(reason);
86 }.bind(this)); 86 }.bind(this));
87 }, 87 },
88 88
89 // _getJsonAsyncArr is the array analog to _getJsonAsync. For example,
90 // if there is an array that will contain multiple results rendered with
91 // a dom-repeat, _getJsonAsyncArr will make an XHR GET request and put
92 // the results into the given array at the index specified by idx.
93 //
94 // Prior to making this call, it is assumed that arr is initialized to be
95 // an array of empty (or filler) objects. busyArr be initialized in the
96 // same way. Due to how Polymer deals with arrays, arrays of primitives
97 // are not supported, thus clients observing busyArr should iterate over
98 // all objects in busyArr and test to see if busyArr[i].status is true.
99 //
100 // To avoid multiple requests clobering one another, an object _jsonAsync
101 // is created on "this" to debounce requests - the most recent request
102 // will win out.
103 _getJsonAsyncArr: function(idx, arr, url, busyArr, headers, params) {
104 if (!arr || !url || !busyArr) {
105 console.log("Need at least a polymer array to bind to, a busy element, and a url");
106 return;
107 }
108 var key = arr + ":" + idx;
109 this.splice(busyArr, idx, 1, {status:true});
110 var now = new Date();
111 this._jsonAsync = this._jsonAsync || {};
112 this._jsonAsync[key] = now;
113 if (params) {
114 url = url + "?" + sk.query.fromParamSet(params);
115 }
116 return sk.request("GET", url, "", headers).then(JSON.parse).then(functio n(json){
117 if (this._jsonAsync[key] !== now) {
118 console.log("ignoring result because a second request happened for " , key);
119 this.splice(busyArr, idx, 1, {status:false});
120 return;
121 }
122 this.splice(arr, idx, 1, json);
123 this.splice(busyArr, idx, 1, {status:false});
124 }.bind(this)).catch(function(reason){
125 console.log("Reason for failure of request to " + url, reason);
126
127 if (this._jsonAsync[key] !== now) {
128 console.log("ignoring failure because a second request happened.");
129 this.splice(busyArr, idx, 1, {status:false});
130 return;
131 }
132 this.splice(busyArr, idx, 1, {status:false});
133 return Promise.reject(reason);
134 }.bind(this));
135 },
136
89 _humanDuration: function(timeInSecs) { 137 _humanDuration: function(timeInSecs) {
90 return sk.human.strDuration(timeInSecs) || "0s"; 138 return sk.human.strDuration(timeInSecs) || "0s";
91 }, 139 },
92 140
93 _not: function(a) { 141 _not: function(a) {
94 return !a; 142 return !a;
95 }, 143 },
96 144
97 _or: function() { 145 _or: function() {
98 var result = false; 146 var result = false;
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 }, 554 },
507 disk_space: function(dir, botA, botB) { 555 disk_space: function(dir, botA, botB) {
508 // We sort based on the raw number of MB of the first disk. 556 // We sort based on the raw number of MB of the first disk.
509 var botACol = botA.disks[0].mb; 557 var botACol = botA.disks[0].mb;
510 var botBCol = botB.disks[0].mb; 558 var botBCol = botB.disks[0].mb;
511 return dir * swarming.naturalCompare(botACol, botBCol); 559 return dir * swarming.naturalCompare(botACol, botBCol);
512 }, 560 },
513 first_seen: function(dir, botA, botB) { 561 first_seen: function(dir, botA, botB) {
514 var botACol = botA.first_seen_ts; 562 var botACol = botA.first_seen_ts;
515 var botBCol = botB.first_seen_ts; 563 var botBCol = botB.first_seen_ts;
516 return dir * swarming.naturalCompare(botACol, botBCol) 564 return dir * swarming.naturalCompare(botACol, botBCol);
565 },
566 gpu: function(dir, botA, botB) {
567 // We want all the "none" GPU bots to come last in the list.
568 var botACol = this._column("gpu", botA);
569 if (botACol === "none") {
570 botACol = "ZZZ";
571 }
572 var botBCol = this._column("gpu", botB);
573 if (botBCol === "none") {
574 botBCol = "ZZZ";
575 }
576 return dir * swarming.naturalCompare(botACol, botBCol);
517 }, 577 },
518 last_seen: function(dir, botA, botB) { 578 last_seen: function(dir, botA, botB) {
519 var botACol = botA.last_seen_ts; 579 var botACol = botA.last_seen_ts;
520 var botBCol = botB.last_seen_ts; 580 var botBCol = botB.last_seen_ts;
521 return dir * swarming.naturalCompare(botACol, botBCol) 581 return dir * swarming.naturalCompare(botACol, botBCol)
522 }, 582 },
523 running_time: function(dir, botA, botB) { 583 running_time: function(dir, botA, botB) {
524 var botACol = this._state(botA, "running_time") || 0; 584 var botACol = this._state(botA, "running_time") || 0;
525 var botBCol = this._state(botB, "running_time") || 0; 585 var botBCol = this._state(botB, "running_time") || 0;
526 return dir * swarming.naturalCompare(botACol, botBCol) 586 return dir * swarming.naturalCompare(botACol, botBCol)
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 706
647 _reload: function() { 707 _reload: function() {
648 if (!this._auth_headers || !this._query_params) { 708 if (!this._auth_headers || !this._query_params) {
649 return; 709 return;
650 } 710 }
651 var url = "/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this._qu ery_params); 711 var url = "/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this._qu ery_params);
652 this.$.page_bots.load(url,this._auth_headers); 712 this.$.page_bots.load(url,this._auth_headers);
653 } 713 }
654 714
655 }); 715 });
656 })(); </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","/api/swarming/v1/tasks/tags","_busy2",this.auth_headers),this._getJsonAsync( "_dimensions","/api/swarming/v1/bots/dimensions","_busy1",this.auth_headers)},_p rimaryArr:function(t){var a=Object.keys(t);return a.sort(),a},_primaryMap:functi on(a,s){a=a&&a.tasks_tags||[],s=s&&s.bots_dimensions||[],tasks=this.tasks||[];va r 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(function(t){O bject.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.k eys(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_RUNNING",this. COMPLETED,"COMPLETED_SUCCESS","COMPLETED_FAILURE",this.EXPIRED,this.TIMED_OUT,th is.BOT_DIED,this.CANCELED,"DEDUPED","ALL"],r.costs_usd=[],r.deduped_from=[],r.du ration=[],r.server_versions=[],r.bot=[],t.forEach(function(t){r[t]=[]}),r},parse Tasks:function(a){if(!a||!a.items)return[];var s=new Date;return a.items.forEach (function(a){var e={};a.tags=a.tags||[],a.tags.forEach(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.human.localeTime(a[t]))}),!a.dura tion&&a.state===this.RUNNING&&a.started_ts&&(a.duration=(s-a.started_ts)/1e3),a. duration&&(a.human_duration=this._humanDuration(a.duration))}.bind(this)),a.item s}})}()</script> </dom-module> <dom-module id="task-list" assetpath="/res/imp/ta sklist/"> <template> <style include="iron-flex iron-flex-alignment iron-position ing swarming-app-style dynamic-table-style task-style">task-filters{margin-botto m:8px;margin-right:10px}.task-list th>span{padding-right:30px}</style> <url-para m name="s" value="{{_sortstr}}" default_value="created_ts:desc"> </url-param> <s warming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" permissio ns="{{_permissions}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2)]]" n ame="Swarming Task List"> <h2 hidden$="[[_signed_in]]">You must sign in to see a nything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <task-list-data id="da ta" auth_headers="[[_auth_headers]]" query_params="[[_query_params]]" tasks="[[_ items]]" busy="{{_busy1)}}" primary_map="{{_primary_map}}" primary_arr="{{_prima ry_arr}}"> </task-list-data> <div class="horizontal layout"> <task-filters prima ry_map="[[_primary_map]]" primary_arr="[[_primary_arr]]" columns="{{_columns}}" query_params="{{_query_params}}" filter="{{_filter}}"> </task-filters> </div> <t able class="task-list"> <thead on-sort_change="_sortChange"> <tr> <th> <span>Tas k Name</span> <sort-toggle name="name" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('state', _columns.*)]]"> <span>State</span> <sort-toggle n ame="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="deduped_from" current="[[_sort]] "> </sort-toggle> </th> <th hidden$="[[_hide('source_revision', _columns.*)]]"> <span>Source Revision</span> <sort-toggle name="source_revision" current="[[_sor t]]"> </sort-toggle> </th> <template is="dom-repeat" items="[[_plainColumns]]" a s="c"> <th hidden$="[[_hide(c)]]"> <span>[[_header(c)]]</span> <sort-toggle name ="[[c]]" current="[[_sort]]"> </sort-toggle> </th> </template> </tr> </thead> <t body> <template id="tasks_table" is="dom-repeat" items="[[_filteredSortedItems]] " as="task" initial-count="50"> <tr class$="[[_taskClass(task)]]"> <td> <a class ="center" href$="[[_taskLink(task.task_id)]]" target="_blank"> [[task.name]] </a > </td> <td hidden$="[[_hide('state', _columns.*)]]"> [[_column('state', task)]] <paper-button raised="" hidden$="[[_cannotCancel(task,_permissions)]]" on-tap=" _promptCancel"> Cancel </paper-button> </td> <td hidden$="[[_hide('bot', _column s.*)]]"> <a class="center" href$="[[_botLink(task.bot_id)]]" target="_blank"> [[ _column('bot',task)]] </a> </td> <td hidden$="[[_hide('deduped_from', _columns.* )]]"> <a class="center" href$="[[_taskLink(task.deduped_from)]]" target="_blank" > [[_column('deduped_from',task)]] </a> </td> <td hidden$="[[_hide('source_revis ion', _columns.*)]]"> <a class="center" href$="[[_sourceLink(task)]]" target="_b lank"> [[_column('source_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}}" parse="[[_ parseTasks]]"> </pageable-data> </div> </swarming-app> <paper-dialog id="prompt" modal="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Ar e you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-but ton dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confir m="">Yes</paper-button> </div> </paper-dialog> <error-toast></error-toast> </tem plate> <script>!function(){function t(t){return function(e){return this._attribu te(e,"human_"+t)[0]}}function e(t){return function(e,a,s){var r=this._attribute( a,t,"0")[0],i=this._attribute(s,t,"0")[0];return e*(r-i)}}var a=["deduped_from", "name","state","bot","source_revision"],s={abandoned_ts:t("abandoned_ts"),bot:fu nction(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"),source_revision :function(t){var e=this._attribute(t,"source_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=this._attribute(t,"try_number","-1")[0];return"0"===a?"COMPLETE D (DEDUPED)":"COMPLETED (SUCCESS)"}return e}},r={user:"Requesting User"},i={aban doned_ts:e("abandoned_ts"),completed_ts:e("completed_ts"),created_ts:e("created_ ts"),duration:e("duration"),modified_ts:e("modified_ts"),started_ts:e("started_t s")};Polymer({is:"task-list",behaviors:[SwarmingBehaviors.DynamicTableBehavior,S warmingBehaviors.TaskBehavior],properties:{client_id:{type:String},_busy1:{type: Boolean,value:!1},_busy2:{type:Boolean,value:!1},_parseTasks:{type:Function,valu e:function(){return this.$.data.parseTasks.bind(this)}},_toCancel:{type:String}, _columnMap:{type:Object,value:function(){var t=this._commonColumns();for(var e i n s)t[e]=s[e];return t}},_headerMap:{type:Object,value:r},_specialColumns:{type: Array,value:a},_specialSort:{type:Object,value:i}},observers:["reload(_query_par ams,_auth_headers)"],_attribute:function(t,e,a){void 0===a&&(a="none");var s=thi s._tag(t,e)||t[e]||[a];return Array.isArray(s)?s:[s]},_cannotCancel:function(t,e ){return!(e&&e.cancel_task&&"PENDING"===this._column("state",t))},_cancelTask:fu nction(){var t="/api/swarming/v1/task/"+this._toCancel+"/cancel";swarming.postWi thToast(t,"Canceling task "+this._toCancel,this._auth_headers),this.set("_toCanc el","")},_promptClosed:function(t){t.detail.confirmed&&this._cancelTask()},_prom ptCancel:function(t){var e=t.model.task;return e&&e.task_id?(this.set("_toCancel ",e.task_id),this.set("_dialogPrompt",'cancel task "'+e.name+'"'),void this.$.pr ompt.open()):void console.log("Missing task info",e)},reload:function(){if(this. _auth_headers&&this._query_params){var t="/api/swarming/v1/tasks/list?"+sk.query .fromParamSet(this._query_params);this.$.page_tasks.load(t,this._auth_headers)}} ,_sourceLink:function(t){var e=this._attribute(t,"source_revision")[0],a=this._a ttribute(t,"source_repo")[0];return"none"!==e&&"none"!==a&&a.replace("%s",e)},_t ag:function(t,e){if(t&&t.tagMap)return t.tagMap[e]},_taskClass:function(t){retur n this.stateClass(this._column("state",t))}})}()</script> </dom-module> <dom-mod ule id="iron-collapse" assetpath="/res/imp/bower_components/iron-collapse/"> <te mplate> <style>:host{display:block;transition-duration:var(--iron-collapse-trans ition-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:[Polyme r.IronResizableBehavior],properties:{horizontal:{type:Boolean,value:!1,observer: "_horizontalChanged"},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedC hanged"},noAnimation:{type:Boolean},_desiredSize:{type:String,value:""}},get dim ension(){return this.horizontal?"width":"height"},get _dimensionMax(){return thi s.horizontal?"maxWidth":"maxHeight"},get _dimensionMaxCss(){return this.horizont al?"max-width":"max-height"},hostAttributes:{role:"group","aria-hidden":"true"," aria-expanded":"false"},listeners:{transitionend:"_transitionEnd"},attached:func tion(){this._transitionEnd()},toggle:function(){this.opened=!this.opened},show:f unction(){this.opened=!0},hide:function(){this.opened=!1},updateSize:function(i, t){if(i="auto"===i?"":i,this._desiredSize!==i){this._desiredSize=i,this._updateT ransition(!1);var e=t&&!this.noAnimation&&this._isDisplayed;if(e){var n=this._ca lcSize();""===i&&(this.style[this._dimensionMax]="",i=this._calcSize()),this.sty le[this._dimensionMax]=n,this.scrollTop=this.scrollTop,this._updateTransition(!0 ),e=i!==n}this.style[this._dimensionMax]=i,e||this._transitionEnd()}},enableTran sition:function(i){Polymer.Base._warn("`enableTransition()` is deprecated, use ` noAnimation` instead."),this.noAnimation=!i},_updateTransition:function(i){this. style.transitionDuration=i&&!this.noAnimation?"":"0s"},_horizontalChanged:functi on(){this.style.transitionProperty=this._dimensionMaxCss;var i="maxWidth"===this ._dimensionMax?"maxHeight":"maxWidth";this.style[i]="",this.updateSize(this.open ed?"auto":"0px",!1)},_openedChanged:function(){this.setAttribute("aria-expanded" ,this.opened),this.setAttribute("aria-hidden",!this.opened),this.toggleClass("ir on-collapse-closed",!1),this.toggleClass("iron-collapse-opened",!1),this.updateS ize(this.opened?"auto":"0px",!0),this.opened&&this.focus()},_transitionEnd:funct ion(){this.style[this._dimensionMax]=this._desiredSize,this.toggleClass("iron-co llapse-closed",!this.opened),this.toggleClass("iron-collapse-opened",this.opened ),this._updateTransition(!1),this.notifyResize()},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.IronMenubarBehaviorImpl={hostAttributes:{role:"menubar"},keyBind ings:{left:"_onLeftKey",right:"_onRightKey"},_onUpKey:function(e){this.focusedIt em.click(),e.detail.keyboardEvent.preventDefault()},_onDownKey:function(e){this. focusedItem.click(),e.detail.keyboardEvent.preventDefault()},get _isRTL(){return "rtl"===window.getComputedStyle(this).direction},_onLeftKey:function(e){this._is RTL?this._focusNext():this._focusPrevious(),e.detail.keyboardEvent.preventDefaul t()},_onRightKey:function(e){this._isRTL?this._focusPrevious():this._focusNext() ,e.detail.keyboardEvent.preventDefault()},_onKeydown:function(e){this.keyboardEv entMatchesKeys(e,"up down left right esc")||this._focusWithKeyboardEvent(e)}},Po lymer.IronMenubarBehavior=[Polymer.IronMenuBehavior,Polymer.IronMenubarBehaviorI mpl]</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> <dom-module id="paper-tab" assetp ath="/res/imp/bower_components/paper-tabs/"> <template> <style>:host{@apply(--la yout-inline);@apply(--layout-center);@apply(--layout-center-justified);@apply(-- layout-flex-auto);position:relative;padding:0 12px;overflow:hidden;cursor:pointe r;vertical-align:middle;@apply(--paper-font-common-base);@apply(--paper-tab)}:ho st(:focus){outline:0}:host([link]){padding:0}.tab-content{height:100%;transform: translateZ(0);-webkit-transform:translateZ(0);transition:opacity .1s cubic-bezie r(.4,0,1,1);@apply(--layout-horizontal);@apply(--layout-center-center);@apply(-- layout-flex-auto);@apply(--paper-tab-content)}:host(:not(.iron-selected))>.tab-c ontent{opacity:.8;@apply(--paper-tab-content-unselected)}:host(:focus) .tab-cont ent{opacity:1;font-weight:700}paper-ripple{color:var(--paper-tab-ink,--paper-yel low-a100)}.tab-content>::content>a{@apply(--layout-flex-auto);height:100%}</styl e> <div class="tab-content"> <content></content> </div> </template> <script>Poly mer({is:"paper-tab",behaviors:[Polymer.IronControlState,Polymer.IronButtonState, Polymer.PaperRippleBehavior],properties:{link:{type:Boolean,value:!1,reflectToAt tribute:!0}},hostAttributes:{role:"tab"},listeners:{down:"_updateNoink",tap:"_on Tap"},attached:function(){this._updateNoink()},get _parentNoink(){var t=Polymer. dom(this).parentNode;return!!t&&!!t.noink},_updateNoink:function(){this.noink=!! this.noink||!!this._parentNoink},_onTap:function(t){if(this.link){var e=this.que ryEffectiveChildren("a");if(!e)return;if(t.target===e)return;e.click()}}})</scri pt> </dom-module> <dom-module id="paper-tabs" assetpath="/res/imp/bower_componen ts/paper-tabs/"> <template> <style>:host{@apply(--layout);@apply(--layout-center );height:48px;font-size:14px;font-weight:500;overflow:hidden;-moz-user-select:no ne;-ms-user-select:none;-webkit-user-select:none;user-select:none;-webkit-tap-hi ghlight-color:transparent;-webkit-tap-highlight-color:transparent;@apply(--paper -tabs)}:host-context([dir=rtl]){@apply(--layout-horizontal-reverse)}#tabsContain er{position:relative;height:100%;white-space:nowrap;overflow:hidden;@apply(--lay out-flex-auto)}#tabsContent{height:100%;-moz-flex-basis:auto;-ms-flex-basis:auto ;flex-basis:auto}#tabsContent.scrollable{position:absolute;white-space:nowrap}#t absContent.scrollable.fit-container,#tabsContent:not(.scrollable){@apply(--layou t-horizontal)}#tabsContent.scrollable.fit-container{min-width:100%}#tabsContent. scrollable.fit-container>::content>*{-ms-flex:1 0 auto;-webkit-flex:1 0 auto;fle x:1 0 auto}.hidden{display:none}.not-visible{opacity:0;cursor:default}paper-icon -button{width:48px;height:48px;padding:12px;margin:0 4px}#selectionBar{position: absolute;height:2px;bottom:0;left:0;right:0;background-color:var(--paper-tabs-se lection-bar-color,--paper-yellow-a100);-webkit-transform:scale(0);transform:scal e(0);-webkit-transform-origin:left center;transform-origin:left center;transitio n:-webkit-transform;transition:transform;@apply(--paper-tabs-selection-bar)}#sel ectionBar.align-bottom{top:0;bottom:auto}#selectionBar.expand{transition-duratio n:.15s;transition-timing-function:cubic-bezier(.4,0,1,1)}#selectionBar.contract{ transition-duration:.18s;transition-timing-function:cubic-bezier(0,0,.2,1)}#tabs Content>::content>:not(#selectionBar){height:100%}</style> <paper-icon-button ic on="paper-tabs:chevron-left" class$="[[_computeScrollButtonClass(_leftHidden, sc rollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onLeftScroll ButtonDown" tabindex="-1"></paper-icon-button> <div id="tabsContainer" on-track= "_scroll" on-down="_down"> <div id="tabsContent" class$="[[_computeTabsContentCl ass(scrollable, fitContainer)]]"> <div id="selectionBar" class$="[[_computeSelec tionBarClass(noBar, alignBottom)]]" on-transitionend="_onBarTransitionEnd"></div > <content select="*"></content> </div> </div> <paper-icon-button icon="paper-ta bs:chevron-right" class$="[[_computeScrollButtonClass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRightScrollButtonDow n" tabindex="-1"></paper-icon-button> </template> <script>Polymer({is:"paper-tab s",behaviors:[Polymer.IronResizableBehavior,Polymer.IronMenubarBehavior],propert ies:{noink:{type:Boolean,value:!1,observer:"_noinkChanged"},noBar:{type:Boolean, value:!1},noSlide:{type:Boolean,value:!1},scrollable:{type:Boolean,value:!1},fit Container:{type:Boolean,value:!1},disableDrag:{type:Boolean,value:!1},hideScroll Buttons:{type:Boolean,value:!1},alignBottom:{type:Boolean,value:!1},selectable:{ type:String,value:"paper-tab"},autoselect:{type:Boolean,value:!1},autoselectDela y:{type:Number,value:0},_step:{type:Number,value:10},_holdDelay:{type:Number,val ue:1},_leftHidden:{type:Boolean,value:!1},_rightHidden:{type:Boolean,value:!1},_ previousTab:{type:Object}},hostAttributes:{role:"tablist"},listeners:{"iron-resi ze":"_onTabSizingChanged","iron-items-changed":"_onTabSizingChanged","iron-selec t":"_onIronSelect","iron-deselect":"_onIronDeselect"},keyBindings:{"left:keyup r ight:keyup":"_onArrowKeyup"},created:function(){this._holdJob=null,this._pending ActivationItem=void 0,this._pendingActivationTimeout=void 0,this._bindDelayedAct ivationHandler=this._delayedActivationHandler.bind(this),this.addEventListener(" blur",this._onBlurCapture.bind(this),!0)},ready:function(){this.setScrollDirecti on("y",this.$.tabsContainer)},detached:function(){this._cancelPendingActivation( )},_noinkChanged:function(t){var e=Polymer.dom(this).querySelectorAll("paper-tab ");e.forEach(t?this._setNoinkAttribute:this._removeNoinkAttribute)},_setNoinkAtt ribute:function(t){t.setAttribute("noink","")},_removeNoinkAttribute:function(t) {t.removeAttribute("noink")},_computeScrollButtonClass:function(t,e,i){return!e| |i?"hidden":t?"not-visible":""},_computeTabsContentClass:function(t,e){return t? "scrollable"+(e?" fit-container":""):" fit-container"},_computeSelectionBarClass :function(t,e){return t?"hidden":e?"align-bottom":""},_onTabSizingChanged:functi on(){this.debounce("_onTabSizingChanged",function(){this._scroll(),this._tabChan ged(this.selectedItem)},10)},_onIronSelect:function(t){this._tabChanged(t.detail .item,this._previousTab),this._previousTab=t.detail.item,this.cancelDebouncer("t ab-changed")},_onIronDeselect:function(t){this.debounce("tab-changed",function() {this._tabChanged(null,this._previousTab),this._previousTab=null},1)},_activateH andler:function(){this._cancelPendingActivation(),Polymer.IronMenuBehaviorImpl._ activateHandler.apply(this,arguments)},_scheduleActivation:function(t,e){this._p endingActivationItem=t,this._pendingActivationTimeout=this.async(this._bindDelay edActivationHandler,e)},_delayedActivationHandler:function(){var t=this._pending ActivationItem;this._pendingActivationItem=void 0,this._pendingActivationTimeout =void 0,t.fire(this.activateEvent,null,{bubbles:!0,cancelable:!0})},_cancelPendi ngActivation:function(){void 0!==this._pendingActivationTimeout&&(this.cancelAsy nc(this._pendingActivationTimeout),this._pendingActivationItem=void 0,this._pend ingActivationTimeout=void 0)},_onArrowKeyup:function(t){this.autoselect&&this._s cheduleActivation(this.focusedItem,this.autoselectDelay)},_onBlurCapture:functio n(t){t.target===this._pendingActivationItem&&this._cancelPendingActivation()},ge t _tabContainerScrollSize(){return Math.max(0,this.$.tabsContainer.scrollWidth-t his.$.tabsContainer.offsetWidth)},_scroll:function(t,e){if(this.scrollable){var i=e&&-e.ddx||0;this._affectScroll(i)}},_down:function(t){this.async(function(){t his._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAsync),this._default FocusAsync=null)},1)},_affectScroll:function(t){this.$.tabsContainer.scrollLeft+ =t;var e=this.$.tabsContainer.scrollLeft;this._leftHidden=0===e,this._rightHidde n=e===this._tabContainerScrollSize},_onLeftScrollButtonDown:function(){this._scr ollToLeft(),this._holdJob=setInterval(this._scrollToLeft.bind(this),this._holdDe lay)},_onRightScrollButtonDown:function(){this._scrollToRight(),this._holdJob=se tInterval(this._scrollToRight.bind(this),this._holdDelay)},_onScrollButtonUp:fun ction(){clearInterval(this._holdJob),this._holdJob=null},_scrollToLeft:function( ){this._affectScroll(-this._step)},_scrollToRight:function(){this._affectScroll( this._step)},_tabChanged:function(t,e){if(!t)return this.$.selectionBar.classLis t.remove("expand"),this.$.selectionBar.classList.remove("contract"),void this._p ositionBar(0,0);var i=this.$.tabsContent.getBoundingClientRect(),n=i.width,o=t.g etBoundingClientRect(),s=o.left-i.left;if(this._pos={width:this._calcPercent(o.w idth,n),left:this._calcPercent(s,n)},this.noSlide||null==e)return this.$.selecti onBar.classList.remove("expand"),this.$.selectionBar.classList.remove("contract" ),void this._positionBar(this._pos.width,this._pos.left);var a=e.getBoundingClie ntRect(),l=this.items.indexOf(e),c=this.items.indexOf(t),r=5;this.$.selectionBar .classList.add("expand");var h=l<c,d=this._isRTL;d&&(h=!h),h?this._positionBar(t his._calcPercent(o.left+o.width-a.left,n)-r,this._left):this._positionBar(this._ calcPercent(a.left+a.width-o.left,n)-r,this._calcPercent(s,n)+r),this.scrollable &&this._scrollToSelectedIfNeeded(o.width,s)},_scrollToSelectedIfNeeded: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.transform("translateX("+e+"%) scaleX( "+t/100+")",this.$.selectionBar)},_onBarTransitionEnd:function(t){var e=this.$.s electionBar.classList;e.contains("expand")?(e.remove("expand"),e.add("contract") ,this._positionBar(this._pos.width,this._pos.left)):e.contains("contract")&&e.re move("contract")}})</script> </dom-module> <dom-module id="single-page-style" as setpath="/res/imp/common/"> <template> <style>.header{max-width:800px}.title{fon t-size:1.5em;font-weight:700;margin:5px}.id_input{margin-left:5px;--paper-input- container-input:{font-size:2em};}.refresh{max-width:40px;max-height:40px;width:i nitial;height:initial}button{min-width:4em;max-height: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{background-color:#A6CEE3;color:#000}pa per-tab.iron-selected{background-color:#1F78B4;color:#fff;font-weight:700;text-d ecoration:underline}paper-tab[disabled]{background-color:#AAA;text-decoration:li ne-through}.quarantined{background-color:#fdd}.dead{background-color:#ccc}</styl e> </template> </dom-module><script>!function(){SwarmingBehaviors.BotPageBehavio r=[SwarmingBehaviors.CommonBehavior,{}]}()</script> <dom-module id="bot-page-dat a" assetpath="/res/imp/botpage/"> <script>!function(){function t(t){if(!s){var e =t.toString();s=e.substring(e.indexOf("("))}return t.toLocaleString()+" "+s}var e,s,i=400,n=["first_seen_ts","last_seen_ts","lease_expiration_ts"],a=["started_t s","completed_ts","abandoned_ts","modified_ts"];Polymer({is:"bot-page-data",beha viors:[SwarmingBehaviors.BotPageBehavior],properties:{auth_headers:{type:Object} ,bot_id:{type:String},busy:{type:Boolean,computed:"_or(_busy1)",notify:!0},bot:{ type:Object,computed:"_parseBot(_bot)",notify:!0},bot_exists:{type:Boolean,value :!0,notify:!0},_busy1:{type:Boolean,value:!1},_bot:{type:Object},_events:{type:O bject},_tasks:{type:Object}},observers:["request(auth_headers,bot_id)"],request: function(){this.bot_id&&this.auth_headers&&(e&&this.cancelAsync(e),e=this.async( function(){e=void 0;var t="/api/swarming/v1/bot/"+this.bot_id,s=this._getJsonAsy nc("_bot",t+"/get","_busy1",this.auth_headers);s.then(function(){this.set("bot_e xists",!0)}.bind(this)).catch(function(t){404===t.status?this.set("bot_exists",! 1):sk.errorMessage("Http response: "+(t.status||" ")+" "+t.response)}.bind(this) ),this.fire("reload",{id:this.bot_id})},i))},_parseBot:function(e){if(!e)return{ };e.state=e.state||"{}",e.state=JSON.parse(e.state)||{};var s=e.state.disks||{}, i=Object.keys(s);if(i.length){e.disks=[];for(var a=0;a<i.length;a++)e.disks.push ({id:i[a],mb:s[i[a]].free_mb});e.disks.sort(function(t,e){return e.mb-t.mb})}els e e.disks=[{id:"unknown",mb:0}];return e.dimensions=e.dimensions||[],e.dimension s.forEach(function(t){swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(t.key)!==-1 &&t.value.forEach(function(e,s){t.value[s]=swarming.alias.apply(e,t.key)})}),n.f orEach(function(s){e[s]&&(e[s]=new Date(e[s]),e["human_"+s]=t(e[s]))}),e},parseE vents:function(e){if(!e||!e.items)return[];var e=e.items;return e.forEach(functi on(e){e.ts&&(e.ts=new Date(e.ts),e.human_ts=t(e.ts))}),e.sort(function(t,e){retu rn 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_duration=this._humanDuration(e.dura tion);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.started_ ts)/1e3}e.state=e.state||"UNKNOWN","COMPLETED"===e.state&&(e.failure?e.state="FA ILURE":e.state="SUCCESS")}.bind(this)),e.sort(function(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 include="single-page-style">.wr apper{display:table;margin-left:auto;margin-bottom:10px;margin-right:5px}paper-c heckbox{margin-left:5px}.thick{border-top-style:solid}</style> <url-param name=" show_full_names" value="{{_show_full_names}}"> </url-param> <url-param name="sho w_all_tasks" value="{{_show_all_tasks}}"> </url-param> <url-param name="sort_sta ts" value="{{_sortstr}}" default_value="total:desc"> </url-param> <div class="wr apper"> <table> <thead on-sort_change="_sortChange"> <tr> <th> <span>Name</span> <sort-toggle name="full_name" current="[[_sort]]"> </sort-toggle> </th> <th> <s pan>Total</span> <sort-toggle name="total" current="[[_sort]]"> </sort-toggle> < /th> <th> <span>Success</span> <sort-toggle name="success" 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> <th> <span>Average Duration</sp an> <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> <templ ate is="dom-repeat" items="[[_tasksToShow]]" as="task"> <tr> <td hidden$="[[_tru thy(_show_full_names)]]" title="[[task.full_name]]">[[task.name]]</td> <td hidde n$="[[_not(_show_full_names)]]" title="[[task.full_name]]">[[task.full_name]]</t d> <td>[[task.total]]</td> <td>[[task.success]]</td> <td>[[task.failed]]</td> <t d>[[task.bot_died]]</td> <td>[[_humanDuration(task.avg_duration)]]</td> <td>[[_h umanDuration(task.total_time)]]</td> <td>[[task.total_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>[[_humanDuration(_totalStats.avg_duration)] ]</td> <td>[[_humanDuration(_totalStats.total_time)]]</td> <td>100.0%</td> </tr> </tbody></table> <div> <table> <thead> <tr> <th title="How much time passed bet ween the oldest task fetched and now."> Total Wall Time </th> <th title="How muc h 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> <paper-ch eckbox checked="{{_show_full_names}}"> Show Full Names </paper-checkbox> <paper- checkbox hidden$="[[_cannotExpand]]" checked="{{_show_all_tasks}}"> Show All Tas ks </paper-checkbox> </div> </div> </template> <script>!function(){var t=15;Poly mer({is:"bot-page-summary",behaviors:[SwarmingBehaviors.BotPageBehavior],propert ies:{tasks:{type:Array},_cannotExpand:{type:Boolean,computed:"_countTasks(_taskS tats.*)"},_show_all_tasks:{type:Boolean},_show_full_names:{type:Boolean},_sortst r:{type:String},_sort:{type:Object,computed:"_makeSortObject(_sortstr)"},_taskSt ats:{type:Array},_tasksToShow:{type:Array,computed:"_sortAndLimitTasks(_taskStat s.*,_sort.*,_show_all_tasks)"},_totalStats:{type:Object}},observers:["_aggregate (tasks.*)"],_aggregate:function(){if(this.tasks&&this.tasks.length){var t=new Da te(1e3*sk.now()),a={},e={total:this.tasks.length,success:0,failed:0,bot_died:0,a vg_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.name.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,fai led: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_dur ation=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(funct ion(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({m inOccurrence:Math.max(2,s.length-1),minLength:6});o.build(s);var n=o.weighByAver age()||[];n.length&&n[0].source.forEach(function(t){var a=i[t].full_name;i[t].na me=a.replace(n[0].name,"...")}),this.set("_taskStats",i)}},_compare:function(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])},_countTasks:func tion(){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],d irection:a[1]}}},_sortAndLimitTasks:function(){swarming.stableSort(this._taskSta ts,this._compare.bind(this));var a=this._taskStats.length;return!this._show_all_ tasks&&this._taskStats.length>t&&(a=t),this._taskStats.slice(0,a)},_sortChange:f unction(t){t&&t.detail&&t.detail.name&&(t.preventDefault(),t.stopPropagation(),t his.set("_sortstr",t.detail.name+":"+t.detail.direction))}})}()</script> </dom-m odule><dom-module id="bot-page" assetpath="/res/imp/botpage/"> <template> <style include="iron-flex iron-flex-alignment iron-positioning swarming-app-style sing le-page-style task-style">.message{white-space:pre-line;font-family:monospace}.b ot_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-color:#f ff;--paper-checkbox-checked-color:#fff;--paper-checkbox-checkmark-color:#000;--p aper-checkbox-unchecked-color:#fff;padding:3px}paper-dialog{border-radius:6px}</ style> <url-param name="id" value="{{bot_id}}"> </url-param> <url-param name="sh ow_all_events" value="{{_show_all}}"> </url-param> <url-param name="selected" va lue="{{_selected}}"> </url-param> <url-param name="show_state" value="{{_show_st ate}}"> </url-param> <swarming-app client_id="[[client_id]]" auth_headers="{{_au th_headers}}" permissions="{{_permissions}}" server_details="{{_server_details}} " signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2,_busy3)]]" name="Swarming 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_header s="[[_auth_headers]]" bot_id="[[bot_id]]" bot="{{_bot}}" bot_exists="{{_bot_exis ts}}" 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> <h2 hidden$="[[_bot_exists]]">Bot not found.</h2> <div hidden$ ="[[_not(_bot_exists)]]"> <div class="horizontal wrap layout"> <div class="flex" > <table> <tbody><tr class$="[[_isDead(_bot)]]" title="Last time the bot contact ed 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="[[_ca nShutdown(_bot,_permissions)]]"> <button class="raised" on-click="_promptShutdow n"> Shut Down Gracefully </button> </template> <template is="dom-if" if="[[_canD elete(_bot,_permissions)]]"> <button class="raised" on-click="_promptDelete"> De lete </button> </template> </td> </tr> <template is="dom-if" if="[[_bot.quaranti ned]]"> <tr class="quarantined"> <td>Quarantined</td> <td colspan="2" class="mes sage">[[_quarantineMessage(_bot)]]</td> </tr> </template> <tr> <td>Current Task< /td> <td> <a target="_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.dim ensions]]" 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_details.bot_version ,_bot.version)]]" title="Version is based on the content of swarming_bot.zip whi ch is the swarming bot code. The bot won't update if quarantined, dead, or busy. "> <td>Bot Version</td> <td>[[_shorten(_bot.version,'8')]]</td> <td></td> </tr> <tr title="The version the server expects the bot to be using."> <td>Expected Bo t Version</td> <td>[[_shorten(_server_details.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 authentica ted by the server."> <td>Authenticated as</td> <td colspan="2">[[_bot.authentica ted_as]]</td> </tr> <template is="dom-if" if="[[_bot.lease_id]]"> <tr> <td>Machi ne Provider Lease ID</td> <td colspan="2"> <a href$="[[_mpLink(_bot,_server_deta ils.machine_provider_template)]]"> [[_bot.lease_id]] </a> </td> </tr> <tr> <td>M achine Provider Lease Expires</td> <td colspan="2">[[_bot.human_lease_expiration _ts]]</td> </tr> </template> </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]]"> <button on-click="_toggleState"> <ir on-icon icon="icons:remove-circle-outline"></iron-icon> </button> </template> <i ron-collapse id="collapse" opened="[[_show_state]]"> <div class="bot_state">[[_p rettyPrint(_bot.state)]]</div> </iron-collapse> </div> <div class="stats flex"> <bot-page-summary tasks="[[_tasks]]"> </bot-page-summary> </div> </div> <div cla ss="tabs"> <paper-tabs selected="{{_selected}}" no-bar=""> <paper-tab>Tasks</pap er-tab> <paper-tab>Events</paper-tab> </paper-tabs> <template is="dom-if" if="[[ _showEvents]]"> <paper-checkbox checked="{{_show_all}}"> Show all events </paper -checkbox> </template> </div> <template is="dom-if" if="[[_not(_showEvents)]]"> <table class="tasks_table"> <thead> <tr> <th>Task</th> <th>Started</th> <th>Dura tion</th> <th>Result</th> </tr> </thead> <tbody> <template is="dom-repeat" items ="{{_tasks}}" as="task"> <tr class$="[[_taskClass(task)]]"> <td> <a target="_bla nk" rel="noopener" href$="[[_taskLink(task.task_id)]]"> [[task.name]] </a> </td> <td>[[task.human_started_ts]]</td> <td title="[[task.human_completed_ts]]">[[ta sk.human_duration]]</td> <td>[[task.state]]</td> </tr> </template> </tbody> </ta ble> </template> <template is="dom-if" if="[[_showEvents]]"> <table class="event s_table"> <thead> <tr> <th>Message</th> <th>Type</th> <th>Timestamp</th> <th>Tas k ID</th> <th>Version</th> </tr> </thead> <tbody> <template is="dom-repeat" item s="{{_eventList(_show_all,_events.*)}}" as="event"> <tr> <td class="message">[[e vent.message]]</td> <td>[[event.event_type]]</td> <td>[[event.human_ts]]</td> <t d> <a target="_blank" rel="noopener" href$="[[_taskLink(event.task_id)]]"> [[eve nt.task_id]] </a> </td> <td class$="[[_classVersion(_server_details.bot_version, event.version)]]"> [[_shorten(event.version,'8')]] </td> </tr> </template> </tbo dy> </table> </template> <pageable-data id="page_tasks" hidden$="[[_showEvents]] " busy="{{_busy2}}" label="Show more tasks" output="{{_tasks}}" parse="[[_parseT asks]]"> </pageable-data> <pageable-data id="page_events" hidden$="[[_not(_showE vents)]]" busy="{{_busy3}}" label="Show more events" output="{{_events}}" parse= "[[_parseEvents]]"> </pageable-data> </div> </swarming-app> <paper-dialog id="pr ompt" modal="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <d iv>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <pape r-button dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-c onfirm="">Yes</paper-button> </div> </paper-dialog> <error-toast></error-toast> </template> <script> (function(){ 716 })(); </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(t){return t===this.CAN CELED||t===this.TIMED_OUT||t===this.EXPIRED?"exception":t===this.BOT_DIED?"bot_d ied":t===this.COMPLETED_FAILURE?"failed_task":t===this.RUNNING||t===this.PENDING ?"pending_task":""},state:function(t){return t?t.state===this.COMPLETED?t.failur e?this.COMPLETED_FAILURE:"0"===t.try_number?this.COMPLETED_DEDUPED:this.COMPLETE D_SUCCESS:t.state:""},_stateClass:function(t){return this.stateClass(this.state( t))}}}()</script> <dom-module id="task-style" assetpath="/res/imp/common/"> <tem plate> <style>.failed_task{background-color:#fdd}.bot_died{background-color:#ccc }.exception{background-color:#edd2ff}.pending_task{background-color:#fffc6c}</st yle> </template> </dom-module><dom-module id="task-filters" assetpath="/res/imp/ tasklist/"> <template> <style is="custom-style" include="iron-flex iron-flex-ali gnment iron-positioning query-column-filter-style">.item.wide{max-width:400px}.s elector.wide{min-width:275px}</style> <url-param name="f" value="{{_filters}}" d efault_values="[]" multi=""> </url-param> <url-param name="c" value="{{columns}} " default_values="[&quot;name&quot;,&quot;state&quot;,&quot;created_ts&quot;,&qu ot;user&quot;]" multi=""> </url-param> <url-param name="q" value="{{_query}}" de fault_value=""> </url-param> <url-param name="l" default_value="50" value="{{_li mit}}"> </url-param> <div class="container horizontal layout"> <div class="narro w-down-selector"> <div> <iron-a11y-keys target="[[_filter_input]]" keys="enter" on-keys-pressed="_manuallyAddFilter"></iron-a11y-keys> <paper-input id="filter" label="Search columns and filters or supply a filter and press enter" placeholde r="gpu nvidia pool:Chrome" value="{{_query::input}}"> </paper-input> </div> <div class="wide selector side-by-side" title="This shows all task tags and other in teresting 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="[[_primaryItems]]" as="item "> <div class="selectable item horizontal layout" label="[[item]]"> <span>[[_bef oreBold(item,_query)]]<span class="bold">[[_bold(item,_query)]]</span>[[_afterBo ld(item,_query)]]</span> <span class="flex"></span> <paper-checkbox noink="" dis abled$="[[_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 options (if any) that the task list can be filtered on."> <template is="dom-repeat" id="secondar yList" items="[[_secondaryItems]]" as="item"> <div class="item horizontal layout " label="[[item]]"> <span>[[_beforeBold(item,_query)]]<span class="bold">[[_bold (item,_query)]]</span>[[_afterBold(item,_query)]]</span> <span class="flex"></sp an> <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 ar e AND'd together and applied to all tasks."> <template is="dom-repeat" items="[[ _filters]]" as="fil"> <div class="item horizontal layout" label="[[fil]]"> <span >[[fil]]</span> <span class="flex"></span> <iron-icon class="icons" icon="icons: remove-circle-outline" hidden="[[_cantRemoveFilter(fil,_filters.*)]]" on-tap="_r emoveFilter"> </iron-icon> </div> </template> </div> <div class="side-by-side"> <paper-input id="_limit" label="Limit Results" auto-validate="" min="0" max="100 0" pattern="[0-9]+" value="{{_limit}}"> </paper-input> </div> </div> </div> </te mplate> <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("COMPLETE D_SUCCESS"===i)return r===this.COMPLETED&&!e;if("COMPLETED_FAILURE"===i)return r ===this.COMPLETED&&e;var a=this._attribute(t,"try_number","-1")[0];return"DEDUPE D"===i?r===this.COMPLETED&&"0"===a:void 0}};Polymer({is:"task-filters",behaviors :[SwarmingBehaviors.QueryColumnFilter,SwarmingBehaviors.TaskBehavior],properties :{columns:{type:Array,notify:!0},query_params:{type:Object,computed:"_extractQue ryParams(_filters.*, _limit)",notify:!0},_filterMap:{type:Object,value:function( ){var i=this._commonFilters();for(var r in t)i[r]=t[r];return i}}},_cantToggleCo lumn:function(t){return!t||"name"===t},_extractQueryParams:function(){var t={},i =[];this._filters.forEach(function(r){var e=r.split(this.FILTER_SEP,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.unapply(s)))}.bind( this)),t.tags=i;var r=parseInt(this._limit);return Number.isInteger(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" assetpath="/res/imp/t asklist/"> <script>!function(){var t=["abandoned_ts","completed_ts","created_ts" ,"modified_ts","started_ts"];Polymer({is:"task-list-data",behaviors:[SwarmingBeh aviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{auth_headers:{ type:Object,observer:"signIn"},query_params:{type:Object},tasks:{type:Array},bus y:{type:Boolean,computed:"_or(_busy2,_busy1)",notify:!0},primary_map:{type:Objec t,computed:"_primaryMap(_tags,_dimensions,tasks.*)",notify:!0},primary_arr:{type :Array,computed:"_primaryArr(primary_map)",notify:!0},_busy2:{type:Boolean,value :!1},_busy1:{type:Boolean,value:!1},_dimensions:{type:Object},_list:{type:Object },_tags:{type:Object}},signIn:function(){this._getJsonAsync("_tags","/api/swarmi ng/v1/tasks/tags","_busy2",this.auth_headers),this._getJsonAsync("_dimensions"," /api/swarming/v1/bots/dimensions","_busy1",this.auth_headers)},_primaryArr:funct ion(t){var a=Object.keys(t);return a.sort(),a},_primaryMap:function(a,s){a=a&&a. tasks_tags||[],s=s&&s.bots_dimensions||[],tasks=this.tasks||[];var e={};a.forEac h(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.f orEach(function(a){e[t.key][a]=!0})}),tasks.forEach(function(t){Object.keys(t.ta gMap).forEach(function(a){var s=t.tagMap[a];e[a]||(e[a]={}),e[a][s]=!0})}),delet e 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.n ame=[],r.state=[this.PENDING,this.RUNNING,"PENDING_RUNNING",this.COMPLETED,"COMP LETED_SUCCESS","COMPLETED_FAILURE",this.EXPIRED,this.TIMED_OUT,this.BOT_DIED,thi s.CANCELED,"DEDUPED","ALL"],r.costs_usd=[],r.deduped_from=[],r.duration=[],r.ser ver_versions=[],r.bot=[],t.forEach(function(t){r[t]=[]}),r},parseTasks:function( a){if(!a||!a.items)return[];var s=new Date;return a.items.forEach(function(a){va r e={};a.tags=a.tags||[],a.tags.forEach(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.human.localeTime(a[t]))}),!a.duration&&a.state== =this.RUNNING&&a.started_ts&&(a.duration=(s-a.started_ts)/1e3),a.duration&&(a.hu man_duration=this._humanDuration(a.duration))}.bind(this)),a.items}})}()</script > </dom-module> <dom-module id="task-list" assetpath="/res/imp/tasklist/"> <temp late> <style include="iron-flex iron-flex-alignment iron-positioning swarming-ap p-style dynamic-table-style task-style">task-filters{margin-bottom:8px;margin-ri ght:10px}.task-list th>span{padding-right:30px}</style> <url-param name="s" valu e="{{_sortstr}}" default_value="created_ts:desc"> </url-param> <swarming-app cli ent_id="[[client_id]]" auth_headers="{{_auth_headers}}" permissions="{{_permissi ons}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2)]]" name="Swarming T ask List"> <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful. </h2> <div hidden$="[[_not(_signed_in)]]"> <task-list-data id="data" auth_header s="[[_auth_headers]]" query_params="[[_query_params]]" tasks="[[_items]]" busy=" {{_busy1)}}" primary_map="{{_primary_map}}" primary_arr="{{_primary_arr}}"> </ta sk-list-data> <div class="horizontal layout"> <task-filters primary_map="[[_prim ary_map]]" primary_arr="[[_primary_arr]]" columns="{{_columns}}" query_params="{ {_query_params}}" filter="{{_filter}}"> </task-filters> </div> <table class="tas k-list"> <thead on-sort_change="_sortChange"> <tr> <th> <span>Task Name</span> < sort-toggle name="name" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[ [_hide('state', _columns.*)]]"> <span>State</span> <sort-toggle name="state" cur rent="[[_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>Dedupe d from</span> <sort-toggle name="deduped_from" current="[[_sort]]"> </sort-toggl e> </th> <th hidden$="[[_hide('source_revision', _columns.*)]]"> <span>Source Re vision</span> <sort-toggle name="source_revision" current="[[_sort]]"> </sort-to ggle> </th> <template is="dom-repeat" items="[[_plainColumns]]" as="c"> <th hidd en$="[[_hide(c)]]"> <span>[[_header(c)]]</span> <sort-toggle name="[[c]]" curren t="[[_sort]]"> </sort-toggle> </th> </template> </tr> </thead> <tbody> <template id="tasks_table" is="dom-repeat" items="[[_filteredSortedItems]]" as="task" ini tial-count="50"> <tr class$="[[_taskClass(task)]]"> <td> <a class="center" href$ ="[[_taskLink(task.task_id)]]" target="_blank"> [[task.name]] </a> </td> <td hid den$="[[_hide('state', _columns.*)]]"> [[_column('state', task)]] <paper-button raised="" hidden$="[[_cannotCancel(task,_permissions)]]" on-tap="_promptCancel"> Cancel </paper-button> </td> <td hidden$="[[_hide('bot', _columns.*)]]"> <a cla ss="center" href$="[[_botLink(task.bot_id)]]" target="_blank"> [[_column('bot',t ask)]] </a> </td> <td hidden$="[[_hide('deduped_from', _columns.*)]]"> <a class= "center" href$="[[_taskLink(task.deduped_from)]]" target="_blank"> [[_column('de duped_from',task)]] </a> </td> <td hidden$="[[_hide('source_revision', _columns. *)]]"> <a class="center" href$="[[_sourceLink(task)]]" target="_blank"> [[_colum n('source_revision',task)]] </a> </td> <template is="dom-repeat" items="[[_plain Columns]]" as="c"> <td hidden$="[[_hide(c)]]"> [[_column(c, task)]] </td> </temp late> </tr> </template> </tbody> </table> <pageable-data id="page_tasks" busy="{ {_busy2}}" label="Show more tasks" output="{{_items}}" parse="[[_parseTasks]]"> </pageable-data> </div> </swarming-app> <paper-dialog id="prompt" modal="" on-ir on-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-button dialog-dism iss="" autofocus="">No</paper-button> <paper-button dialog-confirm="">Yes</paper -button> </div> </paper-dialog> <error-toast></error-toast> </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 r=this._attribute(a,t,"0")[0],i=t his._attribute(s,t,"0")[0];return e*(r-i)}}var a=["deduped_from","name","state", "bot","source_revision"],s={abandoned_ts:t("abandoned_ts"),bot:function(t){retur n this._attribute(t,"bot_id")[0]},completed_ts:t("completed_ts"),costs_usd:funct ion(t){return this._attribute(t,"costs_usd",0)[0]},created_ts:t("created_ts"),du ration:t("duration"),modified_ts:t("modified_ts"),source_revision:function(t){va r e=this._attribute(t,"source_revision")[0];return e.substring(0,8)},started_ts: t("started_ts"),state:function(t){var e=this._attribute(t,"state")[0];if("COMPLE TED"===e){if(this._attribute(t,"failure",!1)[0])return"COMPLETED (FAILURE)";var a=this._attribute(t,"try_number","-1")[0];return"0"===a?"COMPLETED (DEDUPED)":"C OMPLETED (SUCCESS)"}return e}},r={user:"Requesting User"},i={abandoned_ts:e("aba ndoned_ts"),completed_ts:e("completed_ts"),created_ts:e("created_ts"),duration:e ("duration"),modified_ts:e("modified_ts"),started_ts:e("started_ts")};Polymer({i s:"task-list",behaviors:[SwarmingBehaviors.DynamicTableBehavior,SwarmingBehavior s.TaskBehavior],properties:{client_id:{type:String},_busy1:{type:Boolean,value:! 1},_busy2:{type:Boolean,value:!1},_parseTasks:{type:Function,value:function(){re turn this.$.data.parseTasks.bind(this)}},_toCancel:{type:String},_columnMap:{typ e:Object,value:function(){var t=this._commonColumns();for(var e in s)t[e]=s[e];r eturn t}},_headerMap:{type:Object,value:r},_specialColumns:{type:Array,value:a}, _specialSort:{type:Object,value:i}},observers:["reload(_query_params,_auth_heade rs)"],_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. cancel_task&&"PENDING"===this._column("state",t))},_cancelTask:function(){var t= "/api/swarming/v1/task/"+this._toCancel+"/cancel";swarming.postWithToast(t,"Canc eling task "+this._toCancel,this._auth_headers),this.set("_toCancel","")},_promp tClosed:function(t){t.detail.confirmed&&this._cancelTask()},_promptCancel:functi on(t){var e=t.model.task;return e&&e.task_id?(this.set("_toCancel",e.task_id),th is.set("_dialogPrompt",'cancel task "'+e.name+'"'),void this.$.prompt.open()):vo id console.log("Missing task info",e)},reload:function(){if(this._auth_headers&& this._query_params){var t="/api/swarming/v1/tasks/list?"+sk.query.fromParamSet(t his._query_params);this.$.page_tasks.load(t,this._auth_headers)}},_sourceLink:fu nction(t){var e=this._attribute(t,"source_revision")[0],a=this._attribute(t,"sou rce_repo")[0];return"none"!==e&&"none"!==a&&a.replace("%s",e)},_tag:function(t,e ){if(t&&t.tagMap)return t.tagMap[e]},_taskClass:function(t){return this.stateCla ss(this._column("state",t))}})}()</script> </dom-module> <dom-module id="iron-co llapse" assetpath="/res/imp/bower_components/iron-collapse/"> <template> <style> :host{display:block;transition-duration:var(--iron-collapse-transition-duration, 300ms);overflow:visible}:host(.iron-collapse-closed){display:none}:host(:not(.ir on-collapse-opened)){overflow:hidden}</style> <content></content> </template> </ dom-module> <script>Polymer({is:"iron-collapse",behaviors:[Polymer.IronResizable Behavior],properties:{horizontal:{type:Boolean,value:!1,observer:"_horizontalCha nged"},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},noAnim ation:{type:Boolean},_desiredSize:{type:String,value:""}},get dimension(){return this.horizontal?"width":"height"},get _dimensionMax(){return this.horizontal?"m axWidth":"maxHeight"},get _dimensionMaxCss(){return this.horizontal?"max-width": "max-height"},hostAttributes:{role:"group","aria-hidden":"true","aria-expanded": "false"},listeners:{transitionend:"_transitionEnd"},attached:function(){this._tr ansitionEnd()},toggle:function(){this.opened=!this.opened},show:function(){this. opened=!0},hide:function(){this.opened=!1},updateSize:function(i,t){if(i="auto"= ==i?"":i,this._desiredSize!==i){this._desiredSize=i,this._updateTransition(!1);v ar e=t&&!this.noAnimation&&this._isDisplayed;if(e){var n=this._calcSize();""===i &&(this.style[this._dimensionMax]="",i=this._calcSize()),this.style[this._dimens ionMax]=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("`enableTransition()` is deprecated, use `noAnimation` in stead."),this.noAnimation=!i},_updateTransition:function(i){this.style.transitio nDuration=i&&!this.noAnimation?"":"0s"},_horizontalChanged:function(){this.style .transitionProperty=this._dimensionMaxCss;var i="maxWidth"===this._dimensionMax? "maxHeight":"maxWidth";this.style[i]="",this.updateSize(this.opened?"auto":"0px" ,!1)},_openedChanged:function(){this.setAttribute("aria-expanded",this.opened),t his.setAttribute("aria-hidden",!this.opened),this.toggleClass("iron-collapse-clo sed",!1),this.toggleClass("iron-collapse-opened",!1),this.updateSize(this.opened ?"auto":"0px",!0),this.opened&&this.focus()},_transitionEnd:function(){this.styl e[this._dimensionMax]=this._desiredSize,this.toggleClass("iron-collapse-closed", !this.opened),this.toggleClass("iron-collapse-opened",this.opened),this._updateT ransition(!1),this.notifyResize()},get _isDisplayed(){var i=this.getBoundingClie ntRect();for(var t in i)if(0!==i[t])return!0;return!1},_calcSize:function(){retu rn this.getBoundingClientRect()[this.dimension]+"px"}})</script> <script>Polymer .IronMenubarBehaviorImpl={hostAttributes:{role:"menubar"},keyBindings:{left:"_on LeftKey",right:"_onRightKey"},_onUpKey:function(e){this.focusedItem.click(),e.de tail.keyboardEvent.preventDefault()},_onDownKey:function(e){this.focusedItem.cli ck(),e.detail.keyboardEvent.preventDefault()},get _isRTL(){return"rtl"===window. getComputedStyle(this).direction},_onLeftKey:function(e){this._isRTL?this._focus Next():this._focusPrevious(),e.detail.keyboardEvent.preventDefault()},_onRightKe y:function(e){this._isRTL?this._focusPrevious():this._focusNext(),e.detail.keybo ardEvent.preventDefault()},_onKeydown:function(e){this.keyboardEventMatchesKeys( e,"up down left right esc")||this._focusWithKeyboardEvent(e)}},Polymer.IronMenub arBehavior=[Polymer.IronMenuBehavior,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="chevro n-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g> </ defs></svg> </iron-iconset-svg> <dom-module id="paper-tab" assetpath="/res/imp/b ower_components/paper-tabs/"> <template> <style>:host{@apply(--layout-inline);@a pply(--layout-center);@apply(--layout-center-justified);@apply(--layout-flex-aut o);position:relative;padding:0 12px;overflow:hidden;cursor:pointer;vertical-alig n:middle;@apply(--paper-font-common-base);@apply(--paper-tab)}:host(:focus){outl ine:0}:host([link]){padding:0}.tab-content{height:100%;transform:translateZ(0);- webkit-transform:translateZ(0);transition:opacity .1s cubic-bezier(.4,0,1,1);@ap ply(--layout-horizontal);@apply(--layout-center-center);@apply(--layout-flex-aut o);@apply(--paper-tab-content)}:host(:not(.iron-selected))>.tab-content{opacity: .8;@apply(--paper-tab-content-unselected)}:host(:focus) .tab-content{opacity:1;f ont-weight:700}paper-ripple{color:var(--paper-tab-ink,--paper-yellow-a100)}.tab- content>::content>a{@apply(--layout-flex-auto);height:100%}</style> <div class=" tab-content"> <content></content> </div> </template> <script>Polymer({is:"paper- tab",behaviors:[Polymer.IronControlState,Polymer.IronButtonState,Polymer.PaperRi ppleBehavior],properties:{link:{type:Boolean,value:!1,reflectToAttribute:!0}},ho stAttributes:{role:"tab"},listeners:{down:"_updateNoink",tap:"_onTap"},attached: function(){this._updateNoink()},get _parentNoink(){var t=Polymer.dom(this).paren tNode;return!!t&&!!t.noink},_updateNoink:function(){this.noink=!!this.noink||!!t his._parentNoink},_onTap:function(t){if(this.link){var e=this.queryEffectiveChil dren("a");if(!e)return;if(t.target===e)return;e.click()}}})</script> </dom-modul e> <dom-module id="paper-tabs" assetpath="/res/imp/bower_components/paper-tabs/" > <template> <style>:host{@apply(--layout);@apply(--layout-center);height:48px;f ont-size:14px;font-weight:500;overflow:hidden;-moz-user-select:none;-ms-user-sel ect:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:t ransparent;-webkit-tap-highlight-color:transparent;@apply(--paper-tabs)}:host-co ntext([dir=rtl]){@apply(--layout-horizontal-reverse)}#tabsContainer{position:rel ative;height:100%;white-space:nowrap;overflow:hidden;@apply(--layout-flex-auto)} #tabsContent{height:100%;-moz-flex-basis:auto;-ms-flex-basis:auto;flex-basis:aut o}#tabsContent.scrollable{position:absolute;white-space:nowrap}#tabsContent.scro llable.fit-container,#tabsContent:not(.scrollable){@apply(--layout-horizontal)}# tabsContent.scrollable.fit-container{min-width:100%}#tabsContent.scrollable.fit- container>::content>*{-ms-flex:1 0 auto;-webkit-flex:1 0 auto;flex:1 0 auto}.hid den{display:none}.not-visible{opacity:0;cursor:default}paper-icon-button{width:4 8px;height:48px;padding:12px;margin:0 4px}#selectionBar{position:absolute;height :2px;bottom:0;left:0;right:0;background-color:var(--paper-tabs-selection-bar-col or,--paper-yellow-a100);-webkit-transform:scale(0);transform:scale(0);-webkit-tr ansform-origin:left center;transform-origin:left center;transition:-webkit-trans form;transition:transform;@apply(--paper-tabs-selection-bar)}#selectionBar.align -bottom{top:0;bottom:auto}#selectionBar.expand{transition-duration:.15s;transiti on-timing-function:cubic-bezier(.4,0,1,1)}#selectionBar.contract{transition-dura tion:.18s;transition-timing-function:cubic-bezier(0,0,.2,1)}#tabsContent>::conte nt>:not(#selectionBar){height:100%}</style> <paper-icon-button icon="paper-tabs: chevron-left" class$="[[_computeScrollButtonClass(_leftHidden, scrollable, hideS crollButtons)]]" on-up="_onScrollButtonUp" on-down="_onLeftScrollButtonDown" tab index="-1"></paper-icon-button> <div id="tabsContainer" on-track="_scroll" on-do wn="_down"> <div id="tabsContent" class$="[[_computeTabsContentClass(scrollable, fitContainer)]]"> <div id="selectionBar" class$="[[_computeSelectionBarClass(no Bar, alignBottom)]]" on-transitionend="_onBarTransitionEnd"></div> <content sele ct="*"></content> </div> </div> <paper-icon-button icon="paper-tabs:chevron-righ t" class$="[[_computeScrollButtonClass(_rightHidden, scrollable, hideScrollButto ns)]]" on-up="_onScrollButtonUp" on-down="_onRightScrollButtonDown" tabindex="-1 "></paper-icon-button> </template> <script>Polymer({is:"paper-tabs",behaviors:[P olymer.IronResizableBehavior,Polymer.IronMenubarBehavior],properties:{noink:{typ e:Boolean,value:!1,observer:"_noinkChanged"},noBar:{type:Boolean,value:!1},noSli de:{type:Boolean,value:!1},scrollable:{type:Boolean,value:!1},fitContainer:{type :Boolean,value:!1},disableDrag:{type:Boolean,value:!1},hideScrollButtons:{type:B oolean,value:!1},alignBottom:{type:Boolean,value:!1},selectable:{type:String,val ue:"paper-tab"},autoselect:{type:Boolean,value:!1},autoselectDelay:{type:Number, value:0},_step:{type:Number,value:10},_holdDelay:{type:Number,value:1},_leftHidd en:{type:Boolean,value:!1},_rightHidden:{type:Boolean,value:!1},_previousTab:{ty pe:Object}},hostAttributes:{role:"tablist"},listeners:{"iron-resize":"_onTabSizi ngChanged","iron-items-changed":"_onTabSizingChanged","iron-select":"_onIronSele ct","iron-deselect":"_onIronDeselect"},keyBindings:{"left:keyup right:keyup":"_o nArrowKeyup"},created:function(){this._holdJob=null,this._pendingActivationItem= void 0,this._pendingActivationTimeout=void 0,this._bindDelayedActivationHandler= this._delayedActivationHandler.bind(this),this.addEventListener("blur",this._onB lurCapture.bind(this),!0)},ready:function(){this.setScrollDirection("y",this.$.t absContainer)},detached:function(){this._cancelPendingActivation()},_noinkChange d:function(t){var e=Polymer.dom(this).querySelectorAll("paper-tab");e.forEach(t? this._setNoinkAttribute:this._removeNoinkAttribute)},_setNoinkAttribute:function (t){t.setAttribute("noink","")},_removeNoinkAttribute:function(t){t.removeAttrib ute("noink")},_computeScrollButtonClass:function(t,e,i){return!e||i?"hidden":t?" not-visible":""},_computeTabsContentClass:function(t,e){return t?"scrollable"+(e ?" fit-container":""):" fit-container"},_computeSelectionBarClass:function(t,e){ return t?"hidden":e?"align-bottom":""},_onTabSizingChanged:function(){this.debou nce("_onTabSizingChanged",function(){this._scroll(),this._tabChanged(this.select edItem)},10)},_onIronSelect:function(t){this._tabChanged(t.detail.item,this._pre viousTab),this._previousTab=t.detail.item,this.cancelDebouncer("tab-changed")},_ onIronDeselect:function(t){this.debounce("tab-changed",function(){this._tabChang ed(null,this._previousTab),this._previousTab=null},1)},_activateHandler:function (){this._cancelPendingActivation(),Polymer.IronMenuBehaviorImpl._activateHandler .apply(this,arguments)},_scheduleActivation:function(t,e){this._pendingActivatio nItem=t,this._pendingActivationTimeout=this.async(this._bindDelayedActivationHan dler,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:fu nction(){void 0!==this._pendingActivationTimeout&&(this.cancelAsync(this._pendin gActivationTimeout),this._pendingActivationItem=void 0,this._pendingActivationTi meout=void 0)},_onArrowKeyup:function(t){this.autoselect&&this._scheduleActivati on(this.focusedItem,this.autoselectDelay)},_onBlurCapture:function(t){t.target== =this._pendingActivationItem&&this._cancelPendingActivation()},get _tabContainer ScrollSize(){return Math.max(0,this.$.tabsContainer.scrollWidth-this.$.tabsConta iner.offsetWidth)},_scroll:function(t,e){if(this.scrollable){var i=e&&-e.ddx||0; this._affectScroll(i)}},_down:function(t){this.async(function(){this._defaultFoc usAsync&&(this.cancelAsync(this._defaultFocusAsync),this._defaultFocusAsync=null )},1)},_affectScroll:function(t){this.$.tabsContainer.scrollLeft+=t;var e=this.$ .tabsContainer.scrollLeft;this._leftHidden=0===e,this._rightHidden=e===this._tab ContainerScrollSize},_onLeftScrollButtonDown:function(){this._scrollToLeft(),thi s._holdJob=setInterval(this._scrollToLeft.bind(this),this._holdDelay)},_onRightS crollButtonDown:function(){this._scrollToRight(),this._holdJob=setInterval(this. _scrollToRight.bind(this),this._holdDelay)},_onScrollButtonUp:function(){clearIn terval(this._holdJob),this._holdJob=null},_scrollToLeft:function(){this._affectS croll(-this._step)},_scrollToRight:function(){this._affectScroll(this._step)},_t abChanged:function(t,e){if(!t)return this.$.selectionBar.classList.remove("expan d"),this.$.selectionBar.classList.remove("contract"),void this._positionBar(0,0) ;var i=this.$.tabsContent.getBoundingClientRect(),n=i.width,o=t.getBoundingClien tRect(),s=o.left-i.left;if(this._pos={width:this._calcPercent(o.width,n),left:th is._calcPercent(s,n)},this.noSlide||null==e)return this.$.selectionBar.classList .remove("expand"),this.$.selectionBar.classList.remove("contract"),void this._po sitionBar(this._pos.width,this._pos.left);var a=e.getBoundingClientRect(),l=this .items.indexOf(e),c=this.items.indexOf(t),r=5;this.$.selectionBar.classList.add( "expand");var h=l<c,d=this._isRTL;d&&(h=!h),h?this._positionBar(this._calcPercen t(o.left+o.width-a.left,n)-r,this._left):this._positionBar(this._calcPercent(a.l eft+a.width-o.left,n)-r,this._calcPercent(s,n)+r),this.scrollable&&this._scrollT oSelectedIfNeeded(o.width,s)},_scrollToSelectedIfNeeded:function(t,e){var i=e-th is.$.tabsContainer.scrollLeft;i<0?this.$.tabsContainer.scrollLeft+=i:(i+=t-this. $.tabsContainer.offsetWidth,i>0&&(this.$.tabsContainer.scrollLeft+=i))},_calcPer cent:function(t,e){return 100*t/e},_positionBar:function(t,e){t=t||0,e=e||0,this ._width=t,this._left=e,this.transform("translateX("+e+"%) scaleX("+t/100+")",thi s.$.selectionBar)},_onBarTransitionEnd:function(t){var e=this.$.selectionBar.cla ssList;e.contains("expand")?(e.remove("expand"),e.add("contract"),this._position Bar(this._pos.width,this._pos.left)):e.contains("contract")&&e.remove("contract" )}})</script> </dom-module> <dom-module id="single-page-style" assetpath="/res/i mp/common/"> <template> <style>.header{max-width:800px}.title{font-size:1.5em;fo nt-weight:700;margin:5px}.id_input{margin-left:5px;--paper-input-container-input :{font-size:2em};}.refresh{max-width:40px;max-height:40px;width:initial;height:i nitial}button{min-width:4em;max-height:55px}table{border-collapse:collapse;margi n-left:5px;margin-bottom:8px}td,th{border:1px solid #BBB;padding:5px}.tabs{backg round-color:#1F78B4;color:#fff;max-width:600px;margin-left:5px;--paper-checkbox- label-color:#fff}paper-tab{background-color:#A6CEE3;color:#000}paper-tab.iron-se lected{background-color:#1F78B4;color:#fff;font-weight:700;text-decoration:under line}paper-tab[disabled]{background-color:#AAA;text-decoration:line-through}.qua rantined{background-color:#fdd}.dead{background-color:#ccc}</style> </template> </dom-module><script>!function(){SwarmingBehaviors.BotPageBehavior=[SwarmingBeha viors.CommonBehavior,{}]}()</script> <dom-module id="bot-page-data" assetpath="/ res/imp/botpage/"> <script>!function(){function t(t){if(!s){var e=t.toString();s =e.substring(e.indexOf("("))}return t.toLocaleString()+" "+s}var e,s,i=400,n=["f irst_seen_ts","last_seen_ts","lease_expiration_ts"],a=["started_ts","completed_t s","abandoned_ts","modified_ts"];Polymer({is:"bot-page-data",behaviors:[Swarming Behaviors.BotPageBehavior],properties:{auth_headers:{type:Object},bot_id:{type:S tring},busy:{type:Boolean,computed:"_or(_busy1)",notify:!0},bot:{type:Object,com puted:"_parseBot(_bot)",notify:!0},bot_exists:{type:Boolean,value:!0,notify:!0}, _busy1:{type:Boolean,value:!1},_bot:{type:Object},_events:{type:Object},_tasks:{ type:Object}},observers:["request(auth_headers,bot_id)"],request:function(){this .bot_id&&this.auth_headers&&(e&&this.cancelAsync(e),e=this.async(function(){e=vo id 0;var t="/api/swarming/v1/bot/"+this.bot_id,s=this._getJsonAsync("_bot",t+"/g et","_busy1",this.auth_headers);s.then(function(){this.set("bot_exists",!0)}.bin d(this)).catch(function(t){404===t.status?this.set("bot_exists",!1):sk.errorMess age("Http response: "+(t.status||" ")+" "+t.response)}.bind(this)),this.fire("re load",{id:this.bot_id})},i))},_parseBot:function(e){if(!e)return{};e.state=e.sta te||"{}",e.state=JSON.parse(e.state)||{};var s=e.state.disks||{},i=Object.keys(s );if(i.length){e.disks=[];for(var a=0;a<i.length;a++)e.disks.push({id:i[a],mb:s[ i[a]].free_mb});e.disks.sort(function(t,e){return e.mb-t.mb})}else e.disks=[{id: "unknown",mb:0}];return e.dimensions=e.dimensions||[],e.dimensions.forEach(funct ion(t){swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(t.key)!==-1&&t.value.forEa ch(function(e,s){t.value[s]=swarming.alias.apply(e,t.key)})}),n.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.forEac h(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_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.started_ts)/1e3}e.state =e.state||"UNKNOWN","COMPLETED"===e.state&&(e.failure?e.state="FAILURE":e.state= "SUCCESS")}.bind(this)),e.sort(function(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 include="single-page-style">.wrapper{display:t able;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 name="show_all_tasks" va lue="{{_show_all_tasks}}"> </url-param> <url-param name="sort_stats" value="{{_s ortstr}}" default_value="total:desc"> </url-param> <div class="wrapper"> <table> <thead on-sort_change="_sortChange"> <tr> <th> <span>Name</span> <sort-toggle n ame="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="success" 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> <th> <span>Average Duration</span> <sort-toggl e name="avg_duration" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Total Duration</span> <sort-toggle name="total_time" current="[[_sort]]"> </sort-togg le> </th> <th>Percent of Total</th> </tr> </thead> <tbody> <template is="dom-rep eat" items="[[_tasksToShow]]" as="task"> <tr> <td hidden$="[[_truthy(_show_full_ names)]]" title="[[task.full_name]]">[[task.name]]</td> <td hidden$="[[_not(_sho w_full_names)]]" title="[[task.full_name]]">[[task.full_name]]</td> <td>[[task.t otal]]</td> <td>[[task.success]]</td> <td>[[task.failed]]</td> <td>[[task.bot_di ed]]</td> <td>[[_humanDuration(task.avg_duration)]]</td> <td>[[_humanDuration(ta sk.total_time)]]</td> <td>[[task.total_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>[[_totalStat s.bot_died]]</td> <td>[[_humanDuration(_totalStats.avg_duration)]]</td> <td>[[_h umanDuration(_totalStats.total_time)]]</td> <td>100.0%</td> </tr> </tbody></tabl e> <div> <table> <thead> <tr> <th title="How much time passed between the oldest task fetched and now."> Total Wall Time </th> <th title="How much of the wall t ime this bot was busy with a task."> Wall Time Utilization </th> </tr> </thead> <tbody> <tr> <td>[[_humanDuration(_totalStats.wall_time)]]</td> <td>[[_totalStat s.wall_time_utilization]]%</td> </tr> </tbody> </table> <paper-checkbox checked= "{{_show_full_names}}"> Show Full Names </paper-checkbox> <paper-checkbox hidden $="[[_cannotExpand]]" checked="{{_show_all_tasks}}"> Show All Tasks </paper-chec kbox> </div> </div> </template> <script>!function(){var t=15;Polymer({is:"bot-pa ge-summary",behaviors:[SwarmingBehaviors.BotPageBehavior],properties:{tasks:{typ e: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(_taskStats.*,_sort.*,_sh ow_all_tasks)"},_totalStats:{type:Object}},observers:["_aggregate(tasks.*)"],_ag gregate: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_died:0,avg_duration:0,t otal_time:0,wall_time:(t-this.tasks[this.tasks.length-1].started_ts)/1e3};this.t asks.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,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_t ime/e.total,e.wall_time_utilization=(100*e.total_time/e.wall_time).toFixed(1),th is.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_tim e/e.total_time).toFixed(1),i.push(a[t])});var o=new Substrings({minOccurrence:Ma th.max(2,s.length-1),minLength:6});o.build(s);var n=o.weighByAverage()||[];n.len gth&&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:function(t,a){if(!this._sor t)return 0;var e=1;return"desc"===this._sort.direction&&(e=-1),e*swarming.natura lCompare(t[this._sort.name],a[this._sort.name])},_countTasks:function(){return t his._taskStats.length<=t},_makeSortObject:function(t){if(t){var a=t.split(":");r eturn 2!=a.length?{name:"full_name",direction:"asc"}:{name:a[0],direction:a[1]}} },_sortAndLimitTasks:function(){swarming.stableSort(this._taskStats,this._compar e.bind(this));var a=this._taskStats.length;return!this._show_all_tasks&&this._ta skStats.length>t&&(a=t),this._taskStats.slice(0,a)},_sortChange:function(t){t&&t .detail&&t.detail.name&&(t.preventDefault(),t.stopPropagation(),this.set("_sorts tr",t.detail.name+":"+t.detail.direction))}})}()</script> </dom-module><dom-modu le id="bot-page" assetpath="/res/imp/botpage/"> <template> <style include="iron- flex iron-flex-alignment iron-positioning swarming-app-style single-page-style t ask-style">.message{white-space:pre-line;font-family:monospace}.bot_state{white- space:pre;font-family:monospace;margin-bottom:10px}.events_table,.tasks_table{bo rder: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:5 px;margin-top:auto}paper-checkbox{--paper-checkbox-label-color:#fff;--paper-chec kbox-checked-color:#fff;--paper-checkbox-checkmark-color:#000;--paper-checkbox-u nchecked-color:#fff;padding:3px}paper-dialog{border-radius:6px}</style> <url-par am name="id" value="{{bot_id}}"> </url-param> <url-param name="show_all_events" value="{{_show_all}}"> </url-param> <url-param name="selected" value="{{_selecte d}}"> </url-param> <url-param name="show_state" value="{{_show_state}}"> </url-p aram> <swarming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" p ermissions="{{_permissions}}" server_details="{{_server_details}}" signed_in="{{ _signed_in}}" busy="[[_or(_busy1,_busy2,_busy3)]]" name="Swarming Bot Page"> <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hid den$="[[_not(_signed_in)]]"> <bot-page-data id="data" auth_headers="[[_auth_head ers]]" bot_id="[[bot_id]]" bot="{{_bot}}" bot_exists="{{_bot_exists}}" busy="{{_ busy1}}" events="{{_events}}" tasks="{{_tasks}}" on-reload="_clearAndReload"> </ bot-page-data> <div class="header horizontal layout"> <paper-input class="id_inp ut" label="Bot id" value="{{bot_id}}"></paper-input> <template is="dom-if" if="[ [_ccLink(_bot)]]"> <div class="vertical layout"> <a href$="[[_ccLink(_bot)]]" cl ass="cloud">Cloud Console</a> </div> </template> <button on-click="_refresh"> <i ron-icon class="refresh" icon="icons:refresh"></iron-icon> </button> </div> </di v> <h2 hidden$="[[_bot_exists]]">Bot not found.</h2> <div hidden$="[[_not(_bot_e xists)]]"> <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_details.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_details.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"> <a href$="[[_mpLink(_bot,_server_details.machine_pro vider_template)]]"> [[_bot.lease_id]] </a> </td> </tr> <tr> <td>Machine Provider Lease Expires</td> <td colspan="2">[[_bot.human_lease_expiration_ts]]</td> </tr > </template> </tbody></table> <span class="title">State</span> <template is="do m-if" if="[[_not(_show_state)]]"> <button on-click="_toggleState"> <iron-icon ic on="icons:add-circle-outline"></iron-icon> </button> </template> <template is="d om-if" if="[[_show_state]]"> <button on-click="_toggleState"> <iron-icon icon="i cons:remove-circle-outline"></iron-icon> </button> </template> <iron-collapse id ="collapse" opened="[[_show_state]]"> <div class="bot_state">[[_prettyPrint(_bot .state)]]</div> </iron-collapse> </div> <div class="stats flex"> <bot-page-summa ry tasks="[[_tasks]]"> </bot-page-summary> </div> </div> <div class="tabs"> <pap er-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> </te mplate> </div> <template is="dom-if" if="[[_not(_showEvents)]]"> <table class="t asks_table"> <thead> <tr> <th>Task</th> <th>Started</th> <th>Duration</th> <th>R esult</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_tasks}}" a s="task"> <tr class$="[[_taskClass(task)]]"> <td> <a target="_blank" rel="noopen er" href$="[[_taskLink(task.task_id)]]"> [[task.name]] </a> </td> <td>[[task.hum an_started_ts]]</td> <td title="[[task.human_completed_ts]]">[[task.human_durati on]]</td> <td>[[task.state]]</td> </tr> </template> </tbody> </table> </template > <template is="dom-if" if="[[_showEvents]]"> <table class="events_table"> <thea d> <tr> <th>Message</th> <th>Type</th> <th>Timestamp</th> <th>Task ID</th> <th>V ersion</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_eventList (_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_details.bot_version,event.version)] ]"> [[_shorten(event.version,'8')]] </td> </tr> </template> </tbody> </table> </ template> <pageable-data id="page_tasks" hidden$="[[_showEvents]]" busy="{{_busy 2}}" label="Show more tasks" output="{{_tasks}}" parse="[[_parseTasks]]"> </page able-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 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> </template> <sc ript> (function(){
657 717
658 Polymer({ 718 Polymer({
659 is: 'bot-page', 719 is: 'bot-page',
660 720
661 behaviors: [ 721 behaviors: [
662 SwarmingBehaviors.BotPageBehavior, 722 SwarmingBehaviors.BotPageBehavior,
663 ], 723 ],
664 724
665 properties: { 725 properties: {
666 bot_id: { 726 bot_id: {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 return "failed_task"; 934 return "failed_task";
875 } 935 }
876 return ""; 936 return "";
877 }, 937 },
878 938
879 _toggleState: function() { 939 _toggleState: function() {
880 this.set("_show_state", !this._show_state); 940 this.set("_show_state", !this._show_state);
881 } 941 }
882 942
883 }); 943 });
884 })(); </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},task_exists: {type:Boolean,value:!0,notify:!0},_busy1:{type:Boolean,value:!1},_busy2:{type:Bo olean,value:!1},_busy3:{type:Boolean,value:!1},_request:{type:Object},_result:{t ype:Object},_stdout:{type:Object}},observers:["reload(auth_headers,task_id)"],re load:function(){if(!this.task_id||!this.auth_headers)return void console.log("ta sk_id and auth_headers can't be empty");t&&this.cancelAsync(t);var s="/api/swarm ing/v1/task/"+this.task_id;t=this.async(function(){t=void 0;var e=this._getJsonA sync("_request",s+"/request","_busy1",this.auth_headers);e.then(function(){this. set("task_exists",!0)}.bind(this)).catch(function(t){404===t.status?this.set("ta sk_exists",!1):sk.errorMessage("Http response: "+(t.status||" ")+" "+t.response) }.bind(this)),this._getJsonAsync("_result",s+"/result?include_performance_stats= true","_busy2",this.auth_headers),this.reloadStdout()},e)},_parseRequest:functio n(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):{}} ,_parseResult:function(t){if(!t)return{};var e=new Date;return s.forEach(functio n(e){t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),!t.du ration&&t.state===this.RUNNING&&t.started_ts&&(t.duration=(e-t.started_ts)/1e3), t.duration&&(t.human_duration=this._humanDuration(t.duration)),t},_parseStdout:f unction(t){return t&&t.output?t.output:"[No output yet]"},reloadStdout:function( ){this._getJsonAsync("_stdout","/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: 8px}.expand{min-width:3em;vertical-align:middle;padding:.5em}.code{font-family:m onospace}.stdout{white-space:pre-line;padding:2px}.refresh_input{padding:0 5px}. tabbed{border:3px solid #1F78B4;margin-left:5px;min-height:80vh}</style> <url-pa ram name="id" value="{{task_id}}"> </url-param> <url-param name="request_detail" value="{{_request_detail}}"> </url-param> <url-param name="show_raw" value="{{_ show_raw}}"> </url-param> <url-param name="refresh" value="{{_refresh_interval}} " default_value="10"> </url-param> <swarming-app client_id="[[client_id]]" auth_ headers="{{_auth_headers}}" permissions="{{_permissions}}" profile="{{_profile}} " server_details="{{_server_details}}" signed_in="{{_signed_in}}" busy="[[_busy] ]" name="Swarming Task Page"> <h2 hidden$="[[_signed_in]]">You must sign in to s ee 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="{{_result}}" stdout="{{_stdout}}" task_exists="{{ _task_exists}}"> </task-page-data> <div class="horizontal layout wrap"> <div cla ss="left flex"> <div class="horizontal layout"> <paper-input class="id_input" la bel="Task id" value="{{task_id}}"></paper-input> <button on-click="_refresh"> <i ron-icon class="refresh" icon="icons:refresh"></iron-icon> </button> <button on- click="_promptRetry">Retry</button> <template is="dom-if" if="[[_canCancelTask(_ result,_permissions)]]"> <button on-click="_promptCancel">Cancel</button> </temp late> </div> <h2 hidden$="[[_task_exists]]">Task not found.</h2> <table hidden$= "[[_not(_task_exists)]]"> <tbody><tr> <td>Name</td> <td>[[_request.name]]</td> < /tr> <tr> <td>State</td> <td class$="[[_stateClass(_result)]]">[[_state(_result) ]]</td> </tr> <tr> <td>Created</td> <td title$="[[_request.created_ts]]">[[_requ est.human_created_ts]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp(_resu lt)]]"> <tr> <td>Started</td> <td title$="[[_result.started_ts]]">[[_result.huma n_started_ts]]</td> </tr> </template> <template is="dom-if" if="[[_wasNotPickedU p(_result)]]"> <tr> <td>Expires</td> <td>[[_expires(_request)]]</td> </tr> </tem plate> <template is="dom-if" if="[[_result.human_completed_ts]]"> <tr> <td>Compl eted</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.human_a bandoned_ts]]</td> </tr> </template> <tr> <td>Last Updated</td> <td title$="[[_r esult.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 hre f$="[[_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>Priori ty</td> <td>[[_request.priority]]</td> </tr> <tr> <td>User</td> <td>[[_request.u ser]]</td> </tr> <tr> <td>Authenticated</td> <td>[[_request.authenticated]]</td> </tr> <template is="dom-if" if="[[_request.service_account]]"> <tr> <td>Service Account</td> <td>[[_request.service_account]]</td> </tr> </template> <template is="dom-if" if="[[_request.properties.secret_bytes]]"> <tr> <td>Secret Bytes</td > <td>[[_request.properties.secret_bytes]]</td> </tr> </template> <template 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.dimensions) ]]"> <a title="The list of bots that matches the list of dimensions" href$="[[_b otListLink(_request.properties.dimensions)]]"> Requested Dimensions </a> </td> < /tr> <template is="dom-repeat" items="{{_request.properties.dimensions}}" as="di mension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</td> </tr> </ template> <tr> <td>Isolated Inputs</td> <td> <a href$="[[_isolateLink(_request.p roperties.inputs_ref)]]"> [[_request.properties.inputs_ref.isolated]] </a> </td> </tr> <template is="dom-if" if="[[_request.properties.outputs.length]]"> <tr> < td rowspan$="[[_rowspan(_request.properties.outputs)]]">Expected outputs</td> </ tr> <template is="dom-repeat" items="{{_request.properties.outputs}}" as="output "> <tr> <td>[[output]]</td> </tr> </template> </template> <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> </but ton> </td> </tr> </template> <template is="dom-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> <te mplate is="dom-if" if="[[_request_detail]]"> <tr> <td>Extra Args</td> <td class= "code">[[_extraArgs(_request)]]</td> </tr> <tr> <td rowspan$="[[_rowspan(_reques t.tags)]]">Tags</td> </tr> <template is="dom-repeat" items="{{_request.tags}}" a s="tag"> <tr> <td>[[tag]]</td> </tr> </template> <tr> <td>Execution timeout</td> <td>[[_humanDuration(_request.properties.execution_timeout_secs)]]</td> </tr> < tr> <td>I/O timeout</td> <td>[[_humanDuration(_request.properties.io_timeout_sec s)]]</td> </tr> <tr> <td>Grace period</td> <td>[[_humanDuration(_request.propert ies.grace_period_secs)]]</td> </tr> <tr> <td>CIPD server</td> <td> <a href$="[[_ request.properties.cipd_input.server]]"> [[_request.properties.cipd_input.server ]] </a> </td> </tr> <tr> <td>CIPD version</td> <td>[[_request.properties.cipd_in put.client_package.version]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp (_result)]]"> <tr> <td>CIPD package name</td> <td>[[_result.cipd_pins.client_pac kage.package_name]]</td> </tr> </template> <tr hidden$="[[_not(_request.properti es.cipd_input)]]"> <td rowspan$="[[_cipdRowspan(_request,_result)]]">CIPD packag es</td> </tr> <template is="dom-repeat" items="[[_cipdPackages(_request,_result) ]]" as="cipd"> <tr> <td>[[cipd.path]]/</td> </tr> <tr> <td><b>Requested:</b>[[ci pd.requested]]</td> </tr> <tr hidden$="[[_wasNotPickedUp(_result)]]"> <td><b>Act ual:</b>[[cipd.actual]]</td> </tr> </template> <tr hidden$="[[_empty(_request.pr operties.caches)]]"> <td rowspan$="[[_rowspan(_request.properties.caches)]]">Nam ed caches</td> </tr> <template is="dom-repeat" items="[[_request.properties.cach es]]" as="cache"> <tr> <td><span>[[cache.name]]</span>:<span>[[cache.path]]</spa n></td> </tr> </template> </template> </tbody></table> <div class="title" hidden $="[[_not(_task_exists)]]">Task Execution</div> <template is="dom-if" if="[[_was PickedUp(_result)]]"> <table hidden$="[[_not(_task_exists)]]"> <tbody><tr> <td>B ot assigned to task</td> <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.b ot_id]]</a></td> </tr> <tr> <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> <a>Bot Dimensions</a> </td> </tr> <template is="dom-repeat" items="[[_result.bo t_dimensions]]" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dime nsion)]]</td> </tr> </template> <tr> <td>Exit code</td> <td>[[_result.exit_code] ]</td> </tr> <tr> <td>Try number</td> <td>[[_result.try_number]]</td> </tr> <tr> <td>Failure</td> <td class$="[[_failureClass(_result.failure)]]">[[_result.fail ure]]</td> </tr> <tr> <td>Internal Failure</td> <td class$="[[_internalClass(_re sult.internal_failure)]]">[[_result.internal_failure]]</td> </tr> <tr> <td>Isola ted Outputs</td> <td> <a href$="[[_isolateLink(_result.outputs_ref)]]"> [[_resul t.outputs_ref.isolated]] </a> </td> </tr> <tr> <td>Bot version</td> <td>[[_resul t.bot_version]]</td> </tr> <tr> <td>Server version</td> <td>[[_result.server_ver sions]]</td> </tr> </tbody></table> </template> <template is="dom-if" if="[[_was NotPickedUp(_result)]]"> This space left blank until a bot is assigned to the ta sk. </template> <template is="dom-if" if="[[_result.performance_stats]]"> <div c lass="title">Performance Stats</div> <table> <tbody><tr> <td title="This include s time taken to download inputs, isolate outputs, and setup CIPD">Total Overhead </td> <td>[[_humanDuration(_result.performance_stats.bot_overhead)]]</td> </tr> <tr> <td>Downloading Inputs From Isolate</td> <td>[[_humanDuration(_result.perfo rmance_stats.isolated_download.duration)]]</td> </tr> <tr> <td>Uploading Outputs To Isolate</td> <td>[[_humanDuration(_result.performance_stats.isolated_upload. duration)]]</td> </tr> <tr> <td>Initial bot cache</td> <td>[[_result.performance _stats.isolated_download.initial_number_items]] items; [[_bytes(_result.performa nce_stats.isolated_download.initial_size)]]</td> </tr> </tbody></table> </templa te> </div> <div class="flex right" hidden$="[[_not(_task_exists)]]"> <div class= "horizontal layout"> <div class="tabs"> <paper-tabs selected="{{_show_raw}}" no- bar=""> <paper-tab disabled$="[[_noMilo(_request)]]">Milo Output</paper-tab> <pa per-tab>Raw Output</paper-tab> </paper-tabs> </div> <paper-input class="refresh_ input" label="Refresh Interval (seconds)" value="{{_refresh_interval}}" title="H ow often to refresh all information about the task" auto-validate="" min="1" max ="1000" pattern="[0-9]+"> </paper-input> </div> <template is="dom-if" if="[[_sup portsMilo(_request,_show_raw)]]"> <iframe id="miloFrame" class="milo tabbed" src $="[[_getDisplayServerLink(_server_details.display_server_url_template,task_id)] ]"></iframe> </template> <template is="dom-if" if="[[_show_raw]]"> <div class="c ode 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-butt on> <paper-button dialog-confirm="">Yes</paper-button> </div> </paper-dialog> <e rror-toast></error-toast> <interval-timer period="[[_refresh_interval]]" on-trig ger="_softRefresh"> </interval-timer> </template> <script>!function(){Polymer({i s:"task-page",behaviors:[SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.Task Behavior],properties:{task_id:{type:String},client_id:{type:String},_dialogPromp t:{type:String,value:""},_refresh_interval:{type:Number},_request:{type:Object,o bserver:"_requestUpdated"},_request_detail:{type:Boolean},_result:{type:Object}, _server_details:{type:Object},_stdout:{type:String}},_alias:function(t){var e=t. value;return Array.isArray(e)||(e=[e]),swarming.alias.has(t.key)&&e.forEach(func tion(s,i){e[i]=swarming.alias.apply(s,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="/api/swarming/v1/task/"+this .task_id+"/cancel";swarming.postWithToast(t,"Canceling task "+this.task_id,this. _auth_headers)},_cipdRowspan:function(t,e){if(!t||!t.properties||!t.properties.c ipd_input)return 0;var s=(t.properties.cipd_input.packages||[]).length;return s* =e&&e.cipd_pins&&e.cipd_pins.packages?3:2,s+1},_cipdPackages:function(t,e){if(!t ||!t.properties||!t.properties.cipd_input)return[];var s=t.properties.cipd_input .packages||[],i=e&&e.cipd_pins&&e.cipd_pins.packages||[];return s.forEach(functi on(t){t.requested=t.package_name+":"+t.version,i.forEach(function(e){e.path===t. path&&(t.actual=e.package_name+":"+e.version)})}),s},_expires:function(t){var e= parseInt(t.expiration_secs);return e?sk.human.localeTime(new Date(t.created_ts.g etTime()+1e3*e)):t.expiration_secs+" seconds from created time"},_extraArgs:func tion(t){if(!t||!t.properties)return"";var e=t.properties.extra_args||[];return e .join(" ")},_failureClass:function(t){return t?"failed_task":""},_getDisplayServ erLink:function(t,e){if(t)return t.replace("%s",e)},_internalClass:function(t){r eturn t?"exception":""},_isolateLink:function(t){if(t&&t.isolatedserver)return t .isolatedserver+"/browse?namespace="+t.namespace+"&hash="+t.isolated},_noMilo:fu nction(t){return!this._tag(t,"allow_milo")},_pending:function(t){if(!t.created_t s)return"";var e=t.started_ts||t.abandoned_ts||new Date;return e<=t.created_ts?" 0s":this._timeDiffExact(t.created_ts,e)},_promptClosed:function(t){t.detail.conf irmed&&(this._dialogPrompt.startsWith("cancel")?this._cancelTask():this._retryTa sk())},_promptCancel:function(){this.set("_dialogPrompt","cancel task "+this.tas k_id),this.$.prompt.open()},_promptRetry:function(){this.set("_dialogPrompt","re try task "+this.task_id),this.$.prompt.open()},_refresh:function(){this.$.data.r eload()},_requestUpdated:function(t){this._noMilo(t)&&this.set("_show_raw",1)},_ softRefresh:function(){if(!this._result||"RUNNING"===this._result.state||"PENDIN G"===this._result.state){this.$.data.reload();var t=this.$$("iframe");t&&(t.src= this._getDisplayServerLink(this._server_details.display_server_url_template,this .task_id))}},_retryTask:function(){if(!this._request)return void sk.errorMessage ("Task not yet loaded",3e3);var t={expiration_secs:this._request.expiration_secs ,name:this._request.name+" (retry)",parent_task_id:this._request.parent_task_id, priority:this._request.priority,properties:this._request.properties,tags:this._r equest.tags,user:this._profile.email,service_account:this._request.service_accou nt};swarming.postWithToast("/api/swarming/v1/tasks/new","Retrying task "+this.ta sk_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("Task could not be retried",t)})},_rowspan:function(t){return t=t||[],t.length+1},_empty:function(t ){return!t||0==t.length},_supportsMilo:function(t,e){return!e&&t&&this._tag(t,"a llow_milo")},_state:function(t){return t?t.state===this.COMPLETED?t.failure?this .COMPLETED_FAILURE:"0"===t.try_number?this.COMPLETED_DEDUPED:this.COMPLETED_SUCC ESS:t.state:""},_stateClass:function(t){return this.stateClass(this._state(t))}, _toggleDetails:function(){this.set("_request_detail",!this._request_detail)},_ta g:function(t,e){if(t&&t.tagMap)return t.tagMap[e]},_wasPickedUp:function(t){retu rn t&&t.state!==this.PENDING&&t.state!==this.CANCELED&&t.state!=this.EXPIRED},_w asNotPickedUp:function(t){return t&&!this._wasPickedUp(t)}})}()</script> </dom-m odule> </div></body></html> 944 })(); </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},task_exists: {type:Boolean,value:!0,notify:!0},_busy1:{type:Boolean,value:!1},_busy2:{type:Bo olean,value:!1},_busy3:{type:Boolean,value:!1},_request:{type:Object},_result:{t ype:Object},_stdout:{type:Object}},observers:["reload(auth_headers,task_id)"],re load:function(){if(!this.task_id||!this.auth_headers)return void console.log("ta sk_id and auth_headers can't be empty");t&&this.cancelAsync(t);var s="/api/swarm ing/v1/task/"+this.task_id;t=this.async(function(){t=void 0;var e=this._getJsonA sync("_request",s+"/request","_busy1",this.auth_headers);e.then(function(){this. set("task_exists",!0)}.bind(this)).catch(function(t){404===t.status?this.set("ta sk_exists",!1):sk.errorMessage("Http response: "+(t.status||" ")+" "+t.response) }.bind(this)),this._getJsonAsync("_result",s+"/result?include_performance_stats= true","_busy2",this.auth_headers),this.reloadStdout()},e)},_parseRequest:functio n(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):{}} ,_parseResult:function(t){if(!t)return{};var e=new Date;return s.forEach(functio n(e){t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),!t.du ration&&t.state===this.RUNNING&&t.started_ts&&(t.duration=(e-t.started_ts)/1e3), t.duration&&(t.human_duration=this._humanDuration(t.duration)),t},_parseStdout:f unction(t){return t&&t.output?t.output:"[No output yet]"},reloadStdout:function( ){this._getJsonAsync("_stdout","/api/swarming/v1/task/"+this.task_id+"/stdout"," _busy3",this.auth_headers)}})}()</script> </dom-module><dom-module id="task-disa mbiguation" assetpath="/res/imp/taskpage/"> <template> <style include="swarming- app-style single-page-style task-style"></style> <table> <thead> <tr> <th>Try ID </th> <th>Bot ID</th> <th>Status</th> </tr> </thead> <tbody> <template id="resul t_list" is="dom-repeat" items="[[_results]]" as="result" observe="task_id bot_id state"> <tr> <td> <a href$="[[_taskLink(result.task_id,'true')]]"> [[result.tas k_id]] </a> </td> <td> <a href$="[[_botLink(result.bot_id)]]"> [[result.bot_id]] </a> </td> <td class$="[[_stateClass(result)]]">[[state(result)]]</td> </tr> </ template> </tbody> </table> </template> <script>Polymer({is:"task-disambiguation ",behaviors:[SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],pr operties:{auth_headers:{type:Object},summary_result:{type:Object},task_id:{type: String},busy:{type:Boolean,value:!1,notify:!0},_busyArr:{type:Array,value:functi on(){return[]}},_results:{type:Array,value:function(){return[]}}},observers:["_f etchRest(auth_headers,task_id,summary_result)","_computeBusy(_busyArr.*)"],_comp uteBusy:function(){for(var s=0;s<this._busyArr.length;s++)if(this._busyArr[s].st atus)return!0;return!1},_fetchRest:function(s,r,t){if(s&&r&&t){var e=t.try_numbe r;this.set("_busyArr",[]),this.set("_results",[]);for(var u=r.substring(0,r.leng th-1),i="/api/swarming/v1/task/",a=0;a<e-1;a++){var n=u+(a+1);this.splice("_busy Arr",a,0,{}),this.splice("_results",a,0,{task_id:n}),this._getJsonAsyncArr(a,"_r esults",i+n+"/result","_busyArr",s)}t.task_id=u+e,this.splice("_results",e-1,1,t )}}})</script> </dom-module><dom-module id="task-page" assetpath="/res/imp/taskp age/"> <template> <style include="iron-flex iron-flex-alignment swarming-app-sty le single-page-style task-style">.milo{width:calc(100% - 11px);height:2000px}.le ft{min-width:550px}.right{min-width:500px;margin-top:8px}.expand{min-width:3em;v ertical-align:middle;padding:.5em}.code{font-family:monospace}.stdout{white-spac e:pre-line;padding:2px}.refresh_input{padding:0 5px}.tabbed{border:3px solid #1F 78B4;margin-left:5px;min-height:80vh}</style> <url-param name="id" value="{{task _id}}"> </url-param> <url-param name="try_detail" value="{{_try_detail}}"> </url -param> <url-param name="request_detail" value="{{_request_detail}}"> </url-para m> <url-param name="show_raw" value="{{_show_raw}}"> </url-param> <url-param nam e="refresh" value="{{_refresh_interval}}" default_value="10"> </url-param> <swar ming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" permissions= "{{_permissions}}" profile="{{_profile}}" server_details="{{_server_details}}" s igned_in="{{_signed_in}}" busy="[[_or(_busy1,busy2)]]" name="Swarming Task Page" > <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <di v hidden$="[[_not(_signed_in)]]"> <task-page-data id="data" auth_headers="[[_aut h_headers]]" task_id="[[task_id]]" busy="{{_busy1}}" request="{{_request}}" resu lt="{{_result}}" stdout="{{_stdout}}" task_exists="{{_task_exists}}"> </task-pag e-data> <div class="horizontal layout wrap"> <div class="left flex"> <div class= "horizontal layout"> <paper-input class="id_input" label="Task id" value="{{task _id}}"></paper-input> <button on-click="_refresh"> <iron-icon class="refresh" ic on="icons:refresh"></iron-icon> </button> <button on-click="_promptRetry">Retry< /button> <template is="dom-if" if="[[_canCancelTask(_result,_permissions)]]"> <b utton on-click="_promptCancel">Cancel</button> </template> </div> <h2 hidden$="[ [_task_exists]]">Task not found.</h2> <template is="dom-if" if="[[_disambiguate( task_id,_result)]]"> <h2>Displaying a summary for a task with multiple tries</h2 > <task-disambiguation busy="{{busy2}}" auth_headers="[[_auth_headers]]" task_id ="[[task_id]]" summary_result="[[_result]]"> </task-disambiguation> </template> <table hidden$="[[_not(_task_exists)]]"> <tbody><tr> <td>Name</td> <td>[[_reques t.name]]</td> </tr> <tr> <td>State</td> <td class$="[[_stateClass(_result)]]">[[ state(_result)]]</td> </tr> <tr> <td>Created</td> <td title$="[[_request.created _ts]]">[[_request.human_created_ts]]</td> </tr> <template is="dom-if" if="[[_was PickedUp(_result)]]"> <tr> <td>Started</td> <td title$="[[_result.started_ts]]"> [[_result.human_started_ts]]</td> </tr> </template> <template is="dom-if" if="[[ _wasNotPickedUp(_result)]]"> <tr> <td>Expires</td> <td>[[_expires(_request)]]</t d> </tr> </template> <template is="dom-if" if="[[_result.human_completed_ts]]"> <tr> <td>Completed</td> <td title$="[[_result.completed_ts]]">[[_result.human_co mpleted_ts]]</td> </tr> </template> <template is="dom-if" if="[[_result.human_ab andoned_ts]]"> <tr> <td>Abandoned</td> <td title$="[[_result.abandoned_ts]]">[[_ result.human_abandoned_ts]]</td> </tr> </template> <tr> <td>Last Updated</td> <t d title$="[[_result.modified_ts]]">[[_result.human_modified_ts]]</td> </tr> <tem plate is="dom-if" if="[[_result.deduped_from]]"> <tr> <td><b>Deduped from</b></t d> <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> <t d>[[_request.user]]</td> </tr> <tr> <td>Authenticated</td> <td>[[_request.authen ticated]]</td> </tr> <template is="dom-if" if="[[_request.service_account]]"> <t r> <td>Service Account</td> <td>[[_request.service_account]]</td> </tr> </templa te> <template is="dom-if" if="[[_request.properties.secret_bytes]]"> <tr> <td>Se cret Bytes</td> <td>[[_request.properties.secret_bytes]]</td> </tr> </template> <template 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.properti es.dimensions)]]"> <a title="The list of bots that matches the list of dimension s" href$="[[_botListLink(_request.properties.dimensions)]]"> Requested Dimension s </a> </td> </tr> <template is="dom-repeat" items="{{_request.properties.dimens ions}}" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]] </td> </tr> </template> <tr> <td>Isolated Inputs</td> <td> <a href$="[[_isolateL ink(_request.properties.inputs_ref)]]"> [[_request.properties.inputs_ref.isolate d]] </a> </td> </tr> <template is="dom-if" if="[[_request.properties.outputs.len gth]]"> <tr> <td rowspan$="[[_rowspan(_request.properties.outputs)]]">Expected o utputs</td> </tr> <template is="dom-repeat" items="{{_request.properties.outputs }}" as="output"> <tr> <td>[[output]]</td> </tr> </template> </template> <templat e is="dom-if" if="[[_not(_request_detail)]]"> <tr> <td>More Details</td> <td> <b utton on-click="_toggleDetails"> <iron-icon icon="icons:add-circle-outline"></ir on-icon> </button> </td> </tr> </template> <template is="dom-if" if="[[_request_ detail]]"> <tr> <td>Hide Details</td> <td> <button on-click="_toggleDetails"> <i ron-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> <tr> <td rowspan$="[[_r owspan(_request.tags)]]">Tags</td> </tr> <template is="dom-repeat" items="{{_req uest.tags}}" as="tag"> <tr> <td>[[tag]]</td> </tr> </template> <tr> <td>Executio n timeout</td> <td>[[_humanDuration(_request.properties.execution_timeout_secs)] ]</td> </tr> <tr> <td>I/O timeout</td> <td>[[_humanDuration(_request.properties. io_timeout_secs)]]</td> </tr> <tr> <td>Grace period</td> <td>[[_humanDuration(_r equest.properties.grace_period_secs)]]</td> </tr> <tr> <td>CIPD server</td> <td> <a href$="[[_request.properties.cipd_input.server]]"> [[_request.properties.cip d_input.server]] </a> </td> </tr> <tr> <td>CIPD version</td> <td>[[_request.prop erties.cipd_input.client_package.version]]</td> </tr> <template is="dom-if" if=" [[_wasPickedUp(_result)]]"> <tr> <td>CIPD package name</td> <td>[[_result.cipd_p ins.client_package.package_name]]</td> </tr> </template> <tr hidden$="[[_not(_re quest.properties.cipd_input)]]"> <td rowspan$="[[_cipdRowspan(_request,_result)] ]">CIPD packages</td> </tr> <template is="dom-repeat" items="[[_cipdPackages(_re quest,_result)]]" as="cipd"> <tr> <td>[[cipd.path]]/</td> </tr> <tr> <td><b>Requ ested:</b>[[cipd.requested]]</td> </tr> <tr hidden$="[[_wasNotPickedUp(_result)] ]"> <td><b>Actual:</b>[[cipd.actual]]</td> </tr> </template> <tr hidden$="[[_emp ty(_request.properties.caches)]]"> <td rowspan$="[[_rowspan(_request.properties. caches)]]">Named caches</td> </tr> <template is="dom-repeat" items="[[_request.p roperties.caches]]" as="cache"> <tr> <td><span>[[cache.name]]</span>:<span>[[cac he.path]]</span></td> </tr> </template> </template> </tbody></table> <div class= "title" hidden$="[[_not(_task_exists)]]">Task Execution</div> <template is="dom- if" if="[[_wasPickedUp(_result)]]"> <table hidden$="[[_not(_task_exists)]]"> <tb ody><tr> <td>Bot assigned to task</td> <td><a href$="[[_botLink(_result.bot_id)] ]">[[_result.bot_id]]</a></td> </tr> <tr> <td rowspan$="[[_rowspan(_result.bot_d imensions)]]"> <a>Bot Dimensions</a> </td> </tr> <template is="dom-repeat" items ="[[_result.bot_dimensions]]" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</td> </tr> </template> <tr> <td>Exit code</td> <td>[[_res ult.exit_code]]</td> </tr> <tr> <td>Try number</td> <td>[[_result.try_number]]</ td> </tr> <tr> <td>Failure</td> <td class$="[[_failureClass(_result.failure)]]"> [[_result.failure]]</td> </tr> <tr> <td>Internal Failure</td> <td class$="[[_int ernalClass(_result.internal_failure)]]">[[_result.internal_failure]]</td> </tr> <tr> <td>Isolated Outputs</td> <td> <a href$="[[_isolateLink(_result.outputs_ref )]]"> [[_result.outputs_ref.isolated]] </a> </td> </tr> <tr> <td>Bot version</td > <td>[[_result.bot_version]]</td> </tr> <tr> <td>Server version</td> <td>[[_res ult.server_versions]]</td> </tr> </tbody></table> </template> <template is="dom- if" if="[[_wasNotPickedUp(_result)]]"> This space left blank until a bot is assi gned to the task. </template> <template is="dom-if" if="[[_result.performance_st ats]]"> <div class="title">Performance Stats</div> <table> <tbody><tr> <td title ="This includes time taken to download inputs, isolate outputs, and setup CIPD"> Total Overhead</td> <td>[[_humanDuration(_result.performance_stats.bot_overhead) ]]</td> </tr> <tr> <td>Downloading Inputs From Isolate</td> <td>[[_humanDuration (_result.performance_stats.isolated_download.duration)]]</td> </tr> <tr> <td>Upl oading Outputs To Isolate</td> <td>[[_humanDuration(_result.performance_stats.is olated_upload.duration)]]</td> </tr> <tr> <td>Initial bot cache</td> <td>[[_resu lt.performance_stats.isolated_download.initial_number_items]] items; [[_bytes(_r esult.performance_stats.isolated_download.initial_size)]]</td> </tr> </tbody></t able> </template> </div> <div class="flex right" hidden$="[[_not(_task_exists)]] "> <div class="horizontal layout"> <div class="tabs"> <paper-tabs selected="{{_s how_raw}}" no-bar=""> <paper-tab disabled$="[[_noMilo(_request)]]">Milo Output</ paper-tab> <paper-tab>Raw Output</paper-tab> </paper-tabs> </div> <paper-input c lass="refresh_input" label="Refresh Interval (seconds)" value="{{_refresh_interv al}}" title="How often to refresh all information about the task" auto-validate= "" min="1" max="1000" pattern="[0-9]+"> </paper-input> </div> <template is="dom- if" if="[[_supportsMilo(_request,_show_raw)]]"> <div class="milo tabbed" hidden$ ="[[_isSummaryLink(task_id)]]"> Milo results are only generated for task summair es, that is, tasks whose ids end in 0. Tasks ending in 1 or 2 represent possible retries of tasks. See <a href="//goo.gl/LE4rwV">the docs</a> for more. </div> < iframe id="miloFrame" class="milo tabbed" src$="[[_getDisplayServerLink(_server_ details.display_server_url_template,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" mod al="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are yo u 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-time r> </template> <script>!function(){Polymer({is:"task-page",behaviors:[SwarmingBe haviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{task_id:{type :String},client_id:{type:String},_dialogPrompt:{type:String,value:""},_refresh_i nterval:{type:Number},_request:{type:Object,observer:"_requestUpdated"},_request _detail:{type:Boolean},_result:{type:Object},_server_details:{type:Object},_stdo ut:{type:String}},_alias:function(t){var e=t.value;return 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)},_canCanc elTask:function(t,e){return t&&"PENDING"===t.state&&e.cancel_task},_cancelTask:f unction(){var t="/api/swarming/v1/task/"+this.task_id+"/cancel";swarming.postWit hToast(t,"Canceling task "+this.task_id,this._auth_headers)},_cipdRowspan:functi on(t,e){if(!t||!t.properties||!t.properties.cipd_input)return 0;var i=(t.propert ies.cipd_input.packages||[]).length;return i*=e&&e.cipd_pins&&e.cipd_pins.packag es?3:2,i+1},_cipdPackages:function(t,e){if(!t||!t.properties||!t.properties.cipd _input)return[];var i=t.properties.cipd_input.packages||[],s=e&&e.cipd_pins&&e.c ipd_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},_disambiguate:function(t,e){return!(!t.endsWith("0")||!e)&&e.t ry_number>1},_expires:function(t){var e=parseInt(t.expiration_secs);return e?sk. human.localeTime(new Date(t.created_ts.getTime()+1e3*e)):t.expiration_secs+" sec onds from created time"},_extraArgs:function(t){if(!t||!t.properties)return"";va r e=t.properties.extra_args||[];return e.join(" ")},_failureClass:function(t){re turn t?"failed_task":""},_getDisplayServerLink:function(t,e){if(t)return t.repla ce("%s",e)},_internalClass:function(t){return t?"exception":""},_isolateLink:fun ction(t){if(t&&t.isolatedserver)return t.isolatedserver+"/browse?namespace="+t.n amespace+"&hash="+t.isolated},_isSummaryLink:function(t){return t&&t.endsWith(0) },_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.created_ts,e)},_promptClosed:function(t){t .detail.confirmed&&(this._dialogPrompt.startsWith("cancel")?this._cancelTask():t his._retryTask())},_promptCancel:function(){this.set("_dialogPrompt","cancel tas k "+this.task_id),this.$.prompt.open()},_promptRetry:function(){this.set("_dialo gPrompt","retry task "+this.task_id),this.$.prompt.open()},_refresh:function(){t his.$.data.reload()},_requestUpdated:function(t){this._noMilo(t)&&this.set("_sho w_raw",1)},_softRefresh:function(){if(!this._result||"RUNNING"===this._result.st ate||"PENDING"===this._result.state){this.$.data.reload();var t=this.$$("iframe" );t&&(t.src=this._getDisplayServerLink(this._server_details.display_server_url_t emplate,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("/api/swarming/v1/tasks/new","Retrying ta sk "+this.task_id,this._auth_headers,t).then(function(t){t=JSON.parse(t),t&&t.ta sk_id&&this.set("task_id",t.task_id)}.bind(this),function(t){console.log("Task c ould not be retried",t)})},_rowspan:function(t){return t=t||[],t.length+1},_empt y:function(t){return!t||0==t.length},_supportsMilo:function(t,e){return!e&&t&&th is._tag(t,"allow_milo")},_toggleDetails:function(){this.set("_request_detail",!t his._request_detail)},_tag:function(t,e){if(t&&t.tagMap)return t.tagMap[e]},_was PickedUp:function(t){return t&&t.state!==this.PENDING&&t.state!==this.CANCELED&& t.state!=this.EXPIRED},_wasNotPickedUp:function(t){return t&&!this._wasPickedUp( t)}})}()</script> </dom-module> </div></body></html>
OLDNEW
« no previous file with comments | « no previous file | appengine/swarming/ui/res/imp/botlist/bot-list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698