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

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

Issue 2670163002: Make wide logs an option in task-page (Closed)
Patch Set: Address comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | appengine/swarming/ui/res/imp/botpage/bot-page.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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 .then(JSON.parse).then(function(json){ 878 .then(JSON.parse).then(function(json){
879 this._ready_to_cancel = true; 879 this._ready_to_cancel = true;
880 this._estimated_count = json.count; 880 this._estimated_count = json.count;
881 }.bind(this)) 881 }.bind(this))
882 .catch(function(e){ 882 .catch(function(e){
883 console.log(e); 883 console.log(e);
884 sk.errorMessage(e); 884 sk.errorMessage(e);
885 }); 885 });
886 }, 886 },
887 }); 887 });
888 })() </script> </dom-module><dom-module id="task-list" assetpath="/res/imp/tas klist/"> <template> <style include="iron-flex iron-flex-alignment iron-positioni ng swarming-app-style dynamic-table-style task-style">task-filters{margin-bottom :8px;margin-right:10px}.task-list th>span{padding-right:30px}</style> <url-param name="s" value="{{_sortstr}}" default_value="created_ts:desc"> </url-param> <sw arming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" permission s="{{_permissions}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2)]]" na me="Swarming Task List"> <h2 hidden$="[[_signed_in]]">You must sign in to see an ything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <task-list-data id="dat a" auth_headers="[[_auth_headers]]" query_params="[[_query_params]]" tasks="[[_i tems]]" busy="{{_busy1)}}" dimensions="{{_dimensions}}" primary_map="{{_primary_ map}}" primary_arr="{{_primary_arr}}"> </task-list-data> <div class="horizontal layout"> <task-filters dimensions="[[_dimensions]]" permissions="[[_permissions] ]" primary_map="[[_primary_map]]" primary_arr="[[_primary_arr]]" special_columns ="[[_specialColumns]]" columns="{{_columns}}" query_params="{{_query_params}}" f ilter="{{_filter}}" on-cancel-all="_promptCancelAll"> </task-filters> </div> <ta ble class="task-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 na me="state" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('bot', _columns.*)]]"> <span>Bot Assigned</span> <sort-toggle name="bot" current="[[_s ort]]"> </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="[[_sort ]]"> </sort-toggle> </th> <template is="dom-repeat" items="[[_plainColumns]]" as ="c"> <th hidden$="[[_hide(c)]]"> <span>[[_header(c)]]</span> <sort-toggle name= "[[c]]" current="[[_sort]]"> </sort-toggle> </th> </template> </tr> </thead> <tb ody> <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', _columns .*)]]"> <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_revisi on', _columns.*)]]"> <a class="center" href$="[[_sourceLink(task)]]" target="_bl ank"> [[_column('source_revision',task)]] </a> </td> <template is="dom-repeat" i tems="[[_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="[[_p arseTasks]]"> </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-butt on dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm ="">Yes</paper-button> </div> </paper-dialog> <paper-dialog id="cancel_all_dialo g" modal=""> <task-mass-cancel id="mass_cancel" auth_headers="[[_auth_headers]]" started_canceling="{{_started_canceling}}" finished_canceling="{{_finished_canc eling}}"> </task-mass-cancel> <div class="buttons"> <paper-button dialog-dismiss ="" autofocus="" hidden$="[[_started_canceling]]"> Go Back - Don't Cancel Anythi ng </paper-button> <paper-button dialog-dismiss="" autofocus="" hidden$="[[!_fin ished_canceling]]"> Done </paper-button> </div> </paper-dialog> </template> <scr ipt>!function(){function t(t){return function(e){return this._attribute(e,"human _"+t)[0]}}function e(t){return function(e,a,s){var n=this._attribute(a,t,"0")[0] ,i=this._attribute(s,t,"0")[0];return e*(n-i)}}var a=["deduped_from","name","sta te","bot","source_revision"],s={abandoned_ts:t("abandoned_ts"),bot:function(t){r eturn this._attribute(t,"bot_id")[0]},completed_ts:t("completed_ts"),costs_usd:f unction(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("CO MPLETED"===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) ":"COMPLETED (SUCCESS)"}return e}},n={abandoned_ts:"Abandoned On",completed_ts:" Completed On",created_ts:"Created On",duration:"Duration",modified_ts:"Last Modi fied",started_ts:"Started Working On",user:"Requesting User"},i={abandoned_ts:e( "abandoned_ts"),completed_ts:e("completed_ts"),created_ts:e("created_ts"),durati on:e("duration"),modified_ts:e("modified_ts"),started_ts:e("started_ts")};Polyme r({is:"task-list",behaviors:[SwarmingBehaviors.DynamicTableBehavior,SwarmingBeha viors.TaskBehavior],properties:{client_id:{type:String},_busy1:{type:Boolean,val ue:!1},_busy2:{type:Boolean,value:!1},_parseTasks:{type:Function,value:function( ){return this.$.data.parseTasks.bind(this)}},_toCancel:{type:String},_columnMap: {type:Object,value:function(){var t=this._commonColumns();for(var e in s)t[e]=s[ e];return t}},_headerMap:{type:Object,value:n},_specialColumns:{type:Array,value :a},_specialSort:{type:Object,value:i}},observers:["reload(_query_params,_auth_h eaders)"],_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(){va r t="/api/swarming/v1/task/"+this._toCancel+"/cancel";swarming.postWithToast(t," Canceling task "+this._toCancel,this._auth_headers),this.set("_toCancel","")},_p romptClosed:function(t){t.detail.confirmed&&this._cancelTask()},_promptCancel:fu nction(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.$.prompt.open() ):void console.log("Missing task info",e)},_promptCancelAll:function(t){this.$.m ass_cancel.tags=t.detail.tags,this.$.mass_cancel.prompt(),this.$.cancel_all_dial og.open()},_closeCancelAll:function(){this.$.cancel_all_dialog.close()},reload:f unction(){if(this._auth_headers&&this._query_params){var t="/api/swarming/v1/tas ks/list?"+sk.query.fromParamSet(this._query_params);this.$.page_tasks.load(t,thi s._auth_headers)}},_sourceLink:function(t){var e=this._attribute(t,"source_revis ion")[0],a=this._attribute(t,"source_repo")[0];return"none"!==e&&"none"!==a&&a.r eplace("%s",e)},_tag:function(t,e){if(t&&t.tagMap)return t.tagMap[e]},_taskClass :function(t){return this.stateClass(this._column("state",t))}})}()</script> </do m-module> <dom-module id="iron-collapse" assetpath="/res/imp/bower_components/ir on-collapse/"> <template> <style>:host{display:block;transition-duration:var(--i ron-collapse-transition-duration,300ms);overflow:visible}:host(.iron-collapse-cl osed){display:none}:host(:not(.iron-collapse-opened)){overflow:hidden}</style> < content></content> </template> </dom-module> <script>Polymer({is:"iron-collapse" ,behaviors:[Polymer.IronResizableBehavior],properties:{horizontal:{type:Boolean, value:!1,observer:"_horizontalChanged"},opened:{type:Boolean,value:!1,notify:!0, observer:"_openedChanged"},noAnimation:{type:Boolean},_desiredSize:{type:String, value:""}},get dimension(){return this.horizontal?"width":"height"},get _dimensi onMax(){return this.horizontal?"maxWidth":"maxHeight"},get _dimensionMaxCss(){re turn this.horizontal?"max-width":"max-height"},hostAttributes:{role:"group","ari a-hidden":"true","aria-expanded":"false"},listeners:{transitionend:"_transitionE nd"},attached:function(){this._transitionEnd()},toggle:function(){this.opened=!t his.opened},show:function(){this.opened=!0},hide:function(){this.opened=!1},upda teSize:function(i,t){if(i="auto"===i?"":i,this._desiredSize!==i){this._desiredSi ze=i,this._updateTransition(!1);var e=t&&!this.noAnimation&&this._isDisplayed;if (e){var n=this._calcSize();""===i&&(this.style[this._dimensionMax]="",i=this._ca lcSize()),this.style[this._dimensionMax]=n,this.scrollTop=this.scrollTop,this._u pdateTransition(!0),e=i!==n}this.style[this._dimensionMax]=i,e||this._transition End()}},enableTransition:function(i){Polymer.Base._warn("`enableTransition()` is deprecated, use `noAnimation` instead."),this.noAnimation=!i},_updateTransition :function(i){this.style.transitionDuration=i&&!this.noAnimation?"":"0s"},_horizo ntalChanged:function(){this.style.transitionProperty=this._dimensionMaxCss;var i ="maxWidth"===this._dimensionMax?"maxHeight":"maxWidth";this.style[i]="",this.up dateSize(this.opened?"auto":"0px",!1)},_openedChanged:function(){this.setAttribu te("aria-expanded",this.opened),this.setAttribute("aria-hidden",!this.opened),th is.toggleClass("iron-collapse-closed",!1),this.toggleClass("iron-collapse-opened ",!1),this.updateSize(this.opened?"auto":"0px",!0),this.opened&&this.focus()},_t ransitionEnd:function(){this.style[this._dimensionMax]=this._desiredSize,this.to ggleClass("iron-collapse-closed",!this.opened),this.toggleClass("iron-collapse-o pened",this.opened),this._updateTransition(!1),this.notifyResize()},get _isDispl ayed(){var i=this.getBoundingClientRect();for(var t in i)if(0!==i[t])return!0;re turn!1},_calcSize:function(){return this.getBoundingClientRect()[this.dimension] +"px"}})</script> <script>Polymer.IronMenubarBehaviorImpl={hostAttributes:{role: "menubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onUpKey:function (e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},_onDownKey :function(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},g et _isRTL(){return"rtl"===window.getComputedStyle(this).direction},_onLeftKey:fu nction(e){this._isRTL?this._focusNext():this._focusPrevious(),e.detail.keyboardE vent.preventDefault()},_onRightKey:function(e){this._isRTL?this._focusPrevious() :this._focusNext(),e.detail.keyboardEvent.preventDefault()},_onKeydown:function( e){this.keyboardEventMatchesKeys(e,"up down left right esc")||this._focusWithKey boardEvent(e)}},Polymer.IronMenubarBehavior=[Polymer.IronMenuBehavior,Polymer.Ir onMenubarBehaviorImpl]</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.5 8 4.59L10 18l6-6z"></path></g> </defs></svg> </iron-iconset-svg> <dom-module id= "paper-tab" assetpath="/res/imp/bower_components/paper-tabs/"> <template> <style >:host{@apply(--layout-inline);@apply(--layout-center);@apply(--layout-center-ju stified);@apply(--layout-flex-auto);position:relative;padding:0 12px;overflow:hi dden;cursor:pointer;vertical-align:middle;@apply(--paper-font-common-base);@appl y(--paper-tab)}:host(:focus){outline:0}:host([link]){padding:0}.tab-content{heig ht:100%;transform:translateZ(0);-webkit-transform:translateZ(0);transition:opaci ty .1s cubic-bezier(.4,0,1,1);@apply(--layout-horizontal);@apply(--layout-center -center);@apply(--layout-flex-auto);@apply(--paper-tab-content)}:host(:not(.iron -selected))>.tab-content{opacity:.8;@apply(--paper-tab-content-unselected)}:host (:focus) .tab-content{opacity:1;font-weight:700}paper-ripple{color:var(--paper-t ab-ink,--paper-yellow-a100)}.tab-content>::content>a{@apply(--layout-flex-auto); height:100%}</style> <div class="tab-content"> <content></content> </div> </temp late> <script>Polymer({is:"paper-tab",behaviors:[Polymer.IronControlState,Polyme r.IronButtonState,Polymer.PaperRippleBehavior],properties:{link:{type:Boolean,va lue:!1,reflectToAttribute:!0}},hostAttributes:{role:"tab"},listeners:{down:"_upd ateNoink",tap:"_onTap"},attached:function(){this._updateNoink()},get _parentNoin k(){var t=Polymer.dom(this).parentNode;return!!t&&!!t.noink},_updateNoink:functi on(){this.noink=!!this.noink||!!this._parentNoink},_onTap:function(t){if(this.li nk){var e=this.queryEffectiveChildren("a");if(!e)return;if(t.target===e)return;e .click()}}})</script> </dom-module> <dom-module id="paper-tabs" assetpath="/res/ imp/bower_components/paper-tabs/"> <template> <style>:host{@apply(--layout);@app ly(--layout-center);height:48px;font-size:14px;font-weight:500;overflow:hidden;- moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:n one;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transpar ent;@apply(--paper-tabs)}:host-context([dir=rtl]){@apply(--layout-horizontal-rev erse)}#tabsContainer{position:relative;height:100%;white-space:nowrap;overflow:h idden;@apply(--layout-flex-auto)}#tabsContent{height:100%;-moz-flex-basis:auto;- ms-flex-basis:auto;flex-basis:auto}#tabsContent.scrollable{position:absolute;whi te-space:nowrap}#tabsContent.scrollable.fit-container,#tabsContent:not(.scrollab le){@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}.hidden{display:none}.not-visible{opacity:0;cursor: default}paper-icon-button{width:48px;height:48px;padding:12px;margin:0 4px}#sele ctionBar{position:absolute;height:2px;bottom:0;left:0;right:0;background-color:v ar(--paper-tabs-selection-bar-color,--paper-yellow-a100);-webkit-transform:scale (0);transform:scale(0);-webkit-transform-origin:left center;transform-origin:lef t center;transition:-webkit-transform;transition:transform;@apply(--paper-tabs-s election-bar)}#selectionBar.align-bottom{top:0;bottom:auto}#selectionBar.expand{ transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,1,1)}#sele ctionBar.contract{transition-duration:.18s;transition-timing-function:cubic-bezi er(0,0,.2,1)}#tabsContent>::content>:not(#selectionBar){height:100%}</style> <pa per-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollButtonCla ss(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-d own="_onLeftScrollButtonDown" tabindex="-1"></paper-icon-button> <div id="tabsCo ntainer" on-track="_scroll" on-down="_down"> <div id="tabsContent" class$="[[_co mputeTabsContentClass(scrollable, fitContainer)]]"> <div id="selectionBar" class $="[[_computeSelectionBarClass(noBar, alignBottom)]]" on-transitionend="_onBarTr ansitionEnd"></div> <content select="*"></content> </div> </div> <paper-icon-but ton icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonClass(_rightHi dden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRi ghtScrollButtonDown" tabindex="-1"></paper-icon-button> </template> <script>Poly mer({is:"paper-tabs",behaviors:[Polymer.IronResizableBehavior,Polymer.IronMenuba rBehavior],properties:{noink:{type:Boolean,value:!1,observer:"_noinkChanged"},no Bar:{type:Boolean,value:!1},noSlide:{type:Boolean,value:!1},scrollable:{type:Boo lean,value:!1},fitContainer:{type:Boolean,value:!1},disableDrag:{type:Boolean,va lue:!1},hideScrollButtons:{type:Boolean,value:!1},alignBottom:{type:Boolean,valu e:!1},selectable:{type:String,value:"paper-tab"},autoselect:{type:Boolean,value: !1},autoselectDelay:{type:Number,value:0},_step:{type:Number,value:10},_holdDela y:{type:Number,value:1},_leftHidden:{type:Boolean,value:!1},_rightHidden:{type:B oolean,value:!1},_previousTab:{type:Object}},hostAttributes:{role:"tablist"},lis teners:{"iron-resize":"_onTabSizingChanged","iron-items-changed":"_onTabSizingCh anged","iron-select":"_onIronSelect","iron-deselect":"_onIronDeselect"},keyBindi ngs:{"left:keyup right:keyup":"_onArrowKeyup"},created:function(){this._holdJob= null,this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0,th is._bindDelayedActivationHandler=this._delayedActivationHandler.bind(this),this. addEventListener("blur",this._onBlurCapture.bind(this),!0)},ready:function(){thi s.setScrollDirection("y",this.$.tabsContainer)},detached:function(){this._cancel PendingActivation()},_noinkChanged:function(t){var e=Polymer.dom(this).querySele ctorAll("paper-tab");e.forEach(t?this._setNoinkAttribute:this._removeNoinkAttrib ute)},_setNoinkAttribute:function(t){t.setAttribute("noink","")},_removeNoinkAtt ribute:function(t){t.removeAttribute("noink")},_computeScrollButtonClass:functio n(t,e,i){return!e||i?"hidden":t?"not-visible":""},_computeTabsContentClass:funct ion(t,e){return t?"scrollable"+(e?" fit-container":""):" fit-container"},_comput eSelectionBarClass:function(t,e){return t?"hidden":e?"align-bottom":""},_onTabSi zingChanged:function(){this.debounce("_onTabSizingChanged",function(){this._scro ll(),this._tabChanged(this.selectedItem)},10)},_onIronSelect:function(t){this._t abChanged(t.detail.item,this._previousTab),this._previousTab=t.detail.item,this. cancelDebouncer("tab-changed")},_onIronDeselect:function(t){this.debounce("tab-c hanged",function(){this._tabChanged(null,this._previousTab),this._previousTab=nu ll},1)},_activateHandler:function(){this._cancelPendingActivation(),Polymer.Iron MenuBehaviorImpl._activateHandler.apply(this,arguments)},_scheduleActivation:fun ction(t,e){this._pendingActivationItem=t,this._pendingActivationTimeout=this.asy nc(this._bindDelayedActivationHandler,e)},_delayedActivationHandler:function(){v ar t=this._pendingActivationItem;this._pendingActivationItem=void 0,this._pendin gActivationTimeout=void 0,t.fire(this.activateEvent,null,{bubbles:!0,cancelable: !0})},_cancelPendingActivation:function(){void 0!==this._pendingActivationTimeou t&&(this.cancelAsync(this._pendingActivationTimeout),this._pendingActivationItem =void 0,this._pendingActivationTimeout=void 0)},_onArrowKeyup:function(t){this.a utoselect&&this._scheduleActivation(this.focusedItem,this.autoselectDelay)},_onB lurCapture:function(t){t.target===this._pendingActivationItem&&this._cancelPendi ngActivation()},get _tabContainerScrollSize(){return Math.max(0,this.$.tabsConta iner.scrollWidth-this.$.tabsContainer.offsetWidth)},_scroll:function(t,e){if(thi s.scrollable){var i=e&&-e.ddx||0;this._affectScroll(i)}},_down:function(t){this. async(function(){this._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAs ync),this._defaultFocusAsync=null)},1)},_affectScroll:function(t){this.$.tabsCon tainer.scrollLeft+=t;var e=this.$.tabsContainer.scrollLeft;this._leftHidden=0=== e,this._rightHidden=e===this._tabContainerScrollSize},_onLeftScrollButtonDown:fu nction(){this._scrollToLeft(),this._holdJob=setInterval(this._scrollToLeft.bind( this),this._holdDelay)},_onRightScrollButtonDown:function(){this._scrollToRight( ),this._holdJob=setInterval(this._scrollToRight.bind(this),this._holdDelay)},_on ScrollButtonUp:function(){clearInterval(this._holdJob),this._holdJob=null},_scro llToLeft:function(){this._affectScroll(-this._step)},_scrollToRight:function(){t his._affectScroll(this._step)},_tabChanged:function(t,e){if(!t)return this.$.sel ectionBar.classList.remove("expand"),this.$.selectionBar.classList.remove("contr act"),void this._positionBar(0,0);var i=this.$.tabsContent.getBoundingClientRect (),n=i.width,o=t.getBoundingClientRect(),s=o.left-i.left;if(this._pos={width:thi s._calcPercent(o.width,n),left:this._calcPercent(s,n)},this.noSlide||null==e)ret urn this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList .remove("contract"),void this._positionBar(this._pos.width,this._pos.left);var a =e.getBoundingClientRect(),l=this.items.indexOf(e),c=this.items.indexOf(t),r=5;t his.$.selectionBar.classList.add("expand");var h=l<c,d=this._isRTL;d&&(h=!h),h?t his._positionBar(this._calcPercent(o.left+o.width-a.left,n)-r,this._left):this._ positionBar(this._calcPercent(a.left+a.width-o.left,n)-r,this._calcPercent(s,n)+ r),this.scrollable&&this._scrollToSelectedIfNeeded(o.width,s)},_scrollToSelected IfNeeded:function(t,e){var i=e-this.$.tabsContainer.scrollLeft;i<0?this.$.tabsCo ntainer.scrollLeft+=i:(i+=t-this.$.tabsContainer.offsetWidth,i>0&&(this.$.tabsCo ntainer.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("translat eX("+e+"%) scaleX("+t/100+")",this.$.selectionBar)},_onBarTransitionEnd:function (t){var e=this.$.selectionBar.classList;e.contains("expand")?(e.remove("expand") ,e.add("contract"),this._positionBar(this._pos.width,this._pos.left)):e.contains ("contract")&&e.remove("contract")}})</script> </dom-module> <dom-module id="sin gle-page-style" assetpath="/res/imp/common/"> <template> <style>.header{max-widt h:800px}.title{font-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-h eight:40px;width:initial;height:initial}button{min-width:4em;max-height:55px}tab le{border-collapse:collapse;margin-left:5px;margin-bottom:8px}td,th{border:1px s olid #BBB;padding:5px}.tabs{background-color:#1F78B4;color:#fff;max-width:600px; margin-left:5px;--paper-checkbox-label-color:#fff}paper-tab{background-color:#A6 CEE3;color:#000}paper-tab.iron-selected{background-color:#1F78B4;color:#fff;font -weight:700;text-decoration:underline}paper-tab[disabled]{background-color:#AAA; text-decoration:line-through}.quarantined{background-color:#fdd}.dead{background -color:#ccc}</style> </template> </dom-module><script>!function(){SwarmingBehavi ors.BotPageBehavior=[SwarmingBehaviors.CommonBehavior,{}]}()</script> <dom-modul e 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.toLocaleS tring()+" "+s}var e,s,i=400,n=["first_seen_ts","last_seen_ts","lease_expiration_ ts"],a=["started_ts","completed_ts","abandoned_ts","modified_ts"];Polymer({is:"b ot-page-data",behaviors:[SwarmingBehaviors.BotPageBehavior],properties:{auth_hea ders:{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:Objec t},_events:{type:Object},_tasks:{type:Object}},observers:["request(auth_headers, bot_id)"],request:function(){this.bot_id&&this.auth_headers&&(e&&this.cancelAsyn c(e),e=this.async(function(){e=void 0;var t="/api/swarming/v1/bot/"+this.bot_id, s=this._getJsonAsync("_bot",t+"/get","_busy1",this.auth_headers);s.then(function (){this.set("bot_exists",!0)}.bind(this)).catch(function(t){404===t.status?this. set("bot_exists",!1):sk.errorMessage("Http response: "+(t.status||" ")+" "+t.res ponse)}.bind(this)),this.fire("reload",{id:this.bot_id})},i))},_parseBot:functio n(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.lengt h;a++)e.disks.push({id:i[a],mb:s[i[a]].free_mb});e.disks.sort(function(t,e){retu rn e.mb-t.mb})}else e.disks=[{id:"unknown",mb:0}];return e.dimensions=e.dimensio ns||[],e.dimensions.forEach(function(t){swarming.alias.DIMENSIONS_WITH_ALIASES.i ndexOf(t.key)!==-1&&t.value.forEach(function(e,s){t.value[s]=swarming.alias.appl y(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;retur n 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)retur n[];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._hu manDuration(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.ge tTime()-e.started_ts)/1e3}e.state=e.state||"UNKNOWN","COMPLETED"===e.state&&(e.f ailure?e.state="FAILURE":e.state="SUCCESS")}.bind(this)),e.sort(function(t,e){re turn e.started_ts-t.started_ts}),e}})}()</script> </dom-module> <dom-module id=" bot-page-summary" assetpath="/res/imp/botpage/"> <template> <style include="sing le-page-style">.wrapper{display:table;margin-left:auto;margin-bottom:10px;margin -right:5px}paper-checkbox{margin-left:5px}.thick{border-top-style:solid}</style> <url-param name="show_full_names" value="{{_show_full_names}}"> </url-param> <u rl-param name="show_all_tasks" value="{{_show_all_tasks}}"> </url-param> <url-pa ram name="sort_stats" value="{{_sortstr}}" default_value="total:desc"> </url-par am> <div class="wrapper"> <table> <thead on-sort_change="_sortChange"> <tr> <th> <span>Name</span> <sort-toggle name="full_name" current="[[_sort]]"> </sort-tog gle> </th> <th> <span>Total</span> <sort-toggle name="total" current="[[_sort]]" > </sort-toggle> </th> <th> <span>Success</span> <sort-toggle name="success" cur rent="[[_sort]]"> </sort-toggle> </th> <th> <span>Failed</span> <sort-toggle nam e="failed" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Died</span> <sor t-toggle name="bot_died" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Av erage Duration</span> <sort-toggle name="avg_duration" current="[[_sort]]"> </so rt-toggle> </th> <th> <span>Total Duration</span> <sort-toggle name="total_time" current="[[_sort]]"> </sort-toggle> </th> <th>Percent of Total</th> </tr> </the ad> <tbody> <template is="dom-repeat" items="[[_tasksToShow]]" as="task"> <tr> < td hidden$="[[_truthy(_show_full_names)]]" title="[[task.full_name]]">[[task.nam e]]</td> <td hidden$="[[_not(_show_full_names)]]" title="[[task.full_name]]">[[t ask.full_name]]</td> <td>[[task.total]]</td> <td>[[task.success]]</td> <td>[[tas k.failed]]</td> <td>[[task.bot_died]]</td> <td>[[_humanDuration(task.avg_duratio n)]]</td> <td>[[_humanDuration(task.total_time)]]</td> <td>[[task.total_time_per cent]]%</td> </tr> </template> </tbody> <tbody><tr class="thick"> <td>Total</td> <td>[[_totalStats.total]]</td> <td>[[_totalStats.success]]</td> <td>[[_totalSta ts.failed]]</td> <td>[[_totalStats.bot_died]]</td> <td>[[_humanDuration(_totalSt ats.avg_duration)]]</td> <td>[[_humanDuration(_totalStats.total_time)]]</td> <td >100.0%</td> </tr> </tbody></table> <div> <table> <thead> <tr> <th title="How mu ch time passed between the oldest task fetched and now."> Total Wall Time </th> <th title="How much of the wall time this bot was busy with a task."> Wall Time Utilization </th> </tr> </thead> <tbody> <tr> <td>[[_humanDuration(_totalStats.w all_time)]]</td> <td>[[_totalStats.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_task s}}"> Show All Tasks </paper-checkbox> </div> </div> </template> <script>!functi on(){var t=15;Polymer({is:"bot-page-summary",behaviors:[SwarmingBehaviors.BotPag eBehavior],properties:{tasks:{type:Array},_cannotExpand:{type:Boolean,computed:" _countTasks(_taskStats.*)"},_show_all_tasks:{type:Boolean},_show_full_names:{typ e:Boolean},_sortstr:{type:String},_sort:{type:Object,computed:"_makeSortObject(_ sortstr)"},_taskStats:{type:Array},_tasksToShow:{type:Array,computed:"_sortAndLi mitTasks(_taskStats.*,_sort.*,_show_all_tasks)"},_totalStats:{type:Object}},obse rvers:["_aggregate(tasks.*)"],_aggregate:function(){if(this.tasks&&this.tasks.le ngth){var t=new Date(1e3*sk.now()),a={},e={total:this.tasks.length,success:0,fai led:0,bot_died:0,avg_duration:0,total_time:0,wall_time:(t-this.tasks[this.tasks. length-1].started_ts)/1e3};this.tasks.forEach(function(t){var s=t.name.trim(),i= s.split("/");5===i.length&&(s=i[0]+"/"+i[3]),a[s]||(a[s]={full_name:s,name:s,tot al: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_die d++):(e.success++,a[s].success++),e.total_time+=t.duration,a[s].total_time+=t.du ration}),e.avg_duration=e.total_time/e.total,e.wall_time_utilization=(100*e.tota l_time/e.wall_time).toFixed(1),this.set("_totalStats",e);var s=Object.keys(a),i= [];s.forEach(function(t){a[t].avg_duration=a[t].total_time/a[t].total,a[t].total _time_percent=(100*a[t].total_time/e.total_time).toFixed(1),i.push(a[t])});var o =new Substrings({minOccurrence:Math.max(2,s.length-1),minLength:6});o.build(s);v ar n=o.weighByAverage()||[];n.length&&n[0].source.forEach(function(t){var a=i[t] .full_name;i[t].name=a.replace(n[0].name,"...")}),this.set("_taskStats",i)}},_co mpare:function(t,a){if(!this._sort)return 0;var e=1;return"desc"===this._sort.di rection&&(e=-1),e*swarming.naturalCompare(t[this._sort.name],a[this._sort.name]) },_countTasks:function(){return this._taskStats.length<=t},_makeSortObject:funct ion(t){if(t){var a=t.split(":");return 2!=a.length?{name:"full_name",direction:" asc"}:{name:a[0],direction:a[1]}}},_sortAndLimitTasks:function(){swarming.stable Sort(this._taskStats,this._compare.bind(this));var a=this._taskStats.length;retu rn!this._show_all_tasks&&this._taskStats.length>t&&(a=t),this._taskStats.slice(0 ,a)},_sortChange:function(t){t&&t.detail&&t.detail.name&&(t.preventDefault(),t.s topPropagation(),this.set("_sortstr",t.detail.name+":"+t.detail.direction))}})}( )</script> </dom-module><dom-module id="bot-page" assetpath="/res/imp/botpage/"> <template> <style include="iron-flex iron-flex-alignment iron-positioning swarm ing-app-style single-page-style task-style">.message{white-space:pre-line;font-f amily:monospace}.bot_state{white-space:pre;font-family:monospace;margin-bottom:1 0px}.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{w hite-space:nowrap;margin-bottom:5px;margin-top:auto}.deleted{text-align:center;f ont-size:larger}paper-checkbox{--paper-checkbox-label-color:#fff;--paper-checkbo x-checked-color:#fff;--paper-checkbox-checkmark-color:#000;--paper-checkbox-unch ecked-color:#fff;padding:3px}paper-dialog{border-radius:6px}</style> <url-param name="id" value="{{bot_id}}"> </url-param> <url-param name="show_all_events" val ue="{{_show_all}}"> </url-param> <url-param name="selected" value="{{_selected}} "> </url-param> <url-param name="show_state" value="{{_show_state}}"> </url-para m> <swarming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" perm issions="{{_permissions}}" server_details="{{_server_details}}" signed_in="{{_si gned_in}}" busy="[[_or(_busy1,_busy2,_busy3)]]" name="Swarming Bot Page"> <h2 hi dden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden $="[[_not(_signed_in)]]"> <bot-page-data id="data" auth_headers="[[_auth_headers ]]" bot_id="[[bot_id]]" bot="{{_bot}}" bot_exists="{{_bot_exists}}" busy="{{_bus y1}}" events="{{_events}}" tasks="{{_tasks}}" on-reload="_clearAndReload"> </bot -page-data> <div class="header horizontal layout"> <paper-input class="id_input" label="Bot id" value="{{bot_id}}"></paper-input> <template is="dom-if" if="[[_c cLink(_bot)]]"> <div class="vertical layout"> <a href$="[[_ccLink(_bot)]]" class ="cloud">Cloud Console</a> </div> </template> <button on-click="_refresh"> <iron -icon class="refresh" icon="icons:refresh"></iron-icon> </button> </div> </div> <h2 hidden$="[[_bot_exists]]">Bot not found.</h2> <div hidden$="[[_not(_bot_exis ts)]]"> <div class="horizontal wrap layout"> <div class="flex"> <table> <templat e is="dom-if" if="[[_bot.deleted]]"> <tr class="dead deleted" title="This bot wa s deleted."> <td colspan="3">THIS BOT WAS DELETED</td> </tr> </template> <tbody> <tr class$="[[_isDead(_bot)]]" title="Last time the bot contacted the server."> <td>Last Seen</td> <td title="[[_bot.human_last_seen_ts]]"> [[_timeDiffExact(_bo t.last_seen_ts)]] ago</td> <td> <template is="dom-if" if="[[_canShutdown(_bot,_p ermissions)]]"> <button class="raised" on-click="_promptShutdown"> Shut Down Gra cefully </button> </template> <template is="dom-if" if="[[_canDelete(_bot,_permi ssions)]]"> <button class="raised" on-click="_promptDelete"> Delete </button> </ template> </td> </tr> <template is="dom-if" if="[[_bot.quarantined]]"> <tr class ="quarantined"> <td>Quarantined</td> <td colspan="2" class="message">[[_quaranti neMessage(_bot)]]</td> </tr> </template> <tr> <td>Current Task</td> <td> <a targ et="_blank" rel="noopener" href$="[[_taskLink(_bot.task_id)]]"> [[_task(_bot)]] </a> </td> <td> </td> </tr> <tr> <td rowspan$="[[_numRows(_bot.dimensions)]]"> < a href$="[[_siblingBotsLink(_bot.dimensions)]]" title="The list of bots that als o matches these dimensions (except id)."> Dimensions</a> </td> </tr> <template i s="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.exte rnal_ip]]">[[_bot.external_ip]]</a></td> <td></td> </tr> <tr class$="[[_classVer sion(_server_details.bot_version,_bot.version)]]" title="Version is based on the content of swarming_bot.zip which is the swarming bot code. The bot won't updat e if quarantined, dead, or busy."> <td>Bot Version</td> <td>[[_shorten(_bot.vers ion,'8')]]</td> <td></td> </tr> <tr title="The version the server expects the bo t to be using."> <td>Expected Bot Version</td> <td>[[_shorten(_server_details.bo t_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_se en_ts]]"> [[_timeDiffApprox(_bot.first_seen_ts)]] ago </td> <td></td> </tr> <tr title="How the bot is authenticated by the server."> <td>Authenticated as</td> < td colspan="2">[[_bot.authenticated_as]]</td> </tr> <template is="dom-if" if="[[ _bot.lease_id]]"> <tr> <td>Machine Provider Lease ID</td> <td colspan="2"> <a hr ef$="[[_mpLink(_bot,_server_details.machine_provider_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> <s pan class="title">State</span> <template is="dom-if" if="[[_not(_show_state)]]"> <button on-click="_toggleState"> <iron-icon icon="icons:add-circle-outline"></i ron-icon> </button> </template> <template is="dom-if" if="[[_show_state]]"> <but ton on-click="_toggleState"> <iron-icon icon="icons:remove-circle-outline"></iro n-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-summary tasks="[[_tasks]]"> </bot-page -summary> </div> </div> <div class="tabs"> <paper-tabs selected="{{_selected}}" no-bar=""> <paper-tab>Tasks</paper-tab> <paper-tab>Events</paper-tab> </paper-ta bs> <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>Tas k</th> <th>Started</th> <th>Duration</th> <th>Result</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_tasks}}" as="task"> <tr class$="[[_taskClas s(task)]]"> <td> <a target="_blank" rel="noopener" href$="[[_taskLink(task.task_ id)]]"> [[task.name]] </a> </td> <td>[[task.human_started_ts]]</td> <td title="[ [task.human_completed_ts]]">[[task.human_duration]]</td> <td>[[task.state]]</td> </tr> </template> </tbody> </table> </template> <template is="dom-if" if="[[_sh owEvents]]"> <table class="events_table"> <thead> <tr> <th>Message</th> <th>Type </th> <th>Timestamp</th> <th>Task ID</th> <th>Version</th> </tr> </thead> <tbody > <template is="dom-repeat" items="{{_eventList(_show_all,_events.*)}}" as="even t"> <tr> <td class="message">[[event.message]]</td> <td>[[event.event_type]]</td > <td>[[event.human_ts]]</td> <td> <a target="_blank" rel="noopener" href$="[[_t askLink(event.task_id)]]"> [[event.task_id]] </a> </td> <td class$="[[_classVers ion(_server_details.bot_version,event.version)]]"> [[_shorten(event.version,'8') ]] </td> </tr> </template> </tbody> </table> </template> <pageable-data id="page _tasks" hidden$="[[_showEvents]]" busy="{{_busy2}}" label="Show more tasks" outp ut="{{_tasks}}" parse="[[_parseTasks]]"> </pageable-data> <pageable-data id="pag e_events" hidden$="[[_not(_showEvents)]]" busy="{{_busy3}}" label="Show more eve nts" output="{{_events}}" parse="[[_parseEvents]]"> </pageable-data> </div> </sw arming-app> <paper-dialog id="prompt" modal="" on-iron-overlay-closed="_promptCl osed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</ div> <div class="buttons"> <paper-button dialog-dismiss="" autofocus="">No</pape r-button> <paper-button dialog-confirm="">Yes</paper-button> </div> </paper-dial og> </template> <script> (function(){ 888 })() </script> </dom-module><dom-module id="task-list" assetpath="/res/imp/tas klist/"> <template> <style include="iron-flex iron-flex-alignment iron-positioni ng swarming-app-style dynamic-table-style task-style">task-filters{margin-bottom :8px;margin-right:10px}.task-list th>span{padding-right:30px}</style> <url-param name="s" value="{{_sortstr}}" default_value="created_ts:desc"> </url-param> <sw arming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" permission s="{{_permissions}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2)]]" na me="Swarming Task List"> <h2 hidden$="[[_signed_in]]">You must sign in to see an ything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <task-list-data id="dat a" auth_headers="[[_auth_headers]]" query_params="[[_query_params]]" tasks="[[_i tems]]" busy="{{_busy1)}}" dimensions="{{_dimensions}}" primary_map="{{_primary_ map}}" primary_arr="{{_primary_arr}}"> </task-list-data> <div class="horizontal layout"> <task-filters dimensions="[[_dimensions]]" permissions="[[_permissions] ]" primary_map="[[_primary_map]]" primary_arr="[[_primary_arr]]" special_columns ="[[_specialColumns]]" columns="{{_columns}}" query_params="{{_query_params}}" f ilter="{{_filter}}" on-cancel-all="_promptCancelAll"> </task-filters> </div> <ta ble class="task-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 na me="state" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('bot', _columns.*)]]"> <span>Bot Assigned</span> <sort-toggle name="bot" current="[[_s ort]]"> </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="[[_sort ]]"> </sort-toggle> </th> <template is="dom-repeat" items="[[_plainColumns]]" as ="c"> <th hidden$="[[_hide(c)]]"> <span>[[_header(c)]]</span> <sort-toggle name= "[[c]]" current="[[_sort]]"> </sort-toggle> </th> </template> </tr> </thead> <tb ody> <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', _columns .*)]]"> <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_revisi on', _columns.*)]]"> <a class="center" href$="[[_sourceLink(task)]]" target="_bl ank"> [[_column('source_revision',task)]] </a> </td> <template is="dom-repeat" i tems="[[_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="[[_p arseTasks]]"> </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-butt on dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm ="">Yes</paper-button> </div> </paper-dialog> <paper-dialog id="cancel_all_dialo g" modal=""> <task-mass-cancel id="mass_cancel" auth_headers="[[_auth_headers]]" started_canceling="{{_started_canceling}}" finished_canceling="{{_finished_canc eling}}"> </task-mass-cancel> <div class="buttons"> <paper-button dialog-dismiss ="" autofocus="" hidden$="[[_started_canceling]]"> Go Back - Don't Cancel Anythi ng </paper-button> <paper-button dialog-dismiss="" autofocus="" hidden$="[[!_fin ished_canceling]]"> Done </paper-button> </div> </paper-dialog> </template> <scr ipt>!function(){function t(t){return function(e){return this._attribute(e,"human _"+t)[0]}}function e(t){return function(e,a,s){var n=this._attribute(a,t,"0")[0] ,i=this._attribute(s,t,"0")[0];return e*(n-i)}}var a=["deduped_from","name","sta te","bot","source_revision"],s={abandoned_ts:t("abandoned_ts"),bot:function(t){r eturn this._attribute(t,"bot_id")[0]},completed_ts:t("completed_ts"),costs_usd:f unction(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("CO MPLETED"===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) ":"COMPLETED (SUCCESS)"}return e}},n={abandoned_ts:"Abandoned On",completed_ts:" Completed On",created_ts:"Created On",duration:"Duration",modified_ts:"Last Modi fied",started_ts:"Started Working On",user:"Requesting User"},i={abandoned_ts:e( "abandoned_ts"),completed_ts:e("completed_ts"),created_ts:e("created_ts"),durati on:e("duration"),modified_ts:e("modified_ts"),started_ts:e("started_ts")};Polyme r({is:"task-list",behaviors:[SwarmingBehaviors.DynamicTableBehavior,SwarmingBeha viors.TaskBehavior],properties:{client_id:{type:String},_busy1:{type:Boolean,val ue:!1},_busy2:{type:Boolean,value:!1},_parseTasks:{type:Function,value:function( ){return this.$.data.parseTasks.bind(this)}},_toCancel:{type:String},_columnMap: {type:Object,value:function(){var t=this._commonColumns();for(var e in s)t[e]=s[ e];return t}},_headerMap:{type:Object,value:n},_specialColumns:{type:Array,value :a},_specialSort:{type:Object,value:i}},observers:["reload(_query_params,_auth_h eaders)"],_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(){va r t="/api/swarming/v1/task/"+this._toCancel+"/cancel";swarming.postWithToast(t," Canceling task "+this._toCancel,this._auth_headers),this.set("_toCancel","")},_p romptClosed:function(t){t.detail.confirmed&&this._cancelTask()},_promptCancel:fu nction(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.$.prompt.open() ):void console.log("Missing task info",e)},_promptCancelAll:function(t){this.$.m ass_cancel.tags=t.detail.tags,this.$.mass_cancel.prompt(),this.$.cancel_all_dial og.open()},_closeCancelAll:function(){this.$.cancel_all_dialog.close()},reload:f unction(){if(this._auth_headers&&this._query_params){var t="/api/swarming/v1/tas ks/list?"+sk.query.fromParamSet(this._query_params);this.$.page_tasks.load(t,thi s._auth_headers)}},_sourceLink:function(t){var e=this._attribute(t,"source_revis ion")[0],a=this._attribute(t,"source_repo")[0];return"none"!==e&&"none"!==a&&a.r eplace("%s",e)},_tag:function(t,e){if(t&&t.tagMap)return t.tagMap[e]},_taskClass :function(t){return this.stateClass(this._column("state",t))}})}()</script> </do m-module> <dom-module id="iron-collapse" assetpath="/res/imp/bower_components/ir on-collapse/"> <template> <style>:host{display:block;transition-duration:var(--i ron-collapse-transition-duration,300ms);overflow:visible}:host(.iron-collapse-cl osed){display:none}:host(:not(.iron-collapse-opened)){overflow:hidden}</style> < content></content> </template> </dom-module> <script>Polymer({is:"iron-collapse" ,behaviors:[Polymer.IronResizableBehavior],properties:{horizontal:{type:Boolean, value:!1,observer:"_horizontalChanged"},opened:{type:Boolean,value:!1,notify:!0, observer:"_openedChanged"},noAnimation:{type:Boolean},_desiredSize:{type:String, value:""}},get dimension(){return this.horizontal?"width":"height"},get _dimensi onMax(){return this.horizontal?"maxWidth":"maxHeight"},get _dimensionMaxCss(){re turn this.horizontal?"max-width":"max-height"},hostAttributes:{role:"group","ari a-hidden":"true","aria-expanded":"false"},listeners:{transitionend:"_transitionE nd"},attached:function(){this._transitionEnd()},toggle:function(){this.opened=!t his.opened},show:function(){this.opened=!0},hide:function(){this.opened=!1},upda teSize:function(i,t){if(i="auto"===i?"":i,this._desiredSize!==i){this._desiredSi ze=i,this._updateTransition(!1);var e=t&&!this.noAnimation&&this._isDisplayed;if (e){var n=this._calcSize();""===i&&(this.style[this._dimensionMax]="",i=this._ca lcSize()),this.style[this._dimensionMax]=n,this.scrollTop=this.scrollTop,this._u pdateTransition(!0),e=i!==n}this.style[this._dimensionMax]=i,e||this._transition End()}},enableTransition:function(i){Polymer.Base._warn("`enableTransition()` is deprecated, use `noAnimation` instead."),this.noAnimation=!i},_updateTransition :function(i){this.style.transitionDuration=i&&!this.noAnimation?"":"0s"},_horizo ntalChanged:function(){this.style.transitionProperty=this._dimensionMaxCss;var i ="maxWidth"===this._dimensionMax?"maxHeight":"maxWidth";this.style[i]="",this.up dateSize(this.opened?"auto":"0px",!1)},_openedChanged:function(){this.setAttribu te("aria-expanded",this.opened),this.setAttribute("aria-hidden",!this.opened),th is.toggleClass("iron-collapse-closed",!1),this.toggleClass("iron-collapse-opened ",!1),this.updateSize(this.opened?"auto":"0px",!0),this.opened&&this.focus()},_t ransitionEnd:function(){this.style[this._dimensionMax]=this._desiredSize,this.to ggleClass("iron-collapse-closed",!this.opened),this.toggleClass("iron-collapse-o pened",this.opened),this._updateTransition(!1),this.notifyResize()},get _isDispl ayed(){var i=this.getBoundingClientRect();for(var t in i)if(0!==i[t])return!0;re turn!1},_calcSize:function(){return this.getBoundingClientRect()[this.dimension] +"px"}})</script> <script>Polymer.IronMenubarBehaviorImpl={hostAttributes:{role: "menubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onUpKey:function (e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},_onDownKey :function(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},g et _isRTL(){return"rtl"===window.getComputedStyle(this).direction},_onLeftKey:fu nction(e){this._isRTL?this._focusNext():this._focusPrevious(),e.detail.keyboardE vent.preventDefault()},_onRightKey:function(e){this._isRTL?this._focusPrevious() :this._focusNext(),e.detail.keyboardEvent.preventDefault()},_onKeydown:function( e){this.keyboardEventMatchesKeys(e,"up down left right esc")||this._focusWithKey boardEvent(e)}},Polymer.IronMenubarBehavior=[Polymer.IronMenuBehavior,Polymer.Ir onMenubarBehaviorImpl]</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.5 8 4.59L10 18l6-6z"></path></g> </defs></svg> </iron-iconset-svg> <dom-module id= "paper-tab" assetpath="/res/imp/bower_components/paper-tabs/"> <template> <style >:host{@apply(--layout-inline);@apply(--layout-center);@apply(--layout-center-ju stified);@apply(--layout-flex-auto);position:relative;padding:0 12px;overflow:hi dden;cursor:pointer;vertical-align:middle;@apply(--paper-font-common-base);@appl y(--paper-tab)}:host(:focus){outline:0}:host([link]){padding:0}.tab-content{heig ht:100%;transform:translateZ(0);-webkit-transform:translateZ(0);transition:opaci ty .1s cubic-bezier(.4,0,1,1);@apply(--layout-horizontal);@apply(--layout-center -center);@apply(--layout-flex-auto);@apply(--paper-tab-content)}:host(:not(.iron -selected))>.tab-content{opacity:.8;@apply(--paper-tab-content-unselected)}:host (:focus) .tab-content{opacity:1;font-weight:700}paper-ripple{color:var(--paper-t ab-ink,--paper-yellow-a100)}.tab-content>::content>a{@apply(--layout-flex-auto); height:100%}</style> <div class="tab-content"> <content></content> </div> </temp late> <script>Polymer({is:"paper-tab",behaviors:[Polymer.IronControlState,Polyme r.IronButtonState,Polymer.PaperRippleBehavior],properties:{link:{type:Boolean,va lue:!1,reflectToAttribute:!0}},hostAttributes:{role:"tab"},listeners:{down:"_upd ateNoink",tap:"_onTap"},attached:function(){this._updateNoink()},get _parentNoin k(){var t=Polymer.dom(this).parentNode;return!!t&&!!t.noink},_updateNoink:functi on(){this.noink=!!this.noink||!!this._parentNoink},_onTap:function(t){if(this.li nk){var e=this.queryEffectiveChildren("a");if(!e)return;if(t.target===e)return;e .click()}}})</script> </dom-module> <dom-module id="paper-tabs" assetpath="/res/ imp/bower_components/paper-tabs/"> <template> <style>:host{@apply(--layout);@app ly(--layout-center);height:48px;font-size:14px;font-weight:500;overflow:hidden;- moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:n one;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transpar ent;@apply(--paper-tabs)}:host-context([dir=rtl]){@apply(--layout-horizontal-rev erse)}#tabsContainer{position:relative;height:100%;white-space:nowrap;overflow:h idden;@apply(--layout-flex-auto)}#tabsContent{height:100%;-moz-flex-basis:auto;- ms-flex-basis:auto;flex-basis:auto}#tabsContent.scrollable{position:absolute;whi te-space:nowrap}#tabsContent.scrollable.fit-container,#tabsContent:not(.scrollab le){@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}.hidden{display:none}.not-visible{opacity:0;cursor: default}paper-icon-button{width:48px;height:48px;padding:12px;margin:0 4px}#sele ctionBar{position:absolute;height:2px;bottom:0;left:0;right:0;background-color:v ar(--paper-tabs-selection-bar-color,--paper-yellow-a100);-webkit-transform:scale (0);transform:scale(0);-webkit-transform-origin:left center;transform-origin:lef t center;transition:-webkit-transform;transition:transform;@apply(--paper-tabs-s election-bar)}#selectionBar.align-bottom{top:0;bottom:auto}#selectionBar.expand{ transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,1,1)}#sele ctionBar.contract{transition-duration:.18s;transition-timing-function:cubic-bezi er(0,0,.2,1)}#tabsContent>::content>:not(#selectionBar){height:100%}</style> <pa per-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollButtonCla ss(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-d own="_onLeftScrollButtonDown" tabindex="-1"></paper-icon-button> <div id="tabsCo ntainer" on-track="_scroll" on-down="_down"> <div id="tabsContent" class$="[[_co mputeTabsContentClass(scrollable, fitContainer)]]"> <div id="selectionBar" class $="[[_computeSelectionBarClass(noBar, alignBottom)]]" on-transitionend="_onBarTr ansitionEnd"></div> <content select="*"></content> </div> </div> <paper-icon-but ton icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonClass(_rightHi dden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRi ghtScrollButtonDown" tabindex="-1"></paper-icon-button> </template> <script>Poly mer({is:"paper-tabs",behaviors:[Polymer.IronResizableBehavior,Polymer.IronMenuba rBehavior],properties:{noink:{type:Boolean,value:!1,observer:"_noinkChanged"},no Bar:{type:Boolean,value:!1},noSlide:{type:Boolean,value:!1},scrollable:{type:Boo lean,value:!1},fitContainer:{type:Boolean,value:!1},disableDrag:{type:Boolean,va lue:!1},hideScrollButtons:{type:Boolean,value:!1},alignBottom:{type:Boolean,valu e:!1},selectable:{type:String,value:"paper-tab"},autoselect:{type:Boolean,value: !1},autoselectDelay:{type:Number,value:0},_step:{type:Number,value:10},_holdDela y:{type:Number,value:1},_leftHidden:{type:Boolean,value:!1},_rightHidden:{type:B oolean,value:!1},_previousTab:{type:Object}},hostAttributes:{role:"tablist"},lis teners:{"iron-resize":"_onTabSizingChanged","iron-items-changed":"_onTabSizingCh anged","iron-select":"_onIronSelect","iron-deselect":"_onIronDeselect"},keyBindi ngs:{"left:keyup right:keyup":"_onArrowKeyup"},created:function(){this._holdJob= null,this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0,th is._bindDelayedActivationHandler=this._delayedActivationHandler.bind(this),this. addEventListener("blur",this._onBlurCapture.bind(this),!0)},ready:function(){thi s.setScrollDirection("y",this.$.tabsContainer)},detached:function(){this._cancel PendingActivation()},_noinkChanged:function(t){var e=Polymer.dom(this).querySele ctorAll("paper-tab");e.forEach(t?this._setNoinkAttribute:this._removeNoinkAttrib ute)},_setNoinkAttribute:function(t){t.setAttribute("noink","")},_removeNoinkAtt ribute:function(t){t.removeAttribute("noink")},_computeScrollButtonClass:functio n(t,e,i){return!e||i?"hidden":t?"not-visible":""},_computeTabsContentClass:funct ion(t,e){return t?"scrollable"+(e?" fit-container":""):" fit-container"},_comput eSelectionBarClass:function(t,e){return t?"hidden":e?"align-bottom":""},_onTabSi zingChanged:function(){this.debounce("_onTabSizingChanged",function(){this._scro ll(),this._tabChanged(this.selectedItem)},10)},_onIronSelect:function(t){this._t abChanged(t.detail.item,this._previousTab),this._previousTab=t.detail.item,this. cancelDebouncer("tab-changed")},_onIronDeselect:function(t){this.debounce("tab-c hanged",function(){this._tabChanged(null,this._previousTab),this._previousTab=nu ll},1)},_activateHandler:function(){this._cancelPendingActivation(),Polymer.Iron MenuBehaviorImpl._activateHandler.apply(this,arguments)},_scheduleActivation:fun ction(t,e){this._pendingActivationItem=t,this._pendingActivationTimeout=this.asy nc(this._bindDelayedActivationHandler,e)},_delayedActivationHandler:function(){v ar t=this._pendingActivationItem;this._pendingActivationItem=void 0,this._pendin gActivationTimeout=void 0,t.fire(this.activateEvent,null,{bubbles:!0,cancelable: !0})},_cancelPendingActivation:function(){void 0!==this._pendingActivationTimeou t&&(this.cancelAsync(this._pendingActivationTimeout),this._pendingActivationItem =void 0,this._pendingActivationTimeout=void 0)},_onArrowKeyup:function(t){this.a utoselect&&this._scheduleActivation(this.focusedItem,this.autoselectDelay)},_onB lurCapture:function(t){t.target===this._pendingActivationItem&&this._cancelPendi ngActivation()},get _tabContainerScrollSize(){return Math.max(0,this.$.tabsConta iner.scrollWidth-this.$.tabsContainer.offsetWidth)},_scroll:function(t,e){if(thi s.scrollable){var i=e&&-e.ddx||0;this._affectScroll(i)}},_down:function(t){this. async(function(){this._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAs ync),this._defaultFocusAsync=null)},1)},_affectScroll:function(t){this.$.tabsCon tainer.scrollLeft+=t;var e=this.$.tabsContainer.scrollLeft;this._leftHidden=0=== e,this._rightHidden=e===this._tabContainerScrollSize},_onLeftScrollButtonDown:fu nction(){this._scrollToLeft(),this._holdJob=setInterval(this._scrollToLeft.bind( this),this._holdDelay)},_onRightScrollButtonDown:function(){this._scrollToRight( ),this._holdJob=setInterval(this._scrollToRight.bind(this),this._holdDelay)},_on ScrollButtonUp:function(){clearInterval(this._holdJob),this._holdJob=null},_scro llToLeft:function(){this._affectScroll(-this._step)},_scrollToRight:function(){t his._affectScroll(this._step)},_tabChanged:function(t,e){if(!t)return this.$.sel ectionBar.classList.remove("expand"),this.$.selectionBar.classList.remove("contr act"),void this._positionBar(0,0);var i=this.$.tabsContent.getBoundingClientRect (),n=i.width,o=t.getBoundingClientRect(),s=o.left-i.left;if(this._pos={width:thi s._calcPercent(o.width,n),left:this._calcPercent(s,n)},this.noSlide||null==e)ret urn this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList .remove("contract"),void this._positionBar(this._pos.width,this._pos.left);var a =e.getBoundingClientRect(),l=this.items.indexOf(e),c=this.items.indexOf(t),r=5;t his.$.selectionBar.classList.add("expand");var h=l<c,d=this._isRTL;d&&(h=!h),h?t his._positionBar(this._calcPercent(o.left+o.width-a.left,n)-r,this._left):this._ positionBar(this._calcPercent(a.left+a.width-o.left,n)-r,this._calcPercent(s,n)+ r),this.scrollable&&this._scrollToSelectedIfNeeded(o.width,s)},_scrollToSelected IfNeeded:function(t,e){var i=e-this.$.tabsContainer.scrollLeft;i<0?this.$.tabsCo ntainer.scrollLeft+=i:(i+=t-this.$.tabsContainer.offsetWidth,i>0&&(this.$.tabsCo ntainer.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("translat eX("+e+"%) scaleX("+t/100+")",this.$.selectionBar)},_onBarTransitionEnd:function (t){var e=this.$.selectionBar.classList;e.contains("expand")?(e.remove("expand") ,e.add("contract"),this._positionBar(this._pos.width,this._pos.left)):e.contains ("contract")&&e.remove("contract")}})</script> </dom-module> <dom-module id="sin gle-page-style" assetpath="/res/imp/common/"> <template> <style>.header{max-widt h:800px}.title{font-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-h eight:40px;width:initial;height:initial}button{min-width:4em;max-height:55px}tab le{border-collapse:collapse;margin-left:5px;margin-bottom:8px}td,th{border:1px s olid #BBB;padding:5px}.tabs{background-color:#1F78B4;color:#fff;max-width:600px; margin-left:5px;--paper-checkbox-label-color:#fff}paper-tab{background-color:#A6 CEE3;color:#000}paper-tab.iron-selected{background-color:#1F78B4;color:#fff;font -weight:700;text-decoration:underline}paper-tab[disabled]{background-color:#AAA; text-decoration:line-through}.quarantined{background-color:#fdd}.dead{background -color:#ccc}paper-checkbox{--paper-checkbox-checked-color:#1F78B4}</style> </tem plate> </dom-module><script>!function(){SwarmingBehaviors.BotPageBehavior=[Swarm ingBehaviors.CommonBehavior,{}]}()</script> <dom-module id="bot-page-data" asset path="/res/imp/botpage/"> <script>!function(){function t(t){if(!s){var e=t.toStr ing();s=e.substring(e.indexOf("("))}return t.toLocaleString()+" "+s}var e,s,i=40 0,n=["first_seen_ts","last_seen_ts","lease_expiration_ts"],a=["started_ts","comp leted_ts","abandoned_ts","modified_ts"];Polymer({is:"bot-page-data",behaviors:[S warmingBehaviors.BotPageBehavior],properties:{auth_headers:{type:Object},bot_id: {type:String},busy:{type:Boolean,computed:"_or(_busy1)",notify:!0},bot:{type:Obj ect,computed:"_parseBot(_bot)",notify:!0},bot_exists:{type:Boolean,value:!0,noti fy:!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=void 0;var t="/api/swarming/v1/bot/"+this.bot_id,s=this._getJsonAsync("_bot ",t+"/get","_busy1",this.auth_headers);s.then(function(){this.set("bot_exists",! 0)}.bind(this)).catch(function(t){404===t.status?this.set("bot_exists",!1):sk.er rorMessage("Http response: "+(t.status||" ")+" "+t.response)}.bind(this)),this.f ire("reload",{id:this.bot_id})},i))},_parseBot:function(e){if(!e)return{};e.stat e=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})}else e.disk s=[{id:"unknown",mb:0}];return e.dimensions=e.dimensions||[],e.dimensions.forEac h(function(t){swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(t.key)!==-1&&t.valu e.forEach(function(e,s){t.value[s]=swarming.alias.apply(e,t.key)})}),n.forEach(f unction(s){e[s]&&(e[s]=new Date(e[s]),e["human_"+s]=t(e[s]))}),e},parseEvents:fu nction(e){if(!e||!e.items)return[];var e=e.items;return e.forEach(function(e){e. ts&&(e.ts=new Date(e.ts),e.human_ts=t(e.ts))}),e.sort(function(t,e){return e.ts- t.ts}),e},parseTasks:function(e){if(!e||!e.items)return[];var e=e.items;return e .forEach(function(e){if(a.forEach(function(s){e[s]&&(e[s]=new Date(e[s]),e["huma n_"+s]=t(e[s]))}),e.duration)e.human_duration=this._humanDuration(e.duration);el se{var s=e.completed_ts||e.abandoned_ts||e.modified_ts||new Date;e.human_duratio n=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.starte d_ts}),e}})}()</script> </dom-module> <dom-module id="bot-page-summary" assetpat h="/res/imp/botpage/"> <template> <style include="single-page-style">.wrapper{di splay:table;margin-left:auto;margin-bottom:10px;margin-right:5px}paper-checkbox{ margin-left:5px}.thick{border-top-style:solid}</style> <url-param name="show_ful l_names" value="{{_show_full_names}}"> </url-param> <url-param name="show_all_ta sks" value="{{_show_all_tasks}}"> </url-param> <url-param name="sort_stats" valu e="{{_sortstr}}" default_value="total:desc"> </url-param> <div class="wrapper"> <table> <thead on-sort_change="_sortChange"> <tr> <th> <span>Name</span> <sort-t oggle name="full_name" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Tota l</span> <sort-toggle name="total" current="[[_sort]]"> </sort-toggle> </th> <th > <span>Success</span> <sort-toggle name="success" current="[[_sort]]"> </sort-t oggle> </th> <th> <span>Failed</span> <sort-toggle name="failed" current="[[_sor t]]"> </sort-toggle> </th> <th> <span>Died</span> <sort-toggle name="bot_died" c urrent="[[_sort]]"> </sort-toggle> </th> <th> <span>Average Duration</span> <sor t-toggle name="avg_duration" current="[[_sort]]"> </sort-toggle> </th> <th> <spa n>Total Duration</span> <sort-toggle name="total_time" current="[[_sort]]"> </so rt-toggle> </th> <th>Percent of Total</th> </tr> </thead> <tbody> <template is=" dom-repeat" items="[[_tasksToShow]]" as="task"> <tr> <td hidden$="[[_truthy(_sho w_full_names)]]" title="[[task.full_name]]">[[task.name]]</td> <td hidden$="[[_n ot(_show_full_names)]]" title="[[task.full_name]]">[[task.full_name]]</td> <td>[ [task.total]]</td> <td>[[task.success]]</td> <td>[[task.failed]]</td> <td>[[task .bot_died]]</td> <td>[[_humanDuration(task.avg_duration)]]</td> <td>[[_humanDura tion(task.total_time)]]</td> <td>[[task.total_time_percent]]%</td> </tr> </templ ate> </tbody> <tbody><tr class="thick"> <td>Total</td> <td>[[_totalStats.total]] </td> <td>[[_totalStats.success]]</td> <td>[[_totalStats.failed]]</td> <td>[[_to talStats.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 between the oldest task fetched and now."> Total Wall Time </th> <th title="How much of the wall time this bot was busy with a task."> Wall Time Utilization </th> </tr> </ thead> <tbody> <tr> <td>[[_humanDuration(_totalStats.wall_time)]]</td> <td>[[_to talStats.wall_time_utilization]]%</td> </tr> </tbody> </table> <paper-checkbox c hecked="{{_show_full_names}}"> Show Full Names </paper-checkbox> <paper-checkbox hidden$="[[_cannotExpand]]" checked="{{_show_all_tasks}}"> Show All Tasks </pap er-checkbox> </div> </div> </template> <script>!function(){var t=15;Polymer({is: "bot-page-summary",behaviors:[SwarmingBehaviors.BotPageBehavior],properties:{tas ks:{type:Array},_cannotExpand:{type:Boolean,computed:"_countTasks(_taskStats.*)" },_show_all_tasks:{type:Boolean},_show_full_names:{type:Boolean},_sortstr:{type: String},_sort:{type:Object,computed:"_makeSortObject(_sortstr)"},_taskStats:{typ e:Array},_tasksToShow:{type:Array,computed:"_sortAndLimitTasks(_taskStats.*,_sor t.*,_show_all_tasks)"},_totalStats:{type:Object}},observers:["_aggregate(tasks.* )"],_aggregate:function(){if(this.tasks&&this.tasks.length){var t=new Date(1e3*s k.now()),a={},e={total:this.tasks.length,success:0,failed:0,bot_died:0,avg_durat ion: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,failed:0,bo t_died:0,avg_duration:0,total_time:0}),a[s].total++,t.failure?(e.failed++,a[s].f ailed++):t.internal_failure?(e.bot_died++,a[s].bot_died++):(e.success++,a[s].suc cess++),e.total_time+=t.duration,a[s].total_time+=t.duration}),e.avg_duration=e. total_time/e.total,e.wall_time_utilization=(100*e.total_time/e.wall_time).toFixe d(1),this.set("_totalStats",e);var s=Object.keys(a),i=[];s.forEach(function(t){a [t].avg_duration=a[t].total_time/a[t].total,a[t].total_time_percent=(100*a[t].to tal_time/e.total_time).toFixed(1),i.push(a[t])});var o=new Substrings({minOccurr ence:Math.max(2,s.length-1),minLength:6});o.build(s);var n=o.weighByAverage()||[ ];n.length&&n[0].source.forEach(function(t){var a=i[t].full_name;i[t].name=a.rep lace(n[0].name,"...")}),this.set("_taskStats",i)}},_compare:function(t,a){if(!th is._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:function(){r eturn this._taskStats.length<=t},_makeSortObject:function(t){if(t){var a=t.split (":");return 2!=a.length?{name:"full_name",direction:"asc"}:{name:a[0],direction :a[1]}}},_sortAndLimitTasks:function(){swarming.stableSort(this._taskStats,this. _compare.bind(this));var a=this._taskStats.length;return!this._show_all_tasks&&t his._taskStats.length>t&&(a=t),this._taskStats.slice(0,a)},_sortChange:function( t){t&&t.detail&&t.detail.name&&(t.preventDefault(),t.stopPropagation(),this.set( "_sortstr",t.detail.name+":"+t.detail.direction))}})}()</script> </dom-module><d om-module id="bot-page" assetpath="/res/imp/botpage/"> <template> <style include ="iron-flex iron-flex-alignment iron-positioning swarming-app-style single-page- style task-style">.message{white-space:pre-line;font-family:monospace}.bot_state {white-space:pre;font-family:monospace;margin-bottom:10px}.events_table,.tasks_t able{border:3px solid #1F78B4}.old_version{background-color:#ffd}.stats{min-widt h:700px;flex-grow:2}#collapse{max-width:700px}.cloud{white-space:nowrap;margin-b ottom:5px;margin-top:auto}.deleted{text-align:center;font-size:larger}paper-dial og{border-radius:6px}</style> <url-param name="id" value="{{bot_id}}"> </url-par am> <url-param name="show_all_events" value="{{_show_all}}"> </url-param> <url-p aram name="selected" value="{{_selected}}"> </url-param> <url-param name="show_s tate" value="{{_show_state}}"> </url-param> <swarming-app client_id="[[client_id ]]" auth_headers="{{_auth_headers}}" permissions="{{_permissions}}" server_detai ls="{{_server_details}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2,_b usy3)]]" name="Swarming Bot Page"> <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <bot-page-dat a id="data" auth_headers="[[_auth_headers]]" bot_id="[[bot_id]]" bot="{{_bot}}" bot_exists="{{_bot_exists}}" busy="{{_busy1}}" events="{{_events}}" tasks="{{_ta sks}}" on-reload="_clearAndReload"> </bot-page-data> <div class="header horizont al layout"> <paper-input class="id_input" label="Bot id" value="{{bot_id}}"></pa per-input> <template is="dom-if" if="[[_ccLink(_bot)]]"> <div class="vertical la yout"> <a href$="[[_ccLink(_bot)]]" class="cloud">Cloud Console</a> </div> </tem plate> <button on-click="_refresh"> <iron-icon class="refresh" icon="icons:refre sh"></iron-icon> </button> </div> </div> <h2 hidden$="[[_bot_exists]]">Bot not f ound.</h2> <div hidden$="[[_not(_bot_exists)]]"> <div class="horizontal wrap lay out"> <div class="flex"> <table> <template is="dom-if" if="[[_bot.deleted]]"> <t r class="dead deleted" title="This bot was deleted."> <td colspan="3">THIS BOT W AS DELETED</td> </tr> </template> <tbody><tr class$="[[_isDead(_bot)]]" title="L ast time the bot contacted the server."> <td>Last Seen</td> <td title="[[_bot.hu man_last_seen_ts]]"> [[_timeDiffExact(_bot.last_seen_ts)]] ago</td> <td> <templa te is="dom-if" if="[[_canShutdown(_bot,_permissions)]]"> <button class="raised" on-click="_promptShutdown"> Shut Down Gracefully </button> </template> <template is="dom-if" if="[[_canDelete(_bot,_permissions)]]"> <button class="raised" on-c lick="_promptDelete"> Delete </button> </template> </td> </tr> <template is="dom -if" if="[[_bot.quarantined]]"> <tr class="quarantined"> <td>Quarantined</td> <t d colspan="2" class="message">[[_quarantineMessage(_bot)]]</td> </tr> </template > <tr> <td>Current Task</td> <td> <a target="_blank" rel="noopener" href$="[[_ta skLink(_bot.task_id)]]"> [[_task(_bot)]] </a> </td> <td> </td> </tr> <tr> <td ro wspan$="[[_numRows(_bot.dimensions)]]"> <a href$="[[_siblingBotsLink(_bot.dimens ions)]]" title="The list of bots that also matches these dimensions (except id). "> Dimensions</a> </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>E xternal IP</td> <td><a href$="[[_bot.external_ip]]">[[_bot.external_ip]]</a></td > <td></td> </tr> <tr class$="[[_classVersion(_server_details.bot_version,_bot.v ersion)]]" title="Version is based on the content of swarming_bot.zip which is t he 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 tit le="The version the server expects the bot to be using."> <td>Expected Bot Versi on</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 s een</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 server."> <td>Authenticated as</td> <td colspan="2">[[_bot.authenticated_as] ]</td> </tr> <template is="dom-if" if="[[_bot.lease_id]]"> <tr> <td>Machine Prov ider Lease ID</td> <td colspan="2"> <a href$="[[_mpLink(_bot,_server_details.mac hine_provider_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> <templat e is="dom-if" if="[[_not(_show_state)]]"> <button on-click="_toggleState"> <iron -icon icon="icons:add-circle-outline"></iron-icon> </button> </template> <templa te is="dom-if" if="[[_show_state]]"> <button on-click="_toggleState"> <iron-icon icon="icons:remove-circle-outline"></iron-icon> </button> </template> <iron-col lapse id="collapse" opened="[[_show_state]]"> <div class="bot_state">[[_prettyPr int(_bot.state)]]</div> </iron-collapse> </div> <div class="stats flex"> <bot-pa ge-summary tasks="[[_tasks]]"> </bot-page-summary> </div> </div> <div class="tab s"> <paper-tabs selected="{{_selected}}" no-bar=""> <paper-tab>Tasks</paper-tab> <paper-tab>Events</paper-tab> </paper-tabs> <template is="dom-if" if="[[_showEv ents]]"> <paper-checkbox checked="{{_show_all}}"> Show all events </paper-checkb ox> </template> </div> <template is="dom-if" if="[[_not(_showEvents)]]"> <table class="tasks_table"> <thead> <tr> <th>Task</th> <th>Started</th> <th>Duration</t h> <th>Result</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_ta sks}}" as="task"> <tr class$="[[_taskClass(task)]]"> <td> <a target="_blank" rel ="noopener" href$="[[_taskLink(task.task_id)]]"> [[task.name]] </a> </td> <td>[[ task.human_started_ts]]</td> <td title="[[task.human_completed_ts]]">[[task.huma n_duration]]</td> <td>[[task.state]]</td> </tr> </template> </tbody> </table> </ template> <template is="dom-if" if="[[_showEvents]]"> <table class="events_table "> <thead> <tr> <th>Message</th> <th>Type</th> <th>Timestamp</th> <th>Task ID</t h> <th>Version</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_e ventList(_show_all,_events.*)}}" as="event"> <tr> <td class="message">[[event.me ssage]]</td> <td>[[event.event_type]]</td> <td>[[event.human_ts]]</td> <td> <a t arget="_blank" rel="noopener" href$="[[_taskLink(event.task_id)]]"> [[event.task _id]] </a> </td> <td class$="[[_classVersion(_server_details.bot_version,event.v ersion)]]"> [[_shorten(event.version,'8')]] </td> </tr> </template> </tbody> </t able> </template> <pageable-data id="page_tasks" hidden$="[[_showEvents]]" busy= "{{_busy2}}" label="Show more tasks" output="{{_tasks}}" parse="[[_parseTasks]]" > </pageable-data> <pageable-data id="page_events" hidden$="[[_not(_showEvents)] ]" busy="{{_busy3}}" label="Show more events" output="{{_events}}" parse="[[_par seEvents]]"> </pageable-data> </div> </swarming-app> <paper-dialog id="prompt" m odal="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-butto n dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm= "">Yes</paper-button> </div> </paper-dialog> </template> <script> (function(){
889 889
890 Polymer({ 890 Polymer({
891 is: 'bot-page', 891 is: 'bot-page',
892 892
893 behaviors: [ 893 behaviors: [
894 SwarmingBehaviors.BotPageBehavior, 894 SwarmingBehaviors.BotPageBehavior,
895 ], 895 ],
896 896
897 properties: { 897 properties: {
898 bot_id: { 898 bot_id: {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 return "failed_task"; 1125 return "failed_task";
1126 } 1126 }
1127 return ""; 1127 return "";
1128 }, 1128 },
1129 1129
1130 _toggleState: function() { 1130 _toggleState: function() {
1131 this.set("_show_state", !this._show_state); 1131 this.set("_show_state", !this._show_state);
1132 } 1132 }
1133 1133
1134 }); 1134 });
1135 })(); </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:""},reloadStdout:function(){this._getJson Async("_stdout","/api/swarming/v1/task/"+this.task_id+"/stdout","_busy3",this.au th_headers)}})}()</script> </dom-module><dom-module id="task-disambiguation" ass etpath="/res/imp/taskpage/"> <template> <style include="swarming-app-style singl e-page-style task-style"></style> <table> <thead> <tr> <th>Try ID</th> <th>Bot I D</th> <th>Status</th> </tr> </thead> <tbody> <template id="result_list" is="dom -repeat" items="[[_results]]" as="result" observe="task_id bot_id state"> <tr> < td> <a href$="[[_taskLink(result.task_id,'true')]]"> [[result.task_id]] </a> </t d> <td> <a href$="[[_botLink(result.bot_id)]]"> [[result.bot_id]] </a> </td> <td class$="[[_stateClass(result)]]">[[state(result)]]</td> </tr> </template> </tbo dy> </table> </template> <script>Polymer({is:"task-disambiguation",behaviors:[Sw armingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{auth_ headers:{type:Object},summary_result:{type:Object},task_id:{type:String},busy:{t ype:Boolean,value:!1,notify:!0},_busyArr:{type:Array,value:function(){return[]}} ,_results:{type:Array,value:function(){return[]}}},observers:["_fetchRest(auth_h eaders,task_id,summary_result)","_computeBusy(_busyArr.*)"],_computeBusy:functio n(){for(var s=0;s<this._busyArr.length;s++)if(this._busyArr[s].status)return!0;r eturn!1},_fetchRest:function(s,r,t){if(s&&r&&t){var e=t.try_number;this.set("_bu syArr",[]),this.set("_results",[]);for(var u=r.substring(0,r.length-1),i="/api/s warming/v1/task/",a=0;a<e-1;a++){var n=u+(a+1);this.splice("_busyArr",a,0,{}),th is.splice("_results",a,0,{task_id:n}),this._getJsonAsyncArr(a,"_results",i+n+"/r esult","_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/taskpage/"> <templat e> <style include="iron-flex iron-flex-alignment swarming-app-style single-page- style task-style">.milo{width:calc(100% - 11px);height:2000px}.right{margin-top: 8px}.break-all{word-break:break-all}.expand{min-width:3em;vertical-align:middle; padding:.5em}.code{font-family:monospace}.stdout{white-space:pre-line;padding:2p x}.refresh_input{padding:0 5px}.reproduce{margin-left:5px}.tabbed{border:3px sol id #1F78B4;margin-left:5px;min-height:80vh;min-width:550px}.task-info{min-width: 500px}.cipd-header{-moz-user-select:none;-webkit-user-select:none;-ms-user-selec t:none;user-select:none;font-weight:700;margin-left:8px}</style> <url-param name ="id" value="{{task_id}}"> </url-param> <url-param name="try_detail" value="{{_t ry_detail}}"> </url-param> <url-param name="request_detail" value="{{_request_de tail}}"> </url-param> <url-param name="show_raw" value="{{_show_raw}}"> </url-pa ram> <url-param name="refresh" value="{{_refresh_interval}}" default_value="10"> </url-param> <swarming-app client_id="[[client_id]]" auth_headers="{{_auth_head ers}}" permissions="{{_permissions}}" profile="{{_profile}}" server_details="{{_ server_details}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,busy2)]]" name=" Swarming Task Page"> <h2 hidden$="[[_signed_in]]">You must sign in to see anythi ng useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <task-page-data id="data" a uth_headers="[[_auth_headers]]" task_id="[[task_id]]" busy="{{_busy1}}" request= "{{_request}}" result="{{_result}}" stdout="{{_stdout}}" task_exists="{{_task_ex ists}}"> </task-page-data> <div class="horizontal layout wrap"> <div class="left flex"> <div class="horizontal layout"> <paper-input class="id_input" label="Tas k id" value="{{task_id}}"></paper-input> <button on-click="_refresh"> <iron-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> </template> </ div> <h2 hidden$="[[_task_exists]]">Task not found.</h2> <template is="dom-if" i f="[[_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-disambigu ation> </template> <table class="task-info" hidden$="[[_not(_task_exists)]]"> <t body> <tr> <td>Name</td> <td>[[_request.name]]</td> </tr> <tr> <td>State</td> <t d class$="[[_stateClass(_result)]]">[[state(_result)]]</td> </tr> <tr> <td>Creat ed</td> <td title$="[[_request.created_ts]]">[[_request.human_created_ts]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp(_result)]]"> <tr> <td>Started</td > <td title$="[[_result.started_ts]]">[[_result.human_started_ts]]</td> </tr> </ template> <template is="dom-if" if="[[_wasNotPickedUp(_result)]]"> <tr> <td>Expi res</td> <td>[[_expires(_request)]]</td> </tr> </template> <template is="dom-if" if="[[_result.human_completed_ts]]"> <tr> <td>Completed</td> <td title$="[[_res ult.completed_ts]]">[[_result.human_completed_ts]]</td> </tr> </template> <templ ate is="dom-if" if="[[_result.human_abandoned_ts]]"> <tr> <td>Abandoned</td> <td title$="[[_result.abandoned_ts]]">[[_result.human_abandoned_ts]]</td> </tr> </t emplate> <tr> <td>Last Updated</td> <td title$="[[_result.modified_ts]]">[[_resu lt.human_modified_ts]]</td> </tr> <template is="dom-if" if="[[_result.deduped_fr om]]"> <tr> <td><b>Deduped from</b></td> <td> <a href$="[[_taskLink(_result.dedu ped_from)]]"> [[_result.deduped_from]] </a> </td> </tr> </template> <tr> <td>Pen ding Time</td> <td>[[_pending(_result)]]</td> </tr> <tr> <td>Duration</td> <td>[ [_result.human_duration]]</td> </tr> <tr> <td>Priority</td> <td>[[_request.prior ity]]</td> </tr> <tr> <td>User</td> <td>[[_request.user]]</td> </tr> <tr> <td>Au thenticated</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.p roperties.secret_bytes]]"> <tr> <td>Secret Bytes</td> <td>[[_request.properties. secret_bytes]]</td> </tr> </template> <template is="dom-if" if="[[_request.paren t_task_id]]"> <tr> <td>Parent Task</td> <td> <a href$="[[_taskLink(_request.pare nt_task_id)]]">[[_request.parent_task_id]]</a> </td> </tr> </template> <tr> <td rowspan$="[[_rowspan(_request.properties.dimensions)]]"> <a title="The list of b ots that matches the list of dimensions" href$="[[_botListLink(_request.properti es.dimensions)]]"> Requested Dimensions </a> </td> </tr> <template is="dom-repea t" items="{{_request.properties.dimensions}}" as="dimension"> <tr> <td><b>[[dime nsion.key]]:</b> [[_alias(dimension)]]</td> </tr> </template> <tr> <td>Isolated Inputs</td> <td> <a href$="[[_isolateLink(_request.properties.inputs_ref)]]"> [[ _request.properties.inputs_ref.isolated]] </a> </td> </tr> <template is="dom-if" if="[[_request.properties.outputs.length]]"> <tr> <td rowspan$="[[_rowspan(_req uest.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-ico n icon="icons:add-circle-outline"></iron-icon> </button> </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> </tbody> <tbody id="more_detail s" hidden$="[[!_request_detail]]"> <tr> <td>Extra Args</td> <td class="code brea k-all">[[_extraArgs(_request)]]</td> </tr> <tr> <td>Command</td> <td class="code break-all">[[_command(_request)]]</td> </tr> <tr> <td>Idempotent</td> <td>[[_re quest.properties.idempotent]]</td> </tr> <tr> <td rowspan$="[[_rowspan(_request. tags)]]">Tags</td> </tr> <template is="dom-repeat" items="{{_request.tags}}" as= "tag"> <tr> <td class="break-all">[[tag]]</td> </tr> </template> <tr> <td>Execut ion timeout</td> <td>[[_humanDuration(_request.properties.execution_timeout_secs )]]</td> </tr> <tr> <td>I/O timeout</td> <td>[[_humanDuration(_request.propertie s.io_timeout_secs)]]</td> </tr> <tr> <td>Grace period</td> <td>[[_humanDuration( _request.properties.grace_period_secs)]]</td> </tr> <tr> <td>CIPD server</td> <t d> <a href$="[[_request.properties.cipd_input.server]]"> [[_request.properties.c ipd_input.server]] </a> </td> </tr> <tr> <td>CIPD version</td> <td class="break- all">[[_request.properties.cipd_input.client_package.version]]</td> </tr> <templ ate is="dom-if" if="[[_wasPickedUp(_result)]]"> <tr> <td>CIPD package name</td> <td>[[_result.cipd_pins.client_package.package_name]]</td> </tr> </template> <tr hidden$="[[_not(_request.properties.cipd_input)]]"> <td rowspan$="[[_cipdRowspa n(_request,_result)]]">CIPD packages</td> </tr> <template is="dom-repeat" items= "[[_cipdPackages(_request,_result)]]" as="cipd"> <tr> <td>[[cipd.path]]/</td> </ tr> <tr> <td class="break-all"> <span class="cipd-header">Requested: </span>[[ci pd.requested]] </td> </tr> <tr hidden$="[[!_hasActualCIPDPackages(_result)]]"> < td class="break-all"> <span class="cipd-header">Actual: </span>[[cipd.actual]] < /td> </tr> </template> <tr hidden$="[[_empty(_request.properties.caches)]]"> <td rowspan$="[[_rowspan(_request.properties.caches)]]">Named caches</td> </tr> <te mplate is="dom-repeat" items="[[_request.properties.caches]]" as="cache"> <tr> < td><span>[[cache.name]]</span>:<span>[[cache.path]]</span></td> </tr> </template > </tbody> </table> <div class="title" hidden$="[[_not(_task_exists)]]">Task Exe cution</div> <template is="dom-if" if="[[_wasPickedUp(_result)]]"> <table hidden $="[[_not(_task_exists)]]"> <tbody><tr> <td>Bot assigned to task</td> <td><a hre f$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]]</a></td> </tr> <tr> <td row span$="[[_rowspan(_result.bot_dimensions)]]"> <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>[[_result.exit_code]]</td> </tr> <tr> <td>Try number</t d> <td>[[_result.try_number]]</td> </tr> <tr> <td>Failure</td> <td class$="[[_fa ilureClass(_result.failure)]]">[[_result.failure]]</td> </tr> <tr> <td>Internal Failure</td> <td class$="[[_internalClass(_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>[[_result.server_versions]]</td> </tr> </tbody></table> </template> <template is="dom-if" if="[[_wasNotPickedUp(_result)]]"> This space left blank until a bot is assigned to the task. </template> <template is="dom-i f" if="[[_result.performance_stats]]"> <div class="title">Performance Stats</div > <table> <tbody><tr> <td title="This includes time taken to download inputs, is olate outputs, and setup CIPD">Total Overhead</td> <td>[[_humanDuration(_result. performance_stats.bot_overhead)]]</td> </tr> <tr> <td>Downloading Inputs From Is olate</td> <td>[[_humanDuration(_result.performance_stats.isolated_download.dura tion)]]</td> </tr> <tr> <td>Uploading Outputs To Isolate</td> <td>[[_humanDurati on(_result.performance_stats.isolated_upload.duration)]]</td> </tr> <tr hidden$= "[[!_result.performance_stats.isolated_download.initial_size]]"> <td>Initial bot cache</td> <td>[[_result.performance_stats.isolated_download.initial_number_ite ms]] items; [[_bytes(_result.performance_stats.isolated_download.initial_size)]] </td> </tr> </tbody></table> </template> <div hidden$="[[_not(_task_exists)]]"> <div class="title">Reproducing the task locally</div> <div class="reproduce"> <d iv>Download inputs files into directory <i>foo</i>:</div> <div class="code"> pyt hon isolateserver.py download -I [[_request.properties.inputs_ref.isolatedserver ]] --namespace [[_request.properties.inputs_ref.namespace]] -s [[_request.proper ties.inputs_ref.isolated]] --target foo</div> <br> <div>Run this task locally:</ div> <div class="code"> python swarming.py reproduce -S [[_host_url]] [[task_id] ]</div> <br> <div>Download output results into directory <i>foo</i>:</div> <div class="code"> python swarming.py collect -S [[_host_url]] --task-output-dir=foo [[task_id]]</div> <br> <div>Looking for <i>swarming.py</i>?</div> <div class="co de"> git clone https://github.com/luci/client-py</div> </div> </div> </div> <div class="flex right" hidden$="[[_not(_task_exists)]]"> <div class="horizontal lay out"> <div class="tabs"> <paper-tabs selected="{{_show_raw}}" no-bar=""> <paper- tab disabled$="[[_noMilo(_request)]]">Milo Output</paper-tab> <paper-tab>Raw Out put</paper-tab> </paper-tabs> </div> <paper-input class="refresh_input" label="R efresh Interval (seconds)" value="{{_refresh_interval}}" title="How often to ref resh all information about the task" auto-validate="" min="1" max="1000" pattern ="[0-9]+"> </paper-input> </div> <template is="dom-if" if="[[_supportsMilo(_requ est,_show_raw)]]"> <div class="milo tabbed" hidden$="[[_isSummaryLink(task_id)]] "> Milo results are only generated for task summaires, that is, tasks whose ids end in 0. Tasks ending in 1 or 2 represent possible retries of tasks. See <a hre f="//goo.gl/LE4rwV">the docs</a> for more. </div> <iframe id="miloFrame" class=" milo tabbed" src$="[[_getDisplayServerLink(_server_details.display_server_url_te mplate,task_id)]]"></iframe> </template> <template is="dom-if" if="[[_show_raw]] "> <div class="code stdout tabbed break-all">[[_rawOutput(_stdout,_result)]]</di v> </template> </div> </div> </div> </swarming-app> <paper-dialog id="prompt" mo dal="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are y ou sure you want to [[_dialog_prompt]]?</div> <div class="buttons"> <paper-butto n dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm= "">Yes</paper-button> </div> </paper-dialog> <interval-timer period="[[_refresh_ interval]]" on-trigger="_softRefresh"> </interval-timer> </template> <script>!fu nction(){Polymer({is:"task-page",behaviors:[SwarmingBehaviors.CommonBehavior,Swa rmingBehaviors.TaskBehavior],properties:{task_id:{type:String},client_id:{type:S tring},_dialog_prompt:{type:String,value:""},_host_url:{type:String,value:functi on(){return window.location.hostname}},_refresh_interval:{type:Number},_request: {type:Object,observer:"_requestUpdated"},_request_detail:{type:Boolean},_result: {type:Object},_server_details:{type:Object},_stdout:{type:String}},_alias:functi on(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(" | ")},_byt es: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.cipd_input)return 0;var i=(t.properties.cipd_input.packages||[]).le ngth;return i*=this._hasActualCIPDPackages(e)?3:2,i+1},_cipdPackages:function(t, e){if(!t||!t.properties||!t.properties.cipd_input)return[];var i=t.properties.ci pd_input.packages||[],s=e&&e.cipd_pins&&e.cipd_pins.packages||[];return i.forEac h(function(t){t.requested=t.package_name+":"+t.version,s.forEach(function(e){e.p ath===t.path&&(t.actual=e.package_name+":"+e.version)})}),i},_command:function(t ){if(!t||!t.properties)return"";var e=t.properties.command||[];return e.join(" " )},_disambiguate:function(t,e){return!(!t.endsWith("0")||!e)&&e.try_number>1},_e mpty:function(t){return!t||0==t.length},_expires:function(t){var e=parseInt(t.ex piration_secs);return e?sk.human.localeTime(new Date(t.created_ts.getTime()+1e3* e)):t.expiration_secs+" seconds from created time"},_extraArgs:function(t){if(!t ||!t.properties)return"";var e=t.properties.extra_args||[];return e.join(" ")},_ failureClass:function(t){return t?"failed_task":""},_getDisplayServerLink:functi on(t,e){if(t)return t.replace("%s",e)},_hasActualCIPDPackages:function(t){return t&&t.cipd_pins&&t.cipd_pins.packages},_internalClass:function(t){return t?"exce ption":""},_isolateLink:function(t){if(t&&t.isolatedserver)return t.isolatedserv er+"/browse?namespace="+t.namespace+"&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.abandone d_ts||new Date;return e<=t.created_ts?"0s":this._timeDiffExact(t.created_ts,e)}, _promptClosed:function(t){t.detail.confirmed&&(this._dialog_prompt.startsWith("c ancel")?this._cancelTask():this._retryTask())},_promptCancel:function(){this.set ("_dialog_prompt","cancel task "+this.task_id),this.$.prompt.open()},_promptRetr y:function(){this.set("_dialog_prompt","retry task "+this.task_id),this.$.prompt .open()},_rawOutput:function(t,e){return t?t:"PENDING"===e.state||"RUNNING"===e. state?"[No output yet]":"[No output received]"},_refresh:function(){this.$.data. reload()},_requestUpdated:function(t){this._noMilo(t)&&this.set("_show_raw",1)}, _softRefresh:function(){if(!this._result||"RUNNING"===this._result.state||"PENDI NG"===this._result.state){this.$.data.reload();var t=this.$$("iframe");t&&(t.src =this._getDisplayServerLink(this._server_details.display_server_url_template,thi s.task_id))}},_retryTask:function(){if(!this._request)return void sk.errorMessag e("Task not yet loaded",3e3);var t={expiration_secs:this._request.expiration_sec s,name:this._request.name+" (retry)",parent_task_id:this._request.parent_task_id ,priority:this._request.priority,properties:this._request.properties,tags:this._ request.tags,user:this._profile.email,service_account:this._request.service_acco unt};t.properties.idempotent=!1,swarming.postWithToast("/api/swarming/v1/tasks/n ew","Retrying task "+this.task_id,this._auth_headers,t).then(function(t){if(t=JS ON.parse(t),t&&t.task_id){var e={id:this.task_id};history.pushState(e,"Task Page "),this.set("task_id",t.task_id)}}.bind(this),function(t){console.log("Task coul d not be retried",t)})},_rowspan:function(t){return t=t||[],t.length+1},_support sMilo:function(t,e){return!e&&t&&this._tag(t,"allow_milo")},_toggleDetails:funct ion(){this.set("_request_detail",!this._request_detail)},_tag:function(t,e){if(t &&t.tagMap)return t.tagMap[e]},_wasPickedUp:function(t){return t&&t.state!==this .PENDING&&t.state!==this.CANCELED&&t.state!=this.EXPIRED},_wasNotPickedUp:functi on(t){return t&&!this._wasPickedUp(t)}})}()</script> </dom-module> </div></body> </html> 1135 })(); </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:""},reloadStdout:function(){this._getJson Async("_stdout","/api/swarming/v1/task/"+this.task_id+"/stdout","_busy3",this.au th_headers)}})}()</script> </dom-module><dom-module id="task-disambiguation" ass etpath="/res/imp/taskpage/"> <template> <style include="swarming-app-style singl e-page-style task-style"></style> <table> <thead> <tr> <th>Try ID</th> <th>Bot I D</th> <th>Status</th> </tr> </thead> <tbody> <template id="result_list" is="dom -repeat" items="[[_results]]" as="result" observe="task_id bot_id state"> <tr> < td> <a href$="[[_taskLink(result.task_id,'true')]]"> [[result.task_id]] </a> </t d> <td> <a href$="[[_botLink(result.bot_id)]]"> [[result.bot_id]] </a> </td> <td class$="[[_stateClass(result)]]">[[state(result)]]</td> </tr> </template> </tbo dy> </table> </template> <script>Polymer({is:"task-disambiguation",behaviors:[Sw armingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{auth_ headers:{type:Object},summary_result:{type:Object},task_id:{type:String},busy:{t ype:Boolean,value:!1,notify:!0},_busyArr:{type:Array,value:function(){return[]}} ,_results:{type:Array,value:function(){return[]}}},observers:["_fetchRest(auth_h eaders,task_id,summary_result)","_computeBusy(_busyArr.*)"],_computeBusy:functio n(){for(var s=0;s<this._busyArr.length;s++)if(this._busyArr[s].status)return!0;r eturn!1},_fetchRest:function(s,r,t){if(s&&r&&t){var e=t.try_number;this.set("_bu syArr",[]),this.set("_results",[]);for(var u=r.substring(0,r.length-1),i="/api/s warming/v1/task/",a=0;a<e-1;a++){var n=u+(a+1);this.splice("_busyArr",a,0,{}),th is.splice("_results",a,0,{task_id:n}),this._getJsonAsyncArr(a,"_results",i+n+"/r esult","_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/taskpage/"> <templat e> <style include="iron-flex iron-flex-alignment swarming-app-style single-page- style task-style">.milo{width:calc(100% - 11px);height:2000px}.right{margin-top: 8px}.break-all{word-break:break-all}.expand{min-width:3em;vertical-align:middle; padding:.5em}.code{font-family:monospace}.stdout{white-space:pre-wrap;padding:2p x}.stdout.wide{white-space:pre;overflow-x:auto}.refresh_input{padding:0 5px}.rep roduce{margin-left:5px}.tabbed{border:3px solid #1F78B4;margin-left:5px;min-heig ht:80vh;min-width:550px}.task-info{min-width:500px}.cipd-header{-moz-user-select :none;-webkit-user-select:none;-ms-user-select:none;user-select:none;font-weight :700;margin-left:8px}.full-width{min-width:100%}.full-width-container{position:r elative}.full-width-container>paper-checkbox{position:absolute;bottom:10px;width :140px;left:5px}</style> <url-param name="id" value="{{task_id}}"> </url-param> <url-param name="try_detail" value="{{_try_detail}}"> </url-param> <url-param na me="request_detail" value="{{_request_detail}}"> </url-param> <url-param name="s how_raw" value="{{_show_raw}}"> </url-param> <url-param name="wide_logs" value=" {{_wide_logs}}"> </url-param> <url-param name="refresh" value="{{_refresh_interv al}}" default_value="10"> </url-param> <swarming-app client_id="[[client_id]]" a uth_headers="{{_auth_headers}}" permissions="{{_permissions}}" profile="{{_profi le}}" server_details="{{_server_details}}" signed_in="{{_signed_in}}" busy="[[_o r(_busy1,busy2)]]" name="Swarming Task Page"> <h2 hidden$="[[_signed_in]]">You m ust sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <t ask-page-data id="data" auth_headers="[[_auth_headers]]" task_id="[[task_id]]" b usy="{{_busy1}}" request="{{_request}}" result="{{_result}}" stdout="{{_stdout}} " task_exists="{{_task_exists}}"> </task-page-data> <div class="horizontal layou t wrap"> <div class="left flex"> <div class="horizontal layout"> <paper-input cl ass="id_input" label="Task id" value="{{task_id}}"></paper-input> <button on-cli ck="_refresh"> <iron-icon class="refresh" icon="icons:refresh"></iron-icon> </bu tton> <button on-click="_promptRetry">Retry</button> <template is="dom-if" if="[ [_canCancelTask(_result,_permissions)]]"> <button on-click="_promptCancel">Cance l</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="[[_re sult]]"> </task-disambiguation> </template> <table class="task-info" hidden$="[[ _not(_task_exists)]]"> <tbody> <tr> <td>Name</td> <td>[[_request.name]]</td> </t r> <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="[[_wasPickedUp(_result) ]]"> <tr> <td>Started</td> <td title$="[[_result.started_ts]]">[[_result.human_s tarted_ts]]</td> </tr> </template> <template is="dom-if" if="[[_wasNotPickedUp(_ result)]]"> <tr> <td>Expires</td> <td>[[_expires(_request)]]</td> </tr> </templa te> <template is="dom-if" if="[[_result.human_completed_ts]]"> <tr> <td>Complete d</td> <td title$="[[_result.completed_ts]]">[[_result.human_completed_ts]]</td> </tr> </template> <template is="dom-if" if="[[_result.human_abandoned_ts]]"> <t r> <td>Abandoned</td> <td title$="[[_result.abandoned_ts]]">[[_result.human_aban doned_ts]]</td> </tr> </template> <tr> <td>Last Updated</td> <td title$="[[_resu lt.modified_ts]]">[[_result.human_modified_ts]]</td> </tr> <template is="dom-if" if="[[_result.deduped_from]]"> <tr> <td><b>Deduped from</b></td> <td> <a href$= "[[_taskLink(_result.deduped_from)]]"> [[_result.deduped_from]] </a> </td> </tr> </template> <tr> <td>Pending Time</td> <td>[[_pending(_result)]]</td> </tr> <tr > <td>Duration</td> <td>[[_result.human_duration]]</td> </tr> <tr> <td>Priority< /td> <td>[[_request.priority]]</td> </tr> <tr> <td>User</td> <td>[[_request.user ]]</td> </tr> <tr> <td>Authenticated</td> <td>[[_request.authenticated]]</td> </ tr> <template is="dom-if" if="[[_request.service_account]]"> <tr> <td>Service Ac count</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$="[[_botL istLink(_request.properties.dimensions)]]"> Requested Dimensions </a> </td> </tr > <template is="dom-repeat" items="{{_request.properties.dimensions}}" as="dimen sion"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</td> </tr> </tem plate> <tr> <td>Isolated Inputs</td> <td> <a href$="[[_isolateLink(_request.prop erties.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> </button > </td> </tr> </template> <template is="dom-if" if="[[_request_detail]]"> <tr> < td>Hide Details</td> <td> <button on-click="_toggleDetails"> <iron-icon icon="ic ons:remove-circle-outline"></iron-icon> </button> </td> </tr> </template> </tbod y> <tbody id="more_details" hidden$="[[!_request_detail]]"> <tr> <td>Extra Args< /td> <td class="code break-all">[[_extraArgs(_request)]]</td> </tr> <tr> <td>Com mand</td> <td class="code break-all">[[_command(_request)]]</td> </tr> <tr> <td> Idempotent</td> <td>[[_request.properties.idempotent]]</td> </tr> <tr> <td rowsp an$="[[_rowspan(_request.tags)]]">Tags</td> </tr> <template is="dom-repeat" item s="{{_request.tags}}" as="tag"> <tr> <td class="break-all">[[tag]]</td> </tr> </ template> <tr> <td>Execution timeout</td> <td>[[_humanDuration(_request.properti es.execution_timeout_secs)]]</td> </tr> <tr> <td>I/O timeout</td> <td>[[_humanDu ration(_request.properties.io_timeout_secs)]]</td> </tr> <tr> <td>Grace period</ td> <td>[[_humanDuration(_request.properties.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 versi on</td> <td class="break-all">[[_request.properties.cipd_input.client_package.ve rsion]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp(_result)]]"> <tr> <t d>CIPD package name</td> <td>[[_result.cipd_pins.client_package.package_name]]</ td> </tr> </template> <tr hidden$="[[_not(_request.properties.cipd_input)]]"> <t d rowspan$="[[_cipdRowspan(_request,_result)]]">CIPD packages</td> </tr> <templa te is="dom-repeat" items="[[_cipdPackages(_request,_result)]]" as="cipd"> <tr> < td>[[cipd.path]]/</td> </tr> <tr> <td class="break-all"> <span class="cipd-heade r">Requested: </span>[[cipd.requested]] </td> </tr> <tr hidden$="[[!_hasActualCI PDPackages(_result)]]"> <td class="break-all"> <span class="cipd-header">Actual: </span>[[cipd.actual]] </td> </tr> </template> <tr hidden$="[[_empty(_request.p roperties.caches)]]"> <td rowspan$="[[_rowspan(_request.properties.caches)]]">Na med caches</td> </tr> <template is="dom-repeat" items="[[_request.properties.cac hes]]" as="cache"> <tr> <td><span>[[cache.name]]</span>:<span>[[cache.path]]</sp an></td> </tr> </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)]]"> <tbody><tr> <td>Bot assigne d to task</td> <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]]</a ></td> </tr> <tr> <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> <a>Bot Di mensions</a> </td> </tr> <template is="dom-repeat" items="[[_result.bot_dimensio ns]]" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</ td> </tr> </template> <tr> <td>Exit code</td> <td>[[_result.exit_code]]</td> </t r> <tr> <td>Try number</td> <td>[[_result.try_number]]</td> </tr> <tr> <td>Failu re</td> <td class$="[[_failureClass(_result.failure)]]">[[_result.failure]]</td> </tr> <tr> <td>Internal Failure</td> <td class$="[[_internalClass(_result.inter nal_failure)]]">[[_result.internal_failure]]</td> </tr> <tr> <td>Isolated Output s</td> <td> <a href$="[[_isolateLink(_result.outputs_ref)]]"> [[_result.outputs_ ref.isolated]] </a> </td> </tr> <tr> <td>Bot version</td> <td>[[_result.bot_vers ion]]</td> </tr> <tr> <td>Server version</td> <td>[[_result.server_versions]]</t d> </tr> </tbody></table> </template> <template is="dom-if" if="[[_wasNotPickedU p(_result)]]"> This space left blank until a bot is assigned to the task. </temp late> <template is="dom-if" if="[[_result.performance_stats]]"> <div class="titl e">Performance Stats</div> <table> <tbody><tr> <td title="This includes time tak en to download inputs, isolate outputs, and setup CIPD">Total Overhead</td> <td> [[_humanDuration(_result.performance_stats.bot_overhead)]]</td> </tr> <tr> <td>D ownloading Inputs From Isolate</td> <td>[[_humanDuration(_result.performance_sta ts.isolated_download.duration)]]</td> </tr> <tr> <td>Uploading Outputs To Isolat e</td> <td>[[_humanDuration(_result.performance_stats.isolated_upload.duration)] ]</td> </tr> <tr hidden$="[[!_result.performance_stats.isolated_download.initial _size]]"> <td>Initial bot cache</td> <td>[[_result.performance_stats.isolated_do wnload.initial_number_items]] items; [[_bytes(_result.performance_stats.isolated _download.initial_size)]]</td> </tr> </tbody></table> </template> <div hidden$=" [[_not(_task_exists)]]"> <div class="title">Reproducing the task locally</div> < div class="reproduce"> <div>Download inputs files into directory <i>foo</i>:</di v> <div class="code"> python isolateserver.py download -I [[_request.properties. inputs_ref.isolatedserver]] --namespace [[_request.properties.inputs_ref.namespa ce]] -s [[_request.properties.inputs_ref.isolated]] --target foo</div> <br> <div >Run this task locally:</div> <div class="code"> python swarming.py reproduce -S [[_host_url]] [[task_id]]</div> <br> <div>Download output results into director y <i>foo</i>:</div> <div class="code"> python swarming.py collect -S [[_host_url ]] --task-output-dir=foo [[task_id]]</div> <br> <div>Looking for <i>swarming.py< /i>?</div> <div class="code"> git clone https://github.com/luci/client-py</div> </div> </div> </div> <div class$="flex right [[_classRight(_wide_logs)]]" 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> <paper-tab>Raw Output</paper-tab> </paper-ta bs> </div> <paper-input class="refresh_input" label="Refresh Interval (seconds)" value="{{_refresh_interval}}" title="How often to refresh all information about the task" auto-validate="" min="1" max="1000" pattern="[0-9]+"> </paper-input> <div class="full-width-container"> <paper-checkbox checked="{{_wide_logs}}"> Ful l Width Logs </paper-checkbox> </div> </div> <template is="dom-if" if="[[_suppor tsMilo(_request,_show_raw)]]"> <div class="milo tabbed" hidden$="[[_isSummaryLin k(task_id)]]"> Milo results are only generated for task summaires, that is, task s 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="miloFr ame" class="milo tabbed" src$="[[_getDisplayServerLink(_server_details.display_s erver_url_template,task_id)]]"></iframe> </template> <template is="dom-if" if="[ [_show_raw]]"> <div class$="code stdout tabbed break-all [[_classStdout(_wide_lo gs)]]">[[_rawOutput(_stdout,_result)]]</div> </template> </div> </div> </div> </ swarming-app> <paper-dialog id="prompt" modal="" on-iron-overlay-closed="_prompt Closed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialog_prompt]] ?</div> <div class="buttons"> <paper-button dialog-dismiss="" autofocus="">No</p aper-button> <paper-button dialog-confirm="">Yes</paper-button> </div> </paper-d ialog> <interval-timer period="[[_refresh_interval]]" on-trigger="_softRefresh"> </interval-timer> </template> <script>!function(){Polymer({is:"task-page",behav iors:[SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],propertie s:{task_id:{type:String},client_id:{type:String},_dialog_prompt:{type:String,val ue:""},_host_url:{type:String,value:function(){return window.location.hostname}} ,_refresh_interval:{type:Number},_request:{type:Object,observer:"_requestUpdated "},_request_detail:{type:Boolean},_result:{type:Object},_server_details:{type:Ob ject},_stdout:{type:String}},_alias:function(t){var e=t.value;return Array.isArr ay(e)||(e=[e]),swarming.alias.has(t.key)&&e.forEach(function(i,s){e[s]=swarming. alias.apply(i,t.key)}),e.join(" | ")},_bytes:function(t){return sk.human.bytes(t )},_canCancelTask:function(t,e){return t&&"PENDING"===t.state&&e.cancel_task},_c ancelTask:function(){var t="/api/swarming/v1/task/"+this.task_id+"/cancel";swarm ing.postWithToast(t,"Canceling task "+this.task_id,this._auth_headers)},_cipdRow span:function(t,e){if(!t||!t.properties||!t.properties.cipd_input)return 0;var i =(t.properties.cipd_input.packages||[]).length;return i*=this._hasActualCIPDPack ages(e)?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.cipd_pins.packages||[];return i.forEach(function(t){t.requested=t.package_na me+":"+t.version,s.forEach(function(e){e.path===t.path&&(t.actual=e.package_name +":"+e.version)})}),i},_classRight:function(t){return t?"full-width":""},_classS tdout:function(t){return t?"wide":""},_command:function(t){if(!t||!t.properties) return"";var e=t.properties.command||[];return e.join(" ")},_disambiguate:functi on(t,e){return!(!t.endsWith("0")||!e)&&e.try_number>1},_empty:function(t){return !t||0==t.length},_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+" seconds from created time"},_extraArgs:function(t){if(!t||!t.properties)return" ";var e=t.properties.extra_args||[];return e.join(" ")},_failureClass:function(t ){return t?"failed_task":""},_getDisplayServerLink:function(t,e){if(t)return t.r eplace("%s",e)},_hasActualCIPDPackages:function(t){return t&&t.cipd_pins&&t.cipd _pins.packages},_internalClass:function(t){return t?"exception":""},_isolateLink :function(t){if(t&&t.isolatedserver)return t.isolatedserver+"/browse?namespace=" +t.namespace+"&hash="+t.isolated},_isSummaryLink:function(t){return t&&t.endsWit h(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._dialog_prompt.startsWith("cancel")?this._cancelTas k():this._retryTask())},_promptCancel:function(){this.set("_dialog_prompt","canc el task "+this.task_id),this.$.prompt.open()},_promptRetry:function(){this.set(" _dialog_prompt","retry task "+this.task_id),this.$.prompt.open()},_rawOutput:fun ction(t,e){return t?t:"PENDING"===e.state||"RUNNING"===e.state?"[No output yet]" :"[No output received]"},_refresh:function(){this.$.data.reload()},_requestUpdat ed:function(t){this._noMilo(t)&&this.set("_show_raw",1)},_softRefresh:function() {if(!this._result||"RUNNING"===this._result.state||"PENDING"===this._result.stat e){this.$.data.reload();var t=this.$$("iframe");t&&(t.src=this._getDisplayServer Link(this._server_details.display_server_url_template,this.task_id))}},_retryTas k:function(){if(!this._request)return void sk.errorMessage("Task not yet loaded" ,3e3);var t={expiration_secs:this._request.expiration_secs,name:this._request.na me+" (retry)",parent_task_id:this._request.parent_task_id,priority:this._request .priority,properties:this._request.properties,tags:this._request.tags,user:this. _profile.email,service_account:this._request.service_account};t.properties.idemp otent=!1,swarming.postWithToast("/api/swarming/v1/tasks/new","Retrying task "+th is.task_id,this._auth_headers,t).then(function(t){if(t=JSON.parse(t),t&&t.task_i d){var e={id:this.task_id};history.pushState(e,"Task Page"),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},_supportsMilo:function(t,e){ret urn!e&&t&&this._tag(t,"allow_milo")},_toggleDetails:function(){this.set("_reques t_detail",!this._request_detail)},_tag:function(t,e){if(t&&t.tagMap)return t.tag Map[e]},_wasPickedUp:function(t){return t&&t.state!==this.PENDING&&t.state!==thi s.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/botpage/bot-page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698